/* ============================================================
 * 宝可梦模拟器进化版 · 样式（移动优先，兼容电脑 480px 容器）
 * 主题：深色科技 / 训练家终端 ── 墨蓝底 + 青蓝霓虹 + 数据面板
 * 背景使用纯色（长列表滚动不出现上下分层）；网格与辉光是 fixed，不参与滚动
 * ============================================================ */
[hidden] { display: none !important; }

:root {
  --bg:        #05080f;
  --bg-deep:   #03060b;
  --panel:     #0a1120;
  --panel-2:   #0d1830;
  --panel-3:   #101d36;
  --line:      #16304d;
  --line-soft: #102238;
  --cyan:      #38e8ff;
  --cyan-dim:  #1d86a0;
  --blue:      #2f7dff;
  --amber:     #ffc247;
  --danger:    #ff4d5e;
  --text:      #cfe4f5;
  --text-dim:  #7b93ad;
  --text-mute: #4a6079;
  --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,232,255,.10), transparent 62%),
    radial-gradient(120% 70% at 50% 110%, rgba(47,125,255,.09), transparent 66%),
    repeating-linear-gradient(0deg, rgba(56,232,255,.045) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(56,232,255,.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: 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(--cyan);
  background: linear-gradient(180deg, #1a5f74, #0b2b38);
  color: #d6f8ff;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(56,232,255,.28), inset 0 0 14px rgba(56,232,255,.14);
  text-shadow: 0 0 8px rgba(56,232,255,.55);
}
.btn-big { width: 100%; padding: 14px 20px; font-size: 17px; }
.btn-danger { border-color: #5a1f2a; color: #ff97a2; }
.btn-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 首页 ---------- */
#view-home { justify-content: center; gap: 12px; }
.home-hero { text-align: center; margin-top: -16px; }
.home-title {
  margin: 0;
  font-size: 31px;
  letter-spacing: 3px;
  white-space: nowrap;
  background: linear-gradient(180deg, #eafcff, var(--cyan) 52%, #16707f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(56,232,255,.45));
}
.home-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 6px; letter-spacing: .5px; }
.home-count {
  background: rgba(56,232,255,.06);
  border: 1px solid rgba(56,232,255,.28);
  border-radius: 3px;
  padding: 8px 14px;
  color: var(--cyan);
  font-size: 12px;
  white-space: nowrap;
  font-family: var(--mono);
}
.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(--cyan);
  border-radius: 4px;
  padding: 12px 16px;
}
.lv-head { display: flex; align-items: center; gap: 8px; }
.lv-name { color: var(--text-dim); font-size: 13px; }
.lv-lv { color: #d6f8ff; font-size: 16px; font-weight: 700; font-family: var(--mono); }
.lv-bonus { color: var(--cyan); font-size: 11px; white-space: nowrap; margin-left: 4px; font-family: var(--mono); }
.lv-exp-line { margin-top: 7px; color: var(--text-mute); font-size: 12px; text-align: center; font-family: var(--mono); }
/* 经验条：轨道比卡片底色更暗，看得出「满」在哪 */
.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, #16707f, var(--cyan));
  box-shadow: 0 0 10px rgba(56,232,255,.6);
  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-radius: 4px; padding: 12px 14px; }
.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(--cyan);
  border-radius: 4px;
  padding: 16px;
  font-size: 14px;
  line-height: 2;
  color: #a9c2d8;
}
.about-text b { color: var(--cyan); }
.home-sound { width: 100%; display: flex; justify-content: center; margin-top: 4px; }
.btn-sound {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-sound:active { transform: scale(.92); filter: brightness(1.25); }
.home-speed {
  width: 100%;
  max-width: 260px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 14px;
}
.speed-label { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: 13px; }
.speed-label b { color: var(--cyan); font-family: var(--mono); }
.speed-range { width: 100%; margin-top: 6px; accent-color: var(--cyan); }
.home-tip {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 4px;
}
.tip-title { color: var(--cyan); font-size: 13px; margin-bottom: 6px; letter-spacing: 2px; text-align: center; }
.tip-text { color: var(--text-dim); font-size: 12px; line-height: 1.8; text-align: left; }
.qr-area { width: 100%; text-align: center; margin-top: 10px; }
.qr-text { color: var(--text-mute); 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: #a9c2d8; }
.set-label2 { font-size: 15px; color: #a9c2d8; margin-bottom: 8px; }
.set-select {
  width: 100%;
  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(--cyan) 50%), linear-gradient(135deg, var(--cyan) 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: #10424f; border-color: var(--cyan); }
.set-switch input:checked + .track::after { transform: translateX(22px); background: var(--cyan); box-shadow: 0 0 10px rgba(56,232,255,.8); }

/* ---------- 游戏 ---------- */
#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: 19px;
  letter-spacing: 2px;
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
  padding: 0 46px;
  overflow: hidden;
  text-align: center;
  text-shadow: 0 0 12px rgba(56,232,255,.45);
}
.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(--cyan);
  font-size: 17px;
  cursor: pointer;
}
.btn-pause:active { transform: scale(.94); }

.attr-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
/* 宝可梦战力 / 总战力 / 评级：三张各占 1/3 */
.attr-grid3 { grid-template-columns: repeat(3, 1fr); }
.attr-card {
  background: linear-gradient(180deg, rgba(13,24,48,.92), rgba(10,17,32,.92));
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.attr-name { color: var(--text-mute); font-size: 11.5px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attr-rank { color: var(--cyan); font-weight: 700; font-size: 12px; }
.attr-val {
  color: #d6f8ff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  font-family: var(--mono);
  text-shadow: 0 0 10px rgba(56,232,255,.3);
}
.attr-coef { color: #d6f8ff; font-size: 19px; }
.attr-sub { color: var(--text-dim); font-size: 12px; }

/* 收服栏 / 挑战栏（游戏页属性区下）：已收服的宝可梦与已通关的挑战，同一行 */
.huan-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(10,17,32,.82);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 20px;
  max-height: 96px;
  overflow-y: auto;
}
.huan-label { color: var(--text-mute); font-size: 12px; margin-right: 2px; }
.huan-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 3px;
  font-size: 10px; font-weight: 700; padding: 0 6px; line-height: 1;
}
/* 档位配色：F→EX 由灰蓝渐入皮卡丘黄，最后落在宝可梦红（沿用旧版配色，十档一眼可分） */
.hc-t1  { background: #3b4250; color: #dfe6ef; }                              /* F */
.hc-t2  { background: #3f6f9e; color: #e8f3ff; }                              /* E */
.hc-t3  { background: #2f8f8a; color: #e6fffd; }                              /* D */
.hc-t4  { background: #2f9e5e; color: #eafff2; }                              /* C */
.hc-t5  { background: #7aa03c; color: #f6ffe8; }                              /* B */
.hc-t6  { background: #c9a227; color: #fff8dd; }                              /* A */
.hc-t7  { background: #dba800; color: #fff4d6; }                              /* S */
.hc-t8  { background: #f7c600; color: #2a2200; }                              /* SS */
.hc-t9  { background: #f0621f; color: #fff2e0; }                              /* SSS */
.hc-t10 { background: #ee1515; color: #ffe6e6; box-shadow: 0 0 8px rgba(238,21,21,.7); } /* EX */
/* 初始宝可梦胶囊：档位底色 + 青色描边，与后续收服的伙伴区分开 */
.init-chip { box-shadow: inset 0 0 0 1px rgba(56,232,255,.9); }
.settle-huan { justify-content: center; margin-top: 10px; }

.log-box {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(6,11,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(16,29,54,.55);
  color: #a9c2d8;
}
.log-item.year{ background: rgba(16,29,54,.25); color: var(--text-mute); font-size: 12.5px; }
.log-item.brk { background: rgba(56,232,255,.08); border-left-color: var(--cyan); color: #cdf6ff; }
.log-item.ev1 { background: rgba(90,130,150,.12); border-left-color: #4a7d96; color: #b6c8d6; }
.log-item.ev2 { background: rgba(80,120,200,.12); border-left-color: #4a6fc4; color: #c6d6f4; }
.log-item.ev3 { background: rgba(140,110,190,.14); border-left-color: #8a72c8; color: #dcccf6; }
.log-item.ev4 { background: rgba(255,77,94,.13); border-left-color: var(--danger); color: #ffbcc3; }
.log-item.huan{ background: rgba(150,90,200,.18); border-left-color: #a06bd4; color: #e0c8ff; }  /* 战斗与脱身结果：幽紫 */
.log-item.rare{ background: rgba(56,232,255,.10); border-left-color: var(--cyan-dim); color: #bfeaf6; }
.log-item.red {
  background: rgba(255,77,94,.14);
  border-left-color: var(--danger);
  color: #ff9aa5;
  font-weight: 700;
}
.log-item.rainbow {
  background: linear-gradient(90deg, rgba(255,77,94,.22), rgba(255,194,71,.22), rgba(56,232,255,.22), rgba(47,125,255,.22));
  background-size: 400% 100%;
  border-left-color: #d6f8ff;
  color: #eafcff;
  font-weight: 700;
  animation: rainbowShift 1.4s linear infinite;
}
@keyframes rainbowShift { 0% { background-position: 0% 0; } 100% { background-position: 400% 0; } }
/* 金色：进化与终局夺冠 */
.log-item.god {
  background: linear-gradient(90deg, rgba(255,194,71,.20), rgba(255,236,180,.10));
  border-left-color: var(--amber);
  color: #fff0c8;
  font-weight: 700;
  box-shadow: inset 0 0 18px rgba(255,194,71,.16);
}
.log-item.dead{ background: rgba(90,31,42,.22); border-left-color: #7a2a38; color: #ffa8b2; }

/* ---------- 选择人物卡 ---------- */
#view-card { justify-content: flex-start; }
.card-note {
  width: calc(100% - 28px);
  margin: 10px 14px 0;
  text-align: center;
  color: var(--amber);
  font-size: 12.5px;
  background: rgba(255,194,71,.08);
  border: 1px solid rgba(255,194,71,.35);
  border-radius: 4px;
  padding: 7px 10px;
}
.card-body { width: 100%; padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); }
.card-list { display: flex; flex-direction: column; gap: 12px; }
.pcard {
  position: relative;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-left: 2px solid var(--cyan);
  border-radius: 4px;
  padding: 12px 14px 12px 16px;
  color: var(--text);
  font-family: inherit;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.pcard:active { transform: scale(.99); border-color: var(--cyan); filter: brightness(1.18); }
.pcard-no { color: var(--cyan); font-size: 12px; letter-spacing: 2px; font-family: var(--mono); }
.pcard-attrs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 9px; }
.pcard-attr { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pcard-attr span { color: var(--text-mute); font-size: 11px; }
.pcard-attr b { color: #d6f8ff; font-size: 20px; font-weight: 700; font-family: var(--mono); line-height: 1.15; }
.pcard-pk {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.pcard-pk-name { color: var(--text); font-size: 15px; font-weight: 700; }
.pcard-pk-power { color: var(--amber); font-size: 13px; font-family: var(--mono); white-space: nowrap; }

/* ---------- 结算 ---------- */
#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(--cyan);
  border-radius: 4px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settle-title { text-align: center; font-size: 22px; font-weight: 700; color: #d6f8ff; }
.settle-title.god { color: #fff3cc; text-shadow: 0 0 24px rgba(255,194,71,.75); }
.settle-wuhun { text-align: center; color: var(--text-dim); font-size: 13.5px; }
.settle-wuhun b { color: var(--cyan); }
.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-mute); }
.s-row b { color: #d6f8ff; font-family: var(--mono); }
.settle-god {
  text-align: center;
  font-size: 14px;
  color: #fff0c8;
  background: linear-gradient(180deg, rgba(255,194,71,.16), rgba(255,194,71,.04));
  border: 1px solid rgba(255,194,71,.45);
  border-radius: 4px;
  padding: 10px;
  letter-spacing: 1px;
}
.settle-xinwu { font-size: 12.5px; color: #bfeaf6; line-height: 1.6; text-align: center; }
.settle-rank {
  background: rgba(56,232,255,.06);
  border: 1px solid rgba(56,232,255,.28);
  border-radius: 4px;
  padding: 7px;
  color: var(--cyan);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
.settle-note {
  background: rgba(255,77,94,.08);
  border: 1px solid rgba(255,77,94,.35);
  border-radius: 4px;
  padding: 8px 10px;
  color: #ff9aa5;
  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; }

/* ---------- 子页通用（标题绝对居中，✕ 固定右上角） ---------- */
.page-view { padding: 0 !important; }
.page-head {
  width: 100%;
  position: relative;
  padding: 14px 14px 10px;
  background: rgba(8,14,26,.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(--cyan);
  letter-spacing: 2px;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(56,232,255,.4);
}
.btn-close {
  width: 34px; height: 34px;
  border-radius: 4px;
  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(--cyan); color: var(--cyan); }
.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;
}
.tab.active {
  background: linear-gradient(180deg, #1a5f74, #0b2b38);
  border-color: var(--cyan);
  color: #d6f8ff;
  box-shadow: 0 0 12px rgba(56,232,255,.25);
}
.lb-note { padding: 6px 14px 0; font-size: 12px; color: var(--cyan); width: 100%; font-family: var(--mono); }
.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 {
  display: flex;
  align-items: center;
  gap: 8px;
  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(--cyan) inset; background: rgba(56,232,255,.09); }
.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);
}
.lb-rank.top { background: #1d4a5c; color: #d6f8ff; }
.lb-rank.top.r1 { background: var(--amber); color: #2a1500; }
.lb-rank.top.r2 { background: #9fb6c6; color: #101d36; }
.lb-rank.top.r3 { background: #c98a4a; color: #2a1500; }
.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: #a9c2d8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 15px; font-weight: 700; color: #d6f8ff; flex: none; white-space: nowrap; font-family: var(--mono); }
.lb-time { font-size: 11px; color: var(--text-mute); flex: none; font-family: var(--mono); }

/* ---------- 图鉴 ---------- */
.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,232,255,.16), rgba(56,232,255,.05));
  border: 1px solid rgba(56,232,255,.45);
  color: #d6f8ff;
}
.dex-item.lack {
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  color: #2f3f52;
}

/* ---------- 遮罩层 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(3,6,11,.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(--cyan);
  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,232,255,.07);
}
.mask-title { text-align: center; font-size: 20px; color: var(--cyan); font-weight: 700; letter-spacing: 2px; }
.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; }
.review-log {
  flex: 1;
  min-height: 200px;
  max-height: 55vh;
  overflow-y: auto;
  background: rgba(6,11,20,.9);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #a9c2d8;
  -webkit-overflow-scrolling: touch;
}
.review-log .rv-brk { color: #cdf6ff; }
.review-log .rv-ev1 { color: #b6c8d6; }
.review-log .rv-ev2 { color: #c6d6f4; }
.review-log .rv-ev3 { color: #dcccf6; }
.review-log .rv-ev4 { color: #ffbcc3; }
.review-log .rv-god { color: #fff0c8; font-weight: 700; }
.review-log .rv-dead { color: #ffa8b2; }
.review-log .rv-rare { color: #bfeaf6; }
.review-log .rv-red { color: #ff9aa5; font-weight: 700; }
.review-log .rv-huan { color: #e0c8ff; }
.review-log .rv-rainbow {
  background: linear-gradient(90deg, #ff4d5e, #ffc247, #38e8ff, #2f7dff, #a06bd4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.review-log .rv-year { color: var(--text-mute); }

/* ---------- 电脑端 ---------- */
@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(--cyan-dim);
  color: var(--cyan);
  margin-bottom: 12px;
  font-size: 14px;
  padding: 12px 16px;
}
.follow-box { width: 350px; max-width: 90vw; max-height: 86vh; overflow-y: auto; }
.follow-rows { display: flex; flex-direction: column; gap: 10px; }
.follow-video { color: #bfeaf6; font-size: 12px; margin: 4px 0 0; text-align: left; line-height: 1.5; }
.follow-action { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 13px 16px; font-size: 14px; }
.fb-state { font-size: 13px; }
.fb-state.done { color: var(--cyan); }
.fb-state.todo { color: var(--text-mute); }
.fb-total { font-size: 15px; color: var(--cyan); font-weight: 700; }

/* ---------- 成就系统 ---------- */
.home-ach-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.ach-tip { text-align: center; color: var(--cyan); font-size: 12px; margin-bottom: 12px; }
.ach-total {
  text-align: center; color: var(--cyan); font-size: 16px; font-weight: 700;
  margin: 6px 14px 10px; padding: 9px;
  width: calc(100% - 28px);
  background: rgba(56,232,255,.06);
  border: 1px solid rgba(56,232,255,.28);
  border-radius: 4px;
  font-family: var(--mono);
}
.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-thumb { background: var(--cyan-dim); }
.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));
}
.ach-item.done {
  border-color: var(--cyan-dim);
  background: linear-gradient(180deg, #10233c, var(--panel));
  box-shadow: 0 0 16px rgba(56,232,255,.12);
}
.ach-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ach-item.done .ach-name { color: #d6f8ff; }
.ach-item.todo .ach-name { color: var(--text-mute); }
.ach-bonus { font-size: 13px; white-space: nowrap; font-family: var(--mono); }
.ach-item.done .ach-bonus { color: var(--cyan); }
.ach-item.todo .ach-bonus { color: #2f3f52; }

/* ---------- 成就达成面包屑提示 ---------- */
.ach-toast {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99;
  text-align: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #1a5f74, #07222c);
  border-bottom: 1px solid var(--cyan);
  color: #d6f8ff;
  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);
}
.ach-toast.show { transform: translateY(0); }

/* 成就按钮：标题+小字两行居中 */
#btn-ach { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 9px 14px; }
#btn-ach > span:first-child { font-size: 17px; line-height: 1.3; }
.ach-btn-tip { font-size: 10px; color: var(--cyan); white-space: nowrap; }

/* ---------- 手动模式 ---------- */
.manual-tip {
  width: 100%;
  text-align: center;
  color: var(--cyan);
  font-size: 13px;
  padding: 6px 0 2px;
}
.set-tip { margin-top: 6px; color: var(--text-mute); font-size: 12px; line-height: 1.6; }

/* ---------- 遭遇野生宝可梦弹窗（可拖动、可收起） ---------- */
#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;
}
.decision-x:active { transform: scale(.9); }
.decision-tip { text-align: center; color: var(--text-mute); font-size: 11px; line-height: 1.5; }
/* 信息单行不折行（超宽由脚本缩字号适配） */
.decision-info { text-align: center; color: var(--text); font-size: 15px; line-height: 1.6; white-space: nowrap; font-family: var(--mono); }
.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;
  font-weight: 700;
}
/* 迎战：红；撤离：琥珀 */
.opt-fight { border: 1px solid #ff4d5e; background: linear-gradient(180deg, #a3283a, #5a1522); color: #ffe4e8; box-shadow: 0 0 14px rgba(255,77,94,.25); }
.opt-flee  { border: 1px solid var(--amber); background: linear-gradient(180deg, #6b4a12, #3a2807); color: #ffe9bd; box-shadow: 0 0 14px rgba(255,194,71,.22); }
/* 首页 高光+保底 双按钮同排各占 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(--cyan); white-space: nowrap; }
#btn-guard.on {
  border-color: var(--amber);
  background: linear-gradient(180deg, #2a2410, var(--panel));
  box-shadow: 0 0 18px rgba(255,194,71,.28);
}
#btn-guard.on .ach-btn-tip { color: var(--amber); }

/* 高光列表 / 图片预览 / toast */
.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(--cyan-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(--cyan); }
.hl-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hl-top b { color: #d6f8ff; font-size: 14.5px; }
.hl-innate { color: var(--amber); font-size: 11.5px; }
.hl-sect { color: var(--cyan); font-size: 11.5px; }
.hl-end { margin-left: auto; color: #ff9aa5; 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: #d6f8ff; font-family: var(--mono); }
.hl-ring { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hl-ring .huan-chip { min-width: 16px; height: 15px; border-radius: 3px; font-size: 9px; padding: 0 5px; }
.hl-ring-cap { color: var(--text-mute); font-size: 9.5px; margin-right: 2px; }
/* 结算卡预览：图片限制在视口内（生成图很高，按宽度等比缩放会撑出屏幕把按钮顶飞） */
#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-deep); 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: #0e3d4b; border: 1px solid var(--cyan); color: #d6f8ff;
  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,232,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(13,24,48,.85); border-radius: 3px; padding: 6px 10px; text-align: left; color: #a9c2d8; font-size: 13px; line-height: 1.6; }
.guard-row b { color: #d6f8ff; }
.guard-pts { text-align: center; color: var(--cyan); font-size: 15px; font-weight: 700; }
.guard-pts b { color: #d6f8ff; font-size: 18px; font-family: var(--mono); }

/* 遭遇收起后底部召唤按钮 */
.decision-recall {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 70;
  border: 1px solid var(--cyan);
  background: linear-gradient(180deg, #1a5f74, #0b2b38);
  color: #d6f8ff;
  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,232,255,.22);
}
.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; }
.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;
}
