:root {
  --bg: #eef2f7;
  --bg-2: #f1f4f9;
  --card: #ffffff;
  --card-2: #f4f6fb;
  --line: #e2e8f1;
  --line-soft: #eef1f6;
  --text: #16202e;
  --muted: #687587;
  --accent: #0bb98a;
  --accent-2: #2563eb;
  --up: #0a9d6e;
  --down: #e23b4e;
  --gold: #c98a00;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(20,30,50,.07);
  --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* 关键：hidden 属性必须能隐藏元素，否则 display:flex/grid 会压过它，导致界面切换失效 */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(22,224,166,.07), transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.85); backdrop-filter: blur(12px); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 22px; color: var(--accent); filter: drop-shadow(0 0 8px rgba(22,224,166,.6)); }
.brand-name { font-weight: 700; letter-spacing: 1px; font-size: 18px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); padding: 5px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.user-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.data-badge {
  font-size: 11px; letter-spacing: .5px;
  background: rgba(59,130,246,.15); color: var(--accent-2);
  padding: 4px 9px; border-radius: 6px; border: 1px solid rgba(59,130,246,.3); white-space: nowrap;
}

/* ---------- 按钮 / 控件 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; transition: .15s; font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #0fb98a); color: #04231a; border: none; box-shadow: 0 4px 16px rgba(22,224,166,.22); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { opacity: .6; cursor: default; filter: none; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.block.sm { padding: 9px; margin-top: 6px; }
.select { background: var(--card-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 14px; cursor: pointer; }
.select.sm { padding: 7px 10px; font-size: 13px; }
.select.block { width: 100%; }
input { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 11px 13px; font-size: 14px; width: 100%; margin-top: 6px; }
input:focus, .select:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ---------- 落地页：左介绍 + 右登录 ---------- */
.landing {
  min-height: calc(100vh - var(--topbar-h));
  display: grid; grid-template-columns: 1.05fr 420px; align-items: center;
  gap: 40px; max-width: 1120px; margin: 0 auto; padding: 40px 32px;
}
.landing-intro { padding-right: 10px; }
.intro-title { font-size: 38px; line-height: 1.25; font-weight: 800; letter-spacing: .5px; }
.intro-title .hl {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro-lead { color: var(--muted); font-size: 15px; line-height: 1.8; margin: 18px 0 28px; max-width: 540px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-bottom: 26px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list .fi {
  font-size: 18px; width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
}
.feature-list li div { display: flex; flex-direction: column; gap: 3px; }
.feature-list b { font-size: 14.5px; font-weight: 700; }
.feature-list span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.intro-disclaimer { font-size: 12px; color: var(--muted); line-height: 1.7; border-left: 2px solid var(--gold); padding-left: 12px; max-width: 540px; }

.landing-auth { display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 410px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 30px; box-shadow: var(--shadow); }
.auth-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.auth-card-head .logo { font-size: 26px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; background: var(--bg-2); padding: 5px; border-radius: 10px; }
.tab { flex: 1; padding: 9px; border: none; background: transparent; color: var(--muted); border-radius: 7px; cursor: pointer; font-weight: 600; }
.tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(20,30,50,.12); }
.auth-error { color: var(--down); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* 同意协议勾选 */
.agree-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); margin: 2px 0 16px; cursor: pointer; }
.agree-row input[type="checkbox"] { width: auto; margin: 2px 0 0; transform: scale(1.15); accent-color: var(--accent); flex: 0 0 auto; }
.agree-row a { color: var(--accent); text-decoration: none; }
.agree-row a:hover { text-decoration: underline; }

/* 通用弹窗（服务与隐私协议） */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10,20,35,.55); backdrop-filter: blur(4px); }
.modal-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 540px; max-height: 86vh; display: flex; flex-direction: column; padding: 22px 24px; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-x { border: none; background: var(--bg-2); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.modal-x:hover { color: var(--text); }
.modal-body { overflow-y: auto; padding-right: 6px; margin-bottom: 16px; }
.modal-body h4 { font-size: 14px; margin: 16px 0 6px; color: var(--text); }
.modal-body p { font-size: 13px; color: var(--muted); line-height: 1.75; margin-bottom: 6px; }
.modal-body b { color: var(--text); }
.agreement-intro { margin-bottom: 8px; }
.agreement-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text) !important; }

/* 顶栏操作区 */
.top-actions { display: flex; align-items: center; gap: 12px; }

/* 密码提示 + 记住我 + 忘记密码 */
.pw-tip { font-size: 12px; color: var(--gold); line-height: 1.6; margin: -6px 0 14px; }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 14px; gap: 12px; }
.remember-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0; cursor: pointer; }
.remember-row input[type="checkbox"] { width: auto; margin: 0; transform: scale(1.1); accent-color: var(--accent); flex: 0 0 auto; }
.forgot-link { font-size: 12.5px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.forgot-link:hover { text-decoration: underline; }

/* 交流群弹窗 */
.group-card { max-width: 340px; text-align: center; }
.group-body { padding: 4px 0; }
.group-tip { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.group-qr { width: 200px; height: 200px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; place-items: center; }
.group-qr img { width: 100%; height: 100%; object-fit: contain; }
.group-qr-ph { width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; }
.group-qr-ph small { font-size: 11px; opacity: .8; }
.group-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.group-divider::before, .group-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.group-qq { font-size: 14px; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.group-qq b { font-size: 16px; letter-spacing: .5px; }
.group-note { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.6; }

@media (max-width: 920px) {
  .landing { grid-template-columns: 1fr; gap: 28px; padding: 32px 22px; }
  .intro-title { font-size: 30px; }
  .landing-auth { justify-content: stretch; }
  .auth-card { max-width: none; }
}
@media (max-width: 560px) {
  .intro-title { font-size: 26px; }
  .feature-list { gap: 12px; }
  .intro-lead { margin: 14px 0 20px; }
}

/* ---------- 建仓 ---------- */
.onboard { min-height: calc(100vh - var(--topbar-h)); display: flex; justify-content: center; align-items: flex-start; padding: 48px 24px; }
.onboard-card { max-width: 460px; width: 100%; }
.onboard-card h2 { margin-bottom: 6px; }
.onboard-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.field-label { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
/* 十档选择列表 */
.tier-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; margin-bottom: 12px; padding-right: 4px; }
.tier-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; cursor: pointer; transition: .15s; background: var(--bg-2); }
.tier-row:hover { border-color: var(--accent-2); }
.tier-row.selected { border-color: var(--accent); background: rgba(11,185,138,.08); box-shadow: 0 0 0 1px var(--accent) inset; }
.tier-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tier-name { font-weight: 700; font-size: 14.5px; }
.tier-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.tier-max { text-align: right; flex: 0 0 auto; }
.tier-max-label { display: block; font-size: 10px; color: var(--muted); }
.tier-max b { font-size: 16px; color: var(--up); font-variant-numeric: tabular-nums; }
.tier-hint { font-size: 11px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.tier-hint b { color: var(--text); }

/* ---------- 仪表盘布局：侧栏 + 内容 ---------- */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column;
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 14px; border: none; background: transparent; color: var(--muted);
  border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; text-align: left; transition: .15s;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--card-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item .ni { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.mini-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 12px; }
.mini-label .select { margin-top: 6px; }

.content { padding: 26px 30px 70px; max-width: 1000px; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.view-title { font-size: 21px; font-weight: 700; }
.view-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-inline { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-value.up { color: var(--up); }
.kpi-value.down { color: var(--down); }
.chart-card canvas { width: 100% !important; }

/* 策略表现 */
.stat-strip { display: grid; grid-template-columns: repeat(6,1fr); gap: 12px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 13px; text-align: center; }
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.stat-val { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-val.up { color: var(--up); }
.stat-val.down { color: var(--down); }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12px; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(11,185,138,.05); }
.data-table .empty { text-align: center; color: var(--muted); padding: 30px; }
.data-table input[type="number"] { width: 92px; padding: 7px 9px; margin: 0; }
.data-table input[type="checkbox"] { width: auto; transform: scale(1.2); accent-color: var(--accent); }
.match-teams { font-weight: 600; }
.match-meta { font-size: 11px; color: var(--muted); }

.pill { padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block; }
.pill.home { background: rgba(37,99,235,.12); color: #2563eb; }
.pill.draw { background: rgba(201,138,0,.14); color: var(--gold); }
.pill.away { background: rgba(226,59,77,.12); color: var(--down); }
.pill.won { background: rgba(10,157,110,.13); color: var(--up); }
.pill.lost { background: rgba(226,59,77,.12); color: var(--down); }
.pill.placed { background: rgba(104,117,135,.14); color: var(--muted); }
.edge-tag { color: var(--up); font-weight: 700; font-variant-numeric: tabular-nums; }

/* AI 研判框 */
.ai-box { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, rgba(37,99,235,.07), rgba(11,185,138,.07)); border: 1px solid rgba(37,99,235,.25); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.ai-badge { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); padding: 4px 10px; border-radius: 7px; letter-spacing: .5px; }
.ai-box p { font-size: 13px; color: var(--text); line-height: 1.7; margin: 0; }
.gen-time { color: var(--accent-2) !important; font-size: 12px; margin-bottom: 4px; }

.notes { font-size: 13px; color: var(--muted); line-height: 1.8; }
.notes:not(:empty) { margin-bottom: 14px; }
.notes div { padding: 2px 0; }
.plan-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 12px; }
#planSummary { color: var(--text); font-weight: 600; }

/* 积分榜 */
.standings-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.standing-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--card); }
.standing-box h4 { font-size: 13px; color: var(--accent); margin-bottom: 8px; }
.standing-box table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.standing-box th { color: var(--muted); font-weight: 500; text-align: center; padding: 5px; font-size: 11px; }
.standing-box td { padding: 6px 4px; text-align: center; border-top: 1px solid var(--line-soft); }
.standing-box td:first-child, .standing-box th:first-child { text-align: left; }
.standing-box tr.qualified td { color: var(--accent); }
.rating-up { color: var(--up); font-weight: 600; }
.rating-down { color: var(--down); font-weight: 600; }
.rating-chart-head { gap: 12px; align-items: flex-start; }
.rating-chart-head h3 { margin-bottom: 2px; }
.rating-chart-head .select { min-width: 150px; }
.rating-ai { margin: 8px 0 12px; }

/* 方案：逐行操作（采纳/反向/不投） */
.plan-act { padding: 5px 8px; font-size: 12px; border-radius: 8px; min-width: 64px; }
.row-skip { opacity: .42; }
.rev-tag { font-size: 10px; font-weight: 700; color: #fff; background: var(--gold); padding: 1px 5px; border-radius: 5px; vertical-align: middle; }

/* 自选研判 */
.custom-picker { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.pick-row { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); cursor: pointer; color: var(--text); }
.pick-row:hover { border-color: var(--accent); }
.pick-row input[type="checkbox"] { width: auto; margin: 0; transform: scale(1.15); accent-color: var(--accent); flex: 0 0 auto; }
.pick-team { font-weight: 600; font-size: 13.5px; flex: 1; }
.custom-match { padding: 16px 20px; }
.cm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.cm-verdict { margin-bottom: 10px; }
.verdict { font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 8px; display: inline-block; }
.verdict.ok { color: var(--up); background: rgba(10,157,110,.12); }
.verdict.no { color: var(--muted); background: var(--bg-2); }
.verdict.warn { color: var(--gold); background: rgba(201,138,0,.12); line-height: 1.6; }
.best-row { background: rgba(11,185,138,.06); }
.best-tag { font-size: 10px; font-weight: 700; color: #fff; background: var(--accent); padding: 1px 6px; border-radius: 5px; }
.edge-pos { color: var(--up); font-weight: 700; font-variant-numeric: tabular-nums; }
.edge-neg { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 进阶玩法分区 */
.mk-section-head { font-size: 12.5px; font-weight: 700; color: var(--text); margin: 6px 0 8px; padding-left: 8px; border-left: 3px solid var(--accent); }
.mk-section { margin-top: 16px; }
.mk-block { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.mk-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 6px; }
.mk-real { font-size: 10px; font-weight: 700; color: #fff; background: var(--up); padding: 2px 7px; border-radius: 6px; }
.mk-model { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--line); padding: 2px 7px; border-radius: 6px; }
.mk-note { font-size: 11.5px; color: var(--gold); line-height: 1.5; margin: 2px 0 8px; }
.mk-table { font-size: 13px; }
.mk-table th { font-size: 11px; padding: 6px 10px; }
.mk-table td { padding: 8px 10px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center; gap: 8px;
    border-right: none; border-bottom: 1px solid var(--line); padding: 10px 14px; overflow-x: auto;
  }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { white-space: nowrap; padding: 9px 12px; }
  .nav-item.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .nav-item .ni { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: none; display: flex; gap: 8px; align-items: center; }
  .sidebar-foot .mini-label { margin: 0; }
  .sidebar-foot .mini-label .select { margin: 0; }
  .sidebar-foot .btn.block { width: auto; }
  .content { padding: 20px 16px 60px; }
}
@media (max-width: 680px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .risk-cards { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(3,1fr); }
  .standings-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .top-right { gap: 8px; }
  .user-chip { display: none; }
}

/* ============ 移动端深度适配 ============ */
@media (max-width: 860px) {
  /* 侧栏退化为顶部细工具条：仅放 风格选择 + 新建账户（导航移到底部） */
  .sidebar { padding: 8px 14px; }
  .sidebar-foot { flex: 1; margin: 0; padding: 0; border: none; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
  .sidebar-foot .mini-label { font-size: 0; margin: 0; }   /* 隐藏“投注风格”文字，只留下拉框 */
  .sidebar-foot .mini-label .select { font-size: 13px; }
  #newPortfolioBtn { white-space: nowrap; width: auto; }

  /* 导航 → 底部标签栏：固定在底部，图标 + 短标签，清晰直观 */
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    flex: none; flex-direction: row; justify-content: space-around; gap: 0; overflow: visible;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(20,30,50,.06);
  }
  .nav-item {
    flex: 1; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 2px; border-radius: 10px; color: var(--muted); white-space: nowrap;
  }
  .nav-item .ni { display: block; font-size: 18px; opacity: 1; width: auto; }
  .nav-item .nav-label { display: none; }
  .nav-item::after { content: attr(data-m); font-size: 11px; font-weight: 600; }
  .nav-item.active { background: transparent; color: var(--accent); box-shadow: none; }

  /* 内容区底部留白，避免被底部导航遮挡 */
  .content { padding-bottom: 84px; }

  /* “加入交流群” → 右下角悬浮按钮 */
  #groupBtn {
    position: fixed; right: 14px; bottom: 82px; z-index: 45;
    background: linear-gradient(135deg, var(--accent), #0fb98a); color: #04231a;
    border: none; border-radius: 24px; padding: 11px 16px; font-weight: 700; font-size: 13px;
    box-shadow: 0 6px 22px rgba(11,185,138,.45);
  }
  #groupBtn::before { content: "💬 "; }
}

@media (max-width: 640px) {
  .content { padding: 16px 12px 88px; }
  .card { padding: 16px 14px; }
  .view-title { font-size: 19px; }
  .view-head { margin-bottom: 16px; }
  .rating-chart-head { flex-direction: column; align-items: stretch; }
  .rating-chart-head .select { width: 100%; min-width: 0; }
  input, .select { font-size: 16px; }                    /* 防止 iOS 聚焦时整页放大 */
  #portfolioSelect { max-width: 118px; font-size: 13px; }

  /* 宽表格 → 卡片堆叠：每行变成一张小卡，单元格左标签右内容 */
  .data-table thead { display: none; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table tr {
    display: block; background: var(--bg-2); border: 1px solid var(--line);
    border-radius: 12px; padding: 2px 14px; margin-bottom: 10px;
  }
  .data-table tr:hover td { background: transparent; }
  .data-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: normal;
  }
  .data-table tr td:last-child { border-bottom: none; }
  .data-table td::before {
    content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600;
    text-align: left; flex: 0 0 40%;
  }
  .data-table td.empty { display: block; text-align: center; padding: 22px 0; }
  .data-table td.empty::before { content: none; }
  .data-table input[type="number"] { width: 120px; }
  .match-teams { text-align: right; }

  /* 方案底部确认区竖排 */
  .plan-foot { flex-direction: column; align-items: stretch; }
  .plan-foot .btn { width: 100%; }

  .stat-strip { grid-template-columns: repeat(2,1fr); }
  .custom-picker { grid-template-columns: 1fr; }
  .cm-head { flex-direction: column; gap: 2px; }
}
