/* ============================================================
 * 修仙种田模拟器 · 样式（移动优先，兼容电脑 480px 容器）
 * 主题：青碧灵田（深墨绿底 + 灵玉青 + 稻金）· 暗色配色
 * 背景使用纯色（长列表滚动不出现上下分层）
 * ============================================================ */
[hidden] { display: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: #0f1a17;
  color: #e4efe6;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100%;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #0f1a17;
  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% 30%, rgba(201,176,106,.10) 0%, rgba(201,176,106,0) 45%, rgba(201,176,106,.08) 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 #2e4a3f;
  background: linear-gradient(180deg, #1e2f28, #15221d);
  color: #d3e2d6;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,.10);
}
.btn:active { transform: scale(.97); filter: brightness(1.03); }
.btn-primary {
  border: 1px solid #c9b06a;
  background: linear-gradient(180deg, #e3c97f, #c9b06a);
  color: #16241f;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(201,176,106,.28);
}
.btn-big { width: 100%; padding: 14px 20px; font-size: 17px; border-radius: 12px; }
/* 首页主按钮「开始修行」：整体矮一截、内部不留空（其余 btn-big 不受影响） */
#btn-start { padding: 8px 20px; font-size: 16px; line-height: 1.25; border-radius: 10px; }
.btn-danger { border-color: #a08680; color: #b4553f; }
.btn-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #2e4a3f;
  background: linear-gradient(180deg, #1e2f28, #15221d);
  color: #d3e2d6;
  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, #f1dea0, #c9b06a 55%, #6d5a1c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(227,201,127,.35);
}
/* ⚠ 副标题整行永不换行：放不下由 game.js 的 fitHomeSub() 逐 0.5px 缩字号（13 → 8px） */
.home-sub { color: #9fb2a6; font-size: 13px; margin-top: 4px; letter-spacing: 1px; white-space: nowrap; }
.home-count {
  background: rgba(201,176,106,.08);
  border: 1px solid rgba(201,176,106,.22);
  border-radius: 20px;
  padding: 8px 14px;
  color: #c9b06a;
  font-size: 12px;
  white-space: nowrap;
}
.home-count b { font-size: 13px; }
.home-lv {
  width: 100%;
  background: #16241f;
  border: 1px solid #2e4a3f;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
/* 一行放下：玩家等级 · [Lv.N] · 经验 · 初始行动力加成（放不下优先挤经验那段的字号） */
.lv-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lv-name { color: #9fb2a6; font-size: 13px; flex: none; }
.lv-lv { color: #e3c97f; font-size: 16px; font-weight: 700; flex: none; }
.lv-exp-inline { color: #7f948a; font-size: 12px; white-space: nowrap; flex: none; }
.lv-bonus { color: #d4b45c; font-size: 11px; white-space: nowrap; margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.lv-exp-line { margin-top: 7px; color: #7f948a; font-size: 12px; text-align: center; }
/* 经验条：轨道比卡片底色更暗，能看出「满」在哪 */
.lv-bar {
  height: 10px;
  background: #24382f;
  border: 1px solid #2e4a3f;
  border-radius: 5px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.18);
  overflow: hidden;
  margin-top: 8px;
}
.lv-bar-fill { height: 100%; background: linear-gradient(90deg, #e3c97f, #c9b06a); 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: #16241f; border: 1px solid #2e4a3f; border-radius: 12px; padding: 12px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.set-card .set-row { justify-content: space-between; }
.set-card .speed-label { margin-bottom: 4px; }
.about-body { width: 100%; padding: 14px; }
.about-text {
  background: #16241f;
  border: 1px solid #2e4a3f;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 2;
  color: #d3e2d6;
}
.about-text b { color: #e3c97f; }
.home-sound { width: 100%; display: flex; justify-content: center; margin-top: 4px; }
.btn-sound {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid #2e4a3f;
  background: linear-gradient(180deg, #1e2f28, #15221d);
  color: #d3e2d6;
  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.05); }
.home-speed {
  width: 100%;
  max-width: 260px;
  background: #16241f;
  border: 1px solid #2e4a3f;
  border-radius: 12px;
  padding: 8px 14px;
}
.speed-label { display: flex; justify-content: space-between; align-items: center; color: #9fb2a6; font-size: 13px; }
.speed-label b { color: #c9b06a; }
.speed-range { width: 100%; margin-top: 6px; accent-color: #c9b06a; }
.home-tip {
  width: 100%;
  background: #16241f;
  border: 1px solid #2e4a3f;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}
.tip-title { color: #c9b06a; font-size: 13px; margin-bottom: 6px; letter-spacing: 2px; text-align: center; }
.tip-text { color: #9fb2a6; font-size: 12px; line-height: 1.8; text-align: left; }
.qr-area { width: 100%; text-align: center; margin-top: 10px; }
.qr-text { color: #7f948a; 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: #d3e2d6; }
.set-label2 { font-size: 15px; color: #d3e2d6; margin-bottom: 8px; }
.set-select {
  width: 100%;
  background: #16241f;
  color: #d3e2d6;
  border: 1px solid #2e4a3f;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7f948a 50%), linear-gradient(135deg, #7f948a 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: #24382f;
  border: 1px solid #2e4a3f;
  border-radius: 13px;
  transition: background .2s;
}
.track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #6f8177;
  transition: transform .2s, background .2s;
}
.set-switch input:checked + .track { background: #e3c97f; border-color: #c9b06a; }
.set-switch input:checked + .track::after { transform: translateX(22px); background: #f5efe0; }

/* ---------- 游戏 ---------- */
#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: #e3c97f;
  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 #2e4a3f;
  background: linear-gradient(180deg, #1e2f28, #15221d);
  color: #d3e2d6;
  font-size: 17px;
  cursor: pointer;
}
.btn-pause:active { transform: scale(.94); }

.attr-grid {
  width: 100%;
  display: grid;
  /* ⚠ 必须 4 列 × 2 行：首行 等级/模拟点/灵根/气运，次行 修为/法宝战力/法宝加成/总战力。
   *   8 张卡各占 1 格 = 8 格，正好 2×4 —— 总战力**不跨列**（跨 2 列会变成 9 格，被迫挤出第 3 行）。 */
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.attr-span2 { grid-column: auto; }   /* 保留类名兼容，但不再跨列 */
.attr-card {
  background: linear-gradient(180deg, #1e2f28, #15221d);
  border: 1px solid #2e4a3f;
  border-radius: 12px;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.07);
}
.attr-name { color: #9fb2a6; font-size: 11.5px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attr-rank { color: #c9b06a; font-weight: 700; font-size: 12px; }
.attr-val { color: #e3c97f; font-size: 24px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.attr-coef { color: #e3c97f; font-size: 19px; }
.attr-sub { color: #7f948a; 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(22,36,31,.72);
  border: 1px solid #2e4a3f;
  border-radius: 10px;
  min-height: 20px;
  max-height: 96px;
  overflow-y: auto;
}
.huan-label { color: #7f948a; 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;
}
/* 档位配色：练气级→渡劫级 由苔青渐入流金 */
.hc-t1  { background: #2a3138; color: #b9c4bd; }                              /* 练气级 */
.hc-t2  { background: #274038; color: #8fd0b0; }                              /* 筑基级 */
.hc-t3  { background: #22453f; color: #7fd6c0; }                              /* 金丹级 */
.hc-t4  { background: #1f3f4d; color: #7fc2d8; }                              /* 结婴级 */
.hc-t5  { background: #26394f; color: #8fb0dc; }                              /* 化神级 */
.hc-t6  { background: #332e4f; color: #b0a0e0; }                              /* 出窍级 */
.hc-t7  { background: #3d3323; color: #dcc27a; }                              /* 反虚级 */
.hc-t8  { background: #4a3c1c; color: #e3c97f; }                              /* 合体级 */
.hc-t9  { background: #57451f; color: #f1dea0; }                              /* 大乘级 */
.hc-t10 { background: #5c3f14; color: #ffe9a8; box-shadow: 0 0 6px rgba(176,138,42,.5); }  /* 渡劫级 */
/* 法宝胶囊：档位底色 + 金色描边区分于机缘 */
.frt-chip { box-shadow: inset 0 0 0 1px rgba(176,138,42,.6); }
/* 仙灵气胶囊：紫金流光，恒排机缘栏第一位 */
.xian-chip {
  background: linear-gradient(90deg, #ede2ff, #fff3d0);
  color: #6a4a9a;
  box-shadow: inset 0 0 0 1px rgba(150,110,210,.55);
}
.settle-huan { justify-content: center; margin-top: 10px; }

.log-box {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(22,36,31,.72);
  border: 1px solid #2e4a3f;
  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(24,38,32,.9);
  color: #d3e2d6;
}
/* ⚠ 深色主题下每条事件日志都要「深底 + 亮字」，且各档位颜色互相区分得开 */
.log-item.year{ background: transparent; color: #9d9689; font-size: 12.5px; }
.log-item.brk { background: #16281f; border: 1px solid #4fae7e; color: #86e0ae; }               /* 突破 · 绿 */
.log-item.ev1 { background: #16232e; border: 1px solid rgba(74,134,180,.6); color: #8fc4e8; }    /* 事件一档 · 蓝 */
.log-item.ev2 { background: #241d33; border: 1px solid rgba(150,120,210,.6); color: #c3aef0; }   /* 事件二档 · 紫 */
.log-item.ev3 { background: #2a2314; border: 1px solid rgba(212,180,92,.6); color: #edcf8a; }    /* 事件三档 · 金 */
.log-item.ev4 { background: #2c1a18; border: 1px solid rgba(224,139,128,.6); color: #f0968a; }   /* 事件四档 · 红 */
.log-item.huan{ background: #241d33; border: 1px solid rgba(150,120,210,.6); color: #c3aef0; }   /* 突破大境界 · 紫 */
.log-item.rare{ background: #2a2314; border: 1px solid rgba(212,180,92,.5); color: #edcf8a; }    /* 稀有 · 金 */
.log-item.red {
  background: #2c1a18;
  border: 1px solid rgba(224,139,128,.6);
  color: #f0968a;
  font-weight: 700;
}
.log-item.gold {
  background: linear-gradient(180deg, #2a2314, #241f17);
  border: 1px solid #e0c070;
  color: #f1dea0;
  font-weight: 700;
}
.log-item.xian {
  background: linear-gradient(90deg, #2a2340, #241d33);
  border: 1px solid #b0a0e0;
  color: #d3c2ff;
  font-weight: 700;
}
/* 七彩流光：天劫专用（深底 + 赤橙黄绿青蓝紫七色带，文字保持亮色可读） */
.log-item.rainbow {
  background-color: #14181f;
  background-image: linear-gradient(90deg,
    rgba(226,110,110,.45), rgba(226,150,80,.45), rgba(224,200,96,.45),
    rgba(110,200,130,.45), rgba(96,190,205,.45), rgba(104,146,226,.45), rgba(170,124,224,.45));
  background-size: 400% 100%;
  border: 1px solid rgba(201,176,106,.5);
  color: #f4eede;
  font-weight: 700;
  animation: rainbowShift 1.6s linear infinite;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
@keyframes rainbowShift { 0% { background-position: 0% 0; } 100% { background-position: 400% 0; } }
.log-item.god { background: linear-gradient(180deg, #332b1a, #2a2314); border: 1px solid #d4b45c; color: #ffe9a8; font-weight: 700; }
/* 特殊事件（灵根蜕变）：深底七彩流光，一辈子可能只碰一次 */
.log-item.special {
  background-color: #1a1408;
  background-image: linear-gradient(90deg, rgba(255,214,120,.42), rgba(150,210,255,.42), rgba(220,170,255,.42), rgba(255,214,120,.42));
  background-size: 400% 100%;
  border: 1px solid #d4b45c;
  color: #ffe9a8;
  font-weight: 700;
  animation: rainbowShift 2.4s linear infinite;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.log-item.dead{ background: #2c1c1c; border: 1px solid rgba(200,110,100,.5); color: #e8a89e; }

/* ---------- 天劫闪电特效（每行天劫日志触发一次） ---------- */
#trib-fx {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
.trib-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(125% 90% at 50% 0%,
    rgba(255,255,255,.96) 0%, rgba(186,220,255,.62) 38%, rgba(120,160,255,.16) 66%, rgba(120,160,255,0) 88%);
  opacity: 0;
  animation: tribFlash .55s ease-out;
}
.trib-bolt {
  position: absolute;
  top: -6%;
  opacity: 0;
  animation: tribBolt .55s ease-out;
  filter: drop-shadow(0 0 6px rgba(160,205,255,.95)) drop-shadow(0 0 20px rgba(90,140,255,.75));
}
@keyframes tribFlash {
  0%   { opacity: 0; }
  6%   { opacity: 1; }
  15%  { opacity: .10; }
  22%  { opacity: .88; }
  36%  { opacity: .16; }
  52%  { opacity: .42; }
  100% { opacity: 0; }
}
@keyframes tribBolt {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  16%  { opacity: .08; }
  24%  { opacity: .96; }
  40%  { opacity: .18; }
  56%  { opacity: .55; }
  100% { opacity: 0; }
}
/* 用户关掉动效偏好时，只留一记静态闪光 */
@media (prefers-reduced-motion: reduce) {
  .trib-flash, .trib-bolt { animation-duration: .3s; animation-iteration-count: 1; }
}

/* ---------- 结算 ---------- */
#view-settle { justify-content: center; padding-top: 8px; padding-bottom: 8px; }
.settle-box {
  width: 100%;
  background: #16241f;
  border: 1px solid #2e4a3f;
  border-radius: 16px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.settle-title { text-align: center; font-size: 22px; font-weight: 700; color: #e3c97f; }
.settle-title.god { color: #c9b06a; text-shadow: 0 0 24px rgba(212,180,92,.5); }
/* 天劫相关标题：七彩流光文字 */
.settle-title.trib {
  background: linear-gradient(90deg, #c33b3b, #d67b1e, #b89a12, #1f8a4d, #1b7f92, #2a5cb8, #7a45c0);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowShift 2.2s linear infinite;
}
.settle-wuhun { text-align: center; color: #9fb2a6; font-size: 13.5px; }
.settle-wuhun b { color: #e3c97f; }
.settle-rows { display: flex; flex-direction: column; }
.s-row {
  display: flex; justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed #24382f;
  font-size: 14px;
}
.s-row:last-child { border-bottom: none; }
.s-row span { color: #9fb2a6; }
.s-row b { color: #d3e2d6; }
.settle-god {
  text-align: center;
  font-size: 14px;
  color: #e3c97f;
  background: linear-gradient(180deg, rgba(212,180,92,.16), rgba(212,180,92,.05));
  border: 1px solid rgba(212,180,92,.45);
  border-radius: 10px;
  padding: 10px;
  letter-spacing: 1px;
}
.settle-xinwu { font-size: 12.5px; color: #dcc27a; line-height: 1.6; text-align: center; }
.settle-rank {
  background: rgba(201,176,106,.08);
  border: 1px solid rgba(201,176,106,.22);
  border-radius: 10px;
  padding: 7px;
  color: #c9b06a;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
.settle-note {
  background: rgba(192,57,43,.06);
  border: 1px solid rgba(192,57,43,.28);
  border-radius: 10px;
  padding: 8px 10px;
  color: #e08b80;
  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%;
  padding: 14px 14px 10px;
  background: #16241f;
  border-bottom: 1px solid #24382f;
  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: #e3c97f;
  letter-spacing: 2px;
  white-space: nowrap;
}
.btn-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #2e4a3f;
  background: #16241f;
  color: #7f948a;
  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; }
.tab {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 8px 0;
  background: #16241f;
  color: #9fb2a6;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.tab.active { background: linear-gradient(180deg, #e3c97f, #c9b06a); color: #16241f; }
.lb-note { padding: 6px 14px 0; font-size: 12px; color: #c9b06a; width: 100%; }
.lb-fate-note { padding: 6px 14px 0; font-size: 11.5px; color: #c9b06a; width: 100%; line-height: 1.6; }
.lb-body { padding: 8px 14px 30px; width: 100%; }
.lb-tip { text-align: center; color: #7f948a; padding: 30px 0; font-size: 14px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #16241f;
  border: 1px solid #24382f;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  box-shadow: 0 1px 5px rgba(0,0,0,.06);
}
.lb-row.me { box-shadow: 0 0 0 2px #e3c97f inset; background: rgba(227,201,127,.12); }
.lb-rank {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #0f1a17;
  color: #7f948a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
}
.lb-rank.top { background: #d4b45c; color: #1a1408; }
.lb-rank.top.r1 { background: #e0a92c; }
.lb-rank.top.r2 { background: #cbb46a; }
.lb-rank.top.r3 { background: #b79a5a; }
.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: #d3e2d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-size: 15px; font-weight: 700; color: #e3c97f; flex: none; white-space: nowrap; }
.lb-time { font-size: 11px; color: #7f948a; 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(227,201,127,.28), rgba(227,201,127,.10));
  border: 1px solid rgba(201,176,106,.5);
  color: #e3c97f;
  font-weight: 700;
}
.dex-item.lack {
  background: #16241f;
  border: 1px solid #24382f;
  color: #9fb2a6;
}

/* ---------- 遮罩 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(30,48,40,.72);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mask-box {
  width: 300px;
  max-width: 86vw;
  background: #16241f;
  border: 1px solid #2e4a3f;
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(201,176,106,.22);
}
.mask-title { text-align: center; font-size: 20px; color: #e3c97f; font-weight: 700; letter-spacing: 2px; }
.mask-info { text-align: center; color: #9fb2a6; 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: #16241f;
  border: 1px solid #24382f;
  border-radius: 10px;
  padding: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #d3e2d6;
  -webkit-overflow-scrolling: touch;
}
/* ⚠ 这里的配色必须与主日志 `.log-item.*` 一一对应（换肤时最容易漏的就是这一套）：
 *   突破=绿 / 大境界=紫 / 事件四档=蓝·紫·金·红 / 陨落·争夺=红 / 法宝·稀有·飞升=金 / 仙灵气=紫 */
.review-log .rv-brk { color: #86e0ae; }
.review-log .rv-ev1 { color: #8fc4e8; }
.review-log .rv-ev2 { color: #c3aef0; }
.review-log .rv-ev3 { color: #edcf8a; }
.review-log .rv-ev4 { color: #f0968a; }
.review-log .rv-god { color: #ffe9a8; font-weight: 700; }
.review-log .rv-dead { color: #e8a89e; }
.review-log .rv-rare { color: #edcf8a; }
.review-log .rv-red { color: #f0968a; font-weight: 700; }
.review-log .rv-gold { color: #f1dea0; font-weight: 700; }
.review-log .rv-xian { color: #d3c2ff; font-weight: 700; }
.review-log .rv-special { color: #ffe9a8; font-weight: 700; }
.review-log .rv-huan { color: #c3aef0; }
/* 回顾一世里的天劫行：七彩文字（七色，赤橙黄绿青蓝紫） */
.review-log .rv-rainbow {
  background: linear-gradient(90deg, #c33b3b, #d67b1e, #b89a12, #1f8a4d, #1b7f92, #2a5cb8, #7a45c0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.review-log .rv-year { color: #a9a294; }

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

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

/* ---------- 高阶灵根增益（点赞/投币/关注） ---------- */
/* ⚠ 这一条文案很长，永不换行：放不下由 game.js 的 fitFollowBtn() 逐 0.5px 缩字号（12 → 9px） */
.btn-follow {
  border-color: #d4b45c;
  color: #c9b06a;
  /* 它与下面「全站最多成仙」那一行要贴紧：
   * #view-home 是 flex + gap:12px，所以这里用负 margin 把最终间距压到 ~4px。 */
  margin-top: 0;
  margin-bottom: -8px;
  font-size: 12px;              /* 基础字号 14 → 12（文案太长，先降 2px 打底） */
  padding: 8px 16px;            /* 上下留白也压一压，别占一行高 */
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.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: #e3c97f; 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: #c9b06a; }
.fb-state.todo { color: #9fb2a6; }
.fb-total { font-size: 15px; color: #c9b06a; 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: #c9b06a; font-size: 12px; margin-bottom: 12px; }
.ach-total {
  text-align: center; color: #e3c97f; font-size: 16px; font-weight: 700;
  margin: 6px 14px 10px; padding: 9px;
  width: calc(100% - 28px);
  background: rgba(201,176,106,.08);
  border: 1px solid rgba(201,176,106,.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: #e3c97f; border-radius: 3px; }
.ach-list::-webkit-scrollbar-track { background: #0f1a17; border-radius: 3px; }
.ach-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #24382f;
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #1e2f28, #15221d);
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.ach-item.done { border-color: #d4b45c; background: linear-gradient(180deg, #201d17, #201d17); box-shadow: 0 2px 14px rgba(212,180,92,.18); }
.ach-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ach-item.done .ach-name { color: #c9b06a; }
.ach-item.todo .ach-name { color: #9fb2a6; }
.ach-bonus { font-size: 13px; white-space: nowrap; }
.ach-item.done .ach-bonus { color: #d4b45c; }
.ach-item.todo .ach-bonus { color: #5f594e; }

/* ---------- 顶部提示条（口径同《FGO模拟器》的 .ach-toast）
 * 成就 / 签到 / 登录奖励 / 购买 等一切「提示」都走这一条：
 * 屏幕顶部居中的药丸，出现即固定在 top:24px，靠透明度淡入淡出。 ---------- */
.ach-toast {
  position: fixed;
  left: 50%; top: 24px; transform: translateX(-50%);
  z-index: 99;
  max-width: 90vw;
  background: rgba(15,26,23,.96);
  border: 1px solid #c9b06a;
  color: #f1dea0;
  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 14px; }
#btn-ach > span:first-child, #btn-rank > span:first-child { font-size: 17px; line-height: 1.3; }
.ach-btn-tip { font-size: 10px; color: #c9b06a; white-space: nowrap; }
#rank-tip { color: #c9b06a; }

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

/* ---------- 遭遇机缘弹窗（可拖动、可收起） ---------- */
#decision-mask { align-items: flex-start; padding-top: 7vh; }
.decision-box { width: 330px; max-width: 90vw; position: relative; cursor: grab; touch-action: none; user-select: none; }
.decision-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid #2e4a3f;
  background: #16241f;
  color: #7f948a;
  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: #9fb2a6; font-size: 11px; line-height: 1.5; }
/* 信息单行不折行（超宽由脚本缩字号适配） */
.decision-info { text-align: center; color: #d3e2d6; font-size: 15px; line-height: 1.6; white-space: nowrap; }
.decision-opts { display: flex; flex-direction: column; gap: 10px; }
/* 选择按钮：文案单行不换行，超宽时缩字号 */
.decision-opt {
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  font-weight: 700;
}
/* 争夺：金赤；放弃：青绿 */
.opt-fight { border: 1px solid #d4b45c; background: linear-gradient(180deg, #f4cf72, #d4b45c); color: #3a2a00; }
.opt-flee  { border: 1px solid #c9b06a; background: linear-gradient(180deg, #8fd0b0, #e3c97f); color: #14231c; }
/* 首页 高光+保底 双按钮同排各占 50% */
.home-duo { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* 首页 高光 / 保底 / 签到 三按钮同排 */
.home-duo.home-trio { grid-template-columns: 1fr 1fr 1fr; }
.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: #c9b06a; white-space: nowrap; }
#btn-guard.on { border-color: #d4b45c; background: linear-gradient(180deg, #201d17, #201d17); box-shadow: 0 2px 14px rgba(212,180,92,.25); }
#btn-guard.on .ach-btn-tip { color: #c9b06a; }

/* 高光列表 / 图片预览 / 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, #1e2f28, #15221d);
  border: 1px solid #24382f;
  border-radius: 11px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;                 /* 点条目即导出结算卡 */
  flex: none;
  box-shadow: 0 1px 5px rgba(0,0,0,.06);
}
.hl-item:active { transform: scale(.99); border-color: #c9b06a; }
.hl-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hl-top b { color: #e3c97f; font-size: 14.5px; }
.hl-innate { color: #c9b06a; font-size: 11.5px; }
.hl-sect { color: #c9b06a; font-size: 11.5px; }
.hl-end { margin-left: auto; color: #e08b80; font-size: 11.5px; }
.hl-mid { margin-top: 3px; color: #9fb2a6; font-size: 11.5px; line-height: 1.45; }
.hl-mid b { color: #d3e2d6; }
.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: #9fb2a6; 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: #0f1a17; border-radius: 12px; }
.hl-btns { display: flex; gap: 8px; width: 100%; }
/* 下载 / 复制 / 关闭：单行不换行，放不下由 fitHLBtns() 缩字号 */
.hl-btns .btn { flex: 1; padding: 9px 4px; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
/* 操作类提示（只服务高光图片的生成/保存/复制）——口径同《FGO模拟器》的 .hl-toast：底部药丸 */
.hl-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  z-index: 98;
  background: rgba(15,26,23,.95);
  border: 1px solid #c9b06a;
  color: #f1dea0;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13px;
  white-space: nowrap;
  max-width: 88vw; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 6px 22px rgba(0,0,0,.45);
}
.guard-box { width: 320px; max-width: 88vw; }
.guard-rows { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.guard-row { background: #16241f; border-radius: 8px; padding: 6px 10px; text-align: left; color: #d3e2d6; font-size: 13px; line-height: 1.6; }
.guard-row b { color: #e3c97f; }
.guard-pts { text-align: center; color: #c9b06a; font-size: 15px; font-weight: 700; }
.guard-pts b { color: #c9b06a; 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 #c9b06a;
  background: linear-gradient(180deg, #e3c97f, #c9b06a);
  color: #16241f;
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: 0 6px 24px rgba(201,176,106,.28);
}
.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: #9fb2a6; 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;
}

/* ============================================================
 * 修仙种田模拟器 · 新增组件（轮回点加成项 / 成仙劫统计 / 每日签到）
 * ============================================================ */

/* ---------- 等级框内的分隔杠 + 轮回点行 ---------- */
.lv-divider { height: 1px; background: rgba(201,176,106,.28); margin: 10px 0 8px; }
.lv-point-line { display: flex; align-items: center; justify-content: space-between; }
.lv-point-name { color: #9fb2a6; font-size: 13px; }
.lv-point-val { color: #e3c97f; font-size: 16px; font-weight: 700; }

/* ---------- 加成项购买列表（四行平铺） ---------- */
/* 四行加成项：**能多挤就多挤** —— 上下 padding / margin 全为 0，行与行之间不留缝 */
.shop-list { margin: 4px 0 0; display: flex; flex-direction: column; gap: 0; }
.shop-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: rgba(201,176,106,.06);
  border: 1px solid rgba(201,176,106,.18);
  border-radius: 8px;
  padding: 0 7px;          /* ⚠ 上下 0 */
  margin: 0;               /* ⚠ 上下 0 */
  min-height: 20px;
}
.shop-label {
  flex: 0 1 auto; min-width: 0;
  color: #d3e2d6; font-size: 11px; line-height: 1.2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.shop-label b { color: #e3c97f; }
.shop-buy {
  flex: none;
  border: 1px solid #c9b06a;
  background: linear-gradient(180deg, #e3c97f, #c9b06a);
  color: #1a1408;
  border-radius: 6px;
  padding: 1px 6px;        /* ⚠ 上下 1px，几乎贴边 */
  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: #2e4a3f; background: linear-gradient(180deg, #1e2f28, #15221d); color: #6f8177; }

/* ---------- 首页 成仙劫统计行 ---------- */
.home-count.home-ascend {
  background: rgba(201,176,106,.10);
  border: 1px solid rgba(201,176,106,.28);
  color: #e3c97f;
}
.home-count.home-ascend b { color: #f1dea0; }

/* ---------- 每日签到（日历）· 结构 / 配色一律照《FGO模拟器》 ---------- */
#view-sign { justify-content: flex-start; }
/* ⚠ `.page-view` 是 padding:0（顶部标题栏自带内边距），签到正文必须自己补左右内边距，
 *   否则日历会比标题栏宽出去 —— 这就是之前「签到页 CSS 不对」的根因。 */
#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: #f1dea0; }
.sign-stat { margin-left: auto; font-size: 12.5px; color: #7fd6c0; }
.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: #7f948a; }
.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(201,176,106,.16);
  background: rgba(18,32,27,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: #7f948a;
}
.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(201,176,106,.28), rgba(201,176,106,.12));
  border-color: #c9b06a; color: #f1dea0; font-weight: 700;
}
.sg.done::after {
  content: ''; position: absolute; right: 3px; bottom: 3px;
  width: 5px; height: 5px; border-radius: 50%; background: #f1dea0;
}
/* 今天：呼吸高亮 */
.sg.today {
  border-color: #7fd6c0;
  box-shadow: 0 0 10px rgba(127,214,192,.55);
  color: #e4efe6; font-weight: 700;
  animation: sgPulse 1.4s ease-in-out infinite;
}
.sg.today.done { border-color: #c9b06a; box-shadow: 0 0 10px rgba(201,176,106,.6); animation: none; }
@keyframes sgPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(127,214,192,.35); }
  50%      { box-shadow: 0 0 16px rgba(127,214,192,.8); }
}
.sign-btns { margin-top: 14px; }
.sign-note {
  margin-top: 10px;
  font-size: 11.5px; line-height: 1.7; color: #7f948a; text-align: center;
}
.sign-note b { color: #e3c97f; }
.btn.gray, .btn[disabled] { border-color: #2e4a3f; background: linear-gradient(180deg, #1e2f28, #15221d); color: #6f8177; box-shadow: none; }

/* ============================================================
 * 修仙种田模拟器 · 灵田（青碧灵田主题）
 *   结构照《金铲铲农场》，去掉顶部 5 个入口与全站统计
 * ============================================================ */
/* 轮回点行右侧的签到小按钮（照《奥特抽卡模拟器》的位置） */
.btn-mini {
  margin-left: 8px; padding: 3px 10px; font-size: 11.5px; font-family: inherit;
  color: #e3c97f; background: rgba(201,176,106,.10);
  border: 1px solid #6f5d28; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.btn-mini:active { transform: scale(.96); background: rgba(201,176,106,.20); }
.btn-mini.done { color: #7fd6c0; border-color: #2e6b58; background: rgba(127,214,192,.10); }
.lv-point-line .lv-point-val { margin-left: auto; }

#view-farm {
  padding: 0 !important;
  height: 100vh; height: 100dvh; min-height: 0;
  display: flex; flex-direction: column; align-items: stretch;
  justify-content: flex-start; overflow: hidden;
  background: #0f1a17;
}
#view-farm .farm-head { flex: none; background: #16241f; }
.farm-status {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 5px; flex: none;
  background: linear-gradient(180deg, #17271f, #13201a);
  border-bottom: 1px solid #2e4a3f;
}
.farm-lv-row { flex: 2 1 0; display: flex; align-items: center; gap: 6px; min-width: 0; }
.farm-status .lv-badge {
  font-size: 11px; color: #d3e2d6; background: rgba(127,214,192,.12);
  border: 1px solid rgba(127,214,192,.28); padding: 1px 7px; border-radius: 9px;
  white-space: nowrap; flex: none;
}
.farm-status .lv-badge b { color: #f1dea0; font-size: 12px; }
.farm-status .exp-bar {
  flex: 1 1 auto; height: 8px; min-width: 24px;
  background: #24382f; border: 1px solid #2e4a3f; border-radius: 4px; overflow: hidden;
}
.farm-status .exp-fill {
  height: 100%; width: 0; border-radius: 4px; transition: width .3s;
  background: linear-gradient(90deg, #7fd6c0, #e3c97f);
}
.farm-status .exp-text { font-size: 9px; color: #9fb2a6; white-space: nowrap; flex: none; }
.farm-status .point-pill {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(180deg, #3a3320, #2a2517); border: 1px solid #6f5d28;
  border-radius: 14px; padding: 2px 8px; color: #f1dea0;
  font-size: 12px; font-weight: 800; white-space: nowrap; min-width: 0;
}
.point-ico { color: #e3c97f; font-size: 11px; }
.point-name { color: #9fb2a6; font-size: 10px; font-weight: 400; }
.follow-bar {
  margin: 5px 10px 3px; width: calc(100% - 20px); padding: 4px 8px;
  background: rgba(22,36,31,.92); border: 1px solid rgba(201,176,106,.45);
  border-radius: 999px; font-size: 10px; font-weight: 700; color: #e3c97f;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: none;
}
.follow-bar b { color: #7fd6c0; font-size: 11px; }
.follow-bar:active { transform: scale(.98); }
.shovel-hint {
  text-align: center; font-size: 12px; color: #e3c97f; background: rgba(201,176,106,.12);
  padding: 4px; border-bottom: 1px solid #2e4a3f; flex: none;
}
.field-wrap { flex: 1; overflow-y: auto; min-height: 0; padding: 8px; -webkit-overflow-scrolling: touch; }
.field { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-width: 580px; margin: 0 auto; }
.plot {
  position: relative; aspect-ratio: 1; border-radius: 10px; min-width: 0;
  background: linear-gradient(180deg, #2a3f33, #1d2e25);
  border: 1px solid #3d5a4a;
  box-shadow: inset 0 1px 3px rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: visible; user-select: none; -webkit-user-select: none; transition: transform .1s;
}
.plot:active { transform: scale(.95); }
.plot.locked { background: repeating-linear-gradient(45deg, #1b2a22, #1b2a22 6px, #16221c 6px, #16221c 12px); border-color: #2e4a3f; }
.plot.locked .lock-ico { font-size: 18px; opacity: .85; }
.plot.locked .lock-cost { font-size: 9px; color: #e3c97f; margin-top: 2px; }
.plot.empty .empty-ico { font-size: 17px; opacity: .4; }
.plot.empty .empty-tip {
  font-size: 8px; color: #9fb2a6; margin-top: 2px; text-align: center; line-height: 1.15;
  max-width: 96%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plot .crop-icon {
  width: 56%; aspect-ratio: 1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #e4efe6;
  border: 1px solid rgba(255,255,255,.18); box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.plot .grow-bar { width: 84%; height: 5px; background: rgba(0,0,0,.30); border-radius: 3px; margin-top: 3px; overflow: hidden; }
.plot .grow-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fd6c0, #3f9e7f); border-radius: 3px; transition: width .3s; }
.plot .grow-time { font-size: 8px; color: #b8c9bd; margin-top: 1px; }
.plot.ready { animation: farmReady 1.2s ease-in-out infinite; border-color: #e3c97f; background: linear-gradient(180deg, #3b3520, #2b2718); }
.plot.ready .ready-tip { font-size: 9px; color: #f1dea0; font-weight: 800; }
@keyframes farmReady { 0%,100% { box-shadow: 0 0 0 0 rgba(227,201,127,.55); } 50% { box-shadow: 0 0 0 5px rgba(227,201,127,0); } }
.plot .plant-tag { position: absolute; top: 1px; right: 2px; font-size: 8px; background: rgba(0,0,0,.45); color: #fff; padding: 0 4px; border-radius: 4px; }
.plot .tag-point { background: #8a6f22; }
.plot .tag-exp { background: #2f6f8a; }
.float-txt {
  position: absolute; left: 50%; top: -8px; transform: translateX(-50%);
  font-weight: 900; font-size: 13px; color: #f1dea0; pointer-events: none;
  text-shadow: -1px 0 0 #0f1a17, 1px 0 0 #0f1a17, 0 -1px 0 #0f1a17, 0 1px 0 #0f1a17, 0 0 4px rgba(0,0,0,.9);
  animation: floatUp .9s ease-out forwards; z-index: 5; white-space: nowrap;
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}
.plot.pop { animation: plotPop .25s ease; }
@keyframes plotPop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.farm-view .bottom-panel {
  background: #16241f; border-top: 2px solid #2e4a3f;
  box-shadow: 0 -2px 8px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  height: 34vh; min-height: 180px; flex: none;
}
.farm-view .bottom-tabs { display: flex; flex: none; }
.farm-view .bottom-tabs .tab {
  flex: 1; padding: 9px 0; font-size: 13px; font-weight: 700;
  color: #8fa398; background: #13201a;
  border: none; border-radius: 0; border-bottom: 3px solid transparent;
}
.farm-view .bottom-tabs .tab.active { color: #7fd6c0; background: #16241f; border-bottom-color: #7fd6c0; }
.farm-view .bottom-tabs .tab-shovel { flex: 0 0 84px; font-size: 12px; }
.farm-view .bottom-tabs .tab-shovel.on { background: rgba(201,176,106,.16); color: #f1dea0; border-bottom-color: #e3c97f; }
.farm-view .panel-body { flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; padding: 8px 8px calc(18px + env(safe-area-inset-bottom)); }
.seed-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding-bottom: 8px; }
.seed-card {
  position: relative; border: 1px solid #2e4a3f; border-radius: 10px; background: #1a2b24;
  padding: 6px 3px 5px; text-align: center; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .1s, border-color .2s; cursor: pointer;
}
.seed-card:active { transform: scale(.95); }
.seed-card .s-avatar-wrap { position: relative; width: 42px; height: 42px; }
.seed-card .s-avatar {
  width: 42px; height: 42px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: #e4efe6;
  border: 1px solid rgba(255,255,255,.16);
}
.seed-card .s-tier {
  position: absolute; left: -3px; top: -3px; font-size: 8px; font-weight: 800;
  color: #e4efe6; padding: 0 4px; border-radius: 5px; z-index: 2;
}
.seed-card .s-tier.g10 { color: #0f1a17; }
.seed-card .s-name { font-size: 10px; color: #d3e2d6; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; width: 100%; }
.seed-card .s-info { font-size: 8px; color: #8fa398; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seed-card .s-count { position: absolute; top: 1px; right: 3px; font-size: 11px; font-weight: 800; color: #7fd6c0; text-shadow: 0 1px 0 #0f1a17; }
.seed-card .s-price { font-size: 10px; font-weight: 800; color: #e3c97f; }
.seed-card .s-type { font-size: 8px; padding: 0 5px; border-radius: 6px; color: #fff; white-space: nowrap; }
.seed-card .s-type.point { background: #8a6f22; }
.seed-card .s-type.exp { background: #2f6f8a; }
.seed-card.selected { border-color: #7fd6c0; box-shadow: 0 0 0 2px rgba(127,214,192,.35); background: #172a22; }
.seed-card.locked { opacity: .50; background: #17231d; }
.seed-card .s-lock { font-size: 9px; color: #8fa398; line-height: 1.25; }
.bag-empty { text-align: center; color: #8fa398; font-size: 13px; padding: 30px 0; }
/* 灵药品级配色：凡→道 10 品 */
.s-tier.g1, .s-avatar.g1, .crop-icon.g1 { background: #5c6b60; }
.s-tier.g2, .s-avatar.g2, .crop-icon.g2 { background: #3f7a5f; }
.s-tier.g3, .s-avatar.g3, .crop-icon.g3 { background: #2f6f8a; }
.s-tier.g4, .s-avatar.g4, .crop-icon.g4 { background: #5a4f8f; }
.s-tier.g5, .s-avatar.g5, .crop-icon.g5 { background: #7a642f; }
.s-tier.g6, .s-avatar.g6, .crop-icon.g6 { background: #8a6f22; }
.s-tier.g7, .s-avatar.g7, .crop-icon.g7 { background: #2f8a7a; }
.s-tier.g8, .s-avatar.g8, .crop-icon.g8 { background: #8a3f6a; }
.s-tier.g9, .s-avatar.g9, .crop-icon.g9 { background: #9a4f2f; }
.s-tier.g10, .s-avatar.g10, .crop-icon.g10 { background: linear-gradient(135deg, #e3c97f, #7fd6c0); color: #0f1a17; }
/* 灵田升级弹层 */
.farm-lvup-box { width: 330px; max-width: 90vw; }
.lvup-seeds { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; }
.lvup-seed { display: flex; align-items: center; gap: 8px; background: #13201a; border: 1px solid #2e4a3f; border-radius: 8px; padding: 6px 8px; }
.lvup-seed .crop-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #e4efe6; flex: none;
}
.lvup-unlock-label { color: #9fb2a6; font-size: 12px; text-align: center; }
.lvup-name { color: #d3e2d6; font-size: 13px; flex: 1; text-align: left; }
.lvup-seed .s-tier { position: static; flex: none; }
/* 灵田确认弹层 */
.farm-confirm-box { width: 300px; max-width: 86vw; }
.farm-confirm-btns { display: flex; gap: 10px; }
.farm-confirm-btns .btn { flex: 1; }

/* 首页灵田入口：有成熟作物时冒金光 */
#farm-btn-title { white-space: nowrap; }
#btn-farm.ready-glow {
  border-color: #e3c97f;
  animation: farmBtnGlow 1.6s ease-in-out infinite;
}
#btn-farm.ready-glow #farm-btn-title {
  font-size: 14px;
  color: #f1dea0;
}
@keyframes farmBtnGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(227,201,127,.45), 0 0 10px rgba(227,201,127,.35); }
  50%      { box-shadow: 0 0 0 2px rgba(227,201,127,.80), 0 0 22px rgba(227,201,127,.70); }
}
