/* 
  History Page Styles 
  Vertical layout, clean card list (Timeline removed per user request).
*/

:root {
    --header-bg: #e0f2fe;
    --card-bg: #ffffff;
    --text-title: #0f172a;
    --text-body: #475569;
    --text-meta: #64748b;
    --highlight: #3b82f6;
}

/* Base Container */
.history-shell {
    padding-bottom: 60px;
}

/* 1. Top Achievement Banner */
.achievement-banner {
    position: relative;
    background: white;
    border-radius: 16px;
    border: 1px solid #e6edf7;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

.banner-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    background: url('/static/assets/history-header-bg.png') no-repeat right center;
    background-size: cover;
    opacity: 0.15;
    mask-image: linear-gradient(to right, transparent, black);
    -webkit-mask-image: linear-gradient(to right, transparent, black);
    pointer-events: none;
}

.banner-content {
    position: relative;
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    padding: 32px;
    gap: 32px;
    z-index: 2;
}

/* 左侧总分大数字 */
.total-score-block {
    text-align: center;
    position: relative;
}

.score-circle {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 4px solid white;
    box-shadow: 0 0 0 1px #dbeafe, 0 10px 20px -5px rgba(59, 130, 246, 0.15);
}

.score-label {
    font-size: 13px;
    color: var(--text-meta);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.score-value {
    font-size: 48px;
    font-weight: 800;
    color: #1e40af;
    line-height: 1;
}

.score-sub {
    font-size: 12px;
    color: var(--text-meta);
    margin-top: 4px;
}

/* 右侧详细数据网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 24px;
    border-left: 3px solid #f1f5f9;
}

.stat-item:first-child {
    border-color: #3b82f6;
}

.stat-item:nth-child(2) {
    border-color: #10b981;
}

.stat-item:nth-child(3) {
    border-color: #f59e0b;
}

.stat-k {
    font-size: 13px;
    color: var(--text-meta);
    font-weight: 500;
}

.stat-v {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-title);
    font-feature-settings: "tnum";
}

/* 2. List Layout (Clean Vertical Stack) */
.timeline-section {
    display: grid;
    gap: 24px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    /* 减少下边距，因为卡片有上边距或gap */
}

.timeline-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-title);
}

.recent-list {
    display: grid;
    gap: 16px;
    /* 卡片间距 */
}

/* 单个列表项 */
.timeline-item {
    /* 移除Grid布局，直接作为卡片容器 */
    display: block;
    animation: slide-up 0.4s ease-out both;
    animation-delay: var(--delay, 0s);
}

/* 卡片内容主体 */
.record-card {
    background: white;
    border: 1px solid #e6edf7;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 20px;
    align-items: center;
}

.record-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.record-thumb {
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border-radius: 8px;
    object-fit: contain;
    padding: 12px;
    border: 1px solid #f1f5f9;
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.record-date {
    font-size: 13px;
    color: var(--text-meta);
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-title);
    margin: 0;
    line-height: 1.3;
}

.record-badges {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text-meta);
    font-weight: 500;
}

.badge.score-A {
    background: #dcfce7;
    color: #166534;
}

.badge.score-B {
    background: #dbeafe;
    color: #1e40af;
}

.badge.score-C {
    background: #fef9c3;
    color: #854d0e;
}

/* 右侧操作区 */
.record-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    min-width: 120px;
}

.mini-score {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-title);
    line-height: 1;
}

.mini-score small {
    font-size: 14px;
    color: var(--text-meta);
    font-weight: normal;
}

.action-row {
    display: flex;
    gap: 8px;
}

.recording-panel {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.recording-panel[hidden] {
    display: none !important;
}

.recording-list {
    display: grid;
    gap: 10px;
}

.recording-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: grid;
    gap: 8px;
}

.recording-title {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}

.recording-item audio {
    width: 100%;
}

/* 空状态 */
.empty-state {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: var(--text-meta);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .banner-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-item {
        padding-left: 0;
        border-left: none;
        border-bottom: 2px solid #f1f5f9;
        padding-bottom: 8px;
        align-items: center;
    }

    .record-card {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }

    .record-thumb {
        margin: 0 auto;
        width: 60px;
        height: 60px;
    }

    .record-actions {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        border-top: 1px solid #f1f5f9;
        padding-top: 12px;
    }
}
