/* ============================================================================
   EducationCompass 设计系统 v2
   ----------------------------------------------------------------------------
   设计值来源：redesign-existing-projects / landing-page-design 的 Design Values。
   · 字体：Manrope Variable（自托管 woff2）+ 中文回退 PingFang SC / Microsoft YaHei / Noto Sans SC
   · 颜色：一个强调色（品牌蓝）+ 单一中性灰族（hue 260），暗色只用 #000000 / #181818 / #1F1F1F / #272727 / #313131
   · 背景一律纯色，唯一的渐变是首屏标题文字
   · 圆角取 Tailwind 步进；间距取 0/2/4/8/12/16/24/32/40/48/64/80/96
   · 动效统一 cubic-bezier(0.22,1,0.36,1)，位移 500ms，颜色/透明度 300ms
   ========================================================================== */

/* ---------- 字体（自托管的 Manrope Variable，拉丁子集 ~40KB） ---------- */
@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/assets/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 设计令牌 ---------- */
:root {
  color-scheme: light;

  /* 字体 */
  --font-family: "Manrope Variable", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system,
    "Segoe UI Variable Text", sans-serif;
  --font-mono: var(--font-family);

  /* 中性表面（同一灰族，hue 260，chroma ≤ .008；不混用冷暖灰） */
  --background: oklch(97.4% 0.003 260);
  --card: oklch(100% 0 0);
  --card-foreground: oklch(21% 0.012 260);
  --foreground: oklch(21% 0.012 260);
  --secondary: oklch(94.8% 0.005 260);
  --secondary-foreground: oklch(31% 0.012 260);
  --muted: oklch(94.8% 0.005 260);
  --muted-foreground: oklch(49% 0.012 260);
  --subtle: oklch(91% 0.006 260);
  --border: oklch(89.6% 0.006 260);
  --border-strong: oklch(82% 0.008 260);

  /* 唯一强调色（品牌蓝，chroma .165 ≈ HSL 饱和度 74%） */
  --primary: oklch(52% 0.165 262);
  --primary-strong: oklch(45% 0.17 262);
  --primary-soft: oklch(94.4% 0.024 262);
  --primary-foreground: oklch(99% 0.004 262);
  --ring: var(--primary);
  --accent: oklch(94.4% 0.024 262);
  --accent-foreground: oklch(33% 0.085 262);

  /* 语义色（低饱和，只用于状态，不参与装饰） */
  --success: oklch(52% 0.11 154);
  --success-soft: oklch(95% 0.03 154);
  --warning: oklch(56% 0.11 68);
  --warning-soft: oklch(96% 0.035 80);
  --danger: oklch(53% 0.15 25);
  --danger-soft: oklch(95.5% 0.03 25);

  /* 院校封面底色（不使用渐变，靠首字母 + 国家标记构成识别） */
  --cover: oklch(93.2% 0.018 262);
  --cover-initial: oklch(52% 0.165 262 / 0.2);

  /* 阴影：只给浮层，且带背景色相（不用纯黑） */
  --shadow-sm: 0 1px 2px oklch(25% 0.03 262 / 0.06);
  --shadow-md: 0 2px 4px oklch(25% 0.03 262 / 0.05), 0 10px 24px oklch(25% 0.03 262 / 0.07);
  --shadow-lg: 0 4px 10px oklch(25% 0.03 262 / 0.06), 0 24px 56px oklch(25% 0.03 262 / 0.12);
  --shadow-float: 0 1px 1px oklch(25% 0.03 262 / 0.04), 0 8px 28px oklch(25% 0.03 262 / 0.09);

  /* 圆角：Tailwind 步进（2 / 4 / 6 / 8 / 12 / 16 / 24 / full） */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* 间距：只允许这些值 */
  --sp-2: 2px;
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;
  --sp-64: 64px;
  --sp-80: 80px;
  --sp-96: 96px;

  /* 动效 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-default: var(--ease);
  --ease-bounce: var(--ease);
  --ease-out: var(--ease);
  --dur-move: 500ms;
  --dur-color: 300ms;

  /* 品牌标（与 logo.js / favicon 保持一致：纯色，不使用渐变） */
  --brand: #2d63dc;

  /* 布局 */
  --nav-height: 60px;
  --nav-gutter: 12px;
  --bottom-nav-height: 56px;
  --sidebar-width: 224px;
  --content-max: 1160px;

  /* 纹理：极细颗粒，仅用于首屏面板（不是渐变） */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* 暗色只用设计值里允许的背景：#000000 / #181818 / #1F1F1F / #272727 / #313131 */
  --background: #000000;
  --card: #181818;
  --card-foreground: #f6f6f6;
  --foreground: #f6f6f6;
  --secondary: #1f1f1f;
  --secondary-foreground: #e6e6e6;
  --muted: #1f1f1f;
  --muted-foreground: #9b9b9b;
  --subtle: #272727;
  --border: #272727;
  --border-strong: #313131;

  --primary: oklch(72% 0.115 262);
  --primary-strong: oklch(80% 0.1 262);
  --primary-soft: oklch(30% 0.05 262);
  --primary-foreground: #0b0b0c;
  --ring: var(--primary);
  --accent: oklch(30% 0.05 262);
  --accent-foreground: oklch(86% 0.07 262);

  --success: oklch(74% 0.11 154);
  --success-soft: oklch(28% 0.04 154);
  --warning: oklch(78% 0.1 80);
  --warning-soft: oklch(28% 0.04 80);
  --danger: oklch(70% 0.13 25);
  --danger-soft: oklch(28% 0.05 25);

  --cover: #1f1f1f;
  --cover-initial: oklch(72% 0.115 262 / 0.18);

  --shadow-sm: 0 1px 2px oklch(20% 0.05 262 / 0.55);
  --shadow-md: 0 2px 4px oklch(20% 0.05 262 / 0.4), 0 10px 24px oklch(20% 0.05 262 / 0.45);
  --shadow-lg: 0 4px 10px oklch(20% 0.05 262 / 0.5), 0 24px 56px oklch(20% 0.05 262 / 0.6);
  --shadow-float: 0 1px 1px oklch(20% 0.05 262 / 0.5), 0 8px 28px oklch(20% 0.05 262 / 0.55);
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  /* 装饰元素不再撑出横向滚动条；clip 不会让 position: sticky 失效 */
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  /* 注意：这里必须用 clip 而不是 hidden —— overflow: hidden 会让 body 变成滚动容器，
     导致 position: sticky 的影院段落（滚动运镜 / 拆解）在滚动后失效变空白。 */
  overflow-x: clip;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: inherit;
}

img {
  display: block;
  max-width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
}

::selection {
  background: color-mix(in oklab, var(--primary) 22%, transparent);
  color: var(--foreground);
}

/* 键盘焦点必须可见（可访问性要求，不是装饰） */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  border-radius: var(--radius-full);
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 文本样式（命名样式，禁止零散 font-size） ---------- */
.heading-1 {
  font-size: 48px;
  line-height: 48px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.heading-2 {
  font-size: 36px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.heading-3 {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.heading-4 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.heading-5 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.heading-6 {
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.title-1 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}
.title-2 {
  font-size: 18px;
  line-height: 28px;
  font-weight: 500;
}
.title-3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}
.title-4 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.body-1 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}
.body-2 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}
.body-3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}
.body-4 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.body-5 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.body-6 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}
.caption-1 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.caption-2 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
}
.caption-3 {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}
.caption-4 {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}
.caption-5 {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
}
.button-lg {
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
}
.button-md {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}
.button-sm {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

/* 眉标：小号、字距略宽、带一枚强调色小点 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--primary);
  flex: 0 0 auto;
}

/* ---------- 布局骨架 ---------- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.main {
  flex: 1;
  min-width: 0;
  padding: var(--sp-24) var(--sp-24) var(--sp-80);
}

.page {
  max-width: var(--content-max);
  margin: 0 auto;
  position: relative;
}

.page-narrow {
  max-width: 880px;
}

/* 跳到主要内容（键盘用户） */
.skip-link {
  position: fixed;
  top: var(--sp-8);
  left: var(--sp-8);
  z-index: 200;
  transform: translateY(-200%);
  padding: var(--sp-8) var(--sp-12);
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--dur-color) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* 移动端专用结构（由 app.js 的 mobileChromeHtml 渲染，mobile-nav.css 负责展开态）。
   这里给默认隐藏，保证 mobile-nav.css 缺失时桌面端不会多出元素。 */
.mobile-search,
.mobile-drawer {
  display: none;
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: inline-flex;
}

/* ---------- 顶部导航（浮在页面之上，不全宽贴边） ---------- */
.topbar {
  position: sticky;
  top: var(--nav-gutter);
  z-index: 50;
  margin: var(--nav-gutter) var(--nav-gutter) 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: 0 var(--sp-12) 0 var(--sp-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 80%, transparent);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--shadow-float);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.015em;
  flex-shrink: 0;
  padding-right: var(--sp-8);
  border-radius: var(--radius-sm);
}

.brand-sub {
  font-size: 11px;
  line-height: 14px;
  color: var(--muted-foreground);
  font-weight: 500;
  letter-spacing: 0.02em;
  display: block;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #fff;
  font-size: 17px;
  flex: 0 0 auto;
  overflow: hidden;
  transition: transform var(--dur-color) var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(-6deg);
}

.brand-mark .ec-logo {
  display: block;
  border-radius: 10px;
  width: 100%;
  height: 100%;
}

.topbar-search {
  flex: 1;
  max-width: 340px;
  position: relative;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
  transition: background var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}

.nav-link:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-gutter) + var(--nav-height) + var(--sp-16));
  height: calc(100dvh - var(--nav-gutter) - var(--nav-height) - var(--sp-24));
  overflow-y: auto;
  padding: var(--sp-8) var(--sp-12) var(--sp-32) var(--sp-16);
}

.side-group {
  margin-bottom: var(--sp-24);
}

.side-label {
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  padding: var(--sp-8) var(--sp-12);
}

.side-item {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  width: 100%;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--secondary-foreground);
  transition: background var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}

.side-item:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.side-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.side-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
  filter: saturate(0.55);
}

.side-item.active .side-icon {
  background: var(--card);
}

/* 图标容器统一收敛：同样的尺寸 / 圆角 / 中性底，emoji 降低饱和度减少杂色 */
.page-icon,
.icon-tile,
.empty-icon,
.callout-icon {
  filter: saturate(0.6);
}

.side-badge {
  margin-left: auto;
  font-size: 10px;
  line-height: 16px;
  padding: 0 6px;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 底部移动导航（浮起的小胶囊） ---------- */
.bottom-nav {
  position: fixed;
  left: var(--sp-8);
  right: var(--sp-8);
  bottom: calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
  height: var(--bottom-nav-height);
  display: none;
  align-items: stretch;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 84%, transparent);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: var(--shadow-float);
  z-index: 45;
}

.bottom-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--radius);
  font-size: 10px;
  line-height: 14px;
  color: var(--muted-foreground);
  font-weight: 500;
  transition: background var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}

.bottom-item .bi {
  font-size: 18px;
  line-height: 1;
}

.bottom-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 页脚 ---------- */
.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4) var(--sp-16);
  padding: var(--sp-24) var(--sp-16) var(--sp-32);
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-40);
}

.app-footer-credit {
  opacity: 0.8;
}

/* ---------- 卡片（去掉「边框 + 阴影 + 白底」三件套，只留表面色） ---------- */
.card {
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  box-shadow: none;
}

.card-fun {
  transition: transform var(--dur-move) var(--ease), background var(--dur-color) var(--ease),
    box-shadow var(--dur-move) var(--ease);
}

.card-fun:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-head {
  padding: var(--sp-16) var(--sp-16) var(--sp-12);
}

.card-body {
  padding: 0 var(--sp-16) var(--sp-16);
}

.card-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted-foreground);
  margin-top: var(--sp-2);
}

/* ---------- 页头 ---------- */
.page-head {
  position: relative;
  margin-bottom: var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
}

.page-head-row {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  position: relative;
  z-index: 1;
}

.page-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 20px;
  /* 其它视图用内联渐变画图标底板，这里统一收敛为中性表面 */
  background-color: var(--muted) !important;
  background-image: none !important;
  color: var(--foreground);
  box-shadow: none;
  flex-shrink: 0;
}

.page-title {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.page-sub {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
  max-width: 68ch;
}

/* 装饰色块：设计规则里背景必须纯色，这里整体下掉（同时解决横向溢出） */
.deco-blob {
  display: none !important;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  min-height: 36px;
  padding: var(--sp-8) var(--sp-12);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background var(--dur-color) var(--ease), color var(--dur-color) var(--ease),
    border-color var(--dur-color) var(--ease), transform 180ms var(--ease), box-shadow var(--dur-color) var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-outline {
  border-color: var(--border);
  background: var(--card);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--secondary);
  border-color: var(--border-strong);
}

.btn-ghost {
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.btn-sm {
  min-height: 28px;
  padding: var(--sp-4) var(--sp-8);
  font-size: 12px;
  line-height: 16px;
  gap: var(--sp-4);
}

.btn-lg {
  min-height: 44px;
  padding: var(--sp-12) var(--sp-24);
  font-size: 16px;
  line-height: 20px;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* 文字链 + 箭头（比「一个实心 + 一个描边」干净） */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--primary);
  border-radius: var(--radius-xs);
}

.link-arrow span {
  transition: transform var(--dur-color) var(--ease);
}

.link-arrow:hover span {
  transform: translateX(3px);
}

/* ---------- 输入 ---------- */
.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: var(--sp-8) var(--sp-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 14px;
  line-height: 20px;
  color: var(--foreground);
  transition: border-color var(--dur-color) var(--ease), box-shadow var(--dur-color) var(--ease),
    background var(--dur-color) var(--ease);
}

.textarea {
  resize: vertical;
  line-height: 1.65;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23666b73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-12) center;
  padding-right: var(--sp-32);
  cursor: pointer;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-foreground);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 16%, transparent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  margin-bottom: var(--sp-16);
}

.field-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--secondary-foreground);
}

.field-hint {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
}

.with-icon {
  position: relative;
}

.with-icon > .lead-icon {
  position: absolute;
  left: var(--sp-12);
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.with-icon > .input,
.with-icon > .select {
  padding-left: var(--sp-32);
}

/* ---------- 标签（中性底 + 语义色小圆点，避免五颜六色） ---------- */
.tag {
  --tag-hue: 262;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  padding: 2px var(--sp-8);
  border-radius: var(--radius-xs);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--secondary-foreground);
  white-space: nowrap;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: oklch(60% 0.11 var(--tag-hue));
  flex: 0 0 auto;
}

.tag-plain {
  border-color: transparent;
  background: var(--muted);
  color: var(--muted-foreground);
  font-weight: 500;
}

.tag-plain::before {
  display: none;
}

.tag-alevel {
  --tag-hue: 25;
}
.tag-ap {
  --tag-hue: 154;
}
.tag-ib {
  --tag-hue: 262;
}
.tag-igcse {
  --tag-hue: 300;
}
.tag-gaokao {
  --tag-hue: 60;
}
.tag-ielts {
  --tag-hue: 210;
}

html[data-theme="dark"] .tag::before {
  background: oklch(74% 0.1 var(--tag-hue));
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
}

/* 可点击的标签（如院校详情页里点击专业查看要求） */
a.tag-link {
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--dur-color) var(--ease), background var(--dur-color) var(--ease);
}

a.tag-link:hover,
a.tag-link:focus-visible {
  background: var(--secondary);
  border-color: var(--border-strong);
}

a.tag-link::after {
  content: "›";
  opacity: 0.6;
  font-weight: 600;
  margin-left: var(--sp-2);
}

/* ---------- 网格与通用工具类 ---------- */
.grid {
  display: grid;
  gap: var(--sp-16);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
}
.gap-4 {
  gap: var(--sp-4);
}
.gap-8 {
  gap: var(--sp-8);
}
.gap-12 {
  gap: var(--sp-12);
}
.gap-16 {
  gap: var(--sp-16);
}
.row {
  display: flex;
  align-items: center;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.muted {
  color: var(--muted-foreground);
}
.small {
  font-size: 13px;
  line-height: 20px;
}
.xs {
  font-size: 12px;
  line-height: 16px;
}
.bold {
  font-weight: 600;
}
.center {
  text-align: center;
}
.mt-4 {
  margin-top: var(--sp-4);
}
.mt-8 {
  margin-top: var(--sp-8);
}
.mt-12 {
  margin-top: var(--sp-12);
}
.mt-16 {
  margin-top: var(--sp-16);
}
.mt-24 {
  margin-top: var(--sp-24);
}
.mb-4 {
  margin-bottom: var(--sp-4);
}
.mb-8 {
  margin-bottom: var(--sp-8);
}
.mb-12 {
  margin-bottom: var(--sp-12);
}
.mb-16 {
  margin-bottom: var(--sp-16);
}
.mb-20 {
  margin-bottom: var(--sp-24);
}
.mb-24 {
  margin-bottom: var(--sp-24);
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 数字统一等宽，避免跳格 */
.num,
.stat-value,
.kv-value,
.tl-date,
.board-no,
.rank-num,
th,
td {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 数据：统计条（账本式分隔线，不做六个小卡片） ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  padding: var(--sp-16) var(--sp-16) var(--sp-16) var(--sp-24);
  border-left: 1px solid var(--border);
  background: none;
  border-radius: 0;
}

.stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat-value {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
  margin-top: var(--sp-4);
}

/* ---------- 数据：键值对 ---------- */
.kv {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-12);
  border-radius: var(--radius-sm);
  background: var(--muted);
}

.kv-label {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.kv-value {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-8);
}

/* ---------- 列表 ---------- */
.bullets {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

.bullets li {
  display: flex;
  gap: var(--sp-8);
  font-size: 14px;
  line-height: 20px;
  color: var(--secondary-foreground);
}

.bullets li::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--primary);
  margin-top: 8px;
}

.num-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  counter-reset: step;
}

.num-list li {
  display: flex;
  gap: var(--sp-12);
  font-size: 14px;
  line-height: 20px;
  counter-increment: step;
}

.num-list li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-16) 0;
}

/* ---------- 折叠面板 ---------- */
.accordion {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  background: none;
}

.accordion + .accordion {
  margin-top: 0;
}

.accordion:last-child {
  border-bottom: 1px solid var(--border);
}

.accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-16) 0;
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  text-align: left;
  background: none;
  transition: color var(--dur-color) var(--ease);
}

.accordion-head:hover {
  color: var(--primary);
}

.accordion-head .chev {
  margin-left: auto;
  transition: transform 300ms var(--ease);
  color: var(--muted-foreground);
  font-size: 12px;
}

.accordion.open .accordion-head .chev {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: var(--sp-2) 0 var(--sp-24);
  font-size: 14px;
  line-height: 22px;
  color: var(--secondary-foreground);
  max-width: 68ch;
}

.accordion.open .accordion-body {
  display: block;
  animation: ec-fade 300ms var(--ease);
}

/* ---------- 提示条 ---------- */
.callout {
  display: flex;
  gap: var(--sp-12);
  padding: var(--sp-16);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  line-height: 20px;
  color: var(--secondary-foreground);
}

.callout-primary {
  border-color: color-mix(in oklab, var(--primary) 26%, var(--border));
  background: color-mix(in oklab, var(--primary) 5%, var(--card));
}

.callout-warning {
  border-color: color-mix(in oklab, var(--warning) 34%, var(--border));
  background: color-mix(in oklab, var(--warning) 7%, var(--card));
}

.callout-success {
  border-color: color-mix(in oklab, var(--success) 30%, var(--border));
  background: color-mix(in oklab, var(--success) 6%, var(--card));
}

.callout-icon {
  font-size: 16px;
  line-height: 24px;
  flex-shrink: 0;
}

.callout-title {
  font-weight: 600;
  margin-bottom: var(--sp-4);
  font-size: 14px;
  color: var(--foreground);
}

/* ---------- 进度条（纯色，不用渐变） ---------- */
.bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--muted);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  animation: grow-bar 800ms var(--ease) forwards;
}

.bar-fill.warn {
  background: var(--warning);
}
.bar-fill.danger {
  background: var(--danger);
}
.bar-fill.ok {
  background: var(--success);
}

@keyframes grow-bar {
  from {
    width: 0;
  }
}

@keyframes ec-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.float-in {
  animation: float-in 400ms var(--ease) both;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid color-mix(in oklab, var(--primary) 25%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  display: inline-block;
}

/* ---------- 骨架屏（贴合真实布局，不用转圈） ---------- */
.skeleton {
  border-radius: var(--radius-sm);
  background: var(--muted);
  background-image: none;
  position: relative;
  overflow: hidden;
  height: 16px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--card) 60%, transparent), transparent);
  animation: shimmer 1.6s var(--ease) infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ---------- 空状态 ---------- */
.empty {
  padding: var(--sp-64) var(--sp-24);
  text-align: center;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-8);
}

.empty-icon {
  font-size: 28px;
  line-height: 32px;
  margin-bottom: var(--sp-4);
  opacity: 0.7;
}

/* ---------- 院校封面（纯色 + 首字母水印 + 国旗，不用渐变/外链图片） ---------- */
.uni-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.uni-cover {
  position: relative;
  height: 104px;
  background-color: var(--cover) !important;
  background-image: none !important;
  overflow: hidden;
  flex: 0 0 auto;
}

.uni-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uni-cover-mask {
  display: none;
}

/* 首字母水印（院校封面唯一的视觉变化来源，不依赖图片或渐变） */
.uni-initial {
  position: absolute;
  right: var(--sp-8);
  bottom: -28px;
  font-size: 104px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.05em;
  color: var(--cover-initial);
  user-select: none;
  pointer-events: none;
}

/* 无实图时封面上的国家标记（用国家名而不是国旗 emoji：
   Windows 不渲染国旗字形，会退化成 US / GB 这类字母） */
.uni-cover-country {
  position: absolute;
  left: var(--sp-12);
  bottom: var(--sp-12);
  padding: 1px var(--sp-4);
  border-radius: var(--radius-xs);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--secondary-foreground);
  background: color-mix(in oklab, var(--card) 72%, transparent);
  pointer-events: none;
  max-width: calc(100% - var(--sp-24));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 兼容既有选择器（旧封面用国旗 emoji 水印） */
.uni-cover-seal {
  position: absolute;
  left: var(--sp-12);
  bottom: var(--sp-12);
  font-size: 20px;
  line-height: 1;
  opacity: 0.95;
  pointer-events: none;
}

.detail-hero-seal {
  position: absolute;
  right: var(--sp-24);
  top: 50%;
  transform: translateY(-50%);
  font-size: 96px;
  opacity: 0.5;
  pointer-events: none;
  line-height: 1;
}

.uni-cover-text {
  position: absolute;
  left: var(--sp-16);
  right: var(--sp-16);
  bottom: var(--sp-12);
  color: var(--foreground);
}

.uni-cover-title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.uni-cover-meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.uni-rank {
  position: absolute;
  top: var(--sp-12);
  left: var(--sp-12);
  padding: 2px var(--sp-8);
  border-radius: var(--radius-xs);
  background: var(--card);
  color: var(--primary);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 只有区间、没有核实到具体名次时用虚线弱化，避免被当成精确名次 */
.uni-rank.rank-band {
  background: var(--card);
  color: var(--muted-foreground);
  border: 1px dashed var(--border-strong);
  font-weight: 500;
}

.rank-legend {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
  padding: var(--sp-12) var(--sp-16);
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-size: 12px;
  line-height: 18px;
  color: var(--secondary-foreground);
}

.rank-legend .chip-rank {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--sp-8);
  border-radius: var(--radius-xs);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
}

.rank-legend .chip-rank.exact {
  background: var(--primary-soft);
  color: var(--primary);
}

.rank-legend .chip-rank.band {
  background: var(--card);
  color: var(--muted-foreground);
  border: 1px dashed var(--border-strong);
}

.uni-body {
  padding: var(--sp-16);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-12);
}

/* ---------- 详情页 ---------- */
.detail-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 208px;
  background-color: var(--cover) !important;
  background-image: none !important;
  margin-bottom: var(--sp-24);
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero-mask {
  display: none;
}

.detail-hero-text {
  position: absolute;
  left: var(--sp-24);
  right: var(--sp-24);
  bottom: var(--sp-24);
  color: var(--foreground);
}

.detail-hero-title {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.detail-hero-sub {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
  margin-top: var(--sp-4);
}

/* 详情页封面：右下大首字母 + 右上国旗，标题在左下，互不遮挡 */
.detail-hero .uni-initial {
  font-size: 200px;
  right: var(--sp-40);
  bottom: -72px;
}

.detail-hero .detail-hero-seal {
  top: var(--sp-24);
  right: var(--sp-24);
  transform: none;
  font-size: 28px;
  opacity: 0.9;
}

.tabs {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-24);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: var(--sp-12) var(--sp-12);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--dur-color) var(--ease), border-color var(--dur-color) var(--ease);
}

.tab:hover {
  color: var(--foreground);
}

.tab.active {
  color: var(--foreground);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

.panel {
  display: none;
}
.panel.active {
  display: block;
  animation: ec-fade 300ms var(--ease);
}

.section {
  margin-bottom: var(--sp-32);
}

.section-title {
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  margin-bottom: var(--sp-12);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--primary);
}

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.data-table {
  font-size: 14px;
  line-height: 20px;
  min-width: 480px;
}

.data-table th {
  text-align: left;
  padding: var(--sp-12);
  background: var(--muted);
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.data-table td {
  padding: var(--sp-12);
  border-top: 1px solid var(--border);
  vertical-align: top;
  line-height: 20px;
}

.data-table tbody tr {
  transition: background var(--dur-color) var(--ease);
}

.data-table tr:hover td {
  background: color-mix(in oklab, var(--muted) 60%, transparent);
}

/* 大学榜单：国家标签横滑、表头吸顶、行内操作 */
.board-tabs {
  display: flex;
  gap: var(--sp-8);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar {
  display: none;
}

.board-tab {
  flex: 0 0 auto;
  padding: 5px var(--sp-12);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--secondary-foreground);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-color) var(--ease), color var(--dur-color) var(--ease),
    border-color var(--dur-color) var(--ease);
}

.board-tab:hover {
  border-color: var(--border-strong);
  color: var(--foreground);
}

.board-tab.active {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
  font-weight: 600;
}

.board-card {
  overflow: hidden;
}

.board-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--muted);
}

.board-table td {
  vertical-align: middle;
}

.board-no {
  display: block;
  margin-top: var(--sp-4);
}

.board-name {
  display: inline-block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.board-name:hover {
  color: var(--primary);
}

.sys-row {
  display: flex;
  gap: var(--sp-12);
  padding: var(--sp-12) 0;
  border-bottom: 1px solid var(--border);
}

.sys-row:last-child {
  border-bottom: 0;
}

.sys-badge {
  flex-shrink: 0;
  width: 74px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  padding-top: var(--sp-2);
}

/* ---------- 时间线 ---------- */
.timeline {
  position: relative;
  padding-left: var(--sp-24);
}

.timeline::before {
  content: "";
  position: absolute;
  left: var(--sp-8);
  top: var(--sp-8);
  bottom: var(--sp-8);
  width: 2px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

.tl-item {
  position: relative;
  margin-bottom: var(--sp-24);
}

.tl-item:last-child {
  margin-bottom: 0;
}

.tl-dot {
  position: absolute;
  left: calc(var(--sp-24) * -1 + var(--sp-4));
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 3px solid var(--primary);
  background: var(--background);
}

.tl-item.urgent .tl-dot {
  border-color: var(--danger);
}

.tl-item.soon .tl-dot {
  border-color: var(--warning);
}

.tl-head {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.tl-title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.tl-date {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
}

/* ---------- 表单/登录 ---------- */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--sp-24);
  position: relative;
  overflow: hidden;
  background: var(--background);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-32) var(--sp-24);
  position: relative;
  z-index: 1;
}

.auth-switch {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--muted);
  margin-bottom: var(--sp-24);
}

.auth-switch button,
.auth-switch a {
  flex: 1;
  text-align: center;
  padding: var(--sp-8);
  border-radius: var(--radius-xs);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--muted-foreground);
  display: block;
  transition: background var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}

.auth-switch button.active,
.auth-switch a.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.form-error {
  font-size: 12px;
  line-height: 16px;
  color: var(--danger);
  margin-top: var(--sp-8);
  min-height: 17px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  user-select: none;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
}

/* ---------- 模态与提示 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(21% 0.012 260 / 0.44);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: var(--sp-24);
  z-index: 90;
  animation: ec-fade 200ms var(--ease);
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-24);
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: var(--sp-24);
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: var(--sp-8) var(--sp-16);
  border-radius: var(--radius-sm);
  background: var(--foreground);
  color: var(--background);
  font-size: 14px;
  line-height: 20px;
  box-shadow: var(--shadow-lg);
  animation: ec-fade 240ms var(--ease);
  max-width: 88vw;
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

.toast.success {
  background: var(--success);
  color: #fff;
}

/* ---------- AI 批改 ---------- */
.grade-hero {
  display: flex;
  align-items: center;
  gap: var(--sp-24);
  padding: var(--sp-24);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
}

.score-ring {
  position: relative;
  width: 92px;
  height: 92px;
  flex-shrink: 0;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.score-ring-value .num {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.score-ring-value .den {
  font-size: 11px;
  line-height: 16px;
  color: var(--muted-foreground);
}

.criterion {
  padding: var(--sp-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-12);
  background: var(--card);
}

.crit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
  margin-bottom: var(--sp-8);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 1px var(--sp-8);
  border-radius: var(--radius-xs);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
}

.chip-hit {
  background: var(--success-soft);
  color: var(--success);
}
.chip-miss {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- 讲师卡 ---------- */
.teacher-card {
  display: flex;
  gap: var(--sp-16);
  padding: var(--sp-16);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
  color: var(--primary);
  background: var(--primary-soft);
  flex-shrink: 0;
}

/* ============================================================================
   首页专用组件
   ========================================================================== */

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: var(--sp-48);
  align-items: center;
  padding: var(--sp-64) var(--sp-48);
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid var(--border);
  overflow: clip;
  margin-bottom: var(--sp-24);
}

/* 极细颗粒纹理：让大面积纯色表面不显死板（不是渐变） */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  opacity: 0.035;
  pointer-events: none;
}

html[data-theme="dark"] .hero::after {
  opacity: 0.06;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  max-width: 680px;
  min-width: 0;
}

.hero-title {
  max-width: 680px;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* 唯一允许的渐变：首屏标题文字（亮色 #000 → #666，暗色 #FFF → #9B9B9B）。
   前 40% 保持纯墨色，避免第二行整行偏灰影响可读性。 */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero-title {
    background-image: linear-gradient(90deg, #000000 0%, #000000 38%, #666666 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  html[data-theme="dark"] .hero-title {
    background-image: linear-gradient(90deg, #ffffff 0%, #ffffff 38%, #9b9b9b 100%);
  }
}

.hero-sub {
  font-size: 16px;
  line-height: 26px;
  color: var(--secondary-foreground);
  max-width: 680px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-16);
  margin-top: var(--sp-8);
}

.hero-note {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
}

.hero-visual {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  min-width: 0;
}

/* 首屏右侧：真实接口数据的「院校档案」预览 */
.preview {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
}

.preview-name {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.preview-rows {
  display: flex;
  flex-direction: column;
}

.preview-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-12);
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 20px;
}

.preview-row span {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.preview-row b {
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.preview-foot {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
}

/* ---------- 标语逐词显现 ---------- */
.tagline {
  padding: var(--sp-80) 0;
  max-width: 900px;
}

.tagline-text {
  font-size: 36px;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.03em;
  max-width: 880px;
  text-wrap: pretty;
}

.tagline-note {
  margin-top: var(--sp-16);
  font-size: 14px;
  line-height: 22px;
  color: var(--muted-foreground);
  max-width: 640px;
}

.tw {
  display: inline-block;
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
}

.ec-js [data-tw] .tw {
  opacity: 0.28;
  transform: translateY(8px);
}

.ec-js [data-tw].is-in .tw {
  opacity: 1;
  transform: none;
}

.ec-js[data-motion="reduce"] [data-tw] .tw {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ---------- 滚动显现 ---------- */
[data-reveal] {
  opacity: 1;
}

.ec-js [data-reveal] {
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.ec-js [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(32px);
}

.ec-js[data-motion="reduce"] [data-reveal],
.ec-js[data-motion="reduce"] [data-reveal]:not(.is-in) {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-16);
  flex-wrap: wrap;
  margin-bottom: var(--sp-24);
}

.section-head-main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  min-width: 0;
}

.section-head h2,
.section-head h3 {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.section-head-sub {
  font-size: 14px;
  line-height: 22px;
  color: var(--muted-foreground);
  max-width: 60ch;
}

/* ---------- 功能（非对称 7/5 网格 + 索引列表） ---------- */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-16);
  margin-bottom: var(--sp-16);
}

.feat {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  padding: var(--sp-24);
  border-radius: var(--radius-lg);
  background: var(--card);
  transition: background var(--dur-color) var(--ease), transform var(--dur-move) var(--ease),
    box-shadow var(--dur-move) var(--ease);
  min-width: 0;
}

.feat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feat:nth-child(1) {
  grid-column: span 7;
}

.feat:nth-child(2) {
  grid-column: span 5;
}

.feat:nth-child(3) {
  grid-column: span 5;
}

.feat:nth-child(4) {
  grid-column: span 7;
}

.feat-title {
  display: block;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.feat-desc {
  display: block;
  font-size: 14px;
  line-height: 22px;
  color: var(--muted-foreground);
}

.feat-foot {
  display: flex;
  margin-top: auto;
  padding-top: var(--sp-8);
  align-items: center;
  gap: var(--sp-8);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--primary);
}

.feat-foot .arrow {
  transition: transform var(--dur-color) var(--ease);
}

.feat:hover .feat-foot .arrow {
  transform: translateX(3px);
}

.icon-tile {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  background: var(--muted);
  color: var(--foreground);
  flex: 0 0 auto;
}

.icon-tile.accent {
  background: var(--primary-soft);
}

/* 功能索引：点线分隔的行，不做一排卡片 */
.feat-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--sp-48);
  border-top: 1px solid var(--border);
}

.feat-index li {
  border-bottom: 1px solid var(--border);
}

.feat-index a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-16) 0;
  transition: color var(--dur-color) var(--ease);
}

.feat-index a:hover {
  color: var(--primary);
}

.feat-index-title {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.feat-index-desc {
  display: block;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted-foreground);
}

.feat-index .arrow {
  color: var(--muted-foreground);
  transition: transform var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}

.feat-index a:hover .arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* ---------- 院校展示（2 张大卡 + 一列紧排行） ---------- */
.uni-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-16);
  align-items: start;
}

.uni-showcase-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-16);
}

.uni-showcase-side {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.uni-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-12) 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--dur-color) var(--ease);
}

.uni-row:hover {
  color: var(--primary);
}

.uni-row-rank {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.uni-row-name {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uni-row-meta {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uni-row-flag {
  font-size: 16px;
  line-height: 1;
}

.uni-row-arrow {
  font-size: 14px;
  line-height: 1;
  color: var(--muted-foreground);
  transition: transform var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}

.uni-row:hover .uni-row-arrow {
  transform: translateX(3px);
  color: var(--primary);
}

/* 大号院校卡：封面 + 名称 + 两个数据点 */
.uni-big {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius-lg);
  transition: transform var(--dur-move) var(--ease), box-shadow var(--dur-move) var(--ease);
}

.uni-big:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.uni-big .uni-cover {
  height: 128px;
  border-radius: 0;
}

.uni-big-body {
  padding: var(--sp-16);
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  flex: 1;
}

.uni-big-name {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.uni-big-meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
}

.uni-big-kvs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  margin-top: auto;
  padding-top: var(--sp-8);
}

.chip-fact {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 2px var(--sp-8);
  border-radius: var(--radius-xs);
  background: var(--muted);
  font-size: 12px;
  line-height: 16px;
  color: var(--secondary-foreground);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-fact b {
  font-weight: 600;
  color: var(--foreground);
}

/* ---------- 三步 ---------- */
.step-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.step {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--sp-24);
  padding: var(--sp-24) 0;
  border-bottom: 1px solid var(--border);
}

.step-num {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--border-strong);
  font-variant-numeric: tabular-nums;
}

.step-title {
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  margin-bottom: var(--sp-4);
}

.step-desc {
  font-size: 14px;
  line-height: 22px;
  color: var(--muted-foreground);
  max-width: 60ch;
}

/* ---------- 双栏叙述（左文案 / 右清单） ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-48);
  align-items: center;
  padding: var(--sp-48) 0;
  border-top: 1px solid var(--border);
}

.split-copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  min-width: 0;
}

.split-copy h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.split-visual {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  min-width: 0;
}

.split-visual-title {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}

.split-visual .bullets li {
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--border);
  color: var(--foreground);
}

.split-visual .bullets {
  gap: 0;
}

.split-visual .bullets li::before {
  margin-top: 8px;
}

/* ---------- 行列表（兼职岗位等） ---------- */
.list-rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-16);
  padding: var(--sp-16) 0;
  border-bottom: 1px solid var(--border);
}

.list-row-main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.list-row-title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.list-row-meta {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-facts {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- FAQ ---------- */
.faq-list {
  border-top: 1px solid var(--border);
}

/* ---------- 结尾行动区 ---------- */
.final-cta {
  position: relative;
  padding: var(--sp-64) var(--sp-48);
  border-radius: var(--radius-xl);
  background: var(--foreground);
  color: var(--background);
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  align-items: flex-start;
  margin: var(--sp-48) 0 var(--sp-24);
  overflow: clip;
}

.final-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  opacity: 0.05;
  pointer-events: none;
}

.final-cta h2 {
  font-size: 36px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.final-cta p {
  font-size: 14px;
  line-height: 22px;
  opacity: 0.72;
  max-width: 60ch;
  position: relative;
  z-index: 1;
}

.final-cta .row,
.final-cta .hero-actions {
  position: relative;
  z-index: 1;
}

.final-cta .btn-primary {
  background: var(--background);
  color: var(--foreground);
}

.final-cta .btn-primary:hover {
  background: color-mix(in oklab, var(--background) 82%, var(--foreground));
}

.final-cta .btn-ghost {
  color: color-mix(in oklab, var(--background) 72%, transparent);
}

.final-cta .btn-ghost:hover {
  background: color-mix(in oklab, var(--background) 12%, transparent);
  color: var(--background);
}

.final-cta .eyebrow {
  color: inherit;
  opacity: 0.72;
}

.final-cta .eyebrow::before {
  background: var(--background);
}

/* ============================================================================
   大学库 / 榜单 专用组件
   ========================================================================== */

/* 筛选条：搜索最突出，其次是筛选，最后是排序 */
.filterbar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  padding: var(--sp-24);
  border-radius: var(--radius-lg);
  background: var(--card);
  margin-bottom: var(--sp-16);
}

.filterbar-main {
  display: flex;
  gap: var(--sp-8);
  align-items: center;
}

.filterbar-main .with-icon {
  flex: 1;
  min-width: 0;
}

.filterbar-main .input {
  min-height: 44px;
  font-size: 15px;
  border-radius: var(--radius-sm);
}

.filterbar-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: var(--sp-12);
  align-items: end;
}

.filterbar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
  flex-wrap: wrap;
}

.filter-count {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
}

.filter-count b {
  color: var(--foreground);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 快捷国家标签：桌面换行排布，手机横滑 */
.chip-rail {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  padding-bottom: var(--sp-2);
}

.chip-link {
  flex: 0 0 auto;
  padding: 5px var(--sp-12);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--secondary-foreground);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur-color) var(--ease), border-color var(--dur-color) var(--ease),
    color var(--dur-color) var(--ease);
}

.chip-link:hover {
  border-color: var(--border-strong);
  color: var(--foreground);
}

.chip-link.active {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
  font-weight: 600;
}

/* 结果工具条 */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  flex-wrap: wrap;
  padding: var(--sp-12) 0 var(--sp-16);
}

.results-meta {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted-foreground);
}

.results-meta b {
  color: var(--foreground);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result-tip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  color: var(--muted-foreground);
  font-size: 12px;
}

/* 排序：分段控件（链接，不依赖事件） */
.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  gap: 2px;
}

.seg a {
  padding: 4px var(--sp-12);
  border-radius: var(--radius-xs);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}

.seg a:hover {
  color: var(--foreground);
}

.seg a.active {
  background: var(--card);
  color: var(--foreground);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 大学列表：两列横向卡（不是三列等宽卡） */
.uni-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-12);
}

.uni-card.row-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius);
  transition: transform var(--dur-move) var(--ease), box-shadow var(--dur-move) var(--ease);
}

.uni-card.row-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.row-card .uni-cover {
  height: 100%;
  min-height: 132px;
  border-radius: 0;
}

.row-card .uni-initial {
  font-size: 84px;
  top: -12px;
}

.row-card .uni-body {
  padding: var(--sp-16);
  gap: var(--sp-8);
}

.row-card .uni-name {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.row-card .uni-name-en {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-card .uni-overview {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted-foreground);
}

.row-card .uni-meta-row {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--sp-8);
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  margin-top: var(--sp-32);
}

.pager-info {
  font-size: 13px;
  line-height: 20px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  padding: 0 var(--sp-8);
}

/* 榜单行内大号名次 */
.rank-num {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.rank-num.band {
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
}

.board-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  padding: var(--sp-24);
  border-radius: var(--radius-lg);
  background: var(--card);
  margin-bottom: var(--sp-16);
}

.board-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
  flex-wrap: wrap;
}

/* ============================================================================
   响应式
   ========================================================================== */

@media (max-width: 1200px) {
  .hero {
    padding: var(--sp-48) var(--sp-32);
    gap: var(--sp-32);
  }

  .hero-title {
    font-size: 42px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .main {
    padding: var(--sp-16) var(--sp-16) var(--sp-80);
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-24);
    padding: var(--sp-32) var(--sp-24);
  }

  .hero-visual {
    max-width: 460px;
  }

  .uni-showcase {
    grid-template-columns: minmax(0, 1fr);
  }

  .uni-showcase-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--sp-24);
    border-top: 0;
  }

  .uni-showcase-side .uni-row:first-child,
  .uni-showcase-side .uni-row:nth-child(2) {
    border-top: 1px solid var(--border);
  }

  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-24);
    padding: var(--sp-32) 0;
  }

  .filterbar-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feat-index {
    grid-template-columns: minmax(0, 1fr);
  }

  .step {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: var(--sp-16);
  }

  .step .link-arrow {
    display: none;
  }

  .tagline {
    padding: var(--sp-48) 0;
  }

  .tagline-text {
    font-size: 30px;
    line-height: 1.28;
  }

  .final-cta {
    padding: var(--sp-48) var(--sp-32);
  }

  .final-cta h2 {
    font-size: 30px;
    line-height: 36px;
  }
}

@media (max-width: 760px) {
  :root {
    --nav-gutter: 8px;
    --nav-height: 54px;
    --bottom-nav-height: 58px;
  }

  /* 手机顶栏：贴边的应用条，和 mobile-nav.css 的搜索条 / 抽屉配合 */
  .topbar {
    top: 0;
    margin: 0;
    height: var(--nav-height);
    gap: var(--sp-8);
    padding: 0 var(--sp-8);
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    background: color-mix(in oklab, var(--card) 90%, transparent);
  }

  .brand {
    padding-right: 0;
    gap: var(--sp-8);
    min-width: 0;
  }

  /* 手机端站点导航由 app.js 的抽屉承担，顶栏不再排 6 个链接 */
  .nav-links {
    display: none;
  }

  .topbar-search {
    display: none;
  }

  .topbar-actions {
    gap: var(--sp-4);
  }

  .mobile-only {
    display: inline-flex;
  }

  .desktop-only {
    display: none;
  }

  .main {
    padding: var(--sp-12) var(--sp-12)
      calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + var(--sp-32));
  }

  /* 底部快捷导航：浮起的小胶囊（用更高优先级覆盖 mobile-nav.css 的通栏写法，
     安全区由 bottom 偏移承担，避免重复下移） */
  html body .bottom-nav {
    display: flex;
    left: var(--sp-8);
    right: var(--sp-8);
    bottom: calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
    height: var(--bottom-nav-height);
    padding: var(--sp-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-float);
  }

  .toast-host {
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + var(--sp-32));
  }

  .page-title {
    font-size: 24px;
    line-height: 32px;
  }

  .heading-1 {
    font-size: 36px;
    line-height: 40px;
  }
  .heading-2 {
    font-size: 30px;
    line-height: 36px;
  }
  .heading-3 {
    font-size: 24px;
    line-height: 32px;
  }
  .heading-4 {
    font-size: 20px;
    line-height: 28px;
  }
  .tagline-text {
    font-size: 24px;
    line-height: 1.34;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .kv-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-hero {
    height: 168px;
  }

  .detail-hero-title {
    font-size: 24px;
    line-height: 32px;
  }

  .grade-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  /* 首屏 */
  .hero {
    padding: var(--sp-24) var(--sp-16);
    border-radius: var(--radius-lg);
    gap: var(--sp-24);
  }

  .hero-title {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.03em;
  }

  .hero-sub {
    font-size: 15px;
    line-height: 24px;
  }

  .hero-actions {
    gap: var(--sp-12);
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .hero-actions .link-arrow {
    justify-content: center;
    padding: var(--sp-8) 0;
  }

  .preview {
    padding: var(--sp-16);
  }

  /* 区块 */
  .section-head {
    margin-bottom: var(--sp-16);
    align-items: flex-start;
  }

  .section-head h2,
  .section-head h3 {
    font-size: 24px;
    line-height: 32px;
  }

  .feat-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-12);
  }

  .feat,
  .feat:nth-child(1),
  .feat:nth-child(2),
  .feat:nth-child(3),
  .feat:nth-child(4) {
    grid-column: span 1;
    padding: var(--sp-16);
  }

  .feat-title {
    font-size: 18px;
    line-height: 28px;
  }

  .feat-index a {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    padding: var(--sp-12) 0;
  }

  .uni-showcase-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .uni-showcase-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-8);
    padding: var(--sp-16) 0;
  }

  .step-num {
    font-size: 24px;
    line-height: 32px;
  }

  .split-visual {
    padding: var(--sp-16);
  }

  .list-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-8);
    padding: var(--sp-12) 0;
  }

  .list-row-facts {
    justify-content: flex-start;
  }

  .final-cta {
    padding: var(--sp-32) var(--sp-24);
    border-radius: var(--radius-lg);
    margin: var(--sp-32) 0 var(--sp-16);
  }

  .final-cta h2 {
    font-size: 24px;
    line-height: 32px;
  }

  .final-cta .btn {
    width: 100%;
  }

  /* 筛选条 */
  .filterbar,
  .board-toolbar {
    padding: var(--sp-16);
    border-radius: var(--radius);
    gap: var(--sp-12);
  }

  .filterbar-main {
    flex-direction: column;
    align-items: stretch;
  }

  .filterbar-main .btn {
    width: 100%;
    min-height: 44px;
  }

  .filterbar-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-8);
  }

  .filterbar-fields .select {
    min-height: 40px;
  }

  .filterbar .field-label {
    display: none;
  }

  /* 手机上快捷标签横滑，避免换行占掉首屏高度 */
  .chip-rail {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
  }

  .chip-rail::-webkit-scrollbar {
    display: none;
  }

  .uni-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .row-card .uni-cover {
    min-height: 0;
    height: auto;
  }

  .uni-card.row-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .row-card .uni-initial {
    font-size: 64px;
    top: -8px;
  }

  .row-card .uni-overview {
    display: none;
  }

  .pager {
    margin-top: var(--sp-24);
    flex-wrap: wrap;
  }

  .board-toolbar .input,
  .board-toolbar .select {
    min-height: 40px;
  }

  .board-toolbar .btn {
    min-height: 40px;
  }

  /* 榜单表格在手机上改为堆叠卡片（不留横向滚动） */
  .board-card .table-wrap {
    border: 0;
    background: none;
  }

  .board-table {
    min-width: 0;
    display: block;
  }

  .board-table thead {
    display: none;
  }

  .board-table tbody {
    display: flex;
    flex-direction: column;
    gap: var(--sp-8);
  }

  .board-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-4) var(--sp-12);
    padding: var(--sp-12) var(--sp-16);
    background: var(--card);
    border-radius: var(--radius);
  }

  .board-table td {
    display: block;
    padding: 0;
    border: 0;
  }

  .board-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .board-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .board-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .board-table td:nth-child(4),
  .board-table td:nth-child(5) {
    display: inline-block;
    grid-column: 1;
    font-size: 12px;
    color: var(--muted-foreground);
  }

  .board-table td:nth-child(4)::before {
    content: "学费 ";
    color: var(--muted-foreground);
  }

  .board-table td:nth-child(5)::before {
    content: "录取率 ";
    color: var(--muted-foreground);
  }

  .board-table td:nth-child(6) {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }

  .board-no {
    display: inline;
    margin-left: var(--sp-8);
  }

  .board-toolbar-row {
    align-items: flex-start;
  }

  .board-tabs {
    padding-bottom: 0;
  }

  .app-footer {
    padding: var(--sp-16) var(--sp-12) var(--sp-24);
    margin-top: var(--sp-24);
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 28px;
  }

  .tagline-text {
    font-size: 22px;
  }

  .stat {
    padding: var(--sp-12) var(--sp-12) var(--sp-12) var(--sp-16);
  }

  .stat-value {
    font-size: 24px;
    line-height: 32px;
  }
}

/* 小屏手机统计条：两列，避免六列挤压 */
@media (max-width: 760px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

/* ---------- 降低动效偏好：位移换成直接呈现 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 打印 ---------- */
@media print {
  .topbar,
  .sidebar,
  .bottom-nav,
  .no-print,
  .skip-link {
    display: none !important;
  }

  .main {
    padding: 0;
  }
}

/* ============================================================================
   首页：与影院段（cinema）的衔接
   ----------------------------------------------------------------------------
   1) 首页做成全宽「舞台」：左侧栏隐藏、主区去掉内边距，影院段落才能真正 edge-to-edge
   2) 顶栏在首页浮动在黑色舞台之上（滚动到浅色内容区时由 cinema.css 的 over-cinema 接管）
   3) 深色 → 浅色的过渡与段落节奏：开头大留白，之后小段密集
   ========================================================================== */

html[data-route="home"] .sidebar {
  display: none;
}

html[data-route="home"] .main {
  padding: 0;
}

html[data-route="home"] .page {
  max-width: none;
}

/* 首页顶栏浮动在舞台之上（Apple 式：导航压在内容上，而不是占一条白边） */
html[data-route="home"] .topbar {
  position: fixed;
  top: var(--nav-gutter);
  left: var(--nav-gutter);
  right: var(--nav-gutter);
  margin: 0;
}

/* 引擎未启动（脚本被拦 / 首帧）时的兜底：首页顶栏按深色处理，避免白条压黑屏 */
html[data-route="home"]:not(.cinema-ready) .topbar {
  background: rgba(18, 18, 20, 0.74);
  border-color: rgba(255, 255, 255, 0.14);
}

html[data-route="home"]:not(.cinema-ready) .topbar :is(.brand, .brand-sub, .nav-link, .btn-ghost) {
  color: #f5f5f7;
}

html[data-route="home"]:not(.cinema-ready) .topbar .input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f7;
}

/* 深色影院段之后的浅色内容区：居中容器 + 大留白开头 */
.home-body {
  position: relative;
  background: var(--background);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-80) clamp(var(--sp-16), 4vw, var(--sp-24)) var(--sp-64);
}

/* Apple 式节奏：段落之间留白比旧版更紧，靠区块标题与分隔线建立层次 */
.home-section {
  margin-bottom: var(--sp-64);
}

.home-body .section-head {
  margin-bottom: var(--sp-24);
}

.home-body .split {
  padding: var(--sp-48) 0;
  margin-bottom: var(--sp-64);
}

.home-body .final-cta {
  margin: var(--sp-64) 0 var(--sp-32);
}

.home-disclaimer {
  margin-bottom: 0;
}

.home-body .app-footer {
  margin-top: 0;
}

@media (max-width: 1024px) {
  .home-body {
    padding-top: var(--sp-64);
  }

  .home-section {
    margin-bottom: var(--sp-48);
  }
}

@media (max-width: 760px) {
  /* 手机：顶栏回到贴边应用条，仍旧压在影院段上 */
  html[data-route="home"] .topbar {
    top: 0;
    left: 0;
    right: 0;
  }

  html[data-route="home"] .main {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + var(--sp-24));
  }

  .home-body {
    padding: var(--sp-48) var(--sp-16) var(--sp-48);
  }

  .home-section {
    margin-bottom: var(--sp-40);
  }

  .home-body .split {
    padding: var(--sp-32) 0;
    margin-bottom: var(--sp-40);
  }

  .home-body .final-cta {
    margin: var(--sp-40) 0 var(--sp-24);
  }
}

/* ---------- prefers-reduced-motion 下的顶栏兜底 ----------
   引擎在 reduced-motion 时不跑滚动 tick，over-cinema 不会自动加上；
   但首页前三段（首屏 / 拆解 / 数字账本）始终是深色舞台，所以这里直接把首页顶栏
   定为深色玻璃，保证白字压黑底、可读且不闪。 */
@media (prefers-reduced-motion: reduce) {
  html[data-route="home"] .topbar {
    background: rgba(18, 18, 20, 0.74);
    border-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
  }

  html[data-route="home"] .topbar :is(.brand, .brand-sub, .btn-ghost) {
    color: #f5f5f7;
  }

  html[data-route="home"] .topbar .nav-link {
    color: #f5f5f7;
  }

  html[data-route="home"] .topbar .nav-link.active {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
  }

  html[data-route="home"] .topbar .input {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f5f5f7;
  }

  html[data-route="home"] .topbar .btn-outline {
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.24);
  }
}
