/* =========================================================
   象棋研习室 · 界面样式
   ========================================================= */
:root {
  --ink: #241f19;
  --ink-soft: #6a6053;
  --ink-faint: #9c9081;
  --paper: #fffdf8;
  --paper-2: #f7efe1;
  --line: rgba(166, 132, 88, .32);
  --line-strong: rgba(140, 105, 62, .55);
  --gold: #b3854a;
  --gold-soft: #d9b781;
  --red: #a3302a;
  --red-bright: #c8443a;
  --green: #3f7a5b;
  --shadow-sm: 0 2px 6px rgba(70, 45, 20, .08);
  --shadow: 0 18px 44px rgba(70, 45, 20, .12), 0 2px 8px rgba(70, 45, 20, .07);
  --radius: 22px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", "Songti SC", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(80% 55% at 12% -5%, #fffdf7 0%, rgba(255, 253, 247, 0) 55%),
    radial-gradient(70% 45% at 100% 0%, #f7e8d4 0%, rgba(247, 232, 212, 0) 62%),
    linear-gradient(180deg, #fbf6ec 0%, #f4ecdd 48%, #eee2cd 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><fractalNoise type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.22'/></svg>");
}

a { color: inherit; }

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

button { cursor: pointer; }

/* ---------- 布局 ---------- */

.app { position: relative; z-index: 1; }

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.seal {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-family: var(--font-kai);
  font-size: 26px; font-weight: 700;
  color: #ffeede;
  background: linear-gradient(158deg, #bb4136, #8d241f 78%);
  border: 1px solid rgba(255, 226, 198, .4);
  box-shadow: 0 8px 18px rgba(140, 45, 34, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
  letter-spacing: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #2a231b;
}

.brand-text p {
  margin: 3px 0 0;
  font-size: 12.5px;
  letter-spacing: .18em;
  color: var(--ink-faint);
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 402px;
  gap: 26px;
  align-items: stretch;
}

/* ---------- 卡片 ---------- */

.card {
  position: relative;
  background: linear-gradient(178deg, #fffefa 0%, #fdf7ec 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

/* ---------- 棋盘区域 ---------- */

.board-card { padding: 16px 18px 18px; }

.board-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.turn-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 15px 0 12px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: .06em;
  color: #4a4033;
  background: #f6ecdb;
  border: 1px solid rgba(170, 135, 90, .3);
  box-shadow: inset 0 1px 0 #fff;
  transition: background .25s, color .25s;
}

.turn-pill .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 0 3px rgba(200, 68, 58, .14);
  animation: pulse 2.2s ease-in-out infinite;
}

.turn-pill.black .dot {
  background: #33302b;
  box-shadow: 0 0 0 3px rgba(51, 48, 43, .12);
}

.turn-pill.thinking { background: #fdf1d6; color: #8a6120; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: .95; }
  50% { transform: scale(1.14); opacity: 1; }
}

.board-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(170, 135, 90, .28);
  background: #fbf4e7;
  color: #6b5b45;
  font-size: 15px;
  line-height: 1;
  transition: .18s;
}

.icon-btn:hover { background: #f5e8d1; color: #3d3226; }
.icon-btn.off { opacity: .45; }

.board-shell { display: flex; justify-content: center; }

.board-frame {
  width: 100%;
  max-width: 596px;
  padding: clamp(9px, 1.6vw, 16px);
  border-radius: 20px;
  background:
    linear-gradient(150deg, #7a5334 0%, #5a3c22 45%, #452b16 100%);
  box-shadow:
    0 24px 50px rgba(50, 30, 12, .26),
    0 3px 8px rgba(50, 30, 12, .18),
    inset 0 1px 0 rgba(255, 220, 170, .28),
    inset 0 -1px 0 rgba(0, 0, 0, .35);
  position: relative;
}

.board-frame::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 16px;
  border: 1px solid rgba(255, 220, 170, .14);
  pointer-events: none;
}

.board {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 10;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(120% 88% at 28% -10%, #f7ddb2 0%, #efd0a0 32%, #e3bb84 62%, #d3a067 100%);
  box-shadow:
    inset 0 0 60px rgba(120, 72, 25, .22),
    inset 0 0 2px rgba(255, 255, 255, .6);
  cursor: pointer;
  touch-action: manipulation;
}

.board::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .45;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(92deg, rgba(150, 100, 45, .08) 0 1px, rgba(255, 255, 255, 0) 1px 7px),
    repeating-linear-gradient(2deg, rgba(160, 110, 50, .07) 0 1px, rgba(255, 255, 255, 0) 1px 9px);
}

.board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 2px 10px rgba(90, 55, 20, .28), inset 0 0 0 1px rgba(255, 245, 225, .35);
}

.grid, .marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pieces {
  position: absolute;
  inset: 0;
  --pf: 34px;
}

/* ---------- 棋子 ---------- */

.piece {
  position: absolute;
  width: 9.0%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-kai);
  font-size: var(--pf);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: #b02a22;
  background:
    radial-gradient(circle at 34% 24%, #fffef9 0%, #faf0da 34%, #eeddc0 62%, #ddc6a1 100%);
  box-shadow:
    0 5px 10px rgba(90, 55, 20, .3),
    0 1px 2px rgba(90, 55, 20, .25),
    inset 0 2px 3px rgba(255, 255, 255, .9),
    inset 0 -3px 6px rgba(150, 110, 65, .22);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75);
  z-index: 3;
}

.piece::before {
  content: "";
  position: absolute;
  inset: 7.5%;
  border-radius: 50%;
  border: 1px solid rgba(160, 115, 60, .45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.piece.black { color: #2b2620; }
.piece.red { color: #b02a22; }

.piece:hover { transform: translate(-50%, -50%) translateY(-1px) scale(1.03); }

.piece.selected {
  transform: translate(-50%, -50%) translateY(-2px) scale(1.05);
  box-shadow:
    0 10px 18px rgba(90, 55, 20, .34),
    0 0 0 3px rgba(216, 168, 92, .95),
    0 0 0 7px rgba(216, 168, 92, .28),
    inset 0 2px 3px rgba(255, 255, 255, .95);
  z-index: 6;
}

.piece.last-move::after {
  content: "";
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  border: 1.5px dashed rgba(140, 90, 35, .45);
}

.piece.in-check {
  animation: checkGlow .9s ease-in-out infinite;
}

@keyframes checkGlow {
  0%, 100% { box-shadow: 0 5px 10px rgba(90, 55, 20, .3), 0 0 0 0 rgba(200, 60, 45, .55); }
  50% { box-shadow: 0 5px 10px rgba(90, 55, 20, .3), 0 0 0 9px rgba(200, 60, 45, .0); }
}

.piece.captured-hint { filter: saturate(.85); }

/* ---------- 棋盘底部按钮 ---------- */

.board-foot {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid rgba(160, 125, 80, .35);
  background: linear-gradient(180deg, #fffdf7, #f7ebd6);
  color: #4a3d2d;
  font-size: 13.5px;
  letter-spacing: .04em;
  box-shadow: 0 2px 5px rgba(80, 55, 25, .1), inset 0 1px 0 #fff;
  transition: .16s;
}

.btn:hover { background: linear-gradient(180deg, #fffdf7, #f2e2c6); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }

.btn.primary {
  color: #fff8ec;
  border-color: rgba(255, 230, 200, .5);
  background: linear-gradient(180deg, #b4492f, #94301f);
  box-shadow: 0 8px 18px rgba(150, 60, 40, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.btn.primary:hover { background: linear-gradient(180deg, #c15236, #9d3422); }

.btn.ghost {
  background: transparent;
  box-shadow: none;
  border-color: rgba(160, 125, 80, .3);
}

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- 侧栏 ---------- */

.side-panel { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 10px 0;
  background: linear-gradient(180deg, #fbf4e8, rgba(251, 244, 232, 0));
  border-bottom: 1px solid rgba(170, 135, 90, .16);
}

.tab {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: #7b6c58;
  font-size: 13.5px;
  letter-spacing: .1em;
  position: relative;
  transition: .18s;
}

.tab.active {
  color: #2f261b;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .35));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .8);
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 26%; right: 26%; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(179, 133, 74, 0), var(--gold), rgba(179, 133, 74, 0));
}

.tab-panel { display: none; padding: 16px 16px 20px; }
.tab-panel.active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; animation: fade .22s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 状态卡 */
.status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fdf7ec, #f7eedd);
  border: 1px solid rgba(170, 135, 90, .22);
  margin-bottom: 14px;
}

.status-main { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.status-sub { font-size: 12px; color: var(--ink-faint); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: #8a6120;
  background: #fbeecd;
  border: 1px solid rgba(190, 150, 80, .3);
}

.badge.red { color: #982a24; background: #fbe4df; border-color: rgba(190, 90, 80, .28); }

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.field-row label { font-size: 12.5px; color: var(--ink-soft); letter-spacing: .06em; }

select, input[type="text"], input[type="password"] {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(160, 125, 80, .35);
  background: #fffdf7;
  font-size: 13px;
  color: #3b3227;
  box-shadow: inset 0 1px 2px rgba(90, 60, 25, .06);
  min-width: 0;
}

select:focus, input:focus { outline: 2px solid rgba(179, 133, 74, .35); outline-offset: 1px; }

/* 着法列表 */
.move-list {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 460px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(170, 135, 90, .18);
  background: #fffdf8;
  padding: 6px;
  scrollbar-width: thin;
}

.move-list::-webkit-scrollbar { width: 6px; }
.move-list::-webkit-scrollbar-thumb { background: rgba(170, 135, 90, .35); border-radius: 3px; }

.move-row {
  display: grid;
  grid-template-columns: 34px 1fr 1fr;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-radius: 8px;
}

.move-row .no {
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.move-cell {
  border: none;
  background: transparent;
  text-align: left;
  padding: 6px 9px;
  border-radius: 8px;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: .04em;
  color: #43382b;
  transition: .15s;
}

.move-cell.red { color: #a3302a; }
.move-cell:hover { background: #f7eedd; }
.move-cell.current { background: #efe2c9; font-weight: 700; }
.move-cell.current::before { content: "▸ "; color: var(--gold); }

.empty-hint {
  padding: 26px 16px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-faint);
}

.quick-actions { display: flex; gap: 8px; margin-top: 12px; }
.quick-actions .btn { flex: 1; padding: 0 10px; }

/* ---------- 摆谱 ---------- */

.hint-text {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9efdd, #f5e9d2);
  border: 1px solid rgba(170, 135, 90, .2);
}

.pal-item {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-kai);
  font-size: 15px;
  font-weight: 700;
  border: 1px solid rgba(160, 115, 60, .35);
  background: radial-gradient(circle at 34% 24%, #fffef9, #f2e2c2 68%, #e2cba3);
  color: #b02a22;
  box-shadow: 0 2px 4px rgba(90, 55, 20, .14), inset 0 1px 2px #fff;
  transition: .15s;
}

.pal-item.black { color: #2b2620; }
.pal-item:hover { transform: translateY(-1px); }
.pal-item.active {
  box-shadow: 0 0 0 2px #b3854a, 0 4px 10px rgba(150, 100, 40, .3), inset 0 1px 2px #fff;
  transform: translateY(-2px);
}

.pal-item.erase {
  color: #8b7d68;
  font-size: 16px;
  font-family: var(--font-sans);
  font-weight: 500;
  background: linear-gradient(180deg, #fffdf8, #efe5d2);
}

.palette-foot { display: flex; gap: 8px; margin: 10px 0 14px; }
.palette-foot .btn { flex: 1; }

.fen-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fen-row span {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-faint);
  min-width: 30px;
}

.fen-row input { flex: 1; font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.verify-box { margin-top: 12px; }

.verify-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.7;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: #fbf3e4;
  color: #6a5a44;
}

.verify-line.warn { background: #fbeae1; color: #8e3a2e; }
.verify-line.good { background: #eaf3ec; color: #2f6b4d; }

/* ---------- 分析 ---------- */

.eval-wrap {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fdf8ee, #f7eedc);
  border: 1px solid rgba(170, 135, 90, .2);
  margin-bottom: 12px;
}

.eval-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.eval-score {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
}

.eval-score.pos { color: #a3302a; }
.eval-score.neg { color: #2f4d6b; }

.eval-meta { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .04em; }

.eval-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f4d6b, #6f86a0);
  overflow: hidden;
}

.eval-bar .red-side {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 50%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c25a4c, #a3302a);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.eval-bar .mid {
  position: absolute;
  left: 50%; top: -3px; bottom: -3px;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, .75);
  z-index: 2;
}

.analysis-line {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(170, 135, 90, .2);
  background: #fffdf8;
  margin-bottom: 12px;
}

.analysis-line .label {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.best-move {
  font-family: var(--font-serif);
  font-size: 19px;
  color: #a3302a;
  letter-spacing: .06em;
}

.pv-text {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 2;
  color: #5d5142;
  letter-spacing: .04em;
}

.analysis-actions { display: flex; gap: 8px; }
.analysis-actions .btn { flex: 1; }

/* ---------- 棋谱库 ---------- */

.save-form { display: grid; gap: 10px; margin-bottom: 14px; }
.save-form .row { display: flex; gap: 8px; }
.save-form input { flex: 1; }

.record-list { display: grid; gap: 8px; max-height: 330px; overflow: auto; }

.record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fffdf8;
  border: 1px solid rgba(170, 135, 90, .2);
}

.record .t { font-size: 13.5px; color: #3b3227; }
.record .m { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }
.record .acts { display: flex; gap: 6px; flex-shrink: 0; }

.mini-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(160, 125, 80, .3);
  background: #fbf4e6;
  font-size: 11.5px;
  color: #5a4c38;
}

.mini-btn:hover { background: #f4e6cd; }
.mini-btn.danger { color: #a3302a; }

.login-cta {
  padding: 22px 18px;
  text-align: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #fdf7ec, #f6ecd8);
  border: 1px dashed rgba(170, 135, 90, .35);
}

.login-cta p { font-size: 12.5px; line-height: 1.8; color: var(--ink-soft); margin: 0 0 12px; }

/* ---------- 页脚 ---------- */

.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 40px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--ink-faint);
}

/* ---------- 弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(40, 28, 16, .45);
  backdrop-filter: blur(4px);
}

.modal.open { display: flex; animation: fade .2s ease; }

.modal-card {
  width: min(680px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 26px 26px 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffdf8, #fbf3e5);
  box-shadow: 0 30px 70px rgba(30, 18, 8, .35);
  border: 1px solid rgba(255, 255, 255, .6);
}

.modal-card h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: .1em;
  margin: 0 0 4px;
}

.modal-card .sub { font-size: 12px; color: var(--ink-faint); letter-spacing: .1em; margin-bottom: 18px; }

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.guide-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fdf7ea;
  border: 1px solid rgba(170, 135, 90, .18);
}

.guide-item .g {
  font-family: var(--font-kai);
  font-size: 21px;
  font-weight: 700;
  width: 42px; height: 42px;
  flex: 0 0 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #fffef9, #f2e2c2 68%, #e2cba3);
  border: 1px solid rgba(160, 115, 60, .35);
  color: #b02a22;
}

.guide-item .g.black { color: #2b2620; }

.guide-item .txt strong { font-size: 13px; }
.guide-item .txt p { margin: 3px 0 0; font-size: 12px; line-height: 1.7; color: var(--ink-soft); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(42, 32, 20, .9);
  color: #fff6e8;
  font-size: 13px;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: .28s ease;
  z-index: 80;
  box-shadow: 0 12px 30px rgba(30, 20, 8, .3);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 响应式 ---------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .board-card { padding: 14px; }
  .board-frame { max-width: 560px; }
  .side-panel { max-width: 640px; margin: 0 auto; width: 100%; }
  .move-list { height: 220px; }
}

@media (max-width: 620px) {
  .topbar { padding: 16px 14px 12px; }
  .brand-text h1 { font-size: 20px; letter-spacing: .08em; }
  .brand-text p { display: none; }
  .seal { width: 40px; height: 40px; font-size: 22px; }
  .layout { padding: 0 12px 40px; }
  .board-card { padding: 10px; border-radius: 18px; }
  .board-bar { margin-bottom: 8px; }
  .board-foot { margin-top: 12px; gap: 8px; }
  .board-foot .btn { flex: 1; padding: 0 8px; height: 36px; font-size: 12.5px; }
  .tab-panel { padding: 14px 12px 18px; }
  .tabs { padding: 8px 8px 0; }
  .tab { font-size: 12.5px; height: 38px; }
  .move-list { height: auto; max-height: 280px; min-height: 0; }
  .palette { grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 9px; }
  .pal-item { font-size: 13px; }
  .guide-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 20px 18px; }
  .foot { padding-bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- 安装向导 ---------- */

.install-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 22px 70px;
}

.install-card { padding: 30px 28px; }

.install-card h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: .08em;
  margin: 0 0 6px;
}

.steps {
  display: flex;
  gap: 8px;
  margin: 18px 0 24px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(180, 145, 100, .3);
}

.step-dot.on { background: linear-gradient(90deg, #c99a5b, #a3302a); }

.check-list { display: grid; gap: 8px; margin-bottom: 20px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fbf4e6;
  border: 1px solid rgba(170, 135, 90, .18);
}

.check-row .mark { width: 18px; text-align: center; }
.check-row.ok .mark { color: #3f7a5b; }
.check-row.bad .mark { color: #a3302a; }
.check-row .val { margin-left: auto; font-size: 11.5px; color: var(--ink-faint); }

.form-grid { display: grid; gap: 12px; }

.form-grid .fld { display: grid; gap: 5px; }

.form-grid .fld label { font-size: 12px; color: var(--ink-soft); letter-spacing: .06em; }

.radio-row { display: flex; gap: 8px; }

.radio-row label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(160, 125, 80, .3);
  background: #fffdf7;
  font-size: 12.5px;
  cursor: pointer;
}

.radio-row label:has(input:checked) {
  border-color: rgba(179, 133, 74, .8);
  background: #fdf4e3;
  box-shadow: 0 0 0 2px rgba(179, 133, 74, .18);
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fbeae1;
  color: #8e3a2e;
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.alert.good { background: #eaf3ec; color: #2f6b4d; }

/* 登录页 */
.login-wrap { max-width: 420px; margin: 0 auto; padding: 60px 20px; }
.login-card { padding: 30px 26px; }
.login-card h2 { font-family: var(--font-serif); font-size: 20px; letter-spacing: .08em; margin: 0 0 18px; }
