/* ===== 体彩七星彩智能选号器 · 主题与组件样式 =====
   配色取「七星」意象：深空夜蓝 + 青绿(星) + 鎏金(奖)，暗/亮双主题。 */

:root {
  /* 基础（暗色：深空蓝绿 + 星青 + 鎏金） */
  --qxc-background: linear-gradient(180deg, #0f1620 0%, #0a0e15 100%);
  --qxc-foreground: #eef3f8;
  --qxc-primary: #16c8b4;          /* 星青 */
  --qxc-primary-2: #7c5cff;        /* 星紫 */
  --qxc-accent: #ffc53d;           /* 鎏金 */
  --qxc-border: rgba(255, 255, 255, 0.10);
  --qxc-border-strong: rgba(255, 255, 255, 0.18);
  --qxc-border-faint: rgba(255, 255, 255, 0.06);
  --qxc-muted: #93a1b3;
  --qxc-text-secondary: #c7d2de;
  --qxc-text-tertiary: #6b7280;
  --qxc-card: rgba(255, 255, 255, 0.05);
  --qxc-card-solid: #141b24;
  --qxc-surface: rgba(255, 255, 255, 0.08);
  --qxc-overlay: rgba(0, 0, 0, 0.45);
  --qxc-overlay-strong: rgba(0, 0, 0, 0.30);
  --qxc-header-bg: rgba(10, 14, 21, 0.82);
  --qxc-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --qxc-glow: 0 0 40px rgba(22, 200, 180, 0.22);
  --qxc-radius-sm: 8px;
  --qxc-radius-md: 16px;
  --qxc-radius-lg: 24px;
  /* 语义状态色 */
  --qxc-success: #4ade80;
  --qxc-success-bg: rgba(34, 197, 94, 0.15);
  --qxc-danger: #f87171;
  --qxc-danger-bg: rgba(239, 68, 68, 0.15);
  --qxc-warning: #facc15;
  --qxc-warning-bg: rgba(250, 204, 21, 0.15);
  --qxc-info: #7c5cff;
  --qxc-info-bg: rgba(124, 92, 255, 0.18);
  --qxc-cold: #3b82f6;
  --qxc-hot: #ff5a5a;
  --qxc-warm: #facc15;
  --qxc-muted-bg: rgba(148, 163, 184, 0.15);
  /* 号码球（七星彩 7 个位置同构，均为「数位」球） */
  --qxc-ball-digit: linear-gradient(180deg, #1fb6a6 0%, #0e8fa0 100%);
  --qxc-ball-digit-text: #ffffff;
  /* 末位（后区 0-14）用紫金区分，提示「位置不同」 */
  --qxc-ball-last: linear-gradient(180deg, #7c5cff 0%, #5a3fd6 100%);
  --qxc-ball-empty-bg: rgba(255, 255, 255, 0.06);
  --qxc-ball-empty-border: rgba(255, 255, 255, 0.14);
  /* 功能按钮渐变 */
  --qxc-btn-primary: linear-gradient(180deg, #1fc8b4 0%, #0f9e8c 100%);
  --qxc-btn-red: linear-gradient(180deg, #ff5a5a 0%, #e11d48 100%);
  --qxc-btn-blue: linear-gradient(180deg, #3aa0ff 0%, #1565c0 100%);
  --qxc-btn-ghost: rgba(255, 255, 255, 0.06);
  /* 背景光晕 / 标签 / 卡片品牌光（暗色） */
  --qxc-aura-1: rgba(22, 200, 180, 0.20);
  --qxc-aura-2: rgba(124, 92, 255, 0.10);
  --qxc-tag-bg: rgba(22, 200, 180, 0.18);
  --qxc-tag-text: #aef3e8;
  --qxc-card-glow: 0 0 0 1px rgba(22, 200, 180, 0.28), 0 10px 34px rgba(22, 200, 180, 0.12);
}

/* ===== 亮色主题（日间） ===== */
[data-theme="light"] {
  --qxc-background: linear-gradient(180deg, #ffffff 0%, #eef4f9 100%);
  --qxc-foreground: #0f172a;
  --qxc-primary: #0f9e8c;
  --qxc-primary-2: #5a3fd6;
  --qxc-accent: #b8860b;
  --qxc-border: rgba(15, 23, 42, 0.12);
  --qxc-border-strong: rgba(15, 23, 42, 0.20);
  --qxc-border-faint: rgba(15, 23, 42, 0.08);
  --qxc-muted: #475569;
  --qxc-text-secondary: #334155;
  --qxc-text-tertiary: #64748b;
  --qxc-card: rgba(15, 23, 42, 0.04);
  --qxc-card-solid: #ffffff;
  --qxc-surface: rgba(15, 23, 42, 0.05);
  --qxc-overlay: rgba(15, 23, 42, 0.06);
  --qxc-overlay-strong: rgba(15, 23, 42, 0.10);
  --qxc-header-bg: rgba(255, 255, 255, 0.88);
  --qxc-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --qxc-glow: 0 0 40px rgba(15, 158, 140, 0.16);
  --qxc-success: #16a34a;
  --qxc-success-bg: rgba(34, 197, 94, 0.12);
  --qxc-danger: #dc2626;
  --qxc-danger-bg: rgba(239, 68, 68, 0.12);
  --qxc-warning: #d97706;
  --qxc-warning-bg: rgba(250, 204, 21, 0.18);
  --qxc-info: #5a3fd6;
  --qxc-info-bg: rgba(124, 92, 255, 0.16);
  --qxc-cold: #2563eb;
  --qxc-hot: #dc2626;
  --qxc-warm: #d97706;
  --qxc-muted-bg: rgba(15, 23, 42, 0.06);
  --qxc-ball-digit: linear-gradient(180deg, #1fb6a6 0%, #0e8fa0 100%);
  --qxc-ball-last: linear-gradient(180deg, #7c5cff 0%, #5a3fd6 100%);
  --qxc-ball-digit-text: #ffffff;
  --qxc-ball-empty-bg: rgba(15, 23, 42, 0.04);
  --qxc-ball-empty-border: rgba(15, 23, 42, 0.16);
  --qxc-btn-primary: linear-gradient(180deg, #1fc8b4 0%, #0f9e8c 100%);
  --qxc-btn-red: linear-gradient(180deg, #ff5a5a 0%, #e11d48 100%);
  --qxc-btn-blue: linear-gradient(180deg, #3aa0ff 0%, #1565c0 100%);
  --qxc-btn-ghost: rgba(15, 23, 42, 0.05);
  --qxc-aura-1: rgba(15, 158, 140, 0.10);
  --qxc-aura-2: rgba(124, 92, 255, 0.08);
  --qxc-tag-bg: rgba(15, 158, 140, 0.12);
  --qxc-tag-text: #0a6b5e;
  --qxc-card-glow: 0 0 0 1px rgba(15, 158, 140, 0.22), 0 10px 34px rgba(15, 158, 140, 0.10);
}

* { box-sizing: border-box; }

* { -webkit-tap-highlight-color: transparent; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--qxc-foreground);
  background: var(--qxc-background);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
  overflow-x: clip;
}

:focus-visible { outline: 2px solid var(--qxc-primary); outline-offset: 2px; }

.btn, .chip, .seg button, .theme-toggle, a.link, select, input, label {
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(600px 400px at 80% -5%, var(--qxc-aura-1), transparent 60%),
    radial-gradient(500px 360px at 0% 10%, var(--qxc-aura-2), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px 56px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

@media (min-width: 1024px) {
  .app-container {
    padding: 0 28px 72px;
    padding-left: max(28px, env(safe-area-inset-left));
    padding-right: max(28px, env(safe-area-inset-right));
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}
@media (min-width: 1600px) {
  .app-container { max-width: 1440px; }
}

/* ===== 头部 ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px;
  padding-top: max(16px, env(safe-area-inset-top));
  margin-bottom: 8px;
  background: var(--qxc-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--qxc-border-faint);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.header-left > div:last-child { min-width: 0; }
.header-right { display: flex; align-items: center; gap: 8px; flex: none; }

/* ===== 表单（登录页等通用）===== */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--qxc-text-secondary); margin-bottom: 6px; }
.brand-badge {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--qxc-btn-primary);
  color: #fff; font-weight: 800; font-size: 13px; line-height: 1.05; text-align: center;
  box-shadow: var(--qxc-glow);
}
.page-title {
  font-size: 20px; font-weight: 800; margin: 0; letter-spacing: .5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.page-title .title-accent { color: var(--qxc-primary); }
.subtitle { font-size: 12px; color: var(--qxc-muted); margin-top: 2px; }

.theme-toggle {
  flex: none; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--qxc-border); background: var(--qxc-surface); color: var(--qxc-foreground);
  display: grid; place-items: center; font-size: 18px; transition: .2s;
}
.theme-toggle:hover { border-color: var(--qxc-border-strong); transform: translateY(-1px); }

/* ===== 卡片 / 区块 ===== */
.section { margin-top: 20px; }
.card {
  background: var(--qxc-card);
  border: 1px solid var(--qxc-border);
  border-radius: var(--qxc-radius-md);
  padding: 18px;
  box-shadow: var(--qxc-shadow);
  backdrop-filter: blur(6px);
}
.card-title {
  font-size: 16px; font-weight: 700; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 4px;
  background: var(--qxc-btn-primary);
}
.card-body { font-size: 13px; color: var(--qxc-text-secondary); line-height: 1.7; }

/* ===== 数据概览 stat ===== */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px;
}
.stat {
  background: var(--qxc-surface); border: 1px solid var(--qxc-border-faint);
  border-radius: var(--qxc-radius-sm); padding: 12px 14px;
}
.stat .stat-label { font-size: 12px; color: var(--qxc-muted); }
.stat .stat-value { font-size: 20px; font-weight: 800; margin-top: 4px; color: var(--qxc-foreground); }
.stat .stat-value.accent { color: var(--qxc-primary); }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--qxc-tag-bg); color: var(--qxc-tag-text); border: 1px solid var(--qxc-border-faint);
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px;
}
.pill .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot-hot { background: var(--qxc-hot); }
.dot-warm { background: var(--qxc-warm); }
.dot-cold { background: var(--qxc-cold); }

/* ===== 号码球（七星彩：7 个位置同构，均为「数位」球） ===== */
.ball {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  font-size: 15px; font-weight: 700; user-select: none;
  background: var(--qxc-ball-empty-bg);
  border: 1.5px solid var(--qxc-ball-empty-border);
  color: var(--qxc-foreground);
  transition: transform .12s ease, box-shadow .15s ease;
}
.ball.digit { background: var(--qxc-ball-digit); color: var(--qxc-ball-digit-text); border-color: transparent; }
/* 末位（第 7 位 / 后区 0-14）视觉区分 */
.ball.last { background: var(--qxc-ball-last); color: #fff; border-color: transparent; }
.ball.lg { width: 46px; height: 46px; font-size: 17px; }
.ball.sm { width: 30px; height: 30px; font-size: 13px; }
/* 命中（与开奖该位一致）：金色光圈 */
.ball.hit { box-shadow: 0 0 0 3px var(--qxc-accent), var(--qxc-card-glow); border-color: var(--qxc-accent); }

.ball-row { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.ball-run { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.plus { color: var(--qxc-primary); font-weight: 800; margin: 0 2px; flex: none; }

/* 位置序号标签（第1位…第7位） */
.pos-label {
  font-size: 11px; color: var(--qxc-muted); font-weight: 600; margin-right: 4px;
  min-width: 28px; text-align: right;
}

/* ===== 按钮 ===== */
.btn {
  appearance: none; border: 1px solid var(--qxc-border); cursor: pointer;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 700;
  background: var(--qxc-btn-ghost); color: var(--qxc-foreground); transition: .18s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--qxc-border-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--qxc-btn-primary); border-color: transparent; color: #fff; }
.btn-red { background: var(--qxc-btn-red); border-color: transparent; color: #fff; }
.btn-blue { background: var(--qxc-btn-blue); border-color: transparent; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ===== 策略 chips ===== */
.group-block { margin-top: 14px; }
.group-title { font-size: 13px; font-weight: 700; color: var(--qxc-text-secondary); margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--qxc-surface); border: 1px solid var(--qxc-border-faint); color: var(--qxc-text-secondary);
  transition: .15s; margin: 0 8px 8px 0;
}
.chip:hover { border-color: var(--qxc-border-strong); }
.chip.active { background: var(--qxc-tag-bg); color: var(--qxc-tag-text); border-color: var(--qxc-primary); }
.chip .desc { font-size: 11px; color: var(--qxc-muted); font-weight: 500; }

.seg { display: inline-flex; border: 1px solid var(--qxc-border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--qxc-text-secondary); padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg button.active { background: var(--qxc-btn-primary); color: #fff; }

/* ===== 生成结果 ===== */
.result-card {
  background: var(--qxc-card-solid); border: 1px solid var(--qxc-border); border-radius: var(--qxc-radius-md);
  padding: 18px; box-shadow: var(--qxc-card-glow);
}
.result-balls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.result-balls .plus { font-size: 22px; font-weight: 800; color: var(--qxc-primary); margin: 0 4px; }
.result-meta { font-size: 12px; color: var(--qxc-muted); margin-top: 8px; line-height: 1.7; }
.ticket {
  border: 1px dashed var(--qxc-border-strong); border-radius: 12px; padding: 12px; margin-top: 10px;
  background: var(--qxc-surface);
}
.ticket .ticket-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table.qxc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.qxc-table th, table.qxc-table td {
  padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--qxc-border-faint); white-space: nowrap;
}
table.qxc-table th {
  color: var(--qxc-muted); font-weight: 600; position: sticky; top: 0; background: var(--qxc-card-solid);
}
table.qxc-table td.num-cell { font-variant-numeric: tabular-nums; }
.hit { color: var(--qxc-success); font-weight: 700; }

/* ===== 提示 / 免责 ===== */
.disclaimer {
  margin-top: 18px; font-size: 12px; color: var(--qxc-muted); line-height: 1.8;
  border-top: 1px dashed var(--qxc-border); padding-top: 14px;
}
.note-line { font-size: 12px; color: var(--qxc-muted); margin-top: 6px; }
.message { margin-top: 10px; font-size: 13px; padding: 8px 12px; border-radius: 10px; }
.message.error { background: var(--qxc-danger-bg); color: var(--qxc-danger); }
.message.success { background: var(--qxc-success-bg); color: var(--qxc-success); }
.message.info { background: var(--qxc-info-bg); color: var(--qxc-info); }

.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--qxc-muted); }
.accent-text { color: var(--qxc-primary); font-weight: 700; }
.divider { height: 1px; background: var(--qxc-border-faint); margin: 14px 0; }

a.link { color: var(--qxc-primary); text-decoration: none; font-weight: 600; }
a.link:hover { text-decoration: underline; }

/* ===== 玩法选择（单式 / 定位复式） ===== */
.play-panel { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--qxc-border); }
.fushi-panel { margin-top: 12px; }
.fushi-inputs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.fushi-field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--qxc-text-secondary);
  flex: 1 1 130px; min-width: 120px;
}
.fushi-field input {
  width: 100%; padding: 10px 12px; font-size: 16px; font-weight: 800; text-align: center;
  color: var(--qxc-foreground); background: var(--qxc-surface);
  border: 1px solid var(--qxc-border-strong); border-radius: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.fushi-field input::-webkit-outer-spin-button,
.fushi-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fushi-field input:focus { border-color: var(--qxc-primary); box-shadow: var(--qxc-card-glow); }
.fushi-cost {
  margin-top: 12px; font-size: 14px; line-height: 1.6; padding: 10px 12px; border-radius: 10px;
  background: var(--qxc-surface); border: 1px solid var(--qxc-border-faint);
}
.fushi-cost .accent-text { font-size: 16px; }
.fushi-cost-bad { color: var(--qxc-danger); font-weight: 600; }
.fushi-cost-warn { color: var(--qxc-warning); margin-top: 6px; font-size: 12px; }

/* ===== 选号记录 / 历史记录 ===== */
.record-card {
  border: 1px solid var(--qxc-border); border-radius: 14px; padding: 14px;
  margin-top: 12px; background: var(--qxc-surface);
}
.record-card-win { border-color: rgba(74, 222, 128, 0.45); box-shadow: var(--qxc-card-glow); }
.record-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.record-period { font-size: 15px; font-weight: 800; color: var(--qxc-foreground); }
.record-bets { font-size: 12.5px; color: var(--qxc-text-secondary); }
.record-time { margin-left: auto; font-size: 12px; color: var(--qxc-muted); }
.record-strategy { font-size: 12px; color: var(--qxc-muted); margin-top: 6px; }
.record-body { margin-top: 10px; }

/* ===== 记录号码折叠/展开 ===== */
.record-body.rec-collapsible:not(.rec-expanded) {
  max-height: 108px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 62%, transparent 100%);
}
.rec-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 8px; padding: 7px 0; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--qxc-primary);
  background: transparent; border: 1px dashed var(--qxc-border); border-radius: 9px;
  transition: background .18s ease, border-color .18s ease;
}
.rec-toggle:hover { background: var(--qxc-tag-bg); border-color: var(--qxc-primary); }
.rec-toggle .rec-caret { display: inline-block; transition: transform .2s ease; font-size: 11px; }
.rec-toggle.is-open .rec-caret { transform: rotate(180deg); }

.record-body .ticket-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 5px 0; }
.rec-pool { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 5px 0; }
.rec-pool-label { font-size: 12px; color: var(--qxc-muted); font-weight: 600; }
.record-draw {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--qxc-border);
}
.record-foot { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--qxc-border); }
.record-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.btn.rec-del { color: var(--qxc-danger); border-color: rgba(248, 113, 113, 0.35); }
.rec-tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: var(--qxc-tag-bg); color: var(--qxc-tag-text);
}
.rec-tag-fushi { background: rgba(255, 197, 61, 0.18); color: var(--qxc-accent); }
.rec-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.rec-badge-pending { background: var(--qxc-muted-bg); color: var(--qxc-text-secondary); }
.rec-badge-win { background: var(--qxc-success-bg); color: var(--qxc-success); }
.rec-badge-lose { background: var(--qxc-danger-bg); color: var(--qxc-danger); }
.rec-note { font-size: 12px; color: var(--qxc-muted); }
.rec-prize { display: flex; flex-direction: column; gap: 6px; }
.rec-prize-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.rec-prize-row b { color: var(--qxc-success); }
.rec-amount { color: var(--qxc-primary); font-weight: 700; }
.rec-pending-amount { color: var(--qxc-warning); font-weight: 700; }
.rec-prize-sum { font-size: 13px; margin-top: 4px; color: var(--qxc-text-secondary); }
.record-filter { font-size: 13px; color: var(--qxc-text-secondary); }
.record-filter select {
  padding: 6px 10px; border-radius: 8px; font-size: 13px; margin: 0 4px;
  color: var(--qxc-foreground); background: var(--qxc-surface); border: 1px solid var(--qxc-border-strong);
}
.pager { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 14px; }

/* ============================================================
   页面级作用域
   ============================================================ */
body.page-history .section { margin-top: 16px; }
body.page-records #record-list { min-width: 0; }

/* 频率 / 遗漏热力网格 */
.heat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
}
.heat-cell {
  min-height: 46px;
  border-radius: 8px;
  padding: 6px 2px;
  display: grid;
  place-items: center;
  align-content: center;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.heat-num { display: block; }
.heat-meta { display: block; margin-top: 1px; font-size: 10px; font-weight: 600; opacity: .92; }
.heat-cell.hot  { background: linear-gradient(180deg, #1fc8b4 0%, #0e8fa0 100%); }
.heat-cell.warm { background: linear-gradient(180deg, #ffc53d 0%, #f59e0b 100%); }
.heat-cell.cold { background: linear-gradient(180deg, #3aa0ff 0%, #1565c0 100%); }

/* ============================================================
   双端适配（PC / 平板 / 手机）
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); border-color: var(--qxc-border-strong); }
  .chip:hover { border-color: var(--qxc-border-strong); }
  .theme-toggle:hover { border-color: var(--qxc-border-strong); transform: translateY(-1px); }
}
@media (hover: none) {
  .btn:hover, .chip:hover, .theme-toggle:hover { transform: none; }
}
.btn:active, .chip:active, .seg button:active { transform: scale(.97); }

@media (min-width: 1024px) {
  .main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
  }
  .col-main, .col-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  .main-grid .section { margin-top: 0; }

  .ball { width: 40px; height: 40px; font-size: 15px; }
  .heat-cell { min-height: 52px; font-size: 13px; }
  .heat-meta { font-size: 10.5px; }
  .section-overview .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.page-records #record-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }
  body.page-records #record-list .record-card { margin-top: 0; }
  body.page-records .records-head {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-top: 20px;
  }
  body.page-records .records-head > .section { margin-top: 0; }
  .heat-grid { max-width: 800px; }
}

@media (min-width: 1600px) {
  body.page-records #record-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .filter-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .filter-row > div { width: 100%; min-width: 0; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-header { padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: 12px; }
  .brand-badge { width: 38px; height: 38px; font-size: 11px; border-radius: 10px; }
  .page-title { font-size: 17px; }
  .subtitle { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .theme-toggle { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; }
  .header-right { gap: 6px; }
  .header-right .btn-sm { padding: 6px 10px; }

  .card { padding: 14px; border-radius: 14px; }
  .card-title { font-size: 15px; }
  .section { margin-top: 14px; }

  .seg { display: flex; flex-wrap: wrap; width: 100%; }
  .seg button { flex: 1 1 auto; min-width: 0; padding: 9px 10px; white-space: nowrap; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .stat-label { font-size: 11px; }
  .stat .stat-value { font-size: 16px; margin-top: 2px; }
  .section-overview .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill { font-size: 11.5px; padding: 5px 9px; }
  .ball.sm { width: 28px; height: 28px; font-size: 12px; }

  .ball { width: 36px; height: 36px; font-size: 14px; }
  .ball.lg { width: 40px; height: 40px; font-size: 15px; }
  .ball-row { gap: 5px; }
  .ball-run { gap: 5px; }
  .plus { margin: 0 1px; }

  .toolbar { gap: 8px; }
  .toolbar .btn { padding: 11px 12px; min-height: 44px; flex: 1 1 calc(50% - 4px); justify-content: center; }
  .toolbar .btn-primary { flex: 1 1 100%; }
  #toolbar-single .btn-sm, #toolbar-fushi .btn-sm, #toolbar-drag .btn-sm {
    flex: 1 1 calc(50% - 4px); min-height: 44px; padding: 11px 12px; justify-content: center;
  }
  .toolbar .btn-sm { min-height: 36px; padding: 8px 12px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 34px; }

  .fushi-field { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .fushi-field input { font-size: 16px; padding: 11px 10px; }
  .login-input { font-size: 16px; }
  .record-filter select { font-size: 16px; padding: 8px 10px; }

  .record-card { padding: 12px; margin-top: 10px; }
  .record-head { gap: 6px; }
  .record-period { font-size: 14px; }
  .record-bets { font-size: 12px; }
  .record-time { margin-left: 0; width: 100%; font-size: 11px; }
  .record-actions { justify-content: stretch; }
  .record-actions .btn { width: 100%; }
  .pager { flex-wrap: wrap; }

  table.qxc-table.responsive-table,
  table.qxc-table.responsive-table tbody,
  table.qxc-table.responsive-table tr,
  table.qxc-table.responsive-table td { display: block; width: 100%; }
  table.qxc-table.responsive-table thead { display: none; }
  table.qxc-table.responsive-table tr {
    border: 1px solid var(--qxc-border);
    border-radius: 12px;
    background: var(--qxc-surface);
    padding: 10px 12px;
    margin-bottom: 8px;
  }
  table.qxc-table.responsive-table tr:last-child { margin-bottom: 0; }
  table.qxc-table.responsive-table td {
    border: 0; padding: 3px 0; text-align: left; white-space: normal;
    display: flex; align-items: center; gap: 10px;
  }
  table.qxc-table.responsive-table td::before {
    content: attr(data-label);
    flex: 0 0 72px;
    color: var(--qxc-muted);
    font-size: 12px;
    font-weight: 600;
  }
  table.qxc-table.responsive-table td:first-child {
    font-size: 15px; font-weight: 800; padding-bottom: 6px;
    border-bottom: 1px dashed var(--qxc-border-faint); margin-bottom: 4px;
  }
  table.qxc-table.responsive-table td:first-child::before { display: none; }
  table.qxc-table.responsive-table .ball { width: 30px; height: 30px; font-size: 12.5px; }

  .heat-grid { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; max-width: none; }
  .heat-cell { font-size: 11.5px; padding: 6px 1px; }
  .heat-meta { font-size: 9.5px; }

  .disclaimer { font-size: 11.5px; }
}

@media (max-width: 380px) {
  .app-container { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .card { padding: 12px; }
  #qxc-user-info { display: none; }
  .ball { width: 33px; height: 33px; font-size: 13px; }
  .stat-grid, .section-overview .stat-grid { grid-template-columns: 1fr; }
  .fushi-field { flex: 1 1 100%; }
  .toolbar .btn { flex: 1 1 100%; }
  .heat-grid { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }
}
