/* ── 小妍学语法 · Celadon Cool Theme ── */

:root {
  --bg: #eef3f1;
  --bg-soft: #f6f9f8;
  --bg-muted: #dde6e2;
  --surface: #ffffff;
  --surface-alt: #f3f7f5;
  --ink: #15201c;
  --ink-soft: #2c3a35;
  --text-primary: #15201c;
  --text-secondary: #55665f;
  --text-muted: #61736b;
  --text-on-dark: #f4faf7;
  --amber: #1f6f5e;
  --amber-bright: #2d8a75;
  --amber-dim: #154f43;
  --amber-bg: rgba(31, 111, 94, 0.1);
  --amber-bg-strong: rgba(31, 111, 94, 0.16);
  --vermillion: #c0453a;
  --jade: #1f6f5e;
  --jade-bg: rgba(31, 111, 94, 0.08);
  --border: rgba(21, 32, 28, 0.08);
  --border-strong: rgba(21, 32, 28, 0.14);
  --shadow: 0 2px 14px rgba(21, 32, 28, 0.05);
  --shadow-lg: 0 12px 36px rgba(21, 32, 28, 0.09);
  --radius: 8px;
  --radius-lg: 12px;
  --font-display: 'Fraunces', 'Noto Serif SC', serif;
  --font-body: 'Source Serif 4', 'Noto Serif SC', serif;
  --font-ui: 'Noto Serif SC', serif;
  --sidebar-w: 260px;
  --header-h: 68px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(31, 111, 94, 0.28);
  outline-offset: 3px;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
}

.ambient-glow {
  position: fixed;
  top: -15%;
  right: -5%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(31, 111, 94, 0.08) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

/* ── Welcome ── */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f6f9f8 0%, #e8f0ed 50%, #dce8e3 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.welcome-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-inner {
  text-align: center;
  position: relative;
  z-index: 2;
  animation: fadeUp 1s var(--transition) both;
}

.welcome-tag {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  color: var(--amber);
  margin-bottom: 2rem;
  animation: fadeUp 0.8s 0.2s var(--transition) both;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.title-line { display: block; animation: fadeUp 0.9s var(--transition) both; }
.title-line:nth-child(1) { animation-delay: 0.3s; }
.title-line:nth-child(2) { animation-delay: 0.45s; }
.title-line.accent { color: var(--amber); font-style: italic; }

.welcome-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  animation: fadeUp 0.8s 0.6s var(--transition) both;
}

.btn-enter {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: var(--surface);
  border: 1.5px solid var(--amber);
  color: var(--amber-dim);
  font-family: var(--font-ui);
  font-size: 1rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: var(--shadow);
  animation: fadeUpBtn 0.8s 0.75s var(--transition) both;
}

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

.btn-enter:hover {
  background: var(--amber);
  color: var(--text-on-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.welcome-hint {
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  animation: fadeUp 0.8s 0.9s var(--transition) both;
}

.welcome-deco {
  position: absolute;
  right: 5vw;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  opacity: 0.04;
  color: var(--ink);
}

.deco-char {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  writing-mode: vertical-rl;
}

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

/* ── App ── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.header-brand { display: flex; align-items: center; gap: 0.85rem; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--ink-soft);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(192, 69, 58, 0.16);
  background: #f6f1e7;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(88, 44, 35, 0.12);
}

.brand-seal {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.header-stats { display: flex; gap: 0.75rem; }

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 76px;
  box-shadow: var(--shadow);
}

.stat-pill.accent {
  border-color: rgba(31, 111, 94, 0.25);
  background: var(--amber-bg);
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--amber);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

.sidebar-search {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-search input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}

.sidebar-search input:focus {
  border-color: var(--amber);
  background: var(--surface);
}

.sidebar-search input::placeholder { color: var(--text-muted); }

.topic-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.4rem;
}

.topic-nav::-webkit-scrollbar { width: 4px; }
.topic-nav::-webkit-scrollbar-thumb { background: var(--bg-muted); border-radius: 2px; }

.topic-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: var(--reading-088, 0.88rem);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.topic-item:hover {
  background: var(--amber-bg);
  color: var(--ink);
}

.topic-item.active {
  background: var(--amber-bg-strong);
  color: var(--amber-dim);
  font-weight: 600;
}

.topic-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--amber);
  border-radius: 0 2px 2px 0;
}

.topic-icon { font-size: 1rem; flex-shrink: 0; }
.topic-name { flex: 1; }

.topic-count {
  min-width: 36px;
  font-family: var(--font-display);
  font-size: var(--reading-068, 0.68rem);
  text-align: right;
  color: var(--text-muted);
}

.topic-badge {
  font-size: 0.6rem;
  padding: 0.12rem 0.35rem;
  background: var(--jade);
  color: white;
  border-radius: 3px;
  opacity: 0;
}

.topic-item.done .topic-badge { opacity: 1; }

.sidebar-actions {
  padding: 0.85rem;
  border-top: 1px solid var(--border);
}

.font-scale-control {
  margin-bottom: 0.65rem;
  padding: 0.6rem 0.7rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.font-scale-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.28rem;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.72rem;
}

.font-scale-label output {
  color: var(--amber-dim);
  font-family: var(--font-display);
  font-weight: 700;
}

.font-scale-control input[type="range"] {
  display: block;
  width: 100%;
  height: 22px;
  accent-color: var(--amber);
  cursor: pointer;
}

.btn-mock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--amber);
  border: none;
  border-radius: var(--radius);
  color: var(--text-on-dark);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(31, 111, 94, 0.2);
}

.btn-mock:hover {
  background: var(--amber-bright);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(31, 111, 94, 0.28);
}

/* ── Main ── */
.main {
  flex: 1;
  padding: 1.75rem 2rem 3rem;
  max-width: 880px;
  min-width: 0;
}

.main.main--wide { max-width: 920px; }
.main.main--dashboard { max-width: 1120px; }

.topic-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
  animation: fadeUp 0.5s var(--transition) both;
}

.topic-header-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.topic-header-copy { min-width: 0; }

.topic-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.topic-kicker span {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber-dim);
  font-family: var(--font-ui);
  font-size: 0.68rem;
}

.topic-header h2 {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.topic-header p {
  font-size: var(--reading-098, 0.98rem);
  color: var(--text-secondary);
  max-width: 640px;
}

.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--ink); }

.tab-btn.active {
  color: var(--amber-dim);
  border-bottom-color: var(--amber);
  font-weight: 600;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s var(--transition) both;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--amber-dim);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title::before {
  content: '';
  width: 4px;
  height: 1em;
  background: var(--amber);
  border-radius: 1px;
}

.point-list { list-style: none; display: grid; gap: 0.65rem; }

.point-item {
  padding: 0.75rem 1rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.point-rule {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--reading-092, 0.92rem);
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.point-detail { font-size: var(--reading-088, 0.88rem); color: var(--text-muted); }

.tense-detail {
  display: grid;
  gap: 0.65rem;
  line-height: 1.85;
}

.tense-detail p { margin: 0; }

.tense-level {
  width: fit-content;
  padding: 0.16rem 0.55rem;
  border: 1px solid rgba(148, 104, 46, 0.22);
  border-radius: 999px;
  color: var(--amber-dim);
  background: rgba(197, 151, 86, 0.08);
  font-family: var(--font-ui);
  font-size: var(--reading-072, 0.72rem);
  font-weight: 600;
}

.tense-core {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(38, 97, 81, 0.13);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(38, 97, 81, 0.055);
}

.tense-form strong,
.tense-section > strong,
.tense-contrast strong,
.tense-warning strong,
.tense-core strong {
  color: var(--ink);
}

.tense-uses {
  margin: 0.35rem 0 0 1.2rem;
  display: grid;
  gap: 0.28rem;
}

.tense-uses li { padding-left: 0.2rem; }

.tense-contrast {
  padding-left: 0.75rem;
  border-left: 2px solid rgba(38, 97, 81, 0.34);
}

.tense-warning {
  padding: 0.58rem 0.72rem;
  border-radius: 7px;
  color: var(--ink-soft);
  background: rgba(192, 72, 56, 0.065);
}

.tense-signal {
  display: inline-block;
  margin-right: 0.45rem;
  padding: 0.04rem 0.42rem;
  border: 1px solid rgba(192, 72, 56, 0.2);
  border-radius: 999px;
  color: var(--vermillion);
  background: rgba(192, 72, 56, 0.055);
  font-family: var(--font-ui);
  font-size: var(--reading-072, 0.72rem);
  font-weight: 600;
  vertical-align: 0.08em;
}

.tense-en { color: var(--ink-soft); }

.tense-cn,
.tense-reason {
  display: block;
  margin-top: 0.05rem;
  color: var(--text-muted);
  font-size: var(--reading-082, 0.82rem);
  line-height: 1.65;
}

.tense-reason { color: var(--amber-dim); }

.point-item:has(.tense-detail) {
  padding: 1rem 1.1rem;
}

.point-item:has(.tense-detail) .point-rule {
  margin-bottom: 0.55rem;
  font-size: var(--reading-102, 1.02rem);
}

.point-item:has(.tense-detail) .point-examples {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
}

.point-item:has(.tense-detail) .point-examples ul {
  gap: 0.52rem;
}

.point-item:has(.tense-detail) .point-examples li {
  padding: 0.45rem 0.55rem 0.45rem 1.55rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.36);
}

.point-item:has(.tense-detail) .point-examples li::before {
  top: 0.57rem;
  left: 0.55rem;
}

.deep-detail {
  display: grid;
  gap: 0.65rem;
  line-height: 1.85;
}

.deep-detail p { margin: 0; }

.deep-level {
  width: fit-content;
  padding: 0.16rem 0.55rem;
  border: 1px solid rgba(148, 104, 46, 0.22);
  border-radius: 999px;
  color: var(--amber-dim);
  background: rgba(197, 151, 86, 0.08);
  font-family: var(--font-ui);
  font-size: var(--reading-072, 0.72rem);
  font-weight: 600;
}

.deep-core {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(38, 97, 81, 0.13);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(38, 97, 81, 0.055);
}

.deep-form strong,
.deep-section > strong,
.deep-contrast strong,
.deep-warning strong,
.deep-core strong {
  color: var(--ink);
}

.deep-steps,
.deep-uses {
  margin: 0.35rem 0 0 1.2rem;
  display: grid;
  gap: 0.28rem;
}

.deep-steps li,
.deep-uses li { padding-left: 0.2rem; }

.deep-contrast {
  padding-left: 0.75rem;
  border-left: 2px solid rgba(38, 97, 81, 0.34);
}

.deep-warning {
  padding: 0.58rem 0.72rem;
  border-radius: 7px;
  color: var(--ink-soft);
  background: rgba(192, 72, 56, 0.065);
}

.deep-label {
  display: inline-block;
  margin-right: 0.45rem;
  padding: 0.04rem 0.42rem;
  border: 1px solid rgba(192, 72, 56, 0.2);
  border-radius: 999px;
  color: var(--vermillion);
  background: rgba(192, 72, 56, 0.055);
  font-family: var(--font-ui);
  font-size: var(--reading-072, 0.72rem);
  font-weight: 600;
  vertical-align: 0.08em;
}

.deep-en { color: var(--ink-soft); }

.deep-cn,
.deep-reason {
  display: block;
  margin-top: 0.05rem;
  color: var(--text-muted);
  font-size: var(--reading-082, 0.82rem);
  line-height: 1.65;
}

.deep-reason { color: var(--amber-dim); }

.point-item:has(.deep-detail) {
  padding: 1rem 1.1rem;
}

.point-item:has(.deep-detail) .point-rule {
  margin-bottom: 0.55rem;
  font-size: var(--reading-102, 1.02rem);
}

.point-item:has(.deep-detail) .point-examples {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
}

.point-item:has(.deep-detail) .point-examples ul {
  gap: 0.52rem;
}

.point-item:has(.deep-detail) .point-examples li {
  padding: 0.45rem 0.55rem 0.45rem 1.55rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.36);
}

.point-item:has(.deep-detail) .point-examples li::before {
  top: 0.57rem;
  left: 0.55rem;
}

.point-examples {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border-strong);
}

.point-examples-label {
  margin-bottom: 0.35rem;
  color: var(--amber-dim);
  font-family: var(--font-ui);
  font-size: var(--reading-078, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.point-examples ul { list-style: none; display: grid; gap: 0.4rem; }

.point-examples li {
  position: relative;
  padding-left: 1rem;
  color: var(--ink-soft);
  font-size: var(--reading-090, 0.9rem);
  line-height: 1.75;
}

.point-examples li::before {
  content: '例';
  position: absolute;
  top: 0.12rem;
  left: 0;
  color: var(--vermillion);
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 700;
}

.point-examples em {
  color: var(--vermillion);
  font-style: normal;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(192, 72, 56, 0.25);
  text-underline-offset: 3px;
}

.example-list { list-style: none; }

.example-list li {
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: var(--reading-098, 0.98rem);
}

.example-list li:last-child { border-bottom: none; }

.example-list em,
.collocation-examples em {
  font-style: normal;
  color: var(--vermillion);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(192, 72, 56, 0.25);
  text-underline-offset: 3px;
}

/* ── Collocation reading flow ── */
.collocation-flow {
  animation: fadeUp 0.4s var(--transition) both;
}

.flow-top {
  margin-bottom: 0.75rem;
}

.collocation-search-wrap {
  position: relative;
  margin-bottom: 0.55rem;
}

.collocation-search {
  width: 100%;
  padding: 0.65rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  outline: none;
  box-shadow: var(--shadow);
}

.collocation-search:focus { border-color: var(--amber); }

.collocation-search-results {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
}

.search-result-btn {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-ui);
}

.search-result-btn:hover { background: var(--amber-bg); }
.result-phrase { font-size: 0.85rem; font-weight: 600; }
.result-cat { font-size: 0.72rem; color: var(--text-muted); }
.search-empty { font-size: 0.85rem; color: var(--text-muted); padding: 0.4rem 0; }

.flow-hotspots {
  margin-bottom: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flow-hotspots > summary {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--amber-dim);
  list-style: none;
}

.flow-hotspots > summary::-webkit-details-marker { display: none; }
.flow-hotspots > summary::before { content: '▸ '; color: var(--amber); }
.flow-hotspots[open] > summary::before { content: '▾ '; }
.flow-hotspots[open] > summary { margin-bottom: 0.5rem; }

.hotspots-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.hotspot-btn {
  padding: 0.35rem 0.7rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hotspot-btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--text-on-dark);
}

.category-strip {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.45rem 0;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar { display: none; }

.flow-sticky-cats {
  position: sticky;
  top: var(--header-h);
  z-index: 8;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  margin: 0 0 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.category-pill {
  flex-shrink: 0;
  padding: 0.4rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.category-pill:hover {
  border-color: var(--amber);
  color: var(--ink);
}

.category-pill.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--text-on-dark);
  font-weight: 600;
}

.pill-count {
  opacity: 0.72;
  font-size: 0.7rem;
  margin-left: 0.12rem;
}

.flow-cat-head {
  margin-bottom: 1rem;
}

.flow-cat-head h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.flow-cat-head p {
  font-size: var(--reading-092, 0.92rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

.flow-cat-count {
  margin-top: 0.35rem !important;
  font-size: var(--reading-080, 0.8rem) !important;
  color: var(--amber-dim) !important;
  font-weight: 600;
}

.cheat-table-wrap {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.cheat-table-wrap > summary.cheat-title {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--amber-dim);
  cursor: pointer;
  list-style: none;
}

.cheat-table-wrap > summary.cheat-title::-webkit-details-marker { display: none; }
.cheat-table-wrap > summary.cheat-title::before { content: '▸ '; color: var(--amber); }
.cheat-table-wrap[open] > summary.cheat-title::before { content: '▾ '; }
.cheat-table-wrap[open] > summary.cheat-title { margin-bottom: 0.55rem; }

.cheat-summary {
  font-size: var(--reading-086, 0.86rem);
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
  line-height: 1.55;
}

.cheat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--reading-084, 0.84rem);
}

.cheat-table th {
  text-align: left;
  font-family: var(--font-ui);
  font-size: var(--reading-072, 0.72rem);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.35rem 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cheat-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px dotted var(--border);
  vertical-align: top;
  line-height: 1.45;
  color: var(--ink-soft);
}

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

.cheat-table code {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: var(--reading-086, 0.86rem);
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem 1.2rem;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--header-h) + 3.5rem);
}

.entry--hot {
  border-color: rgba(31, 111, 94, 0.28);
  box-shadow: 0 2px 18px rgba(31, 111, 94, 0.08);
}

.entry-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
  margin-bottom: 0.35rem;
}

.entry-badge {
  font-size: var(--reading-068, 0.68rem);
  font-weight: 700;
  color: var(--text-on-dark);
  background: var(--amber);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.entry-phrase {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.entry-wrong {
  font-size: var(--reading-078, 0.78rem);
  color: var(--vermillion);
  background: rgba(192, 69, 58, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

.entry-meaning {
  font-size: var(--reading-095, 0.95rem);
  color: var(--amber-dim);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.entry-tip {
  font-size: var(--reading-088, 0.88rem);
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--amber-bg);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
}

.entry-compare {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.entry-compare-cell {
  padding: 0.65rem 0.75rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border-left: 3px solid var(--jade);
}

.entry-compare-cell span {
  display: block;
  font-size: var(--reading-072, 0.72rem);
  font-weight: 700;
  color: var(--jade);
  margin-bottom: 0.25rem;
}

.entry-compare-cell p {
  font-size: var(--reading-086, 0.86rem);
  line-height: 1.5;
  color: var(--ink-soft);
}

.entry-examples {
  list-style: none;
  margin: 0;
}

.entry-examples li {
  position: relative;
  padding: 0.45rem 0 0.45rem 0.95rem;
  font-size: var(--reading-094, 0.94rem);
  line-height: 1.6;
  border-bottom: 1px dotted var(--border);
  color: var(--ink-soft);
}

.entry-examples li:last-child { border-bottom: none; }

.entry-examples li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--amber);
  font-weight: bold;
}

.entry-examples em {
  font-style: normal;
  color: var(--vermillion);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(192, 69, 58, 0.25);
  text-underline-offset: 3px;
}

.entry-more {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.entry-more > summary {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: var(--reading-080, 0.8rem);
  font-weight: 600;
  color: var(--jade);
  list-style: none;
}

.entry-more > summary::-webkit-details-marker { display: none; }
.entry-more[open] > summary { margin-bottom: 0.55rem; }

.entry-note {
  font-size: var(--reading-086, 0.86rem);
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0.75rem 0.9rem;
  background: var(--jade-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--jade);
  margin-top: 0.5rem;
}

/* ── Quiz ── */
.quiz-index-strip {
  display: flex;
  gap: 0.42rem;
  padding: 0.25rem 0.1rem 0.9rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.quiz-index {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  cursor: pointer;
}

.quiz-index.attempted { border-color: var(--vermillion); color: var(--vermillion); }
.quiz-index.solved { border-color: var(--jade); background: var(--jade-bg); color: var(--jade); }
.quiz-index.current { background: var(--amber); border-color: var(--amber); color: white; }

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.quiz-source-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quiz-year {
  font-size: var(--reading-078, 0.78rem);
  font-weight: 600;
  color: var(--amber-dim);
  background: var(--amber-bg);
  padding: 0.28rem 0.7rem;
  border-radius: 4px;
}

.quiz-type,
.quiz-question-no {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: var(--reading-070, 0.7rem);
}

.quiz-num { font-size: var(--reading-078, 0.78rem); color: var(--text-muted); }

.quiz-stem {
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-alt);
  font-size: var(--reading-108, 1.08rem);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.options-list { list-style: none; display: grid; gap: 0.55rem; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--reading-098, 0.98rem);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--amber);
  background: var(--surface);
}

.option-btn:disabled { cursor: default; }

.option-label {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}

.option-btn.correct {
  border-color: var(--jade);
  background: var(--jade-bg);
}

.option-btn.correct .option-label { background: var(--jade); color: white; }

.option-btn.wrong {
  border-color: var(--vermillion);
  background: rgba(192, 72, 56, 0.06);
}

.option-btn.wrong .option-label { background: var(--vermillion); color: white; }

.option-btn.reveal-correct { border-color: var(--jade); border-style: dashed; }

.text-answer-form {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}

.text-answer-form label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: var(--reading-085, 0.85rem);
  font-weight: 600;
}

.answer-hint {
  margin: -0.2rem 0 0.65rem;
  color: var(--text-muted);
  font-size: var(--reading-078, 0.78rem);
}

.text-answer-row {
  display: flex;
  gap: 0.6rem;
}

.text-answer-row input {
  min-width: 0;
  flex: 1;
  padding: 0.78rem 0.9rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.text-answer-row input:focus { border-color: var(--amber); outline: none; }

.btn-submit-answer,
.btn-retry {
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--amber);
  color: var(--text-on-dark);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid;
  border-radius: var(--radius-lg);
}

.quiz-feedback.is-correct { border-color: rgba(31, 111, 94, 0.35); background: var(--jade-bg); }
.quiz-feedback.is-wrong { border-color: rgba(192, 69, 58, 0.3); background: rgba(192, 69, 58, 0.055); }

.feedback-title {
  margin-bottom: 0.65rem;
  font-family: var(--font-ui);
  font-weight: 700;
}

.is-correct .feedback-title { color: var(--jade); }
.is-wrong .feedback-title { color: var(--vermillion); }

.answer-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.answer-compare > div {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.72);
}

.answer-compare dt { color: var(--text-muted); font-size: var(--reading-070, 0.7rem); }
.answer-compare dd { color: var(--ink); font-weight: 600; word-break: break-word; }
.quiz-feedback p { color: var(--text-secondary); font-size: var(--reading-090, 0.9rem); }
.btn-retry { margin-top: 0.8rem; background: var(--surface); border: 1px solid var(--vermillion); color: var(--vermillion); }

.question-provenance {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.15rem;
  padding: 0.8rem 0.9rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.question-provenance > div { display: flex; flex-direction: column; }
.question-provenance span,
.question-provenance small { color: var(--text-muted); font-size: var(--reading-068, 0.68rem); }
.question-provenance strong { color: var(--ink-soft); font-family: var(--font-ui); font-size: var(--reading-076, 0.76rem); }
.question-provenance a { color: var(--amber-dim); font-family: var(--font-ui); font-size: var(--reading-076, 0.76rem); text-decoration: none; }
.question-provenance a:hover { text-decoration: underline; }

.quiz-explain {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--jade-bg);
  border-left: 3px solid var(--jade);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--reading-092, 0.92rem);
  color: var(--text-muted);
}

.quiz-explain strong { color: var(--jade); font-family: var(--font-ui); }

.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  gap: 1rem;
}

.btn-nav {
  padding: 0.65rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nav:hover:not(:disabled) {
  background: var(--amber);
  color: var(--text-on-dark);
  border-color: var(--amber);
}

.btn-nav:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Dashboard ── */
.dashboard { animation: fadeUp 0.5s var(--transition) both; }

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--amber) !important;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.dashboard-hero h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.dashboard-hero p { color: var(--text-secondary); }

.verification-seal {
  width: 108px;
  height: 108px;
  display: grid;
  place-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(31, 111, 94, 0.3);
  border-radius: 50%;
  background: var(--amber-bg);
  color: var(--amber-dim);
  text-align: center;
  transform: rotate(-4deg);
}

.verification-seal span { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; }
.verification-seal strong { font-family: var(--font-display); font-size: 0.66rem; }

.bank-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(31, 111, 94, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.66);
  color: var(--text-secondary);
  font-size: var(--reading-086, 0.86rem);
}

.bank-notice-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--jade);
  color: white;
  font-size: 0.72rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.topic-card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  color: inherit;
  font: inherit;
  box-shadow: var(--shadow);
}

.topic-card-top,
.topic-card-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.question-count {
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber-dim);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
}

.topic-card:hover {
  border-color: rgba(31, 111, 94, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.topic-card-icon { font-size: 1.6rem; margin-bottom: 0.6rem; }

.topic-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.topic-card p {
  font-size: var(--reading-078, 0.78rem);
  color: var(--text-muted);
  line-height: 1.45;
}

.topic-card-metrics {
  margin-top: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: var(--reading-070, 0.7rem);
}

.topic-card-progress {
  margin-top: 0.75rem;
  height: 3px;
  background: var(--bg-muted);
  border-radius: 2px;
  overflow: hidden;
}

.topic-card-progress-bar {
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.source-audit {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.65);
}

.source-audit summary {
  color: var(--amber-dim);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.source-audit > p { margin: 0.75rem 0; color: var(--text-secondary); font-size: var(--reading-082, 0.82rem); }
.source-audit ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 1rem; padding-left: 1.1rem; }
.source-audit a { color: var(--ink-soft); font-size: var(--reading-078, 0.78rem); text-decoration: none; }

.exam-result-detail .quiz-stem { font-size: var(--reading-095, 0.95rem); }
.source-audit a:hover { color: var(--amber); text-decoration: underline; }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 20, 0.35);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 85vh;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.35s var(--transition) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
}

.modal-close:hover { background: var(--bg-muted); color: var(--ink); }

.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }

.exam-intro p { margin-bottom: 0.85rem; color: var(--text-muted); }

.exam-intro .btn-start-exam {
  display: block;
  width: 100%;
  padding: 0.9rem;
  margin-top: 1.25rem;
  background: var(--amber);
  border: none;
  border-radius: var(--radius);
  color: var(--text-on-dark);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.exam-intro .btn-start-exam:hover { background: var(--amber-bright); }

.exam-result { text-align: center; padding: 0.75rem 0; }

.exam-score {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.exam-score-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.exam-result-detail { text-align: left; margin-top: 1.25rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .flow-sticky-cats {
    top: 0;
  }

  .entry {
    scroll-margin-top: calc(var(--header-h) + 4rem);
  }

  .cheat-table { font-size: 0.78rem; }
  .cheat-table th:nth-child(3),
  .cheat-table td:nth-child(3) { display: none; }

  .entry-compare {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root { --sidebar-w: min(86vw, 320px); --header-h: 64px; }

  .header {
    height: var(--header-h);
    padding: 0 0.75rem;
    gap: 0.55rem;
  }

  .nav-toggle { display: block; flex: 0 0 auto; }
  .brand-mark { display: flex; width: 34px; height: 34px; flex: 0 0 auto; }
  .brand-title { font-size: 1rem; }
  .brand-sub { display: none; }

  .header-stats { gap: 0.25rem; margin-left: auto; }
  .stat-pill { min-width: 50px; padding: 0.2rem 0.35rem; box-shadow: none; }
  .stat-num { font-size: 0.9rem; }
  .stat-label { font-size: 0.52rem; letter-spacing: 0; }

  .layout { display: block; }

  .sidebar {
    position: fixed;
    z-index: 45;
    top: var(--header-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    max-height: none;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { transform: translateX(0); }

  body.nav-open .app::after {
    content: '';
    position: fixed;
    z-index: 40;
    inset: var(--header-h) 0 0;
    background: rgba(21, 32, 28, 0.32);
    backdrop-filter: blur(2px);
  }

  .main { width: 100%; max-width: none; padding: 1.25rem 1rem 2.5rem; }
  .topic-header h2 { font-size: 1.65rem; }
  .topic-header-icon { width: 46px; height: 46px; font-size: 1.4rem; }
  .dashboard-hero { align-items: flex-start; }
  .verification-seal { width: 78px; height: 78px; }
  .verification-seal span { font-size: 0.66rem; }
  .source-audit ul { grid-template-columns: 1fr; }
  .quiz-meta { align-items: flex-start; gap: 0.75rem; }
  .quiz-num { white-space: nowrap; padding-top: 0.25rem; }
  .question-provenance { grid-template-columns: 1fr; gap: 0.4rem; }
  .answer-compare { grid-template-columns: 1fr; }
  .welcome-deco { display: none; }
}

@media (max-width: 520px) {
  .brand-title { display: none; }
  .dashboard-hero { display: block; }
  .verification-seal { display: none; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card { padding: 1rem; }
  .text-answer-row { flex-direction: column; }
  .btn-submit-answer { width: 100%; }
  .quiz-meta { display: block; }
  .quiz-num { display: block; margin-top: 0.55rem; }
  .tab-btn { padding: 0.7rem 0.8rem; font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
