:root {
  color-scheme: light;
  --page: #faf9fe;
  --ink: #17152a;
  --muted: #575468;
  --purple: #6247e7;
  --purple-dark: #5136cc;
  --line: #e7e3f2;
  --panel: #f1eefb;
  --wrap: 76rem;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
:lang(en) { font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(var(--wrap), calc(100% - 4rem)); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 3; top: .5rem; left: .5rem; background: white; padding: .6rem 1rem; }
.top { background: var(--page); border-bottom: 1px solid var(--line); }
.header { display: grid; min-height: 4.5rem; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: .65rem; font-size: 1.125rem; font-weight: 760; letter-spacing: -.055em; white-space: nowrap; }
.brand b { color: var(--purple-dark); }
.header nav, .header-actions { display: flex; align-items: center; gap: clamp(.9rem, 2.7vw, 2.1rem); }
.header nav { color: var(--muted); font-size: .95rem; font-weight: 650; }
.header-actions { justify-content: end; gap: .8rem; }
.header nav a:hover, .foot-links a:hover { color: var(--purple-dark); }
.locale, .top-github { padding: .4rem .65rem; font-size: .88rem; font-weight: 730; white-space: nowrap; }
.locale:hover, .top-github:hover { color: var(--purple-dark); background: var(--panel); border-radius: .4rem; }

.hero {
  background: radial-gradient(ellipse at 78% 25%, #efebff 0, transparent 50%),
    linear-gradient(180deg, var(--page), #f7f4ff);
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: center;
  gap: clamp(2rem, 4vw, 4rem); padding-block: clamp(3.8rem, 7.4vw, 7.1rem);
}
.eyebrow {
  display: flex; align-items: center; gap: .65rem; margin-bottom: 1.15rem;
  color: var(--purple-dark); font-size: .83rem; font-weight: 800; letter-spacing: .075em; line-height: 1.65;
}
.eyebrow-line { width: 1.45rem; height: 2px; flex: none; border-radius: 999px; background: currentColor; }
h1 { font-size: clamp(3.1rem, 5.8vw, 5.9rem); line-height: 1.08; font-weight: 850; letter-spacing: -.07em; }
h1 strong { color: var(--purple-dark); display: block; font-weight: inherit; }
:lang(zh-CN) h1 { font-size: clamp(2.65rem, 5.25vw, 5.45rem); letter-spacing: -.055em; line-height: 1.13; }
.hero-lead { max-width: 30rem; margin-top: 1.4rem; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.72; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.button {
  min-height: 3rem; display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1rem; border-radius: .55rem; border: 1px solid transparent; text-align: center;
  font-weight: 750; line-height: 1.3;
}
.primary { background: var(--purple); color: #fff; }
.primary:hover { background: var(--purple-dark); }
.secondary { border-color: #d9d2ec; background: #fff8; }
.secondary:hover { background: #eee9fd; }

.comparison {
  min-width: 0; padding: .65rem; border-radius: 1.15rem; border: 1px solid #e9dfff;
  background: #fff; box-shadow: 0 1.6rem 3.6rem -1.6rem #30207056;
}
.comparison-top { display: flex; align-items: center; gap: .45rem; min-height: 2.1rem; padding: 0 .4rem .4rem; color: var(--muted); font-size: .83rem; font-weight: 730; }
.comparison-format { margin-left: auto; font-family: ui-monospace, monospace; font-size: .75rem; letter-spacing: .08em; }
.status-dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--purple); }
.compare-visual { --split: 50%; position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.55; border-radius: .68rem; background: #171524; }
.compare-visual img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.compare-visual .before { clip-path: inset(0 calc(100% - var(--split)) 0 0); z-index: 1; }
.image-label {
  position: absolute; z-index: 2; top: .8rem; padding: .35rem .55rem;
  background: #151222d9; color: white; border: 1px solid #ffffff60; border-radius: .3rem; font-size: .78rem; font-weight: 750;
}
.image-label.left { left: .8rem; }
.image-label.right { right: .8rem; }
.divider { position: absolute; z-index: 2; left: var(--split); top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: white; pointer-events: none; }
.knob {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex;
  align-items: center; justify-content: center; gap: .25rem; width: 2.55rem; height: 2.55rem; border-radius: 50%;
  background: white; color: var(--purple-dark); box-shadow: 0 2px 10px #1b162d99;
}
.knob i { width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.knob i + i { transform: rotate(-135deg); }
.compare-input {
  appearance: none; position: absolute; z-index: 3; left: -.9rem; top: 0;
  width: calc(100% + 1.8rem); height: 100%; opacity: 0; margin: 0; cursor: ew-resize; touch-action: pan-y;
}
.compare-input::-webkit-slider-thumb { appearance: none; width: 1.8rem; height: 2.55rem; }
.compare-input::-moz-range-thumb { border: 0; width: 1.8rem; height: 2.55rem; }
.compare-visual:has(input:focus-visible) { outline: 3px solid var(--purple); outline-offset: 3px; }
.comparison figcaption { padding: .68rem .45rem .15rem; color: var(--muted); font-size: .83rem; }

.stats { border-bottom: 1px solid var(--line); background: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-block: 1.7rem; }
.stats-grid div { display: flex; flex-direction: column-reverse; gap: .32rem; padding-inline: 1.45rem; border-left: 1px solid var(--line); }
.stats-grid div:first-child { border: 0; padding-left: 0; }
.stats-grid dt { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.stats-grid dd { color: var(--purple-dark); font-weight: 820; font-size: clamp(1.55rem, 3.4vw, 2.6rem); line-height: 1.05; letter-spacing: -.06em; }

.section { padding-block: clamp(3.4rem, 7vw, 6rem); }
.section-lead { max-width: 47rem; margin-bottom: 2.15rem; }
.section h2 { font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.17; letter-spacing: -.055em; font-weight: 820; }
.section-lead > p:last-child, .inference p:not(.eyebrow) { margin-top: .8rem; color: var(--muted); font-size: 1.07rem; line-height: 1.7; }
.pipeline, .case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 0; margin: 0; }
.pipeline { list-style: none; }
.pipeline li, .case { border: 1px solid var(--line); border-radius: .9rem; background: white; min-width: 0; overflow: hidden; }
.step-visual { display: grid; place-content: center; min-height: 9.25rem; margin: .45rem; border-radius: .6rem; background: var(--panel); }
.step-1 { background: #f1edfc; }
.mini-image { display: grid; place-items: center; width: 6.4rem; height: 6.4rem; padding: .4rem; border: 1px dashed #8066e5; border-radius: .44rem; }
.mini-image img { width: 100%; height: auto; border-radius: .2rem; }
.step-2 { background: #eeebfc; }
.token-grid { display: grid; grid-template-columns: repeat(6, .8rem); gap: .2rem; }
.token-grid i { width: .8rem; height: .8rem; background: #b6a8f2; border-radius: .16rem; }
.token-grid i:nth-child(4n + 1) { background: #654de0; }
.token-grid i:nth-child(9n - 2) { background: #927ce9; }
.step-3 { background: #eeebfb; }
.mini-code { padding: .8rem .9rem; color: #382f65; background: #fffc; border-radius: .4rem; font-size: clamp(.65rem, 1.2vw, .83rem); line-height: 1.6; overflow: hidden; margin: 0; }
.mini-code span { color: var(--purple-dark); font-weight: 750; }
.step-copy, .case-copy { padding: 1.15rem 1.2rem 1.3rem; }
.step-copy h3, .case-copy h3 { font-size: 1.22rem; letter-spacing: -.022em; }
.step-copy p, .case-copy p { margin-top: .55rem; color: var(--muted); line-height: 1.58; }
.spec { display: inline-block; margin-top: 1rem; color: var(--purple-dark); font-size: .8rem; font-weight: 780; letter-spacing: .035em; }
.sources { display: flex; flex-wrap: wrap; gap: .75rem 1.4rem; margin-top: 1.25rem; }
.text-link { color: var(--purple-dark); text-decoration: underline; text-underline-offset: .2em; font-weight: 680; }
.text-link:hover { color: var(--ink); }

.examples { border-block: 1px solid var(--line); background: #f4f1fc; }
.case { display: flex; flex-direction: column; }
.case-visual { padding: .55rem; background: #fff; }
.case-toggle { border: 0; padding: .25rem .15rem .55rem; margin: 0; display: flex; align-items: center; gap: .2rem; }
.case-toggle label { cursor: pointer; }
.case-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.case-toggle span { display: block; padding: .38rem .54rem; border-radius: .35rem; color: var(--muted); font-size: .83rem; font-weight: 720; line-height: 1.2; }
.case-toggle input:checked + span { background: #eae3ff; color: #4731a8; }
.case-toggle input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px; }
.case-images { display: grid; place-items: center; aspect-ratio: 1.65; background: #fbfaff; border: 1px solid #eeeaf8; border-radius: .4rem; overflow: hidden; }
.case-images img { width: 100%; height: 100%; object-fit: contain; }
.case-original, .case-visual:has([value="original"]:checked) .case-vector { display: none; }
.case-visual:has([value="original"]:checked) .case-original { display: block; }
.case-copy { display: flex; flex: 1; flex-direction: column; padding-top: .55rem; }
.case-copy p { margin-bottom: 1rem; }
.case-copy .text-link { align-self: start; margin-top: auto; font-size: .9rem; }
.attribution { margin-top: 1rem; color: var(--muted); font-size: .9rem; }
.limits { margin-top: 2rem; padding: 1rem 1.15rem; border: 1px solid #ddd5f1; border-radius: .7rem; background: #ffffff70; }
.limits summary { width: fit-content; font-weight: 760; cursor: pointer; }
.limits p { margin-top: .6rem; color: var(--muted); max-width: 53rem; line-height: 1.65; }
.inference {
  position: relative; overflow: hidden; isolation: isolate; display: grid; align-items: center; grid-template-columns: 1fr minmax(7rem, 22%);
  gap: 1.3rem; padding: clamp(1.6rem, 5vw, 3.75rem); border-radius: 1.1rem;
  background: linear-gradient(110deg, #1b1734, #2d2357); color: #fff;
}
.inference .eyebrow { color: #cfc1ff; }
.inference p:not(.eyebrow) { color: #ded7f4; max-width: 47rem; }
.inference .secondary { color: white; border-color: #b9a5ed; background: transparent; }
.inference .secondary:hover { background: #ffffff18; }
.infer-mark { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid #d5c6ff35; border-radius: 50%; box-shadow: 0 0 0 1.4rem #d5c6ff12, 0 0 0 2.75rem #d5c6ff0b; }
.infer-mark img { width: 56%; height: auto; transform: rotate(-11deg); }
.footer { border-top: 1px solid var(--line); background: #fff; }
.foot-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem; align-items: center; padding-block: 1.5rem; }
.foot-grid p { margin-top: .5rem; color: var(--muted); font-size: .9rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .65rem 1.2rem; color: var(--muted); font-size: .9rem; font-weight: 650; }

@media (max-width: 62rem) {
  .hero-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.8rem; }
  :lang(zh-CN) h1 { font-size: clamp(2.4rem, 5.1vw, 4.5rem); }
  .step-copy, .case-copy { padding-inline: .85rem; }
}
@media (max-width: 48rem) {
  .wrap { width: min(100% - 2rem, 38rem); }
  .header { grid-template-columns: 1fr auto; gap: .2rem .55rem; padding-block: .65rem; }
  .header nav { grid-row: 2; grid-column: 1 / -1; margin-top: .45rem; gap: 1.15rem; padding-block: .3rem .15rem; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 2.7rem 2rem; gap: 1.5rem; }
  h1 { font-size: clamp(2.7rem, 9vw, 4.25rem); }
  :lang(zh-CN) h1 { font-size: clamp(2.65rem, 8.5vw, 4.25rem); }
  .hero-lead { margin-top: 1rem; }
  .actions { margin-top: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0; }
  .stats-grid div:nth-child(3) { border: 0; padding-left: 0; }
  .pipeline, .case-grid { grid-template-columns: 1fr; }
  .step-copy, .case-copy { padding-inline: 1.15rem; }
  .step-visual { min-height: 8.2rem; }
  .mini-code { font-size: .85rem; }
  .inference { grid-template-columns: 1fr; }
  .infer-mark { display: none; }
}
@media (max-width: 23rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .header-actions { gap: .2rem; }
  .header nav { gap: .75rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
