/* ============ 老树传奇挂机版 主题 ============ */
:root {
  --bg: #0a0d13;
  --bg2: #0e1219;
  --panel: #121722;
  --panel2: #171d2b;
  --border: #232c3d;
  --border2: #2e3a52;
  --text: #cfd8e3;
  --text-dim: #7d8aa0;
  --gold: #d4a437;
  --gold2: #f0c75e;
  --hp: #ef4444;
  --mp: #3b82f6;
  --exp: #a855f7;
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
  --orange: #f59e0b;
  --rarity: #b8b8b8;
  /* 派生色（主题可覆盖，默认沿用深色面板） */
  --bg-glow: #131a2a;
  --input-bg: #0d1120;
  --menu-bg: #161d2b;
  --chip-bg: #1c2433;
  --btn-bg: #1e2635;
  --switch-bg: #27303f;
  --scroll-thumb: #2b3649;
  --toast-bg: #141a28;
  --menu-hover-bg: #222c40;
  --modal-grad: linear-gradient(180deg, #151b29, #0f141e);
  --auth-grad: linear-gradient(180deg, #141a28, #0f141e);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-glow) 0%, var(--bg) 55%);
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ============ 认证界面 ============ */
.auth-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  gap: clamp(24px, 5vw, 72px); padding: 28px 6vw; overflow: auto;
  background:
    radial-gradient(900px 500px at 15% 8%, rgba(212,164,55,.10), transparent 60%),
    radial-gradient(700px 400px at 88% 90%, rgba(59,130,246,.09), transparent 60%),
    radial-gradient(500px 300px at 70% 12%, rgba(168,85,247,.06), transparent 60%),
    var(--bg);
}
/* 官网首页：品牌 + 特色 */
.site-hero { flex: 1 1 560px; max-width: 660px; display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.hero-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hero-brand h1 { font-size: clamp(28px, 4.2vw, 52px); letter-spacing: 8px; color: var(--gold2); font-weight: 900; text-shadow: 0 0 30px rgba(212,164,55,.35); white-space: nowrap; }
.hero-brand .hero-zone { color: var(--text-dim); font-size: 14px; letter-spacing: 3px; }
.hero-intro { color: var(--text-dim); font-size: 14.5px; line-height: 2.05; max-width: 620px; }
.hero-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feat-card {
  background: var(--panel);
  background: linear-gradient(170deg, var(--panel), color-mix(in srgb, var(--panel) 88%, #000));
  border: 1px solid var(--border2); border-radius: 14px; padding: 18px 16px 15px;
  display: flex; flex-direction: column; gap: 8px; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.feat-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(212,164,55,.15); }
.feat-card .feat-no { font-size: 12px; letter-spacing: 3px; color: var(--gold); font-weight: 800; opacity: .85; }
.feat-card .feat-t { color: var(--text); font-weight: 800; font-size: 14.5px; letter-spacing: 1px; }
.feat-card .feat-d { color: var(--text-dim); font-size: 12px; line-height: 1.8; }
.hero-meta { color: var(--text-dim); font-size: 12.5px; letter-spacing: .5px; display: flex; flex-wrap: wrap; gap: 4px 20px; border-top: 1px solid var(--border2); padding-top: 14px; }
.hero-meta b { color: var(--gold2); }
.auth-card {
  width: 420px; max-width: 94vw; max-height: 92vh; overflow: auto;
  background: var(--auth-grad);
  border: 1px solid var(--border2); border-radius: 14px;
  padding: 28px 30px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.auth-title { text-align: center; font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: 3px; margin-bottom: 2px; }
.auth-logo { text-align: center; margin-bottom: 6px; }
.auth-logo .logo-icon { font-size: 42px; }
.auth-logo h1 {
  font-size: 24px; letter-spacing: 3px; color: var(--gold2);
  text-shadow: 0 0 18px rgba(212,164,55,.35);
  font-weight: 800;
}
.auth-logo .zone { color: var(--text-dim); font-size: 12px; margin-top: 2px; letter-spacing: 1px; }
.auth-logo .slogan { color: var(--text-dim); font-size: 12px; margin-top: 8px; line-height: 1.7; }
.auth-tabs { display: flex; margin: 18px 0 14px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.auth-tabs button { flex: 1; padding: 9px 0; background: var(--panel); color: var(--text-dim); border: none; font-size: 14px; }
.auth-tabs button.active { background: var(--panel2); color: var(--gold2); font-weight: 700; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 8px;
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text); font-size: 14px;
  outline: none; transition: border .15s; font-family: inherit;
}
.form-row textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.form-row input:focus, .form-row textarea:focus { border-color: var(--gold); }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--text-dim); opacity: .55; }
.btn-primary {
  width: 100%; padding: 11px; border-radius: 8px; border: none;
  background: linear-gradient(180deg, #e6b84c, #c99a2e); color: #1a1305;
  font-size: 15px; font-weight: 800; letter-spacing: 2px;
  box-shadow: 0 4px 14px rgba(212,164,55,.25);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.auth-err { color: #ff8080; font-size: 12px; min-height: 16px; margin: 4px 0 8px; text-align: center; }

/* 角色选择 */
.char-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.char-slot {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 8px; text-align: center; cursor: pointer; position: relative; transition: border .15s;
}
.char-slot:hover { border-color: var(--gold); }
.char-slot .big { font-size: 30px; }
.char-slot .nm { font-weight: 700; margin-top: 6px; }
.char-slot .sub { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.char-slot .del { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; padding: 0; line-height: 20px; border-radius: 50%; background: var(--red); color: #fff; font-size: 17px; font-weight: 700; text-align: center; display: none; border: 2px solid var(--panel); box-shadow: 0 2px 6px rgba(0,0,0,.45); cursor: pointer; }
.char-slot:hover .del { display: block; }
.char-slot .del:hover { background: #ff5252; }
.char-create { grid-column: span 1; border-style: dashed; color: var(--text-dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.char-create:hover { color: var(--gold2); }

/* ============ 游戏主布局 ============ */
.game-screen { position: fixed; inset: 0; display: none; flex-direction: column; }
.game-screen.active { display: flex; }
.top-bar {
  min-height: 40px; flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 2px 14px;
  background: var(--auth-grad);
  border-bottom: 1px solid var(--border);
}
.top-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--gold2); letter-spacing: 1px; font-size: 15px; white-space: nowrap; }
.top-logo .zone { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.top-server { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.top-spacer { flex: 1; }
/* 左上角站点标题（替代原角色信息区） */
.top-brand {
  font-weight: 800; font-size: 15px; letter-spacing: 1.5px; white-space: nowrap;
  background: linear-gradient(180deg, #ffe9a8, #d4a437);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #d4a437;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 6px;
}
.top-brand::before { content: '🌳'; -webkit-text-fill-color: initial; font-size: 16px; }
.bar { position: relative; height: 11px; border-radius: 6px; background: var(--input-bg); border: 1px solid var(--border2); }
.bar .fill { position: absolute; inset: 0; width: 0%; transition: width .25s; border-radius: inherit; }
.bar .bar-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; text-shadow: 0 1px 2px #000; font-weight: 700; }
.bar.hp .fill { background: linear-gradient(180deg, #ff6b6b, #d92d20); }
.bar.mp .fill { background: linear-gradient(180deg, #6aa8ff, #1d5fd6); }
.bar.exp .fill { background: linear-gradient(180deg, #f0c75e, #d4a437); }
.bar-row { display: flex; gap: 4px; margin-top: 3px; }
.bar-row .bar { flex: 1; }
/* 状态条悬停数值气泡 */
.bar { position: relative; }
.bar[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: rgba(8,8,14,.94); color: #f0e6c8; font-size: 11px; line-height: 1.6;
  padding: 4px 9px; border-radius: 7px; white-space: nowrap; z-index: 999;
  border: 1px solid rgba(212,164,55,.45); pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.gold-chip { display: flex; align-items: center; gap: 4px; color: var(--gold2); font-weight: 700; font-size: 12px; white-space: nowrap; }
.top-btn { padding: 6px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); color: var(--text); font-size: 12px; }
.top-btn:hover { border-color: var(--gold); color: var(--gold2); }
.top-btn.danger:hover { border-color: var(--red); color: #ff9d9d; }

.main-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 300px 1fr 330px; gap: 8px; padding: 8px;
}
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--border); border-radius: 10px;
  display: flex; flex-direction: column; min-height: 0;
}
.panel-head {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--gold2); font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.panel-head .sub { color: var(--text-dim); font-weight: 400; font-size: 11px; }
.panel-head #btnClearLog { margin-left: auto; font-size: 11px; }
/* 挂机控制面板内的紧凑"自动战斗"开关 */
.auto-mini { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-weight: 400; font-size: 12px; color: var(--text); white-space: nowrap; }
.auto-mini .switch { width: 34px; height: 18px; border-radius: 10px; }
.auto-mini .switch::after { width: 14px; height: 14px; top: 2px; left: 2px; }
.auto-mini .switch.on::after { left: 18px; }
.auto-mini .muted { font-size: 11px; }
/* 挂机控制面板头：两行排版（手机/APP 窄屏友好） */
.fight-head { flex-direction: column; align-items: stretch; gap: 4px; }
.fight-head .fh-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.fight-head .fh-top > span:first-child { flex: 0 0 auto; }
.fight-head .fh-top .auto-mini { margin-left: auto; }
.fight-head .fh-stat { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.fight-head .fh-stat .sub { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fight-head .fh-stat #btnRefreshWorld { flex: 0 0 auto; font-size: 11px; padding: 2px 8px; }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.panel-body.pad0 { padding: 0; }

/* 左侧聊天 */

.chat-log .line.chat-sys { color: var(--gold2); }
.chat-tabs { display: flex; flex-wrap: nowrap; gap: 2px; padding: 5px 6px 0; }
.chat-tabs button {
  flex: 1; min-width: 34px; padding: 5px 2px; font-size: 11px; background: transparent;
  border: none; color: var(--text-dim); border-radius: 6px 6px 0 0; white-space: nowrap; overflow: hidden;
}
.chat-tabs button.active { background: var(--panel2); color: var(--gold2); font-weight: 700; }
.chat-tabs button .dot { color: var(--red); margin-left: 2px; font-size: 10px; }
.chat-tabs button.active { background: var(--panel2); color: var(--gold2); font-weight: 700; }
.chat-tabs button .dot { color: var(--red); margin-left: 2px; font-size: 10px; }
.chat-log { flex: 1; min-height: 0; overflow: auto; padding: 6px 10px; font-size: 12px; line-height: 1.75; }
.chat-log .line { word-break: break-all; }
.chat-log .cname { font-weight: 700; cursor: pointer; }
.chat-log .cname:hover { text-decoration: underline; }
.chat-sys { color: var(--gold2); }
.chat-announce { color: #ffd700; background: rgba(212,164,55,.08); padding: 2px 4px; border-radius: 4px; }
.chat-shout { color: #ffd700; }
.chat-local { color: var(--text); }
.chat-whisper { color: #7fd4ff; }
.chat-party { color: var(--green); }
.chat-guild { color: var(--orange); }
.chat-input-row { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.chat-input-row select { background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 6px 4px; font-size: 12px; }
.chat-input-row input { flex: 1; background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 7px 10px; font-size: 12px; outline: none; }
.chat-input-row input:focus { border-color: var(--gold); }
.chat-cost { font-size: 10px; color: var(--text-dim); padding: 2px 4px; }

/* 中央 */
.center-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; position: relative; }
.map-banner {
  flex: 0 0 auto; padding: 10px 14px; border-radius: 10px;
  background: linear-gradient(90deg, var(--bg2), var(--panel) 60%, var(--bg2));
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap;
}
.map-banner .mi { font-size: 30px; }
.map-banner .nm { font-size: 16px; font-weight: 800; color: var(--gold2); }
.map-banner .desc { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.map-banner .hint { color: var(--text-dim); font-size: 11px; background: var(--panel2); padding: 2px 8px; border-radius: 6px; margin-left: auto; white-space: nowrap; }
.fight-panel { flex: 0 0 auto; }
.fight-main { display: flex; gap: 10px; flex-wrap: wrap; }
.fight-block { flex: 1 1 200px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.fight-block h4 { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; display: flex; justify-content: space-between; }
.fight-target { display: flex; align-items: center; gap: 8px; }
.fight-target .ti { font-size: 24px; }
.fight-target .tn { font-weight: 700; }
.fight-target .tbar { flex: 1; }
.fight-stat { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--text-dim); }
.fight-stat b { color: var(--text); }
.auto-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.switch { position: relative; width: 42px; height: 22px; border-radius: 12px; background: var(--switch-bg); transition: background .2s; flex: 0 0 auto; }
.switch.on { background: var(--gold); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch.on::after { left: 22px; }
.log-panel { flex: 1 1 0; min-height: 120px; }
.battle-log { flex: 1; min-height: 0; overflow: auto; padding: 4px 6px; font-size: 12px; line-height: 1.8; }
.battle-log .line { border-bottom: 1px dashed var(--border2); padding: 1px 0; }
.log-gold { color: var(--gold2); }
.mid-row { display: flex; gap: 8px; flex: 1 1 0; min-height: 150px; }
.mid-row .char-panel { flex: 1 1 0; min-width: 0; }
.mid-row .battle-panel { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.battle-body { flex: 1; overflow: hidden; display: flex; padding: 0 !important; min-width: 0; }
.battle-body .battle-log { box-sizing: border-box; width: 100%; max-width: 100%; }
.battle-log { flex: 1; overflow-y: auto; font-size: 12px; line-height: 1.7; word-break: break-all; min-width: 0; width: 100%; }
.battle-item { padding: 2px 1px; border-bottom: 1px dashed var(--border); }
.char-panel { flex: 1 1 0; min-height: 150px; }
.ci-icon { font-size: 20px; filter: drop-shadow(0 0 3px rgba(212,164,55,.4)); }
.ci-name { font-weight: 800; color: var(--gold2); margin-left: 8px; }
.ci-sub { color: var(--text-dim); font-size: 12px; font-weight: 400; margin-left: 8px; }
.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; }
.attr-item { display: flex; justify-content: space-between; padding: 3px 6px; background: var(--panel2); border-radius: 6px; }
.attr-item b { color: var(--gold2); }
.attr-item .lbl { color: var(--text-dim); }
.alloc-row { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.alloc-btn { padding: 4px 8px; border-radius: 6px; background: var(--chip-bg); border: 1px solid var(--border); color: var(--text); font-size: 11px; }
.alloc-btn:hover { border-color: var(--gold); color: var(--gold2); }
.alloc-btn:disabled { opacity: .4; }

/* 右侧标签页 */
.tabbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 6px 0; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.tabbar button { padding: 6px 7px; font-size: 12px; background: transparent; border: none; color: var(--text-dim); border-radius: 7px 7px 0 0; }
.tabbar button.active { background: var(--panel2); color: var(--gold2); font-weight: 700; }
.tabbar button .badge { background: var(--red); color: #fff; border-radius: 8px; font-size: 10px; padding: 0 4px; margin-left: 2px; }
.tab-body { flex: 1; min-height: 0; overflow: auto; padding: 8px; }

/* 背包/仓库格子 */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 5px; }
.slot {
  aspect-ratio: 1/1; background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 24px; position: relative; cursor: pointer;
  transition: border .15s, transform .1s; min-height: 48px;
}
.slot:hover { border-color: var(--gold2); transform: translateY(-1px); z-index: 4; }
.slot .cnt { position: absolute; right: 2px; bottom: 1px; font-size: 10px; color: #fff; background: rgba(0,0,0,.5); border-radius: 4px; padding: 0 3px; }
.slot .dur { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #333; }
.slot .dur > i { display: block; height: 100%; background: var(--green); }
.slot.eq { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.slot.empty { cursor: default; opacity: .35; }
.slot .plus { position: absolute; top: 0; left: 0; font-size: 9px; color: var(--exp); }

/* 快捷物品菜单 */
.item-menu {
  position: absolute; z-index: 60; background: var(--menu-bg); border: 1px solid var(--border2);
  border-radius: 9px; padding: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.6); min-width: 130px;
}
.item-menu button { display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 6px; background: transparent; border: none; color: var(--text); font-size: 12px; }
.item-menu button:hover { background: var(--menu-hover-bg); color: var(--gold2); }
.item-menu button.danger:hover { color: #ff9d9d; }

/* 物品 tooltip */
.item-tip {
  position: fixed; z-index: 200; box-sizing: border-box;
  min-width: 150px; width: max-content; max-width: min(280px, calc(100vw - 12px));
  max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--menu-bg); border: 1px solid var(--border2); border-radius: 10px; padding: 10px;
  font-size: 12px; line-height: 1.7; box-shadow: 0 10px 40px rgba(0,0,0,.6);
  word-break: break-word; white-space: normal;
}
.item-tip .i-name { font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.item-tip .i-type { color: var(--text-dim); font-size: 11px; margin-bottom: 4px; }
.item-tip .i-attr { color: var(--text); }
.item-tip .i-req { color: #ff9d9d; margin-top: 3px; }
.item-tip .i-extra { color: var(--orange); margin-top: 3px; }

/* 列表行 */
.row-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
  background: var(--panel2); border: 1px solid transparent; margin-bottom: 5px; font-size: 12px;
}
.row-item:hover { border-color: var(--border2); }
.row-item .ri { font-size: 20px; }
.row-item .info { flex: 1; min-width: 0; }
.row-item .info .t1 { font-weight: 700; }
.row-item .info .t2 { color: var(--text-dim); font-size: 11px; }
.row-item .ops { display: flex; gap: 4px; flex: 0 0 auto; }
.btn-sm { padding: 4px 8px; border-radius: 6px; background: var(--btn-bg); border: 1px solid var(--border); color: var(--text); font-size: 11px; }
.btn-sm:hover { border-color: var(--gold); color: var(--gold2); }
.btn-sm.green { color: var(--green); } .btn-sm.green:hover { border-color: var(--green); }
.btn-sm.red { color: #ff8f8f; } .btn-sm.red:hover { border-color: var(--red); }
.btn-sm.gold { color: var(--gold2); } .btn-sm.gold:hover { border-color: var(--gold); }

/* 任务 */
.quest-card { background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; }
.quest-card .q1 { display: flex; justify-content: space-between; align-items: center; }
.quest-card .q-name { font-weight: 700; }
.quest-card .q-type { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: var(--chip-bg); color: var(--text-dim); }
.quest-card .q-desc { color: var(--text-dim); font-size: 11px; margin: 4px 0; }
.quest-card .q-prog { font-size: 11px; color: var(--text); }
.quest-card .q-reward { color: var(--gold2); font-size: 11px; margin-top: 3px; }
.quest-card .bar { height: 7px; margin-top: 6px; }
.quest-card .bar .fill { background: linear-gradient(90deg, #f0c75e, #d4a437); }
/* FK202：已完成任务单独收纳区（可折叠） */
.q-done-head { margin: 14px 0 4px; padding: 7px 10px; background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; color: var(--text-dim); font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.q-done-head:active { opacity: .75; }
.q-done-arrow { font-size: 11px; color: var(--gold2); }
#qDoneBody .quest-card { opacity: .62; }
#qDoneBody .quest-card .q-name { color: var(--text-dim); }

/* 模态 */
.modal-mask {
  position: fixed; inset: 0; z-index: 80; background: rgba(4,6,10,.72);
  display: none; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  width: 560px; max-width: 96vw; max-height: 88vh; overflow: auto;
  background: var(--modal-grad);
  border: 1px solid var(--border2); border-radius: 13px; box-shadow: 0 20px 70px rgba(0,0,0,.6);
}
.modal.small { width: 420px; }
.modal.large { width: 760px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 800; color: var(--gold2); }
.modal-head .x { margin-left: auto; background: transparent; border: none; color: var(--text-dim); font-size: 16px; }
.modal-head .x:hover { color: var(--red); }
.modal-body { padding: 14px 16px; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* 商店 */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.shop-item { background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 7px; text-align: center; cursor: pointer; }
.shop-item:hover { border-color: var(--gold); }
.shop-item .si { font-size: 24px; }
.shop-item .sn { font-weight: 700; font-size: 12px; margin-top: 3px; }
.shop-item .sp { color: var(--gold2); font-size: 11px; }
.shop-item .sl { color: var(--text-dim); font-size: 10px; }

/* 交易 */
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-side { background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 8px; min-height: 200px; }
.trade-side h4 { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; display: flex; justify-content: space-between; }
.trade-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.trade-gold { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; }

/* 聊天点击菜单 */
.name-menu {
  position: fixed; z-index: 75; background: var(--menu-bg); border: 1px solid var(--border2);
  border-radius: 9px; padding: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.6); min-width: 120px;
}
.name-menu button { display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 6px; background: transparent; border: none; color: var(--text); font-size: 12px; }
.name-menu button:hover { background: var(--menu-hover-bg); color: var(--gold2); }

/* 底部快捷栏 */
.quick-bar {
  height: 58px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: linear-gradient(0deg, #10151f, #0e141e); border-top: 1px solid var(--border);
}
.quick-slot { width: 42px; height: 42px; border-radius: 8px; background: var(--input-bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 20px; position: relative; cursor: pointer; }
.quick-slot:hover { border-color: var(--gold); }
.quick-slot .qk { position: absolute; top: -6px; left: -4px; font-size: 9px; background: var(--gold); color: #111; border-radius: 5px; padding: 0 3px; }
.quick-sep { width: 1px; height: 36px; background: var(--border); }
.quick-slot.map-q { flex-direction: column; gap: 1px; }
.quick-slot.map-q .mapq-icon { font-size: 15px; line-height: 1; }
.quick-slot.map-q .mapq-name { font-size: 8.5px; color: var(--text-dim); line-height: 1.1; max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 传送员：搜索框 + 星标 */
.travel-search { display: flex; gap: 6px; }
.shop-item { position: relative; }
.tr-star { position: absolute; top: 2px; right: 3px; z-index: 3; background: none; border: none; cursor: pointer; font-size: 13px; padding: 0; color: #9aa3b5; line-height: 1; }
.tr-star:hover { color: #ffd700; }
.tr-star.on { color: #ffd700; }
@media (max-width: 860px) {
  .quick-slot.map-q .mapq-name { font-size: 8px; }
}
.quick-btn { padding: 7px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); color: var(--text); font-size: 12px; }
.quick-btn:hover { border-color: var(--gold); color: var(--gold2); }

/* toast */
.toast-wrap { position: fixed; top: 60px; right: 14px; z-index: 90; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: var(--toast-bg); border: 1px solid var(--border2); border-left: 3px solid var(--gold); border-radius: 8px; padding: 8px 14px; font-size: 12px; max-width: 320px; box-shadow: 0 6px 24px rgba(0,0,0,.5); animation: toastin .25s ease; }
.toast.warn { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes toastin { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.death-flash { position: fixed; inset: 0; z-index: 85; pointer-events: none; background: radial-gradient(ellipse at center, rgba(239,68,68,.25), transparent 65%); opacity: 0; transition: opacity .6s; }
.death-flash.show { opacity: 1; }

.announce-banner {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 88;
  background: linear-gradient(90deg, rgba(212,164,55,.14), rgba(212,164,55,.28), rgba(212,164,55,.14));
  border: 1px solid rgba(212,164,55,.6); border-radius: 999px; padding: 8px 26px;
  color: #ffd700; font-weight: 800; font-size: 15px; letter-spacing: 1px;
  box-shadow: 0 0 40px rgba(212,164,55,.3); animation: toastin .3s ease;
}
.loading-screen {
  position: fixed; inset: 0; z-index: 99; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--text-dim);
}
.loading-screen .spin { width: 40px; height: 40px; border: 3px solid #223; border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.dim-text { color: var(--text-dim); }
.muted { color: var(--text-dim); font-size: 11px; }
.mt2 { margin-top: 8px; }
.flex { display: flex; gap: 6px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.text-gold { color: var(--gold2); }
.text-dim { color: var(--text-dim); }
.text-green { color: var(--green); }
.text-red { color: #ff8f8f; }
.text-blue { color: #7fd4ff; }
.right { text-align: right; }
.w100 { width: 100%; }
.small-input { background: var(--input-bg); border: 1px solid var(--border); color: var(--text); border-radius: 7px; padding: 7px 10px; font-size: 12px; outline: none; }
.small-input:focus { border-color: var(--gold); }

/* 响应式：窄屏时简化布局 */
@media (max-width: 1180px) {
  .main-grid { grid-template-columns: 260px 1fr 280px; }
}
@media (max-width: 960px) {
  .main-grid { grid-template-columns: 1fr; grid-template-rows: auto 300px 1fr; }
  .main-grid > .left-col { order: 2; }
  .main-grid > .right-col { order: 3; }
}

/* ============ 地图行：NPC/强制PK/同图玩家 ============ */
.map-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.map-npcs { display: flex; gap: 6px; flex-wrap: wrap; }
.npc-chip {
  padding: 4px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.npc-chip:hover { border-color: var(--gold); color: var(--gold2); }
.map-pvp {
  padding: 4px 10px; border-radius: 999px; background: rgba(239,68,68,.12);
  border: 1px solid var(--red); color: #ff8f8f; font-size: 12px; font-weight: 700;
  animation: pvppulse 2s ease infinite;
}
@keyframes pvppulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); } 50% { box-shadow: 0 0 10px 2px rgba(239,68,68,.35); } }
.map-players { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex: 1 1 100%; min-width: 0; }
.map-players .mp-label { font-size: 11px; color: var(--text-dim); }
.mp-name {
  padding: 3px 9px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--border);
  color: var(--gold2); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.mp-name:hover { border-color: var(--gold); }
.mp-name .mlv { color: var(--text-dim); font-size: 10px; margin-left: 3px; }
/* 单行折叠（NPC/同图玩家）：一行放满，多余用符号 ▾/▴ 展开收起 */
.row-collapsed { flex-wrap: nowrap !important; overflow: hidden !important; }
/* 折叠时：玩家标签可收缩，折叠按钮固定在最右侧且完整可见 */
.row-collapsed .mp-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row-collapsed .row-fold { flex: 0 0 24px !important; margin-left: auto; position: relative; z-index: 5; }
.row-fold {
  flex: 0 0 auto; width: 24px; height: 22px; line-height: 20px; padding: 0;
  border-radius: 6px; background: var(--panel2); border: 1px solid var(--border);
  color: var(--gold2); font-size: 13px; text-align: center; cursor: pointer; user-select: none;
  position: relative; z-index: 3; box-sizing: border-box;
}
.row-fold:hover { border-color: var(--gold); color: var(--gold2); box-shadow: 0 0 6px rgba(212,164,55,.25); }

/* ============ 队伍面板 ============ */
#partyPanel { margin: 6px 0 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); overflow: hidden; }
.pt-head { display: flex; align-items: center; gap: 8px; padding: 6px 9px; font-size: 12px; color: var(--gold2); background: rgba(212,164,55,.07); border-bottom: 1px solid var(--border); }
.pt-count { font-size: 11px; color: var(--text-dim); }
.pt-leader { font-size: 11px; color: var(--text-dim); margin-left: auto; }
.pt-leave { padding: 2px 8px !important; font-size: 11px !important; }
.pt-list { display: flex; flex-direction: column; }
.pt-row { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-bottom: 1px solid rgba(255,255,255,.04); }
.pt-row:last-child { border-bottom: 0; }
.pt-me { background: rgba(212,164,55,.06); }
.pt-ico { font-size: 16px; flex: 0 0 auto; width: 20px; text-align: center; }
.pt-info { flex: 1; min-width: 0; }
.pt-name { font-size: 12px; color: var(--text); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pt-crown { font-size: 11px; }
.pt-mytag { font-size: 9px; padding: 0 4px; border-radius: 4px; background: var(--gold); color: #1a1206; font-weight: 700; }
.pt-lv { font-size: 10px; color: var(--text-dim); }
.pt-same { font-size: 9px; padding: 0 4px; border-radius: 4px; background: rgba(60,180,110,.2); color: #58d68d; }
.pt-other { font-size: 9px; color: var(--text-dim); }
.pt-bars { display: flex; gap: 4px; margin-top: 3px; }
.pt-bar { display: block; height: 4px; border-radius: 3px; background: rgba(255,255,255,.09); flex: 1; overflow: hidden; }
.pt-bar i { display: block; height: 100%; border-radius: 3px; }
.pt-hp i { background: linear-gradient(90deg,#d92d20,#ff6b5e); }
.pt-mp i { background: linear-gradient(90deg,#1d5fd6,#4d9bff); }
.pt-num { font-size: 10px; color: var(--text-dim); flex: 0 0 auto; }
/* 好友申请区 */
.fr-req-head { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; font-size: 12px; color: var(--gold2); }
.fr-req-badge { background: #d92d20; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 700; }
.fr-req-list { border: 1px solid rgba(212,164,55,.35); border-radius: 8px; overflow: hidden; background: rgba(212,164,55,.05); }
.fr-req-item { border-bottom: 1px solid rgba(255,255,255,.05); }
.fr-req-item:last-child { border-bottom: 0; }

/* ============ 地图场景动画 ============ */
.scene-m {
  font-size: 15px; opacity: .55; line-height: 1;
  animation: floaty 4s ease-in-out infinite;
  text-shadow: 0 0 6px rgba(0,0,0,.25);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-9px) rotate(5deg); }
}

/* ============ 只打选中的怪物 ============ */
.mfilter { display: flex; flex-wrap: wrap; gap: 6px; }
.mfilter-item {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--border); color: var(--text); font-size: 12px;
  cursor: pointer; user-select: none;
}
.mfilter-item .mlv { color: var(--text-dim); font-size: 10px; }
.mfilter-item.on { border-color: var(--gold); color: var(--gold2); background: rgba(212,164,55,.1); }
.mfilter-item:hover { border-color: var(--gold); }

/* ============ 角色装备属性预览 ============ */
.char-preview {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(120deg, var(--panel2), var(--bg2)); border: 1px solid var(--border);
}
.char-preview .cp-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.char-preview .cp-avatar {
  width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: var(--input-bg); border: 1px solid var(--border2); position: relative; flex: 0 0 auto;
}
.char-preview .cp-avsub { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--gold2); background: var(--input-bg); border: 1px solid var(--border); border-radius: 6px; padding: 0 4px; white-space: nowrap; }
.char-preview .cp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.char-preview .cp-name { font-size: 14px; font-weight: 800; }
.char-preview .cp-bars { display: flex; flex-direction: column; gap: 3px; }
.char-preview .cp-bars .bar { height: 14px; width: 100%; }
.char-preview .cp-gearlist { display: flex; gap: 3px; flex-wrap: wrap; font-size: 14px; min-height: 18px; }
.char-preview .cp-gear { cursor: default; filter: drop-shadow(0 0 3px rgba(212,164,55,.4)); }
.char-preview .cp-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.char-preview .cp-stats span { font-size: 11px; color: var(--text-dim); background: var(--panel2); padding: 3px 7px; border-radius: 6px; text-align: center; white-space: nowrap; }
/* 窄屏（右栏 <360px）时属性改 2 列，避免挤压 */
@media (max-width: 1180px) {
  .char-preview .cp-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 顶部 GM 后台按钮 ============ */
#btnAdmin { border-color: rgba(212,164,55,.5); color: var(--gold2); }
#btnAdmin:hover { background: rgba(212,164,55,.12); }

/* ============ 移动端优化 ============ */
@media (max-width: 960px) {
  .auth-screen { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 24px; padding: 24px 18px 44px; }
  /* 账号登录区置顶放大，功能介绍下移 */
  .auth-card { order: 1; width: 100%; max-width: 100%; min-width: 0; max-height: none; padding: 34px 24px 30px; }
  .site-hero { order: 2; flex: none; max-width: 100%; width: 100%; gap: 14px; }
  .hero-feats { grid-template-columns: 1fr 1fr; gap: 10px; }
  /* 移动端首屏：只留品牌名，介绍/特色/信息栏下移压缩 */
  .hero-intro, .hero-meta { display: none; }
  .hero-feats { display: none; }
  .hero-brand { flex-direction: row; align-items: center; gap: 12px; }
  .hero-brand h1 { font-size: 26px; letter-spacing: 4px; }
  /* 移动端触控友好：输入框/按钮放大，防 iOS 缩放 */
  .auth-title { font-size: 23px; letter-spacing: 5px; margin-bottom: 6px; }
  .auth-tabs { margin: 24px 0 20px; }
  .auth-tabs button { padding: 15px 0; font-size: 16px; }
  .form-row { margin-bottom: 19px; }
  .form-row label { font-size: 14px; margin-bottom: 8px; }
  .form-row input { padding: 16px; font-size: 17px; border-radius: 11px; }
  .btn-primary { padding: 17px; font-size: 17px; border-radius: 11px; letter-spacing: 3px; }
  .muted.mt2 { margin-top: 18px; }
  .muted.mt2 a { font-size: 14px !important; }
}
@media (max-width: 480px) {
  .fight-head .fh-top { font-size: 12px; }
  .fight-head .fh-stat .sub { font-size: 10px; }
  .auth-screen { padding: 18px 14px 36px; }
  .hero-brand { gap: 6px; }
  .hero-brand h1 { font-size: 26px; letter-spacing: 4px; }
  .hero-zone, .hero-meta { font-size: 11.5px; }
  .hero-intro { font-size: 13px; line-height: 1.9; }
  .hero-feats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .feat-card { padding: 12px 11px; }
  .feat-card .feat-t { font-size: 13px; }
  .feat-card .feat-d { font-size: 11px; }
  .auth-card { padding: 24px 18px 22px; border-radius: 14px; }
}
/* 手机端弹窗全屏化，操作舒适 */
@media (max-width: 720px) {
  .modal, .modal.small, .modal.large {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0;
    display: flex; flex-direction: column;
  }
  .modal .modal-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
  .modal .modal-foot { flex: 0 0 auto; }
  body { height: 100dvh; }
  .chat-input-row { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .chat-input-row input { font-size: 14px; padding: 9px 10px; }
  .quick-bar { padding-bottom: max(4px, env(safe-area-inset-bottom)); }
}
@media (max-width: 720px) {
  .top-bar { flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
  .top-bar .top-logo { font-size: 14px; }
  .top-brand { font-size: 13px; letter-spacing: .5px; }
  .top-btn { padding: 5px 8px; font-size: 12px; }
  .gold-chip { padding: 3px 8px; font-size: 12px; }
  .map-banner { padding: 8px 10px; }
  .mid-row { flex-direction: column; }
  .mid-row .battle-panel { min-height: 130px; }
  .map-banner .mi { font-size: 24px; }
  .fight-stat { font-size: 10px; }
  .quick-bar { overflow-x: auto; gap: 6px; padding: 0 8px; }
  .quick-btn { padding: 6px 9px; font-size: 11px; white-space: nowrap; }
  .quick-slot { width: 36px; height: 36px; font-size: 17px; flex: 0 0 auto; }
  .chat-input-row input { font-size: 14px; }
  .char-preview .cp-stats { grid-template-columns: repeat(2, 1fr); }
  .char-preview { flex-wrap: wrap; }
  .npc-chip { padding: 5px 12px; font-size: 13px; }
  .mp-name { padding: 5px 11px; font-size: 13px; }
  .attr-grid { grid-template-columns: 1fr 1fr; gap: 3px 8px; }
  .scene-m { font-size: 16px; }
  .tabbar button { padding: 8px 8px; font-size: 12px; }
}
@media (max-width: 480px) {
  .top-server { display: none; }
  .main-grid { grid-template-rows: auto 260px 1fr; gap: 6px; padding: 6px; }
  .panel { border-radius: 8px; }
  .panel-head { font-size: 12px; }
  .quick-bar { height: 50px; }
  .map-pvp { font-size: 11px; }
  .mfilter-item { font-size: 11px; padding: 5px 8px; }
  .char-preview .cp-stats span { font-size: 10px; padding: 2px 5px; }
}
/* ============ 界面主题（⚙️ 设置中切换） ============ */
html[data-theme="light"] {   /* 月光白 → 暖米白 */
  --bg:#f7f1e3; --bg2:#f0e8d4; --panel:#fffdf6; --panel2:#f8f1df;
  --border:#e4d8be; --border2:#d3c29a; --text:#3d3327; --text-dim:#8e7c5e;
  --gold:#b8860b; --gold2:#a9790a;
  --bg-glow:#faefd6;
  --input-bg:#fffef9; --menu-bg:#fffdf6; --chip-bg:#f3ebd8; --btn-bg:#efe3c8;
  --switch-bg:#d9caa4; --scroll-thumb:#d9c9a3; --toast-bg:#fffdf6; --menu-hover-bg:#f6edd8;
  --modal-grad:linear-gradient(180deg,#fffdf6,#f8f1df);
  --auth-grad:linear-gradient(180deg,#fffdf6,#f5ecd6);
}
html[data-theme="silver"] {
  --bg:#1b1f26; --bg2:#21262e; --panel:#272d37; --panel2:#2e3541;
  --border:#3a424f; --border2:#4a5464; --text:#d8dee6; --text-dim:#8d97a6;
  --gold:#c8b17c; --gold2:#ddc18a;
  --bg-glow:#2a3140;
  --input-bg:#1f252e; --menu-bg:#242b35; --chip-bg:#323a46; --btn-bg:#333c49;
  --switch-bg:#3d4653; --scroll-thumb:#414b59; --toast-bg:#262d38; --menu-hover-bg:#3a4452;
  --modal-grad:linear-gradient(180deg,#252b35,#1d222b);
  --auth-grad:linear-gradient(180deg,#242a34,#1c212a);
}
html[data-theme="blue"] {
  --bg:#0a1622; --bg2:#0e1d2c; --panel:#112435; --panel2:#162c40;
  --border:#1e3a55; --border2:#2a4f74; --text:#cfe1f1; --text-dim:#7f9bb8;
  --gold:#e0b85c; --gold2:#f2cd7e;
  --bg-glow:#12304a;
  --input-bg:#0f2030; --menu-bg:#152a3c; --chip-bg:#1c3850; --btn-bg:#1b3449;
  --switch-bg:#2a4f74; --scroll-thumb:#2a4f74; --toast-bg:#142a3c; --menu-hover-bg:#1f3e58;
  --modal-grad:linear-gradient(180deg,#142a3c,#0e2030);
  --auth-grad:linear-gradient(180deg,#12283a,#0d1d2c);
}
html[data-theme="gold"] {
  --bg:#150f08; --bg2:#1c140a; --panel:#24190d; --panel2:#2d2012;
  --border:#42301a; --border2:#554021; --text:#eadcc0; --text-dim:#a08a5e;
  --gold:#f0c75e; --gold2:#ffd97a;
  --bg-glow:#33220c;
  --input-bg:#201609; --menu-bg:#251a0e; --chip-bg:#352713; --btn-bg:#322412;
  --switch-bg:#554021; --scroll-thumb:#554021; --toast-bg:#2a1e10; --menu-hover-bg:#3b2c15;
  --modal-grad:linear-gradient(180deg,#2a1e10,#1e1409);
  --auth-grad:linear-gradient(180deg,#281d0f,#1c1409);
}
html[data-theme="purple"] {
  --bg:#120a1e; --bg2:#170e28; --panel:#1f1234; --panel2:#281845;
  --border:#38235c; --border2:#4a2f7d; --text:#ded2ef; --text-dim:#9a86c0;
  --gold:#c9a6f5; --gold2:#dcc2ff;
  --bg-glow:#241244;
  --input-bg:#1a0e2e; --menu-bg:#1f1234; --chip-bg:#2c1c4e; --btn-bg:#291a48;
  --switch-bg:#4a2f7d; --scroll-thumb:#4a2f7d; --toast-bg:#241542; --menu-hover-bg:#33205a;
  --modal-grad:linear-gradient(180deg,#251644,#1a0e30);
  --auth-grad:linear-gradient(180deg,#211340,#170d2a);
}

/* ============ NPC 对话（直观化） ============ */
.npc-dialog { }
.npc-dlg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.npc-avatar {
  width: 52px; height: 52px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: var(--chip-bg); border: 1px solid var(--border2);
}
.npc-id .npc-name { font-size: 15px; font-weight: 800; color: var(--text); }
.npc-role {
  display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; color: var(--gold2); background: var(--chip-bg); border: 1px solid var(--border);
}
.npc-loc { color: var(--text-dim); font-size: 11px; margin-left: 6px; }
.npc-bubble {
  position: relative; margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--input-bg); border: 1px solid var(--border2); color: var(--text);
  font-size: 13px; line-height: 1.8;
}
.npc-bubble::before {
  content: ''; position: absolute; top: -7px; left: 26px; width: 12px; height: 12px;
  background: var(--input-bg); border-left: 1px solid var(--border2); border-top: 1px solid var(--border2);
  transform: rotate(45deg);
}
.npc-shop-preview { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.npc-pv {
  width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--panel2); border: 1px solid var(--border);
}
.npc-pv-more { color: var(--text-dim); font-size: 11px; }
.npc-shop-tip { color: var(--text-dim); font-size: 11px; margin-bottom: 10px; }
.npc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.npc-act {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 9px;
  background: var(--btn-bg); border: 1px solid var(--border); color: var(--text);
  text-align: left; font-size: 13px;
}
.npc-act b { color: var(--gold2); }
.npc-act i { font-style: normal; color: var(--text-dim); font-size: 11px; }
.npc-act:hover { border-color: var(--gold); background: var(--menu-hover-bg); }
.npc-close {
  width: 100%; padding: 8px; border-radius: 8px; background: transparent;
  border: 1px solid var(--border); color: var(--text-dim); font-size: 12px;
}
.npc-close:hover { color: var(--text); border-color: var(--border2); }
@media (max-width: 480px) { .npc-actions { grid-template-columns: 1fr; } }

/* ============ 传送员：区域分组 ============ */
.travel-region { margin: 10px 0 4px; font-weight: 800; color: var(--gold2); font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; border-radius: 8px; padding: 4px 6px; }
.travel-region:hover { background: var(--chip-bg); color: var(--gold); }
.travel-region .tr-count { color: var(--text-dim); font-weight: 400; font-size: 11px; }
.travel-region .tr-arrow { display: inline-block; width: 14px; text-align: center; font-size: 11px; }
.travel-region:first-child { margin-top: 2px; }
.travel-region::before { content: ''; flex: 0 0 auto; width: 4px; height: 14px; border-radius: 2px; background: var(--gold); }
.travel-grid { margin-bottom: 10px; margin-left: 10px; }

/* ============ 设置弹窗：主题选择 ============ */
.theme-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }
.theme-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px;
  background: var(--btn-bg); border: 1px solid var(--border); color: var(--text); font-size: 12px;
}
.theme-chip .swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--border2); }
.theme-chip.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.theme-chip:hover { border-color: var(--gold2); }

/* ============ 反馈建议（公开留言板） ============ */
.fb-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel2); cursor: pointer; position: relative; }
.fb-card:hover { border-color: var(--gold2); }
.fb-row1 { display: flex; align-items: center; gap: 8px; }
.fb-no {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; letter-spacing: .5px; font-variant-numeric: tabular-nums;
  color: var(--gold2); background: rgba(230, 184, 76, .12); border: 1px solid rgba(230, 184, 76, .35);
  border-radius: 6px; padding: 2px 6px; line-height: 1.25;
}
.fb-d-title .fb-no { margin-right: 8px; vertical-align: middle; font-size: 12px; }
.fb-title { font-weight: 700; font-size: 14px; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-rc { font-size: 11px; color: var(--gold2); background: var(--chip-bg); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; flex: 0 0 auto; }
.fb-prev { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.fb-meta { color: var(--text-dim); font-size: 11px; margin-top: 5px; }
.fb-ops { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 5px; }
.fb-card .fb-meta { padding-right: 90px; }
.fb-stamp {
  display: inline-block; transform: rotate(-12deg); margin-left: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: #e5534b; background: rgba(229, 83, 75, 0.08);
  border: 2px solid #e5534b; border-radius: 3px; padding: 0 5px 0 4px;
  opacity: .88; pointer-events: none; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(229,83,75,.35), 0 0 0 1px rgba(229,83,75,.35);
}
.fb-intro { color: var(--text-dim); font-size: 12px; line-height: 1.7; margin: 0 0 14px; background: var(--chip-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.fb-form { display: flex; flex-direction: column; gap: 14px; }
.fb-field label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text); margin-bottom: 6px; font-weight: 600; }
.fb-counter { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.fb-counter span { min-width: 2ch; display: inline-block; text-align: right; }
.fb-field input, .fb-field textarea {
  width: 100%; box-sizing: border-box; padding: 11px 13px; border-radius: 9px;
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; outline: none; transition: border .15s, box-shadow .15s;
}
.fb-field input::placeholder, .fb-field textarea::placeholder { color: var(--text-dim); opacity: .55; }
.fb-field input:focus, .fb-field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230, 184, 76, .12); }
.fb-field textarea { resize: vertical; min-height: 130px; line-height: 1.65; font-family: inherit; }
.fb-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.fb-foot .btn { width: auto; padding: 9px 24px; border-radius: 9px; font-size: 14px; }
.fb-new-wrap { display: flex; align-items: center; gap: 10px; }
.fb-new-wrap button {
  padding: 10px 26px; border: none; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
  background: linear-gradient(180deg, #e6b84c, #c99a2e); color: #1a1305; box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: transform .12s, box-shadow .12s;
}
.fb-new-wrap button:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(230,184,76,.35); }
.fb-new-wrap span { color: var(--text-dim); font-size: 12px; }
.fb-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.fb-pg-info { color: var(--text-dim); font-size: 12px; }
.fb-pager .btn-sm:disabled { opacity: .4; cursor: not-allowed; }
.fb-d-title { font-size: 16px; font-weight: 800; color: var(--text); }
.fb-d-meta { color: var(--text-dim); font-size: 11px; margin: 4px 0 10px; }
.fb-d-content { background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.fb-reply-head { font-weight: 700; color: var(--gold2); margin: 14px 0 8px; font-size: 13px; }
.fb-reply { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; margin-bottom: 7px; background: var(--panel); }
.fb-r-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.fb-r-head b { color: var(--gold2); }
.fb-r-del { margin-left: auto; background: transparent; border: none; color: var(--red, #ff6b6b); font-size: 11px; cursor: pointer; }
.fb-r-text { font-size: 13px; margin-top: 4px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--text); }

/* ============ PK 战斗窗口 ============ */
.pk-arena { display: flex; gap: 10px; align-items: stretch; margin-bottom: 10px; }
.pk-side { flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.pk-name { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-cls { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.pk-vs { align-self: center; color: var(--red, #ff6b6b); font-weight: 900; font-size: 18px; text-shadow: 0 0 8px rgba(255,80,80,.6); }
.pk-bar { height: 10px; background: #3a2b2b; border: 1px solid #5a3a3a; border-radius: 6px; overflow: hidden; margin: 3px 0; }
.pk-bar-fill { height: 100%; transition: width .3s; }
.pk-bar-fill.hp { background: linear-gradient(90deg, #c42828, #ff5b4d); }
.pk-bar-fill.mp { background: linear-gradient(90deg, #1e5aa8, #4da3ff); }
.pk-num { font-size: 11px; color: var(--text-dim); text-align: right; line-height: 1.2; }
.pk-skills { margin: 4px 0 8px; }
.pk-sec { font-size: 12px; color: var(--gold2); margin: 6px 0 4px; }
.pk-sec-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-skill { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: pointer; }
.pk-skill:hover { border-color: var(--gold2); }
.pk-skill.atk { border-color: rgba(255,90,80,.5); }
.pk-skill.sup { border-color: rgba(80,220,130,.5); }
.pk-skill-mp { font-size: 10px; color: #4da3ff; margin-left: 4px; }
.pk-mode-tag { margin-left: 8px; font-size: 11px; color: #4ade80; }
.pk-mode-tag.peace { color: #9aa0a6; }

/* ============ 多选批量操作 ============ */
.multi-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; padding: 6px 8px; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; }
.multi-bar.on { border-color: var(--gold2); }
.slot { position: relative; }
.slot.multi-sel { outline: 2px solid var(--gold2); box-shadow: 0 0 6px rgba(255,215,0,.5); }
.slot .ms-mark { position: absolute; top: 1px; right: 2px; font-size: 11px; color: #000; background: var(--gold2); border-radius: 3px; padding: 0 3px; font-weight: 700; line-height: 1.3; }

/* ============ 当前装备对比 ============ */
.item-tip .i-cmp { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.item-tip .i-cmp-h { font-size: 11px; color: var(--gold2); font-weight: 700; margin-bottom: 3px; }
.item-tip .i-cmp-none { font-size: 12px; color: var(--text-dim); }
.item-tip .i-cmp-it { padding: 2px 0; }
.item-tip .i-cmp-it + .i-cmp-it { border-top: 1px dotted var(--border); margin-top: 3px; padding-top: 3px; }
.item-tip .i-cmp-n { font-size: 12px; color: #e8e2d0; font-weight: 700; }

/* ============ 手机端页面重排：整页可下拉，重要板块在上、次要在下 ============ */
@media (max-width: 960px) {
  /* 游戏主屏改为整页可滚动（不再把所有板块锁死在一屏内） */
  .game-screen { overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* 主区改为纵向流式布局：高度随内容，页面自然下拉 */
  .main-grid {
    flex: none;
    display: flex; flex-direction: column; gap: 8px; padding: 8px;
  }
  /* 板块排序（从上到下）：挂机打怪(center) → 聊天(left) → 背包/装备(right) */
  .main-grid > .center-col { order: 1; }
  .main-grid > .left-col   { order: 2; }
  .main-grid > .right-col  { order: 3; }

  /* center 内部顺序：地图 → 挂机控制 → 战斗实况 → 角色属性(次要放下) */
  .center-col { display: flex; flex-direction: column; gap: 8px; }
  .center-col > .map-banner { order: 1; }
  .center-col > .map-row    { order: 2; }
  .center-col > .fight-panel { order: 3; flex: none; }
  .center-col > .mid-row { order: 4; flex: none; flex-direction: column; gap: 8px; min-height: 0; }
  .mid-row .battle-panel { order: 1; flex: none; min-height: 0; }
  .mid-row .char-panel   { order: 2; flex: none; }

  /* 面板按内容自适应高度，不再锁视口 */
  .main-grid .panel { min-height: 0; }
  .main-grid .panel-body { flex: none; overflow: visible; padding: 10px; }
  .tab-body { flex: none; overflow: visible; }

  /* 聊天 / 战斗实况：给固定可视高度（内部滚动），更宽裕但不占满全屏 */
  .chat-log { flex: none; height: min(50vh, 440px); min-height: 240px; }
  .battle-log { flex: none; height: min(46vh, 420px); min-height: 200px; }
  .battle-body { flex: none; overflow: visible; padding: 0; }

  /* 挂机控制各块更宽裕 */
  .fight-block { flex: 1 1 100%; }
  .fight-main { gap: 10px; }
  .attr-grid { gap: 6px 12px; }

  /* 底部快捷栏固定在视口底部 */
  .game-screen > .quick-bar {
    position: sticky; bottom: 0; z-index: 40;
    box-shadow: 0 -2px 10px rgba(0,0,0,.28);
  }
  .chat-input-row input { font-size: 15px; }
}

/* ============ 移动端底部导航（类APP） ============ */
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: 52px; background: var(--auth-grad); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,.3);
    padding-bottom: max(0px, env(safe-area-inset-bottom));
    touch-action: manipulation;
  }
  .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px; background: none; border: none; color: var(--text-dim);
    font-size: 11px; cursor: pointer; padding: 2px 0; min-height: 46px; touch-action: manipulation;
  }
  .bottom-nav button span { font-size: 10px; line-height: 1; }
  .bottom-nav button.active { color: var(--gold2); }
  /* 底部快捷栏移到导航栏上方 */
  .game-screen > .quick-bar { position: fixed; bottom: 52px; z-index: 55; }
  /* 主区强制单列堆叠 */
  .main-grid { display: block !important; padding: 8px; padding-bottom: 118px; }
  /* 页签内容：默认全部隐藏 */
  .left-col, .right-col, .char-panel, #pageSet, .map-banner, .map-row, .fight-panel, .battle-panel { display: none !important; }
  /* 战斗页内容默认可见（含未设 tab / 刷新首帧），仅在非战斗页隐藏 */
  body:not([data-tab]) .map-banner,
  body:not([data-tab]) .map-row,
  body:not([data-tab]) .fight-panel,
  body:not([data-tab]) .battle-panel,
  body[data-tab='fight'] .map-banner,
  body[data-tab='fight'] .map-row,
  body[data-tab='fight'] .fight-panel,
  body[data-tab='fight'] .battle-panel { display: block !important; }
  /* 角色页：只保留人物信息（页签栏及其内容归"功能"页） */
  body[data-tab='role'] .char-panel { display: flex !important; }
  body[data-tab='msg']  .left-col   { display: flex !important; }
  body[data-tab='func'] .right-col  { display: flex !important; }
  body[data-tab='set']  #pageSet    { display: flex !important; flex-direction: column; }
  /* 设置页：主区（三列内容）全部隐藏，避免顶部留下大块空白 */
  body[data-tab='set'] .main-grid { display: none !important; }
  .page-set { margin: 8px; padding-bottom: 118px; }
  .set-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
  .set-row .btn-sm { flex: 1; min-width: 90px; min-height: 36px; }
  /* 角色/功能页：tabBody 限高滚动 */
  body[data-tab='func'] .tab-body {
    max-height: calc(100dvh - 240px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  /* 战斗/角色页：隐藏顶部条（角色信息+导航栏），沉浸式 */
  body[data-tab='fight'] .top-bar, body[data-tab='role'] .top-bar { display: none !important; }
  /* 战斗页：地图信息排成一行 */
  body[data-tab='fight'] .map-banner { flex-direction: row !important; align-items: center; gap: 8px; padding: 6px 10px; flex-wrap: nowrap; }
  body[data-tab='fight'] .map-banner .mi { font-size: 18px; }
  body[data-tab='fight'] .map-banner > div { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex-wrap: nowrap; }
  body[data-tab='fight'] .map-banner .nm { font-size: 13px; white-space: nowrap; }
  body[data-tab='fight'] .map-banner .desc { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body[data-tab='fight'] .map-banner .hint { margin-left: auto; font-size: 10px; white-space: nowrap; }
  /* 战斗实况高度缩减 3/5（仅保留 2/5） */
  body[data-tab='fight'] .battle-panel { min-height: 0; }
  body[data-tab='fight'] .battle-log { height: min(18vh, 168px) !important; min-height: 80px !important; }
  body[data-tab='fight'] .battle-body { overflow: hidden; }
  /* 顶部精简：仅隐藏在线人数；反馈保留，紧邻「切换角色」便于 APP/手机端提交建议 */
  .top-bar .top-server, #btnTopOnline { display: none !important; }
}


/* ============ 悬浮球快捷卫星圆环（仅移动端/APP） ============ */
.fab-ring {
  position: fixed; inset: 0; z-index: 9997;
  pointer-events: none; display: none;
}
.fab-ring-item {
  position: fixed; pointer-events: auto;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.18), rgba(16,21,32,.94) 66%);
  border: 1px solid rgba(212,164,55,.55);
  box-shadow: 0 3px 12px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06);
  color: #f0e6cf;
  opacity: 0; transform: translate(-50%, -50%) scale(.4);
  transition: opacity .18s ease, transform .22s cubic-bezier(.34,1.4,.64,1);
}
.fab-ring-item.in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.fab-ring-item:active { transform: translate(-50%, -50%) scale(.88); border-color: var(--gold); }
.fri-ico { font-size: 18px; line-height: 1; }
.fri-lbl { font-size: 8px; line-height: 1.15; color: var(--gold2); font-weight: 700; white-space: nowrap; }
/* 设置页：5 个快捷功能选择器 */
.fr-pick-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.fr-pick-lbl { width: 42px; font-size: 12px; color: var(--text-dim); flex: 0 0 auto; }
.fr-pick-sel {
  flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; font-size: 12px;
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text);
}

/* ============ 首页安卓客户端下载（仅登录卡内链接） ============ */
.auth-dl { margin-top: 10px; text-align: center; font-size: 12px; color: var(--text-dim); }
.auth-dl a { color: var(--gold2); text-decoration: none; }
.auth-dl a:hover { text-decoration: underline; }

/* ============ 角色页内嵌装备栏 ============ */
.role-equip-sep { height: 1px; background: var(--border); margin: 10px 0 8px; }
.role-equip-head { font-size: 12px; font-weight: 700; color: var(--gold2); margin-bottom: 6px; }
#roleEquip .char-preview { display: none; }
#roleEquip .item-grid { margin-top: 0 !important; gap: 6px; }
#roleEquip .slot { min-height: 46px; }
@media (max-width: 720px) {
  #roleEquip .item-grid { grid-template-columns: repeat(4, 1fr) !important; }
  #roleEquip .slot { min-height: 52px; }
}

/* ============ 设置弹窗顶部版本行 ============ */
.ver-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; margin-bottom: 10px;
  border: 1px solid var(--border2); border-radius: 8px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
}
.ver-row .ver-txt { font-size: 12px; color: var(--text-dim); }
.ver-row .ver-txt b { color: var(--gold2); font-size: 13px; margin-left: 2px; }
.ver-row #btnCheckUpdate { margin-left: auto; }

/* ============ 游戏内搜索 ============ */
.sr-wrap { display: flex; flex-direction: column; gap: 8px; }
.sr-bar { display: flex; gap: 6px; }
.sr-input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--input-bg); color: var(--text); font-size: 13px;
}
.sr-input:focus { outline: none; border-color: var(--gold2); }
.sr-types { display: flex; gap: 5px; flex-wrap: wrap; }
.sr-type {
  padding: 4px 11px; border-radius: 14px; border: 1px solid var(--border2);
  background: var(--btn-bg); color: var(--text-dim); font-size: 12px; cursor: pointer;
}
.sr-type.active { background: var(--gold); color: #1a1200; border-color: var(--gold2); font-weight: 700; }
.sr-body { min-height: 60px; }
.sr-hint { padding: 14px 8px; font-size: 12px; color: var(--text-dim); line-height: 1.9; text-align: center; }
.sr-count { font-size: 11px; color: var(--text-dim); padding: 2px 2px 6px; }
.sr-group { margin-bottom: 10px; }
.sr-ghead { font-size: 12px; font-weight: 700; color: var(--gold2); padding: 4px 2px; }
.sr-ghead .muted { color: var(--text-dim); font-weight: 400; font-size: 11px; }
.sr-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; cursor: pointer;
  border-radius: 8px; border: 1px solid transparent;
}
.sr-row:hover, .sr-row:active { background: var(--panel2); border-color: var(--border); }
.sr-ico { font-size: 17px; width: 22px; text-align: center; flex: 0 0 auto; }
.sr-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sr-txt b { font-size: 13px; color: var(--text); font-weight: 700; }
.sr-txt i { font-style: normal; font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-arrow { color: var(--text-dim); font-size: 15px; flex: 0 0 auto; }
.sd-meta { font-size: 12px; color: var(--text-dim); padding: 4px 0 8px; line-height: 1.7; }
.sd-desc { font-size: 13px; color: var(--text); padding: 4px 0 8px; line-height: 1.7; }
.sd-sec { font-size: 12px; font-weight: 700; color: var(--gold2); margin: 12px 0 6px; }
.sd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 10px; }
.sd-attr { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--panel2); }
.sd-attr span { color: var(--text-dim); }
.sd-attr b { color: var(--text); }
.sd-list { max-height: 300px; overflow-y: auto; }
.sd-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 4px 8px; border-bottom: 1px dashed var(--border); }
.sd-row:last-child { border-bottom: none; }
.sd-row b { color: var(--gold2); font-weight: 700; white-space: nowrap; }

/* ============ 一级设置页（扁平） ============ */
.sp-sec { font-size: 13px; font-weight: 800; color: var(--gold2); margin: 16px 0 6px; }
.sp-sec:first-child { margin-top: 2px; }
.sp-note { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.6; }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; background: var(--panel2); margin-bottom: 6px; font-size: 13px; }
.sp-row b { color: var(--gold2); font-size: 12px; }
.sp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.sp-lbl { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.sp-lbl b { color: var(--gold2); }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.sp-chip { padding: 6px 13px; border-radius: 15px; border: 1px solid var(--border2); background: var(--btn-bg); color: var(--text-dim); font-size: 12px; cursor: pointer; }
.sp-chip.on { background: var(--gold); color: #1a1200; border-color: var(--gold2); font-weight: 700; }
.sp-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-btns .btn-sm { flex: 1; min-width: 96px; min-height: 34px; }
#pageSet .panel-body { padding-bottom: 20px; }
.sp-sub { font-style: normal; font-size: 10px; color: var(--text-dim); margin-left: 4px; }

/* ============ 悬浮球（血量/经验/魔法 三环） ============ */
.vital-fab {
  position: fixed; z-index: 9998; width: 76px; height: 76px;
  border-radius: 50%; touch-action: none; cursor: grab;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.14), rgba(10,13,19,.82) 62%);
  box-shadow: 0 4px 16px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.10);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, opacity .2s ease;
}
.vital-fab.dragging { cursor: grabbing; transform: scale(1.06); transition: none; }
/* 队伍成员头像列（悬浮球旁，竖排，最多5人） */
.party-fab {
  position: fixed; z-index: 9998; display: flex; flex-direction: column; gap: 6px;
  padding: 7px 6px; border-radius: 14px;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.12), rgba(10,13,19,.88) 62%);
  border: 1px solid rgba(212,164,55,.45);
  box-shadow: 0 4px 16px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: auto; touch-action: manipulation;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.party-fab.dragging { cursor: grabbing; transform: scale(1.05); transition: none; }
.pf-item {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.16), rgba(16,21,32,.92) 66%);
  border: 1px solid rgba(212,164,55,.5);
  box-shadow: 0 2px 8px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06);
  overflow: hidden; cursor: pointer;
}
.pf-item.pf-leader { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,164,55,.35), 0 2px 8px rgba(0,0,0,.5); }
.pf-item.pf-me { border-color: #6db3f2; }
.pf-ico { font-size: 20px; line-height: 1; position: relative; z-index: 2; }
.pf-lv {
  position: absolute; right: -2px; bottom: -2px; z-index: 3;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #d92d20; color: #fff; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,.45);
}
.pf-crown { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 12px; z-index: 3; line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.pf-hp {
  position: absolute; bottom: 0; left: 0; height: 3px; z-index: 1;
  background: linear-gradient(90deg, #ff7a59, #d92d20); border-radius: 0 3px 3px 0;
  transition: width .3s ease; opacity: .85;
}
.pf-hp-bg {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px; z-index: 0;
  background: rgba(0,0,0,.5); border-radius: 0 0 50% 50% / 0 0 3px 3px;
}
/* 队长视角：非自己头像 hover 提示可踢出 */
.pf-item.pf-kickable { cursor: pointer; }
.pf-item.pf-kickable:hover { border-color: #ff7a59; box-shadow: 0 0 0 2px rgba(217,45,32,.4); }
@media (max-width: 480px) {
  .pf-item { width: 40px; height: 40px; }
  .pf-ico { font-size: 18px; }
  .pf-lv { font-size: 8px; min-width: 14px; height: 14px; }
}
.vital-fab.mini { opacity: .55; transform: scale(.86); }
.vf-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.vf-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; line-height: 1.05;
}
.vf-num { font-size: 14px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.vf-sub { font-size: 9px; font-weight: 700; color: #f5c542; text-shadow: 0 1px 2px rgba(0,0,0,.85); }
@media (max-width: 720px) {
  .vital-fab { width: 72px; height: 72px; }
  .vf-num { font-size: 13px; }
  .vf-sub { font-size: 8px; }
}
/* 桌面端（鼠标）：略收缩，悬停放大提示可拖动 */
@media (hover: hover) and (min-width: 721px) {
  .vital-fab { width: 68px; height: 68px; opacity: .92; }
  .vital-fab:hover { opacity: 1; transform: scale(1.04); box-shadow: 0 6px 22px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.18); }
  .vital-fab.dragging { transform: scale(1.06) !important; }
  .vital-fab.mini { opacity: .45; transform: scale(.82); }
  .vital-fab.mini:hover { opacity: .9; transform: scale(.9); }
  .vf-num { font-size: 13px; }
  .vf-sub { font-size: 8px; }
}

/* ============================================================
   可视化对战模式（Battle Mode v2 · Canvas）
   ============================================================ */
body.battle-open { overflow: hidden; }
.battle-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none; flex-direction: column;
  background: radial-gradient(ellipse at 50% -10%, #1e2a3c 0%, #0a0e14 72%);
  color: #e6edf3;
  user-select: none; -webkit-user-select: none;
}
.bm-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.07), transparent);
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.bm-title { font-weight: 800; font-size: 15px; letter-spacing: .5px; }
.bm-sub { font-size: 12px; color: #8b98a5; }
.bm-mode {
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 10px;
  background: rgba(245,197,66,.15); color: #ffd97a; border: 1px solid rgba(245,197,66,.45);
}
.bm-close {
  margin-left: auto; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
  color: #e6edf3; font-size: 15px; cursor: pointer; line-height: 1;
}
.bm-close:hover { background: rgba(231,76,60,.3); border-color: #e74c3c; }
.bm-flee {
  padding: 5px 14px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  color: #fff; border: 1px solid rgba(231,76,60,.65);
  background: linear-gradient(180deg, rgba(231,76,60,.85), rgba(180,50,40,.85));
  transition: all .15s;
}
.bm-flee:hover { background: linear-gradient(180deg, #e74c3c, #b03028); border-color: #ff7b6b; }
.bm-flee:active { transform: scale(.95); }

.bm-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 10px; gap: 8px; }
.bm-field-wrap {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 14px;
  background: #0d1218;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 0 60px rgba(0,0,0,.55), 0 4px 24px rgba(0,0,0,.4);
  cursor: crosshair;
}
#bmCanvas { display: block; border-radius: 14px; }
.bm-corner {
  position: absolute; color: rgba(245,197,66,.35); font-size: 16px; pointer-events: none; line-height: 1;
}
.bm-corner.tl { top: 6px; left: 9px; } .bm-corner.tr { top: 6px; right: 9px; }
.bm-corner.bl { bottom: 6px; left: 9px; } .bm-corner.br { bottom: 6px; right: 9px; }

/* HUD */
.bm-hud { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.bm-side {
  flex: 1 1 0; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 12px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.1);
}
.bm-side.bm-hero { box-shadow: inset 0 0 0 1px rgba(80,180,255,.4), 0 0 18px rgba(80,180,255,.08); }
.bm-side.bm-foe { box-shadow: inset 0 0 0 1px rgba(255,90,90,.4), 0 0 18px rgba(255,90,90,.08); }
.bm-avatar {
  font-size: 24px; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.14);
}
.bm-vitals { flex: 1 1 auto; min-width: 0; }
.bm-name { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-vitals .bar { position: relative; height: 13px; border-radius: 7px; background: rgba(0,0,0,.55); overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.bm-vitals .bar.sm { height: 7px; margin-top: 4px; }
.bm-vitals .bar .fill { height: 100%; transition: width .15s ease-out; }
.bm-vitals .bar.hp .fill { background: linear-gradient(90deg, #ef4444, #f87171); box-shadow: 0 0 8px rgba(239,68,68,.6); }
.bm-vitals .bar.mp .fill { background: linear-gradient(90deg, #3b82f6, #60a5fa); box-shadow: 0 0 8px rgba(59,130,246,.6); }
.bm-vitals .bmtxt {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; text-shadow: 0 1px 2px #000;
}
.bm-vs { flex: 0 0 auto; font-weight: 900; font-size: 15px; color: rgba(245,197,66,.85); text-shadow: 0 2px 8px rgba(245,197,66,.4); }
.bm-side.bm-foe .bm-name { color: #ffb3b3; }

/* 战斗日志 */
.bm-log {
  flex: 0 0 auto; height: 64px; overflow-y: auto; padding: 5px 10px;
  font-size: 11.5px; line-height: 1.55; border-radius: 10px;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.07);
}
.bml { color: #b9c4d0; }
.bml.dmg { color: #ff9d9d; }
.bml.heal { color: #7ee2a8; }
.bml.hurt { color: #ffb86b; }
.bml.kill { color: #f5c542; font-weight: 700; }
.bml.sys { color: #7fd4ff; }
.bml.muted { color: #7a8794; }
.bml.loot { color: #ffd97a; font-weight: 600; }

/* 底部：摇杆 + 技能 */
.bm-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 8px 12px 12px; border-top: 1px solid rgba(255,255,255,.08);
}
.bm-joy { flex: 0 0 auto; touch-action: none; cursor: grab; }
.joy-base {
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, rgba(255,255,255,.16), rgba(255,255,255,.04) 65%);
  border: 1.5px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.35);
}
.joy-knob {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #d9ecff, #5b8fc9 70%);
  box-shadow: 0 3px 10px rgba(0,0,0,.6), inset 0 -2px 4px rgba(0,0,0,.25);
  transition: transform .05s linear; will-change: transform;
}
.bm-skills { flex: 1 1 auto; display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.bm-skill {
  position: relative; flex: 0 0 auto; width: 58px; height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; border-radius: 11px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.045));
  border: 1px solid rgba(255,255,255,.2); color: #e6edf3;
  transition: transform .08s;
}
.bm-skill:active { transform: scale(.93); }
.bm-skill.cooling { opacity: .45; }
.bm-skill.nomp { filter: saturate(.3) brightness(.75); }
.bm-skill.is-item { border-color: rgba(120,200,255,.55); }
.bm-skill .bs-icon { font-size: 18px; line-height: 1; }
.bm-skill .bs-name { font-size: 8.5px; line-height: 1.1; opacity: .92; max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-skill .bs-mp { position: absolute; top: 2px; right: 4px; font-size: 8px; color: #7fb8ff; font-weight: 700; }
.bm-skill .bs-cnt { position: absolute; bottom: 2px; right: 4px; font-size: 9px; color: #9ae6b4; font-weight: 700; }
.bm-skill .bs-cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; background: rgba(0,0,0,.55); border-radius: 11px; }
.bm-skill .bs-key { background: rgba(0,0,0,.65); border-radius: 4px; padding: 0 4px; color: #ffd97a; font-size: 8.5px; font-weight: 800; position: absolute; bottom: 2px; left: 4px; }

.bm-toast {
  position: absolute; left: 50%; top: 13%; transform: translate(-50%, -8px);
  padding: 8px 18px; border-radius: 22px; font-size: 12.5px; font-weight: 600;
  background: rgba(20,28,38,.94); border: 1px solid rgba(255,255,255,.2);
  color: #ffd97a; opacity: 0; transition: all .2s; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.bm-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 快捷键设置弹窗 */
.hk-list { display: flex; flex-direction: column; gap: 5px; max-height: 46vh; overflow-y: auto; }
.hk-item {
  text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  color: #e6edf3; font-size: 13px;
}
.hk-item:hover { background: rgba(245,197,66,.2); border-color: rgba(245,197,66,.6); }
.hk-clear { color: #ff9d9d; border-color: rgba(231,76,60,.4); }

/* 移动端适配 */
@media (max-width: 720px) {
  .bm-head { padding: 6px 9px; }
  .bm-title { font-size: 13px; }
  .bm-sub { font-size: 10.5px; }
  .bm-body { padding: 6px; gap: 6px; }
  .bm-log { height: 50px; font-size: 10.5px; }
  .joy-base { width: 78px; height: 78px; }
  .joy-knob { width: 34px; height: 34px; }
  .bm-skill { width: 52px; height: 52px; }
  .bm-avatar { width: 34px; height: 34px; font-size: 19px; }
  .bm-name { font-size: 11px; }
  .bm-vs { font-size: 13px; }
}
@media (max-width: 420px) {
  .bm-log { height: 42px; }
  .joy-base { width: 70px; height: 70px; }
  .joy-knob { width: 30px; height: 30px; }
  .bm-skill { width: 48px; height: 48px; }
  .bm-flee { padding: 4px 10px; font-size: 11.5px; }
}

/* ============================================================
   对战模式入口按钮 + 选择对战对象弹窗
   ============================================================ */
.btn-battle {
  padding: 4px 12px; border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  color: #ffd9a0; letter-spacing: .3px;
  background: linear-gradient(180deg, rgba(245,158,66,.28), rgba(180,95,30,.22));
  border: 1px solid rgba(245,158,66,.55);
  box-shadow: 0 0 10px rgba(245,158,66,.12), inset 0 1px 0 rgba(255,255,255,.12);
  transition: all .15s;
}
.btn-battle:hover { background: linear-gradient(180deg, rgba(245,158,66,.45), rgba(180,95,30,.35)); border-color: #f59e42; box-shadow: 0 0 14px rgba(245,158,66,.3); }
.btn-battle:active { transform: scale(.95); }
.btn-battle.armed {
  color: #fff;
  background: linear-gradient(180deg, rgba(231,76,60,.55), rgba(150,45,30,.45));
  border-color: rgba(255,120,100,.8);
  box-shadow: 0 0 12px rgba(231,76,60,.35);
  animation: btmPulse 1.6s ease-in-out infinite;
}
@keyframes btmPulse { 0%,100% { box-shadow: 0 0 8px rgba(231,76,60,.3);} 50% { box-shadow: 0 0 18px rgba(231,76,60,.55);} }

/* 选择对战对象弹窗 */
.btm-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245,158,66,.12), rgba(80,140,255,.08));
  border: 1px solid rgba(255,255,255,.1);
}
.btm-map { font-size: 13.5px; font-weight: 800; color: #ffd97a; }
.btm-tag { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.btm-tag.pvp { color: #ff9d9d; background: rgba(231,76,60,.18); border: 1px solid rgba(231,76,60,.45); }
.btm-tag.safe { color: #9ae6b4; background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.4); }
.btm-sec { font-size: 12.5px; font-weight: 800; color: #cdd8e3; margin: 12px 2px 6px; display: flex; align-items: baseline; gap: 8px; }
.btm-sec-hint { font-size: 10px; font-weight: 500; color: #7a8794; }
.btm-grid { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; padding-right: 2px; }
.btm-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border-radius: 11px; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.11);
  color: #e6edf3; transition: all .13s;
}
.btm-item:hover { background: rgba(245,158,66,.14); border-color: rgba(245,158,66,.55); transform: translateX(3px); }
.btm-item:active { transform: scale(.98); }
.btm-item.disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.6); }
.btm-ic {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12);
}
.btm-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.btm-nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btm-lv { font-size: 10.5px; color: #8b98a5; }
.btm-go { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #f0b25e; }

/* Canvas 不得溢出视口（移动端） */
#bmCanvas { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ============ 组队分配方式（独享/均分） ============ */
.pm-mode { margin-bottom: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); }
.pm-mode-head { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.pm-mode-btns { display: flex; gap: 8px; }
.pm-mode-btn {
  flex: 1; text-align: left; padding: 9px 10px; border-radius: 9px; cursor: pointer;
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text);
  display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, background .15s;
}
.pm-mode-btn b { font-size: 13px; }
.pm-mode-btn i { font-style: normal; font-size: 11px; color: var(--text-dim); line-height: 1.45; }
.pm-mode-btn:hover:not(:disabled) { border-color: var(--gold2); }
.pm-mode-btn.active { border-color: var(--gold); background: rgba(230, 184, 76, .14); }
.pm-mode-btn.active b { color: var(--gold2); }
.pm-mode-btn:disabled { opacity: .55; cursor: not-allowed; }
.pm-mode-now { margin-top: 8px; font-size: 11px; color: var(--text-dim); }
.pm-mode-now b { color: var(--gold2); }

/* 悬浮球队标上的分配方式徽标 */
.fab-party-mode {
  font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 999px; line-height: 1.4;
  background: rgba(230, 184, 76, .16); border: 1px solid rgba(230, 184, 76, .4); color: var(--gold2);
  margin-left: 5px; white-space: nowrap;
}
.fab-party-mode.average { background: rgba(120, 200, 255, .14); border-color: rgba(120, 200, 255, .4); color: #7cc8ff; }
.pf-mode-tag { display: flex; justify-content: center; padding: 2px 0 4px; }
.pf-mode-tag .fab-party-mode { margin-left: 0; font-size: 9px; padding: 0 4px; }

/* 队伍面板：分配方式按钮 */
.pt-mode {
  margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(230,184,76,.14); border: 1px solid rgba(230,184,76,.42); color: var(--gold2);
  font-weight: 700; white-space: nowrap; cursor: pointer;
}
.pt-mode:hover { background: rgba(230,184,76,.24); }
.pt-head .pt-leave { margin-left: 0; }

/* ============ 底部快捷栏：移动端横向滚动修复 ============
   内容超出视口时不再撑宽容器，改为栏内横向滚动，保证每个按钮都能滑到。 */
.quick-bar {
  width: 100%; max-width: 100%; box-sizing: border-box;
  min-width: 0; overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.quick-bar::-webkit-scrollbar { display: none; }
.quick-bar > * { flex: 0 0 auto; }

/* 组队按钮：高亮成主色，便于发现「独享/均分」入口 */
#qBtnParty { border-color: rgba(230,184,76,.5); color: var(--gold2); background: rgba(230,184,76,.1); }
#qBtnParty:hover { border-color: var(--gold); background: rgba(230,184,76,.2); }

/* ============ 快捷栏物品数量：缩小角标 ============
   原来数量继承槽位字号（桌面20px/移动17px），在42/36px 的格子里过大。 */
.quick-slot .cnt {
  position: absolute; right: 1px; bottom: 0;
  font-size: 9px; line-height: 1.25; font-weight: 700;
  color: #fff; background: rgba(0, 0, 0, .62);
  border-radius: 4px; padding: 0 3px;
  letter-spacing: -.2px; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
/* 大数字（4位以上）进一步压缩，避免溢出格子 */
.quick-slot .cnt.cnt-lg { font-size: 8px; padding: 0 2px; letter-spacing: -.4px; }
@media (max-width: 768px) {
  .quick-slot .cnt { font-size: 8.5px; padding: 0 2.5px; }
  .quick-slot .cnt.cnt-lg { font-size: 7.5px; }
}

/* ============ 对战面板：药水 + 快捷键栏 ============ */
.pk-sec-hint { font-size: 10px; color: var(--text-dim); font-weight: 400; margin-left: 4px; }
.pk-skill.pot { border-color: rgba(120,190,255,.5); }
.pk-skill.pot:hover { border-color: #78beff; }
.pk-pot-cnt { font-size: 10px; color: #ffd76a; margin-left: 3px; font-weight: 700; }
.pk-hot-tag {
  display: inline-block; min-width: 14px; margin-left: 5px; padding: 0 3px;
  font-size: 9px; font-weight: 700; line-height: 1.5; text-align: center;
  color: #111; background: var(--gold); border-radius: 4px; vertical-align: middle;
}
.pk-quick { margin: 6px 0 10px; }
.pk-quick-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.pk-hot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 4px 2px; min-height: 46px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  overflow: hidden;
}
.pk-hot b { font-size: 9px; color: var(--gold2); line-height: 1; }
.pk-hot i {
  font-size: 8.5px; font-style: normal; color: var(--text-dim); line-height: 1.1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pk-hot .pk-hot-ico { font-size: 14px; line-height: 1; }
.pk-hot.empty { opacity: .45; border-style: dashed; }
.pk-hot.filled { border-color: rgba(230,184,76,.55); background: rgba(230,184,76,.08); }
.pk-hot.filled:hover { border-color: var(--gold); background: rgba(230,184,76,.18); }
@media (max-width: 768px) {
  .pk-quick-row { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .pk-hot { min-height: 42px; }
  .pk-hot .pk-hot-ico { font-size: 13px; }
  .pk-hot i { font-size: 8px; }
}

/* ============ 对战面板：快捷键按钮（位于底部最左侧） ============ */
.bm-foot { display: flex; align-items: center; }
.bm-hk-btn {
  flex: 0 0 auto; width: 44px; height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; margin: 0 8px; padding: 4px 2px;
  border-radius: 9px; cursor: pointer; font-size: 15px; line-height: 1;
  border: 1px solid rgba(230,184,76,.55); background: rgba(230,184,76,.12); color: var(--gold2);
}
.bm-hk-btn span { font-size: 8px; letter-spacing: -.2px; white-space: nowrap; }
.bm-hk-btn:hover { background: rgba(230,184,76,.24); border-color: var(--gold); }


.hkp-list { display: flex; flex-direction: column; gap: 5px; }
.hkp-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
}
.hkp-row .hkp-key {
  flex: 0 0 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #111; background: var(--gold); border-radius: 5px;
}
.hkp-row .hkp-val { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hkp-row .hkp-empty { color: var(--text-dim); font-size: 11px; }
.hkp-row .hkp-cnt { color: #ffd76a; font-size: 10px; }
.hkp-row .hkp-tag { font-size: 10px; color: var(--text-dim); }
.hkp-row.hkp-fixed { opacity: .7; }
.hkp-grp {
  font-size: 11px; color: var(--gold2); margin: 8px 0 4px; padding-left: 2px;
  border-left: 2px solid var(--gold); padding-left: 6px;
}
.hk-item {
  display: block; width: 100%; text-align: left; margin-bottom: 4px;
  padding: 7px 9px; font-size: 12px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
}
.hk-item:hover { border-color: var(--gold); color: var(--gold2); }

/* ============ 对战面板内的弹窗必须压在最上层 ============
   .battle-modal 是 z-index:9999，而 .modal-mask 只有 80，
   导致快捷键设置弹窗被对战页面盖住看不见。对战打开时提升弹窗层级。 */
body.battle-open .modal-mask { z-index: 10050 !important; }
body.battle-open .modal { z-index: 10051; }

/* ============ 对战界面布局重构 ============
   桌面（宽屏）：战场在左，实时战况在右。
   移动/APP（窄屏）：战场为正方形靠上，战况占满下方剩余空间。 */

/* 外层：arena（战场+HUD） + sidebar（战况） */
.bm-body {
  flex: 1 1 auto; min-height: 0;
  display: flex !important; flex-direction: row !important;
  align-items: stretch; gap: 10px; padding: 10px;
}
.bm-arena {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.bm-arena .bm-field-wrap { flex: 1 1 auto; min-height: 0; }

/* 实时战况侧栏 */
.bm-sidebar {
  flex: 0 0 260px; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.08);
}
.bm-sb-head {
  flex: 0 0 auto; padding: 7px 10px; font-size: 12px; font-weight: 700;
  color: #ffd97a; letter-spacing: .4px;
  background: rgba(245,197,66,.09); border-bottom: 1px solid rgba(255,255,255,.08);
}
.bm-sidebar .bm-log {
  flex: 1 1 auto; height: auto !important; min-height: 0;
  border: 0; border-radius: 0; background: transparent;
  overflow-y: auto; padding: 6px 10px;
}

/* 底部：摇杆 → 快捷键 → 技能栏 */
.bm-foot { display: flex; align-items: center; }
.bm-foot .bm-joy { order: 0; }
.bm-foot .bm-hk-btn { order: 1; }
.bm-foot .bm-skills { order: 2; }

/* ---- 窄屏 / APP 端 ---- */
@media (max-width: 860px) {
  .bm-body { flex-direction: column !important; gap: 8px; padding: 8px; }
  /* 正方形战场，靠屏幕上方 */
  .bm-arena { flex: 0 0 auto; }
  .bm-field-wrap {
    flex: 0 0 auto !important;
    width: min(100%, calc(100vw - 16px));
    aspect-ratio: 1 / 1;
    max-height: 46vh;
  }
  #bmCanvas { width: 100% !important; height: 100% !important; }
  /* 战况占满下方剩余空间 */
  .bm-sidebar { flex: 1 1 auto; min-height: 90px; }
  .bm-sb-head { padding: 5px 9px; font-size: 11px; }
  .bm-sidebar .bm-log { font-size: 11px; line-height: 1.5; }
  /* HUD 压缩，让战场与战况占更多空间 */
  .bm-hud { gap: 6px; }
  .joy-base { width: 74px; height: 74px; }
  .joy-knob { width: 32px; height: 32px; }
  .bm-hk-btn { width: 38px; height: 42px; margin-left: 6px; font-size: 13px; }
}
