/* ============================================================
 * 新三国模拟器 · 样式（移动优先，兼容电脑 480px 容器）
 * 主题：玄黑 + 汉室朱红 + 赤金
 * 背景使用纯色（长列表滚动不出现上下分层）
 * ============================================================ */
[hidden] { display: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: #120c0c;
  color: #ece0d8;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100%;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #120c0c;
  position: relative;
}
/* 四角暗角，制造压迫感（fixed，不参与滚动） */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  width: 480px; max-width: 100%;
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(0,0,0,.72) 100%);
  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 #4a2a22;
  background: linear-gradient(180deg, #241310, #150e0c);
  color: #ece0d8;
  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 #e0b02e;
  background: linear-gradient(180deg, #cf4530, #8f1f14);
  color: #ffeede;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.btn-big { width: 100%; padding: 14px 20px; font-size: 17px; border-radius: 12px; }
.btn-danger { border-color: #5c2a18; color: #ffb09a; }
.btn-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #4a2a22;
  background: linear-gradient(180deg, #241310, #150e0c);
  color: #ece0d8;
  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;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffd9a0, #d83b2a 58%, #7a1e12);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(216,59,42,.32);
}
.home-sub { color: #9a7a6c; font-size: 13px; margin-top: 4px; letter-spacing: 1px; }
.home-count {
  background: rgba(224,176,46,.07);
  border: 1px solid rgba(224,176,46,.22);
  border-radius: 20px;
  padding: 8px 14px;
  color: #e0b02e;
  font-size: 12px;
  white-space: nowrap;
}
.home-count b { font-size: 13px; }
.home-lv {
  width: 100%;
  background: #1c1210;
  border: 1px solid #4a2a22;
  border-radius: 12px;
  padding: 12px 16px;
}
.lv-head { display: flex; align-items: center; gap: 8px; }
.lv-name { color: #9a7a6c; font-size: 13px; }
.lv-lv { color: #ffd98a; font-size: 16px; font-weight: 700; }
.lv-bonus { color: #d97a3a; font-size: 11px; white-space: nowrap; margin-left: 4px; }
.lv-exp-line { margin-top: 7px; color: #8a7268; font-size: 12px; text-align: center; }
/* 经验条：轨道必须比卡片底色更暗（此前轨道与 .home-lv 同色 #1c1210，导致只看得见进度、看不出「满」在哪） */
.lv-bar {
  height: 10px;
  background: #0a0505;
  border: 1px solid #4a2a22;
  border-radius: 5px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.6);
  overflow: hidden;
  margin-top: 8px;
}
.lv-bar-fill { height: 100%; background: linear-gradient(90deg, #8a5f14, #e0b02e); 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: 10px; }
.home-link-btns3 { grid-template-columns: 1fr 1fr 1fr; }
.home-link-btns3 .btn-big { padding: 12px 4px; font-size: 15px; }
.settings-body { width: 100%; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.set-card { background: #1c1210; border: 1px solid #4a2a22; 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: #1c1210;
  border: 1px solid #4a2a22;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 2;
  color: #d3c2b8;
}
.about-text b { color: #ffd98a; }
.home-sound { width: 100%; display: flex; justify-content: center; margin-top: 4px; }
.btn-sound {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid #4a2a22;
  background: linear-gradient(180deg, #241310, #150e0c);
  color: #ece0d8;
  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: #1c1210;
  border: 1px solid #4a2a22;
  border-radius: 12px;
  padding: 8px 14px;
}
.speed-label { display: flex; justify-content: space-between; align-items: center; color: #9a7a6c; font-size: 13px; }
.speed-label b { color: #e0b02e; }
.speed-range { width: 100%; margin-top: 6px; accent-color: #b8892e; }
.home-tip {
  width: 100%;
  background: #1c1210;
  border: 1px solid #33201c;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}
.tip-title { color: #e0b02e; font-size: 13px; margin-bottom: 6px; letter-spacing: 2px; text-align: center; }
.tip-text { color: #9a7a6c; font-size: 12px; line-height: 1.8; text-align: left; }
.qr-area { width: 100%; text-align: center; margin-top: 10px; }
.qr-text { color: #8a7268; 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: #d3c2b8; }
.set-label2 { font-size: 15px; color: #d3c2b8; margin-bottom: 8px; }
.set-select {
  width: 100%;
  background: #150e0c;
  color: #ece0d8;
  border: 1px solid #4a2a22;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8a7268 50%), linear-gradient(135deg, #8a7268 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.set-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.set-switch input { opacity: 0; width: 0; height: 0; }
.track {
  position: absolute; inset: 0;
  background: #20120f;
  border: 1px solid #4a2a22;
  border-radius: 13px;
  transition: background .2s;
}
.track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #9a7a6c;
  transition: transform .2s, background .2s;
}
.set-switch input:checked + .track { background: #b8892e; border-color: #b8892e; }
.set-switch input:checked + .track::after { transform: translateX(22px); background: #fff2e6; }

/* ---------- 游戏 ---------- */
#view-game { padding-top: 0; padding-bottom: 20px; }
.game-top {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px 4px;
}
.game-title {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  letter-spacing: 3px;
  color: #e0b02e;
  font-weight: 700;
  white-space: nowrap;
  padding: 0 46px;
  overflow: hidden;
  text-align: center;
}
.btn-pause {
  position: absolute;
  right: 4px; top: 10px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid #4a2a22;
  background: linear-gradient(180deg, #241310, #150e0c);
  color: #ece0d8;
  font-size: 17px;
  cursor: pointer;
}
.btn-pause:active { transform: scale(.94); }

/* 属性两行：第一行 武将/等级/武力/谋略/统帅（5 栏）；第二行 个人战力/军力/势力/总战力（4 栏） */
.attr-row {
  width: 100%;
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.attr-row1 { grid-template-columns: repeat(5, 1fr); }
.attr-row2 { grid-template-columns: repeat(4, 1fr); margin-top: 6px; }
.attr-card {
  background: linear-gradient(180deg, #150e0c, #150e0c);
  border: 1px solid #4a2a22;
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.attr-name { color: #9a7a6c; font-size: 11px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.attr-rank { color: #e0b02e; font-weight: 700; font-size: 12px; }
/* 5 栏排布下数值字号略小，并由脚本按宽度再缩（fitVal） */
.attr-row1 .attr-val { font-size: 18px; }
.attr-val { color: #ffd98a; font-size: 21px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-align: center; }
.attr-coef { color: #ffd98a; font-size: 19px; }
.attr-sub { color: #8a7268; font-size: 12px; }

/* 战果栏（游戏页属性区下）：攻取的城池 / 收服的武将 / 得到的兵器，各占一行 */
.huan-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(28,18,16,.72);
  border: 1px solid #4a2a22;
  border-radius: 10px;
  min-height: 20px;
  max-height: 96px;
  overflow-y: auto;
}
.huan-label { color: #8a7268; font-size: 12px; margin-right: 2px; }
.huan-chip {
  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;
}
/* 档位配色：F→EX 由玄黑渐入赤金，最后落在朱红 */
.hc-t1  { background: #3a4a5c; color: #e0dcd4; }                              /* F */
.hc-t2  { background: #2f6b8f; color: #ffeae0; }                              /* E */
.hc-t3  { background: #2b8f9c; color: #e6fdff; }                              /* D */
.hc-t4  { background: #2f9e6e; color: #eafff5; }                              /* C */
.hc-t5  { background: #6a9a3f; color: #f4ffe8; }                              /* B */
.hc-t6  { background: #a08a2f; color: #fff8dd; }                              /* A */
.hc-t7  { background: #b8892e; color: #fff4d6; }                              /* S */
.hc-t8  { background: #e0aa2c; color: #3a2a00; }                              /* SS */
.hc-t9  { background: #e07a1f; color: #fff2e0; }                              /* SSS */
.hc-t10 { background: #c8281f; color: #ffe4e0; box-shadow: 0 0 6px rgba(214,52,36,.65); } /* EX */
/* 兵器胶囊：档位底色 + 赤金描边区分于城池/武将 */
.frt-chip { box-shadow: inset 0 0 0 1px rgba(224,176,46,.75); }
.settle-huan { justify-content: center; margin-top: 10px; }

.log-box {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(18,12,12,.78);
  border: 1px solid #33201c;
  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(48,28,24,.55);
  color: #d3c2b8;
}
/* 基础修炼（未突破的逐回合微增）：灰色；突破成功：绿色 */
.log-item.year{ background: rgba(120,114,110,.10); color: #9a9490; font-size: 12.5px; }
.log-item.brk { background: rgba(60,150,90,.14); border: 1px solid rgba(74,176,104,.42); color: #a8e6b8; }
.log-item.ev1 { background: rgba(110,140,180,.12); border: 1px solid rgba(110,140,180,.3); color: #c8d8e4; }
.log-item.ev2 { background: rgba(160,110,190,.12); border: 1px solid rgba(160,110,190,.35); color: #d8c8f0; }
.log-item.ev3 { background: rgba(200,150,70,.12); border: 1px solid rgba(200,150,70,.35); color: #e6d9a8; }
.log-item.ev4 { background: rgba(214,72,52,.15); border: 1px solid rgba(214,72,52,.45); color: #f0b0b8; }
.log-item.huan{ background: rgba(170,90,170,.18); border: 1px solid rgba(180,90,160,.55); color: #e0c8ff; }  /* 战斗与脱身结果：幽紫 */
.log-item.rare{ background: rgba(210,140,60,.13); border: 1px solid rgba(210,140,60,.35); color: #e0c69a; }
.log-item.red {
  background: rgba(214,52,36,.16);
  border: 1px solid rgba(224,60,40,.5);
  color: #ff8a8a;
  font-weight: 700;
}
.log-item.rainbow {
  background: linear-gradient(90deg, rgba(200,50,50,.28), rgba(200,150,60,.28), rgba(224,176,46,.28), rgba(90,120,180,.28), rgba(140,90,200,.28));
  background-size: 400% 100%;
  border: 1px solid rgba(255,238,230,.35);
  color: #fff2e6;
  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(224,176,46,.16); border: 1px solid rgba(224,176,46,.5); color: #fff6dc; font-weight: 700; }
.log-item.dead{ background: rgba(160,40,36,.15); border: 1px solid rgba(190,50,40,.4); color: #ffb0b8; }
/* 攻城 / 斗将 / 兵器：不再一律红色，按档位分四色
 * F E D 蓝 · C B A 紫 · S SS 金 · SSS EX 红 */
.log-item.c1 { background: rgba(110,140,180,.13); border: 1px solid rgba(110,140,180,.34); color: #c8d8e4; }
.log-item.c2 { background: rgba(160,110,190,.14); border: 1px solid rgba(160,110,190,.4); color: #dcc8f0; }
.log-item.c3 { background: rgba(200,150,70,.15); border: 1px solid rgba(200,150,70,.45); color: #f0d9a8; }
.log-item.c4 { background: rgba(214,72,52,.18); border: 1px solid rgba(214,72,52,.55); color: #ffb0a0; font-weight: 700; }
/* 榜单名次加成说明（排行榜页） */
.rank-fate-note { width: 100%; text-align: center; color: #d97a3a; font-size: 12px; padding: 2px 0 4px; }

/* ---------- 结算 ---------- */
#view-settle { justify-content: center; padding-top: 8px; padding-bottom: 8px; }
.settle-box {
  width: 100%;
  background: #1c1210;
  border: 1px solid #4a2a22;
  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: #ffd98a; }
.settle-title.god { color: #fff2e6; text-shadow: 0 0 24px rgba(224,176,46,.6); }
/* 称帝（成功/失败一视同仁）一律七彩 */
.settle-title.rainbow {
  color: #fff2e6;
  background: linear-gradient(90deg, rgba(200,50,50,.55), rgba(200,150,60,.55), rgba(224,176,46,.55), rgba(90,120,180,.55), rgba(140,90,200,.55));
  background-size: 400% 100%;
  border: 1px solid rgba(255,238,230,.35);
  border-radius: 10px;
  padding: 6px 0;
  animation: rainbowShift 1.2s linear infinite;
}
.settle-wuhun { text-align: center; color: #8a7268; font-size: 13.5px; }
.settle-wuhun b { color: #ffd98a; }
.settle-rows { display: flex; flex-direction: column; }
.s-row {
  display: flex; justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed #33201c;
  font-size: 14px;
}
.s-row:last-child { border-bottom: none; }
.s-row span { color: #9a7a6c; }
.s-row b { color: #ece0d8; }
.settle-god {
  text-align: center;
  font-size: 14px;
  color: #fff2e6;
  background: linear-gradient(180deg, rgba(224,176,46,.18), rgba(224,176,46,.06));
  border: 1px solid rgba(224,176,46,.45);
  border-radius: 10px;
  padding: 10px;
  letter-spacing: 1px;
}
.settle-xinwu { font-size: 12.5px; color: #ffd98a; line-height: 1.6; text-align: center; }
.settle-rank {
  background: rgba(224,176,46,.07);
  border: 1px solid rgba(224,176,46,.22);
  border-radius: 10px;
  padding: 7px;
  color: #e0b02e;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
.settle-note {
  background: rgba(214,72,52,.08);
  border: 1px solid rgba(214,72,52,.35);
  border-radius: 10px;
  padding: 8px 10px;
  color: #ffb0b8;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}
.settle-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.settle-btns .btn-big { padding: 11px 6px; font-size: 15px; border-radius: 10px; }

/* ---------- 子页通用（标题绝对居中，✕ 固定右上角） ---------- */
.page-view { padding: 0 !important; }
.page-head {
  width: 100%;
  position: relative;
  padding: 14px 14px 10px;
  background: #0a1626;
  border-bottom: 1px solid #33201c;
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 58px;
  display: flex;
  align-items: center;
}
.page-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 19px;
  color: #e0b02e;
  letter-spacing: 2px;
  white-space: nowrap;
}
.btn-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #4a2a22;
  background: #20120f;
  color: #8a7268;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
  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; }
.tabs-wrap { flex-wrap: wrap; gap: 6px; }
.tabs-wrap .tab { flex: 0 0 calc((100% - 24px) / 5); font-size: 12px; padding: 7px 0; }
/* 图鉴四套页签：四等分占满一整行（不套用 5 列换行规则） */
#dex-src {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex-wrap: nowrap;
}
#dex-src .tab {
  flex: none;
  width: 100%;
  padding: 8px 2px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.tab {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 8px 0;
  background: #20120f;
  color: #9a7a6c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab.active { background: linear-gradient(180deg, #e0b02e, #8a5f14); color: #2a1c00; }
.lb-note { padding: 6px 14px 0; font-size: 12px; color: #e0b02e; width: 100%; }
.lb-body { padding: 8px 14px 30px; width: 100%; }
.lb-tip { text-align: center; color: #8a7268; padding: 30px 0; font-size: 14px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1c1210;
  border: 1px solid #33201c;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.lb-row.me { box-shadow: 0 0 0 2px #b8892e inset; background: rgba(184,137,46,.12); }
.lb-rank {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #20120f;
  color: #8a7268;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
}
.lb-rank.top { background: #b4553f; color: #fff; }
.lb-rank.top.r1 { background: #c0143c; }
.lb-rank.top.r2 { background: #b4553f; }
.lb-rank.top.r3 { background: #b8892e; }
.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: #d3c2b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 15px; font-weight: 700; color: #ffd98a; flex: none; white-space: nowrap; }
.lb-time { font-size: 11px; color: #8a7268; flex: none; }

/* ---------- 图鉴 ---------- */
.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(184,137,46,.22), rgba(184,137,46,.08));
  border: 1px solid rgba(224,176,46,.5);
  color: #ffd98a;
}
.dex-item.lack {
  background: #0a1626;
  border: 1px solid #33201c;
  color: #2a4a6a;
}

/* ---------- 暂停遮罩 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(4,14,24,.8);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mask-box {
  width: 300px;
  max-width: 86vw;
  background: #1c1210;
  border: 1px solid #4a2a22;
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
}
.mask-title { text-align: center; font-size: 20px; color: #e0b02e; font-weight: 700; letter-spacing: 2px; }
.mask-info { text-align: center; color: #8a7268; 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(18,12,12,.82);
  border: 1px solid #33201c;
  border-radius: 10px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #d3c2b8;
  -webkit-overflow-scrolling: touch;
}
.review-log .rv-brk { color: #a8e6b8; }
.review-log .rv-ev1 { color: #c8d8e4; }
.review-log .rv-ev2 { color: #d8c8f0; }
.review-log .rv-ev3 { color: #e6d9a8; }
.review-log .rv-ev4 { color: #f0b0b8; }
.review-log .rv-god { color: #fff2e6; font-weight: 700; }
.review-log .rv-dead { color: #ffb0b8; }
.review-log .rv-rare { color: #e0c69a; }
.review-log .rv-red { color: #ff8a8a; font-weight: 700; }
.review-log .rv-huan { color: #e0c8ff; }
.review-log .rv-rainbow {
  background: linear-gradient(90deg, #e8542f, #e0aa2c, #e0b02e, #3d9bd6, #a06bd4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.review-log .rv-year { color: #9a9490; }

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

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

/* ---------- 高阶天赋增益（点赞/投币/关注） ---------- */
.btn-follow {
  border-color: #b8892e;
  color: #e0b02e;
  margin-bottom: 12px;
  font-size: 14px;
  padding: 12px 16px;
}
.follow-box { width: 350px; max-width: 90vw; max-height: 86vh; overflow-y: auto; }
.follow-rows { display: flex; flex-direction: column; gap: 10px; }
.follow-video { color: #ffd98a; font-size: 12px; margin: 4px 0 0; text-align: left; line-height: 1.5; }
.follow-action { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 13px 16px; font-size: 14px; }
.fb-state { font-size: 13px; }
.fb-state.done { color: #ffd76a; }
.fb-state.todo { color: #8a6a5c; }
.fb-total { font-size: 15px; color: #e0b02e; 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: #e0b02e; font-size: 12px; margin-bottom: 12px; }
.ach-total {
  text-align: center; color: #e0b02e; font-size: 16px; font-weight: 700;
  margin: 6px 14px 10px; padding: 9px;
  width: calc(100% - 28px);
  background: rgba(224,176,46,.07);
  border: 1px solid rgba(224,176,46,.22);
  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: #b8892e; border-radius: 3px; }
.ach-list::-webkit-scrollbar-track { background: #20120f; border-radius: 3px; }
.ach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #4a2a22;
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #20120f, #150e0c);
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.ach-item.done { border-color: #b8892e; background: linear-gradient(180deg, #2a1a16, #1c1210); box-shadow: 0 2px 14px rgba(184,137,46,.2); }
.ach-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ach-item.done .ach-name { color: #ffd98a; }
.ach-item.todo .ach-name { color: #9a7a6c; }
.ach-bonus { font-size: 13px; white-space: nowrap; }
.ach-item.done .ach-bonus { color: #ffd76a; }
.ach-item.todo .ach-bonus { color: #2a4a6a; }

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

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

/* ---------- 开局五选一（不可关闭） ---------- */
#view-wake { justify-content: center; }
.wake-box {
  width: 100%;
  max-width: 440px;
  background: #1c1210;
  border: 1px solid #4a2a22;
  border-radius: 16px;
  padding: 22px 16px 18px;
  text-align: center;
}
.wake-title { font-size: 24px; color: #ffd98a; letter-spacing: 3px; font-weight: 700; text-shadow: 0 0 18px rgba(224,176,46,.35); }
.wake-sub { color: #e0b02e; font-size: 14px; margin: 6px 0 4px; font-weight: 700; }
.wake-hint { color: #8a6a5c; font-size: 12px; margin-bottom: 14px; }
.wake-list { display: flex; flex-direction: column; gap: 8px; }
/* 每张卡两行、各自单行不折行：
 *   武将卡1  EX  蜀·关羽  【保底】
 *   武力97  谋略75  统帅92  争霸点113
 * 行内容放不下时由 game.js 的 fitRow() 逐行缩字号（9~12.5px），
 * ⚠ 不靠 scrollWidth 判断（居中溢出测不到左半），用子元素宽度累加判定 */
.wake-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid #4a2a22;
  background: linear-gradient(180deg, #20120f, #150e0c);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
}
.wake-card:active { transform: scale(.98); border-color: #b8892e; filter: brightness(1.12); }
.wake-card.guard { border-color: #b8892e; box-shadow: 0 0 12px rgba(184,137,46,.28); }
.wake-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 10px;
  white-space: nowrap;
  max-width: 100%;
  font-size: 1em;
  font-weight: 700;
  line-height: 1.2;
}
.wake-card-txt { color: #ece0d8; letter-spacing: 0; flex: none; white-space: nowrap; }
.wake-card-no { color: #e0b02e; flex: none; }
.wake-name { color: #ffd98a; flex: none; }
.wake-guard { color: #ff8a6a; flex: none; }
/* 品级字母：小圆角方块 */
.wake-tier {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 17px; border-radius: 8px;
  padding: 0 5px; font-size: 11px; line-height: 1;
}
/* 兵器胶囊：档位底色 + 赤金描边，区分于武将/城池 */
.wpn-chip { box-shadow: inset 0 0 0 1px rgba(224,176,46,.75); }

/* ---------- 遭遇敌对势力弹窗（可拖动、可收起） ---------- */
#decision-mask { align-items: flex-start; padding-top: 7vh; }
.decision-box { width: 330px; max-width: 90vw; position: relative; cursor: grab; touch-action: none; user-select: none; }
.decision-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid #4a2a22;
  background: #20120f;
  color: #8a7268;
  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: #556677; font-size: 11px; line-height: 1.5; }
/* 信息单行不折行（超宽由脚本缩字号适配） */
/* 敌情/我方信息行：正常折行（不再 nowrap + 缩字号） */
.decision-info {
  text-align: center;
  color: #ece0d8;
  font-size: 15px;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}
/* 我方实力行（攻城显示总战力 / 斗将显示武力），单独一行不与敌情挤在一起 */
.decision-own {
  text-align: center;
  color: #e0b02e;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
  margin-top: 2px;
}
.decision-own b { color: #f0d9a8; }
.decision-opts { display: flex; flex-direction: column; gap: 10px; }
/* 选择按钮：文案单行不换行，超宽时缩字号 */
.decision-opt {
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  color: #0a1626;
  font-weight: 700;
}
/* 迎战：红；脱身：绿（文字统一黑色） */
.opt-fight { border: 1px solid #c8281f; background: linear-gradient(180deg, #ff7a4a, #c8281f); color: #14080a; }
.opt-flee  { border: 1px solid #8a5f14; background: linear-gradient(180deg, #e0aa2c, #8a5f14); color: #2a1c00; }
/* 首页 高光+保底 双按钮同排各占 50% */
.home-duo { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-duo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 9px 6px; }
.btn-duo > span:first-child { font-size: 17px; line-height: 1.3; }
.btn-duo .ach-btn-tip { font-size: 10px; color: #e0b02e; white-space: nowrap; }
#btn-guard.on { border-color: #b8892e; background: linear-gradient(180deg, #2a1a16, #1c1210); box-shadow: 0 2px 14px rgba(184,137,46,.28); }
#btn-guard.on .ach-btn-tip { color: #ffd98a; }

/* 高光列表 / 图片预览 / toast */
.hl-box { width: 340px; max-width: 90vw; max-height: 84vh; }
.hl-list { flex: 1; min-height: 120px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.hl-item {
  background: linear-gradient(180deg, #20120f, #150e0c);
  border: 1px solid #4a2a22;
  border-radius: 11px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;                 /* 点条目即导出结算卡 */
  flex: none;
}
.hl-item:active { transform: scale(.99); filter: brightness(1.15); border-color: #b8892e; }
.hl-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hl-top b { color: #ffd98a; font-size: 14.5px; }
.hl-innate { color: #ffd98a; font-size: 11.5px; }
/* 高光列表里的「称帝成功/称帝失败」标签同样用七彩底（白字保证任何环境下都看得见） */
.hl-innate.rainbow {
  color: #fff2e6;
  padding: 1px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255,238,230,.35);
  background: linear-gradient(90deg, rgba(200,50,50,.55), rgba(200,150,60,.55), rgba(224,176,46,.55), rgba(90,120,180,.55), rgba(140,90,200,.55));
  background-size: 400% 100%;
  animation: rainbowShift 1.2s linear infinite;
}
.hl-sect { color: #e0b02e; font-size: 11.5px; }
.hl-end { margin-left: auto; color: #ffb0b8; font-size: 11.5px; }
.hl-mid { margin-top: 3px; color: #9a7a6c; font-size: 11.5px; line-height: 1.45; }
.hl-mid b { color: #ece0d8; }
.hl-ring { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.hl-ring .huan-chip { min-width: 16px; height: 15px; border-radius: 8px; font-size: 9px; padding: 0 5px; }
.hl-ring-cap { color: #9a7a6c; font-size: 9.5px; margin-right: 2px; }
/* 结算卡预览：图片限制在视口内（生成图很高，按宽度等比缩放会撑出屏幕把按钮顶飞） */
#hl-img-mask { align-items: flex-start; overflow-y: auto; padding: 14px 0 calc(20px + env(safe-area-inset-bottom)); }
.hl-img-box { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 92vw; }
.hl-img { width: auto; height: auto; max-width: min(92vw, 400px); max-height: 60vh; background: #040e18; border-radius: 12px; }
.hl-btns { display: flex; gap: 8px; width: 100%; }
.hl-btns .btn { flex: 1; padding: 9px 4px; font-size: 13.5px; }
.hl-toast {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%);
  z-index: 98; background: #b8892e; color: #2a1c00; font-weight: 700; font-size: 14px;
  border-radius: 999px; padding: 10px 18px; box-shadow: 0 6px 20px rgba(0,0,0,.6);
  white-space: nowrap;
}
.guard-box { width: 320px; max-width: 88vw; }
.guard-rows { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.guard-row { background: rgba(15,42,68,.82); border-radius: 8px; padding: 6px 10px; text-align: left; color: #d3c2b8; font-size: 13px; line-height: 1.6; }
.guard-row b { color: #ffd98a; }
.guard-pts { text-align: center; color: #e0b02e; font-size: 15px; font-weight: 700; }
.guard-pts b { color: #ffd98a; font-size: 18px; }

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

/* 高光独立页 */
/* 高光页：页头固定，只有列表滚动（整页撑高会滚不动/把内容顶出视口） */
#view-hl { height: 100vh; overflow: hidden; }
#view-hl .page-head { flex: none; }
.hl-note { width: 100%; padding: 8px 16px 2px; color: #9a7a6c; font-size: 11.5px; }
.hl-list-page {
  width: 100%;
  flex: 1;
  min-height: 0;             /* flex 子容器可滚动的必要条件 */
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
  margin: 0;
}
