/* ============================================================
   炼道 · 全局样式
   主题：冷墨蓝打底 + 紫金强调，厚涂贴图氛围
   ============================================================ */

:root {
  /* 打底三色是冷墨蓝，不再是原来的暗紫：贴图里的夜色才压得住、不打架。
     金（--qi）与紫（--prestige）退居强调色，只点亮「有价值」的东西。 */
  --bg: #070a11;
  --bg-panel: rgba(13, 19, 30, 0.86);
  --bg-elevated: #16202e;
  --border: #233145;
  --track: #1b2534;    /* 进度条凹槽：比面板再亮一点，才看得出「没填满」 */
  --text: #eef2f8;
  --text-dim: #8ea0b8;
  --qi: #ffc857;      /* 灵气金 */
  --qi-glow: #ffb347;
  --prestige: #b98aff; /* 修为紫 */
  --success: #7bd88f;
  --danger: #ff6b6b;
  --affordable: #57cc99;
  /* 这两个在 v0.3/v0.5 的样式里被引用过但从未定义，一直靠 var() 兜底失败取继承值 */
  --gold: #d4af55;
  --muted: #7f8ba0;
  /* 稀有度四档，图标调色板与 tools/build-icons.mjs 里的 RARITY 一一对应 */
  --r-normal: #8a7f9e;
  --r-rare: #6aa9ff;
  --r-epic: #b47cff;
  --r-legend: #ff9f45;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  min-height: 100vh;
  background: var(--bg);
}

body {
  min-height: 100vh;
  /* 背景图交给 body::before：body 自身必须透明，否则盖住伪元素 */
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 满幅洞府夜色：贴图层 + 遮罩层，都固定在视口上不随滚动跑位 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("assets/art/bg-cave.webp") center bottom / cover no-repeat, var(--bg);
}
/* 遮罩：上压顶栏、中提亮中央舞台、四周收暗角。没有这层，贴图会透过面板糊成一片 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 10, 17, 0.86) 0%, rgba(7, 10, 17, 0.42) 26%, rgba(7, 10, 17, 0.78) 100%),
    radial-gradient(130% 90% at 50% 62%, transparent 34%, rgba(4, 6, 11, 0.72) 100%);
}

/* ---- 顶部 ---- */
.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 17, 0.78);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.title {
  font-size: 22px;
  font-weight: 700;
  color: var(--qi);
  letter-spacing: 2px;
}
.subtitle {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.save-status {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s;
}
.save-status.visible { opacity: 1; color: var(--success); }
.save-status:hover { color: var(--qi); }

/* ---- 布局：常驻左栏 + 右侧 Tab 内容区 ----
   旧版把 19 个面板平铺在一张 13 行 grid 上，又长又乱。
   现在 .layout 只剩两格：左 .resource-panel（常驻修炼入口），右 .tabs（5 个分区轮流显示）。
   各分区的内部小面板用整列堆叠，再靠它们自己的 auto-fill 网格横向填充。 */
.layout {
  display: grid;
  grid-template-columns: minmax(300px, 340px) 1fr;
  gap: 16px;
  padding: 16px 24px 48px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.resource-panel { min-width: 0; }
.tab-panel > .panel { min-width: 0; }

/* ---- Tab 导航条（紧贴顶栏之下，横向可滚动）---- */
.tabbar {
  position: sticky;
  top: 60px;                 /* 顶栏约 60px 高，sticky 让长面板滚动时 tab 始终可点 */
  z-index: 9;
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  margin: 0 auto;
  max-width: 1400px;
  background: rgba(7, 10, 17, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tab-btn {
  position: relative;
  flex: 1 1 0;
  min-width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 12px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
/* 分区图标：一张厚涂贴图，不随状态换图，只换亮度和光晕。
   没贴图的分区（比如以后新增的）自动退回纯文字，不会顶着一个空框。 */
.tab-btn::before {
  content: '';
  width: 30px;
  height: 30px;
  background-image: var(--tab-art);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.62;
  filter: saturate(0.75) brightness(0.82);
  transition: opacity 0.18s, filter 0.18s, transform 0.18s;
}
.tab-btn[data-tab="cultivation"] { --tab-art: url("assets/art/tab-cultivation.png"); }
.tab-btn[data-tab="path"]         { --tab-art: url("assets/art/tab-path.png"); }
.tab-btn[data-tab="arena"]        { --tab-art: url("assets/art/tab-arena.png"); }
.tab-btn[data-tab="adventure"]    { --tab-art: url("assets/art/tab-adventure.png"); }
.tab-btn[data-tab="treasure"]     { --tab-art: url("assets/art/tab-treasure.png"); }
.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab-btn:hover::before { opacity: 0.9; filter: none; }
.tab-btn:focus-visible { outline: 2px solid var(--qi); outline-offset: 2px; }
.tab-btn.is-active {
  color: var(--qi);
  background: linear-gradient(180deg, rgba(255, 200, 87, 0.14), rgba(255, 200, 87, 0.04));
  border-color: rgba(255, 200, 87, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 200, 87, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tab-btn.is-active::before {
  opacity: 1;
  transform: translateY(-1px) scale(1.06);
  filter: drop-shadow(0 0 8px rgba(255, 200, 87, 0.5));
}

/* 红点：这个分区现在有事可做。点落在按钮 padding 内 —— tabbar 是横向滚动容器，
   画到边界外会被直接裁掉，桌面上看着像"有时有有时无"。 */
.tab-btn.has-dot::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.75);
  animation: tab-dot-breathe 1.8s ease-in-out infinite;
}
@keyframes tab-dot-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-btn.has-dot::after { animation: none; }
}

/* ---- Tab 内容区 ---- */
.tabs { min-width: 0; }
.tab-panel {
  display: none;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.tab-panel.is-active { display: grid; }

/* ---- 面板通用 ---- */
.panel {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
/* 每个面板顶边一道极淡的高光，让 13 块面板在暗底上不再是 13 个同样平的方块 */
.panel::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 3px;
  margin-bottom: 16px;
  text-transform: uppercase;
}
/* 标题前的菱形符标：统一视觉起点，比纯文字更「有编目感」 */
.panel-title::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--qi), #a97a2a);
  box-shadow: 0 0 8px rgba(255, 200, 87, 0.6);
}
.panel-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 200, 87, 0.22), transparent);
}
.panel-title > * { flex-shrink: 0; }

/* ---- 资源面板 ---- */
.resource-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.resource-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 2px;
}
.resource-label::before {
  content: '';
  width: 18px;
  height: 18px;
  background: url("assets/art/res-qi.png") center / contain no-repeat;
  filter: drop-shadow(0 0 7px rgba(255, 200, 87, 0.55));
}
/* 另外两种货币同理：数字前面永远先站着一个东西，不是一行字 */
#sect-coin-balance::before,
.prestige-gain::before {
  content: '';
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  vertical-align: -2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
#sect-coin-balance::before { background-image: url("assets/art/res-coin.png"); }
.prestige-gain::before { background-image: url("assets/art/res-sh.png"); }
.qi-amount {
  font-size: 52px;
  font-weight: 700;
  color: var(--qi);
  text-shadow: 0 0 24px rgba(255, 200, 87, 0.35);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.per-second {
  font-size: 16px;
  color: var(--qi-glow);
  font-variant-numeric: tabular-nums;
  margin-bottom: 20px;
}

/* ---- 炼丹炉按钮 ---- */
/* 质感层次（由内到外）：炉膛冷石底 → 底部火光辉 → 内凹阵盘环 → 炉芯热辉 → 厚涂丹炉本体 → 外圈扩散环。
   丹炉贴图自带明暗与体积，所以容器不再画一个彩色圆面，只负责「托光」。 */
.cauldron {
  position: relative;
  width: 208px;
  height: 208px;
  margin-bottom: 44px;         /* 让出下方两行绝对定位的提示文字 */
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 87, 0.34);
  background:
    radial-gradient(circle at 50% 96%, rgba(255, 132, 44, 0.5), transparent 50%),
    radial-gradient(circle at 50% 26%, #2b3a52 0%, #131c2b 52%, #080c14 100%);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(255, 200, 87, 0.16),
    0 0 58px rgba(255, 200, 87, 0.24),
    0 18px 44px rgba(0, 0, 0, 0.62),
    inset 0 0 46px rgba(0, 0, 0, 0.74),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.09s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* 内凹的一圈玄铁环：让圆不再是「一个圆」，而是一个容器 */
.cauldron::before {
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.46));
  border: 1px solid rgba(255, 200, 87, 0.2);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
/* 炉芯热辉：缓慢呼吸，暗示炉火未熄 */
.cauldron-halo {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 168, 60, 0.52), rgba(255, 120, 40, 0) 62%);
  filter: blur(5px);
  pointer-events: none;
  animation: forge-breathe 3.4s ease-in-out infinite;
}
@keyframes forge-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50%      { opacity: 1; transform: scale(1.06); }
}
/* 外圈两道扩散环：点击时重新起跑，形成「灵气被吸进炉里」的节奏 */
.cauldron-ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 87, 0.5);
  pointer-events: none;
  animation: qi-ring 3.4s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
}
.cauldron-ring.ring-2 { animation-delay: 1.7s; }
@keyframes qi-ring {
  0%   { transform: scale(1); opacity: 0.55; }
  70%  { transform: scale(1.24); opacity: 0; }
  100% { transform: scale(1.24); opacity: 0; }
}

.cauldron:hover {
  box-shadow:
    0 0 0 1px rgba(255, 200, 87, 0.4),
    0 0 80px rgba(255, 200, 87, 0.42),
    0 20px 48px rgba(0, 0, 0, 0.66),
    inset 0 0 46px rgba(0, 0, 0, 0.74),
    inset 0 2px 0 rgba(255, 255, 255, 0.14);
}
.cauldron:hover .cauldron-icon { transform: scale(1.03); }
.cauldron:active { transform: scale(0.965); }
.cauldron:focus-visible { outline: 2px solid var(--qi); outline-offset: 4px; }

/* 丹炉本体：一张 512² 厚涂贴图。用 background 而不是 <img>，
   这样按下时能单独做位移和缩放，且不额外增加 DOM。 */
.cauldron-icon {
  position: relative;
  width: 176px;
  height: 176px;
  /* --icon-idle 由 ui.js 写入 inline style，这里只做兜底 */
  background-image: var(--icon-idle, url("assets/art/cauldron.png"));
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  filter: drop-shadow(0 0 16px rgba(255, 158, 52, 0.6)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.7));
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.22s;
  pointer-events: none;
}
.click-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 3px;
  pointer-events: none;
}
.click-power {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 25px);
  font-size: 14px;
  color: var(--qi);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* 点击瞬间：炉身压下去，炉芯闪一下，两道环重置再扩散一次 */
.cauldron.strike { animation: forge-strike 0.42s cubic-bezier(0.2, 0.8, 0.3, 1); }
@keyframes forge-strike {
  0%   { box-shadow: 0 0 0 0 rgba(255, 210, 120, 0.8), 0 0 44px rgba(255, 200, 87, 0.28), inset 0 0 34px rgba(0, 0, 0, 0.7); }
  35%  { box-shadow: 0 0 0 14px rgba(255, 210, 120, 0), 0 0 90px rgba(255, 200, 87, 0.75), inset 0 0 34px rgba(0, 0, 0, 0.7); }
  100% { box-shadow: 0 0 0 14px rgba(255, 210, 120, 0), 0 0 44px rgba(255, 200, 87, 0.28), inset 0 0 34px rgba(0, 0, 0, 0.7); }
}
.cauldron.strike .cauldron-halo { animation: forge-flash 0.42s ease-out; }
@keyframes forge-flash {
  0%   { opacity: 1; transform: scale(1.18); }
  100% { opacity: 0.55; transform: scale(0.94); }
}
.cauldron.strike .cauldron-ring { animation: qi-ring 0.62s cubic-bezier(0.15, 0.8, 0.3, 1); }
.cauldron.strike .cauldron-ring.ring-2 { animation-delay: 0.09s; }
.cauldron.strike .cauldron-icon { transform: translateY(2px) scale(0.94); }

/* ---- 建筑列表 ---- */
.generators { display: flex; flex-direction: column; gap: 10px; }
.generator {
  position: relative;
  display: grid;
  /* 图标 | 名称+描述（可收缩） | 等级产出 | 购买按钮 */
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "icon title stats buy"
    "icon meta  meta  buy";
  align-items: center;
  gap: 4px 14px;
  padding: 12px 14px 12px 12px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 42%),
    var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, transform 0.1s, box-shadow 0.2s;
  min-width: 0;
  overflow: hidden;
}
/* 左侧等级色条：0-9 无条，10 级起一格一格长出来，40 级满格。
   这是「等级感」的第一层——不读数字也能看出哪座建筑在领跑。 */
.generator::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--qi), var(--qi-glow));
  opacity: 0;
  transition: opacity 0.3s;
}
.generator.tier-1::before { opacity: 0.55; }
.generator.tier-2::before { opacity: 0.8; }
.generator.tier-3::before { opacity: 1; box-shadow: 0 0 12px rgba(255, 200, 87, 0.7); }

/* 稀有度：按照建筑在价格阶梯上的位置给铜/银/金第三层视觉语言 */
.generator.g-r0 { --gen-accent: #8e7a5e; --gen-accent-soft: rgba(142, 122, 94, 0.16); }
.generator.g-r1 { --gen-accent: #9fb0bf; --gen-accent-soft: rgba(159, 176, 191, 0.16); }
.generator.g-r2 { --gen-accent: #ffc857; --gen-accent-soft: rgba(255, 200, 87, 0.16); }

.generator.affordable {
  border-color: rgba(87, 204, 153, 0.55);
  box-shadow: 0 0 0 1px rgba(87, 204, 153, 0.15), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.generator.affordable::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 0% 50%, rgba(87, 204, 153, 0.12), transparent 55%);
  pointer-events: none;
}

/* 图标框：一张厚涂贴图。状态不再换图（贴图重画一套成本太高），
   改用亮度、饱和度和外发光区分「买得起 / 里程碑 / 还没拥有」。 */
.gen-icon {
  grid-area: icon;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 118%, var(--gen-accent-soft, transparent), transparent 64%),
    linear-gradient(180deg, #16202f, #0c1220);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 16px rgba(0, 0, 0, 0.62),
    0 4px 10px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  overflow: visible;
}
.gen-icon::before {
  content: '';
  width: 46px;
  height: 46px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: var(--icon-idle);
  opacity: 0.9;
  filter: brightness(0.82) saturate(0.82);
  transition: filter 0.28s, opacity 0.28s;
}
.generator.affordable .gen-icon {
  border-color: rgba(255, 200, 87, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 18px rgba(255, 200, 87, 0.34),
    0 0 0 1px rgba(255, 200, 87, 0.18);
}
.generator.affordable .gen-icon::before {
  opacity: 1;
  filter: brightness(1.06) saturate(1.05) drop-shadow(0 0 7px rgba(255, 190, 90, 0.5));
}
.generator.has-milestone .gen-icon {
  border-color: rgba(255, 216, 138, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 24px rgba(255, 190, 90, 0.45);
}
.generator.has-milestone .gen-icon::before {
  opacity: 1;
  filter: brightness(1.12) saturate(1.15) drop-shadow(0 0 9px rgba(255, 200, 87, 0.75));
}
.generator.tier-0 .gen-icon::before {
  opacity: 0.6;
  filter: grayscale(0.6) brightness(0.66);
}

/* 四列一行在窄一点的桌面上就会把名称列挤成 0 宽（贴图变大之后更容易触发），
   所以 1180px 以下让购买按钮自己占一行，名称列永远有余量。 */
@media (max-width: 1180px) {
  .generator {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "icon title stats"
      "icon meta  meta"
      "icon buy   buy";
  }
  .gen-buy { justify-content: flex-start; }
  /* 价格跟着按钮走：整行铺满之后 margin-left:auto 会把它甩到最右边，脱离按钮组 */
  .gen-cost { margin-left: 8px; }
}

/* 等级徽章压在图标右下角，让等级脱离「一行小字」进入视觉焦点 */
.gen-lv-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 20px;
  padding: 0 5px;
  height: 17px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0b111c;
  background: linear-gradient(180deg, #ffe0a0, var(--qi));
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.generator.tier-0 .gen-lv-badge,
.generator.tier-3 .gen-lv-badge {
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}
.generator.tier-3 .gen-lv-badge {
  background: linear-gradient(180deg, #ffd88a, #ff9f45);
  color: #2a1000;
  box-shadow: 0 0 10px rgba(255, 160, 60, 0.65);
}
.gen-lv-badge:empty { display: none; }

/* 进度条：到下一个里程碑还差多少，用一条细线表达「快满了」 */
.gen-meter {
  grid-area: meta;
  position: relative;
  height: 3px;
  margin-top: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.gen-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 200, 87, 0.35), var(--qi));
  transition: width 0.35s ease;
  box-shadow: 0 0 8px rgba(255, 200, 87, 0.5);
}
.gen-meter.near .gen-meter-fill {
  background: linear-gradient(90deg, var(--qi), #fff4d6);
  animation: meter-throb 1.6s ease-in-out infinite;
}
@keyframes meter-throb {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 200, 87, 0.45); }
  50%      { box-shadow: 0 0 14px rgba(255, 220, 140, 0.9); }
}
.gen-meter:not(.has) { display: none; }
.gen-title {
  grid-area: title;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.gen-name { font-size: 15px; font-weight: 600; white-space: nowrap; }
.gen-desc { font-size: 12px; color: var(--text-dim); }
.gen-stats {
  grid-area: stats;
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: flex-end;
  white-space: nowrap;
}
.gen-level { font-size: 14px; color: var(--qi); font-variant-numeric: tabular-nums; }
.gen-prod { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.gen-milestone {
  grid-area: meta;
  font-size: 11px;
  color: var(--text-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gen-milestone:empty { display: none; }
.gen-buy {
  grid-area: buy;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.gen-buy button {
  background: var(--qi);
  color: #0b111c;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.gen-buy button:hover:not(:disabled) { background: var(--qi-glow); }
.gen-buy button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #4a3556;
  color: var(--text-dim);
}
.gen-cost { font-size: 14px; color: var(--qi); font-variant-numeric: tabular-nums; margin-left: auto; }

/* ---- 飞升面板 ---- */
.prestige-panel {
  border-color: rgba(185, 138, 255, 0.4);
}
.prestige-panel .panel-title { color: var(--prestige); }
.prestige-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }
.prestige-gain {
  font-size: 20px;
  font-weight: 700;
  color: var(--prestige);
  margin-bottom: 12px;
}
.prestige-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #b98aff, #7a4fd4);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.prestige-btn:hover:not(:disabled) { transform: translateY(-1px); }
.prestige-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.prestige-info {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 10px;
}
.prestige-hint {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1.5;
  transition: color 0.3s, background 0.3s;
}
.prestige-hint.ready {
  color: var(--qi);
  background: rgba(255, 200, 87, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 200, 87, 0.25) inset;
}

/* ---- 成就 ---- */
.achievements {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.achievement {
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}
.achievement:not(.locked) {
  opacity: 1;
  border-color: var(--qi);
}
.ach-name { font-size: 12px; font-weight: 600; }
.ach-desc { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }

/* ---- 弹窗 ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.show { display: flex; }
.modal-body {
  background: var(--bg-panel);
  border: 1px solid var(--qi);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 0 60px rgba(255, 200, 87, 0.3);
}
.modal-icon { font-size: 48px; margin-bottom: 8px; }
.modal-body h3 {
  font-size: 20px;
  color: var(--qi);
  margin-bottom: 12px;
}
.offline-gain {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-close {
  padding: 10px 32px;
  background: var(--qi);
  color: #0b111c;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.modal-close:hover { background: var(--qi-glow); }

/* ---- 账号与存档（联机模式的钥匙就是那串 49 位存档码）---- */
/* 四块叠起来比手机屏还高，而浮层是居中的：上下两头一起被裁掉，
   「找回该账号」和回话永远够不着。让面板自己滚，外框照旧居中。 */
.account-body { max-width: 460px; max-height: calc(100vh - 20px); overflow-y: auto; overscroll-behavior: contain; text-align: left; }
.account-body .modal-icon, .account-body h3 { text-align: center; }
.account-note {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.account-field {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.account-code {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--qi);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.4px;
  line-height: 1.6;
  padding: 10px 12px;
  margin-bottom: 10px;
  resize: none;
  /* 不换行的话 49 位会把面板撑出横向滚动 —— 这串字符是给人抄到另一台设备上的，
     看不全就等于没做这个界面 */
  word-break: break-all;
}
.account-code::placeholder { color: var(--text-dim); opacity: 0.75; }
.account-code:focus { outline: none; border-color: var(--qi); }
.account-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.account-row .modal-close { flex: 1; padding: 9px 12px; }
.account-ghost {
  flex: 1;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
#account-reset:hover { border-color: var(--danger); color: var(--danger); }
#account-close:hover { border-color: var(--qi); color: var(--qi); }
.account-msg { min-height: 18px; font-size: 12.5px; color: var(--success); margin: 0; }
.account-msg.is-bad { color: var(--danger); }
/* 一屏里排着入册 / 已入册 / 登录 / 存档码四块，不给隔断玩家会顺着往下填，
   把「登回来」当成「入册」的下一步 —— 那一步是真的会换号的。 */
.account-block + .account-block { padding-top: 16px; border-top: 1px solid var(--border); }
/* 「+」连的是 DOM 里相邻，不管前一块有没有被 hidden 掉。入册之后第一块隐身，
   第二块就会在标题底下凭空画一道隔断 —— 上面什么都没有，那道线没有意义。 */
#account-bind[hidden] + #account-bound { padding-top: 0; border-top: 0; }
.account-block { margin-bottom: 16px; }
.account-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  margin-bottom: 10px;
}
.account-input:focus { outline: none; border-color: var(--qi); }
.account-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--qi);
  margin-bottom: 6px;
}
.account-sub { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  /* 顶栏 63px + tabbar 84px：贴着右上放会压住最右那个分区的红点（实测 bottom 147），所以让到导航下方 */
  top: 156px;
  right: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--qi);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(0); }

/* ---- 点击飘字 ---- */
.click-ripple {
  position: fixed;
  color: var(--qi);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 200, 87, 0.8), 0 2px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 9999;
  animation: ripple 800ms cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
  will-change: transform, opacity;
}
@keyframes ripple {
  0%   { transform: translate(-50%, -50%) scale(0.5);   opacity: 0; }
  12%  { transform: translate(-50%, -62%) scale(1.22);  opacity: 1; }
  100% { transform: translate(-50%, -230%) scale(0.96); opacity: 0; }
}

/* ---- 里程碑徽章 ---- */
.gen-milestone {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 6px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.gen-milestone.active {
  color: #080c14;
  background: linear-gradient(90deg, var(--qi), var(--qi-glow));
  border-color: var(--qi-glow);
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.5);
  font-weight: 700;
  animation: milestone-pulse 2s ease-in-out infinite;
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
}
@keyframes milestone-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 179, 71, 0.4); }
  50%      { box-shadow: 0 0 16px rgba(255, 179, 71, 0.8); }
}

/* ---- 下一成就预览 ---- */
.next-achievement {
  background: linear-gradient(90deg, rgba(185, 138, 255, 0.08), rgba(255, 200, 87, 0.06));
  border: 1px solid var(--prestige);
  border-left: 3px solid var(--prestige);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(185, 138, 255, 0.15);
}
.next-achievement::before {
  content: '';
  display: inline-block;
  margin-right: 6px;
}

/* ---- 批量购买按钮 ---- */
.gen-buy button {
  transition: transform 0.1s;
}
.gen-buy button:not(:disabled):hover {
  transform: translateY(-1px);
}
.gen-buy button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   v0.3 新面板样式：境界 / 排行 / 道途 / 门派 / 奇遇
   ============================================================ */

/* ---- 顶栏徽章 ---- */
.realm-badge, .rank-badge, .sect-badge, .name-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.realm-badge {
  background: linear-gradient(135deg, #2a1f4d, #3b2a6b);
  border: 1px solid var(--prestige);
  color: #d8c9ff;
}
/* 药丸里的境界徽记：18px 的符号位。认不到贴图时这里装 emoji，
   drop-shadow 让它从紫色底里跳出来，不用描边也能读 */
.badge-mark {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  background-image: var(--art, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}
.rank-badge {
  background: linear-gradient(135deg, #4a3410, #6b4a15);
  border: 1px solid var(--gold);
  color: var(--gold);
}
.sect-badge {
  background: #1f2233;
  border: 1px solid #3a3f5c;
  color: #9aa3c7;
}
/* 道号徽标（v0.17）：没入册时是一条虚线灰药丸，它同时是「你还没有名字」的提示；
   入册后换成实心紫金 —— 名字是要在天梯上被人认出来的东西，得比门派徽标更亮。 */
.name-badge {
  background: transparent;
  border: 1px dashed #3a3f5c;
  color: var(--text-dim);
}
.name-badge.is-named {
  background: linear-gradient(135deg, #3c2f10, #5b4315);
  border: 1px solid var(--qi);
  color: var(--qi);
}
/* 上面那条药丸规则把 display 定成了 inline-flex，作者的 display 压过浏览器默认的
   [hidden]{display:none} —— 单机模式要收起这枚徽标就得自己写一条（.break-bar 同理） */
.name-badge[hidden] { display: none; }
/* 门派符号走 SVG 轨道：--icon-idle 由 ui.js 写在行内样式上 */
.sect-badge .badge-sect {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, .05);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px 13px;
  background-image: var(--icon-idle);
}

/* ---- 境界进度条 ---- */
.realm-progress {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.rp-label {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.rp-label > span { white-space: nowrap; }
.rp-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.rp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6a4cd6, var(--gold));
  transition: width 0.3s ease;
}

/* ============================================================
   手动闭关 / 渡劫（v0.15）
   —— 面板四态靠 class 切换，色相由 --thunder-hue 驱动：
   雷种是随机抽的，但抽中就定死了，所以整个读条期间颜色不会跳。
   ============================================================ */
.break-panel {
  position: relative;
  /* 资源栏是 align-items:center 的纵列，不撑开的话整块会缩成文字那么宽 */
  align-self: stretch;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow: hidden;
}
/* 雷光底色：只有渡劫读条时铺一层极淡的雷色雾，闭关（普通层）保持素净 */
.break-panel::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 140%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(60% 70% at 50% 0%,
    hsl(var(--thunder-hue, 268) 85% 62% / .22), transparent 70%);
  transition: opacity .4s ease;
}
.break-panel.is-running.is-trib::before { opacity: 1; }

.break-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #0a0f18;
  background: linear-gradient(135deg, #6a4cd6, var(--prestige));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.break-btn:active { transform: translateY(1px) scale(.994); }

/* 可引雷：雷色描边 + 呼吸光，让人一眼看出「这一步是赌」 */
.break-panel.is-ready.is-trib .break-btn {
  color: #f4f0ff;
  background: linear-gradient(135deg,
    hsl(var(--thunder-hue, 268) 60% 30%), hsl(var(--thunder-hue, 268) 85% 58%));
  box-shadow: 0 0 0 1px hsl(var(--thunder-hue, 268) 90% 70% / .5),
              0 6px 18px -6px hsl(var(--thunder-hue, 268) 90% 60% / .55);
  animation: break-breath 2.4s ease-in-out infinite;
}
@keyframes break-breath {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}
.break-panel.is-ready:not(.is-trib) .break-btn {
  background: linear-gradient(135deg, #6a4cd6, var(--gold));
}
/* 读条中：按钮变「中止」，撤掉所有金气，只留一圈冷描边 */
.break-panel.is-running .break-btn {
  color: #b9c6dc;
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px var(--border);
  animation: none;
}
.break-panel.is-locked .break-btn {
  color: #5c6a80;
  background: rgba(255, 255, 255, .035);
  box-shadow: inset 0 0 0 1px rgba(35, 49, 69, .8);
  cursor: not-allowed;
  animation: none;
}
.break-meta {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.break-bar {
  position: relative;
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
/* hidden 属性要能压过上面的 display:relative —— 浏览器默认样式被覆盖后不会自己藏 */
.break-bar[hidden] { display: none; }
.break-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,
    hsl(var(--thunder-hue, 268) 52% 32%),
    hsl(var(--thunder-hue, 268) 78% 58%));
  box-shadow: 0 0 10px hsl(var(--thunder-hue, 268) 85% 60% / .55);
  /* 每 100ms 推一次宽度：过渡设短，既不抖也不至于一步一跳 */
  transition: width .12s linear;
}
.break-panel.is-running:not(.is-trib) .break-bar-fill {
  background: linear-gradient(90deg, #6a4cd6, var(--gold));
  box-shadow: 0 0 8px rgba(255, 200, 87, .45);
}
/* 雷须：道数=劫相档的 bolts，逐根错峰闪，读条期间一直在跑 */
.break-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 雷只劈在已经灌进去的那截灵气里：整条轨道都闪的话，空白段上会浮着几根
     亮条，看着像渲染坏了。--done 由 JS 每 tick 写成进度百分比。 */
  clip-path: inset(0 calc(100% - var(--done, 0%)) 0 0);
}
.break-sparks .spark {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 2px;
  left: calc(4% + var(--i) * (92% / 10));
  background: linear-gradient(180deg,
    hsl(var(--thunder-hue, 268) 88% 90%),
    hsl(var(--thunder-hue, 268) 80% 58%));
  filter: blur(.4px);
  opacity: 0;
  animation: spark-fall 1.5s linear calc(var(--i) * .17s) infinite;
}
@keyframes spark-fall {
  0%   { opacity: 0; transform: scaleY(.3); }
  6%   { opacity: .95; transform: scaleY(1); }
  22%  { opacity: .25; }
  30%  { opacity: .8; }
  46%  { opacity: 0; }
  100% { opacity: 0; transform: scaleY(1); }
}

/* ============================================================
   渡劫准备（v0.16）：本次服下的丹 + 摆着的阵基
   ============================================================ */
.break-prep {
  position: relative;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 6px;
}
.bp-row { display: flex; align-items: center; gap: 8px; }
.bp-label {
  flex: none;
  min-width: 34px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--muted);
}
.bp-label b {
  margin-left: 2px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.bp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.bp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 4px;
  font: inherit;
  font-size: 11px;
  color: #cfd8e6;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .22s, background .18s, transform .12s, opacity .2s;
}
.bp-chip:hover:not(:disabled) {
  border-color: rgba(255, 200, 87, 0.4);
  transform: translateY(-1px);
}
.bp-chip:active:not(:disabled) { transform: scale(.96); }
.bp-chip:disabled { cursor: default; }
.bp-chip em, .bp-chip .pl-tag {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* 图标位：厚涂贴图由 ui.js 写 --icon-idle，emoji 只做兜底 */
.pl-face {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  background-color: rgba(0, 0, 0, 0.3);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px 15px;
  background-image: var(--icon-idle, none);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
/* 贴图档比 emoji 小一圈就认不出了：厚涂图整体偏暗，缩到 18px 更是糊成一团。
   放大画面 + 提亮，和 .bn-emoji 那批小图标同一套做法。 */
.pl-face.has-art {
  width: 20px;
  height: 20px;
  background-size: 19px 19px;
  filter: brightness(1.22) saturate(1.08);
}
.bp-chip.is-empty { opacity: .42; }
/* 选中态两种颜色分工：丹走灵气金（吃下去的东西），阵走修为紫（摆出来的布置） */
.bp-chip.pill.is-on {
  color: #ffe6b0;
  border-color: rgba(255, 200, 87, 0.55);
  background: linear-gradient(180deg, rgba(255, 200, 87, 0.16), rgba(255, 200, 87, 0.05));
  box-shadow: 0 0 14px rgba(255, 190, 90, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.bp-chip.form.is-on {
  color: #e3d4ff;
  border-color: rgba(185, 138, 255, 0.55);
  background: linear-gradient(180deg, rgba(185, 138, 255, 0.16), rgba(185, 138, 255, 0.05));
  box-shadow: 0 0 14px rgba(150, 90, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* 买断但没摆上：得让玩家看出「这东西还在库里，是我没收起来」 */
.bp-chip.form.is-owned:not(.is-on) .pl-tag { color: var(--success); }
.bp-effect {
  font-size: 10.5px;
  line-height: 1.5;
  color: #6b7a92;
}
.bp-effect.has { color: #a9b8cd; }
.bp-note { font-size: 10px; line-height: 1.5; color: #63718a; }
/* 读条中整块压暗但保持可读：玩家要看得见「冻住的是哪颗丹」，只是动不了 */
.break-panel.is-running .break-prep { opacity: .74; }

/* ---- 排行榜 ---- */
.rank-percentile {
  font-size: 11px;
  font-weight: 400;
  color: #7f8ca3;
  margin-left: 6px;
}
.rankings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* 13 人榜单全部展开：之前 max-height:320px 会把玩家自己裁在可视区外，
     而「我在第几名」正是这个面板存在的理由。 */
  max-height: none;
  overflow-y: auto;
}
.rank-row {
  /* 名次 / 头像 / 名字 / 称号 / 境界 / 灵气 —— 单行网格，右列固定宽度避免数字竖排折行 */
  display: grid;
  grid-template-columns: 20px 34px minmax(0, 1fr) minmax(0, 84px) 62px 44px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  font-size: 12px;
  position: relative;
}
.rank-row.rank-top {
  background: linear-gradient(90deg, #2d2410, var(--bg-elevated));
  border-color: #4a3a15;
}
.rank-row.rank-me {
  background: linear-gradient(90deg, #241b40, var(--bg-elevated));
  border-color: var(--prestige);
  box-shadow: 0 0 0 1px rgba(140,110,255,0.2);
}
.rank-num {
  color: #75839b;
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
/* 前三名给奖牌色，让榜首不需要读数字就能认出来 */
.rank-row.rank-1 .rank-num { color: #ffd25c; text-shadow: 0 0 10px rgba(255, 210, 92, 0.6); }
.rank-row.rank-2 .rank-num { color: #cfd6e0; }
.rank-row.rank-3 .rank-num { color: #d99a5c; }
.rank-row.rank-1 {
  background: linear-gradient(90deg, #3a2c0e, var(--bg-elevated) 62%);
  border-color: #6b5316;
  box-shadow: 0 0 0 1px rgba(255, 210, 92, 0.14) inset;
}
.rank-row.rank-2 { background: linear-gradient(90deg, #23262d, var(--bg-elevated) 62%); border-color: #343a44; }
.rank-row.rank-3 { background: linear-gradient(90deg, #2c211a, var(--bg-elevated) 62%); border-color: #46321f; }
.rank-row.rank-me {
  background: linear-gradient(90deg, #2b1f52, var(--bg-elevated) 70%);
  border-color: var(--prestige);
  box-shadow: 0 0 0 1px rgba(185, 138, 255, 0.28), 0 0 18px rgba(120, 90, 220, 0.18);
}
/* 你现在这一行左侧加一道竖标，长列表里滚回来能一眼定位 */
.rank-row.rank-me::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--prestige);
  box-shadow: 0 0 8px rgba(185, 138, 255, 0.9);
}
.rank-row { position: relative; }
/* 头像位共用的「肖像框」：贴图 + 冷底渐变 + 一点暖地光 + 细描边。
   榜单/弟子/道侣都走这一套，只有尺寸随面板密度各自覆盖。
   --art 由 src/ui.js 的 faceArt() 写在行内样式上；没有贴图时这里退化成
   一个装了 emoji 的小盒子，观感不破。 */
.rank-emoji, .board-emoji, .dc-emoji, .comp-emoji, .cp-emoji {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: 17px;
  line-height: 1;
  background-image: var(--art, none),
    radial-gradient(circle at 50% 118%, rgba(255, 200, 87, .1), transparent 62%),
    linear-gradient(180deg, #16202f, #0c1220);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain, cover, cover;
  filter: brightness(.95) saturate(.96);
}
/* 前三名给奖牌色描边：不用读数字就能认出梯队 */
.rank-row.rank-1 .rank-emoji, .board-row.rank-1 .board-emoji { border-color: rgba(255, 210, 92, .5); filter: brightness(1.02) saturate(1.02); }
.rank-row.rank-2 .rank-emoji, .board-row.rank-2 .board-emoji { border-color: rgba(207, 214, 224, .34); filter: brightness(.99); }
.rank-row.rank-3 .rank-emoji, .board-row.rank-3 .board-emoji { border-color: rgba(217, 154, 92, .34); filter: brightness(.99); }

/* 物件框：寻宝材料/地图、拍品法宝、丹药、门派商店、生活手艺共用。
   和肖像框分开写是因为物件要按稀有度描边（--rarity / --rar 由父级传下来），
   而脸只按名次描边。尺寸仍由各面板自己的规则覆盖。 */
.shop-emoji, .goods-emoji, .dig-map-emoji, .dig-chip-emoji, .tr-emoji, .sk-emoji, .sc-emoji,
.ae-emoji, .log-emoji, .bn-emoji, .secret-emoji, .enemy-face, .drop-emoji, .st-face {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: 17px;
  line-height: 1;
  background-image: var(--art, none),
    radial-gradient(circle at 50% 118%, rgba(255, 200, 87, .08), transparent 62%),
    linear-gradient(180deg, #16202f, #0c1220);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain, cover, cover;
  filter: brightness(.95) saturate(.96);
}
/* 第四轮：这些位长在密集行里（日志一行 11px、加成行首列 22px），
   34px 的框会把行高撑开，所以各自退一档。秘境场景是卡片头，反过来要放大。 */
.secret-emoji { width: 42px; height: 42px; border-radius: 13px; font-size: 21px; }
.ae-emoji { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
.enemy-face { width: 26px; height: 26px; border-radius: 9px; font-size: 14px; }
.bn-emoji, .log-emoji, .drop-emoji { width: 20px; height: 20px; border-radius: 7px; font-size: 11px; }
.bn-emoji { width: 22px; height: 22px; }
/* 这一档只有 20~22px：物件框默认的压暗滤镜会让厚涂糊成一团黑，单独提亮 */
.bn-emoji, .log-emoji, .drop-emoji { filter: brightness(1.26) saturate(1.1); }
/* 弹窗标题与副标题里的脸是内联在文字行里的，得跟着基线走 */
.st-face {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
  vertical-align: -5px;
}
/* 稀有度只借光不重画：不支持 color-mix 的浏览器会整条丢掉，退回默认描边 */
.dig-chip-emoji, .tr-emoji {
  border-color: color-mix(in srgb, var(--rarity, var(--rar, transparent)) 45%, transparent);
  box-shadow: 0 0 12px -7px var(--rarity, var(--rar, transparent));
}
.rank-name {
  color: #dbe3ef;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-row.rank-me .rank-name { color: #c9b3ff; }
.rank-title {
  font-size: 10px;
  color: #75839b;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-stats { text-align: right; }
.rank-qi {
  color: var(--qi);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.rank-realm {
  font-size: 10px;
  color: #75839b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==== 天梯（v0.10） ==== */
/* 列序：名次 / 头像 / 名字 / 称号 / 战力 / 斗法按钮 —— 只有上面一处定义，别再补一份 */
.rank-power {
  color: #ffb45c;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.rank-you {
  font-style: normal;
  font-size: 10px;
  color: #c9b3ff;
  background: rgba(185, 138, 255, 0.16);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 5px;
}
/* 与我的名次相邻的两行：轻描一下，让人看出「再努把力就超过了」 */
.rank-row.rank-near:not(.rank-me) {
  background: linear-gradient(90deg, rgba(255, 180, 92, 0.07), var(--bg-elevated) 70%);
  border-color: rgba(255, 180, 92, 0.18);
}

/* 斗法按钮 */
.rank-duel {
  font: inherit;
  font-size: 11px;
  padding: 3px 0;
  border-radius: 6px;
  cursor: pointer;
  background: linear-gradient(180deg, #3a2a55, #241a38);
  border: 1px solid #6b4fa0;
  color: #d9c8ff;
  transition: filter .15s, transform .1s;
}
.rank-duel:hover:not(:disabled) { filter: brightness(1.25); }
.rank-duel:active:not(:disabled) { transform: scale(0.96); }
.rank-duel:disabled {
  background: #101725;
  border-color: #1b2533;
  color: #566379;
  cursor: not-allowed;
}

/* 顶部：我的战力 + 与相邻名次的差距 */
.ladder-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 180, 92, 0.10), transparent 72%);
  border: 1px solid rgba(255, 180, 92, 0.20);
}
.ladder-mine { display: flex; align-items: baseline; gap: 6px; }
.ladder-label { font-size: 11px; color: #8592a8; }
.ladder-power {
  font-size: 20px;
  font-weight: 800;
  color: #ffb45c;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 180, 92, 0.35);
}
.ladder-delta { font-size: 11px; color: #8592a8; text-align: right; }
.ladder-delta b { color: #ffd25c; font-variant-numeric: tabular-nums; }

/* 底部操作条 */
.ladder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.ladder-daily {
  font: inherit;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(180deg, #4a3410, #2a1e0c);
  border: 1px solid #7a5a1c;
  color: #ffd25c;
  font-weight: 600;
}
.ladder-daily:hover:not(:disabled) { filter: brightness(1.25); }
.ladder-daily:disabled {
  background: #101725; border-color: #1b2533; color: #566379; cursor: not-allowed;
}
.ladder-note { font-size: 11px; color: #75839b; }

/* 战力构成：默认折叠 */
.ladder-breakdown { margin-top: 8px; }
.ladder-breakdown > summary {
  font-size: 11px;
  color: #7f8ca3;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.ladder-breakdown > summary::-webkit-details-marker { display: none; }
.ladder-breakdown > summary::before { content: '▸ '; color: #75839b; }
.ladder-breakdown[open] > summary::before { content: '▾ '; }
.ladder-parts { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.ladder-part {
  display: grid;
  grid-template-columns: 60px 1fr 56px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.lp-label { color: #8592a8; }
.lp-bar { height: 5px; border-radius: 3px; background: #17202e; overflow: hidden; }
.lp-bar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #7a5cc0, #ffb45c);
}
.lp-value {
  text-align: right; color: #dbe3ef;
  font-variant-numeric: tabular-nums;
}

/* 对战记录 */
.duel-log { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.duel-log:not(:empty) { padding-top: 8px; border-top: 1px solid #161f2c; }
.duel-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
}
.duel-flag {
  text-align: center; font-weight: 800; border-radius: 4px;
}
.duel-win .duel-flag { color: #6ef2a8; background: rgba(110, 242, 168, 0.12); }
.duel-lose .duel-flag { color: #ff7a7a; background: rgba(255, 122, 122, 0.12); }
.duel-name { color: #c6cfdd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-gain { color: #8592a8; font-variant-numeric: tabular-nums; }
.duel-win .duel-gain { color: #ffd25c; }

/* ---- 道途 ---- */
.paths-desc, .sects-desc {
  font-size: 11px;
  color: #7f8ca3;
  margin: 0 0 10px;
}
.paths, .sects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.path-card, .sect-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  transition: border-color 0.2s, transform 0.2s;
}
.path-card.path-avail:hover, .sect-card:hover {
  border-color: var(--prestige);
  transform: translateY(-1px);
}
.path-card.path-main {
  border-color: var(--gold);
  background: linear-gradient(135deg, #131a26, var(--bg-elevated));
}
.path-card.path-sec {
  border-color: #4a5f8a;
  background: linear-gradient(135deg, #141c2b, var(--bg-elevated));
}
.sect-card.sect-current {
  border-color: var(--gold);
  background: linear-gradient(135deg, #131a26, var(--bg-elevated));
}
.path-head, .sect-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.path-emoji, .sect-emoji {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background-image: var(--icon-idle);
}
.path-card.path-main .path-emoji,
.path-card.path-sec .path-emoji {
  background-image: var(--icon-active);
  border-color: rgba(255, 200, 87, 0.4);
  box-shadow: 0 0 12px rgba(255, 200, 87, 0.25);
}
.sect-card.sect-current .sect-emoji {
  border-color: rgba(255, 200, 87, 0.4);
  box-shadow: 0 0 12px rgba(255, 200, 87, 0.25);
}
.path-name, .sect-name {
  font-size: 12px;
  font-weight: 600;
  color: #dbe3ef;
}
.path-desc, .sect-desc {
  font-size: 10px;
  color: #75839b;
  line-height: 1.4;
  margin-top: 2px;
}
.path-bonus, .sect-bonus {
  font-size: 10px;
  color: var(--gold);
  background: rgba(212,175,85,0.08);
  border-radius: 6px;
  padding: 3px 6px;
  margin-bottom: 8px;
}
.path-select, .sect-select {
  width: 100%;
  padding: 6px;
  font-size: 11px;
  font-family: inherit;
  color: #0a0f18;
  font-weight: 600;
  background: linear-gradient(135deg, var(--prestige), #8b6cf0);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s;
}
.path-select:hover, .sect-select:hover { filter: brightness(1.12); }

.lock-hint {
  font-size: 11px;
  color: #63718a;
  text-align: center;
  padding: 16px 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* ---- 奇遇事件 ---- */
.active-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.active-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #1a2440, var(--bg-elevated));
  border-left: 3px solid var(--prestige);
  border-radius: 8px;
  font-size: 12px;
}
.active-event.active-negative {
  background: linear-gradient(135deg, #3a1616, var(--bg-elevated));
  border-left-color: #e05a5a;
}
.ae-emoji { font-size: 16px; }
.ae-name { color: #dbe3ef; font-weight: 600; }
.ae-time { font-size: 10px; color: #7f8ca3; }

.event-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.log-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding: 2px 4px;
}
.log-row.log-negative { color: #d98a8a; }
.log-emoji { font-size: 12px; }
.log-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-ago { font-size: 10px; color: #63718a; }

/* ---- 突破弹窗 ---- */
#breakthrough-modal .modal-body { max-width: 320px; text-align: center; }
#bt-icon {
  /* 有贴图时 textContent 是空的：必须给死尺寸，否则这个块塌成 0 高，
     弹窗会少掉一截、动画也看不见 */
  width: 58px;
  height: 58px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  line-height: 1;
  background-image: var(--art, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 0 10px rgba(255, 200, 87, .28));
}
#bt-title {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--gold);
}
.bt-desc {
  font-size: 13px;
  color: #a4adc0;
  line-height: 1.6;
  margin: 0 0 16px;
}

/* ---- 门派试炼 + 丹房兑换（v0.4）---- */
.trial-box {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.trial-section, .shop-section {
  margin-bottom: 14px;
}
.trial-title {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.trial-title strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.trial-start {
  width: 100%;
  padding: 9px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  color: #0a0f18;
  background: linear-gradient(135deg, var(--gold), #f0c96a);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s;
}
.trial-start:hover { filter: brightness(1.1); }
.trial-cool {
  font-size: 11px;
  color: #63718a;
  text-align: center;
  padding: 9px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.trial-active {
  background: linear-gradient(135deg, #2a1f4d, var(--bg-elevated));
  border: 1px solid var(--prestige);
  border-radius: 9px;
  padding: 10px;
}
.trial-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #c9b3ff;
  font-weight: 600;
  margin-bottom: 8px;
}
.trial-time {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.trial-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  margin-bottom: 6px;
}
.trial-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--prestige), var(--gold));
  transition: width 0.3s ease;
}
.trial-nums {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.shop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shop-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px;
}
.shop-item.shop-maxed {
  opacity: 0.55;
  border-color: var(--gold);
}
.shop-head {
  display: flex;
  gap: 8px;
  margin-bottom: 7px;
}
.shop-emoji { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; line-height: 1.2; }
.shop-body { flex: 1; }
.shop-name {
  font-size: 12px;
  font-weight: 600;
  color: #dbe3ef;
}
.shop-lv {
  font-size: 10px;
  color: var(--gold);
  font-weight: 400;
  margin-left: 4px;
}
.shop-desc {
  font-size: 10px;
  color: #75839b;
  margin-top: 2px;
  line-height: 1.4;
}
.shop-buy {
  width: 100%;
  padding: 6px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  color: #d8c9ff;
  background: #241b40;
  border: 1px solid var(--prestige);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.shop-buy:hover:not(:disabled) { background: #2f2450; }
.shop-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.shop-done {
  font-size: 10px;
  color: var(--gold);
  text-align: center;
  padding: 5px;
}

/* 事件日志成功/失败着色 */
.log-row.log-good .log-name { color: #9fd8a8; }
.log-row.log-bad .log-name { color: #e0a0a0; }

/* ---- 弟子面板（v0.4）---- */
.disciples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.disciple-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.2s, transform 0.2s;
}
.disciple-card.dc-afford {
  border-color: var(--prestige);
  box-shadow: 0 0 0 1px rgba(140, 110, 255, 0.15);
}
.disciple-card.dc-afford:hover { transform: translateY(-1px); }
.disciple-card.dc-owned {
  border-color: var(--gold);
  background: linear-gradient(135deg, #131a26, var(--bg-elevated));
}
.disciple-card.dc-locked { opacity: 0.45; }
.dc-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.dc-emoji { width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }
.dc-body { flex: 1; min-width: 0; }
.dc-name {
  font-size: 12px;
  font-weight: 600;
  color: #dbe3ef;
}
.dc-title {
  font-size: 10px;
  color: #75839b;
  line-height: 1.35;
  margin-top: 1px;
}
.dc-effect {
  font-size: 11px;
  color: var(--gold);
  background: rgba(212, 175, 85, 0.08);
  border-radius: 6px;
  padding: 4px 7px;
  line-height: 1.4;
}
.dc-buy {
  width: 100%;
  padding: 6px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  color: #0a0f18;
  background: linear-gradient(135deg, var(--prestige), #8b6cf0);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s;
}
.dc-buy:hover:not(:disabled) { filter: brightness(1.12); }
.dc-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dc-done, .dc-lock {
  font-size: 10px;
  text-align: center;
  padding: 5px;
  border-radius: 6px;
}
.dc-done {
  color: var(--gold);
  background: rgba(212, 175, 85, 0.1);
}
.dc-lock {
  color: #63718a;
  border: 1px dashed var(--border);
}

/* ---- 道侣面板（v0.5）---- */
.companion-current { margin-bottom: 10px; }
.comp-active {
  /* 原来是糖果粉（#3a1f33 / #b0507e），跟本轮「暗紫金 + 冷调」的底色打架，转紫 */
  background: linear-gradient(135deg, #2c1f45, var(--bg-elevated));
  border: 1px solid rgba(185, 138, 255, .3);
  border-radius: 10px;
  padding: 10px;
}
.comp-head {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 8px;
}
.comp-emoji {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 26px;
  border-color: rgba(255, 255, 255, .12);
}
.comp-body { flex: 1; }
.comp-name {
  font-size: 13px;
  font-weight: 600;
  color: #e4d9ff;
}
.comp-favor-num {
  font-size: 10px;
  color: #9c86c6;
  font-weight: 400;
  margin-left: 4px;
}
.comp-desc {
  font-size: 11px;
  color: var(--gold);
  margin-top: 2px;
}
.comp-bar {
  height: 7px;
  border-radius: 999px;
  background: #1a2331;
  overflow: hidden;
  margin-bottom: 8px;
}
.comp-fill {
  height: 100%;
  border-radius: 999px;
  /* 与 .rp-fill 同一条渐变：同为「攒满一条」的进度语义，颜色要一致 */
  background: linear-gradient(90deg, #6a4cd6, var(--qi));
  transition: width 0.3s ease;
}
.comp-skill {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  color: #0a0f18;
  background: linear-gradient(135deg, var(--gold), #f0c96a);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: filter 0.15s;
}
.comp-skill:hover:not(:disabled) { filter: brightness(1.1); }
.comp-skill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.comp-skill-desc {
  font-size: 10px;
  color: #7d8798;
  margin-top: 5px;
  text-align: center;
}

.companions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.companion-card {
  background: var(--bg-elevated);
  border: 1px solid #1d2735;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.companion-card.cp-afford {
  border-color: #b0507e;
  box-shadow: 0 0 0 1px rgba(176, 80, 126, 0.2);
}
.companion-card.cp-locked { opacity: 0.45; }
.cp-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cp-emoji { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.cp-body { flex: 1; min-width: 0; }
.cp-name {
  font-size: 12px;
  font-weight: 600;
  color: #dbe3ef;
}
.cp-title {
  font-size: 10px;
  color: #75839b;
  line-height: 1.35;
  margin-top: 1px;
}
.cp-effect {
  font-size: 10px;
  color: #b9a8d8;
  background: rgba(185, 138, 255, .08);
  border-radius: 6px;
  padding: 4px 7px;
  line-height: 1.4;
}
.cp-bond {
  width: 100%;
  padding: 6px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  color: #f2ecff;
  /* 结契用修为紫，跟金色的全局主按钮区分：这是身份动作，不是花钱买断 */
  background: linear-gradient(135deg, #6a4cd6, var(--prestige));
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.15s;
}
.cp-bond:hover:not(:disabled) { filter: brightness(1.1); }
.cp-bond:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cp-lock {
  font-size: 10px;
  color: #63718a;
  text-align: center;
  padding: 5px;
  border: 1px dashed #1d2735;
  border-radius: 6px;
}

/* ===== v0.5 拍卖坊市 ===== */
.auction-box, .trade-box { display: flex; flex-direction: column; gap: 10px; }
.lot-list { display: grid; gap: 10px; }
.lot-card {
  border: 1px solid rgba(255, 210, 120, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(40, 32, 58, 0.9), rgba(26, 22, 40, 0.9));
  transition: border-color .2s, box-shadow .2s;
}
.lot-card.lot-mine { border-color: #ffcf5c; box-shadow: 0 0 12px rgba(255, 207, 92, .25); }
.lot-card.lot-settled { opacity: .75; }
.lot-head { display: flex; gap: 10px; align-items: flex-start; }
.lot-emoji {
  --lot-glow: rgba(255, 210, 120, 0.35);
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background-repeat: no-repeat;
  background-position: center, center;
  background-size: contain, 26px 26px;
  background-image: var(--art, none), var(--icon-idle);
  background-color: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--lot-glow);
  box-shadow: 0 0 16px var(--lot-glow), inset 0 0 12px rgba(0, 0, 0, 0.5);
}
/* 稀有度不只体现在一个小胶囊标签上，而是决定整张卡的辉光颜色 */
.lot-card { position: relative; overflow: hidden; }
.lot-card.rarity-frame-rare { --lot-glow: rgba(106, 169, 255, 0.4); }
.lot-card.rarity-frame-epic { --lot-glow: rgba(180, 124, 255, 0.45); }
.lot-card.rarity-frame-legendary { --lot-glow: rgba(255, 159, 69, 0.55); }
.lot-card.rarity-frame-legendary {
  border-color: rgba(255, 159, 69, 0.5);
  box-shadow: 0 0 22px rgba(255, 140, 40, 0.2), inset 0 0 40px rgba(255, 140, 40, 0.06);
}
.lot-card.rarity-frame-epic {
  border-color: rgba(180, 124, 255, 0.42);
  box-shadow: 0 0 18px rgba(150, 90, 255, 0.16), inset 0 0 40px rgba(150, 90, 255, 0.05);
}
.lot-card.rarity-frame-rare { border-color: rgba(106, 169, 255, 0.36); }
/* 传说卡一道缓慢扫过的光，是「这件东西不一样」最便宜的合法表达 */
.lot-card.rarity-frame-legendary::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 42%;
  background: linear-gradient(100deg, transparent, rgba(255, 210, 140, 0.16), transparent);
  transform: skewX(-14deg);
  animation: lot-shine 4.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lot-shine {
  0%, 62% { left: -60%; }
  100%    { left: 120%; }
}
.lot-body { flex: 1; }
.lot-name { font-weight: 700; color: #ffe9b0; }
.lot-rarity { font-size: 11px; padding: 1px 6px; border-radius: 999px; margin-left: 6px; }
.rarity-rare { background: rgba(90, 160, 255, .2); color: #8fc4ff; }
.rarity-epic { background: rgba(180, 110, 255, .2); color: #cf9dff; }
.rarity-legendary { background: rgba(255, 160, 60, .22); color: #ffb55c; }
.lot-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lot-price { margin-top: 8px; font-size: 13px; color: #ffd98a; }
.lot-bid, .auction-start, .trade-btn {
  margin-top: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 210, 120, .35);
  background: linear-gradient(180deg, #3c2f55, #2a2140);
  color: #ffe9b0;
  font-size: 13px;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, opacity .2s;
}
.lot-bid:hover:not(:disabled), .auction-start:hover, .trade-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 190, 80, .22);
}
.lot-bid:disabled, .trade-btn:disabled { opacity: .45; cursor: not-allowed; }
.lot-result { margin-top: 8px; font-size: 13px; font-weight: 700; }
.auction-idle { display: flex; flex-direction: column; gap: 8px; }
.auction-won, .auction-cool { font-size: 13px; color: var(--muted); }
.trade-list { display: flex; flex-direction: column; gap: 8px; }
.trade-max { background: linear-gradient(180deg, #4a3a1f, #2f2614); }
.goods-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.goods-row { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.03); }
.goods-emoji { font-size: 18px; }
.goods-name { font-weight: 600; color: #ffe9b0; }
.goods-desc { color: var(--muted); flex: 1; }
.goods-empty { font-size: 12px; color: var(--muted); }

/* v0.8：丹药兑换按钮 —— 灵气回收池入口 */
.goods-craft {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(140, 230, 180, .4);
  background: linear-gradient(180deg, #23503a, #163528);
  color: #b8f5d2;
  font-size: 12px;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.goods-craft:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(120, 220, 160, .22);
}
.goods-craft:disabled { opacity: .4; cursor: not-allowed; }
.auction-runs { font-size: 12px; color: #9adcff; }
.auction-runs.done { color: var(--muted); }

/* ==== 加成一览 ==== */
.bonus-list { display: flex; flex-direction: column; gap: 4px; }
.bonus-row {
  display: grid;
  grid-template-columns: 22px 52px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  font-size: 12px;
  color: var(--muted);
  transition: background .2s;
}
.bonus-row.active {
  background: rgba(255, 200, 90, .07);
  color: var(--text);
}
.bn-emoji { font-size: 14px; line-height: 1; text-align: center; }
.bn-label { font-weight: 600; color: var(--text-dim); }
.bonus-row.active .bn-label { color: #ffe9b0; }
.bn-desc { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--muted);
}
.bonus-row.active .bn-value { color: var(--qi); }

/* ---- v0.6 加成作用域标签（永久 / 本周期）---- */
.bn-scope {
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.bn-scope-perm {
  color: #9fd6a8;
  background: rgba(110, 200, 130, .10);
  border-color: rgba(110, 200, 130, .22);
}
.bn-scope-cycle {
  color: #e0b672;
  background: rgba(224, 182, 114, .10);
  border-color: rgba(224, 182, 114, .22);
}
.bonus-row:not(.active) .bn-scope {
  opacity: .45;
}

/* ---- v0.6 飞升重置提示 ---- */
.prestige-reset-hint {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
  text-align: center;
}
.prestige-reset-hint:empty { display: none; }
.prestige-reset-hint.has-loss {
  color: #f0b9b9;
  background: rgba(220, 100, 100, .10);
  border: 1px solid rgba(220, 100, 100, .22);
}

/* ---- 挖宝（运气系统 v0.9）---- */
.dig-panel { grid-column: 1 / -1; }
.dig-maps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.dig-map {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .025);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .2s, background .2s;
}
.dig-map:hover:not(.dig-locked) {
  border-color: rgba(168, 120, 255, .45);
  background: rgba(168, 120, 255, .06);
}
.dig-locked { opacity: .45; }
.dig-map-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dig-map-emoji { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.dig-map-name { font-weight: 600; font-size: 14px; }
.dig-map-cost { margin-left: auto; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.dig-map-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; min-height: 34px; }
.dig-btn {
  margin-top: auto;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(168, 120, 255, .35);
  background: rgba(168, 120, 255, .12);
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.dig-btn:hover:not(:disabled) { background: rgba(168, 120, 255, .25); }
.dig-btn:active:not(:disabled) { transform: scale(.97); }
.dig-btn:disabled { opacity: .4; cursor: not-allowed; }

.dig-result:empty { display: none; }
.dig-roll {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  animation: dig-pop .35s ease-out;
}
.dig-roll-item { font-weight: 600; font-size: 15px; }
.dig-roll-rarity {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(168, 120, 255, .18);
  color: #c9a6ff;
}
.dig-roll-desc { font-size: 12px; color: var(--text-dim); }
.dig-roll-pity {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 200, 80, .18);
  color: #ffc850;
}
/* 仙品/神品：金色描边 + 光晕，让「中奖」成为可感知的事件 */
.dig-legend {
  border-color: rgba(255, 200, 80, .65);
  background: linear-gradient(135deg, rgba(255, 200, 80, .16), rgba(168, 120, 255, .10));
  box-shadow: 0 0 18px rgba(255, 200, 80, .28);
}
.dig-legend .dig-roll-item { color: #ffd76b; }
@keyframes dig-pop {
  from { transform: scale(.94); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.dig-bag {
  display: block;
  margin-top: 10px;
}
.dig-empty {
  padding: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 10px;
}
/* ---- 行囊：稀有度汇总条 + 紧凑道具格 ---- */
.dig-bag-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dig-bag-title { font-size: 12px; font-weight: 600; letter-spacing: 1px; }
.dig-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.dig-sum-dot {
  font-size: 11px;
  color: var(--rarity, #999);
  position: relative;
  padding-left: 10px;
}
.dig-sum-dot::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--rarity, #999);
}
.dig-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 7px;
}
.dig-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
  min-width: 0;
}
/* 左侧稀有度色条：不依赖 color-mix，旧浏览器也能显示 */
.dig-chip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--rarity, #888);
}
.dig-chip-emoji { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; flex: 0 0 auto; }
.dig-chip-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.dig-chip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rarity, inherit);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dig-chip-perm {
  font-size: 9px;
  font-weight: 400;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  color: #ffd76e;
  border: 1px solid rgba(255, 215, 110, .4);
  vertical-align: 1px;
}
.dig-chip-fx {
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dig-chip-count {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

/* ---- 法宝耐久（v0.9.2）---- */
.treasure-panel { grid-column: 1 / -1; }
.treasure-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.treasure-empty,
.repair-hint {
  grid-column: 1 / -1;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  border: 1px dashed rgba(255, 255, 255, .1);
  border-radius: 10px;
}
.treasure-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px 11px 15px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  overflow: hidden;
}
/* 左侧稀有度色条 */
.treasure-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--rar, #888);
}
.treasure-card.tr-dead { opacity: .55; }
.tr-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.tr-emoji { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
.tr-name { font-size: 13px; font-weight: 600; color: var(--rar, inherit); }
.tr-rar {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--rar, #aaa);
  border: 1px solid currentColor;
  opacity: .85;
}
.tr-badge-broken {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, .5);
  background: rgba(255, 107, 107, .12);
}
.tr-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.tr-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .3s ease, background .3s ease;
}
.tr-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 10.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.tr-actions { display: flex; gap: 8px; }
.tr-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: var(--text, #eee);
  transition: background .18s ease, border-color .18s ease;
}
.tr-repair:hover { background: rgba(87, 204, 153, .18); border-color: rgba(87, 204, 153, .5); }
.tr-salvage:hover { background: rgba(255, 159, 69, .16); border-color: rgba(255, 159, 69, .45); }
.tr-note { font-size: 11px; color: var(--text-dim); }
.tr-note.tr-warn { color: #ffa94d; }
.repair-items { margin-top: 10px; }
.repair-owned { display: flex; flex-wrap: wrap; gap: 8px; }
.repair-chip {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: var(--text-dim);
  cursor: help;
}

/* ============================================================
   窄屏适配（<=560px 手机）
   必须放文件末尾：.generator/.panel/.layout 等基础规则在上面定义，
   媒体块若写在前方会被同选择器的后续规则覆盖（同优先级，后者胜）。
   ============================================================ */
@media (max-width: 560px) {
  .treasure-list { grid-template-columns: 1fr; }
  .dig-maps { grid-template-columns: 1fr; }
  .panel { padding: 14px; }
  .layout { padding: 12px 12px 40px; gap: 12px; }

  /* 建筑行：桌面是 4 列一行塞满，手机上名称会被挤成竖排、
     购买按钮溢出屏幕。改成贴图居左，右侧三行——名称 / 状态条 / 产出+按钮。 */
  .generator {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "icon title"
      "icon meta"
      "icon stats";
    gap: 6px;
    padding: 10px 12px;
  }
  /* 贴图是建筑的身份线索，窄屏也不能再藏起来，只缩尺寸 */
  .gen-icon { width: 46px; height: 46px; border-radius: 11px; }
  .gen-icon::before { width: 38px; height: 38px; }
  .gen-title { flex-wrap: wrap; gap: 2px 8px; }
  .gen-name { font-size: 14px; }
  /* 描述在窄屏会把名称挤到竖排，隐藏换取可读性 */
  .gen-desc { display: none; }
  .gen-stats {
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    white-space: normal;
  }
  .gen-buy {
    flex: 1 1 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    white-space: normal;
    gap: 6px;
    min-width: 0;
  }
  .gen-buy button { padding: 5px 9px; font-size: 11px; flex: 0 0 auto; }
  .gen-cost { font-size: 11px; margin-left: 2px; }
  .gen-level { font-size: 13px; }
  .gen-prod { font-size: 11px; }

  /* 顶栏：标题不再折成两行堆叠 */
  .topbar { gap: 8px; padding: 12px 10px; align-items: center; flex-wrap: nowrap; }
  .title { font-size: 18px; white-space: nowrap; }
  .subtitle { display: none; }
  /* 顶栏整排 nowrap，这行小字会把最右侧顶出视口，页面多出横向滚动条 */
  .save-status { white-space: nowrap; font-size: 10px; }
  /* 第六枚药丸（道号）撞上了同一条 nowrap：截断只发生在顶栏，
     认得出人比看全名重要，全名在账号面板里看得完整 */
  .name-badge { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
  /* 78px 的 min-width 在 375px 下会挤走第五个分区（珍宝），
     要横着拖才看得到等于少一个入口 —— 缩内边距和图标，五个一行排满 */
  .tab-btn { min-width: 0; padding: 6px 2px 7px; letter-spacing: .5px; }
  .tab-btn::before { width: 26px; height: 26px; }
}

/* ============================================================
   秘境副本（v0.11）
   ============================================================ */
.secret-stages { display: flex; flex-direction: column; gap: 10px; }

.secret-stage {
  padding: 12px 14px;
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s;
}
.secret-stage:hover { border-color: rgba(139, 92, 246, 0.45); }
/* 已通关的层用左侧金线标记，一眼看出走过哪些 */
.secret-stage.cleared { border-left: 3px solid rgba(245, 158, 11, 0.7); }
/* 战力不足的层整体压暗，但不隐藏——玩家要能看到「下一个目标在哪」 */
.secret-stage.locked { opacity: 0.62; }
.secret-stage.locked:hover { opacity: 0.8; }

.secret-stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.secret-emoji { font-size: 20px; line-height: 1; }
.secret-name { font-weight: 600; font-size: 15px; }
.secret-clear {
  font-size: 11px;
  font-style: normal;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.25);
  color: #9ca3af;
}
.secret-clear.first { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

.secret-badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}
.secret-badge.ready { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.secret-badge.locked { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.secret-badge.cooling { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

.secret-power {
  margin-left: auto;
  font-size: 12px;
  color: #8b93a7;
  font-variant-numeric: tabular-nums;
}

.secret-desc {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #9aa3b8;
}

.secret-stage-body {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.secret-enemy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  color: #c4b5fd;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.12);
}
.secret-enemy .enemy-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret-note { font-size: 12px; color: #8b93a7; }
.secret-note b { color: #fbbf24; font-variant-numeric: tabular-nums; }

.secret-enter {
  margin-left: auto;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  transition: transform 0.15s, box-shadow 0.15s;
}
.secret-enter:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}
.secret-enter:disabled {
  background: #3a3f4b;
  color: #6b7280;
  cursor: not-allowed;
}

/* 秘境机缘（已获得的独有掉落） */
.secret-drops { margin-top: 14px; }
.secret-drop-title {
  font-size: 12px;
  color: #fbbf24;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.secret-drop-list { display: flex; flex-wrap: wrap; gap: 8px; }
.secret-drop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  cursor: help;
}
.secret-drop em {
  font-style: normal;
  font-size: 11px;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
}

/* 三选一试炼弹窗 */
.secret-trial-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 20px;
}
.secret-trial {
  /* 这条规则加在内层 .modal 上，而 .modal 自带 display:none（弹窗默认隐藏），
     这里必须显式改回 block 才会显示。居中由 .secret-trial-backdrop 负责，
     所以这里不能用 flex —— 否则三个选项会被压成一行。 */
  display: block;
  position: relative;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 24px;
  border-radius: 14px;
  background: linear-gradient(160deg, #1a1f2e, #141821);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.secret-trial-sub {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: #9aa3b8;
}
.secret-trial-sub b { color: #f87171; }
.secret-trial-options { display: flex; flex-direction: column; gap: 10px; }

.secret-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  text-align: left;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
}
.secret-choice:hover {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(139, 92, 246, 0.12);
  transform: translateX(3px);
}
.sc-emoji { width: 44px; height: 44px; border-radius: 13px; grid-row: 1 / 3; font-size: 22px; align-self: center; }
.sc-name { font-size: 14px; font-weight: 600; color: #e5e7eb; }
.sc-desc { font-size: 12px; line-height: 1.5; color: #8b93a7; }

.secret-trial-cancel {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: transparent;
  color: #8b93a7;
  cursor: pointer;
}
.secret-trial-cancel:hover { background: rgba(255, 255, 255, 0.05); color: #cbd5e1; }

/* 移动端：按钮换行到底部，不要和敌人名挤一行 */
@media (max-width: 560px) {
  .secret-stage { padding: 10px 12px; }
  .secret-power { flex: 1 1 100%; margin-left: 0; text-align: right; }
  .secret-stage-body { gap: 8px; }
  .secret-enemy { flex: 0 0 auto; font-size: 12px; }
  .secret-note { flex: 1 1 100%; }
  .secret-enter { flex: 1 1 100%; margin-left: 0; padding: 9px; }
  .secret-trial { padding: 18px 16px; }
  .secret-choice { padding: 10px 12px; }
}

/* ============================================================
   生活技能（v0.12）
   ------------------------------------------------------------
   视觉定位：比秘境安静、比挖宝整齐。它是「日常」，不是「事件」，
   所以用低饱和的边框和细字重，不抢秘境那种金色高光。
   ============================================================ */
.skill-focus:empty { display: none; }

.skill-focus { margin-bottom: 12px; }

/* 排队条：整条进度 + 一个「放弃」。放弃是必要的出口，
   否则玩家花掉灵气才发现做不完就只能干等。 */
.skill-crafting {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.07);
  font-size: 12px;
  color: #cbd5e1;
}
.skill-crafting .sc-label { white-space: nowrap; }
.skill-crafting .sc-bar { flex: 1; }

.skill-focus-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  background: rgba(139, 92, 246, 0.06);
  font-size: 12px;
  color: #a8b0c4;
}
.skill-focus-line b { color: #a78bfa; }

.skill-cancel {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: transparent;
  color: #8b93a7;
  cursor: pointer;
}
.skill-cancel:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }

.sc-bar {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.sc-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.skill-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}
.skill-card.locked { opacity: 0.5; }
.skill-card.maxed { border-color: rgba(250, 204, 21, 0.24); }

.skill-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sk-emoji { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
.sk-name {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sk-name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
}
.sk-level {
  margin-left: auto;
  font-size: 12px;
  color: #8b93a7;
  font-variant-numeric: tabular-nums;
}

.skill-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.skill-badge.ready { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.skill-badge.locked { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
.skill-badge.busy { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
.skill-badge.maxed { background: rgba(250, 204, 21, 0.16); color: #fcd34d; }

.sk-effect {
  margin: 0 0 8px;
  font-size: 12px;
  color: #a78bfa;
}

.skill-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sk-note {
  flex: 1;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.5;
}

.skill-btn {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  cursor: pointer;
  white-space: nowrap;
}
.skill-btn:hover:not(:disabled) { background: rgba(139, 92, 246, 0.24); }
.skill-btn:disabled {
  opacity: 0.4;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #6b7280;
}

@media (max-width: 560px) {
  .skill-card { padding: 10px 12px; }
  .skill-body { flex-wrap: wrap; }
  .sk-note { flex: 1 1 100%; }
  .skill-btn { flex: 1 1 100%; padding: 9px; }
  .skill-crafting { flex-wrap: wrap; }
  .skill-crafting .sc-bar { flex: 1 1 100%; }
  /* 窄屏上「等级」跟徽标挤在一起更省地方，
     让它跟着徽标走，不要被 margin-left:auto 推到最右，
     否则「炼丹 | 手上没空 ........ 5/14」中间一大片空。 */
  .sk-level { margin-left: 4px; order: 3; }
  .skill-badge { order: 2; }
  .sk-name { flex: 1; }
}

/* ============================================================
   丹房（v0.16）：开炉方子与丹库存
   ============================================================ */
/* 卡片语言跟手艺保持一致，但整块走金色系：手艺是「做工」，丹房是「备货」，
   颜色上要一眼分得开，否则玩家会在四门手艺里找那张方子卡。 */
.pill-room {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.pr-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.pr-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #dbe3ef;
}
.pr-stock { display: flex; flex-wrap: wrap; gap: 10px; }
.pr-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  transition: opacity .2s;
}
.pr-item.is-empty { opacity: .38; }
.pr-item em {
  font-style: normal;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pr-cards { display: grid; gap: 8px; }
.pr-card {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 200, 87, 0.12);
  background: rgba(255, 200, 87, 0.03);
}
.pr-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.pr-card .pl-face { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; background-size: 24px 24px; }
.pr-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
}
.pr-name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: #8a7f5c;
}
.pr-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.pr-badge.busy { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
.pr-badge.locked { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
.pr-body { display: flex; align-items: center; gap: 10px; }
.pr-note {
  flex: 1;
  font-size: 11px;
  line-height: 1.5;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}
.pr-btn {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 200, 87, 0.32);
  background: rgba(255, 200, 87, 0.12);
  color: #ffd98a;
  cursor: pointer;
  white-space: nowrap;
}
.pr-btn:hover:not(:disabled) { background: rgba(255, 200, 87, 0.22); }
.pr-btn:disabled {
  opacity: 0.4;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #6b7280;
}

@media (max-width: 560px) {
  .pr-card { padding: 10px 12px; }
  .pr-body { flex-wrap: wrap; }
  .pr-note { flex: 1 1 100%; }
  .pr-btn { flex: 1 1 100%; padding: 9px; }
  .pr-badge { margin-left: 0; order: 3; }
}

/* ============================================================
   灵宠（v0.13）
   ============================================================ */
/* 头像位统一走「贴图框」：ui.js 只写 --art，认得的种类画贴图，
   没贴图的种类 --art 缺失、background-image 落空，emoji 文字自然顶上来。 */
.pet-sum-emoji,
.ph-emoji,
.pe-emoji,
.pet-emoji {
  display: inline-block;
  flex: none;
  background-image: var(--art, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
}
.pet-panel .sects-desc { margin-bottom: 10px; }

.pet-summary {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.07), rgba(167, 139, 250, 0.05));
  margin-bottom: 10px;
}
.pet-summary-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pet-sum-emoji {
  width: 44px;
  height: 44px;
  font-size: 22px;
  animation: pet-breathe 3.8s ease-in-out infinite;
}
.pet-sum-name { font-size: 15px; font-weight: 600; color: #e5e7eb; }
.pet-sum-power {
  margin-left: auto;
  font-size: 12px;
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}
.pet-summary-sub {
  margin-top: 5px;
  font-size: 11px;
  color: #8b93a7;
  line-height: 1.6;
}

/* 资质档：S 是最稀有的，所以颜色最亮 */
.apt-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.apt-S { background: rgba(250, 204, 21, 0.18); color: #fcd34d; border: 1px solid rgba(250, 204, 21, 0.32); }
.apt-A { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.apt-B { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
.apt-C { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }

.pet-hatching { margin-bottom: 10px; }
.pet-hatch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.24);
  background: rgba(167, 139, 250, 0.07);
  font-size: 12px;
  color: #c4b5fd;
}
.pet-hatch .sc-bar { flex: 1 1 120px; }
.ph-remain { font-variant-numeric: tabular-nums; }
/* 孵化中的那只比待机快半拍 —— 快要出壳的暗示 */
.ph-emoji {
  width: 34px;
  height: 34px;
  font-size: 18px;
  animation: pet-breathe 1.7s ease-in-out infinite;
}

/* 待机呼吸：形象「活着」的唯一信号。幅度压得很小，不跟文字抢注意力。 */
@keyframes pet-breathe {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55)) brightness(0.94); }
  50%      { transform: translateY(-2px) scale(1.035); filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.5)) brightness(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .pet-sum-emoji, .pet-emoji, .ph-emoji { animation: none; }
}

.pet-egg-shop {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 10px;
}
.pet-egg-head { font-size: 12px; color: #8b93a7; margin-bottom: 8px; line-height: 1.6; }
.pet-egg-list { display: grid; gap: 6px; }
.pet-egg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #a1a1aa;
}
.pe-emoji { width: 28px; height: 28px; font-size: 15px; }
.pe-name { color: #e5e7eb; font-weight: 500; flex: none; }
/* 成本数字不能断行：'1.20K 灵气' 断成两行会读成两个数 */
.pe-cost { color: #6b7280; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pe-have {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
  background: rgba(250, 204, 21, 0.16);
  color: #fcd34d;
}
.pet-egg-buy, .pet-egg-hatch {
  margin-left: auto;
  padding: 5px 12px;
  font-size: 11px;
  border-radius: 7px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
.pet-egg-hatch {
  margin-left: 0;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}
.pet-egg-buy:hover:not(:disabled), .pet-egg-hatch:hover:not(:disabled) { filter: brightness(1.3); }
.pet-egg-buy:disabled, .pet-egg-hatch:disabled {
  opacity: 0.4;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #6b7280;
}

.pet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}
.pet-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}
.pet-card.active {
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(56, 189, 248, 0.05);
}

.pet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.pet-emoji {
  width: 40px;
  height: 40px;
  font-size: 20px;
  animation: pet-breathe 3.8s ease-in-out infinite;
  animation-delay: -1.9s;
}
.pet-name {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pet-name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
}
.pet-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #8b93a7;
  cursor: pointer;
}
.pet-badge.out {
  cursor: default;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
}

.pet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: #8b93a7;
  margin-bottom: 6px;
}
.pet-skillrow {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 18px;
  margin-bottom: 8px;
}
.pet-skill {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
}

.pet-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pet-note { font-size: 11px; color: #6b7280; }
.pet-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.pet-btn {
  padding: 5px 11px;
  font-size: 11px;
  border-radius: 7px;
  border: 1px solid rgba(139, 92, 246, 0.32);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  cursor: pointer;
  white-space: nowrap;
}
.pet-btn:hover:not(:disabled) { background: rgba(139, 92, 246, 0.24); }
.pet-btn.ghost {
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #8b93a7;
}
.pet-btn:disabled {
  opacity: 0.4;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #6b7280;
}

@media (max-width: 560px) {
  .pet-card { padding: 10px 12px; }
  .pet-actions { margin-left: 0; width: 100%; }
  .pet-btn { flex: 1 1 30%; padding: 8px 4px; }
  .pet-egg-row { flex-wrap: wrap; }
  .pet-egg-buy, .pet-egg-hatch { margin-left: auto; }
  .pet-sum-power { margin-left: 0; }
}

/* ============================================================
   三条榜面板（v0.14）
   ============================================================ */
.boards-panel {
  /* 旧版曾与天梯榜共用 grid 区域；现在各分区独立堆叠，无需区域定位 */
}
.boards-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.board-tab {
  flex: 1 1 0;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #8b93a7;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.board-tab:hover { color: #d5d9e3; }
.board-tab.is-active {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  font-weight: 600;
}
.boards-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: linear-gradient(90deg, #121a27, var(--bg-elevated) 70%);
  border: 1px solid rgba(139, 92, 246, 0.18);
  font-size: 12px;
}
.bs-mine { display: flex; align-items: baseline; gap: 8px; }
.bs-label { color: #8e9bb2; }
.bs-rank { color: #eaeff7; font-weight: 700; font-size: 13px; }
.bs-score {
  color: #ffd25c;
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.bs-unit { color: #8b93a7; font-size: 11px; font-weight: 400; }
.bs-gap { color: #8e9bb2; }
.bs-gap b { color: #c4b5fd; font-variant-numeric: tabular-nums; }

.boards-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.board-row {
  display: grid;
  grid-template-columns: 20px 34px minmax(0, 1fr) minmax(0, 1fr) 74px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid transparent;
  font-size: 12px;
  position: relative;
}
.board-num {
  color: #75839b;
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
/* .board-emoji 的头像框与 .rank-emoji 共用一条规则，写在天梯那节 —— 别在这里再补一份，
   同特异性下文件靠后的会把它覆盖掉 */
.board-name {
  color: #d5d9e3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-title {
  color: #7f8ca3;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-value {
  color: #eaeff7;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.board-row.rank-1 .board-num { color: #ffd25c; text-shadow: 0 0 10px rgba(255, 210, 92, 0.6); }
.board-row.rank-2 .board-num { color: #cfd6e0; }
.board-row.rank-3 .board-num { color: #d99a5c; }
.board-row.rank-1 {
  background: linear-gradient(90deg, #3a2c0e, var(--bg-elevated) 62%);
  border-color: #6b5316;
}
.board-row.rank-2 { background: linear-gradient(90deg, #23262d, var(--bg-elevated) 62%); border-color: #343a44; }
.board-row.rank-3 { background: linear-gradient(90deg, #2c211a, var(--bg-elevated) 62%); border-color: #46321f; }
.board-row.board-me {
  background: linear-gradient(90deg, #2b1f52, var(--bg-elevated) 70%);
  border-color: var(--prestige);
  box-shadow: 0 0 0 1px rgba(185, 138, 255, 0.28);
}
.board-row.board-me::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: var(--prestige);
  box-shadow: 0 0 8px rgba(185, 138, 255, 0.9);
}
.board-row.board-me .board-name { color: #c9b3ff; }
.board-you {
  font-style: normal;
  font-size: 10px;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.24);
  color: #c4b5fd;
}
.boards-note {
  margin-top: 10px;
  font-size: 11px;
  color: #7f8ca3;
  line-height: 1.6;
}

@media (max-width: 560px) {
  .board-row {
    grid-template-columns: 18px 28px minmax(0, 1fr) 62px;
  }
  .board-title { display: none; }
  .boards-summary { gap: 6px 10px; }
  /* 34px 肖像在 375px 宽下会挤掉名字列，窄屏退到 28px：仍是贴图，只是不再描边分层 */
  .rank-emoji, .board-emoji { width: 28px; height: 28px; border-radius: 9px; font-size: 15px; }
  .dc-emoji { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
  .comp-emoji { width: 40px; height: 40px; border-radius: 11px; font-size: 20px; }
  .cp-emoji { width: 32px; height: 32px; border-radius: 10px; font-size: 17px; }
  .rank-row { grid-template-columns: 18px 28px minmax(0, 1fr) minmax(0, 72px) 56px 68px; }
  /* 物件框同理：窄屏退一档，贴图仍在，只是不再撑住整行 */
  .shop-emoji, .dig-map-emoji, .tr-emoji { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
  .goods-emoji { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
  .dig-chip-emoji { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
  .sk-emoji, .sc-emoji { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }
  .secret-emoji { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
  .ae-emoji { width: 24px; height: 24px; border-radius: 8px; font-size: 13px; }
  .enemy-face { width: 22px; height: 22px; border-radius: 8px; font-size: 12px; }
  .bn-emoji, .log-emoji, .drop-emoji { width: 18px; height: 18px; border-radius: 6px; font-size: 10px; }
  .st-face { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
  /* 「⚡ 引雷渡劫 · 筑基一层」在 375px 宽下要折行，字号与内边距各退一档 */
  .break-btn { font-size: 11.5px; padding: 8px 8px; }
  .break-meta { font-size: 10.5px; }
  .break-bar { height: 9px; }
}

/* ============================================================
   窄屏（<=720px 手机/小平板）：左栏折到顶部并压成横排，内容单列
   必须放文件末尾：.resource-panel / .cauldron 等基础规则在上方定义，
   媒体块若写在前方会被同选择器的后续规则覆盖（媒体查询不增加特异性，
   同优先级后者胜）。这里放到最后，才能在 720px 以下稳定压过基础规则。
   ============================================================ */
@media (max-width: 720px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 12px 12px 40px;
    gap: 12px;
  }
  /* 资源面板从纵向大卡压成一条横排：丹炉缩小，灵气与境界进度放右侧 */
  .resource-panel {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
    text-align: left;
  }
  /* 闭关/渡劫要占满一行才按得住：夹在境界进度条旁边会挤成半个按钮 */
  .break-panel { flex: 1 0 100%; order: 3; margin-top: 0; }
  .resource-top { display: flex; flex-direction: column; gap: 2px; }
  .cauldron {
    width: 104px;
    height: 104px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .cauldron-icon { width: 92px; height: 92px; }
  .click-hint { display: none; }
  /* 桌面把这两行绝对定位到炉子下方，横排布局里没这个余量，改回常规流 */
  .click-power { position: static; font-size: 12px; }
  /* 104px 的炉子塞不下外圈扩散环与炉芯光晕，移动端直接隐藏，保留炉体本身 */
  .cauldron-ring,
  .cauldron-ring.ring-2,
  .cauldron-halo { display: none; }
  .qi-amount { font-size: 34px; }
  .per-second { margin-bottom: 0; font-size: 13px; }
  /* flex:1 的默认 min-width 是 auto，而 .rp-label 两个境界名都 nowrap，
     intrinsic 宽度会顶穿容器、把整页撑出横向滚动条 —— 必须显式归零 */
  .realm-progress { flex: 1; min-width: 0; margin-top: 0; }
  .rp-label { min-width: 0; }
  .rp-label > span { overflow: hidden; text-overflow: ellipsis; }
}

/* ============================================================
   关键动效反馈（本轮只做四件事里剩下的两件）
   —— 灵宠待机呼吸在灵宠小节，点击飘字在 .click-ripple。
   全部是 class 一挂载就跑完的一次性动画，不常驻，不跟 tick 抢帧。
   ============================================================ */

/* ---- 神品现世：光从奖品背后炸开，再横扫一道高光 ----
   showDigResult 每次挖宝都重写 innerHTML，节点是新的，所以动画天然会重放。 */
.dig-legend { position: relative; overflow: hidden; }
.dig-legend::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 180, 0.95), rgba(255, 180, 70, 0.4) 45%, transparent 70%);
  animation: legend-burst 0.9s cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
  pointer-events: none;
}
@keyframes legend-burst {
  0%   { transform: scale(0);  opacity: 0; }
  18%  { transform: scale(12); opacity: 1; }
  100% { transform: scale(24); opacity: 0; }
}
.dig-legend::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 246, 218, 0.55) 48%, transparent 66%);
  transform: translateX(-130%);
  animation: legend-sheen 1.1s 0.08s ease-out forwards;
  pointer-events: none;
}
@keyframes legend-sheen { to { transform: translateX(130%); } }

/* ---- 渡劫 / 天劫过场：整屏被雷光照白一次，斜劈的光带扫过弹窗 ---- */
#breakthrough-modal.show { animation: bt-flash 0.6s ease-out; }
@keyframes bt-flash {
  0%   { background: rgba(224, 236, 255, 0.6); }
  20%  { background: rgba(6, 9, 16, 0.88); }
  100% { background: rgba(0, 0, 0, 0.7); }
}
#breakthrough-modal.show .modal-body {
  position: relative;
  overflow: hidden;
  animation: bt-slam 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.05);
}
@keyframes bt-slam {
  0%   { transform: translateY(-16px) scale(0.95); opacity: 0; }
  60%  { transform: translateY(0) scale(1.015); opacity: 1; }
  100% { transform: none; }
}
#breakthrough-modal.show .modal-body::after {
  content: '';
  position: absolute;
  inset: -40% -12%;
  background: linear-gradient(74deg, transparent 42%, rgba(212, 232, 255, 0.85) 50%, transparent 58%);
  transform: translateX(-130%);
  animation: bt-bolt 0.72s 0.06s cubic-bezier(0.3, 0.7, 0.2, 1) forwards;
  pointer-events: none;
}
@keyframes bt-bolt { to { transform: translateX(130%); } }
#breakthrough-modal.show .modal-icon { animation: bt-icon 0.62s cubic-bezier(0.2, 0.9, 0.3, 1.5); }
@keyframes bt-icon {
  0%   { transform: scale(0.2) rotate(-18deg); opacity: 0; }
  55%  { transform: scale(1.22) rotate(6deg);  opacity: 1; }
  100% { transform: none; }
}

/* 渡劫失败：同一套过场换冷白光为血色，不另做一条动画链 */
#breakthrough-modal.is-fail.show { animation: bt-flash-fail 0.6s ease-out; }
@keyframes bt-flash-fail {
  0%   { background: rgba(255, 128, 116, 0.55); }
  20%  { background: rgba(12, 5, 8, 0.9); }
  100% { background: rgba(0, 0, 0, 0.7); }
}
#breakthrough-modal.is-fail.show .modal-body {
  border-color: var(--danger);
  box-shadow: 0 0 60px rgba(255, 107, 107, 0.35);
}
#breakthrough-modal.is-fail.show .modal-body h3 { color: var(--danger); }
#breakthrough-modal.is-fail.show .modal-body::after {
  background: linear-gradient(74deg, transparent 42%, rgba(255, 176, 166, 0.8) 50%, transparent 58%);
}

/* ---- 天劫分档演出（v0.15）----
   劫相三档：雷云初聚 3 道 / 雷暴倾泻 6 道 / 九霄雷池 10 道。
   道数与色相是 JS 在「引雷入体」那一刻定下来的，这里只负责越往上越像回事：
   间隔更密、雷光更久、卡边亮起来、最后连天光都多劈两回。 */
.bt-storm {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}
.bt-storm.has { display: block; }
/* 落雷时的天光：整张卡跟着亮一下，比雷形本身更像「被劈中」 */
.bt-storm.has::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 120% at 50% 8%,
    hsl(var(--thunder-hue, 268) 88% 82% / .5), transparent 68%);
  /* 屏幕混合：雷光是往画面上加光，不是盖一层紫纱 */
  mix-blend-mode: screen;
  opacity: 0;
  animation: storm-flash calc(var(--storm-sec, .9s) * 2) ease-out forwards;
}
@keyframes storm-flash {
  0%, 100% { opacity: 0; }
  6%   { opacity: .95; }
  16%  { opacity: .2; }
  28%  { opacity: .8; }
  42%  { opacity: .12; }
  58%  { opacity: .55; }
  74%  { opacity: .08; }
}
.bt-storm .bolt {
  position: absolute;
  /* 逐道往下错开起点，但落点一律收在卡面上方：雷是朝弹窗劈下来，不是糊在判词上 */
  top: calc(-3% - var(--i) * 0.9%);
  height: calc(24% + var(--i) * 1.2%);
  /* 再细就只是一条斜线，折角根本看不出来；短粗才有「一道雷」的体量 */
  width: 40px;
  /* 10 道封顶，均摊到画面宽度上；道数少时右边留白，看着就是「稀稀拉拉几道」 */
  left: calc(2% + var(--i) * (96% / 10));
  background: linear-gradient(180deg,
    #ffffff,
    hsl(var(--thunder-hue, 268) 92% 90%) 34%,
    hsl(var(--thunder-hue, 268) 86% 70%) 68%,
    hsl(var(--thunder-hue, 268) 80% 52% / 0));
  /* 一条左缘往下、一条右缘折回来的经典雷形；写成自交多边形会变成一坨 */
  clip-path: polygon(58% 0, 16% 44%, 42% 44%, 4% 100%, 70% 38%, 44% 38%, 84% 0);
  /* 每道雷歪一点点：动画占用了 transform，所以倾角只能走独立的 rotate */
  rotate: calc((var(--i) - 4) * 2.4deg);
  filter: blur(.3px) drop-shadow(0 0 6px hsl(var(--thunder-hue, 268) 88% 62% / .75));
  opacity: 0;
  transform-origin: top center;
  animation: bolt-strike var(--storm-sec, .9s) ease-out calc(var(--i) * var(--storm-gap, .14s)) 2 both;
}
@keyframes bolt-strike {
  0%   { opacity: 0; transform: scaleY(.12) skewX(-6deg); }
  8%   { opacity: 1; transform: scaleY(1) skewX(4deg); }
  20%  { opacity: .35; }
  30%  { opacity: .9; transform: scaleY(1) skewX(-3deg); }
  55%  { opacity: .1; }
  100% { opacity: 0; transform: scaleY(1) skewX(0); }
}

/* 三档的节奏：档位越高，雷落得越密、越急 */
#breakthrough-modal.t-gather { --storm-sec: .95s; --storm-gap: .2s; }
#breakthrough-modal.t-pour   { --storm-sec: .78s; --storm-gap: .12s; }
#breakthrough-modal.t-pool   { --storm-sec: .62s; --storm-gap: .075s; }

#breakthrough-modal.is-trib.show .modal-body {
  border-color: hsl(var(--thunder-hue, 268) 80% 62% / .55);
}
#breakthrough-modal.t-pour.show .modal-body,
#breakthrough-modal.t-pool.show .modal-body {
  box-shadow: 0 0 70px hsl(var(--thunder-hue, 268) 90% 58% / .38);
}
/* 九霄雷池：卡面背后浮一圈雷池光轮，随落雷明暗 */
#breakthrough-modal.t-pool.show .modal-body::before {
  content: '';
  position: absolute;
  inset: 18% 12% auto 12%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%,
    hsl(var(--thunder-hue, 268) 95% 70% / .5), transparent 72%);
  filter: blur(10px);
  animation: pool-churn 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pool-churn {
  0%, 100% { opacity: .35; transform: scale(.94); }
  50% { opacity: .8; transform: scale(1.04); }
}
/* 天光：高境界多劈两下，白光从整屏背后透出来 */
#breakthrough-modal.t-pool.show {
  animation: bt-flash .6s ease-out, bt-sky 1.9s .3s ease-out 2;
}
@keyframes bt-sky {
  0%, 100% { background: rgba(0, 0, 0, 0.7); }
  6%  { background: hsl(var(--thunder-hue, 268) 90% 88% / .5); }
  14% { background: rgba(0, 0, 0, 0.7); }
  22% { background: hsl(var(--thunder-hue, 268) 90% 82% / .28); }
  32% { background: rgba(0, 0, 0, 0.7); }
}
/* 震屏：只有「雷暴倾泻」及以上才有 —— 低境界的劫不该抖整张卡 */
#breakthrough-modal.is-shake.show .modal-body {
  animation: bt-slam 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.05),
             bt-shake 1s .5s ease-out;
}
@keyframes bt-shake {
  0%, 100% { transform: none; }
  12% { transform: translate(-3px, 1px) rotate(-.35deg); }
  28% { transform: translate(3px, -1px) rotate(.35deg); }
  46% { transform: translate(-2px, 1px); }
  64% { transform: translate(2px, -1px); }
  82% { transform: translate(-1px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  /* 关动效不等于丢信息：雷幕留着一帧静态的雷（档位照样看得出），
     劈落、天光、震屏、呼吸全撤。读条雷须直接消失 —— 进度条宽度本身就是信息。 */
  .bt-storm .bolt,
  .bt-storm.has::before,
  #breakthrough-modal.t-pool.show,
  #breakthrough-modal.t-pool.show .modal-body::before,
  #breakthrough-modal.is-shake.show .modal-body,
  .break-panel.is-ready.is-trib .break-btn,
  .break-sparks .spark { animation: none; }
  .bt-storm .bolt { opacity: .6; transform: none; }
  .bt-storm.has::before { opacity: .22; }
  .break-sparks .spark { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dig-legend::before,
  .dig-legend::after,
  #breakthrough-modal.show,
  #breakthrough-modal.show .modal-body,
  #breakthrough-modal.show .modal-body::after,
  #breakthrough-modal.show .modal-icon { animation: none; }
  #breakthrough-modal.show .modal-body::after,
  .dig-legend::after { display: none; }
}

/* ============================================================
   第四轮：升级 / 跃迁的一次性动效
   ------------------------------------------------------------
   面板每 100ms 重建（多数是整块 innerHTML），挂在面板节点上的 class 活不过
   下一 tick，所以「涨了一级」的圆环与标签一律画在 body 的 .fx-layer 浮层里：
   JS 只在生成时取一次矩形中心，之后面板怎么重建都打不断这一轮动画。
   只有稳定节点（建筑图标、顶栏徽记、飞升面板）才直接挂 class。
   ============================================================ */
.fx-layer {
  position: fixed;
  inset: 0;
  /* 压在弹窗遮罩（z-index 100）之下：破境那一下由整屏雷光负责，浮层不抢戏 */
  z-index: 90;
  pointer-events: none;
}
.fx-burst {
  position: absolute;
  /* left/top 是 JS 写的目标中心点，所以自身要往回偏移一半 */
  transform: translate(-50%, -50%);
}
.fx-burst::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 216, 138, 0.92);
  box-shadow: 0 0 16px rgba(255, 200, 87, 0.55), inset 0 0 12px rgba(185, 138, 255, 0.35);
  animation: fx-ring 720ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}
@keyframes fx-ring {
  0%   { transform: scale(0.3); opacity: 0; }
  18%  { transform: scale(1);   opacity: 1; }
  100% { transform: scale(2.3); opacity: 0; }
}
.fx-tag {
  position: absolute;
  left: 50%;
  top: 0;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #0b111c;
  background: linear-gradient(90deg, var(--qi), #ffe6a8);
  box-shadow: 0 2px 12px rgba(255, 200, 87, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  animation: fx-rise 800ms cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
  will-change: transform, opacity;
}
@keyframes fx-rise {
  0%   { transform: translate(-50%, -20px) scale(0.82); opacity: 0; }
  22%  { transform: translate(-50%, -38px) scale(1.04); opacity: 1; }
  100% { transform: translate(-50%, -70px) scale(0.96); opacity: 0; }
}
/* 贴着屏幕上沿的锚点（顶栏那排徽记）：标签往下落，往上飘会飞出视口。
   落点刻意收在顶栏那 63px 带内，别压到下面的分区导航。 */
.fx-burst.is-top .fx-tag { animation-name: fx-drop; }
@keyframes fx-drop {
  0%   { transform: translate(-50%, 14px) scale(0.82); opacity: 0; }
  22%  { transform: translate(-50%, 20px) scale(1.04); opacity: 1; }
  100% { transform: translate(-50%, 34px) scale(0.96); opacity: 0; }
}
/* 大境界 / 圆满 / 飞升：紫底大号，与灵气金分档 */
.fx-burst.is-big::before {
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-color: rgba(216, 196, 255, 0.95);
  box-shadow: 0 0 22px rgba(185, 138, 255, 0.6), inset 0 0 14px rgba(255, 200, 87, 0.3);
  animation-duration: 980ms;
}
.fx-burst.is-big .fx-tag {
  font-size: 13px;
  padding: 4px 12px;
  color: #1a1030;
  background: linear-gradient(90deg, var(--prestige), #e0ccff);
  box-shadow: 0 2px 16px rgba(185, 138, 255, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  animation-duration: 1100ms;
}

/* ---- 建筑：图标弹一下，角标跟着抖一次 ---- */
.gen-icon.is-lvup {
  animation: lv-pop 560ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
@keyframes lv-pop {
  0%   { transform: none; }
  32%  { transform: scale(1.14) translateY(-3px); }
  100% { transform: none; }
}
.gen-icon.is-lvup .gen-lv-badge {
  animation: lv-badge-pop 560ms cubic-bezier(0.2, 0.9, 0.3, 1.6);
}
@keyframes lv-badge-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  40%  { transform: scale(1.3); opacity: 1; }
  100% { transform: none; }
}
/* 整十级里程碑：卡片描边亮一道，只闪不循环 */
.generator.is-milestone {
  animation: card-flash 900ms ease-out;
}
@keyframes card-flash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 200, 87, 0); }
  22%  { box-shadow: 0 0 0 2px rgba(255, 216, 138, 0.8), 0 0 30px rgba(255, 180, 71, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(255, 200, 87, 0); }
}

/* ---- 顶栏境界徽记：破境时抬起再落回，带一道紫晕 ---- */
.realm-badge.is-realmup {
  animation: badge-rise 900ms cubic-bezier(0.2, 0.85, 0.25, 1);
}
@keyframes badge-rise {
  0%   { transform: none; box-shadow: none; }
  24%  { transform: translateY(-4px) scale(1.12); box-shadow: 0 0 26px rgba(185, 138, 255, 0.75); }
  66%  { transform: none; box-shadow: 0 0 12px rgba(255, 200, 87, 0.4); }
  100% { box-shadow: none; }
}

/* ---- 涨一层：进度条里的金充亮一下，填充自己已经有 width 过渡 ---- */
.realm-progress.is-layerup .rp-fill {
  animation: rp-surge 720ms ease-out;
}
@keyframes rp-surge {
  0%   { filter: none; }
  28%  { filter: brightness(1.75) saturate(1.15); box-shadow: 0 0 18px rgba(255, 206, 110, 0.85); }
  100% { filter: none; }
}

/* ---- 飞升：整块面板亮一次修为紫 ---- */
.prestige-panel.is-ascend {
  animation: ascend-glow 1100ms ease-out;
}
@keyframes ascend-glow {
  0%   { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); }
  26%  { box-shadow: 0 0 0 1px rgba(185, 138, 255, 0.6), 0 0 46px rgba(185, 138, 255, 0.38); }
  100% { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); }
}

/* ---- 分区切换：面板里的卡片错峰浮起，切页不再「啪」地一下全亮 ---- */
.tab-panel.is-active > .panel {
  animation: panel-in 300ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.tab-panel.is-active > .panel:nth-child(2) { animation-delay: 40ms; }
.tab-panel.is-active > .panel:nth-child(3) { animation-delay: 80ms; }
.tab-panel.is-active > .panel:nth-child(4) { animation-delay: 115ms; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---- 弹窗入场：遮罩淡入 + 卡片落下。#breakthrough-modal 的雷光过场特异度更高，仍走自己那套 ---- */
.modal.show { animation: modal-fade 200ms ease-out; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal.show .modal-body { animation: modal-in 280ms cubic-bezier(0.2, 0.85, 0.25, 1); }
@keyframes modal-in {
  from { transform: translateY(-12px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

@media (max-width: 560px) {
  .fx-tag { font-size: 11px; padding: 2px 7px; }
  .fx-burst.is-big .fx-tag { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  /* 关动效不等于丢信息：标签留着（不飘不移），圆环与错峰入场撤掉 */
  .fx-burst::before { display: none; }
  .fx-tag,
  .fx-burst.is-top .fx-tag,
  .gen-icon.is-lvup,
  .gen-icon.is-lvup .gen-lv-badge,
  .generator.is-milestone,
  .realm-badge.is-realmup,
  .realm-progress.is-layerup .rp-fill,
  .prestige-panel.is-ascend,
  .tab-panel.is-active > .panel,
  .tab-panel.is-active > .panel:nth-child(2),
  .tab-panel.is-active > .panel:nth-child(3),
  .tab-panel.is-active > .panel:nth-child(4),
  .modal.show,
  .modal.show .modal-body {
    animation: none;
  }
  .fx-tag { opacity: 1; }
  .tab-panel.is-active > .panel,
  .modal.show .modal-body { opacity: 1; transform: none; }
}
