/* ==========================================================================
   MineTerra: Hydrosphere — Shared design system
   Strong Minecraft aesthetic · black primary · palette from the logo
   ========================================================================== */

/* ---------- 自托管字体（匹配你本地的 assets/fonts 文件夹结构） ---------- */
/* 1. Pixelify Sans 字体族 (4种字重) */
@font-face {
  font-family: 'Pixelify Sans';
  src: url('../fonts/Pixelify_Sans/static/PixelifySans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Pixelify Sans';
  src: url('../fonts/Pixelify_Sans/static/PixelifySans-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Pixelify Sans';
  src: url('../fonts/Pixelify_Sans/static/PixelifySans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'Pixelify Sans';
  src: url('../fonts/Pixelify_Sans/static/PixelifySans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* 2. Press Start 2P 字体族 (只有常规体，用于按钮和数字) */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/Press_Start_2P/PressStart2P-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}


/* ---------- Design tokens ---------- */
:root {
  /* Surface palette (black, slightly blue) */
  --bg:        #0a0c10;
  --bg-panel:  #12151b;
  --bg-card:   #181c24;
  --bg-elev:   #1f242e;
  --bg-hover:  #262c37;

  /* Text */
  --text:      #e6e9ee;
  --text-dim:  #9aa3af;
  --text-dimmer:#6b7280;

  /* Brand palette (from MTHydro_logo.svg) */
  --ocean-deep:#0b3d66;
  --ocean:     #1565a8;
  --ocean-light:#2f8fd0;
  --ice:       #cfe6f2;
  --grass:     #56a44a;
  --grass-dark:#3f8c3a;
  --grass-light:#7fbf5a;
  --sand:      #c9a85a;

  /* Borders / bevels */
  --border:    #2a313c;
  --border-light:#3a424f;
  --bevel-hi:  rgba(255,255,255,0.10);
  --bevel-lo:  rgba(0,0,0,0.55);
  --black:     #000000;

  /* Accents */
  --accent:    var(--ocean-light);
  --accent-2:  var(--grass);

  /* Fonts */
  --font-pixel: "Press Start 2P", "Pixelify Sans", monospace;
  --font-mc:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
  --font-body:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --header-h: 106px;   /* nav row 68px + dev banner ~38px */
  --content-max: 1180px;
  --radius: 0;                 /* hard MC edges by default */
  --shadow-block: 0 6px 0 0 rgba(0,0,0,0.45);
  --transition: 120ms ease;
}

/* In-development banner */
.dev-banner {
  background: rgba(201,168,90,0.14);
  border-bottom: 2px solid var(--sand);
  color: var(--sand);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 78% -8%, rgba(47,143,208,0.10), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgba(86,164,74,0.06), transparent 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><rect width='16' height='16' fill='none'/><rect width='8' height='8' fill='%23ffffff' fill-opacity='0.012'/><rect x='8' y='8' width='8' height='8' fill='%23ffffff' fill-opacity='0.012'/></svg>");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
img { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--ice); }
h1, h2, h3, h4 { font-family: var(--font-mc); font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: 0.5px; }

/* Page titles (page-hero h1) use Press Start 2P — double-wide font, so sizes are reduced.
   Content headings (markdown h1/h2 in .docs-main) stay in the body font. */
.page-hero h1 {
  font-family: var(--font-pixel);
  font-size: clamp(0.95rem, 3.6vw, 2rem);
  line-height: 1.55;
  letter-spacing: 0;
}

/* Static section titles in .prose (about / mod pages) also use Press Start 2P.
   Markdown content headings (.docs-main) stay in the body font. */
.docs-main h1 {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3.6vw, 1.6rem);
  line-height: 1.55;
  letter-spacing: 0;
}
.docs-main h2 {
  font-family: var(--font-pixel);
  font-size: clamp(0.85rem, 2.4vw, 1.1rem);
  line-height: 1.55;
  letter-spacing: 0;
}
.prose:not(.docs-main) h2,
h2.h-pixel {
  font-family: var(--font-pixel);
  font-size: clamp(0.9rem, 2.6vw, 1.35rem);
  line-height: 1.55;
  letter-spacing: 0;
}
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin: 0.3em 0; }
code, pre, kbd { font-family: var(--font-pixel); font-size: 0.82em; }

/* Inline code gets a visible box (docs content; pre blocks excluded) */
.prose code {
  font-size: 0.65em;
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.06), inset -1px -1px 0 rgba(0,0,0,0.4);
  padding: 0.2em 0.5em;
  white-space: nowrap;
}
.prose pre code {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  white-space: pre;
}
strong { color: #fff; font-weight: 700; }
::selection { background: var(--ocean); color: #fff; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding-left: max(22px, env(safe-area-inset-left));
  padding-right: max(22px, env(safe-area-inset-right)); }
.section { padding: 84px 0; }
.section-tight { padding: 52px 0; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-title { margin-bottom: 0.2em; }
.section-lead { color: var(--text-dim); max-width: 62ch; margin-bottom: 1.6em; }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.pixel-divider {
  height: 4px; border: 0; margin: 0;
  background:
    repeating-linear-gradient(90deg,
      var(--ocean) 0 12px, transparent 12px 18px,
      var(--grass) 18px 24px, transparent 24px 30px,
      var(--sand) 30px 36px, transparent 36px 42px);
  opacity: 0.85;
}

/* ---------- Bevel utilities ---------- */
.bevel {
  box-shadow:
    inset 3px 3px 0 var(--bevel-hi),
    inset -3px -3px 0 var(--bevel-lo);
}
.bevel-strong {
  box-shadow:
    inset 4px 4px 0 var(--bevel-hi),
    inset -4px -4px 0 var(--bevel-lo),
    0 0 0 2px var(--black);
}

/* ---------- Buttons ---------- */
.mc-btn {
  --btn-bg: var(--bg-elev);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  line-height: 1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  padding: 1.05em 1.5em;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: transform 60ms ease, filter var(--transition), background var(--transition);
  box-shadow:
    inset 3px 3px 0 var(--bevel-hi),
    inset -3px -3px 0 var(--bevel-lo);
}
.mc-btn:hover { filter: brightness(1.12); color: var(--btn-fg); }
.mc-btn:active { transform: translateY(3px); box-shadow: inset 3px 3px 0 var(--bevel-lo); }
.mc-btn--primary { --btn-bg: var(--ocean); --btn-fg: #fff; }
.mc-btn--primary:hover { --btn-bg: var(--ocean-light); }
.mc-btn--grass   { --btn-bg: var(--grass-dark); --btn-fg: #eafbe6; }
.mc-btn--grass:hover { --btn-bg: var(--grass); }
.mc-btn--ghost   { --btn-bg: transparent; --btn-fg: var(--text); }
.mc-btn--ghost:hover { --btn-bg: var(--bg-hover); }
.mc-btn--lg { font-size: 0.78rem; padding: 1.2em 1.9em; }
.mc-btn--sm { font-size: 0.6rem; padding: 0.8em 1em; }
.mc-btn .ico { width: 14px; height: 14px; }

/* ---------- Cards / panels ---------- */
.mc-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  padding: 26px;
  box-shadow:
    inset 3px 3px 0 var(--bevel-hi),
    inset -3px -3px 0 var(--bevel-lo);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.mc-card--hover:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--bg-elev); }
.mc-card h3 { margin-top: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.5em 0.7em;
  color: var(--accent);
  background: rgba(47,143,208,0.10);
  border: 1px solid rgba(47,143,208,0.35);
}
.badge--grass { color: var(--grass-light); background: rgba(86,164,74,0.10); border-color: rgba(86,164,74,0.35); }
.badge--sand  { color: var(--sand); background: rgba(201,168,90,0.10); border-color: rgba(201,168,90,0.35); }
.badge--ice   { color: var(--ice); background: rgba(207,230,242,0.08); border-color: rgba(207,230,242,0.30); }

/* ---------- Pixel icon tile ---------- */
.icon-tile {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  background: var(--bg-elev);
  border: 2px solid var(--border-light);
  box-shadow:
    inset 2px 2px 0 var(--bevel-hi),
    inset -2px -2px 0 var(--bevel-lo);
}

/* ==========================================================================
   Header / navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,16,0.86);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 4px 0 rgba(0,0,0,0.35);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__logo { width: 38px; height: 38px; filter: drop-shadow(0 3px 0 rgba(0,0,0,0.5)); }
.brand__wordmark { font-family: var(--font-pixel); font-size: 0.82rem; letter-spacing: 1px; line-height: 1; }
.brand__wordmark b { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  font-family: var(--font-mc); font-weight: 600; font-size: 1.05rem;
  color: var(--text-dim);
  padding: 0.6em 0.85em;
  border: 2px solid transparent;
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--accent); }
.nav__cta { margin-left: 10px; }

.nav-toggle {
  display: none;
  background: var(--bg-elev);
  border: 2px solid var(--border-light);
  color: var(--text);
  width: 44px; height: 44px;
  cursor: pointer;
  box-shadow: inset 2px 2px 0 var(--bevel-hi), inset -2px -2px 0 var(--bevel-lo);
}
.nav-toggle span {
  display: block; width: 20px; height: 2px; margin: 3px auto;
  background: var(--text);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 96px 0 72px;
  overflow: hidden;
  border-bottom: 2px solid var(--border);
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(47,143,208,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,143,208,0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(800px 420px at 50% 30%, #000 0%, transparent 75%);
}
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 50px; align-items: center; }
.hero__logo {
  width: min(340px, 80%);
  margin-left: auto;
  filter: drop-shadow(0 10px 0 rgba(0,0,0,0.55));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.hero__title { font-family: var(--font-pixel); font-size: clamp(1.8rem, 4.4vw, 3.2rem); line-height: 1.6; margin-bottom: 0.35em; }
.hero__title .accent { color: var(--accent); }
.hero__subtitle { color: var(--text-dim); font-size: 1.15rem; max-width: 34ch; margin-bottom: 1.8em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

.hero__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

/* ==========================================================================
   Stat cards
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.stat {
  background: var(--bg-card);
  border: 2px solid var(--border);
  padding: 22px;
  box-shadow: inset 3px 3px 0 var(--bevel-hi), inset -3px -3px 0 var(--bevel-lo);
}
.stat__value { font-family: var(--font-pixel); font-size: 1.15rem; color: var(--accent); line-height: 1.3; }
.stat__label { font-family: var(--font-mc); color: var(--text-dim); font-size: 0.95rem; margin-top: 8px; }

/* ==========================================================================
   Feature grid
   ========================================================================== */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.feature__title { font-family: var(--font-mc); font-size: 1.2rem; margin: 0; }
.feature__body { color: var(--text-dim); margin: 0; }

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  position: relative;
  background:
    linear-gradient(135deg, rgba(21,101,168,0.20), rgba(11,61,102,0.10)),
    var(--bg-card);
  border: 2px solid var(--border-light);
  padding: 48px;
  text-align: center;
  box-shadow: inset 3px 3px 0 var(--bevel-hi), inset -3px -3px 0 var(--bevel-lo);
}
.cta-band h2 { margin-bottom: 0.3em; }
.cta-band p { color: var(--text-dim); max-width: 56ch; margin: 0 auto 1.6em; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 2px solid var(--border);
  background: var(--bg-panel);
  padding: 48px 0 28px;
  margin-top: 60px;
}
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer__brand .brand__logo { width: 44px; height: 44px; }
.footer__about { color: var(--text-dim); font-size: 0.95rem; margin-top: 12px; max-width: 38ch; }
.footer__col h4 { font-family: var(--font-pixel); font-size: 0.62rem; letter-spacing: 1px; color: var(--text); margin-bottom: 14px; text-transform: uppercase; }
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin: 8px 0; }
.footer__col a { color: var(--text-dim); font-size: 0.98rem; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { border-top: 1px solid var(--border); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; color: var(--text-dimmer); font-size: 0.88rem; }
.footer__bottom .pixel-heart { color: var(--ocean-light); }

/* ==========================================================================
   Page hero (sub-pages)
   ========================================================================== */
.page-hero {
  position: relative;
  padding: 60px 0 40px;
  border-bottom: 2px solid var(--border);
  background-image:
    linear-gradient(rgba(47,143,208,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,143,208,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.breadcrumb { font-family: var(--font-mc); color: var(--text-dimmer); font-size: 0.95rem; margin-bottom: 14px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb span { margin: 0 8px; opacity: 0.6; }

/* ==========================================================================
   Mod page (full width + right TOC)
   ========================================================================== */
.layout-toc { display: grid; grid-template-columns: 1fr 240px; gap: 48px; align-items: start; }
.toc-rail { position: sticky; top: calc(var(--header-h) + 24px); }
.toc-rail h4 { font-family: var(--font-pixel); font-size: 0.58rem; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 14px; }
.toc-rail ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc-rail li { margin: 0; }
.toc-rail a { display: block; color: var(--text-dim); font-size: 0.95rem; padding: 7px 0 7px 14px; border-left: 2px solid transparent; margin-left: -2px; }
.toc-rail a:hover { color: var(--text); }
.toc-rail a.is-active { color: var(--accent); border-left-color: var(--accent); background: linear-gradient(90deg, rgba(47,143,208,0.10), transparent); }

.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--text); }
.prose lead { color: var(--text-dim); }

/* spec table */
.spec-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 2px solid var(--border); }
.spec-table th, .spec-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.spec-table th { font-family: var(--font-pixel); font-size: 0.58rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); background: var(--bg-elev); }
.spec-table td { font-size: 0.98rem; }
.spec-table tr:last-child td { border-bottom: 0; }
.spec-table td:first-child { color: var(--text-dim); }

/* Markdown-generated tables in docs get the same look as .spec-table */
.docs-main table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 2px solid var(--border); }
.docs-main th, .docs-main td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.docs-main th { font-family: var(--font-pixel); font-size: 0.55rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); background: var(--bg-elev); }
.docs-main tr:last-child td { border-bottom: 0; }
/* Scroll wrapper: wide tables scroll in place instead of overflowing the page */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Command cells stay on one line so the wrapper scrolls instead of squashing */
.table-wrap code { font-size: 0.6em; white-space: normal; }

/* biome chips */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mc); font-size: 0.9rem;
  padding: 0.35em 0.7em;
  background: var(--bg-elev); border: 1px solid var(--border-light);
  color: var(--text-dim);
}

/* code blocks */
.code {
  position: relative;
  background: #06080b;
  border: 2px solid var(--border);
  box-shadow: inset 3px 3px 0 rgba(255,255,255,0.04), inset -3px -3px 0 rgba(0,0,0,0.5);
  margin: 0 0 1.4em;
}
.code__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.code__file { font-family: var(--font-pixel); font-size: 0.55rem; color: var(--text-dim); letter-spacing: 1px; }
.code__copy {
  font-family: var(--font-pixel); font-size: 0.5rem; letter-spacing: 1px;
  background: var(--bg-elev); color: var(--text-dim); border: 1px solid var(--border-light);
  padding: 0.5em 0.7em; cursor: pointer;
}
.code__copy:hover { color: var(--accent); }
.code__copy.is-copied { color: var(--grass-light); }
.code pre { margin: 0; padding: 16px; overflow-x: auto; color: #d7e3ee; }
.code code { font-family: var(--font-pixel); font-size: 0.72rem; line-height: 1.9; white-space: pre; }
.code .tok-k { color: var(--ocean-light); }
.code .tok-s { color: var(--grass-light); }
.code .tok-n { color: var(--sand); }
.code .tok-c { color: var(--text-dimmer); }

/* steps */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li {
  position: relative; padding: 4px 0 22px 56px; margin: 0;
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-family: var(--font-pixel); font-size: 0.8rem; color: var(--accent);
  background: var(--bg-elev); border: 2px solid var(--border-light);
  box-shadow: inset 2px 2px 0 var(--bevel-hi), inset -2px -2px 0 var(--bevel-lo);
}
.steps li::after {
  content: ""; position: absolute; left: 18px; top: 40px; bottom: 2px; width: 2px;
  background: var(--border);
}
.steps li:last-child::after { display: none; }
.steps h4 { font-family: var(--font-mc); font-size: 1.1rem; margin: 6px 0 4px; }
.steps p { color: var(--text-dim); margin: 0; }

/* feature list with check/dash */
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { padding-left: 30px; position: relative; margin: 10px 0; }
.feature-list li::before { content: "+"; position: absolute; left: 0; top: 0; font-family: var(--font-pixel); color: var(--grass); font-size: 0.9rem; }
.feature-list.is-minus li::before { content: "-"; color: var(--sand); }

/* callout */
.callout {
  background: var(--bg-card); border: 2px solid var(--border-light);
  border-left: 4px solid var(--accent);
  padding: 18px 22px; margin: 1.4em 0;
  box-shadow: inset 3px 3px 0 var(--bevel-hi);
}
.callout--grass { border-left-color: var(--grass); }
.callout--sand  { border-left-color: var(--sand); }
.callout__title { font-family: var(--font-pixel); font-size: 0.6rem; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.callout--grass .callout__title { color: var(--grass-light); }
.callout--sand  .callout__title { color: var(--sand); }
.callout p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Server docs (3-column)
   ========================================================================== */
.docs-layout { display: grid; grid-template-columns: 248px minmax(0,1fr) 200px; gap: 36px; align-items: start; }
.docs-sidebar {
  position: sticky; top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 6px;
}
.docs-sidebar::-webkit-scrollbar { width: 8px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border-light); }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-side-group { margin-bottom: 22px; }
.docs-side-group > h5 {
  font-family: var(--font-pixel); font-size: 0.56rem; letter-spacing: 1px;
  color: var(--text-dim); text-transform: uppercase; margin: 0 0 10px; padding: 0 10px;
}
.docs-side-group ul { list-style: none; padding: 0; margin: 0; }
.docs-side-group li { margin: 0; }
.docs-side-group a {
  display: block; color: var(--text-dim); font-size: 0.97rem; padding: 8px 10px;
  border-left: 2px solid transparent;
}
.docs-side-group a:hover { color: var(--text); background: var(--bg-hover); }
.docs-side-group a.is-active { color: var(--accent); background: rgba(47,143,208,0.10); border-left-color: var(--accent); }

.docs-main { min-width: 0; }
.docs-main h2 { margin-top: 2em; padding-top: 10px; }
.docs-main h2:first-of-type { margin-top: 0; }
.docs-main h3 { margin-top: 1.6em; }

.docs-toc { position: sticky; top: calc(var(--header-h) + 24px); }
.docs-toc h4 { font-family: var(--font-pixel); font-size: 0.56rem; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin: 0 0 12px; }
.docs-toc ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.docs-toc li { margin: 0; }
.docs-toc a { display: block; color: var(--text-dim); font-size: 0.9rem; padding: 6px 0 6px 12px; border-left: 2px solid transparent; margin-left: -2px; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-active { color: var(--accent); border-left-color: var(--accent); }

/* next/prev pagination */
.docs-pagination { display: flex; gap: 16px; justify-content: space-between; margin-top: 48px; padding-top: 24px; border-top: 2px solid var(--border); }
.docs-pagination a {
  flex: 1; background: var(--bg-card); border: 2px solid var(--border);
  padding: 16px 20px; box-shadow: inset 3px 3px 0 var(--bevel-hi), inset -3px -3px 0 var(--bevel-lo);
  transition: border-color var(--transition), background var(--transition);
}
.docs-pagination a:hover { border-color: var(--accent); background: var(--bg-elev); }
.docs-pagination .label { font-family: var(--font-pixel); font-size: 0.5rem; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; }
.docs-pagination .title { font-family: var(--font-mc); font-size: 1.1rem; color: var(--text); margin-top: 6px; }
.docs-pagination a.next { text-align: right; }

/* placeholder / TBD marker */
.tbd { color: var(--sand); font-family: var(--font-mc); }
.tbd-inline {
  font-family: var(--font-pixel); font-size: 0.5rem; letter-spacing: 1px;
  color: var(--sand); border: 1px dashed var(--sand); padding: 0.35em 0.6em;
  margin-left: 8px; text-transform: uppercase; vertical-align: middle;
}
.kbd {
  font-family: var(--font-pixel); font-size: 0.6rem; padding: 0.4em 0.6em;
  background: var(--bg-elev); border: 2px solid var(--border-light);
  box-shadow: inset 2px 2px 0 var(--bevel-hi), inset -2px -2px 0 var(--bevel-lo);
  color: var(--text);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .layout-toc { grid-template-columns: 1fr; }
  .toc-rail { display: none; }
  .docs-layout { grid-template-columns: 220px minmax(0,1fr); }
  .docs-toc { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__logo { margin: 0 auto; }
  .hero__subtitle { margin-left: auto; margin-right: auto; }
  .hero__actions, .hero__badges { justify-content: center; }
  .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .nav.is-open {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; top: var(--header-h); right: 0; left: 0;
    background: var(--bg-panel); border-bottom: 2px solid var(--border);
    padding: 16px 22px; gap: 8px; z-index: 49;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  }
  .nav__cta { display: none; }
  /* CTA stays inside the dropdown panel, in flow, keeping its primary style */
  .nav.is-open .nav__cta {
    display: flex; position: static; width: 100%;
    justify-content: center; margin-top: 6px;
  }
  .nav-toggle { display: block; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; width: 280px;
    max-height: none; background: var(--bg-panel); border-right: 2px solid var(--border);
    transform: translateX(-100%); transition: transform 200ms ease; z-index: 48;
    padding: 20px; box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .docs-sidebar.is-open { transform: translateX(0); }
  .docs-overlay { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,0.6); z-index: 47; }
  .docs-overlay.is-open { display: block; }
  .sidebar-toggle { display: inline-flex !important; }
  /* Tighter vertical rhythm on phones */
  .hero { padding: 56px 0 48px; }
  .page-hero { padding: 40px 0 28px; }
}
.sidebar-toggle { display: none; }
@media (max-width: 560px) {
  body { font-size: 17px; }
  .section { padding: 60px 0; }
  .stats { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .cta-band { padding: 32px 22px; }
  .docs-pagination { flex-direction: column; }
  .docs-pagination a.next { text-align: left; }
  .code pre { padding: 12px; }
}

/* Small phones / foldable cover screens */
@media (max-width: 400px) {
  .hero { padding: 44px 0 40px; }
  .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .hero__actions .mc-btn { width: 100%; justify-content: center; }
  .mc-btn--lg { font-size: 0.75rem; }
  .cta-band__actions .mc-btn { width: 100%; justify-content: center; }
  .stats--2col { grid-template-columns: 1fr; }
  .stat { padding: 14px; }
  .stat__value { font-size: 0.95rem; }
}

/* Two-column stats variant (server docs) */
.stats--2col { grid-template-columns: repeat(2, 1fr); }

/* 防拖拽：仅限导航/页脚等界面链接；正文内容链接保持可选中 */
button, .mc-btn, .nav-toggle, .sidebar-toggle,
.nav a, .site-footer a, .docs-sidebar a, .docs-toc a, .toc-rail a, .breadcrumb a, .page-hero .mc-btn {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-drag: none;
}

/* 禁止文本选择导致的高亮（可选，提升点击体验） */
* {
  -webkit-tap-highlight-color: transparent;
}