/* ================= 设计系统变量（蓝系 · 大厂标准版心规格：1200px） ================= */
:root {
  /* ---------- 背景：蓝调中性，H≈212 ---------- */
  --bg-page: #F6F9FC;
  --bg-card: #FFFFFF;
  --bg-subtle: #EAF1FA;
  --bg-elevated: #FFFFFF;

  /* ---------- 文字：蓝黑渐进 ---------- */
  --text-primary: #121B26;
  --text-secondary: #33455C;
  --text-muted: #57697F;

  /* ---------- 品牌：直接引用基准 ---------- */
  --brand-primary: #3696FC;
  --brand-hover: #1C6CDC;
  --brand-deep: #0C5CAC;
  --brand-tint: rgba(54, 150, 252, 0.10);
  --brand-tint-strong: rgba(54, 150, 252, 0.16);
  --brand-ring: rgba(54, 150, 252, 0.38);

  /* ---------- 边框：同色相半透明 ---------- */
  --border-subtle: rgba(18, 32, 50, 0.08);
  --border-strong: rgba(18, 32, 50, 0.14);
  --border-brand: rgba(54, 150, 252, 0.40);

  /* ---------- 强调 / 语义 ---------- */
  --accent-warm: #C26A1A;
  --accent-warm-bg: rgba(194, 106, 26, 0.10);
  --warn-boundary: #A8432E;
  --warn-boundary-bg: rgba(168, 67, 46, 0.10);

  /* ---------- 阴影：蓝黑基色 ---------- */
  --shadow-xs: 0 1px 2px rgba(15, 30, 50, 0.04);
  --shadow-sm: 0 4px 14px rgba(15, 30, 50, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 30, 50, 0.07);
  --shadow-lg: 0 20px 44px rgba(15, 30, 50, 0.11);
  --shadow-fab: 0 10px 24px rgba(12, 92, 172, 0.30);

  /* ---------- 圆角 ---------- */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* ---------- 字体 ---------- */
  --font-sans: system-ui, sans-serif;
  --font-display: system-ui, sans-serif;

  /* ---------- 动效 ---------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);

  /* ---------- 版心与断点间距规格 ---------- */
  --container-w: 1200px;
  --gutter-desktop: 24px;
  --gutter-tablet: 20px;
  --gutter-mobile: 16px;

  --header-h: 64px;
  --header-top-gap: 12px;

  /* ---------- 全站统一字号与字重系统（默认电脑端：16px） ---------- */
  --fs-base: 16px;
  --fs-min-ratio: 0.85;
  --fs-min: calc(var(--fs-base) * var(--fs-min-ratio)); /* 桌面最小 13.6px */

  --fs-xs: max(var(--fs-min), calc(var(--fs-base) * 0.875));  /* 辅助/标签（桌面 14px） */
  --fs-sm: max(var(--fs-min), calc(var(--fs-base) * 0.9375)); /* 次级正文/描述（桌面 15px） */
  --fs-md: var(--fs-base);                                     /* 标准正文（桌面 16px） */
  --fs-lg: calc(var(--fs-base) * 1.125);                       /* 小标题/导语（桌面 18px） */
  --fs-xl: calc(var(--fs-base) * 1.375);                       /* 中标题/重点数据（桌面 22px） */
  --fs-2xl: calc(var(--fs-base) * 1.75);                       /* 区块主标题（桌面 28px） */
  --fs-hero: clamp(2.125rem, 4.2vw, 3.375rem);                 /* 首屏大标题（34px ~ 54px） */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.22;
  --lh-snug: 1.42;
  --lh-body: 1.68;
}

/* Pad 横屏（960px ~ 1366px 宽且高度 > 540px） */
@media (max-width: 1366px) and (min-width: 960px) and (orientation: landscape) and (min-height: 541px) {
  :root {
    --fs-base: 15px;
    --fs-min: calc(var(--fs-base) * var(--fs-min-ratio)); /* 12.75px */
  }
}

/* Pad 竖屏及常规平板（641px ~ 1024px，排除矮横屏手机） */
@media (max-width: 1024px) and (min-width: 641px) and (not ((max-height: 540px) and (orientation: landscape))) {
  :root {
    --fs-base: 15px;
    --fs-min: calc(var(--fs-base) * var(--fs-min-ratio)); /* 12.75px */
  }
}

/* 手机竖屏及窄屏（<= 640px） */
@media (max-width: 640px) {
  :root {
    --fs-base: 14px;
    --fs-min: calc(var(--fs-base) * var(--fs-min-ratio)); /* 11.9px */
  }
}

/* 手机横屏（宽 <= 960px 且高 <= 540px） */
@media (max-width: 960px) and (max-height: 540px) and (orientation: landscape) {
  :root {
    --fs-base: 14px;
    --fs-min: calc(var(--fs-base) * var(--fs-min-ratio)); /* 11.9px */
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.icon { width: 20px; height: 20px; flex-shrink: 0; display: block; }

/* ================= 统一版心容器 ================= */
.container,
.subpage-wrap,
.assess-wrap {
  width: 100%;
  max-width: var(--container-w);
  margin-left: auto;
  margin-right: auto;
}

.container {
  padding-left: var(--gutter-desktop);
  padding-right: var(--gutter-desktop);
}

.subpage-wrap,
.assess-wrap {
  padding: 28px var(--gutter-desktop) 80px;
}

@media (max-width: 1024px) {
  .container {
    padding-left: var(--gutter-tablet);
    padding-right: var(--gutter-tablet);
  }
  .subpage-wrap,
  .assess-wrap {
    padding: 24px var(--gutter-tablet) 72px;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }
  .subpage-wrap,
  .assess-wrap {
    padding: 20px var(--gutter-mobile) 68px;
  }
}

/* ================= 悬浮非通栏顶部导航 ================= */
.floating-header-wrap {
  position: fixed;
  top: var(--header-top-gap);
  left: 0;
  right: 0;
  z-index: 900;
  padding-left: var(--gutter-desktop);
  padding-right: var(--gutter-desktop);
  pointer-events: none;
}
@media (max-width: 1024px) {
  .floating-header-wrap {
    padding-left: var(--gutter-tablet);
    padding-right: var(--gutter-tablet);
  }
}
@media (max-width: 640px) {
  .floating-header-wrap {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }
}

.topbar.floating-header {
  position: relative;
  width: 100%;
  max-width: var(--container-w);
  height: var(--header-h);
  margin: 0 auto;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.topbar-inner {
  width: 100%;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 14px; }
}

.brand { display: inline-flex; align-items: center; gap: 4px; user-select: none; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; }
.brand-text { display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-extrabold); letter-spacing: -0.025em; color: var(--text-primary); }
.brand-tagline { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); letter-spacing: 0.01em; }
@media (max-width: 480px) { .brand-tagline { display: none; } }

.desktop-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; padding: 8px 14px; border-radius: var(--radius-full);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-secondary);
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-subtle); }
.nav-link.active { color: var(--brand-deep); background: var(--brand-tint); }
.nav-link .icon { width: 16px; height: 16px; opacity: 0.85; }
.nav-link.active .icon { opacity: 1; color: var(--brand-primary); }

/* ================= 移动端汉堡按钮与下拉菜单 ================= */
.mobile-menu-anchor { position: relative; display: none; }
@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .mobile-menu-anchor { display: inline-flex; align-items: center; }
}

.burger-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.burger-btn:hover { background: var(--bg-subtle); }
.burger-btn[aria-expanded="true"] { background: var(--brand-tint); color: var(--brand-deep); }

.burger-lines { width: 18px; height: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.burger-lines span { display: block; height: 2px; width: 100%; border-radius: 2px; background: currentColor; transition: transform 0.25s var(--ease-out), opacity 0.2s; }
.burger-btn[aria-expanded="true"] .burger-lines span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger-btn[aria-expanded="true"] .burger-lines span:nth-child(2) { opacity: 0; }
.burger-btn[aria-expanded="true"] .burger-lines span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  min-width: 136px;
  max-width: calc(100vw - 32px);
  z-index: 910;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.mobile-dropdown.open { display: block; animation: dropdownPop 0.2s var(--ease-out); }

@keyframes dropdownPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mobile-nav-list { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-item {
  width: auto; padding: 9px 14px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; gap: 9px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-secondary);
  white-space: nowrap; text-align: left;
  transition: background 0.16s var(--ease-out), color 0.16s var(--ease-out);
}
.mobile-nav-item .icon { width: 16px; height: 16px; color: var(--text-muted); }
.mobile-nav-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.mobile-nav-item.active { background: var(--brand-tint); color: var(--brand-deep); }
.mobile-nav-item.active .icon { color: var(--brand-primary); }

/* ================= 主体与区块节奏 ================= */
main {
  flex: 1;
  width: 100%;
  padding-top: calc(var(--header-h) + var(--header-top-gap) + 16px);
}

.view { display: none; animation: viewFade 0.28s var(--ease-out); }
.view.active { display: block; }
@keyframes viewFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.section { padding: 72px 0; }
@media (max-width: 1024px) { .section { padding: 60px 0; } }
@media (max-width: 640px) { .section { padding: 48px 0; } }

.section-head { margin-bottom: 36px; max-width: 680px; }
.section-kicker {
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-deep); margin-bottom: 8px; line-height: var(--lh-snug);
}
.section-title {
  font-family: var(--font-display); font-size: var(--fs-2xl);
  font-weight: var(--fw-extrabold); letter-spacing: -0.025em; line-height: var(--lh-tight); color: var(--text-primary);
}
.section-sub { margin-top: 10px; font-size: var(--fs-lg); font-weight: var(--fw-regular); color: var(--text-muted); line-height: var(--lh-body); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: var(--radius-sm);
  background: var(--brand-primary); color: var(--bg-card);
  font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: -0.01em;
  box-shadow: 0 6px 18px rgba(54, 150, 252, 0.24);
  transition: transform 0.2s var(--ease-spring), background 0.2s var(--ease-out), box-shadow 0.2s;
}
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(54, 150, 252, 0.30); }
.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-strong); font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-xs); transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease-spring);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: rgba(20, 32, 24, 0.22); transform: translateY(-1px); }

.subpage-head { margin-bottom: 28px; }

.quiz-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-md);
}
@media (max-width: 640px) { .quiz-card { padding: 22px 18px; } }

.progress-bar { height: 6px; background: var(--bg-subtle); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 24px; }
.progress-fill { height: 100%; background: var(--brand-primary); border-radius: var(--radius-full); transition: width 0.35s var(--ease-out); }

.ep-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-xs);
}
.ep-ext-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.ext-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: var(--radius-full);
  background: var(--bg-subtle); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  transition: background 0.18s, color 0.18s;
}
.ext-chip:hover { background: var(--brand-tint); color: var(--brand-deep); }

.note-item {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 26px 28px; margin-bottom: 18px; box-shadow: var(--shadow-xs);
}

/* ================= 浅色页脚 ================= */
.site-footer.footer-light-bar {
  margin-top: auto;
  background: var(--bg-card);
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
  padding: 28px 0 24px;
}

.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-light-bar .footer-brand { color: var(--text-primary); flex-shrink: 0; }

.footer-inline-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-inline-link {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.18s var(--ease-out);
}
.footer-inline-link:hover,
.footer-inline-link.active { color: var(--brand-deep); }

.footer-social-icons { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.footer-icon-link {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border-subtle);
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), color 0.18s var(--ease-out), transform 0.18s var(--ease-spring);
}
.footer-icon-link:hover {
  background: var(--brand-tint); border-color: var(--brand-primary); color: var(--brand-deep); transform: translateY(-1px);
}

.footer-bottom {
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-top-row { flex-direction: column; align-items: center; gap: 16px; }
  .footer-inline-nav { justify-content: center; gap: 14px 20px; }
  .footer-social-icons { justify-content: center; }
  .footer-bottom { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
}

/* ================= 图标按钮与弹窗 ================= */
.icon-action {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary); background: transparent;
  transition: background 0.18s, color 0.18s;
}
.icon-action:hover { background: var(--bg-subtle); color: var(--text-primary); }
.modal-close { width: 32px; height: 32px; border-radius: 50%; }

.copy-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-primary); word-break: break-all;
}
.copy-btn-sm { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border-subtle); flex-shrink: 0; }
.copy-btn-sm:hover { border-color: var(--brand-primary); color: var(--brand-deep); }

.qr-placeholder {
  width: 164px; height: 164px; margin: 4px auto 14px; border-radius: var(--radius-md);
  border: 1.5px dashed rgba(20, 32, 24, 0.2); background: var(--bg-subtle);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-muted); font-size: var(--fs-xs);
}

.modal-action-row { margin-top: 14px; display: flex; gap: 10px; }
.modal-action-row .btn-primary { flex: 1; height: 42px; font-size: var(--fs-sm); }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120;
  transform: translateX(-50%) translateY(16px);
  background: var(--text-primary); color: var(--bg-card);
  padding: 10px 18px; border-radius: var(--radius-full);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); opacity: 0; pointer-events: none;
  box-shadow: var(--shadow-lg); transition: opacity 0.2s, transform 0.25s var(--ease-out);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }