:root {
  /* ─── Chapter Canvases (Full-Bleed Color-Blocked Sections · Sunlit Default) ─── */
  --bg: #fffbf0;
  --chapter-hero: #fffbf0;
  --chapter-sky: #e8f5ff;
  --chapter-buzz: #fff5cc;
  --chapter-mint: #e5faf0;
  --chapter-footer: #1b1635;

  /* ─── Tactile Card Surfaces ─── */
  --surface: #ffffff;
  --surface-warm: #fffdf6;
  --surface-raised: #f6f8ff;
  --surface-overlay: #ffffff;

  /* ─── Ink & Typography Colors (WCAG AAA >= 13:1 on light canvases) ─── */
  --fg: #1b192e;
  --fg-2: #2d2a45;
  --muted: #534f6e;
  --ink: #1b192e;

  /* ─── Borders & Tactile Brick Lips ─── */
  --border: #1b192e;
  --border-soft: rgba(27, 25, 46, 0.18);
  --brick-stroke: 2px;

  /* ─── Signature Buzz × Sunlit Pop Dopamine Palette ─── */
  --pop-blue: #2b4cff;
  --pop-blue-lip: #1830b5;
  --pop-coral: #ff5a36;
  --pop-coral-lip: #c83717;
  --pop-purple: #7b3fe4;
  --pop-purple-lip: #511fb0;
  --pop-lime: #22d678;
  --pop-lime-lip: #0fa356;
  --pop-yellow: #ffd426;
  --pop-yellow-lip: #d1a000;
  --pop-pink: #ff477e;
  --pop-pink-lip: #c42254;
  --pop-cyan: #00b4d8;
  --pop-cyan-lip: #00829e;
  --pop-orange: #ff8a00;

  /* ─── Semantic Mappings ─── */
  --accent: var(--pop-coral);
  --accent-on: #ffffff;
  --accent-hover: #ff441b;
  --success: #00a878;
  --warn: #e68a00;
  --danger: #e5383b;

  /* ─── Soft Pastel Tints for Spec Bricks & Sticky Notes ─── */
  --tint-coral: #fff0ec;
  --tint-blue: #edf2ff;
  --tint-yellow: #fff9db;
  --tint-lime: #e8fbf0;
  --tint-purple: #f3ecff;
  --tint-pink: #ffedf3;

  /* ─── Typography ─── */
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;

  /* ─── Type Scale ─── */
  --text-xs: 0.76rem;
  --text-sm: 0.88rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.35rem;
  --text-2xl: 1.72rem;
  --text-3xl: 2.3rem;
  --text-4xl: clamp(2.3rem, 4.8vw, 3.65rem);

  --leading-body: 1.76;
  --leading-tight: 1.2;
  --tracking-display: -0.02em;

  /* ─── Spacing & Rhythm ─── */
  --section-y-desktop: 96px;
  --section-y-tablet: 74px;
  --section-y-phone: 56px;

  /* ─── Tactile Toybox Radii ─── */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-pill: 9999px;

  /* ─── Tactile Offset Hard Shadows (Zero AI Glassmorphism!) ─── */
  --shadow-brick: 0 5px 0 var(--ink);
  --shadow-brick-sm: 0 3px 0 var(--ink);
  --shadow-card-blue: 6px 6px 0 var(--pop-blue);
  --shadow-card-coral: 6px 6px 0 var(--pop-coral);
  --shadow-card-purple: 6px 6px 0 var(--pop-purple);
  --shadow-card-ink: 6px 6px 0 var(--ink);
  --bevel-highlight: inset 0 2px 0 rgba(255, 255, 255, 0.72);

  /* ─── Focus & Motion (Bouncy Toy Spring) ─── */
  --focus-ring: 0 0 0 3px var(--pop-yellow), 0 0 0 5px var(--ink);
  --motion-fast: 150ms;
  --motion-base: 260ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ─── Container ─── */
  --container-max: 1180px;
  --container-gutter-desktop: 32px;
  --container-gutter-tablet: 24px;
  --container-gutter-phone: 18px;
}

/* ─── Optional Cosmic Toybox Night Mode ("星际夜航舱") ─── */
[data-theme="cosmic"] {
  --bg: #17132b;
  --chapter-hero: #17132b;
  --chapter-sky: #12203d;
  --chapter-buzz: #22173d;
  --chapter-mint: #112a2c;
  --chapter-footer: #0e0b1d;

  --surface: #231e3d;
  --surface-warm: #282246;
  --surface-raised: #2e2852;
  --surface-overlay: #332c5c;

  --fg: #fffdf7;
  --fg-2: #ede9fe;
  --muted: #b8b2d8;
  --ink: #0b0818;

  --border: #4e467a;
  --border-soft: rgba(255, 255, 255, 0.16);

  --accent: #ff6b4a;
  --accent-on: #ffffff;
  --success: #2ee57d;

  --tint-coral: #38202c;
  --tint-blue: #1e294f;
  --tint-yellow: #38301e;
  --tint-lime: #19362e;
  --tint-purple: #2f2152;
  --tint-pink: #3b1e36;

  --shadow-brick: 0 5px 0 #0b0818;
  --shadow-brick-sm: 0 3px 0 #0b0818;
  --shadow-card-blue: 6px 6px 0 #2b4cff;
  --shadow-card-coral: 6px 6px 0 #ff5a36;
  --shadow-card-purple: 6px 6px 0 #2ee57d;
  --shadow-card-ink: 6px 6px 0 #0b0818;
  --bevel-highlight: inset 0 2px 0 rgba(255, 255, 255, 0.16);
}
