@font-face {
  font-family: "BossBrush";
  src: url("./assets/fonts/ZCOOLKuaiLe-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f7f3e8;
  --paper-2: #fffdf6;
  --paper-3: #efe9da;
  --ink: #2b3a33;
  --ink-2: #5c6b62;
  --ink-3: #8a958d;
  --jade: #2f6b57;
  --jade-2: #7fa896;
  --jade-soft: #e9f2ea;
  --gold: #b8862c;
  --gold-soft: #f7edd5;
  --red: #b5563f;
  --red-soft: #f8e4da;
  --weapon: #2f6b57;
  --weapon-soft: #e9f2ea;
  --name: #b8862c;
  --name-soft: #f7edd5;
  --shovel: #b5563f;
  --shovel-soft: #f8e4da;
  --line: rgba(43, 58, 51, 0.12);
  --line-2: rgba(43, 58, 51, 0.2);
  --shadow: 0 6px 18px rgba(43, 58, 51, 0.08);
  --shadow-lg: 0 14px 34px rgba(43, 58, 51, 0.14);
  --font-ink: "Kaiti SC", "STKaiti", "Songti SC", "STSong", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: #ece7da;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(43, 58, 51, 0.12);
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  animation: fade-in 0.22s ease;
}

.screen.hidden { display: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.hidden { display: none !important; }

/* ---------------- 首页 ---------------- */

#scr-home {
  padding: clamp(12px, 2.2vh, 22px) 16px clamp(14px, 2.4vh, 24px);
  gap: clamp(10px, 1.5vh, 16px);
  justify-content: flex-start;
  background:
    radial-gradient(120% 70% at 50% 0%, #fffdf6 0%, rgba(255, 253, 246, 0) 70%),
    var(--paper);
}

.home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}

.rank {
  display: flex;
  align-items: center;
  gap: 9px;
}

.rank-avatar {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-ink);
  font-size: 21px;
  font-weight: 700;
  color: #fff8ea;
  background: radial-gradient(circle at 32% 26%, #fff6e2 0%, var(--c, #b5563f) 46%, #5d2419 100%);
  border: 2px solid var(--c, #b5563f);
  box-shadow: 0 3px 10px rgba(43, 58, 51, 0.18), inset 0 0 10px rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 2px rgba(60, 20, 10, 0.45);
}
.rank-avatar:active { transform: scale(0.96); }

.rank-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
}

.rank-badge {
  align-self: flex-start;
  padding: 2px 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: #8a6316;
  font-family: var(--font-ink);
  font-size: 13px;
  letter-spacing: 1px;
  background: var(--gold-soft);
  line-height: 1.2;
}

.rank-stars {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 2px;
  line-height: 1;
}

.rank small {
  color: var(--ink-3);
  font-size: 10px;
  max-width: 132px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 14px;
}

.coin i {
  color: var(--gold);
  font-style: normal;
  font-size: 12px;
}

.coin-ic {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  flex: 0 0 auto;
}
.coin b { font-weight: 600; }

.top-res {
  display: flex;
  align-items: center;
  gap: 6px;
}
.energy {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 6px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff4d6, #ffe0a3);
  border: 1px solid #f0c060;
  font-size: 14px;
  cursor: pointer;
  color: #8a5a12;
}
.energy i { font-style: normal; font-size: 12px; }
.energy small { font-size: 10px; opacity: .7; }

.hero {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(8px, 1.8vh, 18px);
  margin-top: clamp(2px, 1vh, 10px);
  padding-bottom: clamp(0px, 0.5vh, 6px);
}

.hero-title { text-align: center; }

.hero-title h1 {
  margin: 0;
  font-family: var(--font-ink);
  font-size: clamp(26px, 6.6vw, 33px);
  font-weight: 600;
  letter-spacing: 6px;
  text-indent: 6px;
  color: var(--ink);
}

.hero-title p {
  margin: 6px 0 0;
  font-size: 12px;
  letter-spacing: 4px;
  text-indent: 4px;
  color: var(--ink-3);
}

.hero-chars {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hc {
  --rot: 0deg;
  --hc: clamp(40px, 11vw, 50px);
  display: grid;
  place-items: center;
  width: var(--hc);
  height: var(--hc);
  border-radius: 11px;
  font-family: var(--font-ink);
  font-size: calc(var(--hc) * 0.52);
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: hc-float 2.4s ease-in-out infinite;
}

.hc.a { color: var(--jade); --rot: -5deg; }
.hc.b { color: var(--jade); --rot: 4deg; animation-delay: 0.18s; }
.hc.c { color: var(--gold); --rot: 4deg; animation-delay: 0.36s; }
.hc.d { color: var(--gold); --rot: -4deg; animation-delay: 0.54s; }

@keyframes hc-float {
  0%, 100% { transform: rotate(var(--rot)) translateY(0); }
  50% { transform: rotate(var(--rot)) translateY(-7px); }
}

.hc.vs {
  width: 22px;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--ink-3);
  font-size: 12px;
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 210px;
  max-height: min(500px, 54vh);
  margin-top: clamp(2px, 1vh, 10px);
}

.mode-card {
  position: relative;
  display: block;
  height: 100%;
  padding: 0;
  border: 1px solid rgba(120, 104, 72, 0.22);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #efe5cf, #e4d9c0);
  box-shadow: 0 10px 24px rgba(85, 72, 48, 0.14);
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.mode-card:active { transform: translateY(1px) scale(0.99); }

.mode-card .card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  pointer-events: none;
  transform: scale(1.02);
}

.mode-card.pvp .card-art { object-position: center 42%; }
.mode-card.endless .card-art { object-position: center 30%; }

.mode-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 36, 32, 0.02) 26%, rgba(24, 32, 28, 0.8) 100%);
}

.mode-card.endless::after {
  background: linear-gradient(180deg, rgba(18, 30, 32, 0.06) 20%, rgba(12, 26, 28, 0.88) 100%);
}

.mode-card .card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 12px 13px 14px;
  color: #f8f3e6;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-tag {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(247, 243, 232, 0.18);
  border: 1px solid rgba(247, 243, 232, 0.3);
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 1px;
  backdrop-filter: blur(4px);
}

.mode-card b {
  font-family: var(--font-ink);
  font-size: 21px;
  letter-spacing: 2px;
  font-weight: 600;
  margin-top: 3px;
}

.mode-card small {
  font-family: var(--font-ui);
  font-size: 10px;
  color: rgba(247, 243, 232, 0.76);
}

.card-go {
  margin-top: 5px;
  font-family: var(--font-ui);
  font-size: 10px;
  color: #f2d9a8;
  letter-spacing: 1px;
}

.home-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex: 0 0 auto;
}

.home-dock button {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(120, 104, 72, 0.26);
  background: #efe5cf;
  box-shadow: 0 4px 12px rgba(43, 58, 51, 0.1);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.home-dock button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 2px 6px rgba(43, 58, 51, 0.12);
}

.home-dock img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.home-dock button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 32, 28, 0) 42%, rgba(24, 32, 28, 0.74) 100%);
}

.home-dock .dock-txt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 2px 6px;
  color: #f8f3e6;
}

.home-dock b {
  font-family: var(--font-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1.15;
}

.home-dock small {
  font-size: 8px;
  letter-spacing: 0.5px;
  color: rgba(248, 243, 230, 0.72);
  white-space: nowrap;
}

.home-foot {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--ink-3);
  opacity: 0.75;
  flex: 0 0 auto;
}

.home-foot b { font-weight: 500; }

/* ---------------- 通用内页 ---------------- */

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex: 0 0 auto;
}

.bar .back {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-2);
}

.bar h2 {
  flex: 1;
  margin: 0;
  font-family: var(--font-ink);
  font-size: 19px;
  letter-spacing: 3px;
  font-weight: 600;
}

.bar-tail { font-size: 12px; color: var(--gold); }

.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 24px;
  -webkit-overflow-scrolling: touch;
}

.note {
  margin: 10px 4px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-3);
}

.note.center { text-align: center; }

.sec-title {
  margin: 20px 4px 10px;
  font-family: var(--font-ink);
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--ink-2);
  font-weight: 600;
}

.stage-list { display: flex; flex-direction: column; gap: 10px; }

.stage-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: left;
}

.stage-row.locked { opacity: 0.5; box-shadow: none; }

.stage-no {
  font-family: var(--font-ink);
  font-size: 22px;
  color: var(--jade-2);
}

.stage-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.stage-main b { font-family: var(--font-ink); font-size: 17px; letter-spacing: 2px; }
.stage-main small { font-size: 11px; color: var(--ink-3); }
.stage-right em { font-style: normal; font-size: 12px; }
.stage-right .gold { color: var(--gold); }
.stage-right .lock { color: var(--ink-3); }
.stage-right .done { color: var(--jade); }

.q-SSR { color: var(--gold); }
.q-SR { color: var(--jade); }
.q-S { color: var(--ink-3); }

.gen-families { display: flex; flex-direction: column; gap: 8px; }

.gen-family {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.gen-head {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 1px solid rgba(184, 134, 44, 0.4);
  background: var(--gold-soft);
  color: #8a6320;
  font-family: var(--font-ink);
  font-size: 18px;
}

.gen-members {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gen-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
  padding: 4px 8px 3px;
  border-radius: 9px;
  border: 1px solid rgba(184, 134, 44, 0.35);
  background: #fdf8ec;
  color: #7a5210;
  font-family: var(--font-ink);
  font-size: 19px;
  line-height: 1.15;
}

.gen-chip small {
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.gen-chip.q-SSR small { color: #a8781f; }
.gen-chip.q-SR small { color: var(--jade); }
.gen-chip.q-S small { color: var(--ink-3); }

.gen-panel { text-align: center; }

.gen-panel h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 4px;
  font-family: var(--font-ink);
  font-size: 22px;
  letter-spacing: 2px;
}

.gen-panel p { margin: 4px 0 0; font-size: 11px; color: var(--ink-3); line-height: 1.6; }

.gen-quality {
  font-style: normal;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.gen-quality.q-SSR { color: #a8781f; background: rgba(184, 134, 44, 0.12); }
.gen-quality.q-SR { color: #2f6b57; background: rgba(47, 107, 87, 0.1); }
.gen-quality.q-S { color: var(--ink-3); background: rgba(43, 58, 51, 0.06); }

.gen-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 8px;
  margin: 12px 0 4px;
}

.gen-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
}

.gen-stat b { color: var(--ink); font-weight: 600; }

.char-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  border-radius: 11px;
  background: var(--weapon-soft);
  border: 1px solid rgba(47, 107, 87, 0.26);
}

.char-card b { font-family: var(--font-ink); font-size: 22px; color: var(--weapon); }
.char-card small { font-size: 9px; color: var(--ink-3); text-align: center; line-height: 1.3; }

/* ---------------- 出征点将 ---------------- */

.sec-title em {
  font-style: normal;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--jade);
  letter-spacing: 0;
  margin-left: 6px;
}

.weapon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.weapon-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 8px;
  border-radius: 12px;
  border: 1px solid rgba(47, 107, 87, 0.28);
  background: var(--paper-2);
  color: var(--weapon);
  font-family: var(--font-ink);
  font-size: 26px;
  transition: all 0.15s ease;
}

.weapon-chip small {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--ink-3);
}

.weapon-chip.on {
  border-color: var(--jade);
  background: var(--jade-soft);
  color: var(--jade);
  box-shadow: 0 5px 12px rgba(47, 107, 87, 0.16);
}

.weapon-chip.on small { color: var(--jade); }

.weapon-chip .weapon-img,
.char-card .weapon-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1.5px rgba(43, 58, 51, 0.22));
}
.weapon-chip.on .weapon-img { filter: drop-shadow(0 2px 3px rgba(47, 107, 87, 0.35)); }

/* 武器卡三属性横条：数值在前，条形在后 */
.wbars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 3px 6px 0;
  font-family: var(--font-ui);
  font-size: 9px;
  line-height: 1;
  color: var(--ink-3);
}

.wbar {
  display: grid;
  grid-template-columns: 10px 25px 1fr;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.wbar i {
  font-style: normal;
  color: var(--ink-3);
}

.wbar b {
  font-weight: 700;
  color: var(--ink-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.wbar-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(47, 107, 87, 0.12);
  overflow: hidden;
}

.wbar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 107, 87, 0.5), var(--jade));
}

.weapon-chip.on .wbar-track { background: rgba(47, 107, 87, 0.18); }
.weapon-chip.on .wbar-fill { background: linear-gradient(90deg, #6fa28e, var(--jade)); }

.name-families {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.family {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.family-head {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--font-ink);
  font-size: 18px;
}

.family-head.on {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: #8a6320;
}

.family-members {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.name-chip {
  min-width: 38px;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid rgba(184, 134, 44, 0.32);
  background: #fdf8ec;
  color: #7a5210;
  font-family: var(--font-ink);
  font-size: 18px;
  line-height: 1.2;
}

.name-chip.on {
  border-color: var(--name);
  background: var(--name-soft);
  color: #8a6320;
}

.name-chip.locked { opacity: 0.45; cursor: not-allowed; }

.combo-panel {
  margin-top: 18px;
  padding: 12px;
  border-radius: 13px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.combo-panel h4 {
  margin: 0 0 8px;
  font-family: var(--font-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink-2);
}

.combo-panel h4 span { color: var(--gold); font-family: var(--font-ui); font-size: 11px; }

.combo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.combo-chip {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a6320;
  font-family: var(--font-ink);
  font-size: 13px;
  letter-spacing: 1px;
}

.combo-chip.muted {
  background: var(--paper-3);
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 11px;
}

.loadout-foot {
  flex: 0 0 auto;
  padding: 8px 14px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.loadout-foot .wide { margin-top: 0; }

#march:disabled {
  background: #cdc3b2;
  border-color: #cdc3b2;
  color: #6f6455;
  opacity: 0.72;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------------- 战斗 ---------------- */

#scr-game {
  background: var(--paper);
  overflow: hidden;
}

.game-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 12px 6px;
  flex: 0 0 auto;
}

.game-bar .back {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1;
}

.game-title {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.game-title b {
  font-family: var(--font-ink);
  font-size: 17px;
  letter-spacing: 2px;
  font-weight: 600;
  white-space: nowrap;
}

.game-title small {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pause {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  display: grid;
  place-items: center;
}
.pause svg { width: 17px; height: 17px; fill: currentColor; display: block; }
.pause:active { background: var(--paper-3); }

.duel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-3);
}

.duel-tag {
  font-family: var(--font-ink);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--ink-2);
}

.duel-bar.ai .duel-tag { color: var(--red); }
.duel-bar.me .duel-tag { color: var(--jade); }

.hpbar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(43, 58, 51, 0.1);
  overflow: hidden;
}

.hpbar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c25f45, #b5563f);
  transition: width 0.25s ease;
}

.hpbar.me i {
  background: linear-gradient(90deg, #4e8c74, #2f6b57);
}

.hpnum {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.duel-hint {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink-3);
  opacity: 0.8;
}

.bun {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a6320;
  font-size: 13px;
}

.bun i {
  font-style: normal;
  font-family: var(--font-ink);
  font-size: 12px;
}

.bun b { font-weight: 600; }

.board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: calc(100% - 12px);
  margin: 2px auto 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
  box-shadow: inset 0 0 22px rgba(120, 104, 72, 0.06);
}

#board {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* 战斗中点击字块：顶部介绍弹窗 */
.char-pop {
  position: absolute;
  left: 50%;
  top: 8px;
  z-index: 18;
  width: min(92%, 460px);
  padding: 8px 12px 9px;
  border-radius: 12px;
  border: 1px solid rgba(184, 134, 44, 0.45);
  background: linear-gradient(180deg, rgba(255, 252, 242, 0.97), rgba(248, 241, 222, 0.97));
  box-shadow: 0 8px 22px rgba(80, 62, 30, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.char-pop.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.char-pop .cp-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.char-pop .cp-head b {
  font-family: var(--font-ink);
  font-size: 19px;
  letter-spacing: 1px;
  color: #4a3a14;
}

.char-pop .cp-head em {
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--jade-soft);
  color: var(--jade);
}

.char-pop .cp-head em[data-t="name"] { background: var(--gold-soft); color: #8a6316; }
.char-pop .cp-head em[data-t="general"] { background: #fbe7c0; color: #7a5210; }
.char-pop .cp-head em[data-t="shovel"] { background: var(--red-soft); color: #8f3f2c; }

.char-pop .cp-rows {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin-top: 5px;
}

.char-pop .cp-cell {
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

.char-pop .cp-cell i {
  font-style: normal;
  margin-right: 3px;
  color: var(--ink-3);
}

.char-pop .cp-cell b {
  font-weight: 600;
  color: var(--ink);
}

.char-pop .cp-tip {
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.35;
  color: #8a6316;
}

.camp {
  flex: 0 0 auto;
  min-height: 0;
  padding: 6px 10px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.4), var(--paper-2));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.camp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.camp-topline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.camp-topline .camp-meta { flex: 0 0 auto; }
.camp-topline .tip {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.camp-label {
  display: grid;
  place-items: center;
  width: 30px;
  height: 54px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-ink);
  font-size: 16px;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.camp-label:hover { border-color: var(--jade); color: var(--jade); }
.camp-label:active { transform: scale(.94); background: var(--weapon-soft); }

.camp-merge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 54px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(184, 115, 28, 0.55);
  background: linear-gradient(160deg, #fff7e4, #f4e2bb);
  color: #8a5a12;
  font-family: var(--font-ink);
  font-size: 16px;
  flex: 0 0 auto;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(160, 110, 40, 0.14);
  transition: transform .12s ease, box-shadow .12s ease;
}
.camp-merge:hover { box-shadow: 0 4px 12px rgba(160, 110, 40, 0.24); }
.camp-merge:active { transform: scale(.94); }

.camp-slots {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  touch-action: none;
}

.slot {
  position: relative;
  height: 46px;
  border-radius: 10px;
  border: 1px dashed var(--line-2);
  background: rgba(255, 253, 246, 0.55);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 18px;
  font-family: var(--font-ink);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.slot.filled {
  border-style: solid;
  border-color: rgba(47, 107, 87, 0.4);
  background: var(--weapon-soft);
  color: var(--ink);
  font-size: 24px;
  box-shadow: 0 3px 8px rgba(47, 107, 87, 0.1);
}

.slot.name {
  border-color: rgba(184, 134, 44, 0.5);
  background: var(--name-soft);
  color: #7a5210;
  box-shadow: 0 3px 8px rgba(184, 134, 44, 0.12);
}

.slot.name .sub { color: #a8781f; }

.slot.farmer {
  border-color: rgba(154, 134, 70, 0.45);
  background: #f6f1de;
}

.slot.shovel {
  border-color: rgba(181, 86, 63, 0.45);
  background: var(--shovel-soft);
  box-shadow: 0 3px 8px rgba(181, 86, 63, 0.1);
}

.slot-ico {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(43, 58, 51, 0.14));
}

.slot.on {
  transform: translateY(-3px);
  border-color: var(--jade);
  box-shadow: 0 8px 16px rgba(47, 107, 87, 0.22);
}

.slot .lv {
  position: absolute;
  top: 2px;
  right: 5px;
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--jade);
}

.slot .sub {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--ink-3);
  text-align: center;
}

.camp-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}

/* 抽字两侧的主动技能格：一格一个主动技，没有则留空位 */
.active-slot {
  flex: 0 0 62px;
  min-width: 0;
  min-height: 52px;
  justify-content: center;
  gap: 6px;
  padding: 0;
}
.active-slot .skill-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
}
.active-slot .skill-btn .sk-cd { font-size: 14px; }
.active-slot:empty::after {
  content: '主动';
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
  color: var(--ink-3);
  font-family: var(--font-ink);
  font-size: 10px;
  opacity: .75;
}

.camp-passive {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
.camp-passive .skill-bar { flex: 1; }
.camp-passive .bun { flex: 0 0 auto; }

.camp-brief {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.camp-meta {
  margin: 0;
  font-size: 10px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}

.recruit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 9px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #376f5c, #295a49);
  color: #f7f5ea;
  box-shadow: 0 6px 14px rgba(41, 90, 73, 0.24);
  font-family: var(--font-ink);
  font-size: 17px;
  letter-spacing: 2px;
}

.recruit:active { transform: scale(0.98); }

.recruit b {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
}

.recruit i {
  font-style: normal;
  font-family: var(--font-ink);
  font-size: 10px;
  opacity: 0.75;
}

.recruit.off {
  background: #cfcabb;
  box-shadow: none;
  color: #f6f3ea;
}

.tip {
  flex: 1;
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* 拖动幽灵 */

.drag-ghost {
  position: fixed;
  z-index: 40;
  width: 54px;
  height: 54px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--paper-2);
  border: 1.5px solid var(--jade);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-ink);
  font-size: 26px;
  color: var(--ink);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0.92;
}

.drag-ghost.bad { border-color: var(--red); opacity: 0.6; }
.drag-ghost.name { border-color: var(--name); background: var(--name-soft); color: #7a5210; }
.drag-ghost.shovel {
  border-color: var(--shovel);
  background: var(--shovel-soft) url(./assets/shovel.png) center / 66% no-repeat;
  color: transparent;
}
.drag-ghost.weapon { border-color: var(--weapon); background: var(--weapon-soft); color: var(--ink); }

/* 暂停 */

.pause-mask {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(247, 243, 232, 0.86);
  backdrop-filter: blur(3px);
}

.pause-panel {
  width: 74%;
  padding: 22px 20px;
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.pause-panel h3 {
  margin: 10px 0 4px;
  font-family: var(--font-ink);
  font-size: 20px;
  letter-spacing: 3px;
}

.pause-panel p {
  margin: 0 0 16px;
  font-size: 11px;
  color: var(--ink-3);
}

/* ---------------- 结算 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(43, 58, 51, 0.28);
  backdrop-filter: blur(4px);
  padding: 24px;
}

.overlay.hidden { display: none; }

.panel {
  width: 100%;
  max-width: 300px;
  padding: 24px 20px 20px;
  border-radius: 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pop 0.28s cubic-bezier(0.2, 1.3, 0.5, 1);
}

@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.seal {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--red);
  color: var(--red);
  font-family: var(--font-ink);
  font-size: 20px;
  transform: rotate(-6deg);
}

.seal.big { width: 56px; height: 56px; font-size: 26px; }

.panel h2 {
  margin: 14px 0 6px;
  font-family: var(--font-ink);
  font-size: 22px;
  letter-spacing: 3px;
}

.panel p {
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-3);
}

.reward {
  display: inline-block;
  margin: 2px 0 16px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a6320;
  font-size: 14px;
}

.panel-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

/* ---------------- 全局主按钮：金边漆器（红漆 / 金漆 / 青玉） ---------------- */
.primary, .ghost {
  position: relative;
  padding: 12px 16px;
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--font-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  text-indent: 4px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.primary {
  color: #fff6df;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 46%),
    linear-gradient(160deg, #c8452c 0%, #9d2c18 55%, #7d1f10 100%);
  border: 1.5px solid #f0cd83;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -3px 8px rgba(90, 20, 8, 0.4),
    0 0 0 1px rgba(122, 34, 16, 0.28),
    0 8px 18px rgba(150, 45, 25, 0.28);
  text-shadow: 0 1px 2px rgba(88, 18, 6, 0.55);
}

/* 统一的高光扫过 */
.primary::after, .ad-btn::after {
  content: '';
  position: absolute;
  top: -70%;
  left: -45%;
  width: 32%;
  height: 240%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.32), rgba(255,255,255,0));
  transform: skewX(-20deg);
  animation: march-shine 3.6s ease-in-out infinite;
  pointer-events: none;
}

.primary:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.26),
    inset 0 -2px 6px rgba(90,20,8,.4),
    0 0 0 1px rgba(122,34,16,.28),
    0 3px 10px rgba(150,45,25,.26);
}

.primary:disabled {
  background: #cdc3b2;
  border-color: #c3b8a4;
  color: #6f6455;
  box-shadow: none;
  text-shadow: none;
  cursor: not-allowed;
}
.primary:disabled::after { display: none; }

.ghost {
  color: var(--jade);
  background: linear-gradient(160deg, #fffdf6, #f2ebdb);
  border: 1.5px solid rgba(47, 107, 87, 0.42);
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(43, 58, 51, 0.1);
}

.ghost:active { transform: translateY(1px); }

.wide { width: 100%; margin-top: 10px; min-height: 50px; }

#toast, #toast-top {
  position: fixed;
  left: 50%;
  z-index: 60;
  transform: translate(-50%, 10px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(43, 58, 51, 0.9);
  color: #f7f5ea;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

#toast { bottom: 16%; }

#toast-top {
  top: 13%;
  transform: translate(-50%, -10px);
}

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

#toast.gold, #toast-top.gold { background: rgba(150, 106, 30, 0.94); }
#toast.bad, #toast-top.bad { background: rgba(150, 60, 46, 0.94); }

#boot-error {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  padding: 10px 14px;
  background: #b5563f;
  color: #fff;
  font-size: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  display: none;
}

@media (max-height: 720px) {
  .hero { gap: 6px; margin-top: 2px; }
  .hero-title h1 { font-size: 24px; }
  .hero-title p { font-size: 11px; }
  .hc { --hc: 38px; }
  .modes { min-height: 170px; max-height: none; }
  .home-dock { gap: 7px; }
  .home-dock b { font-size: 12px; }
  .home-dock small { display: none; }
}

/* ================= 装备 ================= */
.sec-title {
  font-size: 14px;
  color: var(--ink-2);
  margin: 14px 4px 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.sec-title em { font-style: normal; color: var(--gold); font-size: 12px; }
/* ---------------- 装备（背包 / 图鉴） ---------------- */
.eq-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 12px 4px;
  flex: 0 0 auto;
}
.eq-tab {
  flex: 1;
  padding: 7px 0;
  border-radius: 9px;
  border: 1px solid rgba(47, 107, 87, 0.25);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  font-family: var(--font-ui);
}
.eq-tab.on { background: var(--jade); border-color: var(--jade); color: #fff; }

.gen-roster {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}
.gen-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(47, 107, 87, 0.2);
  background: var(--paper-2);
  text-align: left;
  transition: border-color 0.18s, background 0.18s;
}
.gen-row.on {
  border-color: var(--jade);
  background: var(--jade-soft);
  box-shadow: 0 0 0 1px var(--jade) inset;
}
.gen-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.gen-main b { font-family: var(--font-ink); font-size: 18px; font-weight: 700; line-height: 1.1; letter-spacing: 1px; }
.gen-main small { font-size: 10px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-row.on .gen-main small { color: var(--jade); }
.gen-weapon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  min-width: 46px;
}
.gen-weapon em {
  font-style: normal;
  font-size: 9px;
  color: var(--ink-2);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gen-weapon.empty em { color: var(--ink-3); }

/* 头像 / 装备图标（内联 SVG） */
.gen-ava {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.gen-ava svg { width: 100%; height: 100%; display: block; }
.gen-ava.big { width: 62px; height: 62px; }
.eq-ic {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--c, var(--jade));
  background: color-mix(in srgb, var(--c, #2f6b57) 12%, #fffdf6);
  border: 1px solid color-mix(in srgb, var(--c, #2f6b57) 42%, transparent);
}
.eq-ic svg { width: 76%; height: 76%; display: block; }
.eq-ic.big { width: 76px; height: 76px; border-radius: 16px; }
.eq-ic.empty {
  color: var(--ink-3);
  background: var(--paper-3);
  border: 1px dashed rgba(43, 58, 51, 0.2);
  font-size: 12px;
  font-family: var(--font-ui);
}

.gear-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.gear-slot {
  min-height: 74px;
  border: 1.5px dashed rgba(47, 107, 87, 0.3);
  border-radius: 12px;
  background: var(--paper-2);
  padding: 8px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gear-slot.empty { align-items: center; justify-content: center; color: var(--ink-3); }
.gear-slot.empty span { font-size: 12px; }
.gear-slot.empty em { font-style: normal; font-size: 16px; color: rgba(138, 149, 141, 0.55); }
.gear-slot.filled { border-style: solid; }
.gear-slot span { font-size: 10px; color: var(--ink-3); font-family: var(--font-ui); }
.gear-slot b { font-size: 15px; font-weight: 700; }
.gear-slot small { font-size: 10px; color: var(--ink-2); line-height: 1.35; }
.gear-slot em { font-style: normal; font-size: 9px; color: var(--ink-3); margin-top: auto; }

.gen-skill-hint {
  margin: 2px 2px 10px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.45;
}
.gen-skill-hint.ok { background: var(--jade-soft); color: var(--jade); }
.gen-skill-hint.lock { background: var(--red-soft); color: #8f3f2c; }
.gen-skill-hint.off { display: none; }
.sk-ok { color: var(--jade); }
.sk-lock { color: #8f3f2c; }

.gear-bag {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.gear-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-2);
  padding: 8px 9px;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}
.gi-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.gear-item[disabled] { opacity: 0.5; }
.gear-item b { font-size: 14px; font-weight: 700; }
.gear-item .gi-rar { font-size: 10px; color: var(--gold); }
.gear-item small { font-size: 10px; color: var(--ink-2); line-height: 1.35; }
.gear-item .gi-ex {
  align-self: flex-start;
  font-size: 9px;
  color: #8f3f2c;
  background: var(--red-soft);
  border-radius: 5px;
  padding: 1px 5px;
}
.gear-item em { font-style: normal; font-size: 9.5px; color: var(--ink-3); margin-top: 3px; }

.gear-codex-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.codex-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper-2);
  padding: 8px 9px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
}
.codex-item.locked { background: var(--paper-3); }
.codex-item b { font-size: 14px; font-weight: 700; }
.codex-item .gi-rar { font-size: 10px; color: var(--gold); }
.codex-item.locked .gi-rar { color: var(--ink-3); }
.codex-item small { font-size: 10px; color: var(--ink-2); line-height: 1.35; }
.codex-item .gi-ex {
  align-self: flex-start;
  font-size: 9px;
  color: #8f3f2c;
  background: var(--red-soft);
  border-radius: 5px;
  padding: 1px 5px;
}
.codex-item em { font-style: normal; font-size: 9.5px; color: var(--ink-3); margin-top: 3px; }

.rb {
  font-style: normal;
  font-size: 8px;
  line-height: 1;
  padding: 1px 3px;
  margin-left: 2px;
  border-radius: 4px;
  background: var(--jade-soft);
  color: var(--jade);
  vertical-align: 1px;
}
.rb[data-b="mid"] { background: var(--gold-soft); color: #8a6316; }
.rb[data-b="far"] { background: #e8e6fb; color: #5a4bbd; }
.rb[data-b="siege"] { background: var(--red-soft); color: #8f3f2c; }

/* ================= 战前序幕 ================= */
#scr-intro {
  background:
    radial-gradient(circle at 20% 15%, #ffe9c2 0%, rgba(255,233,194,0) 55%),
    radial-gradient(circle at 82% 22%, #cdeaff 0%, rgba(205,234,255,0) 50%),
    radial-gradient(circle at 50% 95%, #ffd6e0 0%, rgba(255,214,224,0) 55%),
    linear-gradient(180deg, #fff7e8 0%, #ffe8d4 60%, #ffd9c0 100%);
  overflow: hidden;
}
#intro-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
}
.intro-overlay {
  position: relative; z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(14px, env(safe-area-inset-top)) 12px 6px;
  color: #4a2c1a;
}
/* 内容居中，但空间不够时自动贴顶并可滚动，避免顶部胶囊被裁掉 */
.intro-body {
  margin: auto 0;
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
}
/* 关卡 / 玩法名：随内容排列在最上方，宽屏也不会压住「对方」 */
.intro-stage {
  flex: 0 0 auto;
  max-width: calc(100% - 16px);
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.66);
  border: 1px solid rgba(184, 115, 28, 0.38);
  box-shadow: 0 2px 10px rgba(120, 72, 20, 0.08);
  font-family: var(--font-ink);
  font-size: 13px;
  letter-spacing: 3px;
  text-indent: 3px;
  color: #8a5a12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.intro-stage:empty { display: none; }
.intro-me, .intro-foe { text-align: center; }
.intro-banner {
  display: inline-block;
  padding: 3px 14px;
  border-radius: 20px;
  background: rgba(60,160,110,.18);
  border: 1.5px solid rgba(60,160,110,.6);
  color: #2c7a52;
  font-size: 12px;
  letter-spacing: 3px;
  animation: fadeUp .8s ease both;
}
.intro-banner.foe {
  background: rgba(220,90,70,.16);
  border-color: rgba(220,90,70,.6);
  color: #c04a32;
}
.intro-me h2, .intro-foe h2 {
  font-size: 28px;
  margin: 10px 0 14px;
  letter-spacing: 3px;
  color: #5a2f12;
  text-shadow: 0 2px 0 rgba(255,255,255,.6);
  animation: flyIn 1s ease both;
}
.intro-foe h2 { animation-delay: .25s; color: #7a2418; }
/* 对方玩家身份：头像 + 昵称 + 等级/在线 */
.foe-id {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 14px;
  animation: flyIn 1s .25s ease both;
}
.foe-id h2 { animation: none; margin: 0; }
.foe-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--font-ink);
  font-size: 20px;
  color: #7a2418;
  background: radial-gradient(circle at 32% 28%, #fff6e2, #f2d8b0 72%);
  border: 2px solid rgba(212, 69, 42, 0.55);
  box-shadow: 0 3px 10px rgba(160, 60, 30, 0.22), inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}
.foe-id-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.foe-lv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #8a5a12;
}
.foe-lv b { font-size: 11px; font-weight: 700; color: #b8731c; letter-spacing: 0.5px; }
.foe-lv i {
  font-style: normal;
  font-size: 9px;
  line-height: 1.6;
  padding: 0 5px;
  border-radius: 8px;
  background: rgba(60, 160, 110, 0.16);
  border: 1px solid rgba(60, 160, 110, 0.45);
  color: #2c7a52;
}
.intro-stats {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(300px, 74vw);
  margin: 0 auto;
  font-size: 12px;
  animation: fadeUp 1s .35s ease both;
}
.intro-foe .intro-stats { animation-delay: .55s; }
.intro-stats div {
  display: flex; justify-content: space-between;
  border-bottom: 1px dashed rgba(140,80,30,.25);
  padding: 3px 2px;
  color: #6b4a2a;
}
.intro-stats b { color: #b8731c; font-weight: 700; }
.intro-tags {
  display: flex; flex-direction: column; gap: 5px;
  justify-content: center; align-items: center; margin-top: 10px;
  max-width: 300px;
}
.intro-tags .tag {
  font-size: 10px; padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(184,115,28,.4);
  color: #8a5a12;
}
/* 序幕信息行：装备 / 技能，带小标题避免看不懂 */
.intro-line {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex-wrap: wrap; max-width: 300px;
  font-size: 10px; color: #7a4c10; line-height: 1.5;
}
.intro-line > b {
  flex: 0 0 auto; padding: 1px 6px; border-radius: 8px;
  background: rgba(184,115,28,.14); border: 1px solid rgba(184,115,28,.38);
  font-size: 9px; font-weight: 700; letter-spacing: 1px; color: #8a5a12;
}
.intro-skills { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sk-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 2px; border-radius: 11px;
  background: rgba(255,255,255,.74); border: 1px solid;
  font-size: 10px; line-height: 1;
}
.sk-chip i {
  width: 16px; height: 16px; border-radius: 5px;
  display: grid; place-items: center;
  font-style: normal; font-size: 10px; font-weight: 700;
  border: 1.2px solid currentColor; background: rgba(255,255,255,.6);
}
.intro-vs {
  font-size: 46px;
  font-weight: 900;
  font-style: italic;
  color: #d4452a;
  text-shadow: 0 3px 0 #fff, 0 0 20px rgba(212,69,42,.5);
  animation: vsPulse 1.6s ease-in-out infinite, vsIn 1s ease both;
  padding: 0 4px;
}
.intro-actions {
  position: relative; z-index: 3;
  flex: 0 0 auto;
  padding: 10px 20px max(18px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
/* 出征按钮：沿用全局金边红漆，只放大尺寸 */
#intro-march {
  height: 54px;
  margin-top: 0;
  padding: 0;
  border-radius: 16px;
  font-size: 21px;
  letter-spacing: 14px;
  text-indent: 14px;
}
@keyframes march-shine {
  0%, 64% { left: -45%; }
  100% { left: 118%; }
}
@keyframes fadeUp { from { opacity:0; transform: translateY(12px);} to {opacity:1; transform:none;} }
@keyframes flyIn { from { opacity:0; transform: translateX(-30px) scale(.8);} to {opacity:1; transform:none;} }
@keyframes vsIn { from { opacity:0; transform: scale(2.4) rotate(-20deg);} to {opacity:1; transform:none;} }
@keyframes vsPulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.12);} }

/* 字卡四属性行（血/攻/程/速） */
.stat-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 6px;
  width: 100%;
  padding: 0 2px;
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--ink-3);
  line-height: 1.3;
}
.stat-line i { font-style: normal; display: flex; justify-content: space-between; }
.stat-line i b { color: var(--ink-2); font-weight: 700; }

/* 技能图标小方块（intro / 图鉴通用） */
/* 战斗底部技能栏 */
/* 技能行：敌方在上（小图标）/ 我方可点（大图标） */
.skill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 3px;
  flex: 0 0 auto;
  min-height: 32px;
}
.skill-row.hidden { display: none; }
.row-label {
  flex: 0 0 auto;
  font-family: var(--font-ink);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-3);
}
.skill-row.foe .row-label { color: var(--red); }

.camp-skill-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.camp-sec {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-ink);
  font-size: 12px;
}

.skill-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px;
  min-height: 40px;
  align-items: center;
}
.skill-bar.small {
  min-height: 32px;
  padding: 0;
  gap: 6px;
  flex: 0 1 auto;
}
#battle-passive:empty::after {
  content: '暂无被动技能';
  font-size: 10px;
  color: var(--ink-3);
  padding: 0 4px;
  white-space: nowrap;
}

.skill-btn {
  position: relative;
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 9px;
  border: 2px solid #8a958d;
  background: var(--paper);
  color: #8a958d;
  font-family: var(--font-ink);
  font-size: 14px;
  font-weight: 700;
  display: grid; place-items: center;
  cursor: pointer;
  touch-action: none;
  transition: transform .12s ease, box-shadow .12s ease, filter .18s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.skill-btn:active { transform: translateY(1px) scale(.95); }

/* 钟表式冷却：深色扇形随时间消退，走完即整块点亮 */
.skill-btn .sk-cd {
  position: absolute; inset: -2px;
  border-radius: inherit;
  display: grid; place-items: center;
  pointer-events: none;
  background: conic-gradient(from -90deg,
    rgba(14, 10, 8, .45) 0deg var(--deg, 0deg),
    rgba(255, 255, 255, 0) var(--deg, 0deg) 360deg);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.85);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.skill-btn.ready {
  animation: skReady 1.5s ease-in-out infinite;
  filter: saturate(1.2) brightness(1.06);
  background: #fffdf6;
}
@keyframes skReady {
  0%,100% { box-shadow: 0 2px 6px rgba(0,0,0,.08); }
  50% { box-shadow: 0 0 0 3px rgba(255,138,60,.5), 0 0 12px rgba(255,170,80,.35); }
}

.skill-btn::before {
  content: attr(data-mark);
  position: absolute; top: -6px; right: -6px;
  font-size: 9px; font-family: var(--font-ui); font-weight: 700;
  color: #fff; border-radius: 8px;
  padding: 0 4px; line-height: 14px;
  background: #8a958d;
  z-index: 2;
}
.skill-btn.active::before { background: #2c7a52; }
.skill-btn.passive { opacity: .92; cursor: default; background: #f6f1e2; }
.skill-btn.passive::before { background: #b8731c; }
/* 被动没有冷却，用「常驻」状态代替读秒 */
.skill-btn.passive .sk-cd {
  background: rgba(47, 107, 87, 0.16);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(47, 107, 87, 0.18);
}

/* 敌方小号技能图标 */
.skill-bar.small .skill-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 13px;
  border-width: 1.5px;
  background: #fffdf6;
}
/* 敌方小图标不再叠数字，只保留扇形扫描，保证名字清晰 */
.skill-bar.small .skill-btn .sk-cd { font-size: 0; }
.skill-bar.small .skill-btn::before { font-size: 8px; line-height: 11px; top: -4px; right: -4px; padding: 0 3px; }

/* BOSS 出场横幅 */
.boss-banner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.6);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  border-radius: 16px;
  background: rgba(20,8,4,.86);
  border: 2px solid var(--bc, #b5563f);
  box-shadow: 0 0 30px var(--bc, #b5563f), 0 6px 20px rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: transform .35s cubic-bezier(.2,1.4,.4,1), opacity .35s;
  white-space: nowrap;
}
.boss-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: bossShake 2.4s ease-in-out;
}
.boss-banner .bb-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  padding: 2px 8px; border-radius: 8px;
  background: var(--bc, #b5563f); color: #fff;
}
.boss-banner b { font-size: 22px; color: #ffe9a8; }
.boss-banner small { font-size: 12px; color: #ffb48a; }
@keyframes bossShake {
  0%,100% { transform: translate(-50%,-50%) scale(1); }
  15% { transform: translate(-52%,-50%) scale(1.04) rotate(-2deg); }
  30% { transform: translate(-48%,-50%) scale(1.02) rotate(2deg); }
  45% { transform: translate(-50%,-50%) scale(1) rotate(0); }
}

/* ================= 结算全屏 ================= */
.result-overlay {
  padding: 0;
  background: rgba(43, 58, 51, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.result-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: max(28px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  background:
    radial-gradient(circle at 18% 12%, #ffe9c2 0%, rgba(255,233,194,0) 55%),
    radial-gradient(circle at 85% 18%, #cdeaff 0%, rgba(205,234,255,0) 50%),
    radial-gradient(circle at 50% 100%, #ffd6e0 0%, rgba(255,214,224,0) 60%),
    linear-gradient(180deg, #fff7e8 0%, #ffe8d4 55%, #ffd9c0 100%);
  animation: pop .32s cubic-bezier(.2,1.3,.5,1);
}
.result-top {
  text-align: center;
  padding-top: 18px;
}
.result-top h2 {
  font-family: var(--font-ink);
  font-size: 30px;
  letter-spacing: 4px;
  color: #5a2f12;
  margin: 14px 0 6px;
  text-shadow: 0 2px 0 rgba(255,255,255,.6);
}
.result-top p {
  font-size: 12px;
  color: #8a5a12;
  margin: 0;
}
.result-top .seal {
  width: 64px; height: 64px; font-size: 30px;
  box-shadow: 0 6px 16px rgba(200,60,40,.3);
}
.result-stats {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: center;
  margin: 18px 0;
}
.stat-card {
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(184,115,28,.3);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
}
.stat-card b {
  display: block;
  font-size: 22px;
  color: #b8731c;
  font-family: var(--font-ink);
}
.stat-card span {
  font-size: 11px;
  color: #8a5a12;
}
.result-bottom { flex: 0 0 auto; }
.result-drops {
  justify-content: center;
  margin: 0 0 10px;
}
.result-reward-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff3cf, #ffe0a3);
  border: 1px solid #f0c060;
  margin-bottom: 12px;
}
.result-reward-line span { font-size: 13px; color: #8a5a12; }
.result-reward-line b { font-size: 22px; color: #b8731c; }
.result-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-btns .wide { width: 100%; margin-top: 0; }

/* ================= 战后技能抽取 ================= */
.result-drops {
  margin: 8px 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
}
.result-drops .drop-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(240,190,90,.12);
  border: 1px solid var(--gold);
  color: #b8731c;
}
.gacha-scroll { padding-bottom: 20px; }
.ad-btn {
  position: relative;
  padding: 10px 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #b8862c;
  font-family: var(--font-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  text-indent: 4px;
  color: #6b4410;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 46%),
    linear-gradient(160deg, #ffe9b0 0%, #f2ce7e 55%, #dcae55 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 8px rgba(140, 95, 20, 0.26),
    0 8px 18px rgba(184, 134, 44, 0.24);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.ad-btn:active { transform: translateY(2px); filter: brightness(0.97); }
.ad-btn.off, .ad-btn:disabled {
  background: #cdc3b0;
  color: #fff;
  border-color: #b9ae9a;
  box-shadow: none;
  text-shadow: none;
  cursor: default;
}
.ad-btn.off::after, .ad-btn:disabled::after { display: none; }
.gacha-tabs { display: flex; gap: 8px; margin: 10px 0; }
.gacha-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 0 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffaf0, #f6e7c8);
  border: 1px solid #e8d3a8;
  color: #8a5a12;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.gacha-tab b { font-family: var(--font-ink); font-size: 14px; letter-spacing: 1px; }
.gacha-tab small { font-size: 9.5px; letter-spacing: 1px; opacity: 0.72; }
.gacha-tab.on {
  background: linear-gradient(160deg, #ffe9b0, #f0b95a 60%, #dc9a3c);
  color: #5a2f12;
  border-color: #b8862c;
  box-shadow: 0 4px 12px rgba(184, 134, 44, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}
.gacha-tab.grey { opacity: 0.45; filter: grayscale(0.8); }
.gacha-tabs.locked .gacha-tab { cursor: default; }
.gacha-tab.locked { opacity: 0.3; filter: grayscale(1); }
.gacha-tab.locked::after { content: '已锁定'; font-size: 9px; letter-spacing: 1px; color: #8a7a5a; }
.gacha-stage {
  position: relative;
  display: flex; justify-content: center;
  padding: 6px 0;
}
#gacha-canvas {
  width: 100%; max-width: 340px;
  height: auto;
  background: linear-gradient(160deg, #fff9ee 0%, #ffe8d0 100%);
  border-radius: 16px;
  border: 1px solid #e8d3a8;
  display: block;
  box-shadow: 0 10px 24px rgba(120, 86, 30, 0.12), inset 0 0 20px rgba(184, 115, 28, 0.08);
}
.merchant-grid {
  width: 100%; max-width: 340px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #e8d3a8;
  background: linear-gradient(160deg, #fff9ee 0%, #ffe8d0 100%);
  box-shadow: 0 10px 24px rgba(120, 86, 30, 0.12), inset 0 0 20px rgba(184, 115, 28, 0.08);
}
.mg-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 12px;
  border: 1.5px solid var(--rc, #b8862c);
  background: linear-gradient(180deg, #fffaf0, #f7ead2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(120, 86, 30, 0.1);
  overflow: hidden;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.mg-cell b {
  font-family: var(--font-ink);
  font-size: 18px;
  letter-spacing: 1px;
  color: #4a2f10;
}
.mg-cell small { font-size: 9px; color: #8a6316; opacity: 0.8; }
.mg-rar {
  position: absolute;
  top: 0; left: 0;
  padding: 0 5px 1px;
  font-size: 8.5px;
  letter-spacing: 1px;
  color: #fff8ea;
  border-bottom-right-radius: 7px;
}
.mg-cell.hot {
  transform: scale(1.06);
  background: linear-gradient(180deg, #fff3d0, #ffe0a8);
  box-shadow: 0 0 0 2px #f0cd83, 0 8px 18px rgba(184, 134, 44, 0.3);
}
.mg-cell.win {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px #e0b45a, 0 10px 24px rgba(184, 134, 44, 0.4), inset 0 0 20px rgba(240, 190, 90, 0.35);
  animation: winPop 0.5s ease;
}
@keyframes winPop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.14); }
  100% { transform: scale(1.08); }
}
.mg-spin {
  aspect-ratio: 1 / 1;
  margin: 5px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  border: 2px solid #f0cd83;
  color: #fff6df;
  background: radial-gradient(circle at 50% 30%, #e0563a, #a9271a 72%);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(80, 10, 0, 0.5);
  box-shadow: 0 6px 16px rgba(120, 30, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  animation: wheelPulse 1.9s ease-in-out infinite;
}
.mg-spin small { font-size: 10px; letter-spacing: 3px; opacity: 0.92; }
.mg-spin:active { transform: scale(0.94); }
.mg-spin:disabled {
  animation: none;
  background: linear-gradient(180deg, #9c8a6a, #6b5a40);
  cursor: default;
}
@keyframes wheelPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 69, 44, 0.42), 0 6px 16px rgba(120, 30, 20, 0.35); }
  55% { box-shadow: 0 0 0 12px rgba(200, 69, 44, 0), 0 6px 16px rgba(120, 30, 20, 0.35); }
}
.ox-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.ox-cards.reveal .ox-card {
  animation: oxCardPop .5s cubic-bezier(.2, .9, .3, 1.2) both;
}
.ox-cards.reveal .ox-card:nth-child(2) { animation-delay: .1s; }
.ox-cards.reveal .ox-card:nth-child(3) { animation-delay: .2s; }
@keyframes oxCardPop {
  from { opacity: 0; transform: translateY(28px) scale(.84); }
  to { opacity: 1; transform: none; }
}
.ox-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 138px;
  padding: 14px 5px 9px;  border-radius: 12px;
  border: 1.5px solid var(--rc, #b8862c);
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 255, 255, 0.9), rgba(255, 248, 232, 0.92) 60%),
    linear-gradient(180deg, #fffaf0, #f7ead2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 3px 8px rgba(120, 86, 30, 0.12);
  color: #4a3a14;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.ox-card::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 9px;
  border: 1px dashed rgba(184, 134, 44, 0.28);
  pointer-events: none;
}
.ox-card.on {
  transform: translateY(-3px);
  border-color: #b8862c;
  box-shadow: 0 0 0 2px rgba(184, 134, 44, 0.45), 0 10px 20px rgba(143, 43, 24, 0.18), inset 0 0 18px rgba(240, 190, 90, 0.22);
}
.ox-rarity {
  position: absolute;
  top: 0; left: 0;
  padding: 1px 7px 2px;
  border-bottom-right-radius: 9px;
  font-size: 9.5px;
  color: #fff8ea;
  letter-spacing: 1px;
}
.ox-char {
  font-family: var(--font-ink);
  font-size: 30px;
  line-height: 1.1;
  color: var(--rc, #8a6316);
  opacity: 0.85;
  margin-top: 2px;
}
.ox-name { font-size: 15px; font-weight: 700; color: #4a2f10; }
.ox-type {
  font-size: 9.5px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(184, 134, 44, 0.14);
  color: #8a6316;
}
.ox-desc {
  font-size: 10px;
  line-height: 1.32;
  color: #7a6444;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ox-check {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  display: none;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: #c8452c;
  color: #fff6df;
  font-style: normal;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(143, 43, 24, 0.4);
}
.ox-card.on .ox-check { display: flex; }
.gacha-hint {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #8a6316;
}
.gacha-result {
  min-height: 30px;
  margin: 8px 0;
}
.gacha-result .gr-card {
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.7);
  border: 2px solid var(--gold);
  animation: fadeUp .4s ease both;
}
.gacha-result .gr-name { font-size: 20px; font-weight: 700; color: #5a2f12; }
.gacha-result .gr-seal {
  width: 42px; height: 42px;
  margin: 0 auto 7px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #fff6df;
  font-family: var(--font-ink);
  font-size: 23px;
  box-shadow: 0 4px 10px rgba(80, 60, 20, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.gacha-result .gr-type { font-size: 11px; margin-top: 2px; }
.gacha-result .gr-desc { font-size: 12px; color: #6b4a2a; margin-top: 6px; }
.gacha-result .gr-got { text-align: center; font-size: 13px; color: #2c7a52; margin-top: 8px; font-weight: 600; }
.gacha-owned { margin: 0 0 8px; }
.gacha-owned .go-empty { text-align: center; font-size: 12px; color: #8a7a5a; }
.gacha-owned .go-title { text-align: center; font-size: 12px; color: #8a6316; margin-bottom: 4px; }
.gacha-owned .go-list { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.gacha-owned .go-chip {
  font-size: 12px;
  padding: 2px 9px;
  border: 1px solid;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}
.gacha-owned .go-chip i { font-style: normal; font-size: 10px; opacity: 0.7; margin-left: 4px; }
.day-hi { color: #b8862c; }
.gacha-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px;
}
button.link {
  background: transparent;
  border: none;
  color: #8a5a12;
  font-size: 13px;
  padding: 6px 0;
  text-decoration: underline;
}
.bar-tail.coin { color: #b8731c; }
.bar-tail.coin i { font-style: normal; color: #d4a02a; }
.note.center { text-align: center; }

/* ================= 排行榜 ================= */
.rank-tabs {
  display: flex;
  gap: 0;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.rank-tab {
  flex: 1;
  padding: 11px 0;
  background: transparent;
  border: none;
  color: var(--ink-2);
  font-size: 14px;
}
.rank-tab.on {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  font-weight: 700;
}
.rank-set {
  background: #fff7e8;
  border: 1px dashed #e8c97a;
  border-radius: 12px;
  padding: 12px;
  margin: 10px;
}
.region-row {
  display: flex; gap: 8px; margin-top: 8px;
}
.region-row select {
  flex: 1;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}
.rank-list { padding: 4px 10px 20px; }
.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto 70px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--paper-2);
  margin-bottom: 6px;
}
.rank-row.me {
  background: linear-gradient(135deg, #fff3cf, #ffe0a3);
  border: 1px solid var(--gold);
}
.rr-no { font-weight: 700; text-align: center; color: #b8731c; font-size: 14px; }
.rr-name { font-size: 14px; font-weight: 600; }
.rr-info { font-size: 10px; color: var(--ink-3); }
.rr-coins { font-size: 12px; color: #b8731c; text-align: right; }

/* ===== 设置 / 首页调整 / 图鉴关闭 ===== */
.rank-col { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.settings-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  color: #6b4a2b; background: linear-gradient(180deg,#fff8e7,#f3e2bf);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.settings-btn i { font-style: normal; font-size: 13px; }
.gen-panel { position: relative; }
.panel-x {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px;
  border: none; background: rgba(0,0,0,.06); border-radius: 50%;
  font-size: 20px; line-height: 1; color: #8a6a3a; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.settings-panel { width: 82%; max-width: 340px; text-align: center; padding: 22px 20px; }
.settings-panel h3 { margin: 0 0 14px; font-size: 17px; color: #6b4a2b; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px; font-size: 14px; color: #5a3d20;
}
.switch { position: relative; display: inline-block; width: 46px; height: 26px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: #cbb387; border-radius: 999px;
  transition: .2s;
}
.switch i::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + i { background: #c0392b; }
.switch input:checked + i::before { transform: translateX(20px); }

/* ---------------- 本局上阵字库 ---------------- */
.camp-codex {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 16, 8, 0.46);
  backdrop-filter: blur(3px);
  animation: ccFade .16s ease;
}
.camp-codex.hidden { display: none; }
@keyframes ccFade { from { opacity: 0; } to { opacity: 1; } }

.cc-panel {
  width: min(92%, 380px);
  max-height: 74%;
  overflow-y: auto;
  padding: 14px 16px 16px;
  border-radius: 16px;
  border: 1px solid rgba(184, 115, 28, 0.42);
  background: linear-gradient(180deg, #fffdf6, #f7efdc);
  box-shadow: 0 18px 44px rgba(40, 24, 8, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  animation: ccPop .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes ccPop { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.cc-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(184, 115, 28, 0.2);
}
.cc-head b {
  font-family: var(--font-ink);
  font-size: 17px;
  letter-spacing: 2px;
  color: #5a3a10;
}
.cc-sub {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: .4px;
}
.cc-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.cc-close:active { transform: scale(.94); }

.cc-title {
  margin: 12px 0 6px;
  font-family: var(--font-ink);
  font-size: 12px;
  letter-spacing: 2px;
  color: #8a5a12;
}
.cc-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.cc-fam {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(184, 115, 28, 0.14);
  color: #8a5a12;
  font-family: var(--font-ink);
  font-size: 13px;
}
.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cc-chip {
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(47, 107, 87, 0.35);
  background: var(--weapon-soft);
  color: var(--ink);
  font-family: var(--font-ink);
  font-size: 17px;
  box-shadow: 0 2px 5px rgba(47, 107, 87, 0.1);
}
.cc-chip.name {
  border-color: rgba(184, 134, 44, 0.45);
  background: var(--name-soft);
  color: #7a5210;
}
.cc-empty {
  font-size: 11px;
  color: var(--ink-3);
}

/* ---------------- 装备 / 武将 详情弹窗 ---------------- */
#detail-mask { z-index: 60; }
.detail-panel {
  position: relative;
  width: min(92%, 400px);
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px 18px;
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pop 0.24s cubic-bezier(0.2, 1.3, 0.5, 1);
}
.detail-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(43, 58, 51, 0.06);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
}
.detail-hero { display: flex; justify-content: center; margin-bottom: 10px; }
.detail-panel h2 {
  margin: 4px 0 4px;
  font-family: var(--font-ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}
.detail-sub {
  margin: 0 0 12px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.detail-sub.left { text-align: left; margin: 10px 0 8px; line-height: 1.5; color: var(--ink-2); }
.detail-attr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--paper-3);
  font-size: 13px;
  margin-bottom: 10px;
}
.detail-attr span { font-size: 10px; color: var(--ink-3); }
.detail-attr b { font-weight: 600; color: var(--ink); }
.detail-desc {
  margin: 0 0 10px;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  text-align: justify;
}
.detail-own {
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: #8a6316;
  font-size: 11.5px;
}
.detail-gen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 12px;
}
.detail-gen h2 { margin: 0 0 3px; font-size: 21px; }
.detail-gen .detail-sub { margin: 0; }
.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.detail-stats div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 9px;
  background: var(--paper-3);
}
.detail-stats span { font-size: 9.5px; color: var(--ink-3); }
.detail-stats b { font-size: 14px; font-weight: 700; color: var(--ink); }
.detail-slots { display: flex; flex-direction: column; gap: 6px; }
.detail-slot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-align: left;
}
.detail-slot > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.detail-slot span { font-size: 9.5px; color: var(--ink-3); }
.detail-slot b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 背景音乐署名 */
.music-credit {
  margin: 2px 0 0;
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--ink-3);
  text-align: center;
}

/* ---------------- 首页：体力加号 / 今日技能 ---------------- */
.energy { align-items: center; }
.energy-plus {
  width: 18px;
  height: 18px;
  margin-left: 3px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fffdf6;
  border: 1px solid #e0a93a;
  color: #a9700f;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.energy-plus:active { transform: scale(0.93); }

/* 首页标题左侧：探出屏幕的树枝，挂一颗「技能」果 */
.hero { position: relative; }
.skill-branch {
  position: absolute;
  left: -8px;
  top: -8px;
  z-index: 2;
  width: 96px;
  height: 88px;
  padding: 0;
  transform-origin: left top;
  transition: transform 0.16s ease;
}
.skill-branch:active { transform: translateY(-1px) rotate(-1.5deg); }
.skill-branch svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sb-limb {
  fill: none;
  stroke: #7a5a34;
  stroke-width: 5.5;
  stroke-linecap: round;
}
.sb-leaf { fill: #7fa896; }
.sb-thread { fill: none; stroke: #7a5a34; stroke-width: 2.2; }
.sb-fruit {
  position: absolute;
  right: 4px;
  bottom: 0;
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 47% 47%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 34% 28%, #ffb08a 0%, #d9573c 52%, #9c3220 100%);
  border: 1.5px solid #8f2f1c;
  box-shadow: 0 4px 10px rgba(143, 47, 28, 0.35), inset 0 2px 6px rgba(255, 224, 200, 0.5);
  color: #fff6e8;
  font-family: var(--font-ink);
}
.sb-fruit b { font-size: 14px; letter-spacing: 1px; line-height: 1.05; }
.sb-fruit i { font-style: normal; font-family: var(--font-ui); font-size: 8px; opacity: 0.85; }
.skill-branch.empty .sb-fruit { filter: grayscale(0.55); opacity: 0.82; }

/* 今日技能弹窗 */
.skills-panel {
  width: 86%;
  max-width: 360px;
  max-height: 80vh;
  max-height: 80dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px 18px;
  text-align: left;
}
.skills-panel h3 {
  margin: 0 0 5px;
  font-family: var(--font-ink);
  font-size: 18px;
  color: #6b4a2b;
}
.skills-tip { margin: 0 0 12px; font-size: 10.5px; color: var(--ink-3); }
.skills-body { display: flex; flex-direction: column; gap: 8px; }
.skill-row {
  display: flex;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.sk-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--c, var(--jade));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, #2f6b57) 18%, transparent);
}
.sk-main b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink);
}
.sk-main b i {
  font-style: normal;
  font-size: 9px;
  color: var(--c, var(--jade));
  border: 1px solid color-mix(in srgb, var(--c, #2f6b57) 45%, transparent);
  border-radius: 999px;
  padding: 0 5px;
}
.sk-main p { margin: 4px 0 0; font-size: 11px; line-height: 1.5; color: var(--ink-2); }
.skills-empty {
  margin: 8px 0 4px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

/* ---------------- 头像 / 军阶 / 体力 弹窗 ---------------- */
.avatar-panel,
.energy-panel {
  width: 86%;
  max-width: 360px;
  max-height: 82vh;
  max-height: 82dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px 18px;
}
.avatar-panel h3,
.energy-panel h3 {
  margin: 0 0 10px;
  font-family: var(--font-ink);
  font-size: 18px;
  color: #6b4a2b;
}
.av-tip {
  margin: 0 0 8px;
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: left;
}
.av-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.av-opt {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-ink);
  font-size: 22px;
  font-weight: 700;
  color: #fff8ea;
  background: radial-gradient(circle at 32% 26%, #fff6e2 0%, var(--c, #b5563f) 46%, #5d2419 100%);
  border: 2px solid transparent;
  text-shadow: 0 1px 2px rgba(60, 20, 10, 0.45);
  opacity: 0.7;
  transition: opacity 0.16s, transform 0.16s;
}
.av-opt.on {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(184, 134, 44, 0.26);
}
.av-opt:active { transform: scale(0.95); }

.rank-ladder {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.rl-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--paper-3);
  font-size: 12px;
  color: var(--ink-2);
}
.rl-no {
  width: 15px;
  text-align: center;
  font-size: 9px;
  color: var(--ink-3);
}
.rl-row b {
  font-family: var(--font-ink);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.rl-row small { margin-left: auto; font-size: 9.5px; color: var(--ink-3); }
.rl-row em {
  font-style: normal;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(43, 58, 51, 0.08);
  color: var(--ink-3);
  white-space: nowrap;
}
.rl-row.on { background: var(--gold-soft); }
.rl-row.on b { color: #8a6316; }
.rl-row.on em { background: var(--gold); color: #fff; }
.rl-row.done b { color: var(--jade); }
.rl-row.done em { background: var(--jade-soft); color: var(--jade); }

.energy-now {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ink-2);
}
.energy-now b { font-size: 17px; color: var(--jade); }
.energy-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.energy-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.energy-opt:disabled { opacity: 0.45; }
.energy-opt b { font-size: 13px; }
.energy-opt small { font-size: 10px; color: var(--gold); }
.energy-opt.ad { border-color: #e0a93a; background: linear-gradient(180deg, #fff8e7, #f9ecc9); }
.energy-opt.share { border-color: var(--jade-2); background: linear-gradient(180deg, #f2faf4, #e6f2ea); }
.energy-opt:active { transform: translateY(1px); }
.energy-note {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* 首页内容较多时允许滚动，避免小屏被裁 */
#scr-home { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* 今日技能：主动 / 被动分组 */
.sk-group { margin-bottom: 12px; }
.sk-group:last-child { margin-bottom: 0; }
.sk-group h4 {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.sk-group h4 em {
  font-style: normal;
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(43, 58, 51, 0.07);
  color: var(--ink-3);
}
.sk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sk-chip {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--c, var(--jade));
  color: var(--c, var(--jade));
  background: color-mix(in srgb, var(--c, #2f6b57) 9%, #fffdf6);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease;
}
.sk-chip:hover { transform: translateY(-1px); }
.sk-chip.on {
  background: var(--c, var(--jade));
  color: #fffdf6;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--c, #2f6b57) 45%, transparent);
}
.sk-none { margin: 0; font-size: 11px; color: var(--ink-3); }

/* 今日技能：点击后显示的详情卡 */
.skills-detail { margin-top: 6px; }
.sk-detail-card {
  border: 1px solid var(--dc, var(--jade));
  border-radius: 12px;
  padding: 12px 12px 11px;
  background: color-mix(in srgb, var(--dc, #2f6b57) 7%, #fffdf6);
}
.sk-detail-top { display: flex; align-items: center; gap: 10px; }
.sk-detail-seal {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-ink); font-size: 22px; color: #fffdf6;
  background: var(--dc, var(--jade));
}
.sk-detail-name { display: block; font-family: var(--font-ink); font-size: 17px; color: var(--ink); }
.sk-detail-tags { display: inline-flex; gap: 8px; margin-top: 2px; font-size: 10px; color: var(--ink-3); }
.sk-detail-tags i { font-style: normal; }
.sk-detail-desc { margin: 9px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-2); }

/* 技能替换 */
.rep-row {
  width: 100%;
  text-align: left;
  align-items: center;
  cursor: pointer;
}
.rep-row .rep-go {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--jade);
}
.new-row {
  border-style: dashed;
  border-color: var(--c, var(--jade));
  background: color-mix(in srgb, var(--c, #2f6b57) 6%, #fffdf6);
}
#replace-giveup { margin-top: 12px; }

/* 点将：武器 / 人物选项卡 */
.eq-tab em {
  font-style: normal;
  font-size: 9.5px;
  margin-left: 3px;
  opacity: 0.72;
}

/* 点将：字牌底部的天赋等级 */
.family-head,
.name-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.family-head { width: 40px; height: 46px; }
.name-chip { min-width: 40px; padding: 4px 8px 3px; line-height: 1; }
.name-chip .nc,
.family-head .nc { font-family: var(--font-ink); font-size: 18px; line-height: 1.1; }
.qbadge {
  font-style: normal;
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.3px;
  padding: 1px 4px;
  border-radius: 999px;
  color: var(--qc, #8a958d);
  border: 1px solid var(--qc, #8a958d);
  background: color-mix(in srgb, var(--qc, #8a958d) 12%, #fffdf6);
}

/* 营地字库：已上阵的名字字灰显 */
.cc-chip.used {
  border-color: var(--line);
  background: #ece9e0;
  color: var(--ink-3);
  box-shadow: none;
}

/* 战前序幕：返回首页（主页/无尽深渊共用，不扣体力） */
.intro-back {
  position: absolute;
  left: 12px;
  top: max(10px, env(safe-area-inset-top));
  z-index: 4;
  width: 38px;
  height: 38px;
  padding: 0 0 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(184, 115, 28, 0.45);
  background: rgba(255, 253, 246, 0.92);
  color: #8a5a12;
  font-family: var(--font-ui);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(120, 72, 20, 0.18), inset 0 0 0 2px rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.intro-back:active { transform: scale(0.93); }

/* 战前序幕：矮屏自适应，宽屏手机不出现上下滚动 */
.intro-body { gap: clamp(4px, 1vh, 10px); }
.intro-me h2, .intro-foe h2 {
  font-size: clamp(20px, 3.4vh, 28px);
  margin: clamp(4px, 1vh, 10px) 0 clamp(6px, 1.4vh, 14px);
}
.intro-vs { font-size: clamp(30px, 5.4vh, 46px); }
.intro-stats { gap: clamp(3px, 0.8vh, 7px); }
.intro-tags { margin-top: clamp(4px, 1.2vh, 10px); }
#intro-march { height: clamp(44px, 6.4vh, 54px); font-size: clamp(18px, 2.6vh, 21px); }

@media (max-height: 700px) {
  .intro-overlay { padding: max(6px, env(safe-area-inset-top)) 10px 2px; }
  .intro-body { gap: 2px; }
  .intro-banner { font-size: 10px; padding: 2px 10px; }
  .intro-me h2, .intro-foe h2 { font-size: 18px; margin: 2px 0 4px; }
  .intro-stats { gap: 2px; }
  .intro-stats div { padding: 1px 2px; font-size: 11px; }
  .intro-tags { margin-top: 3px; gap: 3px; }
  .intro-line { font-size: 9.5px; }
  .intro-vs { font-size: 26px; }
  .foe-id { margin: 4px 0; gap: 8px; }
  .foe-avatar { width: 36px; height: 36px; font-size: 17px; }
  .intro-stage { padding: 2px 12px; font-size: 11px; }
  .intro-actions { padding: 6px 16px max(8px, env(safe-area-inset-bottom)); }
  #intro-march { height: 44px; font-size: 17px; letter-spacing: 10px; text-indent: 10px; }
}

@media (max-height: 600px) {
  .intro-tags { display: none; }
  .intro-banner { display: none; }
  .intro-me h2, .intro-foe h2 { font-size: 16px; margin: 1px 0 3px; }
  .intro-vs { font-size: 20px; }
  .intro-stats { font-size: 10px; }
  #intro-march { height: 40px; font-size: 16px; }
}

/* 图鉴：同名多武将切换 */
.gen-pick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 2px 0 10px; }
.gen-pick button {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 12px;
  color: var(--ink-2);
}
.gen-pick button.on { border-color: var(--jade); color: var(--jade); background: var(--jade-soft); }
.gen-pick small { margin-left: 4px; font-size: 9px; opacity: .65; }

/* 无尽深渊序幕：单人闯关，不显示对方与 VS */
#scr-intro.endless-mode .intro-foe,
#scr-intro.endless-mode .intro-vs { display: none; }
#scr-intro.endless-mode .intro-me { margin: 0 auto; }

/* 无尽深渊：上方半场为不可布阵的深渊区 */
.endless-veil {
  position: absolute;
  inset: 0 0 50% 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(30, 40, 35, 0.5) 0%, rgba(30, 40, 35, 0.2) 60%, rgba(30, 40, 35, 0));
}
.endless-veil span {
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(247, 243, 232, 0.25);
  background: rgba(24, 32, 28, 0.42);
  color: #f7f3e8;
  font-family: var(--font-ink);
  font-size: 15px;
  letter-spacing: 3px;
  text-indent: 3px;
}
.endless-veil b { color: #f2c46a; font-weight: 600; }

/* 装备页：武将按姓氏分组 */
.gen-fam {
  border-radius: 12px;
  border: 1px solid rgba(43, 58, 51, 0.1);
  background: rgba(255, 253, 246, 0.55);
  overflow: hidden;
}
.gen-fam-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
}
.gen-fam-head b {
  font-family: var(--font-ink);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--ink);
}
.gen-fam-head small { flex: 1 1 auto; font-size: 10.5px; color: var(--ink-3); }
.gen-fam-head i {
  font-style: normal;
  font-size: 15px;
  color: var(--ink-3);
  transition: transform 0.18s;
}
.gen-fam.open .gen-fam-head { background: var(--jade-soft); }
.gen-fam.open .gen-fam-head i { transform: rotate(90deg); }
.gen-fam-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 6px 8px;
}

/* 在线对战：匹配中的占位模型 */
#scr-intro.matching .intro-foe { animation: match-breathe 2s ease-in-out infinite; }
#scr-intro.matching .foe-avatar {
  position: relative;
  color: var(--jade);
  background: var(--jade-soft);
}
#scr-intro.matching .foe-avatar::before,
#scr-intro.matching .foe-avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(47, 107, 87, 0.4);
  animation: match-ping 1.6s ease-out infinite;
}
#scr-intro.matching .foe-avatar::after { animation-delay: 0.8s; }
@keyframes match-ping {
  0% { transform: scale(0.82); opacity: 0.9; }
  100% { transform: scale(1.55); opacity: 0; }
}
@keyframes match-breathe {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}
.match-skel {
  display: inline-block;
  width: 86px;
  height: 8px;
  border-radius: 4px;
  vertical-align: middle;
  background: linear-gradient(90deg, rgba(43,58,51,.08), rgba(43,58,51,.2), rgba(43,58,51,.08));
  background-size: 200% 100%;
  animation: match-shimmer 1.2s linear infinite;
}
.match-skel.short { width: 56px; }
@keyframes match-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
#intro-march:disabled { opacity: 0.55; }

/* 背包中已穿戴/可换装的装备 */
.gear-item.worn { background: var(--jade-soft); }
.gear-item.worn .gi-main em { color: var(--jade); }
