:root {
  color-scheme: light;
  --paper: #f8faf9;
  --surface: #ffffff;
  --surface-soft: #f0f5f3;
  --ink: #111615;
  --ink-2: #394744;
  --muted: #66736f;
  --line: rgba(17, 22, 21, 0.11);
  --line-strong: rgba(17, 22, 21, 0.2);
  --mint: #61dfbb;
  --mint-soft: #dff8ee;
  --mint-ink: #075f49;
  --blue: #91aaf7;
  --blue-soft: #e9ecff;
  --blue-ink: #344693;
  --header: rgba(248, 250, 249, 0.88);
  --shadow: 0 24px 70px rgba(22, 51, 43, 0.09);
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang TC", "PingFang HK", "Noto Sans CJK TC", "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121615;
  --surface: #1b211f;
  --surface-soft: #222a28;
  --ink: #f2f6f4;
  --ink-2: #d5ddda;
  --muted: #a5b1ad;
  --line: rgba(233, 242, 239, 0.1);
  --line-strong: rgba(233, 242, 239, 0.2);
  --mint: #79dfc1;
  --mint-soft: #173b31;
  --mint-ink: #a2f1d9;
  --blue: #a7b5fb;
  --blue-soft: #292d4a;
  --blue-ink: #cbd2ff;
  --header: rgba(18, 22, 21, 0.88);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0 0 auto;
  height: 520px;
  background:
    radial-gradient(circle at 22% 12%, color-mix(in srgb, var(--mint) 18%, transparent), transparent 40%),
    radial-gradient(circle at 80% 18%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 42%);
  content: "";
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, select { color: inherit; font: inherit; }
h1, h2, h3, h4, p, ol, ul, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }

:where(a, button, select):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--mint) 75%, var(--ink));
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }
.wrap { width: min(calc(100% - 2 * var(--gutter)), var(--max)); margin-inline: auto; }
.section { padding-block: clamp(72px, 9vw, 136px); }
section[id], article[id], div[id] { scroll-margin-top: 100px; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  backdrop-filter: blur(20px) saturate(145%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2 * var(--gutter)), var(--max));
  min-height: 72px;
  margin-inline: auto;
  gap: 30px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 720; letter-spacing: -0.02em; }
.brand img { width: 36px; height: 36px; border-radius: 11px; }
.site-menu { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: clamp(20px, 4vw, 52px); }
.main-nav { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 34px); }
.main-nav a { color: var(--ink-2); font-size: 14px; font-weight: 570; }
.main-nav a:hover { color: var(--ink); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.portal-link { margin-right: 4px; color: var(--ink-2); font-size: 13px; font-weight: 650; }
.portal-link:hover { color: var(--ink); }
.header-tools select {
  min-height: 36px;
  padding: 0 28px 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
}

.menu-toggle { display: none; width: 42px; height: 42px; padding: 11px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.menu-toggle span { display: block; width: 100%; height: 1.5px; margin: 4px 0; background: currentColor; transition: transform 180ms ease, opacity 180ms ease; }

.hero { padding-top: clamp(42px, 5vw, 50px); }
.hero-intro { max-width: 890px; text-align: center; }
.hero-intro h1 { font-size: clamp(5.3rem, 8vw, 6.6rem); font-weight: 760; line-height: 0.88; letter-spacing: -0.075em; }
.hero-title { margin-top: 18px; font-size: clamp(2.25rem, 3.4vw, 2.8rem); font-weight: 680; line-height: 1.08; letter-spacing: -0.045em; text-wrap: balance; }
.hero-lead { margin-top: 10px; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.16rem); }

.product-gates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: clamp(38px, 3.5vw, 42px); }
.product-gate {
  position: relative;
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: clamp(28px, 2.5vw, 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.product-gate::after {
  position: absolute;
  right: -88px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  border: 66px solid color-mix(in srgb, currentColor 11%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.ai-gate { color: #0f3a30; background: linear-gradient(145deg, #c8f7e8, #8ce8c9 58%, #6bddba); }
.code-gate { color: #20284f; background: linear-gradient(145deg, #edf0ff, #cdd5ff 55%, #b7c4fd); }
.gate-top { position: relative; z-index: 1; display: block; }
.product-name { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.product-gate h2 { max-width: 18ch; margin-top: 14px; font-size: clamp(1.88rem, 2.65vw, 2.25rem); font-weight: 700; line-height: 1.08; letter-spacing: -0.042em; text-wrap: balance; }
.status { position: absolute; top: 0; right: 0; z-index: 2; padding: 7px 11px; border: 1px solid currentColor; border-radius: 999px; font-size: 12px; font-weight: 650; opacity: 0.72; }
.gate-copy { position: relative; z-index: 1; margin-top: 16px; font-size: 14px; line-height: 1.6; }
.gate-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; margin-top: auto; padding-top: 16px; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; gap: 10px; padding: 0 22px; border: 1px solid transparent; border-radius: 999px; font-size: 14px; font-weight: 650; text-align: center; transition: transform 180ms ease, box-shadow 180ms ease; }
.button:hover { transform: translateY(-2px); }
.button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.button-ai { color: #eafff8; background: #0d5c49; box-shadow: 0 10px 26px rgba(13, 92, 73, 0.18); }
.button-code { color: #f7f8ff; background: #394b96; box-shadow: 0 10px 26px rgba(57, 75, 150, 0.18); }
.text-link { border-bottom: 1px solid currentColor; font-size: 14px; font-weight: 650; }

.section-heading { display: grid; grid-template-columns: minmax(150px, 0.4fr) 1fr; align-items: start; gap: 44px; margin-bottom: clamp(46px, 7vw, 86px); }
.section-index { color: var(--muted); font-size: 13px; font-weight: 650; letter-spacing: 0.04em; }
.section-heading h2 { max-width: 16ch; font-size: clamp(2.25rem, 5vw, 4.9rem); font-weight: 675; line-height: 1.04; letter-spacing: -0.048em; text-wrap: balance; }

.uses { padding-top: 40px; }
.use-row { display: grid; grid-template-columns: 0.78fr 1.5fr; gap: clamp(40px, 8vw, 110px); padding: clamp(38px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.use-row:last-child { border-bottom: 1px solid var(--line); }
.use-heading .product-dot, .access-card .product-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.ai-row .product-dot, .ai-access .product-dot { background: var(--mint); box-shadow: 0 0 0 7px var(--mint-soft); }
.code-row .product-dot, .code-access .product-dot { background: var(--blue); box-shadow: 0 0 0 7px var(--blue-soft); }
.use-heading > p { display: inline; margin-left: 14px; font-size: 14px; font-weight: 720; }
.use-heading h3 { max-width: 15ch; margin-top: 24px; font-size: clamp(1.7rem, 3.2vw, 3rem); font-weight: 640; line-height: 1.18; letter-spacing: -0.035em; }
.use-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.use-list article { padding-top: 4px; }
.use-list span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.use-list h4 { margin-top: 28px; font-size: 17px; }
.use-list p { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.8; }

.workflow { background: var(--surface-soft); }
.workflow-heading { grid-template-columns: minmax(150px, 0.4fr) 1fr; row-gap: 20px; }
.workflow-heading > p:last-child { grid-column: 2; max-width: 58ch; margin-top: 0; color: var(--muted); font-size: 14px; }
.workflow-example { display: grid; grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr); gap: clamp(40px, 7vw, 100px); align-items: center; padding-block: clamp(60px, 8vw, 100px); border-top: 1px solid var(--line); }
.workflow-example:last-child { padding-bottom: 0; }
.code-example .example-copy { order: 2; }
.code-example .demo-window { order: 1; }
.example-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.example-label span { padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 999px; }
.example-label strong { color: var(--ink); font-size: 14px; }
.example-copy h3 { max-width: 13ch; margin-top: 26px; font-size: clamp(2rem, 4vw, 3.65rem); font-weight: 660; line-height: 1.08; letter-spacing: -0.042em; }
.example-copy ol { margin-top: 38px; }
.example-copy li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; padding-block: 18px; border-top: 1px solid var(--line); }
.example-copy li > span { color: var(--muted); font-size: 12px; }
.example-copy li strong { font-size: 15px; }
.example-copy li p { margin-top: 4px; color: var(--muted); font-size: 13px; }

.demo-window { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.demo-bar { display: flex; height: 46px; align-items: center; gap: 7px; padding: 0 17px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, var(--surface-soft)); }
.demo-bar > span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.demo-bar b { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 0.12em; }
.ai-demo { min-height: 480px; padding-bottom: 34px; background: linear-gradient(155deg, var(--surface), color-mix(in srgb, var(--mint-soft) 45%, var(--surface))); }
.ai-demo .demo-bar { margin-bottom: 34px; }
.chat-line { width: fit-content; max-width: 72%; padding: 13px 17px; border-radius: 18px 18px 5px 18px; font-size: 14px; }
.user-line { margin: 0 28px 0 auto; color: #f7f8ff; background: #3c4e7f; }
.summary-sheet { width: calc(100% - 70px); margin: 28px auto 0; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 14px 35px rgba(22, 51, 43, 0.08); }
.sheet-head { display: flex; align-items: center; gap: 9px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sheet-head img { width: 28px; height: 28px; border-radius: 9px; }
.sheet-head strong { font-size: 14px; }
.sheet-head small { margin-left: auto; padding: 4px 8px; border-radius: 999px; color: var(--mint-ink); background: var(--mint-soft); font-size: 10px; font-weight: 700; }
.summary-group { margin-top: 22px; }
.summary-group span { color: var(--mint-ink); font-size: 11px; font-weight: 700; }
.summary-group p { margin-top: 7px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.task-lines { display: grid; gap: 10px; margin-top: 22px; }
.task-lines i { width: 84%; height: 8px; border-radius: 999px; background: var(--surface-soft); }
.task-lines i:nth-child(2) { width: 94%; }
.task-lines i:nth-child(3) { width: 65%; }

.code-demo { min-height: 480px; color: #dce3f4; background: #151923; }
.code-demo .demo-bar { border-color: rgba(255,255,255,.08); background: #1b202c; }
.editor-grid { display: grid; grid-template-columns: 120px 1fr; min-height: 434px; }
.editor-grid aside { display: flex; flex-direction: column; gap: 4px; padding: 22px 12px; border-right: 1px solid rgba(255,255,255,.08); color: #8792a8; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.editor-grid aside b { margin-bottom: 10px; color: #b5bed0; font-weight: 650; text-transform: uppercase; }
.editor-grid aside span { padding: 5px 7px; border-radius: 6px; }
.editor-grid aside .active { color: #dfe5f1; background: #292f3d; }
.editor { min-width: 0; }
.editor-tabs { display: flex; height: 42px; align-items: center; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.08); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.editor-tabs em { margin-left: auto; padding: 4px 7px; border: 1px solid #8291d7; border-radius: 999px; color: #b8c3ff; font-style: normal; font-size: 9px; }
.editor pre { padding: 38px 22px 24px; overflow: auto; font: 12px/2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.editor code { display: grid; grid-template-columns: 22px minmax(max-content, 1fr); }
.line-num { color: #596377; user-select: none; }
.plain { color: #bdc7d9; }
.minus { color: #f0a5ac; background: rgba(182,67,80,.15); }
.plus { color: #9ee3bf; background: rgba(62,151,108,.16); }
.review-strip { display: flex; align-items: center; gap: 10px; margin: 46px 20px 0; padding: 13px 15px; border: 1px solid rgba(145,170,247,.24); border-radius: 12px; color: #cdd5ff; background: rgba(145,170,247,.08); font-size: 11px; }
.review-dot { width: 8px; height: 8px; border-radius: 50%; background: #9db0ff; box-shadow: 0 0 0 5px rgba(157,176,255,.1); }

.access { padding-bottom: clamp(90px, 12vw, 160px); }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.access-card { display: flex; min-height: 280px; flex-direction: column; align-items: flex-start; padding: clamp(28px, 4vw, 42px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.access-card > div { display: flex; align-items: center; gap: 16px; }
.access-card > div strong { font-size: 18px; }
.access-card p { max-width: 44ch; margin-top: 28px; color: var(--muted); }
.access-card .button { margin-top: auto; }

.support { padding-block: 54px; border-block: 1px solid var(--line); background: var(--surface); }
.support-inner { display: grid; grid-template-columns: 0.55fr 1.15fr auto; align-items: center; gap: 42px; }
.support-brand { display: flex; align-items: center; gap: 16px; }
.support-brand img { width: 92px; }
.qim-logos { position: relative; display: block; width: 92px; height: 31px; }
.qim-logos img { position: absolute; inset: 0; }
.qim-logo-dark { display: none; }
html[data-theme="dark"] .qim-logo-light { display: none; }
html[data-theme="dark"] .qim-logo-dark { display: block; }
.support-brand > span:last-child { padding-left: 16px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 14px; font-weight: 700; }
.support-copy h2 { font-size: 20px; }
.support-copy p { max-width: 60ch; margin-top: 7px; color: var(--muted); font-size: 14px; }
.text-button { padding: 11px 17px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 650; }

.site-footer { padding-block: 42px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-inner p { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13px; }
.footer-inner p strong { color: var(--ink); font-size: 16px; }
.footer-inner nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 24px; color: var(--muted); font-size: 12px; }
.footer-inner nav a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .site-header:not(.nav-ready) .site-menu { display: none; }
  .site-menu { position: absolute; top: calc(100% + 1px); right: 0; left: 0; display: none; padding: 20px var(--gutter) 24px; border-bottom: 1px solid var(--line); background: var(--paper); box-shadow: 0 18px 38px rgba(0,0,0,.09); }
  .site-header[data-open="true"] .site-menu { display: block; }
  .site-header[data-open="true"] .menu-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .site-header[data-open="true"] .menu-toggle span:nth-child(2) { opacity: 0; }
  .site-header[data-open="true"] .menu-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
  .main-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
  .main-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .header-tools { margin-top: 18px; }
  .portal-link { margin-right: auto; }
  .product-gates, .access-grid { grid-template-columns: 1fr; }
  .section-heading, .workflow-heading { grid-template-columns: 1fr; gap: 20px; }
  .workflow-heading > p:last-child { grid-column: auto; margin-top: 0; }
  .use-row { grid-template-columns: 1fr; }
  .workflow-example { grid-template-columns: 1fr; }
  .code-example .example-copy, .code-example .demo-window { order: initial; }
  .example-copy h3 { max-width: 18ch; }
  .support-inner { grid-template-columns: 1fr auto; }
  .support-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  :root { --gutter: 18px; --radius-xl: 28px; }
  .section { padding-block: 72px; }
  .hero { padding-top: 20px; }
  .hero-intro h1 { font-size: 4rem; }
  .hero-title { margin-top: 12px; font-size: 1.55rem; line-height: 1.12; }
  .hero-lead { margin-top: 6px; font-size: 0.92rem; }
  .product-gates { margin-top: 22px; }
  .product-gate { min-height: 0; padding: 25px; }
  .gate-top { display: block; }
  .product-gate h2 { margin-top: 14px; font-size: 2rem; }
  .status { position: static; display: inline-block; margin-top: 14px; }
  .gate-copy { margin-top: 18px; }
  .gate-actions { align-items: stretch; flex-direction: column; gap: 13px; margin-top: 24px; padding-top: 0; }
  .text-link { align-self: center; }
  .section-heading h2 { font-size: clamp(2.15rem, 11vw, 3.2rem); }
  .use-list { grid-template-columns: 1fr; gap: 8px; }
  .use-list article { padding: 22px 0; border-top: 1px solid var(--line); }
  .use-list h4 { margin-top: 12px; }
  .workflow-example { padding-block: 58px; }
  .demo-window { border-radius: 20px; }
  .ai-demo, .code-demo { min-height: 410px; }
  .summary-sheet { width: calc(100% - 34px); }
  .editor-grid { grid-template-columns: 76px 1fr; min-height: 364px; }
  .editor-grid aside { padding: 16px 7px; }
  .editor pre { padding: 30px 13px 20px; font-size: 10px; }
  .review-strip { margin: 28px 12px 0; }
  .support-inner { grid-template-columns: 1fr; gap: 22px; }
  .support-brand { grid-column: auto; }
  .text-button { width: fit-content; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .footer-inner nav { justify-content: flex-start; gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
