/* ════════════════════════════════════════════════════════════════
   风体经营模拟器 · 手机版样式（独立路由 /m）
   设计语言：大厂移动端标准（类微信 / 支付宝）
   - 统一设计令牌（颜色 / 间距 / 圆角 / 阴影 / 安全区）
   - 顶部栏毛玻璃吸顶、底部 tab 安全区、44px 触控目标
   - 为 V.* 渲染层（对手 / KPI / 政策 / 事件 / 预算 / 结算 / 复盘）补全移动端样式
   ════════════════════════════════════════════════════════════════ */

:root {
  /* 表面 */
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --border: #ebedf0;
  --border-strong: #d8dce3;
  --placeholder: #b7bcc6;

  /* 文字 */
  --text: #1a1d24;
  --text-2: #51565f;
  --muted: #9aa0ab;

  /* 品牌色 */
  --primary: #3a6df0;
  --primary-dark: #2a55d6;
  --primary-soft: #eaf0ff;
  --primary-contrast: #ffffff;

  /* 语义色（涨=红 / 跌=绿，遵循中文行情惯例） */
  --success: #18a058;
  --success-soft: #e8f7ee;
  --danger: #e0483b;
  --danger-soft: #fdecea;
  --warning: #e08a00;
  --warning-soft: #fff4e0;
  --info: #2a9bd6;
  --info-soft: #e6f4fb;
  --gold: #c08a2d;

  /* 兼容旧内联引用 */
  --down: var(--success);
  --up: var(--danger);
  --warn: var(--warning);
  --warn-soft: var(--warning-soft);
  --brand: var(--primary);

  /* 圆角 */
  --r-lg: 16px;
  --r: 12px;
  --r-sm: 9px;
  --r-pill: 999px;

  /* 间距 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(20,28,48,.04), 0 2px 8px rgba(20,28,48,.05);
  --sh-2: 0 6px 20px rgba(20,28,48,.10);
  --sh-pop: 0 12px 40px rgba(20,28,48,.22);

  /* 安全区 */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--text); } /* 16px 避免 iOS 聚焦缩放 */
a { color: var(--primary); }

#m-app {
  position: relative;
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(20,28,48,.03);
}
[hidden] { display: none !important; }

/* ── 通用文字态 ─────────────────────────────── */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.m-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.m-wait { text-align: center; color: var(--muted); font-size: 14px; margin: 18px 0; }
.m-guest-only { display: block; }

/* 涨=红 / 跌=绿 */
.good, .pos, .up { color: var(--danger); }
.neg, .down { color: var(--success); }
.warn { color: var(--warning); }

/* ── 按钮系统（≥44px 触控目标）─────────────── */
.m-btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--r);
  min-height: 46px; padding: 12px 16px; font-size: 15.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .06s ease, background .15s, opacity .15s, box-shadow .15s;
  user-select: none;
}
.m-btn:active { transform: scale(.98); }
.m-btn-block { width: 100%; }
.m-btn-lg { padding: 15px 18px; font-size: 16.5px; }
.m-btn-sm, .m-btn-small { min-height: 38px; padding: 9px 14px; font-size: 14px; border-radius: var(--r-sm); }
.m-btn-primary { background: var(--primary); color: var(--primary-contrast); box-shadow: 0 4px 12px rgba(58,109,240,.28); }
.m-btn-primary:active { background: var(--primary-dark); }
.m-btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.m-btn-ghost:active { background: var(--surface-2); }
/* 进房选择弹窗：进度过 1/3 时禁用「游戏者」按钮 */
.m-btn:disabled, .m-btn.disabled { opacity: .5; cursor: not-allowed; }
.jc-hint { color: #ff6b6b; margin-top: 4px; }
.m-btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f6c9c5; }
.m-btn-text { background: transparent; color: var(--muted); border-color: transparent; min-height: 42px; }
.m-btn-text:active { background: var(--surface-2); }
.m-btn:disabled, .m-btn[disabled] { opacity: .5; pointer-events: none; }

/* 主行动按钮（准备就绪 / 提交） */
.m-btn-ready { background: linear-gradient(135deg, #3a6df0, #5b86f5); color: #fff; box-shadow: 0 6px 16px rgba(58,109,240,.32); }
.m-btn-ready:active { filter: brightness(.96); }

.m-icon-btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); border-radius: 10px; padding: 8px 12px; font-size: 15px; font-weight: 600;
  min-height: 38px; display: inline-flex; align-items: center; gap: 5px; transition: background .15s, opacity .15s;
}
.m-icon-btn:active { background: var(--surface-2); opacity: .8; }

.m-status { text-align: center; color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ── 表单 ─────────────────────────────── */
.m-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.m-field:last-child { margin-bottom: 0; }
.m-field > label, .m-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.m-input {
  width: 100%; min-height: 46px; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.m-input::placeholder { color: var(--placeholder); }
.m-input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
select.m-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0ab' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.m-input-num { width: 64px; min-width: 64px; text-align: center; flex: 0 0 auto; }
.m-code-input { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; text-align: center; }
.m-code-row { display: flex; gap: 10px; align-items: stretch; }
.m-code-row .m-input { flex: 1; }

/* ── 视图容器 ─────────────────────────────── */
.m-view { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
#m-home { min-height: 100dvh; }
#m-lobby { height: 100dvh; min-height: 0; }
#m-game { height: 100dvh; min-height: 0; padding: 0; }

/* ── 通用卡片 / 标题 ─────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px;
}
.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; }
.m-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.m-card-head h3 { margin: 0; font-size: 16px; }
.m-card-title { font-size: 14.5px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }

/* 复用桌面渲染层 V.* 用的通用类 */
.btn { appearance: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 9px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; transition: .14s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { background: var(--surface-2); }
.btn-lg { padding: 13px 18px; font-size: 16px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-small { padding: 7px 12px; font-size: 13.5px; }

/* ── 顶部 HUD（首页 + 大厅共用，毛玻璃吸顶）── */
.m-hud {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.m-hud-left { display: flex; align-items: center; }
.m-hud-right { display: flex; align-items: center; gap: 8px; }
.m-net-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; transition: background .2s; }
.m-net-dot.on { background: var(--success); }
.m-net-text { font-size: 13px; color: var(--text-2); font-weight: 600; }
.m-icon-pill { display: inline-flex; align-items: center; gap: 4px; }

/* ── 首页 ─────────────────────────────── */
.m-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--primary); background: var(--primary-soft);
  padding: 4px 11px; border-radius: var(--r-pill);
}
.m-home-wrap { display: flex; flex-direction: column; gap: 18px; padding: 20px 16px calc(24px + var(--safe-b)); }
.m-home-left { display: flex; flex-direction: column; gap: 6px; }
.m-title { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.m-sub { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.m-home-right { display: flex; flex-direction: column; gap: 14px; }

.m-games { display: flex; flex-direction: column; gap: 10px; }
.m-game-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 14px; border: 1.5px solid var(--border); border-radius: var(--r);
  background: var(--surface); transition: border-color .15s, background .15s;
}
.m-game-opt.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(58,109,240,.12); }
.m-game-opt .go-icon { font-size: 24px; width: 34px; text-align: center; flex: none; }
.m-game-opt .go-main { display: flex; flex-direction: column; }
.m-game-opt .go-main b { font-size: 15px; }
.m-game-opt .go-main span { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 图标控制台 */
.m-icon-console { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-ico-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 18px 8px; border: 1.5px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface); font-size: 13.5px; font-weight: 700; color: var(--text);
  transition: transform .06s, background .15s, border-color .15s;
}
.m-ico-btn:active { transform: scale(.97); background: var(--surface-2); }
.m-ico { font-size: 26px; line-height: 1; }
.m-ico-label { font-size: 13.5px; }
.m-ico-primary {
  grid-column: span 2; background: linear-gradient(135deg, #3a6df0, #5b86f5); border-color: transparent; color: #fff;
  flex-direction: row; gap: 10px; padding: 16px; box-shadow: 0 6px 16px rgba(58,109,240,.28);
}
.m-ico-primary .m-ico { font-size: 22px; }

/* ── 大厅 ─────────────────────────────── */
.m-lobby-wrap { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.m-lobby-left, .m-lobby-right { display: flex; flex-direction: column; gap: 12px; }
.m-lobby-bar {
  padding: 10px 14px calc(10px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--border); flex: 0 0 auto;
}

.m-pill {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px 10px;
}
.m-pill.primary { color: var(--primary); background: var(--primary-soft); border-color: transparent; }

/* 席位 */
.m-seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seat { display: flex; align-items: center; gap: 12px; }
.seat-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 17px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.seat-main { flex: 1; min-width: 0; }
.seat-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 600; }
.seat-name .nm { font-size: 14.5px; }
.seat-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.seat-empty, .seat-more { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* 标签 */
.m-tag, .tag {
  font-size: 11px; font-weight: 700; padding: 1.5px 7px; border-radius: var(--r-pill); line-height: 1.7; white-space: nowrap;
}
.tag-human { background: var(--success-soft); color: var(--success); }
.tag-super { background: var(--primary-soft); color: var(--primary); }
.tag-mimic { background: var(--warning-soft); color: var(--warning); }
.tag-host { background: var(--danger-soft); color: var(--danger); }
.tag-spectator { background: var(--surface-3); color: var(--text-2); }
.tag-ready { background: var(--success-soft); color: var(--success); }
.tag-fog { background: var(--surface-3); color: var(--muted); }

/* 人机按钮 */
.m-bot-group { margin-bottom: 16px; }
.m-bot-group:last-child { margin-bottom: 0; }
.m-bot-group-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.m-bot-group-title b { font-size: 14.5px; }
.m-bot-batch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.m-bot-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.m-bot-btn {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; width: 100%;
  padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); transition: border-color .15s, background .15s;
}
.m-bot-btn:active { background: var(--surface-2); border-color: var(--primary); }
.m-bot-btn b { font-size: 14px; }
.m-bot-btn span { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* 行业信息 */
.m-industry-info { margin-top: 10px; }
.ii-tag { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.ii-tag b { color: var(--primary); }
.ii-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ii-grid > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; }
.ii-grid span { font-size: 11px; color: var(--muted); }
.ii-grid b { font-size: 14px; margin-top: 2px; }
.m-toggles { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.m-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.m-toggle input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }

/* ── 对局视图：头部 / 底部 ──────────────── */
.m-game-head {
  position: sticky; top: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 5px;
  padding: calc(7px + var(--safe-t)) 11px 7px;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.m-game-row { display: flex; align-items: center; gap: 8px; }
.m-game-row2 { flex-wrap: wrap; }
.m-game-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.m-game-code { font-size: 12px; color: var(--muted); white-space: nowrap; }
.m-game-code b { color: var(--text); font-family: var(--mono); letter-spacing: .03em; }
.m-game-phase { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-game-round { font-size: 12px; color: var(--primary); font-weight: 600; white-space: nowrap; flex: 0 0 auto; }

.m-timer {
  display: inline-flex; align-items: center; margin-left: 0;
  padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; color: var(--text-2);
}
.m-timer.urgent { background: var(--danger-soft); border-color: #f6c9c5; color: var(--danger); animation: m-pulse 1s infinite; }
@keyframes m-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.m-game-ready { font-size: 12.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.m-game-ready.all-ready { color: var(--success); }
.m-net { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.m-net i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; transition: background .2s; }
.m-net.on { color: var(--success); }
.m-net.on i { background: var(--success); }
/* 头部第 2 行：聊天按钮推到最右（对局顶栏已移除规则按钮） */
.m-game-row2 #mg-chat { margin-left: auto; }

/* 提交进度点 */
.m-submit-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.sp-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); display: inline-block; transition: background .2s; }
.sp-dot.done { background: var(--success); }
.sp-dot.me { box-shadow: 0 0 0 2px var(--primary); }
.sp-dot.off { background: var(--muted); opacity: .5; }

/* 主体滚动区 */
.m-game-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; display: flex; flex-direction: column; gap: 12px; }

/* 底部：行动按钮 + 常驻 tab 栏 */
.m-game-bottom { flex: 0 0 auto; background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-direction: column; }
#mg-ready, #mg-foot { order: 1; padding: 10px 14px calc(6px + var(--safe-b)); }
#mg-foot .m-btn { width: 100%; }
#mg-foot:empty { display: none; }
.m-game-nav { order: 2; display: flex; border-top: 1px solid var(--border); padding-bottom: var(--safe-b); }
.m-nav-btn {
  flex: 1; appearance: none; border: none; background: var(--surface); position: relative;
  padding: 9px 4px calc(7px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; color: var(--text-2); font-weight: 600; transition: color .15s, background .15s;
}
.m-nav-btn .m-nav-ico { font-size: 19px; line-height: 1; filter: grayscale(.2); }
.m-nav-btn:active { background: var(--surface-2); }
.m-nav-btn.active { color: var(--primary); background: var(--primary-soft); }
.m-nav-btn.active .m-nav-ico { filter: none; }
/* 未读气泡（聊天 tab / 大厅聊天按钮） */
.m-nav-badge {
  position: absolute; top: 3px; right: 50%; margin-right: -22px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--surface);
}
.m-icon-btn { position: relative; }
.m-icon-btn .m-nav-badge { top: -4px; right: -4px; margin-right: 0; }

/* 折叠面板 */
.m-fold { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 14px; box-shadow: var(--sh-1); }
.m-fold > summary { list-style: none; cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.m-fold > summary::-webkit-details-marker { display: none; }
.m-fold > summary::after { content: "▾"; color: var(--muted); transition: .15s; }
.m-fold[open] > summary::after { transform: rotate(180deg); }
.m-fold > div { padding-bottom: 12px; }

/* 反馈条 */
.m-feedback { border-radius: var(--r); padding: 12px; font-size: 14px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.m-feedback.ok { background: var(--success-soft); color: var(--success); }
.m-feedback.neg { background: var(--danger-soft); color: var(--danger); }
.m-feedback.warn { background: var(--warning-soft); color: var(--warning); }

/* ════════════════ V.* 内容组件（移动端补全）═══════════════ */

/* KPI 网格 */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .k { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi.wide { grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 8px; }
.kpi.wide .k { white-space: normal; }
.kpi.wide .v { font-size: 13.5px; text-align: right; }
.kpi.alert .v { color: var(--danger); }
.kpi.info .v { color: var(--info); }

/* 净资产走势 */
.m-spark { margin-top: 2px; }
.m-spark svg { display: block; width: 100%; height: auto; }
.spark-cap { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.spark-cap .up, .spark-cap .down { font-weight: 700; }

/* 对手列表 */
.rivals { display: flex; flex-direction: column; gap: 8px; }
.rival { display: flex; align-items: center; gap: 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.rival.me { border-color: var(--primary); background: var(--primary-soft); }
.rival.dim { opacity: .55; }
.rival.fogged .rival-sub { font-style: italic; }
.rival-av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; }
.rival-main { flex: 1; min-width: 0; }
.rival-name { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-weight: 700; font-size: 14px; }
.dotstate { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.dotstate.off { background: var(--muted); }
.rival-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.rival-val { text-align: right; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; flex: 0 0 auto; }
.rival-val small { display: block; font-weight: 600; font-size: 11px; color: var(--muted); }
.fog-note { font-size: 12.5px; color: var(--info); background: var(--info-soft); border-radius: var(--r-sm); padding: 8px 10px; margin-bottom: 4px; }
.more-note { font-size: 12px; color: var(--muted); text-align: center; padding: 6px 0; }

/* 市场走势 */
.market-trend { display: flex; flex-direction: column; gap: 7px; }
.trend-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.trend-r { width: 30px; color: var(--muted); flex: 0 0 auto; }
.trend-bar { flex: 1; height: 10px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.trend-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5b86f5, #3a6df0); border-radius: var(--r-pill); }
.trend-v { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 事件卡 */
.event { display: flex; gap: 12px; align-items: flex-start; }
.event-icon { font-size: 28px; line-height: 1; flex: 0 0 auto; width: 34px; text-align: center; }
.event-body { flex: 1; min-width: 0; }
.event-body h3 { margin: 0 0 4px; font-size: 15px; }
.event-desc { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.event-advice { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--warning); background: var(--warning-soft); border-radius: var(--r-sm); padding: 5px 10px; }

/* 政策 / 风向标 */
.policy-active { display: flex; flex-direction: column; gap: 8px; }
.policy-item { display: flex; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.policy-item.strong { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(58,109,240,.10); }
.policy-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.policy-main { flex: 1; min-width: 0; }
.policy-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.policy-prof { font-size: 11px; font-weight: 700; color: var(--danger); background: var(--danger-soft); border-radius: var(--r-pill); padding: 1px 7px; }
.policy-desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.policy-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.policy-forecast { margin-top: 10px; background: linear-gradient(135deg, #eef3ff, #f4f0ff); border: 1px solid #dfe6ff; border-radius: var(--r); padding: 12px; }
.pf-head { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 700; }
.pf-certain { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: var(--r-pill); }
.pf-certain.yes { color: var(--success); background: var(--success-soft); }
.pf-certain.no { color: var(--muted); background: var(--surface-3); }
.pf-name { font-size: 14px; font-weight: 700; margin-top: 6px; }
.pf-desc { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }

/* 预算测算（完整版，弹窗 / 我的企业页） */
.budget-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.bchip { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 9px; display: flex; flex-direction: column; gap: 1px; }
.bchip .k { font-size: 11px; color: var(--muted); }
.bchip .v { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bchip.ok .v { color: var(--success); }
.bchip.bad .v { color: var(--danger); }
.bchip.warn .v { color: var(--warning); }
.flowbar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; margin-top: 12px; background: var(--surface-3); }
.flowbar > div { height: 100%; }
.flowlegend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.flowlegend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); }
.flowlegend i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.note { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-left: 3px solid var(--border-strong); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 8px 10px; line-height: 1.5; }
.note b { color: var(--text); }

/* 结算 */
.settle-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.settle-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.settle-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.settle-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: 11px; color: var(--muted); }
.stat .v { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 通用数据表（结算 / 复盘 / 逐季） */
.grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.grid th, .grid td { padding: 8px 9px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.grid td:first-child, .grid th:first-child { text-align: left; }
.grid tbody tr.me { background: var(--primary-soft); }
.grid tbody tr.me td { font-weight: 700; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; margin-right: 6px; }
.rank-badge.rank-1 { background: linear-gradient(135deg,#ffd66b,#f5a623); color: #5a3b00; }
.rank-badge.rank-2 { background: linear-gradient(135deg,#e3e7ee,#b9c0cc); color: #3a3f48; }
.rank-badge.rank-3 { background: linear-gradient(135deg,#f0c49a,#d99a5b); color: #5a3200; }
.delta { font-weight: 700; margin-left: 4px; }
.delta.up { color: var(--danger); }
.delta.down { color: var(--success); }
.notes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

/* 复盘：领奖台 */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 16px 8px 8px; }
.podium-item { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; max-width: 110px; }
.podium-bar { width: 100%; border-radius: var(--r-sm) var(--r-sm) 0 0; display: flex; align-items: flex-start; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; padding-top: 6px; min-height: 38px; }
.podium-name { font-size: 12.5px; font-weight: 700; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 复盘：逐季回看导航 */
.review-seasons { margin-top: 8px; }
.season-nav { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.sn-arrow { appearance: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: var(--r-sm); padding: 7px 10px; font-size: 13px; font-weight: 600; min-height: 36px; }
.sn-arrow:disabled { opacity: .4; }
.sn-strip { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.sn-strip::-webkit-scrollbar { display: none; }
.sn-btn { appearance: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: var(--r-sm); padding: 7px 11px; font-size: 13px; font-weight: 700; min-height: 36px; flex: 0 0 auto; }
.sn-btn.sel { background: var(--primary); border-color: var(--primary); color: #fff; }
.season-meta { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.season-meta b { color: var(--text); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.table-scroll .grid { min-width: 720px; }
.grp { background: var(--surface-2); font-weight: 700; color: var(--text-2); text-align: center; }
.grp-decision { color: var(--primary); }
.grp-result { color: var(--success); }
.mono { font-family: var(--mono); }
.pl-name { text-align: left; }

/* 开局说明 / 复盘要点 */
.briefing-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.briefing-block:last-child { margin-bottom: 0; }
.briefing-block h4 { margin: 0 0 6px; font-size: 14.5px; }
.briefing-block ul { margin: 0; padding-left: 18px; }
.briefing-block li { font-size: 13px; margin: 4px 0; color: var(--text-2); line-height: 1.5; }

/* ════════════════ 决策 tab（2 列 + 滑块）═══════════════ */
.mg-stack { display: flex; flex-direction: column; gap: 10px; }
.mg-budget-pin {
  position: sticky; top: 0; z-index: 6;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 11px; box-shadow: var(--sh-2);
}
.mg-budget-pin .m-card-title { margin-bottom: 5px; font-size: 13px; }

/* 预算测算：4 张小卡片一行，样式对齐「我的企业」KPI 卡 */
.budget-compact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bc {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 5px;
  display: flex; flex-direction: column; gap: 2px; text-align: center; min-width: 0;
}
.bc .k { font-size: 10px; color: var(--muted); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc .v { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); word-break: break-word; }

.mg-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 11px; }
.mg-main .m-decide-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mg-main .m-decide-head .m-card-title { margin: 0; font-size: 14.5px; }
.mg-main .m-feedback { font-size: 11.5px; }

.m-decfields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dec-field {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 10px; transition: border-color .15s, background .15s;
}
.dec-field:focus-within { border-color: var(--primary); background: var(--surface); }
.dec-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }

/* 研发勾选式小卡（与营销并列，不再单独占一行） */
.dec-field.dec-rnd-cell { display: flex; flex-direction: column; gap: 5px; }
.m-check { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--text); line-height: 1.35; cursor: pointer; }
.m-check input { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--primary); }
.m-link { align-self: flex-start; background: none; border: none; color: var(--primary); font-size: 12.5px; padding: 1px 0; text-decoration: underline; cursor: pointer; }
.dec-label { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dec-val { font-size: 12.5px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dec-hint { font-size: 10.5px; line-height: 1.35; color: var(--muted); margin-top: 4px; }

/* 滑块 */
.m-range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 8px 0 4px; background: transparent; touch-action: none; user-select: none; cursor: pointer; }
.m-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--border-strong); }
.m-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); box-shadow: 0 1px 4px rgba(20,28,48,.25); cursor: pointer; }
.m-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border-strong); }
.m-range::-moz-range-thumb { width: 18px; height: 18px; border: 2px solid var(--primary); border-radius: 50%; background: #fff; cursor: pointer; }

.dec-ctrl { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.m-num {
  flex: 1; min-width: 0; width: 100%; min-height: 40px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; padding: 6px 4px;
  -moz-appearance: textfield;
}
.m-num::-webkit-outer-spin-button, .m-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.m-num:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
.dec-unit { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dec-quote { font-size: 11px; color: var(--primary); margin-top: 4px; line-height: 1.4; }

/* 快捷产量 / 重置 */
.m-quickrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.m-quick-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.m-quick-btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); border-radius: var(--r-pill); padding: 7px 13px; font-size: 13px; font-weight: 600; min-height: 34px;
}
.m-quick-btn:active { background: var(--surface-3); border-color: var(--primary); }
.m-quickrow.m-quick-inline { margin-top: 6px; gap: 5px; }
.m-quickrow.m-quick-inline .m-quick-btn { padding: 4px 9px; font-size: 11px; min-height: 28px; }

/* 研发立项 */
.m-rndproj { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; margin-top: 6px; }
.m-rndproj > div:first-child, .m-rndproj > div:nth-child(2), .m-rndproj > div:nth-child(3) { line-height: 1.5; }
.m-rndbar { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 8px; }
.m-rndbar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #2a9bd6, #3a6df0); transition: width .3s; }

/* 对手上季定价分布 */
.m-pricebars { display: flex; align-items: flex-end; gap: 8px; height: 84px; padding: 8px 0; }
.mpb { flex: 1; min-width: 0; background: var(--primary); border-radius: 6px 6px 0 0; display: flex; align-items: flex-start; justify-content: center; color: #fff; font-size: 11px; min-height: 4px; }
.mpb.me { background: var(--success); }

.mg-form-lock { opacity: .72; pointer-events: none; }

/* 历史决策 */
.m-hist-row { font-size: 13.5px; line-height: 1.7; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.m-hist-row:last-child { border-bottom: none; }
.m-hist-row b { color: var(--text); }
.m-hist-row.m-muted { color: var(--muted); font-size: 13px; }
.m-hist-season { font-weight: 700; color: var(--primary); font-size: 14px; margin-bottom: 3px; }
.m-hist-sub { color: var(--text); }
.m-hist-sub:not(:last-child) { margin-bottom: 3px; }
.m-hist-row > .m-hist-sub:last-child { color: var(--muted); font-size: 12.5px; }

/* 聊天 */
.m-chat-log { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.m-chat-line { font-size: 13.5px; line-height: 1.45; }
.m-chat-line b { color: var(--text); }
.m-chat-line.you b { color: var(--primary); }
.m-chat-line .sys { color: var(--muted); font-style: italic; }
.m-chat-form { display: flex; gap: 8px; }
.m-chat-form .m-input { flex: 1; }

/* 对局内「聊天」tab（见 #158）：消息区滚动 + 底部输入条 */
.m-chat-tab { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.m-chat-msgs { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.m-chat-msgs .m-chat-empty { text-align: center; margin: auto; }
.m-chat-inputrow { flex: 0 0 auto; display: flex; gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); }
.m-chat-inputrow .m-input { flex: 1; min-width: 0; }

/* 战况解说 / 教练（抽屉内） */
.narr { background: var(--surface-2); border-left: 3px solid var(--muted); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.5; }
.narr.chat { border-left-color: var(--primary); }
.narr-highlight { border-left-color: var(--primary); }
.narr-rule { border-left-color: var(--gold); }
.narr-warn { border-left-color: var(--warning); }
.narr-info { border-left-color: var(--muted); }
.narr-text { font-size: 13.5px; line-height: 1.5; }
.narr-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.coach-line { background: #eaf3ff; border-left: 3px solid #2563eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.5; }
.coach-line.s2 { background: #eafff3; border-left-color: #0f9d58; }
.coach-line.s3 { background: #fff4e6; border-left-color: #ea8c00; }
.coach-stage { display: inline-block; font-size: 11px; font-weight: 700; color: #2563eb; margin-bottom: 3px; letter-spacing: .3px; }

/* ════════════════ 底部抽屉 / 弹窗 ════════════════ */
.m-sheet-mask { position: fixed; inset: 0; background: rgba(20,28,48,.45); z-index: 90; }
.m-sheet {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px; max-height: 84vh;
  background: var(--surface); z-index: 100;
  display: flex; flex-direction: column; border-radius: 20px 20px 0 0;
  box-shadow: var(--sh-pop); visibility: hidden;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), visibility .3s;
}
.m-sheet.open { transform: translateX(-50%) translateY(0); visibility: visible; }

/* 全屏弹窗（聊天等）：铺满整屏，顶部标题栏 + 中部滚动消息 + 底部输入条 */
.m-sheet.m-sheet-full {
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; max-width: none; height: 100%; max-height: none;
  border-radius: 0; transform: none;
  transition: none; /* 全屏弹窗无需滑入动画；否则 visibility 过渡会让内部输入框在 .open 后短暂不可见
（headless 断言立即判定为隐藏），见 #159 */
  z-index: 101;
}
.m-sheet.m-sheet-full.open { transform: none; }
.m-sheet.m-sheet-full .m-sheet-head {
  padding-top: calc(14px + var(--safe-t)); padding-bottom: 12px;
  background: var(--surface); position: sticky; top: 0; z-index: 2;
}
.m-sheet.m-sheet-full .m-sheet-title { font-size: 17px; }
.m-sheet.m-sheet-full .m-sheet-body { padding: 12px 14px calc(16px + var(--safe-b)); }
.m-sheet.m-sheet-full .m-sheet-foot { padding: 10px 14px calc(12px + var(--safe-b)); background: var(--surface); }
.m-sheet.m-sheet-full .m-chat-line { font-size: 14.5px; line-height: 1.5; }
.m-sheet-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 11px; border-bottom: 1px solid var(--border); }
.m-sheet-title { font-size: 16.5px; font-weight: 700; }
.m-sheet-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(20px + var(--safe-b)); }
.m-sheet-foot { flex: 0 0 auto; display: flex; gap: 10px; padding: 10px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); }
.m-sheet-foot .m-input { flex: 1; }

.m-modal-mask { position: fixed; inset: 0; background: rgba(20,28,48,.45); z-index: 90; }
.m-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.96);
  width: 92%; max-width: 420px; max-height: 86vh;
  background: var(--surface); z-index: 100;
  display: flex; flex-direction: column; border-radius: 18px;
  box-shadow: var(--sh-pop); opacity: 0; visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.m-modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.m-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 11px; border-bottom: 1px solid var(--border); font-size: 16.5px; font-weight: 700; }
.m-modal-body { padding: 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.m-modal-foot { display: flex; gap: 10px; padding: 10px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); }
.m-modal-foot .m-input { flex: 1; }
.m-modal-chat .m-modal-body { flex: 1 1 auto; min-height: 0; }
.m-modal-wide { width: min(680px, 96vw); }
.m-invite-row { display: flex; gap: 10px; align-items: stretch; margin-top: 4px; }
.m-invite-row .m-input { flex: 1; }

/* 规则（V.rules） */
.rules-sec { margin-bottom: 18px; }
.rules-sec h4 { margin: 0 0 8px; font-size: 15px; }
.rules-sec ul { margin: 0; padding-left: 18px; }
.rules-sec li { font-size: 13px; margin: 4px 0; color: var(--text-2); line-height: 1.5; }
.rules-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rules-table th, .rules-table td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.rules-table th { color: var(--muted); font-weight: 600; }

/* 加入方式切换 */
.m-mode-toggle { display: flex; gap: 8px; }
.m-mode-opt { flex: 1; padding: 11px 8px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: var(--r); font-size: 14px; font-weight: 600; min-height: 44px; }
.m-mode-opt.sel { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 账号 / 战绩 */
.m-auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.m-auth-tab { flex: 1; padding: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r); font-size: 14px; color: var(--text-2); font-weight: 600; min-height: 42px; }
.m-auth-tab.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.m-auth-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 10px; }
.m-history-list { display: flex; flex-direction: column; gap: 10px; }
.m-history-item { border: 1px solid var(--border); border-radius: var(--r); padding: 11px 13px; cursor: pointer; transition: border-color .15s; }
.m-history-item:active { border-color: var(--primary); }
.mhi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mhi-top b { font-size: 15px; }
.mhi-rank { color: var(--primary); font-weight: 700; }
.mhi-sub { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.mhi-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.m-history-detail { font-size: 13.5px; line-height: 1.6; }
.m-history-detail h3 { margin: 0 0 10px; font-size: 16px; }
.m-history-detail .season-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.m-history-detail .season-table th, .m-history-detail .season-table td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.m-history-detail .season-table th:first-child, .m-history-detail .season-table td:first-child { text-align: center; }
.m-history-detail .season-table thead th { background: var(--surface-2); color: var(--muted); font-weight: 600; position: sticky; top: 0; }
.m-history-detail .season-table .up { color: var(--danger); }
.m-history-detail .season-table .down { color: var(--success); }

/* 设备购置 */
.m-equip-block { margin-top: 12px; }
.m-equip-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.m-equip-tier { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; padding: 8px 6px; border: 1.5px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; transition: all .15s; }
.m-equip-tier b { font-size: 13px; }
.m-equip-tier span { font-size: 12px; color: var(--primary-dark); font-weight: 700; font-family: var(--mono); }
.m-equip-tier small { font-size: 11px; color: var(--muted); }
.m-equip-tier.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 2px rgba(58,109,240,.18); }
.m-equip-total { font-size: 12.5px; margin-left: 4px; }
.m-equip-total b { color: var(--primary-dark); }

/* Toast */
.m-toast-wrap { position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 90vw; }
.m-toast { background: rgba(23,26,33,.92); color: #fff; padding: 10px 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: m-toast-in .2s ease; }
.m-toast.err { background: rgba(224,72,59,.95); }
.m-toast.ok { background: rgba(24,160,88,.95); }
@keyframes m-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ════════════════ 横屏布局（orientation: landscape）═══════════════ */
@media (orientation: landscape) {
  #m-app { max-width: 1000px; }
  .m-view { min-height: 100vh; min-height: 100dvh; }

  /* 首页：左右分栏，内容垂直居中 */
  .m-home-wrap { flex: 1 1 auto; flex-direction: row; gap: 18px; padding: 16px 18px; overflow: hidden; align-items: stretch; }
  .m-home-left { flex: 1.1; justify-content: center; overflow-y: auto; }
  .m-home-right { flex: 1; justify-content: center; overflow-y: auto; }
  .m-home-status { flex: 0 0 auto; padding: 0 18px 12px; margin: 0; }

  /* 大厅：左席位 / 右设置，各自可滚 */
  .m-lobby-wrap { flex: 1 1 auto; flex-direction: row; gap: 12px; padding: 12px 14px; overflow: hidden; }
  .m-lobby-left { flex: 1.25; overflow-y: auto; }
  .m-lobby-right { flex: 1; overflow-y: auto; }

  /* 对局抽屉在横屏下居中为对话框 */
  .m-sheet { top: 50%; bottom: auto; transform: translate(-50%, -50%) scale(.98); border-radius: 18px; width: min(560px, 92%); max-width: 560px; }
  .m-sheet.open { transform: translate(-50%, -50%) scale(1); }

  /* 对局主页：横屏单屏仪表盘（不滚动）*/
  #m-game { overflow: hidden; }
  #m-game .m-game-head { gap: 6px; padding: calc(6px + var(--safe-t)) 10px 6px; }
  #m-game .m-game-body {
    flex: 1 1 auto; overflow: hidden; padding: 8px 12px;
    display: flex; align-items: stretch; justify-content: center;
  }
  #m-game:not(.phase-decision) .m-game-body > .card { max-height: 100%; overflow: auto; width: min(680px, 100%); margin: auto; }

  /* 横屏底部：行动按钮 + tab 横向排布 */
  .m-game-bottom { display: flex; flex-direction: row; align-items: stretch; gap: 8px; padding: 6px 10px calc(6px + var(--safe-b)); }
  #mg-ready, #mg-foot { order: 0; padding: 0; }
  #mg-ready .m-btn, #mg-foot .m-btn { width: auto; padding: 0 18px; }
  .m-game-nav { order: 0; flex: 1 1 auto; border-top: none; border-left: 1px solid var(--border); padding-bottom: 0; }
  .m-nav-btn { flex-direction: row; gap: 5px; padding: 7px 8px; font-size: 12px; }
  .m-nav-btn .m-nav-ico { font-size: 15px; }

  /* 决策阶段：中部纵向滚动（横屏更紧凑）*/
  #m-game.phase-decision .m-game-body { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 12px; }
  #m-game.phase-decision .mg-stack { max-width: 780px; margin: 0 auto; }
  #m-game.phase-decision .mg-main { overflow: visible; }
  #m-game.phase-decision .dec-field { padding: 5px 8px; }
  #m-game.phase-decision .dec-hint { display: none; }
  #m-game.phase-decision .dec-label { font-size: 12px; }
  #m-game.phase-decision .m-range { height: 20px; margin: 3px 0; }
  #m-game.phase-decision .m-num { height: 34px; font-size: 13px; padding: 3px 4px; }
  #m-game.phase-decision .m-quickrow.m-quick-inline { margin-top: 4px; }
  #m-game.phase-decision .m-quickrow.m-quick-inline .m-quick-btn { padding: 3px 8px; font-size: 10.5px; }
  #intel-modal .m-modal-body { max-height: 70vh; }
}

/* 彻底退出本局：决策底部文字按钮 + 确认 sheet */
.m-quit-game { color: var(--up); opacity: .75; font-size: 12.5px; margin-top: 8px; }
.m-quit-game:hover { opacity: 1; }
.m-quit-confirm-sheet .m-sheet-body { padding: 4px 16px 12px; }
.m-quit-confirm-sheet .m-muted { margin: 0; font-size: 13.5px; line-height: 1.6; }
.m-quit-confirm-sheet .m-muted b { color: var(--up); }
.m-quit-confirm-foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); }
.m-quit-confirm-foot .m-btn { flex: 1; }


/* 超窄 / 极小屏：进一步收紧间距，保证可用 */
@media (max-width: 360px) {
  .m-title { font-size: 23px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .m-game-head { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .m-ico-btn { padding: 14px 6px; }
  .m-ico { font-size: 22px; }
  .m-nav-btn .m-nav-ico { font-size: 17px; }
}
