/* 首屏：导入框是轨道中心，轨道只负责衬托装置。 */
.hero {
  position: relative;
  margin: 8px 24px 0;
  height: max(720px, calc(100vh - var(--nav-h) - 56px));
  border-radius: var(--r-container);
  overflow: hidden;
  overflow-x: clip;
  isolation: isolate;
  background:
    radial-gradient(58% 72% at 6% 92%, rgb(var(--accent-rgb) / .40) 0%, rgb(var(--accent-rgb) / .12) 42%, var(--clear) 72%),
    radial-gradient(52% 58% at 30% 74%, rgb(var(--mid-rgb) / .80) 0%, var(--clear) 72%),
    radial-gradient(42% 46% at 52% 64%, rgb(var(--mid-rgb) / .38) 0%, var(--clear) 72%),
    radial-gradient(38% 44% at 100% 0%, rgb(var(--white-rgb) / .05) 0%, var(--clear) 70%),
    linear-gradient(32deg, var(--accent-mid) 0%, var(--bg-panel-2) 52%, var(--bg-panel-2) 100%);
  color: var(--text);
}
.hero::before, .hero::after, .hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero::before {
  content: "";
  border-radius: inherit;
  border: 1px solid rgb(var(--white-rgb) / .08);
  -webkit-mask: linear-gradient(180deg, var(--solid) 55%, var(--clear) 92%);
  mask: linear-gradient(180deg, var(--solid) 55%, var(--clear) 92%);
  z-index: 3;
}
.hero::after {
  content: "";
  background: linear-gradient(180deg, var(--clear) 70%, rgb(var(--bg-rgb) / .72) 90%, var(--bg) 100%);
  color: var(--text);
  z-index: 1;
}
.hero-grid {
  background-image: radial-gradient(circle, rgb(var(--text-rgb) / .13) 1px, var(--clear) 1.3px);
  background-size: 22px 22px;
  background-position: 11px 11px;
  -webkit-mask: radial-gradient(ellipse 46% 40% at 50% 64%, var(--solid) 0%, var(--clear) 78%);
  mask: radial-gradient(ellipse 46% 40% at 50% 64%, var(--solid) 0%, var(--clear) 78%);
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 48px 0;
  text-align: center;
}
.hero-inner > * { max-width: 100%; flex-shrink: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  margin-block: 1em;
  padding: 0 14px 0 4px;
  border-radius: var(--r-pill);
  background: rgb(var(--bg-rgb) / .35);
  border: 1px solid rgb(var(--white-rgb) / .09);
  color: var(--text-muted);
  font-size: var(--size-small);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.badge-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 22px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: var(--bg);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: .02em;
}
.badge-text b, .hero-desc strong { color: var(--text); font-weight: var(--weight-medium); }
.hero-title {
  margin: 18px 0 0;
  font-size: clamp(34px, 3.35vw, 48px);
  line-height: 1.08;
  letter-spacing: -.025em;
  color: var(--text);
}
.hero-title .line { display: block; }
.hero-title .line-2 {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: var(--clear);
  color: var(--clear);
  padding-bottom: .04em;
}
.hero-desc {
  margin: 14px 0 0;
  max-width: min(100%, 660px);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
}
.cta-row { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero .btn-primary { border-width: 0; }
.platforms {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  justify-content: center;
}
.platforms a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color var(--quick) var(--ease);
}
.platforms a:hover { color: var(--text); text-decoration: underline; }
.platforms svg { width: 15px; height: 15px; display: block; }
.platforms .ico-tux { width: 14px; height: 16px; }
.device-wrap { position: relative; margin-top: 34px; width: min(880px, 100%); }
.stage {
  position: absolute;
  left: 50%;
  top: 80%;
  width: 1240px;
  height: 300px;
  transform: translate(-50%, -50%);
  border-radius: var(--r-round);
  border: 1px solid rgb(var(--accent-rgb) / .18);
  -webkit-mask: linear-gradient(90deg, var(--clear), var(--solid) 22%, var(--solid) 78%, var(--clear));
  mask: linear-gradient(90deg, var(--clear), var(--solid) 22%, var(--solid) 78%, var(--clear));
  pointer-events: none;
  z-index: 0;
}
.stage::before, .stage::after {
  content: "";
  position: absolute;
  border-radius: inherit;
}
.stage::before { inset: -64px -170px; border: 1px solid rgb(var(--accent-rgb) / .09); }
.stage::after {
  inset: 70px 200px;
  background: radial-gradient(ellipse at center, rgb(var(--accent-rgb) / .10), var(--clear) 70%);
  color: var(--text);
}
.device-floor {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 214px;
  height: 80px;
  border-radius: var(--r-round);
  background: radial-gradient(ellipse at center, rgb(var(--shade-rgb) / .62), rgb(var(--shade-rgb) / .2) 45%, var(--clear) 72%);
  color: var(--text);
  filter: blur(10px);
  z-index: 1;
  pointer-events: none;
}
.device {
  position: relative;
  z-index: 2;
  min-height: 252px;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px 28px;
  border-radius: var(--r-device);
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--mist-hi), var(--mist) 46%, var(--mist-lo));
  color: var(--ink);
  text-align: left;
  box-shadow:
    0 0 0 6px rgb(var(--accent-rgb) / .20),
    0 0 0 7px rgb(var(--white-rgb) / .07),
    inset 0 1px 0 rgb(var(--white-rgb) / .95),
    inset 0 -2px 0 rgb(var(--ink-rgb) / .06),
    0 22px 44px -18px rgb(var(--shade-rgb) / .55),
    0 64px 120px -34px rgb(var(--shade-rgb) / .62);
}
.device::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(55% 90% at 16% 0%, rgb(var(--white-rgb) / .55), var(--clear) 62%),
    linear-gradient(180deg, var(--clear) 70%, rgb(var(--ink-rgb) / .035));
  color: var(--ink);
  pointer-events: none;
}
.device-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.prompt { min-width: 0; margin: 0; font: 15px/1.75 var(--font-mono); color: var(--ink-muted); }
.prompt .row { display: block; }
.prompt .scheme { color: var(--ink); }
.prompt .sep { color: var(--ink-faint); padding-inline: .2em; }
.prompt .example { color: var(--ink-muted); }
.input-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-right: 8px;
  vertical-align: -.18em;
  border-radius: var(--r-pill);
  background: var(--accent-deep);
  color: var(--mist-hi);
}
.keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font: 11px/1.6 var(--font-mono);
  color: var(--ink-muted);
}
.keys kbd {
  font-family: inherit;
  padding: 2px 7px;
  border-radius: var(--r-key);
  border: 1px solid rgb(var(--ink-rgb) / .14);
  background: rgb(var(--white-rgb) / .6);
  color: var(--ink-muted);
  box-shadow: inset 0 -1px 0 rgb(var(--ink-rgb) / .10);
}
.device-foot { position: relative; margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.group-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid rgb(var(--ink-rgb) / .14);
  background: rgb(var(--white-rgb) / .5);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgb(var(--white-rgb) / .8);
  font-size: 13.5px;
}
.group-pill svg { width: 14px; height: 14px; color: var(--ink-muted); }
.group-pill .caret-down { color: var(--ink-muted); }
.send, .alt-ico, .dl-fab-ico { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: var(--r-round); }
.send {
  width: 46px;
  height: 46px;
  background: linear-gradient(160deg, var(--accent-dark), var(--accent-deep));
  color: var(--mist-hi);
  box-shadow: 0 8px 18px -6px rgb(var(--accent-dark-rgb) / .7), inset 0 1px 0 rgb(var(--white-rgb) / .35), inset 0 -2px 0 rgb(var(--ink-rgb) / .12);
}
.send svg { width: 18px; height: 18px; }
.device-alts { position: relative; z-index: 2; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.alt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px 0 7px;
  border-radius: var(--r-pill);
  background: rgb(var(--mist-rgb) / .12);
  color: var(--text);
  border: 1px solid rgb(var(--white-rgb) / .14);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgb(var(--white-rgb) / .12), 0 10px 26px -14px rgb(var(--shade-rgb) / .6);
  font-size: 14px;
}
a.alt:hover { background-color: rgb(var(--mist-rgb) / .18); }
.alt-ico {
  width: 28px;
  height: 28px;
  background: rgb(var(--mist-rgb) / .92);
  color: var(--ink);
  box-shadow: inset 0 -1px 0 rgb(var(--ink-rgb) / .12);
}
.alt-ico svg { width: 15px; height: 15px; }
.peek {
  padding: 26px var(--gutter) 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-size: var(--size-small);
  color: var(--text-muted);
}
.peek-label { color: var(--text); letter-spacing: .02em; }
.peek-line { flex: 0 0 40px; height: 1px; background: var(--border); color: var(--text); }
.peek-items { display: flex; gap: 18px; flex-wrap: wrap; }

[role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-device);
  background: var(--bg);
  color: var(--text);
}
[role="tab"] {
  position: relative;
  min-width: 0;
  max-width: 100%;
  min-height: var(--hit);
  padding: 8px 14px 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--clear);
  color: var(--text-muted);
  text-align: center;
}
[role="tab"]:hover:not(:disabled), [role="tab"][aria-selected="true"] { background: var(--bg-panel-2); color: var(--text); }
[role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--accent);
}
[role="tabpanel"] { min-width: 0; }
.toc { width: fit-content; max-width: 100%; margin-bottom: 20px; }
.toc ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.toc a {
  display: flex;
  align-items: center;
  min-height: var(--hit);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel);
  color: var(--text);
}
.toc a:hover { text-decoration: underline; }
.toc--pin { position: sticky; top: 12px; z-index: 4; }
.chapter-layout { display: grid; grid-template-columns: minmax(180px, .68fr) minmax(0, 2fr); gap: clamp(20px, 5vw, 64px); align-items: start; }
.chapter-layout > * { min-width: 0; }
.chapter-layout > .toc { align-self: start; }
.chapter-layout > .toc ul { flex-direction: column; }
.chapter-layout .prose section + section { margin-top: 44px; }

.faq-item {
  margin-block: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-panel);
  color: var(--text);
}
.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--hit);
  padding: 14px 48px 14px 18px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  right: 20px;
  top: 50%;
  border-right: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
  transform: translateY(-65%) rotate(45deg);
}
.faq-item[open] summary::after { transform: translateY(-25%) rotate(225deg); }
.faq-answer { padding: 0 18px 16px; color: var(--text-muted); }
.faq-answer > :last-child { margin-bottom: 0; }

.term-card, .client-card, .article-card { display: flex; flex-direction: column; justify-content: flex-start; }
.term-card dd { margin-inline-start: 0; }
.client-card > :last-child, .article-card > :last-child, .term-card > :last-child { margin-bottom: 0; }
.client-head { display: flex; align-items: flex-start; gap: 12px; }
.client-head > div { min-width: 0; }
.app-icon { width: 56px; height: 56px; }
.plat-actions { margin-top: auto; padding-top: 14px; }
.article-card h3 a:hover { text-decoration: underline; }
.article-meta { color: var(--text-muted); font: var(--size-small)/1.55 var(--font-mono); }
@media (min-width: 961px) {
  .card-grid:has(> :nth-child(5):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .card-grid:has(> :nth-child(5):last-child) > * { grid-column: span 2; }
  .card-grid:has(> :nth-child(5):last-child) > :nth-child(n+4) { grid-column: span 3; }
  .card-grid:has(> :nth-child(7):last-child) { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .card-grid:has(> :nth-child(7):last-child) > * { grid-column: span 3; }
  .card-grid:has(> :nth-child(7):last-child) > :nth-child(n+5) { grid-column: span 4; }
}
@media (min-width: 641px) and (max-width: 960px) {
  .card-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.flag, .step-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-note);
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: var(--size-small);
}
.flag--first { background: var(--accent); color: var(--bg); }
.flag--recommended { color: var(--accent); }
.flag--retired { color: var(--text-muted); }
.step-mark {
  border-color: var(--clear);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-mono);
}
.dot { width: 7px; height: 7px; border-radius: var(--r-round); background: currentColor; }
.callout {
  margin: 20px 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--r-note);
  background: var(--bg-panel);
  color: var(--text);
}
.callout > :last-child { margin-bottom: 0; }
.callout a { color: var(--accent); text-decoration: underline; }
.download-close { margin-top: 36px; }
.download-close > :last-child { margin-bottom: 0; }
.get-note { padding: 8px 12px; border-radius: var(--r-note); background: var(--bg-panel-2); color: var(--text-muted); }

.table-scroll, .prose table, .section-body table, .wrap table:not(.data-table), .data-table {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose table, .section-body table, .wrap table:not(.data-table), .data-table { display: block; }
.table-scroll > .data-table { display: table; min-width: 100%; max-width: none; }
:is(.prose, .section-body, .wrap) table, .data-table { border-collapse: collapse; }
:is(.prose, .section-body, .wrap) :is(th, td), .data-table :is(th, td) {
  min-width: 7em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
:is(.prose, .section-body, .wrap) th, .data-table th { background: var(--bg-panel-2); color: var(--text); font-weight: var(--weight-medium); }
:is(.prose, .section-body, .wrap) th[scope="row"], .data-table th[scope="row"] { width: 1%; white-space: nowrap; }
.table-scroll + p { margin-top: 16px; }

.scene-layout { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 2fr); gap: clamp(20px, 5vw, 60px); align-items: start; }
.scene-layout > * { min-width: 0; }
.scene-demo {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 148px;
  margin-bottom: 18px;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid var(--border);
  border-radius: var(--r-note);
  background: var(--bg);
  color: var(--text);
}
.scene-demo > * { min-width: 0; }
.scene-demo pre, .scene-demo p { margin: 0; }
.scene-control { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.scene-switch {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  width: 36px;
  height: 20px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--ink);
}
.scene-switch::after { content: ""; width: 14px; height: 14px; border-radius: var(--r-round); background: currentColor; }
.gallery-wall { display: grid; gap: 8px; margin-top: 18px; }
.gallery-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.gallery-row + .gallery-row { margin-inline-start: clamp(8px, 3vw, 44px); grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.2fr); }
.gallery-tile {
  min-width: 0;
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-note);
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: var(--size-small);
}
.gallery-tile code { color: var(--text-muted); }

.dl-fab {
  position: fixed;
  right: max(28px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: var(--z-fab);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 7px;
  border-radius: var(--r-pill);
  background: rgb(var(--panel-rgb) / .9);
  color: var(--text);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 32px -14px rgb(var(--shade-rgb) / .7);
  font-size: 14px;
  transition: border-color var(--quick) var(--ease);
}
.dl-fab:hover { border-color: rgb(var(--accent-rgb) / .4); }
.dl-fab-ico { width: 30px; height: 30px; background: linear-gradient(180deg, var(--accent), var(--accent-dark)); color: var(--bg); }
.dl-fab-ico svg { width: 15px; height: 15px; }

.preview-mobile { display: none; }
.preview-mobile summary { list-style: none; }
.preview-mobile summary::-webkit-details-marker { display: none; }
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
}
.swatches li { min-width: 0; }
.swatches li::before {
  content: "";
  display: block;
  height: 48px;
  margin-bottom: 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-key);
  background: var(--swatch, var(--bg));
  color: var(--text);
}
.sw-bg { --swatch: var(--bg); }
.sw-panel { --swatch: var(--bg-panel); }
.sw-panel-2 { --swatch: var(--bg-panel-2); }
.sw-border { --swatch: var(--border); }
.sw-accent { --swatch: var(--accent); }
.sw-accent-dark { --swatch: var(--accent-dark); }
.sw-accent-deep { --swatch: var(--accent-deep); }
.sw-accent-mid { --swatch: var(--accent-mid); }
.sw-text { --swatch: var(--text); }
.sw-muted { --swatch: var(--text-muted); }
.sw-success { --swatch: var(--success); }
.sw-warn { --swatch: var(--warn); }
.sw-error { --swatch: var(--error); }
.sw-mist { --swatch: var(--mist); }
.sw-mist-hi { --swatch: var(--mist-hi); }
.sw-mist-lo { --swatch: var(--mist-lo); }
.sw-ink { --swatch: var(--ink); }
.sw-ink-muted { --swatch: var(--ink-muted); }
.sw-ink-faint { --swatch: var(--ink-faint); }
.sw-solid { --swatch: var(--solid); }
.sw-white { --swatch: var(--white); }
.sw-clear { --swatch: var(--clear); }
.sw-section { --swatch: var(--section-ink); }
.type-display { font: var(--weight-regular) var(--size-display)/1.12 var(--font-display); }

@media (min-width: 961px) and (min-height: 975px) {
  .hero-inner { padding-top: clamp(44px, calc(44px + (100vh - 940px) / 2), 220px); }
}
@media (max-width: 960px) {
  .hero { height: auto; padding-bottom: 72px; }
  .stage { width: 900px; }
  .preview-mobile { display: block; }
  .chapter-layout, .scene-layout { grid-template-columns: minmax(0, 1fr); }
  .chapter-layout > .toc { position: static; }
  .chapter-layout > .toc ul { flex-direction: row; }
}
@media (max-width: 768px) {
  .hero-title { font-size: var(--size-display); line-height: 1.14; letter-spacing: -.02em; }
}
@media (max-width: 640px) {
  .hero { margin: 4px 12px 0; }
  .hero-inner { padding: 32px 18px 0; }
  .platforms { gap: 12px 22px; }
  .device { min-height: 220px; padding: 20px 18px 16px; }
  .prompt { font-size: 13px; }
  .keys, .peek-items { display: none; }
  .device-alts { gap: 8px; }
  .alt { gap: 6px; padding-inline: 5px 9px; font-size: 12px; }
  .hero .btn { padding-inline: 14px; }
  .gallery-tile { padding-inline: 7px; }
  .dl-fab {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    justify-content: center;
    padding: 0;
  }
  .dl-fab-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (forced-colors: active) {
  .hero-title .line-2 { background: none; color: CanvasText; -webkit-text-fill-color: currentColor; }
  [role="tab"][aria-selected="true"] { text-decoration: underline; text-decoration-thickness: 2px; }
}