:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #162b23;
  background: #f7f8f1;
  --muted: #4b5c50;
  --green: #235943;
  --line: #dce3d8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--green); }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #3c7a59; outline-offset: 4px; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 800; font-size: 1.2rem; text-decoration: none; white-space: nowrap; }
.wordmark span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #17382a; color: #e5f3bf; }
.external { font-size: .88rem; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: end; gap: clamp(24px, 6vw, 82px); padding-block: clamp(44px, 8vw, 90px) 54px; }
.hero h1 { margin: 0; font-size: clamp(2.65rem, 6.5vw, 5.3rem); letter-spacing: -.055em; line-height: 1.08; }
.hero em { color: var(--green); font-style: normal; }
.hero p, .hero-notes dd, .workspace > p, .lesson p { color: var(--muted); line-height: 1.8; }
.hero p { max-width: 34em; margin: 20px 0 24px; }
.hero-notes { margin: 0; padding: 4px 24px; border-radius: 20px; background: #192f25; }
.hero-notes div { padding: 15px 0; }
.hero-notes div + div { border-top: 1px solid #43584a; }
.hero-notes dt { color: #dfefaa; font-weight: 750; }
.hero-notes dd { margin: 4px 0 0; color: #ecf0e7; font-size: .92rem; }
.lab { display: grid; grid-template-columns: minmax(185px, 220px) minmax(0, 1fr); overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 16px 40px #284e3010; scroll-margin-top: 14px; }
.picker { background: #eef2e9; padding: 25px; }
.picker h2, .workspace h2 { margin: 0; }
.picker h2 { font-size: 1.15rem; }
fieldset { padding: 0; border: 0; margin: 22px 0 0; min-width: 0; }
legend, .category { color: var(--green); font-size: .82rem; font-weight: 750; }
.providers { display: grid; gap: 6px; padding-top: 8px; }
.providers label { display: flex; align-items: center; min-height: 44px; gap: 8px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.providers label:has(:checked) { color: #153f2e; background: #fff; border-color: #adc9b1; font-weight: 750; }
.providers input { margin: 0; accent-color: var(--green); }
.providers strong, .providers small { display: block; }
.providers small { color: var(--muted); font-weight: 500; font-size: .72rem; margin-top: 2px; }
.workspace { padding: clamp(18px, 4vw, 44px); }
.workspace-heading { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 8px 14px; }
.workspace h2 { font-size: clamp(1.55rem, 4vw, 2.2rem); }
.category { margin: 0 0 5px; }
.settings { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.settings label { display: grid; gap: 5px; color: var(--muted); font-size: .83rem; font-weight: 650; }
.settings select { min-height: 44px; max-width: 100%; padding: 5px 12px; border: 1px solid #abbeb0; border-radius: 8px; color: #17382a; background: #fff; }
.amounts { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 1px; background: var(--line); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.amounts div { background: #f6f8f4; padding: 10px 14px; }
.amounts dt { font-size: .82rem; color: var(--muted); }
.amounts dd { margin: 4px 0 0; font-weight: 800; font-variant-numeric: tabular-nums; font-size: .92rem; overflow-wrap: anywhere; }
.step-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 22px; }
.step-head h3 { font-size: 1rem; margin: 0; }
#status { background: #edf1eb; border-radius: 20px; padding: 4px 10px; font-size: .8rem; font-weight: 750; }
#status[data-state="done"] { background: #dff0e2; color: #1b5735; }
#status[data-state="failed"] { background: #f8e7df; color: #813820; }
.step-help { margin: 5px 0 14px; color: var(--muted); font-size: .84rem; }
.run-grid { display: grid; grid-template-columns: minmax(165px, .9fr) minmax(0, 1.6fr); gap: 14px; align-items: start; }
.timeline { display: grid; gap: 6px; padding: 0; list-style: none; counter-reset: steps; margin: 0; }
.timeline li { counter-increment: steps; }
.timeline button { width: 100%; min-height: 54px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 2px 8px; padding: 8px; align-items: start; text-align: left; background: #f5f7f3; border: 1px solid transparent; border-radius: 8px; color: inherit; }
.timeline button[aria-pressed="true"] { background: #e9f3eb; border-color: #8bb69a; }
.timeline button::before { content: counter(steps); grid-row: span 2; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #e7ede5; color: var(--muted); font-size: .8rem; }
.timeline li[data-state="current"] button::before, .timeline li[data-state="done"] button::before { background: var(--green); color: white; }
.timeline li[data-state="done"] button::before { content: "✓"; }
.timeline li[data-state="failed"] button::before { content: "×"; background: #f8e7df; color: #813820; }
.timeline strong { font-size: .83rem; overflow-wrap: anywhere; }
.timeline small { color: var(--muted); font-size: .72rem; }
.step-detail { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.step-detail h3 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.step-explanation { display: grid; gap: 11px; margin: 14px 0; }
.step-explanation dt { font-size: .85rem; font-weight: 750; }
.step-explanation dd { margin: 4px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.7; overflow-wrap: anywhere; }
.evidence { padding: 9px 10px; border-radius: 8px; background: #eef2e9; font-size: .8rem; }
.evidence span, .evidence strong { display: block; overflow-wrap: anywhere; }
.evidence span { color: var(--muted); margin-bottom: 3px; }
.feedback { color: #1d573d; font-weight: 650; font-size: .87rem; margin-block: 10px; }
.feedback:empty { display: none; }
.controls { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 7px; }
.controls .button { font-size: .89rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-weight: 750; }
.primary { color: #fff; background: var(--green); }
.primary:hover { background: #194431; }
.secondary { color: var(--green); border-color: #b3c6b4; background: white; }
.secondary:hover { background: #f0f6ed; }
.api-inspector { margin-top: 22px; border: 1px solid var(--line); border-radius: 13px; padding: clamp(12px, 2.2vw, 20px); scroll-margin-top: 12px; min-width: 0; }
.api-heading, .api-block-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.api-heading h3, .api-block-heading h4 { margin: 0; }
.api-heading p, .api-note, .api-direction { margin: 5px 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.api-heading label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.api-heading select { width: 100%; min-width: 0; max-width: 100%; min-height: 40px; padding: 5px 9px; border-radius: 8px; border: 1px solid #abbeb0; background: #fff; color: inherit; }
.api-route { margin: 12px 0 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.api-route strong { padding: 4px 8px; border-radius: 5px; color: #17382a; background: #e4f0e5; font-size: .78rem; }
.api-route code { min-width: 0; overflow-wrap: anywhere; color: #203f31; font-size: .84rem; }
.api-payloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.api-block { min-width: 0; background: #f5f7f3; border-radius: 8px; }
.api-block-heading { padding: 7px 9px 4px; }
.api-block-heading h4 { font-size: .84rem; }
.api-block-heading h4 span { color: var(--muted); font-weight: 500; margin-inline-start: 4px; }
.copy { border: 1px solid #b3c6b4; background: #fff; color: #235943; border-radius: 6px; min-height: 34px; padding: 4px 8px; font-size: .77rem; }
.api-inspector pre { margin: 0; padding: 10px; max-height: 280px; white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; color: #ecf4e9; background: #192f25; border-radius: 0 0 8px 8px; font: .77rem/1.6 ui-monospace, monospace; }
.api-decoded { margin-top: 12px; font-size: .86rem; }
.api-headers { padding: 4px 9px; font-size: .8rem; }
.api-decoded summary, .api-headers summary { padding-block: 6px; font-weight: 650; cursor: pointer; }
.fields-title { margin: 14px 0 6px; font-size: .88rem; }
.api-fields { margin: 0; }
.api-fields > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .84rem; }
.api-fields dt { overflow-wrap: anywhere; }
.api-fields dt code { font-weight: 750; }
.api-fields dt small { display: block; color: var(--muted); margin-top: 2px; }
.api-fields dd { margin: 0; color: var(--muted); line-height: 1.5; }
.api-next { padding: 9px 10px; background: #eef2e9; border-radius: 7px; font-size: .84rem; line-height: 1.6; }
.api-next strong { display: block; }
.copy-status { color: var(--green); font-size: .8rem; margin: 0; }
.event-history { margin-top: 18px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 14px; }
.event-history summary { font-size: .9rem; font-weight: 750; cursor: pointer; }
.event-history p, .event-list { font-size: .83rem; color: var(--muted); }
.event-list { padding-inline-start: 22px; margin-bottom: 0; }
.event-list li { padding-block: 5px; }
.event-list li span { margin-inline-start: 8px; overflow-wrap: anywhere; }
.lesson { margin: 22px 0 64px; padding: 18px 22px; background: #eef2e9; border-radius: 12px; }
.lesson summary { cursor: pointer; font-weight: 750; }
.lesson p { max-width: 65em; margin: 12px 0 0; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 28px); }
  .topbar { min-height: 64px; }
  .hero, .lab { grid-template-columns: 1fr; }
  .hero { gap: 23px; padding-block: 38px 30px; }
  .hero p { margin-block: 15px 20px; }
  .hero-notes { border-radius: 12px; padding-inline: 15px; }
  .picker { padding: 17px; }
  .providers { display: flex; flex-wrap: wrap; }
  .providers label { border-color: #d6e0d3; }
  .providers small { display: none; }
  fieldset { margin-top: 12px; }
  .run-grid { grid-template-columns: minmax(110px, .75fr) minmax(0, 1.35fr); }
}
@media (max-width: 520px) {
  .run-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline button { height: 100%; }
  .step-detail { padding: 13px; }
  .amounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amounts div:first-child { grid-column: 1 / -1; }
  .api-payloads { grid-template-columns: 1fr; }
  .api-fields > div { grid-template-columns: 1fr; gap: 4px; }
}
