/* 手谈启蒙 · 古朴典雅主题 */
:root {
  --paper: #f2ead6;
  --paper-deep: #e7dcc0;
  --card: #f7f2e2;
  --ink: #2a251d;
  --ink-soft: #5a4f3d;
  --line: #c3b28a;
  --line-dark: #8a7550;
  --red: #8c2f2f;
  --red-deep: #6f211f;
  --gold: #a37b3d;
  --wood: #c99a4f;
  --shadow: 0 3px 14px rgba(58, 42, 16, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: KaiTi, 楷体, STKaiti, "Kaiti SC", "Songti SC", SimSun, "Noto Serif SC", serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 18% 8%, rgba(255, 252, 240, .55), transparent 45%),
    radial-gradient(ellipse at 85% 92%, rgba(163, 123, 61, .12), transparent 50%),
    repeating-linear-gradient(3deg, transparent 0 6px, rgba(120, 96, 56, .022) 6px 7px),
    var(--paper);
  min-height: 100vh;
  line-height: 1.7;
}

/* ── 页眉 ── */
.site-header {
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 0 -2px var(--line), 0 5px 0 -2px rgba(163, 123, 61, .35);
  background: linear-gradient(180deg, rgba(247, 242, 226, .9), rgba(242, 234, 214, .75));
  padding: 14px 22px 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  max-width: 1440px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.seal {
  width: 42px; height: 42px; flex-shrink: 0;
  background: var(--red); color: #f5eedb;
  display: grid; grid-template-columns: 1fr 1fr; place-items: center;
  font-size: 19px; line-height: 1; padding: 3px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(245, 238, 219, .85), 0 2px 6px rgba(111, 33, 31, .4);
  transform: rotate(-3deg);
}
.seal span { transform: translateY(-1px); }
.brand-name { font-size: 25px; letter-spacing: 6px; font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: 3px; margin-top: -4px; }

.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 16px; letter-spacing: 2px;
  padding: 6px 14px; border: 1px solid transparent; border-radius: 3px;
  transition: color .2s, border-color .2s, background .2s;
}
.site-nav a:hover { color: var(--red); border-color: var(--line); background: rgba(163,123,61,.07); }
.site-nav a.active { color: var(--red); border-color: var(--line-dark); background: rgba(140,47,47,.06); }

/* ── 布局 ── */
.wrap { max-width: 1440px; margin: 0 auto; padding: 22px; }
.page-title {
  font-size: 26px; letter-spacing: 5px; text-align: center; margin: 6px 0 2px;
}
.page-title::after {
  content: ""; display: block; width: 220px; height: 5px; margin: 10px auto 0;
  background:
    linear-gradient(90deg, transparent, var(--gold) 20% 80%, transparent) top/100% 1px no-repeat,
    linear-gradient(90deg, transparent, var(--gold) 30% 70%, transparent) bottom/100% 1px no-repeat;
}
.page-sub { text-align: center; color: var(--ink-soft); font-size: 14px; letter-spacing: 2px; margin-bottom: 18px; }

.layout-row { display: flex; gap: 20px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }

/* ── 卡片 ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  outline: 1px solid rgba(163, 123, 61, .3);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.card h3 {
  font-size: 18px; letter-spacing: 3px; color: var(--red);
  border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px; font-weight: 700;
}
.card h3 .dot { width: 8px; height: 8px; background: var(--red); border-radius: 50%; flex-shrink: 0; }

/* ── 按钮 ── */
.btn {
  font-family: inherit; font-size: 16px; letter-spacing: 2px; cursor: pointer;
  color: var(--paper); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 3px;
  padding: 8px 18px; transition: all .18s;
}
.btn:hover { background: var(--red-deep); border-color: var(--red-deep); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-dark); }
.btn.ghost:hover { color: var(--red); border-color: var(--red); background: rgba(140,47,47,.05); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: var(--red); border-color: var(--red); }
.btn.big { font-size: 18px; padding: 11px 26px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-grid .full { grid-column: 1 / -1; }

/* ── 表单 ── */
select, input[type=text] {
  font-family: inherit; font-size: 15px; color: var(--ink);
  background: rgba(255, 252, 240, .7); border: 1px solid var(--line-dark); border-radius: 3px;
  padding: 5px 8px; cursor: pointer;
}
label.field { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-soft); letter-spacing: 1px; }

/* ── 棋盘容器 ── */
.board-frame {
  background: linear-gradient(160deg, #6b4a22, #4a3115);
  border-radius: 6px; padding: 10px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 240, 200, .25);
  position: relative; display: inline-block;
}
canvas { display: block; cursor: crosshair; border-radius: 3px; }

/* ── 状态条 / 提示 ── */
.status-bar {
  text-align: center; font-size: 18px; letter-spacing: 3px;
  border: 1px solid var(--line); background: rgba(255, 252, 240, .65);
  border-radius: 3px; padding: 6px 18px; color: var(--ink);
}
.tips { color: var(--ink-soft); font-size: 14px; }
.danger { color: var(--red); font-weight: 700; }
.good { color: #3f6b35; font-weight: 700; }

/* ── 消息气泡（老师说）── */
.speech {
  min-height: 96px; font-size: 16px; color: var(--ink);
  background: rgba(255, 252, 240, .8);
  border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: 3px; padding: 12px 14px; line-height: 1.9;
}

/* ── 列表：棋谱 / 题目 ── */
.list-scroll { max-height: 220px; overflow-y: auto; font-size: 14px; }
.list-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-bottom: 1px dashed var(--line); }
.stone-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.stone-dot.b { background: #211c15; }
.stone-dot.w { background: #fdfaf0; border: 1px solid #9a8a60; }

/* ── 首页模块卡 ── */
.home-hero { text-align: center; padding: 42px 20px 30px; }
.home-hero .big-title { font-size: 46px; letter-spacing: 14px; text-indent: 14px; }
.home-hero .motto { color: var(--ink-soft); font-size: 16px; letter-spacing: 4px; margin-top: 10px; }
.module-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px; margin: 26px auto; max-width: 1100px;
}
.module-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  outline: 1px solid rgba(163,123,61,.3); outline-offset: 3px;
  box-shadow: var(--shadow); padding: 22px 18px; text-align: center;
  transition: transform .18s, border-color .18s;
}
.module-card:hover { transform: translateY(-3px); border-color: var(--line-dark); }
.module-card .glyph {
  width: 54px; height: 54px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--paper); background: var(--red);
  border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(245,238,219,.35), 0 3px 8px rgba(111,33,31,.35);
}
.module-card h3 { font-size: 20px; letter-spacing: 4px; margin-bottom: 8px; border: none; justify-content: center; padding: 0; color: var(--ink); }
.module-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.8; }

.quote-band {
  max-width: 860px; margin: 8px auto 30px; text-align: center;
  color: var(--ink-soft); font-size: 15px; letter-spacing: 2px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 14px 20px;
}

/* ── 页脚 ── */
.site-footer {
  margin-top: 34px; border-top: 1px solid var(--line);
  padding: 16px 22px 26px; text-align: center;
  color: var(--ink-soft); font-size: 13px; letter-spacing: 2px;
}

/* ── 徽记/级位 ── */
.rank-badge {
  display: inline-block; padding: 4px 16px; border-radius: 3px;
  color: #f5eedb; background: var(--red); font-size: 16px; letter-spacing: 2px;
}
.progress-outer { background: rgba(120,96,56,.18); border-radius: 3px; height: 12px; overflow: hidden; }
.progress-inner { height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .5s; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #c3a86e; border-radius: 4px; }

.kbd { font-size: 12px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; }

@media (max-width: 860px) {
  .brand-name { font-size: 20px; letter-spacing: 3px; }
  .home-hero .big-title { font-size: 34px; }
  .layout-row { flex-direction: column; align-items: center; }
}
