* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
}

.history-header {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.history-header h2 { font-size: 20px; }
.back-btn {
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.back-btn:hover { background: rgba(255,255,255,0.3); }

.lottery-tabs {
    display: flex;
    background: #fff;
    border-bottom: 2px solid #eee;
}
.lottery-tab {
    flex: 1;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: #fff;
    font-size: 15px;
    font-weight: bold;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}
.lottery-tab.active {
    color: #2ecc71;
    border-bottom-color: #2ecc71;
}
.lottery-tab:hover:not(.active) { color: #333; }

.year-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.year-tab {
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #f9f9f9;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}
.year-tab.active {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
}
.year-tab:hover:not(.active) {
    border-color: #2ecc71;
    color: #2ecc71;
}

.history-list {
    padding: 15px;
}

.history-empty {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 16px;
}

.history-card {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}
.history-period {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}
.history-period span {
    color: #e74c3c;
}
.history-time {
    font-size: 13px;
    color: #999;
}

.history-balls {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(2px, 1.5vw, 10px);
    padding: 14px 8px;
    flex-wrap: nowrap;
}

.h-ball-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.h-ball-wrap {
    width: clamp(30px, 8vw, 50px);
    height: clamp(30px, 8vw, 50px);
    position: relative;
}

.h-ball-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.h-ball-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(14px, 3.5vw, 20px);
    font-weight: 900;
    font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
    color: #000;
    z-index: 2;
}

.h-ball-info {
    font-size: clamp(8px, 2vw, 12px);
    color: #666;
    font-weight: bold;
    white-space: nowrap;
}

.h-separator {
    font-size: clamp(14px, 3.5vw, 22px);
    font-weight: bold;
    color: #333;
    padding-top: 8px;
    align-self: flex-start;
}

.total-count {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* 手机端 */
@media (max-width: 768px) {
    body { padding: 0; }
    .history-header {
        padding: 12px 14px;
    }
    .history-header h2 { font-size: 16px; }
    .back-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
    .lottery-tab {
        padding: 10px 6px;
        font-size: 12px;
    }
    .history-list {
        padding: 10px;
    }
    .history-card-header {
        padding: 10px 12px;
    }
    .history-period { font-size: 14px; }
    .history-time { font-size: 12px; }
    .history-balls {
        gap: 3px;
        padding: 10px 5px;
    }
}
