:root {
  color-scheme: light; --bg: #f8fafc; --panel: #fff; --ink: #111d32;
  --muted: #52617a; --line: #d9e2ef; --accent: #245549; --action: #fff;
  --wash: #e8f0e9; --grid: #dce6fa; --demo-bg: #f5f7fb; --code: #152038;
  font: 15px/1.6 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  scroll-padding-top: 92px;
}
:root[data-theme="dark"] {
  color-scheme: dark; --bg: #111827; --panel: #192337; --ink: #f4f7ff;
  --muted: #b4c2da; --line: #394761; --accent: #c0e5c6; --action: #1b3325;
  --wash: #283a34; --grid: #2c3b59; --demo-bg: #151e2f; --code: #11192a;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { text-underline-offset: .22em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.16; letter-spacing: -.035em; }
p + p { margin-top: 12px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 10px; background: var(--panel); }
.top { position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-inner, .footer { max-width: 1510px; margin: auto; padding: 0 44px; display: flex; align-items: center; gap: 24px; }
.top-inner { min-height: 64px; }
.wordmark { margin-right: auto; color: var(--ink); font-size: 20px; font-weight: 750; letter-spacing: -.045em; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.wordmark span { width: 26px; height: 26px; display: grid; place-items: center; background: var(--accent); color: var(--action); border-radius: 7px; font-size: 16px; }
.top nav { display: flex; gap: 22px; }
.top nav a, .footer a { text-decoration: none; color: var(--muted); font-size: 14px; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent); }
.theme { color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; width: 40px; height: 40px; }
.button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; border-radius: 8px; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--panel); font-weight: 620; }
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); color: var(--action); border-color: transparent; }
.button.compact { min-height: 37px; padding: 5px 12px; font-size: 13px; }
.landing-page {
  --bg: #f7f7f1; --panel: #fdfdf9; --ink: #20231f; --muted: #555c52;
  --line: #d9ddd3; --accent: #245549; --action: #fff;
  --wash: #e9eee4; --demo-bg: #e8ede5; --code: #232b27;
}
:root[data-theme="dark"] .landing-page {
  --bg: #1d231f; --panel: #252d28; --ink: #f2f4eb; --muted: #bac4b8;
  --line: #414e43; --accent: #c0e5c6; --action: #1b3325;
  --wash: #313d32; --demo-bg: #2f3931; --code: #1a211c;
}
.landing { max-width: 1332px; margin: auto; padding: 0 44px 96px; }
.hero { padding: clamp(58px, 7.2vw, 108px) 0 54px; display: grid; grid-template-columns: minmax(0,.96fr) minmax(0,1fr); gap: clamp(24px,4vw,60px); align-items: center; }
.hero-copy { min-width: 0; }
.eyebrow { font: 620 11px/1.5 ui-monospace, monospace; letter-spacing: .115em; color: var(--accent); }
.hero h1 { font-size: clamp(42px, 4.45vw, 70px); line-height: 1.06; font-weight: 710; letter-spacing: -.075em; margin: 15px 0 18px; }
.hero h1 span { display: block; color: var(--accent); }
.hero-description { max-width: 29em; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 24px; }
.hero-actions .button { min-height: 44px; padding-inline: 16px; border-radius: 7px; }
.hero-work { align-self: center; min-width: 0; overflow: hidden; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--wash); }
.hero-preview-header { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 1px 3px 10px; }
.hero-preview-header a { color: var(--ink); font-size: 13px; font-weight: 620; text-decoration: none; }
.hero-preview-header a:hover { text-decoration: underline; }
.hero-preview-header a span { margin-left: 2px; color: var(--muted); }
.hero-work .preview-media { border-radius: 8px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; color: var(--muted); font: 13px/1.5 ui-monospace, monospace; }
.preview-bar a { text-decoration: none; }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.counts a { padding: 17px 14px; display: flex; justify-content: center; align-items: baseline; gap: 10px; text-decoration: none; color: var(--muted); }
.counts a + a { border-left: 1px solid var(--line); }
.counts a:hover { color: var(--accent); background: var(--wash); }
.counts strong { color: var(--ink); font-size: clamp(21px, 2.5vw, 34px); font-weight: 660; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.home-section { margin-top: 78px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.home-section h2 { font-size: clamp(27px, 3.4vw, 43px); }
.section-heading p, .code-feature p { margin-top: 6px; color: var(--muted); }
.section-heading > a { white-space: nowrap; }
.feature-gallery .switchbar { justify-content: start; padding: 0; margin: 0 0 15px; border: 0; }
.feature-gallery .switchbar button { border: 1px solid transparent; padding-inline: 13px; }
.feature-gallery .switchbar button:hover { background: var(--wash); }
.feature-gallery .switchbar button[aria-pressed=true] { background: var(--wash); border-color: var(--line); }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.example-card { min-width: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.example-card .preview-media { border-radius: 0; }
.example-card > a { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 10px 14px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); }
.example-card > a:hover { color: var(--accent); }
.landing .showcase { padding: 12px; background: var(--wash); }
.landing .showcase .switchbar { margin-bottom: 8px; }
.landing .template-preview { overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.landing .template-preview .preview-media { border-radius: 0; }
.showcase, .playground, .code-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.quiet { font-size: 14px; text-decoration: none; }
.switchbar, .preview-tabs { display: flex; gap: 5px; flex-wrap: wrap; }
.switchbar { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.switchbar button, .preview-tabs button, .quiet-button { border: none; color: var(--muted); background: transparent; border-radius: 6px; padding: 8px 12px; min-height: 39px; }
.switchbar button[aria-pressed=true], .preview-tabs button[aria-pressed=true] { background: var(--wash); color: var(--accent); font-weight: 650; }
.quiet-button:hover { color: var(--accent); background: var(--wash); }
.demo-viewport { contain: paint; background: var(--demo-bg); min-height: 180px; padding: 20px; overflow: auto; display: grid; align-items: center; }
.demo-mount { min-width: 0; }
.demo-viewport .demo-inner { min-width: 0; }
.app-viewport .demo-mount, .wide-demo .demo-mount { min-width: 660px; }
.app-viewport { max-height: 660px; }
.code-feature { padding: clamp(18px, 4vw, 40px); display: grid; grid-template-columns: minmax(0, .66fr) minmax(0, 1fr); gap: 26px; align-items: center; background: var(--wash); border-radius: 14px; }
.code-feature .button { margin-top: 17px; }
.code-feature .code-panel { min-width: 0; }
.code-feature .code-panel pre { max-height: 270px; }
.docs-intro > p, .doc-section p, .empty { color: var(--muted); margin-top: 10px; }
.docs { max-width: 1510px; margin: auto; padding: 0 44px 65px; display: grid; grid-template-columns: 206px minmax(0, 1fr) 124px; gap: 28px; }
.sidebar, .toc { position: sticky; top: 64px; align-self: start; }
.sidebar { padding: 28px 12px 10px 0; border-right: 1px solid var(--line); }
.sidebar-toggle { display: none; }
.sidebar-sections { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.sidebar-sections a { padding: 3px 6px; border-radius: 5px; font-size: 12px; color: var(--muted); text-decoration: none; }
.sidebar-sections a[aria-current] { color: var(--accent); background: var(--wash); font-weight: 650; }
.sidebar-group summary { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 7px; color: var(--ink); font-weight: 620; font-size: 13px; cursor: pointer; list-style: none; }
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary:hover { background: var(--wash); border-radius: 5px; }
.sidebar-group[data-current] > summary { color: var(--accent); }
.sidebar-chevron { flex: none; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
.sidebar-group[open] .sidebar-chevron { transform: rotate(45deg); }
.sidebar-count { margin-left: auto; font-size: 11px; font-weight: 450; font-variant-numeric: tabular-nums; color: var(--muted); }
.sidebar-links { display: grid; gap: 1px; margin: 0 0 4px 8px; padding-left: 8px; border-left: 1px solid var(--line); max-height: min(30vh, 255px); overflow-y: auto; }
.sidebar-empty { font-size: 13px; color: var(--muted); padding: 6px; }
input[type=search] { width: 100%; min-height: 38px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.sidebar-items { display: flex; flex-direction: column; margin-top: 12px; max-height: calc(100dvh - 197px); overflow: auto; }
.sidebar-items a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 5px 8px; border-radius: 5px; }
.sidebar-items a:hover, .sidebar-items a[aria-current] { color: var(--accent); background: var(--wash); }
.docs-content { min-width: 0; padding-top: 30px; }
.docs-intro { padding: 0 0 24px; }
.docs-intro .crumb { font-size: 13px; margin: 0 0 10px; }
.docs-intro h1, .simple h1 { font-size: clamp(34px, 5vw, 58px); overflow-wrap: anywhere; }
.toc { padding-top: 42px; color: var(--muted); font-size: 13px; }
.toc nav { display: grid; gap: 7px; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--accent); }
.catalog-search { display: block; max-width: 380px; }
.entry-group { margin-top: 26px; }
.entry-group h2, .doc-section h2 { font-size: 23px; margin-bottom: 12px; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 7px; }
.entry-link { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); text-decoration: none; color: var(--ink); }
.entry-link:hover { border-color: var(--accent); color: var(--accent); }
.doc-section + .doc-section { margin-top: 30px; }
.play-toolbar, .panel-tools { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; gap: 5px; }
.play-toolbar { border-bottom: 1px solid var(--line); }
.panel-tools { border-top: 1px solid var(--line); justify-content: flex-end; }
.code-panel pre { margin: 0; padding: 16px; max-height: 390px; overflow: auto; background: var(--code); color: #e2ebff; font: 13px/1.65 ui-monospace, monospace; }
.code-panel .quiet-button { padding-block: 3px; min-height: 32px; }
.tok-comment { color: #a4b4d1; } .tok-string { color: #aee6c7; } .tok-keyword { color: #eac4ff; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--panel); text-align: left; }
table th, table td { border-bottom: 1px solid var(--line); padding: 8px 12px; }
tbody tr:last-child > * { border-bottom: 0; }
.pager { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pager a { text-decoration: none; }
.simple { max-width: 900px; margin: 60px auto; padding: 0 22px; }
.simple p { margin-top: 18px; }
.footer { border-top: 1px solid var(--line); min-height: 72px; }
.footer .footer-brand { color: var(--ink); font-weight: 700; margin-right: auto; }
.footer nav { display: flex; gap: 16px; }
.no-demo { color: var(--muted); padding: 5px; }
.tier { display: inline-block; white-space: nowrap; border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; color: var(--accent); background: var(--wash); font-size: 12px; }
.tier[data-version="Free"] { color: #176144; background: #e3f4ec; border-color: #a9d7c1; }
.tier[data-version="Pro"] { color: #6234a2; background: #f1e8ff; border-color: #d4b9f5; }
[data-theme="dark"] .tier[data-version="Free"] { color: #a8edce; background: #18382d; border-color: #376c58; }
[data-theme="dark"] .tier[data-version="Pro"] { color: #dec5ff; background: #36224e; border-color: #694990; }
.entry-link { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.tier-filter { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; }
.tier-filter select { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); padding: 5px; }
.preview-media { position: relative; margin: 0; overflow: hidden; background: var(--demo-bg); border-radius: 10px; }
.preview-media img, .preview-media video { display: block; width: 100%; height: auto; aspect-ratio: 860 / 540; }
.preview-media video { position: absolute; inset: 0; }
.preview-media:has(img[hidden]) video { position: static; }
.template-preview > a { display: inline-block; margin: 12px 16px; }
.pro-callout { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 0; }
.pro-source-status { margin: 10px 0; color: var(--muted); }
.pro-source-status:empty { margin: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 24px; }
.plan-grid > section { border: 1px solid var(--line); border-radius: 9px; padding: 20px; background: var(--panel); }
@media (max-width: 1120px) {
  .docs { grid-template-columns: 184px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  :root { scroll-padding-top: 60px; }
  .top-inner, .footer { padding: 0 14px; gap: 9px; min-height: 56px; }
  .top nav { gap: 10px; }
  .top nav a { font-size: 12px; white-space: nowrap; }
  .theme { width: 34px; height: 34px; flex: none; }
  .wordmark { font-size: 17px; }
  .wordmark span { width: 23px; height: 23px; }
  .landing, .docs { padding: 18px 14px 45px; }
  .hero { padding: 32px 0 23px; grid-template-columns: 1fr; gap: 22px; }
  .hero h1 { font-size: clamp(37px, 8vw, 56px); margin-block: 11px; }
  .hero-description { font-size: 15px; }
  .hero-actions { margin-top: 18px; }
  .counts { gap: 0; }
  .counts a { padding: 12px 4px; font-size: 12px; gap: 4px; flex-direction: column; align-items: center; }
  .home-section { margin-top: 50px; }
  .example-grid, .code-feature { grid-template-columns: minmax(0, 1fr); }
  .plan-grid { grid-template-columns: 1fr; }
  .section-heading { flex-wrap: wrap; margin-bottom: 12px; }
  .docs { display: block; }
  .sidebar { position: static; padding: 0; border: 0; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-toggle[aria-expanded=false] + nav { display: none; }
  .sidebar nav { margin-top: 10px; }
  .sidebar-items { max-height: 45vh; }
  .docs-content { padding-top: 17px; }
  .demo-viewport { padding: 10px; }
}
@media (max-width: 380px) {
  .top-inner { padding-inline: 9px; gap: 7px; }
  .top nav { gap: 6px; }
  .top nav a { font-size: 11px; }
  .wordmark { gap: 5px; font-size: 16px; }
  .wordmark span { display: none; }
}
.language { color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap; text-decoration: none; }
.language:hover { color: var(--accent); text-decoration: underline; }
html[lang="en"] .hero h1 { letter-spacing: -.055em; }
html[lang="en"] .hero h1 span { white-space: normal; }
@media (max-width: 520px) {
  :root { scroll-padding-top: 100px; }
  .top-inner { flex-wrap: wrap; min-height: 72px; padding-block: 7px; }
  .top nav { order: 4; width: 100%; justify-content: space-between; gap: 6px; }
  .top nav a { font-size: 11px; white-space: nowrap; }
}
