/* ============================================================================
 *  MINI胖的传奇冒险 · 样式表
 * ==========================================================================*/

:root {
  --bg:        #0f0c0a;
  --bg-2:      #15110e;
  --panel:     #1d1712;
  --panel-2:   #241d16;
  --panel-3:   #2c231a;
  --line:      #3b2f23;
  --line-2:    #59462f;
  --gold:      #d9b06a;
  --gold-2:    #f2d79c;
  --text:      #d8cfc0;
  --text-2:    #a1937f;
  --dim:       #7a6c5b;
  --accent:    #cf5a2c;
  --hp:        #b23a2c;
  --hp-2:      #e05a44;
  --mp:        #2c6bb0;
  --mp-2:      #4a9ae0;
  --exp:       #c9971f;
  --exp-2:     #f0c040;
  --q1:        #c9c2b6;
  --q2:        #4aa3e0;
  --q3:        #a76bdc;
  --q4:        #e8a33d;
  --radius:    8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a1f16 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input { font-family: inherit; }
b { font-weight: 700; }

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* ============================== 成就栏 ============================== */
/*  页面最上方的一条进度带：顶栏之下、三栏布局之上。
 *  ⚠ 高度契约（见技能 fixed-grid-zero-shift）：
 *     - `.ach-bar` 本身 `flex: 0 0 auto`，`.ach-head` 写死一行高度，
 *       所以进度数字每 100ms 变一次也**不会**让下方战斗区上下抖。
 *     - 展开的 `.ach-list` 是**绝对定位浮层**（top: 100%），不参与布局流，
 *       所以展开/收起同样不改变页面高度，只是盖在下面内容之上。
 */
.ach-bar {
  position: relative;
  flex: 0 0 auto;
  z-index: 9;
  background: linear-gradient(180deg, #1b1410 0%, #141009 100%);
  border-bottom: 1px solid var(--line);
}

.ach-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;                 /* 写死：内容变化不许改高度 */
  padding: 0 16px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}
.ach-head:hover { background: rgba(217,176,106,.05); }

.ach-label { flex: 0 0 auto; color: var(--gold-2); font-weight: 700; font-size: 12px; }
.ach-count {
  flex: 0 0 auto; color: var(--gold-2); font-size: 12px;
  font-variant-numeric: tabular-nums;   /* 数字等宽：1→10 不会把后面挤走 */
}
.ach-count .ach-done { color: #7ee08a; }

/* 追踪项：占满中间剩余宽度，超长省略号截断 */
.ach-track {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden;
}
.ach-tname {
  flex: 0 1 auto; min-width: 0; color: var(--text-2); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ach-tnum {
  flex: 0 0 auto; color: var(--text-2); font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ach-toggle { flex: 0 0 auto; color: var(--gold); font-size: 12px; }

/* 迷你进度条：收起态给追踪项，展开态每条成就各一根。
 * ⚠ 这根条会出现在**两种方向不同**的 flex 容器里，flex-basis 的含义跟着变：
 *   · 收起态在 `.ach-head`（**行**容器）里 → `flex: 0 0 110px` 指的是「宽」
 *   · 展开态在 `.ai-main`（**列**容器）里 → flex-basis 指的是「高」，
 *     照抄 120px 会渲染成一根 120px 高的巨型黑条（踩过一次，截图才看出来）。
 *   所以列容器里必须用 flex-basis 表达高度，宽度靠 align-items: stretch 撑开。
 */
.bar.ach-mini {
  height: 5px; border-radius: 3px;
  background: rgba(0,0,0,.45); border: 1px solid var(--line);
  overflow: hidden;
}
.ach-head .bar.ach-mini { flex: 0 0 110px; }
.ach-item .bar.ach-mini { flex: 0 0 5px; align-self: stretch; }
.bar.ach-mini .fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #c9971f, #f0c040);
  transition: width .25s ease;
}
.ach-item.done .bar.ach-mini .fill { background: linear-gradient(90deg, #3f8f4e, #7ee08a); }

.ach-list {
  position: absolute; left: 0; right: 0; top: 100%;
  max-height: min(56vh, 430px); overflow-y: auto;
  padding: 8px 14px 12px;
  background: #191309;               /* 不透明：它是浮层，底下是战斗区 */
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 16px 34px rgba(0,0,0,.72);
}

.ach-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px;
  border: 1px solid transparent;
}
.ach-item + .ach-item { margin-top: 2px; }
.ach-item:hover { background: rgba(217,176,106,.06); }
.ach-item.done { border-color: rgba(126,224,138,.28); background: rgba(126,224,138,.05); }

.ai-ic { flex: 0 0 22px; text-align: center; font-size: 15px; }
.ai-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ai-top { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.ai-name {
  flex: 0 1 auto; min-width: 0; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-ok { flex: 0 0 auto; font-style: normal; font-size: 10px; color: #7ee08a; }
.ai-reward {
  flex: 1 1 auto; min-width: 0; color: var(--gold); font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-num {
  flex: 0 0 auto; color: var(--text-2); font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ach-item.done .ai-num { color: #7ee08a; }

@media (max-width: 960px) {
  .ach-head { height: 32px; padding: 0 10px; gap: 7px; font-size: 12px; }
  .ach-head .bar.ach-mini { flex: 0 0 70px; }
  .ach-label { font-size: 11px; }
  .ach-tname { font-size: 11px; }
  .ach-list { max-height: 46vh; padding: 6px 8px 10px; }
}

/* ============================== 顶栏 ============================== */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #241a12 0%, #17110d 100%);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 2px 14px rgba(0,0,0,.6);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  color: #2a1a0c;
  background: linear-gradient(160deg, var(--gold-2), #b8863a);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 8px rgba(0,0,0,.5);
  font-family: "STKaiti", "KaiTi", serif;
}
.brand-mark.big { width: 62px; height: 62px; font-size: 36px; border-radius: 10px; }

.brand-txt h1 {
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  white-space: nowrap;
  color: var(--gold-2);
  text-shadow: 0 1px 0 #000, 0 0 12px rgba(217,176,106,.35);
  font-family: "STKaiti", "KaiTi", serif;
}
.brand-txt p { font-size: 10px; color: var(--dim); letter-spacing: 3px; }

.top-stats {
  flex: 1 1 auto;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-2);
}
.top-stats .ts-item { white-space: nowrap; }
.top-stats .ts-item b { color: var(--gold-2); font-variant-numeric: tabular-nums; }

.top-actions { flex: 0 0 auto; min-width: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* 顶栏自动存档指示器 */
.save-state {
  font-size: 11px;
  line-height: 1;
  color: var(--dim);
  white-space: nowrap;
  min-width: 88px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color .25s;
}
.save-state.ok { color: #7ee07e; }
.save-state.warn { color: var(--gold-2); }
.save-state.err { color: #e2645b; }
.save-state.off { color: var(--dim); opacity: .7; }
.switch-sm { font-size: 11px; }

/* ============================== 按钮 ============================== */
.btn {
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  color: var(--text);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--gold-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-ghost { background: transparent; }
.btn-danger:hover { border-color: var(--hp-2); color: var(--hp-2); }
.btn-primary {
  background: linear-gradient(180deg, #c9762f, #8e4418);
  border-color: #d99a4a; color: #fff8ec; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  box-shadow: 0 2px 0 #5d2c0e, 0 4px 14px rgba(207,90,44,.35);
}
.btn-primary:hover { filter: brightness(1.12); color: #fff; }
.btn-lg { padding: 11px 34px; font-size: 15px; border-radius: 8px; }

.mini-btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-2);
  padding: 2px 8px; border-radius: 4px; font-size: 11px; cursor: pointer;
  transition: .15s;
}
.mini-btn:hover { color: var(--gold-2); border-color: var(--line-2); }
/* 一键回收在「自动回收 = 不回收」时被置灰：此时按下去没有任何可执行的动作 */
.mini-btn:disabled,
.mini-btn:disabled:hover {
  opacity: .4; cursor: not-allowed; color: var(--dim); border-color: var(--line);
}

/* 背包标题行右侧的按钮组：自动卖书 + 一键回收 */
.panel-title-row .title-btns { display: flex; align-items: center; gap: 6px; }

/* 「自动卖书」是开关按钮：开启时金色描边 + 淡金底，一眼看出正开着 */
.mini-btn.on,
.mini-btn.on:hover {
  color: var(--gold-2);
  border-color: var(--gold);
  background: rgba(200, 145, 58, .15);
  box-shadow: inset 0 0 0 1px rgba(200, 145, 58, .22);
}

/* ============================== 布局 ============================== */
/* 右栏（背包）比左栏宽：背包改成「一行一件装备」后，名字/稀有度/属性/按钮要横向排开 */
.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 372px;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  min-height: 0;
}

.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; }
.col-left, .col-right { overflow-y: auto; }
.col-mid { min-height: 0; overflow-y: auto; }   /* 日志固定 10 行后内容变高：窗口矮时中栏自己滚，别裁掉底部 */

.col::-webkit-scrollbar, .log::-webkit-scrollbar { width: 8px; }
.col::-webkit-scrollbar-thumb, .log::-webkit-scrollbar-thumb {
  background: #3a2e22; border-radius: 4px;
}
.col::-webkit-scrollbar-thumb:hover, .log::-webkit-scrollbar-thumb:hover { background: #554128; }

/* ============================== 面板 ============================== */
.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.022), transparent 40%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.03);
  flex: 0 0 auto;
}

.panel-title {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
  padding-bottom: 7px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.panel-title::before {
  content: '';
  position: absolute; left: -12px; top: 1px;
  width: 3px; height: 12px; border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--gold-2), var(--accent));
}
.panel-title em { font-style: normal; color: var(--dim); font-size: 11px; letter-spacing: 0; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; }

/* ============================== 角色面板 ============================== */
.char-panel { font-size: 12px; }

.char-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.char-avatar {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 24px;
  border-radius: 8px;
  background: radial-gradient(circle at 35% 30%, #3a2c1e, #1b140e);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 0 14px rgba(0,0,0,.7);
}
.char-id { min-width: 0; }
/* 名字 + 称号徽章同一行：名字可以被省略号截断，徽章永远完整显示（flex:0 0 auto） */
.char-id .cname {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--gold-2); font-weight: 700;
  min-width: 0;
}
.char-id .cname .cname-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 称号徽章：挂在名字右边的小金牌 */
.char-id .ctitle {
  flex: 0 0 auto;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 9px;
  letter-spacing: .3px; white-space: nowrap;
  color: #ffe6a8;
  background: linear-gradient(180deg, rgba(200,145,58,.42), rgba(160,110,40,.24));
  border: 1px solid rgba(226,178,96,.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.char-id .cmeta { font-size: 11px; color: var(--dim); }
.char-id .cmeta .cclass { color: var(--text-2); }

/* ---------------- 称号栏（名字下面那一块） ---------------- */
.title-box {
  margin-top: 9px; padding: 7px 10px 8px;
  background: linear-gradient(90deg, rgba(200,145,58,.10), rgba(200,145,58,.015));
  border: 1px solid rgba(200,145,58,.3);
  border-radius: 6px;
  font-size: 11px;
}
.title-box .tb-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  cursor: pointer; user-select: none;
}
.title-box .tb-t { color: var(--gold-2); font-weight: 700; letter-spacing: 1px; }
.title-box .tb-n { color: var(--dim); font-size: 10px; white-space: nowrap; }
.title-box .tb-list {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 7px;
}
.title-box .tb-tip { margin-top: 6px; color: var(--dim); font-size: 10px; }
/* 徽章：已解锁的可点，未解锁的是灰色占位（收起态直接隐藏） */
.tchip {
  font: inherit; font-size: 11px; line-height: 1;
  padding: 4px 7px; border-radius: 10px; white-space: nowrap;
  background: rgba(200,145,58,.14);
  border: 1px solid rgba(200,145,58,.42);
  color: var(--text);
}
button.tchip { cursor: pointer; }
button.tchip:hover { background: rgba(200,145,58,.26); }
.tchip.on {
  background: linear-gradient(180deg, rgba(200,145,58,.44), rgba(160,110,40,.26));
  border-color: rgba(226,178,96,.66);
  color: #ffe6a8; font-weight: 700;
}
.tchip.on i { font-style: normal; font-size: 9px; color: var(--dim); margin-left: 4px; }
.tchip.locked {
  background: rgba(120,110,95,.10);
  border: 1px dashed rgba(150,140,120,.34);
  color: var(--dim);
  display: inline-flex; align-items: center; gap: 5px;
}
.tchip.locked em { font-style: normal; font-size: 9px; color: var(--dim); opacity: .85; }
/* 带属性的称号（「占领 XX」幸运 +1）：把加成标在徽章上，金色高亮。
   ⚠ 与进度 em 区分：进度是灰的、加成是金的。 */
.tchip em.tstat { font-style: normal; font-size: 9px; color: var(--gold-2); border-left: 1px solid rgba(200,145,58,.4); padding-left: 5px; }
/* 收起态：锁定称号整条隐藏（.hide 由 JS 控制，和 .open 一起用） */
.tchip.locked.hide { display: none; }

.stat-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(90,70,47,.35);
}
.stat-row:last-child { border-bottom: none; }
.stat-row .k { color: var(--text-2); }
.stat-row .v { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; }
.stat-row .v.g { color: var(--gold-2); }
.stat-row .v.r { color: var(--hp-2); }

.power-box {
  margin-top: 9px; padding: 8px 10px;
  background: linear-gradient(90deg, rgba(207,90,44,.16), rgba(207,90,44,.02));
  border: 1px solid rgba(207,90,44,.35);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.power-box .pl { font-size: 11px; color: var(--text-2); letter-spacing: 1px; }
.power-box .pv { font-size: 17px; font-weight: 700; color: #ffb066; font-variant-numeric: tabular-nums; }

/* VIP 方框（账号级加成）：紫色系，和「战力」的橙、「里程碑」的金区分开。
   ⚠ 只有 VIP > 0 才渲染（见 ui.js 的 vipBox）—— 没有 VIP 的号这一块**完全不存在**，
     有 VIP 的号则出现在固定位置（战力之下、里程碑之上），不会跳。 */
.vip-box {
  margin-top: 8px; padding: 7px 10px;
  background: linear-gradient(90deg, rgba(150,90,220,.18), rgba(150,90,220,.02));
  border: 1px solid rgba(150,90,220,.4);
  border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
}
.vip-box .vip-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: #f6edff;
  background: linear-gradient(180deg, #9a5ae0, #6d33b8);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 4px; padding: 2px 7px; white-space: nowrap;
}
.vip-box .vip-txt { font-size: 11px; color: var(--text-2); }
.vip-box .vip-txt i {
  font-style: normal; font-weight: 700; color: #d4b4ff;
  font-variant-numeric: tabular-nums;
}
.vip-note { margin-top: 4px; font-size: 10px; line-height: 1.5; color: var(--dim); }

/* 等级里程碑（每 10 级叠一层）：金色描边，跟「战力」的橙色区分开。
   ⚠ 这个方框只放「已累积获得的属性」一行（用户口径 2026-10-05，见 ui.js 的 milestoneBox）。
     原来的 `.ms-n`（右侧「Lv.30 再叠 1 层 · 已 2 层」）和 `.ms-line.dim`（三行灰色说明）
     已随内容一起删掉 —— 要加回带暗色的说明行，先把口径问清楚。 */
.ms-box {
  margin-top: 8px; padding: 7px 10px;
  background: linear-gradient(90deg, rgba(200,145,58,.15), rgba(200,145,58,.02));
  border: 1px solid rgba(200,145,58,.34);
  border-radius: 6px;
  font-size: 11px; line-height: 1.55;
}
.ms-box .ms-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ms-box .ms-t { color: var(--gold-2); font-weight: 700; letter-spacing: 1px; }
.ms-box .ms-line { color: var(--text-2); }

/* 技能 */
.skill-list { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.skill-item {
  padding: 5px 8px; border-radius: 5px;
  background: rgba(167,107,220,.08);
  border: 1px solid rgba(167,107,220,.28);
  font-size: 11px;
}
.skill-item .sn { color: #c9a4ee; font-weight: 700; margin-right: 6px; }
.skill-item .sl {
  font-size: 10px; color: var(--gold-2); margin-right: 6px;
  border: 1px solid rgba(200,160,80,.35); border-radius: 8px; padding: 0 4px;
}
.skill-item .sd { color: var(--text-2); }
.skill-item.locked { opacity: .45; border-style: dashed; }
.skill-item.locked .sn { color: var(--dim); }

/* ============================== 装备 ============================== */
/* 十个装备位（武器/衣服/头盔/项链/手镯×2/戒指×2/鞋子/腰带）纵向排列，左栏可滚动 */
.equip-grid { display: flex; flex-direction: column; gap: 4px; }

.equip-slot {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .15s;
  min-height: 34px;
}
.equip-slot:hover { border-color: var(--line-2); background: var(--panel-3); }
/* 装备图标（.ei）已按要求整体移除，这里不再保留 26px 的图标位 */
.equip-slot .en { flex: 1 1 auto; min-width: 0; }
.equip-slot .en .slot-name { font-size: 10px; color: var(--dim); }
.equip-slot .en .item-name {
  font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.equip-slot .en .item-name.empty { color: #4d4237; font-weight: 400; }
.equip-slot .estat { font-size: 10px; color: var(--text-2); text-align: right; line-height: 1.35; }
.equip-slot .estat i { font-style: normal; color: var(--gold); }

/* ============================== 生命/魔法/经验 ============================== */
.vitals { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }

.bar {
  position: relative;
  height: 18px;
  background: #0d0a07;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.8);
}
.bar .fill {
  height: 100%; width: 0%;
  transition: width .18s linear;
  background-size: 200% 100%;
}
.bar .label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 6px rgba(0,0,0,.8);
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}
.bar.hp .fill { background: linear-gradient(180deg, #e05a44, #8e2418); }
.bar.mp .fill { background: linear-gradient(180deg, #4a9ae0, #1c4a86); }
.bar.exp { height: 14px; }
.bar.exp .fill { background: linear-gradient(180deg, #f0c040, #a06f10); }
.bar.exp .label { font-size: 10px; }

.bar.hp.dead .fill { background: #4a1a14; }

/* ============================== 战斗区 ============================== */
/* 日志框高度已固定（10 行），面板不再需要靠拉伸去填满整栏 ⇒ 面板贴着内容收住，
   中栏剩下的空间就是页面底色；窗口太矮时由 .col-mid 自己滚动，不会把日志裁掉。 */
.battle-panel { display: flex; flex-direction: column; flex: 0 0 auto; }

.arena {
  flex: 0 0 auto;
  min-height: 96px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 120%, rgba(207,90,44,.14), transparent 62%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 22px),
    #120e0a;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.arena .map-tag {
  position: absolute; top: 8px; left: 10px;
  font-size: 11px; color: var(--dim); letter-spacing: 1px;
}

/* ---------------- 战斗立绘（怪物栏左边的人物） ----------------
   立绘与怪物栏并排在 .arena-body 里。**战斗区高度只能由固定 10 格怪物栏决定**：
   立绘宽度写死、高度由 svg 比例算出（80px 宽 → 约 93px，小于怪物栏的 122px），
   所以立绘出不出现、切不切状态，战斗区高度都纹丝不动。
   回归守卫在 tools/probe-hero-layout.js（真 Chrome 量 rect）。 */
.arena-body {
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 852px;          /* = 立绘 80 + 间距 12 + 怪物栏 760 */
  margin-top: 14px;          /* 与左上角地图名错开（原先挂在 .mob-list 上） */
}

/* z-index 必须**高于** .arena-note：阵亡浮层是一层 86%~94% 不透明的遮罩，
   不抬起来的话「生气」的脸会整个被盖住 —— 而那正是玩家阵亡时该看见的东西。 */
.arena-hero {
  flex: 0 0 auto;
  width: 80px;
  position: relative; z-index: 2;
  pointer-events: none;
}
.arena-hero svg { display: block; width: 100%; height: auto; overflow: visible; }

/* 配色全部集中在这里，换主题只动这一段（SVG 里不写任何颜色） */
.hero-limb-o    { fill: none; stroke: #2a1c14; stroke-width: 11; stroke-linecap: round; }
.hero-limb      { fill: none; stroke: #fbe7cf; stroke-width: 7.4; stroke-linecap: round; }
.hero-dress     { fill: #3e8fe0; stroke: #2a1c14; stroke-width: 3; stroke-linejoin: round; }
.hero-face      { fill: #fbe7cf; stroke: #2a1c14; stroke-width: 3; }
.hero-hair      { fill: #7a2e3c; stroke: #2a1c14; stroke-width: 3; stroke-linejoin: round; }
.hero-bun       { fill: #7a2e3c; stroke: #2a1c14; stroke-width: 3; }
.hero-bun-line  { fill: none; stroke: #5e2230; stroke-width: 2; stroke-linecap: round; }
.hero-stick-o   { fill: none; stroke: #2a1c14; stroke-width: 5; stroke-linecap: round; }
.hero-stick     { fill: none; stroke: #e8d9c0; stroke-width: 2.4; stroke-linecap: round; }
.hero-candy     { fill: #f7dc6f; stroke: #2a1c14; stroke-width: 3; }
.hero-candy-line{ fill: none; stroke: #d9a400; stroke-width: 2.2; stroke-linecap: round; }
.hero-eye       { fill: none; stroke: #2a1c14; stroke-width: 3.4; stroke-linecap: round; }
.hero-blush     { fill: #f3a79c; opacity: .8; }
.hero-mouth     { fill: #c0392b; stroke: #2a1c14; stroke-width: 2.6; stroke-linejoin: round; }
.hero-brow      { fill: none; stroke: #2a1c14; stroke-width: 3.6; stroke-linecap: round; }
.hero-pupil     { fill: #2a1c14; }
.hero-blush-hot { fill: #ee8e80; opacity: .9; }
.hero-mouth-angry { fill: none; stroke: #2a1c14; stroke-width: 3.4; stroke-linecap: round; }
.hero-steam     { fill: none; stroke: #e0533a; stroke-width: 3.2; stroke-linecap: round;
                  transform-box: fill-box; transform-origin: 50% 50%; }

/* 表情切换：默认（待机 / 攻击）是开心脸；阵亡时换生气脸 + 头顶怒气符号 */
.hero-face-angry, .hero-steam { display: none; }
.arena-hero.dead .hero-face-happy { display: none; }
.arena-hero.dead .hero-face-angry,
.arena-hero.dead .hero-steam { display: block; }

/* 挥击的转轴设在肩部：fill-box 用的是**不含描边**的几何包围盒，
   而这条手臂的肩端 (76,84) 恰好就是它包围盒的左下角（0% 100%）。
   ⚠ 不写 transform-box 的话 transform-origin 会以整个 SVG 画布为参照，一抡手臂就飞出去。 */
.hero-arm { transform-box: fill-box; transform-origin: 0% 100%; }

@media (prefers-reduced-motion: no-preference) {
  .arena-hero .hero-float     { animation: heroIdle 2.4s ease-in-out infinite; }
  .arena-hero.atk .hero-body  { animation: heroLunge .36s ease-out; }
  .arena-hero.atk .hero-arm   { animation: heroSwing .36s ease-out; }
  .arena-hero.dead .hero-body { animation: heroAngry .24s linear infinite; }
  .arena-hero.dead .hero-steam{ animation: heroSteam .7s ease-in-out infinite; }
}
@keyframes heroIdle { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-3px) } }
@keyframes heroLunge { 0% { transform: translateX(0) } 35% { transform: translateX(5px) } 100% { transform: translateX(0) } }
@keyframes heroSwing { 0%,100% { transform: rotate(0) } 30% { transform: rotate(-30deg) } 55% { transform: rotate(34deg) } }
@keyframes heroAngry { 0%,100% { transform: translate(0,0) } 25% { transform: translate(-1.4px,0) } 75% { transform: translate(1.4px,0) } }
@keyframes heroSteam { 0%,100% { opacity: .35; transform: scale(.82) } 50% { opacity: 1; transform: scale(1.08) } }

/* 场上怪物列表（威胁度已按需求取消显示）。
   **固定 5 列 × 2 行 = 10 格**，与「一波几只」无关 —— 空位由 .mob-slot 占住，
   所以战斗区的高度、每只怪的位置都不随怪物数量变动。
   每格三行：名字 + 精英/BOSS 标签 / 血条 / 等级 · 血量数字。
   （这里没有怪物图标 —— 图标按需求删除后未恢复。） */
.mob-list {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-content: center;
  gap: 8px 12px;
  width: 100%;
  max-width: 760px;
  /* margin-top 挪到 .arena-body（立绘与怪物栏要一起和地图名错开） */
}
/* .mob-row 要 relative：让「尸体」角标绝对定位到它右上角（见 .dead-chip）。
   min-height 与 .mob-slot 取同一个值（50px = 17 + 4 + 9 + 4 + 16），
   于是「有怪的格子」与「空位」永远一样高 ⇒ 战斗区高度跟怪物数量完全无关。 */
.mob-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 50px; position: relative; }

/* 空位：虚线淡框，纯占位。
   ⚠ 它**不是** .mob-row —— 所以「场上几只怪」之类的统计不会被空位污染。 */
.mob-slot {
  border: 1px dashed rgba(255,255,255,.055);
  border-radius: 4px;
  /* 与 .mob-row 取同一个高度（17 头 + 4 + 9 条 + 4 + 16 脚 = 50）：
     这样「全是空位」的行不会比「有怪」的行矮，10 格的高度恒定，
     连 BOSS 单独出场（1 只怪 + 9 空位）时战斗区也不会变高变矮。 */
  min-height: 50px;
}

/* ⚠ 高度写死 17px（= 角标那一行的高度），**不是** content 撑出来的：
   这样「精英 / BOSS / 尸体」角标出不出现，第一行都是 17px，整格高度恒定 = 50px。
   padding-right 恒定为「尸体」角标预留位置（角标本身是绝对定位的，见下），
   于是击杀瞬间名字宽度、行高、整个怪物栏的尺寸全部零变化。 */
.mob-head {
  display: flex; align-items: center; gap: 5px;
  height: 17px; font-size: 12px; line-height: 17px; min-width: 0;
  padding-right: 34px;
}
.mob-name {
  flex: 1 1 auto; min-width: 0; font-weight: 700; letter-spacing: .5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mob-lv { flex: 0 0 auto; font-size: 10px; color: var(--dim); }

/* 第三行：等级（左）+ 血量数字（右）。格子被压到 5 列（最窄约 120px）时，
   单行塞不下 名字+角标+等级+血量，所以把等级与血量挪到独立一行。 */
.mob-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 6px; min-width: 0;
}
.mob-hpv {
  font-size: 10px; color: var(--text-2); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mob-hpbar { height: 9px; }
.mob-hpbar .fill { background: linear-gradient(180deg, #e05252, #7d1a1a); }

/* 精英 / BOSS 用颜色 + 角标区分，一眼能挑出该打谁。
   ⚠ BOSS 的血条**不改变高度**（改高度会让这一行比别人高，战斗区高度就跟着变了），
     只加一圈描边 + 更亮的高光。 */
.mob-row.elite .mob-name { color: #c8a6ff; text-shadow: 0 0 10px rgba(150,110,220,.45); }
.mob-row.boss .mob-name { color: #ff9a5a; text-shadow: 0 0 12px rgba(255,110,50,.5); }
.mob-row.boss .mob-hpbar {
  box-shadow: 0 0 0 1px rgba(255,154,90,.6), 0 0 8px rgba(255,110,50,.35);
}

/* 已击杀的怪**保留在场上当尸体**（整波清空后才换新的一波）：
   整行压暗、名字划掉、血条清空、右侧血量改成「已击杀」 */
.mob-row.down { opacity: .45; }
.mob-row.down .mob-name { text-decoration: line-through; text-shadow: none; color: var(--dim); }
.mob-row.down .mob-hpv { color: var(--dim); }

/* 「尸体」角标：**绝对定位**在格子右上角，彻底脱离布局流。
   ⚠ 这个定位是「怪物栏不跳」的关键 —— 早先它挤在名字旁边（flex 子元素），
   一出现就把名字挤窄、第一行还被它的 15px 行高从 14px 撑到 17px，
   于是整格变高、grid 行高跟着变、align-content:center 再一重排，
   手机上一波怪陆续倒下时整块怪物栏就一跳一跳。
   现在它出现/消失只影响自己，其它格子连重排都不会发生。
   空间由 .mob-head 的 padding-right: 34px 恒定预留，所以也不会盖住名字。 */
.dead-chip {
  position: absolute; top: 0; right: 0;
  font-size: 9px; line-height: 15px; padding: 0 5px;
  border-radius: 8px; letter-spacing: .5px;
  background: rgba(140,140,140,.16); color: var(--dim);
  border: 1px solid rgba(150,150,150,.35);
}

/* 整波清空后、下一波刷新前那 1 秒的倒计时。
   用**绝对定位浮层**，不占布局高度 —— 出现/消失时战斗区高度不变。 */
.wave-wait {
  position: absolute; left: 0; right: 0; bottom: 9px;
  text-align: center;
  font-size: 12px; letter-spacing: 1px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}

/* 阵亡 / 寻找猎物：盖在 10 格空位之上的居中浮层（同样不占布局高度） */
.arena-note {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px;
  background: radial-gradient(circle at 50% 50%, rgba(18,14,10,.86), rgba(18,14,10,.94));
  pointer-events: none;
}

.elite-chip, .boss-chip {
  flex: 0 0 auto; font-size: 9px; line-height: 15px; padding: 0 5px;
  border-radius: 8px; letter-spacing: .5px;
}
.elite-chip {
  background: linear-gradient(90deg,#5a3d8e,#8a5fd0); color: #f2e9ff;
  border: 1px solid #b28fe8;
}
.boss-chip {
  background: linear-gradient(90deg,#8e2418,#cf5a2c); color: #fff;
  border: 1px solid #ff9a5a; animation: bossPulse 1.4s ease-in-out infinite;
}
@keyframes bossPulse { 0%,100% { opacity: 1 } 50% { opacity: .6 } }

.arena .searching { color: var(--dim); font-size: 13px; letter-spacing: 1px; text-align: center; }
.arena .searching .dots::after {
  content: ''; animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots { 0%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} }

/* 「同时出现 N 只怪」选择条：与地图栏同一套视觉。
   位置在战斗区**上方**（紧挨着它要影响的那份怪物列表），上下各留 10px 间距。 */
.mob-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 9px;
  margin: 10px 0;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(207,90,44,.12), rgba(207,90,44,.02));
  border: 1px solid rgba(207,90,44,.28);
}
.mob-bar-label {
  font-size: 11px; color: #ff9a5a;
  letter-spacing: 2px; white-space: nowrap;
}
.mob-select {
  flex: 0 0 auto;
  min-width: 110px;
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: #ffb98a;
  font-family: inherit; font-size: 12px; font-weight: 700;
  padding: 4px 7px; outline: none; cursor: pointer;
}
.mob-select:focus { border-color: #ff9a5a; }
.mob-select option { background: #1c1a16; color: var(--text); }

/* 「打精英 / 打BOSS」两个开关：11px 小勾选框 + 10px 文字的小胶囊，
   紧跟在「同时出现」下拉右边（2026-10-05 用户要求）。
   ⚠ 这两个控件的**宽度是契约**：一旦把那行说明（.mob-bar-hint）挤到第二行，
     整条栏就变高、战斗区被顶下去。改字号 / 加字 / 加 padding 之前先跑
     tools/probe-mob-bar-layout.js —— 它会「把两个开关藏起来再量栏高」，
     两次必须逐像素相同（拿掉控件高度一点不变）才算没破坏契约。 */
.mob-tgl {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 5px;
  border-radius: 999px;
  border: 1px solid rgba(207, 90, 44, .30);
  background: rgba(0, 0, 0, .20);
  font-size: 10px; line-height: 1.3; color: #ffb98a;
  white-space: nowrap; cursor: pointer; user-select: none;
}
.mob-tgl:hover { border-color: #ff9a5a; }
.mob-tgl input {
  width: 11px; height: 11px; margin: 0; padding: 0;
  accent-color: #ff9a5a; cursor: pointer;
}
/* 没勾（这一档不打了）：整颗变灰，一眼看出与默认态不同 */
.mob-tgl.off { color: var(--dim); border-color: var(--line); background: transparent; }
/* 本图没有 BOSS：置灰 + 不可点。点了不会有任何反应，不如当场说清楚为什么
   （鼠标悬停的 title 里写着「哪张图才会遇到 BOSS」）。 */
.mob-tgl.na { opacity: .45; color: var(--dim); border-color: var(--line); background: transparent; cursor: not-allowed; }
.mob-tgl.na input { cursor: not-allowed; }

.mob-bar-hint {
  flex: 1 1 180px; min-width: 0;
  font-size: 10px; line-height: 1.45; color: var(--dim);
}
.mob-bar-hint b { color: #ffb98a; }
.mob-bar-hint .warn-txt { color: #e0603a; }

.dead-banner {
  /* 「mini胖重振旗鼓」是中英混排，字距要收（3px 会松散断开）；加居中与左右内边距防窄屏溢出 */
  color: var(--hp-2); font-size: 17px; font-weight: 700; letter-spacing: 1px;
  text-align: center; line-height: 1.5; padding: 0 12px;
  text-shadow: 0 0 16px rgba(224,90,68,.6);
}

/* 战斗控制条 */
.battle-ctl {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0 8px;
  flex-wrap: wrap;
}
.auto-btn {
  padding: 8px 22px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 700;
  border: 1px solid #d99a4a;
  background: linear-gradient(180deg, #c9762f, #8e4418);
  color: #fff8ec; text-shadow: 0 1px 2px rgba(0,0,0,.5);
  transition: .15s;
  box-shadow: 0 2px 0 #5d2c0e;
}
.auto-btn:hover { filter: brightness(1.12); }
.auto-btn.off {
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border-color: var(--line-2); color: var(--text-2); text-shadow: none; box-shadow: none;
}
.ctl-hint { font-size: 11px; color: var(--dim); }
.ctl-hint b { color: var(--gold); }

/* ============================== 日志 ============================== */
/*  日志框是**固定高度**的：高度 = 可见行数 × 行高，跟里面有 1 条还是 100 条完全无关
 *  （同「固定 10 格怪物栏」一套思路：面板不随内容伸缩，布局纹丝不动）。
 *
 *    --log-row-h  行高（px）：= line-height 19 + 上下 padding 各 1 + 下边框 1 = 22
 *    --log-rows   可见行数：由 ui.js 从 CONFIG.logVisibleLines 现取（这里 10 只是兜底）
 *
 *  ⚠ 改「可见行数」只动 config.js（logVisibleLines）；改「行高」要同时改 --log-row-h
 *    与 .log-line 的 line-height —— 两边对不上，10 行就会露出半行来。
 *  回归守卫：tools/probe-log-layout.js（真 Chrome 量 rect）。 */
.log-wrap { flex: 0 0 auto; display: flex; flex-direction: column; }

.log {
  --log-row-h: 22px;
  flex: 0 0 auto;
  height: calc(var(--log-rows, 10) * var(--log-row-h));
  overflow-y: auto;
  font-size: 12px;
  line-height: 19px;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.log-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--dim); letter-spacing: 2px;
  padding-bottom: 5px; border-bottom: 1px solid var(--line); margin-bottom: 5px;
}
/* ⚠ 这一行的盒子高度必须恒等于 .log 里的 --log-row-h（19 + 1 + 1 + 1 = 22）：
   否则「10 行」的高度算不准，框里会露出半行。改 padding / border 记得同步那个变量。 */
.log-line {
  padding: 1px 0;
  color: var(--text-2);
  border-bottom: 1px solid rgba(59,47,35,.35);
  animation: slideIn .22s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
.log-line b.dmg    { color: #ffb866; }
.log-line b.dmg-in { color: #ff8a72; }
.log-line b.exp    { color: var(--exp-2); }
.log-line b.gold   { color: var(--gold-2); }
.log-line b.lv     { color: #7ee07e; }
.log-line .tag-crit {
  color: #ffcf6a; font-size: 10px; border: 1px solid #d9a12c; border-radius: 3px;
  padding: 0 3px; margin: 0 3px;
}
.log-line .tag-skill {
  color: #c9a4ee; font-size: 10px; border: 1px solid rgba(167,107,220,.6); border-radius: 3px;
  padding: 0 3px; margin: 0 2px;
}
.log-line .affix { color: #7fd9d9; font-size: 11px; }
.log-line .times {
  color: var(--gold-2); font-size: 10px; margin-left: 4px;
  border: 1px solid rgba(217,176,106,.5); border-radius: 3px; padding: 0 4px;
}
.log-line.pulse { animation: pulseLine .25s ease-out; }
@keyframes pulseLine {
  0%   { background: rgba(217,176,106,.22); }
  100% { background: transparent; }
}

.log-line.atk      { color: #cfc3b0; }
.log-line.crit     { color: #ffe0a8; }
.log-line.hit      { color: #b09a86; }
.log-line.crit-in  { color: #ff9c86; background: rgba(178,58,44,.10); }
.log-line.skill    { color: #c9a4ee; }
.log-line.heal     { color: #7ee0a0; }
.log-line.kill     { color: #ffcf6a; background: rgba(201,151,31,.08); }
.log-line.boss     { color: #ff9a5a; font-weight: 700; background: rgba(207,90,44,.14); }
.log-line.levelup  { color: #7ee07e; font-weight: 700; background: rgba(80,200,120,.10); }
.log-line.drop     { color: #9fd0a8; }
.log-line.drop-hi  { color: #d7b0ff; background: rgba(167,107,220,.10); }
.log-line.sell     { color: #8fa08f; }
.log-line.die      { color: var(--hp-2); font-weight: 700; background: rgba(178,58,44,.16); }
.log-line.sys      { color: var(--dim); font-style: italic; }
.log-line.warn     { color: #ddb06a; }

/* ============================== 地图 ============================== */
/* 地图选择器：放在人物血量（状态条）上方的一条窄栏 */
.map-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 9px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(217,176,106,.10), rgba(217,176,106,.02));
  border: 1px solid rgba(217,176,106,.25);
}
.map-bar-label {
  font-size: 11px; color: var(--gold);
  letter-spacing: 2px; white-space: nowrap;
}
.map-select {
  flex: 0 0 auto;
  min-width: 190px; max-width: 60%;
  background: rgba(0, 0, 0, .32);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--gold-2);
  font-family: inherit; font-size: 12px; font-weight: 700;
  padding: 4px 7px; outline: none; cursor: pointer;
}
.map-select:focus { border-color: var(--gold); }
.map-select option { background: #1c1a16; color: var(--text); }
.map-select option:disabled { color: #6b655c; }
.map-bar-hint {
  flex: 1 1 160px; min-width: 0;
  font-size: 10px; line-height: 1.45; color: var(--dim);
}
/* ⚠ 这行说明是"按文字长度换行"的活高度，**别往它里面加任何内容**（连字号/行高都别动）：
   实测 1366×900 下多塞十几个字就会多占一行，地图栏 45 → 59.5px，
   把下面的血条与战斗区整体顶下去 14.5px。地图专属加成（新手村掉落 ×3）写在
   `#mapSelect` 的**选项文字**里 —— 那是零布局成本的位置。
   守卫在 tools/probe-map-buff-layout.js（改倍率前后地图栏高度必须逐像素相同）。 */

/* ============================== 背包 ============================== */
.bag-panel { display: flex; flex-direction: column; }

/* 背包：一件装备一行 —— 名字 / 稀有度 / 属性 / 按钮。
   不用图标（已按要求去掉），所以用 flex 换行：一行放不下时按钮整组落到下一行，
   顺序始终是「名字 → 稀有度 → 属性 → 按钮」，不会出现属性和按钮错位。 */
.bag-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }

.bag-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #16110c;
  border: 1px solid var(--line);
  border-left-width: 3px;
  font-size: 11.5px;
  transition: .12s;
}
.bag-row:hover { background: #1d1610; border-color: var(--line-2); }

/* 稀有度：用左边框 + 名字颜色表示，行内再挂一个小标签 */
.bag-row.q2 { border-left-color: #4aa3e0; }
.bag-row.q3 { border-left-color: #a76bdc; }
.bag-row.q4 { border-left-color: #e8a33d; }
.bag-row.q5 {
  border-left-color: #ff4d4d;
  background: linear-gradient(90deg, rgba(255,77,77,.10), #16110c 60%);
  animation: godPulse 1.8s ease-in-out infinite;
}
@keyframes godPulse {
  0%,100% { box-shadow: inset 0 0 10px rgba(255,77,77,.16); }
  50%     { box-shadow: inset 0 0 16px rgba(255,77,77,.34); }
}
.bag-row.locked { opacity: .55; }

/* 技能书：统一用蓝青色，和装备（品类色）与消耗品区分开 */
.bag-row.book { border-left-color: #8fd3ff; background: #101a22; }
.bag-row.book:hover { background: #16232e; border-color: var(--line-2); }
.bag-row .br-stat i.book { color: #8fd3ff; }
.log-line .book { color: #8fd3ff; font-weight: 600; }

.bag-row .br-name {
  font-weight: 700; font-size: 12px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 3px;
}
.bag-row .br-name .up { font-style: normal; font-size: 9px; color: #7ee07e; }
.bag-row .br-name .br-qty { font-style: normal; font-size: 10px; color: var(--gold-2); }

/* 角色面板「攻击间隔」后面的固定减免角标（成就「万人斩」-0.05 秒这类） */
.ctitle-buff { color: #ffd45e; font-size: 11px; }

.bag-row .br-cat {
  flex: 0 0 auto; font-size: 10px; white-space: nowrap;
  padding: 0 5px; border-radius: 8px;
  border: 1px solid currentColor;
  opacity: .9;
}

.bag-row .br-stat {
  flex: 1 1 96px; min-width: 0;
  color: var(--text-2); font-size: 10.5px; line-height: 1.5;
}
.bag-row .br-stat i {
  font-style: normal; color: var(--gold); margin-right: 5px;
  font-variant-numeric: tabular-nums;
}
.bag-row .br-stat span { margin-right: 5px; font-variant-numeric: tabular-nums; }
.bag-row .br-stat .none { color: #4d4237; }

.bag-row .br-req {
  flex: 0 0 auto; font-size: 10px; color: #e08a8a; white-space: nowrap;
}

.bag-row .br-btns { flex: 0 0 auto; margin-left: auto; display: flex; gap: 4px; }

.br-btn {
  font: inherit; font-size: 10.5px; line-height: 1.5;
  padding: 2px 8px; border-radius: 5px; cursor: pointer;
  background: var(--panel-3); color: var(--text);
  border: 1px solid var(--line-2);
  transition: .12s; white-space: nowrap;
}
.br-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.br-btn.sell { color: var(--text-2); }
.br-btn.sell:hover { border-color: #b23a2c; color: #e08a8a; }
.br-btn[disabled] { opacity: .45; cursor: not-allowed; }
.br-btn[disabled]:hover { border-color: var(--line-2); color: var(--text); }

.bag-empty {
  padding: 18px 8px; text-align: center;
  color: #4d4237; font-size: 11.5px;
  border: 1px dashed var(--line); border-radius: 6px;
}

/* 品类掉落统计 */
.cat-stat {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  margin-bottom: 7px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px; color: var(--text-2);
}
.cat-stat .cs { white-space: nowrap; }
.cat-stat .cs b { font-weight: 700; }
.cat-stat .cs.zero { color: #514436; }

/* 背包上方的自动回收 / 自动吃药（两个下拉） */
.bag-opt {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  margin-bottom: 6px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--text-2);
}
.bag-opt .opt { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.bag-opt .opt-label { color: var(--text-2); }
/* 红药 / 蓝药阈值：从属于「自动吃药」，缩进一级并弱化，关闭吃药时整体置灰 */
.bag-opt .opt-sub { margin-left: 8px; padding-left: 6px; border-left: 1px solid var(--line); }
.bag-opt .opt-sub .opt-label { color: var(--gold-2); }
.bag-opt .opt-sub select { max-width: 104px; }
.bag-opt .opt.off { opacity: .45; }
.bag-opt .opt.off select { cursor: not-allowed; }
.bag-opt select[disabled] { cursor: not-allowed; }
.bag-opt select {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--gold-2);
  color-scheme: dark;                 /* 让浏览器原生下拉列表也是深色 */
  font-family: inherit; font-size: 11px;
  padding: 3px 6px; outline: none; cursor: pointer;
  max-width: 148px;
}
.bag-opt select:hover,
.bag-opt select:focus { border-color: var(--accent); }

/* 下拉下方的一行说明 */
.opt-tip {
  font-size: 10.5px; line-height: 1.55; color: var(--dim);
  margin-bottom: 7px;
}
.opt-tip b { color: var(--gold-2); }

.switch { display: flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { accent-color: #c9762f; cursor: pointer; }

/* 物品详情浮层 */
.item-tip {
  position: fixed;
  z-index: 900;
  max-width: 240px;
  padding: 9px 11px;
  border-radius: 7px;
  background: rgba(20,15,10,.97);
  border: 1px solid var(--line-2);
  box-shadow: 0 8px 28px rgba(0,0,0,.8);
  font-size: 12px;
  pointer-events: none;
  line-height: 1.6;
}
.item-tip .tt-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.item-tip .tt-slot { font-size: 10px; color: var(--dim); margin-bottom: 3px; }
.item-tip .tt-line { color: var(--text-2); }
.item-tip .tt-line b { color: var(--gold-2); }
.item-tip .tt-affix { color: #7fd9d9; }
.item-tip .tt-bonus {
  margin: 4px 0 2px; padding: 3px 0 2px;
  border-top: 1px dashed var(--line-2);
}
.item-tip .tt-bonus .tt-line b { color: #7ee07e; }
.item-tip .tt-req { color: var(--dim); font-size: 11px; }
.item-tip .tt-req.no { color: var(--hp-2); }
.item-tip .tt-hint { margin-top: 5px; font-size: 11px; color: var(--dim); border-top: 1px solid var(--line); padding-top: 4px; }

/* ============================== 建号界面 ============================== */
.overlay {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(207,90,44,.18), transparent 65%),
    rgba(6,4,3,.93);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

.start-box { width: min(760px, 100%); text-align: center; }
.start-title { margin-bottom: 26px; }
.start-title .brand-mark { margin: 0 auto 12px; }
.start-title h1 {
  font-size: 30px; letter-spacing: 4px; color: var(--gold-2);
  font-family: "STKaiti", "KaiTi", serif;
  text-shadow: 0 2px 0 #000, 0 0 30px rgba(217,176,106,.45);
}
.start-title p { color: var(--dim); font-size: 12px; letter-spacing: 4px; margin-top: 6px; }

/* 职业卡片：用 flex + 居中，而不是写死 3 列 ——
   因为建号界面目前**只开放 mini胖**（config.OPEN_CLASSES），
   写死 repeat(3,1fr) 的话单张卡片会缩在左边占 1/3，很难看。
   以后放开法师/道士，3 张会自动排成一行居中。 */
.class-list {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 14px; margin-bottom: 22px;
}

.class-card {
  flex: 0 1 210px;      /* 三张并排时刚好一行（3×210 + 间距 < 760 的 .start-box） */
  padding: 18px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .18s;
  text-align: center;
}
/* 只剩一张卡片时放宽一点 —— mini胖现在有 7 个技能，名字变长后 210px 会挤成一片 */
.class-card:only-child { flex-basis: 300px; }
.class-card:hover { transform: translateY(-4px); border-color: var(--line-2); }
.class-card.sel {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(217,176,106,.15), rgba(217,176,106,.03));
  box-shadow: 0 0 0 1px rgba(217,176,106,.35), 0 8px 26px rgba(0,0,0,.55);
}
.class-card .cc-icon { font-size: 40px; margin-bottom: 8px; display: block; }
/* 职业名字距收到 1px：现在的职业名是「mini胖」，中英混排下 4px 的字距会显得松散断开 */
.class-card .cc-name { font-size: 17px; font-weight: 700; letter-spacing: 1px; margin-bottom: 6px; }
.class-card .cc-desc { font-size: 11px; color: var(--text-2); line-height: 1.6; min-height: 52px; }
.class-card .cc-skill { font-size: 10px; color: var(--dim); margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }

.start-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.name-input {
  width: min(320px, 100%);
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
}
.name-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,176,106,.12); }
.name-input::placeholder { color: #5c5044; letter-spacing: 0; }

/* 该账号的存档卡片（登录后在选职业页上方展示，内容由 main.js renderSaveCard 填） */
.save-card {
  width: min(440px, 100%);
  margin: 0 auto 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(217,176,106,.10), rgba(217,176,106,.02));
  border: 1px solid var(--line-2);
  text-align: left;
}
.save-card .sc-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.save-card .sc-tag {
  font-size: 10px; letter-spacing: 2px; font-weight: 700; color: #1a1410;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  padding: 1px 6px; border-radius: 3px;
}
.save-card .sc-account { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--gold-2); }
.save-card .sc-body {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
}
.save-card .sc-row { display: flex; justify-content: space-between; gap: 8px; min-width: 0; font-size: 12px; }
.save-card .sc-k { flex: 0 0 auto; color: var(--dim); }
.save-card .sc-v {
  min-width: 0; color: var(--text); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 存档卡上的称号小徽章（跟在角色名后面） */
.save-card .sc-title {
  display: inline-block; vertical-align: middle;
  font-size: 10px; padding: 1px 5px; border-radius: 8px; margin-left: 2px;
  color: #ffe6a8;
  background: linear-gradient(180deg, rgba(200,145,58,.42), rgba(160,110,40,.24));
  border: 1px solid rgba(226,178,96,.55);
}

/* ============================== 登录 / 注册 ============================== */
/* 比建号界面更窄的一栏卡片（380px 足够放「账号 + 密码 + 按钮」） */
.login-box { width: min(380px, 100%); text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; text-align: left; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field label { font-size: 12px; color: var(--text-2); letter-spacing: 3px; }
.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.auth-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,176,106,.12); }
.auth-field input::placeholder { color: #5c5044; font-size: 11px; letter-spacing: 0; }

/* 表单错误提示（用户名已存在 / 两次密码不一致……），常驻占位避免抖动 */
.auth-err { min-height: 17px; font-size: 12px; color: #e06a5a; text-align: center; line-height: 1.4; }
.auth-switch { font-size: 12px; color: var(--dim); text-align: center; }
.auth-switch a {
  color: var(--gold); cursor: pointer; text-decoration: none;
  border-bottom: 1px dashed rgba(217,176,106,.5);
}
.auth-switch a:hover { color: var(--gold-2); }

/* ============================== 离线弹窗 ============================== */
.modal-box {
  width: min(400px, 100%);
  padding: 26px 24px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 60px rgba(0,0,0,.8);
  text-align: center;
}
.modal-box h2 {
  font-size: 19px; color: var(--gold-2); letter-spacing: 4px; margin-bottom: 6px;
  font-family: "STKaiti", "KaiTi", serif;
}
.modal-sub { font-size: 12px; color: var(--dim); margin-bottom: 16px; }
.modal-sub b { color: var(--text-2); }
.offline-list { list-style: none; margin-bottom: 20px; }
.offline-list li {
  display: flex; justify-content: space-between;
  padding: 8px 12px; font-size: 13px;
  border-bottom: 1px dashed rgba(90,70,47,.4);
}
.offline-list li:last-child { border-bottom: none; }
.offline-list li span { color: var(--text-2); }
.offline-list li b { color: var(--gold-2); font-variant-numeric: tabular-nums; }
/* 第一行永远是「获得金币」—— 离线挂机里玩家最关心的一项，单独放大免得不明显 */
.offline-list li:first-child {
  background: rgba(198,160,84,.10); border-radius: 6px; border-bottom-style: solid;
}
.offline-list li:first-child b { font-size: 15px; }
.modal-note { font-size: 11px; color: var(--dim); margin: -10px 0 18px; }
.modal-note b { color: var(--gold-2); }

/* ============================== Toast ============================== */
.toast-wrap {
  /* ⚠ 66px 是「顶栏高度 + 6px」的旧值。2026-10-05 加了成就栏（顶栏之下、约 35px），
   *   不改这里气泡就会压在成就栏上 —— 现在按「顶栏 + 成就栏 + 6px」往下让。
   *   窄屏顶栏/成就栏略矮，102px 在两个断点上都刚好在成就栏下方。 */
  position: fixed; top: 102px; left: 50%; transform: translateX(-50%);
  z-index: 950; display: flex; flex-direction: column; gap: 7px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 8px 18px; border-radius: 20px;
  background: rgba(20,15,10,.96);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,.7);
  animation: toastIn .25s ease-out;
}
.toast.gold { border-color: #d9a12c; color: #ffe0a8; }
.toast.green { border-color: #4ac97a; color: #b6f0c8; }
.toast.red { border-color: var(--hp-2); color: #ffb0a0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* 全屏升级闪光 */
.flash {
  position: fixed; inset: 0; z-index: 700; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255,220,120,.30), transparent 55%);
  animation: flashOut .7s ease-out forwards;
}
@keyframes flashOut { from { opacity: 1 } to { opacity: 0 } }

/* ============================== 响应式 ============================== */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 250px minmax(0,1fr) 340px; gap: 10px; padding: 10px; }
}

@media (max-width: 960px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100vh; }
  .layout {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    overflow: visible;
  }
  .col { overflow: visible; }
  /* 手机端栏位顺序：地图怪物 → 装备 → 背包 → 角色。
     角色与装备原本包在同一个 .col-left 里，靠 display:contents 把左栏"拆掉"，
     让这两块面板直接变成 .layout 的网格项，才能用 order 把角色甩到最底下。
     —— 不支持 display:contents 的老浏览器会原样退回旧顺序（不会错乱，只是角色还在中间）。 */
  .col-left  { display: contents; }
  .col-mid   { order: 1; }                     /* 地图 / 怪物 / 战斗日志，永远排第一 */
  .col-left [data-panel="equip"] { order: 2; }
  .col-right { order: 3; }                     /* 背包 */
  .col-left [data-panel="char"]  { order: 4; }  /* 角色面板特意压到最底部 */
  /* 日志框高度已由基础规则钉死（可见行数 × 行高），窄屏不再需要另外限高 */
  .top-stats { display: none; }
  .save-state { min-width: 0; }
  .class-list { grid-template-columns: 1fr; gap: 10px; }
  .class-card .cc-desc { min-height: auto; }
  .brand-txt h1 { font-size: 13px; letter-spacing: 0; }
  .brand-txt p { display: none; }
}

@media (max-width: 640px) {
  /* 窄屏放不下 5 列：固定改成 2 列 × 5 行（**同样是 10 格固定**）。
     列数只跟屏宽有关，跟一波几只怪无关 —— 界面依然不随怪物数量变动。 */
  .mob-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 100%; gap: 7px 10px; }
  /* 窄屏怪物栏变成 2 列 × 5 行（高约 280px），宽度也富余，立绘可以画大一点；
     88px 宽 → 约 103px 高，仍远小于怪物栏，战斗区高度照样不受影响。 */
  .arena-body { gap: 8px; }
  .arena-hero { width: 88px; }
}

@media (max-width: 520px) {
  .mob-bar-hint { flex-basis: 100%; }
  .start-title h1 { font-size: 21px; letter-spacing: 2px; }
  /* 窄屏优先保住按钮：开关只留勾选框，存档时间缩小 */
  .switch-sm span { display: none; }
  .save-state { font-size: 10px; min-width: 0; }
  .top-actions { gap: 6px; }
  .top-actions .btn { padding: 6px 9px; }
  /* 窄屏下红/蓝药阈值不缩进，换行后仍与「自动吃药」对齐成一列 */
  .bag-opt { gap: 5px 8px; }
  .bag-opt .opt-sub { margin-left: 0; padding-left: 4px; }
  .bag-opt .opt-sub select { max-width: 92px; }
  /* 窄屏：地图下拉占满一行，说明行收到下面 */
  .map-select { min-width: 0; max-width: none; flex: 1 1 130px; }
  .map-bar-hint { flex-basis: 100%; }
}
