/* ==========================================================================
   大话文字西游 · 界面样式
   视觉改版（参照「诛仙传说」的设计语言）：
     · 深海蓝底 + 金色主文字 + 青色副文字 + 玫粉强调，扁平化、去描边光晕
     · 顶部 HUD：一行货币/状态条 + 头像/道号/圆形按钮区
     · 内容区用"卡片行"（渐变底 + 1px 细边 + 6px 圆角）
     · 弹层是从底部升起的抽屉（14px 顶圆角 + 青色 2px 顶边）
     · 战斗：左我方 / 右敌方，血条上压数值，日志按语义分色
   注意：类名与 id 全部保持原样（game.js 与自动化检查脚本都依赖它们），
        这次只换"长相"，不动结构与功能。
   ========================================================================== */

.hidden:not(.toast) { display: none; }

:root {
  /* 布局常量：战斗面板与底部栏高度固定，保证日志区大小恒定（不再忽大忽小）。
     用 clamp 随屏幕高度自适应：矮屏自动变矮，日志区才不会被挤没 */
  --battle-h: clamp(124px, 22vh, 190px);
  /* 下限必须容得下"两排按钮 + 上下内边距"（实测 78 + 20 = 98px），否则矮屏会被切 */
  --bar-h: clamp(96px, 13vh, 110px);

  /* ---- 色板（取自参考站）---- */
  --app-bg: #173040;          /* 应用底色 */
  --bg: #173040;              /* 兼容旧名 */
  --bg2: #1d3a4d;             /* 面板底 */
  --bg3: #16303f;             /* 输入框 / 图标底 */
  --hud: #0e2231;             /* 顶栏 */
  --deep: #0a1a26;            /* 最深色：货币条、底栏、日志底 */
  --card-a: #33606f;          /* 卡片渐变上 */
  --card-b: #2b525f;          /* 卡片渐变下 */
  --slot: #245060;            /* 次级卡片 / 选中态 */
  --line: #3f7585;            /* 主描边 */
  --line2: #1f3f52;           /* 弱描边 */
  --line3: #2c5a6e;           /* 分隔线 */

  --gold: #ffd76e;            /* 主色：标题、数值、按钮字 */
  --gold-strong: #ffd76e;     /* 兼容旧名 */
  --cyan: #7ee0ff;            /* 副色：说明、次要数值 */
  --sky: #7ec8ff;             /* 天蓝：系统消息 */
  --green: #7ef29a;           /* 正向：治疗、在线、成功 */
  --red: #ff6a6a;             /* 警示 */
  --red2: #ff5252;            /* 伤害、失败 */
  --pink: #ff9ab5;            /* 强调：分组标题、敌方 */
  --magenta: #e0679a;         /* 标签页选中 */
  --purple: #b26ee0;          /* 技能 */
  --orange: #ffb14e;          /* 押镖 / 挂机按钮 */

  --txt: #e8f2f7;             /* 正文 */
  --dim: #a8cbd8;             /* 次要文字（内联样式里用 var(--dim)） */
  --dim2: #7a9cb0;            /* 更弱 */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--app-bg);
  color: var(--txt);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

body {
  background-image: linear-gradient(#173040, #1d3a4d 30%, #1d3a4d);
  overflow: hidden;
}

a { color: var(--gold); }

/* ---------- 登录 / 注册 / 建号：全屏居中 ---------- */
.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 28%, #1d3a4d 0%, #0a1a26 72%);
}

.card {
  width: 100%;
  max-width: 380px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  box-shadow: none;
}

.title {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
  margin: 0 0 6px;
}

.subtitle {
  text-align: center;
  color: var(--cyan);
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 22px;
}

label { display: block; font-size: 12.5px; color: var(--dim2); margin: 12px 0 6px; }

input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  color: #fff;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  font-family: inherit;
}

textarea { height: auto; padding: 10px 14px; line-height: 1.6; }

input::placeholder, textarea::placeholder { color: #5f8296; }
input:focus, textarea:focus { border-color: var(--cyan); }

button {
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  background: #2a6e8c;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: filter 0.15s;
}

button:active { filter: brightness(1.18); }
button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

/* 主行动按钮：参考站的"描金"渐变 */
button.primary, .btn-gold {
  background: linear-gradient(#c8963c, #a07020);
  border-color: #b8863a;
  color: #fff;
}
/* 参考站的青色渐变按钮（登录页主按钮同款） */
.btn-teal {
  background: linear-gradient(#3f89a8, #2a6e8c);
  border-color: #3f89a8;
  color: #fff;
}

/* 登录页的一排双按钮（参考站 login-btns） */
.login-btns { display: flex; gap: 12px; margin-top: 6px; }
.login-btns button { flex: 1; height: 44px; font-size: 15px; border-radius: 6px; }

button.ghost {
  background: #1c4a5e;
  border: 1px solid var(--line);
  color: var(--cyan);
}

button.small { font-size: 12.5px; padding: 6px 10px; min-height: 32px; }

.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; min-width: 0; }

.hint { color: var(--dim2); font-size: 12.5px; margin-top: 14px; text-align: center; line-height: 1.8; }
.error { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 10px; text-align: center; }
.success { color: var(--green); }

/* 登录页的"游戏特色"说明块（参考站注册页同款） */
.login-feature {
  margin-top: 16px;
  text-align: left;
  background: rgba(10, 20, 30, 0.85);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--txt);
}
.login-feature b { color: var(--red); }
.login-feature .k { color: var(--green); }
.login-contact { margin-top: 10px; text-align: center; color: #bfe6ff; font-size: 12.5px; }
.login-contact b { color: var(--red); font-weight: 700; }

/* ---------- 游戏主界面 ---------- */
.game-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  /* 跟参考站一样把游戏框在手机宽度里居中：电脑上不会拉成一条超长横排 */
  max-width: 640px;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--app-bg);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.55);
}

/* ---------- 顶部 HUD ---------- */
.status-bar {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  background: var(--hud);
  border-bottom: 1px solid var(--deep);
}

/* 第一行：货币 / 场景 / 未分配点数（参考站 hud-res） */
.hud-res {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  font-size: 12px;
  color: #bfe6ff;
  background: var(--deep);
  overflow: hidden;
}
.hud-res .res { white-space: nowrap; flex: 0 0 auto; }
.hud-res .res b { color: var(--gold); font-weight: 600; }
/* 场景名占中间那截，自动居中；长了就省略号，绝不和右边挤在一起 */
.hud-res .zone {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gold);
  font-size: 12px;
  pointer-events: none;
}
.hud-res .online {
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  color: var(--green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-res .online:empty { display: none; }

/* 第二行：头像 + 道号 + 三根条 + 右侧按钮（参考站 hud-main） */
.hud-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 8px;
}

.avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 40%, #2a5a70, #14303f);
  box-shadow: 0 0 8px rgba(255, 215, 110, 0.25);
}

.hud-info { flex: 1 1 auto; min-width: 0; }
.hud-info .nm {
  color: var(--gold);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.4;
  text-shadow: 1px 1px 0 #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-side { display: flex; gap: 6px; flex: 0 0 auto; }
.hud-btn {
  min-width: 58px;
  min-height: 38px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(#d8862c, #a85a10);
  border: 1px solid var(--orange);
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(255, 160, 60, 0.4);
  white-space: nowrap;
}
.hud-btn.green {
  background: #1c5a3e;
  border-color: #3aa56a;
  color: #9af2bd;
  box-shadow: none;
}
.hud-btn.battle-on {
  background: linear-gradient(#c0392b, #8e2318);
  border-color: #ff6a6a;
  color: #ffe0dc;
  box-shadow: 0 0 10px rgba(255, 82, 82, 0.55);
}

/* ---------- 血/蓝/经验条 ---------- */
.bar {
  position: relative;
  height: 15px;
  background: var(--deep);
  border: 1px solid var(--line3);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 3px;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  transition: width 0.25s linear;
}

.bar > span {
  position: absolute;
  inset: 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 13px;
  color: #f4ecd8;
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  letter-spacing: 0.2px;
}

.bar.hp > i { background: linear-gradient(90deg, #8f2f2f, #ff5252); }
.bar.mp > i { background: linear-gradient(90deg, #1f5f8e, #7ee0ff); }
.bar.exp > i { background: linear-gradient(90deg, #8a6418, #ffd76e); }

.status-name { color: var(--gold); font-size: 13.5px; }
.status-scene { color: var(--cyan); }
.dot-points { color: var(--gold); }

/* ---------- 战斗面板 ---------- */
.battle-panel {
  flex: 0 0 auto;
  /* 固定高度：战斗开始/结束都不变，日志区才不会忽大忽小 */
  height: var(--battle-h);
  min-height: var(--battle-h);
  max-height: var(--battle-h);
  overflow-y: auto;
  padding: 8px 12px;
  background: rgba(10, 26, 38, 0.86);
  border-bottom: 1px solid var(--line2);
}

/* 战斗状态条（巡逻中 / 自动 / 定身）——参考站的 fight-status */
.bp-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11.5px;
  color: var(--cyan);
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line2);
}
.bp-mode .m-gold { color: var(--gold); font-weight: 700; }
.bp-mode .m-green { color: var(--green); font-weight: 700; }

/* 活动横幅（整点活动亮起，点击查看） */
.event-banner {
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 12.5px;
  color: #ffe9a8;
  background: linear-gradient(90deg, rgba(120, 70, 10, 0.95), rgba(60, 40, 10, 0.95));
  border-bottom: 1px solid var(--gold);
  cursor: pointer;
  text-align: center;
}
.event-banner.hidden { display: none; }
.event-banner.mail-banner { background: linear-gradient(90deg, rgba(20, 70, 90, 0.95), rgba(15, 40, 60, 0.95)); color: #bfeaff; border-color: #4aa6c8; }
.event-banner.mail-banner b { color: #8fe6ff; }
/* 还没到时候的活动（倒计时）：冷色，不跟"正在抢"的热色混 */
.event-banner.soon {
  background: linear-gradient(90deg, rgba(16, 52, 70, 0.95), rgba(12, 34, 48, 0.95));
  color: #bfe6ff;
  border-color: var(--line);
}
.event-banner b { color: var(--gold); }

/* 战斗单位（旧版横排单位，保留兼容） */
.unit {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}

.unit .uname { flex: 0 0 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit .ubar { flex: 1; min-width: 0; }
.unit .ubar .bar { margin-top: 0; height: 14px; }
.unit.enemy .uname { color: var(--pink); }
.unit.self .uname { color: var(--green); }
.unit.pet .uname { color: var(--sky); }
.unit.dead { opacity: 0.35; text-decoration: line-through; }
.unit .tag { font-size: 11.5px; color: var(--dim2); }

/* 战斗面板：左右两栏（左我方 / 右敌方），单位用血条显示，数值压在血条上 */
.bp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.bp-col { min-width: 0; }
.bp-head {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--green);
  margin-bottom: 1px;
  border-bottom: 1px dashed rgba(126, 242, 154, 0.35);
  padding-bottom: 2px;
}
.bp-head.enemy {
  color: var(--pink);
  border-bottom-color: rgba(255, 154, 181, 0.35);
}
.u-card { margin-bottom: 4px; }
.u-card:last-child { margin-bottom: 0; }
.u-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-size: 11.5px;
  line-height: 1.25;
}
.u-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--txt);
}
.u-tag { flex: 0 0 auto; font-size: 11.5px; color: var(--dim2); }
.u-hp {
  position: relative;
  height: 15px;
  margin-top: 2px;
  background: var(--deep);
  border: 1px solid var(--line3);
  border-radius: 4px;
  overflow: hidden;
}
.u-hp > i {
  display: block;
  height: 100%;
  transition: width 0.2s linear;
}
.u-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 15px;
  line-height: 14px;
  text-align: center;
  font-size: 11.5px;
  color: #f4ead6;
  text-shadow: 0 0 2px #000, 0 0 3px #000;
  letter-spacing: 0.3px;
}
.u-card.enemy .u-name { color: var(--pink); }
.u-card.self .u-name { color: var(--green); }
.u-card.pet .u-name { color: var(--sky); }
.u-card.dead { opacity: 0.4; text-decoration: line-through; }

/* ---------- 文字区（聊天/战报） ---------- */
.log-area {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 14px;
  font-size: 13.5px;
  line-height: 1.8;
  scroll-behavior: smooth;
  background: var(--bg2);
}

.log-line { margin: 2px 0; word-break: break-word; overflow-wrap: anywhere; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55); }
.log-line.system { color: var(--sky); }
.log-line.player { color: var(--gold); }
.log-line.enemy { color: var(--pink); }
.log-line.crit { color: var(--red2); font-weight: 700; }
.log-line.heal { color: var(--green); }
.log-line.levelup { color: var(--gold); font-weight: 700; }
.log-line.chat { color: var(--sky); }
.log-line.quest { color: var(--purple); }
.log-line.dim { color: var(--dim2); }
.log-line.warn { color: var(--red); }
.log-line.pet { color: var(--sky); }
.log-line .t { color: #5a7a8c; font-size: 11.5px; margin-right: 6px; }

/* 文字区里"可点的名字"（NPC）：像小标签，点一下直接开他的对话 */
.npc-links { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.log-npc {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--cyan);
  background: rgba(16, 42, 56, 0.92);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: none;
}
.log-npc:active { filter: brightness(1.35); background: var(--slot); color: #ffe9a8; }

/* ---------- 底部指令栏（参考站 tabbar 的扁平风） ---------- */
.action-bar {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  /* 固定高度：普通按钮栏与技能栏互换时布局不跳 */
  height: var(--bar-h);
  overflow: hidden;
  padding: 8px 8px 10px;
  background: var(--hud);
  border-top: 1px solid var(--deep);
}

.action-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
/* 战斗中底部换成技能栏时**按内容自适应高度**：
   技能数量随等级增长（可能 8 个以上），固定 --bar-h 会在矮屏（360×640）
   把第二行切掉 2~3px。这里保持和原高度一样的 min-height（不会突然变矮），
   最多占半屏（技能特别多时内部滚动，绝不会把日志区挤没）。 */
.action-bar.battle-mode {
  height: auto;
  min-height: var(--bar-h);
  max-height: 52vh;
  overflow-y: auto;
}
/* 菜单页（挑战/功能/排行/设置）：一行 4 个的紧凑按钮
   注意：全局手机检查要求按钮 ≥32px 高、字号 ≥11.5px，所以不能再小了 */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 4px 0 10px;
}
.menu-grid button {
  min-height: 38px;
  padding: 6px 2px;
  font-size: 11.5px;
  line-height: 1.2;
  white-space: normal;
  word-break: break-all;
  color: #bfe6ff;
  background: var(--slot);
  border: 1px solid var(--line);
  border-radius: 6px;
}
/* 按钮里的第二行小字（例如押镖的"押500→900"） */
.menu-grid button i {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--dim2);
  margin-top: 1px;
}
/* 底部按钮上的"小红点"（有东西可领/可做时亮） */
.action-grid button { position: relative; }
.action-grid .dot {
  position: absolute;
  top: 5px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e23a3a;
  box-shadow: 0 0 5px rgba(226, 58, 58, 0.9);
}
.action-grid .dot.hidden { display: none; }
.action-grid button {
  min-height: 38px;
  padding: 8px 2px;
  font-size: 13px;
  line-height: 1.2;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #bfe6ff;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 500;
}
.action-grid button:active { background: var(--slot); color: var(--gold); }
.action-grid button.on { background: var(--slot); color: #ffe9a8; font-weight: 700; }
.action-grid button.wide { grid-column: span 2; }

/* ---------- 技能栏 ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.skill-grid button {
  padding: 4px 2px;
  font-size: 11.5px;
  min-height: 38px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  line-height: 1.15;
  /* 关键：技能名过长时不要折行，否则按钮高度会从 36px 变成 50px，把底部栏挤爆 */
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  background: var(--slot);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.skill-grid button .sk-name {
  display: block;
  font-size: 11.5px;
  color: #ffe9a8;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skill-grid button .sk-cost {
  display: block;
  font-size: 11.5px;
  color: var(--dim2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skill-grid button .cd {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 14, 22, 0.72); border-radius: 5px; color: var(--gold); font-size: 15px;
}
.skill-grid button.auto-on {
  background: linear-gradient(#2f9c6a, #1f7350);
  border-color: #48c98a;
  color: #eafff2;
}
.skill-grid button.auto-on .sk-name, .skill-grid button.auto-on .sk-cost { color: #eafff2; }

/* ---------- 弹层（底部抽屉） ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 20, 0.78);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.modal.hidden { display: none; }

.modal-box {
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg2);
  border-top: 2px solid var(--line);
  border-radius: 14px 14px 0 0;
  padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.5);
}

.modal-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line2);
  padding-bottom: 8px;
}

.modal-title button { padding: 6px 14px; font-size: 13px; }

/* 卡片行（列表项）：参考站 bag-row / mrow 的观感 */
.list-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  margin-bottom: 8px;
  background: linear-gradient(var(--card-a), var(--card-b));
}

.list-item .li-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-item .li-name { color: var(--gold); font-weight: 700; }
.list-item .li-desc { color: var(--dim); font-size: 12.5px; margin-top: 4px; line-height: 1.6; }
.list-item .li-actions {
  /* 所有面板里的按钮统一成"4 列紧凑网格" */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.list-item .li-actions button {
  font-size: 11.5px;
  min-height: 38px;
  padding: 6px 2px;
  white-space: normal;
  word-break: break-all;
  line-height: 1.15;
  color: #fff;
  background: #2a6e8c;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.list-item .li-actions button.ghost { background: #1c4a5e; color: var(--cyan); }
.list-item .li-actions button.primary { background: linear-gradient(#c8963c, #a07020); border-color: #b8863a; color: #fff; }
/* 页签（社交等）也走 4 列紧凑网格 */
.tab-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.tab-grid button {
  min-height: 38px;
  padding: 6px 2px;
  font-size: 11.5px;
  line-height: 1.15;
  color: #bfe6ff;
  background: var(--slot);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.tab-grid button.on { background: var(--magenta); border-color: #f08cb6; color: #fff; font-weight: 700; }
.list-item.selected { border-color: var(--gold); background: linear-gradient(#3d6f7d, #33606f); }

.tag-mini {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 7px;
  border: 1px solid var(--line3);
  border-radius: 4px;
  color: var(--dim);
  background: rgba(10, 26, 38, 0.55);
  margin-right: 6px;
}

.attr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.attr-table th, .attr-table td { padding: 5px 4px; text-align: right; border-bottom: 1px solid var(--line2); }
.attr-table th:first-child, .attr-table td:first-child { text-align: left; }
.attr-table th { color: var(--dim2); font-weight: normal; font-size: 12.5px; }
.attr-table td { color: var(--txt); }
.attr-table td.total { color: var(--gold); }

.alloc-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line2); }
.alloc-row .an { flex: 0 0 60px; color: var(--cyan); }
.alloc-row .av { flex: 1; font-size: 12.5px; color: var(--dim2); }
.alloc-row .av b { color: var(--txt); font-weight: 600; }
.alloc-row button { width: 40px; padding: 6px 0; font-size: 16px; line-height: 1; min-height: 34px; }

.preview { color: var(--gold); font-size: 12.5px; }

.chat-list {
  height: 30vh;
  overflow-y: auto;
  font-size: 13px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--deep);
}
.chat-list div { margin-bottom: 4px; word-break: break-word; }
.chat-list .cf { color: var(--sky); }
.chat-list .ct { color: var(--dim2); font-size: 11.5px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  background: rgba(12, 24, 36, 0.96);
  border: 1px solid var(--line);
  color: #ffe9a8;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 84vw;
  z-index: 90;
  transition: opacity 0.3s;
  text-align: center;
}
.toast.hidden { opacity: 0; pointer-events: none; }

.role-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  margin-bottom: 10px;
  background: linear-gradient(var(--card-a), var(--card-b));
}

.race-cards, .sect-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sect-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 选择卡（种族/门派）：参考站创建角色的头像格 */
.pick-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  background: var(--bg3);
  cursor: pointer;
  font-size: 13.5px;
  color: #bfe6ff;
  min-height: 52px;
}

.pick-card.selected {
  border-color: var(--gold);
  background: #1f4a5c;
  color: var(--gold);
  box-shadow: 0 0 8px rgba(255, 215, 110, 0.55);
}
.pick-card .pc-desc { display: block; font-size: 11.5px; color: var(--dim2); margin-top: 4px; }

.scroll-y { overflow-y: auto; }

/* 无战斗时战斗面板里的占位卡片（保持高度稳定，同时不浪费这块地方） */
.idle-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  gap: 4px;
}
.idle-card .ic-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}
.idle-card .ic-scene { color: var(--cyan); font-size: 12.5px; font-weight: 400; }
.idle-card .ic-desc { color: var(--dim); font-size: 12.5px; line-height: 1.6; }
.idle-card .ic-tip { color: var(--dim2); font-size: 12px; margin-top: 4px; }
/* 空档信息格：气血/魔法/战力/银两（面板高度固定，空着也是空着） */
.idle-card .ic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin-top: 6px;
}
.idle-card .ic-cell {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  padding: 3px 8px;
  min-width: 0;
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: rgba(16, 42, 56, 0.55);
  font-size: 11.5px;
}
.idle-card .ic-cell .k { color: var(--dim2); flex: 0 0 auto; }
.idle-card .ic-cell .v {
  color: var(--cyan);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 战斗浮层里的技能格：比底部栏更大，好点 */
.modal-body .skill-grid { margin-top: 4px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.modal-body .skill-grid button { min-height: 46px; font-size: 12.5px; }
.modal-body .skill-grid button .sk-name { font-size: 12.5px; }
.modal-body .skill-grid button .sk-cost { font-size: 11.5px; }

/* ---------- 状态面板紧凑版 ---------- */
.modal-body.compact-sum { font-size: 12.5px; }
.modal-body.compact-sum .sum-head {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  padding-bottom: 6px; border-bottom: 1px solid var(--line2);
}
.modal-body.compact-sum .sum-head b { color: var(--gold); }
.modal-body.compact-sum .sec { color: var(--pink); font-size: 12.5px; font-weight: 700; margin: 10px 0 4px; }
.modal-body.compact-sum .sec .sub { color: var(--dim2); font-weight: normal; }

/* 分组小标题（面板内通用） */
.sec { color: var(--pink); font-size: 12.5px; font-weight: 700; margin: 10px 0 5px; }
.sec .sub { color: var(--dim2); font-weight: normal; }

/* 六项属性：3 列 2 行 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 8px; }
.stat-grid .sg { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line2); }
.stat-grid .sg span:first-child { color: var(--dim2); }
.stat-grid .sg .v { color: var(--txt); }
.stat-grid .sg .up { color: var(--gold); }
/* 加点行：一行装下 */
.alloc-line { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line2); }
.alloc-line .an { flex: 0 0 34px; color: var(--cyan); }
.alloc-line .av { flex: 1; color: var(--dim2); font-size: 12px; }
.alloc-line .av b { color: var(--txt); font-weight: 600; }
.alloc-line .av .dl { color: var(--gold); }
.alloc-line button { width: 30px; padding: 3px 0; font-size: 15px; line-height: 1.1; }
/* 折叠区 */
.fold { border-top: 1px solid var(--line2); margin-top: 8px; }
.fold > .fold-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; color: var(--gold); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.fold > .fold-body { display: none; padding-bottom: 6px; }
.fold.open > .fold-body { display: block; }
.fold .caret { color: var(--dim2); }
/* 关系紧凑行 */
.rel-line { padding: 3px 0; border-bottom: 1px solid var(--line2); }
.rel-line .who { color: var(--txt); }
.rel-line .meta { color: var(--dim2); font-size: 12px; }

/* ---------- 背包（参考站格局：分类签 + 货币条 + 图标卡片行） ---------- */
.bag-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 8px;
}
.bag-tabs { display: flex; gap: 6px; flex: 0 1 auto; min-width: 0; }

/* 左边那排"页签"：包裹是当前页，一键卖白装是动作 */
.btab {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 13px;
  min-height: 34px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: #2a6e8c;
  white-space: nowrap;
}
.btab.on { background: var(--magenta); border-color: #f08cb6; }
.btab.sell { background: #5a4a8c; border-color: #8a76c8; font-weight: 500; }

/* 右边那排分类签：装备 / 道具 / 其他 */
.bag-filters { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.bchip {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 10px;
  min-height: 34px;
  font-size: 12px;
  color: #fff;
  background: #245060;
  white-space: nowrap;
}
.bchip.bc-prop { background: #2a6e5c; border-color: #3aa56a; }
.bchip.bc-other { background: #4a3f74; border-color: #8a76c8; }
.bchip.on { box-shadow: 0 0 0 1px #ffe9a8 inset; filter: brightness(1.22); font-weight: 700; }

/* 货币条 */
.bag-cur {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 6px 12px;
  background: rgba(16, 42, 56, 0.6);
  border: 1px solid var(--line2);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--cyan);
}
.bag-cur b { color: var(--gold); }
.bag-cur-n { margin-left: auto; color: var(--dim2); font-size: 11.5px; }
.bag-hint { color: var(--dim); font-size: 11.5px; line-height: 1.65; margin: 0 0 8px; }

/* 背包的物品列表改成一行 4 件的小卡后（跟商店同一套），
   原来那套"图标行 + 右侧一排按钮"（.bag-row/.bico/.binfo/.bname/.bdesc/.bmeta/.bbtns）已删除。 */

/* ---------- 商店 / 背包：一行四件共用的紧凑小卡 ----------
   （背包也用这一套：卡面只放名字/数量/等级 + 一个主按钮，点开看说明与全部操作） */
.shop-grid, .bag-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}
.shop-card, .bag-tile {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 7px 6px 8px;
  background: linear-gradient(var(--card-a), var(--card-b));
  border: 1px solid var(--line);
  border-radius: 6px;
}
/* 背包格子同时带着 .list-item，这里把它的下边距去掉，不然网格会被拉开 */
.list-item.bag-tile { margin-bottom: 0; padding: 7px 6px 8px; }
/* 卡面（名字/价格/数量）整块可点：点开看说明与属性 */
.sc-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  cursor: pointer;
  border-radius: 4px;
}
.sc-body:active { background: rgba(126, 224, 255, 0.14); }
.sc-name {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 数量：跟在名字后面，不另起一行（"玉项链 ×4"） */
.sc-name .bsub {
  margin-left: 3px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--pink);
}
.sc-price {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--dim2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-note.owned { color: var(--green); }
/* 底部主按钮：压在卡片底部，宽度撑满 */
.shop-card > button, .bag-tile > button {
  margin-top: auto;
  width: 100%;
  min-height: 34px;
  padding: 4px 2px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(#c8963c, #a07020);
  border: 1px solid #b8863a;
  border-radius: 4px;
  white-space: nowrap;
}
.shop-card > button:disabled, .bag-tile > button:disabled {
  background: #245060;
  border-color: var(--line);
  opacity: 0.5;
}
/* 背包的主按钮是"日常操作"（使用/装备/出售），不用金色 CTA，避免一屏金子 */
.bag-tile > button {
  background: #2a6e8c;
  border-color: var(--line);
  color: #fff;
}

/* ---------- 赞助礼包（累计礼包面板） ---------- */
.sp-progress {
  margin: 2px 0 10px;
  padding: 8px 10px;
  background: rgba(16, 42, 56, 0.6);
  border: 1px solid var(--line2);
  border-radius: 6px;
}
.sp-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
}
.sp-line .sp-next { color: var(--cyan); font-weight: 500; }
.sp-bar {
  position: relative;
  height: 10px;
  margin-top: 6px;
  background: var(--deep);
  border: 1px solid var(--line3);
  border-radius: 5px;
  overflow: hidden;
}
.sp-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b8863a, #ffd76e);
  transition: width 0.3s linear;
}
/* 一张礼包卡 */
.sp-card.ready { border-color: var(--gold); background: linear-gradient(#3d6f7d, #33606f); }
.sp-card.done { opacity: 0.72; }
/* 奖励要点：小标签自动换行 */
.sp-rw {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
}
.sp-rw span {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--cyan);
  background: rgba(10, 26, 38, 0.55);
  border: 1px solid var(--line2);
  border-radius: 4px;
}
.sp-act {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
}
.sp-act button {
  min-height: 36px;
  min-width: 92px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(#c8963c, #a07020);
  border: 1px solid #b8863a;
  border-radius: 5px;
}

/* ---------- 修仙月卡面板 ---------- */
.mc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  margin: 2px 0 8px;
  padding: 8px 10px;
  background: rgba(16, 42, 56, 0.6);
  border: 1px solid var(--line2);
  border-radius: 6px;
  font-size: 12.5px;
}
.mc-head .mc-state { color: var(--dim2); font-weight: 700; }
.mc-head .mc-state.on { color: var(--gold); }
.mc-head .mc-price { color: var(--cyan); }
/* 特权清单：一行一条"平时 → 月卡" */
.mc-perks { display: flex; flex-direction: column; gap: 2px; }
.mc-perk {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(63, 117, 133, 0.35);
  font-size: 12px;
}
.mc-perk:last-child { border-bottom: 0; }
.mc-perk .mp-k { color: var(--dim); }
.mc-perk .mp-v { display: flex; align-items: baseline; gap: 6px; }
.mc-perk .mp-now { color: var(--dim2); }
.mc-perk .mp-v b { color: var(--line); font-weight: 400; }
.mc-perk .mp-card { color: var(--gold); font-weight: 700; }
/* 聊天里的月卡标识 */
.mc-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  font-size: 11px;
  font-style: normal;
  line-height: 1.5;
  color: #2a1c05;
  background: linear-gradient(#ffd76e, #c8963c);
  border-radius: 3px;
  vertical-align: 1px;
}

/* 四张卡的状态条 */
.mc-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 6px 0 10px;
}
.mc-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 12px;
  background: rgba(10, 26, 38, 0.5);
  border: 1px solid var(--line2);
  border-radius: 5px;
  color: var(--dim2);
}
.mc-card.on { border-color: var(--cyan); color: var(--text); }
.mc-card.top { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255, 215, 110, 0.25) inset; }
/* 可以点：点哪张，下面就是哪张的日包与特权 */
.mc-card { cursor: pointer; user-select: none; }
.mc-card:active { transform: scale(0.99); }
.mc-card.sel { background: rgba(126, 224, 255, 0.14); border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.mc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
  flex: 0 0 auto;
}
.mc-card .mc-badge {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 11px;
  color: #2a1c05;
  background: linear-gradient(#ffd76e, #c8963c);
  border-radius: 4px;
  flex: 0 0 auto;
}
.mc-card .mc-name { font-weight: 700; }
.mc-card .mc-day { margin-left: auto; color: var(--cyan); font-size: 11.5px; }
/* 四种卡对比表（窄屏横向滚动） */
.mc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mc-table th, .mc-table td {
  padding: 4px 5px;
  border-bottom: 1px dashed rgba(63, 117, 133, 0.35);
  text-align: right;
  white-space: nowrap;
}
.mc-table th:first-child, .mc-table td:first-child { text-align: left; color: var(--dim); }
.mc-table th { color: var(--gold); font-weight: 700; }

/* ---------- 战斗操作：右侧圆形菜单（2026-10-18） ----------
   只在战斗中出现在日志区右侧：中间是【菜 单】，点一下展开一圈战斗按钮。
   按钮用 inline transform 摆位（layoutFan() 算角度），这里只管样子与动画。 */
.battle-fan {
  /* 圆心位置由 layoutFan() 按日志区实时算（top / right 都写在 inline style 上），
     这里只给个兜底，免得脚本没跑到时挤在角落 */
  position: fixed;
  right: 54px;
  bottom: calc(var(--bar-h) + 120px);
  width: 0;
  height: 0;
  z-index: 45;
}
.battle-fan .fan-btn {
  position: absolute;
  left: 0;
  top: 0;
  margin: -25px 0 0 -25px;
  width: 50px;
  height: 50px;
  padding: 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11.5px;
  line-height: 1.15;
  border-radius: 50%;
  background: linear-gradient(#3d6f7d, #2c5563);
  border: 1px solid var(--line2);
  color: var(--text);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(0, 0) scale(0.6);
  pointer-events: none;
  transition: transform 0.16s ease-out, opacity 0.16s ease-out;
}
.battle-fan .fan-btn .sk-name { font-size: 11.5px; font-weight: 700; }
.battle-fan .fan-btn .sk-cost { font-size: 9.5px; color: var(--dim2); }
.battle-fan .fan-btn[disabled] { opacity: 0.55; }
.battle-fan .fan-btn.auto-on {
  background: linear-gradient(#2f8f57, #1f6b3f);
  border-color: #43b877;
  color: #eafff1;
}
/* 中间的菜单按钮：一直在 */
.battle-fan .fan-menu {
  margin: -32px 0 0 -32px;
  width: 64px;
  height: 64px;
  font-size: 13px;
  font-weight: 700;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  color: #2a1c05;
  background: linear-gradient(#ffd76e, #c8963c);
  border-color: #b8863a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.battle-fan .fan-menu::after {
  content: '▸';
  position: absolute;
  bottom: 4px;
  right: 7px;
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.16s ease-out;
}
.battle-fan.open .fan-menu::after { transform: rotate(180deg); }
/* 展开：一圈按钮淡入+弹到位（位置来自 inline transform 的 translate） */
.battle-fan.open .fan-btn:not(.fan-menu) {
  opacity: 1;
  pointer-events: auto;
}

/* 底部【巡 逻】按钮在巡逻中时高亮一下（2026-10-18） */
#normalBar button.patrol-on {
  color: #7ef29a;
  font-weight: 700;
}

/* ---------- 面板内的"可领取"小红点（2026-10-20） ----------
   挂在具体按钮上：按钮右上角一个小红点，领完就消失。
   底部导航那排用的是 .action-grid .dot（老样式，保持不变）。 */
.menu-grid button,
.tab-grid button,
.list-item .li-actions button,
.list-item { position: relative; }
.menu-grid .dot,
.tab-grid .dot,
.li-actions .dot {
  position: absolute;
  top: 3px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e23a3a;
  box-shadow: 0 0 6px rgba(226, 58, 58, 0.9);
  pointer-events: none;
}

/* ---------- 打造：一行 2 个（2026-10-18 玩家要求） ---------- */
.craft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.craft-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px;
  min-width: 0;
}
.craft-card .cc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}
.craft-card .cc-name {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.craft-card .cc-lv { flex: 0 0 auto; font-size: 11px; color: var(--dim2); }
.craft-card .cc-attr { font-size: 11.5px; line-height: 1.45; color: var(--cyan); }
.craft-card .cc-set { font-size: 11px; color: var(--gold); }
.craft-card .cc-mat { font-size: 11px; line-height: 1.5; word-break: break-all; }
.craft-card .cc-price { font-size: 11px; color: var(--dim2); }
.craft-card .cc-block { font-size: 10.5px; line-height: 1.4; color: #ff9a9a; }
.craft-card button {
  width: 100%;
  margin-top: auto;
  min-height: 34px;
  font-size: 13px;
}

/* ---------- 传送面板：一行 3 个地图卡片 ---------- */
.tp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.tp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  min-width: 0;
  padding: 8px 3px 7px;
  border-radius: 6px;
  background: linear-gradient(var(--card-a), var(--card-b));
  border: 1px solid var(--line);
  color: var(--txt);
  font-family: inherit;
  line-height: 1.25;
}
.tp-card .tp-name {
  max-width: 100%;
  font-size: 12.5px;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-card .tp-tag { font-size: 11.5px; color: var(--dim2); }
.tp-card .tp-info { font-size: 11.5px; color: var(--dim2); min-height: 12px; }
.tp-card .tp-go {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--cyan);
  border-top: 1px solid var(--line3);
  padding-top: 3px;
  width: 100%;
  text-align: center;
}
.tp-card.locked { opacity: 0.55; }
.tp-card.locked .tp-go { color: var(--dim2); border-top-color: var(--line2); }

/* 当前场景的人：只列名字（一行 3 个），点名字再看介绍与操作 */
.npc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.npc-chip {
  padding: 10px 4px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--gold);
  background: linear-gradient(var(--card-a), var(--card-b));
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 每日活跃：档位奖励一条一行 ---------- */
.act-tier {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  background: rgba(16, 42, 56, 0.55);
  font-size: 12px;
  line-height: 1.3;
}
.act-tier.ready { border-color: var(--gold); background: rgba(60, 45, 20, 0.55); }
.act-tier.claimed { opacity: 0.62; }
.act-tier .at-pts {
  flex: 0 0 auto;
  min-width: 30px;
  text-align: right;
  color: var(--gold);
  font-size: 13px;
}
.act-tier .at-pts::after { content: ' 点'; font-size: 11.5px; color: var(--dim2); }
.act-tier .at-rw {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--dim);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.act-tier .at-st { flex: 0 0 auto; color: var(--dim2); font-size: 11.5px; }
.act-tier .at-st.done { color: var(--green); }

/* ---------- 帮派商店：一件商品一张小卡片，一行 3 个 ---------- */
.gs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.gs-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  padding: 7px 3px 6px;
  border-radius: 6px;
  background: linear-gradient(var(--card-a), var(--card-b));
  border: 1px solid var(--line);
  color: var(--txt);
  font-family: inherit;
  line-height: 1.25;
}
.gs-card .gs-name {
  max-width: 100%;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-card .gs-cost { font-size: 11.5px; color: var(--gold); }
.gs-card .gs-left { font-size: 11.5px; color: var(--dim2); }
.gs-card .gs-go {
  margin-top: 3px;
  width: 100%;
  padding-top: 3px;
  border-top: 1px solid var(--line3);
  font-size: 11.5px;
  color: var(--cyan);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-card.locked { opacity: 0.55; }
.gs-card.locked .gs-go { color: var(--dim2); border-top-color: var(--line2); font-size: 11.5px; }

/* ---------- 数字选择（卖出/购买数量）：居中大输入 ---------- */
.qty-box {
  text-align: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--bg3);
  padding: 14px 12px;
}
.qty-box input { text-align: center; font-size: 16px; }

/* ==========================================================================
   手机端适配（2026-10-13 加：家里人一直在手机上玩，专门量过一遍）
   量出来的问题与对策：
   ① 顶部小按钮只有 18px 高、指令栏按钮 32px —— 手指点不准 → 全部加高
   ② 没留安全区 —— 刘海屏/手势条会挡住底部按钮 → 用 env(safe-area-inset-*)
   ③ 弹窗用 86vh —— 手机地址栏一收一放会跳 → 改用 dvh（不支持的浏览器自动退回 vh）
   ④ 有些说明字只有 10px —— 手机上看着费劲 → 手机端兜到 11.5px
   ⑤ 指令栏两排按钮变高后高度要跟着涨，否则会被裁掉
   只在窄屏生效，电脑上的排版完全不变。
   ========================================================================== */
@media (max-width: 480px) {
  :root {
    /* 两排 42px 按钮 + 间距 6 + 上下内边距 20 = 110，留点余量防裁切 */
    --bar-h: clamp(112px, 15vh, 148px);
    --battle-h: clamp(120px, 20vh, 180px);
  }

  /* 安全区：刘海屏顶部、手势条底部 */
  .status-bar { padding-top: calc(env(safe-area-inset-top)); }
  .action-bar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  }
  .modal-box { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

  /* 顶部按钮：抬到 38px 以上，手指点得准 */
  .hud-btn {
    min-height: 38px;
    min-width: 54px;
    padding: 4px 8px;
    font-size: 12.5px !important;
  }

  /* 指令栏与战斗按钮：44px 的触摸标准的一半以上，行高够不挤 */
  .action-grid { gap: 6px; }
  .action-grid button { min-height: 42px; font-size: 13px; }
  .skill-grid button { min-height: 44px; }
  .action-bar { padding-left: 8px; padding-right: 8px; }

  /* 弹窗：底部抽屉别超过屏幕（dvh 跟着地址栏收放走），关闭按钮够大 */
  .modal-box {
    max-height: 88dvh;
    padding-left: 12px;
    padding-right: 12px;
  }
  @supports not (height: 1dvh) {
    .modal-box { max-height: 88vh; }
  }
  /* 关闭/返 回：面板里最重要的按钮，给到 38px（button.small 那条别把它压回去） */
  .modal-title button, .modal-title button.small { min-height: 38px; padding: 8px 16px; font-size: 13.5px; }

  /* 面板里的小按钮（放弃/刷新之类）也要点得准 */
  .list-item .li-actions button { min-height: 38px; }
  .menu-grid button, .tab-grid button { min-height: 38px; }
  button.small { min-height: 34px; font-size: 13px; }

  /* 字号兜底：手机上不出现 10px 的说明字 */
  .li-desc, .tag-mini, .gs-card .gs-left, .gs-card .gs-cost, .gs-card .gs-go, .gs-card.locked .gs-go,
  .u-tag, .tp-card .tp-tag, .tp-card .tp-info, .tp-card .tp-go, .act-tier .at-pts::after, .act-tier .at-st,
  .unit .tag, .modal-body .skill-grid button .sk-cost { font-size: 11.5px !important; }
  .log-line { font-size: 13.5px; }
  .modal-body.compact-sum { font-size: 13px; }
  .modal-body.compact-sum .sec { font-size: 13px; }
}
