/* 顶栏导航 */
.topnav { display: flex; gap: 4px; margin-left: 6px; }
.topnav a { padding: 6px 12px; border-radius: 9px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-actions a { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.hero-actions a:hover { border-color: var(--accent); }
.hero-actions a.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 常见误区 */
.pit-list { display: grid; gap: 12px; }
.pit { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.pit-w, .pit-r { display: flex; gap: 10px; padding: 12px 16px; align-items: flex-start; }
.pit-w { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.pit-r { background: color-mix(in srgb, var(--good) 8%, transparent); border-top: 1px solid var(--border); }
.pit p { margin: 0; font-size: 15px; line-height: 1.65; }
.pit-w p { color: var(--text); }
.pit-ico { flex: none; line-height: 1.65; }

/* 知识关联 */
.link-group { margin: 0 0 14px; }
.link-title { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.chip:hover { border-color: var(--c, var(--accent)); }
.chip small { color: var(--muted); }
.chip-mark { font-size: 12px; }
.chip.done { border-color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.chip.ready { border-color: color-mix(in srgb, var(--c) 60%, var(--border)); }
.chip.locked { color: var(--muted); }
.link-note { color: var(--muted); font-size: 14px; margin: 8px 0; }
.link-note a:hover { color: var(--accent); }

/* 知识地图 */
.map-title { margin: 0 0 6px; font-size: 30px; }
.map-sub { color: var(--muted); margin: 0 0 18px; max-width: 760px; }
.map-tabs .cat-tab small { opacity: .75; margin-left: 4px; }
.map-tabs .cat-tab.on { background: var(--c); border-color: var(--c); color: #fff; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rec { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 12px; background: var(--surface); }
.rec:hover { border-color: var(--c); transform: translateY(-1px); }
.rec-d { font-size: 12px; color: var(--muted); }
.rec b { font-size: 15px; }
.rec-s { font-size: 13px; color: var(--muted); line-height: 1.5; }
.map-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 4px; }
.map-svg { display: block; font-family: inherit; }
.map-svg .mhead { fill: var(--muted); font-size: 12px; }
.map-svg .medge { fill: none; stroke: var(--border); stroke-width: 1.6; transition: opacity .15s; }
.map-svg .mnode rect { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.2; transition: opacity .15s; }
.map-svg .mnode text { fill: var(--text); font-size: 13px; pointer-events: none; }
.map-svg .mnode .mx { fill: var(--muted); font-size: 12px; }
.map-svg .mnode { cursor: pointer; }
.map-svg .mnode.ready rect { stroke: var(--c); stroke-width: 2; fill: var(--surface); }
.map-svg .mnode.done rect { fill: color-mix(in srgb, var(--good) 16%, var(--surface)); stroke: var(--good); }
.map-svg .mnode.locked text { fill: var(--muted); }
.map-svg.focus .mnode, .map-svg.focus .medge { opacity: .18; }
.map-svg.focus .mnode.hl, .map-svg.focus .medge.hl { opacity: 1; }
.map-svg.focus .medge.hl { stroke: var(--c); stroke-width: 2.4; }
.cross-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cross-main { font-weight: 600; }
.cross-main:hover { color: var(--accent); }
.cross-arrow { color: var(--muted); font-size: 13px; }

/* 复习中心 */
.rv-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.rv-form { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.rv-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.rv-form select.btn { min-width: 150px; }
.rv-progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.rv-progress > div { height: 100%; background: var(--c, var(--accent)); border-radius: 99px; transition: width .25s; }
.review-page .stats { margin-bottom: 8px; }
button.btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 640px) {
  .topnav a { padding: 6px 8px; font-size: 13px; }
  .topbar { flex-wrap: wrap; }
  .search-wrap { order: 5; flex-basis: 100%; max-width: none; margin-left: 0; }
  .map-title { font-size: 24px; }
}

/* 复习中心与知识地图没有“所属领域”，给主按钮等组件一个默认主题色 */
.review-page, .map-page { --c: var(--accent); }

/* ===== 跨学科专题与公式家族 ===== */
.th-hero { padding-top: 8px; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 8px; }
.th-card { display: flex; flex-direction: column; gap: 10px; border-top: 4px solid var(--c); }
.th-card-head { display: flex; gap: 12px; align-items: flex-start; }
.th-card-head h3 { margin: 0 0 4px; }
.th-icon { font-size: 30px; line-height: 1; flex: none; }
.th-icon.big { font-size: 46px; }
.th-mini-steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.th-mini-steps li.seen { color: var(--text); }
.th-mini-steps li.seen::marker { color: var(--good); }
.th-doms { display: flex; gap: 6px; align-items: center; font-size: 16px; flex-wrap: wrap; }
.th-doms small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.fam-card { display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--c); }
.fam-head { display: flex; gap: 10px; align-items: center; }
.fam-head h3 { margin: 0; }
.fam-card .formula-mini { overflow-x: auto; overflow-y: hidden; }
.th-title { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.th-title h1 { margin: 0; font-size: 34px; }
.th-title p { margin: 4px 0 0; color: var(--muted); }
.th-question { background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.th-question p { margin: 0; flex: 1 1 260px; line-height: 1.7; }
.th-take { background: color-mix(in srgb, var(--good) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 40%, var(--border)); border-radius: 12px; padding: 12px 16px; margin: 24px 0; }
.th-take p { margin: 6px 0 0; line-height: 1.7; }
.th-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-bottom: 14px; }
.th-node { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); width: 150px; }
.th-node:hover { border-color: var(--c); transform: translateY(-1px); }
.th-node.seen { border-color: color-mix(in srgb, var(--good) 60%, var(--border)); }
.th-node-n { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font-size: 13px; display: grid; place-items: center; font-weight: 600; }
.th-node.seen .th-node-n { background: var(--good); }
.th-node-t { font-size: 14px; font-weight: 600; line-height: 1.4; }
.th-node-d { font-size: 13px; }
.th-arrow { align-self: center; color: var(--muted); font-size: 18px; }
.th-steps { display: grid; gap: 10px; }
.th-step-row { display: flex; gap: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.th-step-row:hover { border-color: var(--c); }
.th-step-row p { margin: 4px 0 6px; color: var(--muted); font-size: 14px; }
.th-step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--c); color: var(--c); display: grid; place-items: center; font-weight: 700; }
.th-step-doms { display: flex; gap: 6px; flex-wrap: wrap; }
.th-dom { font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--c) 45%, var(--border)); color: var(--text); background: color-mix(in srgb, var(--c) 8%, transparent); }
.th-dots { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.th-dots a { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; border: 1.5px solid var(--border); color: var(--muted); background: var(--surface); }
.th-dots a.seen { border-color: var(--good); color: var(--good); }
.th-dots a.on { background: var(--c); border-color: var(--c); color: #fff; font-weight: 700; }
.th-kicker { color: var(--muted); font-size: 14px; margin: 0; }
.th-small { color: var(--muted); font-weight: 400; font-size: 14px; }
.th-quiz { margin-bottom: 14px; }
.th-qn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; margin-right: 8px; vertical-align: 2px; }
.fam-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.fam-member { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 12px; background: var(--surface); min-width: 0; }
.fam-member:hover { border-color: var(--c); }
.fam-m-d { font-size: 12px; color: var(--muted); }
.fam-m-f { overflow-x: auto; overflow-y: hidden; padding: 2px 0; position: relative; }
.fam-m-n { font-size: 13px; color: var(--muted); line-height: 1.55; }
.home-themes { margin: 0 0 26px; }
.home-themes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.home-themes-head h2 { margin: 0 0 10px; font-size: 20px; }
.home-themes-head a { color: var(--muted); font-size: 14px; }
.home-themes-head a:hover { color: var(--accent); }
.home-themes-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.home-theme { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); border-top: 3px solid var(--c); background: var(--surface); }
.home-theme:hover { border-color: var(--c); transform: translateY(-1px); }
.home-theme span { font-size: 24px; }
.home-theme small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .th-node { width: 100%; flex-direction: row; align-items: center; gap: 10px; }
  .th-arrow { transform: rotate(90deg); align-self: flex-start; margin-left: 20px; font-size: 14px; }
  .th-title h1 { font-size: 26px; }
  .th-grid { grid-template-columns: 1fr; }
}
.th-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
.th-legend span { display: inline-flex; align-items: center; gap: 6px; }
.th-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }

/* ================= 证据强度与“怎么用在自己身上” ================= */
.ev-strong { --ev: var(--good); }
.ev-mid { --ev: #1c7ed6; }
.ev-debated { --ev: #e67700; }
.ev-failed { --ev: var(--bad); }
.ev-tool { --ev: #5f3dc4; }
:root[data-theme="dark"] .ev-tool { --ev: #b197fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ev-tool { --ev: #b197fc; } }
:root[data-theme="dark"] .ev-mid { --ev: #74c0fc; }
:root[data-theme="dark"] .ev-debated { --ev: #ffa94d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ev-mid { --ev: #74c0fc; } :root:not([data-theme="light"]) .ev-debated { --ev: #ffa94d; } }
.badge.ev { background: color-mix(in srgb, var(--ev) 14%, transparent); color: var(--ev); }
.ev-box { border: 1px solid color-mix(in srgb, var(--ev) 40%, var(--border)); border-left: 4px solid var(--ev); border-radius: 12px; padding: 14px 16px; background: color-mix(in srgb, var(--ev) 6%, var(--surface)); }
.ev-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 6px; }
.ev-level { font-weight: 700; color: var(--ev); font-size: 16px; }
.ev-desc { color: var(--muted); font-size: 14px; }
.ev-box p { margin: 0 0 10px; line-height: 1.7; }
.ev-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ev-scale span { text-align: center; font-size: 12px; padding: 3px 2px; border-radius: 6px; color: var(--muted); background: var(--surface-2); min-width: 0; overflow-wrap: anywhere; }
.ev-scale span.on { background: var(--ev); color: #fff; font-weight: 700; }
.howto-list { margin: 0; padding: 0; list-style: none; counter-reset: howto; display: grid; gap: 10px; }
.howto-list li { counter-increment: howto; position: relative; padding: 12px 14px 12px 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); line-height: 1.7; }
.howto-list li::before { content: counter(howto); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--c, var(--accent)); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
:root[data-theme="dark"] .ev-scale span.on { color: #15161a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ev-scale span.on { color: #15161a; } }

/* ---------- 学习向导：按问题找、学习路线、每日一题 ---------- */
.ask-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ask-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.ask-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.ask-card b { font-size: 16px; }
.ask-card small { color: var(--muted); font-size: 13px; }
.ask-icon { font-size: 26px; }
.ask-list { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 10px; }
.ask-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 12px; background: var(--surface); min-width: 0; }
.ask-item > div { min-width: 0; }
.ask-item a:hover b { color: var(--c); }
.ask-item small { color: var(--muted); font-size: 12px; }
.ask-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.ask-why { font-size: 14px; margin: 2px 0; }
.path-list .ask-item.is-done { opacity: .75; }
.path-list .ask-item.is-next { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); }
.home-guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; margin: 0 0 26px; }
.daily-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--border); border-top: 4px solid var(--c); background: var(--surface); }
.daily-card:hover { border-color: var(--c); }
.daily-card small { color: var(--muted); }
.daily-card b { font-size: 16px; line-height: 1.5; }
.daily-card span { color: var(--c); font-size: 14px; font-weight: 600; }
.home-asks .chips { gap: 6px; }
@media (max-width: 720px) { .home-guide { grid-template-columns: 1fr; } }
