﻿/* 《交子界》电子原型 · 视觉层 */

:root {
  /* A01 墨褐底 · A02 宣纸底 · A03 弹窗亮纸 · A04 卡面旧纸 */
  --ink: #1A1619;
  --ink-2: #4A4038;
  --paper: #F5E8D3;
  --paper-2: #FBF6EC;
  --paper-3: #E8DCC4;
  /* C01 主按钮红底，左右夹边 */
  --red: #B23A2E;
  --red-deep: #82261A;
  --red-deeper: var(--red-deeper);
  --red-light: #D55A4C;
  --red-soft: #E8B0AB;
  /* 六系主色 */
  --gold: #B8893A;
  --blue: #3E5C76;
  --green: #7A8B3F;
  --plum: #9C5B7B;
  --orange: #C9712C;
  /* 线色：外粗深墨 / 内极浅米白 / 内极浅金褐 */
  --line: #1A1619;
  --line-soft: rgba(26, 22, 25, 0.18);
  --line-hi: rgba(251, 246, 236, 0.72);
  --line-gold: rgba(184, 137, 58, 0.55);
  /* 半透明色族（覆盖 ink / red / paper 的常用强度） */
  --ink-soft: var(--ink-soft);      /* 次文字、辅助信息 */
  --ink-mid: rgba(26, 22, 25, 0.40);      /* 三级文字、淡标签 */
  --ink-faint: rgba(26, 22, 25, 0.28);    /* 已完成、禁用、最淡分隔 */
  --ink-divider: rgba(26, 22, 25, 0.12);  /* 极细水平线 */
  --ink-shadow: rgba(26, 22, 25, 0.16);   /* 柔和投影 */
  --red-soft-bg: var(--red-soft-bg); /* 红系淡底 */
  --red-soft-line: var(--red-soft-line); /* 红系淡描边 */
  --paper-2-soft: var(--paper-2-soft); /* 极淡米底 */
  --serif: "Songti SC", "STSong", "SimSun", "Source Han Serif SC", "Noto Serif SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  /* 结构 */
  --r: 4px;
  --r-lg: 6px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: var(--sans);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

#app { width: 100vw; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.screen { display: none; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.screen.active { display: flex; }

button { font-family: inherit; color: inherit; cursor: pointer; }
img { -webkit-user-drag: none; }

/* ---------- 通用控件 ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  padding: 11px 20px;
  font-size: 13px;
  letter-spacing: 0.08em;
  border-radius: var(--r);
  transition: background .16s, color .16s, border-color .16s, opacity .16s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--paper-3); color: var(--ink); border-color: var(--ink); }
.btn:disabled { color: var(--ink-2); cursor: not-allowed; background: var(--paper-3); border-color: var(--line-soft); }

.btn-primary { background: var(--red); border-color: var(--red-deep); color: var(--paper-2); }
.btn-primary:hover:not(:disabled) { background: var(--red-deep); border-color: var(--red-deeper); }
.btn-primary:disabled { background: var(--red-soft); color: var(--ink-2); border-color: rgba(130, 38, 26, 0.3); }

.btn-ghost { border-color: var(--line); color: var(--ink-2); background: var(--paper-2-soft); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--paper-2); }
.btn-ghost:disabled { border-color: var(--line-soft); color: rgba(74, 64, 56, 0.45); background: rgba(251, 246, 236, 0.4); }

.crumb {
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 10px;
}
h1, h2, h3, h4, h5 { font-family: var(--serif); font-weight: 700; margin: 0; }
.dim { color: rgba(26, 22, 25, 0.56); font-size: 12px; line-height: 1.7; }
em { font-style: normal; }

/* ---------- 开屏落地页 ---------- */
#scr-menu {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 80% 14%, rgba(184, 137, 58, 0.16), transparent 52%),
    radial-gradient(circle at 8% 86%, var(--red-soft-bg), transparent 56%),
    repeating-linear-gradient(0deg, rgba(26, 22, 25, 0.022) 0 1px, transparent 1px 4px),
    var(--paper);
}
#scr-menu::-webkit-scrollbar { width: 10px; }
#scr-menu::-webkit-scrollbar-thumb { background: var(--ink-faint); border: 3px solid var(--paper); border-radius: 6px; }

/* 顶栏 */
.land-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  padding: 12px clamp(16px, 4vw, 56px);
  background: rgba(237, 227, 200, 0.90);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.land-brand { display: flex; align-items: center; gap: 10px; }
.land-brand-seal {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--red);
  color: var(--paper-2);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
  border: 1px solid var(--red-2);
  box-shadow: inset 0 0 0 2px rgba(251, 246, 236, 0.35);
}
.land-brand-name { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 0.14em; }
.land-brand-en { font-size: 9px; letter-spacing: 0.32em; color: rgba(26, 22, 25, 0.42); padding-top: 3px; }
.land-links { display: flex; gap: 4px; }
.land-links button {
  appearance: none; border: 0; background: transparent;
  padding: 7px 12px; font-size: 12px; letter-spacing: 0.12em;
  color: var(--ink-2); border-radius: 2px; transition: color .16s, background .16s;
}
.land-links button:hover { color: var(--red); background: rgba(178, 58, 46, 0.07); }
.land-nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.land-era { font-size: 10px; letter-spacing: 0.24em; color: rgba(26, 22, 25, 0.46); }
.land-sound {
  appearance: none; border: 1px solid var(--line); background: transparent;
  padding: 6px 12px; font-size: 11px; letter-spacing: 0.1em; border-radius: 2px;
  transition: border-color .16s, color .16s, background .16s;
}
.land-sound:hover { border-color: var(--ink); background: rgba(251, 246, 236, 0.7); }

/* 主视觉 */
.land-hero {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 43%);
  align-items: center;
  gap: clamp(24px, 4vw, 66px);
  padding: clamp(24px, 4.4vh, 54px) clamp(16px, 4vw, 56px);
}
.land-copy { min-width: 0; }
.land-kicker {
  font-size: 10px; letter-spacing: 0.4em; color: var(--red);
  animation: landUp .65s cubic-bezier(.2,.7,.3,1) both;
}
.land-title {
  font-size: clamp(54px, 7.2vw, 100px);
  line-height: 0.96;
  letter-spacing: 0.05em;
  margin: 12px 0 0;
  animation: landUp .7s cubic-bezier(.2,.7,.3,1) .06s both;
}
.land-title span { color: var(--red); }
.land-sub {
  font-family: var(--serif);
  font-size: clamp(13px, 1.3vw, 17px);
  letter-spacing: 0.22em;
  color: var(--ink-2);
  margin: 14px 0 0;
  animation: landUp .7s cubic-bezier(.2,.7,.3,1) .12s both;
}
.land-desc {
  max-width: 540px;
  font-size: 12.5px;
  line-height: 2;
  color: rgba(26, 22, 25, 0.66);
  margin: 18px 0 0;
  animation: landUp .7s cubic-bezier(.2,.7,.3,1) .18s both;
}
.land-cta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 26px;
  animation: landUp .7s cubic-bezier(.2,.7,.3,1) .24s both;
}
.land-cta .btn {
  height: 46px; padding: 0 24px;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.land-btn-main {
  background: var(--red);
  border-color: var(--red-deep);
  color: var(--paper-2);
  transition: background .2s, border-color .2s;
}
.land-btn-main:hover:not(:disabled) {
  background: var(--red-deep);
  border-color: var(--red-deeper);
}
.land-btn-main b { font-weight: 600; letter-spacing: 0.14em; }
.land-btn-main em { font-style: normal; transition: transform .2s; }
.land-btn-main:hover em { transform: translateX(4px); }
.land-quick {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px;
  animation: landUp .7s cubic-bezier(.2,.7,.3,1) .30s both;
}
.land-quick .btn { padding: 8px 13px; font-size: 11.5px; letter-spacing: 0.06em; }
.land-stats {
  display: flex; flex-wrap: wrap;
  gap: clamp(20px, 3vw, 44px);
  margin-top: 26px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  animation: landUp .7s cubic-bezier(.2,.7,.3,1) .36s both;
}
.land-stats div { display: flex; flex-direction: column; gap: 3px; }
.land-stats b { font-family: var(--serif); font-size: 26px; line-height: 1; }
.land-stats span { font-size: 9.5px; letter-spacing: 0.2em; color: rgba(26, 22, 25, 0.48); }

/* 封面画框 */
.land-art { position: relative; justify-self: end; width: 100%; max-width: 520px; }
.land-art-frame {
  position: relative;
  height: clamp(330px, 56vh, 600px);
  overflow: hidden;
  background: #FBF6EC;
  border: 1px solid var(--ink);
  transform: rotate(-1.2deg);
  box-shadow: 0 22px 54px rgba(26, 22, 25, 0.20);
  animation:
    landArtIn .9s cubic-bezier(.2,.7,.3,1) .1s both,
    landFloat 8s ease-in-out 1s infinite;
}
.land-art-frame::after {
  content: '';
  position: absolute; inset: 6px;
  border: 1px solid rgba(184, 137, 58, 0.52);
  pointer-events: none;
}
.land-art-frame img {
  display: block;
  width: 100%;
  height: 107%;
  object-fit: cover;
  object-position: top center;
}
.land-art-cap {
  position: absolute; left: -34px; top: 26px;
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 12px; letter-spacing: 0.42em;
  color: rgba(26, 22, 25, 0.42);
}
.land-seal {
  position: absolute; right: -14px; bottom: 26px;
  width: 86px; height: 86px;
  display: grid; place-items: center;
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 25px; letter-spacing: 0.16em;
  color: var(--paper-2);
  background: var(--red);
  border: 3px double rgba(251, 246, 236, 0.68);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(142, 42, 33, 0.30);
  animation: landStamp .8s cubic-bezier(.2,.9,.25,1.25) .62s both;
}
.land-art-note {
  position: absolute; left: 4px; bottom: -24px;
  font-family: var(--serif);
  font-size: 10px; letter-spacing: 0.28em;
  color: rgba(26, 22, 25, 0.42);
}

/* 内容区 */
.land-sections {
  width: 100%; max-width: 1400px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 56px) 44px;
  display: flex; flex-direction: column;
  gap: clamp(34px, 5vh, 62px);
}
.land-sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.land-sec-head span { font-size: 9px; letter-spacing: 0.32em; color: var(--red); }
.land-sec-head h2 { font-size: clamp(21px, 2.3vw, 29px); letter-spacing: 0.06em; }
.land-sec-head::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); margin-left: 6px; }

.land-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.land-card {
  border: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.72);
  padding: 18px 18px 17px;
  transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
}
.land-card:hover {
  transform: translateY(-3px);
  border-color: var(--red-soft-line);
  background: var(--paper-2);
  box-shadow: 0 12px 26px rgba(26, 22, 25, 0.10);
}
.land-card-num { font-family: var(--serif); font-size: 12px; letter-spacing: 0.2em; color: var(--red); }
.land-card h3 { font-size: 16px; letter-spacing: 0.06em; margin: 8px 0 7px; }
.land-card p { margin: 0; font-size: 12px; line-height: 1.85; color: rgba(26, 22, 25, 0.64); }

.land-roles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.land-role {
  appearance: none;
  display: block; width: 100%;
  padding: 0; text-align: left;
  border: 1px solid var(--line);
  background: var(--paper-2);
  overflow: hidden;
  transition: transform .22s, border-color .22s, box-shadow .22s;
}
.land-role:hover {
  transform: translateY(-4px);
  border-color: var(--red);
  box-shadow: 0 14px 28px rgba(26, 22, 25, 0.14);
}
.land-role-frame { display: block; overflow: hidden; background: var(--paper-3); }
.land-role img {
  display: block; width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  transition: transform .4s ease;
}
.land-role:hover img { transform: scale(1.05); }
.land-role-body { display: block; padding: 8px 10px 10px; border-top: 1px solid var(--line-soft); }
.land-role-name { display: block; font-family: var(--serif); font-size: 14px; letter-spacing: 0.08em; }
.land-role-skill { display: block; font-size: 10px; letter-spacing: 0.12em; color: var(--red); margin-top: 2px; }
.land-role-tag { display: block; font-size: 9.5px; line-height: 1.5; color: rgba(26, 22, 25, 0.46); margin-top: 3px; }

.land-deck {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.72);
  padding: 14px;
  transition: transform .2s, border-color .2s, background .2s;
}
.land-deck:hover { transform: translateY(-3px); border-color: var(--red-soft-line); background: var(--paper-2); }
.land-deck img {
  width: 62px; flex: 0 0 62px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line-soft);
}
.land-deck h3 { font-size: 15px; margin: 0 0 6px; letter-spacing: 0.06em; }
.land-deck h3 b { font-family: var(--serif); font-size: 20px; color: var(--red); margin-left: 4px; }
.land-deck p { margin: 0; font-size: 12px; line-height: 1.75; color: rgba(26, 22, 25, 0.62); }

.land-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 16px clamp(16px, 4vw, 56px) 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 9.5px; letter-spacing: 0.16em;
  color: rgba(26, 22, 25, 0.42);
}

/* 滚动显现 */
.land-reveal { opacity: 0; transform: translateY(20px); transition: opacity .62s ease, transform .62s cubic-bezier(.2,.7,.3,1); }
.land-reveal.is-in { opacity: 1; transform: none; }

/* 角色详情弹窗 */
.land-role-modal { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; align-items: start; }
.land-role-modal img { width: 132px; aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; border: 1px solid var(--line); }
.land-role-modal h4 { font-family: var(--serif); font-size: 19px; margin: 0 0 4px; }
.land-role-modal .rm-tag { font-size: 11px; color: var(--ink-soft); letter-spacing: 0.1em; }
.land-role-modal .rm-skill { display: inline-block; margin: 10px 0 8px; padding: 3px 9px; font-size: 10px; letter-spacing: 0.14em; color: var(--red); border: 1px solid var(--red-soft-line); }
.land-role-modal p { margin: 0; font-size: 12px; line-height: 1.9; color: rgba(26, 22, 25, 0.68); }

@keyframes landUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes landArtIn { from { opacity: 0; transform: rotate(-1.2deg) translateY(22px) scale(.97); } to { opacity: 1; transform: rotate(-1.2deg) translateY(0) scale(1); } }
@keyframes landFloat { 0%, 100% { transform: rotate(-1.2deg) translateY(0); } 50% { transform: rotate(-0.6deg) translateY(-9px); } }
@keyframes landStamp { 0% { opacity: 0; transform: rotate(16deg) scale(1.7); } 70% { opacity: 1; transform: rotate(4deg) scale(.95); } 100% { opacity: 1; transform: rotate(6deg) scale(1); } }

@media (max-width: 1080px) {
  .land-hero { grid-template-columns: minmax(0, 1fr) minmax(280px, 40%); }
  .land-roles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .land-hero { grid-template-columns: 1fr; gap: 30px; padding-bottom: 40px; }
  .land-art { justify-self: center; order: -1; max-width: 380px; }
  .land-art-frame { height: clamp(280px, 44vh, 430px); }
  .land-art-cap { display: none; }
  .land-art-note { bottom: -20px; }
  .land-seal { width: 68px; height: 68px; font-size: 20px; right: -8px; }
  .land-cards { grid-template-columns: 1fr; }
  .land-decks { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .land-nav { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 8px; }
  .land-links {
    order: 3; width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .land-links::-webkit-scrollbar { display: none; }
  .land-links button { white-space: nowrap; padding: 6px 10px; }
  .land-era { display: none; }
  .land-title { font-size: clamp(48px, 14vw, 72px); }
  .land-desc { font-size: 12px; line-height: 1.9; }
  .land-cta .btn { flex: 1 1 100%; justify-content: center; }
  .land-stats { gap: 22px; }
  .land-stats b { font-size: 22px; }
  .land-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .land-foot { flex-direction: column; }
}
@media (max-width: 460px) {
  .land-quick { display: grid; grid-template-columns: 1fr 1fr; }
  .land-quick .btn { padding: 9px 8px; text-align: center; }
  .land-seal { width: 60px; height: 60px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .land-kicker, .land-title, .land-sub, .land-desc, .land-cta, .land-quick, .land-stats,
  .land-art-frame, .land-seal { animation: none !important; opacity: 1 !important; transform: none !important; }
  .land-art-frame { transform: rotate(-1.2deg) !important; }
  .land-reveal { opacity: 1; transform: none; transition: none; }
  #scr-menu { scroll-behavior: auto; }
}

/* ---------- 匹配 / 设置页 ---------- */
.page-head {
  padding: 5vh 6vw 18px;
  border-bottom: 1px solid var(--line-soft);
}
.page-head h2 { font-size: clamp(22px, 2.6vw, 34px); letter-spacing: 0.04em; margin-bottom: 8px; }
.page-head .lead { font-size: 12px; color: rgba(26, 22, 25, 0.6); line-height: 1.7; margin: 0; max-width: 720px; }

#match-body, #setup-body { flex: 1; padding: 26px 6vw; overflow: auto; }

.page-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 6vw;
  border-top: 1px solid var(--line-soft);
  background: rgba(251, 246, 236, 0.6);
}
.foot-right { display: flex; align-items: center; gap: 16px; }
.hint { font-size: 12px; color: var(--ink-soft); }

.match-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 1120px; }
.match-side { display: flex; flex-direction: column; gap: 22px; }
.side-block {
  border: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.55);
  padding: 16px 16px 14px;
}
.side-block h4 { font-size: 13px; letter-spacing: 0.14em; margin-bottom: 12px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg-btn {
  flex: 1; border: 0; border-right: 1px solid var(--line);
  background: var(--paper-2); padding: 9px 6px;
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-2);
  transition: background .16s, color .16s;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--ink); color: var(--paper-2); }
.seg-btn:hover:not(.on) { background: var(--paper-3); }
.first-note { font-size: 12px; color: var(--red); margin: 10px 0 0; letter-spacing: 0.06em; }

.seat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.seat-card {
  display: flex;
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  padding: 14px;
  position: relative;
}
.seat-card.first { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
.seat-avatar {
  width: 78px;
  height: 96px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line-soft);
  background: var(--paper-3);
  mix-blend-mode: multiply;
}
.seat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.seat-name {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  padding: 2px 0 4px;
  outline: none;
  width: 100%;
}
.seat-name:focus { border-bottom-color: var(--red); }
.seat-role {
  width: 100%;
  font-size: 12px;
  padding: 6px 4px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.35);
}
.seat-desc { margin: 0; font-size: 11px; line-height: 1.6; color: rgba(26, 22, 25, 0.58); }
.seat-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tag {
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--line-soft);
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.tag.me { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.tag.ai { background: rgba(62, 92, 118, 0.12); color: var(--blue); border-color: rgba(62, 92, 118, 0.4); }
.tag.persona { background: rgba(184, 137, 58, 0.12); color: var(--gold); border-color: rgba(184, 137, 58, 0.45); }
.tag.first { background: var(--red); color: var(--paper-2); border-color: var(--red-2); }
.seat-ai-toggle {
  background: transparent;
  font-family: var(--sans);
  cursor: pointer;
  border-style: dashed;
  color: var(--ink-soft);
}
.seat-ai-toggle:hover { background: var(--ink); color: var(--paper-2); border-color: var(--ink); color: var(--paper-2); }

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 880px;
}
.setup-item {
  border: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.6);
  padding: 16px 18px;
}
.setup-item.wide { grid-column: 1 / -1; }
.setup-item label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--ink-mid);
  margin-bottom: 6px;
}
.setup-item b { font-family: var(--serif); font-size: 17px; }
.setup-item .dim { margin: 8px 0 0; }
.setup-item .seg { margin-top: 6px; max-width: 360px; }
.setup-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; max-width: 880px; }
.setup-seat { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.setup-seat img { width: 46px; height: 56px; object-fit: cover; object-position: top; mix-blend-mode: multiply; }
.setup-seat b { display: block; font-family: var(--serif); font-size: 14px; }
.setup-seat span { display: block; font-size: 11px; color: var(--red); }
.setup-seat em { display: block; font-size: 10px; color: var(--ink-soft); line-height: 1.5; }

/* ---------- 对局框架 ---------- */
#scr-game { position: relative; }
#scr-game.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.82);
  backdrop-filter: blur(4px);
  z-index: 10;
}
.tb-left, .tb-mid, .tb-right { display: flex; align-items: center; gap: 14px; }
.tb-left { min-width: 0; }
.era-chip {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--paper-2);
  background: var(--c, var(--red));
  padding: 5px 12px;
  white-space: nowrap;
}
.tb-round { font-size: 11px; color: rgba(26, 22, 25, 0.62); white-space: nowrap; }
.tb-round b { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.tb-motto { font-family: var(--serif); font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-stat { display: flex; flex-direction: column; line-height: 1.2; }
.tb-stat span { font-size: 9px; letter-spacing: 0.16em; color: var(--ink-mid); }
.tb-stat b { font-family: var(--serif); font-size: 14px; }
.tb-policy { font-size: 11px; color: var(--gold); border: 1px solid rgba(184, 137, 58, 0.5); padding: 4px 9px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tb-policy.empty { color: var(--ink-faint); border-color: var(--line-soft); }
/* 顶栏牌堆徽章：墨线小方章，可点击打开全览 */
.tb-deck {
  font-size: 10px; letter-spacing: 0.12em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 3px 8px;
  background: var(--paper-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.tb-deck b { font-family: var(--serif); font-size: 12px; color: var(--ink); margin-left: 2px; }
.tb-deck:hover { background: var(--red); border-color: var(--red-deep); color: var(--paper-2); }
.tb-deck:hover b { color: var(--paper-2); }
.tb-ver {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.tb-timer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.1;
  padding: 2px 9px 2px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
  white-space: nowrap;
  position: relative;
}
/* D04 倒计时徽章左侧内缘色条 */
.tb-timer::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px;
  background: var(--ink);
}
.tb-timer.urgent::before { background: var(--red); }
.tb-timer.paused::before { background: var(--orange); }
.tb-timer span { font-size: 8px; letter-spacing: 0.14em; color: rgba(26, 22, 25, 0.45); }
.tb-timer b { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.tb-timer.urgent {
  border-color: var(--red);
  background: var(--red-soft-bg);
  animation: tbTimerPulse 1s infinite;
}
.tb-timer.urgent b { color: var(--red); }
.tb-timer.paused { opacity: 0.5; border-style: dashed; animation: none; }
@keyframes tbTimerPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(178, 58, 46, 0.16); }
}
.tb-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.tb-btn:hover { background: var(--ink); color: var(--paper-2); }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 14px;
  min-height: 0;
  padding: 12px 16px 8px;
}
.board-col {
  min-width: 0; min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.opp-col {
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

/* ---------- 棋盘 ---------- */
.board-hold {
  position: relative;
  width: min(100%, calc(100vh - 300px));
}
.board {
  width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 0 18px 40px rgba(26, 22, 25, 0.16), inset 0 0 0 1px rgba(251, 246, 236, 0.7);
  position: relative;
}

.cell {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--ink-faint);
  border-bottom: 1px solid var(--ink-faint);
  background: #E9DFC6;
  min-width: 0;
  cursor: pointer;
}
/* 六系色标：贴在地图外沿，不侵占格内画面 */
.fam-rim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fam-rim i {
  position: absolute;
  display: block;
  background: var(--f, rgba(26, 22, 25, 0.16));
}
.fam-rim .t, .fam-rim .b { height: 6px; }
.fam-rim .l, .fam-rim .r { width: 6px; }
.fam-rim .t { top: -10px; }
.fam-rim .b { bottom: -10px; }
.fam-rim .l { left: -10px; }
.fam-rim .r { right: -10px; }
.cell-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cell-owner {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  display: none;
  z-index: 3;
}
.cell-num { display: none; }
.cell-name { display: none; }
.cell-build { display: none; }
.cell-tokens {
  position: absolute;
  left: 0; right: 0; bottom: 11px;
  display: flex;
  justify-content: center;
  gap: 2px;
  z-index: 4;
  pointer-events: none;
}
.tok {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 1px solid rgba(251, 246, 236, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  background: var(--paper-3);
}

/* ---------- 棋盘中央 ---------- */
.center {
  grid-area: 2 / 2 / 10 / 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.2% 4%;
  gap: 3px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(251, 246, 236, 0.95), rgba(226, 213, 180, 0.6) 70%),
    repeating-linear-gradient(90deg, rgba(26, 22, 25, 0.03) 0 1px, transparent 1px 6px);
}
.center-title {
  font-family: var(--serif);
  font-size: clamp(24px, 4.6vh, 54px);
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 2px 3px 0 rgba(178, 58, 46, 0.13);
  margin-top: 1%;
}
.center-sub {
  font-family: var(--serif);
  font-size: clamp(8px, 1.2vh, 12px);
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.center-rule { width: 64px; height: 1px; background: var(--red); margin: 6px 0 4px; opacity: 0.6; }
.center-tables {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 8px 14px;
  min-height: 0;
}
.ct-block { min-width: 0; }
.ct-block:first-child { grid-column: 1 / -1; }
.ct-block h4 {
  font-size: clamp(7px, 1vh, 10px);
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: 3px;
  font-family: var(--sans);
  font-weight: 600;
}
.era-track { display: flex; gap: 2px; align-items: center; }
.era-node {
  flex: 1;
  text-align: center;
  font-size: clamp(6px, 1vh, 9px);
  line-height: 1.6;
  color: var(--ink-mid);
  border: 1px solid var(--line-soft);
  background: rgba(251, 246, 236, 0.5);
}
.era-node.past { color: var(--ink-faint); text-decoration: line-through; }
.era-node.on { background: var(--red); border-color: var(--red); color: var(--paper-2); font-weight: 700; }

.goods-table { font-size: clamp(6px, 1vh, 9px); }
.gt-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2px; padding: 1px 0; border-bottom: 1px solid var(--line-soft); }
.gt-row span { text-align: right; }
.gt-row span:first-child { text-align: left; }
.gt-row.gt-head { color: var(--ink-mid); font-size: 0.9em; }
.gt-name { font-weight: 600; }
.crisis-table { font-size: clamp(7px, 1vh, 10px); line-height: 1.6; }
.crisis-table p { margin: 0 0 3px; }
.crisis-table b { color: var(--red); }

/* 中央右下角：六系色标图例 */
.fam-legend {
  grid-column: 1 / -1;
  justify-self: end;
  align-self: end;
  padding: 6px 9px 7px;
  border: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.8);
  box-shadow: 0 4px 14px rgba(26, 22, 25, 0.08);
  pointer-events: none;
}
.fam-legend h4 {
  margin: 0 0 3px;
  font-family: var(--sans);
  font-size: clamp(6px, 0.95vh, 9px);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--red);
}
.fam-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px 12px;
}
.fam-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(6px, 1vh, 9px);
  color: rgba(26, 22, 25, 0.72);
  white-space: nowrap;
}
.fam-legend-item i {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--f);
  border: 1px solid rgba(26, 22, 25, 0.25);
}

/* ---------- 玩家信息区 ---------- */
.selfarea {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 18px;
  border-top: 1px solid var(--line);
  background: rgba(251, 246, 236, 0.8);
  min-height: 62px;
  position: relative;
  z-index: 50;
}
.self-id { display: flex; align-items: center; gap: 10px; min-width: 250px; }
.self-avatar {
  width: 42px; height: 50px;
  object-fit: cover; object-position: top;
  border: 1px solid var(--line-soft);
  background: var(--paper-3);
  mix-blend-mode: multiply;
}
.self-meta { min-width: 0; }
.self-name { font-family: var(--serif); font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.self-away {
  font-family: var(--sans, sans-serif);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 0 5px;
  align-self: center;
}
.self-role { font-family: var(--sans); font-size: 10px; color: var(--red); letter-spacing: 0.1em; }
.self-skill { font-size: 10px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }
.self-cash { display: flex; align-items: baseline; gap: 4px; padding: 0 14px; border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); }
.self-cash label { font-size: 9px; letter-spacing: 0.2em; color: var(--ink-mid); writing-mode: vertical-rl; }
.self-cash span { font-family: var(--serif); font-size: 30px; line-height: 1; font-weight: 700; }
.self-cash small { font-size: 10px; color: var(--ink-mid); }
.self-fams { display: flex; gap: 5px; flex-wrap: wrap; }
.fam-chip {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--c, var(--line));
  padding: 2px 6px 2px 3px;
  font-size: 10px;
  background: rgba(251, 246, 236, 0.6);
  cursor: pointer;
}
.chip-icon {
  width: 16px;
  height: 16px;
  object-fit: cover;
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.fam-chip:hover { background: var(--c, var(--line)); }
.fam-chip:hover .fam-mark, .fam-chip:hover .fam-count { color: #fff; }
.fam-mark { color: var(--c, var(--ink)); font-family: var(--serif); font-weight: 700; }
.fam-count { font-size: 9px; color: rgba(26, 22, 25, 0.6); }
.fam-badge { font-size: 8px; background: var(--c); color: #fff; padding: 0 3px; }
.self-goods { display: flex; gap: 5px; flex-wrap: wrap; }
.good-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; padding: 2px 6px 2px 3px;
  border: 1px solid var(--line-soft); color: var(--ink-2); cursor: pointer;
}
.good-chip:hover { border-color: var(--ink); color: var(--ink); }
.good-chip.dim { opacity: 0.35; }
.self-hand {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
  padding: 7px 13px;
  font-size: 11px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--ink);
  transition: background .16s, border-color .16s;
}
.self-hand:hover { background: var(--paper-3); border-color: var(--ink); }
.self-host {
  border: 1px dashed var(--line);
  background: transparent;
  padding: 7px 11px;
  font-size: 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--ink-2);
}
.self-host:hover { border-color: var(--red); color: var(--red); }
.self-host.on {
  border: 1px solid var(--red);
  background: var(--red-soft-bg);
  color: var(--red);
}
.self-host.locked {
  border-style: solid;
  border-color: var(--red-soft-line);
  color: var(--red);
  opacity: 0.7;
}

/* ---------- 对手列 ---------- */
.opp-card {
  display: flex;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  background: rgba(251, 246, 236, 0.65);
}
.opp-card.cur {
  border-color: var(--red);
  background: rgba(178, 58, 46, 0.07);
  box-shadow: inset 3px 0 0 var(--red);
}
.opp-avatar {
  width: 46px; height: 56px;
  object-fit: cover; object-position: top;
  background: var(--paper-3);
  border: 1px solid var(--line-soft);
  mix-blend-mode: multiply;
}
.opp-info { flex: 1; min-width: 0; }
.opp-name { font-family: var(--serif); font-size: 14px; font-weight: 700; }
.opp-role { font-size: 9px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-dots { display: flex; gap: 3px; flex-wrap: wrap; margin: 4px 0; }
.dot { font-size: 9px; color: var(--c, var(--ink)); border: 1px solid var(--c, var(--line)); padding: 0 3px; }
.opp-flags { display: flex; gap: 3px; flex-wrap: wrap; }
.flag { font-size: 9px; padding: 0 4px; border: 1px solid var(--line-soft); color: var(--ink-mid); }
.flag.bad { color: var(--red); border-color: var(--red-soft-line); }
.flag.persona { color: var(--gold); border-color: rgba(184, 137, 58, 0.45); }
.flag.dim { opacity: 0.55; }
.opp-host {
  margin-top: 5px;
  padding: 2px 7px;
  font-size: 9px;
  letter-spacing: 0.06em;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-mid);
}
.opp-host:hover { border-color: var(--red); color: var(--red); }
.opp-host.on {
  border: 1px solid var(--red);
  background: var(--red-soft-bg);
  color: var(--red);
}
.opp-host.locked {
  border-style: solid;
  border-color: rgba(178, 58, 46, 0.3);
  color: var(--red);
  opacity: 0.7;
}
.opp-cash {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  min-width: 52px;
  align-self: stretch;
}
.opp-cash label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-mid);
}
.opp-cash span {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.opp-cash em {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--ink-mid);
  margin-left: 2px;
}

/* ---------- 行动栏 / 进度 / 底栏 ---------- */
.actionbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 18px;
  border-top: 1px solid var(--line-soft);
  background: rgba(237, 227, 200, 0.9);
}
.act-free { font-size: 10px; letter-spacing: 0.14em; color: var(--ink-soft); white-space: nowrap; }
.act-free b { font-family: var(--serif); font-size: 18px; color: var(--red); }
.act-grid { display: flex; gap: 7px; flex-wrap: wrap; }
.act {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
  padding: 7px 13px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  transition: background .15s, border-color .15s, color .15s;
}
.act:hover:not(:disabled) { background: var(--paper-3); border-color: var(--ink); }
.act:disabled { opacity: 0.45; cursor: not-allowed; background: var(--paper-3); border-color: var(--line-soft); }

.phasebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 18px 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-mid);
  background: rgba(237, 227, 200, 0.9);
}
.ph { padding: 2px 8px; border-bottom: 2px solid transparent; }
.ph.on { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }
.ph.done { color: var(--ink-faint); text-decoration: line-through; }
.ph-arrow { opacity: 0.3; }

.dock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 18px;
  border-top: 1px solid var(--line-soft);
  background: rgba(226, 213, 180, 0.75);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(26, 22, 25, 0.6);
}
.deck { cursor: pointer; }
.deck:hover { color: var(--red); }
.deck:hover b { color: var(--red); }
.deck b { font-family: var(--serif); font-size: 13px; color: var(--ink); }
.dock-btn {
  margin-left: auto;
  border: 0; background: transparent;
  font-size: 10px; letter-spacing: 0.14em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink-soft);
  padding: 0;
  line-height: 1;
  transition: color .16s, border-color .16s;
}
.dock-btn:first-of-type { margin-left: auto; }
.dock-btn + .dock-btn { margin-left: 10px; }
.dock-btn:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- 回合叫名 ---------- */
.turn-call {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .24s ease;
}
.turn-call.on { opacity: 1; }
.turn-call.off { opacity: 0; }
.turn-call .tc-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 44px;
  background: rgba(251, 246, 236, 0.94);
  border: 2px solid var(--ink);
  box-shadow: 0 20px 50px var(--ink-faint);
  text-align: center;
}
.turn-call .tc-sub {
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--red);
  font-weight: 600;
}
.turn-call .tc-name {
  font-family: var(--serif);
  font-size: clamp(36px, 5.2vh, 64px);
  line-height: 1.05;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-shadow: 1px 2px 0 rgba(178, 58, 46, 0.18);
}
.turn-call .tc-role {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: rgba(26, 22, 25, 0.6);
}
.turn-call .tc-badge {
  font-size: 10px;
  letter-spacing: 0.16em;
  padding: 2px 10px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  margin-top: 2px;
}
.turn-call .tc-wrap.host {
  border-style: double;
  border-width: 4px;
  border-color: var(--red);
  background: rgba(251, 246, 236, 0.97);
}
.turn-call .tc-wrap.host .tc-sub { letter-spacing: 0.3em; }
.turn-call .tc-wrap.host .tc-badge { border-color: var(--red-soft-line); color: var(--red); }

/* ---------- 本地组队 · 热座交接屏幕 ---------- */
.handoff-stage {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(26, 22, 25, 0.82), rgba(20, 16, 12, 0.94));
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s ease;
}
.handoff-stage.on { opacity: 1; }
.handoff-stage.off { opacity: 0; }
.handoff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 56px 26px;
  background: rgba(251, 246, 236, 0.97);
  border: 3px double var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 86vw;
}
.handoff-sub {
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--red);
  font-weight: 600;
}
.handoff-title {
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
  margin-top: 4px;
}
.handoff-name {
  font-family: var(--serif);
  font-size: clamp(40px, 6vh, 72px);
  line-height: 1.05;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-shadow: 1px 2px 0 rgba(178, 58, 46, 0.18);
  margin: 2px 0;
}
.handoff-role {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: rgba(26, 22, 25, 0.6);
}
.handoff-go {
  margin-top: 14px;
  font-size: 15px;
  letter-spacing: 0.12em;
  padding: 10px 28px;
}
.handoff-tip {
  margin: 6px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
}

/* ---------- 弹层 ---------- */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(26, 22, 25, 0.58);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}
.modal-wrap.card-played { z-index: 180; background: rgba(26, 22, 25, 0.72); backdrop-filter: blur(5px); }
.modal-wrap.card-played.spectator { pointer-events: none; }
.modal-wrap.card-played.on { animation: cpIn .45s cubic-bezier(.18, .86, .24, 1.04) both; }

@keyframes cpIn {
  from { opacity: 0; background: rgba(26, 22, 25, 0); backdrop-filter: blur(0); }
  to { opacity: 1; background: rgba(26, 22, 25, 0.72); backdrop-filter: blur(5px); }
}

/* 打牌弹层 */
.cp-modal.wide { width: min(94vw, 620px); max-height: 92vh; }
.cp-modal h3 {
  font-family: var(--serif);
  font-size: 32px;
  letter-spacing: .18em;
  text-align: center;
  margin: 6px 0 14px;
  color: var(--ink);
}
.cp-flash {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  animation: cpFlash 1.8s .1s ease both;
}
@keyframes cpFlash {
  0% { opacity: 0; transform: translateX(-40%); }
  20% { opacity: 1; transform: translateX(0); }
  80% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(40%); }
}

.cp-stage {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
  perspective: 900px;
}
.cp-card3d {
  position: relative;
  width: 190px;
  height: 270px;
  transform-style: preserve-3d;
  animation: cpCardRise 1.4s cubic-bezier(.19, .86, .24, 1.04) both;
}
.cp-card3d.flip { animation: cpCardFlip 1.15s cubic-bezier(.34, 1.56, .64, 1) forwards; }

@keyframes cpCardRise {
  0% { transform: translateY(50px) rotateX(26deg) scale(.85); opacity: 0; }
  100% { transform: translateY(0) rotateX(0) scale(1); opacity: 1; }
}
@keyframes cpCardFlip {
  0% { transform: rotateY(0deg) scale(1); }
  60% { transform: rotateY(190deg) scale(1.06); }
  100% { transform: rotateY(360deg) scale(1); }
}

.cp-face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: 0 10px 30px rgba(30, 10, 5, .38), inset 0 0 0 3px var(--paper-2), inset 0 0 0 5px var(--ink);
  background: var(--paper-2);
}
.cp-face.back {
  transform: rotateY(180deg);
  background:
    repeating-linear-gradient(45deg, rgba(178, 58, 46, .28) 0 8px, transparent 8px 16px),
    linear-gradient(145deg, var(--red) 0%, var(--red-2) 100%);
}
.cp-pat {
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(240, 207, 160, .65);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 44px;
  color: rgba(240, 207, 160, .85);
  letter-spacing: .3em;
}
.cp-pat::before { content: '交'; }
.cp-face.front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cp-body {
  margin-top: 8px;
}
.cp-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.cp-row span {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: .16em;
  color: rgba(26, 22, 25, .55);
  text-transform: uppercase;
  padding-top: 1px;
}
.cp-row em {
  font-style: normal;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
}
.cp-row.effect { border-bottom: none; margin-top: 12px; }
.cp-row.effect span { color: var(--red); font-weight: 700; }
.cp-effect {
  margin: 8px 0 4px;
  padding: 14px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 60%),
    var(--paper-3);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: .02em;
  color: var(--ink);
  border-radius: 0 4px 4px 0;
}
.cp-effect::first-letter {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--red);
  float: left;
  line-height: 1;
  margin: 0 5px 0 0;
}

/* 旁观者模式：无关闭按钮，提示等待 */
.card-played.spectator .cp-modal { border-color: var(--line-soft); }
.cp-watch {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--gold), #d4a84b);
  color: #fff;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: .18em;
  box-shadow: 0 4px 14px rgba(184, 137, 58, .4);
  z-index: 2;
}
.cp-wait-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  color: rgba(26, 22, 25, .55);
  font-size: 12px;
  letter-spacing: .1em;
}
.cp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: cpBlink 1.2s ease-in-out infinite;
}
@keyframes cpBlink {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ---------- 弹层 ---------- */
/* B14 弹窗框三态：确认（深墨顶带）/警示（朱红顶带）/获得（金黄顶带） */
.modal {
  position: relative;
  width: min(94vw, 460px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: none;
  padding: 28px 26px 20px;
  animation: rise .24s cubic-bezier(.2, .8, .3, 1);
}
/* 顶边色带：默认深墨，警示用朱红，获得用金黄 */
.modal::before {
  content: '';
  position: absolute; left: -1px; right: -1px; top: -1px;
  height: 6px;
  background: var(--ink);
  border-radius: var(--r) var(--r) 0 0;
}
.modal[data-kind="warn"]::before { background: var(--red); }
.modal[data-kind="gain"]::before { background: var(--gold); }
.modal[data-kind="deep"] { background: var(--ink); color: var(--paper-2); border-color: var(--line-hi); }
.modal[data-kind="deep"] h3 { color: var(--paper-2); }
.modal[data-kind="deep"]::before { background: var(--gold); }

.modal.wide { width: min(96vw, 760px); }
.modal-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.modal-x:hover {
  color: var(--paper-2);
  background: var(--red);
  border-color: var(--red-deep);
}
.modal h3 { font-size: 22px; letter-spacing: 0.05em; line-height: 1.25; padding-right: 26px; }
.modal-sub { font-size: 11px; color: var(--ink-soft); margin: 6px 0 14px; line-height: 1.65; }
.modal-body { font-size: 12px; line-height: 1.7; }
.modal-body > p { margin: 0 0 10px; }
.modal-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.modal-acts .btn { flex: 1 1 140px; font-size: 12px; padding: 9px 12px; }

/* 格子详情：左图右信息 */
.tile-detail {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.td-figure { position: relative; }
.td-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-3);
}
.td-num {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--paper-2);
  background: rgba(26, 22, 25, 0.72);
  padding: 0 8px;
}
.td-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.td-tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--c, var(--line));
  color: var(--ink-2);
}
.td-sec { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.td-sec h4 {
  margin: 0 0 7px;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--ink-mid);
}
.td-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; }
.td-item label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(26, 22, 25, 0.48);
}
.td-item b {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.td-text { margin: 0; font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }

/* 玩家资料卡 */
.self-avatar[data-act], .opp-avatar[data-act] { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.self-avatar[data-act]:hover, .opp-avatar[data-act]:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(184, 137, 58, 0.2);
}
.pf-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.pf-avatar {
  width: 92px;
  height: 116px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: top;
  background: var(--paper-3);
  border: 1px solid var(--line);
}
.pf-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.pf-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--serif); font-size: 22px; font-weight: 700; }
.pf-role { font-size: 11px; color: var(--ink-2); }
.pf-skill { font-size: 10px; line-height: 1.65; color: var(--ink-soft); }
.pf-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.pf-stat {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  background: rgba(251, 246, 236, 0.55);
}
.pf-stat label { display: block; margin-bottom: 3px; font-size: 9px; letter-spacing: 0.14em; color: var(--ink-mid); }
.pf-stat b { font-family: var(--serif); font-size: 18px; }
.pf-stat b em { margin-left: 2px; font-size: 10px; font-style: normal; color: var(--ink-mid); }
.pf-sec { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 9px; }
.pf-sec h4 {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--ink-mid);
}
.pf-land {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.pf-land:last-child { border-bottom: 0; }
.pf-land > img {
  width: 64px;
  height: 40px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line-soft);
}
.pf-land-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-land-info b { font-family: var(--serif); font-size: 13px; }
.pf-land-info span { font-size: 10px; color: var(--ink-soft); }
.pf-land-info span i { font-style: normal; color: var(--c, var(--ink)); }
.pf-land em { font-family: var(--serif); font-style: normal; font-size: 14px; color: var(--gold); white-space: nowrap; }
.pf-empty { margin: 4px 0; font-size: 11px; color: var(--ink-mid); }
.pf-cards { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.pf-cardback {
  width: 28px;
  height: 38px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, rgba(26, 22, 25, 0.1) 0 3px, transparent 3px 6px),
    var(--paper-3);
}
.pf-note { margin: 6px 0 0; font-size: 11px; line-height: 1.7; color: rgba(26, 22, 25, 0.6); }
@media (max-width: 900px) {
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-avatar { width: 72px; height: 92px; }
}

/* 牌堆卡表：缩略图网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.card-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  background: rgba(251, 246, 236, 0.6);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card-tile:hover { border-color: var(--red); transform: translateY(-2px); }
.card-tile img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--paper-3);
}
.card-tile span {
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 单张卡牌详情 */
.card-detail { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.card-detail img {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-3);
}

/* 落地结算的场地缩略图 */
.buy-figure {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}
.buy-figure img {
  display: block;
  max-width: 100%;
  max-height: 120px;
  width: auto;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  box-shadow: 0 6px 16px rgba(26, 22, 25, 0.16);
}

.row-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .14s;
}
.row-line:hover { background: rgba(184, 137, 58, 0.08); }
.row-line span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-line span em { font-size: 10px; color: var(--ink-mid); line-height: 1.5; }
.row-line b { font-family: var(--serif); font-size: 14px; color: var(--ink); white-space: nowrap; }

/* ---------- 组队邀请链接框 ---------- */
.share-link-box {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px;
}
.share-link {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 2px;
  word-break: break-all;
}
.share-link:focus { outline: 2px solid var(--red); outline-offset: -1px; }
/* 联机等待页二维码区 */
.online-qr {
  margin-top: 14px;
  padding: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.online-qr img {
  width: 180px; height: 180px;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.online-qr::after {
  content: '手机扫一扫 · 自动加入房间';
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.share-seats { margin-top: 6px; }
.share-seats h5 {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  margin: 0 0 6px;
}

/* 交易结果判定 */
.trade-verdict {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.14em;
  padding: 12px 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.trade-verdict.ok { color: var(--green); }
.trade-verdict.no { color: var(--red); }
.row-line.on { background: rgba(178, 58, 46, 0.08); }
.row-line.on b { color: var(--red); }
.row-line s { opacity: 0.45; font-size: 11px; }

.panel-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-hero > img {
  width: 190px;
  height: 130px;
  object-fit: cover;
  background: var(--paper-3);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.ph-info { flex: 1; min-width: 0; }
.ph-text { font-size: 12px; line-height: 1.75; margin: 6px 0 4px; }
.panel-stat { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 0 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }
.panel-stat span { font-size: 10px; letter-spacing: 0.18em; color: var(--ink-mid); }
.panel-stat b { font-family: var(--serif); font-size: 20px; }
.loan-list, .deed-list, .goods-list { margin: 4px 0 10px; }

.goods-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.9fr;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.goods-row.out { opacity: 0.4; }
.g-name { display: flex; flex-direction: column; font-size: 13px; font-family: var(--serif); }
.g-name em { font-size: 9px; color: var(--ink-mid); font-family: var(--sans); }
.g-price { font-family: var(--serif); font-size: 15px; text-align: right; }
.g-value { font-size: 10px; color: var(--ink-mid); text-align: right; }

.hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  margin: 4px 0 8px;
}
.hand-card {
  border: 1px solid var(--line-soft);
  background: rgba(237, 227, 200, 0.5);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hand-card.dim { opacity: 0.42; }
.hand-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--paper-3); }
.hand-card b { font-family: var(--serif); font-size: 13px; }
.hand-card em { font-size: 9px; color: var(--red); letter-spacing: 0.06em; }
.hand-card span { font-size: 10px; color: rgba(26, 22, 25, 0.6); line-height: 1.55; }

.case-wrap { display: flex; align-items: center; gap: 18px; padding: 12px 0 4px; }
.case-die {
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.case-die.bad { color: var(--paper-2); background: var(--red); border-color: var(--red-2); }
.case-die.good { color: var(--paper-2); background: var(--green); border-color: #5d6b2c; }
.case-meta { display: flex; flex-direction: column; gap: 6px; font-size: 11px; }
.case-meta span { color: var(--ink-mid); letter-spacing: 0.1em; }
.case-meta b { font-family: var(--serif); font-size: 15px; }

.pick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 10px 0 4px; }
.pk {
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--line-soft);
  background: rgba(237, 227, 200, 0.5);
  padding: 5px 3px;
  text-align: left;
  min-width: 0;
}
.pk:hover { border-color: var(--red); background: rgba(178, 58, 46, 0.08); }
.pk b { font-family: var(--serif); font-size: 11px; }
.pk span { font-size: 8px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 竞拍 ---------- */
.auction-wrap {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 125;
  background: rgba(26, 22, 25, 0.94);
  color: var(--paper-2);
  padding: 12px 18px 14px;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.35);
  animation: slideUp .26s ease;
}
.auction-bar { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 18px; align-items: center; }
.au-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.au-left img { width: 54px; height: 54px; object-fit: cover; border: 1px solid rgba(251, 246, 236, 0.3); }
.au-left b { font-family: var(--serif); font-size: 16px; display: block; }
.au-left span { font-size: 10px; color: rgba(251, 246, 236, 0.55); }
.au-mid { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px; }
.au-price { font-size: 11px; color: rgba(251, 246, 236, 0.6); }
.au-price b { font-family: var(--serif); font-size: 26px; color: var(--gold); margin: 0 3px; }
.au-who { font-size: 11px; color: rgba(251, 246, 236, 0.7); }
.au-count { grid-column: 1 / -1; height: 3px; background: rgba(251, 246, 236, 0.2); }
.au-count i { display: block; height: 100%; background: var(--gold); transition: width 1s linear; }
.au-secs { grid-column: 1 / -1; font-size: 9px; letter-spacing: 0.2em; color: rgba(251, 246, 236, 0.45); text-align: right; }
.au-bids { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.au-bid {
  flex: 1 1 130px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(251, 246, 236, 0.25);
  background: transparent;
  color: var(--paper-2);
  padding: 6px 9px;
}
.au-bid:hover:not(:disabled) { border-color: var(--gold); background: rgba(184, 137, 58, 0.14); }
.au-bid:disabled { opacity: 0.35; }
.au-bid img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: top; }
.au-bid span { font-size: 11px; }
.au-bid em { margin-left: auto; font-size: 10px; color: var(--gold); }
.au-note { font-size: 10px; color: rgba(251, 246, 236, 0.45); margin: 8px 0 0; }

/* ---------- 飘字 / 骰子 / 卡牌闪现 ---------- */
#toast-root {
  position: fixed;
  top: 14px; right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: 320px;
}
.toast {
  background: var(--paper-2);
  border-left: 3px solid var(--ink);
  padding: 9px 13px;
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  animation: toastIn .22s ease;
}
.toast.out { opacity: 0; transform: translateX(12px); transition: all .5s; }
.toast.gain { border-left-color: var(--green); }
.toast.pay { border-left-color: var(--red); }
.toast.bad { border-left-color: var(--red); color: var(--red-2); }
.toast.great { border-left-color: var(--gold); }
.toast.turn { border-left-color: var(--blue); }
.toast.policy { border-left-color: var(--gold); }
.toast.card { border-left-color: var(--plum); }
.toast.tile { border-left-color: var(--ink-2); }

/* 掷骰：伪 3D + 赛璐璐平涂的骰子 */
.dice-stage {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  gap: 28px;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.dice-stage.on { opacity: 1; }
.dice-stage.out { opacity: 0; transition: opacity 0.3s ease; }
.dice-board {
  position: relative;
  width: 156px;
  height: 156px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 860px;
}
.dice-shadow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 122px;
  height: 28px;
  margin-left: -61px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--ink-mid), rgba(26, 22, 25, 0) 72%);
  transform: scale(0.55);
  transition: transform 1s ease;
}
.dice-stage.settled .dice-shadow { transform: scale(1); }
.dice-cube {
  position: relative;
  width: 96px;
  height: 96px;
  transform-style: preserve-3d;
  will-change: transform;
}
.dice-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 9px;
  border: 2px solid rgba(26, 22, 25, 0.78);
  border-radius: 10px;
  box-shadow:
    inset 0 0 16px rgba(26, 22, 25, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.55);
}
.f-front { background: #F3E7C6; transform: translateZ(48px); }
.f-back { background: #E4D4AC; transform: rotateY(180deg) translateZ(48px); }
.f-right { background: #D6C398; transform: rotateY(90deg) translateZ(48px); }
.f-left { background: #E1D0A6; transform: rotateY(-90deg) translateZ(48px); }
.f-top { background: #FBF2DA; transform: rotateX(90deg) translateZ(48px); }
.f-bottom { background: #C9B78E; transform: rotateX(-90deg) translateZ(48px); }
.pip {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  align-self: center;
  justify-self: center;
  background: radial-gradient(circle at 35% 30%, #C6493B, #982C20 72%);
  border: 1.5px solid rgba(26, 22, 25, 0.85);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.35);
}
.dice-result {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 6px 20px;
  box-shadow: 0 10px 26px rgba(26, 22, 25, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.dice-result b { font-size: 24px; color: var(--red); margin: 0 4px; }
.dice-stage.settled .dice-result { opacity: 1; transform: translateY(0); }

.cardflash {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 22, 25, 0.34);
  backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
  cursor: pointer;
}
.cardflash.out { opacity: 0; transition: opacity .25s; }
.cf-inner {
  width: min(86vw, 300px);
  background: var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.3);
  padding: 10px;
  animation: rise .28s cubic-bezier(.2, .8, .3, 1);
}
.cf-inner img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--paper-3); }
.cf-tag { font-size: 9px; letter-spacing: 0.22em; color: var(--red); margin-bottom: 6px; }
.cf-inner h4 { font-size: 19px; margin: 9px 0 4px; }
.cf-inner p { margin: 0; font-size: 11px; line-height: 1.65; color: rgba(26, 22, 25, 0.65); }
.cf-hint { margin-top: 8px; font-size: 9px; color: var(--ink-mid); text-align: right; letter-spacing: 0.14em; }

/* ---------- 结算 ---------- */
.settle-wrap { background: rgba(26, 22, 25, 0.72); animation: settleFade .8s ease; }
.settle-wrap .settlement { width: min(96vw, 880px); animation: settleIn .8s cubic-bezier(.2, .8, .3, 1); }
.settlement { width: min(96vw, 880px); }
.settlement > :not(.settle-fx) { position: relative; z-index: 1; }
.settle-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.settle-scrap {
  position: absolute; top: -30px;
  width: var(--w, 10px); height: var(--h, 14px);
  background: rgba(26, 22, 25, 0.09);
  border-left: 2px solid rgba(178, 58, 46, 0.2);
  opacity: 0;
  animation: settleScrap 4.2s linear var(--delay, 0s) both;
}
.settle-crown {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 48px;
  margin: 2px 0 0;
}
.settle-burst {
  position: absolute; left: 50%; top: 50%;
  width: min(300px, 60vw); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 137, 58, 0.55) 0%, rgba(178, 58, 46, 0.22) 38%, rgba(178, 58, 46, 0) 70%);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%);
  animation: settleBurst 3.4s var(--sd, 0s) ease-out both;
}
.settle-crown h3 {
  position: relative; z-index: 2;
  margin: 0; padding: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vh, 44px);
  line-height: 1.1;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: settleCrown 2.05s cubic-bezier(.2, .8, .3, 1) var(--cd, 0s) both;
}
.settle-seal {
  position: relative;
  z-index: 2;
  flex: none;
  width: clamp(40px, 5.6vh, 56px);
  height: clamp(40px, 5.6vh, 56px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: clamp(20px, 3vh, 30px);
  font-style: normal;
  color: var(--paper-2);
  background: var(--red);
  border: 3px double var(--red-2);
  box-shadow: 0 4px 14px var(--red-soft-line);
  opacity: 0;
  animation: settleSeal 1.65s cubic-bezier(.34, 1.56, .64, 1) var(--sd, 0s) both;
}
.settle-seal::before {
  content: '';
  position: absolute; inset: -10px;
  border: 2px solid rgba(178, 58, 46, 0.45);
  border-radius: 50%;
  opacity: 0;
  animation: settleSealRing 1.75s var(--sd, 0s) ease-out both;
}
.settle-verdict {
  display: inline-block;
  margin: 2px 0 6px;
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  border: 1px solid var(--line);
  opacity: 0;
  animation: settleVerdict .7s cubic-bezier(.2, .8, .3, 1) var(--vd, 0s) both;
}
.settle-verdict.win {
  color: var(--paper-2);
  background: var(--red);
  border-color: var(--red-2);
  box-shadow: 0 4px 16px rgba(178, 58, 46, 0.28);
}
.settle-verdict.lose { color: rgba(26, 22, 25, 0.62); background: rgba(26, 22, 25, 0.05); }
.settle-head {
  display: grid;
  grid-template-columns: 36px 1.5fr repeat(4, 1fr) 0.8fr;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-mid);
  padding: 8px 6px;
  border-bottom: 1px solid var(--ink);
}
.settle-list { margin-bottom: 8px; }
.settle-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 36px 1.5fr repeat(4, 1fr) 0.8fr;
  gap: 8px;
  align-items: center;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
  transform: translateY(18px);
  animation: settleRowIn .5s cubic-bezier(.2, .8, .3, 1) var(--d, 0s) both;
}
.settle-row > *:not(.sr-meter) { position: relative; z-index: 1; }
.settle-row.win {
  background: rgba(178, 58, 46, 0.08);
  animation:
    settleRowIn .5s cubic-bezier(.2, .8, .3, 1) var(--d, 0s) both,
    settleWinGlow 2s calc(var(--d, 0s) + 1.1s) ease-in-out 2 both;
}
.sr-meter {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(184, 137, 58, 0.18), rgba(184, 137, 58, 0.02));
  animation: srMeter 1s cubic-bezier(.2, .8, .3, 1) calc(var(--d, 0s) + .1s) both;
}
.settle-row.win .sr-meter {
  background: linear-gradient(90deg, rgba(178, 58, 46, 0.22), rgba(178, 58, 46, 0.03));
}
.sr-rank {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 13px;
  border: 1px solid var(--line);
}
.settle-row.win .sr-rank { background: var(--red); color: var(--paper-2); border-color: var(--red-2); }
.sr-id b { display: block; font-family: var(--serif); font-size: 15px; }
.sr-id span { font-size: 10px; color: var(--ink-soft); }
.sr-num label { display: block; font-size: 8px; letter-spacing: 0.14em; color: var(--ink-mid); }
.sr-num span { font-size: 11px; }
.sr-total { font-family: var(--serif); font-size: 24px; text-align: right; color: var(--red); }
.sr-total small { font-size: 9px; margin-left: 2px; color: var(--ink-mid); }
.sr-count { font-variant-numeric: tabular-nums; }
.settle-row.win .sr-total { animation: settleTotal .4s cubic-bezier(.34, 1.56, .64, 1) var(--sd, 0s) both; }
.settle-wrap .modal-acts { opacity: 0; animation: settleActs .5s cubic-bezier(.2, .8, .3, 1) var(--ad, 0s) both; }

@keyframes settleFade { from { background: rgba(26, 22, 25, 0); } to { background: rgba(26, 22, 25, 0.72); } }
@keyframes settleIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes settleCrown {
  0% { opacity: 0; transform: translateY(24px) scale(1.35); filter: blur(12px); }
  55% { opacity: 1; transform: translateY(0) scale(1.05); filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes settleSeal {
  0% { opacity: 0; transform: rotate(-24deg) scale(2.3); }
  55% { opacity: 1; transform: rotate(-7deg) scale(.9); }
  75% { transform: rotate(-11deg) scale(1.06); }
  100% { opacity: 1; transform: rotate(-9deg) scale(1); }
}
@keyframes settleSealRing {
  0% { opacity: 0.7; transform: scale(.5); }
  100% { opacity: 0; transform: scale(1.7); }
}
@keyframes settleRowIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes settleWinGlow {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: inset 0 0 0 1px rgba(178, 58, 46, 0.45), 0 6px 20px rgba(178, 58, 46, 0.16); }
}
@keyframes srMeter {
  from { width: 0; }
  to { width: var(--pct, 0%); }
}
@keyframes settleTotal {
  0% { transform: scale(.8); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes settleActs {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes settleVerdict {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
  to { opacity: 1; transform: none; }
}
@keyframes settleBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
  15% { opacity: 1; }
  70% { opacity: .55; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.9); }
}
@keyframes settleScrap {
  0% { opacity: 0; transform: translate3d(0, -20px, 0) rotate(var(--rot, 0deg)); }
  12% { opacity: 0.75; }
  85% { opacity: 0.45; }
  100% { opacity: 0; transform: translate3d(var(--dx, 0px), 620px, 0) rotate(calc(var(--rot, 0deg) + 240deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .settle-row, .settle-row.win, .settle-crown h3, .settle-seal, .settle-seal::before,
  .sr-meter, .settle-scrap, .settle-wrap .modal-acts, .settle-verdict {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .settle-burst { display: none !important; }
  .sr-meter { width: var(--pct, 0%) !important; }
  #stamp3d, #coin-pop { display: none !important; }
}

.rule-block { margin-bottom: 13px; padding-left: 12px; border-left: 2px solid rgba(178, 58, 46, 0.3); }
.rule-block h5 { font-size: 12px; letter-spacing: 0.12em; color: var(--red); margin-bottom: 3px; }
.rule-block p { margin: 0; font-size: 11.5px; line-height: 1.75; color: rgba(26, 22, 25, 0.72); }

.log-list { max-height: 52vh; overflow-y: auto; }
.log-row { display: flex; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; line-height: 1.6; }
.lr-r { font-size: 9px; color: var(--ink-mid); min-width: 24px; padding-top: 3px; }
.log-row.great { color: var(--red-2); }
.log-row.bad { color: var(--red-2); }
.log-row.pay { color: rgba(26, 22, 25, 0.75); }
.log-row.gain { color: #5d6b2c; }

.rec-block { margin-bottom: 14px; border: 1px solid var(--line-soft); padding: 8px 10px; }
.rec-head { font-size: 10px; letter-spacing: 0.14em; color: var(--ink-mid); border-bottom: 1px solid var(--line-soft); padding-bottom: 5px; margin-bottom: 3px; }

/* ---------- 声音设置 ---------- */
.vol-block { display: flex; flex-direction: column; gap: 18px; padding: 6px 0 4px; }
.vol-row { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.vol-row:first-child { border-top: 0; padding-top: 4px; }
.vol-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.vol-head span { font-family: var(--serif); font-size: 14px; letter-spacing: 0.1em; }
.vol-head b {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--red-2);
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vol-slider {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  margin: 10px 0 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold) var(--fill, 50%), rgba(26, 22, 25, 0.18) var(--fill, 50%), rgba(26, 22, 25, 0.18) 100%);
  outline: none;
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 0 1px 3px var(--ink-faint);
  transition: transform .12s;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 0 1px 3px var(--ink-faint);
}
.vol-slider::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(26, 22, 25, 0.18); }
.vol-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--gold); }
.vol-row em { display: block; font-size: 10px; font-style: normal; line-height: 1.6; color: rgba(26, 22, 25, 0.52); }

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes shake { 0% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } 100% { transform: rotate(-3deg); } }

/* ---------- 全局效果（3 秒） ---------- */
.fx-stage {
  position: fixed;
  inset: 0;
  z-index: 260;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  --fx: #B8893A;
  animation: fxFadeIn .3s ease both;
}
.fx-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(24, 18, 14, .14) 0%, rgba(24, 18, 14, .5) 56%, rgba(24, 18, 14, .78) 100%);
  animation: fxVeil 2.9s ease both;
}
.fx-stage.out { animation: fxOut .56s ease forwards; }

.fx-copy {
  position: relative;
  z-index: 3;
  max-width: 76vw;
  padding: 26px 60px;
  text-align: center;
  color: #F8F1DE;
  border-top: 1px solid var(--fx);
  border-bottom: 1px solid var(--fx);
  background: linear-gradient(90deg, rgba(24, 18, 14, 0), rgba(24, 18, 14, .74) 16%, rgba(24, 18, 14, .74) 84%, rgba(24, 18, 14, 0));
  animation: fxCopy 2.9s cubic-bezier(.16, .9, .3, 1) both;
}
.fx-kicker {
  font-size: 12px;
  letter-spacing: .44em;
  padding-left: .44em;
  color: var(--fx);
}
.fx-title {
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(36px, 5.4vw, 82px);
  line-height: 1.2;
  letter-spacing: .18em;
  padding-left: .18em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .6), 0 0 30px var(--fx);
}
.fx-sub {
  margin-top: 10px;
  font-size: 15px;
  letter-spacing: .12em;
  color: rgba(248, 241, 222, .86);
}
.fx-foot {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: .32em;
  color: rgba(248, 241, 222, .42);
}

/* 撒金币 / 征收 */
.fx-coin {
  position: absolute;
  top: -12vh;
  width: var(--s, 20px);
  height: var(--s, 20px);
  border-radius: 50%;
  border: 2px solid rgba(255, 245, 205, .72);
  background: radial-gradient(circle at 32% 28%, #FFEFB8, #DCAE4C 46%, #A16E22 100%);
  box-shadow: inset -3px -4px 6px rgba(92, 58, 12, .55), 0 0 16px rgba(220, 174, 76, .6);
  animation: fxCoinFall var(--t, 2.2s) cubic-bezier(.4, .05, .7, .65) var(--delay, 0s) both;
}
.fx-coin::after {
  content: '';
  position: absolute;
  left: 40%;
  top: 40%;
  width: 20%;
  height: 20%;
  background: rgba(92, 58, 12, .55);
}
.fx-tax .fx-coin {
  top: 48%;
  animation-name: fxCoinTake;
  animation-duration: 2.4s;
}

/* 官印 */
.fx-seal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 38vmin;
  height: 38vmin;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 21vmin;
  line-height: 1;
  color: #FBE7D2;
  background: radial-gradient(circle at 40% 34%, rgba(178, 58, 46, .95), rgba(120, 28, 22, .95));
  border: 5px solid rgba(251, 231, 210, .55);
  border-radius: 4px;
  box-shadow: 0 0 70px rgba(178, 58, 46, .55), inset 0 0 50px rgba(0, 0, 0, .4);
  animation: fxSeal 2.9s cubic-bezier(.18, 1.3, .32, 1) both;
}
.fx-ink {
  position: absolute;
  width: var(--s, 20px);
  height: var(--s, 20px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(142, 42, 33, .95) 0%, rgba(142, 42, 33, .4) 55%, rgba(142, 42, 33, 0) 72%);
  transform: translate(-50%, -50%);
  animation: fxInk 1.8s ease-out var(--delay, 0s) both;
}

/* 文书飘落 */
.fx-slip {
  position: absolute;
  top: -18vh;
  width: 42px;
  height: 92px;
  border: 1px solid rgba(26, 22, 25, .32);
  background: linear-gradient(180deg, #F8F0DC, #DECBA4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .22);
  transform-origin: 50% 0;
  animation: fxSlip 2.75s cubic-bezier(.42, .02, .68, .6) var(--delay, 0s) both;
}
.fx-slip::after {
  content: '';
  position: absolute;
  inset: 14px 9px;
  border-top: 1px solid rgba(26, 22, 25, .16);
  border-bottom: 1px solid rgba(26, 22, 25, .16);
}

/* 贬值冲击 */
.fx-shock {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18vmin;
  height: 18vmin;
  margin: -9vmin 0 0 -9vmin;
  border: 3px solid rgba(178, 58, 46, .9);
  border-radius: 50%;
  animation: fxShock 1.15s cubic-bezier(.14, .72, .32, 1) both;
}
.fx-shard {
  position: absolute;
  top: -10vh;
  width: 3px;
  height: 16vh;
  background: linear-gradient(180deg, rgba(178, 58, 46, 0), rgba(178, 58, 46, .9) 45%, rgba(120, 28, 22, .55));
  animation: fxShard 2.4s cubic-bezier(.4, .05, .7, .65) var(--delay, 0s) both;
}

@keyframes fxFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fxOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fxVeil {
  0% { opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fxCopy {
  0% { opacity: 0; transform: translateY(26px) scale(.94); }
  12% { opacity: 1; transform: none; }
  78% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px) scale(1.02); }
}
@keyframes fxCoinFall {
  0% { transform: translate(0, -10vh) rotate(0deg) scale(.8); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(var(--dx), 124vh) rotate(var(--spin)) scale(1); opacity: .95; }
}
@keyframes fxCoinTake {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; }
  14% { opacity: 1; }
  100% { transform: translate(var(--dx), -56vh) scale(1.15) rotate(var(--spin)); opacity: 0; }
}
@keyframes fxSeal {
  0% { transform: rotate(-22deg) scale(2.6); opacity: 0; }
  18% { opacity: .55; }
  34% { transform: rotate(-8deg) scale(1); opacity: .55; }
  82% { transform: rotate(-8deg) scale(1.02); opacity: .55; }
  100% { transform: rotate(-8deg) scale(1.08); opacity: 0; }
}
@keyframes fxInk {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.15); }
  24% { opacity: .85; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.4); }
}
@keyframes fxSlip {
  0% { transform: translate(0, -4vh) rotate(var(--rot)); opacity: 0; }
  14% { opacity: .9; }
  100% { transform: translate(var(--dx), 118vh) rotate(calc(var(--rot) + 170deg)); opacity: .85; }
}
@keyframes fxShock {
  0% { transform: scale(.25); opacity: .95; }
  70% { opacity: .4; }
  100% { transform: scale(9.5); opacity: 0; }
}
@keyframes fxShard {
  0% { transform: translate(0, -8vh) rotate(var(--rot)); opacity: 0; }
  14% { opacity: .85; }
  100% { transform: translate(var(--dx), 120vh) rotate(calc(var(--rot) + 60deg)); opacity: .6; }
}

/* ---------- 3D 落章 ---------- */
.stamp3d {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  perspective: 700px;
  animation: fadeIn .18s both;
}
.stamp3d.out { animation: fxOut .42s ease both; }
.st3d-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
}
.st3d-seal {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 54px;
  color: #F6DEB4;
  background:
    linear-gradient(145deg, #D14C36 0%, #A53226 42%, #7C1F18 72%, #5A140F 100%);
  border: 3px solid #F0CFA0;
  box-shadow:
    0 12px 0 #4E120C,
    0 20px 34px rgba(30, 10, 5, .5),
    inset 0 0 24px rgba(255, 222, 164, .42),
    inset 0 -10px 18px rgba(60, 10, 6, .55);
  text-shadow: 0 2px 0 #4A100B, 0 1px 0 rgba(255, 230, 180, .5);
  transform-origin: 50% 85%;
  animation: stampSlam3D 1.86s cubic-bezier(.19, .86, .24, 1.04) both;
}
.st3d-shadow {
  position: absolute;
  left: 50%;
  top: 108px;
  width: 120px;
  height: 26px;
  margin-left: -60px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(60, 22, 12, .45), rgba(60, 22, 12, 0) 70%);
  animation: stampShadow3D 1.86s cubic-bezier(.19, .86, .24, 1.04) both;
}
.st3d-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  border: 3px solid rgba(178, 58, 46, .7);
  border-radius: 50%;
  opacity: 0;
  animation: stampRing3D 1.8s .42s cubic-bezier(.15, .7, .3, 1) both;
}
.st3d-ring.r2 { animation-delay: .56s; border-color: rgba(184, 137, 58, .65); }
.st3d-sub {
  margin-top: 30px;
  padding: 5px 16px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--paper-2);
  background: rgba(26, 22, 25, .82);
  border: 1px solid rgba(240, 207, 160, .5);
  animation: stampSub3D 1.7s .38s ease both;
}

@keyframes stampSlam3D {
  0% { opacity: 0; transform: translate3d(0, -150px, 160px) rotateX(64deg) rotateZ(-9deg) scale(1.55); }
  18% { opacity: 1; }
  62% { transform: translate3d(0, 4px, 0) rotateX(0deg) rotateZ(0deg) scale(1); }
  74% { transform: translate3d(0, -6px, 8px) rotateX(-6deg) scale(1.03); }
  100% { transform: translate3d(0, 0, 0) rotateX(0) scale(1); }
}
@keyframes stampShadow3D {
  0% { opacity: 0; transform: scale(1.9); }
  18% { opacity: .35; }
  62% { opacity: .7; transform: scale(1); }
  100% { opacity: .55; transform: scale(1); }
}
@keyframes stampRing3D {
  0% { opacity: .85; transform: scale(.45); }
  100% { opacity: 0; transform: scale(2.15); }
}
@keyframes stampSub3D {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 3D 金币 ---------- */
.coin-pop {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  perspective: 620px;
}
.coin-pop.out { animation: fxOut .32s ease both; }
.c3d-wrap { position: relative; width: 0; height: 0; }
.c3d {
  position: absolute;
  left: -14px;
  top: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #6E4A12;
  background:
    radial-gradient(circle at 34% 28%, #FBE9AE 0%, #F0C65E 28%, #C9932F 58%, #9A6A1E 82%, #6E4A12 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 246, 208, .45),
    inset 0 -3px 4px rgba(90, 58, 12, .4),
    0 3px 5px rgba(40, 24, 6, .3);
  transform-style: preserve-3d;
  animation: coinToss3D 1.95s cubic-bezier(.2, .72, .28, 1) both;
  animation-delay: calc(var(--i) * .055s);
}
.c3d::after {
  content: '贯';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 11px;
  color: #6E4A12;
  text-shadow: 0 1px 0 rgba(255, 246, 208, .6);
  backface-visibility: hidden;
}
.c3d-amt {
  position: absolute;
  left: 50%;
  top: 44px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--paper-2);
  background: rgba(26, 22, 25, .86);
  border: 1px solid rgba(240, 207, 160, .5);
  padding: 5px 14px;
  animation: coinAmt3D 1.85s ease both;
}
.c3d-amt span { font-size: 11px; letter-spacing: .1em; margin-right: 8px; color: rgba(246, 222, 180, .78); }
.c3d-amt b { color: var(--gold); font-size: 18px; }
@keyframes coinToss3D {
  0% { opacity: 0; transform: translate3d(0, 26px, 0) rotateY(0deg) rotateX(-24deg) scale(.35); }
  16% { opacity: 1; }
  48% { transform: translate3d(var(--dx), var(--dy), 90px) rotateY(540deg) rotateX(22deg) scale(1.06); }
  100% { opacity: 0; transform: translate3d(calc(var(--dx) * 1.15), 34px, 0) rotateY(1080deg) rotateX(0deg) scale(.65); }
}
@keyframes coinAmt3D {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.92); }
  22% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1240px) {
  .stage { grid-template-columns: minmax(0, 1fr) 236px; }
  .tb-motto { display: none; }
  .self-id { min-width: 200px; }
  .self-skill { max-width: 200px; }
}

@media (max-width: 1040px) {
  .stage { grid-template-columns: minmax(0, 1fr) 206px; }
  .tb-stat span { display: none; }
  .self-goods { display: none; }
}

@media (max-width: 900px) {
  #scr-game.active {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    grid-template-rows: auto auto auto auto auto auto;
  }
  .stage { grid-template-columns: 1fr; }
  .opp-col { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .opp-card { min-width: 190px; }
  .board-hold { width: 96vw; }
  .topbar { flex-wrap: wrap; gap: 8px 14px; }
  .tb-left { flex: 1 1 100%; }
  .tb-mid { flex: 1 1 auto; }
  .tb-right { flex: 0 0 auto; }
  .selfarea { flex-wrap: wrap; }
  .self-hand { margin-left: 0; }
  .act-grid { flex-wrap: nowrap; overflow-x: auto; }
  .act { white-space: nowrap; }
  .match-grid { grid-template-columns: 1fr; }
  .match-side { flex-direction: row; flex-wrap: wrap; }
  .side-block { flex: 1 1 220px; }
  #scr-menu.active { flex-direction: column; }
  .menu-side { width: 100%; height: 32vh; border-left: 0; border-top: 1px solid var(--line-soft); }
  .menu-side::after { background: linear-gradient(0deg, var(--paper), transparent 70%); }
  .menu-figure { height: 130%; }
  .menu-wrap { padding: 6vh 7vw 2vh; }
}

@media (max-width: 640px) {
  .page-head, #match-body, #setup-body, .page-foot { padding-left: 5vw; padding-right: 5vw; }
  .setup-grid { grid-template-columns: 1fr; }
  .seat-list { grid-template-columns: 1fr; }
  .cell-name { font-size: 7px; }
  .cell-num { font-size: 7px; }
  .center-title { font-size: 22px; }
  .center-sub { display: none; }
  .center-tables { grid-template-columns: 1fr; }
  .ct-block:first-child { grid-column: 1; }
  .self-cash span { font-size: 22px; }
  .auction-bar { grid-template-columns: 1fr; }
  .settle-head { display: none; }
  .settle-row { grid-template-columns: 30px 1fr auto; }
  .settle-row .sr-num:nth-child(n+3) { display: none; }
  .modal { padding: 18px; }
  .tile-detail { grid-template-columns: 1fr; }
  .card-detail { grid-template-columns: 1fr; }
  .pick-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 中央可用高度过小时不显示图例，避免被裁切 */
@media (max-height: 620px) {
  .fam-legend { display: none; }
}

/* =========================================================
 * 联机房间样式
 * ========================================================= */
.btn-online {
  background: var(--blue);
  border-color: #2A4258;
  color: var(--paper-2);
  text-align: left;
}
.btn-online:hover:not(:disabled) {
  background: #2A4258;
}

/* 联机页面布局 */
#scr-online.active {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px 40px;
  height: 100vh;
  overflow: hidden;
}
.online-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  height: 100%;
  overflow: hidden;
}
.online-side {
  border-left: 1px solid var(--line-soft);
  padding-left: 24px;
  overflow-y: auto;
}
.online-main {
  overflow-y: auto;
  padding-right: 8px;
}

/* 联机玩家列表 */
.online-guests {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.online-guest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.6);
  transition: all .2s ease;
}
.online-guest.me {
  border-color: #8B4513;
  background: rgba(255, 235, 180, 0.7);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
}
.online-guest.empty {
  border-style: dashed;
  background: rgba(200, 200, 200, 0.2);
}
.online-guest-avatar {
  flex-shrink: 0;
}
.online-guest-info {
  flex: 1;
  min-width: 0;
}
.online-guest-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  font-size: 15px;
}
.online-guest-role {
  font-size: 12px;
  color: var(--ink-2);
}

/* 联机标签 */
.tag.online-host {
  background: #8B4513;
  color: #FFF8DC;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}
.tag.online-ready {
  background: #2C7A4B;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.tag.online-wait {
  background: #ccc;
  color: #666;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.tag.online-me {
  background: #D4A017;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}

/* 响应式 */
@media (max-width: 900px) {
  #scr-online.active {
    padding: 16px;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .online-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    height: auto;
  }
  .online-side {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
    padding-left: 0;
    padding-top: 16px;
  }
}

/* ---------- 联保契约：屏幕中央动效页 ---------- */
.modal-wrap.g-fx {
  z-index: 175;
  background: rgba(26, 22, 25, 0.72);
  backdrop-filter: blur(5px);
}
.g-panel {
  position: relative;
  width: min(92vw, 520px);
  padding: 30px 30px 24px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 34%),
    var(--paper-2);
  border: 1px solid var(--ink);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  animation: gRise 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.06) both;
}
.g-panel::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(26, 22, 25, 0.2);
  pointer-events: none;
}
.g-panel h3 {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0.2em;
  margin: 8px 0 22px;
  color: var(--ink);
  animation: gFade 0.4s 0.12s both;
}
.g-watch {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-mid);
}
.g-duo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 20px;
}
.g-side {
  flex: 1;
  max-width: 42%;
  padding: 14px 10px 12px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(26, 22, 25, 0.28);
}
.g-side.left { animation: gSlideL 0.46s 0.1s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.g-side.right { animation: gSlideR 0.46s 0.1s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.g-side b {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.1em;
  margin-top: 8px;
  color: var(--ink);
}
.g-side span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-top: 2px;
}
.g-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--paper-2);
  background: var(--red);
  border: 2px solid var(--red-2);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(142, 42, 33, 0.3);
  animation: gStamp 0.5s 0.32s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.g-tie {
  width: 54px;
  flex: 0 0 auto;
  position: relative;
}
.g-tie em {
  display: block;
  font-style: normal;
  font-size: 22px;
  color: var(--gold);
  animation: gPulse 1.3s 0.5s ease-in-out infinite;
}
.g-result {
  display: inline-block;
  padding: 7px 18px;
  font-size: 14px;
  letter-spacing: 0.12em;
  border: 1px solid currentColor;
  animation: gResult 0.42s 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.g-result.ok { color: #2E6B4F; background: rgba(46, 107, 79, 0.08); }
.g-result.no { color: var(--red-2); background: rgba(178, 58, 46, 0.08); }
.g-foot {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(26, 22, 25, 0.62);
  margin: 14px 4px 0;
  animation: gFade 0.4s 0.65s both;
}
.g-acts { margin-top: 16px; animation: gFade 0.4s 0.72s both; }

@keyframes gRise {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes gFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gSlideL {
  from { opacity: 0; transform: translateX(-26px); }
  to { opacity: 1; transform: none; }
}
@keyframes gSlideR {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes gStamp {
  from { opacity: 0; transform: scale(2.4) rotate(-16deg); }
  to { opacity: 1; transform: scale(1) rotate(-6deg); }
}
@keyframes gPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.12); }
}
@keyframes gResult {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 开屏过场 ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-columns: minmax(300px, 38%) 1fr;
  background: var(--ink);
  color: var(--paper-2);
  transition: opacity .55s ease, visibility .55s;
}
.splash.out { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(30px, 5vw, 78px);
  border-right: 2px solid var(--gold);
  overflow: hidden;
}
.splash-fams {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  display: flex;
  flex-direction: column;
}
.splash-fams i { flex: 1; display: block; }

.splash-kicker {
  font-size: 11px;
  letter-spacing: .5em;
  color: var(--gold);
  margin-bottom: 24px;
  animation: splashUp .7s .1s both;
}
.splash-title {
  font-family: var(--serif);
  font-size: clamp(54px, 6.4vw, 104px);
  line-height: 1;
  letter-spacing: .16em;
  margin: 0 0 20px;
  animation: splashUp .8s .2s both;
}
.splash-sub {
  font-family: var(--serif);
  font-size: clamp(12px, 1.1vw, 15px);
  letter-spacing: .26em;
  color: rgba(251, 246, 236, .62);
  margin: 0 0 46px;
  animation: splashUp .8s .32s both;
}
.splash-go {
  align-self: flex-start;
  min-width: 168px;
  padding: 15px 30px;
  font-size: 14px;
  letter-spacing: .3em;
  animation: splashUp .8s .44s both;
}
.splash-foot {
  position: absolute;
  left: clamp(30px, 5vw, 78px);
  bottom: 34px;
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(251, 246, 236, .34);
  animation: splashUp .8s .56s both;
}

.splash-figure {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashFade 1s both;
}
.splash-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.06) translateY(-1.5%);
}
.splash-figure::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(184, 137, 58, .55);
  pointer-events: none;
}
.splash-hint {
  position: absolute;
  right: 34px;
  bottom: 34px;
  font-size: 10px;
  letter-spacing: .24em;
  color: rgba(26, 22, 25, .42);
}

@keyframes splashUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes splashFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 900px) {
  .splash { grid-template-columns: 1fr; grid-template-rows: 1fr 44vh; }
  .splash-panel { border-right: 0; border-bottom: 2px solid var(--gold); padding: 0 30px; }
  .splash-figure { order: 2; }
  .splash-title { font-size: clamp(48px, 13vw, 76px); }
  .splash-foot { position: static; margin-top: 40px; }
}

/* =========================================================
 * 电脑端排版（≥1280px）
 * 依据《交子界-电脑端页面排版方案》
 * 小于 1280 仍走原手机布局，功能与结构完全不变
 * ========================================================= */
@media (min-width: 1280px) {
  /* --- 画布：最大 1440，居中，两侧留白 --- */
  .screen { width: 100%; max-width: 1440px; margin: 0 auto; }

  /* --- 非游戏页：页头 72 / 页脚 80 / 左右 40 外边距 --- */
  .page-head {
    min-height: 72px;
    padding: 14px 40px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--line-soft);
  }
  .page-head h2 { font-size: 28px; margin: 0 0 4px; }
  .page-head .lead { font-size: 12px; max-width: 760px; }
  #match-body, #setup-body, #online-body { padding: 24px 40px; }
  .page-foot { height: 80px; padding: 0 40px; }

  /* --- 对局页：顶栏 56 / 左列 288 / 棋盘 / 右 dock / 操作条 40 / 底条 112 --- */
  #scr-game.active {
    /* 钉在视口上，避免页面级滚动/偏移把底条推出屏幕 */
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 288px 132px minmax(0, 1fr) 132px;
    grid-template-rows: 56px minmax(0, 1fr) 40px 112px;
    grid-template-areas:
      "top   top   top   top"
      "opp   phase board dock"
      "act   act   act   act"
      "self  self  self  self";
    height: auto;
    padding: 0 40px;
    overflow: hidden;
  }
  .topbar {
    grid-area: top;
    height: 56px;
    padding: 0;
    border-bottom: 1px solid var(--line-soft);
    background: var(--paper-2);
    backdrop-filter: none;
  }
  /* 让棋盘与玩家列直接参与外层栅格 */
  .stage { display: contents; }

  /* 左侧玩家信息列 */
  .opp-col {
    grid-area: opp;
    padding: 16px 20px 16px 0;
    gap: 16px;
    overflow-y: auto;
  }
  .opp-card { padding: 14px; gap: 12px; min-height: 118px; }
  .opp-avatar { width: 62px; height: 76px; }
  .opp-name { font-size: 15px; }
  .opp-role { font-size: 10px; }
  .opp-cash span { font-size: 24px; }

  /* 棋盘区 */
  .board-col { grid-area: board; padding: 12px 8px; }
  .board-hold { width: min(100%, calc(100vh - 236px)); max-width: 720px; }

  /* 阶段条：棋盘左侧竖排 */
  .phasebar {
    grid-area: phase;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 0 8px 0 4px;
    background: transparent;
    border: 0;
  }
  .phasebar .ph { padding: 2px 0; border-bottom: 1px solid transparent; }
  .phasebar .ph-arrow { transform: rotate(90deg); opacity: 0.25; align-self: center; }

  /* 工具 dock：棋盘右侧竖排 */
  .dock {
    grid-area: dock;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    padding: 0 0 0 20px;
    border-top: 0;
    border-left: 1px solid var(--line-soft);
    background: transparent;
  }
  .dock .dock-btn { margin-left: 0; }
  .dock .dock-btn + .dock-btn { margin-left: 0; }

  /* 操作条：贴在底条上方，与底条之间不画分隔线 */
  .actionbar {
    grid-area: act;
    padding: 0;
    border-top: 0;
    background: transparent;
    gap: 18px;
  }
  .act {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
  }
  .act-free { font-size: 10px; }

  /* 底部自己的信息条 */
  .selfarea {
    grid-area: self;
    height: 112px;
    padding: 0;
    border-top: 1px solid var(--line-soft);
    background: transparent;
  }
  .self-avatar { width: 64px; height: 80px; }

  /* --- 弹窗通则：常规 640 宽、宽版 800 宽，最高 80vh --- */
  .modal { width: min(90vw, 640px); max-height: 80vh; padding: 32px 32px 24px; }
  .modal.wide { width: min(92vw, 800px); }
  .cp-modal { max-height: 84vh; }
}

/* 紧凑档：1280–1439，只收间距与栏宽，字号不动 */
@media (min-width: 1280px) and (max-width: 1439px) {
  #scr-game.active { grid-template-columns: 240px 120px minmax(0, 1fr) 120px; padding: 0 24px; }
  .page-head, .page-foot { padding-left: 24px; padding-right: 24px; }
  #match-body, #setup-body, #online-body { padding-left: 24px; padding-right: 24px; }
  .opp-col { padding-right: 16px; }
  .dock { padding-left: 16px; }
}
