:root {
  /* ── 色彩体系：对齐 macOS Sonoma / iOS 17 系统色 ──
     设计原则：语义色降饱和（避免廉价感），中性色用完整 6 阶灰阶建立层次，
     强调色只用于真正需要吸引注意的交互/状态。 */
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --panel: rgba(255, 255, 255, .72);
  --panel-blur: saturate(180%) blur(20px);   /* 毛玻璃材质 */

  /* 文字 6 阶灰阶（primary → quaternary label，对标 SF） */
  --text: #1d1d1f;          /* primary：标题/正文 */
  --text-2: #424245;        /* secondary：次级正文 */
  --text-3: #6e6e73;        /* tertiary：标签/辅助 */
  --text-4: #86868b;        /* quaternary：最次级/占位 */
  --muted: var(--text-3);

  /* 系统语义色（统一降一档饱和度，更耐看） */
  --primary: #0071e3;       /* systemBlue */
  --primary-dark: #0058b9;
  --primary-tint: rgba(0, 113, 227, .10);
  --green: #30b85d;         /* systemGreen，略降饱和 */
  --orange: #f2912b;        /* systemOrange，去刺眼感 */
  --red: #e5484d;           /* systemRed，柔化 */
  --slate: #8e8e93;         /* systemGray */
  --optimistic: #34a8d8;    /* 乐观档语义色：概率图乐观条/图例点（统一原硬编码值） */

  /* 表面/分隔 */
  --surface-1: #f2f2f7;     /* 标签/卡片次表面 */
  --surface-2: #e5e5ea;     /* 轨道/凹陷 */
  --surface-3: #d1d1d6;     /* 更深凹陷 */
  --border: rgba(0, 0, 0, .07);
  --border-strong: rgba(0, 0, 0, .12);
  --hairline: rgba(0, 0, 0, .06);   /* 1px 发丝线 */

  /* 阴影体系——3 级，对标 macOS 浮起感（轻、长投影、低不透明度） */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .03);
  --shadow: 0 4px 12px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .04);

  /* 圆角体系——4 级，对标 macOS（容器越大圆角越大） */
  --radius-xs: 8px;        /* 小标签/chip */
  --radius-sm: 10px;       /* input/tag */
  --radius-md: 14px;       /* 卡片/表格 */
  --radius-lg: 18px;       /* 面板 */
  --radius-xl: 22px;       /* 大容器/hero */
  --radius-pill: 980px;

  /* 语义墨色 */
  --notice-ink: #0b3d73;
  --danger-ink: #8a1f18;
  --th-bg: rgba(245, 245, 247, .92);

  /* 动效（第9轮统一引用） */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .15s;
  --dur: .25s;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 背景改为克制的双层：极淡的顶光 + 纯净底色，去掉生硬径向渐变 */
  background:
    linear-gradient(180deg, rgba(0, 113, 227, .025) 0%, transparent 280px),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "ss01";
  letter-spacing: -.011em;   /* SF 标准负字距，提升紧凑度 */
}

/* ── 深色模式：对标 macOS 暗色，覆盖关键 token（非暴力反转，保留语义色辨识度） ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --panel: rgba(28, 28, 30, .72);
    --text: #f5f5f7;
    --text-2: #d1d1d6;
    --text-3: #8e8e93;
    --text-4: #636366;
    --muted: var(--text-3);
    --primary: #0a84ff;        /* 暗色下 systemBlue 提亮 */
    --primary-dark: #409cff;
    --primary-tint: rgba(10, 132, 255, .18);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --slate: #636366;
    --optimistic: #64d2f0;     /* 暗色下乐观档提亮，对标 systemTeal 暗色 */
    --surface-1: #2c2c2e;
    --surface-2: #3a3a3c;
    --surface-3: #48484a;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .15);
    --hairline: rgba(255, 255, 255, .08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .2);
    --shadow: 0 4px 12px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
    --th-bg: rgba(28, 28, 30, .92);
    --notice-ink: #5ab9ff;
    --danger-ink: #ff8a80;
  }
  body {
    background: linear-gradient(180deg, rgba(10, 132, 255, .04) 0%, transparent 280px), var(--bg);
  }
  /* 深色下输入框/select 的 SVG 箭头需提亮 */
  select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%238e8e93' d='M2 4l4 4 4-4'/></svg>");
  }
}

/* ── 排印字阶（Type Scale）：对标 SF，5 级 ──
   字重克制：400 正文 / 500 强调 / 600 标题，避免 800 廉价感。 */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 22px 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}

h1 {
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.15;
  letter-spacing: -.022em;
  margin: 14px 0 8px;
  font-weight: 600;
}

.hero-title { display: block; }

.subtitle {
  max-width: 640px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-3);
  margin: 0;
  letter-spacing: -.005em;
}

/* panel/stat-card 的容器样式 —— macOS frosted glass 材质 */
.panel, .stat-card {
  background: var(--panel);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.decision-shell {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 16px;
}

.panel { padding: 24px; margin: 20px 0; }
.decision-shell .panel { margin: 0; }
/* 输入面板是决策起点：用 subtle 左色条 + 略强阴影锚定首屏焦点，引导"从这里开始" */
.predictor {
  position: sticky; top: 16px;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-lg);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.slim-title { margin-bottom: 12px; }
.section-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 600; }
.section-title p { color: var(--muted); margin: 4px 0 0; line-height: 1.45; font-size: 13px; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.compact-form { grid-template-columns: 1fr; gap: 12px; }

label { display: grid; gap: 6px; color: var(--text-3); font-size: 12px; font-weight: 500; letter-spacing: .01em; }
input, select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 15px;
  background: var(--surface-1);
  color: var(--text);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
input:hover, select:hover { border-color: var(--text-4); }
input:focus, select:focus {
  border-color: var(--primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px var(--primary-tint);
}
/* select 自定义箭头（对标 macOS 原生下拉） */
select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2386868b' d='M2 4l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
/* number input 去掉原生 spinner（更干净） */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
input.invalid { border-color: var(--red); background: rgba(229, 72, 77, .06); }
input.invalid:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(229, 72, 77, .12); }

button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
#predictBtn { width: 100%; margin-top: 16px; }
button:hover { background: var(--primary-dark); }
button:active { transform: scale(.97); }              /* 按压反馈 */
button:focus-visible { box-shadow: 0 0 0 4px var(--primary-tint); }
/* F1: 导出按钮 —— 次要动作用 systemGreen，与主按钮形成层级 */
.export-btn { width: 100%; margin-top: 16px; background: var(--green); font-weight: 600; }
.export-btn:hover { background: #28a352; }
.export-btn:active { transform: scale(.97); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 0 12px; }
.stat-card { padding: 14px; min-height: 82px; box-shadow: var(--shadow-sm); }
.stat-card strong { display: block; font-size: 28px; letter-spacing: -.02em; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }

.result-panel { min-height: 470px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.compact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 8px 0 4px; font-size: 18px; letter-spacing: -.015em; font-weight: 600; }
.card .major { color: var(--muted); min-height: 20px; line-height: 1.4; font-size: 13px; }

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 2px; }
.card-type { color: var(--muted); font-size: 11px; font-weight: 500; }

.level { display: inline-flex; border-radius: var(--radius-pill); padding: 4px 10px; color: #fff; font-weight: 600; font-size: 11px; letter-spacing: .02em; }
.level.冲 { background: var(--red); }
.level.稳 { background: var(--orange); }
.level.保 { background: var(--green); }
.level.险 { background: var(--slate); }
.prob { font-size: 34px; font-weight: 700; letter-spacing: -.025em; margin: 6px 0; }
.prob-block { margin: 8px 0; }
.prob-main { display: flex; align-items: baseline; gap: 8px; }
.prob-main span { color: var(--muted); font-size: 12px; font-weight: 500; }
.prob-main strong { font-size: 34px; font-weight: 700; letter-spacing: -.025em; }
.prob-scenarios { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 11px; font-weight: 500; margin-top: 6px; }
.prob-scenarios span { background: var(--surface-1); border-radius: var(--radius-pill); padding: 4px 9px; }
.prob-note { background: rgba(242, 145, 43, .12) !important; color: var(--orange); cursor: help; }

.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.tag { border-radius: var(--radius-pill); padding: 4px 10px; background: var(--surface-1); color: var(--text-2); font-size: 11px; font-weight: 500; }
.tag-key { background: var(--primary-tint); color: var(--primary); }
.tag-warn { background: rgba(229, 72, 77, .10); color: var(--danger-ink); }
.tag-emp { background: rgba(48, 184, 93, .12); color: #1a7a3a; }
/* 院校招生信息标签：网址/电话为可点击链接，note 为合并等特殊提示 */
.tag-url { background: var(--primary-tint); color: var(--primary); text-decoration: none; }
.tag-url:hover { text-decoration: underline; }
.tag-tel { background: var(--surface-1); color: var(--text-1); text-decoration: none; }
.tag-tel:hover { text-decoration: underline; }
.tag-note { background: rgba(202, 138, 4, .12); color: #8a5a00; font-size: 10.5px; line-height: 1.45; }
.school-info { margin: 4px 0 10px; align-items: flex-start; }
.school-info .tag-note { max-width: 100%; }

/* .warn：规则表停招标记/补录警示（主页面用，原仅 export 内联有定义，此处补齐）
   语义与 .tag-warn 对齐：红字红底，醒目提示风险。 */
.warn {
  display: inline-block;
  background: rgba(229, 72, 77, .10);
  color: var(--danger-ink);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}

/* .tag-emp 暗色适配：固定深绿 #1a7a3a 在暗色背景下对比度不足，改用亮绿 */
@media (prefers-color-scheme: dark) {
  .tag-emp { color: var(--green); }
  .tag-note { color: #f0c050; }
}

/* 卡片次级详情折叠 */
.card-detail { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 8px; }
.card-detail > summary {
  cursor: pointer; list-style: none; color: var(--primary); font-size: 12px; font-weight: 700;
  padding: 2px 0;
}
.card-detail > summary::-webkit-details-marker { display: none; }
.card-detail > summary::before { content: '▸ '; }
.card-detail[open] > summary::before { content: '▾ '; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.card-detail .reason {
  color: var(--muted); line-height: 1.6; font-size: 12px;
  display: block; -webkit-line-clamp: unset; overflow: visible; cursor: default;
}

.notice {
  border: 1px solid rgba(0,113,227,.12);
  background: rgba(0,113,227,.07);
  color: #0b3d73;
  border-radius: var(--radius-md);
  padding: 13px 15px;
  margin-bottom: 14px;
  line-height: 1.6;
  font-size: 14px;
}
.compact-notice { margin-bottom: 12px; }
.notice.danger {
  border-color: rgba(255,59,48,.18);
  background: rgba(255,59,48,.08);
  color: #8a1f18;
}

.chart-panel { margin-top: 18px; }
.chart-title { align-items: center; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.conservative { background: var(--text-4); }
.legend-dot.standard { background: var(--primary); }
.legend-dot.optimistic { background: var(--optimistic); }
.chart-hint {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-tint);
  color: var(--notice-ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
/* F4: 分层筛选 chip */
.level-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.level-chip {
  margin: 0; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg-elevated); color: var(--text-2); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.level-chip:hover { border-color: rgba(0,113,227,.3); transform: translateY(-1px); }
.level-chip:active { transform: scale(.96); }
.level-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.empty-state { color: var(--muted); text-align: center; padding: 28px; font-size: 14px; }

/* F2: 院校对比 */
.compare-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 760px) { .compare-selects { grid-template-columns: 1fr; } }
.compare-table th { white-space: normal; }   /* 对比表头允许换行，院校名+专业竖排 */
.compare-table td { font-size: 12px; }
.compare-table .muted { color: var(--muted); font-size: 11px; font-weight: 600; }
.chart { display: grid; gap: 11px; }
.compact-chart { grid-template-columns: repeat(2, 1fr); }
.chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 46px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chart-row:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 113, 227, .22);
  box-shadow: var(--shadow-lg);
}
.chart-label-block { min-width: 0; }
.chart-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; letter-spacing: -.01em; }
.chart-label-block span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-track { height: 10px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.chart-bar { height: 100%; border-radius: var(--radius-pill); display: block; }
.chart-bar.zero { width: 3px !important; min-width: 0; }
.scenario-bars { display: grid; gap: 6px; }
.scenario-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}
.scenario-line em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 500; letter-spacing: .03em; }
.scenario-line b { color: var(--text-2); font-size: 11px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.scenario-line .chart-bar { height: 6px; background: var(--surface-1); transition: width var(--dur) var(--ease); }
.primary-line .chart-bar { height: 8px; }
/* 概率图三档固定语义色：与 .legend-dot 图例严格对齐
   （保底灰 / 标准蓝 / 乐观青）。分层信息由右侧 .chart-score 彩色圆圈表达，
   三档条形不再重复分层染色，避免与图例的"标准=蓝"矛盾。 */
.chart-bar.conservative { background: var(--text-4); }
.chart-bar.standard { background: var(--primary); }
.chart-bar.optimistic { background: var(--optimistic); }
.chart-score {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chart-score.冲 { background: var(--red); }
.chart-score.稳 { background: var(--orange); }
.chart-score.保 { background: var(--green); }
.chart-score.险 { background: var(--slate); }

.knowledge-panel { margin-top: 18px; }
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  overflow-x: auto;
}
.tab {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 15px;
  color: var(--text-2);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
}
.tab.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* P2: 一分一段表内的子标签（体育/文化） */
.subtabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: var(--radius-pill); background: var(--surface-1); }
.subtab { margin: 0; padding: 6px 16px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.subtab.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-sm); }

.toolbar { display: grid; grid-template-columns: 150px minmax(220px, 360px); gap: 10px; align-items: center; }
.score-toolbar { margin-bottom: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: rgba(255,255,255,.86); max-height: 420px; }
.compact-table { max-height: 360px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; background: var(--th-bg); color: var(--text-2); font-weight: 600; backdrop-filter: blur(8px); }
tbody tr:hover td { background: rgba(0,113,227,.04); }
tbody tr:last-child td { border-bottom: 0; }
/* 录取规则表跨行续行（rowspan 合并院校/专业列后，续行 td 只含规则）：
   续行弱化上边框，与首行形成"同校多规则"的视觉分组。 */
tr.rule-cont td { border-top: 1px dashed var(--hairline); }
tr.rule-cont + tr.rule-cont td,
tr.rule-cont td:first-child { color: var(--text-3); }

footer { text-align: center; color: var(--text-4); padding: 32px 20px 48px; font-size: 12px; line-height: 1.6; }

/* B5: 键盘焦点可见性（input 已有 focus 样式，补 button/tab/chart-row 等可交互元素） */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.tab:focus-visible, .chart-row:focus-visible { outline-offset: -2px; }

/* 尊重用户的减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  /* 入场动画禁用时，直接显示最终态（避免 fadeUp 起始的 opacity:0 导致内容不可见） */
  #results .card,
  #probabilityChart .chart-row { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* F3: 趋势折线图 */
.trend-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.trend-view-btn {
  margin: 0; padding: 8px 18px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg-elevated); color: var(--text-2); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.trend-view-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.trend-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.trend-card {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px;
  background: rgba(255, 255, 255, .72); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur);
  box-shadow: var(--shadow-sm);
}
.trend-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.trend-card-head strong { font-size: 15px; font-weight: 600; }
.trend-card-head .muted { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.trend-badge { font-size: 12px; font-weight: 600; white-space: nowrap; }
.sparkline { width: 100%; height: auto; display: block; }

/* 图表视图：汇总统计条 */
.trend-summary {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin-bottom: 16px; padding: 14px 16px;
  background: rgba(0,113,227,.05); border-radius: var(--radius-md);
  border: 1px solid rgba(0,113,227,.1);
}
@media (max-width: 760px) { .trend-summary { grid-template-columns: repeat(2, 1fr); } }
.trend-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trend-stat strong { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.trend-stat span { font-size: 11px; color: var(--muted); font-weight: 500; }
.trend-stat.up strong { color: var(--green); }
.trend-stat.down strong { color: var(--red); }

/* 卡片：趋势状态徽章 + 稳定性 + 边框状态色 */
.trend-card.volatile { border-color: rgba(255,159,10,.35); }
.trend-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.trend-state { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); }
.trend-state.expand { background: rgba(48, 184, 93, .12); color: var(--green); }
.trend-state.shrink { background: rgba(229, 72, 77, .12); color: var(--red); }
.trend-state.flat { background: rgba(142,142,147,.15); color: var(--slate); }
.trend-stab { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: var(--radius-pill); }
.trend-stab.stable { background: rgba(52,199,89,.1); color: var(--green); }
.trend-stab.medium { background: rgba(255,159,10,.12); color: var(--orange); }
.trend-stab.volatile { background: rgba(255,59,48,.12); color: var(--red); }

/* 表格视图：排序表头 */
#historyTableEl th[data-sort] { cursor: pointer; user-select: none; }
#historyTableEl th[data-sort]:hover { color: var(--primary); }
#historyTableEl th.sorted { color: var(--primary); }


/* ---- 响应式 ----
   B3 修复：原 1080px 断点把 compact-form 改成 3 列（窄屏反而变多列，逻辑反了）。
   现改为：宽屏多列、窄屏单列；cards/chart 用 auto-fit/minmax 自适应，避免硬性列数。 */
@media (max-width: 1080px) {
  .hero, .decision-shell { grid-template-columns: 1fr; }
  .predictor { position: static; }
  .compact-form { grid-template-columns: repeat(2, 1fr); }   /* 中屏 2 列 */
  .compact-cards, .compact-chart { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  /* .compact-form 的 2 列已在 ≤1080px 断点定义，此处不重复 */
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero { padding-top: 22px; }
  h1 { font-size: 26px; }                                     /* hero 已精简，移动端跟随桌面收敛 */
  .compact-form, .stats, .cards { grid-template-columns: 1fr; }
  .section-title { display: block; }
  .toolbar { grid-template-columns: 1fr; }

  /* —— P0: 移动端概率图重排，修复横向挤压失效 —— */
  .chart-row { grid-template-columns: 1fr; }
  .chart-score {
    justify-self: start;
    width: 32px; height: 32px; font-size: 13px;               /* 圆圈缩小，避免占位 */
  }
  /* 三档改为更大的条形 + 更清晰的数值：标签栏收窄、数值栏去掉固定宽让条形占满 */
  .scenario-line {
    grid-template-columns: 28px minmax(0, 1fr) 38px;          /* 条形获得更多空间 */
    gap: 8px;
  }
  .scenario-line .chart-bar { height: 10px; }                  /* 条形加粗，移动端可见性 */
  .primary-line .chart-bar { height: 13px; }
  .scenario-line em { font-size: 11px; }
  .scenario-line b { font-size: 11px; font-weight: 600; color: var(--text-2); }
}

/* 第7轮: 示例值提示 + 信息架构 */
.hint-inline { color: var(--orange); font-weight: 500; font-size: 12px; }

/* 第9轮: 2026志愿样表——专业组 + 多专业 + 调剂 */
.major-list { font-size: 13px; margin: 8px 0 6px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-md); }
.major-list strong { display: block; margin-bottom: 6px; color: var(--text); }
.major-chip { display: inline-block; padding: 2px 8px; margin: 2px 3px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; background: var(--surface-2); }
.major-chip.冲 { background: rgba(229, 72, 77, .12); color: var(--red); }
.major-chip.稳 { background: rgba(242, 145, 43, .15); color: var(--orange); }
.major-chip.保 { background: rgba(48, 184, 93, .15); color: var(--green); }
.major-chip.险 { background: rgba(142, 142, 147, .15); color: var(--slate); }
.transfer-hint { font-size: 12px; font-weight: 700; color: var(--orange); margin-top: 4px; padding: 4px 0; }
.detail-major { padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-major:last-child { border-bottom: none; }
.detail-major strong { font-size: 14px; display: block; margin-bottom: 4px; }
.detail-major .detail-tags { margin: 4px 0; }
.detail-major .reason { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 第8轮: 概率图行可点击展开详情，加交互提示 */
.chart-row { cursor: pointer; }
.chart-row:focus-visible { outline-offset: -2px; }

/* ── 入场动画：结果卡片/概率图行渐入上浮，让数据呈现有节奏（对标苹果列表加载） ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#results .card,
#probabilityChart .chart-row {
  animation: fadeUp var(--dur) var(--ease) both;
}
/* 错峰：每张卡片延迟 40ms，形成级联 */
#results .card:nth-child(1), #probabilityChart .chart-row:nth-child(1) { animation-delay: 0ms; }
#results .card:nth-child(2), #probabilityChart .chart-row:nth-child(2) { animation-delay: 40ms; }
#results .card:nth-child(3), #probabilityChart .chart-row:nth-child(3) { animation-delay: 80ms; }
#results .card:nth-child(4), #probabilityChart .chart-row:nth-child(4) { animation-delay: 120ms; }
#results .card:nth-child(n+5), #probabilityChart .chart-row:nth-child(n+5) { animation-delay: 160ms; }

/* details 展开/收起的平滑过渡 */
.card-detail { transition: opacity var(--dur) var(--ease); }

/* ════════ 打赏浮动按钮 ════════ */
.donate-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(238, 90, 36, .35);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease;
}
.donate-float:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 8px 28px rgba(238, 90, 36, .45);
}
.donate-float:active { transform: scale(.96); }
.donate-float svg { flex-shrink: 0; }

/* ════════ 打赏弹窗 ════════ */
.donate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: donateFadeIn .25s ease;
}
.donate-overlay[hidden] { display: none; }

@keyframes donateFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes donateSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.donate-modal {
  position: relative;
  width: min(420px, 90vw);
  background: var(--bg-elevated, #fff);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
  overflow: hidden;
  animation: donateSlideUp .3s cubic-bezier(.34,1.56,.64,1);
}

.donate-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.06);
  color: var(--text-3, #6e6e73);
  font-size: 16px;
  cursor: pointer;
  transition: background .15s ease;
  z-index: 1;
  padding: 0;
}
.donate-close:hover { background: rgba(0,0,0,.12); }

.donate-header {
  text-align: center;
  padding: 32px 28px 16px;
}
.donate-icon { font-size: 40px; margin-bottom: 8px; }
.donate-header h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #1d1d1f);
}
.donate-header p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-3, #6e6e73);
}

.donate-body { padding: 0 28px 20px; }

.donate-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-4, #86868b);
  font-size: 13px;
}
.donate-divider::before,
.donate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, rgba(0,0,0,.07));
}

.donate-qr-placeholder { text-align: center; }
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
  border: 2px dashed var(--border-strong, rgba(0,0,0,.12));
  border-radius: 14px;
  background: var(--surface-1, #f2f2f7);
}
.qr-icon { font-size: 36px; }
.qr-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2, #424245);
  line-height: 1.5;
}
.qr-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-4, #86868b);
}

.donate-footer {
  text-align: center;
  padding: 8px 28px 20px;
}
.donate-footer p {
  margin: 0;
  font-size: 12px;
  color: var(--text-4, #86868b);
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .donate-overlay { background: rgba(0,0,0,.65); }
  .donate-close { background: rgba(255,255,255,.1); color: var(--text-3); }
  .donate-close:hover { background: rgba(255,255,255,.18); }
  .unlock-bar { background: rgba(255,255,255,.06); color: #f5f5f7; }
  .unlock-bar:hover { background: rgba(255,255,255,.1); }
  .unlock-input { background: #2c2c2e; color: #f5f5f7; border-color: #3a3a3c; }
  .tier-card { background: #1c1c1e; }
  .tier-card:hover { border-color: var(--primary, #0a84ff); }
  .tier-recommend { border-color: #ff9f0a; }
  .paywall-overlay { background: rgba(0,0,0,.78); }
}

/* ════════ 解锁栏 ════════ */
.unlock-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0,113,227,.06);
  color: var(--primary, #0071e3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
  border-top: 1px solid var(--border, rgba(0,0,0,.07));
  letter-spacing: .01em;
}
.unlock-bar:hover { background: rgba(0,113,227,.12); }
.unlock-bar.unlocked { color: var(--green, #30b85d); background: rgba(48,184,93,.08); }

/* ════════ 解锁码输入区 ════════ */
.unlock-code-section { margin-bottom: 8px; }
.order-query-section { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-2, #e5e5e7); }
.unlock-code-label { font-size: 13px; color: var(--text-2, #424245); margin: 0 0 8px; font-weight: 500; }
.unlock-input-row { display: flex; gap: 8px; }
.unlock-input {
  flex: 1;
  border: 2px solid var(--border-strong, rgba(0,0,0,.12));
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  background: var(--surface-1, #f2f2f7);
  color: var(--text, #1d1d1f);
  outline: none;
  transition: border-color .15s ease;
  text-transform: uppercase;
}
.unlock-input:focus { border-color: var(--primary, #0071e3); }
.unlock-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 20px;
  background: var(--primary, #0071e3);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.unlock-btn:hover { background: var(--primary-dark, #0058b9); }
.unlock-msg { margin-top: 8px; font-size: 13px; font-weight: 500; min-height: 20px; }
.unlock-msg.success { color: var(--green, #30b85d); }
.unlock-msg.error { color: var(--red, #e5484d); }
.unlock-msg.loading { color: var(--text-3, #6e6e73); }

/* ════════ 档位卡片 ════════ */
.tier-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.tier-cards-single { grid-template-columns: 1fr; }   /* 单档卡占满宽度 */
@media (max-width: 480px) { .tier-cards { grid-template-columns: 1fr; } }
.tier-card {
  position: relative;
  border: 2px solid var(--border, rgba(0,0,0,.07));
  border-radius: 14px;
  padding: 16px;
  background: var(--bg-elevated, #fff);
  transition: border-color .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 单档卡：内容居中，避免左对齐导致右侧大片空白 */
.tier-cards-single .tier-card { text-align: center; align-items: center; }
.tier-cards-single .tier-card .tier-features { align-self: stretch; }
.tier-card:hover { border-color: var(--primary, #0071e3); transform: translateY(-2px); }
.tier-recommend { border-color: rgba(0,0,0,.08); }   /* 单档卡：中性边框，去除误导性橙色 */
.tier-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--orange, #f2912b);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.tier-name { font-size: 16px; font-weight: 700; color: var(--text, #1d1d1f); }
.tier-price-block { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.tier-price { font-size: 36px; font-weight: 800; color: var(--text, #1d1d1f); letter-spacing: -.02em; line-height: 1.1; }
.tier-price-sub { font-size: 12px; color: var(--text-4, #86868b); }
.tier-features { display: flex; flex-direction: column; gap: 6px; }
.tier-features span { font-size: 13px; color: var(--text-3, #6e6e73); }
.tier-btn {
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 999px;
  border: 0;
  color: var(--text, #1d1d1f);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  margin-top: auto;
  transition: all .15s ease;
  cursor: pointer;
}
.tier-btn:hover { opacity: .88; }
.tier-btn-primary { background: var(--primary, #0071e3); color: #fff; }
.tier-btn-primary:hover { background: var(--primary-dark, #0058b9); opacity: 1; }
.unlock-tip { font-size: 12px; color: var(--text-4, #86868b); line-height: 1.5; text-align: center; }

/* ════════ 虎皮椒支付区 ════════ */
.xh-pay-area { margin: 10px 0; }
.xh-pay-inner { max-width: 320px; margin: 0 auto; }
.xh-pay-hint { text-align: center; font-size: 12px; color: var(--text-3, #6e6e73); margin: 0 0 8px; line-height: 1.6; }
/* 二维码区按钮分层：主操作满宽 + 次要链接并排 */
.pay-actions-secondary { display: flex; justify-content: center; gap: 16px; margin-top: 10px; }
.pay-actions-secondary a, .pay-actions-secondary button {
  background: none; border: 0; padding: 0;
  font-size: 13px; color: var(--primary, #0071e3);
  cursor: pointer; text-decoration: none;
}
.pay-actions-secondary a:hover, .pay-actions-secondary button:hover { text-decoration: underline; }
/* 状态切换淡入动画 */
.tier-cards, .xh-pay-area { animation: fadeInUp .3s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ════════ 订单号领取解锁码 ════════ */
.claim-section { margin-top: 14px; }
.claim-details {
  border: 1px solid var(--border, rgba(0,0,0,.07));
  border-radius: 14px;
  padding: 4px 14px;
  background: var(--surface-1, #f2f2f7);
}
.claim-details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #0071e3);
  padding: 10px 0;
}
.claim-details > summary::-webkit-details-marker { display: none; }
.claim-details[open] > summary { border-bottom: 1px solid var(--border, rgba(0,0,0,.07)); margin-bottom: 10px; }
.claim-body { padding: 0 0 12px; }
.claim-desc { font-size: 12px; color: var(--text-3, #6e6e73); margin: 0 0 10px; line-height: 1.5; }
.claim-input-row { display: flex; gap: 8px; }
.claim-result {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-elevated, #fff);
  border: 2px solid var(--green, #30b85d);
  text-align: center;
}
.claim-code-label { font-size: 14px; font-weight: 600; color: var(--text, #1d1d1f); margin-bottom: 8px; }
.claim-code {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--primary, #0071e3);
  background: var(--primary-tint, rgba(0,113,227,.1));
  padding: 10px 16px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 8px;
}
.claim-code-hint { font-size: 12px; color: var(--text-4, #86868b); margin: 0; }

/* ════════ 付费遮罩 ════════ */
.paywall-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 998;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.paywall-overlay.active { display: flex; }
.paywall-content { text-align: center; padding: 24px; }
.paywall-icon { font-size: 48px; margin-bottom: 12px; }
.paywall-content h3 { margin: 0 0 6px; font-size: 20px; color: #fff; }
.paywall-content p { margin: 0 0 18px; font-size: 14px; color: rgba(255,255,255,.7); }
.paywall-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 32px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease;
  box-shadow: 0 4px 16px rgba(238,90,36,.35);
}
.paywall-btn:hover { transform: scale(1.05); }

