/* My Chess Review · 版式与组件
 * 这里只写结构，颜色、圆角、字体、按钮厚度全部来自 css/theme.css 里的变量。换主题 = 换 css/theme.css 这一个文件
 * （三套候选在 docs/design/2026-11-12/theme-a|b|c.css，变量名一致）。
 * 界面是中性色、扁平、小字、只有一个强调色，棋盘是页面上唯一有颜色和质感的东西（张哲 11-12：原来那套像 AI 做的玩具）。
 * 不用装饰性渐变、不用外部字体；尊重 prefers-reduced-motion。
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, .pgn, textarea { font-family: var(--font-mono); }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-track); line-height: 1.2; margin: 0; }

/* ---------- 顶栏 ---------- */
.site-nav { background: var(--nav-bg); border-bottom: var(--nav-border); }
.nav-inner { max-width: calc(var(--stage) + 476px); margin: 0 auto; padding: 0 24px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--nav-ink); text-decoration: none; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 16px; letter-spacing: var(--head-track); }
.logo-mark { width: 24px; height: 24px; flex: none; }
.lm-bg { fill: var(--logo-bg); }
.lm-sq { fill: var(--logo-ink); opacity: .22; }
.lm-ln { fill: none; stroke: var(--logo-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav-links a { display: block; padding: 6px 10px; border-radius: var(--radius-xs); color: var(--nav-muted, var(--nav-ink)); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav-links a:hover { background: var(--nav-hover); color: var(--nav-ink); }
.nav-links a[aria-current="page"] { background: var(--nav-current); color: var(--nav-current-ink); }

/* ---------- 首屏工具区：左边棋盘（主角），右边一栏工具 ---------- */
:root { --stage: max(360px, calc(100vh - 176px)); } /* 棋盘那一栏的宽度：让整张棋盘加上下面的按钮正好在一屏里 */
.hero {
  margin: 0 auto; padding: 20px 24px 32px;
  display: grid; gap: 16px 28px; align-items: start; justify-content: center;
  grid-template-columns: minmax(0, var(--stage)) minmax(340px, 400px); grid-template-rows: auto 1fr;
}
.board-area { grid-column: 1; grid-row: 1 / span 2; }
.hero-copy { grid-column: 2; grid-row: 1; }
.hero > .panel { grid-column: 2; grid-row: 2; }
/* 复盘中：右栏整栏是复盘面板，对局小结放到棋盘下面 */
.hero.review .board-area { grid-row: 1; }
.hero.review .hero-copy { grid-column: 1; grid-row: 2; }
.hero.review > .panel { grid-row: 1 / span 2; }
.hero-copy h1 { font-size: 24px; line-height: 1.2; }
.lede { margin: 8px 0 16px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.trust { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* 输入区 */
.entry { background: var(--surface); border: var(--card-border); border-radius: var(--radius); padding: 12px; box-shadow: var(--card-shadow); }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--radius-sm); }
.tab { border: 0; background: transparent; padding: 7px 6px; border-radius: calc(var(--radius-sm) - 2px); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--tab-on); color: var(--tab-on-ink); box-shadow: var(--tab-shadow); }
.pane { margin-top: 12px; }
.lbl { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--muted); padding: 0; }
textarea, input[type="text"] {
  display: block; width: 100%; background: var(--input-bg); color: var(--ink); border: var(--input-border); border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 14px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; font-size: 13px; }
textarea::placeholder, input::placeholder { color: var(--placeholder); }
.site-pick { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.site-pick legend { margin-bottom: 6px; width: 100%; }
.site-pick label { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: var(--input-border); border-radius: var(--radius-sm); background: var(--input-bg); font-weight: 500; font-size: 14px; cursor: pointer; }
.site-pick input { accent-color: var(--primary); margin: 0; }
.sample-k { margin: 0; font-weight: 600; font-size: 15px; }
.sample-v { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.status { margin: 12px 0 0; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--ink); }
.status:empty { display: none; }

/* 按钮：扁平，没有厚底边 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  background: var(--primary); color: var(--on-primary); border: var(--btn-border); border-radius: var(--btn-radius);
  font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer; transition: background-color .12s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { background: var(--primary-press); }
.btn-wide { width: 100%; margin-top: 12px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-ghost { background: var(--ghost-bg); color: var(--ink); border: var(--ghost-border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost:active { background: var(--ghost-press); }

/* 棋盘 */
.board-area { min-width: 0; width: 100%; }
.board-row { display: flex; gap: 8px; align-items: stretch; }
.board {
  flex: 1; min-width: 0; aspect-ratio: 1; box-sizing: border-box; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  position: relative; border: var(--frame-w, 22px) solid var(--frame-c, #5B3C26); border-radius: var(--board-radius); box-shadow: var(--board-frame);
  /* 格子：底色用渐变画出深浅相间（左上角是浅格）；主题可以再用 border-image 盖一张带边框的木纹底图（切片 72，见 dev/board-art.js） */
  background: repeating-conic-gradient(var(--sq-d) 0 25%, var(--sq-l) 0 50%) 0 0 / 25% 25% padding-box var(--sq-l);
}
.sq { position: relative; }
.pc { position: absolute; left: -4%; top: -6.5%; width: 108%; height: 108%; z-index: 1; }
.co { position: absolute; font-size: 11px; font-weight: 700; line-height: 1; z-index: 2; font-family: var(--font-body); display: none; }
.co-r { top: 4px; left: 4px; }
.co-f { bottom: 3px; right: 4px; }
.sq.l .co { color: var(--co-on-l); }
.sq.d .co { color: var(--co-on-d); }
/* 边框上的坐标 */
.fc { position: absolute; display: grid; place-items: center; z-index: 2; color: var(--frame-ink, #EAD3A8); font: 600 12px/1 var(--font-coord, Georgia, serif); pointer-events: none; }
.fc-r { left: calc(-1 * var(--frame-w, 22px)); width: var(--frame-w, 22px); height: 12.5%; }
.fc-f { bottom: calc(-1 * var(--frame-w, 22px)); height: var(--frame-w, 22px); width: 12.5%; }
.hl { position: absolute; inset: 0; }
.hl-from, .hl-to { background: var(--hl-move); }
.hl-bad { background: var(--hl-bad); }
.hl-best { box-shadow: inset 0 0 0 4px var(--arrow); }
.sq-badge {
  position: absolute; top: 3px; right: 3px; z-index: 3; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px;
  display: grid; place-items: center; font: 800 12px/1 var(--font-body); background: var(--g); color: var(--on-g); box-shadow: 0 0 0 2px var(--badge-ring);
}
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.arrow line { stroke: var(--arrow); stroke-width: 2.2; stroke-linecap: round; }
.arrow polygon { fill: var(--arrow); }
.arrow { opacity: .9; }

/* 评估条 */
.evalbar { position: relative; flex: none; width: 24px; border-radius: var(--radius-xs); overflow: hidden; background: var(--eval-b); box-shadow: var(--eval-frame, var(--board-frame)); }
.eb-w { position: absolute; left: 0; right: 0; bottom: 0; background: var(--eval-w); }
.eb-num { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font: 700 10px/1 var(--font-body); color: var(--eval-b); font-variant-numeric: tabular-nums; }
.eb-num.top { bottom: auto; top: 6px; color: var(--eval-w); }

.player { margin: 0 0 8px 32px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.player:not(.top) { margin: 8px 0 0 32px; }
.pl-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line-strong); }
.pl-dot.w { background: var(--pw); }
.pl-dot.b { background: var(--pb); }

.board-ctl { display: flex; justify-content: center; gap: 6px; margin: 12px 0 0 32px; }
.btn-icon {
  width: 44px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--muted); border: var(--card-border); border-radius: var(--radius-sm);
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 复盘面板 */
.panel { background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.panel > * { padding: 12px 14px; }
.panel > * + * { border-top: 1px solid var(--line); }
/* 还没载入对局时：只留一句提示，不摆空的数字和空图 */
.panel.empty { background: transparent; border: 0; box-shadow: none; }
.panel.empty > :not(.explain) { display: none; }
.panel.empty > .explain { padding: 4px 0 0; border-top: 0; }
.acc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; }
.acc { padding: 12px 14px; }
.acc + .acc { border-left: 1px solid var(--line); }
.acc-k { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.acc-v { display: block; font: 650 28px/1.15 var(--font-body); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.graph-box { padding: 0; }
.graph { width: 100%; height: 72px; }
.gr-b { fill: var(--eval-b); }
.gr-e { fill: var(--surface-2); }
.graph.empty .gr-mid { stroke: var(--line-strong); }
.gr-w { fill: var(--eval-w); }
.gr-mid { stroke: var(--graph-mid); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.gr-now { stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.gr-dot { fill: var(--g); stroke: var(--eval-b); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.explain p { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.explain .ex-k { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.explain.empty p { color: var(--muted); font-size: 13px; }
.explain.empty .ex-k { color: var(--ink); font-size: 13px; }
.ex-k { font-weight: 650; }
.ex-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.moves-box { max-height: 300px; overflow: auto; padding: 6px 8px; }
.moves-empty { margin: 8px 0; color: var(--muted); font-size: 13px; text-align: center; }
.moves { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.moves li { display: grid; grid-template-columns: 34px 1fr 1fr; align-items: center; gap: 2px; }
.no { color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 6px; font-size: 13px; }
.mv { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border-radius: var(--radius-xs); font-weight: 500; }
.mv.now { background: var(--now-bg, var(--primary)); color: var(--now-ink, var(--on-primary)); font-weight: 650; }
.lines { display: block; }
.lines ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.lines li { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: var(--radius-xs); padding: 7px 10px; font-size: 13px; }
.lines .ev { font-weight: 650; min-width: 36px; font-variant-numeric: tabular-nums; }
.lines .ln { color: var(--muted); }
.lines .ex-k { margin: 0; font-size: 13px; color: var(--muted); font-weight: 500; }

/* 分级色标：.g-xxx 只设两个变量，用的地方取 var(--g) / var(--on-g) */
.g-brilliant { --g: var(--g-brilliant); --on-g: var(--on-g-brilliant); }
.g-great { --g: var(--g-great); --on-g: var(--on-g-great); }
.g-best { --g: var(--g-best); --on-g: var(--on-g-best); }
.g-excellent { --g: var(--g-excellent); --on-g: var(--on-g-excellent); }
.g-good { --g: var(--g-good); --on-g: var(--on-g-good); }
.g-book { --g: var(--g-book); --on-g: var(--on-g-book); }
.g-inaccuracy { --g: var(--g-inaccuracy); --on-g: var(--on-g-inaccuracy); }
.g-mistake { --g: var(--g-mistake); --on-g: var(--on-g-mistake); }
.g-miss { --g: var(--g-miss); --on-g: var(--on-g-miss); }
.g-blunder { --g: var(--g-blunder); --on-g: var(--on-g-blunder); }
.mk { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 4px; border-radius: 9px; font: 700 11px/1 var(--font-body); font-style: normal; background: var(--g); color: var(--on-g); flex: none; }
.mk.g-good, .mk.g-book { min-width: 8px; width: 8px; height: 8px; padding: 0; margin: 0 6px; }
.mk.g-book { background: transparent; box-shadow: inset 0 0 0 2px var(--g); width: 10px; min-width: 10px; height: 10px; margin: 0 5px; } /* Book：空心圆，和 Good 的实心点分开 */

/* 对局小结（复盘中，放在棋盘下面） */
.game-card { padding-left: 32px; }
.kicker { display: none; }
.game-card h2 { font-size: 17px; line-height: 1.3; }
.game-meta { margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.game-meta + .game-opening { margin-top: -8px; }
.grades { width: 100%; border-collapse: collapse; font-size: 13px; }
.grades th, .grades td { padding: 6px 6px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.grades th[scope="row"], .grades thead th:first-child { text-align: left; }
.grades th[scope="row"] { display: flex; align-items: center; gap: 8px; }
.grades thead th { border-top: 0; font-size: 12px; color: var(--muted); }
.game-card .btn { margin-top: 12px; }

/* ---------- 正文 ---------- */
.content { max-width: 720px; margin: 0 auto; padding: 24px 24px 72px; border-top: 1px solid var(--line); }
.content section { margin-top: 44px; }
.content h2, .doc h2 { font-size: 24px; margin: 0 0 12px; }
.doc h2 { margin-top: 40px; }
.content h3 { font-size: 18px; margin: 24px 0 8px; }
.content p, .doc p, .content li, .doc li { font-size: 16px; line-height: 1.7; color: var(--text, var(--ink)); }
.content p, .doc p { margin: 0 0 14px; }
.content ul, .content ol, .doc ul, .doc ol { padding-left: 22px; margin: 0 0 16px; }
.content li, .doc li { margin-bottom: 8px; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.pgn { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; margin: 0 0 16px; }
.grade-list { margin: 8px 0 18px; display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: baseline; }
.grade-list dt { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.grade-list dt .mk { min-width: 28px; }
.grade-list dt .mk.g-good { min-width: 12px; margin: 0 8px; }
.grade-list dt .mk.g-book { min-width: 12px; width: 12px; height: 12px; margin: 0 8px; }
.grade-list dd { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text, var(--ink)); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 16px; list-style-position: outside; }
.faq details p { margin: 0 0 16px; color: var(--ink); }

.doc { max-width: 760px; margin: 0 auto; padding: 28px 24px 72px; }
.doc h1 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 12px; }
.doc .lede { font-size: 17px; }
.updated { color: var(--muted); }
.crumbs { max-width: calc(var(--stage) + 476px); margin: 0 auto; padding: 16px 24px 0; font-size: 14px; color: var(--muted); }
.doc .crumbs { padding: 0 0 14px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li { margin: 0; font-size: 14px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--muted); }
.crumbs + .hero { padding-top: 14px; }

.site-foot { border-top: 1px solid var(--line); padding: 28px 24px 36px; text-align: center; font-size: 14px; color: var(--muted); background: var(--foot-bg); }
.site-foot p { margin: 6px auto; max-width: 760px; }
.foot-links a { color: var(--ink); }
.foot-links .lang-switch { color: var(--muted); } /* 语言切换：放在页脚、不抢眼 */

/* ---------- 第二阶段：交互状态（只用主题变量，浅色 E、深色 D 都能用） ---------- */
[hidden] { display: none !important; }
/* 分析中：右栏顶部的进度 */
.progress { background: var(--surface); border: var(--card-border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--card-shadow); }
.prog-k { margin: 0; font-weight: 650; font-size: 15px; }
.prog-v { margin: 4px 0 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.prog-fill { height: 100%; width: 0; background: var(--primary); transition: width .2s linear; }
.progress .btn { margin-top: 12px; }
/* 对局列表（用户名取回的对局、多盘 PGN） */
.game-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); max-height: 360px; overflow: auto; }
.game-list li + li { border-top: 1px solid var(--line); }
.gl-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 6px; cursor: pointer; border-radius: var(--radius-xs); }
.gl-item:hover { background: var(--surface-2); }
.gl-top { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.gl-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
/* 走法列表、评估曲线可以点 */
.moves .mv[data-i] { cursor: pointer; }
.moves .mv[data-i]:not(.now):hover { background: var(--surface-2); }
.panel .graph:not(.empty) { cursor: pointer; }
/* 对局小结的按钮和分享链接 */
.card-act { display: flex; flex-wrap: wrap; gap: 8px; }
.share-box { margin-top: 12px; }
.share-box input { font-size: 13px; font-family: var(--font-mono); }
.share-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
/* 这盘棋该记住什么：一句结论、涉及的几步（点了跳过去）、下一盘的一个习惯、开局原则。右上角切换看白方还是黑方 */
.lesson { padding: 10px 14px 12px; }
.le-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.le-top .mo-k { margin: 0; }
.le-side { display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: var(--radius-sm); }
.le-s { border: 0; background: transparent; padding: 3px 9px; border-radius: calc(var(--radius-sm) - 2px); font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.le-s.on { background: var(--tab-on); color: var(--tab-on-ink); box-shadow: var(--tab-shadow); }
.le-h { margin: 8px 0 0; font-size: 15px; font-weight: 650; line-height: 1.45; }
.le-mvs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.le-mv { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-xs); padding: 3px 8px 3px 5px; font-size: 13px; font-weight: 600; cursor: pointer; }
.le-mv:hover, .le-mv.now { background: var(--now-bg, var(--surface-2)); }
.le-more { font-size: 12px; color: var(--muted); }
.le-do, .le-o { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--text, var(--ink)); }
.le-o + .le-o { margin-top: 4px; }
.le-c { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.gloss { margin: 8px 0 0 !important; padding: 7px 10px; background: var(--surface-2); border-radius: var(--radius-xs); font-size: 13px !important; line-height: 1.5 !important; color: var(--text, var(--ink)); }
/* 关键时刻：复盘面板里曲线下面的几行，点一下跳到那一步；整盘走法列表默认收在按钮后面 */
.moments { padding: 10px 14px 10px; }
.mo-k { margin: 0 0 4px; font-size: 13px; font-weight: 650; color: var(--muted); }
.mo-none { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text, var(--ink)); }
.mo-list { list-style: none; margin: 0 -8px; padding: 0; display: grid; gap: 2px; }
.mo-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; column-gap: 8px; row-gap: 1px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: var(--radius-xs); padding: 6px 8px; cursor: pointer; }
.mo-item:hover { background: var(--surface-2); }
.mo-item.now { background: var(--now-bg, var(--surface-2)); }
.mo-item .mk { justify-self: start; }
.mo-mv { font-size: 14px; font-weight: 650; }
.mo-g { font-weight: 500; color: var(--muted); margin-left: 4px; }
.mo-t { grid-column: 2; font-size: 13px; line-height: 1.4; color: var(--text, var(--ink)); }
.moves-toggle { padding: 8px 14px; }
.moves-toggle .btn { width: 100%; }
/* 分析棋盘：选中的子、可走格、拖动、升变 */
[data-play] .board { touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.hl-sel { background: var(--hl-move); }
.hint { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hint-move::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28%; height: 28%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--arrow); opacity: .55; }
.hint-take { box-shadow: inset 0 0 0 4px var(--arrow); opacity: .7; }
.pc.lifted { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; }
.promo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; display: flex; gap: 4px; padding: 6px; background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.promo-btn { position: relative; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; padding: 0; }
.promo-btn:hover { background: var(--line); }
.promo-btn .pc { left: 4%; top: 2%; width: 92%; height: 92%; }
.lines ol { grid-template-columns: minmax(0, 1fr); }
.lines li { min-width: 0; }
.lines .ev { flex: none; }
.lines .ln { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) { .promo-btn { width: 44px; height: 44px; } }
/* 人机练习：右栏是教练面板。教练拦下一步棋时左边一道色条，棋盘上那一步标红、对方的应着画成红箭头 */
.pl-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.pl-turn { margin: 0; font-size: 15px; font-weight: 650; }
.pl-vs { margin: 0; font-size: 12px; color: var(--muted); }
.pl-coach { min-height: 96px; }
.pl-extra { color: var(--muted) !important; }
/* 「对方这一步」：有要应对的事（被将军、要被将死、有子能被白吃）时放在浅灰底的小卡片里 */
.coach.opp { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.coach.opp:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.coach.opp-check, .coach.opp-mate, .coach.opp-threat { border-top: 0; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.coach.opp-check .ex-k, .coach.opp-mate .ex-k, .coach.opp-threat .ex-k { color: var(--ink); }
.coach.opp .ex-k, .coach.hint .ex-k { font-size: 13px; color: var(--muted); }
/* 开局阶段的建议走法：和「对方这一步之后」一样用细线隔开 */
.coach.suggest { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.coach.suggest:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.coach.suggest .ex-k { font-size: 13px; color: var(--muted); }
/* 开局清单：做到的打勾，没做的空心圈，做错的叉；能易位时那一行加粗 */
.pl-open { padding: 10px 14px 10px; }
.ck-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.ck { position: relative; padding-left: 22px; font-size: 13px; line-height: 1.45; color: var(--text, var(--ink)); }
.ck::before { position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font: 700 10px/1 var(--font-body); content: ""; }
.ck-open::before { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.ck-done { color: var(--muted); }
.ck-done::before { content: "✓"; background: var(--g-best); color: var(--on-g-best); }
.ck-now { font-weight: 650; }
.ck-now::before { box-shadow: inset 0 0 0 2px var(--primary); }
.ck-bad::before { content: "×"; background: var(--g-blunder); color: var(--on-g-blunder); }
.coach.quiet p:not(.ex-k), .coach.intro p:not(.ex-k), .coach.again p:not(.ex-k) { color: var(--muted); }
.coach.quiet .ex-k, .coach.intro .ex-k, .coach.again .ex-k, .coach.hint .ex-k, .coach.note .ex-k, .coach.opening .ex-k, .coach.good .ex-k { font-size: 13px; color: var(--muted); }
.pl-coach:has(.coach.stop) { box-shadow: inset 3px 0 0 var(--g-blunder); }
.panel > .pl-act { margin-top: 0; }
.btn[disabled] { opacity: .45; cursor: default; pointer-events: none; }
.arrow-bad line { stroke: var(--g-blunder); }
.arrow-bad polygon { fill: var(--g-blunder); }

/* ---------- 响应式 ---------- */
@media (max-width: 979px) {
  .hero, .hero.review { grid-template-columns: minmax(0, 1fr); }
  .hero > *, .hero.review > * { grid-column: 1 !important; grid-row: auto !important; }
  /* 还没载入对局：先标题和输入区，再棋盘。复盘中：棋盘、面板、对局小结 */
  .hero-copy { order: 1; } .board-area { order: 2; } .hero > .panel { order: 3; }
  .hero.review .board-area { order: 1; } .hero.review > .panel { order: 2; } .hero.review .hero-copy { order: 3; }
  .board-area, .hero-copy, .hero > .panel { max-width: 640px; width: 100%; margin: 0 auto; }
}
@media (max-width: 767px) {
  .hero { padding: 16px 16px 24px; gap: 16px; }
  .hero-copy h1 { font-size: 22px; }
  textarea { min-height: 64px; }
  .nav-inner { padding: 8px 16px; flex-wrap: wrap; gap: 4px; min-height: 0; }
  .nav-links { width: 100%; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .nav-links a { padding: 6px 6px; font-size: 13px; white-space: nowrap; } /* 四个入口要在 375 宽里排成一行 */
  .content, .doc { padding-left: 16px; padding-right: 16px; }
  .crumbs { padding: 12px 16px 0; }
  .content h2, .doc h2 { font-size: 21px; }
  .grade-list { grid-template-columns: 1fr; gap: 4px; }
  .grade-list dd { margin-bottom: 10px; }
  .board-ctl { margin-left: 0; }
  .game-card { padding-left: 0; }
  .board { --frame-w: var(--frame-w-s, 7px); }
  .fc { display: none; }
  .co { display: block; font-size: 9px; }
  .sq-badge { min-width: 20px; height: 20px; font-size: 10px; top: 2px; right: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
