/* === 设计系统 === */
        :root {
            --brand: #5c6bc0;
            --brand-deep: #3949ab;
            --brand-light: #e8eaf6;
            --accent: #7e57c2;
            --bg: #f4f5f9;
            --surface: #ffffff;
            --surface-2: #f8f9fc;
            --border: #e2e4ec;
            --text-primary: #1a1d2e;
            --text-secondary: #6b7280;
            --text-muted: #9ca3af;
            --success: #10b981;
            --success-bg: #ecfdf5;
            --success-text: #065f46;
            --danger: #ef4444;
            --danger-bg: #fef2f2;
            --danger-text: #991b1b;
            --warning-bg: #fffbeb;
            --warning-text: #92400e;
            --info-bg: #eff6ff;
            --info-text: #1e40af;
            --radius-sm: 8px;
            --radius: 14px;
            --radius-lg: 20px;
            --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
            --shadow: 0 4px 16px rgba(92,107,192,.10), 0 1px 4px rgba(0,0,0,.06);
            --shadow-lg: 0 12px 40px rgba(92,107,192,.14), 0 2px 8px rgba(0,0,0,.06);
            --transition: 0.18s ease;
        }

        /* === 基础重置 === */
        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei',
                         system-ui, -apple-system, sans-serif;
            background: var(--bg);
            min-height: 100vh;
            padding: 24px 16px;
            color: var(--text-primary);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
        }
        .container { width: min(100%, 1180px); margin: 0 auto; }
        body.teacher-writing-wide .container { width: min(100%, 1680px); }
        #tabWriting { margin: 0 -8px; }
        #writingReportsIframe { min-height: calc(100vh - 160px); }

        /* === 品牌标题 === */
        .brand-mark { text-align: center; margin-bottom: 18px; }
        .brand-logo-img {
            height: 50px;
            width: auto;
            display: block;
            margin: 0 auto;
        }
        .brand-tagline {
            margin-top: 8px;
            font-size: .82rem;
            color: var(--text-muted);
            letter-spacing: .04em;
        }

        /* === 后台页眉 logo === */
        .admin-header-logo {
            height: 28px;
            width: auto;
            vertical-align: middle;
            margin-right: 8px;
        }

        /* === 登录卡片 === */
        body.auth-view { display: flex; align-items: center; justify-content: center; }
        body.auth-view .container { width: 100%; }
        .auth-card {
            max-width: 400px;
            margin: 0 auto;
            position: relative;
            padding-top: 32px;
        }
        .auth-card::before {
            content: '';
            display: block;
            width: 48px;
            height: 4px;
            border-radius: 999px;
            margin: 0 auto 24px;
            background: linear-gradient(90deg, var(--brand), var(--accent));
        }
        .btn-block { width: 100%; justify-content: center; }
        .auth-footer {
            text-align: center;
            margin-top: 20px;
            padding-top: 16px;
            border-top: 1px solid var(--border);
        }
        .teacher-entry-link {
            color: var(--text-muted);
            font-size: .85rem;
            text-decoration: none;
            letter-spacing: .02em;
            transition: color var(--transition);
        }
        .teacher-entry-link:hover { color: var(--brand); text-decoration: underline; }

        /* === 卡片 === */
        .card {
            background: var(--surface);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow);
            padding: 36px 40px;
            margin-bottom: 20px;
            border: 1px solid var(--border);
        }
        h1 {
            text-align: center;
            color: var(--text-primary);
            margin-bottom: 8px;
            font-size: 1.7rem;
            font-weight: 700;
            letter-spacing: -.01em;
        }
        .subtitle {
            text-align: center;
            color: var(--text-secondary);
            margin-bottom: 28px;
            font-size: .95rem;
        }

        /* === 表单 === */
        .input-group { margin-bottom: 18px; }
        .input-group label {
            display: block;
            margin-bottom: 6px;
            color: var(--text-primary);
            font-weight: 500;
            font-size: .9rem;
        }
        .input-group input,
        .input-group select,
        .input-group textarea {
            width: 100%;
            padding: 10px 14px;
            font-size: .95rem;
            font-family: inherit;
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--surface-2);
            color: var(--text-primary);
            transition: border-color var(--transition), box-shadow var(--transition);
        }
        .input-group input:focus,
        .input-group select:focus,
        .input-group textarea:focus {
            outline: none;
            border-color: var(--brand);
            box-shadow: 0 0 0 3px rgba(92,107,192,.12);
            background: var(--surface);
        }
        .input-group textarea { resize: vertical; min-height: 100px; }

        /* === 按钮 === */
        .btn {
            background: var(--brand);
            color: #fff;
            border: none;
            padding: 10px 26px;
            font-size: .95rem;
            font-family: inherit;
            font-weight: 600;
            border-radius: var(--radius);
            cursor: pointer;
            transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            letter-spacing: .01em;
        }
        .btn:hover {
            background: var(--brand-deep);
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(92,107,192,.28);
        }
        .btn:active { transform: translateY(0); }
        .btn:disabled {
            opacity: .5;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        .btn-secondary {
            background: transparent;
            color: var(--text-secondary);
            border: 1.5px solid var(--border);
        }
        .btn-secondary:hover {
            background: var(--surface-2);
            color: var(--text-primary);
            border-color: #c5c8d6;
            box-shadow: none;
        }
        .btn-success { background: var(--success); }
        .btn-success:hover { background: #059669; }
        .btn-danger { background: var(--danger); }
        .btn-danger:hover { background: #dc2626; }
        .btn-sm { padding: 6px 14px; font-size: .85rem; border-radius: var(--radius-sm); }
        .btn-study {
            background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
            color: #fff;
            padding: 10px 22px;
            font-size: 1rem;
            font-weight: 700;
            letter-spacing: .08em;
            min-width: 96px;
            justify-content: center;
            box-shadow: 0 4px 14px rgba(92,107,192,.38);
        }
        .btn-study:hover {
            background: linear-gradient(135deg, var(--brand-deep) 0%, #6a3fb8 100%);
            box-shadow: 0 8px 22px rgba(92,107,192,.48);
        }
        .btn-study::before {
            content: '';
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 5px 0 5px 8px;
            border-color: transparent transparent transparent currentColor;
        }
        .btn-group {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
            margin-top: 20px;
        }
        .student-actions {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .progress-actions {
            justify-content: center;
            align-items: center;
        }

        /* === 页面切换 === */
        .screen { display: none; }
        .screen.active { display: block; }

        /* === 后台页眉 === */
        .admin-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border);
        }
        .admin-header h2 {
            color: var(--brand-deep);
            font-size: 1.15rem;
            font-weight: 700;
        }

        /* === 表格 === */
        table { width: 100%; border-collapse: collapse; margin-top: 16px; }
        th, td {
            padding: 11px 14px;
            text-align: left;
            border-bottom: 1px solid var(--border);
            font-size: .9rem;
        }
        th {
            background: var(--surface-2);
            color: var(--brand-deep);
            font-weight: 600;
            font-size: .83rem;
            text-transform: uppercase;
            letter-spacing: .04em;
        }
        tr:hover td { background: var(--brand-light); }
        tr:last-child td { border-bottom: none; }
        .student-name-link {
            color: var(--brand);
            font-weight: 700;
            text-decoration: underline;
            cursor: pointer;
        }
        .student-name-link:hover { color: var(--brand-deep); }
        .active-range-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
            margin-bottom: 12px;
        }
        .active-range-btn {
            border: 1px solid var(--border);
            background: #fff;
            color: var(--text-secondary);
            border-radius: 999px;
            padding: 6px 14px;
            cursor: pointer;
            font-size: .88rem;
        }
        .active-range-btn.is-on {
            background: var(--brand);
            border-color: var(--brand);
            color: #fff;
            font-weight: 700;
        }
        .active-calendar-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
        }
        .active-calendar-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .active-calendar-icon {
            width: 14px;
            height: 14px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            pointer-events: none;
        }
        .active-calendar-panel {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            z-index: 40;
            min-width: 268px;
            padding: 14px;
            background: #fff;
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: 0 10px 28px rgba(20, 24, 50, .14);
        }
        .active-calendar-wrap.is-open .active-calendar-panel { display: block; }
        .active-calendar-presets {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }
        .active-cal-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
        }
        .active-cal-nav-btn {
            width: 28px;
            height: 28px;
            border: 1px solid var(--border);
            background: #fff;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            line-height: 1;
        }
        .active-cal-nav-btn:disabled {
            opacity: .35;
            cursor: default;
        }
        .active-cal-weekdays,
        .active-cal-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 2px;
            text-align: center;
        }
        .active-cal-weekdays {
            margin-bottom: 4px;
            color: #888;
            font-size: .75rem;
        }
        .active-cal-day {
            height: 32px;
            border: 0;
            background: transparent;
            border-radius: 8px;
            cursor: pointer;
            font-size: .85rem;
        }
        .active-cal-day.is-empty {
            visibility: hidden;
        }
        .active-cal-day.is-today { font-weight: 700; }
        .active-cal-day.is-in { background: var(--brand-light); }
        .active-cal-day.is-bound,
        .active-cal-day.is-pending {
            background: var(--brand);
            color: #fff;
            font-weight: 700;
        }
        .active-cal-day.is-future {
            opacity: .35;
            cursor: not-allowed;
        }
        .active-cal-hint {
            margin: 8px 0 10px;
            color: #888;
            font-size: .8rem;
            text-align: center;
        }
        .active-calendar-apply { width: 100%; }
        .active-range-summary {
            margin-bottom: 14px;
            color: #555;
            font-size: .92rem;
        }
        .active-sort-th {
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
        }
        .active-zero-row td { color: #999; }

        .records-table-wrap {
            width: 100%;
            max-height: calc(100vh - 260px);
            overflow: auto;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--surface);
        }
        .records-table {
            min-width: 980px;
            margin-top: 0;
            border-collapse: separate;
            border-spacing: 0;
        }
        .progress-table { min-width: 1420px; }
        .records-table th,
        .records-table td {
            white-space: nowrap;
            border-right: 1px solid var(--border);
        }
        .records-table th:last-child,
        .records-table td:last-child { border-right: none; }
        .records-table thead th {
            position: sticky;
            top: 0;
            z-index: 2;
        }
        .records-filter-row th {
            top: 0;
            padding: 8px;
            background: var(--surface);
            overflow: visible;
            z-index: 5;
        }
        .records-filter-row th.filter-cell-open { z-index: 80; }
        .records-header-row th { top: 43px; z-index: 1; }
        .records-filter-control {
            width: 100%;
            min-width: 92px;
            height: 28px;
            padding: 4px 8px;
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--surface-2);
            color: var(--text-primary);
            font: inherit;
            font-size: .8rem;
            text-transform: none;
            letter-spacing: 0;
        }
        .records-filter-control:focus {
            outline: none;
            border-color: var(--brand);
            box-shadow: 0 0 0 3px rgba(92,107,192,.10);
            background: var(--surface);
        }
        .multi-filter {
            position: relative;
            min-width: 138px;
        }
        .multi-filter-toggle {
            width: 100%;
            height: 28px;
            padding: 4px 8px;
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--surface-2);
            color: var(--text-primary);
            font: inherit;
            font-size: .8rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            cursor: pointer;
            white-space: nowrap;
        }
        .multi-filter.open .multi-filter-toggle,
        .multi-filter-toggle:focus {
            outline: none;
            border-color: var(--brand);
            box-shadow: 0 0 0 3px rgba(92,107,192,.10);
            background: var(--surface);
        }
        .multi-filter-toggle span:first-child {
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .multi-filter-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            width: 270px;
            max-height: 260px;
            overflow: auto;
            padding: 7px;
            display: none;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            box-shadow: 0 18px 45px rgba(17,24,39,.18), 0 4px 12px rgba(17,24,39,.08);
            z-index: 120;
            text-transform: none;
            letter-spacing: 0;
        }
        .multi-filter.open .multi-filter-menu { display: block; }
        .multi-filter-option {
            display: flex;
            align-items: center;
            gap: 8px;
            min-height: 30px;
            padding: 5px 7px;
            border-radius: 6px;
            color: var(--text-primary);
            font-size: .82rem;
            font-weight: 500;
            cursor: pointer;
        }
        .multi-filter-option:hover { background: var(--brand-light); }
        .multi-filter-option input { width: 14px; height: 14px; flex: 0 0 auto; }
        .multi-filter-option span {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .multi-filter-option small {
            margin-left: auto;
            color: var(--text-muted);
            font-size: .72rem;
            font-weight: 600;
            padding-left: 10px;
        }
        .multi-filter-empty {
            padding: 8px;
            color: var(--text-muted);
            font-size: .8rem;
        }
        .multi-filter-clear {
            width: 100%;
            margin-top: 5px;
            padding: 5px 8px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--surface-2);
            color: var(--text-secondary);
            font: inherit;
            font-size: .78rem;
            cursor: pointer;
        }
        .multi-filter-clear:hover {
            color: var(--danger);
            background: var(--danger-bg);
            border-color: var(--danger-bg);
        }
        .records-table .records-score,
        .records-table .records-duration,
        .records-table .numeric-cell {
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

        /* === 徽章 === */
        .badge {
            display: inline-block;
            padding: 3px 10px;
            border-radius: 999px;
            font-size: .78rem;
            font-weight: 600;
            letter-spacing: .02em;
        }
        .badge-success { background: var(--success-bg); color: var(--success-text); }
        .badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
        .badge-warning { background: var(--warning-bg); color: var(--warning-text); }
        .badge-info    { background: var(--info-bg);    color: var(--info-text); }

        /* === 达标状态 === */
        .pass-status {
            font-size: 1rem;
            font-weight: 600;
            padding: 12px 18px;
            border-radius: var(--radius-sm);
            text-align: center;
            margin: 14px 0;
        }
        .pass-status.pass {
            background: var(--success-bg);
            color: var(--success-text);
            border: 1px solid #a7f3d0;
        }
        .pass-status.fail {
            background: var(--danger-bg);
            color: var(--danger-text);
            border: 1px solid #fca5a5;
        }

        /* === 进度条 === */
        .progress-bar {
            background: var(--border);
            border-radius: 999px;
            height: 6px;
            margin: 14px 0;
            overflow: hidden;
        }
        .progress-fill {
            background: linear-gradient(90deg, var(--brand), var(--accent));
            height: 100%;
            border-radius: 999px;
            transition: width .4s cubic-bezier(.4,0,.2,1);
        }

        /* === 统计格 === */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin: 18px 0;
        }
        .stat-box {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 14px 10px;
            text-align: center;
        }
        .stat-value {
            font-size: 1.45rem;
            font-weight: 700;
            color: var(--brand);
            line-height: 1.2;
        }
        .stat-label {
            color: var(--text-muted);
            font-size: .78rem;
            margin-top: 4px;
        }

        /* === 错题列表 === */
        .error-list { max-height: 280px; overflow-y: auto; margin-top: 14px; }
        .error-item {
            background: var(--warning-bg);
            border: 1px solid #fcd34d;
            padding: 9px 14px;
            border-radius: var(--radius-sm);
            margin-bottom: 6px;
            display: flex;
            justify-content: space-between;
            font-size: .88rem;
        }

        /* === Tab 栏 === */
        .tab-bar {
            display: flex;
            gap: 2px;
            margin-bottom: 20px;
            border-bottom: 1.5px solid var(--border);
        }
        .tab {
            padding: 9px 18px;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            margin-bottom: -1.5px;
            color: var(--text-secondary);
            font-size: .9rem;
            font-weight: 500;
            transition: color var(--transition), border-color var(--transition);
            border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        }
        .tab:hover { color: var(--brand); background: var(--brand-light); }
        .tab.active { border-bottom-color: var(--brand); color: var(--brand); font-weight: 700; }

        /* === 弹窗 === */
        .modal {
            display: none;
            position: fixed; top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(15,20,40,.45);
            backdrop-filter: blur(4px);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }
        .modal.active { display: flex; }
        .modal-content {
            background: var(--surface);
            border-radius: var(--radius-lg);
            padding: 28px 30px;
            max-width: 480px;
            width: 92%;
            max-height: 82vh;
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border);
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 18px;
            padding-bottom: 14px;
            border-bottom: 1px solid var(--border);
        }
        .modal-header h3 { font-size: 1.05rem; font-weight: 700; }
        .modal-close {
            background: none;
            border: none;
            font-size: 1.4rem;
            cursor: pointer;
            color: var(--text-muted);
            line-height: 1;
            padding: 2px 6px;
            border-radius: 6px;
            transition: color var(--transition), background var(--transition);
        }
        .modal-close:hover { color: var(--text-primary); background: var(--surface-2); }

        /* === Toast 通知 === */
        .toast {
            position: fixed;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%) translateY(8px);
            background: var(--text-primary);
            color: #fff;
            padding: 10px 22px;
            border-radius: 999px;
            z-index: 2000;
            font-size: .88rem;
            font-weight: 500;
            opacity: 0;
            transition: opacity .25s, transform .25s;
            pointer-events: none;
            white-space: nowrap;
        }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
        .toast.error   { background: var(--danger); }
        .toast.success { background: var(--success); }

        /* === 历史图表区 === */
        .history-chart { height: 180px; margin: 18px 0; }

        #genericScreen,
        #phraseScreen,
        #listeningScreen {
            min-height: calc(100vh - 48px);
            min-height: calc(100dvh - 48px);
        }

        #genericScreen.active,
        #phraseScreen.active,
        #listeningScreen.active {
            display: flex !important;
            flex-direction: column;
            height: 100dvh;
            max-height: 100dvh;
            padding: 0;
            overflow: hidden;
        }

        #genericScreen iframe,
        #phraseScreen iframe,
        #listeningScreen iframe {
            flex: 1;
            width: 100%;
            min-height: 0;
            height: auto !important;
            border: none;
        }

        #progressTable {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        #progressTable table {
            min-width: 640px;
        }

        /* === 复选框筛选组（旧版已废弃，保留空规则避免引用报错） === */
        .checkbox-filter { display: none; }

        /* === Chip 标签筛选器 === */
        .filter-bar {
            padding: 14px 18px;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 18px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .filter-row {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .filter-row-label {
            font-size: .8rem;
            font-weight: 700;
            color: var(--text-muted);
            letter-spacing: .04em;
            white-space: nowrap;
            min-width: 36px;
        }
        .filter-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            flex: 1;
        }
        .filter-chip {
            display: inline-flex;
            align-items: center;
            padding: 4px 13px;
            border-radius: 999px;
            font-size: .83rem;
            font-weight: 500;
            cursor: pointer;
            border: 1.5px solid var(--border);
            background: var(--surface);
            color: var(--text-secondary);
            transition: all var(--transition);
            user-select: none;
            white-space: nowrap;
            line-height: 1.5;
        }
        .filter-chip:hover:not(.active) {
            border-color: var(--brand);
            color: var(--brand);
            background: var(--brand-light);
        }
        .filter-chip.active {
            background: var(--brand);
            border-color: var(--brand);
            color: #fff;
            box-shadow: 0 2px 6px rgba(92,107,192,.22);
        }
        /* 学习进度tab搜索框 */
        .filter-search-wrap {
            position: relative;
            flex: 1;
            max-width: 320px;
        }
        .filter-search-input {
            width: 100%;
            padding: 6px 12px;
            font-size: .88rem;
            font-family: inherit;
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--surface);
            color: var(--text-primary);
            transition: border-color var(--transition), box-shadow var(--transition);
        }
        .filter-search-input:focus {
            outline: none;
            border-color: var(--brand);
            box-shadow: 0 0 0 3px rgba(92,107,192,.10);
        }
        .filter-search-dropdown {
            position: absolute;
            top: calc(100% + 4px);
            left: 0; right: 0;
            background: var(--surface);
            border: 1.5px solid var(--border);
            border-radius: var(--radius-sm);
            max-height: 200px;
            overflow-y: auto;
            z-index: 200;
            display: none;
            box-shadow: var(--shadow);
        }
        .filter-search-dropdown div {
            padding: 8px 14px;
            font-size: .88rem;
            cursor: pointer;
            transition: background var(--transition);
        }
        .filter-search-dropdown div:hover { background: var(--brand-light); color: var(--brand); }
        .filter-clear-link {
            font-size: .8rem;
            color: var(--text-muted);
            cursor: pointer;
            text-decoration: none;
            white-space: nowrap;
            padding: 4px 8px;
            border-radius: var(--radius-sm);
            transition: color var(--transition), background var(--transition);
        }
        .filter-clear-link:hover { color: var(--danger); background: var(--danger-bg); }

        .wrong-book-card { max-width: 820px; margin: 0 auto; }
        .wrong-book-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
        .wrong-book-head h2 { font-size: 1.15rem; margin: 0; }
        .wrong-book-sub { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 14px; }
        .wrong-book-actions { margin-bottom: 16px; }
        .wrong-book-count { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 10px; }
        .wrong-book-catalog { display: flex; flex-direction: column; gap: 10px; }
        .wrong-book-item {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 12px 14px;
        }
        .wrong-book-item[onclick] { cursor: pointer; }
        .wrong-book-item[onclick]:hover { border-color: var(--brand); }
        .wrong-book-item-title { font-weight: 600; line-height: 1.5; }
        .wrong-book-item-sub { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }
        .wrong-book-words { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
        .wrong-book-word {
            font-size: 0.85rem;
            padding: 2px 8px;
            border-radius: 999px;
            background: #eef0f6;
            color: #374151;
        }
        .wrong-book-word.marked { background: #fee2e2; color: #991b1b; font-weight: 600; }
        .wrong-book-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
        .wrong-book-hint { font-size: 0.8rem; color: var(--brand); margin-top: 4px; }

        /* === 响应式 === */
        @media (max-width: 640px) {
            body { padding: 12px 8px; }
            .card { padding: 20px 18px; }
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
            .container { width: 100%; }
            .records-table-wrap { max-height: calc(100vh - 220px); }
            table { font-size: .82rem; }
            th, td { padding: 8px 10px; }
            .tab { padding: 8px 12px; font-size: .82rem; }
            .progress-actions {
                flex-direction: column;
                align-items: stretch;
            }
            .progress-actions .btn-study {
                width: 100%;
            }
        }
