:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #636368;
  --line: rgba(60, 60, 67, 0.12);
  --paper: #e3e6f0;
  --panel: rgba(255, 255, 255, 0.56);
  --accent: #007aff;
  --accent-dark: #0055b3;
  --warm: #ff9500;
  --soft: rgba(0, 122, 255, 0.11);
  --deep: #1d1d1f;
  --header-bg: rgba(235, 238, 246, 0.58);
  --header-line: rgba(255, 255, 255, 0.65);
  --raised-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.64) 0%, rgba(255, 255, 255, 0.38) 100%);
  --popover-bg: linear-gradient(165deg, rgba(252, 253, 255, 0.96) 0%, rgba(241, 244, 251, 0.93) 100%);
  --speech-bg: rgba(255, 255, 255, 0.52);
  --speech-border: rgba(255, 255, 255, 0.72);
  --glass: blur(32px) saturate(210%);
  --glass-edge: rgba(255, 255, 255, 0.76);
  --raised-border: rgba(0, 122, 255, 0.25);
  --alt-bg: rgba(60, 60, 67, 0.06);
  --subtle-bg: rgba(255, 255, 255, 0.72);
  --body-copy: #2c2c2e;
  --content-copy: #1d1d1f;
  --tag-ink: #2c2c2e;
  --code-bg: rgba(24, 26, 32, 0.92);
  --code-ink: #f2f2f7;
  --inline-code: #0055b3;
  --contact-copy: #636368;
  --note: #ff9500;
  --on-accent: #ffffff;
  --panel-bevel: inset 0 1px 1px 0 rgba(255, 255, 255, 0.95), inset 1px 0 0 0 rgba(255, 255, 255, 0.5), inset 0 -1px 0 0 rgba(255, 255, 255, 0.35);
  --shadow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 12px 34px -6px rgba(15, 23, 42, 0.09), 0 3px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-small: 0 0 0 1px rgba(15, 23, 42, 0.05), 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-heavy: 0 0 0 1px rgba(15, 23, 42, 0.08), 0 24px 56px -10px rgba(15, 23, 42, 0.18), 0 6px 18px -2px rgba(15, 23, 42, 0.07);
  --shadow-hover: 0 0 0 1px rgba(0, 122, 255, 0.25), 0 18px 42px -6px rgba(0, 122, 255, 0.18), 0 4px 14px -2px rgba(15, 23, 42, 0.06);
  --focus-ring: #007aff;
  --ease-tactile: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring-snappy: cubic-bezier(0.28, 1.18, 0.38, 1);
  --ease-press: cubic-bezier(0.2, 0, 0, 1);
  /* 专题色谱：iOS 18 浅色调（清透高饱和） */
  --topic-mcu-1: #007aff;
  --topic-mcu-2: #005bb5;
  --topic-mcu-accent: #007aff;
  --topic-linux-1: #ff9500;
  --topic-linux-2: #d97706;
  --topic-linux-accent: #ff9500;
  --topic-qt-1: #34c759;
  --topic-qt-2: #248a3d;
  --topic-qt-accent: #34c759;
  --topic-industrial-1: #ff2d55;
  --topic-industrial-2: #d8153b;
  --topic-industrial-accent: #ff2d55;
  --topic-devops-1: #8b5cf6;
  --topic-devops-2: #6d28d9;
  --topic-devops-accent: #8b5cf6;
  --spectrum-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  --spectrum-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  overflow-x: clip;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #f5f5f7;
    --muted: #98989f;
    --line: rgba(255, 255, 255, 0.12);
    --paper: #06080f;
    --panel: rgba(34, 36, 44, 0.52);
    --accent: #0a84ff;
    --accent-dark: #409cff;
    --warm: #ff9f0a;
    --soft: rgba(10, 132, 255, 0.16);
    --deep: #04050a;
    --header-bg: rgba(10, 12, 20, 0.56);
    --header-line: rgba(255, 255, 255, 0.12);
    --raised-bg: linear-gradient(135deg, rgba(42, 45, 56, 0.58) 0%, rgba(22, 24, 32, 0.40) 100%);
    --popover-bg: linear-gradient(165deg, rgba(38, 41, 52, 0.96) 0%, rgba(24, 26, 35, 0.94) 100%);
    --speech-bg: rgba(26, 31, 42, 0.55);
    --speech-border: rgba(255, 255, 255, 0.18);
    --glass: blur(32px) saturate(200%);
    --glass-edge: rgba(255, 255, 255, 0.18);
    --raised-border: rgba(10, 132, 255, 0.28);
    --alt-bg: rgba(255, 255, 255, 0.06);
    --subtle-bg: rgba(255, 255, 255, 0.11);
    --body-copy: #d1d1d6;
    --content-copy: #f5f5f7;
    --tag-ink: #e5e5ea;
    --code-bg: rgba(10, 12, 16, 0.88);
    --code-ink: #f5f5f7;
    --inline-code: #409cff;
    --contact-copy: #98989f;
    --note: #ff9f0a;
    --on-accent: #ffffff;
    --panel-bevel: inset 0 1px 1px 0 rgba(255, 255, 255, 0.22), inset 1px 0 0 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.55);
    --shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 14px 36px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-small: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 26px 64px rgba(0, 0, 0, 0.78);
    --shadow-hover: 0 0 0 1px rgba(10, 132, 255, 0.35), 0 18px 45px rgba(0, 0, 0, 0.75), 0 0 24px rgba(10, 132, 255, 0.25);
    --focus-ring: #0a84ff;
    /* 专题色谱：iOS 18 深色高饱和霓虹 */
    --topic-mcu-1: #0a84ff;
    --topic-mcu-2: #005bb5;
    --topic-mcu-accent: #409cff;
    --topic-linux-1: #ff9f0a;
    --topic-linux-2: #c97800;
    --topic-linux-accent: #ffb340;
    --topic-qt-1: #30d158;
    --topic-qt-2: #1e8738;
    --topic-qt-accent: #5ce680;
    --topic-industrial-1: #ff375f;
    --topic-industrial-2: #b81436;
    --topic-industrial-accent: #ff6482;
    --topic-devops-1: #a78bfa;
    --topic-devops-2: #7c3aed;
    --topic-devops-accent: #c4b5fd;
    --spectrum-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    --spectrum-shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7;
  --muted: #98989f;
  --line: rgba(255, 255, 255, 0.12);
  --paper: #06080f;
  --panel: rgba(34, 36, 44, 0.52);
  --accent: #0a84ff;
  --accent-dark: #409cff;
  --warm: #ff9f0a;
  --soft: rgba(10, 132, 255, 0.16);
  --deep: #04050a;
  --header-bg: rgba(10, 12, 20, 0.56);
  --header-line: rgba(255, 255, 255, 0.12);
  --raised-bg: linear-gradient(135deg, rgba(42, 45, 56, 0.58) 0%, rgba(22, 24, 32, 0.40) 100%);
  --popover-bg: linear-gradient(165deg, rgba(38, 41, 52, 0.96) 0%, rgba(24, 26, 35, 0.94) 100%);
  --speech-bg: rgba(26, 31, 42, 0.55);
  --speech-border: rgba(255, 255, 255, 0.18);
  --glass: blur(32px) saturate(200%);
  --glass-edge: rgba(255, 255, 255, 0.18);
  --raised-border: rgba(10, 132, 255, 0.28);
  --alt-bg: rgba(255, 255, 255, 0.06);
  --subtle-bg: rgba(255, 255, 255, 0.11);
  --body-copy: #d1d1d6;
  --content-copy: #f5f5f7;
  --tag-ink: #e5e5ea;
  --code-bg: rgba(10, 12, 16, 0.88);
  --code-ink: #f5f5f7;
  --inline-code: #409cff;
  --contact-copy: #98989f;
  --note: #ff9f0a;
  --on-accent: #ffffff;
  --panel-bevel: inset 0 1px 1px 0 rgba(255, 255, 255, 0.22), inset 1px 0 0 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.55);
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 14px 36px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-small: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-heavy: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 26px 64px rgba(0, 0, 0, 0.78);
  --shadow-hover: 0 0 0 1px rgba(10, 132, 255, 0.35), 0 18px 45px rgba(0, 0, 0, 0.75), 0 0 24px rgba(10, 132, 255, 0.25);
  --focus-ring: #0a84ff;
  --topic-mcu-1: #0a84ff;
  --topic-mcu-2: #005bb5;
  --topic-mcu-accent: #409cff;
  --topic-linux-1: #ff9f0a;
  --topic-linux-2: #c97800;
  --topic-linux-accent: #ffb340;
  --topic-qt-1: #30d158;
  --topic-qt-2: #1e8738;
  --topic-qt-accent: #5ce680;
  --topic-industrial-1: #ff375f;
  --topic-industrial-2: #b81436;
  --topic-industrial-accent: #ff6482;
  --topic-devops-1: #a78bfa;
  --topic-devops-2: #7c3aed;
  --topic-devops-accent: #c4b5fd;
  --spectrum-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  --spectrum-shadow: none;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* 瑞士国际网格风格 (Swiss Grid) */
:root[data-theme="swiss"] {
  color-scheme: light;
  --ink: #111111;
  --muted: #595959;
  --line: rgba(17, 17, 17, 0.12);
  --paper: #eeece5;
  --panel: rgba(255, 255, 255, 0.58);
  --accent: #e63329;
  --accent-dark: #cc251b;
  --warm: #d84333;
  --soft: rgba(230, 51, 41, 0.1);
  --deep: #111111;
  --header-bg: rgba(238, 236, 229, 0.62);
  --header-line: rgba(255, 255, 255, 0.65);
  --raised-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.66) 0%, rgba(255, 255, 255, 0.42) 100%);
  --popover-bg: linear-gradient(165deg, rgba(252, 251, 248, 0.96) 0%, rgba(242, 240, 234, 0.94) 100%);
  --speech-bg: rgba(255, 255, 255, 0.58);
  --speech-border: rgba(230, 51, 41, 0.28);
  --glass-edge: rgba(255, 255, 255, 0.78);
  --raised-border: rgba(230, 51, 41, 0.28);
  --alt-bg: rgba(17, 17, 17, 0.055);
  --subtle-bg: rgba(255, 255, 255, 0.74);
  --body-copy: #222222;
  --content-copy: #141414;
  --tag-ink: #333333;
  --code-bg: rgba(17, 17, 17, 0.92);
  --code-ink: #f5f5f2;
  --inline-code: #cc251b;
  --contact-copy: #cbd7dd;
  --note: #cc251b;
  --on-accent: #ffffff;
  --panel-bevel: inset 0 1px 1px 0 rgba(255, 255, 255, 0.92), inset 1px 0 0 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 0 0 1px rgba(17, 17, 17, 0.06), 0 12px 30px -4px rgba(17, 17, 17, 0.1);
  --shadow-small: 0 0 0 1px rgba(17, 17, 17, 0.05), 0 4px 12px -2px rgba(17, 17, 17, 0.07);
  --shadow-hover: 0 0 0 1px rgba(230, 51, 41, 0.25), 0 16px 36px -4px rgba(230, 51, 41, 0.2);
  --focus-ring: #e63329;
  --topic-mcu-1: #1c858f;
  --topic-mcu-2: #0d575f;
  --topic-mcu-accent: #1c858f;
  --topic-linux-1: #e06e12;
  --topic-linux-2: #a84a04;
  --topic-linux-accent: #e06e12;
  --topic-qt-1: #348f52;
  --topic-qt-2: #1d5c32;
  --topic-qt-accent: #348f52;
  --topic-industrial-1: #e63329;
  --topic-industrial-2: #a81a12;
  --topic-industrial-accent: #e63329;
  --topic-devops-1: #7c3aed;
  --topic-devops-2: #4c1d95;
  --topic-devops-accent: #7c3aed;
  --spectrum-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --spectrum-shadow: 0 1px 2px rgba(17, 17, 17, 0.08);
}

/* 深空科技终端风格 (Orbital HUD) */
:root[data-theme="hud"] {
  color-scheme: dark;
  --ink: #d8f3fe;
  --muted: #6f95ad;
  --line: rgba(82, 216, 232, 0.18);
  --paper: #040b15;
  --panel: rgba(7, 21, 38, 0.52);
  --accent: #52d8e8;
  --accent-dark: #7be4f0;
  --warm: #ffd166;
  --soft: rgba(82, 216, 232, 0.14);
  --deep: #02070e;
  --header-bg: rgba(4, 11, 21, 0.58);
  --header-line: rgba(82, 216, 232, 0.22);
  --raised-bg: linear-gradient(135deg, rgba(10, 28, 50, 0.62) 0%, rgba(5, 15, 28, 0.42) 100%);
  --popover-bg: linear-gradient(165deg, rgba(10, 26, 46, 0.97) 0%, rgba(5, 14, 26, 0.95) 100%);
  --speech-bg: rgba(6, 20, 36, 0.58);
  --speech-border: rgba(82, 216, 232, 0.38);
  --glass-edge: rgba(82, 216, 232, 0.32);
  --raised-border: rgba(82, 216, 232, 0.38);
  --alt-bg: rgba(82, 216, 232, 0.07);
  --subtle-bg: rgba(82, 216, 232, 0.12);
  --body-copy: #bfe3f2;
  --content-copy: #cce9f5;
  --tag-ink: #70c9d6;
  --code-bg: rgba(2, 6, 12, 0.88);
  --code-ink: #52d8e8;
  --inline-code: #52d8e8;
  --contact-copy: #cbd7dd;
  --note: #ffd166;
  --on-accent: #02070e;
  --panel-bevel: inset 0 1px 1px 0 rgba(82, 216, 232, 0.42), inset 1px 0 0 0 rgba(82, 216, 232, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 16px 42px -4px rgba(0, 0, 0, 0.75);
  --shadow-small: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 8px 22px -2px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 6px 14px rgba(82, 216, 232, 0.2), 0 20px 48px -4px rgba(82, 216, 232, 0.35);
  --focus-ring: #52d8e8;
  --topic-mcu-1: #00b4d8;
  --topic-mcu-2: #006699;
  --topic-mcu-accent: #52d8e8;
  --topic-linux-1: #ffb703;
  --topic-linux-2: #c96f00;
  --topic-linux-accent: #ffd166;
  --topic-qt-1: #2ecc71;
  --topic-qt-2: #1a7a42;
  --topic-qt-accent: #3bf08b;
  --topic-industrial-1: #ff4d6d;
  --topic-industrial-2: #b01738;
  --topic-industrial-accent: #ff4d6d;
  --topic-devops-1: #c084fc;
  --topic-devops-2: #9333ea;
  --topic-devops-accent: #e9d5ff;
  --spectrum-bevel: inset 0 1px 0 rgba(82, 216, 232, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.6);
  --spectrum-shadow: 0 0 8px rgba(82, 216, 232, 0.2);
}

/* 极简单色建筑风格 (Minimal Monochrome) */
:root[data-theme="mono"] {
  color-scheme: light;
  --ink: #141414;
  --muted: #686868;
  --line: rgba(20, 20, 20, 0.11);
  --paper: #eeece6;
  --panel: rgba(255, 255, 255, 0.56);
  --accent: #141414;
  --accent-dark: #000000;
  --warm: #4a4a4a;
  --soft: rgba(20, 20, 20, 0.08);
  --deep: #0a0a0a;
  --header-bg: rgba(238, 236, 230, 0.6);
  --header-line: rgba(255, 255, 255, 0.65);
  --raised-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.66) 0%, rgba(255, 255, 255, 0.40) 100%);
  --popover-bg: linear-gradient(165deg, rgba(252, 251, 248, 0.96) 0%, rgba(240, 238, 232, 0.94) 100%);
  --speech-bg: rgba(252, 252, 252, 0.58);
  --speech-border: rgba(20, 20, 20, 0.22);
  --glass-edge: rgba(255, 255, 255, 0.78);
  --raised-border: rgba(20, 20, 20, 0.22);
  --alt-bg: rgba(20, 20, 20, 0.055);
  --subtle-bg: rgba(255, 255, 255, 0.72);
  --body-copy: #262626;
  --content-copy: #141414;
  --tag-ink: #525252;
  --code-bg: rgba(20, 20, 20, 0.92);
  --code-ink: #faf9f6;
  --inline-code: #141414;
  --contact-copy: #cbd7dd;
  --note: #4a4a4a;
  --on-accent: #ffffff;
  --panel-bevel: inset 0 1px 1px 0 rgba(255, 255, 255, 0.95), inset 1px 0 0 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 12px 28px -4px rgba(0, 0, 0, 0.1);
  --shadow-small: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 6px 16px -2px rgba(0, 0, 0, 0.07);
  --shadow-hover: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 16px 36px -4px rgba(0, 0, 0, 0.16);
  --focus-ring: #141414;
  --topic-mcu-1: #4e5860;
  --topic-mcu-2: #323a40;
  --topic-mcu-accent: #4e5860;
  --topic-linux-1: #686259;
  --topic-linux-2: #474139;
  --topic-linux-accent: #686259;
  --topic-qt-1: #545c55;
  --topic-qt-2: #373d38;
  --topic-qt-accent: #545c55;
  --topic-industrial-1: #424242;
  --topic-industrial-2: #242424;
  --topic-industrial-accent: #424242;
  --topic-devops-1: #383838;
  --topic-devops-2: #1e1e1e;
  --topic-devops-accent: #383838;
  --spectrum-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  --spectrum-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.motion-reveal {
  opacity: 0;
  transform: translate3d(0, 20px, 0) scale(0.978);
  transition:
    opacity 520ms var(--ease-spring),
    transform 600ms var(--ease-spring);
  transition-delay: calc(var(--stagger-idx, 0) * 48ms);
  will-change: opacity, transform;
}

.motion-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.motion-reveal.is-settled {
  transform: none;
  transition-delay: 0ms;
  will-change: auto;
}

@media (max-width: 620px) {
  .motion-reveal {
    transform: translate3d(0, 12px, 0) scale(0.986);
    transition-duration: 380ms, 420ms;
    transition-delay: calc(var(--stagger-idx, 0) * 32ms);
  }
}

.back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 40;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--raised-border);
  border-radius: 50%;
  background: var(--raised-bg);
  color: var(--accent-dark);
  font: inherit;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
  box-shadow: var(--shadow-small);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.86);
  transition:
    opacity 280ms var(--ease-spring),
    transform 380ms var(--ease-spring-bounce),
    box-shadow 260ms var(--ease-spring),
    background-color 220ms ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

@media (hover: hover) {
  .back-to-top:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: var(--shadow-hover);
  }
}

.back-to-top:active,
.back-to-top.is-pressing {
  transform: translateY(0) scale(0.9) !important;
  transition-duration: 90ms !important;
}
/* 当悬浮示波器工作台激活时，隐藏全局回到顶部按钮，避免与工作台内置的 #dockToTop 发生视觉层叠与遮挡 */
body.has-docked-robot .back-to-top {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(10px) !important;
}

@supports selector(:has(*)) {
  body:has(.robot-dock.is-docked-float) .back-to-top {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(10px) !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  line-break: strict;
  overflow-x: clip;
}

.nav-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-actions .nav-links {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.theme-picker {
  position: relative;
  flex: 0 0 auto;
}

.theme-toggle {
  display: inline-flex;
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-small);
  transition: transform 0.36s var(--ease-spring-bounce), border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.24s var(--ease-spring);
}

.theme-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.theme-toggle[aria-expanded="true"] [data-theme-current-icon] {
  transform: rotate(18deg) scale(1.08);
}

@media (hover: hover) {
  .theme-toggle:hover {
    border-color: var(--accent);
    background: var(--soft);
    color: var(--accent);
    transform: scale(1.06);
    box-shadow: var(--shadow);
  }

  .theme-toggle:hover [data-theme-current-icon] {
    transform: rotate(18deg) scale(1.08);
  }
}

.theme-toggle:active,
.theme-toggle.is-pressing {
  transform: scale(0.9) !important;
  transition-duration: 90ms !important;
}

.theme-icon,
.theme-option svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.34s var(--ease-spring-bounce);
}

[data-theme-current-icon] {
  display: grid;
  place-items: center;
  transition: transform 0.38s var(--ease-spring-bounce);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  width: 236px;
  max-height: min(540px, calc(100vh - 100px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid var(--glass-edge);
  border-radius: 20px;
  background: var(--popover-bg);
  backdrop-filter: blur(36px) saturate(210%);
  -webkit-backdrop-filter: blur(36px) saturate(210%);
  box-shadow: var(--panel-bevel), var(--shadow-heavy);
  transform-origin: top right;
  animation: ios-menu-in 0.32s var(--ease-spring-snappy);
}

@keyframes ios-menu-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu-title {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  user-select: none;
}

.theme-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}

.theme-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  width: 100%;
  padding: 9px 12px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.28s var(--ease-spring-bounce), background-color 0.18s ease, color 0.18s ease;
}

.theme-option[aria-checked="true"] {
  background: var(--soft);
  color: var(--accent);
}

@media (hover: hover) {
  .theme-option:hover {
    background: var(--soft);
    color: var(--accent);
    transform: translateX(3px);
  }

  .theme-option:hover svg {
    transform: scale(1.14) rotate(-6deg);
  }
}

.theme-option:active,
.theme-option.is-pressing {
  transform: scale(0.95) !important;
  transition-duration: 80ms !important;
}

.theme-option-label {
  font-size: 13.5px;
  font-weight: 600;
}

.theme-option-check {
  opacity: 0;
  transform: scale(0.4);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  color: var(--accent);
  transition: opacity 0.2s ease, transform 0.34s var(--ease-spring-bounce);
}

.theme-option[aria-checked="true"] .theme-option-check {
  opacity: 1;
  transform: scale(1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

@media (max-width: 860px) {
  .topbar-actions {
    gap: 10px;
  }
}

@media (max-width: 620px) {
  .theme-toggle {
    width: 38px;
    padding: 0;
  }

  .theme-toggle-label {
    display: none;
  }

  .search-kbd {
    display: none;
  }
}

code,
kbd,
pre,
samp,
.mono,
.item-date,
.status-time,
time {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Sarasa Mono SC", "Noto Sans Mono CJK SC", "WenQuanYi Micro Hei Mono", "Liberation Mono", Menlo, monospace;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--deep);
  color: var(--on-accent);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .motion-reveal {
    opacity: 1;
    transform: none;
  }

  .spectrum-item {
    transition: none !important;
  }
}

/* 顶部微型阅读进度条 (iOS 18 dynamic gradient) */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #007aff, #5856d6 50%, #af52de);
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 1px 8px rgba(0, 122, 255, 0.4);
  transition: transform 60ms linear;
}


/* 色谱指示条与工作台小机器人（背景示波器波形 & 复古仪器风） */
.theme-spectrum-wrap {
  margin: 14px 0 26px;
  position: relative;
}

.robot-stage {
  position: relative;
  width: 100%;
  height: 114px;
  margin-bottom: -5px;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  user-select: none;
}

.scope-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.stage-meta {
  position: absolute;
  bottom: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.78;
  z-index: 2;
}

.scope-channel {
  left: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raised-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.scope-channel:hover,
.scope-channel:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
  opacity: 1;
}

.scope-channel strong {
  font-weight: 700;
  color: var(--ink);
}

.stage-meta-right {
  right: 6px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.stage-meta-dot {
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 560px) {
  .stage-meta-right {
    display: none;
  }
}

.robot-dock {
  position: relative;
  z-index: 3;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

/* 文章目录上方的伴侣机器人卡片 */
.article-robot-card {
  position: relative;
  background: var(--raised-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px 2px;
  box-shadow: var(--panel-bevel), var(--shadow-small);
  overflow: visible;
}

.article-robot-card .scope-canvas {
  border-radius: 9px;
}

.robot-stage-article {
  height: 96px;
  margin-bottom: 0;
}

.robot-stage-article .retro-robot-svg {
  width: 108px;
  height: 93px;
}

.robot-stage-article .scope-channel {
  bottom: auto;
  top: 7px;
  left: 6px;
  padding: 1.5px 7px;
  font-size: 10px;
}

.robot-stage-article .stage-meta-right {
  bottom: auto;
  top: 8px;
  right: 6px;
  font-size: 10px;
}

/* 页面向下滑动离开舞台时：小机器人平滑进入右下角悬浮工作台（固定常驻） */
.robot-dock.is-docked-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 95;
  padding: 8px 10px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--raised-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--panel-bevel), 0 14px 38px rgba(0, 0, 0, 0.28), 0 3px 10px rgba(0, 0, 0, 0.12);
  transform: scale(0.82);
  transform-origin: bottom right;
  animation: robot-dock-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes robot-dock-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.68);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(0.82);
  }
}

.dock-to-top {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.16s ease;
  opacity: 0.82;
  z-index: 5;
}

.robot-dock.is-docked-float .dock-to-top {
  display: inline-flex;
}

.dock-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1.5px);
  opacity: 1;
}

.robot-dock.is-docked-float .robot-speech {
  bottom: calc(100% + 8px);
  right: 0;
  left: auto;
  transform: none;
}

.robot-dock.is-docked-float .robot-speech::after {
  left: auto;
  right: 28px;
  transform: none;
}

@media (max-width: 600px) {
  .robot-dock.is-docked-float {
    bottom: 14px;
    right: 14px;
    transform: scale(0.72);
  }
}

.retro-robot-container {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.retro-robot-container:hover,
.retro-robot-container:focus-visible {
  transform: translateY(-2px);
}

.retro-robot-container:active {
  transform: translateY(0) scale(0.97);
}

.retro-robot-svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 6px 14px rgba(17, 25, 29, 0.2));
  transition: filter 0.25s ease;
}

:root[data-theme="dark"] .retro-robot-svg,
:root[data-theme="hud"] .retro-robot-svg {
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.48));
}

/* 复古仪器小机器人 SVG 主题自适应配色 */
.robot-shadow {
  fill: rgba(17, 25, 29, 0.22);
}

.robot-chassis {
  fill: var(--panel);
  stroke: var(--muted);
  stroke-width: 1.5;
}

.robot-chassis-inner {
  fill: var(--subtle-bg);
  stroke: var(--line);
  stroke-width: 1;
}

.robot-metal-dark,
.robot-ear,
.robot-foot {
  fill: var(--alt-bg);
  stroke: var(--muted);
  stroke-width: 1.25;
}

.robot-stroke-heavy {
  stroke: var(--muted);
  stroke-width: 1.8;
  fill: none;
}

.robot-stroke-thin {
  stroke: var(--muted);
  stroke-width: 0.9;
  opacity: 0.7;
}

.robot-screw {
  fill: var(--muted);
  opacity: 0.75;
}

.robot-crt-bezel {
  fill: var(--deep);
  stroke: var(--line);
  stroke-width: 1.1;
}

.robot-crt-screen {
  fill: var(--code-bg);
}

.robot-crt-grid {
  stroke: var(--accent-dark);
  stroke-opacity: 0.14;
  stroke-width: 0.75;
}

.robot-crt-glare {
  stroke: var(--code-ink);
  stroke-opacity: 0.22;
  stroke-width: 1.1;
  fill: none;
}

.robot-eye {
  fill: var(--accent-dark);
}

:root:not([data-theme="dark"]):not([data-theme="hud"]):not([data-theme="swiss"]):not([data-theme="mono"]) .robot-eye,
:root[data-theme="light"] .robot-eye {
  fill: #80c7a7;
}

.robot-eye-glint {
  fill: #ffffff;
  opacity: 0.92;
}

.robot-eyes-happy {
  opacity: 0;
  transition: opacity 0.14s ease;
}

.retro-robot-container.is-booped .robot-pupils-normal {
  opacity: 0;
}

.retro-robot-container.is-booped .robot-eyes-happy {
  opacity: 1;
}

.robot-happy-arc {
  stroke: var(--warm);
  stroke-width: 2.3;
  fill: none;
}

.robot-cheek {
  fill: var(--warm);
  opacity: 0.58;
}

.robot-mouth {
  stroke: var(--code-ink);
  stroke-width: 1.5;
  opacity: 0.84;
  fill: none;
}

.antenna-bulb {
  fill: var(--warm);
  stroke: var(--ink);
  stroke-width: 1;
}

.antenna-glow-ring {
  fill: var(--warm);
  opacity: 0.24;
  transform-origin: 80px 5.5px;
  animation: antenna-pulse 2.4s infinite ease-in-out;
}

.retro-robot-container.is-booped .antenna-glow-ring {
  opacity: 0.78;
  transform: scale(1.45);
}

.robot-arm-tube {
  stroke: var(--muted);
  stroke-width: 4;
  stroke-dasharray: 2.5 1.2;
  fill: none;
}

.robot-joint {
  fill: var(--panel);
  stroke: var(--muted);
  stroke-width: 1.2;
}

.robot-claw {
  stroke: var(--accent-dark);
  stroke-width: 2;
  fill: none;
}

.robot-meter-face {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 1;
}

.robot-meter-arc {
  stroke: var(--muted);
  stroke-width: 0.9;
  stroke-dasharray: 2 1.5;
  fill: none;
  opacity: 0.75;
}

.robot-meter-needle {
  stroke: var(--note);
  stroke-width: 1.4;
}

.robot-jack {
  stroke: var(--line);
  stroke-width: 0.75;
}

.robot-knob {
  fill: var(--alt-bg);
  stroke: var(--muted);
  stroke-width: 1.2;
}

.robot-knob-mark {
  stroke: var(--warm);
  stroke-width: 1.4;
}

.robot-vent {
  stroke: var(--line);
  stroke-width: 1.5;
}

.robot-badge-text {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 6.5px;
  font-weight: 700;
  fill: var(--muted);
  letter-spacing: 0.05em;
}

/* 机器人状态对话气泡（语义清晰，受控弹出） */
.robot-speech {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 6px);
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  width: max-content;
  max-width: min(380px, 88vw);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  background: var(--speech-bg, rgba(255, 255, 255, 0.55));
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border: 1px solid var(--speech-border, var(--glass-edge));
  border-radius: 8px;
  padding: 5px 11px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 10;
}

.speech-prefix {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--accent-dark);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.robot-speech.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.robot-speech::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: var(--speech-border, var(--glass-edge)) transparent transparent transparent;
}

/* 机器人微动动画 */
@keyframes antenna-pulse {
  0%, 100% { opacity: 0.18; transform: scale(0.95); }
  50% { opacity: 0.55; transform: scale(1.22); }
}

@keyframes robot-blink {
  0%, 93%, 97%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.08); }
}

.robot-eye-left {
  transform-origin: 66px 51px;
  animation: robot-blink 4.2s infinite ease-in-out;
}

.robot-eye-right {
  transform-origin: 94px 51px;
  animation: robot-blink 4.2s infinite ease-in-out;
}

@keyframes robot-wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

.robot-wave-arm {
  transform-origin: 116px 96px;
  animation: robot-wave 3.6s infinite ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .antenna-glow-ring,
  .robot-eye-left,
  .robot-eye-right,
  .robot-wave-arm {
    animation: none !important;
  }
  .retro-robot-container {
    transition: none !important;
  }
}



.theme-spectrum {
  display: flex;
  height: 36px;
  border-radius: 9999px;
  overflow: hidden;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--alt-bg);
  box-shadow: var(--shadow-small);
}

.spectrum-item {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: linear-gradient(145deg, var(--item-color-1), var(--item-color-2));
  opacity: 0.98;
  border-radius: 9999px;
  box-shadow: var(--spectrum-bevel), var(--spectrum-shadow);
  transition: flex 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease;
}

.spectrum-item:hover,
.spectrum-item:focus-visible,
.spectrum-item.is-active {
  flex: 2.8;
  opacity: 1;
  z-index: 2;
  filter: brightness(1.06) saturate(1.08);
}

.spectrum-item.is-active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65), var(--spectrum-bevel), var(--spectrum-shadow);
}

/* 专题色谱后备类绑定 */
.spectrum-item[data-topic="mcu"],
.spectrum-item--mcu {
  --item-color-1: var(--topic-mcu-1);
  --item-color-2: var(--topic-mcu-2);
}
.spectrum-item[data-topic="linux"],
.spectrum-item--linux {
  --item-color-1: var(--topic-linux-1);
  --item-color-2: var(--topic-linux-2);
}
.spectrum-item[data-topic="qt"],
.spectrum-item--qt {
  --item-color-1: var(--topic-qt-1);
  --item-color-2: var(--topic-qt-2);
}
.spectrum-item[data-topic="industrial"],
.spectrum-item--industrial {
  --item-color-1: var(--topic-industrial-1);
  --item-color-2: var(--topic-industrial-2);
}
.spectrum-item[data-topic="devops"],
.spectrum-item--devops {
  --item-color-1: var(--topic-devops-1);
  --item-color-2: var(--topic-devops-2);
}

.spectrum-tooltip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  color: #faf9f6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.spectrum-item:hover .spectrum-tooltip,
.spectrum-item:focus-visible .spectrum-tooltip,
.spectrum-item.is-active .spectrum-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.spectrum-tooltip small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, monospace;
  font-weight: 500;
  line-height: 1;
  opacity: 0.9;
  margin-left: 5px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 5px;
  border-radius: 4px;
}

/* 主题专属进度条调色 */
:root[data-theme="swiss"] .reading-progress {
  background: linear-gradient(90deg, #e63329, #111111);
}

:root[data-theme="hud"] .reading-progress {
  background: linear-gradient(90deg, #52d8e8, #ffd166);
  box-shadow: 0 1px 8px rgba(82, 216, 232, 0.5);
}

:root[data-theme="mono"] .reading-progress {
  background: linear-gradient(90deg, #141414, #737373);
}

/* ==========================================================================
   特种底纹与复古电子硬件质感系统（Retro Electronics Skins）
   方案 A: 工程坐标网格 (grid)
   方案 B: 洞洞板覆铜阵列 (matrix)
   方案 C: 复古仪器前面板全套 (chassis)
   默认模式: 清爽素雅 (default)
   ========================================================================== */
.site-ambience {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 48%, rgba(182, 186, 204, 0.36) 100%),
    radial-gradient(circle at 16% 16%, rgba(0, 122, 255, 0.22) 0%, transparent 46%),
    radial-gradient(circle at 85% 18%, rgba(120, 86, 235, 0.19) 0%, transparent 44%),
    radial-gradient(circle at 38% 52%, rgba(50, 173, 230, 0.15) 0%, transparent 48%),
    radial-gradient(circle at 22% 84%, rgba(255, 149, 0, 0.14) 0%, transparent 46%),
    radial-gradient(circle at 82% 84%, rgba(52, 199, 89, 0.16) 0%, transparent 45%);
  background-size: 100% 100%;
  opacity: 0.98;
  transition: opacity 240ms ease;
}

:root[data-theme="hud"] .site-ambience {
  background-image:
    radial-gradient(circle at 50% 12%, rgba(82, 216, 232, 0.24) 0%, transparent 55%),
    radial-gradient(circle at 85% 75%, rgba(112, 201, 214, 0.16) 0%, transparent 45%);
  opacity: 1;
}

:root[data-theme="dark"] .site-ambience {
  background-image:
    radial-gradient(circle at 18% 15%, rgba(10, 132, 255, 0.26) 0%, transparent 48%),
    radial-gradient(circle at 85% 22%, rgba(110, 92, 240, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 46% 58%, rgba(50, 173, 230, 0.16) 0%, transparent 50%),
    radial-gradient(circle at 22% 86%, rgba(255, 159, 10, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 82% 88%, rgba(48, 209, 88, 0.14) 0%, transparent 45%);
  opacity: 1;
}

:root[data-theme="swiss"] .site-ambience {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(230, 51, 41, 0.13) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(28, 133, 143, 0.11) 0%, transparent 45%);
  opacity: 0.95;
}

:root[data-theme="mono"] .site-ambience {
  background-image:
    radial-gradient(circle at 25% 20%, rgba(20, 20, 20, 0.08) 0%, transparent 48%),
    radial-gradient(circle at 80% 78%, rgba(80, 80, 80, 0.08) 0%, transparent 48%);
  opacity: 0.9;
}

/* --------------------------------------------------------------------------
   方案 A: 经典工程坐标网格 & 示波器荧光分划板 (grid)
   -------------------------------------------------------------------------- */
:root[data-skin="grid"] .site-ambience {
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.48) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 48%, rgba(182, 186, 204, 0.34) 100%),
    radial-gradient(circle at 16% 16%, rgba(0, 122, 255, 0.22) 0%, transparent 46%),
    radial-gradient(circle at 85% 18%, rgba(120, 86, 235, 0.19) 0%, transparent 44%),
    radial-gradient(circle at 38% 52%, rgba(50, 173, 230, 0.15) 0%, transparent 48%),
    radial-gradient(circle at 22% 84%, rgba(255, 149, 0, 0.14) 0%, transparent 46%),
    radial-gradient(circle at 82% 84%, rgba(52, 199, 89, 0.16) 0%, transparent 45%),
    linear-gradient(rgba(0, 122, 255, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 122, 255, 0.065) 1px, transparent 1px),
    linear-gradient(rgba(0, 122, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 122, 255, 0.024) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  opacity: 0.98;
}

@media (prefers-color-scheme: dark) {
  :root[data-skin="grid"]:not([data-theme]) .site-ambience {
    background-image:
      radial-gradient(circle at 20% 15%, rgba(10, 132, 255, 0.18) 0%, transparent 50%),
      radial-gradient(circle at 85% 25%, rgba(94, 92, 230, 0.16) 0%, transparent 45%),
      radial-gradient(circle at 50% 85%, rgba(50, 173, 230, 0.12) 0%, transparent 50%),
      linear-gradient(rgba(10, 132, 255, 0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(10, 132, 255, 0.06) 1px, transparent 1px),
      linear-gradient(rgba(10, 132, 255, 0.02) 1px, transparent 1px),
      linear-gradient(90deg, rgba(10, 132, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 128px 128px, 128px 128px, 32px 32px, 32px 32px;
    opacity: 0.98;
  }
}

:root[data-skin="grid"][data-theme="dark"] .site-ambience {
  background-image:
    radial-gradient(circle at 20% 15%, rgba(10, 132, 255, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 85% 25%, rgba(94, 92, 230, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(50, 173, 230, 0.12) 0%, transparent 50%),
    linear-gradient(rgba(10, 132, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 132, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(10, 132, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 132, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 128px 128px, 128px 128px, 32px 32px, 32px 32px;
  opacity: 0.98;
}

:root[data-skin="grid"][data-theme="hud"] .site-ambience {
  background-image:
    radial-gradient(ellipse at 50% 20%, rgba(82, 216, 232, 0.15), transparent 65%),
    linear-gradient(rgba(82, 216, 232, 0.08) 1.2px, transparent 1.2px),
    linear-gradient(90deg, rgba(82, 216, 232, 0.08) 1.2px, transparent 1.2px),
    linear-gradient(rgba(82, 216, 232, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 216, 232, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 128px 128px, 128px 128px, 32px 32px, 32px 32px;
  opacity: 0.95;
}

:root[data-skin="grid"][data-theme="swiss"] .site-ambience {
  background-image:
    linear-gradient(rgba(230, 51, 41, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 51, 41, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(17, 17, 17, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.03) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  opacity: 0.9;
}

:root[data-skin="grid"][data-theme="mono"] .site-ambience {
  background-image:
    linear-gradient(rgba(20, 20, 20, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 20, 0.06) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   方案 B: 洞洞板 / 覆铜板打孔焊接阵列 (matrix)
   -------------------------------------------------------------------------- */
:root[data-skin="matrix"] .site-ambience {
  background-image:
    radial-gradient(circle at 11px 11px, var(--paper) 1.2px, var(--line) 2.2px, transparent 3.2px);
  background-size: 22px 22px;
  opacity: 0.9;
}

@media (prefers-color-scheme: dark) {
  :root[data-skin="matrix"]:not([data-theme]) .site-ambience {
    background-image:
      radial-gradient(circle at 11px 11px, #11191d 1.2px, rgba(120, 213, 220, 0.28) 2.2px, transparent 3.2px);
    background-size: 22px 22px;
    opacity: 0.9;
  }
}

:root[data-skin="matrix"][data-theme="dark"] .site-ambience {
  background-image:
    radial-gradient(circle at 11px 11px, #11191d 1.2px, rgba(120, 213, 220, 0.28) 2.2px, transparent 3.2px);
  background-size: 22px 22px;
  opacity: 0.9;
}

:root[data-skin="matrix"][data-theme="hud"] .site-ambience {
  background-image:
    radial-gradient(circle at 11px 11px, #040b15 1.2px, rgba(82, 216, 232, 0.35) 2.2px, transparent 3.2px);
  background-size: 22px 22px;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   方案 C: 复古电子仪器前面板全套 (chassis)
   包含复合坐标网格 + 极细 CRT 水平微扫描线 + 工业十字准星
   -------------------------------------------------------------------------- */
:root[data-skin="chassis"] .site-ambience {
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.02) 0px, rgba(0, 0, 0, 0.02) 1px, transparent 1px, transparent 4px),
    linear-gradient(rgba(15, 129, 141, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 129, 141, 0.07) 1px, transparent 1px);
  background-size: 100% 4px, 24px 24px, 24px 24px;
  opacity: 0.92;
}

@media (prefers-color-scheme: dark) {
  :root[data-skin="chassis"]:not([data-theme]) .site-ambience {
    background-image:
      repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1.5px, transparent 1.5px, transparent 4px),
      linear-gradient(rgba(120, 213, 220, 0.07) 1px, transparent 1px),
      linear-gradient(90deg, rgba(120, 213, 220, 0.07) 1px, transparent 1px);
    background-size: 100% 4px, 28px 28px, 28px 28px;
    opacity: 0.95;
  }
}

:root[data-skin="chassis"][data-theme="dark"] .site-ambience {
  background-image:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1.5px, transparent 1.5px, transparent 4px),
    linear-gradient(rgba(120, 213, 220, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 213, 220, 0.07) 1px, transparent 1px);
  background-size: 100% 4px, 28px 28px, 28px 28px;
  opacity: 0.95;
}

:root[data-skin="chassis"][data-theme="hud"] .site-ambience {
  background-image:
    radial-gradient(ellipse at 50% 20%, rgba(82, 216, 232, 0.18), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.3) 0px, rgba(0, 0, 0, 0.3) 1.5px, transparent 1.5px, transparent 4px),
    linear-gradient(rgba(82, 216, 232, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 216, 232, 0.09) 1px, transparent 1px);
  background-size: 100% 100%, 100% 4px, 28px 28px, 28px 28px;
  opacity: 1;
}

/* 方案 C 细节: 面板卡片四角机械定位十字刻度标 */
:root[data-skin="chassis"] .article-item,
:root[data-skin="chassis"] .panel,
:root[data-skin="chassis"] .project-feature,
:root[data-skin="chassis"] .article-interactive-widget {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 20px rgba(0, 0, 0, 0.04);
}

:root[data-skin="chassis"] .article-item::before,
:root[data-skin="chassis"] .panel::before,
:root[data-skin="chassis"] .project-feature::before {
  content: "+";
  position: absolute;
  top: 4px;
  left: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.38;
  pointer-events: none;
}

:root[data-skin="chassis"] .article-item::after,
:root[data-skin="chassis"] .panel::after,
:root[data-skin="chassis"] .project-feature::after {
  content: "+";
  position: absolute;
  top: 4px;
  right: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.38;
  pointer-events: none;
}

/* 方案 C 细节: 状态时钟微荧光余辉 */
:root[data-skin="chassis"] .status-time {
  text-shadow: 0 0 5px currentColor;
  letter-spacing: 0.5px;
}

/* 嵌入式系统心跳指示灯与状态时钟 (iOS 18 Dynamic Island Pill) */
.system-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-family: ui-monospace, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
  user-select: none;
  white-space: nowrap;
  box-shadow: var(--shadow-small);
  transition: all 0.2s var(--ease-spring);
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 rgba(52, 199, 89, 0.6);
  animation: pulse-glow 2.2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
  }
  65% {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

:root[data-theme="hud"] .status-pulse {
  background: var(--accent);
  box-shadow: 0 0 0 rgba(82, 216, 232, 0.6);
  animation-name: pulse-glow-hud;
}

@keyframes pulse-glow-hud {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(82, 216, 232, 0.85);
  }
  65% {
    transform: scale(1.05);
    box-shadow: 0 0 0 7px rgba(82, 216, 232, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(82, 216, 232, 0);
  }
}

:root[data-theme="swiss"] .status-pulse {
  background: var(--accent);
  animation-name: pulse-glow-swiss;
}

@keyframes pulse-glow-swiss {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(230, 51, 41, 0.8);
  }
  65% {
    transform: scale(1.05);
    box-shadow: 0 0 0 6px rgba(230, 51, 41, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(230, 51, 41, 0);
  }
}

.status-time {
  letter-spacing: 0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.status-tag {
  font-size: 9px;
  color: var(--muted);
  opacity: 0.85;
}

@media (max-width: 760px) {
  .system-status .status-tag {
    display: none;
  }
}

@media (max-width: 540px) {
  .system-status {
    display: none;
  }
}

/* 搜索框快捷键小徽章 */
.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
  margin-right: 6px;
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-transparency: reduce) {
  :root,
  :root[data-theme="dark"],
  :root[data-theme="swiss"],
  :root[data-theme="hud"],
  :root[data-theme="mono"] {
    --glass: none;
  }
  :root,
  :root[data-theme="swiss"],
  :root[data-theme="mono"] {
    --raised-bg: rgba(255, 255, 255, 0.98);
    --speech-bg: rgba(255, 255, 255, 0.96);
  }
  :root[data-theme="dark"] {
    --raised-bg: rgba(24, 35, 41, 0.98);
    --speech-bg: rgba(24, 35, 41, 0.96);
  }
  :root[data-theme="hud"] {
    --raised-bg: rgba(7, 21, 38, 0.98);
    --speech-bg: rgba(7, 21, 38, 0.96);
  }
}
