:root {
  --navy: #173568;
  --blue: #1765d9;
  --cyan: #0797b8;
  --ink: #17233d;
  --muted: #5f7088;
  --line: #d8e3ef;
  --surface: #ffffff;
  --background: #f3f7fb;
  --shadow: 0 14px 40px rgba(37, 66, 105, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -60px;
  left: 20px;
  padding: 10px 16px;
  color: #fff;
  background: var(--navy);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  padding: 8px max(24px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid rgba(216, 227, 239, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.topbar p {
  margin: 0;
  color: var(--navy);
  font-weight: 800;
}

.back-link,
.home-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.home-link {
  justify-self: end;
}

main,
footer {
  width: min(1320px, calc(100% - 48px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(420px, 0.8fr);
  gap: 44px;
  align-items: end;
  padding: 62px 0 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 860px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.75;
}

.hero-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.hero-summary article {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(37, 66, 105, 0.07);
}

.hero-summary article:nth-child(1) {
  border-top: 5px solid #1677c8;
}

.hero-summary article:nth-child(2) {
  border-top: 5px solid #dd6b20;
}

.hero-summary article:nth-child(3) {
  border-top: 5px solid #7c4dcc;
}

.hero-summary article:nth-child(4) {
  border-top: 5px solid #0e9a78;
}

.hero-summary strong {
  color: var(--navy);
  font-size: 36px;
  line-height: 1;
}

.hero-summary span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 15px;
}

.learning-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 38px;
  padding: 14px 18px;
  border: 1px solid #cbddeb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(37, 66, 105, 0.06);
}

.learning-route span {
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
}

.learning-route b {
  color: #8da1b8;
}

.map-section,
.outcome-section {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(25px, 2.3vw, 34px);
  line-height: 1.28;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px 15px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  width: 28px;
  border-top: 3px solid #7890aa;
}

.legend-line.dashed {
  border-top-style: dashed;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.legend-dot.core {
  background: var(--blue);
}

.legend-dot.extend {
  border: 2px solid var(--blue);
  background: #fff;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-button,
#reset-view {
  border: 1px solid #cbd9e8;
  border-radius: 999px;
  color: var(--navy);
  background: #f8fbfe;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  transition: 160ms ease;
}

.filter-button {
  padding: 9px 15px;
}

.filter-button:hover,
.filter-button:focus-visible,
#reset-view:hover,
#reset-view:focus-visible {
  border-color: var(--button-color, var(--blue));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-color, var(--blue)) 18%, transparent);
}

.filter-button.active {
  border-color: var(--button-color, var(--blue));
  color: #fff;
  background: var(--button-color, var(--blue));
}

.graph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: stretch;
}

.graph-panel,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f9fbfd;
}

.graph-panel {
  overflow: hidden;
}

.graph-toolbar {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 15px 10px 19px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.graph-toolbar p {
  margin: 0;
  color: var(--navy);
  font-weight: 900;
}

#reset-view {
  padding: 7px 12px;
}

.graph-scroll {
  overflow: auto;
  background: #f7fafd;
}

#knowledge-graph {
  display: block;
  min-width: 780px;
  width: 100%;
  height: auto;
  aspect-ratio: 1120 / 680;
}

.graph-tip {
  margin: 0;
  padding: 9px 16px 12px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.edge {
  fill: none;
  stroke: #91a4b9;
  stroke-width: 3;
  marker-end: url(#arrowhead);
}

.edge.support {
  stroke: #bd7780;
  stroke-dasharray: 8 7;
}

.edge-label {
  fill: #6a7c92;
  font-size: 13px;
  font-weight: 700;
}

.node {
  cursor: pointer;
  filter: drop-shadow(0 6px 8px rgba(41, 65, 95, 0.13));
  transition: filter 160ms ease;
}

.node:hover,
.node:focus-visible {
  filter: drop-shadow(0 9px 13px rgba(41, 65, 95, 0.24));
  outline: none;
}

.node rect {
  stroke-width: 2.5;
  transition: stroke-width 160ms ease;
}

.node:hover rect,
.node:focus-visible rect,
.node.selected rect {
  stroke-width: 5;
}

.node .node-title {
  fill: #15325e;
  font-size: 20px;
  font-weight: 900;
  pointer-events: none;
}

.node .node-subtitle {
  fill: #5f7088;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.node.stage-main .node-title,
.node.course-root .node-title {
  fill: #fff;
  font-size: 23px;
}

.node.stage-main .node-subtitle,
.node.course-root .node-subtitle {
  fill: rgba(255, 255, 255, 0.84);
}

.node.topic .node-title {
  font-size: 17px;
}

.node .level-badge {
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
}

.detail-panel {
  display: flex;
  flex-direction: column;
  padding: 25px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(37, 66, 105, 0.07);
}

.detail-kicker {
  margin: 0 0 7px;
  color: var(--detail-color, var(--blue));
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.detail-panel h3 {
  margin: 0;
  color: var(--navy);
  font-size: 25px;
  line-height: 1.35;
}

.detail-summary {
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-list div {
  padding-top: 11px;
  border-top: 1px solid #e5ebf2;
}

.detail-list dt {
  color: #70829a;
  font-size: 12px;
  font-weight: 900;
}

.detail-list dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.58;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.tag-list span {
  padding: 5px 8px;
  border-radius: 7px;
  color: #36506f;
  background: #edf3f8;
  font-size: 12px;
  font-weight: 700;
}

.lesson-link {
  display: inline-flex;
  align-self: flex-start;
  margin-top: auto;
  padding-top: 24px;
  color: var(--detail-color, var(--blue));
  font-weight: 900;
  text-decoration: none;
}

.lesson-link:hover,
.lesson-link:focus-visible {
  text-decoration: underline;
}

.outcome-section {
  margin-top: 28px;
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.outcome-grid article {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fbfdff;
}

.outcome-grid article:nth-child(1) {
  border-top: 5px solid #1677c8;
}

.outcome-grid article:nth-child(2) {
  border-top: 5px solid #7c4dcc;
}

.outcome-grid article:nth-child(3) {
  border-top: 5px solid #d1495b;
}

.outcome-grid span {
  color: #8ca0b7;
  font-size: 13px;
  font-weight: 900;
}

.outcome-grid h3 {
  margin: 7px 0;
  color: var(--navy);
  font-size: 23px;
}

.outcome-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.page-tech {
  margin: 28px 0 0;
  padding: 18px 21px;
  border-left: 5px solid var(--cyan);
  border-radius: 8px 14px 14px 8px;
  color: #4f647d;
  background: #eaf8fb;
  font-size: 14px;
  line-height: 1.65;
}

.page-tech strong {
  color: #116b7b;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 42px;
  color: #74849a;
  font-size: 13px;
}

footer a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-summary {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero-summary article {
    min-height: 102px;
  }

  .graph-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: 360px;
  }

  .lesson-link {
    margin-top: 8px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding-inline: 16px;
  }

  .topbar p {
    display: none;
  }

  main,
  footer {
    width: min(100% - 28px, 1320px);
  }

  .hero {
    gap: 28px;
    padding-top: 40px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-summary article {
    min-height: 94px;
    padding: 16px;
  }

  .hero-summary strong {
    font-size: 29px;
  }

  .learning-route {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .learning-route span {
    flex: 0 0 auto;
  }

  .map-section,
  .outcome-section {
    padding: 20px;
    border-radius: 19px;
  }

  .section-heading {
    display: block;
  }

  .legend {
    justify-content: flex-start;
    margin-top: 15px;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .filter-button {
    flex: 0 0 auto;
  }

  .graph-toolbar {
    align-items: flex-start;
  }

  .graph-toolbar p {
    font-size: 14px;
  }

  .detail-panel {
    padding: 21px;
  }

  .outcome-grid {
    grid-template-columns: 1fr;
  }

  footer {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .filters,
  #reset-view,
  .graph-tip,
  .page-tech {
    display: none;
  }

  body {
    background: #fff;
  }

  main {
    width: 100%;
  }

  .hero {
    padding-top: 20px;
  }

  .map-section,
  .outcome-section {
    break-inside: avoid;
    box-shadow: none;
  }
}
