/* ==========================================================================
   Multi-Theme Design System: Palettes, Atmospheric Backdrops & Tactile Craft
   --------------------------------------------------------------------------
   Theme Taxonomy (aligned with SITE_THEMES in src/config.ts):
     I.   Liquid Glass Family  — light (:root), pine, iris
     II.  Print & Architecture — paper, swiss, ink
     III. Deep Nocturne Family — midnight, terminal
   All animations strictly mutate GPU-composited transform/opacity properties,
   pause while scrolling (.is-scrolling), and honor prefers-reduced-motion.
   ========================================================================== */

/* ==========================================================================
   I. Liquid Glass Family (light, pine, iris — light base tokens live in :root)
   ========================================================================== */

/* 1. 雨后松林 · 玻璃 (Botanical Canopy Glass: dappled sunbeams & forest mist) */
[data-theme="pine"] {
  --theme-page: 232, 241, 236;
  --theme-surface: 210, 227, 217;
  --theme-card: 246, 252, 248;
  --theme-ink: 18, 42, 32;
  --theme-soft: 34, 63, 50;
  --theme-muted: 48, 79, 65;
  --theme-faint: 55, 86, 72;
  --theme-line: 148, 184, 164;
  --theme-shadow: 18, 46, 34;

  --theme-accent: 18, 88, 63;
  --theme-accent-end: #1c8570;
  --theme-accent-fill: #12583f;
  --theme-accent-fill-rgb: 18, 88, 63;
  --theme-accent-hover: #0c422f;
  --theme-on-accent: #ffffff;
  --theme-signal: 18, 116, 110;
  --title-grad-start: #0d3e2d;
  --title-grad-end: #1c8570;

  --theme-glow-1: 68, 190, 150;
  --theme-glow-2: 72, 178, 206;
  --theme-glow-3: 140, 204, 134;
  --theme-glow-4: 234, 198, 118;
  --theme-glow-5: 76, 192, 204;
  --theme-glow-6: 62, 180, 144;
  --theme-glow-7: 228, 204, 126;
  --theme-glow-8: 112, 202, 156;
  --theme-glow: 68, 190, 150;
  --theme-glow-secondary: 72, 178, 206;
  --theme-glow-alpha-hi: 36%;
  --theme-glow-alpha-mid: 13%;

  --bg-pattern:
    linear-gradient(122deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0) 36%, rgba(68, 190, 150, 0.09) 68%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle at 1px 1px, rgba(18, 88, 63, 0.055) 1px, transparent 0);
  --bg-pattern-size: 100% 100%, 30px 30px;

  --glass-blur: blur(13px);
  --glass-sheen: linear-gradient(146deg, rgba(242, 255, 248, 0.20) 0%, rgba(255, 255, 255, 0.03) 50%, rgba(18, 46, 34, 0.04) 100%);
  --theme-specular: 242, 255, 248;
  --theme-card-alpha: 0.38;
  --theme-card-hover-alpha: 0.54;
  --theme-reading-alpha: 0.62;
  --theme-mobile-alpha: 0.78;
  --theme-head-alpha: 0.16;
  --theme-head-scrolled-alpha: 0.66;
  --theme-foot-alpha: 0.28;
  --theme-subtle-bg: rgba(18, 88, 63, 0.065);
  --theme-subtle-border: rgba(18, 88, 63, 0.15);
  --theme-code-bg: rgba(18, 88, 63, 0.08);
  --theme-track-bg: rgba(36, 66, 53, 0.13);
  --theme-bar-bg: rgba(18, 88, 63, 0.36);
  --quote-border: rgba(18, 88, 63, 0.34);
  --card-footer-line: rgba(18, 88, 63, 0.11);
  --prose-link-underline: rgba(18, 88, 63, 0.36);
  --bar-glow: 0 0 12px rgba(28, 133, 112, 0.28);
  --card-shadow-hover: 0 12px 32px -6px rgba(18, 46, 34, 0.19), 0 0 34px rgba(68, 190, 150, 0.22);

  --a-view-bg: rgba(18, 116, 110, 0.10);
  --a-view-border: rgba(18, 116, 110, 0.28);
  --a-view-ink: #0f5c57;
  --a-input-bg: rgba(248, 253, 250, 0.66);
  --a-input-bg-focus: rgba(252, 255, 253, 0.94);
}

/* 2. 晨雾鸢尾 · 柔光 (Iridescent Mist Glass: pillow radii & dawn prism halos) */
[data-theme="iris"] {
  --theme-page: 238, 232, 246;
  --theme-surface: 221, 212, 238;
  --theme-card: 251, 248, 255;
  --theme-ink: 36, 28, 52;
  --theme-soft: 54, 42, 76;
  --theme-muted: 72, 58, 96;
  --theme-faint: 80, 65, 106;
  --theme-line: 178, 162, 206;
  --theme-shadow: 36, 26, 58;

  --theme-accent: 86, 52, 146;
  --theme-accent-end: #677ae6;
  --theme-accent-fill: #563492;
  --theme-accent-fill-rgb: 86, 52, 146;
  --theme-accent-hover: #422575;
  --theme-on-accent: #ffffff;
  --theme-signal: 78, 102, 198;
  --title-grad-start: #402278;
  --title-grad-end: #6174e8;

  --theme-glow-1: 150, 130, 246;
  --theme-glow-2: 96, 165, 250;
  --theme-glow-3: 78, 200, 210;
  --theme-glow-4: 242, 192, 136;
  --theme-glow-5: 108, 180, 248;
  --theme-glow-6: 138, 116, 240;
  --theme-glow-7: 244, 200, 144;
  --theme-glow-8: 98, 204, 210;
  --theme-glow: 150, 130, 246;
  --theme-glow-secondary: 96, 165, 250;
  --theme-glow-alpha-hi: 40%;
  --theme-glow-alpha-mid: 14%;

  --bg-pattern:
    radial-gradient(90% 65% at 50% -10%, rgba(255, 255, 255, 0.64) 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 1px 1px, rgba(86, 52, 146, 0.05) 1px, transparent 0);
  --bg-pattern-size: 100% 100%, 34px 34px;

  --card-radius: 20px;
  --a-radius: 18px;
  --control-radius: 12px;
  --media-radius: 14px;
  --glass-blur: blur(16px);
  --glass-sheen: linear-gradient(142deg, rgba(255, 255, 255, 0.24) 0%, rgba(164, 142, 248, 0.05) 48%, rgba(96, 165, 250, 0.05) 100%);
  --theme-specular: 250, 246, 255;
  --a-glass: blur(16px) saturate(165%);
  --theme-card-alpha: 0.36;
  --theme-card-hover-alpha: 0.52;
  --theme-reading-alpha: 0.60;
  --theme-mobile-alpha: 0.78;
  --theme-head-alpha: 0.16;
  --theme-head-scrolled-alpha: 0.66;
  --theme-foot-alpha: 0.28;
  --theme-subtle-bg: rgba(86, 52, 146, 0.065);
  --theme-subtle-border: rgba(86, 52, 146, 0.15);
  --theme-code-bg: rgba(86, 52, 146, 0.08);
  --theme-track-bg: rgba(57, 45, 80, 0.13);
  --theme-bar-bg: rgba(86, 52, 146, 0.36);
  --quote-border: rgba(86, 52, 146, 0.32);
  --card-footer-line: rgba(86, 52, 146, 0.11);
  --prose-link-underline: rgba(86, 52, 146, 0.36);
  --bar-glow: 0 0 14px rgba(103, 122, 230, 0.32);
  --card-shadow-hover: 0 14px 34px -8px rgba(42, 28, 72, 0.20), 0 0 38px rgba(150, 130, 246, 0.24);

  --a-view-bg: rgba(78, 102, 198, 0.10);
  --a-view-border: rgba(78, 102, 198, 0.28);
  --a-view-ink: #34479b;
  --a-input-bg: rgba(252, 250, 255, 0.66);
  --a-input-bg-focus: rgba(255, 255, 255, 0.94);
}

/* ==========================================================================
   II. Tactile Print & Architectural Family (paper, swiss, ink)
   ========================================================================== */

/* 3. 书卷活版 · 出版 (Editorial Print: ruled cotton paper & warm letterpress) */
[data-theme="paper"] {
  --theme-page: 247, 240, 228;
  --theme-surface: 236, 222, 201;
  --theme-card: 255, 251, 244;
  --theme-ink: 40, 29, 20;
  --theme-soft: 62, 47, 35;
  --theme-muted: 88, 68, 52;
  --theme-faint: 96, 75, 58;
  --theme-line: 202, 173, 134;
  --theme-shadow: 62, 42, 24;

  --theme-accent: 140, 61, 22;
  --theme-accent-end: #cc6b31;
  --theme-accent-fill: #8c3d16;
  --theme-accent-fill-rgb: 140, 61, 22;
  --theme-accent-hover: #702f0f;
  --theme-on-accent: #ffffff;
  --theme-signal: 186, 94, 34;
  --title-grad-start: #2e1d12;
  --title-grad-end: #7c3818;

  --theme-glow-1: 245, 174, 102;
  --theme-glow-2: 228, 142, 98;
  --theme-glow-3: 118, 186, 158;
  --theme-glow-4: 242, 200, 114;
  --theme-glow-5: 242, 154, 106;
  --theme-glow-6: 232, 168, 98;
  --theme-glow-7: 246, 206, 126;
  --theme-glow-8: 138, 198, 170;
  --theme-glow: 245, 174, 102;
  --theme-glow-secondary: 118, 186, 158;
  --theme-glow-alpha-hi: 22%;
  --theme-glow-alpha-mid: 7%;

  --bg-pattern:
    radial-gradient(120% 90% at 85% 8%, rgba(255, 248, 232, 0.72) 0%, rgba(255, 248, 232, 0) 62%),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(140, 61, 22, 0.042) 31px, rgba(140, 61, 22, 0.042) 32px);
  --bg-pattern-size: 100% 100%, 100% 32px;

  --display: var(--reading);
  --card-radius: 6px;
  --a-radius: 6px;
  --control-radius: 5px;
  --media-radius: 4px;
  --tag-radius: 4px;
  --bar-radius: 3px;
  --back-top-radius: 6px;
  --surface-border: rgba(140, 61, 22, 0.18);
  --card-backdrop: none;
  --head-backdrop: none;
  --foot-backdrop: none;
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 251, 244, 0) 100%);
  --card-bg: rgba(255, 251, 244, 0.94);
  --card-bg-hover: rgba(255, 253, 248, 0.99);
  --card-shadow: 0 2px 10px -3px rgba(62, 42, 24, 0.08), 0 1px 2px rgba(62, 42, 24, 0.05);
  --card-shadow-hover: 0 12px 28px -8px rgba(62, 42, 24, 0.16), 0 -2px 0 0 #8c3d16;

  --theme-card-alpha: 0.94;
  --theme-card-hover-alpha: 0.99;
  --theme-reading-alpha: 0.97;
  --theme-mobile-alpha: 0.98;
  --theme-head-alpha: 0.90;
  --theme-head-scrolled-alpha: 0.97;
  --theme-foot-alpha: 0.86;
  --theme-subtle-bg: rgba(140, 61, 22, 0.055);
  --theme-subtle-border: rgba(140, 61, 22, 0.16);
  --theme-code-bg: rgba(140, 61, 22, 0.075);
  --theme-track-bg: rgba(94, 73, 56, 0.14);
  --theme-bar-bg: rgba(140, 61, 22, 0.38);
  --quote-border: rgba(140, 61, 22, 0.44);
  --card-footer-line: rgba(140, 61, 22, 0.12);
  --media-ring: rgba(62, 42, 24, 0.10);
  --prose-link-underline: rgba(140, 61, 22, 0.40);
  --bar-glow: none;

  --a-glass: none;
  --a-sheen: none;
  --a-surface: rgba(255, 251, 244, 0.94);
  --a-surface-strong: rgba(255, 253, 248, 0.98);
  --a-surface-hover: #fffdf9;
  --a-side-bg: rgba(242, 232, 216, 0.96);
  --a-view-bg: rgba(40, 114, 98, 0.10);
  --a-view-border: rgba(40, 114, 98, 0.28);
  --a-view-ink: #1d594c;
  --a-pin-bg: rgba(180, 92, 24, 0.11);
  --a-pin-border: rgba(180, 92, 24, 0.30);
  --a-pin-ink: #8a410c;
  --a-input-bg: rgba(255, 252, 246, 0.92);
  --a-input-bg-focus: #ffffff;
}

/* 4. 瑞士网格 · 极简 (Swiss Architectural: dual-scale drafting grid & hard offset) */
[data-theme="swiss"] {
  --theme-page: 244, 244, 241;
  --theme-surface: 232, 231, 226;
  --theme-card: 255, 255, 255;
  --theme-ink: 18, 18, 18;
  --theme-soft: 40, 40, 38;
  --theme-muted: 68, 68, 64;
  --theme-faint: 80, 80, 76;
  --theme-line: 204, 203, 196;
  --theme-shadow: 18, 18, 18;

  --theme-accent: 184, 36, 24;
  --theme-accent-end: #e03e2d;
  --theme-accent-fill: #b82418;
  --theme-accent-fill-rgb: 184, 36, 24;
  --theme-accent-hover: #921b11;
  --theme-on-accent: #ffffff;
  --theme-signal: 184, 36, 24;
  --title-grad-start: #121212;
  --title-grad-end: #262624;

  --theme-glow-1: 208, 206, 198;
  --theme-glow-2: 184, 36, 24;
  --theme-glow-3: 196, 195, 188;
  --theme-glow-4: 224, 62, 45;
  --theme-glow-5: 208, 206, 198;
  --theme-glow-6: 184, 36, 24;
  --theme-glow-7: 196, 195, 188;
  --theme-glow-8: 208, 206, 198;
  --theme-glow: 208, 206, 198;
  --theme-glow-secondary: 184, 36, 24;
  --theme-glow-alpha-hi: 9%;
  --theme-glow-alpha-mid: 2.5%;

  --bg-pattern:
    linear-gradient(to right, rgba(18, 18, 18, 0.068) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(18, 18, 18, 0.068) 1px, transparent 1px),
    linear-gradient(to right, rgba(18, 18, 18, 0.024) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(18, 18, 18, 0.024) 1px, transparent 1px);
  --bg-pattern-size: 88px 88px, 88px 88px, 22px 22px, 22px 22px;

  --card-radius: 2px;
  --a-radius: 2px;
  --control-radius: 2px;
  --media-radius: 2px;
  --tag-radius: 2px;
  --bar-radius: 1px;
  --back-top-radius: 2px;
  --surface-border: #cdccc4;
  --card-backdrop: none;
  --head-backdrop: none;
  --foot-backdrop: none;
  --glass-sheen: none;
  --card-bg: #ffffff;
  --card-bg-hover: #ffffff;
  --card-shadow: 0 1px 0 rgba(18, 18, 18, 0.05);
  --card-shadow-hover: 4px 4px 0 #121212;

  --theme-card-alpha: 1;
  --theme-card-hover-alpha: 1;
  --theme-reading-alpha: 1;
  --theme-mobile-alpha: 0.99;
  --theme-head-alpha: 0.94;
  --theme-head-scrolled-alpha: 0.99;
  --theme-foot-alpha: 0.98;
  --theme-subtle-bg: rgba(18, 18, 18, 0.04);
  --theme-subtle-border: rgba(18, 18, 18, 0.15);
  --theme-code-bg: rgba(18, 18, 18, 0.048);
  --theme-track-bg: rgba(18, 18, 18, 0.11);
  --theme-bar-bg: rgba(18, 18, 18, 0.34);
  --quote-border: #b82418;
  --card-footer-line: rgba(18, 18, 18, 0.12);
  --media-ring: rgba(18, 18, 18, 0.12);
  --prose-link-underline: rgba(184, 36, 24, 0.42);
  --bar-glow: none;

  --a-glass: none;
  --a-sheen: none;
  --a-surface: #ffffff;
  --a-surface-strong: #ffffff;
  --a-surface-hover: #fafaf8;
  --a-surface-shadow: none;
  --a-side-bg: #ecebe6;
  --a-hover: rgba(184, 36, 24, 0.07);
  --a-accent-soft: rgba(184, 36, 24, 0.10);
  --a-view-bg: rgba(18, 18, 18, 0.06);
  --a-view-border: rgba(18, 18, 18, 0.22);
  --a-view-ink: #121212;
  --a-input-bg: #f8f8f6;
  --a-input-bg-focus: #ffffff;
}

/* 5. 水墨宣纸 · 东方 (Xuan Paper & Sumi Ink: bamboo screen weave & cinnabar seal) */
[data-theme="ink"] {
  --theme-page: 242, 239, 233;
  --theme-surface: 229, 224, 215;
  --theme-card: 250, 248, 243;
  --theme-ink: 23, 22, 20;
  --theme-soft: 50, 47, 42;
  --theme-muted: 74, 70, 64;
  --theme-faint: 84, 79, 72;
  --theme-line: 192, 186, 174;
  --theme-shadow: 23, 22, 20;

  --theme-accent: 158, 31, 31;
  --theme-accent-end: #c23b2b;
  --theme-accent-fill: #9e1f1f;
  --theme-accent-fill-rgb: 158, 31, 31;
  --theme-accent-hover: #7d1717;
  --theme-on-accent: #ffffff;
  --theme-signal: 158, 31, 31;
  --title-grad-start: #171614;
  --title-grad-end: #3a3630;

  --theme-glow-1: 148, 142, 132;
  --theme-glow-2: 186, 180, 170;
  --theme-glow-3: 138, 132, 122;
  --theme-glow-4: 158, 31, 31;
  --theme-glow-5: 168, 162, 152;
  --theme-glow-6: 146, 140, 130;
  --theme-glow-7: 184, 178, 168;
  --theme-glow-8: 156, 150, 140;
  --theme-glow: 148, 142, 132;
  --theme-glow-secondary: 158, 31, 31;
  --theme-glow-alpha-hi: 14%;
  --theme-glow-alpha-mid: 4%;

  --bg-pattern:
    radial-gradient(115% 85% at 15% 10%, rgba(255, 253, 248, 0.68) 0%, rgba(255, 253, 248, 0) 65%),
    repeating-linear-gradient(to bottom, transparent 0, transparent 5px, rgba(23, 22, 20, 0.022) 5px, rgba(23, 22, 20, 0.022) 6px),
    repeating-linear-gradient(to right, transparent 0, transparent 55px, rgba(23, 22, 20, 0.024) 55px, rgba(23, 22, 20, 0.024) 56px);
  --bg-pattern-size: 100% 100%, 100% 6px, 56px 100%;

  --sans: 'Noto Serif SC', Geist, 'Songti SC', serif;
  --display: 'Noto Serif SC', 'Libre Baskerville', 'Songti SC', serif;
  --a-sans: 'Noto Serif SC', Geist, 'Songti SC', serif;
  --card-radius: 0px;
  --a-radius: 0px;
  --control-radius: 0px;
  --media-radius: 0px;
  --tag-radius: 0px;
  --bar-radius: 0px;
  --back-top-radius: 0px;
  --surface-border: rgba(23, 22, 20, 0.17);
  --card-backdrop: none;
  --head-backdrop: none;
  --foot-backdrop: none;
  --glass-sheen: none;
  --card-bg: rgba(250, 248, 243, 0.94);
  --card-bg-hover: rgba(252, 250, 247, 0.99);
  --card-shadow: 0 1px 4px rgba(23, 22, 20, 0.05);
  --card-shadow-hover: 0 10px 26px -10px rgba(23, 22, 20, 0.18), -3px 0 0 #9e1f1f;

  --theme-card-alpha: 0.94;
  --theme-card-hover-alpha: 0.99;
  --theme-reading-alpha: 0.97;
  --theme-mobile-alpha: 0.98;
  --theme-head-alpha: 0.90;
  --theme-head-scrolled-alpha: 0.97;
  --theme-foot-alpha: 0.88;
  --theme-subtle-bg: rgba(23, 22, 20, 0.042);
  --theme-subtle-border: rgba(23, 22, 20, 0.15);
  --theme-code-bg: rgba(23, 22, 20, 0.055);
  --theme-track-bg: rgba(23, 22, 20, 0.11);
  --theme-bar-bg: rgba(23, 22, 20, 0.34);
  --quote-border: rgba(158, 31, 31, 0.50);
  --card-footer-line: rgba(23, 22, 20, 0.11);
  --media-ring: rgba(23, 22, 20, 0.12);
  --prose-link-underline: rgba(158, 31, 31, 0.40);
  --bar-glow: none;

  --a-glass: none;
  --a-sheen: none;
  --a-surface: rgba(250, 248, 243, 0.94);
  --a-surface-strong: rgba(252, 250, 247, 0.98);
  --a-surface-hover: #fcfaf7;
  --a-surface-shadow: none;
  --a-side-bg: #e7e2d8;
  --a-hover: rgba(158, 31, 31, 0.07);
  --a-accent-soft: rgba(158, 31, 31, 0.10);
  --a-view-bg: rgba(23, 22, 20, 0.06);
  --a-view-border: rgba(23, 22, 20, 0.22);
  --a-view-ink: #171614;
  --a-input-bg: rgba(255, 254, 251, 0.88);
  --a-input-bg-focus: #ffffff;
}

/* ==========================================================================
   III. Deep Nocturne Family (midnight, terminal)
   ========================================================================== */
[data-theme="midnight"], [data-theme="terminal"] {
  color-scheme: dark;
  --theme-edge-2: 0.16;
  --theme-edge-3: 0.04;
  --theme-edge-4: 0.11;
  --theme-edge-5: 0.24;
  --theme-rim-shadow-a: 0.32;
  --a-danger-soft: rgba(248, 113, 113, 0.14);
  --a-danger-ink: #fca5a5;
  --a-danger-bg: rgba(248, 113, 113, 0.14);
  --a-danger-border: rgba(248, 113, 113, 0.32);
  --a-pin-bg: rgba(251, 191, 36, 0.14);
  --a-pin-border: rgba(251, 191, 36, 0.32);
  --a-pin-ink: #fcd34d;
  --a-draft-bg: rgba(251, 191, 36, 0.12);
  --a-draft-border: rgba(251, 191, 36, 0.32);
  --a-draft-ink: #fcd34d;
  --a-flash-error-bg: rgba(185, 28, 28, 0.24);
}

/* 6. 星夜极光 · 暗夜 (Celestial Nocturne: starfield constellations & Borealis glass) */
[data-theme="midnight"] {
  --theme-page: 11, 18, 32;
  --theme-surface: 18, 29, 50;
  --theme-card: 22, 35, 62;
  --theme-ink: 240, 245, 253;
  --theme-soft: 208, 221, 240;
  --theme-muted: 164, 184, 212;
  --theme-faint: 154, 174, 202;
  --theme-line: 58, 86, 126;
  --theme-shadow: 2, 6, 16;

  --theme-accent: 108, 184, 255;
  --theme-accent-end: #38e2d8;
  --theme-accent-fill: #2563eb;
  --theme-accent-fill-rgb: 37, 99, 235;
  --theme-accent-hover: #1d4ed8;
  --theme-on-accent: #ffffff;
  --theme-signal: 56, 218, 208;
  --title-grad-start: #e0f2fe;
  --title-grad-end: #38e2d8;

  --theme-glow-1: 54, 132, 248;
  --theme-glow-2: 20, 204, 192;
  --theme-glow-3: 94, 112, 244;
  --theme-glow-4: 52, 176, 232;
  --theme-glow-5: 34, 208, 232;
  --theme-glow-6: 62, 128, 242;
  --theme-glow-7: 110, 134, 246;
  --theme-glow-8: 40, 204, 184;
  --theme-glow: 54, 132, 248;
  --theme-glow-secondary: 20, 204, 192;
  --theme-glow-alpha-hi: 34%;
  --theme-glow-alpha-mid: 12%;

  --bg-pattern:
    radial-gradient(1.3px 1.3px at 42px 68px, rgba(226, 240, 255, 0.50) 99%, transparent),
    radial-gradient(1px 1px at 188px 154px, rgba(168, 220, 255, 0.36) 99%, transparent),
    radial-gradient(1px 1px at 264px 238px, rgba(240, 248, 255, 0.30) 99%, transparent),
    radial-gradient(1.5px 1.5px at 128px 94px, rgba(110, 231, 220, 0.44) 99%, transparent),
    radial-gradient(1px 1px at 346px 312px, rgba(196, 226, 255, 0.32) 99%, transparent),
    radial-gradient(1.2px 1.2px at 418px 196px, rgba(226, 240, 255, 0.34) 99%, transparent),
    linear-gradient(180deg, rgba(6, 10, 20, 0.56) 0%, rgba(11, 18, 32, 0) 46%, rgba(16, 30, 54, 0.42) 100%);
  --bg-pattern-size: 317px 293px, 317px 293px, 317px 293px, 463px 419px, 463px 419px, 587px 523px, 100% 100%;

  --theme-card-alpha: 0.48;
  --theme-card-hover-alpha: 0.66;
  --theme-reading-alpha: 0.68;
  --theme-mobile-alpha: 0.84;
  --theme-head-alpha: 0.22;
  --theme-head-scrolled-alpha: 0.74;
  --theme-foot-alpha: 0.38;
  --theme-specular: 186, 226, 255;
  --theme-specular-a: 0.19;
  --theme-edge-1: 0.38;
  --theme-subtle-bg: rgba(148, 188, 255, 0.09);
  --theme-subtle-border: rgba(148, 188, 255, 0.18);
  --theme-code-bg: rgba(7, 13, 25, 0.64);
  --theme-track-bg: rgba(148, 188, 255, 0.16);
  --theme-bar-bg: rgba(108, 184, 255, 0.42);
  --quote-border: rgba(56, 226, 216, 0.48);
  --card-footer-line: rgba(148, 188, 255, 0.13);
  --media-ring: rgba(186, 226, 255, 0.14);
  --prose-link-underline: rgba(108, 184, 255, 0.42);
  --bar-glow: 0 0 14px rgba(56, 226, 216, 0.40);
  --card-shadow-hover: 0 14px 36px -6px rgba(2, 6, 16, 0.62), 0 0 34px rgba(56, 218, 208, 0.18);

  --glass-sheen: linear-gradient(148deg, rgb(255 255 255 / 10%) 0%, rgb(255 255 255 / 1%) 52%, rgb(0 0 0 / 20%) 100%);
  --a-surface: rgba(18, 30, 52, 0.58);
  --a-surface-strong: rgba(24, 38, 66, 0.72);
  --a-surface-hover: rgba(30, 48, 80, 0.82);
  --a-sheen: linear-gradient(148deg, rgb(255 255 255 / 8%) 0%, rgb(255 255 255 / 1%) 52%, rgb(0 0 0 / 18%) 100%);
  --a-side-bg: rgba(12, 20, 36, 0.66);
  --a-mobile-glass-bg: rgba(12, 20, 36, 0.84);
  --a-side-toggle-bg: rgba(12, 20, 36, 0.78);
  --a-hover: rgba(108, 184, 255, 0.13);
  --a-accent-soft: rgba(108, 184, 255, 0.17);
  --a-view-bg: rgba(56, 218, 208, 0.13);
  --a-view-border: rgba(56, 218, 208, 0.30);
  --a-view-ink: #5eead4;
  --a-input-bg: rgba(8, 14, 26, 0.58);
  --a-input-bg-focus: rgba(9, 16, 30, 0.88);
  --a-toolbar-bg: rgba(14, 24, 42, 0.84);
  --a-flash-success-bg: rgba(37, 99, 235, 0.22);
}

/* 7. 极客终端 · 等宽 (Phosphor Matrix Deck: dot-matrix + CRT scanlines + telemetry sweep) */
[data-theme="terminal"] {
  --theme-page: 10, 15, 18;
  --theme-surface: 16, 24, 29;
  --theme-card: 18, 27, 32;
  --theme-ink: 226, 244, 236;
  --theme-soft: 192, 222, 210;
  --theme-muted: 146, 186, 172;
  --theme-faint: 136, 178, 164;
  --theme-line: 42, 92, 78;
  --theme-shadow: 0, 8, 6;

  --theme-accent: 52, 211, 153;
  --theme-accent-end: #22d3ee;
  --theme-accent-fill: #0f766e;
  --theme-accent-fill-rgb: 15, 118, 110;
  --theme-accent-hover: #0d9488;
  --theme-on-accent: #ffffff;
  --theme-signal: 34, 211, 238;
  --title-grad-start: #6ee7b7;
  --title-grad-end: #22d3ee;

  --theme-glow-1: 16, 185, 129;
  --theme-glow-2: 6, 182, 212;
  --theme-glow-3: 20, 184, 166;
  --theme-glow-4: 6, 182, 212;
  --theme-glow-5: 16, 185, 129;
  --theme-glow-6: 6, 182, 212;
  --theme-glow-7: 52, 211, 153;
  --theme-glow-8: 34, 211, 238;
  --theme-glow: 16, 185, 129;
  --theme-glow-secondary: 6, 182, 212;
  --theme-glow-alpha-hi: 18%;
  --theme-glow-alpha-mid: 5%;

  --bg-pattern:
    repeating-linear-gradient(to bottom, rgba(52, 211, 153, 0.022) 0, rgba(52, 211, 153, 0.022) 1px, transparent 1px, transparent 4px),
    radial-gradient(circle, rgba(52, 211, 153, 0.17) 1px, transparent 1px);
  --bg-pattern-size: 100% 4px, 24px 24px;

  --display: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --a-sans: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Noto Sans SC', Menlo, Consolas, monospace;
  --card-radius: 6px;
  --a-radius: 6px;
  --control-radius: 4px;
  --media-radius: 4px;
  --tag-radius: 4px;
  --bar-radius: 2px;
  --back-top-radius: 5px;
  --surface-border: rgba(52, 211, 153, 0.24);
  --card-backdrop: none;
  --head-backdrop: none;
  --foot-backdrop: none;
  --glass-sheen: linear-gradient(180deg, rgba(52, 211, 153, 0.045) 0%, rgba(16, 24, 29, 0) 100%);
  --card-bg: rgba(16, 24, 29, 0.92);
  --card-bg-hover: rgba(20, 31, 37, 0.97);
  --card-shadow: 0 4px 16px -6px rgba(0, 8, 6, 0.58);
  --card-shadow-hover: 0 0 0 1px rgba(52, 211, 153, 0.54), 0 12px 28px -8px rgba(16, 185, 129, 0.28);

  --theme-card-alpha: 0.92;
  --theme-card-hover-alpha: 0.97;
  --theme-reading-alpha: 0.96;
  --theme-mobile-alpha: 0.97;
  --theme-head-alpha: 0.88;
  --theme-head-scrolled-alpha: 0.96;
  --theme-foot-alpha: 0.92;
  --theme-subtle-bg: rgba(52, 211, 153, 0.08);
  --theme-subtle-border: rgba(52, 211, 153, 0.24);
  --theme-code-bg: rgba(6, 11, 14, 0.82);
  --theme-track-bg: rgba(52, 211, 153, 0.15);
  --theme-bar-bg: rgba(52, 211, 153, 0.42);
  --quote-border: rgba(52, 211, 153, 0.56);
  --card-footer-line: rgba(52, 211, 153, 0.14);
  --media-ring: rgba(52, 211, 153, 0.24);
  --prose-link-underline: rgba(52, 211, 153, 0.45);
  --bar-glow: 0 0 12px rgba(52, 211, 153, 0.44);

  --a-glass: none;
  --a-sheen: none;
  --a-surface: rgba(16, 24, 29, 0.92);
  --a-surface-strong: rgba(20, 31, 37, 0.97);
  --a-surface-hover: rgba(24, 38, 45, 0.99);
  --a-surface-shadow: 0 4px 16px -6px rgba(0, 8, 6, 0.52);
  --a-side-bg: rgba(12, 18, 22, 0.97);
  --a-mobile-glass-bg: rgba(12, 18, 22, 0.98);
  --a-side-toggle-bg: rgba(12, 18, 22, 0.95);
  --a-hover: rgba(52, 211, 153, 0.10);
  --a-accent-soft: rgba(52, 211, 153, 0.15);
  --a-view-bg: rgba(34, 211, 238, 0.12);
  --a-view-border: rgba(34, 211, 238, 0.30);
  --a-view-ink: #22d3ee;
  --a-input-bg: #080c0f;
  --a-input-bg-focus: #0b1115;
  --a-toolbar-bg: rgba(14, 21, 26, 0.96);
  --a-flash-success-bg: rgba(15, 118, 110, 0.26);
}

/* ==========================================================================
   IV. Derived Surface & Typography Token Mappings
   ========================================================================== */
html[data-theme]:not([data-theme="light"]) {
  --theme-accent-color: rgb(var(--theme-accent));
  --theme-card-color: rgb(var(--theme-card));
  --theme-line-color: rgb(var(--theme-line));
  --theme-page-color: rgb(var(--theme-page));
  --theme-surface-color: rgb(var(--theme-surface));
  --paper: rgb(var(--theme-page));
  --surface: rgb(var(--theme-surface));
  --ink: rgb(var(--theme-ink));
  --soft: rgb(var(--theme-soft, var(--theme-muted)));
  --muted: rgb(var(--theme-muted));
  --faint: rgb(var(--theme-faint, var(--theme-muted)));
  --accent: rgb(var(--theme-accent));
  --cyan: rgb(var(--theme-signal, var(--theme-accent)));
  --signal: var(--cyan);
  --rule: rgb(var(--theme-line));
  --glass-tint: var(--theme-page);
  --card-tint: var(--theme-card);
  --a-bg: var(--paper);
  --a-panel: rgb(var(--theme-card));
  --a-panel-2: var(--surface);
  --a-line: var(--rule);
  --a-line-2: var(--rule);
  --a-text: var(--ink);
  --a-soft: var(--soft);
  --a-muted: var(--muted);
  --a-dim: var(--faint);
  --a-accent: var(--theme-accent-fill, var(--accent));
  --a-accent-ink: var(--accent);
  --a-accent-hover: var(--theme-accent-hover, var(--a-accent));
}

/* ==========================================================================
   V. Theme-Specific Atmospheric Motion
   ========================================================================== */

@keyframes theme-sun-dapple {
  0%, 100% { translate: 0 0; scale: 1 1; }
  33%      { translate: 4.5% -3%; scale: 1.05 0.97; }
  66%      { translate: -3.5% 4%; scale: 0.97 1.04; }
}

@keyframes theme-ink-wash {
  0%, 100% { translate: 0 0; scale: 1 1; }
  50%      { translate: -4% 3%; scale: 1.08 1.04; }
}

@keyframes theme-radar-sweep {
  0%, 100% { translate: -5% -4%; scale: 0.96 1.04; }
  50%      { translate: 6% 5%; scale: 1.06 0.95; }
}

html[data-theme="paper"] :is(.bg, .admin-bg).is-live::before,
html[data-theme="swiss"] :is(.bg, .admin-bg).is-live::before {
  animation: theme-sun-dapple 28s ease-in-out infinite;
}
html[data-theme="paper"] :is(.bg, .admin-bg).is-live::after,
html[data-theme="swiss"] :is(.bg, .admin-bg).is-live::after {
  animation: theme-sun-dapple 34s ease-in-out infinite reverse;
}

html[data-theme="ink"] :is(.bg, .admin-bg).is-live::before {
  animation: theme-ink-wash 30s ease-in-out infinite;
}
html[data-theme="ink"] :is(.bg, .admin-bg).is-live::after {
  animation: theme-ink-wash 38s ease-in-out infinite reverse;
}

html[data-theme="terminal"] :is(.bg, .admin-bg).is-live::before {
  animation: theme-radar-sweep 22s ease-in-out infinite, bg-spin 96s linear infinite;
}
html[data-theme="terminal"] :is(.bg, .admin-bg).is-live::after {
  animation: theme-radar-sweep 28s ease-in-out infinite reverse;
}

/* ==========================================================================
   VI. Tactile Surface Normalization (paper, swiss, ink, terminal)
   Replace glass specular rims with crisp physical edges across ALL surfaces
   including .about-story, ghost buttons, pagers, header/footer, and sidebar.
   ========================================================================== */
html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"])
  :is(.post-card, .writing-overview, .about-story, .article-body, .recommendation-list,
      .page-archive .year-list, .search-form, .archive-year, .empty, .mobile-menu,
      .panel, .table-wrap, .editor, .media-card, .auth-card, .tabs, .search, .empty-state)::after {
  display: none;
}

html:is([data-theme="swiss"], [data-theme="ink"])
  :is(.post-card, .writing-overview, .about-story, .article-body, .recommendation-list,
      .page-archive .year-list, .search-form, .archive-year, .empty, .mobile-menu,
      .panel, .table-wrap, .editor, .media-card, .auth-card, .tabs, .search, .empty-state)::before {
  display: none;
}

html[data-theme="terminal"]
  :is(.post-card, .writing-overview, .about-story, .article-body, .recommendation-list,
      .page-archive .year-list, .search-form, .archive-year, .empty)::before {
  background: radial-gradient(95% 80% at var(--mx, 0%) var(--my, 0%), rgba(52, 211, 153, 0.11), rgba(52, 211, 153, 0) 55%);
}

html[data-theme="paper"]
  :is(.post-card, .writing-overview, .about-story, .article-body, .recommendation-list,
      .page-archive .year-list, .search-form, .archive-year, .empty)::before {
  background: radial-gradient(95% 80% at var(--mx, 0%) var(--my, 0%), rgba(245, 174, 102, 0.15), rgba(245, 174, 102, 0) 55%);
}

html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"])
  :is(.post-card, .writing-overview, .about-story, .article-body, .recommendation-list,
      .page-archive .year-list, .search-form, .archive-year, .empty, .btn-ghost, .end-btn,
      .panel, .table-wrap, .editor, .media-card, .auth-card, .tabs, .search, .empty-state,
      .btn--ghost, .pager-btn, .flash) {
  border: 1px solid var(--surface-border);
}

html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"])
  :is(.btn, .btn-primary, .btn-ghost, .mini, .pager-btn, .search-form, .field input,
      .field select, .field textarea, .tabs, .tabs a, .search, .badge, .flash, .dropzone,
      .subbar-input, .subbar-btn, .subbar-thumb, .avatar-preview, .panel-account, .tb, .t-kind) {
  border-radius: var(--control-radius);
}

html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"]) .side {
  border-right: 1px solid var(--surface-border);
}
@media (min-width: 901px) {
  html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"]) .side {
    box-shadow: none;
  }
}

html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"]) .site-head.is-scrolled,
html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"]) .site-head:has(.burger[aria-expanded='true']) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 1px 0 var(--surface-border);
}

html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"]) .site-foot {
  border-top: 1px solid var(--surface-border);
  box-shadow: none;
}

html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"]) .mobile-menu {
  border: 1px solid var(--surface-border) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html:is([data-theme="paper"], [data-theme="swiss"], [data-theme="ink"], [data-theme="terminal"]) .theme-chip {
  border-radius: var(--control-radius);
}

html:is([data-theme="swiss"], [data-theme="ink"]) :is(.panel-title::before, .side-nav a.is-active::before) {
  border-radius: 0;
}

/* ==========================================================================
   VII. Per-Theme Signature Craft & Micro-Details
   ========================================================================== */

/* ── Light / Pine / Iris: Glass Family Polish ── */
html:is([data-theme="light"], [data-theme="pine"], [data-theme="iris"]) :is(.ticker-track span, .eyebrow, .sec-more, .back) {
  background: rgba(var(--card-tint), 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px -4px rgba(var(--theme-shadow, 24, 43, 61), 0.12);
}

html[data-theme="pine"] .prose blockquote {
  background: rgba(18, 88, 63, 0.06);
  border-left-color: #1c8570;
}

html[data-theme="iris"] .prose blockquote {
  background: rgba(86, 52, 146, 0.06);
  border-left-color: #677ae6;
}

html[data-theme="iris"] .eyebrow,
html[data-theme="iris"] .back,
html[data-theme="iris"] .sec-more {
  border-radius: 999px;
}

/* ── Paper (书卷活版 · 出版): Fine Literary Print Details ── */
html[data-theme="paper"] :is(.writing-overview, .article-body, .about-story) {
  border-top: 2px solid rgba(140, 61, 22, 0.42);
}

html[data-theme="paper"] .eyebrow {
  background: rgba(255, 251, 244, 0.86);
  border-color: rgba(140, 61, 22, 0.22);
}

html[data-theme="paper"] .caret {
  width: 1.5px;
  height: 15px;
  opacity: 0.65;
}

html[data-theme="paper"] .ticker-track span {
  background: rgba(255, 251, 244, 0.88);
  border-color: rgba(140, 61, 22, 0.20);
  box-shadow: 0 1px 0 rgba(140, 61, 22, 0.14);
}

html[data-theme="paper"] .prose blockquote {
  border-left: 3px double rgba(140, 61, 22, 0.58);
  background: rgba(242, 231, 214, 0.56);
  padding: 22px 26px 22px 38px;
}

html[data-theme="paper"] .prose blockquote::before {
  content: '“';
  position: absolute;
  left: 12px;
  top: 14px;
  font: 600 32px/1 var(--reading);
  color: rgba(140, 61, 22, 0.28);
  pointer-events: none;
}

html[data-theme="paper"] .prose pre {
  background: rgba(244, 234, 218, 0.72);
  border-color: rgba(140, 61, 22, 0.18);
}

html[data-theme="paper"] .prose hr {
  background: linear-gradient(90deg, transparent, rgba(140, 61, 22, 0.46), transparent);
}

html[data-theme="paper"] .foot-bottom {
  border-top: 1px double rgba(140, 61, 22, 0.20);
}

/* ── Swiss (瑞士网格 · 极简): International Typographic Precision ── */
html[data-theme="swiss"] :is(.writing-overview, .article-body, .about-story) {
  border-top: 3px solid #121212;
}

html[data-theme="swiss"] .eyebrow {
  background: #ffffff;
  border-color: #c6c5bd;
  color: #282826;
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

html[data-theme="swiss"] .hero-quote {
  border-left-width: 3px;
}

html[data-theme="swiss"] .section-head {
  border-bottom: 2px solid #121212;
}

html[data-theme="swiss"] .sec-index {
  background: #b82418;
  border-color: #b82418;
  color: #ffffff;
}

html[data-theme="swiss"] .ticker-track span {
  background: #ffffff;
  border-color: #c6c5bd;
  color: #282826;
  letter-spacing: 0.04em;
}

html[data-theme="swiss"] .activity-track {
  height: 6px;
}

html[data-theme="swiss"] .prose h2 {
  border-bottom: 2px solid #121212;
}

html[data-theme="swiss"] .prose blockquote {
  background: #fafaf7;
  border: 1px solid #e0dfd8;
  border-left: 3px solid #b82418;
}

html[data-theme="swiss"] .prose pre {
  background: #f6f6f3;
  border-color: #cfcec6;
}

html[data-theme="swiss"] .prose hr {
  max-width: 88px;
  height: 2px;
  background: #121212;
}

html[data-theme="swiss"] .pc-tag--pin {
  background: #b82418;
  border-color: #b82418;
  color: #ffffff;
}

html[data-theme="swiss"] .nav > a::after {
  height: 2px;
  border-radius: 0;
}

/* ── Ink (水墨宣纸 · 东方): Song-Dynasty Scroll & Cinnabar Seal ── */
html[data-theme="ink"] :is(.writing-overview, .article-body, .about-story) {
  box-shadow:
    inset 0 0 0 4px rgba(250, 248, 243, 0.92),
    inset 0 0 0 5px rgba(23, 22, 20, 0.085),
    var(--card-shadow);
}

html[data-theme="ink"] .eyebrow {
  background: rgba(250, 248, 243, 0.78);
  border-color: rgba(23, 22, 20, 0.16);
  letter-spacing: 0.12em;
}

html[data-theme="ink"] .caret {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: #9e1f1f;
  margin-left: 2px;
}

html[data-theme="ink"] .hero-quote {
  border-left-width: 1.5px;
}

html[data-theme="ink"] .ticker-track span {
  background: rgba(250, 248, 243, 0.88);
  border-color: rgba(23, 22, 20, 0.16);
  letter-spacing: 0.10em;
}

html[data-theme="ink"] .activity-track {
  height: 6px;
}

html[data-theme="ink"] .pc-tag--pin {
  border: 1px solid #9e1f1f;
  background: rgba(158, 31, 31, 0.06);
  color: #9e1f1f;
  letter-spacing: 0.08em;
}

html[data-theme="ink"] .prose blockquote {
  background: rgba(23, 22, 20, 0.032);
  border-left: 2px solid #9e1f1f;
}

html[data-theme="ink"] .prose pre {
  background: rgba(23, 22, 20, 0.045);
  border-color: rgba(23, 22, 20, 0.15);
}

html[data-theme="ink"] .prose hr {
  background: linear-gradient(90deg, transparent, rgba(23, 22, 20, 0.28) 32%, rgba(158, 31, 31, 0.72) 50%, rgba(23, 22, 20, 0.28) 68%, transparent);
}

html[data-theme="ink"] :is(.foot-word, .crumb) {
  letter-spacing: 0.18em;
}

/* ── Midnight (星夜极光 · 暗夜): Borealis Observatory Glass ── */
html[data-theme="midnight"] .hero-title {
  filter: drop-shadow(0 0 28px rgba(56, 189, 248, 0.20));
}

html[data-theme="midnight"] .ticker-track span {
  background: rgba(18, 30, 54, 0.52);
  border-color: rgba(148, 188, 255, 0.20);
}

html[data-theme="midnight"] .prose blockquote {
  background: rgba(12, 22, 42, 0.54);
  border-left-color: #38e2d8;
}

html[data-theme="midnight"] .prose pre {
  background: rgba(6, 11, 22, 0.76);
  border-color: rgba(108, 184, 255, 0.22);
}

html[data-theme="midnight"] .prose mark {
  background: rgba(56, 226, 216, 0.20);
  color: #f0f9ff;
}

html[data-theme="midnight"] .site-head.is-scrolled,
html[data-theme="midnight"] .site-head:has(.burger[aria-expanded='true']) {
  box-shadow: 0 1px 0 rgba(148, 188, 255, 0.16), 0 14px 36px -18px rgba(2, 6, 16, 0.72);
}

/* ── Terminal (极客终端 · 等宽): Phosphor Telemetry Deck ── */
html[data-theme="terminal"] .hero-title {
  filter: drop-shadow(0 0 22px rgba(52, 211, 153, 0.20));
}

html[data-theme="terminal"] :is(.writing-overview, .article-body, .about-story, .panel, .table-wrap, .editor) {
  box-shadow: inset 0 1px 0 rgba(52, 211, 153, 0.16), var(--card-shadow, var(--a-surface-shadow));
}

html[data-theme="terminal"] .eyebrow {
  background: rgba(14, 22, 27, 0.88);
  border-color: rgba(52, 211, 153, 0.28);
  color: #9de2c8;
  font-family: var(--mono);
}

html[data-theme="terminal"] .caret {
  width: 9px;
  height: 18px;
  border-radius: 1px;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.52);
}

html[data-theme="terminal"] .ticker-track span {
  background: rgba(14, 22, 27, 0.86);
  border-color: rgba(52, 211, 153, 0.24);
  font-family: var(--mono);
}

html[data-theme="terminal"] .ticker-track span::before {
  content: '# ';
  color: rgba(34, 211, 238, 0.70);
}

html[data-theme="terminal"] .prose blockquote {
  background: rgba(6, 11, 14, 0.70);
  border: 1px solid rgba(52, 211, 153, 0.16);
  border-left: 2px solid #34d399;
}

html[data-theme="terminal"] .prose pre {
  background: #060a0d;
  border-color: rgba(52, 211, 153, 0.28);
}

html[data-theme="terminal"] .prose mark {
  background: rgba(52, 211, 153, 0.22);
  color: #ecfdf5;
}

html[data-theme="terminal"] .pc-tag--pin {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.46);
  color: #6ee7b7;
}

/* ==========================================================================
   VIII. Hover Signatures & Motion Accessibility
   ========================================================================== */
@media (hover: hover) {
  html[data-theme="swiss"] :is(.post-card, .media-card):hover {
    border-color: #121212;
    transform: translate(-2px, -2px);
  }
  html[data-theme="swiss"] :is(.ticker-track span, .pager-btn:not(.is-off), .end-btn, .back-top, .btn-ghost, .btn--ghost):hover {
    border-color: #121212;
    color: #121212;
    box-shadow: 3px 3px 0 #121212;
    transform: translate(-1.5px, -1.5px);
  }
  html[data-theme="ink"] :is(.post-card, .media-card):hover {
    border-color: rgba(158, 31, 31, 0.48);
  }
  html[data-theme="ink"] :is(.ticker-track span, .pager-btn:not(.is-off), .end-btn, .back-top):hover {
    border-color: rgba(158, 31, 31, 0.48);
    color: #9e1f1f;
  }
  html[data-theme="paper"] :is(.post-card, .media-card):hover {
    border-color: rgba(140, 61, 22, 0.36);
  }
  html[data-theme="paper"] :is(.ticker-track span, .pager-btn:not(.is-off), .end-btn, .back-top):hover {
    border-color: rgba(140, 61, 22, 0.38);
  }
  html[data-theme="midnight"] :is(.ticker-track span, .pager-btn:not(.is-off), .end-btn, .back-top):hover {
    border-color: rgba(56, 226, 216, 0.42);
    box-shadow: 0 8px 24px -6px rgba(2, 6, 16, 0.60), 0 0 20px rgba(56, 226, 216, 0.20);
  }
  html[data-theme="terminal"] :is(.post-card, .media-card):hover {
    border-color: rgba(52, 211, 153, 0.52);
  }
  html[data-theme="terminal"] :is(.ticker-track span, .pager-btn:not(.is-off), .end-btn, .back-top):hover {
    border-color: rgba(52, 211, 153, 0.52);
    color: #6ee7b7;
    box-shadow: 0 0 18px -4px rgba(52, 211, 153, 0.30);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] :is(.bg, .admin-bg).is-live::before,
  html[data-theme] :is(.bg, .admin-bg).is-live::after {
    animation: none !important;
  }
}

html[data-theme] :is(.bg, .admin-bg).is-scrolling::before,
html[data-theme] :is(.bg, .admin-bg).is-scrolling::after {
  animation-play-state: paused, paused !important;
}
