/* ============================================================
 * 奥特曼模拟器 · 样式（移动优先，兼容电脑 480px 容器）
 * 主题：深空蓝黑 + 银白 + 奥特曼红 + 能量青
 * （事件/对决仍保留金、红、七彩的语义色，与旧版一致）
 * ============================================================ */
[hidden] { display: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: #05070d;
  color: #e6ecf5;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100%;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(180deg, #0d1626 0%, #070c16 40%, #04060b 100%);
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  width: 480px; max-width: 100%;
  height: 100%;
  transform: translateX(-50%);
  background:
    radial-gradient(1px 1px at 20% 15%, rgba(160,225,255,.55), transparent),
    radial-gradient(1px 1px at 80% 30%, rgba(200,215,235,.5), transparent),
    radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,140,140,.45), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(160,225,255,.4), transparent);
  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 #2f3f5c;
  background: linear-gradient(180deg, #1b263a, #131b2b);
  color: #e6ecf5;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); filter: brightness(1.15); }
.btn-primary {
  border: 1px solid #b62a2a;
  background: linear-gradient(180deg, #e03a3a, #b62a2a);
  color: #fff6f6;
  font-weight: 700;
}
.btn-big { width: 100%; padding: 14px 20px; font-size: 17px; border-radius: 12px; }
.btn-danger { border-color: #7a2f2f; color: #ffb3b3; }
.btn-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #2f3f5c;
  background: linear-gradient(180deg, #1b263a, #131b2b);
  color: #e6ecf5;
  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: 34px;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #ffffff, #7fe3f5 45%, #e03a3a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(79,209,224,.25);
}
.home-sub { color: #93a2ba; font-size: 13px; margin-top: 4px; letter-spacing: 1px; }
.home-count {
  background: rgba(79,209,224,.08);
  border: 1px solid rgba(79,209,224,.25);
  border-radius: 20px;
  padding: 8px 14px;
  color: #ff8a8a;
  font-size: 12px;
  white-space: nowrap;   /* 人数不换行，缩小字体 */
}
.home-count b { font-size: 13px; }
.home-lv {
  width: 100%;
  background: rgba(16,24,40,.85);
  border: 1px solid #2f3f5c;
  border-radius: 12px;
  padding: 12px 16px;
}
.lv-head { display: flex; align-items: center; gap: 8px; }
.lv-name { color: #8895ab; font-size: 13px; }
.lv-lv { color: #f2f6fc; font-size: 16px; font-weight: 700; }
.lv-bonus { color: #ff9e6b; font-size: 11px; margin-left: 4px; }
.lv-exp-line { margin-top: 7px; color: #93a2ba; font-size: 12px; text-align: center; }
.lv-bar { height: 10px; background: #1d2740; border-radius: 5px; overflow: hidden; margin-top: 8px; }
.lv-bar-fill { height: 100%; background: linear-gradient(90deg, #35b6cc, #7fe3f5); border-radius: 5px; 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 1fr; gap: 8px; }
.home-link-btns .btn { font-size: 13px; padding: 10px 4px; white-space: nowrap; overflow: hidden; }
.settings-body { width: 100%; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.set-card { background: rgba(16,24,40,.85); border: 1px solid #2f3f5c; border-radius: 12px; 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: rgba(16,24,40,.85);
  border: 1px solid #2f3f5c;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 2;
  color: #d3dcea;
}
.about-text b { color: #7fe3f5; }
.home-sound { width: 100%; display: flex; justify-content: center; margin-top: 4px; }
.btn-sound {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid #2f3f5c;
  background: linear-gradient(180deg, #1b263a, #131b2b);
  color: #e6ecf5;
  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.2); }
.home-speed {
  width: 100%;
  max-width: 260px;
  background: rgba(16,24,40,.85);
  border: 1px solid #2f3f5c;
  border-radius: 12px;
  padding: 8px 14px;
}
.speed-label { display: flex; justify-content: space-between; align-items: center; color: #8895ab; font-size: 13px; }
.speed-label b { color: #7fe3f5; }
.speed-range { width: 100%; margin-top: 6px; accent-color: #e03a3a; }
.home-tip {
  width: 100%;
  background: rgba(16,24,40,.8);
  border: 1px solid #22304a;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}
.tip-title { color: #7fe3f5; font-size: 13px; margin-bottom: 6px; letter-spacing: 2px; text-align: center; }
.tip-text { color: #8895ab; font-size: 12px; line-height: 1.8; text-align: left; }
.qr-area { width: 100%; text-align: center; margin-top: 10px; }
.qr-text { color: #93a2ba; font-size: 12.5px; margin-bottom: 6px; }
.qr-img { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 5px; }

/* ---------- 开关 ---------- */
.set-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.set-label { font-size: 15px; color: #d3dcea; }
.set-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.set-switch input { opacity: 0; width: 0; height: 0; }
.track {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: #22304a;
  border: 1px solid #2f3f5c;
  border-radius: 13px;
  transition: background .2s;
}
.track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #8895ab;
  transition: transform .2s, background .2s;
}
.set-switch input:checked + .track { background: #e03a3a; border-color: #e03a3a; }
.set-switch input:checked + .track::after { transform: translateX(22px); background: #fff; }

/* ---------- 游戏 ---------- */
#view-game { padding-top: 0; padding-bottom: 20px; }
.game-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 14px 8px 6px;
}
.game-title {
  font-size: 20px;
  letter-spacing: 4px;
  color: #7fe3f5;
  font-weight: 700;
}
.btn-pause {
  position: absolute;
  right: 4px; top: 12px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid #2f3f5c;
  background: linear-gradient(180deg, #1b263a, #131b2b);
  color: #e6ecf5;
  font-size: 17px;
  cursor: pointer;
}
.btn-pause:active { transform: scale(.94); }

.attr-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
/* 行内三卡网格（480px 容器下每卡 ≈140px，字号由 fitAttrVal 自动收缩到放得下） */
.attr-grid-inner { display: grid; gap: 10px; width: 100%; }
.attr-grid-inner.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 光进度条（对局页第一行） ---------- */
.stamina-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(27,38,58,.92), rgba(14,20,33,.92));
  border: 1px solid #2f3f5c;
  border-radius: 12px;
}
.stamina-name { font-size: 12px; color: #7fe3f5; letter-spacing: 1px; white-space: nowrap; font-weight: 700; }
.stamina-bar { flex: 1; min-width: 0; height: 12px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.stamina-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #2a6f8f, #7fe3f5);
  box-shadow: 0 0 10px rgba(79,209,224,.55);
  transition: width .25s ease;
}
.stamina-val { font-size: 13px; font-variant-numeric: tabular-nums; color: #f2f6fc; white-space: nowrap; font-weight: 700; }
.attr-card {
  background: linear-gradient(180deg, rgba(23,33,52,.9), rgba(14,21,35,.9));
  border: 1px solid #2f3f5c;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.attr-name { color: #8895ab; font-size: 12px; letter-spacing: 1px; }
.attr-rank { color: #7fe3f5; font-weight: 700; font-size: 12.5px; }
.attr-val { color: #f2f6fc; font-size: 26px; font-weight: 700; white-space: nowrap; }
.attr-sub { color: #7d8ba0; font-size: 12px; }
.attr-wuhun { grid-column: 1 / -1; }
.attr-wuhun-name { color: #f2f6fc; font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.attr-innate-line { color: #7fe3f5; font-size: 13px; margin-top: 2px; }
.attr-innate-line b { color: #ff9e6b; }

.log-box {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(6,10,18,.7);
  border: 1px solid #22304a;
  border-radius: 12px;
  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: 8px;
  background: rgba(26,36,56,.4);
  color: #d3dcea;
}
.log-item.year{ background: rgba(26,36,56,.18); color: #93a2ba; font-size: 12.5px; }
.log-item.brk { background: rgba(76,175,80,.14); border: 1px solid rgba(76,175,80,.4); color: #a5d6a7; }
.log-item.ev1 { background: rgba(110,150,220,.12); border: 1px solid rgba(110,150,220,.3); color: #c9d7f0; }
.log-item.ev2 { background: rgba(180,120,220,.12); border: 1px solid rgba(180,120,220,.35); color: #e0c9f5; }
.log-item.ev3 { background: rgba(212,175,55,.14); border: 1px solid rgba(212,175,55,.4); color: #ffe9a8; }
.log-item.ev4 { background: rgba(230,80,80,.16); border: 1px solid rgba(230,80,80,.45); color: #ffb3b3; }
.log-item.move{ background: rgba(198,40,40,.22); border: 1px solid rgba(240,90,90,.6); color: #ffc4c4; font-weight: 700; }  /* 兜底色：红 */
.log-item.rare{ background: rgba(255,150,80,.14); border: 1px solid rgba(255,150,80,.35); color: #ffc59a; }
.log-item.red {
  background: rgba(255,50,50,.16);
  border: 1px solid rgba(255,60,60,.5);
  color: #ff8a8a;
  font-weight: 700;
}
.log-item.rainbow {
  background: linear-gradient(90deg, rgba(255,90,90,.28), rgba(255,200,80,.28), rgba(110,220,120,.28), rgba(90,160,255,.28), rgba(180,120,255,.28));
  background-size: 400% 100%;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-weight: 700;
  animation: rainbowShift 1.2s linear infinite;
}
@keyframes rainbowShift { 0% { background-position: 0% 0; } 100% { background-position: 400% 0; } }
.log-item.god { background: rgba(127,227,245,.18); border: 1px solid rgba(127,227,245,.5); color: #f5ffff; font-weight: 700; }
.log-item.dead{ background: rgba(180,60,60,.15); border: 1px solid rgba(180,60,60,.4); color: #ffb3b3; }

/* ---------- 结算（紧凑，无滚动条） ---------- */
#view-settle { justify-content: center; padding-top: 8px; padding-bottom: 8px; }
.settle-box {
  width: 100%;
  background: rgba(16,24,40,.85);
  border: 1px solid #2f3f5c;
  border-radius: 16px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settle-title { text-align: center; font-size: 22px; font-weight: 700; color: #f2f6fc; }
.settle-title.god { color: #f5ffff; text-shadow: 0 0 24px rgba(127,227,245,.6); }
.settle-breath { text-align: center; color: #93a2ba; font-size: 13.5px; }
.settle-breath b { color: #ffc59a; }
.settle-rows { display: flex; flex-direction: column; }
.s-row {
  display: flex; justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed #22304a;
  font-size: 14px;
}
.s-row:last-child { border-bottom: none; }
.s-row span { color: #8895ab; }
.s-row b { color: #e6ecf5; }
.settle-god {
  text-align: center;
  font-size: 14px;
  color: #f5ffff;
  background: linear-gradient(180deg, rgba(127,227,245,.24), rgba(127,227,245,.08));
  border: 1px solid rgba(127,227,245,.55);
  border-radius: 10px;
  padding: 10px;
  letter-spacing: 1px;
}
.settle-weak { font-size: 12.5px; color: #ffc59a; line-height: 1.6; text-align: center; }
.settle-weak.warn { color: #ff8a8a; font-weight: 700; }
.settle-rank {
  background: rgba(79,209,224,.08);
  border: 1px solid rgba(79,209,224,.25);
  border-radius: 10px;
  padding: 7px;
  color: #7fe3f5;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
/* 榜单名次加成说明条（排行榜页顶部） */
#rank-fate-note { color: #7fe3f5; padding-bottom: 2px; }
/* 设置页下拉（遭遇策略 / 决战策略） */
.set-select {
  flex: none;
  background: #131b2b;
  color: #e6ecf5;
  border: 1px solid #2f3f5c;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  max-width: 60%;
}
.set-select:focus { outline: none; border-color: #e03a3a; }
.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: 10px; }

/* ---------- 排行榜（页头 + 三层 tab + 卡片式列表） ---------- */
.page-view { padding: 0 !important; }
.page-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  background: #0d1626;
  border-bottom: 1px solid #22304a;
  position: sticky;
  top: 0;
  z-index: 5;
}
.page-title { flex: 1; text-align: center; font-size: 19px; color: #7fe3f5; margin: 0; letter-spacing: 2px; }
.btn-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #2f3f5c;
  background: #1d2740;
  color: #93a2ba;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.btn-close:active { transform: scale(.92); }
.tabs { display: flex; gap: 8px; padding: 10px 14px 4px; width: 100%; }
.tabs-wrap { flex-wrap: wrap; row-gap: 6px; }
.tabs-wrap .tab { flex: 0 0 calc(20% - 7px); }
.tabs-small { padding-top: 4px; }
.tabs-small .tab { font-size: 12px; padding: 6px 0; }
.tab {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 8px 0;
  background: #1d2740;
  color: #8895ab;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active { background: linear-gradient(180deg, #e03a3a, #b62a2a); color: #fff6f6; }
.lb-note { padding: 6px 14px 0; font-size: 12px; color: #7fe3f5; width: 100%; }
.lb-body { padding: 8px 14px 30px; width: 100%; }
.lb-tip { text-align: center; color: #7d8ba0; padding: 30px 0; font-size: 14px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #101828;
  border: 1px solid #22304a;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.lb-row.me { box-shadow: 0 0 0 2px #e03a3a inset; background: rgba(79,209,224,.12); }
.lb-rank {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #22304a;
  color: #8895ab;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
}
.lb-rank.top { background: #f08a1e; color: #fff; }
.lb-rank.top.r1 { background: #ff3b30; }
.lb-rank.top.r2 { background: #ff9500; }
.lb-rank.top.r3 { background: #ffcc00; }
.lb-user { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.lb-name { font-size: 14px; color: #d3dcea; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 15px; font-weight: 700; color: #f2f6fc; flex: none; white-space: nowrap; }
.lb-time { font-size: 11px; color: #7d8ba0; flex: none; }

/* ---------- 暂停遮罩 ---------- */
.mask {
  position: fixed;
  /* ⚠ 不用 inset: 0：老版本 WebView / 部分手机浏览器不认这个简写，
   *   会让遮罩撑不开、弹窗定位与尺寸全乱。四向写法等价且兼容性更好。 */
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4,8,16,.72);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mask-box {
  width: 300px;
  max-width: 86vw;
  background: #0d1626;
  border: 1px solid #2f3f5c;
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.mask-title { text-align: center; font-size: 20px; color: #7fe3f5; font-weight: 700; letter-spacing: 2px; }
.mask-info { text-align: center; color: #93a2ba; font-size: 13px; }
.mask-box .set-row { justify-content: center; padding: 4px 0; }

/* ---------- 遭遇怪兽弹窗（可拖动、可收起）----------
 * 结构与类名照搬《综武模拟器》的 decision-* 一套，只换配色。
 * ⚠ 卡片样式**写全在 .decision-box 上**（背景/边框/圆角/内边距/阴影不再依赖 .mask-box）：
 *   之前只写 width、其余靠 .mask-box 提供，实际运行时卡片变成了无底无边的裸框。 */
#decision-mask { align-items: flex-start; padding-top: 7vh; }
.decision-box {
  width: 330px;
  max-width: 90vw;
  background: #0d1626;
  border: 1px solid #2f3f5c;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  position: relative;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.decision-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid #2f3f5c;
  background: #131b2b;
  color: #93a2ba;
  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: #6d7b91; font-size: 11px; line-height: 1.5; }
/* 信息单行不折行（超宽由脚本缩字号适配） */
/* ⚠ 字号**恒为 15px 不缩小**，超长就**换行**（用户明确要求）。
 *   不要 white-space: nowrap，也不要 overflow: hidden —— 那会把超长信息裁断。 */
.decision-info { text-align: center; color: #d3dcea; font-size: 15px; line-height: 1.6; word-break: break-all; }
.decision-opts { display: flex; flex-direction: column; gap: 10px; }
/* 选择按钮：字号恒为 15px 不缩小，放不下就换行 */
.decision-opt {
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  word-break: break-all;
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 12px;
}
/* 迎战：金赤；撤离：青绿 */
.opt-fight { border: 1px solid #c9962e; background: linear-gradient(180deg, #f4cf72, #c9962e); color: #3a2a00; }
.opt-flee  { border: 1px solid #a8322a; background: linear-gradient(180deg, #a8e6c8, #c04a3e); color: #12402c; }

/* 遭遇收起后底部召唤按钮 */
.decision-recall {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 70;
  border: 1px solid #b62a2a;
  background: linear-gradient(180deg, #e03a3a, #b62a2a);
  color: #fff6f6;
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.decision-recall:active { transform: translateX(-50%) scale(.96); }

.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,10,18,.7);
  border: 1px solid #22304a;
  border-radius: 10px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #d3dcea;
  -webkit-overflow-scrolling: touch;
}
.review-log .rv-brk { color: #a5d6a7; }
.review-log .rv-ev1 { color: #c9d7f0; }
.review-log .rv-ev2 { color: #e0c9f5; }
.review-log .rv-ev3 { color: #f2f6fc; }
.review-log .rv-ev4 { color: #ffb3b3; }
.review-log .rv-move { color: #ff9a9a; font-weight: 700; }
.review-log .rv-god { color: #f5ffff; font-weight: 700; }
.review-log .rv-dead { color: #ffb3b3; }
.review-log .rv-rare { color: #ffc59a; }
.review-log .rv-red { color: #ff8a8a; font-weight: 700; }
.review-log .rv-rainbow {
  background: linear-gradient(90deg, #ff6b6b, #ffd166, #7be0ad, #5aa9ff, #b488ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.review-log .rv-year { color: #8895ab; }

/* ---------- 电脑端 ---------- */
@media (min-width: 520px) {
  body { background: #060a13; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #2f3f5c; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 高阶天赋增益（点赞/投币/关注） ---------- */
.btn-follow {
  border-color: #b62a2a;
  color: #ff8a8a;
  margin-bottom: 12px;
  font-size: 14px;
  padding: 12px 16px;
}
.follow-box { width: 320px; max-width: 88vw; }
.follow-rows { display: flex; flex-direction: column; gap: 10px; }
.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: #6cdb8a; }
.fb-state.todo { color: #7a86a0; }
.fb-total { font-size: 15px; color: #7fe3f5; font-weight: 700; }

/* ---------- 成就系统 ---------- */
/* 入口两两一行（排行榜|成就 / 图鉴|保底）：两行式小字按钮放得下，字号不缩 */
.home-ach-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.home-ach-row .btn { white-space: nowrap; overflow: hidden; }
.ach-tip { text-align: center; color: #7fe3f5; font-size: 12px; margin-bottom: 12px; }
.ach-total {
  text-align: center; color: #7fe3f5; font-size: 16px; font-weight: 700;
  margin: 6px 14px 10px; padding: 9px;
  width: calc(100% - 28px);
  background: rgba(79,209,224,.08);
  border: 1px solid rgba(79,209,224,.25);
  border-radius: 12px;
}
.ach-list {
  display: flex; flex-direction: column; gap: 14px;
  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: #e03a3a; border-radius: 3px; }
.ach-list::-webkit-scrollbar-track { background: #1d2740; border-radius: 3px; }
.ach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #2f3f5c;
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #1a2338, #131b2b);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.ach-item.done { border-color: #7fe3f5; background: linear-gradient(180deg, #16303c, #0f222b); box-shadow: 0 2px 14px rgba(79,209,224,.18); }
.ach-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ach-item.done .ach-name { color: #8ee6f7; }
.ach-item.todo .ach-name { color: #8895ab; }
.ach-bonus { font-size: 13px; white-space: nowrap; }
.ach-item.done .ach-bonus { color: #6cdb8a; }
.ach-item.todo .ach-bonus { color: #5c6882; }

/* ---------- 图鉴（结构照搬《综武模拟器》，配色换本作深色主题） ---------- */
.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: 9px;
  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(79,209,224,.30), rgba(79,209,224,.10));
  border: 1px solid rgba(79,209,224,.55);
  color: #eaf8ff;
  font-weight: 700;
}
.dex-item.lack {
  background: rgba(16,24,40,.85);
  border: 1px solid #22304a;
  color: #6d7b91;
}

/* ---------- 成就达成面包屑提示 ---------- */
.ach-toast {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99;
  text-align: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #7fe3f5, #e03a3a);
  color: #06121a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  transform: translateY(-100%);
  transition: transform .35s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.ach-toast.show { transform: translateY(0); }

/* 排行榜 / 成就 / 图鉴 / 保底：标题+小字两行居中（结构一致，视觉统一） */
#btn-ach, #btn-rank, #btn-dex, #btn-guard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 9px 6px; }
#btn-ach > span:first-child, #btn-rank > span:first-child,
#btn-dex > span:first-child, #btn-guard > span:first-child { font-size: 17px; line-height: 1.3; white-space: nowrap; }
.ach-btn-tip { font-size: 10px; color: #7fe3f5; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#btn-guard.on {
  opacity: 1; border-color: #7fe3f5; color: #f2f6fc;
  background: linear-gradient(180deg, #1c4a58, #123640);
  box-shadow: 0 0 12px rgba(79,209,224,.35);
}

/* ---------- 手动模式 ---------- */
.manual-tip {
  width: 100%;
  text-align: center;
  color: #ff9e6b;
  font-size: 13px;
  padding: 6px 0 2px;
}
.set-tip { margin-top: 6px; color: #7a86a0; font-size: 12px; }

/* ============ 高光时刻 ============ */
.hl-list { width: 100%; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; }
.hl-empty { color: #7a86a0; text-align: center; padding: 40px 10px; font-size: 13px; line-height: 1.8; }
.hl-row {
  width: 100%;
  background: rgba(16,24,40,.85);
  border: 1px solid #2f3f5c;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.hl-row:active { background: rgba(28,42,66,.95); }
.hl-top { display: flex; align-items: center; gap: 8px; }
.hl-time { color: #93a2ba; font-size: 12px; white-space: nowrap; }
.hl-title { color: #f2f6fc; font-size: 14px; font-weight: 700; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-badge { font-size: 11px; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.hl-badge.god, .hl-badge.asc-god, .hl-badge.asc-weak { background: rgba(127,227,245,.2); color: #f2f6fc; border: 1px solid rgba(127,227,245,.45); }
.hl-badge.asc-duel { background: rgba(180,120,255,.18); color: #dcc3ff; border: 1px solid rgba(180,120,255,.5); }
.hl-badge.asc-origin { background: rgba(255,210,110,.18); color: #ffe9a8; border: 1px solid rgba(255,210,110,.5); }
.hl-badge.fail { background: rgba(255,80,80,.18); color: #ffb3b3; border: 1px solid rgba(255,90,90,.45); }
.hl-badge.dead { background: rgba(120,140,170,.15); color: #b8c2d4; border: 1px solid rgba(120,140,170,.35); }
.hl-badge.pause { background: rgba(180,150,80,.15); color: #d8c9a0; border: 1px solid rgba(180,150,80,.35); }
.hl-sub { margin-top: 6px; color: #b8c2d4; font-size: 12px; line-height: 1.6; }
.hl-sub b { color: #ffd0a0; }
/* 高光行的胶囊栏（照抄综武 .hl-ring / .hl-ring-cap，配色换本作主题） */
.hl-ring { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hl-ring .move-chip { min-width: 16px; height: 15px; border-radius: 8px; font-size: 9px; padding: 0 5px; }
.hl-ring-cap { color: #8895ab; font-size: 9.5px; margin-right: 2px; }

/* 高光履历回看弹窗 */
.mask-box.hl-box { width: 320px; max-width: 88vw; max-height: 80vh; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.mask-box.hl-box .mask-head { flex-shrink: 0; }
.mask-box.hl-box .review-log { flex: 1; min-height: 0; }
.mask-box.hl-box .btn { flex-shrink: 0; width: 100%; }
.hl-sub-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.hl-sub { margin-top: 0; }
.hl-export-btn {
  flex-shrink: 0; margin-left: auto;
  font-size: 12px; padding: 5px 12px; border-radius: 15px;
  border: 1px solid #4a6a8c; background: rgba(79,209,224,.14); color: #a9dcea;
  white-space: nowrap; cursor: pointer;
}
.hl-export-btn:active { background: rgba(79,209,224,.3); }

/* 高光行下双按钮（导出详情 / 导出成就图） */
.hl-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.hl-act-btn {
  font-size: 13px; padding: 8px 6px; border-radius: 9px; cursor: pointer; white-space: nowrap;
  border: 1px solid #33507a; background: rgba(20,28,44,.7); color: #c9d7e6;
}
.hl-act-btn.primary { border-color: #7fe3f5; background: linear-gradient(180deg, #1c4a58, #123640); color: #eaf8ff; }
.hl-act-btn:active { filter: brightness(1.2); }
.hl-act-btn + .hl-act-btn { margin-left: 0; }

/* 高光履历弹窗（右上角 ✕ 关闭） */
.mask-head { display: flex; align-items: center; gap: 6px; width: 100%; }
.mask-head .mask-title { flex: 1; text-align: center; margin: 0; }

/* 高光浮动提示 */
#hl-toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 99; max-width: 82vw;
  background: rgba(12,22,38,.94); border: 1px solid #33507a; border-radius: 20px;
  color: #e8f1f6; font-size: 13px; padding: 9px 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  pointer-events: none; text-align: center;
}

/* 履历海报全屏展示（长按/双击保存） */
#hl-img-mask { align-items: center; justify-content: center; background: rgba(4,6,12,.96); padding: 12px; }
.hl-img-box { width: min(94vw, 460px); height: 92vh; max-height: 92vh; display: flex; flex-direction: column; gap: 10px; }
.hl-img-head { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hl-img-tip { flex: 1; color: #cfdae4; font-size: 13px; text-align: center; }
/* ⚠ 容器不要白色底：图比容器矮时会在下方留出一块明显的白框 */
.hl-img-scroll {
  flex: 1; min-height: 0; overflow: auto; background: transparent;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.hl-img-scroll img { display: block; width: 100%; height: auto; border-radius: 8px; user-select: none; -webkit-user-select: none; }
.hl-img-box .btn { flex-shrink: 0; }

/* 保底说明弹窗 */
.guard-rows { display: flex; flex-direction: column; gap: 5px; width: 100%; color: #d3dcea; font-size: 13px; padding: 2px 0; }
.guard-row { background: rgba(20,30,48,.6); border-radius: 8px; padding: 5px 10px; text-align: left; }
.guard-row b { color: #f2f6fc; }
.mask-info b.gold { color: #f2f6fc; }

/* 击败怪兽 / 破绽展示行（游戏页属性区下 + 结算页）
 * ⚠ 标签与胶囊必须是容器的**直接子元素**：
 *   套一层时所有胶囊在 flex 眼里只是「一个」子项，放不下就整组换行，标签会被顶到上一行。
 * ⚠ 行间**不留空隙**：用 flex + row-gap 精确控制。 */
.move-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  column-gap: 5px; row-gap: 2px;
  width: 100%; padding: 0 2px; margin-top: 8px;
  line-height: 1;
}
.settle-move { margin-top: 10px; }
.move-label { flex: none; color: #93a2ba; font-size: 12px; white-space: nowrap; }
.move-chip {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px;
  font-size: 10px; font-weight: 700; padding: 0 6px; line-height: 1;
}
/* 胶囊档位配色：色相沿用《综武模拟器》那一套（灰→绿→蓝→紫→金→红→七彩），
 * ⚠ 但**字体统一为深色**（用户明确要求）：综武原版是「浅底配深字 / 深底配白字」交替，
 *   相邻档位看起来一黑一白很别扭；这里把深底一律调浅，全档统一深字 #1a1c1f。 */
.hc-move { background: #d8d8d8; color: #1a1c1f; }
.hc-t1  { background: #d8d8d8; color: #1a1c1f; }  /* F  · 浅灰 */
.hc-t2  { background: #b0b0b0; color: #1a1c1f; }  /* E  · 中灰 */
.hc-t3  { background: #a8d8b0; color: #1a1c1f; }  /* D  · 浅绿 */
.hc-t4  { background: #7bc98a; color: #1a1c1f; }  /* C  · 中绿 */
.hc-t5  { background: #a8cfe8; color: #1a1c1f; }  /* B  · 浅蓝 */
.hc-t6  { background: #7cc0f0; color: #1a1c1f; }  /* A  · 中蓝 */
.hc-t7  { background: #c0a3e0; color: #1a1c1f; }  /* S  · 浅紫 */
.hc-t8  { background: #e8cc6a; color: #1a1c1f; }  /* SS · 浅金 */
.hc-t9  { background: #e08a86; color: #1a1c1f; }  /* SSS· 浅红 */
.hc-t10 { background: linear-gradient(90deg,#ff4d4f,#ff9800,#ffeb3b,#4caf50,#00bcd4,#3f51b5,#9c27b0); background-size: 300% 100%; color: #1a1c1f; box-shadow: 0 0 6px rgba(160,80,200,.55); text-shadow: 0 1px 2px rgba(255,255,255,.35); animation: rainbowShift 2.6s linear infinite; }  /* EX · 七彩 */
.hc-weak  { background: linear-gradient(90deg,#ff4d4f,#ff9800,#ffeb3b,#4caf50,#00bcd4,#3f51b5,#9c27b0); background-size: 300% 100%; color: #1a1c1f; box-shadow: 0 0 6px rgba(160,80,200,.55); text-shadow: 0 1px 2px rgba(255,255,255,.35); animation: rainbowShift 2.6s linear infinite; }  /* 德拉西翁的破绽：七彩 */
/* 对局内：居中 + 一圈框；尺寸与滚动照抄综武 .huan-line */
#attr-move { position: relative; padding: 8px 10px; border: 1px solid #2f3f5c; border-radius: 10px; background: rgba(16,24,40,.5); min-height: 20px; max-height: 96px; overflow-y: auto; }

/* ---------- 命悬一线 · 复活引导 ---------- */
.revive-box { width: 320px; max-width: 88vw; }
.revive-box .mask-title { color: #ff8a8a; text-shadow: 0 0 20px rgba(255,80,80,.45); }
.revive-box .mask-info { line-height: 1.7; }

/* ---------- 决战德拉西翁 · 四选一 / 遭遇怪兽 · 二选一（整框七彩） ---------- */
:root {
  --rainbow: linear-gradient(90deg, #ff4d4f, #ff9800, #ffeb3b, #4caf50, #00bcd4, #3f51b5, #9c27b0);
}
.choice-box {
  width: 340px; max-width: 90vw;
  /* 双背景：内层铺底色，外层只做边框 → 一圈七彩描边 */
  border: 2px solid transparent;
  background: linear-gradient(#0d1626, #0d1626) padding-box, var(--rainbow) border-box;
  box-shadow: 0 0 26px rgba(255,255,255,.10), 0 8px 40px rgba(0,0,0,.5);
}
.mask-head { display: flex; align-items: center; justify-content: center; position: relative; }
.mask-head .mask-title { flex: 1; text-align: center; }
/* 标题：七彩渐变文字 */
.choice-mtitle {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.choice-opts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
/* 选项：七彩描边 + 深色底；文字**绝不换行**（放不下由 fitChoiceBtns 缩字号） */
.choice-btn {
  width: 100%; padding: 12px 12px;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(#131c2e, #0f1726) padding-box, var(--rainbow) border-box;
  color: #e6ecf5;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.choice-btn:active { transform: scale(.98); filter: brightness(1.25); }
.choice-float {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: 90vw;
  padding: 11px 18px; border-radius: 22px;
  background: linear-gradient(180deg, #e03a3a, #b62a2a);
  color: #fff6f6; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  cursor: pointer; white-space: nowrap;
  animation: floatPulse 1.4s ease-in-out infinite;
}
@keyframes floatPulse { 0%,100% { opacity: .92; } 50% { opacity: 1; } }
