/* ---------- 顶栏 ---------- */
.topbar {
  border-bottom: 1px solid var(--rule-dark);
  background: var(--paper);
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding-top: var(--safe-top);
  /* 移动端答题页隐藏/重现：整条顶栏平移滑出/滑入（无位移时不受影响） */
  transition: transform .22s ease;
}
/* 向上延伸实心底，挡住 iOS 橡皮筋回弹时从标题行上方透出的正文 */
.topbar::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  height: 100dvh;
  background: var(--paper);
  pointer-events: none;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h);
  gap: 12px;
  min-width: 0;
}
.brand { display: flex; align-items: baseline; gap: 12px; cursor: pointer; min-width: 0; }
.brand .brand-mark { width: 28px; height: 28px; flex: 0 0 auto; align-self: center; }
.brand .mark { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: 0.06em; }
.brand .mark em { font-style: normal; color: var(--gold); }
.brand .en {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--faint);
}
.top-status {
  font-family: var(--sans); font-size: 12px; color: var(--faint);
  min-width: 0; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  /* 状态在左、题库切换在最右，使按钮右边框与页面内容右边界对齐。 */
  order: -1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-btn {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--faint); background: transparent; border: 1px solid var(--rule);
  padding: 4px 11px; cursor: pointer; white-space: nowrap; transition: all .18s;
}
.topbar-btn:hover { color: var(--ink); border-color: var(--ink); }
/* 主题切换按钮：与题库切换同款紧凑胶囊，图标随主题切换（暗色显示太阳、浅色显示月亮） */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; flex: none;
  border: 1px solid var(--rule); background: transparent; cursor: pointer;
  color: var(--faint); transition: all .18s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .theme-ico { width: 16px; height: 16px; display: none; }
.theme-toggle .theme-ico svg { display: block; width: 100%; height: 100%; }
:root[data-theme="dark"] .theme-toggle .theme-ico-sun { display: block; }
:root:not([data-theme="dark"]) .theme-toggle .theme-ico-moon { display: block; }
/* 页脚中英语言切换：纸感分段胶囊——当前语言墨底纸字，另一语言灰字 hover 转墨（见 app-i18n.js） */
.lang-switch {
  display: inline-flex; align-items: center;
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 2px; gap: 2px; vertical-align: middle;
  transition: border-color .18s;
}
.lang-switch:hover { border-color: var(--ink); }
.lang-switch .ls-seg {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .06em;
  line-height: 1.4; color: var(--faint); text-decoration: none;
  cursor: pointer; transition: color .18s, background .18s;
}
.lang-switch .ls-seg:hover { color: var(--ink); }
.lang-switch .ls-seg.is-cur { color: var(--paper); background: var(--ink); cursor: default; pointer-events: none; }
.top-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: .03em;
  color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 999px;
  cursor: pointer;
  min-height: 36px; padding: 4px 14px 4px 8px; margin-left: 2px;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s, transform .1s;
}
.top-back:hover { color: var(--accent); border-color: var(--accent); background: var(--paper-deep); }
.top-back:active { transform: translateY(1px); }
.top-back-arrow { font-size: 22px; line-height: 1; font-weight: 400; transform: translateY(-1px); color: var(--accent); margin-right: 1px; }
/* hidden 属性必须压过 .brand/.top-back 的 display 声明（作者样式优先于 UA 的 [hidden]） */
.top-back[hidden], #brand-home[hidden] { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 13px 30px; cursor: pointer; letter-spacing: 0.04em;
  border: 1px solid var(--rule-dark); background: transparent; color: var(--ink);
  transition: all .18s; border-radius: 0;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover:not(:disabled) { background: var(--rule-dark); border-color: var(--rule-dark); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
#view-home .btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--paper);
}
#view-home .btn.primary:hover:not(:disabled) {
  background: var(--green-deep);
  border-color: var(--green-deep);
}
#view-home .btn.ghost:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}
/* 首页「AI 陪练」按钮的「新」角标（陶土橙贴片，随主色亮暗自适应，永久展示） */
#btn-coach-home { position: relative; }
.new-tag {
  position: absolute;
  top: -9px; right: -8px;
  z-index: 2;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
  color: #fff;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, .6);
  padding: 3px 7px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(23, 35, 45, .3);
  transform: rotate(9deg);
  pointer-events: none;
  animation: newTagPop .55s cubic-bezier(.22, .9, .3, 1.4) both;
}
@keyframes newTagPop {
  from { transform: rotate(9deg) scale(.3); opacity: 0; }
  to   { transform: rotate(9deg) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .new-tag { animation: none; } }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mini-btn {
  font-family: var(--sans); font-size: 12px; font-weight: 600; padding: 7px 16px;
  border: 1px solid var(--rule-dark); background: transparent; cursor: pointer;
  transition: all .15s;
}
.mini-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 视图切换 ---------- */
.view { display: none; }
.view.show { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- 首页 ---------- */
.hero { padding: 76px 0 64px; border-bottom: 1px solid var(--rule); position: relative; z-index: 1; }
#view-home {
  position: relative;
}
#view-home::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  /* 仅保留低对比横向网格，避免中轴装饰线切割首页内容。 */
  background: linear-gradient(rgba(23, 35, 45, 0.028) 1px, transparent 1px);
  background-size: 22px 22px;
}
#view-home::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.32;
  background-image: linear-gradient(to bottom, transparent 62%, var(--paper));
}
.hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='760' viewBox='0 0 900 760'%3E%3Cg fill='none' stroke='%2317232D' stroke-width='1'%3E%3Cpolygon points='640,80 812,180 812,380 640,480 468,380 468,180'/%3E%3Cpolygon points='640,150 752,215 752,345 640,410 528,345 528,215'/%3E%3Cpolygon points='640,210 698,244 698,316 640,350 582,316 582,244'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 118% -8%;
  background-size: 780px 660px;
}
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
/* 历史记录会增加左列高度；图卡仍以标题而非整列垂直居中为基准。 */
.hero-grid.has-history .spec-card { align-self: start; margin-top: 47px; }
.issue-line { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.issue-line .rule-seg { flex: none; height: 1px; background: var(--rule-dark); width: 60px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(38px, 5.4vw, 58px);
  line-height: 1.16; font-weight: 700;
}
.hero h1 .it { font-style: normal; color: var(--accent); }
.hero .sub { margin-top: 22px; font-size: 16.5px; color: var(--ink-soft); max-width: 30em; }
.hero .sub strong { color: var(--ink); }
.cta-row { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.exam-scene {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 24px; font-family: var(--sans); font-size: 13px;
}
.exam-scene[hidden] { display: none !important; }
.exam-scene-label { color: var(--faint); margin-right: 4px; }
.exam-scene-option {
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink-soft); cursor: pointer; font: inherit;
}
.exam-scene-option.selected { border-color: var(--green); background: var(--green-soft); color: var(--green-deep); font-weight: 700; }
.exam-scene-option:hover { border-color: var(--ink); }
.hero-history-link {
  display: inline-block; margin-top: 18px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--faint); border-bottom: 1px dotted var(--faint);
  transition: color .15s, border-color .15s;
}
.hero-history-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.hero-meta {
  margin-top: 32px; display: flex; gap: 26px;
  font-family: var(--sans); font-size: 12px; color: var(--faint);
}
/* 数字牌弱化（2026-08-26）：数字缩小变浅，作「脚注」级存在，不抢金句/CTA */
.hero-meta b { display: block; font-family: var(--serif); font-size: 19px; color: var(--faint); font-weight: 700; }
.hero-meta b small { font-size: 12px; }
.hero-meta div:first-child b { color: var(--faint); }

.spec-card {
  background: var(--card); border: 1px solid var(--rule-dark);
  padding: 28px 22px 18px; position: relative;
  box-shadow: 8px 8px 0 var(--paper-deep);
}
.spec-card::before {
  content: attr(data-title); position: absolute; top: -9px; left: 24px;
  background: var(--paper); padding: 0 10px;
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.24em; color: var(--gold);
}
.spec-card .chart-paper {
  position: relative;
  background-image:
    linear-gradient(rgba(217,225,229,.8) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,225,229,.8) 1px, transparent 1px);
  background-size: 18px 18px;
  background-position: center;
  margin: 4px 0 6px;
}
.dial { position: relative; width: 100%; }
.dial svg { display: block; width: 100%; height: auto; }
.hex-outer { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.hex-mid { fill: none; stroke: var(--gold); stroke-width: 1; opacity: .7; }
.hex-in { fill: rgba(31,107,103,.06); stroke: var(--green); stroke-width: .9; opacity: .85; }
.spoke { stroke: var(--rule); stroke-width: 1; }
/* 指向维度时不再用绿线连中心（红指针已足够指示方向），辐条保持浅灰参考线 */
.hub-ring { fill: var(--card); stroke: var(--ink); stroke-width: 1.2; }
.hub-fill { fill: var(--green); }
.dim-needle { transform-origin: 200px 188px; transition: transform .35s ease; stroke: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .dim-needle { transition: none; }
}
.pip { fill: var(--card); stroke: var(--ink); stroke-width: 1.3; }
.halo { fill: none; stroke: var(--green); stroke-width: 1.1; opacity: 0; }
.g-node.is-on .pip { fill: var(--green); stroke: var(--green); }
.g-node.is-on .halo { opacity: .7; }
.dim-lbl { font-family: var(--sans); font-size: 12px; font-weight: 700; fill: var(--faint); letter-spacing: .12em; }
.dim-lbl.is-on { fill: var(--green); }
.node-hit {
  position: absolute; width: 44px; height: 44px;
  transform: translate(-50%, -50%);
  border: 0; background: transparent; cursor: pointer; border-radius: 50%;
}
.dim-plate {
  border-top: 1px dotted var(--rule);
  padding: 12px 10px 4px;
  min-height: 4.6em;
}
.dim-plate-k { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--gold); }
.dim-plate-name { font-size: 15px; font-weight: 700; margin: 2px 0 4px; }
.dim-plate-fw { font-size: 12px; color: var(--faint); line-height: 1.55; }
.spec-row {
  display: block; padding: 12px 0; border-bottom: 1px dotted var(--rule);
  font-size: 15px;
}
.spec-row > span:first-child { display: block; font-weight: 700; }
.spec-row:last-child { border-bottom: none; }
.spec-row .fw-list {
  display: block; font-family: var(--sans); font-size: 12px; color: var(--faint);
  text-align: left; line-height: 1.6; margin-top: 4px;
}

section.home-sec { padding: 30px 0; position: relative; z-index: 1; }
.sec-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 38px; }
.sec-head .no { font-size: 15px; font-style: italic; color: var(--gold); font-weight: 700; white-space: nowrap; }
.sec-head h2 { font-family: var(--serif); font-size: 27px; font-weight: 700; }
.sec-head .line { flex: 1; height: 1px; background: var(--rule-dark); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule-dark); background: var(--card); }
.step { padding: 28px 26px 24px; border-right: 1px solid var(--rule-dark); }
.step:last-child { border-right: none; }
.step .glyph { font-family: var(--serif); font-size: 28px; font-style: italic; color: var(--gold); font-weight: 700; }
.step h3 { font-size: 17px; margin: 10px 0 8px; }
.step p { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- 首页「今日之思」：金句装进「金色便利贴」质感容器（见 app-thought.js） ---------- */
/* 容器：暖金纸感卡——细金描边 + 微渐变暖底 + 柔和投影 + 上缘高光，像一枚精致的便利贴 */
.thought-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule-dark);
  box-shadow: 8px 8px 0 var(--paper-deep);
  padding: 34px 36px 30px;
  max-width: 34em;
}
/* 左上陶土橙小角标：延续首页"测"字标/维度卡的品牌点缀 */
.thought-card::before {
  content: "";
  position: absolute; left: -1px; top: -1px;
  width: 0; height: 0;
  border-top: 26px solid var(--accent);
  border-right: 26px solid transparent;
}
/* 内缘细墨线框（与品牌描边语言一致） */
.thought-card::after {
  content: "";
  position: absolute; inset: 7px;
  border: 1px solid var(--rule);
  pointer-events: none;
}
/* 字号由 JS 动态计算，此处只定字体/行高/装饰。
 * 注意：必须用 #thought-hero（id 特异性）压过 .hero h1 的 line-height:1.16，
 * 否则金句行距永远不生效（曾被 .hero h1 覆盖导致调多大都无行距）。 */
#thought-hero.thought-hero {
  position: relative;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
  line-height: 1.5;           /* 1.5 倍行距（2026-08-26 定稿）：克制、舒适 */
  font-weight: 700; font-style: normal;
  color: var(--ink);
  margin: 0;
  padding-right: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
  transition: color .18s ease;
}
#thought-hero.thought-hero:hover { color: var(--signal); }
/* 金色细菱形小装饰：替代引号，独立一行，尽量靠上 */
.thought-gem {
  display: block;
  font-size: 13px; line-height: 1;
  color: var(--accent);
  margin: 0 0 6px;
  letter-spacing: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.thought-hero:hover .thought-gem { transform: translateY(-2px); }
/* 署名行：细金线 + 金色小字（字距拉开）；「认识这个框架」在右下 */
.thought-byline {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px;
}
.thought-sign {
  font-family: var(--sans);
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--gold);
}
/* 署名前细金线装饰 */
.thought-sign::before {
  content: "";
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 10px;
  opacity: .65;
}
.thought-dot { display: none; }
/* 认识这个框架：右下角 */
.thought-link {
  margin-left: auto;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); border-bottom: 1px dotted var(--gold);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.thought-link:hover { color: var(--signal); border-bottom-color: var(--signal); }

/* 正文引导句：段首「7 分钟…」加重，与说明段合成一段 */
.thought-lead {
  font-family: var(--serif);
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-right: 6px;
}
.thought-lead .it { font-style: normal; color: var(--accent); }
/* 正文段与金句署名区之间的留白（分区：金句 → 正文 → 操作） */
.thought-sub { margin-top: 34px; }

/* ---------- 首页学习中心区块 ---------- */
.home-learn-sec { padding-top: 4px; }
.hl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.hl-card {
  background: var(--card); border: 1px solid var(--rule-dark);
  padding: 20px 22px 14px; cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.hl-card:hover { box-shadow: 6px 6px 0 var(--green-soft); transform: translate(-2px, -2px); border-color: var(--green); }
.hl-top { display: flex; align-items: baseline; gap: 10px; }
.hl-no {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  color: var(--gold); letter-spacing: 0.08em;
}
.hl-card h3 { font-size: 17px; font-weight: 700; }
.hl-fws { font-family: var(--sans); font-size: 12px; color: var(--faint); line-height: 1.6; margin: 8px 0 14px; }
.hl-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans); font-size: 12px; color: var(--faint);
  border-top: 1px dotted var(--rule); padding-top: 10px;
}
.hl-enter { color: var(--ink); font-weight: 700; }
.hl-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: var(--card); border: 1px solid var(--rule-dark);
  box-shadow: 8px 8px 0 var(--paper-deep); padding: 24px 30px;
}
.hl-banner-text { font-size: 15.5px; }
.hl-banner-text b { font-family: var(--serif); font-size: 25px; color: var(--green); margin-right: 4px; }
.hl-progress { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--faint); margin-top: 5px; }
@media (max-width: 900px) {
  .hl-grid { grid-template-columns: 1fr; }
  .hl-banner { flex-direction: column; align-items: flex-start; }
}


/* ---------- 金句弹窗大便利贴卡片（分享传播，见 app-thought.js openThoughtCard） ---------- */
.thought-card-layer { z-index: 90; }
.thought-card-big {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule-dark);
  box-shadow: 10px 10px 0 var(--paper-deep);
  padding: 44px 46px 30px;
  width: min(460px, 92vw);
  max-height: 90vh; overflow-y: auto;
}
.thought-card-big::before {
  content: ""; position: absolute; left: -1px; top: -1px;
  width: 0; height: 0;
  border-top: 30px solid var(--accent); border-right: 30px solid transparent;
}
.thought-card-big::after {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid var(--rule); pointer-events: none;
}
/* 弹窗关闭按钮：轻盈化——去方框，细 ✕，hover 变金 */
.thought-card-big .bp-close {
  position: absolute; right: 18px; top: 18px; z-index: 2;
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--faint);
  font-size: 16px; font-weight: 300; line-height: 1;
  transition: color .18s ease, transform .18s ease;
}
.thought-card-big .bp-close:hover {
  color: var(--gold);
  transform: rotate(90deg);
}
.thought-big-inner { padding: 8px 6px 0; }
.thought-gem.big { font-size: 14px; margin-bottom: 10px; }
.thought-big-text {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
  font-size: 26px; font-weight: 700; line-height: 1.9;
  color: var(--ink); margin: 0;
  letter-spacing: 0.02em;
}
.thought-big-sign {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.14em; color: var(--gold);
  margin-top: 18px;
}
.thought-big-foot {
  display: flex; align-items: center; gap: 14px;
  margin-top: 26px; padding-top: 18px;
  border-top: 1px dotted rgba(169,143,92,.42);
}
.thought-big-qr {
  flex: none; width: 92px; height: 92px;
  background: var(--card); border: 1px solid var(--rule-dark);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
.thought-big-qr img { display: block; width: 100%; height: 100%; }
.thought-qr-fallback {
  font-family: var(--sans); font-size: 12px; color: var(--gold);
  text-align: center; line-height: 1.6;
}
.thought-big-qr-note {
  font-family: var(--sans); font-size: 12px; color: #8a6d3b;
  line-height: 1.7;
}
.thought-big-actions {
  display: flex; gap: 10px; margin-top: 22px;
  justify-content: center;
}
.thought-big-actions .btn { flex: 0 1 auto; min-width: 180px; }
