/* ==================== 驾照考试学习网站 - 全局样式 ==================== */

/* CSS 变量定义 */
:root {
    /* 颜色方案 - 浅色模式 */
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8edf2;
    --bg-card: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --text-inverse: #ffffff;
    --border-color: #e2e8f0;
    --border-light: #edf2f7;

    /* 主题色 */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-primary-dark: #1e40af;

    /* 功能色 */
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-success-bg: #ecfdf5;
    --color-danger: #ef4444;
    --color-danger-light: #fee2e2;
    --color-danger-bg: #fef2f2;
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-warning-bg: #fffbeb;
    --color-info: #3b82f6;
    --color-info-light: #dbeafe;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

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

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

    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* 顶栏高度 */
    --header-height: 60px;
    --nav-height: 50px;
}

/* 深色模式 */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-inverse: #0f172a;
    --border-color: #334155;
    --border-light: #1e293b;

    --color-primary-light: #1e3a5f;
    --color-success-light: #064e3b;
    --color-success-bg: #064e3b;
    --color-danger-light: #7f1d1d;
    --color-danger-bg: #450a0a;
    --color-warning-light: #78350f;
    --color-warning-bg: #451a03;
    --color-info-light: #1e3a5f;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
}

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ==================== 顶部导航栏 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-5);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

.header-logo svg {
    width: 28px;
    height: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* 深色模式切换按钮 */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-size: 1.25rem;
    background: var(--bg-tertiary);
}

.theme-toggle:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* ==================== 科目选择导航 ==================== */
.subject-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 var(--space-4);
    z-index: 999;
    transition: background-color var(--transition-normal);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.subject-btn {
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: var(--bg-tertiary);
}

.subject-btn:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.subject-btn.active {
    background: var(--color-primary);
    color: var(--text-inverse);
}

/* ==================== 底部功能导航 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    transition: background-color var(--transition-normal);
}

[data-theme="dark"] .bottom-nav {
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-1) var(--space-2);
    color: var(--text-tertiary);
    font-size: 0.625rem;
    transition: all var(--transition-fast);
    min-width: 56px;
    border-radius: var(--radius-sm);
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item:hover {
    color: var(--color-primary);
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item.active svg {
    transform: scale(1.1);
}

.nav-label {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ==================== 主内容区 ==================== */
.main-content {
    margin-top: calc(var(--header-height) + var(--nav-height));
    padding: var(--space-5);
    padding-bottom: 80px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

.page-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-section.active {
    display: block;
}

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

/* ==================== 卡片组件 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-5);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

/* ==================== 模式选择按钮组 ==================== */
.mode-selector {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.mode-btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.mode-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.mode-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ==================== 章节列表 ==================== */
.chapter-list {
    display: grid;
    gap: var(--space-3);
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chapter-item:hover {
    background: var(--color-primary-light);
    transform: translateX(4px);
}

.chapter-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.chapter-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

/* ==================== 答题界面 ==================== */
.question-area {
    margin-bottom: var(--space-5);
}

.question-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.question-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin: 0 var(--space-4);
    overflow: hidden;
}

.question-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.question-number {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.875rem;
    margin-bottom: var(--space-2);
}

.question-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: var(--space-2);
}

.badge-single { background: var(--color-info-light); color: var(--color-info); }
.badge-judge { background: var(--color-warning-light); color: var(--color-warning); }
.badge-multi { background: #e8e0f6; color: #7c3aed; }

.question-text {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: var(--space-5);
    color: var(--text-primary);
}

/* 交通标志图示 */
.question-sign {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-5);
}

.sign-icon {
    width: 100px;
    height: 100px;
}

/* 选项列表 */
.options-list {
    display: grid;
    gap: var(--space-3);
}

.option-item {
    display: flex;
    align-items: center;
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    user-select: none;
}

.option-item:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.option-item.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.option-item.correct {
    border-color: var(--color-success);
    background: var(--color-success-bg);
}

.option-item.wrong {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
}

.option-item.disabled {
    pointer-events: none;
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
    margin-right: var(--space-3);
    flex-shrink: 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.option-item.selected .option-letter {
    background: var(--color-primary);
    color: white;
}

.option-item.correct .option-letter {
    background: var(--color-success);
    color: white;
}

.option-item.wrong .option-letter {
    background: var(--color-danger);
    color: white;
}

.option-text {
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* 解析区域 */
.explanation-box {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    background: var(--color-primary-light);
    display: none;
    animation: slideDown 0.3s ease;
}

.explanation-box.show {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.explanation-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.explanation-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 答题导航按钮 */
.question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-6);
    gap: var(--space-3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    min-height: 44px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: 0.8125rem;
    min-height: 36px;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ==================== 模拟考试 ==================== */
.exam-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: sticky;
    top: calc(var(--header-height) + var(--nav-height) + var(--space-2));
    z-index: 10;
}

.timer {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.timer.warning {
    color: var(--color-danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.exam-info {
    display: flex;
    gap: var(--space-4);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.exam-score {
    font-weight: 600;
}

/* 答题卡 */
.answer-card {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.answer-card-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.answer-card-item.answered {
    background: var(--color-primary);
    color: white;
}

.answer-card-item.current {
    border: 2px solid var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.answer-card-item.correct-review {
    background: var(--color-success);
    color: white;
}

.answer-card-item.wrong-review {
    background: var(--color-danger);
    color: white;
}

/* 考试结果 */
.exam-result {
    text-align: center;
    padding: var(--space-10);
}

.result-score {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
}

.result-score.pass {
    color: var(--color-success);
}

.result-score.fail {
    color: var(--color-danger);
}

.result-label {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-6);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin: var(--space-6) 0;
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.result-stat-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

/* ==================== 错题本 ==================== */
.mistake-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mistake-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.mistake-question {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: var(--space-2);
}

.mistake-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.mistake-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.tag-subject1 { background: #dbeafe; color: #2563eb; }
.tag-subject2 { background: #d1fae5; color: #059669; }
.tag-subject3 { background: #fef3c7; color: #d97706; }
.tag-subject4 { background: #e8e0f6; color: #7c3aed; }

.empty-state {
    text-align: center;
    padding: var(--space-10);
    color: var(--text-tertiary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.empty-state-desc {
    font-size: 0.875rem;
}

/* ==================== 知识点讲解 ==================== */
.knowledge-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
}

.knowledge-tab {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.knowledge-tab:hover {
    color: var(--color-primary);
}

.knowledge-tab.active {
    background: var(--color-primary);
    color: white;
}

/* 交通标志展示 */
.signs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-4);
}

.sign-card {
    text-align: center;
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: default;
}

.sign-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sign-svg {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-3);
}

.sign-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: var(--space-1);
}

.sign-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* 法规知识卡片 */
.regulation-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.regulation-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.regulation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.regulation-table th {
    background: var(--color-primary);
    color: white;
    padding: var(--space-3) var(--space-4);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
}

.regulation-table td {
    padding: var(--space-3) var(--space-4);
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.5;
}

.regulation-table tr:last-child td {
    border-bottom: none;
}

.regulation-table tr:hover td {
    background: var(--color-primary-light);
}

.regulation-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-primary);
}

/* 易混淆知识点 */
.confusing-card {
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
}

.confusing-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-warning);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.confusing-list {
    padding-left: var(--space-5);
}

.confusing-list li {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    list-style: disc;
    margin-bottom: var(--space-1);
}

/* ==================== 语音读题控制 ==================== */
.speech-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.speech-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    transition: all var(--transition-fast);
}

.speech-btn:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.speech-btn.active {
    background: var(--color-danger);
}

.speech-speed {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.speech-speed select {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8125rem;
}

/* ==================== 学习进度 ==================== */
.progress-overview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.progress-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.progress-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: var(--space-1);
}

.progress-stat-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.progress-subject {
    margin-bottom: var(--space-4);
}

.progress-subject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.progress-subject-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.progress-subject-pct {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-primary);
}

.progress-bar {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
    background: linear-gradient(90deg, var(--color-primary), #60a5fa);
}

.progress-bar-fill.s1 { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.progress-bar-fill.s2 { background: linear-gradient(90deg, #059669, #34d399); }
.progress-bar-fill.s3 { background: linear-gradient(90deg, #d97706, #fbbf24); }
.progress-bar-fill.s4 { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.progress-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

/* 正确率环形图 */
.accuracy-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-4);
}

.accuracy-ring svg {
    transform: rotate(-90deg);
}

.accuracy-ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.accuracy-ring-fill {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.accuracy-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
}

/* ==================== 考试开始面板 ==================== */
.exam-start-panel {
    text-align: center;
    padding: var(--space-8);
}

.exam-start-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-5);
    background: var(--color-primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.exam-start-icon svg {
    width: 40px;
    height: 40px;
}

.exam-start-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.exam-start-desc {
    font-size: 0.9375rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

.exam-rules {
    text-align: left;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.exam-rules-title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.exam-rules li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: var(--space-4);
    position: relative;
}

.exam-rules li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
}

/* ==================== 反馈动画 ==================== */
.feedback-correct {
    animation: correctPop 0.5s ease;
}

.feedback-wrong {
    animation: wrongShake 0.5s ease;
}

@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ==================== 对话框/弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--space-5);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.modal-body {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* ==================== 首页 ==================== */
.home-hero {
    text-align: center;
    padding: var(--space-8) 0;
}

.home-hero-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero-desc {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-6);
}

.home-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-3);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.feature-icon.blue { background: #dbeafe; color: #2563eb; }
.feature-icon.green { background: #d1fae5; color: #059669; }
.feature-icon.orange { background: #fef3c7; color: #d97706; }
.feature-icon.purple { background: #e8e0f6; color: #7c3aed; }
.feature-icon.red { background: #fee2e2; color: #ef4444; }
.feature-icon.teal { background: #ccfbf1; color: #0d9488; }

.feature-name {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: var(--space-1);
}

.feature-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* 快速开始 */
.quick-start {
    margin-top: var(--space-6);
}

.quick-start-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.quick-subject {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-3);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-subject:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.quick-subject-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.quick-subject-num {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    color: white;
}

.qs-1 { background: #2563eb; }
.qs-2 { background: #059669; }
.qs-3 { background: #d97706; }
.qs-4 { background: #7c3aed; }

.quick-subject-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.quick-subject-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.quick-subject-arrow {
    color: var(--text-tertiary);
    font-size: 1.25rem;
}

/* ==================== 确认交卷按钮 ==================== */
.submit-exam-area {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

/* ==================== 回到顶部 ==================== */
.scroll-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    transition: all var(--transition-fast);
}

.scroll-top.show {
    display: flex;
}

.scroll-top:hover {
    transform: translateY(-2px);
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 640px) {
    .main-content {
        padding: var(--space-4);
        padding-bottom: 80px;
    }

    .header-logo span {
        display: none;
    }

    .home-features {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .feature-card {
        padding: var(--space-4);
    }

    .progress-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .result-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-3);
    }

    .answer-card {
        grid-template-columns: repeat(8, 1fr);
    }

    .signs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .exam-header {
        flex-direction: column;
        gap: var(--space-3);
    }

    .card {
        padding: var(--space-4);
    }
}

@media (max-width: 400px) {
    .home-features {
        grid-template-columns: 1fr;
    }

    .answer-card {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ==================== 加载状态 ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--text-tertiary); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.gap-3 { gap: var(--space-3); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }
