/* 中小学知识图谱：深空科技玻璃风（与测试诊断系统同一套视觉语言）。浏览页与诊断页共用。 */

:root {
  color-scheme: dark;

  /* 深空底 + 玻璃面 */
  --bg: #050a18;
  --bg-elev: rgba(255, 255, 255, 0.05);
  --bg-muted: rgba(255, 255, 255, 0.08);
  --text: #e8eef7;
  --muted: #94a6c0;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* 品牌：霓虹青（主）+ 科技蓝 */
  --brand: #22d3ee;
  --brand-strong: #67e8f9;
  --brand-soft: rgba(34, 211, 238, 0.15);
  --on-brand: #04122b;
  --brand-blue: #3b82f6;
  --junior: #60a5fa;
  --junior-soft: rgba(59, 130, 246, 0.16);
  --focus: #22d3ee;
  --accent: #2dd4bf;

  --radius: 16px;
  --radius-sm: 12px;
  --header-bg: rgba(7, 15, 34, 0.72);
  --panel: rgba(255, 255, 255, 0.05);

  --logo-sheet: rgba(34, 211, 238, 0.18);
  --logo-fold: rgba(34, 211, 238, 0.30);

  /* 玻璃质感 */
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glow: 0 10px 34px rgba(3, 9, 24, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glow-cyan: 0 0 22px rgba(34, 211, 238, 0.35);
  --shadow: 0 10px 30px rgba(2, 6, 18, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --fs: 16px;

  /* 状态色（深色提亮） */
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, 0.15);
  --on-ok: #052e16;
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, 0.15);
  --on-bad: #450a0a;
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.15);
  --unk: #9fb0c7;
  --unk-bg: rgba(148, 163, 184, 0.14);

  /* 知识图谱学段三色（数据编码：小学青 / 初中蓝 / 高中紫）+ 目标橙 */
  --node-primary: #2dd4bf;
  --node-primary-bg: rgba(45, 212, 191, 0.16);
  --node-junior: #60a5fa;
  --node-junior-bg: rgba(96, 165, 250, 0.16);
  --node-senior: #c084fc;
  --node-senior-bg: rgba(192, 132, 252, 0.17);
  --node-current-bg: rgba(251, 146, 60, 0.18);
  --node-current-border: #fb923c;
  --node-text: #f1f5f9;
  --edge: #7c8aa5;
  --edge-soft: #4b5a76;

  --hard-bg: rgba(248, 113, 113, 0.15);
  --hard-fg: #fca5a5;
  --soft-bg: rgba(148, 163, 184, 0.14);
  --soft-fg: #cbd5e1;
  --diagram-ok-bg: rgba(74, 222, 128, 0.15);
  --diagram-ok: #4ade80;
  --diagram-bad-bg: rgba(248, 113, 113, 0.15);
  --diagram-bad: #f87171;
  --diagram-unk-bg: rgba(148, 163, 184, 0.14);
  --diagram-unk: #cbd5e1;
  --diagram-shaky-bg: rgba(251, 191, 36, 0.16);
  --diagram-shaky: #fcd34d;
  --diagram-text: #f1f5f9;
  --diagram-edge: #94a3b8;
}

/* 学科切换在同一套深空青蓝框架内，保持视觉统一 */
body.subject-physics,
body.subject-english {
  --brand: #22d3ee;
  --brand-strong: #67e8f9;
  --brand-soft: rgba(34, 211, 238, 0.15);
  --on-brand: #04122b;
  --focus: #22d3ee;
  --accent: #2dd4bf;
  --logo-sheet: rgba(34, 211, 238, 0.18);
  --logo-fold: rgba(34, 211, 238, 0.30);
}

@media print {
  :root {
    color-scheme: light;
    --bg: #fff;
    --bg-elev: #fff;
    --bg-muted: #f4f7fb;
    --text: #162033;
    --muted: #475569;
    --line: #d5dde6;
    --line-strong: #c2ccd9;
    --brand: #0e7490;
    --brand-strong: #0e7490;
    --brand-soft: #e6f6f8;
    --on-brand: #fff;
    --panel: #fff;
    --header-bg: #fff;
    --logo-sheet: #cdeef3;
    --logo-fold: #e8f8fa;
    --glass: #fff;
    --glass-strong: #fff;
    --glass-border: #d5dde6;
    --shadow: none;
    --glow: none;
    --glow-cyan: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: #050a18; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  letter-spacing: 0.01em;
  position: relative;
  min-height: 100vh;
}
/* 深空极光背景（与测试诊断系统 tech-dark 同源） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: #050a18;
  background-image:
    radial-gradient(1200px 620px at 50% -220px, rgba(34, 211, 238, 0.30), transparent 62%),
    radial-gradient(1000px 560px at 100% -40px, rgba(59, 130, 246, 0.26), transparent 58%),
    radial-gradient(820px 820px at 8% 92%, rgba(37, 99, 235, 0.22), transparent 60%),
    radial-gradient(760px 760px at 92% 82%, rgba(45, 212, 191, 0.18), transparent 60%),
    radial-gradient(640px 640px at 58% 42%, rgba(129, 140, 248, 0.13), transparent 66%);
  background-size: 100% 100%;
  background-attachment: fixed;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(2, 6, 18, 0.55) 100%);
}
@media print {
  html { background: #fff; }
  body::before, body::after { display: none !important; }
}
img { max-width: 100%; height: auto; }
.node-tip {
  position: absolute;
  z-index: 6;
  max-width: min(280px, calc(100% - 16px));
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(8, 16, 34, 0.92);
  color: #e8eef7;
  border: 1px solid var(--line-strong);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow-wrap: anywhere;
}
code { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

.top-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 12px;
  background: rgba(8, 15, 32, 0.92);
  color: #dbe7f5;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
}
.top-banner:hover { background: rgba(34, 211, 238, 0.16); color: var(--brand-strong); }
@media (max-width: 420px) {
  .top-banner { font-size: 12.5px; padding: 5px 8px; }
}
@media print {
  .top-banner { display: none !important; }
}

/* ===== 玻璃拟态工具类（供各页面共用） ===== */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--glow);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 12px 28px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  max-width: 100%;
}
body:not(.page-explore) .site-header {
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.logo {
  color: var(--brand);
  width: 40px;
  height: 40px;
  flex: none;
  display: block;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.45));
}
.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 1px;
}
.brand-name {
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #f4f8ff;
  overflow-wrap: anywhere;
}
.brand-kicker {
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.14em;
  color: var(--brand-strong);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  min-width: 0;
  max-width: 100%;
}
.subject-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--line);
}
.page-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 650;
  transition: all 0.18s ease;
}
.nav-link:hover { background: var(--bg-muted); color: #eaf2fc; }
.nav-link.active, .nav-link[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.28);
}
.nav-link.active:hover, .nav-link[aria-current="page"]:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.nav-link.subject-link {
  color: var(--muted);
  border: 0;
  background: transparent;
  padding: 0 14px;
}
.nav-link.subject-link:hover { background: transparent; color: #eaf2fc; }
.nav-link.subject-link.on {
  background: linear-gradient(100deg, #22d3ee, #3bbec9 55%, #3b82f6);
  color: var(--on-brand);
  font-weight: 800;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
}
.nav-link.subject-link.on:hover { background: linear-gradient(100deg, #22d3ee, #3bbec9 55%, #3b82f6); color: var(--on-brand); }
@media (max-width: 720px) {
  .site-header { padding: 10px 14px 8px; gap: 4px 12px; }
  .brand { gap: 10px; min-height: 44px; }
  .logo { width: 34px; height: 34px; }
  .brand-name { font-size: 1.02rem; }
  .brand-kicker { font-size: 0.72rem; letter-spacing: 0.1em; }
  .site-nav { flex: 1 1 100%; justify-content: space-between; gap: 4px 8px; }
  .nav-link { padding: 0 8px; font-size: 0.9rem; }
  .nav-link.subject-link { padding: 0 12px; }
}

.site-footer {
  padding: 14px 16px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
  max-width: 100%;
}
.site-footer p { margin: 0; overflow-wrap: anywhere; }
.site-footer a { color: var(--brand-strong); font-weight: 700; }

/* ===== 按钮：玻璃幽灵 + 霓虹青主 CTA ===== */
button, .btn {
  font: inherit;
  font-weight: 650;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe4f0;
  cursor: pointer;
  transition: all 0.18s ease;
}
button:hover, .btn:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.5);
  color: #a5f3fc;
}
button.primary, .btn-primary {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  background: linear-gradient(100deg, #22d3ee 0%, #33c9d6 45%, #3b82f6 100%);
  color: var(--on-brand);
  font-weight: 800;
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.42);
}
button.primary:hover, .btn-primary:hover {
  filter: brightness(1.06);
  background: linear-gradient(100deg, #22d3ee 0%, #33c9d6 45%, #3b82f6 100%);
  color: var(--on-brand);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.6);
}

/* 题目图示 */
.q-figure { color: inherit; max-width: 100%; min-width: 0; margin: 8px 0 2px; }
.q-figure svg { width: 100%; max-width: 440px; height: auto; display: block; overflow: visible; }
.choices.fig-icons, .sample-choices.fig-icons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}
.choices.fig-icons .q-figure svg, .sample-choices.fig-icons .q-figure svg { max-width: 100%; }
button.choice.fig-choice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.sample-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sample-choice {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
  padding: 8px 10px;
  min-width: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
}
.btn-lg { min-height: 50px; padding: 12px 20px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===== 深色输入框 ===== */
input[type="search"], input[type="text"], input[type="number"], select, textarea {
  font: inherit;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
  max-width: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: all 0.18s ease;
}
input::placeholder, textarea::placeholder { color: #64748b; }
input[type="search"]:hover, input[type="text"]:hover, input[type="number"]:hover, select:hover, textarea:hover {
  border-color: rgba(255, 255, 255, 0.26);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.7);
  background: rgba(34, 211, 238, 0.07);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
select option { background: #0d1830; color: #f1f5f9; }
textarea { min-height: 96px; }
.search-lg { width: 100%; font-size: 1.08rem; min-height: 52px; }

.stage-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-tab { border-radius: 999px; }
.stage-tab.on, .stage-tab[aria-selected="true"] {
  background: var(--brand);
  color: var(--on-brand);
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.38);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.badge.hard { background: var(--hard-bg); color: var(--hard-fg); }
.badge.soft { background: var(--soft-bg); color: var(--soft-fg); }

/* ===== 首页 ===== */
.home { width: min(1040px, 100%); margin: 0 auto; padding: 28px 16px 56px; }
.hero {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 32px 28px 26px;
  box-shadow: var(--glow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #22d3ee, #3b82f6, transparent);
  opacity: 0.8;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 4.4vw, 2.8rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #f7fbff;
  text-shadow: 0 0 30px rgba(34, 211, 238, 0.25);
}
.lede { margin: 0 0 20px; font-size: 1.05rem; max-width: 40em; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn { flex: 1 1 180px; }
.quiet-link { margin: 16px 0 0; }
.quiet-link a { color: var(--brand-strong); font-weight: 650; text-underline-offset: 3px; }

.section-title {
  position: relative;
  margin: 36px 0 14px;
  padding-left: 13px;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #cffafe;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 1.05em;
  border-radius: 2px;
  background: linear-gradient(180deg, #22d3ee, #3b82f6);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.6);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.steps li {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  min-width: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.steps li:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, 0.4); }
.step-no {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid rgba(34, 211, 238, 0.35);
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.28);
}
.steps h3 { margin: 12px 0 5px; font-size: 1.05rem; letter-spacing: -0.02em; color: #eef4fc; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.stat-grid, .grade-grid {
  display: grid;
  gap: 14px;
}
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grade-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card, a.grade-card, a.iq-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  min-width: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.stat-card { padding: 16px 18px; }
.stat-num { font-size: 1.85rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: #a5f3fc; text-shadow: 0 0 22px rgba(34, 211, 238, 0.35); }
.stat-label { color: var(--muted); font-weight: 650; font-size: 0.92rem; }
.stat-note { color: var(--muted); margin: 10px 0 0; font-size: 0.92rem; }
a.grade-card, a.iq-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  min-height: 96px;
  text-decoration: none;
  color: inherit;
  border-top: 3px solid var(--node-primary);
}
a.grade-card.is-junior { border-top-color: var(--node-junior); }
a.grade-card.is-senior { border-top-color: var(--node-senior); }
a.grade-card:hover, a.iq-card:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, 0.45); }
a.grade-card strong, a.iq-card strong { font-size: 1.08rem; letter-spacing: -0.02em; color: #eef4fc; }
a.iq-card { margin-top: 22px; gap: 4px; max-width: 100%; border-top-color: var(--brand); }
a.iq-card .iq-sub { font-weight: 650; overflow-wrap: anywhere; }
a.iq-card .iq-note { color: var(--muted); font-size: 0.82rem; font-weight: 650; overflow-wrap: anywhere; }
.grade-stage { color: var(--muted); font-size: 0.82rem; font-weight: 650; }
.grade-count { font-weight: 650; color: var(--brand-strong); }
.load-error {
  background: var(--bad-bg);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
}
@media (max-width: 900px) {
  .grade-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 24px 18px 20px; }
}
