:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #242331;
  background: #f5f5f9;
  --ink: #242331;
  --muted: #626073;
  --rule: #dedde7;
  --purple: #594bc1;
  --violet-light: #f0edff;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, select, summary, input[type="range"] { -webkit-tap-highlight-color: transparent; }
button, select, summary, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #806de3; outline-offset: 3px; }
button:disabled, select:disabled, input:disabled { cursor: default; opacity: .46; }
button:enabled, select:enabled, input[type="range"]:enabled, summary { cursor: pointer; }
.symbols { position: absolute; width: 0; height: 0; pointer-events: none; }
.icon { width: 19px; height: 19px; flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(100% - clamp(32px, 9vw, 130px), 1120px); margin-inline: auto; }
.masthead { background: #fff; border-bottom: 1px solid var(--rule); }
.masthead-inner { min-height: 68px; display: flex; align-items: center; gap: 18px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.31rem; font-weight: 750; letter-spacing: .05em; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--purple); color: white; }
.logo .icon { width: 21px; height: 21px; }
.brand-context { border-left: 1px solid var(--rule); padding-left: 18px; color: var(--muted); font-size: .875rem; text-decoration: none; }
.brand-context:hover { color: var(--purple); text-decoration: underline; text-underline-offset: 3px; }
.download { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; min-height: 37px; border: 1px solid #d3d2df; border-radius: 8px; color: #38364a; background: #fff; text-decoration: none; font-size: .875rem; font-weight: 600; }
.download .icon { width: 16px; height: 16px; }
.download:hover, .step:enabled:hover { background: #f4f2fc; border-color: #b8b2de; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: clamp(28px, 4.6vh, 52px) 0 25px; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font: 600 clamp(2rem, 3.4vw, 3rem)/1.22 "STIX Two Text", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif; letter-spacing: .025em; color: #232333; }
.intro p { color: var(--muted); margin-top: 10px; font-size: 1rem; line-height: 1.6; }
.stats { display: flex; align-items: center; margin: 0 0 2px; }
.stats > div { display: flex; flex-direction: column-reverse; min-width: 95px; padding-left: 24px; }
.stats > div + div { margin-left: 24px; border-left: 1px solid #d9d8e3; }
.stats dt { font-size: .8125rem; color: var(--muted); }
.stats dd { font: 570 1.78rem/1.25 var(--mono); letter-spacing: -.08em; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(292px, 1fr); align-items: start; gap: 22px; margin-bottom: clamp(30px, 6vh, 68px); }
.panel { min-width: 0; background: white; border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 3px 12px -11px #19162766; }
.viewer { overflow: hidden; }
.panel-head, .chapter-head { display: flex; align-items: center; gap: 10px; }
.panel-head { min-height: 55px; justify-content: space-between; padding: 0 23px; border-bottom: 1px solid var(--rule); }
h2 { font-size: 1.07rem; font-weight: 670; line-height: 1.4; letter-spacing: .025em; }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: #efedf8; color: #5c527c; font-size: .8125rem; }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #81769d; }
.state.is-playing { color: #4636ae; background: #ede9ff; }
.state.is-playing::before { background: var(--purple); }
.canvas-sheet {
  display: grid; place-items: center; padding: clamp(20px, 3vh, 35px);
  background-color: #eaeaf2; background-image: radial-gradient(#cac9da .8px, transparent .9px);
  background-size: 13px 13px;
}
.art { width: min(100%, clamp(290px, 47.5vh, 480px)); aspect-ratio: 1; background: white; box-shadow: 0 0 0 1px #30274c1c, 0 7px 22px #30284c26; }
.art > img, .art > svg { display: block; width: 100%; height: 100%; }
.transport { border-top: 1px solid var(--rule); padding: 16px 23px 20px; }
.position, .buttons { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.position { color: var(--muted); font-size: .875rem; }
#progress { font-variant-numeric: tabular-nums; }
#progress strong { font-family: var(--mono); color: var(--purple); font-weight: 650; }
.timeline { --pct: 100%; width: 100%; height: 26px; margin: 3px 0 9px; appearance: none; background: transparent; }
.timeline::-webkit-slider-runnable-track { height: 4px; border-radius: 5px; background: linear-gradient(to right, var(--purple) var(--pct), #e3e1ec var(--pct)); }
.timeline::-moz-range-track { height: 4px; border-radius: 5px; background: #e3e1ec; }
.timeline::-moz-range-progress { height: 4px; background: var(--purple); }
.timeline::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; margin-top: -5.5px; border: 2px solid white; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 1px #a59cd9; }
.timeline::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 1px #a59cd9; }
.buttons { justify-content: flex-start; }
.buttons button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.primary { gap: 6px; min-width: 112px; padding: 0 15px; color: #fff; background: var(--purple); border: 1px solid var(--purple); font-weight: 620; font-size: .9rem; }
.primary:enabled:hover { background: #483aa7; }
.step-buttons { display: inline-flex; gap: 5px; }
.step { width: 39px; padding: 0; border: 1px solid var(--rule); background: white; color: #4a475b; }
.step .icon { width: 17px; height: 17px; }
.speed { margin-left: auto; display: flex; align-items: center; position: relative; gap: 8px; color: var(--muted); font-size: .875rem; }
.speed select { appearance: none; min-height: 38px; min-width: 59px; padding: 0 22px 0 10px; border: 1px solid var(--rule); border-radius: 7px; background: white; color: var(--ink); font-size: .875rem; font-weight: 600; }
.speed .icon { pointer-events: none; position: absolute; right: 6px; width: 14px; height: 14px; }
.sidebar { min-width: 0; display: grid; align-content: start; gap: 13px; }
.chapters { padding: 20px 17px 14px; }
.chapter-head { margin-inline: 4px; }
.section-icon { display: grid; place-items: center; color: var(--purple); }
.section-icon .icon { width: 18px; height: 18px; }
.guide { margin: 8px 4px 15px; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.chapter-list { display: grid; gap: 3px; }
.chapter {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) 14px; gap: 12px; align-items: center;
  min-height: 61px; width: 100%; padding: 6px 10px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 9px; text-align: left;
}
.chapter:hover { background: #f6f5fa; }
.chapter[aria-current="step"] { background: var(--violet-light); border-color: #d9d3fa; }
.thumb { display: block; width: 46px; aspect-ratio: 1; border-radius: 6px; box-shadow: inset 0 0 0 1px #28223e1a; background-color: #dcdfeb; background-image: url("./phases.webp"); background-repeat: no-repeat; background-size: 600% 100%; }
.chapter-copy { display: grid; gap: 4px; }
.chapter-name { font-size: .9375rem; font-weight: 620; line-height: 1.35; }
.chapter-range { color: var(--muted); font: .77rem/1.4 var(--mono); }
.chapter[aria-current="step"] .chapter-name { color: #4836a6; }
.chapter[aria-current="step"]::after { content: ""; width: 7px; height: 7px; justify-self: center; border-radius: 50%; background: var(--purple); }
.inspector summary { min-height: 55px; display: flex; align-items: center; gap: 10px; padding: 0 21px; font-size: .94rem; font-weight: 630; list-style: none; }
.inspector summary::-webkit-details-marker { display: none; }
.inspector summary .chevron { width: 15px; height: 15px; margin-left: auto; color: var(--muted); }
.inspector[open] .chevron { transform: rotate(180deg); }
.inspection-body { padding: 0 17px 17px; }
#mark-info { margin: 0 4px 10px; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.pigment:not([hidden]) { display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; color: var(--muted); font-size: .8125rem; }
#paint-chip { width: 58px; height: 12px; border-radius: 3px; border: 1px solid #27223829; }
pre { margin: 0; padding: 13px 15px; border-radius: 8px; background: #242334; color: #e9e3ff; font: .82rem/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 20rem; overflow-y: auto; }
.load-error { font-size: .875rem; padding: 0 22px 16px; }
.load-error a { color: var(--purple); }
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1.35fr) minmax(245px, 1fr); gap: 13px; }
  .wrap { width: calc(100% - 36px); }
  .chapters { padding: 15px 10px 10px; }
  .chapter { gap: 9px; padding-inline: 6px; }
  .speed label { display: none; }
}
@media (max-width: 660px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .masthead-inner { min-height: 55px; gap: 12px; }
  .brand-context { padding-left: 12px; font-size: .8125rem; }
  .intro { display: block; margin: 25px 0 17px; }
  .intro p { margin-top: 7px; }
  .stats { margin-top: 12px; gap: 15px; }
  .stats > div { min-width: 0; flex-direction: row-reverse; gap: 5px; align-items: baseline; padding-left: 0; }
  .stats > div + div { margin-left: 0; padding-left: 15px; }
  .stats dd { font-size: 1.01rem; letter-spacing: -.04em; }
  .stats dt { font-size: .79rem; }
  .panel-head { min-height: 46px; padding-inline: 16px; }
  .transport { padding: 12px 16px 16px; }
  .art { width: min(100%, 390px); }
  .buttons, .step-buttons { gap: 6px; }
  .buttons button, .speed select { min-height: 42px; }
  .chapters { padding: 17px 13px 13px; }
  .chapter { padding-inline: 8px; }
  .inspector summary { padding-inline: 17px; }
}
@media (max-width: 355px) {
  .wrap { width: calc(100% - 24px); }
  .brand-context { display: none; }
  .primary { min-width: 98px; padding-inline: 9px; }
}
