/* ==========================================================================
   iOS / macOS 26 液态玻璃 · 全站界面（设置 → 实验性 → 主题样式 = 液态玻璃）
   只在 html[data-switch-style="glass"] 时生效；交互与折射由 js/core/liquid-glass.js 驱动。

   高光原则（这次重做的重点）：
     · 不再用「顶部白色渐变 + 粗内阴影」——那会像一块塑料。
     · 只留一圈 1px 的镜面边：左上角那段弧最亮，右下角次亮（光线穿过玻璃从对边出来），
       上下两条直边几乎没有；随按下/悬停整体变亮。
     · 立体感交给折射（边缘把背后的内容拉弯）和一层很柔的投影。
   ========================================================================== */

/* ---------------------------------------------------------------- 经典样式下也要用到的：滑块的基础外观 */
.lgx-range {
  position: relative;
  display: block;
  width: 100%;
  min-width: 80px;
}
.lgx-range > .lgx-slider { display: none; }
.ui-range,
.lgx-range > input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.lgx-range.is-disabled { opacity: .5; }

@property --lgx-glow {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

/* ---------------------------------------------------------------- 设计变量 */
html[data-switch-style="glass"] {
  --nav-h: 58px;
  --lgx-spring: cubic-bezier(.3, 1.35, .45, 1);
  /* 镜面边亮度：左上角那段弧最亮，右下角次之，其余只剩一圈很淡的底 */
  --lgx-ring-tl: .95;
  --lgx-ring-br: .55;
  --lgx-ring-base: .14;
  --lgx-hair: 0 0 0 .5px rgba(0, 0, 0, .07);
  --lgx-fill: rgba(250, 250, 252, .66);
  --lgx-fill-strong: rgba(250, 250, 252, .78);
  --lgx-fill-clear: rgba(255, 255, 255, .2);
  --lgx-btn-plain: rgba(255, 255, 255, .5);
  --lgx-blur: 14px;
  --lgx-sat: 190%;
  --lgx-shadow: var(--lgx-hair), 0 10px 30px -10px rgba(0, 0, 0, .16), 0 2px 6px -2px rgba(0, 0, 0, .06);
  --lgx-shadow-sm: var(--lgx-hair), 0 4px 12px -4px rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .05);
  --lgx-glow-a: .5;
  --lgx-track: rgba(120, 120, 128, .16);
  --lgx-thumb: #fff;
  --lgx-ink: rgba(29, 29, 31, .86);
  --lgx-sb-fill: rgba(250, 250, 253, .60);
  --lgx-sb-shadow: 0 0 0 .5px rgba(0, 0, 0, .06), 0 14px 36px -12px rgba(0, 0, 0, .14), 0 4px 12px -4px rgba(0, 0, 0, .06);
  --lgx-sb-pill: color-mix(in srgb, var(--accent) 13%, rgba(255, 255, 255, .78));
  --lgx-sb-pill-shadow: 0 0 0 .5px color-mix(in srgb, var(--accent) 20%, rgba(0, 0, 0, .06)), 0 4px 14px -4px color-mix(in srgb, var(--accent) 22%, rgba(0, 0, 0, .10)), 0 1px 2px rgba(0, 0, 0, .05);
  --lgx-sb-hover: rgba(0, 0, 0, .048);
  --lgx-sb-sep: rgba(0, 0, 0, .08);
}
html[data-theme="dark"][data-switch-style="glass"] {
  --lgx-ring-tl: .6;
  --lgx-ring-br: .3;
  --lgx-ring-base: .07;
  --lgx-hair: 0 0 0 .5px rgba(0, 0, 0, .32);
  --lgx-fill: rgba(28, 28, 30, .58);
  --lgx-fill-strong: rgba(32, 32, 35, .74);
  --lgx-fill-clear: rgba(255, 255, 255, .06);
  --lgx-btn-plain: rgba(255, 255, 255, .09);
  --lgx-shadow: var(--lgx-hair), 0 14px 36px -10px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --lgx-shadow-sm: var(--lgx-hair), 0 6px 14px -6px rgba(0, 0, 0, .55);
  --lgx-glow-a: .22;
  --lgx-track: rgba(120, 120, 128, .32);
  --lgx-thumb: #f5f5f7;
  --lgx-ink: rgba(245, 245, 247, .88);
  --lgx-sb-fill: rgba(28, 28, 32, .56);
  --lgx-sb-shadow: 0 0 0 .5px rgba(255, 255, 255, .07), 0 18px 44px -12px rgba(0, 0, 0, .62), 0 4px 14px -4px rgba(0, 0, 0, .42);
  --lgx-sb-pill: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, .10));
  --lgx-sb-pill-shadow: 0 0 0 .5px color-mix(in srgb, var(--accent) 32%, rgba(255, 255, 255, .10)), 0 6px 16px -6px rgba(0, 0, 0, .55);
  --lgx-sb-hover: rgba(255, 255, 255, .075);
  --lgx-sb-sep: rgba(255, 255, 255, .10);
}
html[data-switch-style="glass"][data-palette]:not([data-palette="default"]) {
  --lgx-sb-fill: color-mix(in srgb, var(--pal) 7%, rgba(252, 252, 255, .60));
}
html[data-theme="dark"][data-switch-style="glass"][data-palette]:not([data-palette="default"]) {
  --lgx-sb-fill: color-mix(in srgb, var(--pal) 10%, rgba(24, 24, 28, .56));
}

/* ---------------------------------------------------------------- 共用：镜面边（::before）+ 按下的光 */
html[data-switch-style="glass"] :is(
  .lgx, .btn, .icon-btn, .lgx-glider, .lgx-side-glider, .lgx-seg-lens, .lgx-sl-lens, .modal, .admin-directory, footer.footer
)::before {
  content: "";
  position: absolute;
  /* 画在元素自己的边框上（不是边框里面）：这些玻璃大多留着 1px 透明边框，底色会从边框下透出来，
     亮边如果画在边框内侧，边缘就成了「一条底色带 + 一条亮线」两道线。 */
  inset: calc(var(--lgx-bw, 0px) * -1);
  z-index: 0;
  padding: 1px;
  border-radius: inherit;
  /* 以前用的是以中心为原点的 conic-gradient：在宽胶囊上，0° 和 140° 附近的亮段会铺满整条上沿和下沿，
     看起来就是按钮上下各一道灰条。现在亮光只从两个角上的弧出发，按固定距离（--lgx-ring-r）衰减，
     直边只剩很淡的一圈，和 iOS 26 一样。 */
  background:
    radial-gradient(var(--lgx-ring-r, 42px) var(--lgx-ring-r, 42px) at 0 0,
      rgb(255 255 255 / var(--lgx-ring-tl)), rgb(255 255 255 / calc(var(--lgx-ring-tl) * .3)) 50%, rgb(255 255 255 / 0)),
    radial-gradient(var(--lgx-ring-r, 42px) var(--lgx-ring-r, 42px) at 100% 100%,
      rgb(255 255 255 / var(--lgx-ring-br)), rgb(255 255 255 / calc(var(--lgx-ring-br) * .3)) 50%, rgb(255 255 255 / 0)),
    linear-gradient(rgb(255 255 255 / var(--lgx-ring-base)) 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  opacity: .85;
  transition: opacity .3s ease;
}
html[data-switch-style="glass"] :is(.lgx-hit, .btn, .icon-btn):is(.lgx-hover, .lgx-pressed)::before { opacity: 1; }
/* 高光沿边延伸多远：跟着控件大小走（小按钮短，面板、弹窗长） */
html[data-switch-style="glass"] :is(.lgx, .modal) { --lgx-ring-r: 90px; }
html[data-switch-style="glass"] :is(.admin-directory, footer.footer) { --lgx-ring-r: 120px; --lgx-bw: 0px; }
html[data-switch-style="glass"] .lgx-side-glider { --lgx-ring-r: 48px; --lgx-bw: 0px; }
html[data-switch-style="glass"] :is(.btn, .icon-btn, .lgx-glider, .lgx-seg-lens, .lgx-sl-lens, .lgx-hit) { --lgx-ring-r: 42px; }
/* 边框宽度（上面的亮边要盖在边框上）。按钮统一成 1px 透明边框，顶栏里个别按钮原来是 0。 */
html[data-switch-style="glass"] :is(.lgx, .modal, .segmented, .toast, .to-top) { --lgx-bw: 1px; }
html[data-switch-style="glass"] .btn { --lgx-bw: 1px; border-width: 1px; border-style: solid; }
html[data-switch-style="glass"] :is(.icon-btn, .lgx-glider, .lgx-seg-lens, .lgx-sl-lens) { --lgx-bw: 0px; }

/* 手机上点按时浏览器会在元素上盖一块灰色矩形（tap highlight），盖在圆角玻璃上就是一闪。
   液态玻璃有自己的按下反馈（变大 + 从手指位置亮起），这里把它关掉。 */
html[data-switch-style="glass"] :is(
  .btn, .icon-btn, .lgx-hit, [data-glass-hit], .segmented button, .lgx-range, .lgx-range-input,
  header.nav a, header.nav button, .home-section-nav a, .nav-drawer a, .admin-directory a, .admin-directory button
) {
  -webkit-tap-highlight-color: transparent;
}

/* 玻璃面板的通用配方（变量由各组件覆盖） */
html[data-switch-style="glass"] :is(
  .lgx-regular, .lgx-clear, .lgx-tint, .lgx-bar,
  header.nav :is(.nav-menu, .user-menu, .notify-panel), header.nav .nav-drawer,
  .home-section-nav.lgx, .toast, .to-top, .modal
) {
  --lgx-glow: 0;
  border-color: transparent;
  background:
    radial-gradient(140% 140% at var(--lgx-x, 30%) var(--lgx-y, 0%),
      rgb(255 255 255 / calc(var(--lgx-glow) * var(--lgx-glow-a))) 0%, rgb(255 255 255 / 0) 55%),
    var(--lgx-panel-fill, var(--lgx-fill));
  -webkit-backdrop-filter: blur(var(--lgx-panel-blur, var(--lgx-blur))) saturate(var(--lgx-sat));
  backdrop-filter: var(--lgx-refract,) blur(var(--lgx-panel-blur, var(--lgx-blur))) saturate(var(--lgx-sat));
  box-shadow: var(--lgx-panel-shadow, var(--lgx-shadow));
  transition: --lgx-glow .35s ease, transform .45s var(--lgx-spring), box-shadow .3s ease;
}
html[data-switch-style="glass"] .lgx-clear { --lgx-panel-fill: var(--lgx-fill-clear); --lgx-panel-blur: 2px; }
html[data-switch-style="glass"] .lgx-tint {
  --lgx-panel-fill: color-mix(in srgb, var(--lgx-tint, var(--accent)) 80%, transparent);
  --lgx-panel-blur: 8px;
  color: #fff;
}
html[data-switch-style="glass"] .lgx-hit.lgx-hover { --lgx-glow: .45; }
html[data-switch-style="glass"] .lgx-hit.lgx-pressed { --lgx-glow: 1; transform: scale(1.03); }

/* ==========================================================================
   1. 顶栏：悬浮的玻璃胶囊（页面内容从下面滚过时，边缘会被折射拉弯）
   ========================================================================== */
html[data-switch-style="glass"] header.nav,
html[data-switch-style="glass"][data-theme="dark"] header.nav { background: transparent; }
html[data-switch-style="glass"] header.nav::before,
html[data-switch-style="glass"][data-theme="dark"] header.nav::before {
  background: none;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html[data-switch-style="glass"] header.nav .nav-inner { position: relative; }
html[data-switch-style="glass"] .lgx-bar {
  position: absolute;
  z-index: -1;
  top: 7px;
  bottom: 3px;
  left: 6px;
  right: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  pointer-events: none;
  --lgx-panel-blur: 16px;
}
html:not([data-switch-style="glass"]) :is(.lgx-bar, .lgx-glider, .lgx-side-glider, .lgx-seg-thumb) { display: none; }
html[data-switch-style="glass"] .scroll-progress { display: none; }

/* 导航链接：当前项下面垫一块玻璃滑块，替代原来的下划线 */
html[data-switch-style="glass"] header.nav .nav-links { position: relative; }
html[data-switch-style="glass"] header.nav .nav-links .nav-link {
  position: relative;
  z-index: 1;
  color: var(--lgx-ink);
}
html[data-switch-style="glass"] header.nav .nav-links .nav-link.active::after { display: none; }
html[data-switch-style="glass"] .lgx-glider {
  --lgx-lift: 0;
  position: absolute;
  z-index: 0;
  left: 0;
  top: 50%;
  height: 32px;
  width: 0;
  border-radius: 999px;
  pointer-events: none;
  transform-origin: 50% 50%;
  background: rgb(255 255 255 / calc(.62 + var(--lgx-lift) * .2));
  box-shadow: var(--lgx-shadow-sm);
  transition: opacity .2s ease, background .2s ease;
}
html[data-theme="dark"][data-switch-style="glass"] .lgx-glider {
  background: rgb(255 255 255 / calc(.11 + var(--lgx-lift) * .08));
}

/* 右侧按钮在胶囊里：去掉方角 hover，换成玻璃圆 */
html[data-switch-style="glass"] header.nav .icon-btn { border-radius: 50%; }
html[data-switch-style="glass"] header.nav .nav-actions > .btn { height: 30px; padding: 0 14px; }

/* 下拉菜单 / 账号菜单 / 通知面板：更厚的磨砂玻璃 */
html[data-switch-style="glass"] header.nav :is(.nav-menu, .user-menu, .notify-panel),
html[data-switch-style="glass"][data-theme="dark"] header.nav :is(.nav-menu, .user-menu, .notify-panel) {
  --lgx-panel-fill: var(--lgx-fill-strong);
  --lgx-panel-blur: 28px;
  border: 1px solid transparent;
  border-radius: 22px;
}
html[data-switch-style="glass"] header.nav .nav-menu { top: calc(100% - 4px); padding: 8px; }
html[data-switch-style="glass"] header.nav :is(.nav-menu a, .user-menu .nav-link) { position: relative; z-index: 1; border-radius: 14px; }

/* 移动端抽屉：从胶囊下方落下的一整块玻璃 */
html[data-switch-style="glass"] header.nav .nav-drawer,
html[data-switch-style="glass"][data-theme="dark"] header.nav .nav-drawer {
  --lgx-panel-fill: var(--lgx-fill-strong);
  --lgx-panel-blur: 30px;
  top: calc(var(--nav-h) + 2px);
  left: 8px;
  right: 8px;
  height: auto;
  max-height: calc(100dvh - var(--nav-h) - 14px);
  padding-bottom: 18px;
  border: 1px solid transparent;
  border-radius: 28px;
}
html[data-switch-style="glass"] header.nav .nav-drawer > * { position: relative; z-index: 1; }

/* 首页分区导航：第二颗玻璃胶囊 */
html[data-switch-style="glass"] .section-nav.home-section-nav.lgx,
html[data-switch-style="glass"][data-theme="dark"] .section-nav.home-section-nav.lgx {
  top: calc(var(--nav-h) + 2px);
  width: fit-content;
  max-width: 100%;
  height: 40px;
  margin: 6px auto 0;
  padding: 0 18px;
  gap: clamp(14px, 2.2vw, 30px);
  border: 1px solid transparent;
  border-radius: 999px;
  overflow-y: hidden;
}
html[data-switch-style="glass"] .section-nav.home-section-nav.lgx a {
  z-index: 1;
  height: 38px;
  color: var(--lgx-ink);
}
html[data-switch-style="glass"] .section-nav.home-section-nav.lgx a::after { display: none; }
html[data-switch-style="glass"] .section-nav.home-section-nav.lgx .lgx-glider { height: 28px; }
html[data-switch-style="glass"] .zone { scroll-margin-top: calc(var(--nav-h) + 64px); }

/* ==========================================================================
   1.5. 侧边栏：macOS 26 悬浮液态玻璃浮岛（仅在主题样式 = 液态玻璃时生效）
   ========================================================================== */
html[data-switch-style="glass"][data-theme] .admin-directory,
html[data-switch-style="glass"][data-theme][data-workspace-layout="edge"] .workspace-page .admin-directory {
  background: var(--lgx-sb-fill);
  -webkit-backdrop-filter: blur(22px) saturate(var(--lgx-sat));
  backdrop-filter: var(--lgx-refract,) blur(22px) saturate(var(--lgx-sat));
  border: 0;
  border-radius: 24px;
  box-shadow: var(--lgx-sb-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html[data-switch-style="glass"][data-theme] .admin-directory nav {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  min-height: 0;
  gap: 3px;
  scrollbar-width: none;
}
html[data-switch-style="glass"][data-theme] .admin-directory nav::-webkit-scrollbar {
  display: none;
}
html[data-switch-style="glass"] .admin-directory-head {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 2px 4px 10px 10px;
}
html[data-switch-style="glass"] .admin-directory-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .05em;
  color: var(--text-3);
}
html[data-switch-style="glass"] .admin-directory-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-2);
  transition: background-color .2s ease, box-shadow .2s ease, color .2s ease, transform .35s var(--lgx-spring);
}
html[data-switch-style="glass"] .admin-directory-toggle:hover {
  background: var(--lgx-sb-hover);
  box-shadow: 0 0 0 .5px var(--lgx-sb-sep);
  color: var(--text);
}
html[data-switch-style="glass"] .admin-directory-toggle:active {
  transform: scale(.94);
}
html[data-switch-style="glass"][data-workspace-layout="edge"] .admin-directory-link.active::before {
  display: none;
}
html[data-switch-style="glass"] .admin-directory-link {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  color: var(--lgx-ink);
  font-weight: 500;
  transition: color .2s ease, background-color .2s ease, transform .35s var(--lgx-spring);
}
html[data-switch-style="glass"] .admin-directory-link:hover {
  background: var(--lgx-sb-hover);
  color: var(--text);
}
html[data-switch-style="glass"] .admin-directory-link.active {
  color: var(--text);
  font-weight: 620;
}
html[data-switch-style="glass"] .admin-directory nav:not(.lgx-side-ready) .admin-directory-link.active {
  background: var(--lgx-sb-pill);
  box-shadow: var(--lgx-sb-pill-shadow);
}
html[data-switch-style="glass"] .admin-directory nav.lgx-side-ready .admin-directory-link.active,
html[data-switch-style="glass"] .admin-directory nav.lgx-side-ready .admin-directory-link.active:hover {
  background: transparent;
  box-shadow: none;
}
html[data-switch-style="glass"] .admin-directory-link.active .admin-directory-icon {
  color: var(--accent);
}
html[data-switch-style="glass"] .admin-directory-link:active {
  transform: scale(.985);
}
html[data-switch-style="glass"] .admin-directory-group {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  color: var(--text-3);
}
html[data-switch-style="glass"] .admin-directory-sep {
  position: relative;
  z-index: 1;
  background: var(--lgx-sb-sep);
}
html[data-switch-style="glass"] .admin-directory-page {
  border-color: var(--lgx-sb-sep);
}
html[data-switch-style="glass"] .lgx-side-glider {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  border-radius: 12px;
  pointer-events: none;
  transform-origin: 50% 50%;
  background: var(--lgx-sb-pill);
  box-shadow: var(--lgx-sb-pill-shadow);
  will-change: transform, width, height;
  transition: opacity .2s ease, background .25s ease;
}
html[data-switch-style="glass"][data-palette-multi="1"] .lgx-side-glider {
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent-2) 12%, transparent)),
    var(--lgx-sb-pill);
}

/* 桌面端侧栏模式（edge）：独立悬浮玻璃岛 + 内部可滚动导航 + 边缘渐隐 */
@media (min-width: 701px) {
  html[data-switch-style="glass"][data-workspace-layout="edge"] .workspace-page .admin-layout {
    --ws-exp: 250px;
    --workspace-sidebar: 250px;
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"][data-dir-collapsed="1"] .workspace-page .admin-layout {
    --workspace-sidebar: 84px;
    grid-template-columns: 84px minmax(0, 1fr);
  }
  html[data-switch-style="glass"][data-theme][data-workspace-layout="edge"] .workspace-page .admin-directory {
    margin: 10px 6px 14px 10px;
    width: calc(100% - 16px);
    height: fit-content;
    max-height: calc(100dvh - var(--nav-h) - 64px);
    align-self: start;
    top: calc(var(--nav-h) + 12px);
    padding: 12px 10px;
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"] .workspace-page .admin-directory nav {
    width: calc(var(--ws-exp) - 36px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 0 6px;
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"] .workspace-page .admin-directory nav[data-scroll-top="1"] {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 100%);
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"] .workspace-page .admin-directory nav[data-scroll-bottom="1"] {
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 18px), transparent 100%);
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"] .workspace-page .admin-directory nav[data-scroll-top="1"][data-scroll-bottom="1"] {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"][data-dir-collapsed="1"] .workspace-page .admin-directory-head {
    padding: 2px 0 10px;
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"][data-dir-collapsed="1"] .workspace-page .admin-directory-link {
    width: 48px;
    border-radius: 14px;
    overflow: hidden;
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"][data-dir-collapsed="1"] .workspace-page .admin-directory-link > span:not(.admin-directory-icon) {
    white-space: nowrap;
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"][data-dir-collapsed="1"] .workspace-page .admin-directory-group::after {
    width: 32px;
    left: 8px;
    right: auto;
    background: var(--lgx-sb-sep);
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"][data-dir-collapsed="1"] .workspace-page .admin-directory-sep {
    width: 32px;
    margin: 10px 8px;
  }
  html[data-switch-style="glass"][data-workspace-layout="edge"][data-dir-collapsed="1"] .lgx-side-glider {
    border-radius: 14px;
  }
}
@media (min-width: 701px) and (max-width: 900px) {
  html[data-switch-style="glass"][data-workspace-layout="edge"] .workspace-page .admin-layout {
    --ws-exp: 208px;
    --workspace-sidebar: 208px;
  }
}

/* 居中模式桌面端（classic）：悬浮圆角玻璃目录卡片 */
@media (min-width: 901px) {
  html[data-switch-style="glass"][data-theme]:not([data-workspace-layout="edge"]) .admin-directory {
    top: calc(var(--nav-h) + 18px);
    margin-top: 32px;
    padding: 12px 10px;
    max-height: calc(100dvh - var(--nav-h) - 32px);
    border-radius: 22px;
  }
  html[data-switch-style="glass"][data-theme]:not([data-workspace-layout="edge"]) .admin-directory nav {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 0 4px;
  }
  html[data-switch-style="glass"][data-theme]:not([data-workspace-layout="edge"]) .admin-directory-link {
    border-radius: 12px;
  }
}

/* 窄屏 / 移动端：悬浮横向玻璃胶囊条 */
@media (max-width: 700px) {
  html[data-switch-style="glass"][data-theme][data-workspace-layout="edge"] .workspace-page .admin-directory {
    margin: 8px 10px 4px;
    width: calc(100% - 20px);
    height: auto;
    border-radius: 18px;
    padding: 6px 8px;
    top: calc(var(--nav-h) + 6px);
  }
  html[data-switch-style="glass"][data-theme][data-workspace-layout="edge"] .workspace-page .admin-directory nav {
    flex-direction: row;
    width: auto;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 0;
  }
  html[data-switch-style="glass"][data-theme][data-workspace-layout="edge"] .workspace-page .admin-directory-link {
    width: auto;
    border-radius: 12px;
  }
}
@media (max-width: 900px) {
  html[data-switch-style="glass"][data-theme]:not([data-workspace-layout="edge"]) .admin-directory {
    top: calc(var(--nav-h) + 8px);
    border-radius: 18px;
    padding: 6px 8px;
  }
  html[data-switch-style="glass"][data-theme]:not([data-workspace-layout="edge"]) .admin-directory nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 0;
  }
  html[data-switch-style="glass"][data-theme]:not([data-workspace-layout="edge"]) .admin-directory-link {
    width: auto;
    border-radius: 12px;
  }
}

/* ==========================================================================
   2. 按钮：玻璃胶囊 + 镜面边 + 按下时从手指位置亮起
   ========================================================================== */
html[data-switch-style="glass"] .btn {
  --lgx-glow: 0;
  --lgx-btn-fill: var(--lgx-btn-plain);
  --lgx-btn-shadow: var(--lgx-shadow-sm);
  border-color: transparent;
  background:
    radial-gradient(130% 160% at var(--lgx-x, 50%) var(--lgx-y, 0%),
      rgb(255 255 255 / calc(var(--lgx-glow) * var(--lgx-glow-a))) 0%, rgb(255 255 255 / 0) 60%),
    var(--lgx-btn-img, linear-gradient(transparent, transparent)),
    var(--lgx-btn-fill);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  backdrop-filter: blur(10px) saturate(180%);
  box-shadow: var(--lgx-btn-shadow);
  overflow: visible;
  transition: --lgx-glow .35s ease, transform .5s var(--lgx-spring), box-shadow .3s ease, opacity .2s ease, color .2s ease;
}
html[data-switch-style="glass"] .btn > :not(.notify-badge) { position: relative; z-index: 1; }
html[data-switch-style="glass"] .btn:hover { transform: none; box-shadow: var(--lgx-btn-shadow); }
html[data-switch-style="glass"] .btn.lgx-hover { --lgx-glow: .4; }
html[data-switch-style="glass"] .btn:active,
html[data-switch-style="glass"] .btn.lgx-pressed { --lgx-glow: 1; transform: scale(1.035); }
html[data-switch-style="glass"] .btn .ripple,
html[data-switch-style="glass"] .icon-btn .ripple { display: none; }

/* 有颜色的按钮：带主题色的玻璃（Apple 的 .glassProminent） */
html[data-switch-style="glass"] :is(.btn-primary, .btn-danger, .btn-success) {
  --lgx-btn-fill: color-mix(in srgb, var(--btn-bg) 86%, transparent);
  --lgx-btn-shadow: 0 0 0 .5px color-mix(in srgb, var(--btn-bg) 60%, #000 10%),
    0 8px 22px -8px color-mix(in srgb, var(--btn-bg) 70%, transparent),
    0 2px 5px -2px color-mix(in srgb, var(--btn-bg) 50%, transparent);
  --lgx-glow-a: .38;
  color: #fff;
}
html[data-switch-style="glass"] :is(.btn-primary, .btn-danger, .btn-success):hover {
  box-shadow: var(--lgx-btn-shadow);
}
html[data-switch-style="glass"][data-palette-multi="1"] .btn-primary { --lgx-btn-img: var(--accent-grad); }
html[data-switch-style="glass"] .btn-tint {
  --lgx-btn-fill: color-mix(in srgb, var(--accent) 16%, rgba(255, 255, 255, .45));
  color: var(--accent);
}
html[data-theme="dark"][data-switch-style="glass"] .btn-tint {
  --lgx-btn-fill: color-mix(in srgb, var(--accent) 24%, rgba(255, 255, 255, .04));
}
html[data-switch-style="glass"] .btn.is-busy::after { position: relative; z-index: 1; }

/* 图标按钮：平时透明，悬停/按下时浮出一颗玻璃圆 */
html[data-switch-style="glass"] .icon-btn {
  --lgx-glow: 0;
  background:
    radial-gradient(120% 120% at var(--lgx-x, 50%) var(--lgx-y, 0%),
      rgb(255 255 255 / calc(var(--lgx-glow) * var(--lgx-glow-a))) 0%, rgb(255 255 255 / 0) 65%),
    transparent;
  transition: --lgx-glow .3s ease, transform .45s var(--lgx-spring), background-color .25s ease, box-shadow .25s ease, color .2s ease;
}
html[data-switch-style="glass"] .icon-btn::before { opacity: 0; }
html[data-switch-style="glass"] .icon-btn:is(:hover, .lgx-hover, .lgx-pressed) {
  --lgx-glow: .5;
  background-color: var(--lgx-fill-clear);
  box-shadow: var(--lgx-shadow-sm);
  transform: none;
}
html[data-switch-style="glass"] .icon-btn:is(:hover, .lgx-hover, .lgx-pressed)::before { opacity: 1; }
html[data-switch-style="glass"] .icon-btn.lgx-pressed { --lgx-glow: 1; transform: scale(1.1); }
html[data-switch-style="glass"] .icon-btn > :not(.notify-badge) { position: relative; z-index: 1; }
html[data-switch-style="glass"] .icon-btn > .notify-badge {
  position: absolute;
  top: auto;
  bottom: 1px;
  right: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .45), 0 1px 4px rgba(0, 0, 0, .24);
}
html[data-theme="dark"][data-switch-style="glass"] .icon-btn > .notify-badge {
  box-shadow: 0 0 0 1.5px rgba(20, 20, 24, .75), 0 1px 4px rgba(0, 0, 0, .45);
}

/* ==========================================================================
   3. 分段控件：选中块是一块玻璃，按住可以拖到别的选项
   ========================================================================== */
html[data-switch-style="glass"] .segmented.lgx-seg {
  background: var(--lgx-track);
  border-color: transparent;
  touch-action: pan-y;                    /* 手指横向拖动选中块，竖向仍然滚动页面 */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
html[data-switch-style="glass"] .segmented.lgx-seg.lgx-overflow { touch-action: auto; }
html[data-switch-style="glass"] .segmented.lgx-seg button.active,
html[data-theme="dark"][data-switch-style="glass"] .segmented.lgx-seg button.active {
  background: transparent;
  box-shadow: none;
}
html[data-switch-style="glass"] .lgx-seg-thumb {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  border-radius: 999px;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform, width;
}
html[data-switch-style="glass"] .lgx-seg-thumb.is-lifted { z-index: 2; }
html[data-switch-style="glass"] :is(.lgx-seg-face, .lgx-seg-lens) {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
html[data-switch-style="glass"] .lgx-seg-face {
  background: var(--lgx-thumb);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .04), 0 3px 8px -2px rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .06);
}
html[data-theme="dark"][data-switch-style="glass"] .lgx-seg-face {
  background: #636366;
  box-shadow: 0 3px 8px -2px rgba(0, 0, 0, .5);
}
html[data-switch-style="glass"] .lgx-seg-lens {
  opacity: 0;
  background: rgba(255, 255, 255, .04);
  -webkit-backdrop-filter: saturate(140%);
  backdrop-filter: var(--lgx-refract,) saturate(140%) brightness(1.04);
  box-shadow: var(--lgx-shadow-sm);
}

/* ==========================================================================
   4. 滑块：静止是白色胶囊旋钮，拖动时浮起成透明玻璃
   ========================================================================== */
html[data-switch-style="glass"] .lgx-range { height: 30px; }
html[data-switch-style="glass"] .lgx-range > .lgx-slider { display: block; }
html[data-switch-style="glass"] .lgx-range > .lgx-range-input {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: pan-y;
}
/* 原生旋钮尺寸要和画出来的旋钮一致，指针位置才会对得上 */
html[data-switch-style="glass"] .lgx-range > .lgx-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
}
html[data-switch-style="glass"] .lgx-range > .lgx-range-input::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border: 0;
}
html[data-switch-style="glass"] .lgx-range > .lgx-range-input:disabled { cursor: not-allowed; }
html[data-switch-style="glass"] .lgx-range > .lgx-range-input:disabled + .lgx-slider { opacity: .45; }
html[data-switch-style="glass"] .lgx-slider {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
html[data-switch-style="glass"] .lgx-sl-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--lgx-track);
}
html[data-switch-style="glass"] .lgx-sl-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--accent);
}
html[data-switch-style="glass"] .lgx-sl-knob {
  position: absolute;
  left: 0;
  top: 50%;
  width: 44px;
  height: 30px;
  border-radius: 999px;
  transform-origin: 50% 50%;
  transform: translate3d(-7px, -50%, 0) scale(.682, .667);
}
html[data-switch-style="glass"] :is(.lgx-sl-face, .lgx-sl-lens) {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
html[data-switch-style="glass"] .lgx-sl-face {
  background: #fff;
  box-shadow: 0 0 0 .75px rgba(0, 0, 0, .05), 0 4px 12px -2px rgba(0, 0, 0, .18), 0 1.5px 3px rgba(0, 0, 0, .1);
}
html[data-switch-style="glass"] .lgx-sl-lens {
  opacity: 0;
  -webkit-backdrop-filter: saturate(130%);
  backdrop-filter: var(--lgx-refract,) saturate(130%) brightness(1.03);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .05), 0 6px 16px -6px rgba(0, 0, 0, .22);
}
html[data-switch-style="glass"] .lgx-range-input:focus-visible + .lgx-slider .lgx-sl-knob {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   5. 浮层：提示条 / 回到顶部 / 弹窗
   ========================================================================== */
html[data-switch-style="glass"] .toast {
  position: relative;
  border: 1px solid transparent;
}
html[data-switch-style="glass"] .toast > * { position: relative; z-index: 1; }
html[data-switch-style="glass"] .to-top { border: 1px solid transparent; }
html[data-switch-style="glass"] .to-top > * { position: relative; z-index: 1; }
html[data-switch-style="glass"] .modal {
  --lgx-panel-fill: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  --lgx-panel-blur: 34px;
  position: relative;
  border: 1px solid transparent;
  border-radius: 28px;
}
html[data-switch-style="glass"] .modal > * { position: relative; z-index: 1; }

/* ==========================================================================
   6. 降级
   ========================================================================== */
html[data-switch-style="glass"][data-lg-refract="0"] .lgx-bar { --lgx-panel-blur: 20px; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  html[data-switch-style="glass"][data-theme] .admin-directory,
  html[data-switch-style="glass"][data-theme][data-workspace-layout="edge"] .workspace-page .admin-directory,
  html[data-switch-style="glass"] :is(
    .lgx-regular, .lgx-clear, .lgx-bar, header.nav :is(.nav-menu, .user-menu, .notify-panel),
    header.nav .nav-drawer, .home-section-nav.lgx, .toast, .to-top, .modal, .btn
  ) {
    background: var(--surface-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  html[data-switch-style="glass"] :is(.btn-primary, .btn-danger, .btn-success) { background: var(--btn-bg); }
  html[data-switch-style="glass"] :is(.lgx-seg-lens, .lgx-sl-lens) { background: var(--lgx-thumb); backdrop-filter: none; }
  html[data-switch-style="glass"] .lgx-side-glider { background: var(--accent-soft); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-switch-style="glass"] :is(.btn, .icon-btn, .lgx-hit, .admin-directory-link, .admin-directory-toggle) { transition: none; }
  html[data-switch-style="glass"] :is(.btn, .icon-btn, .lgx-hit).lgx-pressed { transform: none; }
}

/* ---------------------------------------------------------------- 设置页预览 */
.experimental-preview .lgx-range,
.experimental-preview .ui-range { width: 180px; flex: none; }


/* ==========================================================================
   1.6. 页脚：独立悬浮液态玻璃窗口
   ========================================================================== */
html[data-switch-style="glass"][data-theme] footer.footer {
  position: relative;
  width: min(calc(100% - 28px), var(--page-max));
  margin: 44px auto 26px;
  padding: 26px 30px;
  border: 0;
  border-radius: 26px;
  background: var(--lgx-sb-fill);
  -webkit-backdrop-filter: blur(22px) saturate(var(--lgx-sat));
  backdrop-filter: var(--lgx-refract,) blur(22px) saturate(var(--lgx-sat));
  box-shadow: var(--lgx-sb-shadow);
  overflow: hidden;
}
html[data-switch-style="glass"][data-theme] footer.footer > * {
  position: relative;
  z-index: 1;
}
html[data-switch-style="glass"][data-theme] footer.footer.in-workspace {
  width: auto;
  margin: auto 0 22px;
  padding: 24px 28px;
  border-top: 0;
}
@media (max-width: 700px) {
  html[data-switch-style="glass"][data-theme] footer.footer {
    width: calc(100% - 20px);
    margin: 28px auto 18px;
    padding: 20px 18px;
    border-radius: 22px;
  }
}
