/* ============================================================
 * 咒回宿傩模拟器 · 样式（移动优先，兼容电脑 480px 容器）
 * ⚠ 基础样式 / 排版 / 配色全部来自《咒回轮盘模拟器》
 *   （即《咒术回战模拟器》的墨黑咒界 + 六眼青色板），
 *   说明页 / 日志 / 结算页也按轮盘版本对齐；
 *   仅末尾追加本作新增组件（顶栏、底栏、六格属性、术式+弱点行）。
 * ============================================================ */
[hidden] { display: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: #0d1117;
  color: #e8e4d8;
  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, #12161f 0%, #0d1117 40%, #080a0f 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(255,215,130,.5), transparent),
    radial-gradient(1px 1px at 80% 30%, rgba(255,215,130,.4), transparent),
    radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,215,130,.4), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,.3), 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 #2c3d4d;
  background: linear-gradient(180deg, #1f2c38, #18222c);
  color: #e8e4d8;
  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 #3fb8d6;
  background: linear-gradient(180deg, #6fd8f0, #3fb8d6);
  color: #062630;
  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 #2c3d4d;
  background: linear-gradient(180deg, #1f2c38, #18222c);
  color: #e8e4d8;
  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, #d8f4ff, #4fc3dc 60%, #1b6a80);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(212,175,55,.25);
}
.home-sub { color: #9aa5b8; font-size: 13px; margin-top: 4px; letter-spacing: 1px; }
.home-count {
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 20px;
  padding: 8px 14px;
  color: #4fc3dc;
  font-size: 12px;
  white-space: nowrap;   /* 玩过/进化人数不换行，缩小字体 */
}
.home-count b { font-size: 13px; }
.home-lv {
  width: 100%;
  background: rgba(18,22,31,.85);
  border: 1px solid #2c3d4d;
  border-radius: 12px;
  padding: 12px 16px;
}
/* 等级行：玩家等级 · [Lv.N] · 经验 · 初始模拟点加成（结构照《百世修仙模拟器》） */
.lv-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lv-name { color: #8b96ab; font-size: 13px; flex: none; }
.lv-lv { color: #d8f4ff; font-size: 16px; font-weight: 700; flex: none; }
.lv-exp-inline { color: #7f8a9a; font-size: 12px; white-space: nowrap; flex: none; }
.lv-bonus { color: #ff9e6b; font-size: 11px; white-space: nowrap; margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.lv-exp-line { margin-top: 7px; color: #9aa5b8; font-size: 12px; text-align: center; }
.lv-bar { height: 10px; background: #232f47; border-radius: 5px; overflow: hidden; margin-top: 8px; }
.lv-bar-fill { height: 100%; background: linear-gradient(90deg, #66bb6a, #a5d6a7); 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; }
.settings-body { width: 100%; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.set-card { background: rgba(18,22,31,.85); border: 1px solid #2c3d4d; 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(18,22,31,.85);
  border: 1px solid #2c3d4d;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 2;
  color: #c9cdd6;
}
.about-text b { color: #d8f4ff; }
.home-sound { width: 100%; display: flex; justify-content: center; margin-top: 4px; }
.btn-sound {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid #2c3d4d;
  background: linear-gradient(180deg, #1f2c38, #18222c);
  color: #e8e4d8;
  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(18,22,31,.85);
  border: 1px solid #2c3d4d;
  border-radius: 12px;
  padding: 8px 14px;
}
.speed-label { display: flex; justify-content: space-between; align-items: center; color: #8b96ab; font-size: 13px; }
.speed-label b { color: #4fc3dc; }
.speed-range { width: 100%; margin-top: 6px; accent-color: #3fb8d6; }
.home-tip {
  width: 100%;
  background: rgba(18,22,31,.8);
  border: 1px solid #243040;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}
.tip-title { color: #4fc3dc; font-size: 13px; margin-bottom: 6px; letter-spacing: 2px; text-align: center; }
.tip-text { color: #8b96ab; font-size: 12px; line-height: 1.8; text-align: left; }
.qr-area { width: 100%; text-align: center; margin-top: 10px; }
.qr-text { color: #9aa5b8; 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: #c9cdd6; }
.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;   /* 同上：inset 老内核不认，开关轨道会消失 */
  background: #243040;
  border: 1px solid #2c3d4d;
  border-radius: 13px;
  transition: background .2s;
}
.track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #8b96ab;
  transition: transform .2s, background .2s;
}
.set-switch input:checked + .track { background: #3fb8d6; border-color: #3fb8d6; }
.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: #4fc3dc;
  font-weight: 700;
  white-space: nowrap;   /* 术式名 + 天赋点数可能变长：宁可缩小字号，绝不折行 */
}
.btn-pause {
  position: absolute;
  right: 4px; top: 12px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid #2c3d4d;
  background: linear-gradient(180deg, #1f2c38, #18222c);
  color: #e8e4d8;
  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.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- 模拟点进度条（对局页第一行） ----------
 * 结构与类名照抄《鬼灭之刃模拟器》，只把配色换成本作（墨黑 + 六眼青） */
.stamina-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(18,22,31,.92), rgba(13,17,23,.92));
  border: 1px solid #2c3d4d;
  border-radius: 12px;
}
.stamina-name { font-size: 12px; color: #4fc3dc; 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, #1b6a80, #6fd8f0);
  box-shadow: 0 0 10px rgba(63,184,214,.45);
  transition: width .25s ease;
}
.stamina-val { font-size: 13px; font-variant-numeric: tabular-nums; color: #d8f4ff; white-space: nowrap; font-weight: 700; }
.attr-card {
  background: linear-gradient(180deg, rgba(30,40,60,.9), rgba(22,29,44,.9));
  border: 1px solid #2c3d4d;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.attr-name { color: #8b96ab; font-size: 12px; letter-spacing: 1px; }
.attr-rank { color: #4fc3dc; font-weight: 700; font-size: 12.5px; }
.attr-val { color: #d8f4ff; font-size: 26px; font-weight: 700; white-space: nowrap; }
.attr-sub { color: #7f8ba0; font-size: 12px; }
.attr-wuhun { grid-column: 1 / -1; }
.attr-wuhun-name { color: #d8f4ff; font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.attr-innate-line { color: #4fc3dc; 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(11,15,22,.7);
  border: 1px solid #243040;
  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(31,44,56,.4);
  color: #c9cdd6;
}
.log-item.year{ background: rgba(31,44,56,.18); color: #9aa5b8; 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.jutsu{ background: rgba(255,120,190,.16); border: 1px solid rgba(255,120,190,.5); color: #ffd0e6; }  /* 习得术式：粉色 */
.log-item.rare{ background: rgba(255,150,80,.14); border: 1px solid rgba(255,150,80,.35); color: #ffc59a; }
/* 剧情事件：七彩（与「进化本源」的 rainbow 同款，但对完整的剧情行常亮、不闪烁） */
.log-item.plot {
  background: linear-gradient(90deg, rgba(255,90,90,.26), rgba(255,200,80,.26), rgba(110,220,120,.26), rgba(90,160,255,.26), rgba(180,120,255,.26));
  background-size: 400% 100%;
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  font-weight: 700;
  animation: rainbowShift 1.6s linear infinite;
}
.log-item.plotmiss { background: rgba(120,128,140,.12); border: 1px solid rgba(120,128,140,.3); color: #98a1ad; }
.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(111,216,240,.18); border: 1px solid rgba(111,216,240,.5); color: #eafcff; 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(18,22,31,.85);
  border: 1px solid #2c3d4d;
  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: #d8f4ff; }
.settle-title.god { color: #eafcff; text-shadow: 0 0 24px rgba(111,216,240,.6); }
.settle-shude { text-align: center; color: #9aa5b8; font-size: 13.5px; }
.settle-shude 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 #243040;
  font-size: 14px;
}
.s-row:last-child { border-bottom: none; }
.s-row span { color: #8b96ab; }
.s-row b { color: #e8e4d8; }
.settle-god {
  text-align: center;
  font-size: 14px;
  color: #eafcff;
  background: linear-gradient(180deg, rgba(111,216,240,.2), rgba(111,216,240,.08));
  border: 1px solid rgba(111,216,240,.5);
  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(63,184,214,.08);
  border: 1px solid rgba(63,184,214,.25);
  border-radius: 10px;
  padding: 7px;
  color: #4fc3dc;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
/* 结算页「自动下一局」挂机倒计时条（设置里开启后才显示） */
.settle-auto {
  background: rgba(212,175,55,.10);
  border: 1px solid rgba(212,175,55,.30);
  border-radius: 10px;
  padding: 7px;
  color: #e8c86a;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
/* 榜单名次加成说明条（排行榜页顶部） */
#rank-fate-note { color: #4fc3dc; padding-bottom: 2px; }
/* 设置页下拉（对决宿傩的决策方式） */
.set-select {
  flex: none;
  background: #18222c;
  color: #e8e4d8;
  border: 1px solid #2c3d4d;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  max-width: 60%;
}
.set-select:focus { outline: none; border-color: #3fb8d6; }
.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: #12161f;
  border-bottom: 1px solid #243040;
  position: sticky;
  top: 0;
  z-index: 5;
}
.page-title { flex: 1; text-align: center; font-size: 19px; color: #4fc3dc; margin: 0; letter-spacing: 2px; }
.btn-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #2c3d4d;
  background: #232f47;
  color: #9aa5b8;
  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-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: #232f47;
  color: #8b96ab;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active { background: linear-gradient(180deg, #6fd8f0, #3fb8d6); color: #062630; }
.lb-note { padding: 6px 14px 0; font-size: 12px; color: #4fc3dc; width: 100%; }
.lb-body { padding: 8px 14px 30px; width: 100%; }
.lb-tip { text-align: center; color: #7f8ba0; padding: 30px 0; font-size: 14px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #18222c;
  border: 1px solid #243040;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.lb-row.me { box-shadow: 0 0 0 2px #3fb8d6 inset; background: rgba(63,184,214,.12); }
.lb-rank {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #243040;
  color: #8b96ab;
  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: #c9cdd6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 15px; font-weight: 700; color: #d8f4ff; flex: none; white-space: nowrap; }
.lb-time { font-size: 11px; color: #7f8ba0; flex: none; }

/* ---------- 暂停遮罩 ---------- */
.mask {
  position: fixed;
  /* ⚠ 必须写四条边，不能用 inset 简写：inset 只有 Chrome 87+ / Safari 14.1+ 认识，
   * 老内核（旧安卓 WebView、微信 X5、iOS 13 及以下）会整条忽略 → mask 退回「静态位置」，
   * 因 mask 在文档末尾而被渲染到视口下方，弹窗看不见也点不到（宿傩决战处直接卡死）。 */
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(8,12,20,.7);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mask-box {
  width: 300px;
  max-width: 86vw;
  background: #12161f;
  border: 1px solid #2c3d4d;
  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: #4fc3dc; font-weight: 700; letter-spacing: 2px; }
.mask-info { text-align: center; color: #9aa5b8; 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(11,15,22,.7);
  border: 1px solid #243040;
  border-radius: 10px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #c9cdd6;
  -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: #d8f4ff; }
.review-log .rv-ev4 { color: #ffb3b3; }
.review-log .rv-jutsu { color: #ffd0e6; }
.review-log .rv-plot { color: #ffe9a8; font-weight: 700; }
.review-log .rv-plotmiss { color: #98a1ad; }
.review-log .rv-god { color: #eafcff; 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: #8b96ab; }

/* ---------- 电脑端 ---------- */
@media (min-width: 520px) {
  body { background: #0b0f18; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #2c3d4d; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 高阶咒术天赋增益（点赞/投币/关注） ---------- */
.btn-follow {
  border-color: #3fb8d6;
  color: #6fd8f0;
  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: #4fc3dc; font-weight: 700; }

/* ---------- 成就系统 ---------- */
.home-ach-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 6px; }
/* 三入口按钮文字绝不换行（放不下由 fitHomeBtns 逐档缩小字号） */
.home-ach-row .btn { white-space: nowrap; overflow: hidden; }
.ach-tip { text-align: center; color: #4fc3dc; font-size: 12px; margin-bottom: 12px; }
.ach-total {
  text-align: center; color: #4fc3dc; font-size: 16px; font-weight: 700;
  margin: 6px 14px 10px; padding: 9px;
  width: calc(100% - 28px);
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.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: #3fb8d6; border-radius: 3px; }
.ach-list::-webkit-scrollbar-track { background: #232c40; border-radius: 3px; }
.ach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #2c3d4d;
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #232c40, #1c2436);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.ach-item.done { border-color: #3fb8d6; background: linear-gradient(180deg, #3a3320, #2c2616); box-shadow: 0 2px 14px rgba(63,184,214,.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: #8b96ab; }
.ach-bonus { font-size: 13px; white-space: nowrap; }
.ach-item.done .ach-bonus { color: #6cdb8a; }
.ach-item.todo .ach-bonus { color: #5c6882; }

/* ---------- 顶部提示条（结构 / 动效照《百世修仙模拟器》的 .ach-toast） ----------
 * 成就 / 签到 / 登录奖励 / 购买 等一切提示：屏幕顶部居中的药丸，透明度淡入淡出。 */
.ach-toast {
  position: fixed;
  left: 50%; top: 24px; transform: translateX(-50%);
  z-index: 99;
  max-width: 90vw;
  background: rgba(18,21,26,.96);
  border: 1px solid #3fb8d6;
  color: #d8f4ff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity .25s ease;
  box-shadow: 0 6px 22px rgba(0,0,0,.45);
}
.ach-toast.show { opacity: 1; }

/* 成就 / 排行榜按钮：标题+小字两行居中（结构一致，视觉统一） */
#btn-ach, #btn-rank { 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 { font-size: 17px; line-height: 1.3; white-space: nowrap; }
.ach-btn-tip { font-size: 10px; color: #4fc3dc; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
#btn-guard {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 9px 4px; opacity: .85; border-color: #2c3d4d;
}
#btn-guard > span:first-child { font-size: 17px; line-height: 1.3; white-space: nowrap; }
#btn-guard.on {
  opacity: 1; border-color: #4fc3dc; color: #d8f4ff;
  background: linear-gradient(180deg, #5a4a1e, #3c3412);
  box-shadow: 0 0 12px rgba(212, 175, 55, .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(18,22,31,.85);
  border: 1px solid #2c3d4d;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.hl-row:active { background: rgba(40,52,78,.95); }
.hl-top { display: flex; align-items: center; gap: 8px; }
.hl-time { color: #9aa5b8; font-size: 12px; white-space: nowrap; }
.hl-title { color: #d8f4ff; 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-shenkao { background: rgba(111,216,240,.2); color: #d8f4ff; border: 1px solid rgba(111,216,240,.45); }
.hl-badge.asc-dujie { background: rgba(180,120,255,.18); color: #dcc3ff; border: 1px solid rgba(180,120,255,.5); }
.hl-badge.asc-shenwang { background: rgba(80,200,255,.16); color: #a9e8ff; border: 1px solid rgba(80,200,255,.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; }

/* 高光履历回看弹窗 */
.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 #5a6c92; background: rgba(120,150,220,.16); color: #a9c0ea;
  white-space: nowrap; cursor: pointer;
}
.hl-export-btn:active { background: rgba(120,150,220,.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 #4a5a78; background: rgba(31,44,56,.7); color: #c9d3e6;
}
.hl-act-btn.primary { border-color: #3fb8d6; background: linear-gradient(180deg, #5a4a1e, #3c3412); color: #d8f4ff; }
.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; bottom: auto; left: 50%; transform: translateX(-50%);
  z-index: 99; max-width: 82vw;
  background: rgba(20,28,44,.94); border: 1px solid #4a5a78; border-radius: 20px;
  color: #e8edf6; 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(8,10,16,.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: #cfd6e4; 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: #c9cdd6; font-size: 13px; padding: 2px 0; }
.guard-row { background: rgba(24, 32, 42, .6); border-radius: 8px; padding: 5px 10px; text-align: left; }
.guard-row b { color: #d8f4ff; }
.mask-info b.gold { color: #d8f4ff; }

/* 习得术式展示行（游戏页属性区下 + 结算页）
 * ⚠ 标签与胶囊必须是容器的**直接子元素**（HTML 里不再套中间 span）：
 *   套一层时所有胶囊在 flex 眼里只是「一个」子项，放不下就整组换行，「习得术式」会被顶到上一行。
 * ⚠ 行间**不留空隙**：原来用 inline 流 + line-height:1.9，两行胶囊之间会空出 ~9px；
 *   现在用 flex + row-gap 精确控制，紧贴排布。 */
.jutsu-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-jutsu { margin-top: 10px; }
.jutsu-label { flex: none; color: #9aa5b8; font-size: 12px; white-space: nowrap; }
.jutsu-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 5px; line-height: 1;
}
.hc-ten   { background: #ffffff; color: #333; border: 1px solid #b8c0cc; }    /* 黑闪：白 */
.hc-bai   { background: #f4c542; color: #062630; }                             /* 简易领域：黄 */
.hc-qian  { background: #9b6bff; color: #ffffff; }                             /* 领域展延：紫 */
.hc-wan   { background: #14141a; color: #ffffff; border: 1px solid #666; }     /* 领域展开：黑 */
.hc-shiwan{ background: #e03a3a; color: #ffffff; }                             /* 极之番：红 */
.hc-weak  { background: linear-gradient(90deg, #ff4d4f, #ff9800, #ffeb3b, #4caf50, #00bcd4, #3f51b5, #9c27b0); color: #1a1200; }   /* 宿傩的弱点：七彩胶囊 */
#attr-jutsu { position: relative; padding: 8px 10px; border: 1px solid #2c3d4d; border-radius: 10px; background: rgba(18,22,31,.5); }   /* 对局内：居中 + 一圈框 */

/* ---------- 命悬一线 · 复活引导 ---------- */
.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(#12161f, #12161f) 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(#181f2b, #141a24) padding-box, var(--rainbow) border-box;
  color: #e8e4d8;
  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, #6fd8f0, #3fb8d6);
  color: #062630; 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; } }

/* ============================================================
 * 咒回轮盘模拟器 · 新增组件（轮回点加成项 / 每日签到 / 天赋轮盘）
 * ============================================================ */

/* ---------- 等级框内的分隔杠 + 轮回点行 + 签到小按钮 ---------- */
.lv-divider { height: 1px; background: rgba(63,184,214,.30); margin: 10px 0 8px; }
.lv-point-line { display: flex; align-items: center; gap: 8px; }
.lv-point-name { color: #8b96ab; font-size: 13px; flex: none; }
.lv-point-val { color: #7fd6ea; font-size: 16px; font-weight: 700; flex: none; }
.btn-mini {
  margin-left: auto;
  flex: none;
  border: 1px solid #3fb8d6;
  background: linear-gradient(180deg, #1f2c38, #18222c);
  color: #7fd6ea;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  white-space: nowrap;
}
.btn-mini:active { transform: scale(.96); }

/* ---------- 加成项购买列表（四行平铺，尽量紧凑） ---------- */
.shop-list { margin: 6px 0 0; display: flex; flex-direction: column; gap: 0; }
.shop-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: rgba(63,184,214,.06);
  border: 1px solid rgba(63,184,214,.18);
  border-radius: 8px;
  padding: 0 7px;
  margin: 0;
  min-height: 20px;
}
.shop-label {
  flex: 0 1 auto; min-width: 0;
  color: #c9cdd6; font-size: 11px; line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.shop-label b { color: #7fd6ea; }
.shop-buy {
  flex: none;
  border: 1px solid #3fb8d6;
  background: linear-gradient(180deg, #6fd8f0, #3fb8d6);
  color: #062630;
  border-radius: 6px;
  padding: 1px 6px;
  margin: 0;
  line-height: 1.35;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.shop-buy:active { transform: scale(.97); }
.shop-buy.off { border-color: #2c3d4d; background: linear-gradient(180deg, #1f2c38, #18222c); color: #6d7682; }

/* ---------- 首页 全站斩杀统计行 ---------- */
.home-count.home-ascend {
  background: rgba(63,184,214,.08);
  border: 1px solid rgba(63,184,214,.26);
  color: #7fd6ea;
}
.home-count.home-ascend b { color: #d8f4ff; }

/* ---------- 首页三按钮一排（排行榜 / 成就 / 保底） ---------- */
.home-ach-row3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.home-ach-row3 > .btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 9px 4px;
}
.home-ach-row3 > .btn > span:first-child { font-size: 15px; line-height: 1.3; }
.home-ach-row3 .ach-btn-tip { font-size: 9.5px; }
#btn-guard.on { border-color: #f0a53a; background: linear-gradient(180deg, #2a2314, #241f17); box-shadow: 0 2px 14px rgba(240,165,58,.25); }
#btn-guard.on .ach-btn-tip { color: #ffce7a; }

/* ---------- 每日签到（日历） ---------- */
#view-sign { justify-content: flex-start; }
#view-sign .sign-head,
#view-sign .sign-week,
#view-sign .sign-grid,
#view-sign .sign-btns,
#view-sign .sign-note { width: calc(100% - 28px); }
#view-sign .sign-head { display: flex; align-items: baseline; margin: 4px 0 10px; }
.sign-ym { font-size: 15px; font-weight: 700; color: #d8f4ff; }
.sign-stat { margin-left: auto; font-size: 12.5px; color: #7fd6ea; }
.sign-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-bottom: 5px; }
.sign-week span { text-align: center; font-size: 11.5px; color: #7f8a9a; }
.sign-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.sg {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  border: 1px solid rgba(63,184,214,.16);
  background: rgba(18,22,31,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: #7f8a9a;
}
.sg.blank { border: none; background: none; }
.sg.future { opacity: .35; }
.sg.miss { color: #e08b80; border-color: rgba(192,86,74,.25); }
.sg.done {
  background: linear-gradient(180deg, rgba(63,184,214,.28), rgba(63,184,214,.10));
  border-color: #3fb8d6; color: #d8f4ff; font-weight: 700;
}
.sg.done::after {
  content: ''; position: absolute; right: 3px; bottom: 3px;
  width: 5px; height: 5px; border-radius: 50%; background: #7fd6ea;
}
.sg.today {
  border-color: #f0a53a;
  box-shadow: 0 0 10px rgba(240,165,58,.55);
  color: #fff2d0; font-weight: 700;
  animation: sgPulse 1.4s ease-in-out infinite;
}
.sg.today.done { border-color: #3fb8d6; box-shadow: 0 0 10px rgba(63,184,214,.6); animation: none; }
@keyframes sgPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(240,165,58,.35); }
  50%      { box-shadow: 0 0 16px rgba(240,165,58,.8); }
}
.sign-btns { margin-top: 14px; }
.sign-note { margin-top: 10px; font-size: 11.5px; line-height: 1.7; color: #7f8a9a; text-align: center; }
.sign-note b { color: #7fd6ea; }
.btn.gray, .btn[disabled] { border-color: #2c3d4d; background: linear-gradient(180deg, #1f2c38, #18222c); color: #6d7682; box-shadow: none; }

/* ---------- 咒术天赋轮盘 ---------- */
#view-wheel { justify-content: flex-start; }
.wheel-wrap {
  /* 轮盘占画面宽度 95%：左右各留 2.5% */
  width: 100%; padding: 10px 2.5% calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.wheel-tip { color: #9aa5b8; font-size: 12.5px; line-height: 1.6; text-align: center; }
.wheel-stage {
  position: relative;
  width: 100%; max-width: none;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
}
.wheel-canvas { position: relative; z-index: 1; width: 100%; height: 100%; display: block; }
/* 指针层：整层绕圆心旋转，指针固定在层顶部；停下后旋到抽中的档位处 */
.wheel-pointer-layer {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
  pointer-events: none;
  transform-origin: 50% 50%;
  transition: transform .25s ease;
}
.wheel-pointer {
  position: absolute; top: -2px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 22px solid #3fb8d6;
  filter: drop-shadow(0 2px 6px rgba(63,184,214,.7));
  z-index: 2;
}
.wheel-legend { color: #7f8a9a; font-size: 12px; letter-spacing: 1px; text-align: center; }
.wheel-btns { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.wheel-btns .btn-big { padding: 12px 12px; font-size: 16px; }
.wheel-btns .btn[disabled] { opacity: .5; }
/* 保底盘：七彩光环 + 金色指针 */
#view-wheel.wheel-guarantee .wheel-pointer {
  border-top-color: #f0a53a;
  filter: drop-shadow(0 2px 8px rgba(240,165,58,.85));
}
#view-wheel.wheel-guarantee .wheel-stage::before {
  content: '';
  position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(#e05555, #e08b3a, #d9c24a, #5fbf6a, #3fbfa8, #3fa6d9, #4f7fd0, #8a5fd0, #c04fc4, #e0559a, #e05555);
  filter: blur(10px); opacity: .62;
  animation: wheelRainbow 4s linear infinite;
  z-index: 0;
}
@keyframes wheelRainbow { to { transform: rotate(360deg); } }
#view-wheel.wheel-guarantee .wheel-tip { color: #ffce7a; }

/* ---------- 首页标题 / 副标题：永不换行（放不下由脚本缩放，绝不折行） ---------- */
.home-title { white-space: nowrap; }
.home-sub { white-space: nowrap; }
/* 轮盘/签到新增内容后首页略紧凑 */
#view-home { gap: 10px; }

/* 首页内容比无尽版更高（等级框内新增轮回点 + 四行加成）：
 * 小屏必须允许从顶部正常滚动，不能用 justify-content:center（溢出时顶部会被裁掉）。 */
#view-home { justify-content: flex-start; padding-top: 18px; }
.home-hero { margin-top: 0; }

/* ---------- 全站禁止左右拖动 ----------
 * 任何视图的子元素超宽（长标题 / 长日志 / nowrap 统计行）都不允许把页面撑出横向滚动。 */
html, body { overflow-x: hidden; }
#app { overflow-x: hidden; }
.view { max-width: 100%; overflow-x: hidden; }
/* 游戏页标题：占满可用宽度、超宽裁切（字号已由 fitAttrVal 自适应缩小） */
.game-title { flex: 1 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-align: center; }
/* 日志长串（连续英文/数字）强制在容器内换行 */
.log-item { word-break: break-word; overflow-wrap: anywhere; }

/* ============================================================
 * 本作追加：顶栏 / 底栏 / 六格属性 / 术式+弱点行 / 结算补充
 * （基础样式与配色全部来自《咒回轮盘模拟器》，即《咒术回战模拟器》色板）
 * ============================================================ */

/* ---------- 顶栏（版式照《斩妖除魔模拟器》，配色取咒术回战） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 14px;
  background: rgba(13, 17, 23, .90);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #2c3d4d;
}
.brand { display: flex; align-items: baseline; gap: 2px; font-weight: 900; letter-spacing: 1px; flex: 0 0 auto; }
.brand .b1 { color: #6fd8f0; font-size: 19px; }
.brand .b2 { color: #e8e4d8; font-size: 19px; }
.brand .b3 { color: #7f8ba0; font-size: 9px; margin-left: 6px; letter-spacing: .5px; }
.top-btn {
  flex: 0 0 auto; height: 30px; padding: 0 10px; margin-left: auto;
  border: 1px solid #2c3d4d; border-radius: 8px;
  background: linear-gradient(180deg, #1f2c38, #18222c);
  color: #9aa5b8; font-size: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.top-btn:active { color: #4fc3dc; border-color: #3fb8d6; transform: scale(.96); }
body.in-game .topbar { display: none; }

/* ---------- 底栏 tab ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 45;
  display: flex; padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  background: rgba(13, 17, 23, .94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid #2c3d4d;
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; color: #7f8ba0; font-size: 10.5px; padding: 4px 0; cursor: pointer;
}
.tabbar .tab .ti { font-size: 16px; opacity: .8; }
.tabbar .tab.on { color: #6fd8f0; }
.tabbar .tab.on .ti { opacity: 1; }
body.hide-tabbar .tabbar { display: none; }
#view-home, #view-rank, #view-ach, #view-hl, #view-about {
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

/* ---------- 首页补充 ---------- */
.hero-sub-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-share {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 1px solid #2c3d4d; background: #18222c; color: #9aa5b8;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.btn-share:active { transform: scale(.94); color: #4fc3dc; border-color: #3fb8d6; }
.home-count.home-loss {
  background: rgba(63,184,214,.08);
  border: 1px solid rgba(63,184,214,.25);
  color: #d8f4ff;
}
.home-count.home-loss b { color: #8fd8ff; }

/* ---------- 六格属性 ---------- */
.attr-card.card-mine .attr-val { color: #8fd8ff; }
.attr-card.card-danger { border-color: #7a2f2f; }
.attr-card.card-danger .attr-val { color: #ffb3b3; }

/* ---------- 术式 + 弱点：同一行、居中、外面一圈框 ---------- */
#jutsu-line {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #2c3d4d;
  border-radius: 10px;
  background: rgba(18, 22, 31, .5);
  min-height: 20px;
  max-height: 132px;
  overflow-y: auto;
}
.settle-jutsu {
  padding: 8px 10px;
  border: 1px solid #2c3d4d;
  border-radius: 10px;
  background: rgba(18, 22, 31, .5);
}
.jutsu-label { flex: none; color: #9aa5b8; font-size: 12px; white-space: nowrap; margin-right: 2px; }

/* ---------- 决战弹窗按钮 ---------- */
.decision-opt .opt-k { display: inline-block; width: 16px; color: #6fd8f0; font-weight: 800; }
.decision-opt .opt-eff { color: #8fd8ff; font-size: 11.5px; }
.decision-opt.opt-d { border: 1px solid #7a2f2f; background: linear-gradient(180deg, #24161a, #180f12); }

/* ---------- 高光列表补充 ---------- */
.hl-mid { font-size: 12px; color: #9aa5b8; line-height: 1.7; }
.hl-mid b { color: #e8e4d8; }
.hl-ring { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px; }
.hl-ring-cap { font-size: 10.5px; color: #7f8ba0; }

/* ---------- 结算按钮：两列 2×2，不许改 ---------- */
.settle-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settle-btns .btn-big { padding: 11px 6px; font-size: 15px; border-radius: 10px; white-space: nowrap; }

/* ---------- 分享弹窗 ---------- */
.share-tip { margin-top: 8px; font-size: 12.5px; color: #9aa5b8; text-align: center; }
.share-qr { display: block; width: 160px; height: 160px; margin: 10px auto 0; border-radius: 10px; background: #fff; padding: 6px; }
.share-link {
  margin-top: 10px; padding: 8px; border-radius: 8px; word-break: break-all;
  border: 1px solid #2c3d4d; background: #12161f; font-size: 11.5px; color: #8fd8ff; text-align: center;
}

/* ---------- 三连 / 关注 ---------- */
.follow-box { width: 350px; max-width: 90vw; }
.follow-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.follow-row {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  border-radius: 10px; border: 1px solid #2c3d4d; background: #18222c; font-size: 13.5px;
}
.follow-row .fr-name { flex: 1; color: #c9cdd6; }
.follow-row .fr-tip { color: #7f8ba0; font-size: 12.5px; }
.follow-row.done { border-color: #3fb8d6; background: rgba(63,184,214,.10); }
.follow-row.done .fr-name { color: #8ee6f7; }
.follow-row.done .fr-tip { color: #6cdb8a; }
.fb-total { text-align: center; font-size: 15px; color: #d8f4ff; font-weight: 700; }

/* ---------- 高光图片预览 ---------- */
.hl-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.hl-btns .btn { width: auto; margin: 0; }
.hl-toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 95;
  padding: 8px 16px; border-radius: 999px; border: 1px solid #2c3d4d;
  background: rgba(13,17,23,.96); color: #d8f4ff; font-size: 12.5px;
}

/* ---------- 榜单 / 高光说明 ---------- */
.lb-fate-note { padding: 6px 14px 0; font-size: 11.5px; color: #4fc3dc; width: 100%; line-height: 1.6; }
.hl-note { width: 100%; padding: 8px 14px 0; font-size: 12px; color: #7f8ba0; }

/* ---------- 对局 HUD：第二行 4 卡一行 ---------- */
.attr-grid-inner.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.attr-grid #jutsu-line { margin-top: 0; }

/* ---------- 对局 HUD：四卡一行时的紧凑字号（标签不换行） ---------- */
.attr-grid-inner.g4 .attr-card { padding: 10px 8px; }
.attr-grid-inner.g4 .attr-name {
  font-size: 10.5px; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attr-grid-inner.g4 .attr-val { font-size: 20px; }

/* ---------- 决战框：整宽 + 七彩描边（照轮盘 choice-box） ---------- */
#finale-mask { padding: 16px; }
#finale-mask .choice-box { width: 100%; max-width: 100%; }
#finale-mask .mask-head { margin-bottom: 10px; }

/* ---------- 五条悟术式胶囊：按阶位给底色（照轮盘的胶囊口径） ---------- */
.hc-t1 { background: #e8e4d8; color: #062630; }                                  /* 基础裹咒级 */
.hc-t2 { background: #f4c542; color: #062630; }                                  /* 顺转术式级 */
.hc-t3 { background: #9b6bff; color: #ffffff; }                                  /* 黑闪级 */
.hc-t4 { background: #14141a; color: #ffffff; border: 1px solid #666; }          /* 极之番级 */
.hc-t5 { background: #e03a3a; color: #ffffff; }                                  /* 咒术领域级 */

/* ============================================================
 * 对局 HUD · 六张卡统一版式
 *   上排 4 格；下排两张各跨 2 格（与上排格线严格对齐，等宽等高）
 *   标签完整显示（允许两行，底对齐），数值字号统一
 * ============================================================ */
.attr-grid-inner.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.attr-grid-inner.g4 .attr-card { padding: 10px 8px; }
.attr-grid-inner.g4 .attr-name {
  font-size: 10.5px; letter-spacing: 0;
  white-space: normal; line-height: 1.25;
  overflow: visible; text-overflow: clip;
  min-height: 2.6em; display: flex; align-items: flex-end;
}
.attr-grid-inner.g4 .attr-val { font-size: 20px; }
.attr-grid-inner.g4 .attr-card.span2 { grid-column: span 2; padding: 10px 12px; }
.attr-grid-inner.g4 .span2 .attr-name { font-size: 11.5px; min-height: 2.4em; }
.attr-grid-inner.g4 .span2 .attr-val { font-size: 22px; }

/* 下排两张卡与上排完全同款（同内边距 / 同数值字号 / 同高） */
.attr-grid-inner.g4 .attr-card.span2 { padding: 10px 8px; }
.attr-grid-inner.g4 .span2 .attr-name { font-size: 10.5px; }
.attr-grid-inner.g4 .span2 .attr-val { font-size: 20px; }

/* ============================================================
 * 对局 HUD · 六张卡「同高」（上排高度即基准，下排不得更高/更矮）
 *   ⚠ 之前给标签留了两行高度（min-height: 2.6em），把上排卡片撑高了，这里全部回调：
 *     标签单行、不折行、不预留额外高度；六张卡内边距 / 字号 / 行高完全一致。
 * ============================================================ */
.attr-grid-inner.g4 .attr-card,
.attr-grid-inner.g4 .attr-card.span2 { padding: 10px 8px; }
.attr-grid-inner.g4 .attr-name,
.attr-grid-inner.g4 .span2 .attr-name {
  font-size: 10.5px; letter-spacing: 0; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; min-height: 0; height: auto;
}
.attr-grid-inner.g4 .attr-val,
.attr-grid-inner.g4 .span2 .attr-val { font-size: 20px; line-height: 1.15; }

/* ---------- 设置页：下拉框独占一行、占满宽度（照参考项目的设置卡片） ---------- */
.set-card .set-label2 { font-size: 15px; color: #e8e4d8; margin-bottom: 8px; }
.set-card > .set-select {
  display: block;
  width: 100%; max-width: 100%;
  margin: 0;
  padding: 9px 10px;
  font-size: 13.5px;
  background: #18222c;
  color: #e8e4d8;
  border: 1px solid #2c3d4d;
  border-radius: 9px;
}
.set-card > .set-select:focus { outline: none; border-color: #3fb8d6; }

/* ---------- 结算提示条：失败用红色，提前结算用中性青 ---------- */
.settle-note.neutral {
  background: rgba(63,184,214,.08);
  border-color: rgba(63,184,214,.28);
  color: #8fd8ff;
}
.settle-god { white-space: normal; line-height: 1.7; }

/* 结算成长提示：胜利青框 / 失败红框，都是一行 */
.settle-god.lose {
  color: #ffb3b3;
  background: linear-gradient(180deg, rgba(200,50,46,.14), rgba(200,50,46,.05));
  border-color: rgba(200,50,46,.45);
}

/* 结算成长提示：一整句话（正文 + 括号加成同一段文本流），自然折行即可 */
.settle-god { white-space: normal; overflow: visible; text-overflow: clip; font-size: 13px; }

/* ---------- 高光行：与结算页完全同口径的十项（两列网格） ---------- */
.hl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin-top: 6px; }
.hl-stat {
  display: flex; justify-content: space-between; gap: 6px;
  font-size: 12px; line-height: 1.9; color: #8b96ab;
  border-bottom: 1px dashed rgba(36,48,64,.7);
}
.hl-stat b { color: #e8e4d8; font-weight: 500; }
.hl-row { cursor: pointer; }

/* ---------- 决战框：手机占满整宽，桌面不超出 App 宽度 ---------- */
#finale-mask .choice-box { width: 100%; max-width: 480px; }

/* ---------- 高光导出页：长图在框内滚动，底部按钮等分 ---------- */
.hl-img-box .hl-btns { flex-shrink: 0; width: 100%; }
.hl-img-box .hl-btns .btn { flex: 1; width: auto; margin: 0; padding: 10px 6px; font-size: 14px; white-space: nowrap; }

/* ---------- 首页：三项加成下面的「当前总咒力」 ---------- */
.home-mytotal {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed rgba(63,184,214,.28);
  color: #8b96ab; font-size: 13px; letter-spacing: .5px;
}
.home-mytotal b { color: #8fd8ff; font-size: 17px; font-weight: 700; }

/* ---------- 对决框：右上 ✕ 暂时收起 + 底部召回（照《斩妖除魔模拟器》的遭遇框） ---------- */
#finale-mask .choice-box { position: relative; }
.finale-x {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid #2c3d4d; background: #18222c; color: #9aa5b8;
  font-size: 13px; line-height: 1; cursor: pointer; z-index: 3;
}
.finale-x:active { transform: scale(.9); }
.finale-recall {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 70;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid #3fb8d6;
  background: rgba(13,17,23,.95); color: #8fd8ff;
  font-size: 13.5px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
}
.finale-recall:active { transform: translateX(-50%) scale(.96); }
