/* ============================================================
   德鲁克知识库 · 1966 编辑部 (taste-skill 迭代 v2)
   纸面 + 墨色 + 单一朱砂红；衬线标题 + 系统无衬线正文 + 等宽编号。
   钻石模型为单色线描几何，仅中心「重视贡献」一点朱砂。
   五实践是发丝线索引行，附录是旁注式便签，无卡片堆叠。

   SHAPE RULE（全站一致）:
     容器与控件 12px / 胶囊全圆 / 勾选框 8px
   COLOR RULE:
     全站只有一个强调色：朱砂红。墨色承担结构，纸面是地面。
   DARK RULE:
     跟随 prefers-color-scheme，亮暗两套令牌，页面级锁定。
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  color-scheme: light dark;
  /* 纸面与墨色 */
  --bg: #FFFFFF;
  --bg-out: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F4F1;
  --ink: #1b1c21;
  --ink-2: #3f4149;
  --muted: #66676f;
  --line: #E9E5DC;
  --line-strong: #D6D0C2;
  /* 唯一强调色：朱砂红 */
  --accent: #c9351f;
  --accent-hover: #e04a2e;
  --accent-fg: #ffffff;
  --accent-soft: #f7e3dc;
  --accent-deep: #9e2f1a;
  /* 字体 */
  --font-serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* 圆角规则 */
  --radius-control: 12px;
  --radius-chip: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --bg-out: #0a0b0d;
    --surface: #17181c;
    --surface-2: #202126;
    --ink: #eceae5;
    --ink-2: #c4c2ba;
    --muted: #98968d;
    --line: #2a2b31;
    --line-strong: #3d3e46;
    --accent: #ff6a4d;
    --accent-hover: #ff8065;
    --accent-fg: #160a06;
    --accent-soft: #3a201a;
    --accent-deep: #ff9d85;
  }
}

html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-out);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
}
::selection { background: var(--accent-soft); color: var(--ink); }
textarea, input { caret-color: var(--accent); }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}
.view { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.view.hidden { display: none !important; }
.page { animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 滚动揭示（JS 存在时才隐藏；无 JS / 减弱动效时始终可见） ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .55s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 通用 ---------- */
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.page-header { padding: 30px 20px 8px; }
.page-title { font-family: var(--font-serif); font-size: 27px; font-weight: 800; letter-spacing: .02em; line-height: 1.25; }
.page-title::after { content: ""; display: block; width: 42px; height: 3px; background: var(--accent); margin-top: 10px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 11px; }
.about-note {
  padding: 22px 20px 30px; font-size: 11.5px; color: var(--muted);
  text-align: center; font-family: var(--font-num); letter-spacing: .08em;
}

/* ---------- 知识库头部 ---------- */
.kb-header { padding: 36px 20px 14px; }
.kb-kicker {
  font-family: var(--font-num); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; color: var(--muted); text-transform: uppercase;
  display: flex; align-items: center; gap: 9px;
}
.kb-kicker::before { content: ""; width: 18px; height: 2px; background: var(--accent); }
.kb-title {
  font-family: var(--font-serif); font-size: 34px; font-weight: 800;
  letter-spacing: .02em; line-height: 1.25; margin-top: 12px;
}
.kb-title::after { content: ""; display: block; width: 46px; height: 3px; background: var(--accent); margin-top: 12px; }
.kb-quote {
  margin-top: 26px;
  padding: 18px 20px 16px 56px;
  position: relative;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
}
.kb-quote-mark {
  position: absolute;
  left: 12px;
  top: 0;
  font-family: var(--font-serif);
  font-size: 62px;
  line-height: 1;
  color: var(--accent);
  pointer-events: none;
}
.kb-quote-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(16px, 4.8vw, 21px);
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.kb-quote-em {
  color: var(--accent-deep);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

/* ---------- 钻石模型：单色线描 ---------- */
.diamond-box { padding: 26px 22px 12px; }
.diamond-svg { display: block; width: 84%; max-width: 300px; height: auto; margin: 0 auto; }
.dia-node {
  cursor: pointer; transform-box: fill-box; transform-origin: center;
  transition: transform .18s ease, opacity .18s ease;
}
.dia-node:hover { transform: scale(1.025); }
.dia-node:active { transform: scale(.975); }
.dia-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.dia-node text { pointer-events: none; }
.dia-node polygon {
  fill: transparent; stroke: var(--ink); stroke-width: 1.6;
  stroke-linejoin: round;
  transition: fill .25s ease, stroke-width .18s ease;
}
.dia-node:hover polygon { stroke-width: 2.2; }
.dia-contribution polygon { stroke: var(--accent); }
.dia-contribution text { fill: var(--accent-fg); }
.dia-name { font-family: var(--font-serif); font-weight: 700; font-size: 13.5px; }
.dia-contribution .dia-name { font-weight: 800; font-size: 14px; }
.dia-line { fill: var(--muted); font-size: 10.5px; }
.dia-contribution .dia-line { fill: var(--accent-fg); }
@media (prefers-reduced-motion: no-preference) {
  .dia-node polygon {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: dia-draw 1.1s cubic-bezier(.4, 0, .2, 1) forwards;
    animation-delay: calc(var(--i, 0) * .13s + .15s);
  }
  .dia-contribution polygon {
    animation: dia-draw 1.1s cubic-bezier(.4, 0, .2, 1) forwards, dia-fill .4s ease forwards;
    animation-delay: calc(var(--i, 0) * .13s + .15s), calc(var(--i, 0) * .13s + 1s);
  }
}
@keyframes dia-draw { to { stroke-dashoffset: 0; } }
@keyframes dia-fill { from { fill: transparent; } to { fill: var(--accent); } }
.diamond-tip {
  margin-top: 12px; text-align: center; font-size: 11px; color: var(--muted);
  font-family: var(--font-num); letter-spacing: .06em;
}

/* ---------- 这门课在讲什么（编辑部横带） ---------- */
.intro-card {
  margin-top: 4px; padding: 22px 20px 24px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.intro-title { font-family: var(--font-serif); font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.intro-title::before { content: ""; display: block; width: 30px; height: 3px; background: var(--accent); margin-bottom: 10px; }
.intro-card p { font-size: 14px; color: var(--ink-2); margin-top: 10px; line-height: 1.75; }
.hl { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
@media (prefers-color-scheme: dark) {
  .hl { color: var(--accent-deep); }
}

/* ---------- 五实践：发丝线索引 ---------- */
.practice-list { margin-top: 6px; }
.practice-item { border-bottom: 1px solid var(--line); }
.practice-item.open { background: var(--surface); }
.practice-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 17px 20px; background: none; border: 0; text-align: left;
  transition: background .18s ease;
}
@media (hover: hover) {
  .practice-head:hover { background: var(--surface-2); }
}
.practice-num {
  width: 42px; flex-shrink: 0; font-size: 20px; font-weight: 700;
  color: var(--ink-2); letter-spacing: .02em;
}
.practice-num::after {
  content: ""; display: block; width: 15px; height: 2px; background: var(--accent);
  margin-top: 3px; transform: scaleX(0); transform-origin: left center;
  transition: transform .28s cubic-bezier(.16, 1, .3, 1);
}
.practice-item.open .practice-num { color: var(--accent); }
.practice-item.open .practice-num::after { transform: scaleX(1); }
.practice-head-txt { flex: 1; min-width: 0; }
.practice-title {
  display: block; font-family: var(--font-serif); font-size: 18px; font-weight: 800;
  letter-spacing: .01em; line-height: 1.35;
}
.practice-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.chevron {
  color: var(--muted); flex-shrink: 0; display: inline-flex; width: 20px; height: 20px;
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.chevron svg { width: 20px; height: 20px; }
.practice-item.open .chevron { transform: rotate(180deg); }

/* 手风琴：grid-template-rows 0fr→1fr，无 JS 测量 */
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.16, 1, .3, 1); }
.open > .collapse { grid-template-rows: 1fr; }
.collapse-inner { overflow: hidden; min-height: 0; }

.practice-collapse-inner { padding: 0 20px; border-top: 1px dashed var(--line); }
.practice-item.open .practice-collapse-inner { padding-bottom: 28px; }

/* 一句话本质：衬线大题眼，非卡片 */
.essence-card { margin-top: 20px; padding: 0; background: none; border: 0; }
.essence-label {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-num); font-size: 10.5px; font-weight: 700;
  letter-spacing: .16em; color: var(--muted);
}
.essence-label::before { content: ""; width: 16px; height: 2px; background: var(--accent); }
.essence-card p {
  margin-top: 10px; font-family: var(--font-serif); font-size: 17px; font-weight: 800;
  color: var(--ink); line-height: 1.75; letter-spacing: .01em;
}

.block { margin-top: 30px; }
.block-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--accent-deep);
}
.block-title::before {
  content: "";
  flex: none;
  width: 16px;
  height: 2px;
  background: var(--accent);
}
.block-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.block-title .check-summary { margin-left: auto; }
.check-summary { font-size: 11.5px; font-weight: 600; color: var(--muted); font-family: var(--font-num); }

/* 常见误区：朱砂浅底警示面板 */
.myths-list {
  margin-top: 13px; padding: 15px 16px;
  background: var(--accent-soft); border-radius: var(--radius-control);
}
.myth-row { padding: 10px 0; }
.myth-row + .myth-row { border-top: 1px dashed var(--line); }
.myth-line { display: flex; gap: 9px; align-items: baseline; font-size: 13.5px; line-height: 1.65; }
.myth-line + .myth-line { margin-top: 9px; }
.tag {
  flex-shrink: 0; display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: var(--radius-chip); font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; transform: translateY(-1px);
}
.tag-wrong { color: var(--accent-deep); background: var(--surface); }
.tag-right { color: var(--ink-2); background: var(--surface); }
.myth-wrong { color: var(--muted); }
.myth-right { color: var(--ink); }

/* 要点速查：方法条目 + 案例芯片 */
.points-list { margin-top: 13px; }
.point-row { padding: 12px 0; }
.point-title { font-family: var(--font-serif); font-size: 15px; font-weight: 800; color: var(--ink); }
.point-text { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.7; }
.point-example {
  margin-top: 11px; display: flex; gap: 9px; align-items: flex-start;
  background: var(--surface-2); border-radius: 10px; padding: 9px 12px;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.65;
}
.point-example .tag { color: var(--muted); background: var(--surface); border: 1px solid var(--line); flex-shrink: 0; margin-top: 1px; }

/* 德鲁克怎么说：居中摘句 */
.quote-card { margin-top: 30px; padding: 0 8px; text-align: center; }
.quote-card::before {
  content: ""; display: block; width: 26px; height: 2px;
  background: var(--accent); margin: 0 auto 16px;
}
.quote-zh { font-family: var(--font-serif); font-size: 16.5px; font-weight: 700; color: var(--ink); line-height: 1.85; }
.quote-en { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 10px; line-height: 1.6; }
.quote-source {
  font-size: 11px; color: var(--accent); margin-top: 11px;
  font-family: var(--font-num); letter-spacing: .06em;
}

/* 自检清单 */
.kd-checks { margin-top: 13px; }
.check-item { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; cursor: pointer; }
.check-item + .check-item { border-top: 1px solid var(--line); }
.check-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; border-radius: 8px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-fg); transition: background .18s ease, border-color .18s ease;
}
.check-box svg { width: 13px; height: 13px; opacity: 0; transform: scale(.5); transition: opacity .15s ease, transform .2s cubic-bezier(.16, 1, .3, 1); }
.check-item input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check-item input:checked + .check-box svg { opacity: 1; transform: scale(1); }
.check-item input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; transition: color .18s ease; }
.check-item.checked .check-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.primary-btn {
  display: block; width: 100%; margin-top: 15px; padding: 13px 18px;
  border: 0; border-radius: var(--radius-control);
  background: var(--accent); color: var(--accent-fg);
  font-size: 14.5px; font-weight: 700; line-height: 1.3;
  transition: background .18s ease, transform .12s ease;
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:active { transform: scale(.985); }
.primary-btn:disabled { opacity: .45; pointer-events: none; }
.practice-collapse-inner .primary-btn { margin-top: 24px; }

/* ---------- 附录：旁注式便签 ---------- */
.glossary-entry {
  margin: 16px 12px 4px; transform: rotate(-.6deg);
  background: var(--surface); border: 1px dashed var(--line-strong);
  overflow: hidden;
}
.glossary-head {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 15px 16px; background: none; border: 0; text-align: left;
  transition: background .18s ease;
}
@media (hover: hover) {
  .glossary-head:hover { background: var(--surface-2); }
}
.glossary-icon {
  width: 38px; height: 38px; border-radius: var(--radius-control); flex-shrink: 0;
  border: 1px solid var(--line-strong); color: var(--accent);
  display: flex; align-items: center; justify-content: center; background: var(--surface);
}
.glossary-icon svg { width: 20px; height: 20px; }
.glossary-head-txt { flex: 1; min-width: 0; }
.glossary-title { display: block; font-family: var(--font-serif); font-size: 18px; font-weight: 800; color: var(--ink); }
.glossary-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.glossary-entry.open .chevron { transform: rotate(180deg); }
.glossary-collapse-inner { padding: 0 16px; border-top: 1px dashed var(--line-strong); }
.glossary-entry.open .glossary-collapse-inner { padding-bottom: 14px; }
.glossary-groups { margin-top: 10px; }
.glossary-group { padding: 9px 0; }
.glossary-group + .glossary-group { border-top: 1px dashed var(--line); }
.glossary-group-title {
  font-family: var(--font-num); font-size: 11px; font-weight: 700;
  letter-spacing: .14em; color: var(--muted); margin-bottom: 5px;
}
.glossary-item { padding: 7px 2px; }
.glossary-term { font-size: 14px; font-weight: 700; color: var(--ink); }
.glossary-usage { font-size: 13px; color: var(--ink-2); margin-top: 2px; line-height: 1.6; }
.glossary-diff { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.55; }
.diff-label { font-family: var(--font-num); font-weight: 700; font-size: 11px; color: var(--accent); letter-spacing: .04em; }

/* ---------- AI 教练 ---------- */
#view-coach {
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden; padding-bottom: 0;
}
.chat-shell { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }
.chat-bar {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 6px 14px 6px 18px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.text-btn { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 10px 12px; }
.chat-bar .text-btn { margin-left: auto; flex-shrink: 0; }
.method-line {
  flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted);
  font-family: var(--font-num); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.messages { flex: 1; overflow-y: auto; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; animation: msg-in .28s ease both; }
.msg.user { align-items: flex-end; }
.msg.bot { align-items: flex-start; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bubble {
  max-width: 86%; padding: 11px 14px; border-radius: var(--radius-control);
  font-size: 14.5px; word-break: break-word; white-space: normal; line-height: 1.6;
}
.msg.user .bubble { background: #1b1c21; color: #fff; border-bottom-right-radius: 4px; }
.msg.user .answer-body,
.msg.user .answer-body strong,
.msg.user .answer-body h4,
.msg.user .answer-body a,
.msg.user .answer-body li::marker { color: inherit; }
.msg.bot .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.md-li { display: block; margin: 2px 0 2px 4px; }
.retry-btn {
  margin-top: 7px; align-self: flex-start; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); border-radius: var(--radius-chip);
  padding: 7px 14px; font-size: 12.5px; font-weight: 600;
}
.welcome-bubble { max-width: 94%; }
.chip-row { display: flex; flex-direction: column; gap: 9px; padding: 0 2px 4px; }
.chip {
  align-self: flex-start; max-width: 100%; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-chip);
  padding: 10px 15px; font-size: 13.5px; color: var(--ink); font-weight: 600;
  text-align: left; line-height: 1.45; transition: background .18s ease, transform .12s ease;
}
.chip:active { transform: scale(.98); background: var(--accent-soft); }
.waiting-bubble {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px;
  background: var(--accent-soft); border: 1px dashed var(--accent);
}
.waiting-dots { display: inline-flex; gap: 4px; }
.waiting-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: .18s; }
.waiting-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes dot-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.waiting-text { font-size: 13px; color: var(--ink); }
.streaming-caret::after {
  content: "▍"; margin-left: 2px; color: var(--accent); animation: caret .8s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* 输入条 */
.coach-question-context { flex-shrink: 0; margin: 0 16px 8px; padding: 10px 12px; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--line) 60%, transparent); border-radius: var(--radius-control); background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); color: var(--muted); }
.coach-question-context-title { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.coach-question-context-title span { color: var(--muted); font-weight: 400; }
.coach-message-context { max-width: 86%; margin: 0 0 8px; padding: 8px 12px; border-left: 2px solid var(--line-strong); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); color: var(--muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.coach-question-context-body { max-height: min(128px, 18dvh); overflow-y: auto; overflow-wrap: anywhere; font-size: 13px; line-height: 1.65; }
.coach-context-markdown .answer-body { color: inherit; font-size: inherit; line-height: inherit; }
.coach-context-markdown .answer-body > * + * { margin-top: 6px; }
.coach-context-markdown .answer-body > h4 { margin-top: 10px; font-size: inherit; line-height: inherit; }
.coach-context-markdown .answer-body > h4:first-child { margin-top: 0; }
.coach-context-markdown .answer-body strong,
.coach-context-markdown .answer-body h4,
.coach-context-markdown .answer-body a,
.coach-context-markdown .answer-body li::marker { color: inherit; }
.coach-context-markdown .answer-body li + li { margin-top: 3px; }
.composer {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 12px; padding-bottom: calc(62px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 10px 13px; font-size: 14.5px; font-family: inherit; resize: none;
  min-height: 42px; height: 42px; max-height: min(240px, 34dvh); overflow-y: hidden;
  line-height: 1.4; outline: none; background: var(--bg); color: var(--ink);
}
.composer textarea:focus { border-color: var(--accent); }
.composer textarea::placeholder { color: var(--muted); }
.send-btn {
  border: 0; background: var(--accent); color: var(--accent-fg); border-radius: var(--radius-control);
  padding: 11px 18px; font-size: 14.5px; font-weight: 700; flex-shrink: 0;
  transition: background .18s ease, transform .12s ease;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:active { transform: scale(.97); }
.send-btn:disabled { opacity: .45; pointer-events: none; }
.mic-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none;
  transition: background .18s ease, color .18s ease;
}
.mic-btn svg { width: 21px; height: 21px; }
.mic-btn.recording { background: var(--accent); color: var(--accent-fg); animation: mic-pulse 1s infinite; }
@keyframes mic-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
.mic-btn:disabled { opacity: .45; pointer-events: none; }

/* ---------- 常用工具 ---------- */
#tools-groups { padding: 4px 20px 30px; }
.tools-group { margin-bottom: 10px; }
.tools-group-title {
  display: flex; align-items: baseline; gap: 12px; margin: 16px 0 4px;
  font-family: var(--font-serif); font-size: 17px; font-weight: 800; color: var(--ink);
}
.group-num { font-family: var(--font-num); font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.tool-item { border-bottom: 1px solid var(--line); }
.tool-head {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0;
  background: none; border: 0; text-align: left; transition: background .18s ease;
}
@media (hover: hover) {
  .tool-head:hover { background: var(--surface-2); }
}
.tool-head-txt { flex: 1; min-width: 0; }
.tool-title { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.tool-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.tool-item.open .chevron { transform: rotate(180deg); }
.tool-collapse-inner { padding: 0 0 0 2px; border-top: 1px dashed var(--line); }
.tool-item.open .tool-collapse-inner { padding-bottom: 15px; }
.tool-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; cursor: pointer; }
.tool-check + .tool-check { border-top: 1px solid var(--line); }
.tool-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tool-check input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-text { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 40;
}
.tab-btn {
  flex: 1; padding: 8px 0 9px; border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; position: relative; transition: color .18s ease;
}
.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.active { color: var(--ink); font-weight: 700; }
.tab-btn.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-90px);
  background: var(--ink); color: var(--bg); font-size: 13px; padding: 10px 18px;
  border-radius: var(--radius-chip); z-index: 90; max-width: 86%; text-align: center;
  transition: transform .28s cubic-bezier(.16, 1, .3, 1); line-height: 1.5;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .dia-node polygon { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .dia-contribution polygon { fill: var(--accent); }
  .msg { animation: none; }
}

/* 1.0 的纸面、墨色、朱砂红视觉语言保持不变；这里仅补足新交互。 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mic-btn:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.mic-btn.recording:hover { color: var(--accent-fg); background: var(--accent); }
.mic-btn.is-unsupported { color: var(--muted); }
.mobile-glossary-jump {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 18px; align-items: center; gap: 10px;
  width: calc(100% - 40px); margin: 18px 20px 4px; padding: 14px 15px; text-align: left;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.mobile-glossary-jump > span:first-child { color: var(--accent-deep); font: 700 20px/1 var(--font-serif); }
.mobile-glossary-jump strong { display: block; font: 800 16px/1.4 var(--font-serif); }
.mobile-glossary-jump small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.mobile-glossary-jump > span:last-child { color: var(--accent-deep); }
.glossary-jump { display: none; }
#glossary { scroll-margin-top: 22px; }
.kb-header { padding-bottom: 7px; }
.kb-title { font-size: clamp(28px, 7.4vw, 38px); }
.kb-quote { margin-top: 23px; }
.diamond-box { padding-top: 12px; }
.diamond-svg { width: 100%; max-width: 365px; }
.dia-name { font-size: 14px; }
.dia-line { font-size: 11.2px; }
.diamond-tip { margin-top: 9px; }
.intro-card { padding-bottom: 20px; }
.intro-ask { width: 100%; margin-top: 17px; }
.intro-em { color: var(--accent); font-weight: 700; border-bottom: 2px solid currentColor; padding-bottom: 1px; }
.essence-card p { margin-top: 7px; }
.reflect-question {
  margin-top: 24px; border-left: 2px solid var(--accent); background: var(--surface-2);
  padding: 12px 14px; font-family: var(--font-serif); font-weight: 700; line-height: 1.65;
}
.practice-ask { margin-top: 21px !important; width: 100%; }
.chat-title { font-family: var(--font-serif); font-size: 17px; font-weight: 800; }
.chat-title small { display: block; font-family: var(--font-sans); font-size: 10px; font-weight: 500; color: var(--muted); line-height: 1.1; }
.demo-note { max-width: 100%; font-size: 11.5px; color: var(--muted); line-height: 1.5; padding: 4px 5px 8px; }
.action-save-btn {
  align-self: flex-start; border: 1px solid var(--accent); border-radius: var(--radius-chip);
  background: var(--surface); color: var(--accent-deep); font-size: 12px; font-weight: 700;
  padding: 7px 12px; margin-top: 7px;
}
.action-save-btn:disabled { border-color: var(--line); color: var(--muted); cursor: default; }
.answer-bubble { padding: 16px 17px 17px; overflow: hidden; }
.answer-direct { font-size: 15px; line-height: 1.76; color: var(--ink); }
.answer-flow { margin-top: 13px; color: var(--ink-2); line-height: 1.76; }
.answer-actions { margin-top: 14px; padding: 13px 14px 13px 16px; background: var(--surface-2); border-radius: 6px; }
.answer-actions ol { padding-left: 20px; }
.answer-actions li { padding-left: 3px; }
.answer-actions li + li { margin-top: 11px; }
.answer-actions li::marker { color: var(--accent-deep); font-weight: 800; }
.answer-actions small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.answer-question { margin-top: 14px; padding-left: 12px; border-left: 2px solid var(--accent); color: var(--ink-2); font-weight: 600; line-height: 1.72; }
.answer-boundary { margin-top: 13px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; }
.tab-icon { height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.tab-icon svg { width: 22px; height: 22px; }
.field-label {
  display: block; margin-top: 16px; color: var(--ink); font-size: 13px;
  font-weight: 700; line-height: 1.55;
}
.field-label textarea, .field-label input {
  display: block; width: 100%; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 8px; color: var(--ink); font: 400 14px/1.55 var(--font-sans);
  padding: 10px 12px; margin-top: 7px; outline: none;
}
.field-label textarea:focus, .field-label input:focus { border-color: var(--accent); }
.field-label textarea { resize: vertical; min-height: 66px; }
.field-label textarea::placeholder { color: var(--muted); }
.tool-save { width: 100%; margin-top: 18px; }
.tool-coach-link {
  width: 100%; border: 0; background: none; color: var(--accent-deep); text-decoration: underline;
  text-underline-offset: 3px; font-size: 13px; padding: 11px 3px 1px; font-weight: 700;
}
.saved-action { padding: 9px 20px 2px; scroll-margin-top: 12px; }
.action-empty {
  border: 1px solid var(--line); background: var(--surface-2); padding: 15px 17px;
  border-left: 3px solid var(--accent);
}
.action-empty strong { display: block; font-family: var(--font-serif); font-size: 16px; }
.action-empty p { margin-top: 5px; color: var(--ink-2); font-size: 12.5px; }
.action-section-title { font-family: var(--font-serif); font-size: 17px; font-weight: 800; margin-bottom: 7px; }
.action-section-title span { color: var(--accent); font: 700 12px var(--font-num); margin-left: 6px; }
.action-item { border: 1px solid var(--line); padding: 13px 15px; margin-top: 9px; }
.action-meta { font: 600 11px var(--font-num); color: var(--muted); }
.action-title { font-size: 14px; line-height: 1.6; font-weight: 600; margin-top: 7px; }
.action-details { margin-top: 11px; border-top: 1px solid var(--line); padding-top: 9px; }
.action-details summary { color: var(--accent-deep); font-size: 12px; font-weight: 700; cursor: pointer; }
.action-detail { margin-top: 10px; font-size: 12px; line-height: 1.6; }
.action-detail strong { display: block; color: var(--muted); }
.action-detail p { margin-top: 3px; white-space: pre-wrap; }
.action-controls { display: flex; gap: 14px; margin-top: 11px; }
.action-controls button { border: 0; background: none; color: var(--accent-deep); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.action-controls button:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.tool-form { padding: 2px 2px 4px; }
@media (min-width: 900px) {
  body { background: #f6f5f2; }
  #app { max-width: 1600px; min-height: 100dvh; display: grid; grid-template-columns: 236px minmax(0, 1fr); box-shadow: 0 0 0 1px var(--line); }
  .app-main { grid-column: 2; grid-row: 1; min-width: 0; }
  .view { padding-bottom: 0; }
  .tabbar { position: sticky; grid-column: 1; grid-row: 1; top: 0; left: auto; bottom: auto; transform: none; max-width: none; width: 236px; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 7px; padding: 116px 15px 24px; border-top: 0; border-right: 1px solid var(--line); align-self: start; }
  .tabbar::before { content: 'AI 康老师'; position: absolute; top: 30px; left: 24px; font: 800 25px/1 var(--font-serif); letter-spacing: .04em; color: var(--ink); }
  .tabbar::after { content: '两天课后的继续学习'; position: absolute; top: 67px; left: 24px; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
  .tab-btn { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 8px; font-size: 14px; text-align: left; }
  .tab-btn.active { background: var(--accent-soft); color: var(--accent-deep); }
  .tab-btn.active::before { top: 10px; bottom: 10px; left: 0; width: 3px; height: auto; transform: none; border-radius: 3px; }
  .tab-icon, .tab-icon svg { width: 20px; height: 20px; }
  .knowledge-page { width: 100%; max-width: none; margin: 0; }
  .knowledge-hero { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(360px, .9fr); align-items: center; min-height: 450px; border-bottom: 1px solid var(--line); padding: 26px 38px 12px; gap: 28px; }
  .kb-header { padding: 0; align-self: center; }
  .kb-title { font-size: clamp(42px, 4vw, 64px); margin-top: 24px; }
  .kb-quote { max-width: 500px; margin-top: 32px; }
  .kb-quote-text { font-size: 23px; }
  .diamond-box { padding: 0; }
  .diamond-svg { max-width: 390px; }
  .intro-card { display: grid; grid-template-columns: 190px minmax(0, 1fr) 220px; align-items: center; gap: 22px; padding: 28px 38px; border-top: 0; }
  .intro-title { font-size: 22px; }
  .intro-card p { margin-top: 0; }
  .intro-ask { margin-top: 0; }
  .practice-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 20px 38px 0; border-top: 1px solid var(--line); }
  .practice-head { padding: 20px 8px; }
  .practice-item.open { grid-column: 1 / -1; }
  .practice-collapse-inner { padding: 0 18px; }
  .practice-item.open .practice-collapse-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0 34px; padding-bottom: 30px; }
  .practice-collapse-inner > .essence-card, .practice-collapse-inner > .reflect-question, .practice-collapse-inner > .practice-ask { grid-column: 1 / -1; }
  .practice-collapse-inner > .practice-ask { max-width: 360px; }
  .practice-collapse-inner > .block { margin-top: 26px; }
  #glossary { max-width: 900px; margin: 22px auto 0; padding: 0 18px; }
  .glossary-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 30px; }
  .glossary-group + .glossary-group { border-top: 0; }
  #view-coach { display: block; height: 100dvh; }
  .chat-shell { height: 100dvh; min-width: 0; }
  .chat-bar { padding: 14px 28px; min-height: 66px; }
  .messages { padding: 28px max(28px, calc((100% - 760px)/2)); }
  .coach-question-context { margin-inline: max(28px, calc((100% - 760px)/2)); }
  .bubble { max-width: 82%; }
  .coach-message-context { max-width: 82%; }
  .answer-bubble { max-width: 720px; }
  .composer { padding: 16px max(28px, calc((100% - 760px)/2)); }
  #view-tools .page { width: 100%; max-width: none; margin: 0; padding: 0 32px; }
  .page-header { padding: 42px 20px 12px; }
  .page-title { font-size: 38px; }
  #tools-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 40px; }
  .tools-group { margin-bottom: 10px; }
  .saved-action { padding-top: 18px; }
}
@media (min-width: 900px) and (max-width: 1170px) {
  #app { grid-template-columns: 200px minmax(0, 1fr); }
  .tabbar { width: 200px; }
  .knowledge-hero { grid-template-columns: 1fr 350px; gap: 10px; }
  .intro-card { grid-template-columns: 1fr 2fr; }
  .intro-ask { grid-column: 2; }
}
@media (min-width: 900px) and (max-width: 1050px) {
  .knowledge-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 50px; }
  .kb-header { max-width: 640px; }
  .diamond-box { padding: 18px 0 22px; }
  .intro-card { grid-template-columns: 1fr; }
  .intro-ask { grid-column: 1; max-width: 320px; }
}
@media (max-width: 380px) {
  .diamond-svg { max-width: 325px; }
  .dia-line { font-size: 11px; }
}

/* 网页端独立阅读工作区：目录与正文分开，避免手机手风琴在宽屏被拉长。 */
.desktop-learning, .desktop-tool-workspace { display: none; }
@media (min-width: 900px) {
  #app { max-width: none; box-shadow: none; }
  body { background: var(--surface-2); }
  .tabbar { background: var(--surface); }
  .knowledge-page { width: 100%; max-width: none; }
  .knowledge-hero {
    min-height: 354px; grid-template-columns: minmax(0, 1fr) 330px;
    gap: 60px; padding: 38px clamp(34px, 5vw, 80px); border-bottom: 0;
    background: var(--surface);
  }
  .kb-kicker { font-family: var(--font-sans); font-size: 12px; letter-spacing: .1em; }
  .kb-title { font-size: clamp(44px, 4.4vw, 66px); margin-top: 18px; }
  .kb-quote { max-width: 510px; margin-top: 25px; padding: 14px 20px 13px 48px; }
  .kb-quote-text { font-size: 20px; }
  .diamond-box { width: 330px; padding: 0; }
  .diamond-svg { width: 86%; max-width: 300px; }
  .diamond-tip { font-family: var(--font-sans); font-size: 11px; line-height: 1.5; letter-spacing: 0; }
  .intro-card {
    grid-template-columns: 190px minmax(0,1fr) auto; margin: 0 clamp(34px, 5vw, 80px);
    padding: 24px 0; gap: 25px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  .intro-card p { font-size: 14px; line-height: 1.65; }
  .intro-ask { width: auto; min-width: 205px; padding-left: 20px; padding-right: 20px; }
  .desktop-learning { display: block; margin: 0 clamp(34px, 5vw, 80px); padding: 56px 0 36px; scroll-margin-top: 22px; }
  .desktop-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
  .desktop-section-heading span, .workspace-eyebrow { font: 700 11px var(--font-num); letter-spacing: .14em; color: var(--accent-deep); }
  .desktop-section-heading h2 { font: 800 29px/1.35 var(--font-serif); margin-top: 8px; }
  .desktop-section-heading p { font-size: 13px; color: var(--muted); margin-top: 7px; }
  .glossary-jump {
    display: grid; grid-template-columns: 24px minmax(126px, 1fr) 14px; align-items: center; gap: 9px;
    flex: 0 0 auto; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--ink); text-align: left; transition: border-color .18s ease, background .18s ease;
  }
  .glossary-jump:hover { border-color: var(--accent); background: var(--accent-soft); }
  .glossary-jump .glossary-jump-icon { font: 700 18px/1 var(--font-serif); letter-spacing: 0; }
  .glossary-jump strong { display: block; font-size: 13px; line-height: 1.35; }
  .glossary-jump small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
  .glossary-jump > span:last-child { font-family: var(--font-sans); font-size: 15px; letter-spacing: 0; }
  .mobile-glossary-jump { display: none; }
  .desktop-workspace, .desktop-tool-workspace {
    display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    align-items: start; border: 1px solid var(--line); border-radius: 16px;
    background: var(--surface); overflow: clip; box-shadow: 0 12px 35px rgba(24, 24, 25, .035);
  }
  .desktop-workspace-nav { min-width: 0; align-self: stretch; padding: 24px 12px; background: var(--surface-2); border-right: 1px solid var(--line); }
  .workspace-nav-label { padding: 0 15px 13px; font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
  .workspace-nav-item {
    display: grid; grid-template-columns: 29px minmax(0,1fr) 15px; align-items: start; gap: 9px;
    width: 100%; padding: 14px 12px; border: 0; border-radius: 10px; background: transparent;
    text-align: left; color: var(--ink); transition: background .18s ease;
  }
  .workspace-nav-item + .workspace-nav-item { margin-top: 4px; }
  .workspace-nav-item:hover { background: var(--surface); }
  .workspace-nav-item.active { background: var(--surface); box-shadow: 0 1px 7px rgba(0,0,0,.045); }
  .workspace-nav-num { padding-top: 2px; font: 700 12px var(--font-num); color: var(--accent-deep); }
  .workspace-nav-item strong { display: block; font: 800 16px/1.35 var(--font-serif); }
  .workspace-nav-item small { display: block; font-size: 12px; line-height: 1.45; color: var(--muted); margin-top: 4px; }
  .workspace-arrow { opacity: 0; color: var(--accent); font-size: 16px; line-height: 1.1; }
  .workspace-nav-item.active .workspace-arrow { opacity: 1; }
  .workspace-nav-foot { margin: 22px 13px 0; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
  .desktop-workspace-detail { min-width: 0; padding: 32px clamp(30px, 4vw, 66px) 45px; }
  .workspace-detail-header { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .workspace-detail-header h3 { font: 800 32px/1.3 var(--font-serif); margin-top: 9px; }
  .workspace-detail-header p { color: var(--muted); font-size: 14px; margin-top: 6px; }
  .desktop-practice-content { max-width: 760px; }
  .desktop-practice-content .essence-card { margin: 23px 0 0; padding: 18px 21px; border-left: 3px solid var(--accent); background: var(--accent-soft); }
  .desktop-practice-content .essence-card p { font-size: 17px; line-height: 1.55; }
  .desktop-practice-content .block { margin-top: 36px; }
  .desktop-practice-content .block-title { font-size: 14px; }
  .desktop-practice-content .myths-list { margin-top: 18px; padding: 17px 20px; }
  .desktop-practice-content .point-row { padding: 16px 0; }
  .desktop-practice-content .point-row + .point-row { border-top: 1px solid var(--line); }
  .desktop-practice-content .point-example { margin-top: 10px; }
  .desktop-practice-content .quote-card { margin-top: 18px; padding: 17px; background: var(--surface-2); }
  .desktop-practice-content .quote-card::before { display: none; }
  .desktop-practice-content .quote-zh { font: 700 19px/1.65 var(--font-serif); text-align: center; }
  .desktop-practice-content .quote-en { max-width: 620px; margin: 14px auto 0; color: var(--muted); font-size: 13px; line-height: 1.6; font-style: italic; text-align: center; }
  .desktop-practice-content .reflect-question { margin-top: 30px; }
  .desktop-practice-content .practice-ask { max-width: 340px; }
  #practice-list { display: none; }
  #glossary { max-width: none; margin: 0 clamp(34px, 5vw, 80px); padding: 0 0 45px; }
  .glossary-entry { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .glossary-head { padding: 21px 26px; }
  .glossary-collapse-inner { padding-left: 25px; padding-right: 25px; }
  .about-note { padding-top: 0; }
  #view-tools .page { width: 100%; max-width: none; padding: 0 clamp(34px, 5vw, 80px) 55px; }
  #view-tools .page-header { padding: 47px 0 10px; }
  #view-tools .page-title { font-size: 40px; }
  #view-tools .page-sub { font-size: 14px; }
  #saved-action { padding: 18px 0 22px; }
  #saved-action .action-empty { background: var(--surface); border-radius: 12px; }
  #tools-groups { display: none; }
  .desktop-tool-workspace { display: grid; }
  .desktop-tool-content { max-width: 690px; padding: 8px 0 0; }
  .desktop-tool-content .field-label { margin-top: 22px; font-size: 14px; }
  .desktop-tool-content .field-label textarea { min-height: 78px; }
  .desktop-tool-content .tool-save, .desktop-tool-content .tool-coach-link { max-width: 360px; }
  .desktop-tool-content .tool-coach-link { display: block; }
}
@media (min-width: 900px) and (max-width: 1170px) {
  .knowledge-hero { grid-template-columns: minmax(0,1fr) 290px; gap: 20px; }
  .diamond-box { width: 290px; }
  .intro-card { grid-template-columns: 1fr; gap: 10px; }
  .intro-ask { max-width: 290px; }
  .desktop-workspace, .desktop-tool-workspace { grid-template-columns: 220px minmax(0,1fr); }
  .desktop-workspace-detail { padding-left: 26px; padding-right: 26px; }
}
@media (min-width: 900px) and (max-width: 1050px) {
  .knowledge-hero { grid-template-columns: 1fr; }
  .diamond-box { width: 290px; }
}

/* 历史对话、行动记录和工具指导 */
.chat-shell { position: relative; }
.chat-empty-intro { max-width: 660px; padding: 24px 2px 12px; }
.chat-empty-kicker { color: var(--accent-deep); font: 700 11px var(--font-num); letter-spacing: .12em; }
.chat-empty-intro h2 { margin-top: 8px; font: 800 26px/1.35 var(--font-serif); }
.chat-empty-intro > p:last-child { margin-top: 11px; max-width: 620px; color: var(--ink-2); font-size: 14px; line-height: 1.75; }
.chat-title { flex: 1; min-width: 0; }
.chat-bar-actions { display: flex; align-items: center; gap: 3px; }
.chat-bar .chat-bar-actions .text-btn { margin-left: 0; padding: 9px 7px; font-size: 12px; white-space: nowrap; }
.chat-history-panel {
  position: absolute; z-index: 30; inset: 45px 0 0; overflow-y: auto;
  background: var(--surface); padding: 20px; border-top: 1px solid var(--line);
}
.chat-history-panel.hidden { display: none; }
.history-panel-head { display: flex; align-items: start; justify-content: space-between; gap: 15px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.history-panel-head strong { font: 800 22px/1.3 var(--font-serif); }
.history-panel-head p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.history-panel-head button { border: 0; background: none; color: var(--muted); font-size: 27px; line-height: 1; padding: 0 5px; }
.chat-history-list { padding-top: 9px; }
.history-item { display: block; width: 100%; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.history-item:hover { background: var(--surface-2); }
.history-item.current strong { color: var(--accent-deep); }
.history-item strong { display: block; font-size: 14px; color: var(--ink); line-height: 1.45; }
.history-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.history-empty { color: var(--muted); font-size: 13px; line-height: 1.6; padding: 20px 4px; }
.tool-view-switch { display: flex; gap: 5px; margin: 16px 20px 6px; padding: 5px; border-radius: 11px; background: var(--surface-2); }
.tool-view-switch button { flex: 1; border: 0; border-radius: 8px; background: transparent; padding: 9px 11px; color: var(--muted); font-size: 13px; font-weight: 700; }
.tool-view-switch button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.07); }
.tool-view-switch span { display: inline-block; min-width: 19px; padding: 1px 5px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); font: 700 11px var(--font-num); margin-left: 4px; }
#saved-action.hidden, #tools-groups.hidden, #view-tools .desktop-tool-workspace.hidden { display: none; }
.action-empty button { margin-top: 14px; border: 0; background: var(--accent); color: var(--accent-fg); border-radius: 8px; padding: 10px 14px; font-weight: 700; }
.action-storage-note { margin: 5px 0 18px; color: var(--muted); font-size: 12px; }
.tool-form > .field-label:first-child { margin-top: 14px; }
@media (min-width: 900px) {
  .chat-history-panel { inset: 66px 0 0; padding: 28px max(28px, calc((100% - 760px)/2)); }
  .chat-bar .chat-bar-actions .text-btn { font-size: 13px; padding: 10px 12px; }
  .tool-view-switch { max-width: 440px; margin: 18px 0 23px; }
  #saved-action { max-width: 870px; padding: 5px 0 20px; }
  .action-item { border-radius: 10px; background: var(--surface); padding: 17px 20px; margin-top: 11px; }
}

/* 术语词典：恢复 1.0 的分类与“和常识不同”，并强化网页端阅读层级。 */
.glossary-entry {
  transform: none;
  margin: 16px 12px 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.glossary-head { padding: 16px; }
.glossary-icon svg, .mobile-glossary-jump svg, .glossary-jump-icon svg { width: 20px; height: 20px; }
.glossary-collapse-inner { padding: 0 16px; border-top: 0; }
.glossary-entry.open .glossary-collapse-inner { padding-bottom: 20px; border-top: 1px solid var(--line); }
.glossary-index {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 15px;
  scrollbar-width: none; border-bottom: 1px solid var(--line);
}
.glossary-index::-webkit-scrollbar { display: none; }
.glossary-index button {
  display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 7px;
  min-height: 44px; padding: 8px 11px; flex: 0 0 auto; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700;
}
.glossary-index button:hover { border-color: var(--accent); background: var(--accent-soft); }
.glossary-index button > span { color: var(--accent-deep); font: 700 10px var(--font-num); }
.glossary-index button small {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font: 700 10px var(--font-num);
}
.glossary-groups { margin-top: 0; }
.glossary-group { padding: 22px 0 8px; scroll-margin-top: 18px; }
.glossary-group + .glossary-group { border-top: 1px solid var(--line); }
.glossary-group-head { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.glossary-group-head > span {
  color: var(--accent-deep); font: 700 11px var(--font-num); letter-spacing: .08em;
}
.glossary-group-title {
  margin: 0; color: var(--ink); font: 800 17px/1.35 var(--font-serif); letter-spacing: .02em;
}
.glossary-group-head p { margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.glossary-item { padding: 14px 2px; }
.glossary-item + .glossary-item { border-top: 1px dashed var(--line-strong); }
.glossary-term { color: var(--ink); font: 800 15px/1.5 var(--font-serif); }
.glossary-usage { margin-top: 5px; color: var(--ink-2); font-size: 13px; line-height: 1.72; }
.glossary-diff {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px;
  margin-top: 8px; padding: 8px 10px; border-left: 2px solid var(--accent);
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.65;
}
.diff-label {
  padding-top: 1px; color: var(--accent-deep); font: 800 10.5px/1.55 var(--font-sans);
  letter-spacing: 0; white-space: nowrap;
}

@media (min-width: 900px) {
  .glossary-entry { margin: 0; }
  .glossary-head { padding: 21px 26px; }
  .glossary-title { font-size: 20px; }
  .glossary-sub { font-size: 12.5px; }
  .glossary-collapse-inner { padding-left: 26px; padding-right: 26px; }
  .glossary-entry.open .glossary-collapse-inner { padding-bottom: 28px; }
  .glossary-index {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
    padding: 20px 0; overflow: visible;
  }
  .glossary-index button { width: 100%; grid-template-columns: auto minmax(0, 1fr) auto; text-align: left; }
  .glossary-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-top: 22px; }
  .glossary-group {
    min-width: 0; padding: 22px 24px 12px; border: 1px solid var(--line) !important;
    border-radius: 12px; background: var(--surface);
  }
  .glossary-group-featured { grid-column: 1 / -1; }
  .glossary-group-featured .glossary-items { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .glossary-group-featured .glossary-item:nth-child(2) { border-top: 0; }
  .glossary-item { padding: 15px 2px; }
  .glossary-term { font-size: 16px; }
  .glossary-usage { font-size: 13.5px; }
}

/* 记录删除：保持整行可打开，删除作为独立操作。 */
.history-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  border-bottom: 1px solid var(--line);
}
.history-row .history-item { min-width: 0; border-bottom: 0; }
.history-delete {
  margin-right: 3px; padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 12px; font-weight: 700;
}
.history-delete:hover { color: var(--accent-deep); background: var(--accent-soft); }
.action-controls { align-items: center; flex-wrap: wrap; }
.action-controls .action-delete { margin-left: auto; color: var(--muted); }
.action-controls .action-delete:hover { color: var(--accent-deep); }

/* 大屏阅读容器：背景铺满，内容保持可读行长，工作卡不再无限拉宽。 */
@media (min-width: 1800px) {
  .app-main { background: var(--surface); }
  .knowledge-page,
  #view-tools .page {
    width: 100%; max-width: 1920px; min-height: 100dvh;
    margin-inline: auto; background: var(--surface);
  }
  #view-coach { background: var(--surface-2); }
  .chat-shell { width: 100%; max-width: 1600px; margin-inline: auto; background: var(--surface); }
  .knowledge-hero {
    grid-template-columns: minmax(620px, 1fr) 420px;
    gap: 80px; padding-left: 64px; padding-right: 64px;
  }
  .diamond-box { width: 420px; }
  .diamond-svg { max-width: 360px; }
  .intro-card,
  .desktop-learning,
  #glossary { margin-left: 64px; margin-right: 64px; }
  .desktop-workspace { max-width: 1500px; }
  .desktop-workspace,
  .desktop-tool-workspace { margin-left: auto; margin-right: auto; }
  .desktop-tool-workspace { max-width: 1320px; }
  #view-tools .page-header { max-width: 1320px; margin-left: auto; margin-right: auto; }
  #view-tools .tool-view-switch {
    margin-left: max(0px, calc((100% - 1320px) / 2));
  }
  .desktop-practice-content { max-width: 960px; }
  .desktop-tool-content { max-width: 760px; }
  #saved-action { max-width: 1100px; margin-left: auto; margin-right: auto; }
}

/* 等待回答时的“正在思考” */
.thinking-bubble { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.thinking-dots { display: inline-flex; gap: 4px; }
.thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .25; animation: thinking-dot 1.2s infinite ease-in-out; }
.thinking-dots i:nth-child(2) { animation-delay: .2s; }
.thinking-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes thinking-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .thinking-dots i { animation: none; opacity: .6; } }

/* 回答分点 */
.answer-points { margin-top: 12px; padding-left: 0; list-style: none; counter-reset: point; }
.answer-points li { position: relative; padding-left: 28px; counter-increment: point; }
.answer-points li + li { margin-top: 11px; }
.answer-points li::before { content: counter(point); position: absolute; left: 0; top: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--accent-soft, rgba(196, 59, 42, .1)); color: var(--accent-deep); font: 700 11.5px/19px var(--font-num, inherit); text-align: center; }
.answer-points strong { display: block; color: var(--ink); font-size: 14.5px; line-height: 1.6; }
.answer-points p { margin-top: 2px; color: var(--ink-2); font-size: 14px; line-height: 1.72; }
.answer-flow + .answer-flow { margin-top: 8px; }
.answer-actions-label { margin-bottom: 8px; color: var(--accent-deep); font-size: 12px; font-weight: 700; letter-spacing: .06em; }

/* 回答正文：按内容排版（段落、列表、小标题、加粗） */
.answer-body { color: var(--ink); font-size: 15px; line-height: 1.78; }
.answer-body > * { margin: 0; }
.answer-body > * + * { margin-top: 12px; }
.answer-body > h4 { margin: 18px 0 0; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.answer-body > h4:first-child { margin-top: 0; }
.answer-body > h4 + * { margin-top: 6px; }
.answer-body ol, .answer-body ul { margin: 0; padding-left: 22px; }
.answer-body li + li { margin-top: 6px; }
.answer-body ol li::marker { color: var(--accent-deep); font-weight: 700; }
.answer-body ul li::marker { color: var(--accent-deep); }
.answer-body strong { font-weight: 700; color: var(--ink); }


/* 正式版附加状态；主页面结构与上方两份参考样式保持一致。 */
.coach-access-note { margin-top: auto; padding: 20px 12px; color: var(--muted); font-size: 11px; }
.coach-ai-notice { position: absolute; top: 54px; right: 16px; color: var(--muted); font-size: 9px; line-height: 1.3; pointer-events: none; }
.workspace-detail-header h2 { font: 800 32px/1.3 var(--font-serif); margin-top: 9px; }
.coach-notice { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: min(620px, calc(100vw - 32px)); padding: 12px 18px; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; box-shadow: 0 5px 24px #0001; font-size: 13px; }
.coach-notice button { border: 0; background: none; color: var(--accent-deep); padding: 0 6px; }
.coach-modal-backdrop { position: fixed; inset: 0; z-index: 110; background: #0005; display: grid; place-items: center; padding: 20px; }
.coach-modal { width: min(680px, 100%); max-height: 85dvh; overflow: auto; padding: 26px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.coach-modal header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.coach-modal header button { border: 0; background: none; color: var(--muted); font-size: 24px; }
.coach-primary, .coach-secondary { border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; background: var(--surface); color: var(--accent-deep); }
.coach-primary { background: var(--accent); color: var(--accent-fg); margin-top: 16px; border: 0; }
.coach-history-backdrop { position: fixed; inset: 0 0 56px; z-index: 30; pointer-events: none; }
.coach-history { pointer-events: auto; }
.history-panel-head h2 { font: 800 22px/1.3 var(--font-serif); }
.action-empty h3 { font: 700 16px/1.5 var(--font-serif); }
@media (min-width: 900px) { .coach-history-backdrop { left: 236px; bottom: 0; } .coach-ai-notice { top: 71px; } }
@media (min-width: 900px) and (max-width: 1170px) { .coach-history-backdrop { left: 200px; } }
@media (max-width: 899px) { .coach-access-note { display: none; } }

.desktop-tool-content > .tool-form { padding: 0; }

.coach-stream-cursor { display:inline-block; width:2px; height:1em; margin-left:3px; background:currentColor; animation:coach-caret 1s step-end infinite; }
@keyframes coach-caret { 50% { opacity:0; } }
@media (prefers-reduced-motion: reduce) { .coach-stream-cursor { animation:none; } }
