/* ============================================================
   中级会计备考空间站 · 前端样式系统
   深色专注主题，三科主题色贯穿，全部本地资源、无外部 CDN
   ============================================================ */

:root {
    --bg-0: #0a0f1f;
    --bg-1: #101731;
    --bg-2: #182144;
    --card: rgba(255, 255, 255, 0.055);
    --card-strong: rgba(255, 255, 255, 0.09);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-0: #eef2ff;
    --text-1: #aab5d6;
    --text-2: #6d7899;
    --blue: #4f7cff;
    --teal: #22b8a6;
    --orange: #f58231;
    --green: #34d399;
    --red: #f87171;
    --gold: #fbbf24;
    --purple: #a78bfa;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --nav-w: 232px;
    --font-scale: 1;
}

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

html, body {
    height: 100%;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(1200px 700px at 85% -10%, rgba(79, 124, 255, 0.18), transparent 60%),
        radial-gradient(900px 600px at -10% 30%, rgba(34, 184, 166, 0.12), transparent 55%),
        radial-gradient(800px 600px at 50% 110%, rgba(245, 130, 49, 0.1), transparent 55%),
        var(--bg-0);
    color: var(--text-0);
    font-size: calc(15.5px * var(--font-scale));
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }

/* ---------- 布局 ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--nav-w);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    padding: 26px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(10, 15, 31, 0.72);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--card-border);
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 22px;
}

.brand-logo {
    width: 42px; height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: grid; place-items: center;
    font-size: 22px;
    box-shadow: 0 8px 22px rgba(79, 124, 255, 0.4);
}

.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: 11.5px; color: var(--text-2); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-1);
    transition: all 0.22s ease;
    border: 1px solid transparent;
    font-size: 15px;
}

.nav-item .icon { font-size: 18px; width: 22px; text-align: center; }

.nav-item:hover { background: var(--card-strong); color: var(--text-0); }

.nav-item.active {
    background: linear-gradient(90deg, rgba(79, 124, 255, 0.22), rgba(79, 124, 255, 0.05));
    color: #fff;
    border-color: rgba(79, 124, 255, 0.35);
}

.nav-foot {
    margin-top: auto;
    padding: 14px 10px;
    font-size: 12px;
    color: var(--text-2);
    border-top: 1px solid var(--card-border);
}

.main {
    flex: 1;
    margin-left: var(--nav-w);
    padding: 30px 38px 80px;
    max-width: 1280px;
}

/* ---------- 通用组件 ---------- */
.page-head { margin-bottom: 28px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: 0.5px; }
.page-desc { color: var(--text-1); margin-top: 8px; max-width: 720px; }

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(12px);
}

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14.5px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue), #6d94ff);
    color: #fff;
    box-shadow: 0 10px 24px rgba(79, 124, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(79, 124, 255, 0.45); }

.btn-ghost {
    background: var(--card-strong);
    color: var(--text-0);
    border-color: var(--card-border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

.btn-teal { background: linear-gradient(135deg, var(--teal), #3fd6c4); color: #062622; }
.btn-teal:hover { transform: translateY(-2px); }

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.tag-tier-1 { background: rgba(248, 113, 113, 0.15); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.3); }
.tag-tier-2 { background: rgba(251, 191, 36, 0.14); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.3); }
.tag-tier-3 { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.25); }

.diff-dot { display: inline-flex; gap: 3px; }
.diff-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); }
.diff-dot i.on { background: var(--gold); }

.muted { color: var(--text-2); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- 进度条 ---------- */
.progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue), var(--teal));
    transition: width 0.6s ease;
}

/* ---------- 入场动画 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.show { opacity: 1; transform: translateY(0); }

/* ---------- 首页 Hero ---------- */
.hero {
    position: relative;
    min-height: 460px;
    border-radius: 26px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: linear-gradient(160deg, rgba(24, 33, 68, 0.85), rgba(16, 23, 49, 0.7));
    display: flex;
    align-items: center;
    margin-bottom: 28px;
}

.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 50px 56px;
    max-width: 620px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(79, 124, 255, 0.15);
    border: 1px solid rgba(79, 124, 255, 0.35);
    color: #bcd0ff;
    font-size: 13px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 40px;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: 1px;
    background: linear-gradient(120deg, #fff, #bcd0ff 60%, #9be9df);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p { color: var(--text-1); margin-top: 16px; font-size: 16px; }

.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

/* 统计卡片 */
.stat-card {
    position: relative;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
.stat-card:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.2); }

.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; }
.stat-sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }

.stat-accent::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--blue), var(--teal));
}

/* 科目入口卡片（3D 翻转） */
.subject-card {
    position: relative;
    padding: 28px 24px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.subject-card:hover { border-color: rgba(255, 255, 255, 0.25); box-shadow: var(--shadow); }

.subject-glow {
    position: absolute;
    width: 180px; height: 180px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    top: -40px; right: -40px;
}

.subject-card h3 { font-size: 20px; margin: 14px 0 8px; }
.subject-meta { display: flex; gap: 16px; margin-top: 18px; }
.subject-meta b { display: block; font-size: 18px; }
.subject-meta span { font-size: 12px; color: var(--text-2); }

.subject-emoji {
    width: 54px; height: 54px;
    border-radius: 16px;
    display: grid; place-items: center;
    font-size: 28px;
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- 章节 / 知识点卡片 ---------- */
.chapter-card {
    padding: 22px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    transition: transform 0.22s ease, border-color 0.22s ease;
    cursor: pointer;
}
.chapter-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.22); }

.chapter-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chapter-title { font-size: 17px; font-weight: 700; margin: 10px 0 6px; }
.chapter-points { color: var(--text-1); font-size: 13.5px; margin: 8px 0 14px; min-height: 44px; }

.chapter-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.kp-card {
    padding: 22px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    transition: transform 0.22s ease, border-color 0.22s ease;
}
.kp-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.22); }

.status-badge { font-size: 12px; padding: 3px 11px; border-radius: 999px; }
.status-new { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; }
.status-learning { background: rgba(79, 124, 255, 0.16); color: #bcd0ff; }
.status-mastered { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }

/* ---------- 知识点详情 ---------- */
.kp-hero {
    padding: 30px;
    border-radius: var(--radius);
    background: linear-gradient(150deg, rgba(79, 124, 255, 0.14), rgba(34, 184, 166, 0.08));
    border: 1px solid var(--card-border);
    margin-bottom: 22px;
}

.flip-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 22px 0; }

.flip-card { position: relative; min-height: 215px; cursor: pointer; }
.flip-inner { position: relative; width: 100%; min-height: 215px; }

.flip-face {
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--card-border);
    background: var(--card);
    display: flex;
    flex-direction: column;
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.flip-front { opacity: 1; transform: scaleX(1); }
.flip-back {
    opacity: 0;
    transform: scaleX(0);
    background: var(--card-strong);
    pointer-events: none;
}
.flip-card.flipped .flip-front { opacity: 0; transform: scaleX(0); pointer-events: none; }
.flip-card.flipped .flip-back { opacity: 1; transform: scaleX(1); pointer-events: auto; }

.flip-face h4 { font-size: 17px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.flip-face p { color: var(--text-1); font-size: 14.5px; line-height: 1.7; flex: 1; }

.point-list li {
    position: relative;
    padding: 16px 18px 16px 50px;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 1px solid var(--card-border);
    margin-bottom: 12px;
}
.point-list li::before {
    content: counter(step);
    counter-increment: step;
    position: absolute;
    left: 16px; top: 16px;
    width: 24px; height: 24px;
    border-radius: 8px;
    background: rgba(79, 124, 255, 0.2);
    color: #bcd0ff;
    display: grid; place-items: center;
    font-size: 13px;
    font-weight: 700;
}
.point-list { counter-reset: step; }

/* ---------- 刷题页面 ---------- */
.quiz-shell { max-width: 860px; margin: 0 auto; }

.quiz-progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; color: var(--text-1); font-size: 14px; }

.quiz-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 34px;
    backdrop-filter: blur(14px);
}

.q-type { margin-bottom: 16px; display: flex; gap: 10px; align-items: center; }
.q-stem { font-size: 18px; font-weight: 600; line-height: 1.8; }

.options { margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }

.option {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: flex-start;
}
.option:hover { border-color: rgba(79, 124, 255, 0.5); background: rgba(79, 124, 255, 0.08); }

.option .key {
    flex: 0 0 32px; height: 32px;
    border-radius: 10px;
    display: grid; place-items: center;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
}
.option.selected { border-color: var(--blue); background: rgba(79, 124, 255, 0.12); }
.option.selected .key { background: var(--blue); color: #fff; }

.option.correct { border-color: var(--green); background: rgba(52, 211, 153, 0.12); }
.option.correct .key { background: var(--green); color: #06281c; }
.option.wrong { border-color: var(--red); background: rgba(248, 113, 113, 0.12); }
.option.wrong .key { background: var(--red); color: #fff; }
.option.disabled { cursor: default; pointer-events: none; }

.option-text { flex: 1; }

.quiz-actions { display: flex; justify-content: space-between; margin-top: 26px; gap: 14px; flex-wrap: wrap; }

.analysis-panel {
    margin-top: 24px;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.06);
    animation: fadeUp 0.4s ease;
}
.analysis-panel h4 { color: var(--gold); margin-bottom: 10px; }
.analysis-panel p { color: var(--text-1); }

.feedback-banner {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 16px;
    font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.feedback-right { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3); }
.feedback-wrong { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.3); }

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

/* ---------- 图表 ---------- */
.chart-wrap { padding: 22px; }
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; margin-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 42px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--blue), var(--teal)); position: relative; min-height: 4px; transition: height 0.6s ease; }
.bar.empty { background: rgba(255, 255, 255, 0.08); }
.bar-label { font-size: 11.5px; color: var(--text-2); }

.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { transform: rotate(-90deg); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; color: var(--text-1); font-size: 14px; }
.legend-dot { width: 12px; height: 12px; border-radius: 4px; }

/* ---------- 记录时间线 ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--card-border); }
.timeline-item { position: relative; padding: 0 0 22px 18px; }
.timeline-item::before {
    content: ""; position: absolute; left: -26px; top: 8px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--blue); box-shadow: 0 0 0 5px rgba(79, 124, 255, 0.18);
}

/* ---------- 设置表单 ---------- */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 4px;
    border-bottom: 1px solid var(--card-border);
    gap: 20px;
}
.setting-row:last-child { border-bottom: none; }
.setting-info h4 { font-size: 15.5px; }
.setting-info p { color: var(--text-2); font-size: 13px; margin-top: 4px; }

.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; border-radius: 999px;
    background: rgba(255, 255, 255, 0.12); transition: 0.25s; cursor: pointer;
}
.switch .slider::before {
    content: ""; position: absolute; width: 24px; height: 24px;
    left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: 0.25s;
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(22px); }

select, input[type="number"] {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-0);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    min-width: 120px;
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 32px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-2);
    border: 1px solid var(--card-border);
    color: var(--text-0);
    padding: 13px 22px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .sidebar { position: relative; width: 100%; flex-direction: row; overflow-x: auto; padding: 12px; }
    .brand { display: none; }
    .main { margin-left: 0; padding: 20px 18px 60px; }
    .app-shell { flex-direction: column; }
    .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .hero-content { padding: 32px 24px; }
    .hero h1 { font-size: 28px; }
    .nav-foot { display: none; }
}
