/* ==========================================================================
   Design Tokens — Publication-Grade Technical Manual
   - Warm Paper Canvas (#f4f3ee) harmonized with 3D studio renders
   - Strict 3-weight scale (400 / 500 / 700) to prevent YaHei UI bold collapse
   - Unified 3-step border-radius scale (6px / 10px / 16px)
   - Dedicated restrained 4-color console palette for the dark Simulator Lab
   ========================================================================== */

/* Publication-Grade Static Serif Subset (Noto Serif SC wght=640, Zero Faux-Bold) */
@font-face {
  font-family: "AcademyDisplaySerif";
  src: url("../assets/fonts/noto-serif-sc-display.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paper & Surface Hierarchy */
  --bg-canvas: #f4f3ee;
  --bg-surface: #fbfaf7;
  --bg-subtle: #ecebe5;
  --bg-highlight: #f4efe6;

  /* Typography Ink Hierarchy */
  --ink-primary: #171a1f;
  --ink-body: #2b3038;
  --ink-secondary: #4e5663;
  --ink-tertiary: #6e7785;
  --ink-inverse: #fbfaf7;

  /* Editorial Semantic Accents (Restrained, High Contrast) */
  --accent-indigo: #1b4d7e;
  --accent-indigo-hover: #143c63;
  --accent-indigo-soft: #e9eff6;
  --accent-indigo-border: rgba(27, 77, 126, 0.24);

  --accent-amber: #a85d14;
  --accent-amber-soft: #f5ede0;
  --accent-amber-border: rgba(168, 93, 20, 0.28);

  --accent-emerald: #13734f;
  --accent-emerald-soft: #e7f3ec;
  --accent-emerald-border: rgba(19, 115, 79, 0.26);

  --accent-crimson: #b83227;
  --accent-crimson-soft: #f9eae8;
  --accent-crimson-border: rgba(184, 50, 39, 0.28);

  /* Dark Console / Engineer X-Ray Palette (Strictly 4 Semantic Colors) */
  --bg-console: #121720;
  --bg-console-card: #18202c;
  --bg-console-well: #0e131b;
  --border-console: rgba(255, 255, 255, 0.1);
  --text-console: #e6ecf4;
  --text-console-muted: #8e9bb0;
  --console-info: #8fb3d9;
  --console-ok: #6fbf9a;
  --console-warn: #e0a458;
  --console-alert: #e07a6a;

  /* Hairlines */
  --border-subtle: rgba(23, 26, 31, 0.09);
  --border-medium: rgba(23, 26, 31, 0.16);
  --border-strong: rgba(23, 26, 31, 0.28);

  /* Elevation — Reserved Strictly for Floating Overlays (Modals / Drawers) */
  --shadow-overlay: 0 20px 50px rgba(17, 22, 32, 0.16), 0 4px 14px rgba(17, 22, 32, 0.06);

  /* Typography Stacks (Latin-first sans + True-Weight Static Serif Display + CJK-safe Mono) */
  --font-sans: -apple-system, "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --font-serif: "AcademyDisplaySerif", "Source Han Serif SC", "Noto Serif SC", "Songti SC", "PingFang SC", "Microsoft YaHei UI", Georgia, serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "PingFang SC", "Microsoft YaHei UI", monospace;

  /* Strict 3-Step Font Weight System */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;

  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem; /* 17px comfortable reading size */

  /* Layout Rhythm */
  --topbar-h: 58px;
  --sidebar-w: 276px;
  --toc-w: 216px;
  --reading-max: 680px;
  --wide-max: 1080px;

  /* Unified 3-Step Border Radius System */
  --bw: 1px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Motion — Emil Design Engineering Curves */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 130ms;
  --dur-fast: 170ms;
  --dur-modal: 250ms;
}

/* High-Comfort Reading Font Scale Toggle */
[data-font-scale="large"] {
  font-size: 17.5px;
}
