/* ============================================================================
 *  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; }

/* ============================== 顶栏 ============================== */
.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; }

.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; }
.char-id .cname {
  font-size: 14px; color: var(--gold-2); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.char-id .cmeta { font-size: 11px; color: var(--dim); }
.char-id .cmeta .cclass { color: var(--text-2); }

.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; }

/* 等级里程碑（每 10 级叠一层）：金色描边，跟「战力」的橙色区分开 */
.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-n { color: var(--dim); font-size: 10px; white-space: nowrap; }
.ms-box .ms-line { color: var(--text-2); }
.ms-box .ms-line.dim { color: var(--dim); }

/* 技能 */
.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; }

/* ============================== 战斗区 ============================== */
.battle-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

.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;
}
/* 场上怪物列表（威胁度已按需求取消显示）。
   **固定 5 列 × 2 行 = 10 格**，与「一波几只」无关 —— 空位由 .mob-slot 占住，
   所以战斗区的高度、每只怪的位置都不随怪物数量变动。
   每格三行：名字 + 精英/BOSS 标签 / 血条 / 等级 · 血量数字。
   （这里没有怪物图标 —— 图标按需求删除后未恢复。） */
.mob-list {
  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: 14px;
}
/* .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); }
.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); }

/* ============================== 日志 ============================== */
.log-wrap { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 120px; }

.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 {
  flex: 1 1 auto;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.65;
  padding-right: 4px;
  scroll-behavior: smooth;
}
.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);
}

/* ============================== 背包 ============================== */
.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); }

/* 🌟 武器星级：名字后的徽标 + 属性/日志/详情里的金色条目，全局共用一套配色 */
.br-star {
  font-style: normal; font-size: 10px; color: #ffd45e;
  text-shadow: 0 0 6px rgba(255,212,94,.45); letter-spacing: -.5px;
}
.bag-row .br-stat i.star,
.equip-slot .estat i.star { color: #ffd45e; }
.log-line .star { color: #ffd45e; font-weight: 600; }
.item-tip .tt-line.star,
.item-tip .tt-name .star { color: #ffd45e; }

.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;
}

/* ============================== 登录 / 注册 ============================== */
/* 比建号界面更窄的一栏卡片（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 {
  position: fixed; top: 66px; 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; }  /* 角色面板特意压到最底部 */
  .log { max-height: 260px; }
  .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; }
}

@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%; }
}
