:root {
  color-scheme: light;
  --ink: #211933;
  --muted: #645b73;
  --purple: #633ab5;
  --purple-deep: #50279f;
  --pine: #2f614d;
  --paper: #fcfbfe;
  --line: #e8e1f2;
  --content: 71rem;
  --gutter: clamp(1.125rem, 4vw, 2.5rem);
  font-family: Inter, "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; }
button, select { font: inherit; }
button, select, summary { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.23em; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 3px solid #9365f3; outline-offset: 4px; }
section[id], div[id] { scroll-margin-top: 5.5rem; }

.container { width: min(var(--content), calc(100% - 2 * var(--gutter))); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.8rem 1rem;
  color: white;
  background: var(--purple-deep);
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 3;
  top: 0;
  background: #fbf9ffed;
  border-bottom: 1px solid #ece5f7;
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4.375rem;
  gap: 1rem;
}

.brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  white-space: nowrap;
  text-decoration: none;
}

.brand-zh {
  padding-left: 0.55rem;
  border-left: 1px solid #dcd1eb;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.site-header nav, .site-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(1rem, 2.5vw, 1.85rem);
}

.site-header nav a, .site-footer nav a, .repo-link {
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.45rem;
}

.site-header nav a:hover, .site-footer nav a:hover, .repo-link:hover { color: var(--purple-deep); }

.repo-link {
  justify-self: end;
  padding-inline: 0.8rem;
  border: 1px solid #e7def1;
  border-radius: 0.625rem;
  white-space: nowrap;
}

.hero {
  overflow: clip;
  padding: clamp(2.5rem, 4.5vw, 4rem) 0 clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(ellipse at 50% 20%, #eee5ff 0%, #f8f3ff 42%, transparent 74%),
    linear-gradient(#faf7ff, #f3ecff 82%, var(--paper));
}

.hero-content { text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #e1d3fa;
  border-radius: 999px;
  background: #fbf8ffc9;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--purple-deep);
}

.eyebrow-mark {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 0.125rem;
  background: #8054d0;
  transform: rotate(45deg);
}

h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.85rem, 6.2vw, 5.4rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.04em;
}

h1 span {
  display: inline-block;
  color: var(--purple);
  background: linear-gradient(105deg, #552ca2, #7c50c6 80%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  max-width: 45rem;
  margin: 1.35rem auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.14rem);
  line-height: 1.85;
  text-wrap: balance;
}

.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.primary { color: white; background: var(--purple); box-shadow: 0 7px 18px #5824a536; }
.primary:hover { background: var(--purple-deep); }
.secondary { background: #ffffffb5; border-color: #e2d6f2; }
.secondary:hover { background: white; }

.icon-download {
  display: inline-block;
  position: relative;
  width: 0.85rem;
  height: 1rem;
  border-bottom: 1.5px solid currentColor;
}

.icon-download::before, .icon-download::after { content: ""; position: absolute; left: 50%; }
.icon-download::before { height: 0.53rem; border-left: 1.5px solid currentColor; top: 0.02rem; }
.icon-download::after {
  width: 0.36rem;
  height: 0.36rem;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  top: 0.27rem;
  transform: translateX(-43%) rotate(45deg);
}

.platforms { margin-top: 1rem; color: var(--muted); font-size: 0.8rem; }
.platforms span { margin-inline: 0.25rem; }

.gallery { position: relative; margin-top: clamp(2.2rem, 4vw, 3.25rem); }

.gallery-controls { min-height: 2.6rem; margin-bottom: 1.05rem; text-align: center; }

.gallery-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: 1px solid #e5d9f7;
  border-radius: 0.8rem;
  background: #f3ebfc;
}

.gallery-tabs button, .example-tablist button {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 0.84rem;
  font-weight: 690;
}

.gallery-tabs button { padding: 0.58rem 0.9rem; border-radius: 0.55rem; }
.gallery-tabs button:hover { color: var(--purple-deep); }
.gallery-tabs button[aria-selected="true"] { background: white; color: var(--purple-deep); box-shadow: 0 2px 5px #3d23691a; }

.gallery-frame {
  padding: clamp(0.45rem, 1.25vw, 0.85rem);
  border: 1px solid #e2d4f4;
  border-radius: clamp(0.85rem, 2.2vw, 1.55rem);
  background: #faf6ffb8;
  box-shadow: 0 26px 100px -32px #6a3ba75e, inset 0 1px 0 #fff;
}

.gallery img {
  width: 100%;
  height: auto;
  border: 1px solid #39244f20;
  border-radius: clamp(0.5rem, 1.4vw, 1rem);
}

figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.85rem 0.5rem 0.2rem;
  font-size: 0.78rem;
  color: #514266;
  font-weight: 650;
}

figcaption a { white-space: nowrap; text-decoration: none; }
figcaption a:hover { text-decoration: underline; }
.caption-detail { color: var(--muted); font-weight: 450; }

.features { padding-block: clamp(3.75rem, 8vw, 6.5rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2.25rem; }
h2 { font-size: clamp(2rem, 3.85vw, 3.25rem); line-height: 1.2; font-weight: 780; letter-spacing: -0.04em; }
.section-heading p { margin-top: 0.6rem; color: var(--muted); line-height: 1.7; font-size: 1rem; }
.text-link { color: var(--purple-deep); font-weight: 700; font-size: 0.875rem; text-decoration-color: #b397e2; }

.feature-grid, .download-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.15rem; margin-top: 2rem; }
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.feature-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 4px 20px -14px #3c226630;
}

.feature-example { min-height: 12.25rem; display: grid; align-items: center; padding: clamp(0.85rem, 2vw, 1.4rem); }
.example-tabs { background: linear-gradient(145deg, #f0e9ff, #f7f2ff); }
.example-image { background: linear-gradient(145deg, #e8efe7, #f4f7f1); }
.example-drawing { background: linear-gradient(145deg, #f6f2e8, #fbf8f1); }
.example-fold { background: linear-gradient(145deg, #e6f5ee, #f1faf6); }
.example-code { background: linear-gradient(145deg, #ebe6f8, #f4effa); }
.example-fallback { background: linear-gradient(145deg, #f2edfb, #faf6ff); }

.image-example, .drawing-example {
  overflow: hidden;
  border-radius: 0.75rem;
  background: white;
  border: 1px solid #345c5124;
  box-shadow: 0 7px 20px #2b453c12;
}
.image-example img, .drawing-example img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.image-example figcaption, .drawing-example figcaption {
  padding: 0.48rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 550;
  color: #36594d;
  border-top: 1px solid #eef2ec;
}
.drawing-example figcaption { color: #5c4d35; border-top-color: #f0eadc; }

.example-window, .code-window {
  min-width: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  font-size: 0.815rem;
  box-shadow: 0 7px 20px #39275717;
}

.example-window { background: white; border: 1px solid #4b38611a; }
.example-window > p { padding: 0.85rem; line-height: 1.65; color: #4b4259; }

.example-tablist {
  display: flex;
  gap: 0.15rem;
  align-items: stretch;
  padding: 0 0.4rem;
  border-bottom: 1px solid #eae2f6;
}

.example-tablist button {
  min-width: 0;
  padding: 0.6rem 0.45rem;
  border-bottom: 2px solid transparent;
  font-size: clamp(0.68rem, 1.05vw, 0.8rem);
  white-space: nowrap;
}

.example-tablist button[aria-selected="true"] { color: var(--purple-deep); border-bottom-color: #8555d0; }
.example-tablist button:focus-visible { outline-offset: -4px; }

summary { padding: 0.85rem; font-weight: 700; color: #245f4c; }
summary:hover { background: #f6fbf9; }
summary:focus-visible { outline-offset: -4px; }
details > p { border-top: 1px solid #e3eee8; }

.code-window {
  color: #edf3ee;
  background: #17302a;
  border: 1px solid #2b4e44;
  font-family: Consolas, "SFMono-Regular", ui-monospace, monospace;
}
.code-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: #203d35;
  border-bottom: 1px solid #2e5449;
  font-size: 0.72rem;
}
.code-lang { color: #9fc4b5; font-weight: 600; }
.code-title { color: #f6f3e8; font-weight: 700; text-align: center; }
.code-badge { justify-self: end; color: #e8c27e; font-size: 0.68rem; }
.code-window pre { margin: 0; padding-block: 0.5rem; overflow: auto; font-size: clamp(0.66rem, 0.96vw, 0.78rem); line-height: 1.6; }
.code-window code { font: inherit; }
.code-window code span { display: block; padding-inline: 0.75rem; white-space: pre; }
.code-window code .hl { border-left: 2px solid #e8c27e; background: #2c4a3e; padding-left: calc(0.75rem - 2px); }
.code-window .ln { display: inline-block; width: 1.35rem; color: #7ca393; font-style: normal; user-select: none; }

.fallback-flow {
  display: grid;
  gap: 0.65rem;
}
.flow-pill, .flow-node {
  padding: 0.7rem 0.85rem;
  border-radius: 0.7rem;
  background: white;
  border: 1px solid #dfd3f2;
  box-shadow: 0 4px 12px #3c22660d;
}
.flow-pill strong, .flow-node strong { display: block; font-size: 0.8rem; color: var(--ink); }
.flow-pill span, .flow-node span { display: block; margin-top: 0.22rem; font-size: 0.75rem; color: var(--muted); line-height: 1.45; }
.flow-pill { text-align: center; background: #fcfaff; border-style: dashed; border-color: #bfa8e6; }
.flow-branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.flow-node.is-accent { border-color: #c8b2ef; background: #f8f4ff; }
.flow-node.is-accent strong { color: var(--purple-deep); }

.feature-copy { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.feature-copy code { font-size: 0.88em; background: #f4effb; padding: 0.1em 0.35em; border-radius: 0.3em; color: #472588; overflow-wrap: anywhere; }
.feature-copy h3, .download-card h3 { font-size: 1.18rem; font-weight: 770; letter-spacing: -0.02em; }
.feature-copy p { margin-top: 0.45rem; color: var(--muted); font-size: 0.89rem; line-height: 1.75; }

.feature-copy .fallback { border-top: 1px solid var(--line); margin-top: auto; padding-top: 0.8rem; }
.feature-copy p + .fallback { margin-top: 0.9rem; }
.fallback strong { color: var(--purple-deep); margin-right: 0.25em; }

.capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.capabilities li { padding: 0.45rem 0.8rem; background: #f5f0fc; border: 1px solid var(--line); border-radius: 999px; color: #54436f; font-size: 0.79rem; }

.download {
  padding-block: clamp(3.5rem, 7vw, 6rem);
  color: #fff;
  background: radial-gradient(ellipse at 95% 6%, #472879 0%, #2b1b49 43%, #201531 85%);
}

.download-heading p, .download-card p, .download-note { color: #ded2f1; }

.release-link {
  border: 1px solid #a490c76e;
  background: #ffffff10;
  border-radius: 0.55rem;
  padding: 0.6rem 0.8rem;
  color: #f5edff;
  font-weight: 650;
  font-size: 0.82rem;
  text-decoration: none;
}

.release-link:hover { background: #ffffff20; }

.download-card { border: 1px solid #d1bbf23d; border-radius: 1rem; background: #ffffff0e; padding: 1.25rem; }
.download-card p { margin-top: 0.35rem; font-size: 0.82rem; }
.download-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin-top: 1.25rem; }

.download-actions select {
  min-height: 2.6rem;
  color: #fff;
  color-scheme: dark;
  background: #33234d;
  border: 1px solid #a08bbf;
  border-radius: 0.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
}

.download-actions .button { min-height: 2.6rem; background: #f1e8fe; color: #362157; border-radius: 0.5rem; font-size: 0.82rem; }
.download-actions .button:hover { background: #fff; }
.download-note { margin-top: 1.3rem; font-size: 0.82rem; line-height: 1.75; }
.download-note a { color: #fff; }

.site-footer { padding-block: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.15rem 2rem; justify-content: space-between; align-items: center; }
.site-footer p { margin-top: 0.55rem; color: var(--muted); font-size: 0.8rem; }

@media (max-width: 56rem) {
  .feature-grid, .download-grid { gap: 0.85rem; }
  .feature-copy, .download-card { padding: 1.05rem; }
}

@media (max-width: 44rem) {
  .header-inner { grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding-top: 0.625rem; }
  .site-header nav { grid-column: 1 / -1; grid-row: 2; gap: 1.15rem; min-height: 2.5rem; }
  .site-header nav a { font-size: 0.82rem; }
  .repo-link { grid-column: 2; grid-row: 1; }
  .hero { padding-top: 3rem; }
  h1 span { display: block; }
  .feature-grid, .download-grid, .flow-branches { grid-template-columns: 1fr; }
  .feature-example { padding-inline: clamp(1rem, 6vw, 2.5rem); min-height: 8.5rem; }
  .example-tablist button, .code-window pre { font-size: 0.78rem; }
  .feature-copy, .download-card { padding: 1.1rem; }
  .download-actions .button { flex-grow: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  h1 span { background: none; -webkit-text-fill-color: currentColor; }
  .gallery-tabs button[aria-selected="true"], .example-tablist button[aria-selected="true"] { outline: 1px solid currentColor; outline-offset: -2px; }
}
