/* ============================================================
 * 王者荣耀模拟器 · 样式（移动优先，兼容电脑 480px 容器）
 * 主题：竞技终端 —— 近黑灰底 + 亮橙 + 蓝 + 切角面板（事件日志保持原有分档色）
 * 背景为纯色底（长列表滚动不出现上下分层）；网格与辉光是 fixed，不参与滚动
 * ============================================================ */
[hidden] { display: none !important; }

:root {
  --bg:          #0a1420;
  --bg-deep:     #060d16;
  --panel:       #12202f;
  --panel-2:     #1a2c40;
  --panel-3:     #22384f;
  --line:        #2a4258;
  --line-soft:   #1c3145;
  --gold:        #38b6ff;
  --gold-dim:    #1d6ea8;
  --gold-bright: #a5e4ff;
  --teal:        #5ed0f5;
  --teal-dim:    #2f7fa5;
  --danger:      #c8281f;
  --danger-text: #ff9aa2;
  --text:        #d6e8f6;
  --text-dim:    #87a6bf;
  --text-mute:   #4b657a;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
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%;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}
/* 终端网格 + 上下辉光：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(56,182,255,.10), transparent 62%),
    radial-gradient(120% 70% at 50% 110%, rgba(94,151,217,.09), transparent 66%),
    repeating-linear-gradient(0deg, rgba(56,182,255,.05) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(56,182,255,.05) 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: 4px;
  padding: 11px 20px;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.btn:active { transform: scale(.97); filter: brightness(1.25); }
.btn-primary {
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #0d4a70, #1a7cb5);
  color: #d9f3ff;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(56,182,255,.30), inset 0 0 14px rgba(56,182,255,.14);
  text-shadow: 0 0 8px rgba(190,232,255,.55);
}
.btn-big { width: 100%; padding: 14px 20px; font-size: 17px; border-radius: 6px; }
.btn-danger { border-color: #5a1f1a; color: var(--danger-text); }

/* ---------- 首页 ---------- */
#view-home { justify-content: center; gap: 12px; }
.home-hero { text-align: center; margin-top: -16px; }
.home-title {
  margin: 0;
  font-size: 34px;
  letter-spacing: 4px;
  white-space: nowrap;
  background: linear-gradient(90deg, #2b9ed8, #5ed0f5, #a5e4ff, #5ed0f5, #2b9ed8);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: rainbowShift 3s linear infinite;
  filter: drop-shadow(0 0 14px rgba(125,212,255,.45));
}
.home-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; letter-spacing: 1px; }
.home-count {
  background: rgba(56,182,255,.07);
  border: 1px solid rgba(56,182,255,.22);
  border-radius: 3px;
  padding: 8px 14px;
  color: var(--gold);
  font-size: 12px;
  white-space: nowrap;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.home-count b { font-size: 13px; }
.home-lv {
  width: 100%;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  padding: 12px 16px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.lv-head { display: flex; align-items: center; gap: 8px; }
.lv-name { color: var(--text-dim); font-size: 13px; }
.lv-lv { color: var(--gold-bright); font-size: 16px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lv-bonus { color: var(--gold); font-size: 11px; white-space: nowrap; margin-left: 4px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lv-exp-line { margin-top: 7px; color: var(--text-dim); font-size: 12px; text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* 经验条：轨道必须比卡片底色更暗（此前轨道与 .home-lv 同色 #1b1f24，导致只看得见进度、看不出「满」在哪） */
.lv-bar {
  height: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.lv-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold) 55%, var(--teal));
  box-shadow: 0 0 10px rgba(56,182,255,.55);
  width: 0%;
  transition: width .3s;
}
.home-btns { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.home-link-btns { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-link-btns3 { grid-template-columns: 1fr 1fr 1fr; }
.home-link-btns3 .btn-big { padding: 12px 4px; font-size: 15px; }
.settings-body { width: 100%; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.set-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  padding: 12px 14px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.set-card .set-row { justify-content: space-between; }
.set-card .speed-label { margin-bottom: 4px; }
.about-body { width: 100%; padding: 14px; }
.about-text {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--teal-dim);
  border-radius: 4px;
  padding: 16px;
  font-size: 14px;
  line-height: 2;
  color: #b8c2cc;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.about-text b { color: var(--gold-bright); }
.home-sound { width: 100%; display: flex; justify-content: center; margin-top: 4px; }
.speed-label { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: 13px; }
.speed-label b { color: var(--gold); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.speed-range { width: 100%; margin-top: 6px; accent-color: var(--gold-dim); }
.qr-area { width: 100%; text-align: center; margin-top: 10px; }
.qr-text { color: var(--text-dim); font-size: 12.5px; margin-bottom: 6px; }
.qr-img { width: 132px; height: 132px; border-radius: 4px; background: #fff; padding: 5px; }

/* ---------- 开关 ---------- */
.set-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.set-label { font-size: 15px; color: #b8c2cc; }
.set-label2 { font-size: 15px; color: #b8c2cc; margin-bottom: 8px; }
.set-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.set-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.set-switch input { opacity: 0; width: 0; height: 0; }
.track {
  position: absolute; inset: 0;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: background .2s;
}
.track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: transform .2s, background .2s;
}
.set-switch input:checked + .track { background: #0d4a70; border-color: var(--gold); }
.set-switch input:checked + .track::after { transform: translateX(22px); background: var(--gold); box-shadow: 0 0 10px rgba(56,182,255,.85); }

/* ---------- 游戏 ---------- */
#view-game { padding-top: 0; padding-bottom: 20px; }
.game-top {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px 4px;
}
.game-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
  padding: 0 50px 0 4px;   /* 右侧留出绝对定位的暂停按钮，正文靠左 */
  overflow: hidden;
  text-align: left;
  text-shadow: 0 0 10px rgba(94,151,217,.30), 0 0 22px rgba(56,182,255,.30);
}
.btn-pause {
  position: absolute;
  right: 4px; top: 10px;
  width: 42px; height: 42px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--gold);
  font-size: 17px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.btn-pause:active { transform: scale(.94); }

.attr-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.attr-card {
  background: linear-gradient(180deg, rgba(35,42,48,.92), rgba(27,31,36,.92));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.attr-name { color: var(--text-mute); font-size: 11.5px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attr-val {
  color: var(--gold-bright);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(56,182,255,.30);
}

.log-box {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(15,18,20,.86);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.log-item {
  font-size: 13.5px;
  line-height: 1.5;
  padding: 7px 10px;
  border-radius: 3px;
  border-left: 2px solid transparent;
  background: rgba(42,61,82,.45);
  color: #b8c2cc;
}
/* 日志配色（按类型）：
 *   修炼 = 默认 · 突破 = 绿 · 事件 = 蓝/紫/金/红 · 排位 = 按对手品级（FDE 蓝 / BCA 紫 / S·SS 金 / SSS·EX 红）
 *   诞生 = 七彩 · 全球总决赛 = 七彩 · 生涯落幕 = 红 */
.log-item.year { background: rgba(42,61,82,.32); color: #c2ccd6; }
.log-item.brk { background: rgba(47,158,110,.16); border-left-color: rgba(47,158,110,.85); border-top: 1px solid rgba(47,158,110,.5); border-right: 1px solid rgba(47,158,110,.5); border-bottom: 1px solid rgba(47,158,110,.5); color: #a8e6c8; }
.log-item.ev1, .log-item.pk1 { background: rgba(61,155,214,.14); border-left-color: rgba(61,155,214,.85); border-top: 1px solid rgba(61,155,214,.45); border-right: 1px solid rgba(61,155,214,.45); border-bottom: 1px solid rgba(61,155,214,.45); color: #a8d4f5; }
.log-item.ev2, .log-item.pk2 { background: rgba(160,107,212,.14); border-left-color: rgba(160,107,212,.85); border-top: 1px solid rgba(160,107,212,.48); border-right: 1px solid rgba(160,107,212,.48); border-bottom: 1px solid rgba(160,107,212,.48); color: #d8c8f0; }
.log-item.ev3, .log-item.pk3 { background: rgba(200,170,110,.15); border-left-color: rgba(200,170,110,.9); border-top: 1px solid rgba(200,170,110,.5); border-right: 1px solid rgba(200,170,110,.5); border-bottom: 1px solid rgba(200,170,110,.5); color: #d6eefc; }
.log-item.ev4, .log-item.pk4 { background: rgba(200,40,31,.16); border-left-color: rgba(200,40,31,.9); border-top: 1px solid rgba(200,40,31,.52); border-right: 1px solid rgba(200,40,31,.52); border-bottom: 1px solid rgba(200,40,31,.52); color: #f0a8a8; }
/* 转会期：红色（独立一档） */
.log-item.trans { background: rgba(200,40,31,.14); border-left-color: rgba(200,40,31,.9); border-top: 1px solid rgba(200,40,31,.5); border-right: 1px solid rgba(200,40,31,.5); border-bottom: 1px solid rgba(200,40,31,.5); color: #ff9c9c; font-weight: 700; }
/* 俱乐部等级 / 段位突破：紫色 */
.log-item.club { background: rgba(160,107,212,.16); border-left-color: rgba(160,107,212,.9); border-top: 1px solid rgba(160,107,212,.5); border-right: 1px solid rgba(160,107,212,.5); border-bottom: 1px solid rgba(160,107,212,.5); color: #dcc6f5; font-weight: 700; }
/* 诞生与全球总决赛：七彩渐变流动 */
.log-item.rb, .log-item.born {
  background: linear-gradient(90deg, rgba(232,84,47,.26), rgba(224,170,44,.26), rgba(240,192,74,.28), rgba(61,155,214,.26), rgba(160,107,212,.26));
  background-size: 400% 100%;
  border: 1px solid rgba(200,170,110,.7);
  color: #eaf7ff;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(200,170,110,.28);
  animation: rainbowShift 1.2s linear infinite;
}
@keyframes rainbowShift { 0% { background-position: 0% 0; } 100% { background-position: 400% 0; } }
.log-item.dead { background: rgba(150,40,50,.15); border-left-color: rgba(170,50,60,.85); border-top: 1px solid rgba(170,50,60,.4); border-right: 1px solid rgba(170,50,60,.4); border-bottom: 1px solid rgba(170,50,60,.4); color: #ffb0b8; }

/* ---------- 结算 ---------- */
#view-settle { justify-content: center; padding-top: 8px; padding-bottom: 8px; }
.settle-box {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}
.settle-title { text-align: center; font-size: 22px; font-weight: 700; color: var(--gold-bright); letter-spacing: 2px; }
.settle-title.god { color: #eaf6ff; text-shadow: 0 0 24px rgba(56,182,255,.65); }
.settle-rows { display: flex; flex-direction: column; }
.s-row {
  display: flex; justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 14px;
}
.s-row:last-child { border-bottom: none; }
.s-row span { color: var(--text-dim); }
.s-row b { color: var(--gold-bright); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.settle-rank {
  background: rgba(56,182,255,.07);
  border: 1px solid rgba(56,182,255,.22);
  border-radius: 4px;
  padding: 7px;
  color: var(--gold);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.settle-note {
  background: rgba(200,40,31,.08);
  border: 1px solid rgba(200,40,31,.35);
  border-radius: 4px;
  padding: 8px 10px;
  color: #ffb0b8;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}
.settle-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.settle-btns .btn-big { padding: 11px 6px; font-size: 15px; border-radius: 4px; }

/* 回顾生涯弹窗（照 CSGO：日志块与游戏内 .log-box 用同一套 .log-item 配色） */
.review-box { width: 340px; max-width: 88vw; max-height: 80vh; }
.review-log {
  flex: 1;
  min-height: 200px;
  max-height: 55vh;
  overflow-y: auto;
  background: rgba(15,18,20,.86);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- 子页通用（标题绝对居中，✕ 固定右上角） ---------- */
.page-view { padding: 0 !important; }
.page-head {
  width: 100%;
  position: relative;
  padding: 14px 14px 10px;
  background: rgba(15,18,20,.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 58px;
  display: flex;
  align-items: center;
}
.page-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 19px;
  color: var(--gold);
  letter-spacing: 2px;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(56,182,255,.40);
}
.btn-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  clip-path: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
  flex: none;
}
.btn-close:active { transform: scale(.92); border-color: var(--gold); color: var(--gold); }
.tabs { display: flex; gap: 8px; padding: 10px 14px 4px; width: 100%; }
.tabs-small { padding-top: 4px; }
.tabs-small .tab { font-size: 12px; padding: 6px 0; }
.tabs-wrap { flex-wrap: wrap; gap: 6px; }
.tabs-wrap .tab { flex: 0 0 calc((100% - 24px) / 5); font-size: 12px; padding: 7px 0; }
.tab {
  flex: 1;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 8px 0;
  background: var(--panel-2);
  color: var(--text-mute);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.tab.active {
  background: linear-gradient(180deg, #1a7cb5, #0d4a70);
  border-color: var(--gold);
  color: #d9f3ff;
  box-shadow: 0 0 12px rgba(56,182,255,.35);
}
.lb-note { padding: 6px 14px 0; font-size: 12px; color: var(--gold); width: 100%; letter-spacing: 1px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lb-body { padding: 8px 14px 30px; width: 100%; }
.lb-tip { text-align: center; color: var(--text-mute); padding: 30px 0; font-size: 14px; }
.lb-row.me { box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(56,182,255,.12); }
.lb-rank.top { background: #124a6e; color: #d9f3ff; }
.lb-rank.top.r1 { background: #c0143c; color: #fff; }
.lb-rank.top.r2 { background: #c05a3f; color: #fff; }
.lb-rank.top.r3 { background: var(--gold-dim); color: #d9f3ff; }

/* ---------- 图鉴 ---------- */
.dex-body { width: 100%; padding: 8px 14px 30px; }
.dex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dex-item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 3px;
  padding: 9px 4px;
  font-size: 12.5px;
  line-height: 1.3;
  min-height: 40px;
  word-break: break-all;
}
.dex-item.have {
  background: linear-gradient(180deg, rgba(56,182,255,.22), rgba(56,182,255,.08));
  border: 1px solid rgba(56,182,255,.5);
  color: var(--gold-bright);
}
.dex-item.lack {
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  color: #3d444b;
}

/* ---------- 暂停遮罩 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(20,23,26,.86);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mask-box {
  width: 300px;
  max-width: 86vw;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.8), 0 0 40px rgba(56,182,255,.08);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}
.mask-title { text-align: center; font-size: 20px; color: var(--gold); font-weight: 700; letter-spacing: 2px; text-shadow: 0 0 14px rgba(56,182,255,.35); }
.mask-info { text-align: center; color: var(--text-dim); font-size: 13px; }
.mask-box .set-row { justify-content: center; padding: 4px 0; }
.review-box { width: 320px; max-width: 88vw; max-height: 80vh; }
/* 与游戏内 .log-box 完全同一套样式：回顾生涯里的颜色/底色/边框和进程日志一模一样 */
.review-log {
  flex: 1;
  min-height: 200px;
  max-height: 55vh;
  overflow-y: auto;
  background: rgba(15,18,20,.86);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 电脑端 ---------- */
@media (min-width: 520px) {
  body { background: var(--bg-deep); }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 高阶天赋增益（点赞/投币/关注） ---------- */
.btn-follow {
  border-color: var(--gold-dim);
  color: var(--gold);
  margin-bottom: 12px;
  font-size: 14px;
  padding: 12px 16px;
}
/* ⚠ .follow-action / .fb-total 都带 overflow:hidden，在 flex 容器里的**自动最小尺寸是 0**：
 *   内容一旦超出 max-height，浏览器会把它们**压扁**（「当前增益」整行高度变 0、彻底看不见），
 *   而不是滚动。所以滚动只交给中间的列表区，标题 / 合计 / 关闭按钮一律禁止收缩、常驻可见。 */
.follow-box { width: 350px; max-width: 90vw; max-height: 86vh; overflow: hidden; }
.follow-rows {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.follow-rows > *, .mask-title, .fb-total, .follow-box > .btn { flex: none; }
/* 一行到底不换行；字号由 JS 的 fitOneLine 自适应缩到放得下为止
 * ⚠ .fb-state 用 em 而非 px：整行缩字号时跟着一起缩（同 .roster-pos 的做法） */
.follow-action { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 13px 16px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.fb-state { font-size: .92em; flex: none; margin-left: 8px; }
.fb-state.done { color: #a5e4ff; }
.fb-state.todo { color: var(--text-mute); }
/* 合计行：不换行，字号由 JS fitOneLine 自适应缩 */
.fb-total { font-size: 15px; color: var(--gold); font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }

/* ---------- 成就系统 ---------- */
.home-ach-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.ach-total {
  text-align: center; color: var(--gold); font-size: 16px; font-weight: 700;
  margin: 6px 14px 10px; padding: 9px;
  width: calc(100% - 28px);
  background: rgba(56,182,255,.07);
  border: 1px solid rgba(56,182,255,.22);
  border-radius: 4px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.ach-list {
  display: flex; flex-direction: column; gap: 12px;
  padding: 6px 16px 30px;
  width: 100%;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.ach-list::-webkit-scrollbar { width: 6px; }
.ach-list::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }
.ach-list::-webkit-scrollbar-track { background: var(--panel-2); border-radius: 3px; }
.ach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.ach-item.done { border-color: var(--gold-dim); background: linear-gradient(180deg, #252c33, var(--panel)); box-shadow: 0 0 16px rgba(56,182,255,.18); }
.ach-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ach-item.done .ach-name { color: var(--gold-bright); }
.ach-item.todo .ach-name { color: var(--text-dim); }
.ach-bonus { font-size: 13px; white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ach-item.done .ach-bonus { color: #a5e4ff; }
.ach-item.todo .ach-bonus { color: #3d444b; }

/* ---------- 成就达成面包屑提示 ---------- */
.ach-toast {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99;
  text-align: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #1a7cb5, #0d4a70);
  border-bottom: 1px solid var(--gold);
  color: #d9f3ff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  transform: translateY(-100%);
  transition: transform .35s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.7), 0 0 24px rgba(56,182,255,.25);
}
.ach-toast.show { transform: translateY(0); }

/* 成就按钮：标题+小字两行居中 */
#btn-ach, #btn-rank { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 9px 14px; }
#btn-ach > span:first-child, #btn-rank > span:first-child { font-size: 17px; line-height: 1.3; }
.ach-btn-tip { font-size: 10px; color: var(--gold); white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* 排行榜页内的榜单名次加成说明（参考新三国模拟器） */
.rank-fate-note { width: 100%; text-align: center; color: var(--gold); font-size: 12px; padding: 2px 0 4px; font-variant-numeric: tabular-nums; }

/* ---------- 手动模式 ---------- */
.manual-tip {
  width: 100%;
  text-align: center;
  color: var(--gold);
  font-size: 13px;
  padding: 6px 0 2px;
  letter-spacing: 2px;
}
.set-tip { margin-top: 6px; color: var(--text-mute); font-size: 12px; line-height: 1.6; }
.set-min-row .set-label { flex: none; white-space: nowrap; }

/* ---------- KPL总决赛 参战弹窗（可拖动、可收起） ---------- */
#decision-mask { align-items: flex-start; padding-top: 7vh; }
.decision-box { width: 330px; max-width: 90vw; position: relative; cursor: grab; touch-action: none; user-select: none; }
.decision-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.decision-x:active { transform: scale(.9); }
.decision-tip { text-align: center; color: var(--text-mute); font-size: 11px; line-height: 1.5; }
.decision-opts { display: flex; flex-direction: column; gap: 10px; }
/* 选择按钮：文案单行不换行，超宽时缩字号 */
.decision-opt {
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  color: var(--bg);
  font-weight: 700;
  border-radius: 4px;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
/* 首页 高光+保底 双按钮同排各占 50% */
.home-duo { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-duo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 9px 6px; }
.btn-duo > span:first-child { font-size: 17px; line-height: 1.3; }
.btn-duo .ach-btn-tip { font-size: 10px; color: var(--gold); white-space: nowrap; }
#btn-guard.on { border-color: var(--gold); background: linear-gradient(180deg, #0a2438, var(--panel)); box-shadow: 0 0 18px rgba(56,182,255,.30); }
#btn-guard.on .ach-btn-tip { color: var(--gold-bright); }

/* 首页「图鉴」按钮：标题 + 加成小字两行（与排行榜 / 成就按钮同款） */
#btn-dex { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; }
#btn-dex .ach-btn-tip { font-size: 10px; color: var(--gold); white-space: nowrap; }
.hl-list { flex: 1; min-height: 120px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.hl-item {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold-dim);
  border-radius: 4px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;                 /* 点条目即导出结算卡 */
  flex: none;
}
.hl-item:active { transform: scale(.99); filter: brightness(1.2); border-color: var(--gold); }
/* 高光条目里的六只精灵（照王者把阵容铺在条目内） */
/* 阵容行：**允许换行** —— 一行排不下就折到下一行，不缩字号、不裁切 */
.hl-roster { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 11.5px; }
.hl-sp {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 3px 8px; border-radius: 3px;
  background: var(--bg-deep); border: 1px solid var(--line-soft);
  color: #c2ccd6; font-size: 1em; font-family: var(--mono);   /* em：跟随 .hl-roster 的字号 */
}
/* 品级标签复用游戏页的 .roster-tier.tN 配色（见下方「精灵行 · 定稿」配色表）。
 * ⚠ 这里只纠正字体的斜体，**不要**再写 font-weight/颜色——会被这条 (0,1,1) 覆盖掉
 *   .roster-tier 的 (0,1,0) 基础样式和 .roster-tier.tN 的配色。 */
.hl-sp i { font-style: normal; }
.hl-sp em { font-style: normal; color: #8b9cae; }
.hl-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hl-top b { color: var(--gold-bright); font-size: 14.5px; }
.hl-innate { color: #d6eefc; font-size: 11.5px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hl-end { margin-left: auto; color: #ffb0b8; font-size: 11.5px; }
.hl-mid { margin-top: 3px; color: var(--text-dim); font-size: 11.5px; line-height: 1.45; }
.hl-mid b { color: var(--gold-bright); font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* 结算卡预览：图片限制在视口内（生成图很高，按宽度等比缩放会撑出屏幕把按钮顶飞） */
#hl-img-mask { align-items: flex-start; overflow-y: auto; padding: 14px 0 calc(20px + env(safe-area-inset-bottom)); }
.hl-img-box { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 92vw; }
.hl-img { width: auto; height: auto; max-width: min(92vw, 400px); max-height: 60vh; background: var(--bg); border-radius: 4px; }
.hl-btns { display: flex; gap: 8px; width: 100%; }
.hl-btns .btn { flex: 1; padding: 9px 4px; font-size: 13.5px; }
.hl-toast {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%);
  z-index: 98; background: linear-gradient(180deg, #1a7cb5, #0d4a70); border: 1px solid var(--gold);
  color: #d9f3ff; font-weight: 700; font-size: 14px;
  border-radius: 4px; padding: 10px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.7), 0 0 24px rgba(56,182,255,.25);
  white-space: nowrap;
}
.guard-box { width: 320px; max-width: 88vw; }
.guard-rows { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.guard-row { background: rgba(35,42,48,.85); border-radius: 3px; padding: 6px 10px; text-align: left; color: #b8c2cc; font-size: 13px; line-height: 1.6; }
.guard-row b { color: var(--gold-bright); }

/* 遭遇收起后底部召唤按钮 */
.decision-recall {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 70;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #1a7cb5, #0d4a70);
  color: #d9f3ff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
  padding: 10px 22px;
  box-shadow: 0 6px 24px rgba(0,0,0,.7), 0 0 22px rgba(56,182,255,.25);
}
.decision-recall:active { transform: translateX(-50%) scale(.96); }

/* 高光独立页 */
/* 高光页：页头固定，只有列表滚动（整页撑高会滚不动/把内容顶出视口） */
#view-hl { height: 100vh; overflow: hidden; }
#view-hl .page-head { flex: none; }
.hl-note { width: 100%; padding: 8px 16px 2px; color: var(--text-mute); font-size: 11.5px; letter-spacing: 1px; }
.hl-list-page {
  width: 100%;
  flex: 1;
  min-height: 0;             /* flex 子容器可滚动的必要条件 */
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
  margin: 0;
}

/* ============================================================
 * 电竞经理模拟器 · 新增样式
 * 首发五人列表 · 选秀页 · KPL总决赛弹窗 · 转会期弹窗 · 选手图鉴分组
 * ============================================================ */

/* ---------- 首发五人（游戏页 / 结算页共用） ---------- */
.roster-box {
  width: 100%;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 30vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.settle-roster { max-height: none; margin-top: 4px; }
.roster-row {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 3px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--gold-dim);
  background: linear-gradient(90deg, rgba(35,42,48,.92), rgba(27,31,36,.72));
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.roster-name { flex: none; color: var(--gold-bright); font-weight: 700; }
.roster-lv { flex: none; color: var(--teal); font-family: var(--mono); font-weight: 700; }
.roster-attr { flex: none; color: #9fb0c2; font-family: var(--mono); }
.roster-power { flex: 1; text-align: right; color: var(--gold-bright); font-family: var(--mono); font-weight: 700; }

/* ---------- 选秀页 ---------- */
#view-draft { height: 100vh; overflow: hidden; }
.draft-box {
  width: 100%;
  max-width: 560px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 14px;
}
.draft-head { flex: none; padding: 18px 0 10px; text-align: center; }
.draft-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(56,182,255,.35);
}
.draft-sub { margin-top: 6px; font-size: 11.5px; color: var(--text-mute); letter-spacing: .5px; }
/* 选秀页信息栏：战队 / 电竞点 / 抽卡次数 / 剩余刷新（单行不换行，超宽缩字号） */
.draft-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #9fb0c2;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}
.draft-meta b { color: var(--gold-bright); }
.draft-meta .dm-sep { color: var(--line); margin: 0 5px; }
/* 开头的教练等级胶囊（只放 F~EX 字母） */
.draft-meta .dm-tier { vertical-align: middle; margin-right: 5px; }
/* 候选区工具条：候选数 + ⇧ TOP6 + ↻ 刷新（照世界杯的 draft-sec-head 布局） */
.draft-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1.5px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 5px;
}
.draft-tools-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.draft-refresh {
  flex: none;
  margin-left: auto;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid rgba(200,170,110,.55);
  background: rgba(200,170,110,.10);
  color: var(--gold);
  cursor: pointer;
}
.draft-refresh.on { box-shadow: 0 0 8px rgba(200,170,110,.35); }
/* 「⇧ TOP6」：一键选回品级最高的 6 只（与刷新并排，靠右） */
.draft-top {
  flex: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid rgba(200,170,110,.85);
  background: rgba(200,170,110,.22);
  color: var(--gold-bright);
  cursor: pointer;
}
.draft-top:hover { background: rgba(200,170,110,.34); }
.draft-top + .draft-refresh { margin-left: 0; }
.draft-refresh.used, .draft-refresh.used:hover {
  border-color: var(--line-soft);
  background: rgba(200,150,145,.10);
  color: var(--text-mute);
  box-shadow: none;
  cursor: default;
}
/* 悬浮提示气泡（照世界杯：定位在按钮附近，横向夹在页面内，绝不超界） */
.draft-tip-float {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  max-width: min(236px, calc(100vw - 16px));
  padding: 7px 10px;
  border-radius: 4px;
  background: rgba(12,26,40,.97);
  border: 1px solid rgba(200,170,110,.55);
  color: var(--gold-bright);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: .5px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s;
}
.draft-tip-float.show { opacity: 1; visibility: visible; }
.draft-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
}
.draft-refresh {
  flex: none;
  margin-left: auto;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .5px;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid rgba(56,182,255,.55);
  background: rgba(56,182,255,.10);
  color: var(--gold);
  cursor: pointer;
}
.draft-refresh.on { box-shadow: 0 0 8px rgba(56,182,255,.35); }
.draft-refresh.used, .draft-refresh.used:hover {
  border-color: var(--line-soft);
  background: rgba(120,130,150,.10);
  color: var(--text-mute);
  box-shadow: none;
  cursor: default;
}
/* 未关注 / 额度用完时的悬浮提示（fixed 定位，不会被滚动容器裁掉） */
.draft-tip-float {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  max-width: min(236px, calc(100vw - 16px));
  padding: 7px 10px;
  border-radius: 4px;
  background: rgba(20,23,26,.97);
  border: 1px solid rgba(56,182,255,.55);
  color: var(--gold-bright);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: .5px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s;
}
.draft-tip-float.show { opacity: 1; visibility: visible; }
.draft-row.picked {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(56,182,255,.20), rgba(56,182,255,.05));
  box-shadow: 0 0 10px rgba(56,182,255,.20) inset;
}
.draft-row.picked::after {
  content: '✓';
  flex: none;
  color: var(--gold);
  font-weight: 700;
}
.draft-foot {
  flex: none;
  padding: 10px 0 calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(20,23,26,0), rgba(20,23,26,.96) 40%);
}
.draft-foot .btn { width: 100%; }
#decision-info { display: flex; flex-direction: column; gap: 2px; text-align: center; }
#decision-info b { color: var(--gold-bright); font-size: 15px; }
/* 属性行：分路 / 名字（评级）/ 等级 / 天赋 / 意识 / 精灵战力 / 选手实力 */
.t-attr {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--gold-dim);
  border-radius: 3px;
  background: rgba(27,31,36,.72);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.t-attr .t-pos { flex: none; color: var(--teal); font-weight: 700; }
.t-attr .t-name { flex: none; color: var(--gold-bright); font-weight: 700; }
.t-attr .t-kv { flex: none; color: #9fb0c2; font-family: var(--mono); }
.t-attr .t-star { flex: none; color: #a5e4ff; font-weight: 700; font-size: 11px; }
.t-btn {
  flex: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 5px 12px;
  border-radius: 3px;
  border: 1px solid;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.t-btn-up { border-color: rgba(70,200,130,.7); background: rgba(70,200,130,.14); color: #7ff0b0; }
.t-btn-down { border-color: rgba(226,86,74,.7); background: rgba(226,86,74,.14); color: #ff9d92; }
.t-btn-no { border-color: var(--line-soft); background: rgba(120,130,150,.10); color: var(--text-mute); cursor: default; }
.t-btn:disabled { cursor: default; }
.dex-bonus { color: var(--gold); font-size: 12px; letter-spacing: .5px; }


/* ============================================================
 * 赛尔号模拟器 · 特有组件（继承上文王者设计体系）
 * ============================================================ */

/* ---------- 弹层通用 ---------- */
.dlg-btns { width: 100%; display: flex; gap: 10px; margin-top: 12px; }
.dlg-btns .btn { flex: 1; }
.enc-body { width: 100%; margin: 8px 0; }
.battle-box, .catch-box { width: 100%; max-width: 420px; }
.catch-box { max-height: 84vh; overflow-y: auto; }

/* ---------- 开局候选 ---------- */
.cand-list { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cand {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  border-radius: 4px; padding: 9px 10px; text-align: left;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  cursor: pointer; transition: filter .12s;
}
.cand:active { filter: brightness(1.25); }
.cand.sel { border-color: var(--gold); border-left-color: var(--gold); background: var(--panel-2); box-shadow: 0 0 10px rgba(56,182,255,.22); }
.draft-body { width: 100%; }
.sp-card.wild { border-color: var(--gold); border-left-color: var(--gold); background: var(--panel-2); }
.sp-evo.ready { color: #7ff0b0; }

/* ---------- 收服替换列表 ---------- */
.swap-list { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.swap-row { display: block; width: 100%; text-align: left; padding: 0; background: none; border: 1.5px solid transparent; border-radius: 6px; cursor: pointer; }
.swap-row .sp-card { border-left-width: 2px; }
.swap-row.up .sp-card { border-color: #2f9e6e; border-left-color: #2f9e6e; }
.swap-row.down .sp-card { border-color: #a3302a; border-left-color: #a3302a; }
.swap-row.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(56,182,255,.28); }
.catch-sec { width: 100%; font-size: 12px; color: var(--text-mute); margin: 10px 0 6px; }

/* ---------- 日志（沿用王者的分档配色思路） ---------- */

/* ---------- 图鉴网格（王已有 .dex-grid，这里补未收集态） ---------- */
.dex-item.lack { opacity: .42; }
.dex-item.have { border-color: var(--gold-dim); color: var(--gold-bright); }

/* ---------- 高光行 ---------- */
.hl-item { width: 100%; background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--gold);
  border-radius: 4px; padding: 10px 12px; margin-bottom: 8px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.hl-btns { margin-top: 8px; }

/* ---------- 排行榜行 ---------- */
/* 本地榜行（格式照王者：编号徽章 + 成绩 + 时间 + 分数；前三名彩色徽章） */
.lb-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 4px; padding: 8px 10px; margin-bottom: 6px;
}
.lb-row.me { box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(56,182,255,.12); }
.lb-rank {
  flex: none; width: 26px; height: 26px; border-radius: 3px;
  background: var(--panel-2); color: var(--text-mute);
  font-size: 13px; font-weight: 700; text-align: center; line-height: 26px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.lb-rank.top { background: #1d4b70; color: #cdeaff; }
.lb-rank.top.r1 { background: #c0143c; color: #fff; }
.lb-rank.top.r2 { background: #b3612f; color: #fff; }
.lb-rank.top.r3 { background: var(--gold-dim); color: #d9f3ff; }
.lb-user { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-avatar { width: 28px; height: 28px; border-radius: 3px; flex: none; }
.lb-name { font-size: 14px; color: #b8c2cc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-time { font-size: 11px; color: var(--text-dim); flex: none; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.lb-score { font-size: 15px; font-weight: 700; color: var(--gold-bright); flex: none; white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.rank-row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 3px; margin-bottom: 5px; }
.rk { width: 26px; text-align: center; font-size: 12px; color: var(--text-mute); font-weight: 700; font-family: var(--mono); }
.av { width: 24px; height: 24px; border-radius: 50%; }
.nm { flex: 1; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc { font-size: 12.5px; color: var(--gold); white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }


/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 14%; transform: translateX(-50%); z-index: 99;
  background: rgba(18,32,47,.97); color: var(--text); padding: 10px 18px; border-radius: 4px;
  border: 1px solid var(--gold-dim); font-size: 13px; max-width: 84vw; text-align: center; }


/* ============================================================
 * 精灵行（照王者 .roster-row 的横向一行结构，补齐全部属性）
 * ============================================================ */
.roster-row { gap: 6px; font-size: 12px; padding: 7px 8px; }
.roster-tier {
  flex: none; font-size: 10px; font-weight: 800; padding: 2px 5px;
  border-radius: 3px; background: var(--panel-3); color: var(--text-dim); letter-spacing: .3px;
}
.roster-name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; }
.roster-attr b, .roster-power b { font-weight: 700; margin-left: 1px; }
.roster-attr b { color: var(--text); }
.roster-power b { color: var(--gold-bright); }
.roster-evo { flex: none; font-size: 10px; color: var(--text-mute); font-family: var(--mono); }
.roster-evo.ready { color: #7ff0b0; font-weight: 700; }
.roster-row.wild {
  border-color: var(--gold);
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(56,182,255,.12), rgba(27,31,36,.72));
}
/* 收服替换列表：升绿降红 */
.swap-row .roster-row { border-color: transparent; border-left-width: 3px; }
.swap-row.up .roster-row { border-color: #2f9e6e; border-left-color: #2f9e6e; }
.swap-row.down .roster-row { border-color: #a3302a; border-left-color: #a3302a; }
.swap-row.sel .roster-row { box-shadow: 0 0 0 2px rgba(56,182,255,.30); }

/* 候选精灵：也走横向行 */
.cand-list { display: flex; flex-direction: column; gap: 6px; }
.cand {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: linear-gradient(90deg, rgba(35,42,48,.92), rgba(27,31,36,.72));
  border: 1px solid var(--line-soft); border-left: 2px solid var(--line);
  border-radius: 3px; padding: 7px 9px; text-align: left; font-size: 12px;
  white-space: nowrap; overflow: hidden; cursor: pointer;
}
.cand.sel { border-color: var(--gold); border-left-color: var(--gold); box-shadow: 0 0 10px rgba(56,182,255,.25); }


/* ============================================================
 * 精灵行 · 紧凑版（保证一行放得下全部属性）
 * ============================================================ */
.roster-row { gap: 5px; font-size: 11.5px; padding: 6px 8px; }
.roster-tier { flex: none; font-size: 9.5px; font-weight: 800; padding: 1px 4px; border-radius: 3px; letter-spacing: .3px; }
.roster-name { max-width: 5.5em; overflow: hidden; text-overflow: ellipsis; }
.roster-lv { font-size: 11px; }
.roster-attr { font-size: 11px; }
.roster-power { font-size: 11px; }
.roster-evo { font-size: 9.5px; }
.roster-row.wild .roster-tier { background: var(--gold); color: #04141f; }

/* 候选项：外层只做选中态，内层走 .roster-row */
.cand { display: block; width: 100%; padding: 0; background: none; border: 1.5px solid transparent;
  border-radius: 4px; text-align: left; cursor: pointer; }
.cand.sel { border-color: var(--gold); box-shadow: 0 0 10px rgba(56,182,255,.25); }
.cand .roster-row { border-left-width: 3px; }
.cand.sel .roster-row { border-left-color: var(--gold); }
.cand:active .roster-row { filter: brightness(1.2); }
.cand-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }

/* 首页保底那行小字：允许换行 */
#guard-tip, .btn-duo .ach-btn-tip, .home-link-btns3 .ach-btn-tip { white-space: normal; line-height: 1.25; }

/* 弹层内的精灵行：略放宽，弹层本身较窄 */
.mask-box .roster-row { padding: 7px 9px; font-size: 12px; }
.mask-box .roster-name { max-width: 6.5em; }


/* ============================================================
 * 精灵行 · 定稿：评级配色 + 名字截断 + 实力右对齐
 * （用双类选择器，避免被上面的 .roster-tier / .roster-name 基础样式覆盖）
 * ============================================================ */
.roster-tier.t1  { background: #2a3646; color: #9fb4c8; }
.roster-tier.t2  { background: #274357; color: #9fd0f0; }
.roster-tier.t3  { background: #23533f; color: #8fe0b4; }
.roster-tier.t4  { background: #2c4a6b; color: #a9cdff; }
.roster-tier.t5  { background: #4a3a1e; color: #ffd75e; }
.roster-tier.t6  { background: #553423; color: #ffb47a; }
.roster-tier.t7  { background: #4a2340; color: #ff9de0; }
.roster-tier.t8  { background: #3f1f52; color: #d8a6ff; }
.roster-tier.t9  { background: #5c1f1f; color: #ff8a9c; }
.roster-tier.t10 { background: linear-gradient(135deg, #2b9ed8, #5ed0f5); color: #04141f; font-weight: 900; }
.roster-row.wild .roster-tier { box-shadow: 0 0 0 1px var(--gold); }

/* 名字：宽度封顶，超出省略号 */
.roster-name { flex: none; max-width: 4.6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 实力：吃掉剩余空间并右对齐（必须是行内最后一个元素） */
.roster-power { flex: 1 1 auto; text-align: right; }
/*


/* ---------- 覆盖：名字完整显示 · 不做右对齐 ---------- */
.roster-name { flex: none; max-width: none; overflow: visible; text-overflow: clip; }
.roster-power { flex: none; text-align: left; }


/* ---------- 定稿：名字完整显示（不受限）· 实力右对齐 ---------- */
.roster-name  { flex: none; max-width: none; overflow: visible; text-overflow: clip; text-align: left; }
.roster-power { flex: 1 1 auto; text-align: right; }


/* ============================================================
 * 精灵评级徽标 · 高对比配色（十档一眼可辨）
 * 前面几版给的背景色过暗（#2a3646 之类），在深空蓝底上几乎看不见，
 * 这里统一改成「半透明彩底 + 亮色文字」，EX 用实心金。
 * ============================================================ */
.roster-row .roster-tier.t1  { background: rgba(150,163,178,.20); color: #aebccb; }
.roster-row .roster-tier.t2  { background: rgba(70,205,140,.20);  color: #6ee6a8; }
.roster-row .roster-tier.t3  { background: rgba(80,160,255,.22);  color: #7cbcff; }
.roster-row .roster-tier.t4  { background: rgba(80,215,235,.20);  color: #6fdcf0; }
.roster-row .roster-tier.t5  { background: rgba(170,120,255,.24); color: #bfa2ff; }
.roster-row .roster-tier.t6  { background: rgba(255,205,60,.20);  color: #ffd75e; }
.roster-row .roster-tier.t7  { background: rgba(255,145,60,.22);  color: #ffae63; }
.roster-row .roster-tier.t8  { background: rgba(255,90,110,.22);  color: #ff8a9c; }
.roster-row .roster-tier.t9  { background: rgba(255,95,205,.24);  color: #ff9de0; }
.roster-row .roster-tier.t10 { background: linear-gradient(135deg, #c9a227, #ffd75e); color: #2a1e04; font-weight: 900; }

/* 徽标本身再加粗一点、字距拉开，更醒目 */
.roster-tier { font-weight: 800; min-width: 2.4em; text-align: center; }


/* ============================================================
 * 精灵评级徽标 · 最终配色（按指定方案）
 *   EX 七彩 / SSS 红 / SS 金 / S 紫 / A 蓝 / B 浅蓝 / C 绿 / D 浅绿 / E·F 灰色系（深浅区分）
 * ============================================================ */
.roster-row .roster-tier.t1  { background: rgba(112,124,136,.26); color: #8592a0; }   /* F 深灰 */
.roster-row .roster-tier.t2  { background: rgba(170,182,194,.26); color: #b9c6d2; }   /* E 浅灰 */
.roster-row .roster-tier.t3  { background: rgba(110,222,152,.22); color: #8ce9b6; }   /* D 浅绿 */
.roster-row .roster-tier.t4  { background: rgba(52,186,104,.26);  color: #57d68c; }   /* C 绿 */
.roster-row .roster-tier.t5  { background: rgba(122,212,246,.24); color: #93ddff; }   /* B 浅蓝 */
.roster-row .roster-tier.t6  { background: rgba(72,138,255,.28);  color: #7dacff; }   /* A 蓝 */
.roster-row .roster-tier.t7  { background: rgba(168,108,255,.28); color: #bf92ff; }   /* S 紫 */
.roster-row .roster-tier.t8  { background: linear-gradient(135deg, #b8901f, #ffd75e); color: #2a1e04; }  /* SS 金 */
.roster-row .roster-tier.t9  { background: linear-gradient(135deg, #9c1414, #ff3b3b); color: #fff2f2; }  /* SSS 红 */
.roster-row .roster-tier.t10 {                                                          /* EX 七彩 */
  background: linear-gradient(90deg, #ff4d4d, #ffb84d, #ffe94d, #5ee08a, #4dc3ff, #a17dff, #ff6ee0, #ff4d4d);
  background-size: 300% 100%;
  animation: rainbowShift 3s linear infinite;
  color: #0a1420;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}
/* 金 / 红 / 七彩 三种实心底的徽标再加一层描边，避免糊在背景上 */
.roster-row .roster-tier.t8,
.roster-row .roster-tier.t9,
.roster-row .roster-tier.t10 { box-shadow: 0 0 8px rgba(255,255,255,.12); }


/* ============================================================
 * 首页按钮：主标题与下方小字改为纵向两行
 * （原来两个 span 是横向 inline 排列，小字根本没有独立的一行）
 * ============================================================ */
.home-ach-row .btn-big,
.home-duo .btn-big,
.home-link-btns3 .btn-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.3;
}
.home-ach-row .ach-btn-tip,
.home-duo .ach-btn-tip,
.home-link-btns3 .ach-btn-tip {
  white-space: normal;      /* 放不下时允许折行，不再被 nowrap 裁掉 */
  line-height: 1.25;
  text-align: center;
}


/* ---------- 图鉴：每只精灵左侧档位色条（与徽标配色一致）---------- */
.dex-item { border-left: 2px solid var(--line); }
.dex-item.t1  { border-left-color: #8592a0; }   /* F  深灰 */
.dex-item.t2  { border-left-color: #b9c6d2; }   /* E  浅灰 */
.dex-item.t3  { border-left-color: #8ce9b6; }   /* D  浅绿 */
.dex-item.t4  { border-left-color: #57d68c; }   /* C  绿   */
.dex-item.t5  { border-left-color: #93ddff; }   /* B  浅蓝 */
.dex-item.t6  { border-left-color: #7dacff; }   /* A  蓝   */
.dex-item.t7  { border-left-color: #bf92ff; }   /* S  紫   */
.dex-item.t8  { border-left-color: #ffd75e; }   /* SS 金   */
.dex-item.t9  { border-left-color: #ff3b3b; }   /* SSS 红  */
.dex-item.t10 { border-left-color: #ff6ee0; }   /* EX 品红 */


/* ============================================================
 * 撤销此前对王者 .roster-row 的私自覆盖 —— 恢复王者原值
 * （此前为了塞下多出来的「进化标记」把 gap 压到 5px、字号压到 11.5px，
 *   属于乱改参考项目的设计；现改为把进化标记并入名字，元素数与王者一致）
 * ============================================================ */
.roster-row  { gap: 7px; font-size: 13px; padding: 7px 9px; }
.roster-lv   { font-size: inherit; }
.roster-attr { font-size: inherit; }
.roster-power{ font-size: inherit; flex: 1 1 auto; text-align: right; }
.roster-name { flex: none; max-width: none; overflow: visible; text-overflow: clip; }
/* 档位徽标是赛尔号特有元素，保持克制的小尺寸，不影响整行字号 */
.roster-tier { font-size: 10px; font-weight: 800; padding: 2px 5px; border-radius: 3px;
  min-width: 2.4em; text-align: center; flex: none; }
.roster-evo  { font-size: 10px; color: var(--text-mute); }
.roster-evo.ready { color: #7ff0b0; font-weight: 700; }

/* 开局候选：外层只做选中态，内层走王者 .roster-row */
.cand { display: block; width: 100%; padding: 0; background: none; border: 1.5px solid transparent;
  border-radius: 4px; text-align: left; cursor: pointer; }
.cand.sel { border-color: var(--gold); box-shadow: 0 0 10px rgba(56,182,255,.25); }
.cand .roster-row { border-left-width: 3px; }
.cand.sel .roster-row { border-left-color: var(--gold); }
.cand-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }


/* ============================================================
 * 游戏页 HUD（第一行模拟点进度条 + 第二行三卡）
 * 结构搬自鬼灭之刃模拟器，配色改用赛尔号的深空蓝体系
 * ============================================================ */
.attr-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }

.stamina-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-left: 2px solid var(--gold);
  border-radius: 4px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.stamina-name { font-size: 12px; color: var(--gold); letter-spacing: 1px; white-space: nowrap; font-weight: 700; }
.stamina-bar {
  flex: 1; min-width: 0; height: 12px; border-radius: 6px;
  background: var(--bg-deep); border: 1px solid var(--line-soft); overflow: hidden;
}
.stamina-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold) 60%, var(--teal));
  box-shadow: 0 0 10px rgba(56,182,255,.45);
  transition: width .25s ease;
}
.stamina-val { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--gold-bright); white-space: nowrap; font-weight: 700; }
.attr-grid-inner { display: grid; gap: 8px; width: 100%; }
.attr-grid-inner.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }


/* ---------- 收服页替换项：未选中一律灰，选中才升绿降红 ---------- */
.swap-row .roster-row { border-color: transparent; border-left: 3px solid var(--line); }
.swap-row.sel   .roster-row { border-color: var(--gold); border-left-color: var(--gold); box-shadow: 0 0 0 2px rgba(56,182,255,.30); }
.swap-row.sel.up   .roster-row { border-color: #2f9e6e; border-left-color: #2f9e6e; box-shadow: 0 0 0 2px rgba(47,158,110,.28); }
.swap-row.sel.down .roster-row { border-color: #a3302a; border-left-color: #a3302a; box-shadow: 0 0 0 2px rgba(163,48,42,.28); }


/* ============================================================
 * 收服页替换项 · 定稿
 *   未选中 = 整行灰；选中 = 战力提升绿 / 下降红
 *   （用 > 子选择器 + !important，确保压过王者 .roster-row 自带的金色左边框）
 * ============================================================ */
.swap-row { display: block; width: 100%; padding: 0; background: none; border: none; cursor: pointer; }
.swap-row > .roster-row {
  border: 1px solid var(--line-soft) !important;
  border-left: 3px solid var(--line) !important;
  background: linear-gradient(90deg, rgba(35,42,48,.92), rgba(27,31,36,.72)) !important;
  box-shadow: none !important;
}
.swap-row.sel > .roster-row {
  border-color: var(--gold) !important;
  border-left-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(56,182,255,.30) !important;
}
.swap-row.sel.up > .roster-row {
  border-color: #2f9e6e !important;
  border-left-color: #2f9e6e !important;
  box-shadow: 0 0 0 2px rgba(47,158,110,.32) !important;
}
.swap-row.sel.down > .roster-row {
  border-color: #a3302a !important;
  border-left-color: #a3302a !important;
  box-shadow: 0 0 0 2px rgba(163,48,42,.32) !important;
}
.swap-row:active > .roster-row { filter: brightness(1.2); }

/* 未选中的确认按钮：灰色禁用 */
.dlg-btns .btn:disabled { opacity: .45; filter: grayscale(1); cursor: not-allowed; }


/* ============================================================
 * 王者转会期 .t-attr 里的行内元素类（补齐）+ 遭遇弹窗定稿
 * ============================================================ */
.t-tier { flex: none; font-size: 10px; font-weight: 800; padding: 2px 5px; border-radius: 3px;
  min-width: 2.4em; text-align: center; background: var(--panel-3); color: var(--text-dim); }
.t-tier.t1  { background: rgba(112,124,136,.26); color: #8592a0; }
.t-tier.t2  { background: rgba(170,182,194,.26); color: #b9c6d2; }
.t-tier.t3  { background: rgba(110,222,152,.22); color: #8ce9b6; }
.t-tier.t4  { background: rgba(52,186,104,.26);  color: #57d68c; }
.t-tier.t5  { background: rgba(122,212,246,.24); color: #93ddff; }
.t-tier.t6  { background: rgba(72,138,255,.28);  color: #7dacff; }
.t-tier.t7  { background: rgba(168,108,255,.28); color: #bf92ff; }
.t-tier.t8  { background: linear-gradient(135deg, #b8901f, #ffd75e); color: #2a1e04; }
.t-tier.t9  { background: linear-gradient(135deg, #9c1414, #ff3b3b); color: #fff2f2; }
.t-tier.t10 { background: linear-gradient(90deg, #ff4d4d, #ffb84d, #ffe94d, #5ee08a, #4dc3ff, #a17dff, #ff6ee0, #ff4d4d);
  background-size: 300% 100%; animation: rainbowShift 3s linear infinite; color: #0a1420; font-weight: 900; }
.t-name { flex: none; color: var(--gold-bright); font-weight: 700; font-size: 13px; }
.t-kv { flex: none; color: var(--text-dim); font-size: 12px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.t-kv b { color: var(--text); font-weight: 700; }

/* 遭遇弹窗：用王者的 transfer-box 宽度与滚动区 */
.battle-box, .catch-box { width: 350px; max-width: 92vw; }
#battle-body, #catch-body { width: 100%; max-height: 56vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#battle-body .t-attr, #catch-body .t-attr { border-left-color: var(--gold); background: rgba(56,182,255,.06); }
.t-btn { display: inline-flex; align-items: center; }

/* 六维明细：换行显示，并给一点区分色 */
.t-attr .t-six { color: var(--text-mute); border-left: 1px solid var(--line-soft); padding-left: 7px; }
.t-attr .t-six b { color: var(--teal); }

/* 遭遇弹框描述行（照宝可梦 decision-info） */
.enc-line { width: 100%; font-size: 13px; line-height: 1.7; color: var(--text); text-align: center; }
.enc-line.dim { color: var(--text-dim); font-size: 12.5px; font-family: var(--mono); }
#battle-body { max-height: none; display: flex; flex-direction: column; gap: 6px; }


/* ============ 日志条目：补齐我用到、而王者没有的档位色 ============ */
.log-item.ev1 { background: rgba(61,155,214,.14); border-color: rgba(61,155,214,.45); border-left-color: rgba(61,155,214,.9); color: #bcd8f0; }
.log-item.ev3 { background: rgba(200,170,110,.15); border-color: rgba(200,170,110,.5); border-left-color: rgba(200,170,110,.9); color: #ffe9bd; }
.log-item.ev4 { background: rgba(200,40,31,.16); border-color: rgba(200,40,31,.52); border-left-color: rgba(200,40,31,.9); color: #ffb0b8; }
.log-item.year { color: var(--text-dim); }
.log-item.rb { color: #ffd9a0; }

/* 收服弹框的小节标题：居中加粗 */
.catch-sec { text-align: center; font-weight: 700; color: var(--text); font-size: 13px; margin: 10px 0 6px; }
/* 替换行：禁止换行、由 JS 自适应缩字号 */
.swap-row .roster-row { white-space: nowrap; overflow: hidden; }
