/* 中小学·高中知识图谱：清新少儿向全站配色、圆润卡片与友好交互。浏览页与诊断页共用。 */

:root {
  color-scheme: light;
  --bg: #f3fbf8;
  --bg-elev: #ffffff;
  --bg-muted: #e8f6f0;
  --text: #1e2d3b;
  --muted: #567082;
  --line: #d4ebe1;
  --brand: #10b981;
  --brand-strong: #059669;
  --brand-soft: #dcfce7;
  --on-brand: #ffffff;
  --junior: #0ea5e9;
  --junior-soft: #e0f2fe;
  --focus: #10b981;
  --shadow: 0 4px 12px rgba(16, 185, 129, 0.08), 0 12px 28px rgba(14, 165, 233, 0.06);
  --radius: 20px;
  --radius-sm: 14px;
  --header-bg: rgba(255, 255, 255, 0.92);
  --logo-sheet: #d1fae5;
  --logo-fold: #ffffff;
  --font: "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --fs: 16px;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --on-ok: #ffffff;
  --bad: #e11d48;
  --bad-bg: #ffe4e6;
  --on-bad: #ffffff;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --unk: #475569;
  --unk-bg: #e2f0fb;
  --accent: #10b981;
  --panel: #ffffff;
  --node-primary: #10b981;
  --node-primary-bg: #d1fae5;
  --node-junior: #0ea5e9;
  --node-junior-bg: #e0f2fe;
  --node-senior: #a855f7;
  --node-senior-bg: #f3e8ff;
  --node-current-bg: #fef3c7;
  --node-current-border: #f59e0b;
  --node-text: #1e2d3b;
  --edge: #64748b;
  --edge-soft: #94a3b8;
  --hard-bg: #ffedd5;
  --hard-fg: #c2410c;
  --soft-bg: #e0f2fe;
  --soft-fg: #0369a1;
  --diagram-ok-bg: #dcfce7;
  --diagram-ok: #15803d;
  --diagram-bad-bg: #ffe4e6;
  --diagram-bad: #e11d48;
  --diagram-unk-bg: #f1f5f9;
  --diagram-unk: #64748b;
  --diagram-shaky-bg: #fef3c7;
  --diagram-shaky: #d97706;
  --diagram-text: #1e2d3b;
  --diagram-edge: #64748b;
}

body.subject-physics {
  --brand: #f59e0b;
  --brand-strong: #d97706;
  --brand-soft: #fef3c7;
  --on-brand: #ffffff;
  --focus: #f59e0b;
  --accent: #f59e0b;
  --logo-sheet: #fde68a;
  --logo-fold: #ffffff;
}

body.subject-english {
  --brand: #6366f1;
  --brand-strong: #4f46e5;
  --brand-soft: #e0e7ff;
  --on-brand: #ffffff;
  --focus: #6366f1;
  --accent: #6366f1;
  --logo-sheet: #c7d2fe;
  --logo-fold: #ffffff;
}

body.subject-science {
  --brand: #14b8a6;
  --brand-strong: #0d9488;
  --brand-soft: #ccfbf1;
  --on-brand: #ffffff;
  --focus: #14b8a6;
  --accent: #14b8a6;
  --logo-sheet: #99f6e4;
  --logo-fold: #ffffff;
}

body.subject-chinese {
  --brand: #f43f5e;
  --brand-strong: #e11d48;
  --brand-soft: #ffe4e6;
  --on-brand: #ffffff;
  --focus: #f43f5e;
  --accent: #f43f5e;
  --logo-sheet: #fecdd3;
  --logo-fold: #ffffff;
}

body.subject-morality {
  --brand: #fb923c;
  --brand-strong: #ea580c;
  --brand-soft: #ffedd5;
  --on-brand: #ffffff;
  --focus: #fb923c;
  --accent: #fb923c;
  --logo-sheet: #fed7aa;
  --logo-fold: #ffffff;
}

body.subject-history {
  --brand: #b45309;
  --brand-strong: #92400e;
  --brand-soft: #fef3c7;
  --on-brand: #ffffff;
  --focus: #b45309;
  --accent: #b45309;
  --logo-sheet: #fde68a;
  --logo-fold: #ffffff;
}

body.subject-geography {
  --brand: #06b6d4;
  --brand-strong: #0891b2;
  --brand-soft: #cffafe;
  --on-brand: #ffffff;
  --focus: #06b6d4;
  --accent: #06b6d4;
  --logo-sheet: #a5f3fc;
  --logo-fold: #ffffff;
}

body.subject-biology {
  --brand: #22c55e;
  --brand-strong: #16a34a;
  --brand-soft: #dcfce7;
  --on-brand: #ffffff;
  --focus: #22c55e;
  --accent: #22c55e;
  --logo-sheet: #bbf7d0;
  --logo-fold: #ffffff;
}

body.subject-chemistry {
  --brand: #ec4899;
  --brand-strong: #db2777;
  --brand-soft: #fce7f3;
  --on-brand: #ffffff;
  --focus: #ec4899;
  --accent: #ec4899;
  --logo-sheet: #fbcfe8;
  --logo-fold: #ffffff;
}

/* 清新少儿向始终保持明亮护眼浅色画布，不随系统深色切暗 */

@media print {
  :root {
    --bg: #fff;
    --bg-elev: #fff;
    --bg-muted: #f4f7fb;
    --text: #162033;
    --muted: #475569;
    --line: #d5dde6;
    --panel: #fff;
    --header-bg: #fff;
    --logo-sheet: #dff3ef;
    --logo-fold: #ffffff;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(16, 185, 129, 0.10), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(56, 189, 248, 0.11), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(250, 204, 21, 0.10), transparent 32%),
    var(--bg);
  background-attachment: fixed;
  letter-spacing: 0.01em;
}
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: var(--text);
  color: var(--bg);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: var(--shadow);
  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: 36px;
  padding: 6px 12px;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 52%, #38bdf8 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 0.02em;
}
.top-banner:hover { filter: brightness(1.05); color: #ffffff; }
@media (max-width: 420px) {
  .top-banner { font-size: 12.5px; padding: 5px 8px; }
}
@media print {
  .top-banner { display: none !important; }
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 12px 28px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--line);
  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;
}
.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: var(--text);
  overflow-wrap: anywhere;
}
.brand-kicker {
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--brand);
}
.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);
}
.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: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 650;
}
.nav-link:hover { background: var(--bg-muted); color: var(--text); }
.nav-link.active, .nav-link[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 750;
}
.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: var(--text); }
.nav-link.subject-link.on {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 750;
}
.nav-link.subject-link.on:hover { background: var(--brand); color: var(--on-brand); }
.nav-link.resource-search-btn {
  gap: 6px;
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand-strong);
  margin-left: 6px;
  text-decoration: none;
}
.nav-link.resource-search-btn:hover { background: var(--brand-soft); color: var(--brand-strong); }
.resource-search-ico { width: 14px; height: 14px; flex: none; }
.resource-search-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 720px) {
  .nav-link.resource-search-btn { margin-left: 0; padding: 0 9px; min-height: 36px; }
  .resource-search-ico { display: none; }
  .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.06em; }
  .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; }

button, .btn {
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background-color 0.14s ease, border-color 0.14s ease;
}
button:hover, .btn:hover { background: var(--bg-muted); border-color: var(--brand); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  border-color: transparent;
  color: var(--on-brand);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
button.primary:hover, .btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.32); }

/* 题目图示：只用 currentColor，浅色和深色都看得见。宽度跟着容器走，不写死像素。 */
.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: 48px; padding: 10px 18px; font-size: 1rem; }
.btn-block { width: 100%; }

input[type="search"], input[type="text"], input[type="number"], select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
  max-width: 100%;
}
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;
}

.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: 20px 16px 48px; }
.hero {
  background: linear-gradient(135deg, #ffffff 0%, #effcf6 58%, #fefce8 100%);
  border: 2px solid var(--line);
  border-radius: 26px;
  padding: 30px 26px 24px;
  box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.85rem, 4.4vw, 2.7rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 750;
}
.lede { margin: 0 0 18px; font-size: 1.05rem; max-width: 38em; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn { flex: 1 1 180px; }
.quiet-link { margin: 14px 0 0; }
.quiet-link a { color: var(--brand-strong); font-weight: 650; text-underline-offset: 3px; }

.section-title { margin: 32px 0 12px; font-size: 1.15rem; letter-spacing: -0.02em; }
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.steps li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 18px;
  min-width: 0;
}
.step-no {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 750;
  font-size: 0.92rem;
}
.steps h3 { margin: 10px 0 4px; font-size: 1.05rem; letter-spacing: -0.02em; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.stat-grid, .grade-grid {
  display: grid;
  gap: 12px;
}
.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(--bg-elev);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
  box-shadow: 0 3px 10px rgba(30, 45, 59, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.stat-card { padding: 14px 16px; }
.stat-num { font-size: 1.75rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; color: var(--brand-strong); }
.stat-label { color: var(--muted); font-weight: 650; font-size: 0.92rem; }
.stat-note { color: var(--muted); margin: 8px 0 0; font-size: 0.92rem; }
a.grade-card, a.iq-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  min-height: 98px;
  text-decoration: none;
  color: inherit;
  border-top: 4px 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 { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.14); }
a.grade-card strong, a.iq-card strong { font-size: 1.08rem; letter-spacing: -0.02em; }
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.finals-card {
  display: flex; flex-direction: column; gap: 4px; margin-top: 22px; padding: 12px 14px;
  background: var(--bg-elev); border: 1px solid var(--line); border-top: 3px solid var(--brand);
  border-radius: var(--radius); text-decoration: none; color: inherit; min-width: 0;
}
a.finals-card:hover { border-color: var(--brand); }
a.finals-card strong { font-size: 1.08rem; letter-spacing: -0.02em; }
a.finals-card .finals-sub { color: var(--muted); font-size: 0.92rem; 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; }
.load-error {
  background: var(--bad-bg);
  color: var(--text);
  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: 22px 16px 18px; }
}


/* 首页本机盲区汇总 */
.blind-home { margin: 28px 0 8px; }
.blind-home-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.blind-home-item {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, #fff);
}
.blind-home-name { font-weight: 800; color: var(--brand-strong); text-decoration: none; overflow-wrap: anywhere; }
.blind-home-name:hover { text-decoration: underline; }
.blind-home-meta { color: var(--muted); font-size: 0.9rem; }
.blind-home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
