:root {
  --ink: #172026;
  --muted: #60717c;
  --paper: #fffaf0;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(23, 32, 38, 0.14);
  --teal: #0f766e;
  --teal-dark: #134e4a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --green: #16a34a;
  --shadow: 0 22px 70px rgba(48, 37, 19, 0.16);
  color-scheme: light;
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 8%, rgba(13, 148, 136, 0.20), transparent 30%),
    radial-gradient(circle at 88% 5%, rgba(217, 119, 6, 0.20), transparent 28%),
    linear-gradient(135deg, #f7ecd3 0%, #f6f9f1 42%, #dff3ef 100%);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(1760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.site-header,
.hero,
.workspace > *,
.panel {
  backdrop-filter: blur(18px);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 22px;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent),
    linear-gradient(135deg, #0f766e, #d97706);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 17px;
}

.brand-text em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.top-nav a,
.site-return,
.player button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  padding: 10px 14px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.top-nav a:hover,
.site-return:hover,
.player button:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: #ffffff;
  transform: translateY(-1px);
}

.site-return {
  color: #ffffff;
  background: var(--teal);
  border-color: transparent;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  margin: 24px 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 247, 237, 0.74)),
    repeating-linear-gradient(90deg, rgba(15, 118, 110, 0.06) 0 1px, transparent 1px 46px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 72px);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.hero p {
  max-width: 790px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-card {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, 0.24), transparent 24%),
    linear-gradient(145deg, #134e4a, #0f766e 54%, #d97706);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.hero-card span {
  opacity: 0.78;
}

.hero-card strong {
  font-size: 24px;
}

.hero-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.lesson-nav,
.stage-card,
.control-card {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lesson-nav {
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.lesson-nav-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.lesson-nav-head {
  padding: 18px 18px 8px;
}

.lesson-nav-head strong,
.panel-head strong {
  color: var(--teal-dark);
}

.lesson-tabs {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.lesson-tab {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.lesson-tab span {
  color: var(--muted);
  font-size: 12px;
}

.lesson-tab strong {
  font-size: 15px;
}

.lesson-tab.is-active {
  border-color: rgba(15, 118, 110, 0.26);
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.12);
}

.stage-card {
  overflow: hidden;
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 16px;
}

.stage-head h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -0.04em;
}

.stage-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.player {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.player button:first-child {
  color: #fff;
  background: var(--teal);
  border-color: transparent;
}

.stage-wrap {
  margin: 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(238, 250, 246, 0.74)),
    radial-gradient(circle at 50% 120%, rgba(15, 118, 110, 0.16), transparent 34%);
}

#stage {
  display: block;
  width: 100%;
  min-height: 600px;
}

.timeline {
  display: grid;
  gap: 10px;
  padding: 18px 24px 22px;
}

.timeline label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.extra-panel {
  margin: 0 24px 24px;
}

.control-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
}

.control-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.control {
  display: grid;
  gap: 8px;
}

.control label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.control strong {
  color: var(--ink);
}

.control select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.metric {
  min-height: 82px;
  padding: 12px;
  border-radius: 18px;
  background: #f8fbf8;
  border: 1px solid rgba(15, 118, 110, 0.14);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: 22px;
  line-height: 1.1;
}

.note-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.note-list li {
  position: relative;
  padding: 0 0 0 18px;
  color: var(--ink);
  line-height: 1.65;
}

.note-list li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--amber);
}

.insight {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.circuit-lab {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
}

.part-tray,
.drop-map {
  padding: 14px;
  border: 1px dashed rgba(15, 118, 110, 0.32);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
}

.part-tray h3,
.drop-map h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.drag-chip {
  display: inline-flex;
  margin: 0 8px 8px 0;
  padding: 9px 11px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 999px;
  background: #ffffff;
  cursor: grab;
}

.drop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.drop-zone {
  min-height: 70px;
  padding: 10px;
  border: 1px dashed rgba(96, 113, 124, 0.34);
  border-radius: 16px;
  background: #fbfaf5;
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.drop-zone.is-filled {
  border-color: rgba(15, 118, 110, 0.5);
  background: #effaf6;
}

.circuit-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--teal-dark);
  background: rgba(15, 118, 110, 0.10);
  line-height: 1.6;
}

.svg-label {
  fill: #172026;
  font-size: 20px;
  font-weight: 800;
}

.svg-small {
  fill: #60717c;
  font-size: 15px;
}

.svg-tiny {
  fill: #60717c;
  font-size: 12px;
}

.axis {
  stroke: rgba(23, 32, 38, 0.48);
  stroke-width: 3;
}

.guide {
  stroke: rgba(96, 113, 124, 0.34);
  stroke-width: 2;
  stroke-dasharray: 8 8;
}

.ray {
  stroke: #d97706;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
}

.ray-soft {
  stroke: rgba(217, 119, 6, 0.45);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 9 7;
}

.ray-out {
  stroke: #2563eb;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
}

.force {
  stroke: #dc2626;
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
}

.field {
  stroke: #2563eb;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  opacity: 0.72;
}

.water {
  fill: rgba(37, 99, 235, 0.22);
  stroke: rgba(37, 99, 235, 0.35);
  stroke-width: 2;
}

.liquid {
  fill: rgba(37, 99, 235, 0.30);
}

.metal {
  fill: #e7edf0;
  stroke: #8ea0aa;
  stroke-width: 3;
}

.wood {
  fill: #b7791f;
  stroke: #7c4a03;
  stroke-width: 3;
}

.danger {
  fill: rgba(220, 38, 38, 0.12);
  stroke: #dc2626;
  stroke-width: 3;
}

.ok {
  fill: rgba(22, 163, 74, 0.12);
  stroke: #16a34a;
  stroke-width: 3;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .control-card {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 20px, 1500px);
  }

  .site-header,
  .stage-head,
  .hero {
    grid-template-columns: 1fr;
  }

  .site-header,
  .stage-head {
    align-items: stretch;
  }

  .workspace,
  .control-card,
  .circuit-lab {
    grid-template-columns: 1fr;
  }

  .lesson-nav {
    position: static;
  }

  .lesson-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .drop-grid {
    grid-template-columns: 1fr;
  }
}
