/* ============================================================
 * 鬼灭模拟器 · 样式（移动优先，兼容电脑 480px 容器）
 * 主题：墨黑夜空（深墨蓝底）+ 绯红刀光（日之呼吸）+ 紫藤紫 + 金
 * ============================================================ */
[hidden] { display: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: #070b16;
  color: #e9edf7;
  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, #141b30 0%, #101728 42%, #0a0f1c 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(2px 2px at 20% 15%, rgba(232,182,76,.55), transparent),
    radial-gradient(1.5px 1.5px at 78% 28%, rgba(232,182,76,.45), transparent),
    radial-gradient(2px 2px at 45% 62%, rgba(216,74,61,.4), transparent),
    radial-gradient(1.5px 1.5px at 68% 78%, rgba(232,182,76,.45), transparent),
    radial-gradient(2px 2px at 14% 84%, rgba(216,74,61,.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 #2e3a5e;
  background: linear-gradient(180deg, #1b2540, #131b30);
  color: #e9edf7;
  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.2); }
.btn-primary {
  border: 1px solid #ff8a7a;
  background: linear-gradient(180deg, #e4574a, #b8332a);
  color: #fff3e6;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.btn-big { width: 100%; padding: 14px 20px; font-size: 17px; border-radius: 12px; }
.btn-danger { border-color: #a23b2a; color: #ffb0a0; }
.btn-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #2e3a5e;
  background: linear-gradient(180deg, #1b2540, #131b30);
  color: #e9edf7;
  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: 6px;
  background: linear-gradient(180deg, #ffe1a0, #d94a3d 55%, #a8322c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 26px rgba(216,74,61,.35);
}
.home-sub { color: #9aabc9; font-size: 13px; margin-top: 6px; letter-spacing: 1px; }
/* 首页全站数据：始终一行，窄屏按视口缩字号（宁缩字号也不换行） */
.home-count {
  background: rgba(216,74,61,.10);
  border: 1px solid rgba(216,74,61,.30);
  border-radius: 20px;
  padding: 8px 12px;
  color: #f0c46a;
  font-size: clamp(10px, 2.8vw, 12px);
  white-space: nowrap;
}
.home-count b { font-size: 1.1em; }
.home-lv {
  width: 100%;
  background: rgba(14,20,38,.88);
  border: 1px solid #2e3a5e;
  border-radius: 12px;
  padding: 12px 16px;
}
.lv-head { display: flex; align-items: center; gap: 8px; }
.lv-name { color: #93a4c2; font-size: 13px; }
.lv-lv { color: #ffe1a0; font-size: 16px; font-weight: 700; }
.lv-bonus { color: #ff9e6b; font-size: 11px; margin-left: 4px; }
.lv-exp-line { margin-top: 7px; color: #9aabc9; font-size: 12px; text-align: center; }
.lv-bar { height: 10px; background: #131a2c; border-radius: 5px; overflow: hidden; margin-top: 8px; }
.lv-bar-fill { height: 100%; background: linear-gradient(90deg, #b8332a, #ffd98a); 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; gap: 8px; }
.home-link-btns .btn { font-size: 14px; padding: 10px 4px; white-space: nowrap; }
#btn-guard {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 8px 4px; opacity: .85; border-color: #3a4468;
}
#btn-guard > span:first-child { font-size: 14px; line-height: 1.3; white-space: nowrap; }
#btn-guard.on {
  opacity: 1; border-color: #d94a3d; color: #ffd9a0;
  background: linear-gradient(180deg, #4a1f22, #2a1420);
  box-shadow: 0 0 12px rgba(216,74,61,.45);
}
#btn-guard.on #guard-tip { color: #ffd9a0; }

/* ---------- 人物卡 · 五连抽（五张一竖排，卡内三项横向排列；只展示资质 / 寿元） ---------- */
.card-box { width: 340px; }
.char-cards { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.char-card {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px;
  border: 1px solid #2e3a5e;
  background: linear-gradient(180deg, #1b2540, #131b30);
  color: #e9edf7; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.char-card:active { transform: scale(.97); filter: brightness(1.2); }
.char-grade { flex: 1 1 0; font-size: 13px; color: #93a4c2; letter-spacing: 1px; white-space: nowrap; text-align: left; }
.char-apt { flex: none; font-size: 24px; font-weight: 700; color: #ffe0a8; line-height: 1.1; }
.char-life { flex: 1 1 0; font-size: 13px; color: #8b6bb1; white-space: nowrap; text-align: right; }
.char-card.top { border-color: #d94a3d; box-shadow: 0 0 14px rgba(216,74,61,.35); }
.char-card.top .char-apt { color: #ffb0a0; }

/* ---------- 保底说明弹窗 ---------- */
.guard-rows { display: flex; flex-direction: column; gap: 5px; width: 100%; color: #a3b2ce; font-size: 13px; padding: 2px 0; }
.guard-row { background: rgba(30,42,66,.6); border-radius: 8px; padding: 6px 10px; text-align: left; line-height: 1.5; }
.guard-row b { color: #ffe9a8; }
.mask-info b.gold { color: #f0c46a; font-size: 15px; }
.settings-body { width: 100%; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.set-card { background: rgba(14,20,38,.88); border: 1px solid #2e3a5e; 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(14,20,38,.88);
  border: 1px solid #2e3a5e;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 2;
  color: #c3cede;
}
.about-text b { color: #ffd98a; }
.qr-area { width: 100%; text-align: center; margin-top: 10px; }
.qr-text { color: #9aabc9; 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: #e9edf7; }
.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: #1e2745;
  border: 1px solid #2e3a5e;
  border-radius: 13px;
  transition: background .2s;
}
.track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #a3b2ce;
  transition: transform .2s, background .2s;
}
.set-switch input:checked + .track { background: #b8332a; border-color: #b8332a; }
.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: 6px;
  color: #f0c46a;
  font-weight: 700;
  text-shadow: 0 0 14px rgba(216,74,61,.4);
}
.btn-pause {
  position: absolute;
  right: 4px; top: 12px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid #2e3a5e;
  background: linear-gradient(180deg, #1b2540, #131b30);
  color: #e9edf7;
  font-size: 17px;
  cursor: pointer;
}
.btn-pause:active { transform: scale(.94); }

.attr-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.attr-card {
  background: linear-gradient(180deg, rgba(20,26,48,.92), rgba(14,20,38,.92));
  border: 1px solid #2e3a5e;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.attr-card.attr-wide { grid-column: 1 / -1; }
.attr-name { color: #93a4c2; font-size: 12px; letter-spacing: 1px; }
.attr-rank { color: #f0c46a; font-weight: 700; font-size: 12.5px; }
.attr-val { color: #ffe1a0; font-size: 26px; font-weight: 700; }
.attr-val b { font-size: 34px; color: #d94a3d; }
.attr-sub { color: #93a4c2; font-size: 12px; }

.log-box {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(10,14,28,.7);
  border: 1px solid #243055;
  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(38,48,78,.4);
  color: #e9edf7;
}
.log-item.year { background: rgba(38,48,78,.2); color: #93a4c2; font-size: 12.5px; }
.log-item.brk { background: rgba(232,182,76,.14); border: 1px solid rgba(232,182,76,.4); color: #ffd9a0; }
.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(232,182,76,.16); border: 1px solid rgba(232,182,76,.42); color: #ffe1a0; }
.log-item.ev4 { background: rgba(216,74,61,.2); border: 1px solid rgba(216,74,61,.5); color: #ffb3a0; }
.log-item.rare { background: rgba(216,74,61,.14); border: 1px solid rgba(216,74,61,.35); color: #ffd0a0; }
.log-item.red {
  background: rgba(216,74,61,.18);
  border: 1px solid rgba(216,74,61,.5);
  color: #ffa08a;
  font-weight: 700;
}
.log-item.rainbow {
  background: linear-gradient(90deg, rgba(216,74,61,.3), rgba(232,182,76,.3), rgba(110,220,120,.3), rgba(90,160,255,.3), rgba(180,120,255,.3));
  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(232,182,76,.2); border: 1px solid rgba(232,182,76,.55); color: #fff3cc; font-weight: 700; }
.log-item.dead { background: rgba(216,74,61,.18); border: 1px solid rgba(216,74,61,.45); color: #ffb0a0; }

/* ---------- 结算 ---------- */
#view-settle { justify-content: center; padding-top: 8px; padding-bottom: 8px; }
.settle-box {
  width: 100%;
  background: rgba(14,20,38,.9);
  border: 1px solid #2e3a5e;
  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: #ffe1a0; }
.settle-title.god { color: #fff3cc; text-shadow: 0 0 26px rgba(232,182,76,.7); }
.settle-talent { text-align: center; color: #9aabc9; font-size: 13.5px; }
.settle-talent b { color: #f0c46a; }
.settle-rows { display: flex; flex-direction: column; }
.s-row {
  display: flex; justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed #243055;
  font-size: 14px;
}
.s-row:last-child { border-bottom: none; }
.s-row span { color: #93a4c2; }
.s-row b { color: #e9edf7; }
.settle-god {
  text-align: center;
  font-size: 14px;
  color: #fff3cc;
  background: linear-gradient(180deg, rgba(232,182,76,.22), rgba(232,182,76,.08));
  border: 1px solid rgba(232,182,76,.55);
  border-radius: 10px;
  padding: 10px;
  letter-spacing: 1px;
}
.settle-rank {
  background: rgba(216,74,61,.1);
  border: 1px solid rgba(216,74,61,.3);
  border-radius: 10px;
  padding: 7px;
  color: #f0c46a;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
.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; }

/* ---------- 排行榜 ---------- */
.page-view { padding: 0 !important; }
.page-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  background: #0d1322;
  border-bottom: 1px solid #243055;
  position: sticky;
  top: 0;
  z-index: 5;
}
.page-title { flex: 1; text-align: center; font-size: 19px; color: #f0c46a; margin: 0; letter-spacing: 2px; }
.btn-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #2e3a5e;
  background: #1e2745;
  color: #9aabc9;
  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: #1e2745;
  color: #93a4c2;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active { background: linear-gradient(180deg, #e4574a, #b8332a); color: #2a0f0c; }
.lb-note { padding: 6px 14px 0; font-size: 12px; color: #f0c46a; width: 100%; }
.lb-body { padding: 8px 14px 30px; width: 100%; }
.lb-tip { text-align: center; color: #8a9bb9; padding: 30px 0; font-size: 14px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #171e33;
  border: 1px solid #243055;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.lb-row.me { box-shadow: 0 0 0 2px #b8332a inset; background: rgba(232,182,76,.14); }
.lb-rank {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #243055;
  color: #93a4c2;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
}
.lb-rank.top { background: #c9403a; color: #fff; }
.lb-rank.top.r1 { background: #e4574a; }
.lb-rank.top.r2 { background: #d94a3d; }
.lb-rank.top.r3 { background: #e8b64c; }
.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: #e9edf7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 15px; font-weight: 700; color: #ffe1a0; flex: none; white-space: nowrap; }
.lb-time { font-size: 11px; color: #8a9bb9; flex: none; }

/* ---------- 事件/剧情选择弹层 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(8,11,22,.78);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mask-box {
  width: 320px;
  max-width: 88vw;
  max-height: 84vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #161d33, #0b1120);
  border: 1px solid #3a4468;
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.mask-title { text-align: center; font-size: 20px; color: #f0c46a; font-weight: 700; letter-spacing: 2px; }
.mask-info { text-align: center; color: #9aabc9; font-size: 13px; }
.mask-box .set-row { justify-content: center; padding: 4px 0; }
.choice-desc { text-align: center; color: #e9edf7; font-size: 14px; line-height: 1.7; padding: 2px 4px; }
.choice-opts { display: flex; flex-direction: column; gap: 9px; }
.choice-btn { white-space: normal; text-align: left; line-height: 1.45; }
.choice-tip { text-align: center; color: #8a9bb9; font-size: 12px; }
.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(10,14,28,.7);
  border: 1px solid #243055;
  border-radius: 10px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #e9edf7;
  -webkit-overflow-scrolling: touch;
}
.review-log .rv-brk { color: #ffd9a0; }
.review-log .rv-ev1 { color: #c9d7f0; }
.review-log .rv-ev2 { color: #e0c9f5; }
.review-log .rv-ev3 { color: #ffe1a0; }
.review-log .rv-ev4 { color: #ffb3a0; }
.review-log .rv-god { color: #fff3cc; font-weight: 700; }
.review-log .rv-dead { color: #ffb0a0; }
.review-log .rv-rare { color: #ffd0a0; }
.review-log .rv-red { color: #ffa08a; 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: #8a9bb9; }

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

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

/* ---------- 高天赋增益 ---------- */
.btn-follow {
  border-color: #d94a3d;
  color: #ffd98a;
  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: #8a9bb9; }
.fb-total { font-size: 15px; color: #f0c46a; 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: #f0c46a; font-size: 12px; margin-bottom: 12px; }
.ach-total {
  text-align: center; color: #f0c46a; font-size: 16px; font-weight: 700;
  margin: 6px 14px 10px; padding: 9px;
  width: calc(100% - 28px);
  background: rgba(216,74,61,.1);
  border: 1px solid rgba(216,74,61,.3);
  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: #b8332a; border-radius: 3px; }
.ach-list::-webkit-scrollbar-track { background: #171e33; border-radius: 3px; }
.ach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #2e3a5e;
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #161d33, #121828);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.ach-item.done { border-color: #d94a3d; background: linear-gradient(180deg, #1c2138, #151b2e); box-shadow: 0 2px 14px rgba(232,182,76,.2); }
.ach-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ach-item.done .ach-name { color: #ffe1a0; }
.ach-item.todo .ach-name { color: #93a4c2; }
.ach-bonus { font-size: 13px; white-space: nowrap; }
.ach-item.done .ach-bonus { color: #6cdb8a; }
.ach-item.todo .ach-bonus { color: #7d8dab; }

/* ---------- 成就达成面包屑 ---------- */
.ach-toast {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99;
  text-align: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #e4574a, #b8332a);
  color: #2a0f0c;
  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,.4);
}
.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: #f0c46a; white-space: nowrap; }

/* ---------- 手动模式 ---------- */
.manual-tip {
  width: 100%;
  text-align: center;
  color: #ff9e6b;
  font-size: 13px;
  padding: 6px 0 2px;
}
.set-tip { margin-top: 6px; color: #8a9bb9; 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: #8a9bb9; text-align: center; padding: 40px 10px; font-size: 13px; line-height: 1.8; }
.hl-row {
  width: 100%;
  background: rgba(14,20,38,.88);
  border: 1px solid #2e3a5e;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.hl-row:active { background: rgba(20,26,48,.95); }
.hl-top { display: flex; align-items: center; gap: 8px; }
.hl-time { color: #9aabc9; font-size: 12px; white-space: nowrap; }
.hl-title { color: #ffe1a0; 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 { background: rgba(232,182,76,.22); color: #ffe1a0; border: 1px solid rgba(232,182,76,.5); }
.hl-badge.fail { background: rgba(216,74,61,.2); color: #ffb0a0; border: 1px solid rgba(216,74,61,.5); }
.hl-badge.dead { background: rgba(120,140,180,.18); color: #b3c0d8; border: 1px solid rgba(120,140,180,.4); }
.hl-badge.pause { background: rgba(139,107,177,.18); color: #d6ddec; border: 1px solid rgba(139,107,177,.4); }
.hl-sub { margin-top: 6px; color: #b9c5da; 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 #8b6bb1; background: rgba(232,182,76,.16); color: #ffd0a0;
  white-space: nowrap; cursor: pointer;
}
.hl-export-btn:active { background: rgba(232,182,76,.3); }
.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(10,14,30,.95); border: 1px solid #8a3a34; border-radius: 20px;
  color: #e9edf7; font-size: 13px; padding: 9px 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  pointer-events: none; text-align: center;
}

/* ============================================================
 * 追加：属性面板两栏（第一栏 资质+寿元+实力 / 第二栏 气+爆发+战力）+ 呼吸法条
 * ============================================================ */
.attr-panel { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.attr-row { display: grid; gap: 10px; }
.attr-row-2 { grid-template-columns: 1fr 1fr; }
.attr-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.attr-row .attr-card {
  background: linear-gradient(180deg, rgba(20,26,48,.94), rgba(14,20,38,.94));
  border: 1px solid #5f3a58;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.attr-row-2 .attr-card { padding: 12px 12px; text-align: center; }
.attr-row-3 .attr-card { padding: 10px 6px; text-align: center; }
.attr-row .attr-name {
  color: #9aabc9;
  font-size: 12px;
  letter-spacing: .5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attr-row-3 .attr-name { font-size: 11px; }
.attr-row .attr-val {
  color: #ffe1a0;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attr-row-2 .attr-val { font-size: 28px; }
.attr-row-3 .attr-val { font-size: 19px; }

/* ---------- 设置：下拉选择 + 速度滑条占满 ---------- */
.set-select {
  width: 100%;
  margin-top: 8px;
  background: #171e33;
  color: #e9edf7;
  border: 1px solid #3a4468;
  border-radius: 8px;
  padding: 9px 6px;
  font-size: 14px;
  outline: none;
}
.speed-range { width: 100%; display: block; margin: 8px 0 0; accent-color: #b8332a; }
#view-settings .settings-body { padding: 14px 12px; }
#view-settings .set-card { width: 100%; }

/* ---------- 事件/剧情选择弹层：类型徽标 + 头部 ---------- */
.choice-box .mask-head { display: flex; align-items: center; gap: 8px; }
/* 弹窗标题：长标题宁可缩小字号，也绝不换行（字号由 game.js fitTitle 实测收缩） */
.choice-mtitle {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 18px;
  color: #f0c46a;
  margin: 0;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
}
.choice-type {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.choice-type.rand { background: rgba(110,150,220,.18); color: #cfe0ff; border: 1px solid rgba(110,150,220,.45); }
.choice-type.plot { background: rgba(216,74,61,.18); color: #ffd9a0; border: 1px solid rgba(216,74,61,.5); }
.choice-type.finale { background: rgba(216,74,61,.24); color: #ffc9a0; border: 1px solid rgba(216,74,61,.55); }

/* ---------- 待决选择悬浮提示 ---------- */
#choice-float {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: 88vw;
  background: linear-gradient(180deg, #c9403a, #8f2c26);
  color: #fff;
  border: 1px solid #e4574a;
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 6px 22px rgba(0,0,0,.5);
  cursor: pointer;
  white-space: nowrap;
}
#choice-float:active { transform: translateX(-50%) scale(.96); }
/* 待决时：透明全屏感应层（在内容之上、浮标之下），点击页面任意位置重新唤出选择 */
#choice-tap {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: transparent;
  cursor: pointer;
}
#choice-float { z-index: 60; }
.mask-box .mask-head + .choice-desc { margin-top: 2px; }

/* ---------- 普通/剧情事件选择结果 · 顶部悬浮胶囊（贴顶部偏下、不贴屏幕最顶端） ---------- */
.ev-toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  z-index: 98;
  width: auto;
  max-width: 86vw;
  text-align: center;
  padding: 9px 16px;
  background: linear-gradient(180deg, #9c3630, #6d241f);
  color: #ffe7d0;
  font-size: 13.5px;
  line-height: 1.55;
  border: 1px solid #ffcf90;
  border-radius: 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  transform: translate(-50%, -150%);
  transition: transform .32s ease;
  pointer-events: none;
}
.ev-toast.show { transform: translate(-50%, 0); }
#finale-desc { white-space: pre-line; }

/* ---------- 机缘（无选项特殊事件） ---------- */
.log-item.special {
  background: linear-gradient(90deg, rgba(200,110,255,.18), rgba(232,182,76,.18));
  border: 1px solid rgba(210,140,255,.55);
  color: #f0d9ff;
  font-weight: 700;
}
.review-log .rv-special { color: #e5c3ff; font-weight: 700; }
.special-box { align-items: stretch; }
.special-box .choice-desc { white-space: pre-line; }

/* ---------- 游戏页 · 呼吸法条 ---------- */
.breath-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(139,107,177,.20), rgba(216,74,61,.16));
  border: 1px solid rgba(139,107,177,.45);
  text-align: center;
}
.breath-strip-name { color: #e5c3ff; font-size: 14px; font-weight: 700; letter-spacing: 2px; }
.breath-strip-desc { color: #8a9bb9; font-size: 11px; }

/* ---------- 呼吸法觉醒（开局三选一） ---------- */
.breath-box { width: 340px; }
.breath-cards { display: flex; flex-direction: column; gap: 10px; }
.breath-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #2e3a5e;
  background: linear-gradient(180deg, #1b2540, #131b30);
  color: #e9edf7;
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.breath-card:active { transform: scale(.98); filter: brightness(1.2); }
.breath-card .breath-name { font-size: 17px; font-weight: 700; letter-spacing: 2px; color: #cfe0ff; }
.breath-card .breath-desc { font-size: 12px; color: #93a4c2; }
/* 日之呼吸：九彩卡面（隐藏效果不向玩家提示，仅以此暗示它不一般） */
.breath-card.sun {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, #241d33, #120f1c) padding-box,
    linear-gradient(100deg, #ff5959, #ffb347, #ffe66d, #6fdc8c, #4fc3f7, #7c7cff, #c77dff, #ff7ad9, #ff9a8a) border-box;
  animation: sunGlow 3.2s ease-in-out infinite alternate;
}
.breath-card.sun .breath-name {
  background: linear-gradient(100deg, #ff5959, #ffb347, #ffe66d, #6fdc8c, #4fc3f7, #7c7cff, #c77dff, #ff7ad9, #ff9a8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.breath-card.sun .breath-desc { color: #f0c46a; }
@keyframes sunGlow {
  from { box-shadow: 0 0 14px rgba(199,125,255,.40); }
  to   { box-shadow: 0 0 26px rgba(79,195,247,.65); }
}
.breath-tip { color: #8a9bb9; }
