/* ============================================================
 * 植物大战僵尸模拟器 · 样式（移动优先，兼容电脑 480px 容器）
 * 主题：深夜草坪绿 + 阳光黄 —— 深绿底（#08130b）+ 豌豆绿描边（#7ed957）+ 阳光黄（#f4d35e）
 * 背景为纯色底（长列表滚动不出现上下分层）；网格与辉光是 fixed，不参与滚动
 * ============================================================ */
[hidden] { display: none !important; }

:root {
  --bg:          #08130b;     /* 深夜草坪 */
  --bg-deep:     #040c06;
  --panel:       #102317;
  --panel-2:     #16301f;
  --panel-3:     #1e4029;
  --line:        #7ed957;     /* 豌豆绿 */
  --line-soft:   #2f5b34;
  --gold:        #f4d35e;     /* 阳光黄 */
  --gold-dim:    #8d7a2a;
  --gold-bright: #fff3b0;
  --teal:        #8fd14f;     /* 主强调色 = 嫩叶绿 */
  --teal-dim:    #5fa832;
  --danger:      #d9484a;
  --danger-text: #ff9aa2;
  --text:        #eaf5e6;
  --text-dim:    #a9c4a2;
  --text-mute:   #6b8a68;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "DejaVu Sans Mono", monospace;

  /* —— 位置色（控卫 / 分卫 / 小前 / 大前 / 中锋） —— */
  --p-def: #7fb3ff;
  --p-sup: #ffd166;
  --p-single: #ff9f6b;
  --p-aoe: #b99cff;
  --p-ash: #ff6b6b;
  /* 旧类名保留（历史样式仍可能引用），统一映射到新位置色 */
  --p-top: var(--p-c);
  --p-jug: var(--p-sf);
  --p-mid: var(--p-pg);
  --p-adc: var(--p-sg);
  --p-sup: var(--p-pf);
  --c-war: var(--p-c);
  --c-mag: var(--p-pg);
  --c-asn: var(--p-sf);
  --c-tnk: var(--p-pf);
  --c-mm:  var(--p-sg);
  --c-sup: var(--p-pg);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ============================================================
 * 全局：**永远不出现横向滚动**
 *   html/body 关掉横向溢出 → 任何元素超宽都只会被裁掉，不会撑出左右滑动
 * ============================================================ */
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100%;
  /* ⚠ `width:100%` 必须写：`overflow-x:hidden` 只裁剪显示，**不阻止元素被内容撑宽**
   *   （html 的宽度锚在视口上，从它开始卡死，下面的 100% 才有意义） */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;   /* iOS 横屏不放大字号，避免撑破 */
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}
/* 多媒体/表格永不超宽 */
img, canvas, video, table { max-width: 100%; }
/* 长串（URL / 连续英文数字）强制换行，避免撑破容器 */
.log-item, .about-text, .hist-item, .settle-note, .sign-note,
.review-log .log-item, .mask-info, .lb-name { overflow-wrap: anywhere; word-break: break-word; }
/* 夜空网格 + 上下辉光：fixed 定位，滚动时不动，底色保持纯色不分层 */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  width: 480px; max-width: 100%;
  height: 100%;
  transform: translateX(-50%);
  background:
    radial-gradient(90% 55% at 50% 0%, rgba(126,217,87,.10), transparent 62%),
    radial-gradient(120% 70% at 50% 110%, rgba(244,211,94,.10), transparent 66%),
    repeating-linear-gradient(0deg, rgba(126,217,87,.045) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(126,217,87,.045) 0 1px, transparent 1px 34px);
  pointer-events: none;
  z-index: 0;
}

.view {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  border-radius: 12px;
  padding: 10px 17px;
  font-size: 14.5px;
  cursor: pointer;
  user-select: none;
  transition: transform .1s, filter .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); filter: brightness(1.15); }
.btn-primary {
  background: linear-gradient(180deg, #f6d98a, #d8ab4e);
  border-color: var(--gold-bright);
  color: #2a1d00;
  font-weight: 700;
}
.btn-big { width: 100%; padding: 12px 14px; font-size: 14.5px; border-radius: 13px; }
.btn-danger { border-color: var(--danger); color: var(--danger-text); }
.btn.gray, .btn:disabled { opacity: .45; cursor: default; }
.btn-pause {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; font-size: 15px; cursor: pointer;
  flex: 0 0 auto;
}
.btn-pill {
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.04); color: var(--text-dim);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px; cursor: pointer;
}
.btn-pill:active { color: var(--gold-bright); border-color: var(--gold); }

/* ⚠⚠ 宽度屏障：凡是「用 fitOneLine / fitHomeLine 缩字号」的单行文本元素，
 *   都必须有**宽度上限**（以及从 #app 一路下来的 width:100% 约束）——
 *   否则元素会被自身内容撑宽，clientWidth 跟着一起变大 → `naturalWidth <= avail`
 *   恒成立 → 缩字号一次都不触发，长标题直接被裁掉右半截。
 *   （用户把首页标题改成「原神模拟器2.0(礼装版)」后暴露：标题撑到 401px > 视口 390px） */
#app, .view, .home-hero, .page-head { width: 100%; max-width: 100%; }
.home-title, .game-title, .page-title, .home-count, .home-tianli { max-width: 100%; overflow: hidden; }

/* ---------- 首页 ---------- */
.home-hero { text-align: center; margin-top: 6px; }
.home-title {
  margin: 0; font-size: 34px; font-weight: 800; letter-spacing: 2px;
  /* 鎏金标题：金色纵向渐变 + 顶部白高光 + 深金投影 —— 浅金底上也能"金光闪闪" */
  color: transparent;
  background: linear-gradient(180deg, #efffe0 0%, #b9f06a 38%, #6fbf3a 62%, #3f8c2a 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.5)) drop-shadow(0 2px 6px rgba(20,60,20,.6));
  white-space: nowrap;
}
.home-sub {
  margin-top: 4px; font-size: 12.5px; color: var(--text-dim);
  line-height: 1.6; padding: 0 6px;
}
.home-count {
  margin-top: 10px; font-size: 12.5px; color: var(--text-dim);
  background: rgba(126,217,87,.07);
  border: 1px solid rgba(126,217,87,.22);
  border-radius: 999px; padding: 7px 14px;
  white-space: nowrap;
  /* ⚠ 必须给宽度上限：这行是 flex 列的居中子项（align-items:center），
   *   不加 max-width 时元素宽度永远跟着内容走 → scrollWidth 恒等于 clientWidth，
   *   溢出根本测不出来，缩字号逻辑（fitHomeCount/fitTianli）就是摆设。 */
  max-width: 100%;
  overflow: hidden;          /* 兜底：真缩到最小还放不下就裁掉，绝不撑破整页 */
}
/* ⚠ 这里**不能写死 px**：外层整行会按需缩字号，写死会让 <b> 不跟着缩、整行照样溢出。
 *   用 em 跟随外层（略大一点点保持强调）。 */
.home-count b { color: var(--teal); font-size: 1.04em; }
.home-tianli {
  margin-top: 8px;
  background: rgba(240,201,106,.07);
  border-color: rgba(240,201,106,.26);
}
.home-tianli b { color: var(--gold-bright); }

.home-lv {
  width: 100%; margin-top: 10px;
  background: linear-gradient(180deg, rgba(22,48,31,.9), rgba(16,35,23,.9));
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 14px 10px;
}
.lv-head { display: flex; align-items: baseline; gap: 6px; font-size: 13px; min-width: 0; }
.lv-name { color: var(--teal); font-weight: 700; flex: 0 0 auto; }
.lv-lv { color: var(--gold-bright); font-size: 13.5px; white-space: nowrap; flex: 0 0 auto; }
.lv-bonus { margin-left: auto; color: var(--text-dim); font-size: 11.5px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lv-bar {
  height: 7px; border-radius: 999px; margin-top: 8px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.lv-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width .3s;
}
/* 等级框：红线（分隔线，压在「教练特训」按钮上方） */
.lv-gap-line { margin-top: 8px; border-top: 1px dashed rgba(240,201,106,.35); }
/* 等级框底部：资金行（左标签 / 右数值） */
.lv-gem-line {
  margin-top: 8px;
  display: flex; align-items: center;
}
.lv-gem-name { font-size: 12.5px; color: var(--text-dim); }
.lv-gem-val { margin-left: auto; font-size: 15px; color: var(--teal); font-weight: 700; }

.home-btns { width: 100%; margin-top: 14px; }
.home-team-wrap {
  width: 100%; margin-top: 12px;
  border: 1px solid var(--line-soft); border-radius: 14px;
  background: rgba(16,35,23,.6);
  padding: 10px 10px 8px;
}
.home-team-title { font-size: 12px; color: var(--text-mute); margin-bottom: 8px; }
.home-team { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.home-team .mini-card {
  flex: 1 1 0; min-width: 0;
  /* ⚠ 必须 relative：卡里的「外援」角标是 absolute 定位，否则会飞到整页右上角 */
  position: relative;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 8px 6px; text-align: center;
  display: flex; flex-direction: column; gap: 3px;
}
.mini-card .mc-name { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; }
.mini-card .mc-sub { font-size: 10.5px; color: var(--text-mute); white-space: nowrap; }
.mini-card.empty { opacity: .45; }
/* 位置标签（5 种）—— 基础版式 + 配色 */
.pos-tag {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; padding: 0 5px; height: 17px;
  font-size: 10px; font-weight: 700; line-height: 1;
  vertical-align: middle; flex: 0 0 auto;
  background: rgba(10,200,185,.12); color: #9fe0f0; border: 1px solid rgba(10,200,185,.42);
}
.p-pg { background: rgba(74,163,255,.18); color: #9fc8ff; border-color: rgba(74,163,255,.5); }
.p-sg { background: rgba(255,179,71,.18); color: #ffcf8a; border-color: rgba(255,179,71,.5); }
.p-sf { background: rgba(94,224,160,.18); color: #96efc3; border-color: rgba(94,224,160,.5); }
.p-pf { background: rgba(179,140,255,.18); color: #cdb2ff; border-color: rgba(179,140,255,.5); }
.p-c  { background: rgba(255,107,107,.18); color: #ff9d9d; border-color: rgba(255,107,107,.5); }
/* 球技图鉴的「位置胶囊」直接复用同一套颜色（champ-chip 需要边框） */
.champ-chip.p-pg, .champ-chip.p-sg, .champ-chip.p-sf, .champ-chip.p-pf, .champ-chip.p-c { border-style: solid; border-width: 1px; }

/* 位置胶囊（卡面第一行第三格） */
.region-tag {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; padding: 0 5px; height: 17px;
  font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .3px;
  vertical-align: middle; flex: 0 0 auto;
}
.r-lpl { background: rgba(217,74,74,.18); color: #ff9090; border: 1px solid rgba(217,74,74,.5); }
.r-lck { background: rgba(74,144,217,.18); color: #93c3f2; border: 1px solid rgba(74,144,217,.5); }
.r-lec { background: rgba(94,200,138,.18); color: #93e2b4; border: 1px solid rgba(94,200,138,.5); }
.r-lta { background: rgba(224,160,60,.18); color: #f2c586; border: 1px solid rgba(224,160,60,.5); }
.r-lcp { background: rgba(176,106,217,.18); color: #d3a6f2; border: 1px solid rgba(176,106,217,.5); }
.r-wc  { background: rgba(138,149,168,.18); color: #b4c0d4; border: 1px solid rgba(138,149,168,.5); }

/* 球技职业胶囊 */
.champ-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; padding: 0 5px; height: 17px;
  font-size: 10px; font-weight: 700; line-height: 1;
}
.c-war { background: rgba(255,138,76,.18); color: #ffb38a; border: 1px solid rgba(255,138,76,.5); }
.c-mag { background: rgba(90,169,255,.18); color: #9fc8ff; border: 1px solid rgba(90,169,255,.5); }
.c-asn { background: rgba(255,127,176,.18); color: #ffa8c8; border: 1px solid rgba(255,127,176,.5); }
.c-tnk { background: rgba(200,170,110,.18); color: #e3c98f; border: 1px solid rgba(200,170,110,.5); }
.c-mm  { background: rgba(255,209,102,.18); color: #ffe08a; border: 1px solid rgba(255,209,102,.5); }
.c-sup { background: rgba(87,214,138,.18); color: #93e2b4; border: 1px solid rgba(87,214,138,.5); }

.home-row { width: 100%; display: flex; gap: 10px; margin-top: 10px; }
.home-row2 .btn {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; padding: 10px 8px;
}
.home-row3 .btn {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  padding: 10px 6px; font-size: 14px;
}
/* 按钮主文字与副标题（与成就按钮同一套结构，视觉统一） */
.home-row .btn > span:first-child { font-size: 15px; line-height: 1.3; white-space: nowrap; }
.ach-btn-tip {
  font-size: 10.5px; color: var(--gold); font-weight: 400;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}

.btn-follow {
  margin-top: 12px; border-color: var(--gold);
  background: linear-gradient(180deg, rgba(240,201,106,.16), rgba(240,201,106,.06));
  color: var(--gold-bright); font-size: 12.5px; white-space: normal;
}
.qr-area { margin-top: 14px; text-align: center; }
.qr-text { font-size: 12px; color: var(--text-mute); margin-bottom: 6px; }
.qr-img { width: 150px; height: 150px; border-radius: 10px; background: #fff; padding: 6px; }

/* ---------- 游戏页 ---------- */
.game-top { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.game-title {
  flex: 1; text-align: center; font-size: 16px; font-weight: 700; white-space: nowrap;
  /* 同首页标题：鎏金渐变 */
  color: transparent;
  background: linear-gradient(180deg, #efffe0 0%, #b9f06a 38%, #6fbf3a 62%, #3f8c2a 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.7)) drop-shadow(0 1px 3px rgba(105,75,12,.5));
}
.attr-grid { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.stamina-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(16,35,23,.75); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 10px 12px;
}
.stamina-name { font-size: 12.5px; color: var(--teal); flex: 0 0 auto; }
.stamina-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.stamina-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .25s; }
.stamina-val { font-size: 13px; color: var(--gold-bright); flex: 0 0 auto; }
.attr-row3 { display: flex; gap: 8px; }
.attr-card {
  flex: 1; min-width: 0;
  background: rgba(16,35,23,.75); border: 1px solid var(--line-soft);
  border-radius: 12px; padding: 9px 6px; text-align: center;
}
.attr-name { font-size: 11px; color: var(--text-mute); white-space: nowrap; }
.attr-val { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--gold-bright); white-space: nowrap; }

.team-box {
  width: 100%; margin-top: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.team-box.scroll { max-height: 240px; overflow-y: auto; }
.team-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(16,35,23,.75); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 8px 10px;
  font-size: 12.5px; white-space: nowrap;
}
/* ⚠ 行内每一段都必须 flex:0 0 auto（不许收缩）：
 *   一旦被压扁，fitOneLine 量到的就是「压扁后的宽度」→ 误判成放得下而不缩字号，
 *   名字会直接溢出压到 Lv./元素上（结算页与游戏页的从者行都是这套版式）。
 *   保证不收缩后，fitOneLine 才能量到真实所需宽度并逐级缩字号，永远一行放下。 */
.team-row > * { flex: 0 0 auto; }
.team-name {
  display: flex; align-items: center; gap: 5px;
  color: var(--text); font-weight: 700;
}
.team-lv { color: var(--teal); }
.team-attr { color: var(--text-dim); }
.team-power { margin-left: auto; color: var(--gold-bright); font-weight: 700; }
.team-row.team-empty { justify-content: center; color: var(--text-mute); }

.manual-tip { margin-top: 10px; font-size: 12px; color: var(--gold); }
/* ---------- 日志面板（参考龙族：一整块带框面板，条目在里面只是淡淡分行） ----------
 * ⚠ **不要**给它 overflow-y:auto / 固定高度：那样会把日志锁成"内部滚动的小框"。
 *   龙族能滚动是因为父级是 min-height（高度自适应），所以这里不锁高度、跟随整页滚动。 */
.log-box {
  width: 100%;
  margin-top: 10px;
  background: rgba(6,10,18,.7);
  border: 1px solid rgba(126,217,87,.22);
  border-radius: 12px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.log-item {
  font-size: 13px; line-height: 1.55;
  padding: 6px 9px; border-radius: 8px;
  background: rgba(20,29,46,.4); color: #cbd5ea;
}
/* 日常历练行：几乎不显底色，读起来就是面板里的一行字 */
/* ⚠ 文字色只**压深明度**（色相不变）—— 页面底色换成浅金后，原来的浅色字看不清 */
.log-item.year { background: rgba(20,29,46,.18); color: #93a0ba; font-size: 12.5px; }
.log-item.brk { background: rgba(116,194,168,.14); border: 1px solid rgba(116,194,168,.4); color: #a9e3cd; }
.log-item.ev1 { background: rgba(110,150,220,.12); border: 1px solid rgba(110,150,220,.3); color: #c9d7f0; }
.log-item.ev2 { background: rgba(180,120,220,.12); border: 1px solid rgba(180,120,220,.35); color: #e0c9f5; }
.log-item.ev3 { background: rgba(240,201,106,.14); border: 1px solid rgba(240,201,106,.4); color: #ffe9a8; }
.log-item.ev4 { background: rgba(230,80,80,.16); border: 1px solid rgba(230,80,80,.45); color: #ffb3b3; }
.log-item.red { background: rgba(255,60,60,.16); border: 1px solid rgba(255,60,60,.5); color: #ff9a9a; font-weight: 700; }
.log-item.dead { background: rgba(180,60,60,.15); border: 1px solid rgba(180,60,60,.4); color: #ffb3b3; }
.log-item.god { background: rgba(126,217,87,.18); border: 1px solid rgba(126,217,87,.5); color: #eafcff; font-weight: 700; }
.log-item.rainbow {
  background: linear-gradient(90deg, rgba(255,90,90,.26), rgba(255,200,80,.26), rgba(110,220,120,.26), rgba(90,160,255,.26), rgba(180,120,255,.26));
  background-size: 400% 100%;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-weight: 700;
  animation: rainbowShift 1.2s linear infinite;
}
.log-item.plot {
  background: linear-gradient(90deg, rgba(255,90,90,.26), rgba(255,200,80,.26), rgba(110,220,120,.26), rgba(90,160,255,.26), rgba(180,120,255,.26));
  background-size: 400% 100%;
  border: 1px solid rgba(255,255,255,.45);
  color: #fff; font-weight: 700;
  animation: rainbowShift 1.6s linear infinite;
}
.log-item.plotmiss { background: rgba(120,128,140,.12); border: 1px solid rgba(120,128,140,.3); color: #98a1ad; }
@keyframes rainbowShift { 0% { background-position: 0% 0; } 100% { background-position: 400% 0; } }

/* ---------- 结算（参考龙族：整块居中、数据行带分隔虚线、按钮两列） ---------- */
#view-settle {
  justify-content: center;
  align-items: center;
  padding-top: 8px; padding-bottom: 8px;
  min-height: 100vh;
}
.settle-box {
  width: 100%; max-width: 440px;
  background: linear-gradient(180deg, rgba(22,33,63,.92), rgba(13,21,38,.92));
  border: 1px solid rgba(126,217,87,.35);
  border-radius: 16px;
  padding: 18px 16px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.settle-title {
  text-align: center; font-size: 22px; font-weight: 700; color: var(--text);
  white-space: nowrap;
}
.settle-title.god {
  color: transparent;
  background: linear-gradient(90deg,#ff5f5f,#ffd75e,#6fdc8c,#6fb0ff,#c78cff);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 14px rgba(126,217,87,.5));
}
.settle-title.died { color: var(--danger-text); }
/* 失败长标题（后院被攻破…）：必须一行，放不下由 fitOneLine 自动缩小字号 */
.settle-title.long { font-size: 17px; white-space: nowrap; }
/* 数据行：左右分布 + 虚线下边框，最后一行不要线 */
.settle-rows { display: flex; flex-direction: column; }
.s-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(240,201,106,.30);
  font-size: 14px;
}
.s-row:last-child { border-bottom: none; }
.s-row span { color: var(--text-mute); }
.s-row b { color: var(--text); }
.settle-team { margin-top: 2px; }
.settle-note { font-size: 12.5px; color: var(--gold); text-align: center; }
/* 全球冠军赛被削弱的七彩文案（沿用日志的 rainbow 观感：流光底 + 白字） */
.settle-note.rainbow {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(255,90,90,.26), rgba(255,200,80,.26), rgba(110,220,120,.26), rgba(90,160,255,.26), rgba(180,120,255,.26));
  background-size: 400% 100%;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-weight: 700; line-height: 1.6;
  animation: rainbowShift 1.2s linear infinite;
}
.settle-rank {
  background: rgba(126,217,87,.08);
  border: 1px solid rgba(126,217,87,.25);
  border-radius: 10px;
  padding: 8px;
  color: var(--gold);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
/* 结算按钮：两列网格（2×2） */
.settle-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 2px; }
.settle-btns .btn-big { padding: 11px 6px; font-size: 14.5px; border-radius: 11px; }
.settle-box .qr-area { margin-top: 4px; }

/* ---------- 子页通用 ---------- */
.page-view { align-items: stretch; }
.page-head {
  width: 100%; position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 36px; margin-bottom: 8px;
}
.page-title {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  margin: 0; font-size: 18px; font-weight: 800; color: var(--gold-bright);
  white-space: nowrap;
}
.btn-close {
  margin-left: auto; position: relative; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text-dim); font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.btn-close:active { transform: scale(.92); color: var(--gold-bright); border-color: var(--gold); }

/* ---------- Tabs / 筛选 ---------- */
.tabs { width: 100%; display: flex; gap: 6px; margin-bottom: 8px; }
.tabs-wrap { flex-wrap: wrap; }
.tabs-small .tab { font-size: 12px; padding: 6px 4px; }
.tab {
  flex: 1; padding: 8px 6px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(126,217,87,.25);
  background: rgba(255,255,255,.04);
  color: var(--text-dim); font-size: 13px; font-weight: 700;
  white-space: nowrap;
}
.tab.active { background: rgba(240,201,106,.18); color: var(--gold-bright); border-color: var(--gold); }

/* ---------- 排行榜 ---------- */
.lb-note { width: 100%; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.rank-fate-note { width: 100%; font-size: 12px; color: var(--gold); margin-bottom: 8px; }
.lb-body { width: 100%; max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.lb-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: rgba(16,35,23,.7); border: 1px solid rgba(126,217,87,.18);
  border-radius: 10px; font-size: 13px;
}
.lb-row.me { border-color: var(--gold); background: rgba(240,201,106,.1); }
.lb-rank { flex: 0 0 30px; text-align: center; font-weight: 800; color: var(--text-mute); }
.lb-rank.top { color: var(--gold-bright); }
.lb-rank.r1 { color: #ffd75e; } .lb-rank.r2 { color: #dfe6f0; } .lb-rank.r3 { color: #e6a877; }
.lb-user { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.lb-avatar { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; }
.lb-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-time { font-size: 11px; color: var(--text-mute); white-space: nowrap; }
.lb-score { margin-left: auto; color: var(--gold-bright); font-weight: 700; white-space: nowrap; }
.lb-tip { text-align: center; color: var(--text-mute); font-size: 13px; padding: 22px 0; }

/* ---------- 成就（参考龙族模拟器的卡片式排版） ---------- */
.ach-total {
  width: 100%; text-align: center;
  color: var(--gold); font-size: 16px; font-weight: 700;
  margin-bottom: 12px; padding: 10px 9px;
  background: rgba(240,201,106,.08);
  border: 1px solid rgba(240,201,106,.25);
  border-radius: 12px;
}
.ach-list {
  width: 100%; display: flex; flex-direction: column; gap: 10px;
  padding: 2px 0 8px;
}
.ach-list::-webkit-scrollbar { width: 6px; }
.ach-list::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
.ach-list::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 3px; }
.ach-item {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  border: 1px solid rgba(126,217,87,.22); border-radius: 14px;
  padding: 12px 15px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.ach-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* 成就进度条：当前值 / 目标值 */
.ach-prog { display: flex; align-items: center; gap: 8px; }
.ach-bar {
  flex: 1 1 auto; min-width: 0; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.ach-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width .25s;
}
.ach-prog-txt { flex: 0 0 auto; font-size: 11px; color: var(--text-mute); white-space: nowrap; }
.ach-item.done .ach-fill { background: linear-gradient(90deg, #6cdb8a, var(--gold)); }
.ach-item.done .ach-prog-txt { color: #6cdb8a; }
.ach-item.done {
  border-color: var(--gold);
  background: linear-gradient(180deg, #33301f, #26241a);
  box-shadow: 0 2px 14px rgba(126,217,87,.18);
}
.ach-name { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.ach-item.done .ach-name { color: var(--teal); }
.ach-item.todo .ach-name { color: #8b9096; }
.ach-bonus { font-size: 13px; white-space: nowrap; }
.ach-item.done .ach-bonus { color: #6cdb8a; }
.ach-item.todo .ach-bonus { color: #5c6882; }

/* ---------- 高光 ---------- */
.hl-note { width: 100%; font-size: 12px; color: var(--text-dim); margin-bottom: 10px; text-align: center; }
.hl-list { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.hl-list-page { max-height: 70vh; overflow-y: auto; }
.hl-item {
  background: rgba(16,35,23,.75); border: 1px solid rgba(126,217,87,.28);
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
}
.hl-item:active { filter: brightness(1.15); }
/* 长结局文案（后院被攻破…）在中间列内换行，保证完整可读、不撑破卡片 */
.hl-top { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.hl-top .hl-innate { flex: 1 1 auto; min-width: 0; white-space: normal; line-height: 1.35; text-align: right; }
.hl-top b { color: var(--gold-bright); }
.hl-end { margin-left: auto; font-size: 11.5px; color: var(--text-mute); }
.hl-innate { font-size: 11px; color: var(--teal); }
/* 夺冠全球冠军赛：与画布里的强调色一致（HL_END_COLOR['夺冠全球冠军赛'] = #7ed957） */
.hl-innate.hl-slain { color: var(--gold-bright); font-weight: 700; }
.hl-mid { margin-top: 5px; font-size: 12px; color: var(--text-dim); }
.hl-mid b { color: var(--text); }
.hl-weak { font-size: 11.5px; color: var(--text-dim); }
/* 圣杯争夺战高光：双方出战各一行（我方米白 / 对手战术红） */
/* 高光页：双方出战名单必须完整展示，10 株时自动换行，不裁切 */
.hl-vs { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.45; }
.hl-vs.hl-side-me { color: var(--text); }
.hl-vs.hl-side-foe { color: #ff8b95; }
.hl-weak b { color: var(--teal); }
.hl-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(10,16,36,.95); border: 1px solid var(--gold);
  color: var(--gold-bright); border-radius: 999px; padding: 9px 18px;
  font-size: 13px; z-index: 80;
}
.hl-img-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.hl-img { max-width: 88vw; max-height: 70vh; border-radius: 10px; }
.hl-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- 设置 ---------- */
.settings-body { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.set-card {
  background: rgba(16,35,23,.75); border: 1px solid rgba(126,217,87,.24);
  border-radius: 12px; padding: 12px;
}
.set-row { display: flex; align-items: center; }
.set-label { font-size: 14px; color: var(--text); }
.set-switch { margin-left: auto; position: relative; width: 46px; height: 26px; }
.set-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.set-switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: rgba(255,255,255,.14); transition: background .2s;
}
.set-switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #cfd8ea; transition: transform .2s;
}
.set-switch input:checked + .track { background: linear-gradient(90deg, var(--teal), var(--gold)); }
.set-switch input:checked + .track::after { transform: translateX(20px); background: #fff; }
.set-tip { margin-top: 7px; font-size: 11.5px; color: var(--text-mute); line-height: 1.5; }
.set-label2 { font-size: 13.5px; color: var(--teal); font-weight: 700; margin-bottom: 8px; }
.set-select {
  width: 100%; padding: 9px 10px; border-radius: 10px; font-size: 13px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line-soft);
}
.speed-label { display: flex; align-items: center; font-size: 13px; color: var(--text-dim); }
.speed-label b { margin-left: auto; color: var(--gold-bright); }
.speed-range { width: 100%; margin-top: 8px; accent-color: var(--gold); }

/* ---------- 说明 ---------- */
.about-body { width: 100%; }
.about-text {
  font-size: 13.5px; line-height: 1.95; color: var(--text-dim);
  background: rgba(16,35,23,.6); border: 1px solid rgba(126,217,87,.22);
  border-radius: 12px; padding: 14px;
}
.about-text b { color: var(--gold-bright); }

/* ---------- 遮罩 / 弹窗 ---------- */
/* ---------- 遮罩 / 弹层（参考龙族模拟器：flex + gap 排版，标题居中金色） ---------- */
.mask {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,10,24,.72); padding: 20px;
}
.mask-box {
  width: 300px; max-width: 86vw;
  background: linear-gradient(180deg, #16213f, #101a33);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  position: relative;
}
.mask-title {
  text-align: center; font-size: 20px; font-weight: 700;
  color: var(--gold); letter-spacing: 2px;
}
.mask-info { text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1.7; }
.fb-total { text-align: center; color: var(--gold); }
.follow-rows { display: flex; flex-direction: column; gap: 8px; }
.follow-action { display: flex; align-items: center; font-size: 13px; }
.fb-state { margin-left: auto; font-size: 11.5px; }
.fb-state.done { color: #7fdc9a; }
.fb-state.todo { color: var(--text-mute); }

.review-box { width: 320px; max-width: 88vw; max-height: 80vh; overflow: hidden; }
.review-log {
  flex: 1; min-height: 180px; max-height: 55vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
  background: rgba(6,10,18,.7); border: 1px solid rgba(126,217,87,.18);
  border-radius: 10px; padding: 10px;
}
.review-log .log-item { font-size: 12.5px; }

/* ---------- 决战弹窗 ---------- */
.finale-box { width: 340px; max-width: 90vw; }
.finale-title { font-size: 17px; letter-spacing: 1px; }
.decision-x {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.06);
  color: var(--text-dim); font-size: 13px; cursor: pointer; line-height: 1;
}
.finale-opts { display: flex; flex-direction: column; gap: 8px; }
.finale-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; font-size: 13.5px; text-align: left;
}
.finale-opt .fo-key { color: var(--gold-bright); font-weight: 800; }
.finale-opt .fo-label { font-weight: 700; }
.finale-opt .fo-effect { margin-left: auto; font-size: 11px; color: var(--text-mute); }
.decision-tip { font-size: 11px; color: var(--text-mute); text-align: center; }
.choice-float {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 60;
  max-width: 90vw; padding: 11px 18px; border-radius: 999px;
  background: linear-gradient(180deg, #f0c96a, #c8a45c);
  color: #2a1d00; font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 22px rgba(0,0,0,.5); cursor: pointer; white-space: nowrap;
  animation: floatPulse 1.4s ease-in-out infinite;
}
@keyframes floatPulse { 0%,100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.04); } }
.revive-box { text-align: center; }
#revive-mask .mask-box .btn { width: 100%; margin-top: 8px; }
.ach-toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  z-index: 90; max-width: 90vw;
  background: rgba(10,16,36,.96); border: 1px solid var(--gold);
  color: var(--gold-bright); border-radius: 999px; padding: 9px 18px;
  font-size: 13px; white-space: nowrap;
}

/* ---------- 组队 / 牌库 ---------- */
.team-tabs { width: 100%; display: flex; gap: 8px; margin-bottom: 10px; }
.deck-title {
  width: 100%; display: flex; align-items: center;
  font-size: 13px; color: var(--teal); font-weight: 700; margin-bottom: 8px;
}
.deck-sub { margin-left: auto; font-size: 11.5px; color: var(--text-mute); font-weight: 400; }
.deck-current { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.deck-slot {
  position: relative; border-radius: 12px; padding: 10px 6px; min-height: 84px;
  border: 2px solid rgba(126,217,87,.3);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-align: center; cursor: pointer;
}
.deck-slot.empty { border-style: dashed; border-color: rgba(126,217,87,.2); background: rgba(255,255,255,.03); }
.deck-slot .plus { font-size: 20px; color: var(--text-mute); }
.deck-slot .cs-name { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
.deck-slot .cs-sub { font-size: 10.5px; color: var(--text-mute); white-space: nowrap; }
.slot-x {
  position: absolute; top: -7px; right: -7px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(217,72,74,.95); color: #fff; font-size: 12px; font-weight: 800;
  line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.slot-x:active { transform: scale(.9); }
.deck-info { width: 100%; margin-top: 8px; font-size: 11.5px; color: var(--text-mute); }
.deck-filter { width: 100%; display: flex; gap: 6px; margin: 12px 0 8px; flex-wrap: wrap; }
.deck-filter .tab { flex: 0 0 auto; padding: 7px 12px; font-size: 12px; }
.deck-pool-title {
  width: 100%; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px;
  font-size: 13px; color: var(--teal); font-weight: 700; margin-bottom: 8px;
}
/* 页面标题里的「[资金:N]」（版式照抄联盟PK模拟器的 .title-gem） */
.title-gem { color: var(--teal); font-size: .82em; margin-left: 2px; }
.deck-pool {
  width: 100%; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 7px; padding-bottom: 16px;
}
.pool-card {
  position: relative; border-radius: 10px; padding: 10px 4px 8px; min-height: 78px; min-width: 0;
  border: 2px solid rgba(126,217,87,.28);
  background: linear-gradient(180deg, rgba(22,48,31,.92), rgba(8,19,11,.92));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-align: center; cursor: pointer; transition: transform .1s;
}
.pool-card:active { transform: scale(.95); }
.pool-card.locked { opacity: .34; cursor: default; }
/* 选中态：金色外描边 + 金光晕（**不再提亮底色** —— 深色主题下浅金底会刺眼） */
.pool-card.picked {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(240,201,106,.35);
}
/* ⚠ 这里**绝对不能写 color**：`.pool-card .pc-name`（0,2,0）的特异性高于名字档位色 `.ntN`（0,1,0），
 *   一旦写 color 就会把「从者名按档位染色」整个盖掉 → 250 张牌库卡的名字全变成米白。
 *   （2026-10-13 报障：从者页牌库里的从者名颜色全没了。实测 color=var(--text)，而首页/槽位/招募卡都是档位色） */
.pool-card .pc-name { font-size: 12px; font-weight: 700; white-space: nowrap; }
.pool-card .pc-sub { font-size: 10px; color: var(--text-mute); white-space: nowrap; }
.pool-card .pc-star { font-size: 10px; color: var(--gold); letter-spacing: -.5px; white-space: nowrap; }
.pool-card .pc-leaf {
  position: absolute; left: 4px; top: 3px;
  font-size: 9px; font-weight: 800; color: var(--text-dim);
  background: rgba(0,0,0,.35); border-radius: 4px; padding: 0 4px;
}

/* ---------- 招募 ---------- */
.gacha-top { width: 100%; display: flex; align-items: center; margin-bottom: 10px; }
.gacha-gem { font-size: 13px; color: var(--text-dim); }
.gacha-gem b { color: var(--teal); font-size: 16px; }
.gacha-top .btn-pill { margin-left: auto; }
.gacha-pity {
  width: 100%; background: rgba(16,35,23,.75);
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 10px 12px;
}
.pity-head { display: flex; align-items: center; font-size: 12.5px; color: var(--text-dim); }
.pity-head b { margin-left: auto; color: var(--gold-bright); }
.pity-tip { margin-top: 6px; font-size: 11px; color: var(--text-mute); }
.gacha-result {
  width: 100%; min-height: 150px; margin-top: 14px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px;
  align-content: start;
}
.gacha-result.single { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gacha-empty {
  grid-column: 1 / -1; text-align: center; color: var(--text-mute);
  font-size: 13px; padding: 46px 0;
}
.gacha-card {
  position: relative; border-radius: 10px; padding: 10px 4px 8px; min-height: 76px;
  border: 2px solid rgba(126,217,87,.3);
  background: linear-gradient(180deg, rgba(22,48,31,.95), rgba(8,19,11,.95));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-align: center;
  opacity: 0;
  animation: gachaIn .5s ease forwards;
}
.gacha-card .gc-name { font-size: 11.5px; font-weight: 700; color: var(--text); white-space: nowrap; }
.gacha-card .gc-sub { font-size: 10px; color: var(--text-mute); white-space: nowrap; }
.gacha-card .gc-new {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; color: #2a1d00;
  background: linear-gradient(180deg, #f0c96a, #c8a45c);
  border-radius: 999px; padding: 1px 7px; white-space: nowrap;
}
/* 高阶（A 档及以上）：金边 + 光晕 */
.gacha-card.t-hi { border-color: var(--gold); box-shadow: 0 0 12px rgba(240,201,106,.35); }
.gacha-card.t-hi .gc-name { color: var(--gold-bright); }
/* 顶阶（EX）：七彩描边 */
.gacha-card.t-top {
  border: 2px solid transparent;
  background: linear-gradient(180deg, rgba(24,40,22,.96), rgba(8,19,11,.96)) padding-box,
              linear-gradient(135deg,#ff5f6d,#ffc93b,#6fd0ff,#9c27b0) border-box;
  animation: gachaIn .5s ease forwards, topGlow 1.1s ease-in-out infinite alternate .55s;
}
@keyframes gachaIn {
  0%   { opacity: 0; transform: translateY(26px) rotateY(88deg) scale(.82); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) rotateY(0) scale(1); }
}
@keyframes topGlow {
  from { box-shadow: 0 0 12px rgba(255,201,59,.4); }
  to   { box-shadow: 0 0 26px rgba(255,201,59,.85); }
}
/* 三个按钮（单次 / 十连 / 百连）并排：flex:1 1 0 + min-width:0 才不会被内容顶宽 */
.gacha-btns { width: 100%; display: flex; gap: 8px; margin-top: 16px; }
.gacha-btns .gacha-btn {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  align-items: center; padding: 10px 3px; font-size: 13.5px;
}
.gacha-btn small { font-size: 10px; color: var(--text-mute); font-weight: 400; white-space: nowrap; }
.btn-primary.gacha-btn small { color: rgba(42,29,0,.7); }

/* ---------- 招募历史 ---------- */
.hist-list { width: 100%; max-height: 64vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.hist-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: rgba(16,35,23,.7); border: 1px solid rgba(126,217,87,.16);
  border-radius: 9px; font-size: 12.5px;
}
.hist-id { color: var(--text-mute); font-size: 11px; font-family: var(--mono); }
.hist-name { color: var(--text); font-weight: 700; }
.hist-tier { color: var(--gold); }
.hist-new { margin-left: auto; font-size: 10.5px; color: #7fdc9a; }
.hist-old { margin-left: auto; font-size: 10.5px; color: var(--text-mute); }
.pager { width: 100%; display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.pager .pg {
  min-width: 30px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.04); color: var(--text-dim);
}
.pager .pg.active { border-color: var(--gold); color: var(--gold-bright); background: rgba(240,201,106,.16); }
.pager .pg-input {
  width: 54px; padding: 6px; border-radius: 8px; text-align: center; font-size: 12.5px;
  border: 1px solid var(--line-soft); background: var(--panel-2); color: var(--text);
}

/* ---------- 桌面端 ---------- */
@media (min-width: 700px) {
  #app { max-width: 520px; }
  body::before { width: 520px; }
}

/* ---------- 滚动条美化（全局） ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(126,217,87,.35); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(126,217,87,.6); }
html { scrollbar-width: thin; scrollbar-color: rgba(126,217,87,.4) transparent; }

/* ---------- 列表型子页：高度自适应，跟随整页滚动（不做内部滚动框） ---------- */
#view-ach, #view-rank, #view-hl, #view-history {
  min-height: 100vh;
}
#view-ach .ach-list,
#view-rank .lb-body,
#view-hl .hl-list-page,
#view-history .hist-list {
  max-height: none; overflow: visible;
  padding-bottom: 20px;
}
/* 组队 / 设置 / 说明：内容较长，保持整页滚动 */
#view-team, #view-settings, #view-about { overflow-y: auto; }


/* ============================================================
 * 招募页：**高度固定为一屏**，结果框撑满剩余高度、**内部滚动**，
 *          单抽/十连按钮固定在最底部（不随内容移动）
 *   ⚠ 卡片保持原有大小（2 列），出得多就在结果框里滚动 —— 不压缩卡片、页面也不变高
 * ============================================================ */
/* ⚠ 高度必须减掉顶栏（52px）：原来写 100vh，加上顶栏后整页多出 52px，
 *   页面本身就会长出滚动条。减掉后「页面不滚、只有结果框内部滚」。 */
#view-gacha {
  height: calc(100vh - 52px);
  height: calc(100dvh - 52px);
  max-height: calc(100vh - 52px);
  max-height: calc(100dvh - 52px);
  min-height: 0;
  overflow: hidden;
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
}
#view-gacha > * { flex: none; min-height: 0; }
#view-gacha .gacha-result {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px;
  grid-auto-rows: max-content;      /* 行高按卡片内容撑开，绝不压缩卡片 */
  align-content: start;
  margin-top: 12px; padding: 10px 10px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(16,35,23,.45);
}
#view-gacha .gacha-btns { margin-top: 12px; }

/* ============================================================
 * 档位胶囊（配色参考综武模拟器：浅灰 → 深灰 → 绿 → 蓝 → 紫 → 金 → 红 → 七彩）
 * ============================================================ */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 17px; border-radius: 9px; padding: 0 6px;
  font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap;
  flex: 0 0 auto;
  vertical-align: middle;      /* ⚠ inline-flex 默认按基线对齐，会被顶下去 */
}
.chip-t1  { background: #d8d8d8; color: #3a3a3a; }
.chip-t2  { background: #6b6b6b; color: #f2f2f2; }
.chip-t3  { background: #a8d8b0; color: #1f4a28; }
.chip-t4  { background: #3d7a4a; color: #eaf7ee; }
.chip-t5  { background: #a8cfe8; color: #1a3c55; }
.chip-t6  { background: #2f5f8a; color: #eaf3fb; }
.chip-t7  { background: #7b5aa6; color: #f4eefc; }
.chip-t8  { background: #d4a72c; color: #3a2a00; }
.chip-t9  { background: #a8322a; color: #fdeeed; }
.chip-t10 {
  background: linear-gradient(90deg,#ff4d4f,#ff9800,#ffeb3b,#4caf50,#00bcd4,#3f51b5,#9c27b0);
  background-size: 300% 100%; color: #fff;
  box-shadow: 0 0 6px rgba(160,80,200,.55);
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  animation: rainbowShift 2.6s linear infinite;
}
/* 从者名按档位染色（与胶囊同一套稀有度语言） */
.nt1  { color: #c9c9c9; } .nt2  { color: #9aa0a6; } .nt3  { color: #a8d8b0; }
.nt4  { color: #6fc98a; } .nt5  { color: #a8cfe8; } .nt6  { color: #6aa9e0; }
.nt7  { color: #b48ce0; } .nt8  { color: #f0c96a; } .nt9  { color: #ff7a72; }
.nt10 { color: #ffd75e; }

/* ============================================================
 * 从者卡统一版式（1 行 3 张）：
 *   ① [EX] 导电 卡卡罗
 *   ② ★1 星 · 进度 0/1
 *   ③ 灵基强度 50（+5）
 *   ④ 宝具威力 30（+3）
 * ============================================================ */
/* 卡头 = 外层裁剪框（固定为卡宽）+ 内层真内容（可整体缩放）
 * ⚠⚠ 绝不能把 transform 直接加在 .pc-head 上：overflow:hidden 的裁剪框会跟着一起缩，
 *   内容相对边界一点没变，等于没修（「加了 scale 仍在切」的根因）。
 * ⚠ 外层必须 width:100%：否则宽度跟着内容走，clientWidth 恒等于内容宽，永远测不出溢出。 */
.pc-head {
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; line-height: 1; min-width: 0;
  width: 100%; max-width: 100%;
}
.pc-head-inner {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  flex: 0 0 auto; transform-origin: 50% 50%; line-height: 1;
}
/* 卡面第二行：人物卡（从者名）单独占一行，居中；
 * ⚠ 必须是 flex 容器：.pc-name 靠 flex 子项身份才有确定的 clientWidth，
 *   否则 span 退化成 inline，overflow/text-overflow 失效、fitCardNames 也量不准 */
.pc-name-row { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; line-height: 1; }
.pc-name {
  font-size: 12.5px; font-weight: 700;
  flex: 0 1 auto; min-width: 0;        /* 占剩余空间；放不下由 fitCardText 缩字号 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pc-line2, .pc-line3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pc-line2 { font-size: 10.5px; color: var(--gold); white-space: nowrap; }
.pc-line3 { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.pc-line3 b { color: var(--text); font-weight: 700; }

/* 牌库网格：1 行 3 张 */
.deck-pool { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.pool-card {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; padding: 9px 8px; min-height: 0; text-align: left;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(22,48,31,.92), rgba(8,19,11,.92));
  border: 1px solid rgba(126,217,87,.28);
}
.pool-card.locked { opacity: .38; }
/* 选中态：金色外描边 + 金光晕（同牌库页，保持一致） */
.pool-card.picked {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(240,201,106,.35);
}
/* 队伍槽位（同一套版式） */
.deck-slot {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 4px; padding: 9px 8px; min-height: 0; text-align: left;
  border-radius: 12px; cursor: pointer;
}
.deck-slot.empty { align-items: center; justify-content: center; min-height: 82px; }
/* 首页出战卡 */
.home-team .mini-card {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; padding: 9px 8px; text-align: left;
}
.home-team .mini-card.empty { align-items: center; justify-content: center; min-height: 76px; }

/* 组队页二阶筛选（参考 CSGO 模拟器）：两行**都常驻、同时生效（AND 联动）**
 *   ① 元素行（在上）：全部 + 14 元素 = 15 个 → 一行放不下，排 **8 列 → 2 行**（8+7）
 *   ② 品级行（在下）：全部 + 10 档位 = 11 个 → **1 行等分**    */
.deck-filter { display: flex; flex-direction: column; gap: 6px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-row .tab { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; }
#lib-cls { flex-wrap: wrap; }
#lib-cls .tab { flex: 0 0 calc((100% - 42px) / 8); font-size: 12px; padding: 7px 0; }  /* 8 列 → 15 个排两行 */
#lib-tier .tab { flex: 1 1 0; min-width: 0; font-size: 12px; padding: 7px 0; }         /* 11 个等分一行 */

/* 招募结果卡沿用同一套版式 */
.gacha-card {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; padding: 9px 8px; min-height: 76px; text-align: left;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(22,48,31,.95), rgba(8,19,11,.95));
  border: 1px solid rgba(126,217,87,.3);
}
.gacha-card.t-hi { border-color: var(--gold); box-shadow: 0 0 12px rgba(240,201,106,.35); }
.gacha-card.t-top {
  border: 1px solid transparent;
  background: linear-gradient(180deg, rgba(24,40,22,.96), rgba(8,19,11,.96)) padding-box,
              linear-gradient(135deg,#ff5f6d,#ffc93b,#6fd0ff,#9c27b0) border-box;
  animation: gachaIn .5s ease forwards, topGlow 1.1s ease-in-out infinite alternate .55s;
}
.gacha-card .gc-new {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; color: #2a1d00;
  background: linear-gradient(180deg, #f0c96a, #c8a45c);
  border-radius: 999px; padding: 1px 7px; white-space: nowrap; z-index: 2;
}
/* ⚠ 卡片是 flex 纵向容器：子项必须 flex:none，否则结果框装不下时
 *   四行文字会被 flex-shrink 压扁（挤成一团），而不是撑出滚动条 */
.gacha-card > * { flex: none; }


/* ============================================================
 * 卡片内容居中（所有从者卡统一：品级 / 元素 / 名字 / 星级 / 元素都居中）
 * ============================================================ */
.pool-card, .gacha-card, .deck-slot, .home-team .mini-card { align-items: center; text-align: center; }
.pc-head { justify-content: center; }
.pc-line2, .pc-line3 { text-align: center; }
/* 未获得的卡：仍然完整显示元素，只是整体压暗 */
.pool-card.locked { opacity: .5; }

/* 组队页两行筛选：每个 tab 等分整行，不留空 */
.filter-row .tab { flex: 1 1 0; min-width: 0; padding: 6px 2px; font-size: 12px; }


/* ---------- 模拟暂停弹层 ---------- */
#pause-mask .mask-box .btn { width: 100%; }
#pause-mask .mask-title { font-size: 20px; }
#pause-mask .mask-info { line-height: 1.8; }


/* ============================================================
 * 游戏页：高度自适应（min-height），内容长了就整页滚动 —— 不做内部滚动框
 * ============================================================ */
#view-game {
  min-height: 100vh;
  padding-top: 8px; padding-bottom: 14px;
}
#view-game > * { flex: none; }


/* ============================================================
 * 每日签到（日历）
 * ============================================================ */
#view-sign .sign-head {
  width: 100%; display: flex; align-items: baseline;
  margin-bottom: 10px;
}
.sign-ym { font-size: 15px; font-weight: 700; color: var(--gold-bright); }
.sign-stat { margin-left: auto; font-size: 12.5px; color: var(--teal); }

.sign-week {
  width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px; margin-bottom: 5px;
}
.sign-week span {
  text-align: center; font-size: 11.5px; color: var(--text-mute);
}

.sign-grid {
  width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.sg {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  border: 1px solid rgba(126,217,87,.16);
  background: rgba(16,35,23,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--text-mute);
}
.sg.blank { border: none; background: none; }
/* 未来的日子：压暗 */
.sg.future { opacity: .35; }
/* 过去漏签：红字 */
.sg.miss { color: #a33; border-color: rgba(217,72,74,.25); }
/* 已签到：金色底 */
.sg.done {
  background: linear-gradient(180deg, rgba(240,201,106,.28), rgba(240,201,106,.12));
  border-color: var(--gold); color: var(--gold-bright); font-weight: 700;
}
.sg.done::after {
  content: ''; position: absolute; right: 3px; bottom: 3px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold-bright);
}
/* 今天：呼吸高亮 */
.sg.today {
  border-color: var(--teal);
  box-shadow: 0 0 10px rgba(126,217,87,.55);
  color: var(--text); font-weight: 700;
  animation: sgPulse 1.4s ease-in-out infinite;
}
.sg.today.done { border-color: var(--gold); box-shadow: 0 0 10px rgba(240,201,106,.6); animation: none; }
@keyframes sgPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(126,217,87,.35); }
  50%      { box-shadow: 0 0 16px rgba(126,217,87,.8); }
}

.sign-btns { width: 100%; margin-top: 14px; }
.sign-note {
  width: 100%; margin-top: 10px;
  font-size: 11.5px; line-height: 1.7; color: var(--text-mute);
  text-align: center;
}
.sign-note b { color: var(--gold); }


/* 等级框内：总资金那一行（资金下面，虚线分隔） */
.lv-gem-line.lv-gem-total { border-top: 1px dashed rgba(126,217,87,.14); margin-top: 5px; padding-top: 5px; }
.lv-gem-line.lv-gem-total .lv-gem-name { font-size: 11.5px; color: var(--text-mute); }
.lv-gem-line.lv-gem-total .lv-gem-val { font-size: 13px; color: var(--text-dim); }


/* 招募历史：顶部计数居中 */
.hist-note { text-align: center; }


/* 顶部「全站最多夺冠全球冠军赛…」那行：初始字号再小 1px（放不下继续由 fitOneLine 缩） */
.home-tianli { font-size: 11.5px; }


/* ---------- 招募 · 卡池选择行已移除（只有一个「招募」池，不分池） ---------- */


/* ============================================================
 * 无畏契约新增：元素标签 / 从者牌库分组 / 培养按钮 / 外援标识 / 队伍老板礼装 / 分享
 * ============================================================ */

/* ---------- 4 种元素标签配色（CN 中国 / AS 亚洲 / US 北美 / EU 欧洲） ---------- */
.sp-cn { background: rgba(126,217,87,.18);   color: #ff8b95; border: 1px solid rgba(126,217,87,.48); }
.sp-as { background: rgba(255,180,80,.18);  color: #ffcf95; border: 1px solid rgba(255,180,80,.48); }
.sp-us { background: rgba(90,180,255,.18);  color: #8fc9ff; border: 1px solid rgba(90,180,255,.48); }
.sp-eu { background: rgba(123,211,200,.18); color: #9fe4da; border: 1px solid rgba(123,211,200,.48); }

/* ---------- 从者牌库：不分页，平铺（与母本同一套版式） ---------- */

/* ---------- 从者培养按钮（卡内） ---------- */
.pc-train {
  margin-top: 2px; width: 100%;
  border: 1px solid rgba(123,211,200,.55); background: rgba(123,211,200,.12);
  color: var(--teal); border-radius: 7px; padding: 3px 4px;
  font-size: 10px; font-weight: 700; line-height: 1.25;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px;
  white-space: nowrap;
}
.pc-train:active { transform: scale(.96); }
.pc-train .pc-train-cost { font-weight: 400; color: var(--text-mute); }
.pc-train[disabled] { opacity: .4; cursor: default; }

/* ---------- 外援从者标识 ---------- */
.pc-sup {
  position: absolute; right: 4px; top: 3px;
  font-size: 9px; font-weight: 800; color: #241a00;
  background: linear-gradient(180deg, #ffe9a8, #d9b45a);
  border-radius: 4px; padding: 0 4px; line-height: 1.5;
}
.pc-train.is-sup { border-color: rgba(154,167,189,.4); color: var(--text-mute); background: rgba(154,167,189,.10); }

/* ---------- 队伍老板礼装（= 教练） ---------- */
.coach-row { width: 100%; margin-bottom: 6px; }
.btn-coach {
  width: 100%; padding: 6px 10px; font-size: 12px; line-height: 1.25; border-radius: 9px;
  border-color: var(--gold); color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(126,217,87,.16), rgba(126,217,87,.05));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-coach .coach-cost { color: var(--gold); font-weight: 700; }

/* ---------- 分享从者 / 输入加密码 ---------- */
.share-text {
  width: 100%; min-height: 96px; resize: none;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--panel-2); color: var(--text);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  padding: 9px 10px; overflow-wrap: anywhere; word-break: break-all;
}
.share-btns { display: flex; gap: 8px; }
.share-btns .btn { flex: 1; }
.mask-warn { color: var(--danger-text); }
.home-team-3d { margin-left: auto; font-size: 11.5px; color: var(--gold); font-weight: 400; }
.home-team-title { display: flex; align-items: baseline; }
/* ============================================================
 * 无畏契约模拟器 新增：匹配界面 · 首页 2 列 3 行 · 队伍 3+2 · PK 对手面板
 * ============================================================ */

/* ---------- 匹配中（伪装随机匹配） ---------- */
.match-mask {
  position: fixed; inset: 0; z-index: 100;
  background: #0a1119;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.match-spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 4px solid rgba(123,211,200,.22);
  border-top-color: var(--teal);
  border-right-color: var(--gold);
  animation: matchSpin .9s linear infinite;
}
@keyframes matchSpin { to { transform: rotate(360deg); } }
.match-text { font-size: 15px; font-weight: 700; color: var(--text); }
.match-sub { font-size: 12px; color: var(--text-mute); }

/* ---------- 首页主按钮：2 列 3 行（左列 歌会 / 右列 PK） ---------- */
.home-grid2 {
  width: 100%; margin-top: 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.home-grid2 .btn {
  width: 100%; min-width: 0;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: 4px; padding: 10px 4px; white-space: nowrap;
}
.home-grid2 .btn > span:first-child { font-size: 13px; line-height: 1.25; white-space: nowrap; }
/* 副提示与主文字同一行：更小的红色字 */
.home-grid2 .btn .ach-btn-tip {
  font-size: 9.5px; font-weight: 400; color: var(--danger-text);
  white-space: nowrap; max-width: none; overflow: visible; text-overflow: clip;
}

/* ---------- 首页队伍：两行 3 + 2（第二行居中） ---------- */
.home-team5 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.home-team5 .mini-card { grid-column: span 2; flex: none; }
.home-team5 .mini-card:nth-child(4) { grid-column: 2 / span 2; }
.home-team5 .mini-card:nth-child(5) { grid-column: 4 / span 2; }

/* ---------- 组队页槽位：两行 3 + 2（第二行居中） ---------- */
.deck-current5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.deck-current5 .deck-slot { grid-column: span 2; }
.deck-current5 .deck-slot:nth-child(4) { grid-column: 2 / span 2; }
.deck-current5 .deck-slot:nth-child(5) { grid-column: 4 / span 2; }

/* ---------- PK 对手面板 ---------- */
.foe-box {
  width: 100%; margin-top: 8px;
  border: 1px solid var(--line-soft); border-radius: 12px;
  background: linear-gradient(180deg, rgba(240,201,106,.12), rgba(16,35,23,.75));
  padding: 8px 10px;
  flex: none;
}
.foe-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.foe-title { font-size: 12.5px; font-weight: 800; color: var(--gold-bright); }
.foe-syn { font-size: 11px; color: var(--text-mute); }
.foe-line { display: flex; gap: 12px; font-size: 11.5px; color: var(--text-dim); margin-bottom: 6px; }
.foe-line b { color: var(--text); }
.foe-pows { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.foe-item { display: flex; align-items: baseline; gap: 4px; font-size: 11px; }
.foe-name { color: var(--text-dim); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foe-pow { color: var(--teal); font-weight: 700; }

/* ---------- PK 日志区与从者行（与游戏页同一套） ---------- */
#view-pk .log-box { flex: 1 1 auto; min-height: 120px; }

/* ---------- 从者牌库职阶筛选：全部 + 14 职阶 = 15 项，每行 8 个、排两行 ----------
 * ⚠ 14 职阶比原来的 7 元素多一倍，**不能再压成一行**（nowrap 会把每个 tab 挤到 6% 宽）。
 *   flex-wrap: wrap + 定宽 1/8 才是两行的正确写法。 */
#lib-cls { flex-wrap: wrap; gap: 4px; }
#lib-cls .tab { flex: 0 0 calc((100% - 28px) / 8); min-width: 0; padding: 5px 1px; font-size: 10.5px; white-space: nowrap; overflow: hidden; }

/* ---------- 卡面名字行前的等级 ---------- */
.pc-lv { font-size: 11px; font-weight: 800; color: var(--teal); margin-right: 4px; flex: 0 0 auto; }

/* ============================================================
 * PK 结算：双方关键数据对比 + 阵容对比（照联盟PK）
 * ============================================================ */
.settle-cmp { display: flex; flex-direction: column; width: 100%; }
.cmp-row {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 6px 4px; font-size: 13.5px;
  border-bottom: 1px dashed rgba(123,211,200,.22);
}
.cmp-row:last-child { border-bottom: none; }
.cmp-row .cmp-k { flex: 0 0 auto; margin-right: auto; color: var(--text-mute); font-size: 12.5px; }
.cmp-row .cmp-me { flex: 0 0 auto; color: var(--gold-bright); font-weight: 700; white-space: nowrap; }
.cmp-row .cmp-vs { flex: 0 0 auto; color: var(--text-mute); font-size: 11px; font-style: normal; }
.cmp-row .cmp-foe { flex: 0 0 auto; color: var(--danger-text); font-weight: 700; white-space: nowrap; }

.settle-versus-title {
  margin-top: 6px; text-align: center;
  font-size: 12.5px; color: var(--teal); font-weight: 700;
}
.settle-versus {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  background: rgba(16,35,23,.55); border: 1px solid rgba(240,201,106,.28);
  border-radius: 12px; padding: 9px 10px;
}
.vs-side { display: flex; flex-direction: column; gap: 3px; }
.vs-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; white-space: nowrap; }
.vs-row > * { flex: 0 0 auto; }
.vs-row .vs-name { color: var(--text); font-weight: 700; min-width: 0; }
.vs-row .vs-pow { margin-left: auto; font-weight: 700; }
.vs-side.me .vs-pow { color: var(--gold-bright); }
.vs-side.foe .vs-pow { color: var(--danger-text); }
.vs-label { font-size: 11px; color: var(--text-mute); }
.vs-divider { height: 1px; margin: 3px 0; background: linear-gradient(90deg, transparent, var(--danger), transparent); }

/* ============================================================
 * 特异点改造新增的组件样式（属于「游戏改造」，必须保留）
 * ⚠ 配色一律沿用原版：深蓝黑底 + 红 / 青，不用任何金色。
 * ============================================================ */

/* ---------- 6 种职业标签（配色沿用原版 .sp-cn/.sp-as/.sp-us/.sp-eu 那套） ---------- */






/* ---------- 天选从者弹层 ---------- */
.pick-box { width: 340px; max-width: 90vw; max-height: 80vh; display: flex; flex-direction: column; }
.pick-list {
  margin-top: 10px; min-height: 0; max-height: 56vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--line-soft); padding-top: 10px;
}
.pick-item {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 8px 10px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line-soft);
  cursor: pointer; font-size: 13px; color: var(--text);
}
.pick-item:active { transform: scale(.985); }
.pick-item.on { border-color: var(--gold); background: rgba(255,255,255,.06); }
.pick-item.on .pi-name { color: var(--gold-bright); }
.pick-item .pi-name { flex: 1 1 auto; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; }
.pick-item .pi-mark { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--gold); }
.pick-item .pi-none { color: var(--text-dim); }

/* ---------- 决战特异点结算的「获得特异点 +1 把」行 ---------- */
.s-row-kill b { color: var(--gold-bright); font-weight: 800; }
.s-row-kill span { color: var(--teal); }

/* ---------- 「天选-从者名」按钮：太长时省略，不撑破那一行 ---------- */
#btn-gacha-pick { flex: 0 1 auto; min-width: 0; max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
 * 特异点改造 · 新增组件样式（配色沿用原版：深蓝黑底 + 红/青描边）
 * ============================================================ */

/* ---------- 6 种职业标签（战士 / 法师 / 刺客 / 坦克 / 射手 / 辅助） ---------- */






/* ---------- 天选从者弹层 ---------- */
.pick-box { width: 340px; max-width: 90vw; max-height: 80vh; display: flex; flex-direction: column; }
.pick-list {
  margin-top: 10px; min-height: 0; max-height: 56vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--line-soft); padding-top: 10px;
}
.pick-item {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 8px 10px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line-soft);
  cursor: pointer; font-size: 13px; color: var(--text);
}
.pick-item:active { transform: scale(.985); }
.pick-item.on { border-color: var(--gold); background: rgba(126,217,87,.12); }
.pick-item .pi-name { flex: 1 1 auto; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; }
.pick-item .pi-mark { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--gold); }
.pick-item .pi-none { color: var(--text-dim); }

/* 「天选-从者名」可能很长：放不下时省略，不撑破那一行 */
#btn-gacha-pick { flex: 0 1 auto; min-width: 0; max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 决战特异点结算：「获得特异点 +1 把」行 ---------- */
.s-row-kill b { color: var(--gold-bright); font-weight: 800; }
.s-row-kill span { color: var(--teal); }


/* ============================================================
 * 礼装（2.0 新增组件）
 * ============================================================ */
/* 资金那一行右侧的小号「签到」按钮 */
.btn-mini {
  margin-left: 10px; padding: 3px 10px; font-size: 11.5px; font-family: inherit;
  color: var(--gold); background: rgba(240,201,106,.12);
  border: 1px solid var(--gold-dim); border-radius: 10px; cursor: pointer;
}
.btn-mini:active { background: rgba(240,201,106,.26); }
/* 人物卡下面的【礼】加成行（首页「当前队伍」+ 球技页「出战阵容」共用）
 * ⚠ 挂在**每一张人物卡**下面，不是页脚汇总；文字允许换行、不截断 */
.card-holy {
  margin-top: 5px; font-size: 10.5px; line-height: 1.45; font-weight: 700;
  color: var(--gold); text-align: center;
  white-space: normal; overflow-wrap: anywhere;
}
/* 出战槽位：卡面 + 【礼】行 在上、礼装按钮在下 */
.deck-slot { flex-direction: column; }
.slot-relic {
  display: block; width: 100%; margin-top: 6px; padding: 5px 6px; font-size: 11px;
  font-family: inherit; color: var(--text-dim); background: rgba(16,35,23,.86);
  border: 1px dashed var(--line-soft); border-radius: 8px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slot-relic.has { color: var(--gold); border-style: solid; border-color: var(--gold-dim); background: rgba(240,201,106,.10); }
/* 图鉴页 */
.relic-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-dim); margin: 2px 0 8px; }
.relic-note { font-size: 11.5px; color: var(--text-mute); line-height: 1.6; margin-bottom: 10px; }
.relic-list { display: flex; flex-direction: column; gap: 6px; }
/* 一件礼装**两行**：
 *   ① 品级胶囊 + 名称（+ 标记） ……………… 右对齐 ★N a/b
 *   ② 灵基强度+6、宝具威力+14
 * （原来星级与进度各占一行、共三行，太占地方；**只把星级合并进名称行**，加成行保持独立） */
.relic-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.relic-top { display: flex; align-items: center; gap: 6px; }
/* ⚠ 品级胶囊必须同时带 `.chip`（外形：高度/圆角/内边距/字号）+ `.chip-tN`（配色）。
 *   只写 .chip-tN 会得到一块没有圆角的色块 —— 就是「礼装页的胶囊跟别处不一样」的原因。
 *   这里只补 flex 收缩控制（礼装行是 flex 容器）。 */
.relic-chip { flex: 0 0 auto; }
.relic-name {
  flex: 0 1 auto; min-width: 0;
  font-size: 12.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 星级 + 升级进度：靠右对齐，多行之间才对得齐 */
.relic-lv {
  flex: 0 0 auto; margin-left: auto;
  font-size: 11px; color: var(--text-mute); white-space: nowrap;
}
.relic-stats { font-size: 11.5px; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relic-row.relic-used { border-color: var(--gold-dim); background: rgba(217,180,90,.10); }
.relic-row.relic-dim { opacity: .55; }
/* 图鉴里**未获得**的礼装：整行压暗 + 虚线边（仍展示品级与初始加成，让玩家看得到目标） */
.relic-row.relic-locked { opacity: .45; border-style: dashed; }
.relic-tag-lock { background: rgba(255,255,255,.10); color: var(--text-mute); }
.relic-tag { margin-left: 6px; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: rgba(217,180,90,.18); color: var(--gold); }
.relic-tag-warn { background: rgba(110,198,255,.18); color: var(--teal); }
.relic-tag-bond { background: rgba(108,219,138,.18); color: #6cdb8a; }
.relic-tag-nobond { background: rgba(255,255,255,.08); color: var(--text-mute); }
.relic-empty { text-align: center; color: var(--text-mute); font-size: 12.5px; padding: 24px 0; }
/* ⚠ 图鉴 / 装备弹层一律**单列**：宽屏也不分栏（一行一件，加成行才展得开） */

/* 结算页：获得礼装 —— **独立一框**（七彩流光 · 允许换行）
 * 位置在「出球队伍卡」与「四个按钮」之间（不是数据行里的一条）
 * ⚠ 决战与圣杯争夺战共用，每次开新局/结算都要复位（见 game.js 的 finishGameResetRows） */
.settle-relic-box {
  width: 100%; margin: 12px 0 2px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.45);
  background: linear-gradient(90deg, rgba(255,90,90,.26), rgba(255,200,80,.26), rgba(110,220,120,.26), rgba(90,160,255,.26), rgba(180,120,255,.26));
  background-size: 400% 100%;
  animation: rainbowShift 1.6s linear infinite;
  text-align: center;
}
.settle-relic-box .srb-title { font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .6px; }
.settle-relic-box .srb-body {
  margin-top: 5px; font-size: 12.5px; font-weight: 700; color: #fff;
  line-height: 1.55; white-space: normal; overflow-wrap: anywhere;
}

/* 装备弹层 / 二次确认 / 令咒复活 */
.relic-pick-list { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.relic-pick-btns, .confirm-btns { display: flex; gap: 10px; margin-top: 4px; }
.relic-pick-btns .btn, .confirm-btns .btn { flex: 1 1 0; }
.relic-pick-box, .confirm-box, .revive-box { max-width: 400px; }
.revive-box .mask-info { line-height: 1.8; margin-bottom: 14px; }
.confirm-box .mask-info { white-space: pre-line; line-height: 1.7; margin-bottom: 14px; }

/* ============================================================
 * NBA球队模拟器 · 新增组件
 * ============================================================ */
/* 选秀位置筛选行 */
/* 选秀位置行：**等分铺满一整行、不留空**（同首发球员页的三行筛选） */
.gacha-pos { width: 100%; display: flex; gap: 4px; margin-top: 10px; flex-wrap: nowrap; }
.gacha-pos .tab {
  flex: 1 1 0; min-width: 0;
  padding: 7px 0; font-size: 12px; text-align: center;
  white-space: nowrap; overflow: hidden;
}

/* 首发球员页筛选：三行（位置 × 评级 × 位置）
 * ⚠ 每行必须**等分铺满整行**：`flex:1 1 0` + nowrap，不能 flex:0 0 auto（那样会挤在左边、右边留空）。
 *   位置行 7 项、评级行 11 项——11 项时每格只有 ~30px，所以 padding 收到 2px、字号 12px。 */
.deck-filter { width: 100%; display: flex; flex-direction: column; gap: 6px; margin: 12px 0 8px; }
.deck-filter .filter-row { width: 100%; display: flex; gap: 4px; flex-wrap: nowrap; }
.deck-filter .filter-row .tab {
  flex: 1 1 0; min-width: 0;
  padding: 7px 0; font-size: 12px;
  white-space: nowrap; overflow: hidden;
}

/* 卡面名字行前的位置胶囊（与名字同一行） */
.pc-name-row .region-tag { display: inline-flex; vertical-align: middle; margin-right: 4px; }

/* 球技熟练度进度 */
.hero-prog { color: var(--text-mute); font-size: 10.5px; }

/* 窄卡（球员库 / 首页首发 / 首发槽位）：三个胶囊（档位 + 位置 + 位置）挤一行，
 * ⚠ 必须留出**余量**：整行刚好等于卡宽时，任何字体/语言/缩放的细微差异都会让它溢出，
 *   而 .pc-head 是居中 + overflow:hidden → 两端同时被切（曾表现为「F 胶囊只剩半个」）。
 *   这里把胶囊整体压小一档，让自然宽度比卡宽小 ~8px，再配合 JS 的 scale 兜底。 */
.pool-card .pc-head-inner, .home-team .mini-card .pc-head-inner, .deck-slot .pc-head-inner { gap: 3px; }
.pool-card .chip, .pool-card .pos-tag, .pool-card .region-tag,
.home-team .mini-card .chip, .home-team .mini-card .pos-tag, .home-team .mini-card .region-tag,
.deck-slot .chip, .deck-slot .pos-tag, .deck-slot .region-tag {
  height: 15px; padding: 0 4px; font-size: 9px; border-radius: 7px;
}
.pool-card .pos-tag, .home-team .mini-card .pos-tag, .deck-slot .pos-tag { border-radius: 6px; }
.pool-card .pc-lv { font-size: 10px; }

/* ============================================================
 * 顶栏品牌横幅 / 底栏五页导航（版式参考《少女前线模拟器》）
 * ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 14px;
  background: rgba(10,14,23,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126,217,87,.55), rgba(244,211,94,.5), transparent);
  pointer-events: none;
}
.brand { display: flex; align-items: baseline; gap: 2px; font-weight: 900; min-width: 0; }
.brand .b1 {
  font-size: 19px; letter-spacing: 1px;
  color: transparent;
  background: linear-gradient(180deg, #efffe0, #7ed957);
  -webkit-background-clip: text; background-clip: text;
}
.brand .b2 { color: #e9eef6; font-size: 19px; }
.brand .b3 { color: var(--gold); font-size: 9px; margin-left: 6px; letter-spacing: .5px; opacity: .8; }
.top-btn {
  flex: 0 0 auto; height: 30px; padding: 0 10px; margin-left: auto;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text-dim); font-size: 12px;
  font-family: inherit;
}
.top-btn:active { transform: scale(.97); }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 45;
  display: flex; padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  background: rgba(10,14,23,.95);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; color: var(--text-mute);
  font-size: 10.5px; padding: 4px 0; font-family: inherit;
}
.tabbar .tab .ti { font-size: 16px; opacity: .8; }
.tabbar .tab.on { color: var(--gold); }
.tabbar .tab.on .ti { opacity: 1; filter: drop-shadow(0 0 6px rgba(255,138,61,.5)); }
body.hide-tabbar .tabbar { display: none; }
body.in-game .topbar { display: none; }
body.in-game .view { min-height: 100vh; }
#view-home, #view-rank, #view-ach, #view-hl, #view-about {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

/* 首页标题右侧的分享按钮 */
.hero-sub-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 6px;
}
.hero-sub-row .home-sub {
  margin-top: 0; padding: 0;
  flex: 0 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.btn-share {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text-mute);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn-share:active { transform: scale(.94); color: var(--gold); border-color: var(--gold); }

/* 分享 / 二维码弹层 */
.share-box { text-align: center; }
.share-tip { font-size: 12.5px; color: var(--text-dim); margin: 2px 0 10px; line-height: 1.6; }
.qr-area { margin: 0 auto 10px; text-align: center; }
.share-qr, .qr-img {
  width: 190px; height: 190px; margin: 0 auto 10px; display: block;
  border-radius: 10px; background: #fff; padding: 8px;
}
.share-link {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-mute);
  word-break: break-all; margin: 0 0 12px; line-height: 1.5;
}
.share-box .btn { width: 100%; margin-top: 6px; }

/* 首页四个分享按钮：一行四列（版式参考《少女前线模拟器》） */
.home-grid4 {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px; margin-top: 10px;
}
.home-grid4 .btn {
  display: flex; align-items: center; justify-content: center;
  padding: 9px 2px; font-size: 11.5px; border-radius: 10px;
  white-space: nowrap; overflow: hidden; min-width: 0;
}
/* ============================================================
 * 植物大战僵尸模拟器 · 主题补充
 *   · 绿色系（草坪 / 豌豆 / 阳光）
 *   · 5 类型配色、5 列布局（首页 / 出战页 / 结算页）
 *   · 游戏页固定高度（最多 6 株，超出才滚动）
 *   · 禅境花园
 * ============================================================ */

/* ---------- 类型胶囊 ---------- */
.p-def    { background: rgba(127,179,255,.18); color: #b7d4ff; border-color: rgba(127,179,255,.5); }
.p-sup    { background: rgba(255,209,102,.18); color: #ffe3a1; border-color: rgba(255,209,102,.5); }
.p-single { background: rgba(255,159,107,.18); color: #ffc4a3; border-color: rgba(255,159,107,.5); }
.p-aoe    { background: rgba(185,156,255,.18); color: #d6c7ff; border-color: rgba(185,156,255,.5); }
.p-ash    { background: rgba(255,107,107,.18); color: #ffb0b0; border-color: rgba(255,107,107,.5); }

/* ---------- 首页出战：5 列（最多 10 株 = 两行 5+5） ---------- */
.home-team,
.home-team5, .home-team6, .home-team7, .home-team8, .home-team9, .home-team10 {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px;
}
.home-team .mini-card,
.home-team5 .mini-card, .home-team6 .mini-card, .home-team7 .mini-card,
.home-team8 .mini-card, .home-team9 .mini-card, .home-team10 .mini-card {
  grid-column: auto !important;
  flex: none !important;
  min-width: 0;
  padding: 7px 3px;
}
.home-team .mini-card .pc-name,
.home-team .mini-card .pc-line2,
.home-team .mini-card .pc-line3 { line-height: 1.2; }
.home-team .mini-card .chip { font-size: 9px; padding: 0 4px; height: 15px; }
.home-team .mini-card .pos-tag { font-size: 9px; padding: 0 4px; height: 15px; }

/* ---------- 出战页槽位：5 列（最多 10 株 = 两行 5+5） ---------- */
.deck-current,
.deck-current5, .deck-current6, .deck-current7, .deck-current8, .deck-current9, .deck-current10 {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
.deck-current .deck-slot,
.deck-current5 .deck-slot, .deck-current6 .deck-slot, .deck-current7 .deck-slot,
.deck-current8 .deck-slot, .deck-current9 .deck-slot, .deck-current10 .deck-slot {
  grid-column: auto !important;
  min-height: 78px;
  padding: 8px 3px;
}
.deck-slot .pc-name,
.deck-slot .pc-line2,
.deck-slot .pc-line3 { line-height: 1.2; }
.deck-slot .chip, .deck-slot .pos-tag { font-size: 9px; padding: 0 4px; height: 15px; }

/* ---------- 图鉴 / 抽取卡：更紧凑的字体，防长名溢出 ---------- */
.pool-card .pc-name { font-size: 12px; }
.pool-card .pc-line3 { font-size: 9.5px; }
.pool-card .pc-head .chip, .pool-card .pc-head .pos-tag { font-size: 9px; }
.gacha-card .pc-name { font-size: 12px; }

/* ---------- 游戏页植物列表：固定高度，最多完整展示 6 株 ---------- */
.team-box {
  max-height: 246px;              /* 6 行 × 约 37px + 间距 */
  overflow: hidden;
  flex: none;
}
.team-box.scroll {
  max-height: 246px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
}
.team-box.scroll::-webkit-scrollbar { width: 4px; }
.team-box.scroll::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 4px; }
.team-row { flex: none; }

/* ---------- 游戏页：固定高度的植物框（最多 6 株，超过上下滑动） ---------- */
#view-game #team-box {
  flex: none;
  height: 246px;
  max-height: 246px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(126,217,87,.30);
  border-radius: 12px;
  background: rgba(6,14,9,.48);
  box-shadow: inset 0 0 18px rgba(0,0,0,.35);
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
}
#view-game #team-box::-webkit-scrollbar { width: 4px; }
#view-game #team-box::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 4px; }

/* ---------- 结算页出战植物：完整纵向列表（不滚动、不裁切）---------- */
.settle-team {
  max-height: none !important;
  overflow: visible !important;
}

/* ---------- 结算：种子框 ---------- */
.settle-seed-box {
  width: 100%; margin-top: 8px;
  border: 1px solid rgba(126,217,87,.42);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(126,217,87,.14), rgba(16,35,23,.55));
  padding: 9px 12px;
}
.settle-seed-box .srb-title { font-size: 12px; font-weight: 700; color: var(--teal); margin-bottom: 5px; }
.settle-seed-box .srb-body { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ---------- 禅境花园 ---------- */
.garden-top {
  width: 100%; display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-dim); margin-bottom: 10px;
}
.garden-top .garden-lv { margin-left: auto; color: var(--gold); }
.garden-top .garden-lv b { color: var(--gold-bright); }
/* 铲子：点一下拿起，再点花盆铲除 */
.garden-shovel {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(244,211,94,.45);
  background: rgba(244,211,94,.08);
  color: var(--gold); font-size: 11.5px; font-weight: 700;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.garden-shovel svg { width: 15px; height: 15px; display: block; }
.garden-shovel:active { filter: brightness(1.15); }
.garden-shovel.on {
  background: linear-gradient(180deg, rgba(244,211,94,.30), rgba(244,211,94,.12));
  border-color: #ffe9a6; color: #fff6d7;
  box-shadow: 0 0 12px rgba(244,211,94,.45);
}
#garden-grid.shoveling .gplot { cursor: crosshair; }
#garden-grid.shoveling .gplot:not(.empty):not(.locked) {
  border-color: rgba(244,211,94,.65);
  box-shadow: 0 0 8px rgba(244,211,94,.28);
}
/* 首次进入花园的悬浮提示（不弹关注窗） */
.garden-float-tip {
  position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; z-index: 130;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px); width: max-content;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(18,38,23,.97);
  border: 1px solid rgba(244,211,94,.70);
  color: #ffe9a6; font-size: 12px; line-height: 1.5; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.45), 0 0 14px rgba(244,211,94,.35);
}
.garden-float-tip.show { animation: gtipFade 5s ease forwards; }
@keyframes gtipFade {
  0% { opacity: 0; transform: translate(-50%,-10px); }
  8% { opacity: 1; transform: translate(-50%,0); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-6px); }
}
.garden-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.gplot {
  position: relative;
  min-height: 86px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6px 3px 5px; gap: 2px; cursor: pointer;
  transition: transform .12s, box-shadow .2s;
  overflow: hidden;
}
.gplot:active { transform: scale(.96); }
.gplot.locked { opacity: .38; cursor: default; border-style: dashed; }
.gplot.empty { border-style: dashed; }
.gplot.ready {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(244,211,94,.35);
  animation: gready 1.4s ease-in-out infinite alternate;
}
@keyframes gready {
  from { box-shadow: 0 0 6px rgba(244,211,94,.40); border-color: rgba(244,211,94,.55); }
  to { box-shadow: 0 0 22px rgba(244,211,94,.95), 0 0 40px rgba(244,211,94,.42); border-color: #ffe9a6; }
}
.gplot-tier {
  position: absolute; left: 4px; top: 3px;
  font-size: 9px; font-weight: 800; line-height: 1;
  border-radius: 4px; padding: 2px 4px;
  background: rgba(0,0,0,.35); color: var(--text-dim);
}
.gplot-tier.t10 { color: #ffe9a6; background: rgba(244,211,94,.22); }
.gplot-tier.t9  { color: #ffd9d9; background: rgba(255,120,120,.18); }
.gplot-tier.t8  { color: #e0d0ff; background: rgba(185,156,255,.18); }
.gplot-tier.t7  { color: #c9e8ff; background: rgba(127,179,255,.18); }
.gplot-tier.t6  { color: #ffe3a1; background: rgba(255,209,102,.16); }
.gplot-icon { font-size: 24px; line-height: 1; margin-top: 10px; }
.gplot.growing .gplot-icon { animation: ggrow 1.6s ease-in-out infinite alternate; }
@keyframes ggrow { from { transform: translateY(0) scale(.96); } to { transform: translateY(-2px) scale(1.06); } }
.gplot.empty .gplot-icon { opacity: .55; }
.gplot.ready .gplot-icon { animation: greadyicon 1s ease-in-out infinite alternate; }
@keyframes greadyicon { from { transform: rotate(-4deg) scale(1); } to { transform: rotate(4deg) scale(1.1); } }
.gplot-name { font-size: 10px; font-weight: 700; color: var(--text); white-space: nowrap; }
.gplot-time { font-size: 9px; color: var(--text-mute); white-space: nowrap; }
.gplot-bar {
  position: absolute; left: 6px; right: 6px; bottom: 5px; height: 3px;
  border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden;
}
.gplot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal-dim), var(--teal)); border-radius: 3px; transition: width .4s; }
.gplot.ready .gplot-bar i { background: var(--gold); }
.garden-bag-title {
  width: 100%; display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; color: var(--teal); font-weight: 700; margin: 14px 0 8px;
}
.garden-sel-note { margin-left: auto; font-size: 11px; color: var(--text-mute); font-weight: 400; }
.garden-bag {
  width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px;
  padding-bottom: 18px;
}
.gseed {
  position: relative; border-radius: 10px; padding: 8px 4px 6px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.gseed:active { transform: scale(.95); }
.gseed.selected { border-color: var(--gold); box-shadow: 0 0 10px rgba(244,211,94,.3); }
.gseed.empty { opacity: .35; }
.gseed-tier { font-size: 11px; font-weight: 800; color: var(--text-dim); }
.gseed-tier.t10 { color: #ffe9a6; }
.gseed-tier.t9 { color: #ffd9d9; }
.gseed-tier.t8 { color: #e0d0ff; }
.gseed-tier.t7 { color: #c9e8ff; }
.gseed-tier.t6 { color: #ffe3a1; }
.gseed-time { font-size: 9px; color: var(--text-mute); white-space: nowrap; }
.gseed-count { font-size: 10.5px; font-weight: 700; color: var(--gold); }

/* ---------- 顶部按钮 / 主按钮统一绿色高光 ---------- */
.btn-primary {
  border-color: var(--line);
  background: linear-gradient(180deg, #2c6a36, #174a24);
  color: #f4ffe9;
}
.btn-primary:active { filter: brightness(1.12); }
.btn-coach {
  border-color: rgba(244,211,94,.55);
  background: linear-gradient(180deg, rgba(244,211,94,.16), rgba(16,35,23,.55));
}
.ready-glow { animation: gready 1.4s ease-in-out infinite alternate; }
/* 花园有成熟植物：首页按钮整体发金光 */
.btn-garden.ready-glow {
  border-color: rgba(244,211,94,.80);
  background: linear-gradient(180deg, rgba(244,211,94,.20), rgba(16,35,23,.55));
  animation: gready 1.1s ease-in-out infinite alternate;
}
.btn-garden.ready-glow > span:first-child {
  color: #ffe9a6; text-shadow: 0 0 10px rgba(244,211,94,.9);
}
.btn-garden.ready-glow #garden-tip { color: #ffe9a6; font-weight: 700; }

/* ---------- 窄屏：卡名再缩一档，绝不溢出 ---------- */
@media (max-width: 380px) {
  .home-team .mini-card .pc-name,
  .deck-slot .pc-name,
  .pool-card .pc-name { font-size: 11px; }
  .gplot { min-height: 78px; }
  .gplot-icon { font-size: 21px; }
}

/* 强化后院按钮：名字变长后收一点字号，避免与右侧数字挤在一起 */
.btn-coach { font-size: 12.5px; }

/* 种子 / 幼苗 / 成熟：三种不同的动画 */
.gplot.seed .gplot-icon { animation: gseedwig 1.8s ease-in-out infinite; }
@keyframes gseedwig {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(-1px); }
}
.gplot.sprout .gplot-icon { animation: ggrow 1.2s ease-in-out infinite alternate; }
.gplot.ready .gplot-icon { animation: greadyicon .9s ease-in-out infinite alternate; }

/* 花盆手绘 SVG：替代 emoji，WebView 字体缺字时也不会显示成方块 */
.gplot-icon {
  width: 38px; height: 35px;
  margin-top: 6px;
  display: flex; align-items: flex-end; justify-content: center;
  font-size: 0;
}
.gpot-svg { width: 38px; height: 35px; display: block; overflow: visible; }

/* 花园文字：允许缩小，但不至于看不清 */
.gplot-name { font-size: 10.5px; }
.gplot-time { font-size: 9.5px; }
.gseed-time { font-size: 10px; }
.garden-bag-title { font-size: 13px; }
