:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --surface-blue: #f2f7ff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #eaf4ff;
  --green: #248a3d;
  --green-soft: #eef9f0;
  --purple: #7d4de8;
  --purple-soft: #f3efff;
  --orange: #bf5b00;
  --orange-soft: #fff5e8;
  --dark: #161617;
  --dark-surface: #242426;
  --dark-text: #f5f5f7;
  --dark-secondary: #a1a1a6;
  --radius-sm: 0.875rem;
  --radius-md: 1.375rem;
  --radius-lg: 2rem;
  --shadow-small: 0 2px 10px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 16px 44px rgba(0, 0, 0, 0.09);
  --content: 76rem;
  --nav-height: 3.75rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1.5rem);
}

body {
  margin: 0;
  min-width: 20rem;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 1000;
  transform: translateY(-200%);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #fff;
  background: var(--blue);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.45);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 100;
  min-height: var(--nav-height);
  background: rgba(255, 255, 255, 0.86);
  border-block-end: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-shell,
.section-shell {
  width: min(calc(100% - 2rem), var(--content));
  margin-inline: auto;
}

.nav-shell {
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.5rem;
  color: #fff;
  background: var(--blue);
  font-size: 0.875rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding-inline: 0.875rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-links a:hover { color: var(--text); background: var(--surface-soft); }
.nav-links .nav-primary { color: #fff; background: var(--text); }
.nav-links .nav-primary:hover { color: #fff; background: #2c2c2e; }

.hero {
  padding-block: clamp(4.75rem, 10vw, 8.75rem) clamp(4.5rem, 8vw, 7rem);
}

.context-label,
.section-kicker,
.step-count,
.role-label {
  margin: 0 0 0.75rem;
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero h1,
.section-header h2,
.class-change h2,
.parent-shell h2 {
  margin: 0;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero h1 {
  max-width: 62rem;
  font-size: clamp(3rem, 7.2vw, 6.75rem);
  line-height: 0.98;
  font-weight: 750;
}

.hero h1 em { color: var(--blue); font-style: normal; }

.hero-lead {
  max-width: 48rem;
  margin: 1.75rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.55;
  letter-spacing: -0.015em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 2rem;
}

.button,
.icon-button,
.setup-tab,
.copy-button,
.choice-button {
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
}

.button {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding-inline: 1.25rem;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
  transition: transform 120ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button svg,
.icon-button svg,
.choice-button svg,
.status-icon,
.node-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button svg { width: 1.1rem; height: 1.1rem; }
.button:active,
.icon-button:active,
.setup-tab:active,
.copy-button:active,
.choice-button:active { transform: scale(0.97); }

.button-primary { color: #fff; background: var(--blue); }
.button-primary:hover { background: var(--blue-hover); }
.button-secondary { color: var(--text); background: var(--surface-soft); }
.button-secondary:hover { background: #e9e9eb; }
.button.compact { min-height: 2.875rem; padding-inline: 1rem; font-size: 0.95rem; }

.change-card {
  margin-block-start: clamp(3.5rem, 7vw, 6rem);
  border-block: 1px solid var(--border);
}

.change-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  align-items: center;
  min-height: 6.25rem;
  padding-block: 1.25rem;
}

.change-label {
  color: var(--text-tertiary);
  font-weight: 650;
}

.change-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.15rem, 2.2vw, 1.8rem);
  letter-spacing: -0.02em;
}

.change-old .change-flow { color: var(--text-secondary); }
.change-new .change-flow strong { color: var(--blue); }
.change-divider { height: 1px; background: var(--border); }

.parent-reminder {
  margin-block-start: 2rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-sm);
  color: #185c2a;
  background: var(--green-soft);
}

.parent-reminder p { margin: 0; }
.status-icon { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; stroke-width: 2.4; }

.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section-soft { background: var(--surface-soft); }
.section-header { max-width: 49rem; margin-block-end: clamp(2.5rem, 5vw, 4rem); }
.section-header.centered { margin-inline: auto; text-align: center; }
.section-header h2,
.class-change h2,
.parent-shell h2 {
  font-size: clamp(2.35rem, 5.2vw, 4.75rem);
  line-height: 1.04;
  font-weight: 740;
}
.section-header > p:last-child {
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.setup-controls {
  display: grid;
  gap: 0.5rem;
}

.setup-tab {
  min-height: 4.5rem;
  width: 100%;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 0;
  border-radius: 1rem;
  color: var(--text-secondary);
  background: transparent;
  text-align: start;
  transition: transform 120ms ease, background-color 160ms ease, color 160ms ease;
}

.setup-tab:hover { background: rgba(255, 255, 255, 0.72); }
.setup-tab.is-active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-small); }
.setup-tab strong, .setup-tab small { display: block; }
.setup-tab strong { font-size: 0.98rem; }
.setup-tab small { margin-block-start: 0.15rem; color: var(--text-tertiary); font-size: 0.8rem; }

.tab-index {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-secondary);
  background: #e9e9eb;
  font-size: 0.82rem;
  font-weight: 750;
}
.setup-tab.is-active .tab-index { color: #fff; background: var(--blue); }

.setup-display {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-medium);
}

.setup-copy {
  min-height: 9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-block-end: 1px solid var(--border);
}

.setup-copy h3 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.35rem); letter-spacing: -0.035em; }
.setup-copy #step-description { margin: 0.5rem 0 0; color: var(--text-secondary); }
.step-count { margin-block-end: 0.45rem; }
.setup-actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }

.icon-button {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  transition: transform 120ms ease, background-color 160ms ease, opacity 160ms ease;
}
.icon-button:hover:not(:disabled) { background: var(--surface-soft); }
.icon-button:disabled { cursor: default; opacity: 0.3; }
.icon-button svg { width: 1.25rem; height: 1.25rem; }

.device-stage {
  min-height: 34rem;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: #eef0f4;
}

.device-stage img {
  width: 100%;
  max-height: 43rem;
  object-fit: contain;
  border-radius: 1.35rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transition: opacity 160ms ease, transform 220ms cubic-bezier(.2,.8,.2,1);
}

.device-stage img.is-changing { opacity: 0.25; transform: scale(0.985); }

.url-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-block-start: 1px solid var(--border);
}
.url-row code { min-width: 0; overflow-wrap: anywhere; color: var(--text-secondary); }
.copy-button {
  min-height: 2.75rem;
  padding-inline: 1rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-weight: 650;
  transition: transform 120ms ease, background-color 160ms ease;
}
.copy-button:hover { background: var(--blue-hover); }
.copy-status { color: var(--green); font-size: 0.9rem; min-width: 3.5rem; }

.setup-complete {
  margin-block-start: 1rem;
  min-height: 5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.875rem;
  align-items: center;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  background: var(--green-soft);
  color: #185c2a;
}
.setup-complete strong, .setup-complete span { display: block; }
.setup-complete span { margin-block-start: 0.1rem; font-size: 0.9rem; opacity: 0.85; }

.rebuild-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  gap: 0.65rem;
  align-items: center;
  margin-block-start: 3.5rem;
}

.rebuild-node { min-width: 0; text-align: center; }
.rebuild-node strong, .rebuild-node small { display: block; }
.rebuild-node strong { margin-block-start: 0.75rem; font-size: 1rem; }
.rebuild-node small { margin-block-start: 0.2rem; color: var(--text-tertiary); font-size: 0.82rem; }
.node-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  margin-inline: auto;
  border-radius: 1rem;
  color: var(--blue);
  background: var(--blue-soft);
}
.node-icon svg { width: 1.5rem; height: 1.5rem; }
.final-node .node-icon { color: #fff; background: var(--blue); }
.connector { width: clamp(1rem, 3vw, 3rem); height: 1px; background: var(--border-strong); }

.learning-section { background: #fff; }
.learning-step {
  min-height: 42rem;
  display: grid;
  grid-template-columns: minmax(17rem, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
  border-block-start: 1px solid var(--border);
}
.learning-step.reverse { grid-template-columns: minmax(0, 1.28fr) minmax(17rem, 0.72fr); }
.learning-step.reverse .learning-text { grid-column: 2; }
.learning-step.reverse .product-frame { grid-column: 1; grid-row: 1; }
.large-index { color: var(--text-tertiary); font-size: 0.9rem; font-weight: 700; }
.learning-text h3 { margin: 0.65rem 0 0; font-size: clamp(2.5rem, 5vw, 5rem); line-height: 1; letter-spacing: -0.055em; }
.learning-one-line { margin: 1.25rem 0 0 !important; color: var(--blue) !important; font-size: clamp(1.25rem, 2.2vw, 1.75rem) !important; font-weight: 650; }
.learning-text p { margin: 1rem 0 0; color: var(--text-secondary); font-size: clamp(1.05rem, 1.7vw, 1.22rem); }
.learning-text strong { color: var(--text); }

.product-frame {
  margin: 0;
  padding: clamp(0.65rem, 1.6vw, 1rem);
  border-radius: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-medium);
}
.product-frame img { width: 100%; border-radius: calc(clamp(1.5rem, 3vw, 2.5rem) - 0.5rem); }
.blue-frame { background: var(--blue-soft); }
.green-frame { background: var(--green-soft); }
.purple-frame { background: var(--purple-soft); }

.section-dark { color: var(--dark-text); background: var(--dark); }
.light-kicker { color: #62a8ff; }
.class-change { display: grid; gap: 4rem; }
.class-change-intro { max-width: 60rem; }
.class-statement { margin: 1rem 0 0; color: var(--dark-secondary); font-size: clamp(1.5rem, 3vw, 2.5rem); letter-spacing: -0.03em; }
.class-statement strong { color: #fff; }
.roles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.role-card {
  min-height: 18rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: var(--dark-surface);
}
.role-card h3 { margin: 1.25rem 0 0; font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.16; letter-spacing: -0.035em; }
.role-card p:last-child { margin: 1.25rem 0 0; color: var(--dark-secondary); font-size: 1.05rem; }
.student-role .role-label { color: #63e27d; }
.teacher-role .role-label { color: #62a8ff; }
.class-change blockquote {
  margin: 0;
  max-width: 64rem;
  padding-inline-start: clamp(1.25rem, 3vw, 2rem);
  border-inline-start: 4px solid #62a8ff;
  color: #fff;
  font-size: clamp(1.75rem, 4.2vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-weight: 700;
}
.transfer-target {
  width: min(100%, 38rem);
  justify-self: end;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid rgba(255, 255, 255, 0.14);
}
.transfer-target span, .transfer-target strong { display: block; }
.transfer-target span { color: var(--dark-secondary); font-size: 0.9rem; }
.transfer-target strong { margin-block-start: 0.4rem; font-size: clamp(2.25rem, 5vw, 4rem); letter-spacing: -0.04em; }
.transfer-target p { margin: 0.65rem 0 0; color: var(--dark-secondary); }

.parent-section { background: var(--surface-soft); }
.parent-shell { text-align: center; }
.parent-shell h2 { font-size: clamp(3.5rem, 9vw, 8rem); }
.parent-choice {
  width: min(100%, 54rem);
  margin: clamp(2.5rem, 6vw, 4.5rem) auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.choice-button {
  min-height: 9rem;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  text-align: start;
  box-shadow: var(--shadow-small);
  transition: transform 120ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.choice-button:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
.choice-button svg { width: 2.5rem; height: 2.5rem; padding: 0.55rem; border-radius: 50%; }
.choice-button strong, .choice-button small { display: block; }
.choice-button strong { font-size: 1.3rem; }
.choice-button small { margin-block-start: 0.35rem; color: var(--text-secondary); font-size: 0.9rem; }
.complete-choice svg { color: #fff; background: var(--green); }
.reminder-choice svg { color: var(--orange); background: var(--orange-soft); }
.complete-choice.is-selected { border-color: rgba(36, 138, 61, 0.32); background: var(--green-soft); }
.reminder-choice.is-selected { border-color: rgba(191, 91, 0, 0.28); background: var(--orange-soft); }
.parent-fineprint { margin: 2rem auto 0; color: var(--text-secondary); }
.final-cta { margin-block-start: 1.5rem; }

.site-footer { background: var(--surface-soft); border-block-start: 1px solid var(--border); }
.footer-shell { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--text-tertiary); font-size: 0.9rem; }
.footer-shell a { min-height: 2.75rem; display: inline-flex; align-items: center; color: var(--text-secondary); text-decoration: none; }
.footer-shell a:hover { color: var(--text); }

@media (max-width: 900px) {
  .nav-links a:not(.nav-primary) { display: none; }
  .change-row { grid-template-columns: 1fr; gap: 0.5rem; }
  .setup-layout { grid-template-columns: 1fr; }
  .setup-controls {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    padding-block-end: 0.25rem;
  }
  .setup-tab { min-width: 15rem; scroll-snap-align: start; }
  .rebuild-line { grid-template-columns: 1fr; gap: 0.75rem; }
  .connector { width: 1px; height: 1.5rem; justify-self: center; }
  .learning-step,
  .learning-step.reverse { grid-template-columns: 1fr; min-height: auto; gap: 2.5rem; }
  .learning-step.reverse .learning-text,
  .learning-step.reverse .product-frame { grid-column: auto; grid-row: auto; }
  .learning-step.reverse .learning-text { order: 0; }
  .learning-step.reverse .product-frame { order: 1; }
}

@media (max-width: 680px) {
  .nav-shell, .section-shell { width: min(calc(100% - 1.25rem), var(--content)); }
  .site-header { --nav-height: 3.5rem; }
  .brand span:last-child { font-size: 0.95rem; }
  .nav-links .nav-primary { padding-inline: 0.85rem; font-size: 0.82rem; }
  .hero { padding-block-start: 4rem; }
  .hero h1 { font-size: clamp(2.85rem, 13vw, 4.75rem); }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
  .change-flow { gap: 0.5rem; }
  .change-flow span { color: var(--text-tertiary); }
  .setup-copy { min-height: auto; align-items: center; }
  .setup-actions { flex-direction: column; }
  .icon-button { width: 2.75rem; height: 2.75rem; }
  .device-stage { min-height: 24rem; padding: 0.75rem; }
  .device-stage img { border-radius: 1rem; }
  .url-row { grid-template-columns: 1fr auto; }
  .copy-status { grid-column: 1 / -1; }
  .setup-complete { grid-template-columns: auto 1fr; }
  .setup-complete .button { grid-column: 1 / -1; }
  .roles-grid, .parent-choice { grid-template-columns: 1fr; }
  .choice-button { min-height: 7.5rem; }
  .parent-fineprint span { display: block; height: 0.35rem; color: transparent; }
  .footer-shell { flex-direction: column; align-items: flex-start; justify-content: center; padding-block: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button,
  .icon-button,
  .setup-tab,
  .copy-button,
  .choice-button,
  .device-stage img { transition: none; }
  .button:active,
  .icon-button:active,
  .setup-tab:active,
  .copy-button:active,
  .choice-button:active { transform: none; }
}
