:root {
  color-scheme: dark;
  --bg: #111115;
  --sidebar: #141418;
  --panel: #19191e;
  --panel-raised: #1f1f25;
  --line: #2c2b34;
  --text: #f6f3f2;
  --muted: #b3adb5;
  --dim: #9b949e;
  --accent: #ff7847;
  --accent-light: #ffa886;
  --green: #78d5a9;
  --red: #ff8b8b;
  --violet: #bcadf6;
  --radius: 17px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; font-size: 1rem; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible, input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 4px; }
::selection { background: #a54a31; color: white; }
[hidden], .symbols { display: none !important; }
.skip { position: fixed; left: 1rem; top: -20rem; z-index: 20; background: var(--accent); color: #20100a; padding: .7rem 1rem; }
.skip:focus { top: 1rem; }
.icon { width: 1.24em; height: 1.24em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-frame { display: grid; grid-template-columns: 227px minmax(0, 1fr); min-height: 100vh; max-width: 1800px; margin: 0 auto; }
.sidebar { display: flex; flex-direction: column; position: sticky; top: 0; align-self: start; height: 100vh; padding: 24px 17px 20px; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; margin: 0 0 43px 7px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #261007; font-size: 1.4rem; box-shadow: 0 3px 17px #ed5c362c; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.02rem; letter-spacing: .035em; }
.brand small { color: var(--dim); font-size: .78rem; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; min-height: 46px; color: var(--muted); font-size: .94rem; border-radius: 9px; border: 1px solid transparent; }
.sidebar nav a:hover { background: #1e1d23; color: var(--text); }
.sidebar nav a[aria-current="page"] { background: #32221f; color: #ffac8b; border-color: #503128; font-weight: 650; }
.nav-count { margin-left: auto; font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--accent-light); }
.sidebar-foot { margin-top: auto; padding: 12px 8px 5px; border-top: 1px solid var(--line); color: var(--dim); font-size: .76rem; }
.sidebar-foot strong { display: block; color: var(--muted); font-size: .87rem; margin-top: 2px; font-weight: 550; }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 65px; padding-inline: clamp(21px, 3.1vw, 50px); border-bottom: 1px solid var(--line); }
.location { font-size: .92rem; font-weight: 650; }
.local { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; }
.local > span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
main { width: 100%; max-width: 1420px; margin: 0 auto; padding: 29px clamp(21px, 3.1vw, 50px) 36px; flex: 1; outline: none; }
.foot { display: flex; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap; margin-inline: clamp(21px, 3.1vw, 50px); padding: 15px 0 20px; color: var(--dim); font-size: .79rem; border-top: 1px solid var(--line); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.4vw, 3rem); letter-spacing: -.04em; line-height: 1.18; }
h2 { font-size: 1.35rem; letter-spacing: -.015em; line-height: 1.3; }
h3 { font-size: 1.08rem; line-height: 1.35; }
.hero { isolation: isolate; position: relative; overflow: hidden; min-height: 350px; display: flex; align-items: center; background: #1b1116; border: 1px solid #4c2d2a; border-radius: 22px; }
.hero-image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #1a1119 0%, #1a1119f2 25%, #1a111986 49%, transparent 68%); }
.hero-content { position: relative; padding: clamp(27px, 4vw, 61px); max-width: 630px; }
.hero h1 { font-size: clamp(2.5rem, 4.8vw, 4.35rem); line-height: 1.09; letter-spacing: -.05em; margin: 11px 0 16px; }
.hero h1 span { display: block; color: var(--accent-light); }
.eyebrow { color: var(--accent-light); font-size: .87rem; font-weight: 650; letter-spacing: .18em; }
.hero p { color: #e5cbd2; max-width: 29rem; font-size: .99rem; }
.hero-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.hero-actions { margin-top: 24px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 15px; font-size: .93rem; font-weight: 680; border-radius: 10px; border: 1px solid transparent; text-align: center; transition: background .15s ease, border-color .15s ease; }
.button.primary { background: var(--accent); color: #1d0d08; }
.button.primary:hover:not(:disabled) { background: #ff966e; }
.button.secondary { color: var(--text); background: #25232a; border-color: #3e3945; }
.button.secondary:hover:not(:disabled) { background: #302c36; }
.button.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button.ghost:hover:not(:disabled) { border-color: #726576; color: var(--text); }
.button:disabled { opacity: .45; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.stat, .mode, .topic, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.stat { display: flex; align-items: center; gap: 13px; padding: 15px 17px; min-width: 0; }
.stat-icon, .mode-icon, .topic-icon { display: inline-grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; color: var(--accent-light); background: #382822; border-radius: 10px; }
.stat-icon.violet, .mode-icon.violet, .topic-icon.violet { color: var(--violet); background: #292441; }
.stat-icon.green, .mode-icon.green, .topic-icon.green { color: var(--green); background: #20362e; }
.stat-value { display: block; color: var(--text); font-weight: 750; font-size: 1.46rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .86rem; }
.section { margin-top: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; margin-bottom: 12px; }
.section-title > a { color: var(--accent-light); font-size: .86rem; }
.section-title > a:hover { text-decoration: underline; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.mode { display: flex; align-items: flex-start; flex-direction: column; text-align: left; color: var(--text); padding: 17px; width: 100%; gap: 9px; transition: border-color .15s, background .15s; }
.mode:hover { border-color: #7a4937; background: #211d20; }
.mode p, .topic p, .subtext, .panel p, .muted { color: var(--muted); }
.mode p, .topic p { font-size: .9rem; }
.mode-meta { margin-top: auto; color: var(--dim); font-size: .8rem; padding-top: 5px; }
.page-head { max-width: 850px; margin-bottom: 24px; }
.page-head p { margin-top: 10px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.topic { padding: 17px; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.topic p { flex: 1; }
.topic .button { margin-top: 5px; min-height: 37px; padding-block: 6px; }
.topic-count { color: var(--dim); font-size: .83rem; }
.panel { padding: clamp(17px, 3vw, 30px); }
.panel p + .actions, .panel h2 + p { margin-top: 12px; }
.resume { margin-top: 15px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resume strong { color: var(--text); font-size: .91rem; }
.resume p { margin: 0; font-size: .84rem; }
.empty { min-height: 208px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.list-panel { display: grid; gap: 2px; padding: 4px 16px; }
.list-row { padding: 13px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row p, .list-row small { font-size: .87rem; color: var(--muted); }
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 256px); gap: 16px; align-items: start; }
.quiz-side { display: grid; gap: 11px; }
.quiz-panel { min-height: 455px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.badges { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.badge { display: inline-flex; padding: 3px 9px; color: var(--accent-light); background: #34231f; border-radius: 6px; font-size: .86rem; font-weight: 650; }
.badge.topic-tag { background: #2b2932; color: #d8cedf; }
.quiz-index { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress { display: block; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; background: #292831; color: var(--accent); }
.progress::-webkit-progress-bar { background: #292831; }
.progress::-webkit-progress-value { background: var(--accent); }
.progress::-moz-progress-bar { background: var(--accent); }
.question { font-size: clamp(1.21rem, 2vw, 1.63rem); letter-spacing: -.01em; margin: 17px 0 12px; line-height: 1.47; }
.question:focus { outline: none; }
.option-list { display: grid; gap: 8px; margin: 14px 0; padding: 0; border: 0; min-width: 0; }
.option { display: grid; grid-template-columns: 30px minmax(0, 1fr) 19px; align-items: center; gap: 10px; position: relative; text-align: left; min-height: 53px; width: 100%; padding: 8px 11px; color: var(--text); background: #212127; border: 1px solid #34323c; border-radius: 10px; font-size: .99rem; line-height: 1.48; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option:has(input:focus-visible) { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.option:has(input:not(:disabled)) { cursor: pointer; }
.option:has(input:not(:disabled)):hover { border-color: #94716a; }
.option.selected { background: #35241f; border-color: #d47252; }
.option.correct { background: #1b332b; border-color: #459a73; }
.option.incorrect { background: #392527; border-color: #b9656e; }
.option-letter { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #302d38; color: #e1d8e4; font-weight: 700; font-size: .84rem; }
.option.selected .option-letter { background: #754733; color: #ffe0d3; }
.option.correct .option-letter { background: #275942; color: #b1efce; }
.option.incorrect .option-letter { background: #6f3943; color: #ffe0e0; }
.option-result { color: var(--green); }
.incorrect .option-result { color: var(--red); }
.quiz-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 20px; }
.quiz-actions .actions { margin-top: 0 !important; }
.answer-note { padding: 12px 14px; border: 1px solid #425943; border-radius: 10px; background: #202a23; }
.answer-note.bad { border-color: #614148; background: #302125; }
.answer-note strong { color: var(--green); }
.answer-note.bad strong { color: var(--red); }
.answer-note p { color: #e2dce0; margin-top: 4px; }
.quiz-side .panel { padding: 14px; }
.side-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-line strong { font-size: .95rem; }
.timer { color: var(--text); font-size: 1.08rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.answer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; max-height: 405px; overflow: auto; padding: 4px 3px; margin: 8px -3px 0; }
.answer-grid button { background: #232129; border: 1px solid #373440; border-radius: 5px; color: var(--muted); min-height: 30px; min-width: 0; padding: 0; font-size: .83rem; font-variant-numeric: tabular-nums; }
.answer-grid button:hover, .answer-grid button[aria-current="step"] { border-color: var(--accent); color: var(--accent-light); }
.answer-grid .done { color: #f2c6b2; background: #3b2b27; border-color: #664636; }
.answer-grid .good { color: #b0efce; background: #254235; border-color: #427359; }
.answer-grid .bad { color: #ffc1c6; background: #4a2930; border-color: #76454c; }
.side-submit { width: 100%; margin-top: 11px; }
.result-grid { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(0, 1fr); gap: 14px; }
.result-score { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 780; line-height: 1.1; margin: 12px 0; color: var(--accent-light); font-variant-numeric: tabular-nums; }
.result-facts { display: flex; gap: 14px; flex-wrap: wrap; }
.review-list { display: grid; gap: 8px; margin-top: 13px; }
.review { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.review summary { cursor: pointer; line-height: 1.6; }
.review p { margin-top: 9px; color: var(--muted); }
.good-text { color: var(--green); }
.bad-text { color: var(--red); }
.screen-note { margin-top: 12px; font-size: .84rem; color: var(--muted); }
dialog { color: var(--text); background: var(--panel-raised); border: 1px solid #554547; border-radius: var(--radius); max-width: min(430px, calc(100% - 24px)); padding: 22px; }
dialog::backdrop { background: #060508b7; }
dialog p { color: var(--muted); margin-top: 9px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@media (max-width: 1060px) {
  .app-frame { grid-template-columns: 174px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .hero-content { padding-inline: 34px; }
}
@media (max-width: 790px) {
  .app-frame { display: block; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 13px 8px; }
  .brand { margin: 0 0 8px; width: max-content; }
  .brand-mark { width: 33px; height: 33px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .sidebar nav a { padding: 7px 3px; min-height: 32px; justify-content: center; gap: 4px; font-size: .84rem; white-space: nowrap; }
  .sidebar-foot, .sidebar .nav-count { display: none; }
  .topbar { min-height: 42px; }
  main { padding-top: 16px; }
  .hero { min-height: 310px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .sidebar nav .icon { display: none; }
  .topbar { padding-inline: 15px; }
  main { padding-inline: 13px; }
  .foot { margin-inline: 13px; }
  .hero { min-height: 394px; align-items: end; }
  .hero-image { object-fit: cover; object-position: 64% center; height: 64%; }
  .hero::before { background: linear-gradient(0deg,#1a1119 0%,#1a1119 36%,#1a1119bd 47%,#1a11190f 67%); }
  .hero-content { padding: 20px 17px 19px; }
  .hero h1 { font-size: clamp(2rem, 8.9vw, 2.95rem); margin: 8px 0 9px; }
  .hero h1 span { display: inline; }
  .hero p { font-size: .91rem; }
  .hero-actions { margin-top: 14px; }
  .section { margin-top: 23px; }
  .stats { gap: 5px; }
  .stat { gap: 2px; display: block; padding: 9px 7px; }
  .stat-value { font-size: 1.18rem; }
  .stat-icon { display: none; }
  .stat-label { font-size: .75rem; }
  .mode-grid { grid-template-columns: 1fr; gap: 7px; }
  .mode { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 11px; }
  .mode-icon { grid-row: span 3; }
  .mode-meta { margin: 0; padding: 0; }
  .quiz-layout, .result-grid { grid-template-columns: 1fr; }
  .quiz-panel { min-height: auto; }
  .quiz-side .answer-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); max-height: 182px; }
  .topic-grid { gap: 7px; }
  .topic { padding: 11px; }
}
@media (max-width: 335px) {
  .topic-grid { grid-template-columns: 1fr; }
  .quiz-actions .button { padding-inline: 8px; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
