/* ==========================================================================
   金局 · 主题层（最后加载）
   深墨底 + 香槟金主色 + 玉色点缀；玻璃面板、渐变描边、柔和阴影
   参考社区组件库（uiverse.io）的现代卡片/按钮模式，改为贴合棋牌与博彩场景
   支持 data-accent（gold|jade|violet|ice）、data-density（comfort|compact）、data-motion（full|reduced）
   ========================================================================== */

:root {
  --ink-0: #05070b;
  --ink-1: #0a0f16;
  --ink-2: #0f1620;
  --ink-3: #141d29;
  --panel: rgba(16, 23, 33, .82);
  --panel-solid: #101722;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #eef3fa;
  --text-dim: #9fb0c2;
  --text-mute: #6f8090;

  --gold: #e9c46a;
  --gold-bright: #ffe7b0;
  --gold-deep: #c1963d;
  --jade: #2ec4a6;
  --danger: #ff7a6b;
  --warn: #ffcf6a;

  --accent: var(--gold);
  --accent-bright: var(--gold-bright);
  --accent-deep: var(--gold-deep);
  --accent-ink: #201602;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --pad: 18px;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .45);
  --shadow-lg: 0 28px 60px rgba(0, 0, 0, .55);
  --glow: 0 10px 30px rgba(233, 196, 106, .22);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .22s;

  --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

html[data-accent="jade"] {
  --accent: #43e0a0;
  --accent-bright: #b9ffe0;
  --accent-deep: #1f9c72;
  --accent-ink: #04231a;
  --glow: 0 10px 30px rgba(67, 224, 160, .22);
}
html[data-accent="violet"] {
  --accent: #b39bff;
  --accent-bright: #e2d8ff;
  --accent-deep: #7b61d6;
  --accent-ink: #170a33;
  --glow: 0 10px 30px rgba(179, 155, 255, .24);
}
html[data-accent="ice"] {
  --accent: #7cc8ff;
  --accent-bright: #d5efff;
  --accent-deep: #3d8fc4;
  --accent-ink: #04192b;
  --glow: 0 10px 30px rgba(124, 200, 255, .22);
}

html { color-scheme: dark; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(233, 196, 106, .12), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(46, 196, 166, .10), transparent 55%),
    linear-gradient(180deg, var(--ink-1), var(--ink-0) 55%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(233, 196, 106, .35); color: #fff; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(233, 196, 106, .45); background-clip: content-box; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: 72px;
  padding: 0 clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 18, .72);
  backdrop-filter: blur(18px) saturate(140%);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(233, 196, 106, .55);
  color: var(--accent);
  background: linear-gradient(160deg, rgba(233, 196, 106, .18), transparent 70%), var(--ink-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow-sm);
  font-size: 22px; font-weight: 700;
}
.brand b { font-size: 20px; letter-spacing: .04em; }
.brand small { font-size: 9px; letter-spacing: .28em; color: var(--text-mute); text-transform: uppercase; }
.identity { color: var(--text-dim); font-size: 12.5px; }

/* ---------------- 按钮 ---------------- */
.button, td button {
  font-family: inherit;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .01)), rgba(22, 30, 42, .85);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.button:hover:not(:disabled), td button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(233, 196, 106, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow-md);
}
.button:active:not(:disabled), td button:active:not(:disabled) {
  transform: translateY(1px) scale(.995);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
}
.button-primary {
  color: var(--accent-ink);
  border-color: transparent;
  background: linear-gradient(160deg, var(--accent-bright), var(--accent) 48%, var(--accent-deep));
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .65);
  font-weight: 800;
}
.button-primary:hover:not(:disabled) {
  filter: saturate(1.08) brightness(1.04);
  box-shadow: 0 16px 34px rgba(233, 196, 106, .3), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.button-ghost, .button-link { background: transparent; box-shadow: none; border-color: transparent; color: var(--accent); }
.button-link { justify-content: center; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid rgba(233, 196, 106, .8);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------------- 表单 ---------------- */
input, select, textarea {
  height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(10, 15, 22, .9);
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .26); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(233, 196, 106, .65);
  box-shadow: 0 0 0 3px rgba(233, 196, 106, .18), inset 0 1px 0 rgba(255, 255, 255, .06);
  background: rgba(12, 18, 26, .95);
  outline: none;
}
input[readonly] { color: var(--text-dim); background: rgba(255, 255, 255, .03); }
label { color: var(--text-dim); font-size: 12.5px; gap: 7px; }

/* ---------------- 登录 / 首页 ---------------- */
.auth-layout { gap: clamp(28px, 6vw, 72px); min-height: 560px; }
.auth-intro h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.12; letter-spacing: -.01em; font-weight: 800; }
.auth-intro em {
  color: transparent;
  background: linear-gradient(100deg, var(--accent-bright), var(--accent) 45%, var(--jade));
  -webkit-background-clip: text;
  background-clip: text;
  display: block;
}
.auth-intro > p:not(.eyebrow) { color: var(--text-dim); line-height: 1.85; max-width: 430px; }
.intro-stats { gap: clamp(20px, 4vw, 44px); }
.intro-stats b { font-family: var(--font-mono); font-size: 24px; color: var(--text); }

.auth-card {
  position: relative;
  padding: clamp(24px, 4vw, 34px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 28, 40, .92), rgba(9, 13, 19, .96));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .07);
  display: grid;
  gap: 18px;
  overflow: hidden;
}
.auth-card h2 { font-size: 22px; letter-spacing: -.01em; }
.auth-card .status {
  border-radius: var(--radius-sm);
  border-color: rgba(255, 207, 106, .4);
  background: rgba(255, 207, 106, .1);
}
.form-note { color: var(--text-mute); font-size: 11.5px; }

/* ---------------- 玩家区 ---------------- */
.player-hero { padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.balance-block strong { font-family: var(--font-mono); font-size: 32px; letter-spacing: -.02em; }
.live-pill, .safe-label {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: #8ff0cf;
  background: rgba(46, 196, 166, .14);
  border: 1px solid rgba(46, 196, 166, .3);
}
.game-grid { gap: 16px; }
.game-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 26, 37, .9), rgba(9, 13, 19, .95));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  overflow: hidden;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: rgba(233, 196, 106, .35);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(233, 196, 106, .18);
}
.game-copy { padding: 18px 20px 20px; }
.game-copy h3 { font-size: 17px; letter-spacing: -.01em; }
.game-copy p { color: var(--text-mute); font-size: 12px; line-height: 1.7; }
.tag { color: var(--accent); letter-spacing: .18em; font-size: 9.5px; }
.panel { border-top: 1px solid var(--line); padding: 20px 0; }
.section-heading h2 { font-size: 20px; letter-spacing: -.01em; }
.eyebrow, .card-kicker { color: var(--accent); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; font-weight: 700; }

.player-navigation {
  border-top: 1px solid var(--line);
  background: rgba(8, 12, 18, .9);
  backdrop-filter: blur(20px) saturate(150%);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -18px 40px rgba(0, 0, 0, .45);
}
.player-navigation button {
  color: var(--text-mute);
  font-size: 10.5px;
  border-radius: 12px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.player-navigation button[aria-current="page"], .player-navigation button.active {
  color: var(--accent);
  background: rgba(233, 196, 106, .12);
}
.player-navigation button:active { transform: scale(.96); }

/* ---------------- 表格 ---------------- */
table { font-size: 12.5px; }
th {
  background: rgba(255, 255, 255, .04);
  color: var(--text-mute);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 12px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 1;
}
td { padding: 13px 12px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
td, .balance-block strong, .econ-hero strong, .metric strong { font-variant-numeric: tabular-nums; }
.amount-positive { color: var(--jade); }
.amount-negative { color: var(--danger); }

/* ---------------- 后台 ---------------- */
.admin-layout { grid-template-columns: 232px minmax(0, 1fr); gap: 28px; }
.admin-sidebar {
  border-right: 1px solid var(--line);
  padding-right: 20px;
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}
.admin-sidebar h1 { font-size: 20px; letter-spacing: -.01em; }
.admin-sidebar nav { gap: 4px; }
.admin-sidebar nav button {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 12.5px;
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.admin-sidebar nav button:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.admin-sidebar nav button[aria-pressed="true"] {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(233, 196, 106, .16), transparent 85%);
  border-color: rgba(233, 196, 106, .26);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 122, 107, .22);
  color: #ffd9d4;
  font-size: 10px;
  text-align: center;
}
.sidebar-note { margin-top: 40px; color: var(--text-mute); font-size: 10.5px; letter-spacing: .04em; }
.view-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.view-head h2 { font-size: 22px; letter-spacing: -.01em; }
.view-date { font-size: 11.5px; color: var(--text-mute); }

.metric-row { gap: 16px; }
.metric, .econ-hero > div {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.metric small, .econ-hero small { color: var(--text-mute); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.econ-hero strong { font-size: 21px; }
.admin-content .panel { border-top: 0; padding: 0; }
.admin-content h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }

/* ---------------- 对话框 / 提示 ---------------- */
dialog {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(20, 28, 40, .97), rgba(9, 13, 19, .99));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .06);
  padding: 26px;
}
dialog::backdrop { background: rgba(3, 5, 8, .72); backdrop-filter: blur(6px); }
.status {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 207, 106, .45);
  background: rgba(255, 207, 106, .1);
  color: #ffe6b8;
}

/* ---------------- 密度 ---------------- */
html[data-density="compact"] {
  --pad: 12px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
}
html[data-density="compact"] .topbar { height: 60px; }
html[data-density="compact"] .button,
html[data-density="compact"] td button { min-height: 34px; padding: 6px 13px; font-size: 12px; }
html[data-density="compact"] td { padding: 9px 10px; }
html[data-density="compact"] th { padding: 8px 10px; }
html[data-density="compact"] .metric,
html[data-density="compact"] .econ-hero > div { padding: 10px 12px; }
html[data-density="compact"] .econ-hero strong { font-size: 17px; }
html[data-density="compact"] .admin-sidebar nav button { padding: 7px 10px; font-size: 12px; }

/* ---------------- 动效 ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
html[data-motion="reduced"] * {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
}
html[data-motion="reduced"] .game-card:hover { transform: none; }
html[data-motion="reduced"] .button:hover:not(:disabled) { transform: none; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html[data-motion="full"] .game-card,
  html[data-motion="full"] .sb-match,
  html[data-motion="full"] .sb-card,
  html[data-motion="full"] .metric,
  html[data-motion="full"] .econ-hero > div {
    animation: rise-in .34s var(--ease) both;
  }
}

/* ---------------- 外观面板 ---------------- */
.theme-swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-swatch {
  width: 100px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--text-dim);
  font-size: 11.5px;
}
.theme-swatch i {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 16px rgba(0, 0, 0, .45);
}
.theme-swatch[aria-pressed="true"] {
  border-color: rgba(233, 196, 106, .6);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(233, 196, 106, .35), var(--glow);
}
.theme-swatch i[data-tone="gold"] { background: linear-gradient(160deg, #ffe7b0, #e9c46a 55%, #c1963d); }
.theme-swatch i[data-tone="jade"] { background: linear-gradient(160deg, #b9ffe0, #43e0a0 55%, #1f9c72); }
.theme-swatch i[data-tone="violet"] { background: linear-gradient(160deg, #e2d8ff, #b39bff 55%, #7b61d6); }
.theme-swatch i[data-tone="ice"] { background: linear-gradient(160deg, #d5efff, #7cc8ff 55%, #3d8fc4); }
.theme-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.theme-row:last-child { border-bottom: 0; }
.theme-row b { font-size: 13px; }
.theme-row small { display: block; color: var(--text-mute); font-size: 11px; margin-top: 3px; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.segmented button {
  padding: 6px 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
}
.segmented button[aria-pressed="true"] {
  color: var(--accent-ink);
  background: linear-gradient(160deg, var(--accent-bright), var(--accent) 60%, var(--accent-deep));
  font-weight: 700;
}

/* ================= 修正层：登录双栏 / 后台 console / 指标卡 ================= */

@media (min-width: 901px) {
  #login-panel.auth-layout {
    grid-template-columns: minmax(0, 1fr) 400px !important;
    align-items: center !important;
    gap: clamp(32px, 6vw, 80px) !important;
  }
  #login-panel .auth-card { position: sticky; top: 96px; }
  #login-panel .auth-intro { padding: 24px 0; }
}
@media (max-width: 900px) {
  #login-panel.auth-layout { grid-template-columns: 1fr !important; gap: 20px !important; }
  #login-panel .auth-intro h1 { font-size: 34px; }
}
.auth-intro h1 { line-height: 1.16; padding-bottom: .08em; }

/* 后台：顶部导航 console 形态 */
.admin-portal .admin-layout { display: block !important; }
.admin-portal .admin-sidebar {
  position: sticky;
  top: 72px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0 10px;
  margin-bottom: 10px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 12, 18, .94), rgba(8, 12, 18, .72));
  backdrop-filter: blur(18px) saturate(140%);
  max-height: none;
  overflow: visible;
}
.admin-portal .admin-sidebar .eyebrow { margin: 0; }
.admin-portal .admin-sidebar h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.admin-portal .admin-sidebar nav {
  display: flex !important;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.admin-portal .admin-sidebar nav::-webkit-scrollbar { display: none; }
.admin-portal .admin-sidebar nav button {
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 12.5px;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .03);
}
.admin-portal .admin-sidebar nav button[aria-pressed="true"] {
  box-shadow: none;
  border-color: transparent;
  background: linear-gradient(160deg, var(--accent-bright), var(--accent) 55%, var(--accent-deep));
  color: var(--accent-ink);
  font-weight: 700;
}
.admin-portal .sidebar-note { display: none; }
.admin-portal .admin-content { max-width: 1180px; }
.admin-portal .view-head { margin-top: 4px; }

/* 概览指标卡 */
.overview-metrics {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  border-top: 0 !important;
  margin: 18px 0 24px !important;
}
.overview-metrics > div {
  padding: 14px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.overview-metrics small { color: var(--text-mute) !important; font-size: 10px !important; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px !important; }
.overview-metrics strong { font-size: 23px !important; font-family: var(--font-mono); }
.overview-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 标题裁切修正：渐变文字需要底部留白 */
.auth-intro h1 { line-height: 1.12; padding-bottom: .06em; }
.auth-intro em { line-height: 1.2; padding-bottom: .14em; display: block; }

/* 外观页：整行布局（CSP 环境不能用内联 style） */
.theme-row.stacked { display: block; }
.theme-row { align-items: flex-start; }
.theme-row > div:first-child { min-width: 0; }
.auth-intro em { line-height: 1.24; padding-bottom: .22em; }

/* 渐变标题：确保字形不被裁切 */
.auth-intro, .auth-intro h1 { overflow: visible; }
.auth-intro em { display: inline-block; padding: .04em .02em .2em; line-height: 1.08; }

/* ================= 移动端适配修正（360–430px）================= */

/* 品牌副标 7px → 9px，保留字距 */
.brand small { font-size: 9px; letter-spacing: .2em; }

/* 小标签统一不低于 10px */
.eyebrow, .card-kicker, .tag { font-size: 10px; }
.live-pill, .safe-label { font-size: 10px; }

/* 博彩页投注项说明文字 */
.sb-pick small { font-size: 10.5px; }
.sb-market-name { font-size: 11px; }
.sb-tile small { font-size: 10.5px; }

@media (max-width: 640px) {
  /* 触控目标：主要按钮与小控件不低于 36px */
  #player-panel .button,
  #player-panel a.button,
  #sports-page button,
  .hero-actions .button,
  .game-filter button,
  .room-game-tabs button,
  .segmented button {
    min-height: 36px;
  }
  #player-panel .button-primary,
  #player-panel a.hero-ghost {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .sb-chip { min-height: 38px; }
  .sb-sum { min-height: 38px; }
  .econ-windows button { min-height: 34px; }

  /* 移动端字号下限 */
  .sb-bet-main span, .sb-pool-foot, .econ-note, .muted-text { font-size: 11px; }
  .sb-match-head, .sb-bet-main b { font-size: 13px; }
}

/* ================= 移动端严格修正（覆盖既有高优先级规则）================= */
@media (max-width: 640px) {
  /* 品牌副标：lobby.css 在移动端压到 7px，这里抬到 9px */
  .player-mode .brand small { font-size: 9px !important; letter-spacing: .18em; }

  /* 触控目标下限 38–40px（只针对确实偏小的控件） */
  .hero-hall .button,
  .hero-actions .button,
  .hero-ghost { min-height: 40px !important; }
  .game-filter button,
  .room-game-tabs button,
  .activity-tabs button,
  .segmented button { min-height: 38px !important; }
  .sb-sum,
  .sb-chip { min-height: 40px !important; }

  /* 小字号统一抬到 10–10.5px */
  .live-pill, .eyebrow, .card-kicker, .tag { font-size: 10px !important; }
  .sb-tile small, .sb-pick small, .sb-sum i { font-size: 10.5px !important; }
  .account-greeting small, .hero-hall .scene-kicker { font-size: 10.5px !important; }
}

/* 移动端收尾：英雄区小标与筛选胶囊 */
@media (max-width: 640px) {
  #player-panel .hero-hall small,
  #player-panel .hero-hall .scene-kicker,
  #player-panel .hero-hall .eyebrow,
  #player-panel .scene-band small { font-size: 10.5px !important; letter-spacing: .14em; }

  #player-panel .game-filter button,
  #player-panel .filter-row button,
  #player-panel .chip-row button,
  #player-panel .game-grid > .tabs button { min-height: 38px !important; }

  /* 兜底：玩家区内非导航的小按钮不低于 36px */
  #player-panel button:not(.button):not([data-player-go]):not(.sb-chip):not(.sb-sum):not(.sb-fill) {
    min-height: 36px;
  }
}

/* 最后一档：玩家区内所有说明性小字不低于 10px；活动页签在横屏也保持 38px */
#player-panel small { font-size: max(10px, 0.7em); }
@media (max-width: 900px) {
  .activity-tabs button,
  #activities-page button:not(.button) { min-height: 38px; }
}

/* ================= 横屏（手持设备横置）================= */
@media (min-width: 700px) and (max-height: 520px) {
  .topbar { height: 56px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
  .brand b { font-size: 16px; }
  .brand small { font-size: 9px !important; }

  /* 底部导航压成细条，把高度还给内容 */
  .player-navigation { height: 52px !important; padding: 4px 0 !important; }
  .player-navigation button { height: 44px; min-height: 44px; padding: 2px 0; }
  .player-navigation svg { width: 16px; height: 16px; }
  .player-navigation { padding-top: 4px; padding-bottom: 4px; }
  .player-navigation button { min-height: 42px; gap: 1px; font-size: 9.5px; }
  .player-navigation svg { width: 17px; height: 17px; }

  /* 内容居中限宽，避免卡片被拉成大横条 */
  #player-panel main { max-width: 1100px; margin: 0 auto; padding: 10px 16px 14px; }
  #player-panel .hero-hall.scene-band { height: 176px !important; }
  #player-panel .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .lounge-shortcuts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

  /* 博彩页两列 */
  #sports-page .sb-tabs { top: 56px; }
  #sports-page .sb-body { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .sb-tabs button { height: 34px; font-size: 12px; }

  /* 横屏下页签不再强制 38px，节省纵向空间 */
  .activity-tabs button, #activities-page button:not(.button) { min-height: 36px !important; }
  .sb-chip, .sb-sum { min-height: 36px !important; }
}
