/* ============================================================
   site-header.css — PhLaX 统一站点表头唯一 source
   规约：本文件 + layouts/_partials/site-header.html + static/js/site-header.js
        必须产出同样的 DOM；本文件是 header 视觉的唯一来源。
   独立性：本文件也被工具页（chord-demo 等独立 HTML）共享，所以**只用自己的
          --sh-* 变量**，不读 custom.css 的 --fg / --violet —— 工具页自己也定义
          同名变量，借用它们会让顶栏在每个工具上长得不一样。

   风格（data-skin）：顶栏跟着站点风格换（颜色、字体、品牌标、导航胶囊的形状）。
   各风格正文部分的值在 assets/css/skins.css；这里只有顶栏与「外观」面板那一份。
   新增风格时两边都要加（skins.css 文件头有清单）。
   ============================================================ */

/* 全站字体 MiSans（可变字体，字重 150–700）。放在这里是因为它是 Hugo 页、工具页、Caddy 自带页
   **都引**的唯一一份样式；字体文件按 unicode-range 切成 56 片（static/fonts/misans-5.0.0/），
   一页只下用到的那几片。各处字体栈把 'MiSans VF' 排第一，没下完之前先用系统字体（font-display: swap）。 */
@import url('/fonts/misans-5.0.0/misans-vf.css');

html, body { overflow-x: clip; }

/* ---------- 顶栏变量：默认风格「便当」 ---------- */
:root {
  --sh-page: #F5F6F3;
  --sh-bg: rgba(245, 246, 243, 0.94);
  --sh-fg: #202923;
  --sh-mute: #536159;
  --sh-accent: #246B58;
  --sh-accent-2: #3C746B;
  --sh-on-accent: #FFFFFF;
  --sh-rule: rgba(32, 38, 57, 0.08);
  --sh-hover: rgba(0, 0, 0, 0.045);
  --sh-panel: #FFFFFF;
  --sh-panel-shadow: 0 12px 40px -12px rgba(20, 24, 40, 0.25), 0 0 0 1px rgba(32, 38, 57, 0.08);
  --sh-font: 'MiSans VF', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable',
             'PingFang SC', 'Microsoft YaHei UI', 'Source Han Sans SC', sans-serif;
  --sh-bw: 1px;
  --sh-radius: 999px;
  --sh-panel-r: 20px;
  --sh-weight: 600;
  /* 当前栏目、登录胶囊上的字：强调色往正文色里掺一点，浅色变深、深色变亮，各风格都过 4.5:1 */
  --sh-accent-ink: color-mix(in oklab, var(--sh-accent) 70%, var(--sh-fg));
}
html.dark {
  --sh-page: #141C19;
  --sh-bg: rgba(20, 28, 25, 0.94);
  --sh-fg: #E9F0E9;
  --sh-mute: #ADBCB2;
  --sh-accent: #8ACDB0;
  --sh-accent-2: #9AC9C0;
  --sh-on-accent: #141C19;
  --sh-rule: rgba(214, 222, 255, 0.08);
  --sh-hover: rgba(255, 255, 255, 0.06);
  --sh-panel: #24312B;
  --sh-panel-shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(214, 222, 255, 0.10);
}
/* 书卷 */
html[data-skin="paper"] {
  --sh-font: 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Source Han Serif SC', 'Noto Serif SC', 'Songti SC', SimSun, serif;
  --sh-radius: 2px; --sh-panel-r: 3px; --sh-weight: 600;
}
html[data-skin="paper"]:not(.dark) {
  --sh-page: #FBF8F1;
  --sh-bg: rgba(251, 248, 241, 0.92); --sh-fg: #1E1A16; --sh-mute: #5E564B;
  --sh-accent: #9E3B26; --sh-accent-2: #8A6A2E; --sh-on-accent: #FBF8F1;
  --sh-rule: rgba(60, 40, 20, 0.16); --sh-hover: rgba(60, 40, 20, 0.05);
  --sh-panel: #FDFBF6; --sh-panel-shadow: 0 10px 30px -12px rgba(60, 40, 20, 0.3), 0 0 0 1px rgba(60, 40, 20, 0.16);
}
html[data-skin="paper"].dark {
  --sh-page: #1C1A17;
  --sh-bg: rgba(28, 26, 23, 0.92); --sh-fg: #EDE4D3; --sh-mute: #B3A894;
  --sh-accent: #E08F6A; --sh-accent-2: #CDB078; --sh-on-accent: #1C1A17;
  --sh-rule: rgba(237, 228, 211, 0.14); --sh-hover: rgba(237, 228, 211, 0.06);
  --sh-panel: #24211D; --sh-panel-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(237, 228, 211, 0.14);
}
/* 杂志 */
html[data-skin="editorial"] {
  --sh-font: 'MiSans VF', 'Inter', 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Microsoft YaHei UI', sans-serif;
  --sh-radius: 0; --sh-panel-r: 0; --sh-weight: 700; --sh-bw: 2px;
}
html[data-skin="editorial"]:not(.dark) {
  --sh-page: #FAF9F6;
  --sh-bg: rgba(250, 249, 246, 0.95); --sh-fg: #0A0A0A; --sh-mute: #474747;
  --sh-accent: #CF1834; --sh-accent-2: #0A0A0A; --sh-on-accent: #FFFFFF;
  --sh-rule: #0A0A0A; --sh-hover: #F0F0F0;
  --sh-panel: #FFFFFF; --sh-panel-shadow: 0 0 0 2px #0A0A0A;
}
html[data-skin="editorial"].dark {
  --sh-page: #191919;
  --sh-bg: rgba(25, 25, 25, 0.95); --sh-fg: #F2F2F2; --sh-mute: #ABABAB;
  --sh-accent: #FF5A6E; --sh-accent-2: #F2F2F2; --sh-on-accent: #191919;
  --sh-rule: #F2F2F2; --sh-hover: #232323;
  --sh-panel: #242424; --sh-panel-shadow: 0 0 0 2px #F2F2F2;
}
/* 北境 */
html[data-skin="nord"] { --sh-radius: 12px; --sh-panel-r: 24px; --sh-bw: 0px; }
html[data-skin="nord"]:not(.dark) {
  --sh-page: #EDF1F5;
  --sh-bg: rgba(237, 241, 245, 0.94); --sh-fg: #2E3440; --sh-mute: #4C566A;
  --sh-accent: #4A6A94; --sh-accent-2: #92CADA; --sh-on-accent: #ECEFF4;
  --sh-rule: rgba(46, 52, 64, 0.08); --sh-hover: rgba(94, 129, 172, 0.10);
  --sh-panel: #FAFCFD; --sh-panel-shadow: 0 20px 50px -18px rgba(46, 52, 64, 0.35);
}
html[data-skin="nord"].dark {
  --sh-page: #2E3440;
  --sh-bg: rgba(46, 52, 64, 0.82); --sh-fg: #ECEFF4; --sh-mute: #C2CAD8;
  --sh-accent: #92CADA; --sh-accent-2: #8FBCBB; --sh-on-accent: #2E3440;
  --sh-rule: rgba(216, 222, 233, 0.08); --sh-hover: rgba(136, 192, 208, 0.12);
  --sh-panel: #3B4252; --sh-panel-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.6);
}
/* 终端 */
html[data-skin="terminal"] {
  --sh-font: 'Cascadia Code', 'JetBrains Mono', 'Sarasa Mono SC', ui-monospace, Consolas, 'MiSans VF', 'Microsoft YaHei UI', monospace;
  --sh-radius: 4px; --sh-panel-r: 6px; --sh-weight: 700;
}
html[data-skin="terminal"]:not(.dark) {
  --sh-page: #EEE8D5;
  --sh-bg: rgba(238, 232, 213, 0.94); --sh-fg: #073642; --sh-mute: #4F656C;
  --sh-accent: #1B6AA3; --sh-accent-2: #2AA198; --sh-on-accent: #FDF6E3;
  --sh-rule: rgba(88, 110, 117, 0.3); --sh-hover: rgba(88, 110, 117, 0.1);
  --sh-panel: #FDF6E3; --sh-panel-shadow: 0 0 0 1px rgba(88, 110, 117, 0.5), 6px 6px 0 rgba(88, 110, 117, 0.15);
}
html[data-skin="terminal"].dark {
  --sh-page: #002B36;
  --sh-bg: rgba(0, 43, 54, 0.94); --sh-fg: #E4DDC8; --sh-mute: #93A1A1;
  --sh-accent: #63B1EB; --sh-accent-2: #2AA198; --sh-on-accent: #002B36;
  --sh-rule: rgba(147, 161, 161, 0.25); --sh-hover: rgba(147, 161, 161, 0.1);
  --sh-panel: #073642; --sh-panel-shadow: 0 0 0 1px rgba(147, 161, 161, 0.4), 6px 6px 0 rgba(0, 0, 0, 0.35);
}
/* 粗野 */
html[data-skin="brutal"] { --sh-weight: 700; --sh-bw: 2px; --sh-panel-r: 8px; --sh-radius: 5px; }
html[data-skin="brutal"]:not(.dark) {
  --sh-page: #F5F1E7; --sh-bg: #F5F1E7; --sh-fg: #111111; --sh-mute: #333333;
  --sh-accent: #5B21FF; --sh-accent-2: #FF7A00; --sh-on-accent: #FFFFFF;
  --sh-rule: #111111; --sh-hover: #FFE7B0;
  --sh-panel: #FFFFFF; --sh-panel-shadow: 0 0 0 2px #111111, 6px 6px 0 #111111;
}
html[data-skin="brutal"].dark {
  --sh-page: #1A1A1D; --sh-bg: #1A1A1D; --sh-fg: #F7F3E8; --sh-mute: #C9C3B4;
  --sh-accent: #FFD23F; --sh-accent-2: #FF6B8E; --sh-on-accent: #1A1A1D;
  --sh-rule: #F7F3E8; --sh-hover: #303037;
  --sh-panel: #26262B; --sh-panel-shadow: 0 0 0 2px #F7F3E8, 6px 6px 0 #FFD23F;
}

.site-header {
  display: block;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--sh-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: var(--sh-bw) solid var(--sh-rule);
  font-family: var(--sh-font);
  /* full-bleed: 跳出 body padding */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

/* 顶栏高度：**全站唯一 source**。任何要「贴在顶栏底下」的东西（Hugo 的目录抽屉、
   工具页里自己 sticky 的走带条）都引 var(--nav-h)，别再各写各的数 —— assets/css/
   custom.css 曾经自己写着 64px，比真实的 56 多 8，于是窄屏目录抽屉的顶边与顶栏底边
   之间露出一条横缝，正文从缝里滚过去。 */
:root { --nav-h: 56px; }

.site-header__inner {
  height: var(--nav-h);
  margin: 0 auto;
  max-width: 1280px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

/* brand：品牌标 + 文字。品牌标随风格换形（便当 = 松绿圆角块，书卷 = 朱印，
   杂志 = 红方块，北境 = 霜色圆点，终端 = 提示符，粗野 = 描边方块） */
.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: var(--sh-weight);
  color: var(--sh-fg);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.site-header__brand::before {
  content: "";
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--sh-accent);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--sh-accent) 30%, transparent);
  flex-shrink: 0;
}
.site-header__brand:hover { color: var(--sh-accent); }
html[data-skin="paper"] .site-header__brand::before {
  width: 20px; height: 20px; border-radius: 2px; box-shadow: none;
  background: var(--sh-accent);
  box-shadow: inset 0 0 0 2px var(--sh-bg), inset 0 0 0 3px var(--sh-accent);
}
html[data-skin="editorial"] .site-header__brand { font-size: 17px; letter-spacing: -0.04em; }
html[data-skin="editorial"] .site-header__brand::before { width: 18px; height: 18px; border-radius: 0; box-shadow: none; background: var(--sh-accent); }
html[data-skin="nord"] .site-header__brand::before { border-radius: 50%; box-shadow: none; }
html[data-skin="terminal"] .site-header__brand::before {
  content: "❯"; width: auto; height: auto; background: none; box-shadow: none;
  color: var(--sh-accent); font-size: 16px; line-height: 1;
}
html[data-skin="terminal"] .site-header__brand { gap: 8px; }
html[data-skin="brutal"] .site-header__brand::before {
  border-radius: 6px; background: var(--sh-accent-2);
  box-shadow: 0 0 0 2px var(--sh-rule), 3px 3px 0 2px var(--sh-rule);
  width: 20px; height: 20px;
}

.site-header__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-header__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--sh-mute);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--sh-radius);
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;   /* 四个栏目挤窄屏时宁可收内边距，不许「知/识」竖着折成两行 */
}
.site-header__link:hover {
  color: var(--sh-fg);
  background: var(--sh-hover);
}
.site-header__link[aria-current="page"] {
  color: var(--sh-accent-ink);
  background: color-mix(in srgb, var(--sh-accent) 11%, transparent);
}
/* 杂志 / 书卷：当前栏目不用底色块，用一道下划线 —— 印刷品里没有胶囊按钮 */
html:is([data-skin="editorial"], [data-skin="paper"]) .site-header__link[aria-current="page"] {
  background: none; box-shadow: inset 0 -2px 0 var(--sh-accent);
}
html[data-skin="editorial"] .site-header__link { font-weight: 700; color: var(--sh-fg); }
html[data-skin="terminal"] .site-header__link[aria-current="page"] { background: none; }
html[data-skin="terminal"] .site-header__link[aria-current="page"]::before { content: "*"; color: var(--sh-accent); }
html[data-skin="brutal"] .site-header__link { font-weight: 700; color: var(--sh-fg); }
html[data-skin="brutal"] .site-header__link[aria-current="page"] {
  background: var(--sh-accent); color: var(--sh-on-accent); box-shadow: 0 0 0 2px var(--sh-rule);
}

.site-header__toggle {
  margin-left: 4px;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--sh-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--sh-radius);
  transition: color 0.12s, background 0.12s;
}
.site-header__toggle:hover,
.site-header__toggle[aria-expanded="true"] { color: var(--sh-accent); background: var(--sh-hover); }
.site-header__toggle svg { width: 18px; height: 18px; display: block; }

/* 账户入口：首屏 hidden，site-header.js 问过 /api/account/me 后才显示。
   未登录是「登录」描边胶囊；已登录是用户名（data-signed-in）。 */
.site-header__account[hidden] { display: none; }
.site-header__account {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sh-accent-ink);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--sh-radius);
  border: 1px solid color-mix(in srgb, var(--sh-accent) 40%, transparent);
  max-width: 10em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.site-header__account:hover { background: color-mix(in srgb, var(--sh-accent) 10%, transparent); }
.site-header__account[data-signed-in] {
  color: var(--sh-fg);
  border-color: color-mix(in srgb, var(--sh-fg) 16%, transparent);
}

/* ============================================================
   「外观」面板：点顶栏右边那颗调色盘按钮弹出。DOM 由 site-header.js 生成
   （Hugo 页与工具页同一份），挂在 .site-header__inner 里、靠右对齐。
     明暗：浅色 / 深色 / 跟随系统（三选一）
     风格：每个风格一张小卡，卡面就是那个风格自己的底色、卡片、强调色与标题字体
   ============================================================ */
.site-theme[hidden] { display: none; }
.site-theme {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: 400px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--nav-h) - 24px);
  overflow-y: auto;
  padding: 20px;
  border-radius: var(--sh-panel-r);
  background: var(--sh-panel);
  box-shadow: var(--sh-panel-shadow);
  color: var(--sh-fg);
  font: 13px/1.4 var(--sh-font);
  text-align: left;
  z-index: 60;
}
.site-theme__sec {
  margin: 2px 2px 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sh-mute);
}
.site-theme__sec + .site-theme__modes { margin-bottom: 14px; }
.site-theme__modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border-radius: calc(var(--sh-panel-r) * 0.7);
  background: var(--sh-hover);
}
.site-theme__mode {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 4px;
  border: 0;
  border-radius: calc(var(--sh-panel-r) * 0.55);
  background: transparent;
  color: var(--sh-mute);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.site-theme__mode svg { width: 15px; height: 15px; flex-shrink: 0; }
.site-theme__mode:hover { color: var(--sh-fg); }
.site-theme__mode[aria-pressed="true"] {
  background: var(--sh-panel);
  color: var(--sh-fg);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 1px color-mix(in srgb, var(--sh-fg) 8%, transparent);
}
.site-theme__skins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.site-theme__skin {
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px 6px 9px;
  border: 1px solid color-mix(in srgb, var(--sh-fg) 10%, transparent);
  border-radius: calc(var(--sh-panel-r) * 0.8);
  background: transparent;
  color: var(--sh-fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.site-theme__skin:hover { border-color: color-mix(in srgb, var(--sh-fg) 28%, transparent); background: var(--sh-hover); }
.site-theme__skin[aria-pressed="true"] {
  border-color: var(--sh-accent);
  box-shadow: 0 0 0 1px var(--sh-accent);
}
.site-theme__name { display: flex; align-items: center; gap: 6px; padding: 0 3px; font-weight: 600; font-size: 13px; }
.site-theme__name::after {
  content: "✓"; margin-left: auto; color: var(--sh-accent); font-size: 12px;
  visibility: hidden;
}
.site-theme__skin[aria-pressed="true"] .site-theme__name::after { visibility: visible; }
.site-theme__desc { padding: 0 3px; font-size: 11.5px; line-height: 1.45; color: var(--sh-mute); }
.site-theme__mode:focus-visible, .site-theme__skin:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 2px; }

/* 预览卡面：颜色由 JS 按「那个风格 × 当前明暗」写进 --pv-* */
.site-theme__pv {
  position: relative;
  height: 80px;
  padding: 9px 10px;
  border-radius: calc(var(--sh-panel-r) * 0.55);
  background: var(--pv-bg);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sh-fg) 8%, transparent);
}
.site-theme__pv i {
  position: absolute; left: 12px; right: 12px; top: 11px; bottom: -8px;
  display: block;
  background: var(--pv-card);
  border-radius: var(--pv-r);
  border: var(--pv-bw) solid var(--pv-line);
  box-shadow: var(--pv-shadow);
}
.site-theme__pv b {
  position: absolute; left: 24px; top: 23px;
  font: var(--pv-weight) 19px/1 var(--pv-font);
  color: var(--pv-fg);
  letter-spacing: -0.01em;
}
.site-theme__pv s {
  position: absolute; left: 24px; top: 53px;
  width: 44px; height: 5px; border-radius: 3px;
  background: var(--pv-accent);
  text-decoration: none;
}
.site-theme__pv u {
  position: absolute; left: 76px; top: 53px;
  width: 22px; height: 5px; border-radius: 3px;
  background: var(--pv-accent-2);
  text-decoration: none;
}

/* 换明暗 / 风格的那一帧：一切过渡关掉，一步到位（site-header.js 的 instant） */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }

/* 工具调 /api/* 吃到 401 时冒出来的那条提示（site-header.js 的 showLoginPrompt） */
.site-login-prompt {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: 12px;
  background: var(--sh-fg);
  color: var(--sh-panel);
  font: 500 14px/1.4 var(--sh-font);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.site-login-prompt__go {
  flex-shrink: 0;
  color: var(--sh-on-accent);
  background: var(--sh-accent);
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
}
.site-login-prompt__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  opacity: 0.7;
}

@media (max-width: 600px) {
  :root { --nav-h: 52px; }
  .site-header__inner { padding: 0 16px; gap: 8px; height: var(--nav-h); }
  .site-header__link  { padding: 6px 10px; font-size: 13px; }
  .site-header__account { margin-left: 2px; padding: 5px 10px; max-width: 6em; }
  .site-theme { right: 12px; left: 12px; width: auto; max-width: none; }
}
/* 手机竖屏：品牌 + 四个栏目 + 账户 + 外观要挤进 360 宽，栏目再收一档 */
@media (max-width: 420px) {
  .site-header__inner { gap: 6px; }
  .site-header__nav  { gap: 0; min-width: 0; }
  .site-header__link { padding: 6px 7px; }
  /* 还放不下时只让用户名缩（省略号），栏目、品牌与外观按钮不动 */
  .site-header__brand, .site-header__link, .site-header__toggle { flex-shrink: 0; }
  .site-header__account { min-width: 3em; padding: 5px 8px; }
}
@media (max-width: 380px) {
  .site-header__link    { padding: 6px 5px; }
  .site-header__account { min-width: 2.4em; }
}


/* ============================================================
   滚动条：全站统一外观
   放在这里是因为本文件是全站唯一每页都引的样式（Hugo 页、工具页、Caddy 的
   目录页与错误页、notefall 外观页）。

   - **闲着看不见**。只在两种时候浮出来：正在滚（.sb-on，停手 0.9 秒摘掉），
     或鼠标在那个框里（.sb-hover；整页那条是鼠标贴到窗口右边缘）。两个类都由
     site-header.js 挂。**别改回 :hover** —— Chromium 里 :hover 变了不会重画滚动条，
     挂类才会（2026-10-24 在无头 Chrome 里量过：:hover 命中了，滑块照样不出来）。
   - **长得像站点**：滑块是一颗渐变胶囊，两端是当前风格的两个强调色（便当 = 紫→青，
     就是品牌标那条渐变）；槽透明，不画箭头。
   - 墨迹 6px，靠 3px 透明边框 + content-box 把可抓区域撑到 12px —— 细的是墨迹，
     不是热区。指上去 / 拖动时渐变加浓。
   - 两套引擎分开写：Chromium / Safari 走 ::-webkit-scrollbar；Firefox 只认
     scrollbar-width / scrollbar-color（画不了渐变，用紫色单色）。后两个在新版
     Chromium 里一旦写上就会**压掉** ::-webkit-scrollbar，所以只给不认 webkit
     伪元素的浏览器写。
   - 个别工具自己写了 scrollbar-*（钢琴页名单框、键盘条不画），那些元素以它们
     自己的为准。
   ============================================================ */
:root {
  /* 跟着风格走：两端取顶栏的两个强调色（便当 = 紫→青，与品牌标同一条渐变） */
  --sb-a: color-mix(in srgb, var(--sh-accent) 45%, transparent);
  --sb-b: color-mix(in srgb, var(--sh-accent-2) 45%, transparent);
  --sb-a-hot: color-mix(in srgb, var(--sh-accent) 88%, transparent);
  --sb-b-hot: color-mix(in srgb, var(--sh-accent-2) 88%, transparent);
}

::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb {
  background: transparent;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
  min-height: 40px;
  min-width: 40px;
}
.sb-on::-webkit-scrollbar-thumb:vertical,
.sb-hover::-webkit-scrollbar-thumb:vertical {
  background-image: linear-gradient(180deg, var(--sb-a), var(--sb-b));
}
.sb-on::-webkit-scrollbar-thumb:horizontal,
.sb-hover::-webkit-scrollbar-thumb:horizontal {
  background-image: linear-gradient(90deg, var(--sb-a), var(--sb-b));
}
::-webkit-scrollbar-thumb:vertical:hover,
::-webkit-scrollbar-thumb:vertical:active {
  background-image: linear-gradient(180deg, var(--sb-a-hot), var(--sb-b-hot));
}
::-webkit-scrollbar-thumb:horizontal:hover,
::-webkit-scrollbar-thumb:horizontal:active {
  background-image: linear-gradient(90deg, var(--sb-a-hot), var(--sb-b-hot));
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.2s ease;
  }
  .sb-on, .sb-hover {
    scrollbar-color: var(--sb-a) transparent;
  }
}

/* The picker has its own heading and a visible dismissal control on touch screens. */
.site-theme__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.site-theme__title { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.site-theme__close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--sh-rule); border-radius: var(--sh-radius); background: transparent; color: var(--sh-mute); cursor: pointer; }
.site-theme__close:hover { color: var(--sh-fg); background: var(--sh-hover); }
.site-theme__close svg { width: 15px; height: 15px; }
.site-theme__close:focus-visible, .site-header__toggle:focus-visible, .site-header__link:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 3px; }
.site-theme__hint { margin: 15px 2px 0; color: var(--sh-mute); font-size: 11px; line-height: 1.6; }
.site-theme__skin[aria-pressed="true"] { background: color-mix(in srgb, var(--sh-accent) 5%, var(--sh-panel)); }
.site-theme__pv::after { content: ""; position: absolute; left: 24px; top: 65px; width: 58%; height: 2px; background: var(--pv-fg); opacity: .16; }
.site-theme__skin[data-skin-id="paper"] .site-theme__pv b { font-weight: 500; }
.site-theme__skin[data-skin-id="terminal"] .site-theme__pv b::before { content: "> "; color: var(--pv-accent); }
.site-theme__skin[data-skin-id="editorial"] .site-theme__pv b { font-size: 23px; letter-spacing: -.05em; }
@media (prefers-reduced-motion: reduce) {
  .site-header *, .site-header *::before, .site-header *::after { transition: none !important; animation: none !important; }
}
