/* Mituo Music 底部胶囊导航 · v7「液态玻璃：四面水滴接触面 + 连续过渡 + 3D 折射」
   相对 v6 的关键修正（用户反馈：水滴边缘过渡不自然、且要四面都有）：
     ① 折射位移图与 nav 实测比例(206x63)一致、各向同性；折射峰对齐可见轮廓
        （filter region 112% → 位移图内留 5.36% 边距），不再错位到轮廓外；
     ② 外部位移平滑衰减到 0（四角零位移），消除 v6 四角恒定满幅造成的硬切；
        边缘用 smootherstep 连续上升 + 液面翻卷双峰，过渡自然无断层；
     ③ 明暗结构从「只有上/下」改为「上/下/左/右四面 + 四角连续」：
        四面 inset 亮脊 + 四面全反射暗带 + 四面渐变卷边（随圆角裁剪，无十字接缝）；
     ④ 双端拖动(touch-action:none)、果冻回弹、绿滑球、白色播放栏、按钮下白板去除全部保留。
   播放栏不覆盖；其它页面与构建产物不动。 */

/* ① 胶囊本体：高透明中心 + 真实边缘折射（3D 核心） */
nav[aria-label="主导航"] {
  background: rgba(29, 170, 114, .035) !important;                    /* 不支持 color-mix 时退化 */
  background: color-mix(in srgb, var(--primary) 3.5%, transparent) !important;
  border: 1px solid rgba(255, 255, 255, .62) !important;
  /* 手指 / 鼠标左右拖动：禁止浏览器把水平拖动误判为页面滚动手势（手机端关键修复） */
  touch-action: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  /* 渐进增强：不支持 SVG filter 时保留基础玻璃；支持时升级为真实背景折射 */
  -webkit-backdrop-filter: blur(6px) saturate(165%) !important;
  backdrop-filter: blur(6px) saturate(165%) !important;
  -webkit-backdrop-filter: url(#mt-liquid-refract) !important;
  backdrop-filter: url(#mt-liquid-refract) !important;
  /* 四面水滴接触面：亮脊(四面) → 全反射暗带(四面) → 外侧接触阴影。
     inset 阴影天然沿圆角连续，四角不断层；不再只有上下两条。 */
  box-shadow:
    inset 0 1.5px 0 -.5px rgba(255, 255, 255, 1),
    inset 0 -1.5px 0 -.5px rgba(255, 255, 255, .92),
    inset 1.5px 0 0 -.5px rgba(255, 255, 255, 1),
    inset -1.5px 0 0 -.5px rgba(255, 255, 255, 1),
    inset 0 3px 5px -3px rgba(9, 42, 30, .28),
    inset 0 -3px 5px -3px rgba(9, 42, 30, .30),
    inset 3px 0 5px -3px rgba(9, 42, 30, .28),
    inset -3px 0 5px -3px rgba(9, 42, 30, .28),
    0 1px 0 0 rgba(9, 42, 30, .30),
    0 3px 7px -3px rgba(9, 42, 30, .38),
    0 12px 26px -10px rgba(9, 42, 30, .42) !important;
  /* 被按住时整体轻微回弹（nav 无内联 transition，安全） */
  transition: scale .28s cubic-bezier(.34, 1.56, .64, 1) !important;
}
nav[aria-label="主导航"]:active { scale: 1.015 .985 !important; }

/* ② 四面液面卷起：四条边各自向内平滑衰减(14px)，四角两带叠加更亮(曲率大)，
     由 border-radius:inherit 沿圆角裁剪 → 四面都有、四角连续、无十字接缝 */
nav[aria-label="主导航"]::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.92) 0, rgba(255,255,255,.34) 2px, rgba(255,255,255,.06) 7px, rgba(255,255,255,0) 14px) top    / 100% 14px no-repeat,
    linear-gradient(0deg,   rgba(255,255,255,.80) 0, rgba(255,255,255,.26) 3px, rgba(255,255,255,.05) 7px, rgba(255,255,255,0) 14px) bottom / 100% 14px no-repeat,
    linear-gradient(90deg,  rgba(255,255,255,.92) 0, rgba(255,255,255,.34) 2px, rgba(255,255,255,.06) 7px, rgba(255,255,255,0) 14px) left   / 14px 100% no-repeat,
    linear-gradient(270deg, rgba(255,255,255,.92) 0, rgba(255,255,255,.34) 2px, rgba(255,255,255,.06) 7px, rgba(255,255,255,0) 14px) right  / 14px 100% no-repeat !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

/* ③ 四面内凹全反射暗带：液面翻卷进去的厚度（四面 + 四角连续） */
nav[aria-label="主导航"]::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background:
    linear-gradient(180deg, rgba(9,42,30,.20) 0, rgba(9,42,30,0) 10px) top    / 100% 10px no-repeat,
    linear-gradient(0deg,   rgba(9,42,30,.22) 0, rgba(9,42,30,0) 10px) bottom / 100% 10px no-repeat,
    linear-gradient(90deg,  rgba(9,42,30,.20) 0, rgba(9,42,30,0) 10px) left   / 10px 100% no-repeat,
    linear-gradient(270deg, rgba(9,42,30,.20) 0, rgba(9,42,30,0) 10px) right  / 10px 100% no-repeat !important;
  pointer-events: none !important;
}

/* ④ 绿色选中框：3D 果冻质感（上缘高光脊 + 下缘接触暗边 + 主色湿痕光晕）
     不动组件的 left / width / transform / transition，弹簧吸附与拖动跟手保持原生 */
nav[aria-label="主导航"] span[class*="bg-primary/20"] {
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--primary) 34%, transparent),
      color-mix(in srgb, var(--primary) 20%, transparent)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .78),
    inset 0 -1px 0 rgba(9, 42, 30, .20),
    inset 0 0 0 1px rgba(255, 255, 255, .24),
    0 3px 10px -3px color-mix(in srgb, var(--primary) 48%, transparent) !important;
  backdrop-filter: blur(3px) !important;
  -webkit-backdrop-filter: blur(3px) !important;
  /* 果冻拉长：独立 scale 属性（与组件内联 transform:scale 相乘，互不覆盖）。
     由增强脚本用 rAF 弹性插值写入 --mt-sx/--mt-sy，松手带过冲回弹（QQ 弹弹）。
     绝不在此声明 transition —— 组件内联的 left/width 0.5s 弹簧是松手吸附的核心。 */
  scale: var(--mt-sx, 1) var(--mt-sy, 1);
}

/* ⑤ 按钮下面不再垫白：内容延伸到屏幕底部，导航悬浮在内容之上（仅重构后的首页） */
div.h-dvh:has(.mt-card) > div.pointer-events-none.flex-none.z-40 {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40 !important;
}

/* 深色：四面接触阴影加深、高光收敛为银亮细线，避免泛白；折射一致 */
.dark nav[aria-label="主导航"] {
  background: color-mix(in srgb, var(--primary) 4%, transparent) !important;
  border-color: rgba(255, 255, 255, .34) !important;
  box-shadow:
    inset 0 1.5px 0 -.5px rgba(255, 255, 255, .72),
    inset 0 -1.5px 0 -.5px rgba(255, 255, 255, .60),
    inset 1.5px 0 0 -.5px rgba(255, 255, 255, .72),
    inset -1.5px 0 0 -.5px rgba(255, 255, 255, .72),
    inset 0 3px 5px -3px rgba(0, 0, 0, .50),
    inset 0 -3px 5px -3px rgba(0, 0, 0, .55),
    inset 3px 0 5px -3px rgba(0, 0, 0, .50),
    inset -3px 0 5px -3px rgba(0, 0, 0, .50),
    0 1px 0 0 rgba(0, 0, 0, .62),
    0 4px 9px -3px rgba(0, 0, 0, .68),
    0 14px 30px -10px rgba(0, 0, 0, .78) !important;
}
.dark nav[aria-label="主导航"]::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,.52) 0, rgba(255,255,255,.18) 2px, rgba(255,255,255,.03) 7px, rgba(255,255,255,0) 14px) top    / 100% 14px no-repeat,
    linear-gradient(0deg,   rgba(255,255,255,.42) 0, rgba(255,255,255,.12) 3px, rgba(255,255,255,.02) 7px, rgba(255,255,255,0) 14px) bottom / 100% 14px no-repeat,
    linear-gradient(90deg,  rgba(255,255,255,.52) 0, rgba(255,255,255,.18) 2px, rgba(255,255,255,.03) 7px, rgba(255,255,255,0) 14px) left   / 14px 100% no-repeat,
    linear-gradient(270deg, rgba(255,255,255,.52) 0, rgba(255,255,255,.18) 2px, rgba(255,255,255,.03) 7px, rgba(255,255,255,0) 14px) right  / 14px 100% no-repeat !important;
}
.dark nav[aria-label="主导航"]::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,.34) 0, rgba(0,0,0,0) 10px) top    / 100% 10px no-repeat,
    linear-gradient(0deg,   rgba(0,0,0,.38) 0, rgba(0,0,0,0) 10px) bottom / 100% 10px no-repeat,
    linear-gradient(90deg,  rgba(0,0,0,.34) 0, rgba(0,0,0,0) 10px) left   / 10px 100% no-repeat,
    linear-gradient(270deg, rgba(0,0,0,.34) 0, rgba(0,0,0,0) 10px) right  / 10px 100% no-repeat !important;
}
