/* Psycho Icons — site styles
 * Visual language mirrors Energy Icons: calm neutral surfaces, compact 13px UI,
 * a saturated hero, a grouped sidebar, and a dense but quiet icon grid.
 */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Montserrat:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-zh: 'Noto Sans SC', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', 'DengXian', 'Source Han Sans SC', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', sans-serif;

  --bg: #f7f6f3;
  --sidebar: #f8f8f8;
  --sidebar-hover: #efefef;
  --surface: #fdfcfa;
  --hover: #efeee9;
  --line: #e6e4de;
  --fg: #1b1a18;
  --fg-muted: #6f6c65;
  --fg-subtle: #a19e96;
  --accent: #6d4aff;
  --accent-soft: rgba(109, 74, 255, .09);
  --accent-ring: rgba(109, 74, 255, .45);
  --primary: #111;
  --primary-fg: #fff;
  --hero-a: #3b1ec2;
  --hero-b: #6d4aff;
  --dot: rgba(255, 255, 255, .16);
  --shadow: 0 12px 32px rgba(20, 20, 19, .09);
  --shadow-lg: 0 24px 70px rgba(20, 20, 19, .18);
}

html.dark {
  --bg: #141413;
  --sidebar: #1c1c1a;
  --sidebar-hover: #262624;
  --surface: #1b1b19;
  --hover: #232321;
  --line: #2a2a27;
  --fg: #ecebe7;
  --fg-muted: #a09d96;
  --fg-subtle: #6d6b65;
  --accent: #9b86ff;
  --accent-soft: rgba(155, 134, 255, .15);
  --accent-ring: rgba(155, 134, 255, .6);
  --primary: #f2f1ed;
  --primary-fg: #111;
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.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; }

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(circle, var(--dot) 1.15px, transparent 1.15px);
  background-size: 22px 22px;
  background-position: 8px 8px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 40%, transparent 100%);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 60% 55% at 50% 52%, rgba(0, 0, 0, .13), transparent 70%);
}
.hero-nav {
  position: relative;
  width: 100%;
  max-width: 1240px;
  height: 62px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(6px);
}
.brand-mark svg { width: 20px; height: 20px; }
.hero-nav-links { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 500; }
.hero-nav-links a { opacity: .82; transition: opacity .15s; }
.hero-nav-links a:hover { opacity: 1; }
.nav-github {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  font-size: 12px; font-weight: 600;
}
.nav-github:hover { background: rgba(255,255,255,.24); }
.nav-github svg { width: 14px; height: 14px; }

.hero-body {
  position: relative;
  width: 100%;
  max-width: 1240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 24px 70px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  margin-bottom: 26px;
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: #b6ffd9; }
.hero h1 {
  margin: 0;
  font-size: clamp(52px, 9.2vw, 116px);
  line-height: .94;
  font-weight: 800;
  letter-spacing: -.065em;
  text-wrap: balance;
}
.hero-sub {
  max-width: 620px;
  margin: 24px auto 0;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 1.5;
  letter-spacing: -.02em;
  color: rgba(255,255,255,.86);
}
.hero-sub strong { color: #fff; font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  border: 1px solid transparent;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; }
.btn-white { background: #fff; color: #2a1597; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.btn-white:hover { box-shadow: 0 12px 30px rgba(0,0,0,.24); }
.btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.hero-meta {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .04em;
  color: rgba(255,255,255,.68);
}
.hero-meta span { color: #fff; }

.float-icon {
  position: absolute;
  width: 74px; height: 74px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: 0 12px 30px rgba(0,0,0,.14);
  backdrop-filter: blur(3px);
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}
.float-icon svg { width: 42px; height: 42px; color: #fff; stroke-width: 1.7; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(var(--rot, 0deg)); } 50% { transform: translateY(-12px) rotate(var(--rot, 0deg)); } }
.float-icon:nth-of-type(1) { top: 20%; left: 5%; --rot: -7deg; animation-delay: 0s; }
.float-icon:nth-of-type(2) { top: 55%; left: 11%; --rot: 6deg; animation-delay: 1.1s; }
.float-icon:nth-of-type(3) { top: 12%; right: 9%; --rot: 8deg; animation-delay: .5s; }
.float-icon:nth-of-type(4) { top: 58%; right: 5%; --rot: -6deg; animation-delay: 1.7s; }
.float-icon:nth-of-type(5) { top: 76%; left: 24%; --rot: 4deg; animation-delay: 2.3s; width: 58px; height: 58px; }
.float-icon:nth-of-type(5) svg { width: 32px; height: 32px; }
.float-icon:nth-of-type(6) { top: 78%; right: 25%; --rot: -5deg; animation-delay: 1.4s; width: 58px; height: 58px; }
.float-icon:nth-of-type(6) svg { width: 32px; height: 32px; }

/* ----------------------------- Browser shell ----------------------------- */
.browser {
  display: flex;
  min-height: calc(100vh - 40px);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.sidebar {
  width: 236px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar-inner { padding: 16px 12px 8px; flex: 1; }
.side-group { margin-bottom: 20px; }
.side-label {
  padding: 0 8px; margin-bottom: 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-subtle);
}
.side-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 29px; padding: 0 8px; border-radius: 6px;
  color: var(--fg-muted); font-size: 12.5px;
  transition: background .12s, color .12s;
  border: 0; background: none; width: 100%; text-align: left;
}
.side-link:hover { background: var(--sidebar-hover); color: var(--fg); }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link .count { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-subtle); }
.side-link.active .count { color: var(--accent); }
.side-link .zh { font-size: 10px; color: var(--fg-subtle); margin-left: auto; }
.side-link.active .zh { color: var(--accent); opacity: .8; }
.sidebar-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--fg-subtle);
  line-height: 1.7;
}
.sidebar-foot a { color: var(--fg-muted); text-decoration: underline; text-underline-offset: 2px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.toolbar {
  position: sticky; top: 0; z-index: 20;
  min-height: 54px;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 16px;
  padding: 8px 14px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 7px;
  background: none; color: var(--fg-muted);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; }
.search-wrap { position: relative; display: flex; align-items: center; flex: 1; min-width: 190px; max-width: 380px; }
.search-wrap > svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--fg-subtle); pointer-events: none; }
.search-wrap input {
  width: 100%; height: 32px;
  padding: 0 12px 0 34px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--fg);
  font-size: 12.5px; outline: none;
}
.search-wrap input::placeholder { color: var(--fg-subtle); }
.search-wrap input:hover { background: var(--hover); }
.search-wrap input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.kbd {
  position: absolute; right: 9px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg-subtle);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; pointer-events: none;
}
.tool-divider { width: 1px; height: 18px; background: var(--line); flex-shrink: 0; }
.size-control { display: flex; align-items: center; gap: 10px; }
.size-control input[type=range] { width: 120px; accent-color: var(--accent); cursor: pointer; }
.size-output {
  min-width: 34px; height: 24px; padding: 0 5px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
}
.size-unit { font-size: 11px; color: var(--fg-subtle); }
.master-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px; font-weight: 500; color: var(--fg-muted); white-space: nowrap;
}
.master-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.weight-switch {
  display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px;
  height: 30px; padding: 2px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg);
}
.weight-switch button {
  border: 0; border-radius: 999px; background: none;
  padding: 0 12px; font-size: 11.5px; color: var(--fg-muted); white-space: nowrap;
}
.weight-switch button.active { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.tool-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.result-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-subtle); white-space: nowrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 13px; border: 0; border-radius: 999px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.btn-primary:hover { opacity: .86; }
.btn-primary svg { width: 14px; height: 14px; }

/* ----------------------------- Grid ----------------------------- */
.grid-head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 24px 24px 6px;
}
.grid-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.03em; }
.grid-head p { margin: 0; font-size: 12px; color: var(--fg-muted); }
.grid-head .zh { color: var(--fg-subtle); }
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cell, 108px), 1fr));
  gap: 10px;
  padding: 14px 24px 60px;
}
.icon-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 8px 4px 6px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  transition: border-color .12s, transform .12s, box-shadow .12s, background .12s;
}
.icon-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); background: var(--surface); }
.icon-card .glyph { display: grid; place-items: center; flex: 1; min-height: 0; }
.icon-card .glyph svg { width: var(--icon-size, 32px); height: var(--icon-size, 32px); color: var(--fg); }
.icon-card .name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10.5px; color: var(--fg-muted); letter-spacing: -.01em;
}
.icon-card:hover .name { color: var(--fg); }
.icon-card .quick {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 3px; opacity: 0; transform: translateY(-3px);
  transition: opacity .12s, transform .12s;
}
.icon-card:hover .quick, .icon-card:focus-within .quick { opacity: 1; transform: none; }
.quick button {
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--fg-muted);
}
.quick button:hover { color: var(--accent); border-color: var(--accent); }
.quick button svg { width: 13px; height: 13px; }
.empty-state { grid-column: 1 / -1; padding: 90px 20px; text-align: center; color: var(--fg-muted); }
.empty-state h3 { margin: 0 0 8px; font-size: 16px; color: var(--fg); }
.empty-state p { margin: 0; font-size: 12.5px; }

/* ----------------------------- Detail drawer ----------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 14, 13, .38);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(390px, 100vw);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .24s cubic-bezier(.22,.8,.3,1);
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--fg-subtle); letter-spacing: .04em; text-transform: uppercase;
}
.drawer-body { padding: 20px; }
.preview {
  height: 190px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); margin-bottom: 20px;
}
.preview svg { width: 96px; height: 96px; color: var(--fg); }
.detail-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.035em; word-break: break-word; }
.detail-zh { margin: 4px 0 0; font-size: 12.5px; color: var(--fg-muted); }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-row span:first-child { color: var(--fg-subtle); }
.detail-row span:last-child { color: var(--fg); font-weight: 500; text-align: right; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { padding: 3px 8px; border-radius: 999px; background: var(--hover); color: var(--fg-muted); font-size: 10.5px; }
.code-label { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 7px; font-size: 11px; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: .05em; }
.code-box {
  max-height: 132px; overflow: auto; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg-muted);
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1.65;
  word-break: break-all; white-space: pre-wrap;
}
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.detail-actions .btn-primary, .detail-actions .btn-outline { justify-content: center; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--fg); font-size: 11.5px; font-weight: 600;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline svg { width: 14px; height: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 60;
  transform: translate(-50%, 16px);
  padding: 10px 16px; border-radius: 999px;
  background: var(--primary); color: var(--primary-fg);
  font-size: 12px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ----------------------------- Docs / footer ----------------------------- */
.docs-shell { max-width: 1180px; margin: 0 auto; display: flex; gap: 40px; padding: 40px 24px 90px; }
.docs-nav { width: 210px; flex-shrink: 0; position: sticky; top: 24px; align-self: flex-start; }
.docs-nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--fg-muted); font-size: 12.5px; }
.docs-nav a:hover { background: var(--hover); color: var(--fg); }
.docs-nav .side-label { padding: 0 10px; }
.docs-content { flex: 1; min-width: 0; }
.docs-content h1 { font-size: 34px; letter-spacing: -.05em; margin: 0 0 10px; }
.docs-content > p.lead { font-size: 14px; color: var(--fg-muted); line-height: 1.7; margin: 0 0 36px; }
.docs-content section { padding: 24px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.docs-content h2 { font-size: 19px; letter-spacing: -.035em; margin: 0 0 12px; }
.docs-content h3 { font-size: 13.5px; margin: 22px 0 8px; }
.docs-content p { font-size: 13px; line-height: 1.75; color: var(--fg-muted); margin: 0 0 12px; }
.docs-content ul { padding-left: 20px; color: var(--fg-muted); line-height: 1.9; font-size: 13px; }
.docs-content code { font-family: var(--font-mono); font-size: 11.5px; background: var(--hover); padding: 2px 5px; border-radius: 4px; color: var(--fg); }
.docs-content pre {
  padding: 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); overflow-x: auto;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7; color: var(--fg);
}
.docs-content pre code { background: none; padding: 0; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.spec-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.spec-card b { display: block; font-size: 17px; letter-spacing: -.03em; margin-bottom: 4px; }
.spec-card span { font-size: 11.5px; color: var(--fg-muted); }
.site-footer { border-top: 1px solid var(--line); padding: 26px 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--fg-subtle); }
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }
.docs-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ----------------------------- Bilingual ----------------------------- */
html.lang-zh [data-lang="en"],
html.lang-en [data-lang="zh"] { display: none !important; }

.lang-switch {
  display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px;
  height: 28px; padding: 2px;
  border: 1px solid rgba(255, 255, 255, .32); border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}
.lang-switch button {
  border: 0; border-radius: 999px; background: none;
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 0 9px; opacity: .72; letter-spacing: .02em;
}
.lang-switch button:hover { opacity: 1; }
.lang-switch button.active { background: #fff; color: #2a1597; opacity: 1; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.toolbar .lang-switch { height: 30px; border-color: var(--line); background: var(--bg); }
.toolbar .lang-switch button { color: var(--fg-muted); font-size: 11.5px; }
.toolbar .lang-switch button.active { background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px var(--line); }

/* Compact hero for documentation pages */
.hero.hero-compact { min-height: 250px; }
.hero-compact .hero-body { padding: 8px 24px 48px; }
.hero-compact h1 { font-size: clamp(44px, 6vw, 68px); }
.hero-compact .eyebrow { margin-bottom: 16px; }
.hero-compact .hero-sub { margin-top: 14px; font-size: 15px; }

/* Collapsed sidebar on wide screens */
body.hide-sidebar .sidebar { display: none; }

/* ----------------------------- Responsive ----------------------------- */
@media (max-width: 1080px) {
  .float-icon:nth-of-type(n+3) { display: none; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; height: 100vh; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .hero-nav-links a:not(.nav-github) { display: none; }
  .toolbar { gap: 8px 10px; }
  .tool-divider, .master-badge { display: none; }
  .size-control input[type=range] { width: 80px; }
  .float-icon { display: none; }
  .docs-nav { display: none; }
  .docs-shell { padding-top: 28px; }
}
@media (max-width: 620px) {
  .hero { min-height: 470px; }
  .hero h1 { font-size: 52px; }
  .tool-right { margin-left: 0; }
  .search-wrap { max-width: none; }
  .icon-grid { padding: 12px 14px 48px; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .grid-head { padding: 18px 14px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .float-icon { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Chinese typography
   The Latin UI was tuned at 13px with tight negative tracking.
   CJK glyphs need a real Chinese family, a larger scale, normal
   tracking and looser leading; numbers/code stay monospace.
   ============================================================ */
html.lang-zh body {
  font-family: var(--font-zh);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0;
  -webkit-font-smoothing: auto;
}
/* Latin wordmarks keep Montserrat and its tight display tracking */
html.lang-zh .brand,
html.lang-zh .hero h1 { font-family: var(--font-sans); }

html.lang-zh .hero-nav-links { font-size: 13.5px; letter-spacing: 0; }
html.lang-zh .nav-github { font-size: 12.5px; letter-spacing: 0; }
html.lang-zh .eyebrow,
html.lang-zh .hero-meta { font-family: var(--font-zh); font-size: 11.5px; letter-spacing: .08em; }
html.lang-zh .hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.85;
  letter-spacing: .01em;
}
html.lang-zh .hero-sub strong { font-weight: 700; }
html.lang-zh .btn { font-size: 14px; letter-spacing: .01em; }
html.lang-zh .hero-compact h1 {
  font-family: var(--font-zh);
  font-size: clamp(40px, 5.5vw, 62px);
  letter-spacing: .04em;
  font-weight: 700;
}
html.lang-zh .hero-compact .hero-sub { font-size: 16px; line-height: 1.8; letter-spacing: .01em; }

html.lang-zh .side-label { font-size: 11.5px; letter-spacing: .05em; }
html.lang-zh .side-link { font-size: 13.5px; letter-spacing: 0; }
html.lang-zh .side-link .count { font-size: 11px; }
html.lang-zh .sidebar-foot { font-size: 12px; line-height: 1.95; }

html.lang-zh .search-wrap input { font-size: 13.5px; letter-spacing: 0; }
html.lang-zh .size-unit { font-size: 11.5px; }
html.lang-zh .master-badge { font-size: 12px; letter-spacing: 0; }
html.lang-zh .weight-switch button { font-size: 12.5px; letter-spacing: 0; }
html.lang-zh .btn-primary { font-size: 12.5px; letter-spacing: 0; }
html.lang-zh .lang-switch button { font-size: 12px; }
html.lang-zh .toolbar .lang-switch button { font-size: 12px; }

html.lang-zh .grid-head h2 { font-size: 18px; letter-spacing: 0; }
html.lang-zh .grid-head p,
html.lang-zh .grid-head .zh { font-size: 13px; letter-spacing: 0; }
html.lang-zh .icon-card .name { font-size: 12px; letter-spacing: .01em; font-weight: 500; }
html.lang-zh .empty-state h3 { font-size: 18px; letter-spacing: 0; }
html.lang-zh .empty-state p { font-size: 13.5px; line-height: 1.8; }

html.lang-zh .drawer-head { font-size: 12px; letter-spacing: .04em; }
html.lang-zh .detail-title { font-size: 21px; letter-spacing: 0; }
html.lang-zh .detail-zh { font-size: 13px; }
html.lang-zh .detail-row { font-size: 13px; letter-spacing: 0; }
html.lang-zh .tag { font-size: 11.5px; letter-spacing: 0; }
html.lang-zh .code-label { font-size: 11.5px; letter-spacing: .04em; }
html.lang-zh .btn-outline { font-size: 12.5px; letter-spacing: 0; }
html.lang-zh .toast { font-size: 13px; letter-spacing: .01em; }

html.lang-zh .docs-nav a { font-size: 13.5px; letter-spacing: 0; }
html.lang-zh .docs-content h1 { font-family: var(--font-sans); font-size: 34px; letter-spacing: -.02em; }
html.lang-zh .docs-content > p.lead { font-size: 15px; line-height: 1.9; letter-spacing: .01em; }
html.lang-zh .docs-content h2 { font-size: 21px; letter-spacing: 0; }
html.lang-zh .docs-content h3 { font-size: 15px; letter-spacing: 0; }
html.lang-zh .docs-content p,
html.lang-zh .docs-content ul { font-size: 14px; line-height: 1.95; letter-spacing: .01em; }
html.lang-zh .docs-content li { margin-bottom: 4px; }
html.lang-zh .docs-content code { font-size: 12px; }
html.lang-zh .spec-card b { letter-spacing: 0; }
html.lang-zh .spec-card span { font-size: 12.5px; letter-spacing: 0; }
html.lang-zh .site-footer { font-size: 12.5px; letter-spacing: 0; }
