:root {
  --wood-1: #f2dcb4;
  --wood-2: #e6c691;
  --wood-line: #8a5a24;
  --ink: #2c2117;
  --ink-soft: #6b5a45;
  --red: #b3271d;
  --red-soft: #d9534f;
  --black: #1f2a37;
  --blue: #1d6fb8;
  --paper: #fbf6ec;
  --card: #fffaf1;
  --edge: #e3d4bb;
  --shadow: 0 10px 30px rgba(80, 55, 20, .12);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, #fff6e4 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #f5e6cd 0%, transparent 55%),
    var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 头部 ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 26px 10px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "KaiTi", "STKaiti", serif; font-size: 26px; font-weight: 700; color: var(--red);
  background: radial-gradient(circle at 32% 28%, #fff8e8, #f0dcb6 65%, #dcc094);
  border: 2px solid #b98a4e; box-shadow: var(--shadow);
}
.site-head h1 { margin: 0; font-size: 24px; letter-spacing: 2px; }
.sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.engine-tag {
  font-size: 12px; color: var(--ink-soft); background: #fff; border: 1px solid var(--edge);
  padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow); white-space: nowrap;
}

/* ---------- 布局 ---------- */
.layout {
  flex: 1; display: grid; grid-template-columns: minmax(320px, 1fr) 340px;
  gap: 20px; padding: 6px 26px 22px; align-items: start;
}
@media (max-width: 1020px) { .layout { grid-template-columns: 1fr; } }

.board-card {
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.board-stage { position: relative; width: 100%; }
#board { display: block; width: 100%; height: auto; touch-action: manipulation; cursor: pointer; border-radius: 10px; }
.hint { margin: 12px 2px 0; font-size: 12.5px; color: var(--ink-soft); }

/* 思考指示 */
.thinking {
  position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 5px;
  background: rgba(28, 26, 24, .82); color: #ffeccd; font-size: 12px;
  padding: 6px 12px; border-radius: 999px;
}
.thinking .dot { width: 6px; height: 6px; border-radius: 50%; background: #ffeccd; animation: blink 1.2s infinite; }
.thinking .dot:nth-child(2) { animation-delay: .2s; }
.thinking .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }

/* 结算浮层 */
.modal {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(30, 20, 8, .42); backdrop-filter: blur(2px); border-radius: 10px;
}
.modal-box {
  background: var(--card); border: 1px solid var(--edge); border-radius: 16px;
  padding: 24px 30px; text-align: center; box-shadow: 0 22px 50px rgba(60, 30, 5, .35);
  max-width: 82%;
}
.modal-kicker { margin: 0; font-size: 12px; letter-spacing: 3px; color: var(--ink-soft); text-transform: uppercase; }
.modal-box h2 { margin: 6px 0 4px; font-size: 28px; letter-spacing: 2px; }
.modal-desc { margin: 0 0 16px; font-size: 13px; color: var(--ink-soft); }

/* ---------- 侧栏 ---------- */
.side { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.card.grow { min-height: 210px; display: flex; flex-direction: column; }
.card-title { margin: 0 0 10px; font-size: 13px; letter-spacing: 1.5px; color: var(--ink-soft); font-weight: 600; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-head .card-title { margin-bottom: 10px; }

.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; font: inherit; font-size: 12.5px; padding: 7px 4px; cursor: pointer;
  border: 1px solid var(--edge); background: #fff; color: var(--ink-soft); border-radius: 9px;
  transition: .16s;
}
.seg button:hover { border-color: #c9a76a; color: var(--ink); }
.seg button.on { background: #2f2a24; border-color: #2f2a24; color: #ffeccd; }

.actions { display: flex; gap: 8px; margin-top: 4px; }
.btn {
  font: inherit; font-size: 13px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--edge); background: #fff; color: var(--ink); transition: .16s;
}
.btn:hover { border-color: #c9a76a; transform: translateY(-1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff8ef; }
.btn.primary:hover { background: #9d2118; }
.btn.tiny { font-size: 11.5px; padding: 5px 9px; color: var(--ink-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.turn-line { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.stone { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 1.5px solid; }
.stone.red { background: #ffe9d6; border-color: var(--red); }
.stone.black { background: #e8eef5; border-color: var(--black); }
.meta { margin: 6px 0 12px; font-size: 11.5px; color: var(--ink-soft); min-height: 15px; }

.captured { display: flex; flex-direction: column; gap: 7px; }
.cap-label { font-size: 11.5px; color: var(--ink-soft); margin-right: 8px; }
.cap-zone { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; min-height: 20px; }
.chip {
  font-family: "KaiTi", "STKaiti", serif; font-size: 13px; width: 20px; height: 20px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid;
}
.chip.r { color: var(--red); border-color: #e0b3a8; background: #fff2ec; }
.chip.b { color: var(--black); border-color: #b9c3ce; background: #f1f4f8; }

.moves { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 46vh; font-size: 13px; flex: 1; }
.moves li { display: grid; grid-template-columns: 30px 1fr 1fr; gap: 6px; padding: 4px 6px; border-radius: 7px; }
.moves li:nth-child(odd) { background: rgba(210, 180, 130, .13); }
.moves li .no { color: #b0a08a; font-size: 11.5px; text-align: right; }
.moves li .r { color: var(--red); }
.moves li .b { color: var(--black); }
.moves li.now { outline: 1.5px solid var(--blue); }
.empty-tip { font-size: 12px; color: #a3927c; margin: 8px 0 0; }

.rules { margin: 0; padding-left: 18px; font-size: 12px; color: var(--ink-soft); line-height: 1.75; }

.site-foot { padding: 0 26px 22px; font-size: 11.5px; color: #a3927c; }
.hidden { display: none !important; }
