/* 原创山水画面承托页面留白；棋盘结构与交互由原规则引擎驱动。 */
.hero {
  background-image:
    linear-gradient(90deg, rgba(239, 225, 194, .70), rgba(245, 232, 205, .40) 35%, rgba(248, 238, 215, .03) 75%),
    url('/assets/optimized/heritage-landscape-wide-desktop.04becdec07c3.webp');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.home-modules {
  background-image:
    linear-gradient(180deg, rgba(245, 235, 215, .27), rgba(239, 225, 196, .31)),
    url('/assets/optimized/heritage-landscape-wide-desktop.04becdec07c3.webp');
  background-position: center 65%;
  background-size: cover;
  background-repeat: no-repeat;
}

.play {
  background-image:
    linear-gradient(180deg, rgba(247, 242, 232, .88), rgba(247, 242, 232, .97) 68%),
    url('/assets/optimized/heritage-landscape-wide-desktop.04becdec07c3.webp');
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

.module-red .module-number { color: #9b382b; }

/* 入口保留各自色彩，让插画透过暖纸卡片显露。主对弈入口维持深绿识别。 */
.module-card:not(.module-featured) { background: rgba(255, 250, 240, .82); }
.module-card.module-red { background: rgba(246, 223, 201, .84); }
.module-card.module-blue { background: rgba(227, 239, 236, .82); }
.module-card.module-gold { background: rgba(247, 235, 213, .82); }
.module-card.module-green { background: rgba(230, 240, 230, .82); }
.module-card.module-purple { background: rgba(238, 234, 241, .82); }
.module-card.module-cultural { background: rgba(239, 226, 211, .82); }

/* PC 功能区：使用源自项目规则拓扑的 29 点水印增强文化辨识度。 */
@media (min-width: 761px) {
  .home-modules {
    background-image:
      linear-gradient(180deg, rgba(245, 235, 215, .27), rgba(239, 225, 196, .31)),
      url('/assets/optimized/heritage-landscape-wide-desktop.04becdec07c3.webp');
  }

  .module-heading {
    border-bottom: 1px solid #ae8553;
    padding-bottom: 20px;
  }

  .module-card {
    position: relative;
    overflow: hidden;
    border-top: 3px solid #bd8c4c;
    box-shadow: 0 10px 24px #38442b22;
  }

  .module-card::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    top: 5px;
    right: 12px;
    background: url('./assets/board-watermark.svg') center / contain no-repeat;
    opacity: .32;
    pointer-events: none;
  }

  .module-card.module-featured::before {
    filter: brightness(0) invert(1);
    opacity: .23;
  }

  .module-symbol { display: none; }
  .module-copy, .module-number { position: relative; z-index: 1; }
  .module-arrow { z-index: 1; }
}

@media (min-width: 1100px) {
  .module-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
  }

  .module-card {
    grid-column: span 3;
    min-height: 188px;
    padding: 20px 22px;
  }

  .module-card:nth-of-type(1),
  .module-card:nth-of-type(2) {
    grid-column: span 4;
    min-height: 205px;
  }

  .module-card:nth-of-type(3),
  .module-card:nth-of-type(4) { grid-column: span 2; }

  .module-card:nth-of-type(3)::before,
  .module-card:nth-of-type(4)::before {
    width: 85px;
    height: 85px;
    opacity: .22;
  }
}

@media (max-width: 760px) {
  .hero {
    background-image:
      linear-gradient(180deg, rgba(245, 231, 204, .68), rgba(243, 227, 197, .47) 58%, rgba(242, 223, 187, .14)),
      url('/assets/optimized/heritage-landscape-mobile-desktop.e98f3f34d0e7.webp');
  }

  .home-modules {
    background-image:
      linear-gradient(180deg, rgba(245, 233, 210, .42), rgba(241, 224, 193, .36)),
      url('/assets/optimized/heritage-landscape-mobile-desktop.e98f3f34d0e7.webp');
    background-position: center center;
  }

  .play {
    background-image:
      linear-gradient(180deg, rgba(247, 242, 232, .88), rgba(247, 242, 232, .97)),
      url('/assets/optimized/heritage-landscape-mobile-desktop.e98f3f34d0e7.webp');
  }
}

/* 每组功能使用独立画面；中央承载层保证文字与棋盘可读。 */
.play { --scene: url('/assets/optimized/heritage-landscape-wide-desktop.04becdec07c3.webp'); --scene-shade: linear-gradient(90deg, #10362e33, transparent 28%, transparent 72%, #10362e33); }
.story { --scene: url('/assets/optimized/scene-culture-path-desktop.09c8411795ab.webp'); --scene-shade: linear-gradient(90deg, #253e2d44, transparent 30%, transparent 73%, #723c2440); }
.learn { --scene: url('/assets/optimized/scene-learning-sunrise-desktop.96efca5bb052.webp'); --scene-shade: linear-gradient(90deg, #74401d42, transparent 26%, transparent 75%, #93603530); }
.rules { --scene: url('/assets/optimized/scene-rules-dusk-desktop.c89dd6e01081.webp'); --scene-shade: linear-gradient(90deg, #0e263655, transparent 28%, transparent 74%, #0e263655); }
.review { --scene: url('/assets/optimized/scene-archive-paper-desktop.9a1a01ee7072.webp'); --scene-shade: linear-gradient(90deg, #6e312d33, transparent 29%, transparent 72%, #452b1d42); }
.online-page { --scene: url('/assets/optimized/scene-coach-river-desktop.cc26939bb1c8.webp'); --scene-shade: linear-gradient(90deg, #15585a44, transparent 27%, transparent 75%, #24546633); }
.training-page { --scene: url('/assets/optimized/scene-learning-sunrise-desktop.96efca5bb052.webp'); --scene-shade: linear-gradient(90deg, #9b4b2638, transparent 24%, transparent 71%, #a15d2940); }
.coach-page { --scene: url('/assets/optimized/scene-coach-river-desktop.cc26939bb1c8.webp'); --scene-shade: linear-gradient(90deg, #133f3a55, transparent 26%, transparent 72%, #385c3744); }
.analysis-page { --scene: url('/assets/optimized/scene-rules-dusk-desktop.c89dd6e01081.webp'); --scene-shade: linear-gradient(90deg, #1a394f55, transparent 24%, transparent 72%, #153b4f55); }
.history-page { --scene: url('/assets/optimized/scene-archive-paper-desktop.9a1a01ee7072.webp'); --scene-shade: linear-gradient(90deg, #60352b44, transparent 24%, transparent 71%, #59332233); }
.profile-page { --scene: url('/assets/optimized/scene-culture-path-desktop.09c8411795ab.webp'); --scene-shade: linear-gradient(90deg, #27463955, transparent 27%, transparent 72%, #945b2840); }
.login-page { --scene: url('/assets/optimized/heritage-landscape-wide-desktop.04becdec07c3.webp'); --scene-shade: linear-gradient(90deg, #10362e55, transparent 28%, transparent 72%, #10362e55); }
.privacy-page { --scene: url('/assets/optimized/scene-archive-paper-desktop.9a1a01ee7072.webp'); --scene-shade: linear-gradient(90deg, #5b352e44, transparent 30%, transparent 70%, #5b352e44); }
.play, .story, .rules, .learn, .review, .extra-page, .login-page, .privacy-page {
  background-image: var(--scene-shade), var(--scene);
  background-position: center center;
  background-size: cover;
}
.training-page { background-position: center bottom; }
.analysis-page { background-position: center 38%; }
.profile-page { background-position: center 58%; }
@media (min-width: 900px) {
  .play, .story, .rules, .learn, .review, .extra-page, .login-page, .privacy-page {
    background-attachment: fixed;
  }
  .play > .wrap, .story > .wrap, .rules > .wrap, .learn > .wrap,
  .review > .wrap, .extra-page > .wrap {
    background: rgba(250,246,235,.72);
    border: 1px solid #d4bb91;
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 20px 46px #112d2540;
  }
}

.game-shell { background: #d5bf9e; border-color: #b08c5e; box-shadow: 0 15px 34px #5b3b252c; }
.game-board-panel, .review-board-panel, .extra-board,
.culture-board-panel svg, .rule-diagrams svg, .hero-board {
  background: linear-gradient(145deg, #d5ad75, #bb8852);
  border-color: #81582f;
  box-shadow: inset 0 0 0 2px #e9c58d, 0 8px 18px #4b301f38;
}
.board-line { stroke: #443321; stroke-width: .78; opacity: .96; }
.board-node { fill: #392a1a; }
.node-label, .temple-label { fill: #594027; }

@media (max-width: 899px) {
  .play, .story, .rules, .learn, .review, .extra-page, .login-page, .privacy-page {
    background-image: linear-gradient(180deg, #f7eedf66, #f7eedf33), var(--scene);
    background-position: center center;
  }
  .play > .wrap, .story > .wrap, .rules > .wrap, .learn > .wrap,
  .review > .wrap, .extra-page > .wrap {
    background: rgba(250,246,235,.81);
    border: 1px solid #d7c3a3;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 12px 28px #1b352930;
  }
}

/* 图解页有深色背景，略增纸层浓度并压深正文颜色。 */
.rules > .wrap { background: rgba(250,246,235,.84); }
.rules .rule-card p { color: #40564b; }

.lesson-card:not(.complete), .culture-timeline, .rule-diagrams article,
.extra-panel, .extra-aside, .review-side, .review-empty, .history-card,
.profile-identity, .stat-card {
  background: rgba(255,250,240,.86);
}

/* 本机昵称进入与数据说明。登录不拦截原有任何功能入口。 */
.header-actions { display: flex; align-items: center; gap: 16px; }
.account-link { display: flex; align-items: center; gap: 6px; max-width: 128px; color: #f9e8c4; font-size: 11px; white-space: nowrap; }
.account-link svg { width: 38px; height: 38px; flex: none; border: 1px solid #d9b879; border-radius: 50%; padding: 6px; background: #255548; fill: none; stroke: #f9dfac; stroke-width: 1.7; stroke-linecap: round; }
.account-link:hover svg, .account-link:focus-visible svg { background: #397060; }
.account-link span { overflow: hidden; text-overflow: ellipsis; }
.live-analysis-card { padding: 18px 20px; background: #fff9e9; border: 1px solid #ba985f; border-top: 4px solid #ad4835; border-radius: 10px; box-shadow: 0 7px 18px #55311a1a; }
.live-analysis-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.live-analysis-head .small-label { margin: 0; }
.live-analysis-head button { border: 1px solid #baa077; border-radius: 20px; background: #f8efdc; padding: 5px 10px; min-height: 30px; color: #485c50; font-size: 11px; white-space: nowrap; }
.live-analysis-head button[aria-pressed="false"] { background: #eee8dc; color: #755f50; }
.live-analysis-card h3 { font: 600 20px 'Noto Serif SC','Songti SC',serif; margin: 8px 0 10px; }
.live-analysis-result { color: #455d4e; font-size: 12px; line-height: 1.7; min-height: 44px; }
.live-analysis-result strong { display: block; color: #20473a; font-size: 14px; }
.live-analysis-result p { margin: 6px 0; }
.live-analysis-result small { color: #84735c; }
.live-analysis-card > a { display: inline-block; margin-top: 12px; color: #a43c31; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.play-guidance { width: 100%; overflow: hidden; border: 1px solid #bc9f72; border-radius: 11px; background: rgba(255,250,240,.92); box-shadow: 0 7px 18px #55311a1a; }
.play-guidance-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; background: #e6d5b8; }
.play-guidance-tabs button { min-height: 43px; border: 0; border-radius: 7px; background: transparent; color: #355347; font-size: 13px; font-weight: 700; }
.play-guidance-tabs button[aria-selected="true"] { background: #173f35; color: #fff9e9; box-shadow: 0 3px 8px #15382b38; }
.play-guidance-tabs button:focus-visible { outline: 3px solid #b04433; outline-offset: -3px; }
.play-guidance-tabs button[hidden], .play-guidance-panel[hidden] { display: none; }
.play-guidance .live-analysis-card { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.play-guidance .coach-dialog { margin: 0; padding: 15px; border: 0; }
.play-guidance .coach-dialog-head { display: block; }
.play-guidance .coach-dialog-head h3 { font-size: 20px; }
.play-guidance .coach-dialog-head small { display: block; margin-top: 3px; text-align: left; }
.play-guidance .coach-dialog-thread { min-height: 110px; max-height: 190px; margin: 12px 0; padding: 10px; }
.play-guidance .coach-suggestions button { font-size: 10px; padding: 6px 8px; }
.play-guidance .coach-dialog-form input { padding: 10px; }
@media (max-width: 900px) { .play-guidance .coach-dialog-thread { max-height: 250px; } }
.profile-policy-link { color: #9c372b; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.login-page, .privacy-page { min-height: calc(100vh - 72px); }
.login-page .back-link, .privacy-page .back-link { margin: 0 0 24px; }
.login-card { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: .95fr 1.05fr; background: #fbf5e9; border: 1px solid #d6bd91; border-radius: 20px; overflow: hidden; box-shadow: 0 28px 65px #0c302960; }
.login-art { background: linear-gradient(150deg, #10362eec, #164a3dbb 66%, #733f27a8), url('/assets/optimized/heritage-landscape-wide-desktop.04becdec07c3.webp') center / cover; color: #fdf0d4; padding: 58px; min-height: 550px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art-top, .login-art-bottom { letter-spacing: .2em; font-size: 12px; color: #e8bd76; }
.login-art h1 { font: 600 clamp(34px,3.4vw,48px)/1.32 'Noto Serif SC','Songti SC',serif; margin: 0; }
.login-art p { max-width: 310px; line-height: 1.9; color: #f4e7cf; }
.login-content { padding: 55px clamp(28px,5vw,70px); display: flex; flex-direction: column; justify-content: center; }
.login-content .eyebrow { margin: 0 0 14px; }
.login-content h2 { font: 600 clamp(28px,2.8vw,38px) 'Noto Serif SC','Songti SC',serif; margin: 0 0 15px; }
.login-intro { color: #5b6d64; line-height: 1.8; margin: 0; }
.login-name-label { display: block; margin-top: 26px; margin-bottom: 9px; font-weight: 700; }
.login-content input[type="text"], .login-content input[name="nickname"] { display: block; width: 100%; border: 1px solid #cbb895; border-radius: 10px; padding: 15px; background: #fffdf8; }
.login-consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; color: #52665b; font-size: 13px; line-height: 1.7; }
.login-consent input { width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; flex: none; accent-color: #b83f30; }
.login-consent a, .login-guest { color: #9d372c; text-decoration: underline; text-underline-offset: 3px; }
.login-submit { width: 100%; margin-top: 22px; }
.login-message { min-height: 1.5em; color: #ad3b30; font-size: 12px; margin: 8px 0 0; }
.login-guest { align-self: flex-start; margin-top: 10px; font-size: 13px; }
.privacy-card { max-width: 1060px; margin: 0 auto; background: #fbf5e9; border: 1px solid #d6bd91; border-radius: 18px; padding: clamp(26px,5vw,64px); box-shadow: 0 24px 55px #0c30294a; }
.privacy-card h1 { font: 600 clamp(30px,3.1vw,44px) 'Noto Serif SC','Songti SC',serif; margin: 0 0 15px; }
.privacy-lede { max-width: 800px; color: #475e50; line-height: 1.9; }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.privacy-grid article { padding: 24px; background: #fffdf7; border: 1px solid #ddc8a8; border-top: 3px solid #bd7d47; border-radius: 10px; }
.privacy-grid article span { color: #b44735; font: 600 22px 'Noto Serif SC',serif; }
.privacy-grid h2 { font: 600 20px 'Noto Serif SC','Songti SC',serif; margin: 12px 0 8px; }
.privacy-grid p, .privacy-note { color: #536a5b; line-height: 1.8; font-size: 13px; margin: 0; }
.privacy-note { margin: 24px 0; }
.privacy-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.privacy-actions .text-link { padding-bottom: 3px; }
.site-footer .footer-inner>div:last-child { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.site-footer a[href="#/privacy"], .site-footer a[href="/privacy/"] { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 760px) {
  .header-actions { gap: 9px; }
  .account-link svg { width: 34px; height: 34px; }
  .account-link span { display: none; }
  .login-page, .privacy-page { padding: 19px 0 72px; }
  .login-page .back-link, .privacy-page .back-link { margin: 0 0 15px; }
  .login-card { display: flex; flex-direction: column; }
  .login-art { min-height: 190px; padding: 25px; }
  .login-art h1 { font-size: 28px; }
  .login-art p { display: none; }
  .login-content { padding: 28px 24px 32px; }
  .login-content h2 { font-size: 28px; }
  .privacy-grid { grid-template-columns: 1fr; }
  .privacy-grid article { padding: 19px; }
  .site-footer .footer-inner>div:last-child { align-items: flex-start; }
}
@media (max-width: 360px) {
  .header-actions .header-cta { display: none; }
}

/* Keep every scene on its mobile asset after the shared scene declarations. */
@media (max-width: 760px) {
  .play, .login-page { --scene: url('/assets/optimized/heritage-landscape-mobile-desktop.e98f3f34d0e7.webp'); }
  .story, .profile-page { --scene: url('/assets/optimized/scene-culture-path-mobile.5974c3bea956.webp'); }
  .learn, .training-page { --scene: url('/assets/optimized/scene-learning-sunrise-mobile.f4df0ced2510.webp'); }
  .rules, .analysis-page { --scene: url('/assets/optimized/scene-rules-dusk-mobile.2f3020f56cdc.webp'); }
  .review, .history-page, .privacy-page { --scene: url('/assets/optimized/scene-archive-paper-mobile.027441381490.webp'); }
  .online-page, .coach-page { --scene: url('/assets/optimized/scene-coach-river-mobile.9f8ab0c00c24.webp'); }
  .login-art {
    background-image: linear-gradient(150deg, #10362eec, #164a3dbb 66%, #733f27a8), url('/assets/optimized/heritage-landscape-mobile-desktop.e98f3f34d0e7.webp');
  }
}
