/* ============================================================
   A+量化 · 设计系统（高保真原型）
   风格：主流 to C 暗色金融科技 · 红涨绿跌 · 金色 VIP
   ============================================================ */

:root {
  /* 背景层级 */
  --bg-page: #0A0E1A;
  --bg-elev-1: #101627;
  --bg-elev-2: #161E33;
  --bg-elev-3: #1D2740;
  --bg-hover: rgba(255, 255, 255, 0.05);

  /* 描边 */
  --border-1: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);

  /* 文字 */
  --text-1: #EDF1F8;
  --text-2: #9AA7BF;
  --text-3: #5D6B85;

  /* 品牌 & 功能色 */
  --brand: #5B8CFF;
  --brand-2: #8A5BFF;
  --brand-grad: linear-gradient(135deg, #5B8CFF 0%, #8A5BFF 100%);
  --cyan: #2DD4BF;

  /* 涨跌（A股：红涨绿跌） */
  --up: #F5485F;
  --up-bg: rgba(245, 72, 95, 0.12);
  --down: #1EC78A;
  --down-bg: rgba(30, 199, 138, 0.12);
  --flat: #8A94A8;
  --flat-bg: rgba(138, 148, 168, 0.12);

  /* VIP 金 */
  --gold: #F2C14E;
  --gold-2: #E09A2B;
  --gold-grad: linear-gradient(135deg, #F7D774 0%, #E09A2B 100%);
  --gold-bg: rgba(242, 193, 78, 0.12);

  /* 状态 */
  --danger: #FF5C6C;
  --warning: #F5A623;
  --success: #1EC78A;
  --info: #5B8CFF;

  /* 形状 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 10px 34px rgba(0, 0, 0, 0.42);
  --shadow-gold: 0 8px 28px rgba(224, 154, 43, 0.28);
  --shadow-brand: 0 8px 26px rgba(91, 140, 255, 0.32);

  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --nav-h: 60px;
  --ticker-h: 34px;
  --max-w: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(1000px 500px at 85% -10%, rgba(91, 140, 255, 0.10), transparent 60%),
    radial-gradient(800px 420px at -10% 20%, rgba(138, 91, 255, 0.08), transparent 55%);
  background-attachment: fixed;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: #7DA3FF; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: rgba(91, 140, 255, 0.35); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: #273251; border-radius: 5px; border: 2px solid var(--bg-page); }
::-webkit-scrollbar-thumb:hover { background: #35436B; }

/* ===================== 顶部免责滚动条 ===================== */
.ticker {
  height: var(--ticker-h);
  background: linear-gradient(90deg, #1A1330, #141B33, #1A1330);
  border-bottom: 1px solid var(--border-1);
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 60;
}
.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 46s linear infinite;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0.3px;
}
.ticker-track span { padding: 0 36px; display: inline-flex; align-items: center; gap: 8px; }
.ticker-track .dot { color: var(--gold); }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===================== 导航栏 ===================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10, 14, 26, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-1);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
  user-select: none;
}
.nav-logo .logo-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand-grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  box-shadow: var(--shadow-brand);
}
.nav-logo .logo-sub { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  color: var(--text-2);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14px;
  transition: all 0.18s ease;
  cursor: pointer;
}
.nav-links a:hover { color: var(--text-1); background: var(--bg-hover); }
.nav-links a.active { color: #fff; background: var(--brand-grad); box-shadow: var(--shadow-brand); }
.nav-links a.nav-vip {
  background: var(--gold-grad);
  color: #3A2A05;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.nav-links a.nav-vip:hover { filter: brightness(1.06); color: #3A2A05; }
.nav-right { display: flex; align-items: center; gap: 10px; }

.role-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--gold-bg); color: var(--gold);
  border: 1px solid rgba(242, 193, 78, 0.4);
}
.role-badge.admin { background: var(--up-bg); color: var(--up); border-color: rgba(245,72,95,.4); }

/* 用户下拉 */
.user-menu { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-1);
  color: var(--text-1);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  font-size: 13px;
  transition: border-color .18s;
}
.user-menu-trigger:hover { border-color: var(--border-2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 160px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: 6px;
  display: none;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.user-dropdown a:hover { background: var(--bg-hover); color: var(--text-1); }
.user-dropdown a.danger { color: var(--danger); }

/* ===================== 布局 & 通用组件 ===================== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 28px 24px 64px; }
.view { display: none; }
.view.active { display: block; animation: view-in 0.28s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.card-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: var(--brand-grad);
}
.card-title.gold::before { background: var(--gold-grad); }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; }
.page-head p { color: var(--text-2); margin-top: 6px; font-size: 13px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-2);
  background: var(--bg-elev-2);
  color: var(--text-1);
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.18s ease;
  user-select: none;
}
.btn:hover { border-color: var(--brand); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand-grad); border: none; color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-gold { background: var(--gold-grad); border: none; color: #3A2A05; font-weight: 700; box-shadow: var(--shadow-gold); }
.btn-gold:hover { filter: brightness(1.06); color: #3A2A05; }
.btn-ghost { background: transparent; border-color: var(--border-1); color: var(--text-2); }
.btn-ghost:hover { color: var(--text-1); border-color: var(--border-2); }
.btn-danger { background: transparent; border-color: rgba(255,92,108,.4); color: var(--danger); }
.btn-danger:hover { background: var(--up-bg); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 30px; font-size: 15px; border-radius: 12px; }

/* 表单 */
.input, .select {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-1);
  color: var(--text-1);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.18); }
.input::placeholder { color: var(--text-3); }
.form-item { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 6px; min-height: 18px; }
.input-row { display: flex; gap: 10px; }
.input-row .input { flex: 1; }

/* 徽章 / 标签 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}
.badge-up { background: var(--up-bg); color: var(--up); }
.badge-down { background: var(--down-bg); color: var(--down); }
.badge-flat { background: var(--flat-bg); color: var(--flat); }
.badge-gold { background: var(--gold-bg); color: var(--gold); border: 1px solid rgba(242,193,78,.35); }
.badge-info { background: rgba(91,140,255,.14); color: var(--brand); }
.badge-warn { background: rgba(245,166,35,.13); color: var(--warning); }
.badge-cyan { background: rgba(45,212,191,.13); color: #2DD4BF; border: 1px solid rgba(45,212,191,.35); }

/* 信号点 */
.dot-yes, .dot-no, .dot-mid {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; font-weight: 800;
}
.dot-yes { background: var(--down-bg); color: var(--down); }
.dot-no { background: var(--up-bg); color: var(--up); }
.dot-mid { background: var(--flat-bg); color: var(--flat); }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-1); border-radius: var(--r-md); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.table thead th {
  background: var(--bg-elev-2);
  color: var(--text-2);
  font-weight: 600;
  text-align: left;
  padding: 11px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-1);
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border-1); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table .num { font-family: var(--mono); }
.text-up { color: var(--up); }
.text-down { color: var(--down); }
.text-gold { color: var(--gold); }
.text-warn { color: var(--warning); }
.text-cyan { color: #2DD4BF; }
.text-muted { color: var(--text-3); }
.text-mask { color: var(--text-3); letter-spacing: 2px; font-family: var(--mono); }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pagination .page-info { color: var(--text-3); font-size: 12px; margin-right: auto; }
.page-btn {
  min-width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-1);
  background: var(--bg-elev-2);
  color: var(--text-2);
  font-size: 13px;
  padding: 0 8px;
  transition: all .15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--text-1); }
.page-btn.active { background: var(--brand-grad); border: none; color: #fff; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-ellipsis { color: var(--text-3); padding: 0 4px; }

/* 页签 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-chip {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-1);
  background: var(--bg-elev-2);
  color: var(--text-2);
  font-size: 13px;
  transition: all .18s;
}
.tab-chip:hover { color: var(--text-1); border-color: var(--border-2); }
.tab-chip.active { background: var(--brand-grad); color: #fff; border: none; box-shadow: var(--shadow-brand); }
.tab-chip .chip-sub { font-size: 11px; opacity: .75; margin-left: 5px; }

/* 提示条 */
.notice {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 16px;
}
.notice-gold { background: var(--gold-bg); border: 1px solid rgba(242,193,78,.3); color: var(--gold); }
.notice-info { background: rgba(91,140,255,.1); border: 1px solid rgba(91,140,255,.3); color: #9FB9FF; }
.notice-danger { background: var(--up-bg); border: 1px solid rgba(245,72,95,.3); color: #FF9AA6; }

.aigc-note { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }

/* AIGC 金色胶囊（全站统一标识） */
.aigc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, rgba(242,193,78,.18), rgba(242,193,78,.06));
  border: 1px solid rgba(242,193,78,.4);
  color: var(--gold); font-size: 11.5px; font-weight: 700;
}

/* AIGC 醒目标识（算参数详情弹窗） */
.aigc-badge {
  margin-left: auto; margin-right: 10px; flex-shrink: 0;
  padding: 4px 12px; border-radius: 999px;
  background: var(--gold-grad); color: #3A2A05;
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(242,193,78,.35);
}
.aigc-banner {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 10px 14px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(242,193,78,.18), rgba(242,193,78,.05));
  border: 1px solid rgba(242,193,78,.4);
  color: var(--gold); font-size: 12.5px; font-weight: 700;
}

/* ===================== 首页 · 智能鉴别 ===================== */
.hero { text-align: center; padding: 46px 0 34px; }
.hero h1 {
  font-size: 40px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(120deg, #FFFFFF 20%, #9FB9FF 55%, #C9A6FF 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-2); margin: 12px 0 30px; font-size: 15px; }
.search-bar {
  display: flex; gap: 0;
  max-width: 560px; margin: 0 auto;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-2);
  transition: border-color .2s, box-shadow .2s;
}
.search-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91,140,255,.15), var(--shadow-2); }
.search-bar input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-1); font-size: 16px; padding: 10px 20px;
  font-family: var(--mono); letter-spacing: 2px;
}
.search-bar input::placeholder { color: var(--text-3); font-family: var(--font); letter-spacing: normal; }
.search-bar .btn { border-radius: 999px; padding: 10px 26px; }
.hero-tips { margin-top: 14px; color: var(--text-3); font-size: 12px; display: flex; gap: 16px; justify-content: center; }
.hero-tips code { color: var(--brand); font-family: var(--mono); cursor: pointer; }

/* 结果区 */
.result-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stock-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--brand-grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
}
.stock-name { font-size: 20px; font-weight: 800; }
.stock-code { color: var(--text-3); font-family: var(--mono); font-size: 13px; margin-left: 8px; }

.price-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.price-card {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.price-card .pc-label { font-size: 12px; color: var(--text-3); }
.price-card .pc-value { font-size: 24px; font-weight: 800; font-family: var(--mono); margin-top: 4px; }
.price-card .pc-sub { font-size: 12px; margin-top: 2px; }

.signal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.signal-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
}
.signal-item .sig-name { color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.sig-state { font-weight: 700; font-size: 12px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-cell { text-align: center; padding: 14px 8px; background: var(--bg-elev-2); border-radius: var(--r-md); border: 1px solid var(--border-1); }
.stat-cell .sc-value { font-size: 18px; font-weight: 800; font-family: var(--mono); }
.stat-cell .sc-label { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* AI 分析区 */
.ai-block {
  background: linear-gradient(180deg, rgba(91,140,255,.07), rgba(138,91,255,.04));
  border: 1px solid rgba(91,140,255,.25);
  border-radius: var(--r-md);
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.85;
}
.ai-block h4 { color: #B9CBFF; font-size: 15px; margin: 14px 0 6px; }
.ai-block h4:first-child { margin-top: 0; }
.ai-block ul { padding-left: 20px; color: var(--text-2); }
.ai-block p { color: var(--text-2); margin: 6px 0; }
.ai-block strong { color: var(--text-1); }
.cursor-blink {
  display: inline-block; width: 8px; height: 16px;
  background: var(--brand); border-radius: 2px;
  vertical-align: -2px; margin-left: 3px;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===================== 算参数 ===================== */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge-label { font-size: 13px; color: var(--text-2); }
.gauge-score { font-size: 34px; font-weight: 800; font-family: var(--mono); }

.strategy-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.strategy-card { border-radius: var(--r-md); padding: 14px 16px; border: 1px solid; }
.strategy-card .sc-title { font-size: 12px; opacity: .85; }
.strategy-card .sc-price { font-size: 20px; font-weight: 800; font-family: var(--mono); margin-top: 4px; }
.strategy-card.c-green { background: var(--down-bg); border-color: rgba(30,199,138,.35); color: var(--down); }
.strategy-card.c-blue { background: rgba(91,140,255,.12); border-color: rgba(91,140,255,.35); color: #9FB9FF; }
.strategy-card.c-red { background: var(--up-bg); border-color: rgba(245,72,95,.35); color: var(--up); }
.strategy-card.c-gold { background: var(--gold-bg); border-color: rgba(242,193,78,.4); color: var(--gold); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.detail-grid { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; } }
.info-cell { background: var(--bg-elev-2); border: 1px solid var(--border-1); border-radius: 10px; padding: 10px 14px; }
.info-cell .ic-label { font-size: 12px; color: var(--text-3); }
.info-cell .ic-value { font-size: 15px; font-weight: 700; font-family: var(--mono); margin-top: 2px; }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===================== VIP 套餐 ===================== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.plan-card {
  position: relative;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
  padding: 26px 22px;
  text-align: center;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.plan-card:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: var(--shadow-2); }
.plan-card.recommend {
  border: 1px solid rgba(242,193,78,.55);
  background: linear-gradient(180deg, rgba(242,193,78,.10), var(--bg-elev-1) 55%);
  box-shadow: var(--shadow-gold);
}
.plan-flag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  padding: 3px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
.plan-flag.gold { background: var(--gold-grad); color: #3A2A05; }
.plan-flag.cyan { background: linear-gradient(135deg,#2DD4BF,#0EA5E9); color: #04202A; }
.plan-name { font-size: 16px; font-weight: 700; margin-top: 6px; }
.plan-price { margin: 14px 0 4px; }
.plan-price .currency { font-size: 18px; color: var(--gold); font-weight: 700; vertical-align: 6px; }
.plan-price .amount { font-size: 44px; font-weight: 800; font-family: var(--mono); color: var(--gold); }
.plan-card:not(.recommend) .plan-price .amount,
.plan-card:not(.recommend) .plan-price .currency { color: var(--text-1); }
.plan-period { color: var(--text-3); font-size: 12px; }
.plan-feats { list-style: none; margin: 18px 0 22px; text-align: left; flex: 1; }
.plan-feats li { display: flex; gap: 8px; color: var(--text-2); font-size: 13px; padding: 5px 0; }
.plan-feats li::before { content: "✓"; color: var(--down); font-weight: 800; }

/* 支付订单 */
.pay-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .pay-layout { grid-template-columns: 1fr; } }
.channel-option {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .18s;
  background: var(--bg-elev-2);
}
.channel-option + .channel-option { margin-top: 10px; }
.channel-option.active { border-color: var(--brand); background: rgba(91,140,255,.08); box-shadow: 0 0 0 3px rgba(91,140,255,.12); }
.channel-option.disabled { opacity: .45; cursor: not-allowed; }
.channel-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.channel-icon.alipay { background: rgba(22,119,255,.15); }
.channel-icon.wechat { background: rgba(9,187,7,.15); }
.order-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border-1); font-size: 13px; }
.order-row:last-child { border-bottom: none; }
.order-row .or-label { color: var(--text-3); }
.order-amount { font-size: 30px; font-weight: 800; font-family: var(--mono); color: var(--gold); }

/* ===================== 弹窗 ===================== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(4, 7, 14, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-mask.open { display: flex; animation: mask-in .2s ease; }
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2);
  animation: modal-in .24s cubic-bezier(.2,.9,.3,1.2);
}
.modal.modal-lg { max-width: 640px; }
.modal.modal-xl { max-width: 860px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 0;
}
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  border: none; background: var(--bg-elev-2); color: var(--text-2);
  font-size: 15px; line-height: 1;
}
.modal-close:hover { background: var(--bg-elev-3); color: var(--text-1); }
.modal-body { padding: 18px 22px 24px; }

/* 登录注册 Tabs */
.auth-tabs { display: flex; background: var(--bg-elev-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; border: none; background: transparent;
  color: var(--text-2); padding: 9px 0; font-size: 14px; border-radius: 9px;
  transition: all .18s;
}
.auth-tabs button.active { background: var(--brand-grad); color: #fff; font-weight: 700; box-shadow: var(--shadow-brand); }

/* 免责声明弹窗 */
.disclaimer-body { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.disclaimer-body h5 { color: var(--text-1); margin: 12px 0 4px; font-size: 13px; }

/* 升级 VIP 弹窗 */
.upgrade-hero { text-align: center; padding: 8px 0 4px; }
.upgrade-hero .crown {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 18px; background: var(--gold-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; box-shadow: var(--shadow-gold);
}

/* 赞赏弹窗 */
.donate-amount {
  text-align: center; font-size: 40px; font-weight: 800;
  font-family: var(--mono); color: var(--gold);
  padding: 10px 0 2px;
  transition: opacity .2s, transform .2s;
}
.donate-amount.swap { opacity: 0; transform: translateY(8px); }
.donate-quick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }

/* ===================== Toast ===================== */
#toast {
  position: fixed; top: 90px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--bg-elev-3);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none;
  transition: all .25s ease;
  z-index: 200;
  max-width: 82vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: rgba(30,199,138,.5); color: var(--down); }
#toast.error { border-color: rgba(245,72,95,.5); color: #FF9AA6; }

/* ===================== 后台管理 ===================== */
.admin-layout { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-side { position: sticky; top: calc(var(--nav-h) + 18px); }
.admin-side .side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: var(--text-2); cursor: pointer; font-size: 14px;
  transition: all .15s;
}
.admin-side .side-item:hover { background: var(--bg-hover); color: var(--text-1); }
.admin-side .side-item.active { background: var(--brand-grad); color: #fff; font-weight: 700; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.mini-stat { background: var(--bg-elev-2); border: 1px solid var(--border-1); border-radius: var(--r-md); padding: 16px 18px; }
.mini-stat .ms-label { font-size: 12px; color: var(--text-3); }
.mini-stat .ms-value { font-size: 24px; font-weight: 800; font-family: var(--mono); margin-top: 4px; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.on { background: var(--success); box-shadow: 0 0 6px rgba(30,199,138,.8); }
.status-dot.off { background: var(--flat); }

/* 富文本工具栏（原型示意） */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-1);
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  padding: 8px;
}
.editor-toolbar button {
  min-width: 30px; height: 30px; padding: 0 7px;
  border: none; background: transparent; color: var(--text-2);
  border-radius: 6px; font-size: 13px;
}
.editor-toolbar button:hover { background: var(--bg-elev-3); color: var(--text-1); }
.editor-toolbar .tb-sep { width: 1px; background: var(--border-1); margin: 4px 5px; }
.editor-area {
  min-height: 260px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-1);
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 16px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.9;
  outline: none;
}
.editor-area:focus { border-color: var(--brand); }

/* 内容页（三不做等） */
.article { font-size: 14px; line-height: 2; color: var(--text-2); }
.article h2 { color: var(--text-1); font-size: 19px; margin: 22px 0 10px; padding-left: 12px; border-left: 4px solid var(--brand); }
.article h3 { color: var(--text-1); font-size: 15px; margin: 16px 0 6px; }
.article p { margin: 8px 0; }
.article ul, .article ol { padding-left: 22px; margin: 8px 0; }
.article li { margin: 4px 0; }
.article blockquote {
  border-left: 3px solid var(--gold);
  background: var(--gold-bg);
  padding: 10px 16px; border-radius: 0 8px 8px 0;
  margin: 12px 0; color: var(--gold);
}
.article code { background: var(--bg-elev-3); padding: 2px 7px; border-radius: 5px; font-family: var(--mono); font-size: 12px; color: #9FB9FF; }
.article table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.article th, .article td { border: 1px solid var(--border-2); padding: 8px 12px; text-align: left; }
.article th { background: var(--bg-elev-2); color: var(--text-1); }

/* ===================== 练习大厅 ===================== */
.lobby-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .lobby-grid { grid-template-columns: 1fr; } }
.fund-hero {
  background: linear-gradient(135deg, rgba(91,140,255,.16), rgba(138,91,255,.10));
  border: 1px solid rgba(91,140,255,.3);
  border-radius: var(--r-lg);
  padding: 24px;
}
.fund-amount { font-size: 38px; font-weight: 800; font-family: var(--mono); }
.level-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
}
.level-gray { background: var(--flat-bg); color: #B9C2D4; border: 1px solid rgba(138,148,168,.4); }
.level-green { background: var(--down-bg); color: var(--down); border: 1px solid rgba(30,199,138,.4); }
.level-blue { background: rgba(91,140,255,.14); color: #9FB9FF; border: 1px solid rgba(91,140,255,.45); }
.level-purple { background: rgba(168,85,247,.15); color: #C9A0FA; border: 1px solid rgba(168,85,247,.45); }
.level-gold { background: var(--gold-bg); color: var(--gold); border: 1px solid rgba(242,193,78,.5); }
.level-red { background: var(--up-bg); color: var(--up); border: 1px solid rgba(245,72,95,.5); }

.rank-row-1 td { background: linear-gradient(90deg, rgba(242,193,78,.14), transparent); }
.rank-row-2 td { background: linear-gradient(90deg, rgba(192,200,214,.10), transparent); }
.rank-row-3 td { background: linear-gradient(90deg, rgba(205,127,50,.10), transparent); }
.rank-medal { font-size: 16px; }

.quiz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .quiz-grid { grid-template-columns: 1fr; } }
.quiz-card {
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: all .18s;
  background: var(--bg-elev-2);
}
.quiz-card:hover { border-color: var(--border-2); }
.quiz-card.active { border-color: var(--brand); background: rgba(91,140,255,.09); box-shadow: 0 0 0 3px rgba(91,140,255,.12); }
.quiz-card .qc-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.quiz-card .qc-desc { color: var(--text-3); font-size: 12px; margin-top: 5px; }
.quiz-card .qc-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent; flex-shrink: 0;
}
.quiz-card.active .qc-check { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ===================== 练习页 ===================== */
.practice-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.progress-track { flex: 1; min-width: 180px; height: 8px; background: var(--bg-elev-3); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-grad); border-radius: 999px; transition: width .4s ease; }
.chart-box { background: var(--bg-elev-1); border: 1px solid var(--border-1); border-radius: var(--r-lg); padding: 10px; }
#mainChart { width: 100%; height: 620px; }
#netChart { width: 100%; height: 300px; }

.fund-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.trade-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.trade-actions .btn { flex: 1; min-width: 130px; }
.btn-hold { background: var(--down-bg); border-color: rgba(30,199,138,.4); color: var(--down); }
.btn-hold:hover { border-color: var(--down); color: var(--down); }
.btn-sell { background: var(--up-bg); border-color: rgba(245,72,95,.4); color: var(--up); }
.btn-sell:hover { border-color: var(--up); color: var(--up); }

.settle-hero { text-align: center; padding: 10px 0 20px; }
.settle-hero .big-return { font-size: 52px; font-weight: 800; font-family: var(--mono); }
.reveal-box {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--bg-elev-2); border: 1px dashed var(--border-2);
  border-radius: var(--r-md); padding: 12px 22px;
}

/* ===================== 页脚 ===================== */
.footer {
  border-top: 1px solid var(--border-1);
  padding: 26px 24px 34px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 30px;
}
.footer a { color: var(--text-3); margin: 0 8px; }
.footer a:hover { color: var(--text-2); }

/* ===================== 赞赏浮动按钮 ===================== */
.donate-fab {
  position: fixed; right: 22px; bottom: 26px;
  z-index: 90;
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #FF6B81, #F5485F);
  color: #fff; border: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 28px rgba(245,72,95,.4);
  transition: transform .18s;
}
.donate-fab:hover { transform: translateY(-3px) scale(1.03); }

/* ===================== 响应式 ===================== */
/* 统一移动端适配规则见文件末尾「移动端 H5 适配」区块（需置于追加组件之后才能生效） */
.nav-links a { white-space: nowrap; }
@media (max-width: 1024px) {
  .nav-links a { padding: 6px 9px; font-size: 13px; }
}

/* ============================================================
   亮色主题 · 高端浅色系（[data-theme="light"]）
   象牙白底 + 深海军蓝文字 + 柔和投影，品牌渐变与金色保持
   ============================================================ */
[data-theme="light"] {
  --bg-page: #F4F6FB;
  --bg-elev-1: #FFFFFF;
  --bg-elev-2: #F0F3FA;
  --bg-elev-3: #E3EAF5;
  --bg-hover: rgba(18, 32, 60, 0.045);

  --border-1: rgba(18, 32, 60, 0.08);
  --border-2: rgba(18, 32, 60, 0.15);

  --text-1: #12203C;
  --text-2: #4A5A75;
  --text-3: #8A97AD;

  --up: #E03350;
  --up-bg: rgba(224, 51, 80, 0.09);
  --down: #0E9F6E;
  --down-bg: rgba(14, 159, 110, 0.10);
  --flat: #66748C;
  --flat-bg: rgba(102, 116, 140, 0.10);

  --gold: #C88A12;
  --gold-bg: rgba(224, 154, 43, 0.13);

  --danger: #D6336C;
  --warning: #D98E04;

  --shadow-1: 0 1px 2px rgba(18, 32, 60, 0.05), 0 6px 20px rgba(18, 32, 60, 0.05);
  --shadow-2: 0 16px 48px rgba(18, 32, 60, 0.14);
  --shadow-gold: 0 8px 26px rgba(224, 154, 43, 0.30);
  --shadow-brand: 0 8px 26px rgba(91, 140, 255, 0.30);
}

[data-theme="light"] body {
  background-image:
    radial-gradient(1000px 500px at 85% -10%, rgba(91, 140, 255, 0.10), transparent 60%),
    radial-gradient(800px 420px at -10% 20%, rgba(138, 91, 255, 0.06), transparent 55%);
}

/* 滚动条 */
[data-theme="light"] ::-webkit-scrollbar-track { background: #F4F6FB; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #C6D0E2; border-color: #F4F6FB; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #A9B8D2; }

/* 顶栏与导航 */
[data-theme="light"] .ticker {
  background: linear-gradient(90deg, #FBF3DE, #EDF3FF, #FBF3DE);
}
[data-theme="light"] .navbar { background: rgba(255, 255, 255, 0.82); }

/* 首页渐变标题 */
[data-theme="light"] .hero h1 {
  background: linear-gradient(120deg, #12203C 20%, #3B5BDB 55%, #7048E8 85%);
  -webkit-background-clip: text; background-clip: text;
}

/* AI 分析区 */
[data-theme="light"] .ai-block {
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.08), rgba(138, 91, 255, 0.04));
  border-color: rgba(91, 140, 255, 0.30);
}
[data-theme="light"] .ai-block h4 { color: #3B5BDB; }

/* 提示条与代码 */
[data-theme="light"] .notice-info { background: rgba(91, 140, 255, 0.08); color: #3B5BDB; }
[data-theme="light"] .notice-danger { color: #D6336C; }
[data-theme="light"] .article code { color: #3B5BDB; }

/* 弹窗遮罩 */
[data-theme="light"] .modal-mask { background: rgba(18, 32, 60, 0.32); }

/* 仪表盘（内联 SVG 硬编码色覆盖） */
[data-theme="light"] .gauge-wrap circle[stroke="#1D2740"] { stroke: #E3EAF5; }
[data-theme="light"] .gauge-wrap text[fill="#9AA7BF"] { fill: #8A97AD; }

/* 策略卡 / 修仙等级在浅色下的文字色加深 */
[data-theme="light"] .strategy-card.c-blue { color: #3B5BDB; }
[data-theme="light"] .level-blue { color: #3B5BDB; }
[data-theme="light"] .badge-cyan { color: #0D9488; }
[data-theme="light"] .text-cyan { color: #0D9488; }
[data-theme="light"] .level-purple { color: #9333AE; }

/* 资金卡 */
[data-theme="light"] .fund-hero {
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.12), rgba(138, 91, 255, 0.07));
  border-color: rgba(91, 140, 255, 0.28);
}

/* 演示工具条 */
[data-theme="light"] .demo-bar { background: rgba(255, 255, 255, 0.94); }

/* 主题切换按钮 */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-1);
  background: var(--bg-elev-2);
  font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.15); }
.theme-toggle .tt-sun { display: none; }
.theme-toggle .tt-moon { display: inline; }
[data-theme="light"] .theme-toggle .tt-sun { display: inline; }
[data-theme="light"] .theme-toggle .tt-moon { display: none; }

/* ============================================================
   业务组件补充（对接后端渲染逻辑）
   ============================================================ */

/* 工具 */
.hidden { display: none !important; }
.user-dropdown.show { display: block; }
.page-meta { color: var(--text-3); font-size: 12px; margin-bottom: 14px; }
.param-empty { text-align: center; color: var(--text-2); padding: 48px 0; }
.loading-line { text-align: center; color: var(--text-2); padding: 32px 0; }
.error-msg {
  max-width: 560px; margin: 14px auto 0;
  background: var(--up-bg); border: 1px solid rgba(245,72,95,.3);
  color: #FF9AA6; border-radius: var(--r-md);
  padding: 10px 16px; font-size: 13px; text-align: center;
}
[data-theme="light"] .error-msg { color: #D6336C; }

/* 首页搜索后 Hero 收缩 */
.hero.compact { padding: 22px 0 18px; }
.hero.compact h1 { font-size: 26px; }
.hero.compact p { margin: 8px 0 20px; font-size: 13px; }

/* SSE 流式未稳定文本 */
.pending-text { color: var(--text-2); white-space: pre-wrap; }

/* 关注票池 */
.watch-form { display: flex; gap: 10px; flex-wrap: wrap; }
.watch-form .input { flex: 1; min-width: 160px; }
.watch-input {
  background: var(--bg-elev-2); border: 1px solid var(--brand);
  color: var(--text-1); border-radius: 8px; padding: 4px 8px; font-size: 13px;
  outline: none; max-width: 120px;
}

/* 行内角色下拉 */
.role-select {
  background: var(--bg-elev-2); border: 1px solid var(--border-1);
  color: var(--text-1); border-radius: 8px; padding: 4px 8px; font-size: 12px;
  outline: none;
}

/* 支付渠道（真实单选按钮版） */
.channel-option input[type="radio"] { display: none; }
.channel-option .radio-dot { margin-left: auto; color: var(--text-3); }
.channel-option.active .radio-dot { color: var(--brand); }

/* 赞赏金额输入 */
.donate-amount-box {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 14px 0 6px;
}
.donate-amount-input {
  width: 150px; text-align: center;
  background: var(--bg-elev-2); border: 1px solid var(--border-2);
  color: var(--gold); border-radius: 12px;
  font-size: 30px; font-weight: 800; font-family: var(--mono);
  padding: 8px 12px; outline: none;
  transition: transform .2s, border-color .2s;
}
.donate-amount-input:focus { border-color: var(--gold); }
.donate-unit { color: var(--text-2); font-size: 14px; }
.donate-refresh {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-1); background: var(--bg-elev-2);
  color: var(--text-2); font-size: 16px;
  transition: transform .3s;
}
.donate-refresh:hover { color: var(--text-1); border-color: var(--border-2); }
.donate-amount-anim { height: 18px; font-size: 12px; color: var(--text-3); transition: opacity .2s; }

/* 练习页图表容器 */
#practiceChart { width: 100%; height: 560px; }
#settleChart { width: 100%; height: 300px; }

/* 结算股票揭晓 */
.settle-reveal { text-align: center; }
.settle-reveal-code { font-size: 22px; font-weight: 800; }
.settle-reveal-period { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* Quill 富文本编辑器主题适配 */
.ql-toolbar.ql-snow {
  border: 1px solid var(--border-1); border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: var(--bg-elev-2);
}
.ql-container.ql-snow {
  border: 1px solid var(--border-1);
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--bg-elev-1);
  min-height: 280px;
  font-size: 14px;
}
.ql-editor { color: var(--text-1); line-height: 1.9; }
.ql-editor.ql-blank::before { color: var(--text-3); }
.ql-snow .ql-stroke { stroke: var(--text-2); }
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill { fill: var(--text-2); }
.ql-snow .ql-picker { color: var(--text-2); }
.ql-snow .ql-picker-options { background: var(--bg-elev-2); border-color: var(--border-2) !important; }
.ql-snow .ql-picker-item:hover, .ql-snow .ql-picker-item.ql-selected { color: var(--brand); }
.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label { border-color: var(--border-2); }
.ql-snow button:hover .ql-stroke, .ql-snow button.ql-active .ql-stroke { stroke: var(--brand); }
.ql-snow button:hover .ql-fill, .ql-snow button.ql-active .ql-fill { fill: var(--brand); }
.ql-editor table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.ql-editor td, .ql-editor th { border: 1px solid var(--border-2); padding: 8px 12px; }
.ql-editor blockquote { border-left: 3px solid var(--gold); background: var(--gold-bg); padding: 8px 14px; border-radius: 0 8px 8px 0; }
.ql-editor code, .ql-editor pre { background: var(--bg-elev-3); border-radius: 6px; }

/* ============================================================
   移动端 H5 适配（手机竖屏优先）
   置于此处是为了压过上方追加组件区的同名规则（如图表固定高度）
   ============================================================ */

/* 网格子元素防撑破：允许收缩到 min-content 以下（内部表格自行横向滚动） */
.lobby-grid > *, .admin-layout > *, .pay-layout > *, .detail-grid > * { min-width: 0; }

/* 平板 / 窄桌面：大厅双栏变单栏 */
@media (max-width: 1024px) {
  .lobby-grid { grid-template-columns: 1fr; }
}

/* 手机 H5（≤720px） */
@media (max-width: 720px) {
  /* 布局与导航：菜单独立成第二行通栏 tab 条（一行 logo+操作，二行栏目横滑） */
  .container { padding: 16px 12px 48px; }
  .navbar { padding: 0 12px; gap: 8px; flex-wrap: wrap; padding-bottom: 0; height: auto; min-height: var(--nav-h); }
  .nav-logo { flex-shrink: 0; font-size: 16px; }
  .nav-logo .logo-sub { display: none; }
  .nav-right { flex-shrink: 0; gap: 6px; margin-left: auto; }
  .nav-links {
    order: 3; flex: 1 0 100%; min-width: 0;
    overflow-x: auto; scrollbar-width: none;
    border-top: 1px solid var(--border-1);
    padding: 6px 0 8px; gap: 4px;
    scroll-snap-type: x proximity;
    /* 右侧渐隐提示可滑动 */
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 88%, transparent 100%);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 6px 10px; font-size: 13px; scroll-snap-align: start; white-space: nowrap; }

  /* 首页 · 智能鉴别 */
  .hero { padding: 30px 0 24px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 13px; margin: 10px 0 22px; }
  .search-bar input { min-width: 0; padding: 9px 14px; font-size: 14px; letter-spacing: 1px; }
  .search-bar .btn { padding: 9px 16px; font-size: 13px; }
  .hero-tips { flex-wrap: wrap; gap: 8px 14px; }
  .price-cards { grid-template-columns: 1fr; }
  .price-card .pc-value { font-size: 20px; }
  .stock-name { font-size: 17px; }

  /* 通用卡片 / 页头 / 统计格 */
  .card { padding: 16px 14px; }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 20px; }
  .stat-cards { gap: 10px; }
  .mini-stat { padding: 12px 14px; }
  .mini-stat .ms-value { font-size: 19px; }
  .ai-block { padding: 14px; font-size: 13px; }

  /* 表格：手机上允许更窄，横向滑动查看 */
  table.table { min-width: 560px; font-size: 12px; }
  .table thead th, .table tbody td { padding: 9px 10px; }

  /* 弹窗：收窄边距、增高可视区 */
  .modal-mask { padding: 12px; }
  .modal { max-height: 92vh; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }

  /* 后台管理：侧栏变横向滚动条 */
  .admin-side { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .admin-side .side-item { white-space: nowrap; padding: 8px 12px; font-size: 13px; }

  /* 练习大厅 */
  .quiz-grid { grid-template-columns: 1fr; }
  .fund-hero .fund-amount { font-size: 26px; word-break: break-all; }

  /* 练习页 */
  .practice-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .practice-head h1 { font-size: 17px !important; }
  #practiceChart { height: 430px; }
  #settleChart { height: 240px; }
  .settle-hero .big-return { font-size: 38px; }
  .trade-actions { gap: 8px; }
  .trade-actions .btn { min-width: 0; padding-left: 10px; padding-right: 10px; font-size: 13px; }

  /* 悬浮赞赏按钮 */
  .donate-fab { right: 14px; bottom: 18px; padding: 10px 16px; font-size: 13px; }

  /* 页脚 */
  .footer { padding: 20px 14px 28px; margin-top: 20px; }
}

/* 小屏手机（≤400px）：统计格两列紧凑排布 */
@media (max-width: 400px) {
  .fund-bar { grid-template-columns: repeat(2, 1fr); }
  .signal-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .strategy-cards { grid-template-columns: 1fr; }
  .gauge-score { font-size: 28px; }
  #practiceChart { height: 380px; }
  .plan-price .amount { font-size: 36px; }
}

/* ===== P3a 加权总分 ===== */
.score-num { font-family: var(--mono); font-weight: 700; }
.score-hi { color: var(--gold); font-weight: 800; }
.score-mid { color: var(--brand); }
.score-lo { color: var(--text-3); }

/* ===== P3c/P3d 后台回测报告与权重配置 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--bg-elev-2); border: 1px solid var(--border-1); border-radius: var(--r-sm); padding: 14px 16px; }
.stat-card .stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 24px; font-weight: 800; font-family: var(--mono); color: var(--text-1); }
.stat-card .stat-value.up { color: var(--up); }
.stat-card .stat-value.down { color: var(--down); }
.weight-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 14px 0; }
.weight-form .wf-item label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.weight-form .wf-item .input { width: 100%; }
.mono-note { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

/* ===== H5 卡片表格模式（≤720px）：宽表每行转卡片，标签:值 排列 ===== */
@media (max-width: 720px) {
  #recommendTable, #poolStrategyWrap .table {
    min-width: 0;
    font-size: 13px;
  }
  #recommendTable thead, #poolStrategyWrap .table thead { display: none; }
  #recommendTable tbody tr, #poolStrategyWrap .table tbody tr {
    display: block;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    margin-bottom: 10px;
    padding: 4px 2px;
  }
  /* 浅色主题：卡片取纯白与原灰蓝之间的中间档，避免太亮或太糊 */
  [data-theme="light"] #recommendTable tbody tr, [data-theme="light"] #poolStrategyWrap .table tbody tr {
    background: #FAFBFE;
  }
  #recommendTable tbody td, #poolStrategyWrap .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border: none;
    text-align: right;
  }
  #recommendTable tbody td::before, #poolStrategyWrap .table tbody td::before {
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
  }
  /*  colspan 占位行（空数据/登录提示/加载失败）还原为整行 */
  #recommendTable tbody td[colspan], #poolStrategyWrap .table tbody td[colspan] {
    display: block; text-align: center;
  }
  #recommendTable tbody td[colspan]::before, #poolStrategyWrap .table tbody td[colspan]::before { content: none; }

  /* 智能策略表列标签（17 列） */
  #recommendTable td:nth-child(1)::before { content: '股票代码'; }
  #recommendTable td:nth-child(2)::before { content: '股票名称'; }
  #recommendTable td:nth-child(3)::before { content: '状态'; }
  #recommendTable td:nth-child(4)::before { content: '总分'; }
  #recommendTable td:nth-child(5)::before { content: '上榜次数'; }
  #recommendTable td:nth-child(6)::before { content: '葛兰碧第一天'; }
  #recommendTable td:nth-child(7)::before { content: '双均线之上'; }
  #recommendTable td:nth-child(8)::before { content: '做多趋势'; }
  #recommendTable td:nth-child(9)::before { content: '短线'; }
  #recommendTable td:nth-child(10)::before { content: '中线'; }
  #recommendTable td:nth-child(11)::before { content: '长线'; }
  #recommendTable td:nth-child(12)::before { content: '量能'; }
  #recommendTable td:nth-child(13)::before { content: 'MACD'; }
  #recommendTable td:nth-child(14)::before { content: 'RSI'; }
  #recommendTable td:nth-child(15)::before { content: 'ADX'; }
  #recommendTable td:nth-child(16)::before { content: '止损位'; }
  #recommendTable td:nth-child(17)::before { content: '换手率'; }
  /* 代码+名称两行突出为卡片头 */
  #recommendTable td:nth-child(1), #recommendTable td:nth-child(2),
  #poolStrategyWrap .table td:nth-child(3), #poolStrategyWrap .table td:nth-child(4) {
    font-weight: 700;
  }

  /* 票池策略表列标签（19 列） */
  #poolStrategyWrap .table td:nth-child(1)::before { content: '日期'; }
  #poolStrategyWrap .table td:nth-child(2)::before { content: '批次'; }
  #poolStrategyWrap .table td:nth-child(3)::before { content: '股票代码'; }
  #poolStrategyWrap .table td:nth-child(4)::before { content: '股票名称'; }
  #poolStrategyWrap .table td:nth-child(5)::before { content: '状态'; }
  #poolStrategyWrap .table td:nth-child(6)::before { content: '总分'; }
  #poolStrategyWrap .table td:nth-child(7)::before { content: '上榜次数'; }
  #poolStrategyWrap .table td:nth-child(8)::before { content: '葛兰碧第一天'; }
  #poolStrategyWrap .table td:nth-child(9)::before { content: '双均线之上'; }
  #poolStrategyWrap .table td:nth-child(10)::before { content: '做多趋势'; }
  #poolStrategyWrap .table td:nth-child(11)::before { content: '短线'; }
  #poolStrategyWrap .table td:nth-child(12)::before { content: '中线'; }
  #poolStrategyWrap .table td:nth-child(13)::before { content: '长线'; }
  #poolStrategyWrap .table td:nth-child(14)::before { content: '量能'; }
  #poolStrategyWrap .table td:nth-child(15)::before { content: 'MACD'; }
  #poolStrategyWrap .table td:nth-child(16)::before { content: 'RSI'; }
  #poolStrategyWrap .table td:nth-child(17)::before { content: 'ADX'; }
  #poolStrategyWrap .table td:nth-child(18)::before { content: '止损位'; }
  #poolStrategyWrap .table td:nth-child(19)::before { content: '换手率'; }
}

/* ===== H5 卡片表格增强：代码&名称一行两个，其余指标三个一行（标签在上值在下） ===== */
@media (max-width: 720px) {
  #recommendTable tbody tr, #poolStrategyWrap .table tbody tr {
    display: flex;
    flex-wrap: wrap;
  }
  #recommendTable tbody td, #poolStrategyWrap .table tbody td {
    box-sizing: border-box;
  }
  /* colspan 占位行保持整行 */
  #recommendTable tbody td[colspan], #poolStrategyWrap .table tbody td[colspan] { flex: 1 0 100%; }

  /* 智能策略：股票代码+股票名称 一行两个（卡片头） */
  #recommendTable tbody td:nth-child(1), #recommendTable tbody td:nth-child(2) {
    flex: 1 0 50%; min-width: 140px;
  }
  /* 票池策略：日期+批次、股票代码+股票名称 一行两个 */
  #poolStrategyWrap .table tbody td:nth-child(1), #poolStrategyWrap .table tbody td:nth-child(2),
  #poolStrategyWrap .table tbody td:nth-child(3), #poolStrategyWrap .table tbody td:nth-child(4) {
    flex: 1 0 50%; min-width: 140px;
  }

  /* 其余指标列：三个一行，标签在上、值在下，紧凑居中（block 布局保证行内值不堆叠） */
  #recommendTable tbody td:nth-child(n+3),
  #poolStrategyWrap .table tbody td:nth-child(n+5) {
    flex: 1 0 33.3%; min-width: 100px;
    display: block;
    text-align: center;
    padding: 5px 4px;
  }
  #recommendTable tbody td:nth-child(n+3)::before,
  #poolStrategyWrap .table tbody td:nth-child(n+5)::before {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
  }

  /* H5 短标签：三个一行更清爽 */
  #recommendTable td:nth-child(5)::before { content: '上榜'; }
  #recommendTable td:nth-child(6)::before { content: '葛兰碧'; }
  #recommendTable td:nth-child(7)::before { content: '双均线'; }
  #recommendTable td:nth-child(8)::before { content: '做多'; }
  #recommendTable td:nth-child(16)::before { content: '止损'; }
  #recommendTable td:nth-child(17)::before { content: '换手'; }
  #poolStrategyWrap .table td:nth-child(7)::before { content: '上榜'; }
  #poolStrategyWrap .table td:nth-child(8)::before { content: '葛兰碧'; }
  #poolStrategyWrap .table td:nth-child(9)::before { content: '双均线'; }
  #poolStrategyWrap .table td:nth-child(10)::before { content: '做多'; }
  #poolStrategyWrap .table td:nth-child(18)::before { content: '止损'; }
  #poolStrategyWrap .table td:nth-child(19)::before { content: '换手'; }
}

/* ===== H5：窄列表取消最小宽度（排行榜 5 列可自然放下） ===== */
@media (max-width: 720px) {
  #leaderboardTable { min-width: 0; }
}
@media (max-width: 720px) {
  #leaderboardTable { font-size: 11.5px; }
  #leaderboardTable thead th, #leaderboardTable tbody td { padding: 8px 4px; white-space: nowrap; }
  #leaderboardTable td.num { font-size: 11px; }
}
@media (max-width: 720px) {
  /* 排行榜继续收窄：用户名截断、灵石数字缩小，确保 390px 免横滑 */
  #leaderboardTable td:nth-child(2), #leaderboardTable th:nth-child(2) { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  #leaderboardTable td:nth-child(4), #leaderboardTable td:nth-child(5) { font-size: 10.5px; }
  /* 隐藏 ◇ 前缀、修仙等级徽章缩小，进一步压缩列宽 */
  #leaderboardTable .ls-prefix { display: none; }
  #leaderboardTable td:nth-child(3) .level-badge { font-size: 10.5px; padding: 2px 6px; }
}
