:root {
  color-scheme: light;
  font-family: "DM Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #211e1b;
  background: #fff;
  --muted: #625b55;
  --accent: #ff7a00;
  --accent-ink: #a64300;
  --accent-tint: #fff3e7;
  --accent-fill: #ffe3c9;
  --preview-fill: #fff8f1;
  --line: #e9e4de;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
svg { display: block; }
p, h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }
section[id] { scroll-margin-top: 26px; }
.wrap { width: min(1160px, calc(100% - 96px)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: -.045em; white-space: nowrap; }
.brand img { border-radius: 8px; object-fit: cover; }
nav { display: flex; align-items: center; gap: 31px; color: var(--muted); font-size: 14px; font-weight: 600; }
nav a:hover, .text-link:hover { color: var(--accent-ink); }
.nav-download { padding: 9px 15px; border-radius: 7px; color: var(--accent-ink); background: var(--accent-tint); }
.nav-download:hover { background: var(--accent-fill); }
.nav-download span { margin-left: 5px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 36px;
  padding-block: 58px 57px;
}
.hero-copy { text-align: center; }
h1 { font-size: clamp(38px, 5vw, 70px); line-height: 1.16; letter-spacing: -.035em; font-weight: 800; }
h1 span, h1 em { white-space: nowrap; }
h1 em { color: var(--accent); font-style: normal; }
.hero-description { color: var(--muted); font-size: 16px; line-height: 1.8; margin: 18px auto 0; max-width: 44em; text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 13px 20px; margin-top: 23px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; min-height: 49px; border-radius: 9px; font-size: 14px; font-weight: 700; }
.button svg { width: 17px; height: 17px; }
.primary { color: #271506; background: var(--accent); }
.primary:hover { background: #f16e00; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.file-meta, .mono, code { font-family: "IBM Plex Mono", Consolas, monospace; }
.file-meta { margin-top: 12px; color: var(--muted); font-size: 12px; }
.file-meta span { padding-inline: 2px; }

.studio {
  overflow: hidden;
  width: min(880px, 100%);
  min-width: 0;
  border-radius: 11px;
  background: var(--preview-fill);
}
.studio-bar, .studio-controls { min-height: 49px; display: flex; align-items: center; padding-inline: 16px; }
.studio-bar { justify-content: space-between; }
.studio-title { color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.reset { display: grid; place-items: center; width: 29px; height: 29px; border: 0; border-radius: 6px; color: var(--accent-ink); background: var(--accent-tint); }
.reset:hover { background: var(--accent-fill); }
.reset svg { width: 15px; height: 15px; }
.viewport { position: relative; height: clamp(260px, 31vw, 370px); }
.formula { position: absolute; z-index: 1; top: 15px; left: 16px; max-width: calc(100% - 32px); padding: 6px 9px; border-radius: 5px; color: var(--accent-ink); background: var(--accent-tint); font: 11px/1.3 Consolas, monospace; pointer-events: none; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
canvas:focus-visible { outline-offset: -3px; }
.plot-hint { position: absolute; bottom: 12px; right: 15px; color: var(--muted); font-size: 11px; pointer-events: none; }
.plot-hint span { margin-right: 3px; font-size: 13px; }
.studio-controls { justify-content: center; gap: 7px; }
.studio-controls button { min-height: 32px; padding: 6px 13px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; }
.studio-controls button:hover { color: var(--accent-ink); background: var(--accent-tint); }
.studio-controls button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-fill); font-weight: 700; }

.features { border-top: 1px solid var(--line); padding-block: 35px 65px; }
.section-heading h2, .download h2 { font-size: clamp(27px, 3.4vw, 39px); font-weight: 760; line-height: 1.25; letter-spacing: -.025em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 24px; }
.feature-grid article { background: var(--accent-tint); border-radius: 12px; padding: 22px; }
.feature-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent-fill); border-radius: 7px; }
.feature-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.feature-grid h3 { margin-block: 13px 8px; font-size: 16px; }
.feature-grid p, .news-body { color: var(--muted); font-size: 14px; line-height: 1.8; }

.news { border-block: 1px solid var(--line); }
.news-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; padding-block: 55px; }
.news-items { display: grid; gap: 10px; }
details { border-radius: 10px; background: var(--preview-fill); }
details[open] { background: var(--accent-tint); }
summary { display: flex; align-items: center; gap: 12px; padding: 16px; cursor: pointer; list-style: none; font-size: 15px; }
summary::-webkit-details-marker { display: none; }
.news-tag { flex-shrink: 0; border-radius: 5px; padding: 4px 7px; color: var(--accent-ink); background: var(--accent-fill); font-size: 11px; font-weight: 700; }
.toggle-icon { position: relative; flex: 0 0 13px; height: 13px; color: var(--accent-ink); margin-left: auto; }
.toggle-icon::before, .toggle-icon::after { content: ""; position: absolute; top: 50%; width: 100%; height: 1px; background: currentColor; }
.toggle-icon::after { transform: rotate(90deg); }
details[open] .toggle-icon::after { transform: none; }
.news-body { padding: 0 16px 16px; }
code { border-radius: 3px; color: var(--accent-ink); background: var(--accent-tint); padding-inline: 3px; }
.download { padding-block: 54px; }
.download-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 10px; padding: 27px 30px; background: var(--accent-tint); }
.download h2 { margin-top: 0; font-size: clamp(22px, 3vw, 30px); }
.download p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 72px; border-top: 1px solid var(--line); }
.site-footer .brand { font-size: 15px; }

@media (max-width: 1040px) {
  .wrap { width: calc(100% - 72px); }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 36px); }
  .header-inner { min-height: 64px; }
  nav { gap: 15px; font-size: 12px; }
  .hero { gap: 27px; padding-block: 36px; }
  .hero h1 { font-size: clamp(33px, 7.5vw, 53px); }
  .hero-description { margin-top: 17px; }
  .hero-actions { margin-top: 21px; }
  .viewport { height: clamp(250px, 58vw, 355px); }
  .features { padding-block: 29px 37px; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .feature-grid article { padding: 16px; }
  .news-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-block: 32px; }
  .download { padding-block: 32px; }
  .download-panel { padding: 18px; flex-wrap: wrap; }
}
@media (max-width: 390px) {
  .header-inner { gap: 10px; }
  nav { gap: 10px; }
  .header-inner .brand { font-size: 17px; gap: 6px; }
  .header-inner .brand img { width: 27px; height: 27px; }
  .nav-download { padding: 7px 8px; }
  .nav-download span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
