/* ============================================================
 * common.css — 学习数据系统全站公共样式
 *
 * 组织：
 *   1. 设计令牌 (:root 变量)
 *   2. Reset 与基础
 *   3. 排版
 *   4. 按钮
 *   5. 表单（输入/选择/表单组）
 *   6. 表格
 *   7. 卡片
 *   8. 徽章与标签
 *   9. 模态框
 *  10. Toast 通知
 *  11. 加载/骨架屏/空状态
 *  12. 分页
 *  13. 布局壳（侧边栏应用 / 顶栏 / 认证卡）
 *  14. 筛选栏
 *  15. 知识点树
 *  16. 题目卡 / 选项 / 答案 / 解析 / 答题交互
 *  17. 视频卡 / 播放器
 *  18. 讲解内容区
 *  19. 难度筛选球
 *  20. 即将上线占位
 *  21. 响应式
 *
 * 主题色通过 --brand 注入，各页面可在自己的 <style> 中覆盖。
 * 默认 --brand: #1a73e8。
 * ============================================================ */

/* ============ 1. 设计令牌 ============ */
:root {
    /* 品牌色 */
    --brand: #1a73e8;
    --brand-dark: #0d47a1;
    --brand-rgb: 26, 115, 232;
    --brand-light: #e8f0fe;
    --brand-lighter: #f5f9ff;

    /* 语义色 */
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #2563eb;
    --info-bg: #dbeafe;

    /* 中性色 */
    --text-1: #1e293b;   /* 主文字 */
    --text-2: #475569;   /* 次要文字 */
    --text-3: #94a3b8;   /* 辅助/占位 */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --bg: #f1f5f9;       /* 页面背景 */
    --bg-card: #ffffff;  /* 卡片背景 */
    --bg-soft: #f8fafc;  /* 柔和背景 */

    /* 圆角 */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;

    /* 过渡 */
    --transition: all 0.2s ease;

    /* 布局 */
    --sidebar-w: 230px;
    --sidebar-w-collapsed: 60px;
    --header-h: 60px;
}

/* ============ 2. Reset 与基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text-1);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--brand-dark); }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

ul, ol { list-style: none; }
img { max-width: 100%; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 3. 排版 ============ */
h1, h2, h3, h4 { color: var(--text-1); font-weight: 600; line-height: 1.4; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }

/* ============ 4. 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    transition: var(--transition);
    border: 1px solid transparent;
    user-select: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }

.btn-secondary { background: var(--bg-card); color: var(--text-2); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--brand); color: var(--brand); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); color: var(--brand); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* ============ 5. 表单 ============ */
.form-group { margin-bottom: var(--space-4); }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}
.form-group .required { color: var(--danger); margin-left: 2px; }

.input, .select, textarea.input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-1);
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
}
.input:focus, .select:focus, textarea.input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}
.input::placeholder { color: var(--text-3); }
.select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
textarea.input { resize: vertical; min-height: 80px; }

.form-row { display: flex; gap: var(--space-3); }
.form-row > .form-group { flex: 1; }

/* ============ 6. 表格 ============ */
.table-wrap { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; white-space: nowrap; }
.table thead th {
    background: var(--bg-soft);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--border);
    position: sticky; top: 0; z-index: 1;
}
.table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--brand-lighter); }
.table td.actions { white-space: nowrap; }
.table td.actions .btn { margin-right: 4px; }

/* ============ 7. 卡片 ============ */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 16px; }
.card-body { padding: var(--space-5); }

/* ============ 8. 徽章与标签 ============ */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: var(--radius-full);
    font-size: 12px; font-weight: 500; line-height: 1.6;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg-soft); color: var(--text-2); }

.role-badge { font-size: 12px; padding: 2px 10px; border-radius: var(--radius-full); font-weight: 500; }
.role-admin { background: #fce7f3; color: #be185d; }
.role-teacher { background: var(--info-bg); color: var(--info); }
.role-student { background: var(--success-bg); color: var(--success); }
.role-user { background: var(--bg-soft); color: var(--text-2); }

/* ============ 9. 模态框 ============ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: var(--space-4);
    animation: fadeIn 0.15s ease;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow: hidden;
    display: flex; flex-direction: column;
    animation: slideUp 0.2s ease;
}
.modal.modal-lg { max-width: 720px; }
.modal.modal-sm { max-width: 380px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; }
.modal-close { font-size: 22px; color: var(--text-3); line-height: 1; padding: 4px; transition: var(--transition); }
.modal-close:hover { color: var(--text-1); }
.modal-body { padding: var(--space-5); overflow-y: auto; flex: 1; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 10. Toast 通知 ============ */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 2000; display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    min-width: 240px; max-width: 360px;
    padding: 12px 16px; border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: #fff;
    pointer-events: auto;
    animation: toastIn 0.25s ease;
}
.toast.toast-out { animation: toastOut 0.25s ease forwards; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--brand); }
.toast-icon { font-size: 16px; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ============ 11. 加载/骨架屏/空状态 ============ */
.loading { text-align: center; padding: 40px 20px; color: var(--text-3); }
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-state .empty-icon { font-size: 42px; display: block; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; margin-bottom: 14px; }

/* ============ 12. 分页 ============ */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border);
    flex-wrap: wrap; gap: var(--space-2);
}
.pagination-info { font-size: 13px; color: var(--text-3); }
.pagination-controls { display: flex; gap: 6px; align-items: center; }
.pagination-controls .btn { min-width: 34px; padding: 5px 10px; font-size: 13px; }
.pagination-controls .page-num.active { background: var(--brand); color: #fff; }

/* ============ 13. 布局壳 ============ */
/* --- 侧边栏应用（dashboard） --- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0;
    z-index: 100;
    transition: width 0.25s ease;
    overflow: hidden;
}
.sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}
.sidebar-header .logo { font-size: 24px; }
.sidebar-header .sidebar-title { font-size: 15px; font-weight: 600; color: #fff; }
.sidebar-toggle {
    position: absolute; top: 22px; right: -12px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; box-shadow: var(--shadow);
    transition: var(--transition); z-index: 101;
}
.sidebar-toggle:hover { background: var(--brand-dark); }
.nav-menu { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 3px;
    border-radius: var(--radius-sm);
    color: #cbd5e1; font-size: 14px;
    cursor: pointer; transition: var(--transition);
    white-space: nowrap;
}
.nav-item .nav-icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; }
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap; overflow: hidden;
}
.sidebar-footer .user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sidebar-footer .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.sidebar-footer .user-name { font-size: 14px; color: #fff; font-weight: 500; }
.sidebar-footer .user-role { font-size: 12px; color: #94a3b8; }
.sidebar-footer .footer-actions { display: flex; gap: 8px; }
.sidebar-footer .footer-actions .btn { flex: 1; padding: 6px; font-size: 13px; }

/* 折叠态 */
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.app-shell.sidebar-collapsed .sidebar-header .sidebar-title,
.app-shell.sidebar-collapsed .nav-item .nav-text,
.app-shell.sidebar-collapsed .sidebar-footer .user-info,
.app-shell.sidebar-collapsed .sidebar-footer .footer-actions { display: none; }
.app-shell.sidebar-collapsed .nav-item { justify-content: center; }
.app-shell.sidebar-collapsed .main-content { margin-left: var(--sidebar-w-collapsed); }

.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; transition: margin-left 0.25s ease; }
.content-header {
    height: var(--header-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-6); gap: var(--space-4);
    position: sticky; top: 0; z-index: 50;
}
.content-header .header-title h2 { font-size: 17px; }
.content-header .header-title .subtitle { font-size: 12px; color: var(--text-3); }
.content-header .header-actions { display: flex; align-items: center; gap: var(--space-3); }
.content-body { flex: 1; padding: var(--space-6); overflow-y: auto; }

.module-container { display: none; }
.module-container.active { display: block; }

/* 移动端侧边栏遮罩 */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }
.sidebar-backdrop.show { display: block; }
.mobile-menu-btn { display: none; }

/* --- 顶栏（admin） --- */
.topbar {
    height: var(--header-h);
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-6);
    box-shadow: var(--shadow);
}
.topbar .topbar-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.topbar .topbar-actions { display: flex; align-items: center; gap: var(--space-3); }
.topbar .topbar-user { font-size: 14px; opacity: 0.95; }
.topbar .btn { background: rgba(255,255,255,0.15); color: #fff; }
.topbar .btn:hover { background: rgba(255,255,255,0.25); }
.page-body { padding: var(--space-6); max-width: 1200px; margin: 0 auto; }

/* --- 认证卡（login） --- */
.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: var(--space-4);
}
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 400px;
    padding: var(--space-8);
    animation: slideUp 0.4s ease;
}
.auth-logo { text-align: center; margin-bottom: var(--space-6); }
.auth-logo .logo-icon { font-size: 44px; }
.auth-logo .logo-title { font-size: 20px; font-weight: 600; color: var(--text-1); margin-top: 8px; }
.auth-logo .logo-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ============ 14. 筛选栏 ============ */
.filters {
    display: flex; flex-wrap: wrap; gap: var(--space-3);
    align-items: flex-end;
    background: var(--bg-card);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-5);
}
.filters .filter-group { display: flex; flex-direction: column; gap: 4px; }
.filters .filter-group label { font-size: 12px; color: var(--text-3); }
.filters .select { min-width: 140px; padding: 8px 32px 8px 10px; }
.filters .search-box { position: relative; flex: 1; min-width: 200px; }
.filters .search-box .input { padding-left: 34px; }
.filters .search-box::before {
    content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 13px; opacity: 0.6;
}

/* ============ 15. 知识点树 ============ */
.chapter-title {
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff; padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; font-weight: 500; transition: var(--transition);
}
.chapter-title:hover { transform: translateX(3px); box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3); }
.chapter-title .arrow { transition: transform 0.3s; }
.chapter-title.open .arrow { transform: rotate(90deg); }

.section-list { display: none; padding-left: 10px; margin-top: 8px; }
.section-list.open { display: block; }
.section-group { margin-bottom: 8px; }
.section-title {
    color: var(--text-2); padding: 6px 10px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; font-weight: 500; border-left: 3px solid var(--brand);
    margin-left: 8px; transition: var(--transition);
}
.section-title:hover { color: var(--brand); transform: translateX(3px); }
.section-title .section-arrow { font-size: 10px; transition: transform 0.3s; }
.section-title.open .section-arrow { transform: rotate(180deg); }

.knowledge-items { display: none; padding-left: 15px; margin-top: 5px; }
.knowledge-items.open { display: block; }
.knowledge-item {
    color: var(--text-1); padding: 5px 8px; cursor: pointer; font-size: 12px;
    border-left: 2px solid var(--border); margin-left: 8px; transition: var(--transition);
    position: relative;
}
.knowledge-item:hover { color: var(--brand); border-left-color: var(--brand); }
.knowledge-item.open { color: var(--brand); border-left-color: var(--brand); }
.knowledge-item .toggle-btn {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: var(--text-3); transition: transform 0.3s;
}
.knowledge-item.open .toggle-btn { transform: translateY(-50%) rotate(180deg); }

.explanation-items { display: none; padding-left: 10px; margin-top: 3px; }
.explanation-items.open { display: block; }
.explanation-item {
    color: var(--text-2); padding: 5px 8px; cursor: pointer; font-size: 11px;
    background-color: var(--bg-soft); border-radius: 4px; margin-bottom: 3px;
    border-left: 2px solid var(--border-strong); transition: var(--transition);
}
.explanation-item:hover { background-color: var(--brand); color: #fff; border-left-color: var(--brand-dark); }
.explanation-item.active { background-color: var(--brand); color: #fff; border-left-color: var(--brand-dark); }

/* ============ 16. 题目卡 / 选项 / 答案 / 解析 / 答题交互 ============ */
.question-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: var(--space-5); margin-bottom: var(--space-4);
    box-shadow: var(--shadow); border-left: 4px solid var(--brand);
}
.question-head {
    display: flex; align-items: center; gap: var(--space-3);
    margin-bottom: var(--space-3); flex-wrap: wrap;
}
.question-head .q-index { font-size: 13px; font-weight: 600; color: var(--brand); }
.question-stem { font-size: 14px; color: var(--text-1); line-height: 1.7; margin-bottom: var(--space-3); }
.question-stem .blank-line { display: inline-block; min-width: 60px; border-bottom: 1.5px solid var(--text-2); margin: 0 3px; vertical-align: baseline; }
.question-stem .blank-input { display: inline-block; min-width: 80px; max-width: 90%; border: none; border-bottom: 1.5px solid var(--text-2); background: transparent; outline: none; font: inherit; color: var(--text-1); margin: 0 3px; padding: 0 2px; vertical-align: baseline; }
.question-stem .blank-input:focus { border-bottom-color: var(--brand); }
.question-stem .blank-input:disabled { color: var(--text-2); opacity: 0.85; cursor: default; }

.question-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
.option-item {
    background: var(--bg-soft); padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-2); border: 2px solid transparent;
    transition: var(--transition); cursor: default;
}
.option-item.clickable { cursor: pointer; }
.option-item.clickable:hover { background: var(--brand-lighter); border-color: var(--brand-light); }
.option-item.selected { background: var(--info-bg); border-color: var(--info); color: var(--info); font-weight: 500; }
.option-item.correct { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.option-item.wrong { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.question-answer { background: var(--info-bg); padding: 12px; border-radius: var(--radius-sm); margin-bottom: var(--space-3); }
.question-answer strong { color: var(--info); margin-right: 8px; }
.question-analysis { background: var(--warning-bg); padding: 12px; border-radius: var(--radius-sm); border-left: 4px solid var(--warning); margin-top: var(--space-2); }
.question-analysis h4 { color: var(--warning); font-size: 13px; margin-bottom: 8px; }
.question-analysis-content { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.question-analysis-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 8px 0; }

.question-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.question-feedback { margin-top: var(--space-3); padding: 12px; border-radius: var(--radius-sm); font-size: 13px; display: none; }
.question-feedback.show { display: block; }
.question-feedback.correct { background: var(--success-bg); color: var(--success); }
.question-feedback.wrong { background: var(--danger-bg); color: var(--danger); }
.question-feedback .time-rating { margin-left: 8px; font-weight: 600; }

.q-timer {
    margin-left: auto; font-size: 13px; color: var(--text-2);
    background: var(--bg-soft); padding: 3px 10px; border-radius: var(--radius-full);
    font-variant-numeric: tabular-nums;
}
.q-timer.running { color: var(--brand); background: var(--brand-light); }

/* 答题导航 */
.answer-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); flex-wrap: wrap; }
.answer-card-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.answer-card-grid .ac-cell {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; cursor: pointer; transition: var(--transition);
    background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border);
}
.answer-card-grid .ac-cell:hover { border-color: var(--brand); color: var(--brand); }
.answer-card-grid .ac-cell.current { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.answer-card-grid .ac-cell.correct { background: var(--success); color: #fff; border-color: var(--success); }
.answer-card-grid .ac-cell.wrong { background: var(--danger); color: #fff; border-color: var(--danger); }

.progress-summary { display: flex; gap: var(--space-4); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.progress-summary span strong { color: var(--text-1); }

/* ============ 17. 视频卡 / 播放器 ============ */
.video-card {
    background: #fff; border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow); cursor: pointer; transition: var(--transition);
    border: 2px solid transparent;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.video-card.active { border-color: var(--brand); box-shadow: 0 4px 15px rgba(var(--brand-rgb), 0.3); }

.video-thumbnail {
    width: 100%; height: 150px;
    background: linear-gradient(135deg, #c9b896 0%, #a89878 100%);
    position: relative; display: flex; align-items: center; justify-content: center;
}
.video-thumbnail::before {
    content: ''; width: 44px; height: 44px; background-color: rgba(255,255,255,0.92);
    border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.video-thumbnail::after {
    content: '▶'; position: absolute; color: var(--text-2); font-size: 16px; margin-left: 3px;
}
.video-duration {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.7); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px;
}
.video-info { padding: 14px; }
.video-title {
    font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-card.active .video-title { color: var(--brand); }
.video-meta { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }

.video-container { margin-bottom: var(--space-5); }
.video-wrapper {
    position: relative; background: linear-gradient(135deg, #c9b896 0%, #a89878 100%);
    border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
}
.video-player { width: 100%; display: block; border-radius: var(--radius-lg); }

/* ============ 18. 讲解内容区 ============ */
.explanation-content { background: var(--bg-soft); border-radius: var(--radius-lg); padding: var(--space-6); }
.explanation-title { font-size: 18px; color: var(--text-1); margin-bottom: var(--space-5); padding-bottom: var(--space-4); border-bottom: 2px solid var(--border); }
.text-explanation { background: #fff; border-radius: var(--radius-lg); padding: var(--space-6); line-height: 1.8; color: #444; box-shadow: var(--shadow-sm); }
.text-explanation p { margin-bottom: 14px; }
.text-explanation img { max-width: 100%; border-radius: var(--radius-sm); margin: 10px 0; }
.no-selection { text-align: center; padding: 40px 20px; color: var(--text-3); }
.no-selection i { font-size: 36px; display: block; margin-bottom: 10px; }

/* ============ 19. 难度筛选球 ============ */
.difficulty-filter { display: flex; align-items: center; gap: 8px; margin-bottom: var(--space-4); flex-wrap: wrap; }
.difficulty-filter .filter-label { font-size: 13px; color: var(--text-2); margin-right: 4px; }
.diff-ball {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; color: #fff; cursor: pointer; transition: var(--transition);
    opacity: 0.55; border: 2px solid transparent;
}
.diff-ball:hover { opacity: 0.85; transform: scale(1.08); }
.diff-ball.active { opacity: 1; transform: scale(1.1); border-color: var(--text-1); }
.diff-ball.diff-all { background: var(--text-3); }
.diff-ball.diff-1 { background: #52c41a; }
.diff-ball.diff-2 { background: #faad14; }
.diff-ball.diff-3 { background: #ff4d4f; }
.diff-ball.diff-4 { background: #722ed1; }
.diff-ball.diff-5 { background: #1677ff; }
.diff-count { font-size: 12px; color: var(--text-3); margin-left: 8px; }

/* ============ 20. 即将上线占位 ============ */
.coming-soon {
    text-align: center; padding: 70px 20px; color: var(--text-3);
}
.coming-soon .cs-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.coming-soon .cs-title { font-size: 18px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.coming-soon .cs-desc { font-size: 14px; }

/* ============ 21. 响应式 ============ */
@media (max-width: 1024px) {
    :root { --sidebar-w: 200px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
    .app-shell.sidebar-collapsed .nav-item .nav-text,
    .app-shell.sidebar-collapsed .sidebar-header .sidebar-title,
    .app-shell.sidebar-collapsed .sidebar-footer .user-info,
    .app-shell.sidebar-collapsed .sidebar-footer .footer-actions { display: revert; }
    .app-shell.sidebar-collapsed .nav-item { justify-content: flex-start; }
    .main-content, .app-shell.sidebar-collapsed .main-content { margin-left: 0; }
    .mobile-menu-btn { display: inline-flex; }
    .content-body { padding: var(--space-4); }
    .content-header { padding: 0 var(--space-4); }
    .content-header .header-title h2 { font-size: 15px; }
    .filters { padding: var(--space-3); }
    .filters .select { min-width: 120px; }
    .question-options { grid-template-columns: 1fr; }
    .video-grid { grid-template-columns: 1fr 1fr; }
    .topbar { padding: 0 var(--space-4); }
    .topbar .topbar-user { display: none; }
    .page-body { padding: var(--space-4); }
}

@media (max-width: 480px) {
    .video-grid { grid-template-columns: 1fr; }
    .modal { max-width: 100%; }
    .form-row { flex-direction: column; }
    .answer-nav { flex-direction: column; align-items: stretch; }
}
