:root {
  --bg: #f6f5f2;
  --bg-panel: #ffffff;
  --bg-panel-2: #1e1b1a;
  --bg-sunk: #ecebe7;
  --border: #e3e1dc;
  --border-strong: #d4d1ca;
  --accent: #0a61ef;
  --accent-dark: #0848bd;
  --accent-soft: rgba(10, 97, 239, 0.09);
  --accent-edge: rgba(10, 97, 239, 0.55);
  --text: #1e1b1a;
  --text-muted: #625e58;
  --text-faint: #96918a;
  --success: #1f8a5b;
  --warn: #e8714e;
  --error: #c8352b;
  --on-accent: #ffffff;
  --on-dark: #f6f5f2;
  --on-dark-muted: rgba(246, 245, 242, 0.74);
  --on-dark-line: rgba(246, 245, 242, 0.14);
  --device: #1e1b1a;
  --device-edge: #3b3735;
  --device-lens: #2c2927;
  --grid-line: rgba(30, 27, 26, 0.045);
  --grid-fade: rgba(0, 0, 0, 1);
  --grid-clear: rgba(0, 0, 0, 0);
  --veil: rgba(30, 27, 26, 0.32);

  --font-display: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --tracking-display: -0.025em;
  --tracking-cjk: -0.02em;
  --tracking-body: -0.005em;
  --size-body: 16px;
  --size-small: 14px;
  --size-caption: 12px;
  --size-h1: clamp(34px, calc(2.2vw + 16px), 48px);
  --size-h2: clamp(26px, 3vw, 36px);
  --size-h3: 22px;
  --leading-body: 1.6;
  --leading-title: 1.14;

  --radius-xl: 24px;
  --radius-device-lg: 22px;
  --radius-device-sm: 34px;
  --radius-screen: 27px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-shot: 10px;
  --radius-xs: 8px;
  --radius-pill: 999px;
  --radius-circle: 50%;
  --shadow-soft: 0 1px 2px rgba(30, 27, 26, 0.05), 0 10px 28px -12px rgba(30, 27, 26, 0.14);
  --shadow-back: 0 1px 2px rgba(30, 27, 26, 0.06), 0 18px 40px -18px rgba(30, 27, 26, 0.28), 0 40px 70px -40px rgba(30, 27, 26, 0.22);
  --shadow-front: 0 2px 4px rgba(30, 27, 26, 0.08), 0 22px 44px -10px rgba(30, 27, 26, 0.34), 0 52px 80px -30px rgba(30, 27, 26, 0.30);
  --shadow-button: 0 1px 1px rgba(8, 72, 189, 0.20), 0 8px 18px -8px rgba(10, 97, 239, 0.55);
  --nav-h: 72px;
  --strip-h: 40px;
  --gutter: max(32px, calc((100vw - 1280px) / 2));
  --wrap-gutter: clamp(20px, 4vw, 40px);
  --reading-width: 780px;
  --content-width: 1200px;
  --space-section: clamp(64px, 8vw, 112px);
  --motion-fast: 200ms;
  --motion-reveal: 600ms;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
html.nav-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body, main, section, article, aside, nav, header, footer, div { min-width: 0; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: 1.25;
  letter-spacing: var(--tracking-cjk);
  text-wrap: balance;
}
h1 { font-size: var(--size-h1); line-height: var(--leading-title); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: var(--accent-soft); }
button { color: var(--text); }
img { max-width: 100%; }
svg { display: block; flex-shrink: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-xs); }
::selection { background: var(--accent); color: var(--on-accent); }
code { font-family: var(--font-mono); font-size: .9em; overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--size-small);
  line-height: 1.8;
  tab-size: 2;
}
pre code { font-size: inherit; overflow-wrap: normal; white-space: pre; }
strong { font-weight: var(--weight-medium); }
.wrap { width: 100%; max-width: var(--content-width); margin-inline: auto; padding-inline: var(--wrap-gutter); }
.reading { max-width: var(--reading-width); margin-inline: auto; }
.section { padding-top: var(--space-section); padding-bottom: var(--space-section); }
.section__head { max-width: 720px; margin-bottom: 40px; }
.section__head p { margin-top: 16px; color: var(--text-muted); }
.stack > * + * { margin-top: 24px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-two > *, .grid-three > * { min-width: 0; }
.keep { white-space: nowrap; }
.muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }
.text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.text-link:hover { color: var(--accent-dark); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: 8px;
  left: 16px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-xs);
}
.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.prose { min-width: 0; line-height: 1.85; }
.prose > * + * { margin-top: 24px; }
.prose h2 { margin-top: 64px; }
.prose h3 { margin-top: 36px; }
.prose p, .prose li { overflow-wrap: break-word; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li + li { margin-top: 10px; }
.prose a:not(.btn):not(.store-button) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose code:not(pre code) { background: var(--bg-sunk); color: var(--text); border-radius: var(--radius-xs); }
.prose figure { margin-inline: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 26px;
  border: 1px solid var(--grid-clear);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-body);
  line-height: 1.4;
  text-align: center;
  transition: background-color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn--store { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-button); }
.btn--store:hover, .btn--store.is-hover { background: var(--accent-dark); color: var(--on-accent); }
.btn--store:active { transform: translateY(1px); }
.btn--line { background: var(--bg-panel); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-soft); }
.btn--line:hover { border-color: var(--border-strong); }
.btn--line svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn--line:hover svg { transform: translateX(3px); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--bg-sunk); color: var(--text-muted); border-color: var(--border); box-shadow: none; cursor: not-allowed; transform: none; }
.btn.is-focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.card, .panel { background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); padding: 32px; }
.card p, .panel p { margin-top: 14px; color: var(--text-muted); }

.topbar { position: relative; z-index: 40; height: var(--nav-h); background: var(--bg-panel); color: var(--text); border-bottom: 1px solid var(--border); }
.topbar__inner {
  position: relative;
  z-index: 31;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
  width: 100%;
  max-width: min(100%, calc(1280px + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brandmark { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; font-size: var(--size-body); font-weight: var(--weight-medium); letter-spacing: -.01em; }
.brandmark__logo { display: block; width: 32px; height: 32px; border-radius: var(--radius-circle); flex-shrink: 0; }
.brandmark__slot { display: block; width: 32px; height: 32px; border-radius: var(--radius-xs); background: var(--bg-panel); color: var(--text); border: 1px solid var(--border-strong); box-shadow: inset 0 0 0 4px var(--bg-panel), inset 0 0 0 5px var(--accent-soft); flex-shrink: 0; }
.navrail { margin-left: auto; min-width: 0; height: 100%; }
.navrail__list { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; height: 100%; gap: 0; }
.navrail__list li { height: 100%; }
.navrail__link { position: relative; height: 100%; display: inline-flex; align-items: center; gap: 7px; padding-inline: 12px; font-size: 15px; color: var(--text-muted); white-space: nowrap; transition: color var(--motion-fast) var(--ease); }
.navrail__link svg, .header-tools svg, .mobile-drawer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.navrail__link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); transform: scaleX(0); transition: transform var(--motion-fast) var(--ease); }
.navrail__link:hover, .navrail__link[aria-current="page"] { color: var(--text); }
.navrail__link[aria-current="page"] svg { color: var(--accent); }
.navrail__link[aria-current="page"]::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.language-control { position: relative; }
.langpick { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-panel); color: var(--text); font-size: var(--size-small); white-space: nowrap; }
.langpick svg, .langpick__caret { color: var(--text-muted); }
.langpick__caret { font-size: 11px; }
.langpick__short { display: none; }
.language-menu { position: absolute; z-index: 3; right: 0; top: calc(100% + 12px); min-width: 190px; padding: 8px; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-soft); }
.language-menu a { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-xs); }
.language-menu a:hover, .language-menu a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-dark); }
.menu-toggle { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-panel); color: var(--text); }
.menu-toggle svg { width: 22px; height: 22px; }
.mobile-drawer { display: none; }
.nav-veil { position: fixed; z-index: 30; inset: var(--nav-h) 0 0; border: 0; background: var(--veil); color: var(--on-dark); }
.preview-mobile { display: none; }

.site-footer { background: var(--bg-panel); color: var(--text); border-top: 1px solid var(--border); padding-top: 64px; padding-bottom: 28px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr 1fr; gap: 48px; }
.footer-brand p { max-width: 28em; margin-top: 20px; color: var(--text-muted); font-size: var(--size-small); }
.footer-title { font-size: var(--size-body); margin-bottom: 18px; }
.footer-links { list-style: none; display: grid; gap: 10px; font-size: var(--size-small); color: var(--text-muted); }
.footer-links a { display: inline-block; padding-block: 4px; }
.footer-links a:hover { color: var(--accent); }
.footer-languages { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: var(--size-small); color: var(--text-muted); }
.footer-languages a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-languages a[aria-current="true"] { color: var(--accent); }
.footer-bottom { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: var(--size-caption); color: var(--text-muted); }
.reveal { opacity: 1; transform: none; }
html.reveal-ready .reveal:not(.shown) { opacity: 0; transform: translateY(18px); }
html.reveal-ready .reveal { transition: opacity var(--motion-reveal) var(--ease), transform var(--motion-reveal) var(--ease); }
.reveal.shown { opacity: 1; transform: none; }
.decorated, .hero, .storeband { overflow-x: clip; }

@media (max-width: 1400px) {
  .topbar__inner { gap: 16px; }
  .navrail__link { padding-inline: 9px; font-size: var(--size-small); }
  .navrail__link::after { left: 9px; right: 9px; }
}
@media (max-width: 1279px) {
  .topbar__inner { padding-inline: 24px; }
  .navrail { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: inline-flex; }
  .mobile-drawer {
    display: block;
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    top: 100%;
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text);
    box-shadow: var(--shadow-soft);
  }
  .mobile-drawer ul { list-style: none; }
  .mobile-drawer a { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px 16px; border-radius: var(--radius-xs); }
  .mobile-drawer a:hover, .mobile-drawer a[aria-current] { background: var(--accent-soft); color: var(--accent-dark); }
  .mobile-drawer__languages { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
  .mobile-drawer__title { padding: 8px 16px; color: var(--text-muted); font-size: var(--size-small); }
  .preview-mobile { display: block; }
  .preview-mobile summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--bg-panel); color: var(--text); cursor: pointer; }
  .preview-mobile summary::-webkit-details-marker { display: none; }
  .preview-mobile nav { position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; background: var(--bg-panel); color: var(--text); padding: 16px 24px; border-bottom: 1px solid var(--border); }
  .preview-mobile nav a { display: flex; align-items: center; min-height: 48px; padding: 12px 16px; }
}
@media (max-width: 768px) {
  :root { --size-h1: clamp(24px, 4.6vw, 30px); }
  .grid-two, .grid-three { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --nav-h: 60px; --gutter: 20px; --wrap-gutter: 20px; }
  .topbar__inner { padding-inline: 16px; gap: 12px; }
  .brandmark__text { display: none; }
  .header-tools { margin-left: auto; }
  .langpick { min-height: 36px; padding-inline: 12px; }
  .langpick__full { display: none; }
  .langpick__short { display: inline; }
  .btn { min-height: 50px; padding: 12px 20px; font-size: 15px; }
  .card, .panel { padding: 24px; }
  pre { padding: 18px; }
  .tilt, [data-tilt] { transform: none !important; }
  .footer-grid { gap: 28px 20px; }
  .footer-brand .brandmark__text { display: inline; }
  .footer-brand .brandmark { font-size: var(--size-small); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.reveal-ready .reveal:not(.shown) { opacity: 1; transform: none; }
}