/* ==========================================================================
   群英纪元 · 丝路裂隙  —  H5 视觉系统
   水墨、丝路、金石。移动优先。
   ========================================================================== */
:root {
  --ink: #0b0f0e;
  --ink-2: #111816;
  --ink-3: #17201d;
  --ink-4: #1e2925;
  --paper: #ece2ca;
  --paper-dim: #bcb29b;
  --paper-faint: #8d8878;
  --gold: #c9a45c;
  --gold-bright: #efd79e;
  --gold-deep: #8e6d37;
  --jade: #6f9e8e;
  --jade-bright: #a9cdbd;
  --crimson: #a24f44;
  --crimson-bright: #d07a6b;
  --line: rgba(201, 164, 92, 0.22);
  --line-soft: rgba(236, 226, 202, 0.1);
  --glass: rgba(14, 20, 18, 0.78);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --font-serif: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --nav-h: 66px;
  --top-h: 64px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--paper);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(70, 95, 82, 0.24), transparent 62%),
    radial-gradient(900px 600px at 110% 100%, rgba(105, 71, 45, 0.16), transparent 60%),
    var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
::selection { background: rgba(201, 164, 92, 0.35); color: #fff; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, 0.28); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* 纸纹 */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.8'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: flex; }
.hidden { display: none !important; }

/* ================= 通用组件 ================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: rgba(236, 226, 202, 0.04);
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.12em;
  border-radius: var(--radius);
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}
.btn:hover { border-color: rgba(201, 164, 92, 0.55); background: rgba(201, 164, 92, 0.08); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; transform: none; }
.btn-primary {
  color: #16130c;
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, #e9d19a, #c6a05a 55%, #a87f3d);
  box-shadow: 0 6px 26px rgba(201, 164, 92, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(135deg, #f3dfad, #d2ae68 55%, #b78d48); }
.btn-ghost { background: rgba(9, 13, 12, 0.24); }
.btn-danger { border-color: rgba(208, 122, 107, 0.4); color: #e8b4aa; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 15px; letter-spacing: 0.22em; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12px; letter-spacing: 0.08em; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-soft); border-radius: 50%; color: var(--paper-dim); }
.btn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-soft); color: var(--paper-dim);
  background: rgba(8, 12, 11, 0.4);
  transition: 0.2s;
}
.icon-btn:hover { color: var(--gold-bright); border-color: var(--line); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-family: var(--font-serif); font-size: 26px; font-weight: 500; letter-spacing: 0.12em; line-height: 1.15; }
.section-head .sub { margin-top: 5px; font-size: 11px; letter-spacing: 0.18em; color: var(--paper-faint); text-transform: uppercase; }
.eyebrow { color: var(--gold); font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; }
.muted { color: var(--paper-faint); }
.gold { color: var(--gold-bright); }
.jade { color: var(--jade-bright); }
.crimson { color: var(--crimson-bright); }
.tiny { font-size: 10px; }
.small { font-size: 12px; }
.serif { font-family: var(--font-serif); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border: 1px solid var(--line-soft);
  border-radius: 99px; font-size: 10px; letter-spacing: 0.08em;
  color: var(--paper-dim); background: rgba(8, 12, 11, 0.32);
}
.pill.gold { color: var(--gold-bright); border-color: rgba(201, 164, 92, 0.35); }
.pill.jade { color: var(--jade-bright); border-color: rgba(111, 158, 142, 0.35); }
.pill.crimson { color: #e7aea4; border-color: rgba(162, 79, 68, 0.4); }

.tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10px; letter-spacing: 0.04em;
  border: 1px solid var(--line); color: var(--gold-bright);
  background: rgba(201, 164, 92, 0.07); border-radius: 2px;
}

.progress { height: 4px; background: rgba(236, 226, 202, 0.1); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--jade), var(--gold)); border-radius: inherit; transition: width 0.35s ease; }
.progress.gold > i { background: linear-gradient(90deg, #9b7437, var(--gold-bright)); }

.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); border: 0; margin: 18px 0; }
.divider.left { background: linear-gradient(90deg, var(--line), transparent); }

/* 头像 */
.portrait {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 34% 24%, color-mix(in srgb, var(--p1, #42655c) 64%, #1a2621 36%), transparent 58%),
    radial-gradient(circle at 72% 82%, color-mix(in srgb, var(--p2, #c9a45c) 34%, transparent), transparent 55%),
    linear-gradient(145deg, #1b2924, #0a0f0d 82%);
  border: 1px solid color-mix(in srgb, var(--p2, #c9a45c) 55%, transparent);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55), 0 4px 18px rgba(0, 0, 0, 0.3);
}
.portrait::before {
  content: "";
  position: absolute; inset: 6%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--p2, #c9a45c) 32%, transparent);
  opacity: 0.8;
}
.portrait::after {
  content: "";
  position: absolute; left: -20%; right: -20%; bottom: -8%; height: 42%;
  background: radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.55), transparent 70%);
}
.portrait .hero-figure {
  position: absolute;
  inset: -5%;
  z-index: 1;
  width: 110%;
  height: 110%;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.36));
  transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.3, 1), filter 0.35s ease;
}
.portrait .glyph {
  position: relative; z-index: 1;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: calc(var(--p-size, 54px) * 0.46);
  line-height: 1;
  color: rgba(245, 235, 210, 0.94);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  transform: translateY(-2%);
}
.portrait .region {
  position: absolute; z-index: 3; right: 3%; bottom: 5%;
  width: 24%; height: 24%;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: calc(var(--p-size, 54px) * 0.12);
  color: #17140e; background: var(--p2, #c9a45c); border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(12, 16, 14, 0.7);
}
.portrait.xs { --p-size: 30px; }
.portrait.sm { --p-size: 44px; }
.portrait.md { --p-size: 64px; }
.portrait.lg { --p-size: 92px; }
.portrait.xl { --p-size: 132px; }
.portrait.hero-portrait { border-radius: 46% 46% 40% 40% / 38% 38% 52% 52%; }
.portrait.hero-portrait::before { border-radius: 46% 46% 40% 40% / 38% 38% 52% 52%; }

/* ================= 标题界面 ================= */
.landing { flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: #070a09; }
.landing-bg { position: absolute; inset: 0; overflow: hidden; }
.landing-art { width: 100%; height: 100%; object-fit: cover; }
.landing-fog {
  position: absolute; left: -20%; width: 140%; height: 44%;
  background: radial-gradient(ellipse at 50% 50%, rgba(174, 192, 166, 0.12), transparent 68%);
  filter: blur(28px); pointer-events: none;
}
.fog-a { bottom: 4%; animation: fogDrift 18s ease-in-out infinite alternate; }
.fog-b { bottom: 22%; opacity: 0.6; animation: fogDrift 26s ease-in-out infinite alternate-reverse; }
.landing-stars { position: absolute; inset: 0; pointer-events: none; }
.landing-stars i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #f2dfae; opacity: 0.4;
  box-shadow: 0 0 6px 1px rgba(242, 223, 174, 0.45);
  animation: twinkle 4s ease-in-out infinite;
}
.landing-content {
  position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 24px 26px 88px;
  width: min(760px, 100%);
  animation: fadeUp 1.1s cubic-bezier(0.22, 0.8, 0.28, 1) both;
}
.landing-kicker {
  color: rgba(201, 164, 92, 0.76);
  font-size: 9px; letter-spacing: 0.42em; text-indent: 0.42em;
  margin-bottom: 28px;
}
.title-lockup { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.title-seal {
  display: grid; place-items: center;
  width: clamp(52px, 9vw, 76px); aspect-ratio: 0.72;
  border: 1px solid rgba(226, 178, 142, 0.72);
  color: #e8bb9f;
  font-family: var(--font-serif);
  font-size: clamp(17px, 3vw, 24px);
  line-height: 1.05; letter-spacing: 0.05em;
  background: linear-gradient(160deg, rgba(142, 62, 49, 0.55), rgba(69, 27, 23, 0.52));
  box-shadow: inset 0 0 0 3px rgba(10, 12, 11, 0.6), inset 0 0 0 4px rgba(226, 178, 142, 0.24), 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: rotate(-2deg);
  writing-mode: vertical-rl;
}
.landing h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(56px, 12vw, 108px);
  line-height: 0.98;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  white-space: nowrap;
  color: #f2e8d1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28), 0 16px 60px rgba(0, 0, 0, 0.6);
}
.landing-subtitle {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(13px, 2.2vw, 18px);
  letter-spacing: 0.7em; text-indent: 0.7em;
  color: var(--gold);
}
.landing-tagline {
  margin-top: clamp(24px, 5vh, 44px);
  color: rgba(224, 216, 196, 0.72);
  font-family: var(--font-serif);
  font-size: clamp(13px, 2vw, 16px);
  line-height: 2;
  letter-spacing: 0.1em;
}
.landing-actions { display: flex; gap: 14px; margin-top: clamp(28px, 5vh, 46px); flex-wrap: wrap; justify-content: center; }
.landing-actions .btn { min-width: 156px; }
.landing-note {
  margin-top: 24px; font-size: 10px; letter-spacing: 0.18em;
  color: rgba(188, 178, 155, 0.55);
}
.landing-footer {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
  font-size: 9px; letter-spacing: 0.16em; color: rgba(188, 178, 155, 0.42);
  border-top: 1px solid rgba(236, 226, 202, 0.06);
  background: linear-gradient(180deg, transparent, rgba(5, 8, 7, 0.7));
}
.landing-footer-mark { color: rgba(201, 164, 92, 0.5); }

/* ================= 角色创建 ================= */
.creation { overflow-y: auto; background: var(--ink); display: none; }
.creation.active { display: block; }
.creation-bg {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 50% -20%, rgba(111, 158, 142, 0.15), transparent 70%),
    linear-gradient(180deg, #101716, #080b0a);
}
.creation-inner { position: relative; max-width: 980px; margin: 0 auto; padding: 28px 18px calc(42px + env(safe-area-inset-bottom)); }
.creation-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.creation-back { display: inline-flex; align-items: center; gap: 8px; color: var(--paper-faint); font-size: 11px; letter-spacing: 0.12em; }
.creation-back:hover { color: var(--gold-bright); }
.creation-step { font-size: 10px; letter-spacing: 0.22em; color: var(--gold); }
.creation-head { text-align: center; margin-bottom: 30px; }
.creation-head .eyebrow { margin-bottom: 12px; }
.creation-head h2 { font-family: var(--font-serif); font-size: clamp(30px, 6vw, 46px); font-weight: 400; letter-spacing: 0.12em; }
.creation-head p { margin-top: 12px; color: var(--paper-faint); font-size: 13px; line-height: 1.9; }
.creation-block { margin-top: 34px; }
.creation-block-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.creation-block-head h3 { font-family: var(--font-serif); font-size: 20px; font-weight: 500; letter-spacing: 0.1em; }
.creation-block-head span { font-size: 10px; letter-spacing: 0.16em; color: var(--paper-faint); }
.name-field { position: relative; max-width: 440px; margin: 0 auto; }
.name-field input {
  width: 100%; height: 54px;
  padding: 0 18px; text-align: center;
  background: rgba(236, 226, 202, 0.035);
  border: 1px solid var(--line);
  border-radius: 2px; outline: none;
  font-family: var(--font-serif); font-size: 22px; letter-spacing: 0.2em;
  color: var(--paper);
}
.name-field input:focus { border-color: rgba(201, 164, 92, 0.65); box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.08); }
.name-field .name-hint { text-align: center; font-size: 10px; color: var(--paper-faint); margin-top: 8px; letter-spacing: 0.12em; }

.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.path-card {
  position: relative; text-align: left; padding: 18px 16px 16px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(236, 226, 202, 0.045), rgba(7, 10, 9, 0.2));
  border-radius: 3px;
  transition: 0.2s; overflow: hidden;
}
.path-card::before {
  content: ""; position: absolute; inset: auto -30% -50% auto; width: 120px; height: 120px;
  border-radius: 50%; background: var(--pc, var(--gold)); filter: blur(42px); opacity: 0.16;
}
.path-card:hover { border-color: rgba(201, 164, 92, 0.4); transform: translateY(-2px); }
.path-card.selected { border-color: var(--gold); background: linear-gradient(160deg, rgba(201, 164, 92, 0.13), rgba(7, 10, 9, 0.3)); box-shadow: inset 0 0 0 1px rgba(201, 164, 92, 0.16), 0 8px 30px rgba(0, 0, 0, 0.3); }
.path-glyph {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(201, 164, 92, 0.36); font-family: var(--font-serif);
  font-size: 20px; color: var(--pc, var(--gold-bright)); margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.22);
}
.path-card h4 { font-family: var(--font-serif); font-size: 22px; font-weight: 500; letter-spacing: 0.12em; }
.path-card .path-title { font-size: 10px; color: var(--paper-faint); margin-top: 4px; letter-spacing: 0.06em; }
.path-card p { margin-top: 12px; font-size: 11px; line-height: 1.75; color: var(--paper-dim); min-height: 58px; }
.path-card .path-perk { margin-top: 10px; font-size: 10px; color: var(--jade-bright); letter-spacing: 0.06em; }
.path-bars { display: grid; gap: 5px; margin-top: 12px; }
.path-bars span { display: flex; align-items: center; gap: 6px; font-size: 9px; color: var(--paper-faint); }
.path-bars i { flex: 1; height: 2px; background: rgba(236, 226, 202, 0.1); }
.path-bars i b { display: block; height: 100%; background: var(--pc, var(--gold)); opacity: 0.8; }
.path-check { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 50%; }
.path-card.selected .path-check { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 3px #151610; }

.starter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.starter-card {
  position: relative; padding: 16px 14px 14px; text-align: left;
  border: 1px solid var(--line-soft);
  background: linear-gradient(165deg, rgba(236, 226, 202, 0.045), rgba(6, 9, 8, 0.3));
  border-radius: 3px; transition: 0.2s; overflow: hidden;
  display: grid; grid-template-columns: 76px 1fr;
  grid-template-areas: "portrait name" "portrait title" "role role" "bio bio";
  align-items: start; column-gap: 12px;
}
.starter-card:hover { border-color: rgba(201, 164, 92, 0.42); transform: translateY(-2px); }
.starter-card.selected { border-color: var(--gold); background: linear-gradient(165deg, rgba(201, 164, 92, 0.12), rgba(6, 9, 8, 0.35)); }
.starter-card .portrait { grid-area: portrait; width: 66px; margin: 0; }
.starter-card h4 { grid-area: name; font-family: var(--font-serif); font-size: 21px; font-weight: 500; letter-spacing: 0.08em; align-self: end; }
.starter-card .starter-title { grid-area: title; font-size: 10px; color: var(--gold); margin-top: 3px; letter-spacing: 0.08em; align-self: start; }
.starter-card .starter-role { grid-area: role; margin-top: 10px; display: flex; gap: 5px; }
.starter-card p { grid-area: bio; margin-top: 10px; font-size: 11px; line-height: 1.7; color: var(--paper-dim); min-height: 56px; }
.starter-check {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; color: transparent;
}
.starter-card.selected .starter-check { border-color: var(--gold); background: var(--gold); color: #151610; }
.gender-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin: 0 auto; }
.gender-card {
  position: relative; padding: 16px 12px 14px; text-align: center;
  border: 1px solid var(--line-soft); border-radius: 3px;
  background: linear-gradient(165deg, rgba(236, 226, 202, 0.045), rgba(6, 9, 8, 0.3));
  transition: 0.2s; overflow: hidden;
}
.gender-card::before {
  content: ""; position: absolute; inset: auto 12% -45% 12%; height: 70%;
  background: radial-gradient(ellipse at 50% 100%, var(--pc, #c9a45c), transparent 68%);
  opacity: 0.14; pointer-events: none;
}
.gender-card:hover { border-color: rgba(201, 164, 92, 0.42); transform: translateY(-2px); }
.gender-card.selected { border-color: var(--gold); background: linear-gradient(165deg, rgba(201, 164, 92, 0.12), rgba(6, 9, 8, 0.35)); }
.gender-card .portrait { width: 84px; margin: 0 auto 10px; }
.gender-label { font-family: var(--font-serif); font-size: 19px; letter-spacing: 0.08em; color: var(--paper); }
.gender-sub { margin-top: 3px; font-size: 9px; color: var(--paper-faint); letter-spacing: 0.04em; }
.gender-check {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-size: 9px;
  border: 1px solid var(--line); color: transparent;
}
.gender-card.selected .gender-check { border-color: var(--gold); background: var(--gold); color: #151610; }
.creation-submit { margin-top: 38px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.creation-submit .btn { min-width: 260px; }
.creation-submit small { font-size: 10px; color: var(--paper-faint); letter-spacing: 0.1em; }

/* ================= 主界面 ================= */
.game { flex-direction: column; background: transparent; }
.game::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 600px at 50% -8%, rgba(64, 89, 77, 0.22), transparent 65%),
    linear-gradient(180deg, #0f1513, #090c0b 72%);
}
.topbar {
  position: relative; z-index: 20;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 14, 13, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.player-mini { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.player-mini .portrait { width: 36px; }
.player-mini-info { min-width: 0; }
.player-mini-name { display: flex; align-items: baseline; gap: 6px; font-size: 12px; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-mini-name em { font-style: normal; font-size: 9px; color: var(--gold); }
.player-mini-exp { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.player-mini-exp .progress { width: 66px; }
.player-mini-exp span { font-size: 8px; color: var(--paper-faint); }
.top-resources { display: flex; align-items: center; gap: 6px; }
.res-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 7px;
  border: 1px solid var(--line-soft); border-radius: 99px;
  background: rgba(7, 11, 10, 0.42);
  font-size: 10px; color: var(--paper-dim); white-space: nowrap;
}
.res-chip b { color: var(--paper); font-weight: 500; font-variant-numeric: tabular-nums; }
.res-glyph { color: var(--gold); font-family: var(--font-serif); font-size: 11px; }
.view {
  position: relative; z-index: 1;
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 16px 14px calc(24px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.view-inner { width: 100%; max-width: 1180px; margin: 0 auto; animation: viewIn 0.34s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.bottomnav {
  position: relative; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line-soft);
  background: rgba(8, 12, 11, 0.88);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: rgba(188, 178, 155, 0.5);
  font-size: 10px; letter-spacing: 0.08em; transition: color 0.2s;
}
.nav-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active { color: var(--gold-bright); }
.nav-btn.active::before {
  content: ""; position: absolute; top: 0; width: 22px; height: 1px;
  background: var(--gold); box-shadow: 0 0 12px 1px rgba(201, 164, 92, 0.6);
}
.nav-btn:active { transform: translateY(1px); }

/* ================= 地图 ================= */
.map-view { position: relative; }
.map-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.map-head h2 { font-family: var(--font-serif); font-size: 27px; font-weight: 500; letter-spacing: 0.12em; line-height: 1.1; }
.map-head .eyebrow { margin-bottom: 6px; }
.map-progress { text-align: right; flex: 0 0 auto; }
.map-progress strong { font-family: var(--font-serif); font-size: 20px; color: var(--gold-bright); font-weight: 500; }
.map-progress span { font-size: 9px; color: var(--paper-faint); letter-spacing: 0.08em; }
.map-viewport {
  position: relative;
  height: clamp(330px, 49vh, 570px);
  overflow-x: auto; overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #0b1110;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55), var(--shadow);
  cursor: grab;
  scrollbar-width: none;
  touch-action: pan-x;
}
.map-viewport::-webkit-scrollbar { display: none; }
.map-viewport.dragging { cursor: grabbing; }
.map-board {
  position: relative;
  width: 1500px; height: 100%; min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 24% 38%, rgba(137, 108, 63, 0.15), transparent 38%),
    radial-gradient(ellipse at 70% 55%, rgba(73, 103, 91, 0.14), transparent 44%),
    linear-gradient(135deg, #101714, #0a0f0e);
}
.map-board::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 9, 8, 0.6), transparent 12%, transparent 88%, rgba(6, 9, 8, 0.6));
}
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-label {
  position: absolute; z-index: 2; pointer-events: none;
  font-family: var(--font-serif); font-size: 11px; letter-spacing: 0.3em;
  color: rgba(188, 178, 155, 0.24); white-space: nowrap;
}
.map-label.vertical { writing-mode: vertical-rl; letter-spacing: 0.24em; }
.map-compass { position: absolute; z-index: 2; right: 42px; top: 38px; width: 66px; height: 66px; opacity: 0.4; pointer-events: none; }
.map-node {
  position: absolute; z-index: 5;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 0; color: var(--paper);
  width: 96px;
}
.node-ring {
  position: relative; display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid rgba(201, 164, 92, 0.58);
  background: radial-gradient(circle at 35% 30%, rgba(65, 86, 74, 0.78), rgba(11, 16, 14, 0.94));
  box-shadow: 0 0 0 4px rgba(8, 12, 11, 0.65), inset 0 0 18px rgba(201, 164, 92, 0.12), 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: 0.2s;
}
.node-glyph { font-family: var(--font-serif); font-size: 21px; color: var(--gold-bright); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.node-label { font-family: var(--font-serif); font-size: 13px; letter-spacing: 0.12em; color: #e4dac2; text-shadow: 0 2px 8px #000; white-space: nowrap; }
.node-label em { display: block; font-style: normal; font-family: var(--font-body); font-size: 8px; letter-spacing: 0.08em; color: rgba(188, 178, 155, 0.54); margin-top: 1px; }
.map-node:hover .node-ring { border-color: var(--gold-bright); transform: scale(1.06); box-shadow: 0 0 0 4px rgba(8, 12, 11, 0.65), 0 0 28px rgba(201, 164, 92, 0.3); }
.map-node.current .node-ring { border-color: var(--gold-bright); animation: nodePulse 2.6s ease-in-out infinite; }
.map-node.current .node-glyph { color: #fff3d1; }
.map-node.cleared .node-ring { border-color: rgba(111, 158, 142, 0.55); background: radial-gradient(circle at 35% 30%, rgba(53, 89, 77, 0.8), rgba(11, 16, 14, 0.94)); }
.map-node.cleared .node-glyph { color: var(--jade-bright); }
.node-check {
  position: absolute; right: -2px; bottom: -2px; z-index: 2;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--jade); color: #0c1411; font-size: 9px; font-weight: 700;
  box-shadow: 0 0 0 3px #0d1210;
}
.map-node.locked { opacity: 0.42; filter: grayscale(0.7); }
.map-node.locked .node-ring { border-color: rgba(188, 178, 155, 0.24); }
.map-node.locked .node-label { color: rgba(188, 178, 155, 0.6); }
.node-lock {
  position: absolute; right: -3px; bottom: -2px; z-index: 2;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 8px; color: #cfc5ad;
  background: #1a211e; box-shadow: 0 0 0 2px #0d1210;
}
.map-node.rift .node-ring {
  width: 60px; height: 60px;
  border-color: rgba(212, 185, 120, 0.85);
  background: radial-gradient(circle at 50% 50%, rgba(189, 157, 92, 0.3), rgba(9, 13, 12, 0.96) 68%);
  box-shadow: 0 0 40px rgba(201, 164, 92, 0.18), inset 0 0 22px rgba(239, 215, 158, 0.2);
}
.map-node.rift .node-glyph { font-size: 24px; }
.map-hint {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 7px 2px 0;
  font-size: 9px; letter-spacing: 0.1em; color: var(--paper-faint);
}
.map-hint .drag-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-soft), transparent); }
.objective-card {
  position: relative; margin-top: 14px; padding: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(201, 164, 92, 0.08), transparent 55%),
    rgba(12, 18, 16, 0.72);
  border-radius: 3px;
  overflow: hidden;
}
.objective-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
}
.objective-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.objective-top .eyebrow { color: var(--jade-bright); }
.objective-title { margin-top: 8px; font-family: var(--font-serif); font-size: 21px; letter-spacing: 0.08em; }
.objective-desc { margin-top: 7px; font-size: 11px; line-height: 1.8; color: var(--paper-dim); }
.objective-actions { margin-top: 13px; display: flex; gap: 8px; }
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.quick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 12px 11px; border: 1px solid var(--line-soft);
  background: rgba(236, 226, 202, 0.025); border-radius: 3px;
  transition: 0.2s; text-align: left;
}
.quick-card:hover { border-color: rgba(201, 164, 92, 0.36); background: rgba(201, 164, 92, 0.05); }
.quick-card span { font-size: 9px; color: var(--paper-faint); letter-spacing: 0.1em; }
.quick-card strong { font-family: var(--font-serif); font-size: 16px; font-weight: 500; letter-spacing: 0.06em; }
.quick-card .quick-glyph { color: var(--gold); font-family: var(--font-serif); font-size: 11px; }

/* ================= 群英谱 ================= */
.collection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.collection-count { font-family: var(--font-serif); color: var(--gold-bright); font-size: 24px; }
.collection-count small { font-size: 11px; color: var(--paper-faint); }
.filter-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 14px 0; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto; height: 30px; padding: 0 13px; border-radius: 99px;
  border: 1px solid var(--line-soft); font-size: 11px; color: var(--paper-faint);
  letter-spacing: 0.06em; background: rgba(8, 12, 11, 0.25); transition: 0.2s;
}
.filter-chip.active { color: #18140d; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.roster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero-card {
  position: relative; text-align: left; padding: 13px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(155deg, rgba(236, 226, 202, 0.04), rgba(8, 12, 11, 0.3));
  border-radius: 3px; overflow: hidden; transition: 0.2s;
}
.hero-card::after {
  content: ""; position: absolute; right: -35px; top: -35px; width: 100px; height: 100px;
  border-radius: 50%; background: var(--hc, #c9a45c); opacity: 0.07; filter: blur(20px);
}
.hero-card:hover { border-color: rgba(201, 164, 92, 0.35); transform: translateY(-2px); }
.hero-card.in-party { border-color: rgba(111, 158, 142, 0.42); }
.hero-card.player-card { grid-column: 1 / -1; }
.hero-card.player-card .hero-card-top { align-items: center; }
.hero-card.player-card .hero-card-top > .portrait { width: 78px; }
.hero-card.player-card .hero-card-name { font-size: 23px; }
.hero-card.player-card .hero-card-title { margin-top: 5px; font-size: 10px; }
.hero-card.player-card .hero-card-meta { margin-top: 11px; }
.hero-card.player-card .hero-card-level { margin-top: 10px; }
.hero-card .portrait { width: 66px; transition: transform 0.3s ease; }
.hero-card:hover .portrait { transform: translateY(-2px) scale(1.035); }
.hero-card-top { display: flex; align-items: flex-start; gap: 10px; }
.hero-card-name { font-family: var(--font-serif); font-size: 19px; font-weight: 500; letter-spacing: 0.05em; }
.hero-card-title { margin-top: 3px; font-size: 9px; color: var(--gold); letter-spacing: 0.05em; }
.hero-card-meta { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.hero-card-level { font-size: 9px; color: var(--paper-faint); margin-top: 7px; letter-spacing: 0.06em; }
.party-badge {
  position: absolute; right: 10px; bottom: 11px; z-index: 2;
  font-size: 8px; letter-spacing: 0.08em; color: #0e1713;
  background: var(--jade); padding: 2px 5px; border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
.hero-card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hero-empty {
  padding: 16px 13px; border: 1px dashed var(--line-soft); border-radius: 3px;
  color: var(--paper-faint); font-size: 10px; text-align: center; min-height: 116px;
  display: flex; align-items: center; justify-content: center; line-height: 1.8;
}

/* ================= 行囊 / 任务 / 观星 ================= */
.panel {
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(236, 226, 202, 0.035), rgba(8, 12, 11, 0.24));
  border-radius: 3px;
}
.panel-pad { padding: 15px; }
.currency-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.currency-box { padding: 12px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(8, 12, 11, 0.25); }
.currency-box span { display: block; font-size: 9px; color: var(--paper-faint); letter-spacing: 0.12em; }
.currency-box strong { display: block; margin-top: 5px; font-family: var(--font-serif); font-size: 21px; font-weight: 500; color: var(--gold-bright); }
.item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.item-card { padding: 12px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(8, 12, 11, 0.28); display: flex; gap: 10px; align-items: flex-start; transition: border-color .2s, transform .2s, background .2s; }
.item-card:hover { border-color: rgba(201,164,92,.34); transform: translateY(-2px); background: rgba(201,164,92,.035); }
.item-glyph {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--ic, #c9a45c) 45%, transparent);
  background: color-mix(in srgb, var(--ic, #c9a45c) 12%, transparent);
  color: var(--ic, #c9a45c); font-family: var(--font-serif); font-size: 17px;
}
.item-name { font-size: 12px; color: var(--paper); display: flex; justify-content: space-between; gap: 6px; }
.item-name b { font-weight: 500; }
.item-desc { margin-top: 4px; font-size: 9px; line-height: 1.6; color: var(--paper-faint); }
.item-card .btn { margin-top: 7px; }
.item-note { display: inline-flex; align-items: center; margin-top: 7px; padding: 3px 7px; border: 1px dashed rgba(201,164,92,.24); border-radius: 2px; font-size: 8px; letter-spacing: .08em; color: var(--paper-faint); white-space: nowrap; }
.artifact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.artifact-card { padding: 12px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(8, 12, 11, 0.26); transition: border-color .2s, transform .2s; }
.artifact-card:hover { border-color: rgba(201,164,92,.34); transform: translateY(-2px); }
.artifact-card .item-glyph { margin-bottom: 9px; }
.artifact-name { font-family: var(--font-serif); font-size: 16px; letter-spacing: 0.06em; }
.artifact-stats { margin-top: 4px; font-size: 9px; color: var(--jade-bright); }
.artifact-from { margin-top: 6px; font-size: 8px; color: var(--paper-faint); letter-spacing: 0.08em; }

.quest-tabs, .inv-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.quest-tab, .inv-tab {
  position: relative; padding: 10px 14px; font-size: 11px; color: var(--paper-faint); letter-spacing: 0.1em;
}
.quest-tab.active, .inv-tab.active { color: var(--gold-bright); }
.quest-tab.active::after, .inv-tab.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 1px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.chapter-card { margin-bottom: 9px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(8, 12, 11, 0.24); }
.chapter-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chapter-name { font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.08em; }
.chapter-num { font-size: 9px; color: var(--gold); letter-spacing: 0.14em; }
.chapter-sub { margin-top: 5px; font-size: 10px; color: var(--paper-faint); }
.chapter-locs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 9px; }
.loc-chip { padding: 3px 7px; border: 1px solid var(--line-soft); border-radius: 2px; font-size: 9px; color: var(--paper-dim); }
.loc-chip.done { border-color: rgba(111, 158, 142, 0.4); color: var(--jade-bright); }
.chapter-progress { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.chapter-progress .progress { flex: 1; }
.chapter-progress span { font-size: 9px; color: var(--paper-faint); white-space: nowrap; }
.chapter-reward { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.reward-line { font-size: 9px; color: var(--paper-faint); line-height: 1.7; }
.ach-card { padding: 12px 13px; border: 1px solid var(--line-soft); border-radius: 3px; margin-bottom: 8px; background: rgba(8, 12, 11, 0.24); }
.ach-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ach-name { font-size: 12px; }
.ach-desc { margin-top: 4px; font-size: 9px; color: var(--paper-faint); }
.ach-progress { margin-top: 9px; display: flex; align-items: center; gap: 8px; }
.ach-progress .progress { flex: 1; }
.ach-progress span { font-size: 9px; color: var(--paper-faint); white-space: nowrap; }
.ach-reward { margin-top: 8px; font-size: 9px; color: var(--gold); }

/* 观星 / 分润 */
.ads-hero {
  position: relative; overflow: hidden;
  padding: 20px 16px; border: 1px solid rgba(201, 164, 92, 0.3); border-radius: 3px;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(201, 164, 92, 0.18), transparent 50%),
    radial-gradient(ellipse at 10% 100%, rgba(111, 158, 142, 0.14), transparent 55%),
    #0c1210;
}
.ads-hero::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 150px; height: 150px;
  border: 1px solid rgba(201, 164, 92, 0.2); border-radius: 50%;
  box-shadow: 0 0 0 17px rgba(201, 164, 92, 0.04), 0 0 0 34px rgba(201, 164, 92, 0.025);
  animation: slowSpin 28s linear infinite;
}
.ads-hero h3 { font-family: var(--font-serif); font-size: 26px; font-weight: 500; letter-spacing: 0.1em; }
.ads-hero p { margin-top: 8px; font-size: 11px; line-height: 1.8; color: var(--paper-dim); max-width: 420px; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.wallet-box { padding: 13px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(7, 11, 10, 0.35); }
.wallet-box span { font-size: 9px; color: var(--paper-faint); letter-spacing: 0.1em; }
.wallet-box strong { display: block; margin-top: 5px; font-family: var(--font-serif); font-size: 25px; font-weight: 500; color: var(--gold-bright); }
.wallet-box em { display: block; font-style: normal; font-size: 8px; color: var(--paper-faint); margin-top: 3px; }
.ad-action-card { margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 3px; background: linear-gradient(120deg, rgba(111, 158, 142, 0.08), transparent 55%), rgba(8, 12, 11, 0.4); }
.ad-action-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ad-action-top h4 { font-family: var(--font-serif); font-size: 19px; font-weight: 500; letter-spacing: 0.06em; }
.ad-meta { margin-top: 5px; font-size: 9px; color: var(--paper-faint); letter-spacing: 0.04em; }
.ad-reward-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ad-reward-pill { padding: 4px 8px; border: 1px solid rgba(201, 164, 92, 0.25); border-radius: 99px; font-size: 9px; color: var(--gold-bright); background: rgba(201, 164, 92, 0.06); }
.ad-main-btn { margin-top: 12px; width: 100%; min-height: 50px; font-size: 14px; letter-spacing: 0.18em; }
.ad-cooldown { margin-top: 7px; text-align: center; font-size: 9px; color: var(--paper-faint); }
.transparency { margin-top: 12px; padding: 13px; border: 1px dashed rgba(201, 164, 92, 0.24); border-radius: 3px; font-size: 9px; line-height: 1.9; color: var(--paper-faint); }
.transparency b { color: var(--gold); font-weight: 500; }
.transparency .formula { margin-top: 6px; color: var(--paper-dim); font-variant-numeric: tabular-nums; }
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.shop-card { padding: 12px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(8, 12, 11, 0.28); }
.shop-card h5 { font-size: 11px; font-weight: 500; }
.shop-card .shop-desc { margin-top: 4px; font-size: 9px; color: var(--paper-faint); line-height: 1.5; }
.shop-card .shop-price { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.shop-price span { font-size: 10px; color: var(--gold-bright); }
.ledger { margin-top: 12px; }
.ledger-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 10px; }
.ledger-row:last-child { border-bottom: 0; }
.ledger-row .ledger-time { color: var(--paper-faint); font-size: 8px; }
.ledger-row .ledger-amt { color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.ledger-row .ledger-star { color: var(--jade-bright); font-size: 9px; }
.ad-note { margin-top: 12px; font-size: 9px; line-height: 1.8; color: var(--paper-faint); }

/* ================= 弹层 ================= */
#modal-root, #dialogue-root, #battle-root, #ad-root { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
#modal-root.open, #dialogue-root.open, #battle-root.open, #ad-root.open { pointer-events: auto; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  background: rgba(3, 6, 5, 0.7);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn 0.2s ease both;
}
.modal-overlay.center { align-items: center; }
.modal-card {
  position: relative; width: min(620px, 100%);
  max-height: min(88dvh, 860px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid rgba(201, 164, 92, 0.32);
  border-radius: 3px;
  background:
    linear-gradient(160deg, rgba(35, 49, 43, 0.4), transparent 35%),
    #0e1513;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(236, 226, 202, 0.06);
  animation: sheetUp 0.28s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
.modal-card.wide { width: min(760px, 100%); }
.modal-card.slim { width: min(460px, 100%); }
.modal-head {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 15px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 21, 19, 0.92);
  backdrop-filter: blur(12px);
}
.modal-head h3 { font-family: var(--font-serif); font-size: 21px; font-weight: 500; letter-spacing: 0.08em; }
.modal-head .eyebrow { margin-top: 3px; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--paper-faint); border: 1px solid var(--line-soft); }
.modal-close:hover { color: var(--paper); border-color: var(--line); }
.modal-body { padding: 16px; }
.modal-foot { position: sticky; bottom: 0; z-index: 3; padding: 12px 15px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); background: rgba(14, 21, 19, 0.94); backdrop-filter: blur(12px); display: flex; gap: 8px; }
.modal-foot .btn { flex: 1; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.location-hero {
  position: relative; overflow: hidden;
  margin: -16px -16px 16px; padding: 26px 18px 20px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse at 75% 10%, color-mix(in srgb, var(--loc, #c9a45c) 26%, transparent), transparent 55%),
    linear-gradient(160deg, rgba(36, 52, 45, 0.55), rgba(9, 13, 12, 0.2));
}
.location-hero::after {
  content: ""; position: absolute; right: -20px; top: -30px; width: 150px; height: 150px;
  border: 1px solid color-mix(in srgb, var(--loc, #c9a45c) 24%, transparent); border-radius: 50%;
  box-shadow: 0 0 0 15px rgba(201, 164, 92, 0.03), 0 0 0 32px rgba(201, 164, 92, 0.02);
}
.location-hero .loc-big-glyph {
  position: absolute; right: 18px; bottom: -28px;
  font-family: var(--font-serif); font-size: 130px; line-height: 1;
  color: var(--loc, #c9a45c); opacity: 0.12; pointer-events: none;
}
.location-hero h2 { font-family: var(--font-serif); font-size: 38px; font-weight: 500; letter-spacing: 0.12em; }
.location-hero .loc-region { margin-top: 4px; font-size: 10px; color: var(--gold); letter-spacing: 0.14em; }
.location-hero p { position: relative; z-index: 1; margin-top: 12px; max-width: 82%; font-size: 11px; line-height: 1.9; color: var(--paper-dim); }
.location-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.story-card { padding: 14px; border: 1px solid var(--line); border-radius: 3px; background: linear-gradient(120deg, rgba(201, 164, 92, 0.07), transparent 60%), rgba(8, 12, 11, 0.3); }
.story-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.story-card h4 { font-family: var(--font-serif); font-size: 20px; font-weight: 500; letter-spacing: 0.08em; }
.story-card .story-sub { margin-top: 4px; font-size: 9px; color: var(--paper-faint); letter-spacing: 0.08em; }
.story-card p { margin-top: 8px; font-size: 10px; line-height: 1.8; color: var(--paper-dim); }
.reward-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.reward-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border: 1px solid var(--line-soft); border-radius: 2px; font-size: 9px; color: var(--paper-dim); }
.reward-chip b { color: var(--gold-bright); font-weight: 500; }
.trial-list { display: grid; gap: 8px; }
.trial-card { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(8, 12, 11, 0.25); }
.trial-card .portrait { width: 42px; }
.trial-info { flex: 1; min-width: 0; }
.trial-name { font-family: var(--font-serif); font-size: 17px; letter-spacing: 0.05em; }
.trial-sub { margin-top: 3px; font-size: 9px; color: var(--paper-faint); }
.trial-card .btn { flex: 0 0 auto; }
.loc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.loc-action { padding: 12px; text-align: left; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(8, 12, 11, 0.25); transition: 0.2s; }
.loc-action:hover { border-color: rgba(201, 164, 92, 0.4); }
.loc-action strong { display: block; font-family: var(--font-serif); font-size: 16px; font-weight: 500; letter-spacing: 0.05em; }
.loc-action span { display: block; margin-top: 4px; font-size: 9px; color: var(--paper-faint); line-height: 1.6; }

/* 英雄详情 */
.hero-detail-head { display: flex; gap: 14px; align-items: flex-start; }
.hero-detail-head .portrait { width: 96px; box-shadow: 0 12px 30px rgba(0,0,0,.38), inset 0 0 24px rgba(0,0,0,.55); }
.hero-detail-name { font-family: var(--font-serif); font-size: 30px; font-weight: 500; letter-spacing: 0.08em; line-height: 1.1; }
.hero-detail-title { margin-top: 4px; font-size: 10px; color: var(--gold); letter-spacing: 0.1em; }
.hero-detail-era { margin-top: 3px; font-size: 9px; color: var(--paper-faint); }
.hero-detail-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.stat-box { padding: 9px; border: 1px solid var(--line-soft); border-radius: 2px; background: rgba(8, 12, 11, 0.25); }
.stat-box span { display: block; font-size: 8px; color: var(--paper-faint); letter-spacing: 0.1em; }
.stat-box strong { display: block; margin-top: 3px; font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--paper); }
.stat-box em { font-style: normal; font-size: 8px; color: var(--jade-bright); margin-left: 2px; }
.hero-quote { margin-top: 14px; padding-left: 10px; border-left: 1px solid var(--gold); font-family: var(--font-serif); font-size: 13px; line-height: 1.8; color: var(--gold-bright); }
.hero-bio { margin-top: 9px; font-size: 10px; line-height: 1.9; color: var(--paper-dim); }
.history-card { margin-top: 14px; padding: 13px; border: 1px solid rgba(201, 164, 92, 0.2); background: linear-gradient(135deg, rgba(201, 164, 92, 0.06), rgba(8, 12, 11, 0.2)); border-radius: 3px; }
.history-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.history-seal { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(201, 164, 92, 0.45); border-radius: 50%; font-family: var(--font-serif); font-size: 15px; color: var(--gold-bright); background: rgba(201, 164, 92, 0.06); }
.history-head strong { display: block; font-family: var(--font-serif); font-size: 15px; font-weight: 500; letter-spacing: 0.08em; color: var(--paper); }
.history-head > div > span { display: block; margin-top: 3px; font-size: 8px; color: var(--paper-faint); line-height: 1.6; }
.history-card p { font-size: 10px; line-height: 1.95; color: var(--paper-dim); }
.detail-section { margin-top: 18px; }
.detail-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 9px; letter-spacing: 0.18em; color: var(--paper-faint); text-transform: uppercase; }
.detail-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.skill-row { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 3px; margin-bottom: 7px; background: rgba(8, 12, 11, 0.22); }
.skill-glyph { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-serif); font-size: 16px; color: var(--gold-bright); border: 1px solid rgba(201, 164, 92, 0.3); background: rgba(201, 164, 92, 0.06); }
.skill-info { flex: 1; min-width: 0; }
.skill-name-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.skill-name-line strong { font-size: 12px; font-weight: 500; }
.skill-cost { font-size: 8px; color: var(--paper-faint); white-space: nowrap; }
.skill-desc { margin-top: 3px; font-size: 9px; line-height: 1.65; color: var(--paper-dim); }
.skill-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.gear-slot { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px dashed var(--line-soft); border-radius: 3px; }
.gear-slot.filled { border-style: solid; border-color: rgba(201, 164, 92, 0.26); background: rgba(201, 164, 92, 0.035); }
.gear-slot .item-glyph { width: 34px; height: 34px; font-size: 15px; }
.gear-name { font-family: var(--font-serif); font-size: 15px; }
.gear-desc { margin-top: 2px; font-size: 8px; color: var(--paper-faint); }
.gear-list { margin-top: 8px; display: grid; gap: 6px; }
.gear-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 2px; font-size: 10px; text-align: left; }
.gear-option:hover { border-color: var(--line); }
.gear-option.equipped { border-color: rgba(111, 158, 142, 0.4); color: var(--jade-bright); }
.gear-option small { color: var(--paper-faint); font-size: 8px; }
.gender-switch { display: flex; gap: 8px; }
.gender-switch .btn { flex: 1; }
.hero-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.hero-detail-actions .btn { width: 100%; }

/* 事件 */
.event-choice { display: block; width: 100%; text-align: left; padding: 13px; margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 3px; background: rgba(236, 226, 202, 0.025); transition: 0.2s; }
.event-choice:hover { border-color: rgba(201, 164, 92, 0.4); background: rgba(201, 164, 92, 0.05); }
.event-choice strong { display: block; font-size: 12px; font-weight: 500; }
.event-choice span { display: block; margin-top: 4px; font-size: 9px; color: var(--paper-faint); }
.event-choice:disabled { opacity: 0.4; }
.event-result { text-align: center; padding: 8px 4px; }
.event-result .event-result-glyph { width: 54px; height: 54px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-family: var(--font-serif); font-size: 22px; color: var(--gold-bright); }
.event-result h3 { font-family: var(--font-serif); font-size: 24px; font-weight: 500; letter-spacing: 0.08em; }
.event-result p { margin-top: 10px; font-size: 11px; line-height: 1.9; color: var(--paper-dim); }
.gain-list { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.gain-chip { padding: 4px 9px; border: 1px solid var(--line); border-radius: 99px; font-size: 9px; color: var(--gold-bright); background: rgba(201, 164, 92, 0.05); }

/* 对话 */
.dialogue-overlay {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px 16px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 25%, rgba(62, 86, 74, 0.28), transparent 58%),
    linear-gradient(180deg, rgba(6, 9, 8, 0.76), rgba(4, 7, 6, 0.97));
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease both;
  overflow: hidden;
}
.dialogue-overlay::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 78%, var(--scene, rgba(201, 164, 92, 0.1)), transparent 55%);
  pointer-events: none;
}
.dialogue-skip { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; z-index: 3; font-size: 10px; color: var(--paper-faint); letter-spacing: 0.14em; padding: 6px 9px; border: 1px solid var(--line-soft); border-radius: 99px; background: rgba(8, 12, 11, 0.4); }
.dialogue-stage { position: relative; z-index: 2; flex: 1; display: flex; align-items: flex-end; justify-content: center; min-height: 0; padding-bottom: 16px; }
.dialogue-portrait-wrap { position: relative; display: flex; flex-direction: column; align-items: center; animation: portraitIn 0.5s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.dialogue-portrait-wrap .portrait { width: clamp(118px, 34vw, 220px); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(201, 164, 92, 0.24); }
.dialogue-portrait-wrap .portrait .glyph { font-size: clamp(54px, 16vw, 100px); }
.dialogue-name {
  position: relative; z-index: 2; margin-top: -14px;
  padding: 6px 18px; border: 1px solid rgba(201, 164, 92, 0.42);
  background: #111815; color: var(--gold-bright);
  font-family: var(--font-serif); font-size: 15px; letter-spacing: 0.16em;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.dialogue-scene-label { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 18px; z-index: 3; font-family: var(--font-serif); font-size: 12px; letter-spacing: 0.18em; color: rgba(188, 178, 155, 0.55); writing-mode: vertical-rl; }
.dialogue-box {
  position: relative; z-index: 3; width: min(760px, 100%); margin: 0 auto;
  min-height: 114px; padding: 18px 18px 16px;
  border: 1px solid rgba(201, 164, 92, 0.26);
  background: linear-gradient(160deg, rgba(20, 29, 26, 0.96), rgba(8, 12, 10, 0.97));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(236, 226, 202, 0.05);
}
.dialogue-box::before { content: ""; position: absolute; left: 8px; top: 8px; width: 12px; height: 12px; border-left: 1px solid var(--gold); border-top: 1px solid var(--gold); opacity: 0.6; }
.dialogue-box::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 12px; height: 12px; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold); opacity: 0.6; }
.dialogue-text { font-family: var(--font-serif); font-size: clamp(15px, 2.6vw, 18px); line-height: 1.85; letter-spacing: 0.05em; color: #eae0c9; min-height: 62px; }
.dialogue-text.narration { color: var(--paper-dim); font-size: clamp(13px, 2.3vw, 16px); }
.dialogue-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.dialogue-progress { font-size: 9px; color: var(--paper-faint); letter-spacing: 0.12em; }
.dialogue-next { font-size: 10px; color: var(--gold); letter-spacing: 0.16em; animation: nextBlink 1.8s ease-in-out infinite; }
.dialogue-narrator-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 130px; height: 130px; border: 1px solid rgba(201, 164, 92, 0.18); border-radius: 50%; display: grid; place-items: center; font-family: var(--font-serif); font-size: 56px; color: rgba(201, 164, 92, 0.18); }
.dialogue-narrator-mark::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(201, 164, 92, 0.08); border-radius: 50%; }

/* 奖励 / 结算 */
.reward-overlay { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(3, 6, 5, 0.8); backdrop-filter: blur(8px); animation: fadeIn 0.25s ease both; }
.reward-card { position: relative; width: min(480px, 100%); max-height: 90dvh; overflow-y: auto; border: 1px solid rgba(201, 164, 92, 0.4); background: radial-gradient(ellipse at 50% -10%, rgba(201, 164, 92, 0.16), transparent 55%), #0d1412; padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); text-align: center; box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7); animation: rewardIn 0.4s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.reward-card::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(201, 164, 92, 0.12); pointer-events: none; }
.reward-kicker { font-size: 9px; letter-spacing: 0.34em; color: var(--gold); }
.reward-title { margin-top: 8px; font-family: var(--font-serif); font-size: 34px; font-weight: 500; letter-spacing: 0.14em; }
.reward-sub { margin-top: 6px; font-size: 10px; color: var(--paper-faint); letter-spacing: 0.1em; }
.reward-icon { margin: 16px auto 0; width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font-family: var(--font-serif); font-size: 28px; color: var(--gold-bright); background: rgba(201, 164, 92, 0.06); }
.reward-items { display: grid; gap: 6px; margin-top: 16px; text-align: left; }
.reward-item { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.reward-item span { color: var(--paper-dim); }
.reward-item b { color: var(--gold-bright); font-weight: 500; }
.reward-card .btn { margin-top: 16px; width: 100%; }
.reward-levelups { margin-top: 10px; padding: 9px; border: 1px dashed var(--line); font-size: 9px; color: var(--jade-bright); line-height: 1.7; }
.reward-hero { margin: 14px auto 0; width: 100%; }
.reward-hero .hero-detail-name { white-space: nowrap; }
.reward-hero .portrait { width: 96px; margin: 0 auto; }
.reward-stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 14px; }
.reward-stat-row div { padding: 9px; border: 1px solid var(--line-soft); font-size: 9px; color: var(--paper-faint); }
.reward-stat-row b { display: block; margin-top: 3px; font-family: var(--font-serif); font-size: 18px; color: var(--paper); font-weight: 500; }

/* 提示 */
.toast-root { position: fixed; z-index: 3000; left: 50%; bottom: calc(98px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: min(92vw, 430px); }
.toast {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 8px 14px; border: 1px solid rgba(201, 164, 92, 0.3); border-radius: 99px;
  background: rgba(12, 18, 16, 0.94); color: var(--paper); font-size: 11px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px);
  animation: toastIn 0.24s ease both;
}
.toast.out { animation: toastOut 0.22s ease both; }
.toast .toast-glyph { color: var(--gold); font-family: var(--font-serif); }

/* ================= 战棋 ================= */
.battle-screen {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--battle-bg, #0a0e0d);
  animation: fadeIn 0.3s ease both;
  --board-max: 780px;
}
.battle-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 8%, var(--battle-glow, rgba(201, 164, 92, 0.12)), transparent 42%),
    linear-gradient(180deg, rgba(5, 8, 7, 0.1), rgba(5, 8, 7, 0.82));
}
.battle-ambient { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0.5; }
.battle-atmosphere { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.battle-atmosphere .ba-glyph {
  position: absolute; right: -2vw; top: 8%; font-family: var(--font-serif);
  font-size: clamp(180px, 44vw, 460px); line-height: 1; color: #e9d8ae; opacity: 0.035;
  text-shadow: 0 0 80px rgba(201,164,92,.08);
}
.battle-atmosphere .ba-ring {
  position: absolute; left: 50%; top: 44%; width: min(62vw, 420px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border: 1px solid rgba(201,164,92,.07); border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(201,164,92,.015), 0 0 0 58px rgba(201,164,92,.01);
}
.battle-atmosphere .ba-label {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font-family: var(--font-serif); font-size: 11px;
  letter-spacing: .42em; color: rgba(236,226,202,.16);
}
.battle-atmosphere .ba-mark {
  position: absolute; right: 14px; bottom: 16%; writing-mode: vertical-rl;
  font-size: 8px; letter-spacing: .35em; color: rgba(201,164,92,.18);
}
.battle-ambient i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--battle-particle, #d9bf85); opacity: 0.4; animation: emberFloat linear infinite; }
.battle-header {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(9px + env(safe-area-inset-top)) 12px 7px;
}
.battle-title-wrap { text-align: center; min-width: 0; }
.battle-title { font-family: var(--font-serif); font-size: 16px; letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-subtitle { margin-top: 2px; font-size: 8px; color: var(--paper-faint); letter-spacing: 0.14em; }
.battle-hud-btns { display: flex; gap: 5px; }
.battle-hud-btn { height: 30px; padding: 0 9px; font-size: 9px; letter-spacing: 0.06em; border: 1px solid var(--line-soft); border-radius: 99px; color: var(--paper-dim); background: rgba(8, 12, 11, 0.45); display: inline-flex; align-items: center; gap: 4px; }
.battle-hud-btn.active { color: var(--gold-bright); border-color: rgba(201, 164, 92, 0.45); }
.battle-objective {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 14px 7px; max-width: 900px; width: 100%; margin: 0 auto;
  font-size: 9px; color: var(--paper-faint); letter-spacing: 0.06em;
}
.battle-objective .obj-main { color: var(--paper-dim); }
.battle-objective .obj-main b { color: var(--gold-bright); font-weight: 500; }
.battlefield {
  position: relative; z-index: 3;
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 8px;
}
.battle-grid {
  position: relative;
  width: min(100%, var(--board-max));
  height: min(43dvh, 380px);
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(6, 1fr);
  border: 1px solid rgba(201, 164, 92, 0.35);
  background: rgba(6, 10, 8, 0.72);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), inset 0 0 40px rgba(0, 0, 0, 0.5);
  user-select: none;
  touch-action: manipulation;
}
.battle-grid::before { content: ""; position: absolute; inset: -5px; border: 1px solid rgba(201, 164, 92, 0.12); pointer-events: none; }
.battle-grid::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 42px; height: 42px;
  transform: translate(-50%, -50%); border: 1px solid rgba(201, 164, 92, 0.1); border-radius: 50%;
  pointer-events: none;
}
.tile {
  position: relative; padding: 0; min-width: 0; min-height: 0;
  border-right: 1px solid rgba(236, 226, 202, 0.055);
  border-bottom: 1px solid rgba(236, 226, 202, 0.055);
  background: var(--tile, rgba(53, 72, 62, 0.28));
  transition: background 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.tile:nth-child(9n) { border-right: 0; }
.tile[data-terrain="forest"] { background: rgba(44, 78, 56, 0.66); }
.tile[data-terrain="hill"] { background: rgba(92, 81, 55, 0.62); }
.tile[data-terrain="water"] { background: rgba(32, 69, 78, 0.74); cursor: not-allowed; }
.tile[data-terrain="ruins"] { background: rgba(76, 65, 53, 0.6); }
.tile .terrain-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-serif); font-size: 9px; color: rgba(222, 213, 191, 0.18);
  pointer-events: none;
}
.tile[data-terrain="water"] .terrain-mark { color: rgba(124, 173, 183, 0.34); }
.tile::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.12s; }
.tile.move::after { opacity: 1; background: rgba(91, 155, 193, 0.2); box-shadow: inset 0 0 0 1px rgba(131, 194, 226, 0.32); }
.tile.attack::after { opacity: 1; background: rgba(191, 82, 67, 0.16); box-shadow: inset 0 0 0 1px rgba(218, 122, 102, 0.3); }
.tile.aoe::after { opacity: 1; background: rgba(214, 154, 74, 0.18); box-shadow: inset 0 0 0 1px rgba(232, 183, 108, 0.34); }
.tile.targetable::after { opacity: 1; background: rgba(204, 83, 66, 0.2); box-shadow: inset 0 0 0 1px rgba(231, 129, 107, 0.48); animation: targetPulse 1.5s ease-in-out infinite; }
.tile.preview::after { opacity: 1; background: rgba(183, 70, 55, 0.34); box-shadow: inset 0 0 0 1px rgba(238, 143, 120, 0.7); }
.tile.selected::after { opacity: 1; background: transparent; box-shadow: inset 0 0 0 2px rgba(239, 215, 158, 0.85), inset 0 0 18px rgba(201, 164, 92, 0.18); }
.tile:hover::after { opacity: 0.6; }
.tile:disabled { cursor: default; }
.unit-layer, .fx-layer { position: absolute; inset: 0; pointer-events: none; }
.fx-layer { z-index: 8; overflow: visible; }
.unit-token {
  position: absolute; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 2px;
  transition: left 0.16s linear, top 0.16s linear, opacity 0.2s, transform 0.2s;
}
.unit-token .unit-avatar {
  position: relative; overflow: visible;
  width: 92%; aspect-ratio: 1; max-width: clamp(36px, 5.8vw, 58px);
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--u1, #6f9e8e) 80%, white 0%), transparent 60%),
    radial-gradient(circle at 72% 76%, var(--u2, #c9a45c), transparent 58%),
    #111a17;
  border: 1px solid color-mix(in srgb, var(--u2, #c9a45c) 65%, transparent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.4);
  color: #f2e8d1;
  font-family: var(--font-serif); font-size: clamp(15px, 4.1vw, 24px); line-height: 1;
}
.unit-token.enemy .unit-avatar { border-color: color-mix(in srgb, #d07868 70%, transparent); background: radial-gradient(circle at 50% 35%, #352b2a, #0b0e0d 78%); }
.unit-token.enemy .unit-avatar .hero-figure { filter: brightness(1.2) saturate(0.8) drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.unit-token.boss .unit-avatar { box-shadow: 0 0 0 2px rgba(201, 164, 92, 0.5), 0 0 18px rgba(201, 164, 92, 0.22); }
.unit-token.player .unit-avatar { box-shadow: 0 0 0 2px rgba(169, 205, 189, 0.5), 0 0 18px rgba(111, 158, 142, 0.26); }
.unit-token .unit-avatar .hero-figure { inset: -4%; width: 108%; height: 108%; filter: brightness(1.15) drop-shadow(0 2px 3px rgba(0,0,0,.45)); clip-path: circle(50% at 50% 50%); border-radius: 50%; }
.unit-token .unit-lv {
  position: absolute; right: -2px; bottom: -2px; z-index: 2;
  min-width: 13px; height: 13px; padding: 0 3px;
  display: grid; place-items: center;
  font-family: var(--font-body); font-size: 7px; color: #11150f;
  background: var(--u2, #c9a45c); border-radius: 99px;
  box-shadow: 0 0 0 1.5px rgba(8, 12, 11, 0.85);
}
.unit-token .unit-hp {
  width: 88%; height: 4px; margin-top: 2px; overflow: hidden;
  background: rgba(5, 8, 7, 0.8); border-radius: 99px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.unit-token .unit-hp i { display: block; height: 100%; background: linear-gradient(90deg, #6f9e8e, #a9cdbd); transition: width 0.3s; }
.unit-token.enemy .unit-hp i { background: linear-gradient(90deg, #9e4e43, #d07a6b); }
.unit-token .unit-energy { width: 60%; height: 2px; margin-top: 1px; background: rgba(5, 8, 7, 0.7); border-radius: 99px; overflow: hidden; }
.unit-token .unit-energy i { display: block; height: 100%; background: #d5b46e; transition: width 0.3s; }
.unit-token .unit-status {
  position: absolute; left: -3px; top: -3px; display: flex; gap: 1px; z-index: 2;
}
.unit-token .unit-status span { width: 12px; height: 12px; display: grid; place-items: center; font-size: 7px; border-radius: 50%; background: rgba(8, 12, 11, 0.92); border: 1px solid var(--line); color: var(--gold-bright); }
.unit-token .unit-shield { position: absolute; inset: -2px; border-radius: 50%; border: 1px solid rgba(111, 158, 190, 0.65); box-shadow: 0 0 8px rgba(101, 155, 189, 0.4); }
.unit-token.acted { opacity: 0.52; filter: saturate(0.4); }
.unit-token.selected { z-index: 6; }
.unit-token.selected .unit-avatar { outline: 2px solid #efd79e; outline-offset: 2px; box-shadow: 0 0 24px rgba(239, 215, 158, 0.45); }
.unit-token.dead { opacity: 0; transform: scale(0.6); pointer-events: none; }
.unit-token.hit .unit-avatar { animation: hitShake 0.28s ease; }
.unit-token.attack-lunge { transform: translateY(-6px) scale(1.08); }
.unit-token.enemy.attack-lunge { transform: translateY(6px) scale(1.08); }
.unit-token.heal-flash .unit-avatar { box-shadow: 0 0 24px rgba(120, 205, 170, 0.7); }
.unit-token .unit-buff { position: absolute; right: -2px; top: -3px; display: flex; gap: 1px; }
.unit-token .unit-buff span { width: 11px; height: 11px; display: grid; place-items: center; font-size: 6px; border-radius: 50%; background: rgba(8, 12, 11, 0.9); color: var(--jade-bright); border: 1px solid rgba(111, 158, 142, 0.45); }

.float-text {
  position: absolute; z-index: 9;
  left: var(--fx, 50%); top: var(--fy, 50%);
  transform: translate(-50%, -50%);
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  color: #f4e2b4; text-shadow: 0 2px 4px #000, 0 0 12px rgba(0, 0, 0, 0.7);
  pointer-events: none; white-space: nowrap;
  animation: floatUp 0.85s ease-out forwards;
}
.float-text.enemy { color: #ffb3a3; }
.float-text.heal { color: #9fe3c4; }
.float-text.crit { font-size: 24px; color: #ffd98c; }
.float-text.miss { color: #c8c2b4; font-size: 14px; }
.float-text.status { font-size: 11px; letter-spacing: 0.08em; color: #d8c598; }
.battle-screen.shake .battle-grid { animation: battleShake 0.3s ease; }
.battle-screen.speed-2 .unit-token { transition-duration: 0.09s; }

.turn-banner {
  position: fixed; z-index: 20; left: 50%; top: 38%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
  animation: bannerIn 1.4s ease forwards;
}
.turn-banner .tb-line { width: 150px; height: 1px; margin: 0 auto 10px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.turn-banner .tb-title { font-family: var(--font-serif); font-size: clamp(30px, 8vw, 46px); letter-spacing: 0.24em; color: var(--gold-bright); text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7); white-space: nowrap; }
.turn-banner .tb-sub { margin-top: 4px; font-size: 9px; letter-spacing: 0.3em; color: var(--paper-dim); }
.turn-banner.enemy .tb-title { color: #d08a7e; }
.turn-banner.enemy .tb-line { background: linear-gradient(90deg, transparent, #b06a5e, transparent); }

.skill-flash {
  position: fixed; z-index: 19; left: 50%; top: 25%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
  animation: skillFlash 1.1s ease forwards;
}
.skill-flash .sf-name { font-family: var(--font-serif); font-size: clamp(26px, 7vw, 42px); letter-spacing: 0.18em; color: #fff0c7; text-shadow: 0 0 30px rgba(201, 164, 92, 0.75), 0 3px 8px #000; white-space: nowrap; }
.skill-flash .sf-caster { margin-top: 4px; font-size: 9px; color: var(--gold); letter-spacing: 0.2em; }

.battle-panel {
  position: relative; z-index: 7;
  flex: 0 0 auto;
  width: 100%;
  background: linear-gradient(180deg, rgba(8, 13, 11, 0.74), rgba(7, 11, 9, 0.98));
  border-top: 1px solid rgba(201, 164, 92, 0.24);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: blur(14px);
}
.battle-panel-inner { width: min(100%, var(--board-max)); margin: 0 auto; }
.battle-info-row { display: flex; align-items: center; gap: 9px; min-height: 32px; }
.battle-info-portrait { width: 30px; }
.battle-info-row > .portrait { width: 32px; flex: 0 0 32px; }
.battle-info-main { flex: 1; min-width: 0; }
.battle-info-name { display: flex; align-items: baseline; gap: 6px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-info-name strong { font-family: var(--font-serif); font-size: 15px; font-weight: 500; letter-spacing: 0.05em; }
.battle-info-name em { font-style: normal; font-size: 8px; color: var(--paper-faint); }
.battle-bars { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.battle-bars .bhp { flex: 1; height: 4px; background: rgba(236, 226, 202, 0.1); border-radius: 99px; overflow: hidden; }
.battle-bars .bhp i { display: block; height: 100%; background: linear-gradient(90deg, #6f9e8e, #a9cdbd); transition: width 0.25s; }
.battle-bars .benergy { width: 54px; height: 3px; background: rgba(236, 226, 202, 0.1); border-radius: 99px; overflow: hidden; }
.battle-bars .benergy i { display: block; height: 100%; background: var(--gold); transition: width 0.25s; }
.battle-info-stats { font-size: 8px; color: var(--paper-faint); white-space: nowrap; }
.battle-hint { margin-top: 4px; font-size: 8px; color: var(--paper-faint); letter-spacing: 0.04em; min-height: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.battle-actions { display: flex; gap: 6px; margin-top: 7px; }
.battle-action {
  flex: 1; min-width: 0; min-height: 38px; border: 1px solid rgba(201, 164, 92, 0.26);
  border-radius: 2px; background: rgba(201, 164, 92, 0.055);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--paper); font-size: 10px; letter-spacing: 0.06em; transition: 0.16s;
}
.battle-action small { font-size: 7px; color: var(--paper-faint); letter-spacing: 0.02em; }
.battle-action:hover { border-color: rgba(201, 164, 92, 0.55); background: rgba(201, 164, 92, 0.1); }
.battle-action:disabled { opacity: 0.3; }
.battle-action.primary { background: linear-gradient(135deg, rgba(201, 164, 92, 0.22), rgba(201, 164, 92, 0.08)); border-color: rgba(201, 164, 92, 0.5); }
.battle-action.end { border-color: rgba(111, 158, 142, 0.35); background: rgba(111, 158, 142, 0.07); color: var(--jade-bright); }
.battle-action.end.ready { animation: endPulse 1.8s ease-in-out infinite; }
.battle-logline { margin-top: 5px; font-size: 8px; color: rgba(188, 178, 155, 0.6); text-align: center; min-height: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skill-sheet { position: fixed; z-index: 25; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(94vw, var(--board-max)); max-height: 58dvh; overflow-y: auto; border: 1px solid rgba(201, 164, 92, 0.4); background: #0d1412; box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6); padding: 12px; animation: skillSheetUp 0.24s ease both; }
.skill-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.skill-sheet-head span { font-size: 9px; color: var(--paper-faint); letter-spacing: 0.16em; }
.skill-choice { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px; border: 1px solid var(--line-soft); border-radius: 3px; margin-top: 6px; text-align: left; background: rgba(236, 226, 202, 0.025); }
.skill-choice:hover { border-color: rgba(201, 164, 92, 0.42); }
.skill-choice:disabled { opacity: 0.38; }
.skill-choice .skill-glyph { width: 36px; height: 36px; }
.skill-choice-main { flex: 1; min-width: 0; }
.skill-choice .skill-name-line strong { font-size: 13px; }
.skill-choice .skill-desc { font-size: 9px; }
.skill-choice .skill-meta { font-size: 8px; color: var(--gold); white-space: nowrap; }
.aoe-confirm {
  position: fixed; z-index: 26; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(94vw, var(--board-max)); padding: 10px 12px;
  border: 1px solid rgba(201, 164, 92, 0.45); background: rgba(11, 17, 15, 0.98);
  display: flex; align-items: center; gap: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.aoe-confirm .aoe-text { flex: 1; font-size: 10px; color: var(--paper-dim); line-height: 1.5; }
.aoe-confirm .aoe-text b { color: var(--gold-bright); }
.aoe-confirm .btn { min-height: 32px; padding: 0 12px; font-size: 10px; }
.battle-result-actions { display: flex; gap: 8px; }

/* 战棋主题 */
.theme-changan { --battle-bg: #0d1310; --battle-glow: rgba(225, 157, 80, 0.16); --battle-particle: #e6b76f; }
.theme-luoyang { --battle-bg: #120f11; --battle-glow: rgba(203, 123, 120, 0.16); --battle-particle: #dca3a0; }
.theme-chibi { --battle-bg: #0c1113; --battle-glow: rgba(196, 94, 61, 0.2); --battle-particle: #e0906c; }
.theme-dunhuang { --battle-bg: #14110c; --battle-glow: rgba(211, 166, 85, 0.2); --battle-particle: #e3c17f; }
.theme-rome { --battle-bg: #120f0d; --battle-glow: rgba(192, 109, 77, 0.17); --battle-particle: #d89373; }
.theme-athens { --battle-bg: #0e1211; --battle-glow: rgba(144, 170, 150, 0.16); --battle-particle: #bcd4bf; }
.theme-alexandria { --battle-bg: #12110c; --battle-glow: rgba(214, 177, 95, 0.18); --battle-particle: #e4ca8c; }
.theme-florence { --battle-bg: #12100d; --battle-glow: rgba(188, 142, 87, 0.18); --battle-particle: #dbb784; }
.theme-paris { --battle-bg: #0e1116; --battle-glow: rgba(138, 152, 190, 0.16); --battle-particle: #b6c2dc; }
.theme-london { --battle-bg: #0c1112; --battle-glow: rgba(118, 147, 148, 0.18); --battle-particle: #b9d2d0; }
.theme-rift { --battle-bg: #0b0d0e; --battle-glow: rgba(212, 185, 120, 0.2); --battle-particle: #eed89c; }
.battle-screen.theme-changan .battle-screen-glow { background: radial-gradient(ellipse at 50% 0%, rgba(225, 157, 80, 0.14), transparent 55%); }

/* 广告播放 */
.ad-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(2, 5, 4, 0.92); animation: fadeIn 0.2s ease both; }
.ad-player { position: relative; width: min(520px, 100%); min-height: min(560px, 82dvh); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(201, 164, 92, 0.35); background: #0d1412; box-shadow: 0 30px 100px rgba(0, 0, 0, 0.8); }
.ad-visual { position: relative; flex: 1; min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; padding: 26px 22px; overflow: hidden; }
.ad-visual::before { content: ""; position: absolute; inset: 0; background: var(--ad-bg, linear-gradient(140deg, #243d36, #0d1412)); }
.ad-visual::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.08), transparent 60%), linear-gradient(180deg, transparent 40%, rgba(6, 9, 8, 0.88)); }
.ad-visual.tea { --ad-bg: linear-gradient(140deg, #2f4a3d, #0d1712 70%); }
.ad-visual.sand { --ad-bg: linear-gradient(140deg, #7a5b35, #1a130c 72%); }
.ad-visual.ink { --ad-bg: linear-gradient(140deg, #2c3b3d, #0c1112 72%); }
.ad-visual.sea { --ad-bg: linear-gradient(140deg, #2d4c57, #0b1214 72%); }
.ad-brand { position: relative; z-index: 2; font-size: 9px; letter-spacing: 0.3em; color: rgba(239, 215, 158, 0.8); }
.ad-big-title { position: relative; z-index: 2; margin-top: 8px; font-family: var(--font-serif); font-size: clamp(30px, 8vw, 46px); line-height: 1.18; letter-spacing: 0.1em; color: #f4ead2; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.45); }
.ad-copy { position: relative; z-index: 2; margin-top: 11px; max-width: 340px; font-size: 11px; line-height: 1.8; color: rgba(236, 226, 202, 0.78); }
.ad-cta { position: relative; z-index: 2; align-self: flex-start; margin-top: 18px; padding: 8px 18px; border: 1px solid rgba(239, 215, 158, 0.55); font-size: 10px; letter-spacing: 0.16em; color: #f2e6c8; background: rgba(0, 0, 0, 0.2); }
.ad-orbit { position: absolute; z-index: 1; right: -30px; top: 20px; width: 160px; height: 160px; border: 1px solid rgba(239, 215, 158, 0.18); border-radius: 50%; box-shadow: 0 0 0 18px rgba(239, 215, 158, 0.03), 0 0 0 38px rgba(239, 215, 158, 0.02); animation: slowSpin 30s linear infinite; }
.ad-bottom { position: relative; z-index: 3; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); background: #0a100e; }
.ad-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 9px; color: var(--paper-faint); letter-spacing: 0.08em; }
.ad-status b { color: var(--gold-bright); font-weight: 500; }
.ad-progress { height: 3px; margin-top: 8px; background: rgba(236, 226, 202, 0.1); overflow: hidden; }
.ad-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--jade), var(--gold)); transition: width 0.3s linear; }
.ad-actions { display: flex; gap: 8px; margin-top: 9px; }
.ad-actions .btn { flex: 1; min-height: 38px; font-size: 10px; }
.ad-disclaimer { margin-top: 8px; font-size: 8px; color: rgba(188, 178, 155, 0.45); line-height: 1.6; text-align: center; }

/* ================= 动画 ================= */
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes skillSheetUp { from { opacity: 0; transform: translate(-50%, 28px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes rewardIn { from { opacity: 0; transform: translateY(22px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes fogDrift { from { transform: translateX(-3%) scaleY(1); } to { transform: translateX(4%) scaleY(1.12); } }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.65; } }
@keyframes nodePulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(8, 12, 11, 0.65), 0 0 0 0 rgba(201, 164, 92, 0.3), inset 0 0 18px rgba(201, 164, 92, 0.12); } 50% { box-shadow: 0 0 0 4px rgba(8, 12, 11, 0.65), 0 0 0 9px rgba(201, 164, 92, 0), inset 0 0 24px rgba(201, 164, 92, 0.22); } }
@keyframes slowSpin { to { transform: rotate(360deg); } }
@keyframes nextBlink { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes portraitIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes targetPulse { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(231, 129, 107, 0.35); } 50% { box-shadow: inset 0 0 0 2px rgba(238, 151, 130, 0.72); } }
@keyframes hitShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-3px) rotate(-2deg); } 40% { transform: translateX(3px) rotate(2deg); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
@keyframes battleShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(0.8); } 18% { opacity: 1; transform: translate(-50%, -70%) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -210%) scale(0.92); } }
@keyframes bannerIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.94); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 72% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -58%) scale(1.02); } }
@keyframes skillFlash { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.9); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1.03); } }
@keyframes endPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(111, 158, 142, 0.18); } 50% { box-shadow: 0 0 0 5px rgba(111, 158, 142, 0); } }
@keyframes emberFloat { 0% { transform: translateY(20px) translateX(0); opacity: 0; } 12% { opacity: 0.55; } 100% { transform: translateY(-140px) translateX(18px); opacity: 0; } }
@keyframes targetReticle { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } }

/* ================= 响应式 ================= */
@media (min-width: 720px) {
  .roster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-card.player-card { grid-column: span 2; }
  .item-grid, .artifact-grid, .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view { padding-left: 24px; padding-right: 24px; }
  .map-viewport { height: clamp(380px, 52vh, 620px); }
  .modal-overlay { align-items: center; padding: 24px; }
  .modal-card { border-radius: 4px; }
  .modal-foot .btn { flex: 0 1 auto; }
  .landing-content { padding-bottom: 60px; }
}
@media (min-width: 1080px) {
  .roster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-card.player-card { grid-column: span 2; }
  .item-grid, .artifact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .player-mini .portrait { width: 32px; }
  .player-mini-exp .progress { width: 48px; }
  .res-chip { height: 24px; padding: 0 6px; font-size: 9px; }
  .view { padding: 13px 11px calc(20px + env(safe-area-inset-bottom)); }
  .hero-card { padding: 10px; }
  .hero-card .portrait { width: 48px; }
  .hero-card-top { gap: 8px; }
  .hero-card-name { font-size: 16px; letter-spacing: 0; }
  .hero-card-title { font-size: 8px; letter-spacing: 0.02em; }
  .hero-card-meta { gap: 3px; margin-top: 6px; }
  .hero-card-meta .pill { font-size: 8px; padding: 3px 6px; }
  .hero-card-level { font-size: 8px; }

  .hero-card.player-card { padding: 13px; }
  .hero-card.player-card .portrait { width: 72px; }
  .hero-card.player-card .hero-card-name { font-size: 22px; letter-spacing: 0.03em; }
  .hero-card.player-card .hero-card-level { max-width: 100%; padding-right: 0; font-size: 9px; }
  .section-head h2 { font-size: 23px; }
  .map-head h2 { font-size: 24px; }
  .path-grid, .starter-grid { grid-template-columns: 1fr; }
  .gender-card .portrait { width: 66px; }
  .path-card p, .starter-card p { min-height: 0; }
  .starter-card { grid-template-columns: 58px 1fr; column-gap: 10px; padding: 13px 12px; }
  .starter-card .portrait { width: 54px; }
  .starter-card h4 { font-size: 19px; }
  .starter-card p { min-height: 0; }
  .creation-inner { padding-left: 14px; padding-right: 14px; }
  .creation-submit .btn { min-width: 0; width: 100%; }
  .quest-tab, .inv-tab { padding: 9px 10px; font-size: 10px; }
  .modal-overlay { padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .modal-card { max-height: 92dvh; }
  .modal-body { padding: 13px; }
  .location-hero { margin: -13px -13px 13px; padding: 22px 14px 17px; }
  .location-hero h2 { font-size: 32px; }
  .location-hero p { max-width: 92%; }
  .hero-detail-head .portrait { width: 74px; }
  .hero-detail-name { font-size: 26px; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-detail-actions { grid-template-columns: 1fr 1fr; }
  .battle-grid { width: min(calc(100vw - 12px), var(--board-max)); height: min(44dvh, 370px); }
  .battle-panel { padding-left: 7px; padding-right: 7px; }
  .battle-action { min-height: 36px; font-size: 9px; }
  .battle-action small { display: none; }
  .battle-info-stats { display: none; }
  .unit-token .unit-avatar { max-width: 34px; font-size: clamp(12px, 3.8vw, 18px); }
  .unit-token .unit-hp { height: 3px; }
  .dialogue-overlay { padding: 14px 12px calc(18px + env(safe-area-inset-bottom)); }
  .dialogue-box { min-height: 100px; padding: 14px 14px 12px; }
  .dialogue-stage { padding-bottom: 8px; }
  .ads-hero h3 { font-size: 23px; }
}
@media (max-height: 700px) {
  .battle-grid { width: min(calc(100vw - 12px), var(--board-max)); height: min(40dvh, 300px); }
  .battle-panel { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .battle-info-row { min-height: 28px; }
  .battle-actions { margin-top: 5px; }
  .battle-action { min-height: 34px; }
  .battle-hint { display: none; }
  .battle-logline { display: none; }
}
@media (max-width: 380px) {
  .landing-content { padding-left: 16px; padding-right: 16px; }
  .landing h1 { font-size: 46px; letter-spacing: 0.04em; text-indent: 0.04em; }
  .title-lockup { gap: 10px; }
  .title-seal { width: 42px; font-size: 14px; }
  .landing-subtitle { letter-spacing: 0.45em; text-indent: 0.45em; }
  .hero-card-name { font-size: 15px; }
  .hero-card .portrait { width: 44px; }
  .hero-card.player-card .portrait { width: 68px; }
  .hero-card.player-card .hero-card-name { font-size: 21px; }
}
@media (max-width: 360px) {
  .res-chip.rep { display: none; }
  .battle-action { font-size: 8px; letter-spacing: 0; }
  .node-label { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
