/* ═══════════════════════════════════════════════════════
   同盟数据统计 · 宣纸墨金
   Hallmark · macrostructure: Ink-Scroll Ledger（卷轴账簿）
   · tone: 宣纸墨金 editorial · anchor hue: 印红 12°
   · pre-emit: P5 H4 E4 S5 R4 V5 · contrast: pass (40–41)
   令牌：宣纸 #f3ede1 / 墨 #1a1712 / 鎏金 #b98a4e / 印 #a63a2b / 次 #6b6355
   ═══════════════════════════════════════════════════════ */

:root {
  --paper: #f3ede1;
  --paper-2: #ece4d3;
  --ink: #1a1712;
  --ink-2: #2c261e;
  --ink-deep: #14110d;
  --gold: #b98a4e;          /* 纸面装饰线/暗底金字 */
  --gold-ink: #7d5a28;      /* 纸面上的金色文字/交互态（≥4.5:1） */
  --gold-line: rgba(185, 138, 78, 0.55);
  --seal: #a63a2b;
  --sub: #6b6355;
  --paper-a78: rgba(243, 237, 225, 0.78);
  --paper-a60: rgba(243, 237, 225, 0.6);
  --paper-a30: rgba(243, 237, 225, 0.3);
  --paper-a55: rgba(243, 237, 225, 0.55);
  --hairline: rgba(26, 23, 18, 0.16);
  --hairline-soft: rgba(26, 23, 18, 0.09);
  --hairline-on-ink: rgba(243, 237, 225, 0.09);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --kai: "Kaiti SC", STKaiti, KaiTi, "Noto Serif SC", serif;
  --head-h: 56px;
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px;
}

html { overflow-x: clip; }

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }
}

a, button { touch-action: manipulation; }

/* 键盘焦点：立即显形，不做过渡 */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

/* 宣纸肌理（噪点极淡，无图片资源） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

main { position: relative; z-index: 1; }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: rgba(185, 138, 78, 0.35); }

/* ── 印章 ── */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--kai);
  font-size: 19px;
  line-height: 1;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px var(--paper-a30);
  flex: none;
}

/* ── 顶栏 ── */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--head-h);
  padding: 0 clamp(16px, 4vw, 48px);
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 16px;
}

.seal-brand { width: 28px; height: 28px; font-size: 16px; }

.site-nav {
  display: none;
  gap: 28px;
  margin-left: auto;
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--sub);
}

.site-nav a { padding: 15px 2px; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.site-nav a:hover { color: var(--ink); border-color: var(--gold); }

.nav-loc {
  display: none;
  width: 26px;
  height: 26px;
  font-size: 14px;
  border-radius: 2px;
  transition: opacity 0.2s;
}

.head-cta {
  margin-left: auto;
  font-size: 14px;
  letter-spacing: 0.2em;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--ink);
  transition: background 0.2s, color 0.2s;
}

.head-cta:hover { background: var(--ink); color: var(--paper); }

@media (min-width: 840px) {
  .site-nav { display: flex; }
  .nav-loc { display: inline-flex; margin-left: var(--space-6); }
  .head-cta { margin-left: var(--space-4); }
}

/* ── Hero（桌面全幅底图，文字坐画作左侧安全区；左下浮云是点睛，取景必须含它） ── */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--hairline);
}

.hero-text {
  position: relative;
  z-index: 2;
  padding: clamp(40px, 8vw, 96px) clamp(20px, 6vw, 72px) clamp(36px, 6vw, 64px);
}

.hero-figure { position: relative; }

.hero-figure img {
  width: 100%;
  height: clamp(280px, 60vw, 430px);
  object-fit: cover;
  object-position: 45% center; /* 手机横条：云尾与脸部兼得 */
}

.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.34em;
  color: var(--sub);
  margin-bottom: 22px;
}

/* 卷首题签：标题不折行 + 竖排小注贴金线 */
.hero-title-row {
  display: flex;
  align-items: stretch;
  gap: 20px;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 900;
  white-space: nowrap;
}

/* 「账」与全站印章同语言：红底框 + 纸色字，与标题居中对齐 */
.hero-accent {
  font-family: var(--kai);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1;
  color: var(--paper);
  background: var(--seal);
  padding: 0.16em 0.2em 0.2em;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1.5px var(--paper-a30);
}

.hero-name {
  font-size: clamp(30px, 4.6vw, 56px);
  letter-spacing: 0.14em;
  line-height: 1.18;
}

.hero-side {
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--sub);
  border-left: 1px solid rgba(185, 138, 78, 0.55);
  padding-left: 14px;
  max-height: 230px;
}

.hero-claim {
  margin-top: 24px;
  font-size: clamp(15px, 1.6vw, 18px);
  letter-spacing: 0.3em;
  color: var(--sub);
}

@media (max-width: 640px) {
  .hero-title { white-space: normal; }
  .hero-side {
    writing-mode: horizontal-tb;
    max-height: none;
    border-left: 0;
    border-top: 1px solid rgba(185, 138, 78, 0.55);
    padding: 10px 0 0;
    letter-spacing: 0.4em;
  }
  .hero-title-row { flex-direction: column; gap: 16px; }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

@media (min-width: 960px) {
  .hero {
    min-height: calc(100vh - var(--head-h));
    min-height: calc(100svh - var(--head-h));
  }
  .hero-figure { position: absolute; inset: 0; }
  .hero-figure img {
    width: 100%;
    height: 100%;
    object-position: 18% center; /* 桌面全幅取景：左下浮云完整入画 */
  }
  .hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 46%;
    min-height: calc(100vh - var(--head-h));
    min-height: calc(100svh - var(--head-h));
    padding-left: clamp(32px, 6vw, 96px);
  }
}

@media (min-width: 960px) and (max-width: 1439px) {
  .hero-figure img { object-position: 42% center; } /* 中窄屏取景窗小，云与脸折中 */
}

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-8);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--seal); border-color: var(--seal); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold-ink); color: var(--gold-ink); }

.btn:active, .head-cta:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-big { padding: var(--space-4) var(--space-12); font-size: 17px; white-space: nowrap; }

@media (max-width: 480px) {
  .btn-big { padding: 14px 26px; font-size: 15px; letter-spacing: 0.18em; text-indent: 0.18em; }
}

/* ── 通用章节 ── */
.sec {
  padding: clamp(72px, 11vw, 150px) clamp(20px, 6vw, 72px);
  border-bottom: 1px solid var(--hairline);
}

section[id] { scroll-margin-top: calc(var(--head-h) + 10px); }

.sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.sec-head h2 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  letter-spacing: 0.3em;
  text-wrap: balance;
}

.sec-head.center { justify-content: center; }

.sec-note {
  margin-left: auto;
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--sub);
  max-height: 120px;
}

@media (max-width: 839px) {
  .sec-note { display: none; }
}

/* 章节导语 */
.sec-lead {
  max-width: 620px;
  margin: -1.2em 0 clamp(30px, 4.5vw, 48px);
  font-size: 15px;
  letter-spacing: 0.12em;
  line-height: 2.1;
  color: var(--sub);
}

/* ── 功能六部（账簿行：图标居左、条目横排，非卡片阵列） ── */
.feat-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(32px, 5vw, 80px);
  border-top: 1px solid var(--hairline);
}

.feat {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  padding: clamp(26px, 3.5vw, 42px) 0;
  border-bottom: 1px solid var(--hairline);
}

.feat-icon {
  flex: none;
  width: 48px;
  height: 48px;
  color: var(--gold);
}

.feat-icon svg { width: 100%; height: 100%; }

.feat h3 {
  margin: var(--space-1) 0 var(--space-2);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-wrap: balance;
}

.feat p {
  font-size: 14.5px;
  color: var(--sub);
  letter-spacing: 0.06em;
  line-height: 1.9;
}

@media (max-width: 839px) {
  .feat-grid { grid-template-columns: 1fr; }
}

/* ── 作战沙盘（墨底 3D 全屏段） ── */
.sandbox {
  display: flex;
  flex-direction: column;
  /* 段底环境晕：中心微亮的深墨，让 alpha 画布下的地形层次可读 */
  background: radial-gradient(120% 90% at 58% 38%, #201a13 0%, var(--ink-deep) 68%);
  color: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.sand-text {
  position: relative;
  z-index: 2;
  padding: clamp(56px, 8vw, 100px) clamp(20px, 6vw, 72px) clamp(36px, 5vw, 64px);
}

.sand-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  letter-spacing: 0.4em;
  color: var(--paper-a60);
  margin-bottom: 24px;
}

.sand-text h2 {
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-wrap: balance;
}

.sand-sub {
  margin-top: 18px;
  font-size: clamp(14px, 1.4vw, 16px);
  letter-spacing: 0.32em;
  color: var(--paper-a60);
}

.sand-stage { position: relative; flex: 1; min-height: 56vh; }

.hex3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  cursor: crosshair;
}

.hex3d-fallback { position: absolute; inset: 0; }

.hex3d-fallback svg { width: 100%; height: 100%; }

@media (min-width: 960px) {
  .sandbox { flex-direction: row; min-height: 100vh; }
  .sand-text {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--hairline-on-ink);
    padding-left: clamp(32px, 6vw, 96px);
  }
  .sand-stage { min-height: 100vh; }
}

/* ── 使用场景带（真实时序时间轴：战前→战中→战后） ── */
.scene-flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
}

.scene { position: relative; }

.scene-node { width: 40px; height: 40px; font-size: 18px; position: relative; z-index: 1; }

/* 节点间连线（时序语义） */
.scene:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 20px;
  left: calc(40px + var(--space-4));
  right: calc(-1 * clamp(28px, 4vw, 56px) + var(--space-4));
  height: 1px;
  background: var(--hairline);
}

.scene-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-2);
}

.scene-icon {
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--gold);
}

.scene-icon svg { width: 100%; height: 100%; }

.scene h3 {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.3em;
}

.scene p {
  font-size: 14.5px;
  color: var(--sub);
  letter-spacing: 0.06em;
  line-height: 1.9;
  max-width: 34ch;
}

@media (max-width: 839px) {
  .scene-flow { grid-template-columns: 1fr; gap: var(--space-8); }
  .scene { padding-left: 60px; }
  .scene-node { position: absolute; left: 0; top: 0; }
  .scene:not(:last-child)::before {
    left: 20px; top: 48px;
    right: auto; bottom: calc(-1 * var(--space-8));
    width: 1px; height: auto;
  }
  .scene-head { margin-top: 0; }
}

/* ── 数据带（墨横） ── */
.numbers {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.numbers .ink3d { position: absolute; inset: 0; width: 100%; height: 100%; }

.ink3d-fallback {
  position: absolute;
  inset: 0;
}

.ink3d-fallback svg { width: 100%; height: 100%; }

.numbers-inner {
  position: relative;
  z-index: 2;
  padding: clamp(64px, 10vw, 128px) clamp(20px, 6vw, 72px);
  text-align: center;
}

.numbers-eyebrow {
  font-size: 13px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--paper-a55);
  margin-bottom: clamp(28px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.numbers-eyebrow::before,
.numbers-eyebrow::after {
  content: "";
  width: 44px;
  height: 1px;
  background: rgba(185, 138, 78, 0.65);
}

.numbers-row {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.num { display: flex; flex-direction: column; gap: 6px; }

.num-val {
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.num-label {
  font-size: 14px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--paper-a78);
}

.numbers-note {
  margin-top: clamp(28px, 4vw, 44px);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--paper-a55);
}

@media (min-width: 840px) {
  .numbers-row {
    flex-direction: row;
    justify-content: center;
    gap: clamp(48px, 8vw, 120px);
  }
}

/* ── 小程序带 ── */
.phones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 5vw, 56px);
}

.phone { text-align: center; }

.phone-frame {
  width: min(264px, 72vw);
  margin: 0 auto;
  padding: var(--space-2);
  background: var(--paper);
  border: 1px solid var(--hairline);
}

.phone-frame img {
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline-soft);
}

.phone figcaption {
  margin-top: 16px;
  font-size: 13.5px;
  letter-spacing: 0.3em;
  color: var(--sub);
}

@media (min-width: 840px) {
  .phones { flex-direction: row; justify-content: center; align-items: flex-start; }
  .phone:last-child { margin-top: 56px; }
}

.mp-note {
  margin-top: clamp(36px, 5vw, 56px);
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.28em;
  color: var(--sub);
}

.mp-note .dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 14px;
  vertical-align: middle;
}

/* ── 世界观带 ── */
.world {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 7vw, 88px);
}

.world .ink3d { position: absolute; inset: 0; width: 100%; height: 100%; }

.world-inner { position: relative; z-index: 2; padding: 0 clamp(20px, 6vw, 72px); }

.world-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 72px);
}

.world-poem {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.poem-col {
  writing-mode: vertical-rl;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 900;
  letter-spacing: 0.62em;
  color: var(--ink);
}

.poem-seal { margin-top: 8px; }

@media (min-width: 960px) {
  .world-poem { display: flex; }
}

.scroll-set {
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
  scrollbar-width: none;
}

.scroll-set::-webkit-scrollbar { display: none; }

.scroll-frame {
  flex: 0 0 auto;
  width: clamp(220px, 26vw, 340px);
  border: 1px solid var(--hairline);
  background: var(--paper);
  padding: 10px;
  scroll-snap-align: center;
}

.scroll-frame img { width: 100%; height: auto; }

/* ── 下载 ── */
.download { text-align: center; }

.download-sub {
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--sub);
  margin-bottom: 30px;
}

/* ── 页脚 ── */
.site-foot {
  padding: 40px clamp(20px, 6vw, 72px) 48px;
  text-align: center;
  font-size: 13px;
  color: var(--sub);
  letter-spacing: 0.12em;
  line-height: 2.2;
}

.site-foot a { border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.site-foot a:hover { color: var(--seal); border-color: var(--seal); }

/* ── Toast ── */
#toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 16px);
  z-index: 90;
  max-width: calc(100vw - 48px);
  padding: 13px 26px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.18em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

#toast.show { opacity: 1; transform: translate(-50%, 0); }

#toast::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--seal);
  border-radius: 1px;
  margin-right: 12px;
  vertical-align: 1px;
}

/* ── 3D 降级（默认静态 SVG；仅 JS+WebGL+非 reduced-motion 才切 canvas） ── */
.ink3d, .hex3d { display: none; }
.webgl-ok .ink3d, .webgl-ok .hex3d { display: block; }
.webgl-ok .ink3d-fallback,
.webgl-ok .hex3d-fallback { display: none; }
