:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #1b2733;
  --ink-soft: #566172;
  --primary: #1e4e8c;
  --primary-dark: #143a6b;
  --primary-soft: #eaf1fb;
  --accent: #2a9d8f;
  --accent-soft: #e6f4f1;
  --line: #e4eaf3;
  --shadow: 0 8px 28px rgba(20, 58, 107, 0.08);
  --shadow-lg: 0 18px 48px rgba(20, 58, 107, 0.16);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
}

a { color: var(--primary); text-decoration: none; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶部导航 ---------- */
.topbar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  min-height: 74px; padding-top: 9px; padding-bottom: 9px;
}
.brand { display: flex; flex-direction: column; flex: 0 0 auto; line-height: 1.3; }
.brand-name { font-weight: 800; font-size: 19px; color: var(--primary); letter-spacing: .5px; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--ink-soft); font-weight: 500; margin-top: 2px; white-space: nowrap; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
.nav a {
  position: relative; padding: 8px 10px;
  color: var(--ink-soft); font-size: 14px; border-radius: 8px; transition: color .15s, background .15s;
}
@media (max-width: 980px) {
  .brand-sub { white-space: normal; max-width: 360px; }
}
@media (max-width: 720px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 17px; }
}
.nav a:hover { color: var(--primary); background: var(--primary-soft); }
.nav a.active { color: var(--primary); font-weight: 700; }
.nav a.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 3px;
  background: var(--primary); border-radius: 3px;
}

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1e4e8c 0%, #143a6b 60%, #0f2c52 100%);
  color: #fff; padding: 78px 0 84px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(42,157,143,.45), transparent 70%);
  filter: blur(8px);
}
.hero::before { width: 420px; height: 420px; top: -140px; right: -80px; }
.hero::after { width: 300px; height: 300px; bottom: -120px; left: -60px; opacity: .6; }
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow {
  display: inline-block; font-size: 13.5px; letter-spacing: 1px;
  color: #cfe4ff; margin-bottom: 18px; font-weight: 600;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
}
.hero h1 { font-size: 46px; line-height: 1.2; margin: 0 0 18px; font-weight: 800; letter-spacing: .5px; }
.hero h1 .grad {
  background: linear-gradient(90deg, #7cc7ff, #a78bfa 55%, #f0a6ca);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 18px; opacity: .92; max-width: 780px; margin: 0 0 24px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn {
  display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 700; font-size: 15px;
  transition: transform .15s, box-shadow .15s;
}
.hero .btn-primary { background: #fff; color: var(--primary-dark); }
.hero .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.hero .btn-ghost { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.2); }

/* Hero 底部数据指标 */
.hero .hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 36px; max-width: 720px;
}
.hero .stat-item {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px; padding: 18px 12px; text-align: center;
}
.hero .stat-num {
  font-size: 30px; font-weight: 800; line-height: 1;
  background: linear-gradient(90deg, #7cc7ff, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .stat-label { display: block; margin-top: 9px; font-size: 13px; color: #c3d2e8; letter-spacing: .5px; }
@media (max-width: 760px) { .hero .hero-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 区块标题 ---------- */
.section { padding: 60px 0; }
.section h2 {
  font-size: 27px; margin: 0 0 6px; position: relative; padding-left: 16px;
}
.section h2::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px;
  background: linear-gradient(var(--primary), var(--accent)); border-radius: 3px;
}
.section .sub { color: var(--ink-soft); margin: 0 0 30px 16px; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: 0; transition: opacity .18s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #d3e0f0; }
.card:hover::before { opacity: 1; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- 课程卡片（首页） ---------- */
.course-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.course-card .meta { color: var(--accent); font-size: 13px; font-weight: 700; margin-bottom: 10px; letter-spacing: .3px; }
.course-card h3 { font-size: 19px; }
.course-card .desc { color: var(--ink-soft); font-size: 14px; margin: 0 0 16px; }
.course-card .stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.course-card .stats span {
  font-size: 12px; color: var(--primary); background: var(--primary-soft);
  padding: 4px 10px; border-radius: 999px; font-weight: 600;
}
.course-card .go {
  margin-top: auto; padding-top: 14px; font-weight: 700; color: var(--primary);
  border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between;
}
.course-card:hover .go span.arrow { transform: translateX(4px); }
.course-card .go .arrow { transition: transform .18s; }

/* ---------- 占位图 ---------- */
.thumb {
  height: 150px; border-radius: 12px; margin-bottom: 14px;
  background: linear-gradient(135deg, #dbe7f5, #eaf3ef);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 14px; border: 1px dashed #c5d4e6;
}

/* ---------- 页脚 ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding: 30px 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- 课程详情 ---------- */
.course-hero { background: linear-gradient(135deg, #1e4e8c, #143a6b); color: #fff; padding: 46px 0; }
.course-hero h1 { margin: 0 0 8px; font-size: 30px; }
.course-hero p { margin: 0; opacity: .9; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 30px 0 26px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 11px 18px; cursor: pointer; border: none; background: none;
  font-size: 15px; color: var(--ink-soft); border-bottom: 3px solid transparent;
  font-family: inherit; transition: color .15s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

.panel { display: none; animation: fade .25s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 课件 / 作业 列表 */
.list { display: grid; gap: 12px; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.list-item:hover { border-color: #cfe0f3; box-shadow: var(--shadow); }
.list-item .idx {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.list-item .body { flex: 1; }
.list-item .body b { display: block; font-size: 15px; }
.list-item .body span { color: var(--ink-soft); font-size: 13px; }
.badge { font-size: 12px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* 图谱布局 */
.graph-wrap { display: flex; gap: 20px; align-items: stretch; }
.graph-canvas {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; min-height: 460px;
}
.graph-detail {
  width: 320px; flex: 0 0 320px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.graph-detail h4 { margin: 0 0 10px; color: var(--primary); }
.graph-detail p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.graph-detail .hint { margin-top: 16px; font-size: 12px; color: #9aa5b1; }
@media (max-width: 880px) {
  .graph-wrap { flex-direction: column; }
  .graph-detail { width: 100%; flex: none; }
}
.node circle { cursor: pointer; transition: r .12s ease, filter .12s ease; }
.node circle:hover { filter: drop-shadow(0 0 6px rgba(42,157,143,.8)); }
.node text { font-size: 13px; fill: var(--ink); pointer-events: none; user-select: none; }
.link { stroke: #b9c6da; stroke-width: 1.5; transition: stroke .12s; }

.notice {
  background: #fff7e6; border: 1px solid #ffe1a8; color: #8a5a00;
  padding: 14px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 18px;
}

/* ---------- 滚动渐显（渐进增强：无 JS 时仍可见） ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
