/* ============================================================
   孩子所学的一切 · 设计系统 (Design System)
   Ethereal Glass 暗色星图范式 · Parchment (light) 可选
   ============================================================ */
:root {
  --serif: "Fraunces", "Noto Serif SC", Georgia, serif;
  --sans: "Noto Sans SC", "Space Grotesk", system-ui, -apple-system, sans-serif;

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --topbar-h: 64px;
  --sidebar-w: 286px;
  --panel-w: 384px;
  --maxw: 1760px;                 /* 顶栏 / 学科条 / 进度栏统一最大宽度，确保 9 学科一行完整展示 */

  /* 顶部堆叠：顶栏 → 学科条 → 控制台 */
  --top-gap: 14px;
  --stack-gap: 10px;
  --subjectbar-h: 54px;
  --controls-top: calc(var(--top-gap) + var(--topbar-h) + var(--stack-gap) + var(--subjectbar-h) + var(--stack-gap));
}

/* ---- Obsidian (dark) ---- */
[data-theme="dark"] {
  --bg: #060912;
  --bg-2: #0A0C18;
  --surface: rgba(255,255,255,0.045);
  --surface-2: rgba(255,255,255,0.075);
  --surface-solid: #0E1120;
  --hairline: rgba(255,255,255,0.12);
  --hairline-soft: rgba(255,255,255,0.07);
  --text: #ECECF3;
  --text-2: #A9B0C2;
  --text-3: #838BA2;
  --accent: #9D8CFF;
  --accent-soft: rgba(157,140,255,0.16);
  --accent-2: #6E8BFF;
  --cool: #7FB6FF;
  --warm: #FFC16B;
  --cn-gold: #E8B23D;
  --shadow: 0 24px 70px -24px rgba(0,0,0,0.82);
  --shadow-sm: 0 10px 30px -16px rgba(0,0,0,0.7);
  --grain-op: 0.06;
  color-scheme: dark;
}
/* ---- Parchment (light) ---- */
[data-theme="light"] {
  --bg: #F4F2FB;
  --bg-2: #E9E6F5;
  --surface: rgba(34,28,66,0.035);
  --surface-2: rgba(34,28,66,0.06);
  --surface-solid: #FBFAFF;
  --hairline: rgba(34,28,66,0.14);
  --hairline-soft: rgba(34,28,66,0.08);
  --text: #15131F;
  --text-2: #514C66;
  --text-3: #7E7894;
  --accent: #6B5BD6;
  --accent-soft: rgba(107,91,214,0.16);
  --accent-2: #4F6BE0;
  --cool: #2E73D6;
  --warm: #C0731A;
  --cn-gold: #9A6510;
  --shadow: 0 24px 60px -28px rgba(60,50,95,0.42);
  --shadow-sm: 0 10px 28px -18px rgba(60,50,95,0.36);
  --grain-op: 0.035;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 600ms var(--ease-out), color 400ms var(--ease-out);
}
button, input { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* ============================================================
   背景氛围层
   ============================================================ */
.aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; filter: blur(60px); opacity: 0.9; }
.aurora-blob { position: absolute; border-radius: 50%; mix-blend-mode: screen; will-change: transform; }
[data-theme="light"] .aurora { opacity: 0.5; mix-blend-mode: multiply; }
.aurora-blob.a { width: 46vw; height: 46vw; left: 4%; top: 6%;
  background: radial-gradient(circle at 30% 30%, rgba(110,91,255,0.50), transparent 62%);
  animation: drift1 26s var(--ease-inout) infinite alternate; }
.aurora-blob.b { width: 42vw; height: 42vw; right: 2%; top: 18%;
  background: radial-gradient(circle at 50% 50%, rgba(176,124,255,0.42), transparent 62%);
  animation: drift2 32s var(--ease-inout) infinite alternate; }
.aurora-blob.c { width: 40vw; height: 40vw; left: 28%; bottom: 2%;
  background: radial-gradient(circle at 50% 50%, rgba(91,200,255,0.36), transparent 62%);
  animation: drift3 30s var(--ease-inout) infinite alternate; }
@keyframes drift1 { to { transform: translate3d(8vw, 6vh, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-7vw, 8vh, 0) scale(1.1); } }
@keyframes drift3 { to { transform: translate3d(6vw, -7vh, 0) scale(1.2); } }

.grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 40%, transparent 55%, rgba(0,0,0,0.32) 100%); }
[data-theme="light"] .vignette { background: radial-gradient(120% 100% at 50% 40%, transparent 60%, rgba(60,45,20,0.12) 100%); }

#graph-canvas { position: fixed; inset: 0; z-index: 2; width: 100%; height: 100%; display: block; touch-action: none; }

/* ============================================================
   玻璃质感 (double-bezel)
   ============================================================ */
.glass {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.10);
  position: relative;
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), transparent 38%);
}
[data-theme="light"] .glass { box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.6); }
[data-theme="light"] .glass::before { background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent 40%); }

/* ============================================================
   顶栏 (floating island)
   ============================================================ */
.topbar {
  position: fixed; top: var(--top-gap); left: 50%; transform: translateX(-50%);
  z-index: 40; height: var(--topbar-h); width: calc(100% - 28px); max-width: var(--maxw);
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  border-radius: var(--r-pill);
}

/* ============================================================
   学科筛选条（独立全宽行，确保 8 个学科完整可达）
   ============================================================ */
.subjectbar {
  position: fixed; top: calc(var(--top-gap) + var(--topbar-h) + var(--stack-gap)); left: 50%; transform: translateX(-50%);
  z-index: 39; height: var(--subjectbar-h); width: calc(100% - 28px); max-width: var(--maxw);
  display: flex; align-items: center; gap: 6px; padding: 0 8px;
  border-radius: var(--r-pill);
}
.subjectbar .filters { flex: 1; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.subjectbar .chip { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 9px; font-size: 12.5px; gap: 6px; }
.subjectbar .chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.subjectbar .chip .cnt { font-size: 10.5px; }
.subjectbar .sb-scroll { display: none; }
.sb-scroll {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1;
  transition: transform 160ms var(--ease-out), background 200ms, color 200ms, border-color 200ms, opacity 200ms;
}
.sb-scroll:hover { color: var(--text); background: var(--surface); border-color: var(--hairline); }
.sb-scroll:active { transform: scale(0.9); }
.sb-scroll[disabled] { opacity: 0.22; cursor: default; pointer-events: none; }

/* ============================================================
   全局焦点环（无障碍）
   ============================================================ */
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 75%, #fff); outline-offset: 2px; border-radius: 8px; }
[data-theme="light"] :focus-visible { outline-color: color-mix(in srgb, var(--accent) 70%, #222); }
:focus:not(:focus-visible) { outline: none; }

/* ============================================================
   轻量 Toast 提示（标记即时反馈 / 复盘入口）
   ============================================================ */
.toast-stack { position: fixed; z-index: 96; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: min(460px, 92vw);
  padding: 12px 14px 12px 14px; border-radius: var(--r-md); background: var(--surface-solid);
  border: 1px solid var(--hairline); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 13.5px; color: var(--text-2); line-height: 1.5; transform: translateY(14px); opacity: 0;
  transition: transform 380ms var(--ease-out), opacity 320ms; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast b { color: var(--text); font-weight: 600; }
.toast .toast-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 15px; background: var(--accent-soft); color: var(--accent); }
.toast .toast-act { margin-left: auto; flex: none; padding: 6px 13px; border-radius: var(--r-pill); border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: all 200ms var(--ease-out); }
.toast .toast-act:hover { background: var(--surface); border-color: var(--hairline); transform: translateY(-1px); }
.brand { display: flex; align-items: center; gap: 10px; padding-left: 6px; flex: none; }
.brand-mark { width: 16px; height: 16px; border-radius: 5px; flex: none;
  background: conic-gradient(from 210deg, var(--accent), #5B9DFF, #34D399, #C067E0, var(--accent));
  box-shadow: 0 0 14px rgba(232,201,138,0.5); }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: 0.5px; }

.filters { display: flex; gap: 7px; overflow-x: auto; flex: 1; scrollbar-width: none; mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1px solid var(--hairline-soft);
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background 200ms, color 200ms, border-color 200ms, opacity 200ms;
}
.chip:hover { color: var(--text); transform: translateY(-1px); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.chip.off { opacity: 0.38; }
.chip.off .dot { box-shadow: none; }
.chip .cnt { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip:active { transform: scale(0.96); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.layout-switch { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--hairline-soft); }
.ls-btn { border: 0; background: transparent; color: var(--text-3); height: 30px; padding: 0 11px; border-radius: var(--r-pill); cursor: pointer; font-size: 13px; font-weight: 500; transition: color 200ms, background 240ms var(--ease-out); }
.ls-btn.is-active { background: var(--text); color: var(--bg); }

.icon-btn { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 1px solid var(--hairline-soft);
  background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center;
  transition: transform 160ms var(--ease-out), background 200ms, color 200ms, border-color 200ms; }
.icon-btn:hover { color: var(--text); background: var(--surface); border-color: var(--hairline); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.search { position: relative; display: flex; align-items: center; width: 200px; transition: width 360ms var(--ease-out); }
.search:focus-within { width: 264px; }
.search-ico { position: absolute; left: 12px; width: 16px; height: 16px; fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
#search-input { width: 100%; height: 38px; border-radius: var(--r-pill); border: 1px solid var(--hairline-soft);
  background: var(--surface-2); padding: 0 14px 0 36px; font-size: 13.5px; outline: none; color: var(--text);
  transition: border-color 200ms, background 200ms; }
#search-input::placeholder { color: var(--text-3); }
#search-input:focus { border-color: var(--hairline); background: var(--surface); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; max-height: 320px; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--hairline); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; transition: background 140ms; }
.sr-item:hover, .sr-item.active { background: var(--accent-soft); }
.sr-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sr-item .sr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item .sr-dom { color: var(--text-3); font-size: 11.5px; flex: none; }

.menu-btn { display: none; flex-direction: column; gap: 4px; }
.menu-btn span { width: 16px; height: 1.6px; background: currentColor; border-radius: 2px; transition: transform 300ms var(--ease-drawer), opacity 200ms; }

/* ============================================================
   开场 Hero
   ============================================================ */
.intro { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  transition: opacity 700ms var(--ease-out), visibility 700ms; }
.intro::before { content: ""; position: absolute; inset: 0; background: var(--bg); opacity: 0.72; backdrop-filter: blur(6px); }
.intro-inner { position: relative; max-width: 760px; text-align: center; }
.eyebrow { display: inline-block; font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; padding: 7px 16px; border: 1px solid var(--hairline); border-radius: var(--r-pill);
  background: var(--surface); margin-bottom: 26px; }
.intro-title { font-family: var(--serif); font-weight: 700; font-size: clamp(40px, 8.2vw, 100px); line-height: 1.04; white-space: nowrap; max-width: 100%;
  letter-spacing: 0.02em; background: linear-gradient(180deg, var(--text), var(--text-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-sub { margin: 26px auto 0; max-width: 620px; font-size: clamp(15px, 2.4vw, 17px); line-height: 1.85; color: var(--text-2); }
.intro-sub .hl { color: var(--text); font-weight: 500; }
.intro-sub strong { color: var(--accent); font-family: var(--serif); font-weight: 600; }
.intro-stats { display: flex; justify-content: center; gap: 14px; margin: 34px 0 38px; flex-wrap: wrap; }
.stat { min-width: 110px; padding: 16px 22px; border-radius: var(--r-md); border: 1px solid var(--hairline-soft); background: var(--surface); }
.stat b { display: block; font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1; color: var(--text); }
.stat span { font-size: 12.5px; color: var(--text-3); letter-spacing: 0.08em; }
.intro-foot { margin-top: 26px; font-size: 12px; color: var(--text-3); letter-spacing: 0.04em; }

.btn-primary { display: inline-flex; align-items: center; gap: 14px; height: 56px; padding: 0 14px 0 28px;
  border-radius: var(--r-pill); border: 1px solid rgba(232,201,138,0.5); cursor: pointer;
  background: linear-gradient(180deg, rgba(232,201,138,0.22), rgba(232,201,138,0.08));
  color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: 0.04em;
  transition: transform 220ms var(--ease-out), box-shadow 300ms; box-shadow: 0 10px 36px -14px rgba(232,201,138,0.5); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 48px -16px rgba(232,201,138,0.6); }
.btn-primary:active { transform: scale(0.98); }
.btn-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #1A1206; display: grid; place-items: center; font-size: 16px; transition: transform 240ms var(--ease-out); }
.btn-primary:hover .btn-ico { transform: translate(2px, -2px); }
.btn-ico-sm { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; }

.intro-fade { position: absolute; bottom: 0; left: 0; right: 0; height: 30%; pointer-events: none;
  background: linear-gradient(transparent, var(--bg)); }

body:not([data-loading="true"]) .intro { opacity: 0; visibility: hidden; pointer-events: none; }

/* ============================================================
   侧栏控制台
   ============================================================ */
.sidebar { position: fixed; left: 14px; top: var(--controls-top); z-index: 30; width: var(--sidebar-w);
  padding: 18px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - var(--controls-top) - 24px); overflow-y: auto; }
.sb-section { display: flex; flex-direction: column; gap: 11px; }
.sb-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.age-hint { text-transform: none; letter-spacing: 0; color: var(--accent); font-size: 11.5px; }

.legend-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--r-sm); cursor: pointer; transition: background 160ms; }
.legend-row:hover { background: var(--surface-2); }
.legend-row.off { opacity: 0.4; }
.legend-row .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 9px currentColor; }
.legend-row .lg-name { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .lg-cnt { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.age-quick { display: flex; gap: 6px; }
.age-q { flex: 1; height: 32px; border-radius: var(--r-sm); border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 12.5px; transition: all 180ms var(--ease-out); }
.age-q:hover { color: var(--text); }
.age-q.is-active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.age-dial { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: var(--hairline); outline: none; margin-top: 4px; }
.age-dial::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 0 0 4px var(--accent-soft); }
.age-dial::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--accent); cursor: pointer; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sg-item { padding: 12px 13px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--hairline-soft); }
.sg-item b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; color: var(--text); }
.sg-item span { font-size: 11px; color: var(--text-3); }

.subject-bars { display: flex; flex-direction: column; gap: 7px; }
.sb-bar { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.sb-bar .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sb-bar .track { flex: 1; height: 6px; border-radius: 6px; background: var(--hairline-soft); overflow: hidden; }
.sb-bar .fill { height: 100%; border-radius: 6px; transition: width 600ms var(--ease-out); }
.sb-bar .num { color: var(--text-3); font-variant-numeric: tabular-nums; width: 30px; text-align: right; }

.help-btn { display: flex; align-items: center; justify-content: center; gap: 9px; height: 42px; border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: transform 180ms var(--ease-out), background 200ms, border-color 200ms; }
.help-btn:hover { background: var(--surface); border-color: var(--hairline); transform: translateY(-1px); }
.help-btn:active { transform: scale(0.98); }
.help-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ============================================================
   提示 / 工具提示
   ============================================================ */
.hint { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 25;
  display: flex; gap: 9px; align-items: center; padding: 9px 18px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--hairline-soft); backdrop-filter: blur(14px);
  font-size: 12px; color: var(--text-3); letter-spacing: 0.03em; opacity: 0; transition: opacity 500ms; pointer-events: none; }
.hint.show { opacity: 1; }
.hint i { color: var(--hairline); font-style: normal; }

/* ============================================================
   中国课标主线 · 漫游控制条（金色玻璃胶囊）
   ============================================================ */
.cn-line-bar {
  position: fixed; bottom: 18px; left: 50%; z-index: 45;
  display: none; align-items: center; gap: 8px;
  padding: 8px 9px 8px 8px; border-radius: var(--r-pill);
  opacity: 0; transform: translateX(-50%) translateY(16px);
  transition: opacity 440ms var(--ease-out), transform 440ms var(--ease-out);
  border-color: color-mix(in srgb, var(--cn-gold) 42%, transparent);
  box-shadow: var(--shadow), 0 0 34px -12px var(--cn-gold), inset 0 1px 0 rgba(255,255,255,0.10);
}
body.cn-line .cn-line-bar, .cn-line-bar.show {
  display: flex; opacity: 1; transform: translateX(-50%) translateY(0);
}
.cn-line-bar .clb-x {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text-3);
  cursor: pointer; font-size: 12px; display: grid; place-items: center;
  transition: transform 240ms var(--ease-out), color 200ms, border-color 200ms, background 200ms;
}
.cn-line-bar .clb-x:hover { color: var(--text); border-color: var(--hairline); transform: rotate(90deg); }
.cn-line-bar .clb-nav {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text);
  cursor: pointer; font-size: 22px; line-height: 1; display: grid; place-items: center;
  transition: transform 160ms var(--ease-out), color 200ms, border-color 200ms, background 200ms;
}
.cn-line-bar .clb-nav:hover { color: var(--cn-gold); border-color: color-mix(in srgb, var(--cn-gold) 55%, transparent); background: color-mix(in srgb, var(--cn-gold) 14%, transparent); }
.cn-line-bar .clb-nav:active { transform: scale(0.9); }
.cn-line-bar .clb-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 8px; min-width: 158px; }
.cn-line-bar .clb-label { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--cn-gold); font-weight: 600; opacity: 0.92; }
.cn-line-bar .clb-stage { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text); line-height: 1.15; white-space: nowrap; }
.cn-line-bar .clb-count { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 顶栏「中国课标主线」按钮激活态 */
#cn-line-btn.is-active {
  color: var(--cn-gold); border-color: color-mix(in srgb, var(--cn-gold) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cn-gold) 30%, transparent), 0 0 18px -4px var(--cn-gold);
}

/* 顶栏「旋转视角」按钮激活态（3D 布局自动开启 · 手动可切换） */
#rotate-btn.is-active {
  color: var(--cn-gold); border-color: color-mix(in srgb, var(--cn-gold) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cn-gold) 30%, transparent), 0 0 18px -4px var(--cn-gold);
}
#rotate-btn.is-active svg { animation: rotSpin 3.4s linear infinite; transform-origin: 50% 50%; }
@keyframes rotSpin { to { transform: rotate(360deg); } }

.tooltip { position: fixed; z-index: 70; max-width: 280px; padding: 10px 13px; border-radius: var(--r-md);
  background: var(--surface-solid); border: 1px solid var(--hairline); box-shadow: var(--shadow); backdrop-filter: blur(10px);
  font-size: 13px; line-height: 1.45; transform: translate(-50%, calc(-100% - 14px)); transition: opacity 140ms; pointer-events: none; }
.tooltip .tt-sub { font-size: 11px; color: var(--text-3); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.tooltip .tt-sub .dot { width: 7px; height: 7px; border-radius: 50%; }
.tooltip .tt-dom { color: var(--accent); font-size: 11px; margin-top: 4px; }

/* ============================================================
   详情面板
   ============================================================ */
.panel { position: fixed; right: 14px; top: var(--controls-top); z-index: 35; width: var(--panel-w);
  max-height: calc(100vh - var(--controls-top) - 24px); padding: 0; display: flex; flex-direction: column;
  transform: translateX(calc(100% + 28px)); opacity: 0; transition: transform 520ms var(--ease-out), opacity 360ms; pointer-events: none; }
.panel.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.panel-scroll { padding: 24px 24px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.panel-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 32px; height: 32px; font-size: 14px; }
.panel-head { padding-right: 36px; }
.panel-subject { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--hairline-soft); background: var(--surface-2); margin-bottom: 12px; }
.panel-subject .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.panel-title { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.25; letter-spacing: 0.01em; }
.panel-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.meta-tag { font-size: 11.5px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--hairline-soft); color: var(--text-2); }
.meta-tag b { color: var(--text); font-weight: 600; }

.panel-block { display: flex; flex-direction: column; gap: 9px; }
.block-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.panel-desc, .panel-assess { font-size: 14px; line-height: 1.78; color: var(--text-2); }
.panel-evidence { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.panel-evidence li { position: relative; padding-left: 22px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.panel-evidence li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }

.panel-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel-col { gap: 8px; }
.panel-links { list-style: none; display: flex; flex-direction: column; gap: 5px; max-height: 230px; overflow-y: auto; }
.link-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--hairline-soft); cursor: pointer; font-size: 13px; line-height: 1.4; transition: transform 160ms var(--ease-out), background 180ms, border-color 180ms; }
.link-item:hover { transform: translateX(3px); background: var(--surface); border-color: var(--hairline); }
.link-item .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.link-item .li-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-item .li-depth { font-size: 10.5px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }
.cnt { color: var(--accent); font-weight: 700; margin-left: 4px; }

.panel-standards { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.st-group { display: flex; flex-direction: column; gap: 7px; }
.st-group-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--hairline-soft); }
.st-group-label { font-size: 12.5px; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }
.st-group-note { font-size: 11px; color: var(--text-3); }
.st-list { display: flex; flex-direction: column; gap: 6px; }
.st-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--hairline-soft); }
.st-item .st-code { font-size: 11px; color: var(--text-3); font-family: var(--sans); letter-spacing: 0.03em; }
.st-item .st-title { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.st-item .st-zh { font-size: 11.5px; color: var(--accent); margin-top: 1px; }
.st-item .st-meta { font-size: 11px; color: var(--text-3); }
.st-more { font-size: 11.5px; color: var(--text-3); padding: 2px 2px 0; }

.panel-actions { display: flex; gap: 9px; margin-top: 4px; }
.btn-ghost { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: transform 180ms var(--ease-out), background 200ms, border-color 200ms; }
.btn-ghost:hover { background: var(--surface); border-color: var(--hairline); transform: translateY(-1px); }
.btn-ghost:active { transform: scale(0.98); }

/* ============================================================
   覆盖层 / 弹窗 (scale+fade from trigger, blur backdrop)
   ============================================================ */
.overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: rgba(4,5,9,0.62); backdrop-filter: blur(14px); opacity: 0; visibility: hidden; transition: opacity 400ms var(--ease-out), visibility 400ms; }
[data-theme="light"] .overlay { background: rgba(40,32,18,0.4); }
.overlay.open { opacity: 1; visibility: visible; }
.overlay-card { width: min(720px, 100%); max-height: min(86vh, 820px); display: flex; flex-direction: column; padding: 28px 30px;
  transform: scale(0.96) translateY(10px); opacity: 0; transition: transform 460ms var(--ease-drawer), opacity 360ms; position: relative; }
.overlay.open .overlay-card { transform: scale(1) translateY(0); opacity: 1; }
.overlay-card.wide { width: min(940px, 100%); }
.overlay-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; font-size: 15px; }
.ov-head { margin-bottom: 20px; padding-right: 40px; }
.ov-title { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.2; margin-top: 8px; }
.ov-sub { font-size: 13.5px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }

/* 学习路径 */
.path-scroll { overflow-y: auto; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 0; }
.path-step { position: relative; padding: 14px 16px 14px 52px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--hairline-soft); margin-bottom: 10px; cursor: pointer; transition: transform 180ms var(--ease-out), border-color 200ms, background 200ms; }
.path-step::before { content: ""; position: absolute; left: 20px; top: 22px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.path-step::after { content: ""; position: absolute; left: 26px; top: 35px; bottom: -10px; width: 1.5px; background: var(--hairline); }
.path-step:last-child::after { display: none; }
.path-step:hover { transform: translateX(4px); border-color: var(--hairline); background: var(--surface); }
.ps-top { display: flex; align-items: center; gap: 10px; }
.ps-name { font-family: var(--serif); font-size: 17px; font-weight: 600; flex: 1; }
.ps-depth { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ps-sub { font-size: 12.5px; color: var(--text-3); margin-top: 5px; display: flex; gap: 8px; align-items: center; }
.ps-sub .dot { width: 7px; height: 7px; border-radius: 50%; }
.ps-band { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; font-weight: 600; }
.path-empty { color: var(--text-3); text-align: center; padding: 40px; font-size: 14px; }

/* 学科百科 */
.domains-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.dom-tab { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; transition: all 180ms var(--ease-out); }
.dom-tab .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.dom-tab:hover { color: var(--text); transform: translateY(-1px); }
.dom-tab.is-active { background: var(--text); color: var(--bg); border-color: transparent; }
.dom-tab.is-active .dot { box-shadow: none; }
.domains-list { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 4px; align-content: start; }
.domain-card { padding: 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--hairline-soft); cursor: pointer; transition: transform 200ms var(--ease-out), border-color 200ms, background 200ms; display: flex; flex-direction: column; gap: 8px; }
.domain-card:hover { transform: translateY(-3px); border-color: var(--hairline); background: var(--surface); }
.domain-card .dc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.domain-card .dc-name { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.domain-card .dc-age { font-size: 11.5px; color: var(--text-3); flex: none; }
.domain-card .dc-sum { font-size: 12.5px; color: var(--text-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.domain-card .dc-count { font-size: 11.5px; color: var(--accent); font-weight: 600; }

/* 使用说明 */
.help-title { font-family: var(--serif); font-size: 28px; font-weight: 600; margin-bottom: 12px; }
.help-lead { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: 20px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.help-item { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--hairline-soft); }
.hi-ico { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 15px; }
.help-item b { display: block; font-size: 14px; margin-bottom: 3px; }
.help-item span { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.help-dep { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--hairline-soft); font-size: 13px; line-height: 1.7; color: var(--text-2); }
.help-dep .cool { color: var(--cool); font-weight: 600; }
.help-dep .warm { color: var(--warm); font-weight: 600; }
.help-cite { margin-top: 14px; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

/* ============================================================
   教材关键词库（K12）
   ============================================================ */
.k12-body { overflow-y: auto; padding: 4px; display: flex; flex-direction: column; gap: 18px; }
.k12-stage-h { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline-soft); }
.k12-grade { margin-bottom: 14px; }
.k12-grade-h { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 9px; }
.k12-subj { margin-bottom: 11px; }
.k12-subj-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.k12-subj-h .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.k12-kws { display: flex; flex-wrap: wrap; gap: 6px; }
.k12-kw { padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--hairline-soft); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 12.5px; transition: all 200ms var(--ease-out); }
.k12-kw:hover { color: var(--text); background: var(--surface); border-color: var(--hairline); transform: translateY(-1px); }
.k12-kw:active { transform: scale(0.96); }

/* ============================================================
   移动端抽屉
   ============================================================ */
.mobile-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--surface-solid); border-top: 1px solid var(--hairline);
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 460ms var(--ease-drawer); max-height: 80vh; overflow-y: auto; }
.mobile-sheet.open { transform: translateY(0); }
.mobile-sheet-inner { display: flex; flex-direction: column; gap: 18px; }
.mobile-search { display: flex; align-items: center; gap: 8px; }
.mobile-search .search-ico { position: static; width: 18px; height: 18px; flex: none; }
#mobile-search-input { flex: 1; height: 44px; border-radius: var(--r-pill); border: 1px solid var(--hairline); background: var(--surface-2); padding: 0 16px; font-size: 15px; outline: none; }
.ms-block { display: flex; flex-direction: column; gap: 10px; }
.ms-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.mobile-filters, .mobile-age, .mobile-layout { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-age .age-q, .mobile-layout .ls-btn { border: 1px solid var(--hairline-soft); }
.sheet-scrim { position: fixed; inset: 0; z-index: 54; background: rgba(4,5,9,0.5); opacity: 0; visibility: hidden; transition: opacity 360ms; }
.sheet-scrim.open { opacity: 1; visibility: visible; }

/* ============================================================
   加载层
   ============================================================ */
.loader { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); transition: opacity 600ms var(--ease-out), visibility 600ms; }
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-ring { position: relative; width: 54px; height: 54px; }
.loader-ring span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 1.1s linear infinite; }
.loader-ring span:nth-child(2) { inset: 8px; border-top-color: #5B9DFF; animation-duration: 1.5s; animation-direction: reverse; }
.loader-ring span:nth-child(3) { inset: 16px; border-top-color: #34D399; animation-duration: 0.9s; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.04em; }
.loader-sub { font-size: 12.5px; color: var(--text-3); }

/* ============================================================
   入场动画 (staggered reveal)
   ============================================================ */
.intro-inner > * { opacity: 0; transform: translateY(16px); animation: rise 760ms var(--ease-out) forwards; }
.intro-inner .eyebrow { animation-delay: 60ms; }
.intro-inner .intro-title { animation-delay: 140ms; }
.intro-inner .intro-sub { animation-delay: 240ms; }
.intro-inner .intro-stats { animation-delay: 340ms; }
.intro-inner .btn-primary { animation-delay: 440ms; }
.intro-inner .intro-foot { animation-delay: 540ms; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1080px) {
  .sidebar { display: none; }
}
@media (max-width: 860px) {
  .filters, .layout-switch, #domains-btn-top, #subjectbar { display: none; }
  .menu-btn { display: flex; }
  .search { width: 150px; }
  .search:focus-within { width: 180px; }
  .panel { width: calc(100% - 28px); top: auto; bottom: 14px; max-height: 64vh; }
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-name { display: none; }
  .hint { display: none; }
  .cn-line-bar { bottom: 14px; gap: 5px; padding: 7px 7px 7px 6px; }
  .cn-line-bar .clb-nav { width: 34px; height: 34px; font-size: 20px; }
  .cn-line-bar .clb-mid { min-width: 120px; padding: 0 4px; }
  .cn-line-bar .clb-stage { font-size: 15px; }
}
@media (min-width: 861px) { .mobile-sheet, .sheet-scrim { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .aurora-blob { animation: none; }
}

/* ============================================================
   学习地图 · 进度追踪栏
   ============================================================ */
#explorer-btn.is-active { color: var(--cool); border-color: color-mix(in srgb, var(--cool) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cool) 30%, transparent), 0 0 18px -4px var(--cool); }

#profile-bar {
  display: none;
  position: fixed; top: var(--controls-top); left: 50%; transform: translateX(-50%);
  z-index: 40; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: var(--r-pill);
  max-width: min(var(--maxw), calc(100vw - 28px)); flex-wrap: wrap; justify-content: center;
}
body.explorer-mode #profile-bar { display: flex; animation: rise 520ms var(--ease-out) both; }
.pb-label { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.pb-profiles { display: flex; gap: 6px; flex-wrap: wrap; }
.pb-profile {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline-soft); background: var(--surface);
  font-size: 13px; cursor: pointer; color: var(--text-2); transition: all 240ms var(--ease-out);
}
.pb-profile.is-active { color: var(--text); border-color: color-mix(in srgb, var(--cool) 50%, transparent); background: color-mix(in srgb, var(--cool) 14%, transparent); }
.pb-pname { font-weight: 500; }
.pb-del { font-size: 11px; opacity: 0.5; padding: 0 2px; }
.pb-del:hover { opacity: 1; color: #ff8a8a; }
.pb-btn {
  padding: 6px 13px; border-radius: var(--r-pill); border: 1px solid var(--hairline-soft);
  background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--text-2); transition: all 220ms var(--ease-out);
}
.pb-btn:hover { color: var(--text); border-color: var(--hairline); }
.pb-btn.ghost { color: var(--text-3); }
.pb-hide { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.pb-hide input { accent-color: var(--cool); }
.pb-progress { font-size: 12px; color: var(--text-2); padding-left: 10px; border-left: 1px solid var(--hairline-soft); margin-left: 2px; white-space: nowrap; }

/* ============================================================
   知识点面板 · 标签页（讲解 / 评测 / 脉络）
   ============================================================ */
.panel-tabs { display: flex; gap: 4px; padding: 4px; margin: 4px 0 8px; background: var(--surface); border: 1px solid var(--hairline-soft); border-radius: var(--r-md); }
.ptab {
  flex: 1; padding: 9px 0; border: 0; background: transparent; border-radius: calc(var(--r-md) - 4px);
  font-size: 13.5px; font-weight: 600; color: var(--text-3); cursor: pointer; transition: all 240ms var(--ease-out);
}
.ptab:hover { color: var(--text-2); }
.ptab.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }
.ptab-pane { display: block; animation: fadeUp 360ms var(--ease-out) both; }
.ptab-pane[hidden] { display: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.panel-why, .panel-how { font-size: 14px; line-height: 1.78; color: var(--text-2); }
.why-block { border-left: 2px solid color-mix(in srgb, var(--cool) 70%, transparent); padding-left: 14px; }
.how-block { border-left: 2px solid color-mix(in srgb, var(--warm) 70%, transparent); padding-left: 14px; }
.link-empty { color: var(--text-3); font-size: 13px; padding: 4px 2px; }

/* 掌握状态标记 */
.panel-mark { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--hairline-soft); border-radius: var(--r-md); }
.mark-label { font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: 0.04em; }
.mark-btns { display: flex; gap: 6px; margin-left: auto; }
.mark-btn {
  padding: 7px 12px; border-radius: var(--r-pill); border: 1px solid var(--hairline-soft);
  background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--text-2); transition: all 220ms var(--ease-out);
}
.mark-btn:hover { transform: translateY(-1px); }
.mark-btn.is-on[data-state="known"] { color: #7fe0a8; border-color: color-mix(in srgb, #7fe0a8 60%, transparent); background: color-mix(in srgb, #7fe0a8 14%, transparent); }
.mark-btn.is-on[data-state="learning"] { color: var(--warm); border-color: color-mix(in srgb, var(--warm) 60%, transparent); background: color-mix(in srgb, var(--warm) 14%, transparent); }
.mark-btn.is-on[data-state="none"] { color: var(--text); border-color: var(--hairline); background: var(--surface-2); }

.panel-actions { flex-wrap: wrap; }
.panel-actions .btn-ghost { flex: 1 1 auto; min-width: 108px; }

/* ============================================================
   12 周成长地图
   ============================================================ */
.route-card { width: min(760px, 100%); }
.route-scroll { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 6px 4px; }
.route-week { background: var(--surface); border: 1px solid var(--hairline-soft); border-radius: var(--r-md); padding: 14px 16px; }
.route-week:first-child { border-color: color-mix(in srgb, var(--cool) 40%, transparent); }
.rw-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.rw-idx { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text); }
.rw-age { font-size: 12.5px; color: var(--text-3); }
.rw-cnt { margin-left: auto; font-size: 12px; color: var(--text-3); }
.rw-list { display: flex; flex-wrap: wrap; gap: 7px; }
.rw-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border-radius: var(--r-pill); border: 1px solid var(--hairline-soft); background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: all 220ms var(--ease-out);
}
.rw-chip:hover { color: var(--text); transform: translateY(-1px); border-color: var(--hairline); }
.rw-chip.is-target { color: var(--text); border-color: color-mix(in srgb, var(--cool) 60%, transparent); background: color-mix(in srgb, var(--cool) 14%, transparent); box-shadow: 0 0 16px -6px var(--cool); }
.rw-more { font-size: 12px; color: var(--text-3); align-self: center; }

/* ============================================================
   成长日志（Logbook）
   ============================================================ */
.logbook-card { width: min(940px, 100%); }
.logbook-body { overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 4px 4px 8px; }
.lb-top { display: flex; align-items: center; gap: 22px; }
.lb-ring {
  --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-content: center; text-align: center;
}
.lb-ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface-solid); }
.lb-pct { position: relative; font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--text); }
.lb-ring-lbl { position: relative; font-size: 11px; color: var(--text-3); }
.lb-kpis { display: flex; gap: 26px; flex-wrap: wrap; }
.lb-kpi { display: flex; flex-direction: column; }
.lb-kpi b { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--text); }
.lb-kpi span { font-size: 12px; color: var(--text-3); }
.lb-section { display: flex; flex-direction: column; gap: 12px; }
.lb-h { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: baseline; gap: 10px; }
.lb-hint { font-size: 12px; color: var(--text-3); font-weight: 400; font-family: var(--sans); }
.lb-subjects { display: flex; flex-direction: column; gap: 9px; }
.lb-subj { display: grid; grid-template-columns: 150px 44px 1fr auto; align-items: center; gap: 10px; }
.lb-subj-name { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-subj-pct { font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.lb-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.lb-fill { display: block; height: 100%; border-radius: 999px; }
.lb-subj-num { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.lb-sugg { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.lb-sugg-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 11px 13px; border-radius: var(--r-md); border: 1px solid var(--hairline-soft); background: var(--surface); cursor: pointer; text-align: left; transition: all 220ms var(--ease-out); }
.lb-sugg-item:hover { transform: translateY(-1px); border-color: var(--hairline); background: var(--surface-2); }
.lb-sugg-name { font-size: 13.5px; font-weight: 500; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.lb-sugg-meta { font-size: 11.5px; color: var(--text-3); }
.lb-empty { color: var(--text-3); font-size: 13px; padding: 6px 2px; }
.lb-trail { display: flex; flex-direction: column; }
.lb-trail-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--hairline-soft); font-size: 13px; }
.lb-trail-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.lb-trail-dot.known { background: #7fe0a8; }
.lb-trail-dot.learning { background: var(--warm); }
.lb-trail-name { color: var(--text); }
.lb-trail-act { color: var(--text-2); font-size: 12px; }
.lb-trail-time { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ============================================================
   响应式 · 新组件
   ============================================================ */
@media (max-width: 860px) {
  #profile-bar { top: 70px; padding: 8px 12px; }
  .pb-label, .pb-progress { display: none; }
  .lb-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .lb-subj { grid-template-columns: 1fr auto; }
  .lb-subj-pct, .lb-track { display: none; }
}
