* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* ===== 顶部导航 ===== */
.topbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 18px; font-weight: 600; color: #1a73e8; }
.logo-icon { font-size: 24px; }
.nav { display: flex; gap: 24px; }
.nav a { color: #666; text-decoration: none; font-size: 14px; cursor: pointer; }
.nav a:hover { color: #1a73e8; }

/* ===== 容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; min-height: calc(100vh - 60px - 60px); }
.footer { text-align: center; padding: 24px; color: #999; font-size: 13px; background: #fff; }

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

/* ===== 首页 Hero ===== */
.hero { text-align: center; padding: 40px 0 32px; }
.hero h1 { font-size: 32px; color: #1a1a2e; margin-bottom: 8px; }
.hero p { color: #888; font-size: 16px; }

/* ===== 卡片网格 ===== */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-icon { font-size: 28px; }
.card-title h2 { font-size: 20px; }

/* ===== 章节列表 ===== */
.chapter-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.chapter-item {
    padding: 14px 16px;
    background: #f8f9ff;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e8ecff;
    transition: all 0.2s;
}
.chapter-item:hover { background: #eef2ff; border-color: #1a73e8; transform: translateY(-1px); }
.chapter-name { font-size: 15px; font-weight: 500; color: #333; }
.chapter-count { font-size: 12px; color: #999; margin-top: 2px; }

/* ===== 按钮 ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    background: #f0f0f0;
    color: #333;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-success { background: #34a853; color: #fff; }
.btn-danger { background: #fff; color: #e53935; border: 1px solid #e53935; }
.btn-green { background: #34a853; color: #fff; }
.btn-outline { background: #fff; border: 1px solid #ddd; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.card-actions { display: flex; flex-direction: column; gap: 10px; }
.card-actions.vertical { justify-content: center; height: 200px; }

/* ===== 练习/考试页 ===== */
.practice-header, .exam-header, .list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.exam-timer { font-size: 24px; font-weight: 700; color: #e53935; font-variant-numeric: tabular-nums; }
.practice-body { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }

.question-area {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.question-no { color: #999; font-size: 14px; margin-bottom: 12px; }
.question-text { font-size: 18px; font-weight: 500; margin-bottom: 24px; line-height: 1.8; }

.options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.option-item {
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.option-item:hover { border-color: #1a73e8; background: #f8faff; }
.option-item.selected { border-color: #1a73e8; background: #eef4ff; }
.option-item.correct { border-color: #34a853; background: #e8f5e9; }
.option-item.wrong { border-color: #e53935; background: #ffebee; }
.option-label {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    flex-shrink: 0;
}
.option-item.selected .option-label { background: #1a73e8; color: #fff; }
.option-item.correct .option-label { background: #34a853; color: #fff; }
.option-item.wrong .option-label { background: #e53935; color: #fff; }

.analysis {
    background: #fffde7;
    border-left: 4px solid #fbc02d;
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 20px;
}
.analysis-title { font-weight: 600; color: #f57f17; margin-bottom: 8px; }
.analysis-content { color: #555; font-size: 14px; line-height: 1.8; }

.practice-footer { display: flex; gap: 12px; justify-content: center; }

/* ===== 答题卡 ===== */
.question-nav {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: sticky;
    top: 80px;
}
.nav-title { font-size: 13px; color: #888; margin-bottom: 10px; font-weight: 500; }
.nav-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.nav-item {
    aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    background: #f7f8fa;
    color: #999;
    border: 1px solid #eef0f3;
    transition: all 0.15s;
}
.nav-item:hover { background: #e8f0fe; color: #1a73e8; }
.nav-item.current { border-color: #1a73e8; background: #e3f2fd; color: #1a73e8; font-weight: 600; box-shadow: 0 0 0 2px rgba(26,115,232,0.15); }
.nav-item.done { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.nav-item.wrong { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
.nav-legend {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: #999;
}
.legend-dot {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}
.legend-dot.current { background: #e3f2fd; border: 1px solid #1a73e8; }
.legend-dot.done { background: #e8f5e9; border: 1px solid #c8e6c9; }
.legend-dot.wrong { background: #ffebee; border: 1px solid #ffcdd2; }
.legend-dot.todo { background: #f7f8fa; border: 1px solid #eef0f3; }

/* ===== 结果页 ===== */
.result-card {
    background: #fff;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}
.result-score { font-size: 72px; font-weight: 700; color: #1a73e8; line-height: 1; }
.result-label { color: #999; margin: 12px 0 24px; }
.result-detail { color: #666; margin-bottom: 24px; font-size: 15px; }
.result-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== 错题/收藏列表 ===== */
.item-list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    cursor: pointer;
}
.list-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.list-item-ask { font-size: 15px; margin-bottom: 8px; }
.list-item-meta { font-size: 13px; color: #999; }

/* ===== 口试页 ===== */
.koushi-body {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.koushi-ask { font-size: 20px; font-weight: 500; margin-bottom: 24px; line-height: 1.8; }
.koushi-answer { margin-bottom: 24px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .card-grid { grid-template-columns: 1fr; }
    .practice-body { grid-template-columns: 1fr; }
    .chapter-list { grid-template-columns: 1fr; }
}
