:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --surface: #fff;
  --surface-2: #faf9f6;
  --ink: #242522;
  --muted: #6e716b;
  --line: #e2dfd7;
  --line-2: #cbc6bb;
  --green: #2e6452;
  --green-soft: #e5f0ea;
  --amber: #8a611a;
  --amber-soft: #f6edd9;
  --red: #9b403b;
  --red-soft: #f8e8e7;
  --blue: #315f82;
  --blue-soft: #e5eef5;
  --radius: 10px;
  font-family: "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171917;
  --surface: #202320;
  --surface-2: #262926;
  --ink: #eeede8;
  --muted: #a7aaa3;
  --line: #363a36;
  --line-2: #4a504a;
  --green: #94c7b2;
  --green-soft: #263c33;
  --amber: #dfb96d;
  --amber-soft: #413721;
  --red: #eba09b;
  --red-soft: #462d2c;
  --blue: #94bfdf;
  --blue-soft: #283944;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.6; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 70%, transparent); outline-offset: 3px; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 9px 12px; color: white; background: #242522; border-radius: 5px; }
.skip:focus { top: 16px; }
.header { position: sticky; top: 0; z-index: 20; min-height: 66px; padding: 0 clamp(18px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: color-mix(in srgb, var(--bg) 91%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; color: white; background: #2e6452; border-radius: 6px; font: 700 12px "SF Mono", monospace; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; line-height: 1.2; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.language-picker select { min-height: 40px; padding: 0 30px 0 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.server-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.server-state i { width: 7px; height: 7px; background: #3d906c; border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, #3d906c 14%, transparent); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.icon-button svg { width: 18px; }
main { max-width: 1520px; margin: auto; padding: 0 clamp(18px, 4vw, 56px); }
.intro { padding: 30px 0 42px; display: grid; grid-template-columns: 1.4fr .6fr; gap: clamp(38px, 8vw, 120px); align-items: center; border-bottom: 1px solid var(--line); }
.eyebrow, .section-no, .lab-tag { color: var(--green); font: 700 11px "SF Mono", monospace; letter-spacing: .11em; text-transform: uppercase; }
.intro h1 { max-width: 820px; margin: 12px 0 24px; font-family: "Songti SC", "STSong", serif; font-size: clamp(48px, 7.2vw, 98px); line-height: .98; letter-spacing: -.055em; }
.lead { max-width: 700px; margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 20px); }
.start-card { padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step-kicker { color: var(--amber); font-size: 12px; font-weight: 700; }
.start-card ol { margin: 15px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.start-card li + li { margin-top: 8px; }
kbd { padding: 2px 6px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; font: 11px "SF Mono", monospace; }
.lab-layout { padding: 44px 0 80px; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 28px; align-items: start; }
.scenario-panel { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { padding: 20px 19px 14px; display: flex; align-items: end; justify-content: space-between; }
.panel-head h2 { display: inline; margin: 0 0 0 9px; font-size: 17px; }
.panel-head > span { color: var(--muted); font-size: 11px; }
.filters { padding: 0 14px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border-bottom: 1px solid var(--line); }
.filters button { min-height: 38px; padding: 7px 10px; overflow: hidden; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.filters button[aria-pressed="true"] { color: var(--green); background: var(--green-soft); font-weight: 700; }
.scenario-list { overflow-y: auto; padding: 8px; }
.scenario-button { width: 100%; min-height: 60px; padding: 10px; display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.scenario-button:hover { background: var(--surface-2); }
.scenario-button.active { background: var(--green-soft); }
.scenario-button .num { color: var(--muted); font: 10px "SF Mono", monospace; }
.scenario-button strong { display: block; font-size: 13px; line-height: 1.3; }
.scenario-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.stage { min-width: 0; }
.stage-head { min-height: 91px; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.stage-head h2 { margin: 6px 0 4px; font-family: "Songti SC", serif; font-size: clamp(27px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -.025em; }
.stage-head p { margin: 0; color: var(--muted); font-size: 13px; }
.lab-tag { display: inline-block; padding: 3px 6px; background: var(--green-soft); border-radius: 3px; }
.reset-button { min-height: 40px; padding: 7px 11px; display: flex; align-items: center; gap: 7px; flex: none; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 12px; }
.reset-button svg { width: 15px; }
.browser-frame { margin-top: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; }
.browser-bar { height: 45px; padding: 0 14px; display: grid; grid-template-columns: 65px minmax(100px, 1fr) 34px; gap: 10px; align-items: center; background: #e8e6e1; border-bottom: 1px solid #d7d3ca; color: #535750; }
[data-theme="dark"] .browser-bar { background: #2f332f; border-color: #414641; color: #c1c5bf; }
.window-dots { display: flex; gap: 6px; }
.window-dots i { width: 9px; height: 9px; display: block; background: #a7a59f; border-radius: 50%; }
.address { min-width: 0; height: 27px; padding: 3px 10px; display: flex; align-items: center; gap: 8px; overflow: hidden; background: color-mix(in srgb, var(--surface) 76%, transparent); border-radius: 5px; font: 11px "SF Mono", monospace; white-space: nowrap; text-overflow: ellipsis; }
.lock { color: #4b7867; }
.browser-menu { text-align: right; font-weight: 700; letter-spacing: 2px; }
.demo-app { min-height: 430px; padding: clamp(22px, 4vw, 48px); background: var(--surface-2); }
.product-shell { max-width: 760px; margin: auto; }
.app-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.app-logo { font-weight: 800; letter-spacing: -.03em; }
.app-user { width: 30px; height: 30px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); border-radius: 50%; font-size: 11px; }
.app-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.app-card h3 { margin: 0 0 6px; font-size: 21px; }
.app-card p { margin: 0; color: var(--muted); font-size: 13px; }
.app-card + .app-card { margin-top: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.field { padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; }
.field span { display: block; color: var(--muted); font-size: 10px; }
.field strong { display: block; margin-top: 4px; font-size: 14px; }
.bad-focus:focus { outline: none !important; box-shadow: none !important; }
.primary, .secondary { min-height: 43px; padding: 9px 15px; border-radius: 5px; cursor: pointer; font-weight: 700; }
.primary { color: white; background: #2f3934; border: 1px solid #2f3934; }
.primary:hover { background: #45534c; }
.primary:disabled { opacity: .58; cursor: wait; }
.secondary { background: var(--surface); border: 1px solid var(--line-2); }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.status-box { min-height: 48px; margin-top: 16px; padding: 12px 14px; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--line-2); font: 12px/1.6 "SF Mono", monospace; }
.status-box.loading { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.status-box.error { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.status-box.success { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.spinner { width: 16px; height: 16px; display: inline-block; margin-right: 8px; vertical-align: -3px; border: 2px solid color-mix(in srgb, var(--blue) 22%, transparent); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.metric { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.metric span { color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin-top: 5px; font-size: 23px; }
.code-preview { margin-top: 18px; padding: 15px; overflow-x: auto; color: #dfe5df; background: #202420; border-radius: 6px; font: 12px/1.7 "SF Mono", monospace; }
.poster { min-height: 240px; display: grid; place-items: center; overflow: hidden; background: #e1e8e3; border: 1px solid var(--line); border-radius: 7px; color: #456054; text-align: center; }
.poster img { width: 100%; height: auto; display: block; }
.overlay-demo { position: relative; min-height: 300px; }
.fake-overlay { position: absolute; inset: 90px 0 0; z-index: 4; background: rgba(255,255,255,.01); border: 1px dashed transparent; }
.memory-bars { height: 110px; margin-top: 20px; display: flex; align-items: end; gap: 8px; }
.memory-bars i { flex: 1; min-height: 8px; background: var(--blue); opacity: .72; transition: height .2s; }
.jank-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; margin-top: 22px; }
.jank-grid i { aspect-ratio: 1; background: var(--green); opacity: .3; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 360px; padding: 12px 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; font-size: 12px; }
.coach-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; margin-top: 14px; }
.coach-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.mission-card { grid-row: span 2; }
.coach-card h3 { margin: 8px 0 12px; font-size: 16px; }
.coach-card ul, .coach-card ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.coach-card li + li { margin-top: 7px; }
.disclosure { width: 100%; min-height: 38px; padding: 0; display: flex; justify-content: space-between; align-items: center; border: 0; background: transparent; cursor: pointer; text-align: left; }
.disclosure .section-no { display: block; margin-bottom: 4px; }
.plus { font-size: 24px; font-weight: 300; transition: transform .2s ease; }
.disclosure[aria-expanded="true"] .plus { transform: rotate(45deg); }
.hidden-body { display: none; padding-top: 14px; border-top: 1px solid var(--line); }
.hidden-body.open { display: block; }
.hidden-body p { margin: 0; color: var(--muted); font-size: 13px; }
.evidence { margin-top: 12px; padding: 10px; color: var(--green); background: var(--green-soft); border-radius: 5px; font: 11px/1.5 "SF Mono", monospace; }
footer { min-height: 74px; padding: 0 clamp(18px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }

@media (max-width: 980px) {
  .intro { grid-template-columns: 1fr; padding: 28px 0 38px; }
  .start-card { max-width: 620px; }
  .lab-layout { grid-template-columns: 1fr; }
  .scenario-panel { position: static; max-height: none; }
  .scenario-list { display: grid; grid-template-columns: repeat(2, 1fr); max-height: 320px; }
}
@media (max-width: 650px) {
  .server-state { display: none; }
  .language-picker select { width: 105px; }
  .intro h1 { font-size: 48px; }
  .scenario-list, .coach-grid { grid-template-columns: 1fr; }
  .mission-card { grid-row: auto; }
  .stage-head { min-height: auto; flex-direction: column; }
  .form-row, .dashboard-grid { grid-template-columns: 1fr; }
  .demo-app { min-height: 460px; padding: 20px 14px; }
  .app-nav { margin-bottom: 24px; }
  footer { align-items: flex-start; flex-direction: column; padding-top: 20px; padding-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
