/* 2026 数媒竞赛展示版：以 29 点棋盘、庙区轮廓和走棋路线为视觉骨架。 */
:root {
  --ink: #173f35;
  --ink-deep: #10362e;
  --jade: #267a61;
  --vermilion: #c94732;
  --gold: #d6ab62;
  --ground: #f1ede4;
  --paper: #fffaf0;
  --wood: #e9d2a2;
  --line: #d9cbb3;
  --muted: #5d7167;
  --radius: 12px;
  font-family: 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  color: var(--ink-deep);
  background: var(--ground);
}
body { background: var(--ground); color: var(--ink-deep); }
.wrap { width: min(1300px, calc(100% - 64px)); }
.section-pad { padding: 74px 0; }
.eyebrow { color: var(--vermilion); margin-bottom: 13px; letter-spacing: .16em; }
.small-label { color: #a5613d; letter-spacing: .12em; }
.button, .header-cta { border-radius: 8px; }
.button, .mode-button, .level-button, .game-actions button,
.history-actions button, .challenge-tab, .lesson-card { min-height: 44px; }
a:focus-visible, button:focus-visible, input:focus-visible, .board-hit:focus-visible {
  outline: 3px solid #dfad4e;
  outline-offset: 3px;
}

/* 顶部导航与首页：首屏出现文化路径，功能入口紧随其后。 */
.site-header { height: 72px; background: var(--ink-deep); color: #f8f0df; border: 0;
  box-shadow: none; padding: 0 max(32px, calc((100% - 1300px) / 2)); }
.brand-mark { width: 38px; height: 38px; border: 1px solid #e3ab76;
  border-radius: 50%; background: var(--vermilion); color: #fff; font-size: 24px; }
.brand strong { font-size: 19px; }
.brand small { color: #d4c6a9; }
.site-header nav { color: #d7e4dc; gap: 29px; }
.site-header nav a { padding: 26px 0; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: #f5d091; }
.site-header nav a[aria-current="page"]::after { bottom: 17px; background: #e6bc78; }
.header-cta { background: var(--vermilion); padding: 11px 19px; }

.hero { min-height: 0; background: var(--ground); color: var(--ink-deep); }
.hero-ink, .hero::after, .hero-card::before { display: none; }
.hero-inner { grid-template-columns: minmax(0, 1fr) minmax(360px, 470px); gap: clamp(30px, 5vw, 72px);
  min-height: 505px; padding: 28px 0; align-items: center; }
.hero .eyebrow.light { color: #b64b37; margin-bottom: 21px; }
.hero h1 { font-size: clamp(43px, 4.8vw, 65px); line-height: 1.14; letter-spacing: .02em; }
.hero h1 em { color: var(--vermilion); }
.hero-lede { color: #4f665c; max-width: 550px; font-size: 16px; line-height: 1.8; margin: 25px 0 29px; }
.hero-actions { gap: 12px; }
.hero-actions .button { padding: 14px 22px; min-width: 170px; gap: 20px;
  box-shadow: 0 10px 20px #8e3f2d20; }
.button-primary, .header-cta { background: var(--vermilion); color: #fff; }
.hero-actions .button-ghost { background: var(--ink); color: #fff; border-color: var(--ink); }
.hero-card { width: 100%; max-width: none; padding: 16px; transform: rotate(1deg); background: var(--ink-deep);
  border: 0; border-radius: 16px; box-shadow: 0 25px 55px #2944382d; }
.hero-card-head, .hero-card-foot { color: #e8d3a5; font-size: 11px; letter-spacing: .11em; }
.hero-board { height: auto; aspect-ratio: 1; background: #ead2a1; border: 8px solid #cfa971;
  border-radius: 7px; box-shadow: inset 0 0 0 2px #f5e3bc; }
.hero-board svg { display: block; width: 100%; height: 100%; }
.hero-board .node-label, .hero-board .temple-label, .hero-board .stone-text { display: none; }
.hero-bottom { width: 100%; max-width: none; min-height: 62px; margin: 0; padding: 0 max(32px, calc((100% - 1300px) / 2));
  background: var(--ink); color: #f5e6c5; align-items: center; gap: clamp(11px, 3vw, 36px);
  font-size: 12px; letter-spacing: .07em; }
.hero-bottom a { color: #f5e6c5; text-decoration: none; border-bottom: 1px solid #c8aa72; padding-bottom: 2px; }
.hero-bottom span:first-child { font-weight: 700; color: #f8c982; }

.home-modules { padding: 58px 0 90px; background: var(--ground); }
.module-heading { margin-bottom: 24px; }
.module-heading h2 { font-size: clamp(30px, 3vw, 40px); line-height: 1.2; }
.module-heading>p, .module-footnote { color: var(--muted); }
.module-grid { gap: 12px; }
.module-card, .module-featured { grid-column: auto; min-height: 174px; padding: 18px 20px;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-deep);
  border-radius: var(--radius); box-shadow: none; }
.module-card:hover { box-shadow: 0 13px 25px #343d2c20; border-color: #af9a76; transform: translateY(-3px); }
.module-featured { background: var(--ink); color: #fff; border-color: var(--ink); }
.module-red { background: #f6dfc9; color: var(--ink-deep); border-color: #e6bda2; }
.module-blue { background: #e3efec; }
.module-gold { background: #f7ebd5; }
.module-green { background: #e6f0e6; }
.module-purple { background: #eeeaf1; }
.module-cultural { background: #efe2d3; }
.module-number, .module-featured .module-number { color: #bb563f; }
.module-featured .module-number { color: #efd093; }
.module-copy { gap: 7px; }
.module-copy strong, .module-featured .module-copy strong { font-size: 23px; }
.module-copy small { color: #63766c; font-size: 12px; }
.module-featured .module-copy small { color: #d2e2d8; font-size: 12px; }
.module-red .module-copy small { color: #675f50; }
.module-symbol { color: #b85d3d12; font-size: 107px; right: 15px; top: 7px; }
.module-featured .module-symbol { color: #e9f0e514; font-size: 130px; }
.module-arrow { color: var(--vermilion); }
.module-divider { margin: 12px 0 0; color: #8a6643; }

/* 对弈页：棋盘是桌面主视觉；移动端把状态和棋盘放在控制区前。 */
.play { padding: 25px 0 68px; background: var(--ground); }
.play .back-link { margin: 0 0 12px; }
.play .section-heading { align-items: center; margin-bottom: 16px; gap: 26px; }
.play .section-heading h2 { font-size: clamp(27px, 3vw, 36px); line-height: 1.2; }
.play .section-heading>p { width: min(420px, 45%); font-size: 13px; color: #526a5e; line-height: 1.65; }
.play .section-heading .eyebrow { margin-bottom: 7px; }
.game-shell { grid-template-columns: minmax(0, 1fr) minmax(275px, 320px); gap: 12px 18px;
  grid-template-rows: max-content 1fr; padding: 13px; background: #e9dfca;
  border: 1px solid #d8c8ab; border-radius: 16px; }
.game-toolbar { min-height: 48px; height: auto; align-items: center; }
.game-board-panel { min-height: 0; padding: 12px; background: #ead3a5; border: 7px solid #cba46c;
  border-radius: 10px; box-shadow: inset 0 0 0 2px #f5e4bd; }
.game-board-panel svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: 660px; }
.board-caption, .board-bottom { color: #604b34; font-size: 12px; }
.board-line { stroke: #574533; stroke-width: .66; opacity: .9; }
.board-node { fill: #45382b; }
.node-label { fill: #705b3e; font-size: 1.7px; }
.temple-label { fill: #705b3e; font-size: 2.5px; }
.board-target-halo { fill: #b9dec6a8; stroke: #237455; stroke-width: .48; }
.board-target { fill: #e5ffed; stroke: #176e50; stroke-width: .65; filter: none; }
.board-selected { fill: none; stroke: #e3aa43; stroke-width: 1; }
.board-replaced.clamp { stroke: #1d7d62; }
.board-replaced.carry { stroke: #cf4b33; }
.board-hit { fill: transparent; cursor: pointer; }
.turn-card { background: var(--ink); border: 0; color: #fff; padding: 18px; border-radius: var(--radius); }
.turn-card[data-side="B"] { background: #8f332a; }
.turn-card .small-label, .turn-card small { color: #e8c784; }
.turn-card strong, .turn-card .reserves strong { color: #fff; }
.turn-card .reserves { border-color: #e5d4a050; }
.turn-card .reserves span { color: #dbe7dd; }
.turn-card .reserves strong { font-size: 22px; }
.game-message { min-height: 0; padding: 13px 16px; background: var(--paper); color: var(--ink-deep);
  border: 1px solid var(--line); border-left: 4px solid var(--vermilion);
  border-radius: var(--radius); font-size: 13px; }
.capture-feedback { border-radius: var(--radius); padding: 12px 16px; font-weight: 700; }
.capture-feedback[data-type="clamp"] { background: #1e7257; color: #fff; }
.capture-feedback[data-type="carry"] { background: var(--vermilion); color: #fff; }
.level-card, .move-card { background: var(--paper); border-color: var(--line); border-radius: var(--radius); }
.mode-button, .level-button { border-radius: 7px; }
.mode-button.active, .level-button.active { background: var(--ink); border-color: var(--ink); }
.game-actions button { padding: 10px 4px; color: #98513f; }

/* 文化和学习页面延续同一网格、卡片材质与色彩语义。 */
.story, .rules, .learn, .review { background: var(--ground); }
.story, .learn, .rules { padding-top: 62px; }
.story-grid, .culture-explore { gap: 20px; }
.fact-card { border-color: var(--line); }
.fact-index { color: var(--vermilion); }
.culture-board-panel, .culture-timeline, .lesson-card, .rule-diagrams article,
.extra-panel, .extra-aside, .review-side, .review-empty, .history-card,
.profile-identity, .stat-card { background: var(--paper); border-color: var(--line); border-radius: var(--radius); }
.culture-explore { margin-top: 32px; }
.culture-board-panel svg { border: 6px solid #cba46c; }
.culture-timeline { border-top: 4px solid var(--ink); }
.source-note { color: #52695d; border-color: var(--line); }
.source-note a { color: #a53c2d; text-decoration: underline; }
.lesson-progress { background: var(--ink); color: #fff; }
.lesson-card.complete { border-color: #72a589; background: #eaf4ea; }
.lesson-card.active { border-color: var(--vermilion); }
.online-page { background: #e8f0ec; }
.training-page { background: #f6edd9; }
.coach-page { background: #e8f0e7; }
.analysis-page { background: #e7efed; }
.history-page { background: #f0ecf0; }
.profile-page { background: #f4eae0; }
.site-footer { background: var(--ink-deep); }

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(280px, 39%); gap: 24px; }
  .hero h1 { font-size: clamp(38px, 4.6vw, 54px); }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-shell { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 760px) {
  body { padding-bottom: 64px; }
  .wrap { width: calc(100% - 28px); }
  .section-pad { padding: 50px 0; }
  .site-header { height: 58px; padding: 0 14px; }
  .brand-mark { width: 32px; height: 32px; font-size: 20px; }
  .brand strong { font-size: 17px; }
  .brand small, .site-header nav { display: none; }
  .header-cta { padding: 8px 10px; font-size: 11px; }
  .hero-inner { display: flex; flex-direction: column; align-items: stretch; min-height: 0;
    padding: 29px 0 28px; gap: 20px; }
  .hero .eyebrow.light { margin: 0 0 17px; font-size: 10px; }
  .hero h1 { font-size: clamp(33px, 9vw, 39px); line-height: 1.25; }
  .hero-lede { font-size: 13px; line-height: 1.65; margin: 14px 0 19px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .hero-actions .button { min-width: 0; width: 100%; gap: 5px; padding: 12px 10px;
    font-size: 11px; white-space: nowrap; }
  .hero-card { width: min(100%, 240px); align-self: center; transform: none; padding: 9px; border-radius: 13px; }
  .hero-board { height: auto; border-width: 5px; max-height: 205px; }
  .hero-card-head, .hero-card-foot { font-size: 9px; }
  .hero-bottom { min-height: 43px; padding: 0 14px; justify-content: space-between; gap: 5px;
    white-space: nowrap; font-size: 9px; }
  .hero-bottom .vertical-line { display: none; }
  .home-modules { padding: 31px 0 62px; }
  .module-heading { display: block; margin-bottom: 14px; }
  .module-heading h2 { font-size: 27px; }
  .module-heading>p { margin-top: 8px; font-size: 11px; }
  .module-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .module-card, .module-featured { min-height: 132px; padding: 13px; }
  .module-copy strong, .module-featured .module-copy strong { font-size: 18px; }
  .module-copy small, .module-featured .module-copy small { font-size: 10px; line-height: 1.45; }
  .module-number { font-size: 9px; }
  .module-symbol, .module-featured .module-symbol { font-size: 82px; right: 9px; top: 8px; }
  .module-arrow { right: 10px; bottom: 9px; }
  .module-divider { font-size: 11px; margin-top: 8px; }
  .mobile-nav { background: #fffaf0; border-color: var(--line); }
  .mobile-nav a[aria-current="page"] { color: var(--vermilion); }

  .play { padding: 18px 0 46px; }
  .play .back-link { margin: 0 0 10px; font-size: 11px; }
  .play .section-heading { display: block; margin-bottom: 10px; }
  .play .section-heading .eyebrow { font-size: 10px; margin-bottom: 4px; }
  .play .section-heading h2 { font-size: 25px; }
  .play .section-heading>p { width: 100%; font-size: 11px; line-height: 1.45; margin: 5px 0 0; }
  .game-shell { display: flex; flex-direction: column; padding: 8px; gap: 8px; }
  .game-status { display: contents; }
  .turn-card { order: 0; padding: 10px 13px; width: 100%; }
  .turn-card .small-label { font-size: 10px; margin-bottom: 5px; }
  .turn-line { gap: 8px; }
  .piece-icon { width: 34px; height: 34px; }
  .turn-line strong { font-size: 17px; }
  .turn-line small { font-size: 10px; }
  .reserves { margin-top: 8px; padding-top: 7px; }
  .reserves div { font-size: 10px; }
  .turn-card .reserves strong { font-size: 15px; }
  .game-main { order: 1; }
  .game-toolbar { min-height: 38px; padding: 0 2px 4px; flex-wrap: nowrap; gap: 5px; }
  .mode-button { padding: 5px 6px; font-size: 11px; min-height: 44px; }
  .game-actions { gap: 7px; }
  .game-actions button { font-size: 11px; padding: 6px 1px; min-height: 44px; }
  .game-board-panel { padding: 8px; border-width: 5px; }
  .game-board-panel svg { width: 100%; height: auto; aspect-ratio: 1 / 1; max-height: none; }
  .board-caption, .board-bottom { font-size: 9px; letter-spacing: 0; }
  .game-status .game-message { order: 2; width: 100%; font-size: 12px; line-height: 1.5; padding: 10px 12px; }
  .game-status .capture-feedback { order: 3; width: 100%; font-size: 12px; }
  .game-side { order: 4; width: 100%; display: flex; }
  .level-card, .move-card { padding: 14px; }
  .level-card .small-label, .move-card .small-label { margin-bottom: 8px; }
}
@media (max-width: 360px) {
  .hero-actions .button { font-size: 10px; }
  .module-copy strong, .module-featured .module-copy strong { font-size: 16px; }
  .game-actions button { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 棋局问答与原有分级提示共处，联网能力始终由本地服务决定。 */
.coach-dialog { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.coach-dialog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.coach-dialog-head h3 { margin: 0; font: 600 23px/1.3 'Noto Serif SC','Songti SC',serif; color: var(--ink); }
.coach-dialog-head small { color: #597468; font-size: 11px; text-align: right; }
.coach-dialog-thread { display: flex; flex-direction: column; gap: 9px; background: #f0eadc;
  border: 1px solid #ded0b7; border-radius: 12px; min-height: 135px; max-height: 340px;
  overflow-y: auto; padding: 14px; margin: 16px 0 12px; }
.coach-dialog-thread p { margin: 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.assistant-bubble, .visitor-bubble { padding: 12px 14px; max-width: 96%; }
.assistant-bubble { align-self: flex-start; background: var(--paper); color: var(--ink-deep);
  border-radius: 10px 10px 10px 2px; }
.visitor-bubble { align-self: flex-end; background: var(--ink); color: #fffaf0;
  border-radius: 10px 10px 2px 10px; }
.coach-dialog-sources { display: flex; flex-wrap: wrap; gap: 9px; font-size: 11px; }
.coach-dialog-sources a { color: #9f4234; text-decoration: underline; text-underline-offset: 3px; }
.coach-dialog-context { font-size: 11px; color: #61766a; line-height: 1.5; }
.coach-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.coach-suggestions button { min-height: 36px; border: 1px solid #b5c2ad; background: #ecf3e9;
  color: #275846; border-radius: 18px; padding: 7px 9px; font-size: 11px; }
.coach-suggestions button:hover { border-color: var(--jade); background: #e0eee1; }
.coach-dialog-form { display: flex; gap: 7px; margin-top: 13px; }
.coach-dialog-form input { min-width: 0; flex: 1; border: 1px solid #c8bda9; background: var(--paper);
  border-radius: 8px; padding: 12px; font-size: 12px; }
.coach-dialog-form button { min-height: 44px; border: 0; background: var(--vermilion); color: #fff;
  border-radius: 8px; padding: 0 14px; font-size: 12px; white-space: nowrap; }
.coach-dialog-form button:disabled { opacity: .6; cursor: wait; }
.coach-online-option { display: flex; align-items: center; gap: 6px; color: #395b4d;
  font-size: 12px; margin-top: 12px; }
.coach-online-option[hidden] { display: none; }
.coach-online-option input { accent-color: var(--jade); width: 16px; height: 16px; }
.coach-dialog-note { color: #687b70; font-size: 11px; line-height: 1.5; margin: 10px 0 0; }
@media (max-width: 760px) {
  .coach-dialog { margin-top: 25px; }
  .coach-dialog-thread { min-height: 120px; }
  .coach-dialog-head h3 { font-size: 21px; }
}
/* Culture, learning and review presentation. */
.story, .learn, .rules, .review, .extra-page { padding-top: 33px; }
.story .back-link, .learn .back-link, .rules .back-link,
.review .back-link, .extra-page .back-link { margin: 0 0 22px; }
.story-grid { grid-template-columns: minmax(0,.82fr) minmax(0,1.18fr); gap: 18px; }
.story-heading { background: #173f35; color: #fff9e9; border-radius: 14px;
  padding: 30px; align-self: stretch; }
.story-heading .back-link { color: #d7e6da; border-color: #9db3a2; }
.story-heading .eyebrow { color: #ecc582; }
.story-heading h2 { font-size: clamp(30px,3.2vw,43px); line-height: 1.25; margin: 0 0 22px; }
.story-heading .section-intro { color: #d8e5d9; font-size: 14px; line-height: 1.75; }
.story-heading .text-link { color: #f2c27d; }
.story-body { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.fact-card { min-height: 182px; display: block; border: 1px solid #d9cbb3;
  background: #fffaf0; border-radius: 12px; padding: 19px; }
.fact-index { display: block; font-size: 22px; margin-bottom: 10px; }
.fact-card h3 { font-size: 18px; margin-bottom: 7px; }
.fact-card p { font-size: 12px; line-height: 1.7; }
.culture-explore { margin-top: 18px; }
.culture-board-panel, .culture-timeline { border-radius: 12px; }
.culture-board-panel svg { width: min(100%,350px); }
.learn .section-heading, .rules .section-heading,
.review .section-heading, .extra-page .section-heading { margin-bottom: 22px; }
.learn .section-heading h2, .rules .section-heading h2,
.review .section-heading h2, .extra-page .section-heading h2 {
  font-size: clamp(31px,3.4vw,43px); line-height: 1.28; }
.learn .section-heading>p, .rules .section-heading>p,
.review .section-heading>p, .extra-page .section-heading>p { line-height: 1.65; }
.lesson-progress { width: 100%; border-radius: 10px; margin: 0 0 18px;
  padding: 16px 18px 24px; position: relative; overflow: hidden; }
.lesson-progress::before, .lesson-progress::after { content: ''; position: absolute;
  left: 18px; right: 18px; bottom: 10px; height: 5px; border-radius: 5px; background: #75998a; }
.lesson-progress::after { right: auto; width: calc((100% - 36px) * var(--lesson-progress,0)); background: #e9bd72; }
.lesson-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.lesson-card { min-height: 172px; border-radius: 12px; padding: 18px; }
.lesson-card span { font-size: 25px; }
.lesson-card h3 { font-size: 19px; }
.coach-banner { border-radius: 12px; overflow: hidden; }
.coach-page .extra-aside { border-top: 4px solid #408267; }
.analysis-page .extra-aside { border-top: 4px solid #278392; }
.review-side { border-top: 4px solid #c94732; }
.review-layout, .extra-grid { gap: 16px; }
@media(max-width:760px) {
  .story, .learn, .rules, .review, .extra-page { padding-top: 22px; }
  .story .back-link, .learn .back-link, .rules .back-link,
  .review .back-link, .extra-page .back-link { margin: 0 0 15px; }
  .story-grid { display: block; }
  .story-heading { padding: 19px; margin-bottom: 10px; }
  .story-heading h2 { font-size: 28px; margin-bottom: 10px; }
  .story-heading .section-intro { font-size: 12px; line-height: 1.6; margin-bottom: 10px; }
  .story-heading .text-link { font-size: 11px; }
  .story-body { gap: 8px; }
  .fact-card { min-height: 164px; padding: 12px; }
  .fact-index { font-size: 18px; margin-bottom: 5px; }
  .fact-card h3 { font-size: 14px; }
  .fact-card p { font-size: 12px; line-height: 1.55; }
  .culture-explore { margin-top: 10px; }
  .learn .section-heading, .rules .section-heading,
  .review .section-heading, .extra-page .section-heading { margin-bottom: 14px; }
  .learn .section-heading h2, .rules .section-heading h2,
  .review .section-heading h2, .extra-page .section-heading h2 { font-size: 27px; }
  .learn .section-heading>p, .rules .section-heading>p,
  .review .section-heading>p, .extra-page .section-heading>p { margin-top: 10px; font-size: 12px; }
  .lesson-progress { padding: 13px 14px 21px; font-size: 12px; }
  .lesson-progress::before,.lesson-progress::after { left: 14px; bottom: 8px; }
  .lesson-progress::after { width: calc((100% - 28px) * var(--lesson-progress,0)); }
  .lesson-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lesson-card { min-height: 154px; padding: 13px; }
  .lesson-card h3 { font-size: 16px; }
  .lesson-card p { font-size: 12px; }
  .coach-banner { height: 130px; }
}
