:root {
  --bg: #F3F7FE;
  --bg-panel: #FFFFFF;
  --bg-panel-2: #E9EFF9;
  --border: #DCE3EF;
  --border-strong: #C4CFE0;
  --accent: #1E5FC4;
  --accent-dark: #164A9C;
  --text: #1F2A37;
  --text-muted: #5B6778;
  --text-faint: #8C97A8;
  --star: #B7C1D1;
  --success: #2E8B57;
  --warn: #B7791F;
  --error: #C4382F;
  --label: #A8362D;
  --mark: #FFE27A;
  --on-accent: #FFFFFF;
  --clear: transparent;
  --veil: rgba(31,42,55,.24);

  --font-display: "Inter","Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --font-body: "Inter","Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;

  --radius: 6px;
  --radius-sm: 4px;
  --radius-tick: 3px;
  --radius-mark: 2px;
  --radius-pip: 1px;
  --radius-round: 50%;
  --radius-pill: 999px;

  --shadow-hair: 0 1px 2px rgba(31,42,55,.04);
  --shadow-card: 0 1px 2px rgba(31,42,55,.05),0 3px 8px -2px rgba(31,42,55,.05);
  --shadow-window: 0 2px 4px rgba(31,42,55,.04),0 20px 44px -18px rgba(31,42,55,.18),0 56px 110px -36px rgba(22,74,156,.20);
  --shadow-sheet: 0 10px 30px -14px rgba(31,42,55,.14);
  --shadow-btn: 0 1px 0 rgba(22,74,156,.45),0 8px 18px -8px rgba(30,95,196,.60);
  --shadow-pointer: drop-shadow(0 2px 3px rgba(31,42,55,.22));
  --ring: 0 0 0 3px rgba(30,95,196,.28);

  --nav-h: 72px;
  --nav-h-small: 60px;
  --nav-width: 1360px;
  --wrap: 1120px;
  --hero-width: 1360px;
  --reading: 74ch;
  --gutter: 40px;
  --section-space: clamp(48px,7vw,96px);
  --ease-out: cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
[hidden] { display: none !important; }
:where(img,svg,video) { max-width: 100%; }
:where(button,input,select,textarea) { font: inherit; }
:where(a,button,summary,input,select,textarea,[tabindex]):focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
  border-radius: var(--radius);
}
a { color: var(--accent); text-decoration-thickness: .12em; text-underline-offset: .16em; }
a:hover { color: var(--accent-dark); }
:where(h1,h2,h3) {
  margin: 0 0 .55em;
  font-family: var(--font-display);
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(34px,3.4vw,48px); font-weight: 900; line-height: 1.15; }
h2 { font-size: clamp(24px,2.6vw,36px); font-weight: 900; line-height: 1.2; }
h3 { font-size: clamp(18px,1.8vw,22px); font-weight: 800; line-height: 1.35; }
p { margin: 0 0 1em; }
:where(section,h2,h3,article)[id] { scroll-margin-block-start: 5rem; }
.nowrap { white-space: nowrap; }
code, pre, kbd, samp { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  min-width: 0;
  margin: 0 0 1em;
  padding: 1em;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  white-space: pre;
  overflow-wrap: normal;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: .875rem;
}
pre code { overflow-wrap: normal; }
mark {
  background: var(--mark);
  color: var(--text);
  padding: .04em .12em;
  border-radius: var(--radius-mark);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}
.sec { padding-block: var(--section-space); }
.prose { width: 100%; max-width: var(--reading); min-width: 0; line-height: 1.85; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose li + li { margin-top: .4em; }
.muted { color: var(--text-muted); }
.meta { font: .8125rem/1.55 var(--font-mono); color: var(--text-muted); }
.decor-frame { position: relative; overflow-x: clip; }
.decor-fill { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
:where(.hero-grid,.wb-grid,.rel-grid,.letter-grid,.card-grid,.footer-grid,.swatch-grid) > * { min-width: 0; }
:where(.dot,.icon,.brand-mark,.btn svg,.tools svg,.dl-fab svg) { flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  max-width: 100%;
  padding: 8px 22px;
  border: 0;
  border-radius: var(--radius);
  font-size: 15.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s,border-color .18s,transform .18s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.btn-primary:is(:hover,.is-hover) { background: var(--accent-dark); color: var(--on-accent); }
.btn-ghost {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}
.btn-ghost:is(:hover,.is-hover) { border-color: var(--text); color: var(--text); }
.btn:is(:focus-visible,.is-focus) { box-shadow: var(--ring); }
.btn:is(:active,.is-pressed) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--bg-panel-2);
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.masthead {
  position: relative;
  z-index: 30;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.mast-inner {
  width: 100%;
  max-width: min(100%,calc(var(--nav-width) + var(--gutter) * 2));
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: stretch;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.brand:hover { color: var(--text); text-decoration: underline; }
.mast-inner .brand { flex-shrink: 0; white-space: nowrap; }
.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-card);
}
.tabs { display: flex; min-width: 0; margin-left: auto; }
.tabs ul {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tabs li { display: flex; height: 100%; }
.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  padding-inline: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .2s;
}
.tabs a::after {
  content: "";
  position: absolute;
  inset: auto 10px -1px;
  height: 3px;
  border-radius: var(--radius-tick) var(--radius-tick) 0 0;
  background: var(--border-strong);
  color: var(--text);
  transform: scaleX(0);
  transition: transform .25s var(--ease-out);
}
.tabs a:is(:hover,[aria-current="page"]) { color: var(--text); }
.tabs a:is(:hover,[aria-current="page"])::after { transform: scaleX(1); }
.tabs a[aria-current="page"]::after { background: var(--accent); color: var(--on-accent); }
.tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lang-box { position: relative; }
.lang, .nav-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  font: 600 13.5px/1 var(--font-body);
  cursor: pointer;
  box-shadow: var(--shadow-hair);
  white-space: nowrap;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
.lang svg { width: 15px; height: 15px; color: var(--text-muted); }
.caret-down { color: var(--text-muted); font-size: 11px; }
.lang-short, .nav-toggle, .nav-drawer, .preview-drawer { display: none; }
.lang-list {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  z-index: 2;
  min-width: 150px;
  max-width: calc(100vw - var(--gutter) * 2);
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  background: var(--bg-panel);
  color: var(--text);
}
.lang-list a, .nav-drawer a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius);
}
.lang-list a[aria-current], .nav-drawer a[aria-current] {
  background: var(--bg-panel-2);
  color: var(--text);
  font-weight: 700;
}
html.nav-open { overflow: hidden; }
.nav-veil { position: fixed; z-index: 29; inset: 0; background: var(--veil); color: var(--text); }

.card, .panel {
  min-width: 0;
  padding: clamp(16px,2.2vw,28px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.panel { background: var(--bg-panel-2); color: var(--text); }
:where(.card,.panel) > :last-child { margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.site-foot { border-top: 1px solid var(--border); padding-block: 46px 22px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.5fr .8fr; gap: 24px; }
.footer-brand p { margin-top: 12px; color: var(--text-muted); }
.foot-heading { margin: 0 0 10px; font-size: 15px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li + li { margin-top: 5px; }
.footer-links a, .foot-bottom a { font-size: 14px; }
.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-block-start: 28px;
  padding-block-start: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.reveal-watch .reveal {
  transition: opacity .45s var(--ease-out),transform .45s var(--ease-out);
}
.reveal-watch .reveal:not(.shown):not(:focus-within):not(:target) {
  opacity: 0;
  transform: translateY(10px);
}
@media (max-width: 1400px) {
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .mast-inner .tabs { display: none; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .tools { margin-left: auto; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .nav-toggle { display: inline-flex; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .nav-drawer:not([hidden]) { display: block; }
}
.nav-toggle { min-width: 44px; min-height: 44px; padding-inline: 8px; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-drawer {
  position: absolute;
  inset: 100% 0 auto;
  max-height: calc(100vh - var(--nav-h));
  max-height: calc(100dvh - var(--nav-h));
  padding: 10px var(--gutter) 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-block-end: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.nav-drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer-heading { margin: 12px 12px 4px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 1100px) {
  :root { --nav-h: var(--nav-h-small); }
  .mast-inner { align-items: center; gap: 10px; }
  .mast-inner .tabs { display: none; }
  .tools { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  .nav-drawer:not([hidden]), .preview-drawer { display: block; }
}
@media (max-width: 768px) {
  :root { --gutter: 20px; }
  h1 { font-size: clamp(24px,5.5vw,30px); }
  .card-grid, .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .tilt, .tilt-decoration { transform: none; rotate: none; }
  .mast-inner .brand { font-size: 15px; gap: 7px; }
  .mast-inner .brand-mark { width: 30px; height: 30px; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .lang { min-height: 44px; padding-inline: 9px; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .mast-inner .brand span { white-space: normal; line-height: 1.2; }
  html:not([lang="zh-CN"]):not([lang="zh-TW"]) .mast-inner .brand { min-width: 0; flex-shrink: 1; }
}
@media (max-width: 500px) {
  .card-grid { grid-template-columns: minmax(0,1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal-watch .reveal:not(.shown) { opacity: 1; transform: none; }
}