/* 高端版移动端底栏 · 液态玻璃滑块
   ------------------------------------------------------------
   只作用于 max-width:650px 且 data-view="high"，完整版 / 极简版不受影响。

   和上一版最大的不同：滑块是**常驻**的，也是唯一的选中指示器。
   旧版只有动画期间才显示滑块，结束后淡出、再让 button.active 的背景顶上，
   两套材质交接时会闪一下 —— 这就是「不好看」的主要来源。

   形状交给 transform: scale()：胶囊被拉长时圆角跟着变成椭圆，两端自然收尖，
   比改 width 更像液体，也不用触发布局。
   ============================================================ */

@media (max-width: 650px) {
  /* ───────────── 1. 几何 ───────────── */
  html[data-theme][data-view="high"] {
    --knav-h: clamp(54px, 15vw, 64px);
    --knav-side: clamp(9px, 3.2vw, 15px);
    --knav-gap: max(6px, calc(3px + env(safe-area-inset-bottom) * .5));
    /* 其余尺寸都按高度推导：只动 --knav-h 一个数，图标/字号/内边距一起跟着变，
       圆角恒等于 h/2，永远是胶囊，不会因为调高而变成圆角矩形 */
    --knav-radius: calc(var(--knav-h) / 2);
    --knav-icon: clamp(24px, calc(var(--knav-h) * .44), 27px);
    --knav-font: clamp(12px, calc(var(--knav-h) * .225), 13.5px);
    --knav-gapv: calc(var(--knav-h) * .07);
    --knav-pad: calc(var(--knav-h) * .13);
    --knav-sel: calc(var(--knav-h) * .09);
  }

  html[data-theme][data-view="high"] aside nav {
    position: relative;
    z-index: 2;
    touch-action: none;
  }

  /* aside 不裁：拖动时滑块会故意上下溢出这条导航栏 */
  html[data-theme][data-view="high"] aside {
    overflow: visible !important;
  }

  /* touch-action 不继承。只写在 nav 上时，手指落在 button 上依然按 auto 处理，
     浏览器会把横向拖动当成手势接管，发 pointercancel 把拖动打断。
     底栏这一条区域本来就不该滚动，整块吃掉。 */
  html[data-theme][data-view="high"] aside,
  html[data-theme][data-view="high"] aside nav,
  html[data-theme][data-view="high"] aside nav button,
  html[data-theme][data-view="high"] aside nav button * {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* ───────────── 2. 按钮：只管颜色和图标，背景交给滑块 ───────────── */
  html[data-theme][data-view="high"] aside nav button {
    position: relative;
    z-index: 2;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    color: rgba(17, 21, 28, .72);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    transition:
      color .18s ease,
      transform .26s cubic-bezier(.34, 1.42, .52, 1);
  }

  html[data-theme][data-view="high"] aside nav button span {
    color: rgba(17, 21, 28, .72) !important;
    transition: color .18s ease;
  }
  html[data-theme][data-view="high"] aside nav button svg {
    color: rgba(17, 21, 28, .72);
    transition: color .18s ease, transform .26s cubic-bezier(.34, 1.42, .52, 1);
  }

  /* 选中：图标和字变蓝，图标轻轻抬一点 */
  html[data-theme][data-view="high"] aside nav button.active {
    color: #245cff !important;
  }
  html[data-theme][data-view="high"] aside nav button.active span {
    color: #245cff !important;
    font-weight: 600 !important;
  }
  html[data-theme][data-view="high"] aside nav button.active svg {
    color: #245cff !important;
    transform: translateY(-1px) scale(1.055);
  }

  /* 拖到哪一格，哪一格就先亮起来 */
  html[data-theme][data-view="high"] aside nav button.nav-blob-target span {
    color: #245cff !important;
  }
  html[data-theme][data-view="high"] aside nav button.nav-blob-target svg {
    color: #245cff !important;
    transform: scale(1.075);
  }

  /* 拖动中：整条底栏的图标稍稍退后，让滑块和落点更清楚 */
  html[data-theme][data-view="high"] aside.nav-dragging nav button:not(.nav-blob-target) {
    opacity: .58;
    transition: opacity .16s ease;
  }

  /* ───────────── 3. 滑块 ───────────── */
  html[data-theme][data-view="high"] .nav-blob-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* 不裁：拖动时滑块会故意上下溢出这条导航栏 */
    overflow: visible;
    border-radius: inherit;
    pointer-events: none;
    /* 不能给 paint：contain:paint 会把溢出导航栏的滑块裁掉，
       这正是之前「上下被切」的原因。layout 足够，绘制交给父级。 */
    contain: layout;
  }

  html[data-theme][data-view="high"] .nav-blob {
    position: absolute;
    left: 0;
    top: 0;
    width: 64px;
    height: 50px;
    box-sizing: border-box;
    border-radius: 999px;
    transform-origin: 50% 50%;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    opacity: 0;
    isolation: isolate;
    /* 离地高度，由 JS 每帧写：0 = 嵌在栏里，1 = 被拎起来 */
    --e: 0;
    /* 提起时整块变得更白更实：它离开栏面之后不再被栏的底色混掉，
       这是「拿起来」最直接的视觉证据，比加深阴影更有效 */
    background:
      radial-gradient(140% 132% at 50% -14%,
        rgb(255 255 255 / .44) 0%,
        rgb(255 255 255 / .12) 42%,
        rgb(255 255 255 / 0) 72%),
      linear-gradient(180deg,
        rgb(255 255 255 / .40) 0%,
        rgb(255 255 255 / .16) 56%,
        rgb(180 195 215 / .14) 100%);
    -webkit-backdrop-filter: blur(9px) saturate(1.9) brightness(1.05);
    backdrop-filter: blur(9px) saturate(1.9) brightness(1.05);
    box-shadow:
      /* 顶部高光：玻璃有厚度的唯一证据。抬得越高，边缘受光越强 */
      inset 0 1px 0 rgb(255 255 255 / calc(.92 + var(--e) * .06)),
      /* 内侧下暗边：离开桌面后反光变浅 */
      inset 0 -10px 16px -12px rgb(58 47 31 / calc(.36 - var(--e) * .18)),
      /* 亚像素描边 */
      inset 0 0 0 1px rgb(255 255 255 / .66),
      /* 极淡的外描边：把胶囊从栏面上「切」出来 */
      /* 接触影：抬起来就散掉 */
      0 calc(3px - var(--e) * 2px) calc(10px - var(--e) * 5px) rgb(32 24 14 / calc(.18 - var(--e) * .14)),
      /* 悬空影：偏移和模糊一起跟着长，影子越远说明离得越高 */
      0 calc(10px + var(--e) * 18px) calc(26px + var(--e) * 34px) -6px rgb(32 24 14 / calc(.16 + var(--e) * .28));
  }

  /* 拖尾：低不透明度的柔光胶囊，位置由 JS 每帧给（比滑块慢 70ms）。
     它不能有背板滤镜，否则会和滑块叠出一块更厚的玻璃。 */
  html[data-theme][data-view="high"] .nav-wake {
    position: absolute;
    left: 0;
    top: 0;
    width: 64px;
    height: 50px;
    box-sizing: border-box;
    border-radius: 999px;
    transform-origin: 50% 50%;
    will-change: transform, opacity;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(90deg,
      rgb(255 255 255 / 0) 0%,
      rgb(255 255 255 / .42) 40%,
      rgb(255 255 255 / .22) 68%,
      rgb(255 255 255 / 0) 100%);
    filter: blur(7px);
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .nav-wake {
    background: linear-gradient(90deg,
      rgb(150 190 255 / 0) 0%,
      rgb(160 200 255 / .34) 42%,
      rgb(150 190 255 / .16) 68%,
      rgb(150 190 255 / 0) 100%);
  }

  /* 内部高光：位置由 --flow 驱动，和滑块位移反着走。
     拖得越快，光越往尾巴那边落 —— 「液体在玻璃里晃」就是这一层。 */
  html[data-theme][data-view="high"] .nav-sheen {
    position: absolute;
    inset: 0;
    display: block;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(100deg,
      rgb(255 255 255 / 0) 24%,
      rgb(255 255 255 / .22) 43%,
      rgb(255 255 255 / .07) 57%,
      rgb(255 255 255 / 0) 76%);
    transform: translateX(calc(var(--flow, 0) * -28px)) scaleX(1.18);
    opacity: calc(.08 + var(--e, 0) * .14);
  }

  /* 提起/落位的差异已经全部由 --e 连续驱动，这里不再切整张阴影表，
     否则会在切换的那一帧把连续过渡打断成一次硬跳 */
  html[data-theme][data-view="high"] .nav-blob.grabbed {
    filter: brightness(1.04) saturate(1.06);
  }

  /* 落在目标上：高光收一点，暗示「归位」 */
  html[data-theme][data-view="high"] .nav-blob.landing {
    filter: brightness(1.01);
  }

  /* ───────────── 4. 深色 ───────────── */
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button {
    color: rgba(233, 240, 252, .70);
  }
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button span {
    color: rgba(233, 240, 252, .70) !important;
  }
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button svg {
    color: rgba(233, 240, 252, .70);
  }
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button.active,
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button.active span,
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button.active svg {
    color: #7fb3ff !important;
  }
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button.nav-blob-target span,
  html[data-theme][data-view="high"][data-scheme="dark"] aside nav button.nav-blob-target svg {
    color: #7fb3ff !important;
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .nav-blob {
    background:
      radial-gradient(140% 132% at 50% -14%,
        rgb(196 222 255 / .28) 0%,
        rgb(196 222 255 / .08) 42%,
        rgb(255 255 255 / 0) 72%),
      linear-gradient(180deg,
        rgb(255 255 255 / .14) 0%,
        rgb(255 255 255 / .045) 56%,
        rgb(120 150 200 / .14) 100%);
    box-shadow:
      inset 0 1px 0 rgb(215 235 255 / calc(.36 + var(--e) * .24)),
      inset 0 -10px 16px -12px rgb(0 4 12 / calc(.62 - var(--e) * .26)),
      inset 0 0 0 1px rgb(175 208 255 / .30),
      0 calc(3px - var(--e) * 2px) calc(10px - var(--e) * 5px) rgb(0 4 12 / calc(.44 - var(--e) * .26)),
      0 calc(10px + var(--e) * 20px) calc(26px + var(--e) * 38px) -6px rgb(0 4 12 / calc(.46 + var(--e) * .30));
  }
  html[data-theme][data-view="high"][data-scheme="dark"] .nav-blob.grabbed {
    filter: brightness(1.10) saturate(1.08);
  }
}

/* ───────────── 5. 周表页「整周 / 课程」：复用底栏的玻璃语言 ───────────── */
@media (max-width: 650px) {
  /* 容器就是一枚缩小版底栏：同一组高光、描边、模糊与接触影；
     选中态不使用实色，改用同一颗 .nav-blob 玻璃胶囊滑过去。 */
  html[data-theme][data-view="high"] .subswitch {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    width: fit-content;
    height: 40px;
    margin: 0 0 16px;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 20px;
    overflow: hidden;
    background:
      radial-gradient(100% 120% at 12% 0%, rgba(255, 255, 255, .9), transparent 58%),
      linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .5));
    -webkit-backdrop-filter: blur(30px) saturate(1.95);
    backdrop-filter: blur(30px) saturate(1.95);
    box-shadow:
      0 12px 28px rgba(34, 48, 82, .13),
      inset 0 1px 0 rgba(255, 255, 255, .96),
      inset 0 -1px 0 rgba(255, 255, 255, .4);
  }

  html[data-theme][data-view="high"] .subswitch button {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    margin: 0;
    padding: 0 16px;
    box-sizing: border-box;
    border: 0 !important;
    border-radius: 16px;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(17, 21, 28, .72);
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease;
  }

  html[data-theme][data-view="high"] .subswitch button.on {
    color: #245cff !important;
    font-weight: 650 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* 玻璃滑块：直接使用底栏 .nav-blob 的材质，尺寸由脚本按当前按钮测量 */
  html[data-theme][data-view="high"] .subswitch-blob-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* 不裁：长按提起时滑块会上下溢出这条分段控件，跟底栏一样 */
    overflow: visible;
    border-radius: inherit;
    pointer-events: none;
    contain: layout;
  }

  html[data-theme][data-view="high"] .subswitch .nav-blob {
    opacity: 1;
    transition: transform .30s cubic-bezier(.2, .86, .24, 1);
  }

  html[data-theme][data-view="high"] .subswitch button:focus-visible {
    outline: 2px solid rgba(36, 92, 255, .55);
    outline-offset: 2px;
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .subswitch {
    border-color: rgba(255, 255, 255, .18);
    background-color: rgba(255, 255, 255, .07);
    background-image: linear-gradient(180deg,
      rgba(255, 255, 255, .12) 0%,
      rgba(255, 255, 255, .025) 46%,
      rgba(255, 255, 255, .07) 100%);
    box-shadow:
      0 12px 30px rgba(0, 0, 0, .38),
      inset 0 1px 0 rgba(255, 255, 255, .18),
      inset 0 -1px 0 rgba(255, 255, 255, .07);
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .subswitch button {
    color: rgba(231, 238, 250, .66);
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .subswitch button.on {
    color: #9dbcff !important;
  }
}

/* ───────────── 6. 同校页三个分类：复用同一颗玻璃胶囊 ───────────── */
@media (max-width: 650px) {
  /* 群聊 / 课程讨论 / 教师讨论：容器是一整条玻璃，
     选中态不再铺实色，而是让底栏那颗 .nav-blob 滑到当前选项下面。 */
  html[data-theme][data-view="high"] .room-seg {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 20px;
    overflow: hidden;
    background:
      radial-gradient(120% 130% at 12% 0%, rgba(255, 255, 255, .92), transparent 58%),
      linear-gradient(180deg, rgba(255, 255, 255, .70), rgba(255, 255, 255, .44));
    -webkit-backdrop-filter: blur(30px) saturate(1.95);
    backdrop-filter: blur(30px) saturate(1.95);
    box-shadow:
      0 12px 28px rgba(34, 48, 82, .12),
      inset 0 1px 0 rgba(255, 255, 255, .96),
      inset 0 -1px 0 rgba(255, 255, 255, .40);
  }

  html[data-theme][data-view="high"] .room-seg button {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    padding: 0 4px;
    box-sizing: border-box;
    border: 0 !important;
    border-radius: 16px;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(17, 21, 28, .66);
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease;
  }

  html[data-theme][data-view="high"] .room-seg button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: rgba(17, 21, 28, .66);
    opacity: .72;
    transition: color .18s ease, opacity .18s ease, transform .26s cubic-bezier(.34, 1.42, .52, 1);
  }

  html[data-theme][data-view="high"] .room-seg button.on {
    color: #245cff !important;
    font-weight: 650 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html[data-theme][data-view="high"] .room-seg button.on svg {
    color: #245cff !important;
    opacity: 1;
    transform: translateY(-1px) scale(1.035);
  }

  html[data-theme][data-view="high"] .room-seg .subswitch-blob-layer {
    position: absolute;
    inset: -1px;
    z-index: 1;
    overflow: visible;
    border-radius: 20px;
    pointer-events: none;
    contain: layout;
  }

  html[data-theme][data-view="high"] .room-seg .nav-blob {
    opacity: 1;
    transition: transform .30s cubic-bezier(.2, .86, .24, 1);
  }

  html[data-theme][data-view="high"] .room-seg button:focus-visible {
    outline: 2px solid rgba(36, 92, 255, .55);
    outline-offset: 2px;
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .room-seg {
    border-color: rgba(255, 255, 255, .18);
    background-color: rgba(255, 255, 255, .07);
    background-image: linear-gradient(180deg,
      rgba(255, 255, 255, .12) 0%,
      rgba(255, 255, 255, .025) 46%,
      rgba(255, 255, 255, .07) 100%);
    box-shadow:
      0 12px 30px rgba(0, 0, 0, .38),
      inset 0 1px 0 rgba(255, 255, 255, .18),
      inset 0 -1px 0 rgba(255, 255, 255, .07);
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .room-seg button,
  html[data-theme][data-view="high"][data-scheme="dark"] .room-seg button svg {
    color: rgba(231, 238, 250, .66);
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .room-seg button.on,
  html[data-theme][data-view="high"][data-scheme="dark"] .room-seg button.on svg {
    color: #9dbcff !important;
  }
}

/* ───────────── 7. 出勤「到了 / 没去」：卡片里的小玻璃分段 ───────────── */
@media (max-width: 650px) {
  html[data-theme][data-view="high"] .att-seg {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
    height: 32px;
    padding: 3px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 16px;
    overflow: hidden;
    background:
      radial-gradient(100% 120% at 12% 0%, rgba(255, 255, 255, .9), transparent 58%),
      linear-gradient(180deg, rgba(255, 255, 255, .70), rgba(255, 255, 255, .46));
    -webkit-backdrop-filter: blur(18px) saturate(1.7);
    backdrop-filter: blur(18px) saturate(1.7);
    box-shadow:
      0 8px 20px rgba(34, 48, 82, .10),
      inset 0 1px 0 rgba(255, 255, 255, .92),
      inset 0 -1px 0 rgba(255, 255, 255, .38);
  }

  html[data-theme][data-view="high"] .att-seg .card-tool.att-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 48px;
    height: 26px;
    min-height: 26px;
    margin: 0;
    padding: 0 10px;
    box-sizing: border-box;
    border: 0 !important;
    border-radius: 13px;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(17, 21, 28, .60);
    font: inherit;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease;
  }

  html[data-theme][data-view="high"] .att-seg .card-tool.att-btn.on {
    color: #245cff !important;
    font-weight: 600 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html[data-theme][data-view="high"] .att-seg .subswitch-blob-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: visible;
    border-radius: 16px;
    pointer-events: none;
    contain: layout;
  }

  html[data-theme][data-view="high"] .att-seg .nav-blob {
    opacity: 1;
    transition: transform .30s cubic-bezier(.2, .86, .24, 1);
  }

  html[data-theme][data-view="high"] .att-seg .card-tool:focus-visible {
    outline: 2px solid rgba(36, 92, 255, .55);
    outline-offset: 2px;
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .att-seg {
    border-color: rgba(255, 255, 255, .18);
    background-color: rgba(255, 255, 255, .07);
    background-image: linear-gradient(180deg,
      rgba(255, 255, 255, .12) 0%,
      rgba(255, 255, 255, .025) 46%,
      rgba(255, 255, 255, .07) 100%);
    box-shadow:
      0 8px 22px rgba(0, 0, 0, .34),
      inset 0 1px 0 rgba(255, 255, 255, .18),
      inset 0 -1px 0 rgba(255, 255, 255, .07);
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .att-seg .card-tool.att-btn {
    color: rgba(231, 238, 250, .66);
  }

  html[data-theme][data-view="high"][data-scheme="dark"] .att-seg .card-tool.att-btn.on {
    color: #9dbcff !important;
  }
}

/* ───────────── 8. 同校搜索：与真实列表同圆角的玻璃骨架 ───────────── */
html[data-theme][data-view="high"] .room-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 4px 14px;
}

html[data-theme][data-view="high"] .room-sk-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

html[data-theme][data-view="high"] .room-sk-ava {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
}

html[data-theme][data-view="high"] .room-sk-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

html[data-theme][data-view="high"] .room-sk-copy i {
  display: block;
  height: 10px;
  border-radius: 4px;
}

html[data-theme][data-view="high"] .room-sk-block {
  height: 52px;
  border-radius: 12px;
}

html[data-theme][data-view="high"] .room-sk-fill {
  background: linear-gradient(100deg,
    rgba(35, 31, 25, .07) 20%,
    rgba(35, 31, 25, .14) 42%,
    rgba(35, 31, 25, .07) 64%);
  background-size: 220% 100%;
  animation: room-shimmer 1.5s linear infinite;
}

html[data-theme][data-view="high"][data-scheme="dark"] .room-sk-fill {
  background-image: linear-gradient(100deg,
    rgba(255, 255, 255, .08) 20%,
    rgba(255, 255, 255, .16) 42%,
    rgba(255, 255, 255, .08) 64%);
}

@keyframes room-shimmer {
  from { background-position: 180% 0; }
  to   { background-position: -80% 0; }
}

/* ───────────── 9. 开关的轻回弹：只动滑块，不动文字 ───────────── */
html[data-theme][data-view="high"] .set-switch::after {
  left: 2px !important;
  transform: translateX(0);
  transition: transform .38s cubic-bezier(.68, -.55, .27, 1.55), box-shadow .18s ease;
}

html[data-theme][data-view="high"] .set-sw:checked + .set-switch::after {
  left: 2px !important;
  transform: translateX(18px);
}

html[data-theme][data-view="high"] .room-switch::after {
  left: 2px !important;
  transform: translateX(0);
  transition: transform .38s cubic-bezier(.68, -.55, .27, 1.55), box-shadow .18s ease;
}

html[data-theme][data-view="high"] .room-toggle:checked + .room-switch::after {
  left: 2px !important;
  transform: translateX(21px);
}

/* 关掉动效时退回朴素状态：滑块只在位，不做跟随和拉伸（JS 会直接同步到位） */
@media (prefers-reduced-motion: reduce) {
  html[data-theme][data-view="high"] .nav-blob {
    transition: none;
  }
  html[data-theme][data-view="high"] .att-seg .nav-blob {
    transition: none;
  }
  html[data-theme][data-view="high"] .room-sk-fill {
    animation: none;
    background-position: center;
  }
  html[data-theme][data-view="high"] .set-switch::after,
  html[data-theme][data-view="high"] .room-switch::after {
    transition: none;
  }
}

/* ─────────———— 7. 分段控件：长按提起时允许溢出、横向手势别被页面滚走 ───────────── */
@media (max-width: 650px) {
  /* 静止时还是裁在圆角里，只有提起那一刻放开，让滑块能浮出来 */
  html[data-theme][data-view="high"] .subswitch:has(.nav-blob.grabbed),
  html[data-theme][data-view="high"] .room-seg:has(.nav-blob.grabbed),
  html[data-theme][data-view="high"] .att-seg:has(.nav-blob.grabbed) {
    overflow: visible;
  }

  /* 竖向照常滚动，横向留给滑块拖动 */
  html[data-theme][data-view="high"] .subswitch,
  html[data-theme][data-view="high"] .room-seg,
  html[data-theme][data-view="high"] .att-seg {
    touch-action: pan-y;
  }

  /* 拖到哪一格，哪一格就先亮起来 */
  html[data-theme][data-view="high"] .subswitch button.nav-blob-target,
  html[data-theme][data-view="high"] .room-seg button.nav-blob-target,
  html[data-theme][data-view="high"] .att-seg button.nav-blob-target {
    color: #245cff !important;
  }
  html[data-theme][data-view="high"][data-scheme="dark"] .subswitch button.nav-blob-target,
  html[data-theme][data-view="high"][data-scheme="dark"] .room-seg button.nav-blob-target,
  html[data-theme][data-view="high"][data-scheme="dark"] .att-seg button.nav-blob-target {
    color: #7fb3ff !important;
  }
}
