/* ==========================================================================
   tzyi.pw · App Store 式导航
   - 顶部：图标 + 网址，撑满整行
   - 主体：一张大玻璃面板里的 App 列表
   - 底部：悬浮 Dock，装分类与搜索
   - 按下：图标主色像水一样浸满整行
   ========================================================================== */

:root {
  color-scheme: light;

  --bg-base: #eef0f8;
  --ink: #0d1018;
  --ink-soft: #3a4152;
  --muted: #6a7286;

  --glass: rgba(255, 255, 255, .72);
  --glass-solid: #ffffff;
  --glass-edge: rgba(255, 255, 255, .9);
  --glass-border: rgba(255, 255, 255, .7);
  --hairline: rgba(16, 20, 45, .08);
  --surface-2: rgba(120, 125, 150, .12);

  --accent: #5b4bff;
  --accent-soft: rgba(91, 75, 255, .12);
  --btn-from: #5b4bff;
  --btn-to: #9b5cff;

  --shadow-sheet: 0 2px 6px rgba(20, 18, 60, .05), 0 30px 60px -40px rgba(20, 18, 60, .55);
  --shadow-dock: 0 2px 10px rgba(18, 16, 50, .10), 0 24px 50px -28px rgba(18, 16, 50, .55);

  --r-sheet: 26px;
  --r-icon: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg-base: #08090d;
  --ink: #f2f4fb;
  --ink-soft: #c8cddd;
  --muted: #8f97ad;

  --glass: rgba(22, 25, 35, .70);
  --glass-solid: #15171f;
  --glass-edge: rgba(255, 255, 255, .16);
  --glass-border: rgba(255, 255, 255, .10);
  --hairline: rgba(255, 255, 255, .07);
  --surface-2: rgba(255, 255, 255, .09);

  --accent: #a99bff;
  --accent-soft: rgba(140, 120, 255, .18);
  --btn-from: #5b4bff;
  --btn-to: #8b3df0;

  --shadow-sheet: 0 2px 8px rgba(0, 0, 0, .5), 0 30px 60px -40px rgba(0, 0, 0, .95);
  --shadow-dock: 0 2px 12px rgba(0, 0, 0, .6), 0 26px 50px -26px rgba(0, 0, 0, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg-base); }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 128px;          /* 给底部 Dock 留位置 */
  background: var(--bg-base);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(91, 75, 255, .26); }

/* ---------- 背景 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 520px at 8% -10%, #cfc4ff 0%, rgba(207, 196, 255, 0) 60%),
    radial-gradient(680px 460px at 92% -8%, #b7e6ff 0%, rgba(183, 230, 255, 0) 58%),
    radial-gradient(760px 520px at 84% 106%, #b8f5dc 0%, rgba(184, 245, 220, 0) 60%),
    radial-gradient(700px 480px at 6% 104%, #ffd7ec 0%, rgba(255, 215, 236, 0) 62%),
    var(--bg-base);
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(760px 520px at 20% -6%, #c9f0ff 0%, rgba(201, 240, 255, 0) 58%),
    radial-gradient(700px 480px at 88% 10%, #ffd0ef 0%, rgba(255, 208, 239, 0) 58%),
    radial-gradient(760px 520px at 6% 92%, #d3c6ff 0%, rgba(211, 198, 255, 0) 60%);
  animation: breathe 26s ease-in-out infinite alternate;
}

[data-theme="dark"] .bg {
  background:
    radial-gradient(720px 520px at 8% -10%, #2c2069 0%, rgba(44, 32, 105, 0) 60%),
    radial-gradient(680px 460px at 92% -8%, #0a3d4f 0%, rgba(10, 61, 79, 0) 58%),
    radial-gradient(760px 520px at 84% 106%, #0a4a3b 0%, rgba(10, 74, 59, 0) 60%),
    radial-gradient(700px 480px at 6% 104%, #4a1738 0%, rgba(74, 23, 56, 0) 62%),
    var(--bg-base);
}

[data-theme="dark"] .bg::after {
  background:
    radial-gradient(760px 520px at 20% -6%, #0d4d63 0%, rgba(13, 77, 99, 0) 58%),
    radial-gradient(700px 480px at 88% 10%, #4d1a3f 0%, rgba(77, 26, 63, 0) 58%),
    radial-gradient(760px 520px at 6% 92%, #2a1d63 0%, rgba(42, 29, 99, 0) 60%);
}

@keyframes breathe { 0% { opacity: 0; } 55% { opacity: .9; } 100% { opacity: .4; } }

/* ---------- 顶栏：图标 + 网址 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--glass);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-edge);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--btn-from), var(--btn-to));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 14px -8px rgba(91, 75, 255, .9);
}

.brand-url { font-size: 17px; font-weight: 760; letter-spacing: -.025em; }
.brand-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.topbar-spacer { flex: 1; }

.icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 15px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--ink);
  cursor: pointer;
  transition: transform .14s, background .2s;
}
.icon-btn:hover { transform: translateY(-1px); }

/* ---------- 主体 ---------- */
.stage {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 8px;
}

.stage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stage-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.stage-title h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.035em;
}
.stage-count { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

.region {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}
.region button {
  padding: 5px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.region button[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(140deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 6px 14px -10px rgba(91, 75, 255, 1);
}

/* ---------- 大玻璃面板 ---------- */
.sheet {
  position: relative;
  border-radius: var(--r-sheet);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sheet), inset 0 1px 0 var(--glass-edge);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  overflow: hidden;
}

/* 玻璃斜切高光 */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(152deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 44%);
  opacity: .7;
}
[data-theme="dark"] .sheet::before {
  background: linear-gradient(152deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 46%);
  opacity: .8;
}

.rows {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.rows.is-empty { display: block; }

/* ---------- App 行 ---------- */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  isolation: isolate;
  transition: background .18s ease;
  content-visibility: auto;
  contain-intrinsic-size: 0 82px;
}
.row:hover { background: rgba(var(--tint), .10); }

/* 按下时颜色像水从图标处漫开 */
.row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 130% at 22% 50%, rgba(var(--tint), .98) 0%, rgba(var(--tint), .86) 62%, rgba(var(--tint), .95) 100%);
  clip-path: circle(0% at 42px 50%);
  opacity: 0;
  transition: clip-path .55s cubic-bezier(.22, .75, .25, 1), opacity .22s ease;
}
.row.pressing::after { clip-path: circle(135% at 42px 50%); opacity: 1; }
.row.pressing .name-text,
.row.pressing .desc,
.row.pressing .open,
.row.pressing .clicks { color: #fff; }
.row.pressing .open { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .5); }
.row.pressing .geo { color: #fff; background: rgba(255, 255, 255, .22); }

.app-icon {
  position: relative;
  z-index: 1;
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--r-icon);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(var(--tint), .16);
  box-shadow: 0 8px 18px -12px rgba(var(--tint), .95), inset 0 1px 0 rgba(255, 255, 255, .8);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
[data-theme="dark"] .app-icon { background: #f7f8fc; }
.app-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-icon.fallback {
  background: linear-gradient(150deg, rgba(var(--tint), 1), rgba(var(--tint), .72));
  border-color: rgba(255, 255, 255, .28);
}

.meta {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.name-text {
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -.012em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s;
}

.geo {
  flex: none;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  transition: color .18s, background .18s;
}

.desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s;
}

.tail {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.clicks { font-size: 10px; font-family: var(--mono); color: var(--muted); min-height: 13px; transition: color .18s; }

.open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(var(--tint), .16);
  border: 1px solid rgba(var(--tint), .22);
  border-radius: 999px;
  transition: background .18s, color .18s, border-color .18s, transform .12s;
}
.row:hover .open { background: rgba(var(--tint), .26); }

/* ---------- 底部 Dock ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  width: max-content;
  max-width: min(94vw, 780px);
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-dock), inset 0 1px 0 var(--glass-edge);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  transition: max-width .28s ease;
}

.dock-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: min(72vw, 640px);
  scroll-behavior: smooth;
  transition: opacity .2s ease;
}
.dock-tabs::-webkit-scrollbar { display: none; }

.dock-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 19px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.dock-tab:hover { background: var(--surface-2); }
.dock-tab[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(140deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 8px 18px -12px rgba(91, 75, 255, 1), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.dock-count { font-size: 10px; font-weight: 600; opacity: .65; font-variant-numeric: tabular-nums; }

.dock-search-btn {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: background .18s, transform .14s;
}
.dock-search-btn:hover { transform: scale(1.06); }
.dock-search-btn svg { width: 17px; height: 17px; fill: var(--ink-soft); }

/* Dock 里的搜索：点开后铺满 Dock */
.dock-search {
  position: absolute;
  inset: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 14px;
  border-radius: 20px;
  background: var(--glass-solid);
  border: 1px solid var(--hairline);
  opacity: 0;
  transform: scale(.96);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.dock.searching .dock-search { opacity: 1; transform: none; pointer-events: auto; }
.dock.searching .dock-tabs,
.dock.searching .dock-search-btn { opacity: 0; pointer-events: none; }
.dock.searching { max-width: min(94vw, 780px); }

.dock-search > svg { width: 16px; height: 16px; fill: var(--muted); flex: none; }
.dock-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  height: 36px;
}
.dock-search input::placeholder { color: var(--muted); }

.dock-cancel {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

/* ---------- 空状态 / 骨架 ---------- */
.empty { padding: 56px 20px; text-align: center; }
.empty-title { margin: 0 0 6px; font-size: 15px; font-weight: 650; }
.empty-sub { margin: 0; font-size: 13px; color: var(--muted); }

.btn {
  margin-top: 14px;
  padding: 9px 18px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(140deg, var(--btn-from), var(--btn-to));
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.sheet-skeleton {
  height: 420px;
  background: linear-gradient(100deg, var(--surface-2) 25%, var(--glass) 37%, var(--surface-2) 63%);
  background-size: 300% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 页脚 ---------- */
.footer {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 0 20px 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.footer .dot { opacity: .5; }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--ink);
  background: var(--glass-solid);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  box-shadow: var(--shadow-dock);
}

/* ---------- 响应式 ---------- */


@media (max-width: 719px) {
  body { padding-bottom: 112px; }
  .topbar-inner { padding: 9px 14px; gap: 8px; }
  .brand-url { font-size: 16px; }
  .stage { padding: 16px 14px 6px; }
  .stage-title h1 { font-size: 24px; }
  .sheet { border-radius: 22px; }
  .row { padding: 11px 13px; gap: 11px; }
  .app-icon { width: 48px; height: 48px; border-radius: 12px; }
  .name-text { font-size: 14px; }
  .desc { font-size: 12px; }
  .open { min-width: 54px; padding: 4px 11px; font-size: 12px; }
  .clicks { display: none; }
  .dock { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 24px; max-width: calc(100vw - 20px); }
  .dock-tabs { max-width: calc(100vw - 96px); }
  .footer { padding: 0 14px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .sheet, .dock { background: var(--glass-solid); }
}

/* ===== 底部栏（新版）：4 个分组 + 独立圆形搜索 ===== */
.dock-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 94vw;
  transition: opacity .2s ease, transform .28s ease;
}
.dock-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(14px);
}

.dock {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  width: max-content;
  max-width: calc(94vw - 62px);
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-dock), inset 0 1px 0 var(--glass-edge);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
}

.dock-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 20px;
  background: linear-gradient(140deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 12px 24px -16px rgba(91, 75, 255, 1), inset 0 1px 0 rgba(255, 255, 255, .45);
  transition: transform .42s cubic-bezier(.25, .8, .2, 1), width .42s cubic-bezier(.25, .8, .2, 1), opacity .2s;
  pointer-events: none;
  opacity: 0;
}

.dock-tab {
  position: relative;
  z-index: 1;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s;
}
.dock-tab svg { width: 16px; height: 16px; fill: currentColor; opacity: .85; }
.dock-tab[aria-selected="true"] { color: #fff; }
.dock-tab[aria-selected="true"] svg { opacity: 1; }
.dock-count { font-size: 10px; font-weight: 600; opacity: .6; font-variant-numeric: tabular-nums; }
.dock-tab[aria-selected="true"] .dock-count { opacity: .85; }

.search-fab {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-dock), inset 0 1px 0 var(--glass-edge);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  cursor: pointer;
  transition: transform .16s ease;
}
.search-fab:hover { transform: scale(1.05); }
.search-fab svg { width: 20px; height: 20px; fill: var(--ink); }

.search-panel {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(94vw, 780px);
  padding: 8px 8px 8px 16px;
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-dock);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .28s cubic-bezier(.25, .8, .2, 1);
}
.search-panel.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.search-panel svg { width: 16px; height: 16px; fill: var(--muted); flex: none; }
.search-panel input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.panel-cancel {
  flex: none;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: var(--accent);
  background: var(--surface-2);
  border: 0;
  border-radius: 19px;
  cursor: pointer;
}

.app-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

@media (max-width: 719px) {
  .dock-bar { max-width: calc(100vw - 20px); gap: 8px; }
  .dock { max-width: calc(100vw - 90px); padding: 5px; }
  .dock-tab { padding: 8px 11px; font-size: 12.5px; }
  .dock-tab svg { width: 15px; height: 15px; }
  .dock-count { display: none; }
  .search-fab { width: 46px; height: 46px; }
  .search-panel { width: calc(100vw - 20px); }
}

/* ==========================================================================
   v3：真·液态玻璃 + iOS 手感
   - 玻璃更透（背景 alpha 降到 ~.3）、模糊更强，能看见背后颜色在流动
   - 高光/内阴影做出玻璃的折射边
   - 动效统一走 spring 曲线，按压有回弹
   ========================================================================== */
:root {
  --glass: rgba(255, 255, 255, .34);
  --glass-border: rgba(255, 255, 255, .60);
  --glass-edge: rgba(255, 255, 255, .95);
  --spring: cubic-bezier(.32, 1.34, .56, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="dark"] {
  --glass: rgba(30, 34, 50, .40);
  --glass-border: rgba(255, 255, 255, .16);
  --glass-edge: rgba(255, 255, 255, .28);
}

/* 背景更饱和，玻璃才有东西可折射 */
.bg {
  background:
    radial-gradient(720px 560px at 10% 4%, #a78bfa 0%, rgba(167, 139, 250, 0) 58%),
    radial-gradient(680px 520px at 92% 2%, #67e8f9 0%, rgba(103, 232, 249, 0) 55%),
    radial-gradient(800px 600px at 82% 98%, #6ee7b7 0%, rgba(110, 231, 183, 0) 56%),
    radial-gradient(760px 560px at 4% 96%, #fda4af 0%, rgba(253, 164, 175, 0) 58%),
    #eef0f8;
}

[data-theme="dark"] .bg {
  background:
    radial-gradient(720px 560px at 10% 4%, #4c1d95 0%, rgba(76, 29, 149, 0) 58%),
    radial-gradient(680px 520px at 92% 2%, #0e7490 0%, rgba(14, 116, 144, 0) 55%),
    radial-gradient(800px 600px at 82% 98%, #047857 0%, rgba(4, 120, 87, 0) 56%),
    radial-gradient(760px 560px at 4% 96%, #9f1239 0%, rgba(159, 18, 57, 0) 58%),
    #08090d;
}

/* 三块玻璃统一：透 + 强模糊 + 折射高光 */
.topbar,
.dock,
.search-fab,
.search-panel,
.sheet {
  background: var(--glass);
  border-color: var(--glass-border);
  backdrop-filter: blur(46px) saturate(210%) brightness(1.05);
  -webkit-backdrop-filter: blur(46px) saturate(210%) brightness(1.05);
}

.topbar {
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 rgba(255, 255, 255, .12),
              0 1px 0 rgba(20, 18, 60, .04);
}

/* 面板用渐变玻璃，比纯色更像玻璃片 */
.sheet {
  background: linear-gradient(168deg,
    rgba(255, 255, 255, .52) 0%,
    rgba(255, 255, 255, .26) 52%,
    rgba(255, 255, 255, .36) 100%);
  box-shadow:
    0 2px 6px rgba(20, 18, 60, .05),
    0 34px 70px -46px rgba(20, 18, 60, .62),
    inset 0 1px 0 var(--glass-edge),
    inset 0 -1px 0 rgba(255, 255, 255, .16);
}

[data-theme="dark"] .sheet {
  background: linear-gradient(168deg,
    rgba(44, 49, 68, .58) 0%,
    rgba(22, 25, 37, .40) 52%,
    rgba(32, 36, 52, .50) 100%);
}

/* ---------- 底栏放大 10% ---------- */
.dock-bar { gap: 11px; }

.dock {
  padding: 7px;
  gap: 3px;
  border-radius: 29px;
  box-shadow:
    0 2px 10px rgba(18, 16, 50, .10),
    0 26px 54px -30px rgba(18, 16, 50, .6),
    inset 0 1px 0 var(--glass-edge),
    inset 0 -1px 0 rgba(255, 255, 255, .14);
}

.dock-tab {
  padding: 10px 15px;
  gap: 7px;
  font-size: 14px;
  border-radius: 22px;
  transition: color .26s var(--ease), transform .34s var(--spring);
}
.dock-tab:active { transform: scale(.95); }
.dock-tab svg { width: 17px; height: 17px; }

.dock-indicator {
  top: 7px;
  bottom: 7px;
  border-radius: 22px;
  transition: transform .58s var(--spring), width .58s var(--spring), opacity .25s var(--ease);
}

.dock-count { font-size: 10.5px; }

.search-fab {
  width: 57px;
  height: 57px;
  border-radius: 50%;
  box-shadow:
    0 2px 10px rgba(18, 16, 50, .10),
    0 26px 54px -30px rgba(18, 16, 50, .6),
    inset 0 1px 0 var(--glass-edge),
    inset 0 -1px 0 rgba(255, 255, 255, .14);
  transition: transform .36s var(--spring);
}
.search-fab svg { width: 22px; height: 22px; }
.search-fab:active { transform: scale(.93); }

.search-panel {
  border-radius: 29px;
  transition: opacity .26s var(--ease), transform .5s var(--spring);
}

/* ---------- 列表与按压动效 ---------- */
.row {
  transition: background .24s var(--ease), transform .46s var(--spring);
  animation: row-in .52s var(--ease) both;
  animation-delay: var(--d, 0ms);
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(10px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.row.pressing { transform: scale(.986); }

.row::after {
  transition: clip-path .62s var(--ease), opacity .24s var(--ease);
}

.app-icon {
  transition: transform .46s var(--spring), box-shadow .3s var(--ease);
}
.row.pressing .app-icon { transform: scale(.88); }

.open {
  transition: background .24s var(--ease), color .24s var(--ease),
              border-color .24s var(--ease), transform .34s var(--spring);
}
.row.pressing .open { transform: scale(.96); }

/* 顶部标题切换的轻微弹入 */
.stage-title h1 {
  transition: opacity .3s var(--ease), transform .4s var(--spring);
}

/* ==========================================================================
   v4：iOS 式 tab（图标在上、文字在下）+ 系统蓝 + 分层过渡
   ========================================================================== */
:root {
  --ios-blue: #007aff;
  --ios-blue-2: #5ac8fa;
  --ios-blue-soft: rgba(0, 122, 255, .13);
}

[data-theme="dark"] {
  --ios-blue: #0a84ff;
  --ios-blue-2: #64d2ff;
  --ios-blue-soft: rgba(10, 132, 255, .20);
}

/* 左上角图标改蓝 */
.brand-mark {
  background: linear-gradient(145deg, var(--ios-blue), var(--ios-blue-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 16px -10px rgba(0, 122, 255, .95);
}

/* tab 改为竖排：图标在上、文字在下 */
.dock { padding: 7px 6px 6px; gap: 2px; }

.dock-tab {
  flex-direction: column;
  gap: 3px;
  min-width: 58px;
  padding: 6px 10px 5px;
  border-radius: 18px;
}

.tab-icon { display: grid; place-items: center; height: 22px; }
.tab-icon svg {
  width: 21px;
  height: 21px;
  fill: var(--ios-blue);
  opacity: .5;
  transition: opacity .3s var(--ease), transform .55s var(--spring);
}

.tab-name {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--muted);
  transition: color .26s var(--ease);
}

.dock-tab[aria-selected="true"] .tab-icon svg {
  opacity: 1;
  animation: tab-pop .58s var(--spring);
}

@keyframes tab-pop {
  0% { transform: scale(.84); }
  55% { transform: scale(1.14) translateY(-1px); }
  100% { transform: scale(1.06) translateY(-1px); }
}

.dock-tab[aria-selected="true"] .tab-name { color: var(--ios-blue); }

/* 选中胶囊：蓝色玻璃 + 弹性滑动 */
.dock-indicator {
  border-radius: 18px;
  background: var(--ios-blue-soft);
  border: 1px solid rgba(0, 122, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 8px 18px -14px rgba(0, 122, 255, .9);
  will-change: transform, width;
}

[data-theme="dark"] .dock-indicator {
  border-color: rgba(10, 132, 255, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 8px 18px -14px rgba(0, 0, 0, .9);
}

/* 搜索圆钮图标也跟随系统蓝 */
.search-fab svg { fill: var(--ios-blue); }

/* 切换分组时标题轻轻弹一下 */
.stage-title h1.pop { animation: title-pop .44s var(--spring); }
@keyframes title-pop {
  from { opacity: .3; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* 手机端：竖排后能完整放下 4 个 tab + 搜索 */
@media (max-width: 719px) {
  .dock-bar { gap: 8px; max-width: calc(100vw - 16px); }
  .dock { padding: 6px 4px 5px; gap: 0; max-width: calc(100vw - 82px); }
  .dock-tab { min-width: 50px; padding: 5px 5px 4px; }
  .tab-icon { height: 20px; }
  .tab-icon svg { width: 19px; height: 19px; }
  .tab-name { font-size: 9.5px; }
  .search-fab { width: 50px; height: 50px; }
  .search-fab svg { width: 20px; height: 20px; }
}

/* v4.1：选中态不再自带紫色底，交给蓝色胶囊 */
.dock-tab[aria-selected="true"] {
  background: none;
  box-shadow: none;
  color: var(--ios-blue);
}

.dock-tab { gap: 4px; padding: 7px 10px 6px; }

.dock-tab svg { width: 22px; height: 22px; }
.tab-icon { height: 23px; }

@media (max-width: 719px) {
  .dock-tab { padding: 6px 8px 5px; gap: 3px; }
  .tab-icon { height: 21px; }
  .dock-tab svg { width: 20px; height: 20px; }
}

/* v4.2：居中不用 transform（transform 祖先会让 Safari 的 backdrop-filter 失效） */
.dock-bar {
  left: 0;
  right: 0;
  margin: 0 auto;
  width: max-content;
  transform: none;
  justify-content: center;
}
.dock-bar.hidden { transform: translateY(14px); }

.search-panel {
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: translateY(16px);
}
.search-panel.open { transform: none; }

/* 玻璃再透一点点，但保证 Dock 上文字可读 */
:root { --glass-dock: rgba(255, 255, 255, .42); }
[data-theme="dark"] { --glass-dock: rgba(28, 32, 46, .46); }
.dock, .search-fab, .search-panel { background: var(--glass-dock); }

/* v4.3：给标签留出呼吸空间，避免贴到胶囊底边 */
.dock { padding: 7px; }
.dock-tab { padding: 8px 10px 7px; gap: 3px; }
.tab-icon { height: 21px; }
.dock-tab svg { width: 21px; height: 21px; }
.tab-name { line-height: 1.15; }

.dock-indicator { top: 7px; bottom: 7px; }

@media (max-width: 719px) {
  .dock { padding: 6px; }
  .dock-tab { padding: 7px 8px 6px; }
  .tab-icon { height: 20px; }
  .dock-tab svg { width: 20px; height: 20px; }
}

/* ==========================================================================
   v5：底栏放大 + 液态滑动（拉伸—回弹由 JS 的 WAAPI 驱动，这里只管外观）
   ========================================================================== */
.dock {
  padding: 8px 14px;
  gap: 2px;
  border-radius: 34px;
}

.dock-tab {
  min-width: 64px;
  padding: 9px 12px 8px;
  gap: 4px;
  border-radius: 22px;
}

.tab-icon { height: 23px; }
.dock-tab svg { width: 23px; height: 23px; }
.tab-name { font-size: 11px; line-height: 1.15; }

/* 液态指示块：不再用 CSS 过渡，交给 JS 关键帧，避免两套动画打架 */
.dock-indicator {
  top: 8px;
  bottom: 8px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(0, 122, 255, .16), rgba(0, 122, 255, .10));
  border: 1px solid rgba(0, 122, 255, .24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .7),
    inset 0 -1px 0 rgba(0, 122, 255, .10),
    0 10px 24px -16px rgba(0, 122, 255, .85);
  transition: opacity .3s var(--ease);
  will-change: transform, width;
}

[data-theme="dark"] .dock-indicator {
  background: linear-gradient(180deg, rgba(10, 132, 255, .28), rgba(10, 132, 255, .16));
  border-color: rgba(10, 132, 255, .40);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 10px 24px -16px rgba(0, 0, 0, .9);
}

.dock-bar { gap: 12px; }

.search-fab { width: 62px; height: 62px; }
.search-fab svg { width: 24px; height: 24px; }

@media (max-width: 719px) {
  .dock { padding: 7px 6px; border-radius: 28px; }
  .dock-tab { min-width: 58px; padding: 8px 8px 7px; gap: 3px; }
  .tab-icon { height: 21px; }
  .dock-tab svg { width: 21px; height: 21px; }
  .tab-name { font-size: 10px; }
  .dock-indicator { top: 7px; bottom: 7px; border-radius: 18px; }
  .dock-bar { gap: 9px; }
  .search-fab { width: 56px; height: 56px; }
  .search-fab svg { width: 22px; height: 22px; }
}

/* ==========================================================================
   v6：底栏拉长放大 + 按住拖动的液态跟随
   ========================================================================== */
.dock-bar {
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  margin: 0 auto;
}

.dock {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
  padding: 9px 12px;
  gap: 2px;
  touch-action: pan-y;
}

.dock-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 8px 8px;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.tab-icon { height: 24px; }
.dock-tab svg { width: 24px; height: 24px; }
.tab-name { font-size: 11.5px; }

.dock-indicator { top: 9px; bottom: 9px; }

/* 拖到哪个 tab，哪个 tab 的文字先亮起来 */
.dock-tab[data-preview] .tab-name { color: var(--ios-blue); }
.dock-tab[data-preview] .tab-icon svg { opacity: .95; }

.search-fab { width: 64px; height: 64px; }
.search-fab svg { width: 25px; height: 25px; }

@media (max-width: 719px) {
  .dock-bar { width: calc(100vw - 20px); gap: 8px; }
  .dock { padding: 7px 8px; }
  .dock-tab { padding: 8px 4px 7px; gap: 3px; }
  .tab-icon { height: 22px; }
  .dock-tab svg { width: 22px; height: 22px; }
  .tab-name { font-size: 10.5px; }
  .dock-indicator { top: 7px; bottom: 7px; border-radius: 20px; }
  .search-fab { width: 56px; height: 56px; }
}

/* ==========================================================================
   v7：按 App Store 参考图放大底栏 + 干掉双击缩放
   ========================================================================== */

/* touch-action: manipulation → 去掉双击放大和 300ms 点击延迟，但保留双指缩放 */
html,
body {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
a,
button,
.dock-tab,
.region button,
.open {
  touch-action: manipulation;
}

/* 底栏是拖动区：不让页面滚动手势抢走（页面还是可以从内容区滚） */
.dock,
.dock-tab {
  touch-action: none;
}

/* 桌面：再高一档 */
.dock { padding: 10px 14px; border-radius: 34px; }
.dock-tab { padding: 10px 8px 9px; gap: 4px; }
.tab-icon { height: 25px; }
.dock-tab svg { width: 25px; height: 25px; }
.tab-name { font-size: 12px; }
.dock-indicator { top: 10px; bottom: 10px; }

@media (max-width: 719px) {
  body { padding-bottom: 130px; }

  .dock-bar {
    width: calc(100vw - 16px);
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }

  .dock {
    padding: 8px 10px;
    border-radius: 30px;
  }

  .dock-tab {
    padding: 10px 4px 9px;
    gap: 4px;
    border-radius: 22px;
  }

  .tab-icon { height: 26px; }
  .dock-tab svg { width: 26px; height: 26px; }
  .tab-name { font-size: 11px; letter-spacing: 0; }

  .dock-indicator { top: 8px; bottom: 8px; border-radius: 22px; }

  .search-fab { width: 62px; height: 62px; }
  .search-fab svg { width: 25px; height: 25px; }
}

/* 手机屏幕上底栏压着内容，稍微提高不透明度保证文字可读（仍然透） */
@media (max-width: 719px) {
  :root { --glass-dock: rgba(255, 255, 255, .58); }
  [data-theme="dark"] { --glass-dock: rgba(26, 30, 44, .62); }
}

/* ==========================================================================
   v8：对照 App Store 底栏
   - 胶囊圆角（999px），图标 30px，搜索圆钮与底栏等高
   - 未选中：深色（黑）；选中：系统蓝
   - 图标加 drop-shadow 做出轻微立体感
   ========================================================================== */
:root {
  --tab-ink: #10131c;
  --dock-h: 84px;
}

[data-theme="dark"] {
  --tab-ink: #e9ecf5;
}

.dock {
  height: var(--dock-h);
  padding: 0 18px;
  border-radius: 999px;
  align-items: center;
  gap: 4px;
}

.dock-tab {
  height: calc(var(--dock-h) - 14px);
  padding: 0 12px;
  border-radius: 999px;
  justify-content: center;
  gap: 5px;
}

.tab-icon { height: 30px; }
.dock-tab svg {
  width: 30px;
  height: 30px;
  fill: var(--tab-ink);
  opacity: 1;
  filter: drop-shadow(0 1px 1.5px rgba(12, 16, 34, .22));
  transition: fill .28s var(--ease), filter .28s var(--ease), transform .5s var(--spring);
}

[data-theme="dark"] .dock-tab svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}

.tab-name {
  font-size: 11.5px;
  color: var(--muted);
  transition: color .28s var(--ease);
}

.dock-tab[aria-selected="true"] svg {
  fill: var(--ios-blue);
  filter: drop-shadow(0 1.5px 3px rgba(0, 122, 255, .38));
}

.dock-tab[aria-selected="true"] .tab-name { color: var(--ios-blue); }

/* 搜索圆钮与底栏等高 */
.search-fab {
  width: var(--dock-h);
  height: var(--dock-h);
  border-radius: 50%;
}
.search-fab svg { width: 27px; height: 27px; fill: var(--tab-ink); }

.dock-indicator {
  top: 7px;
  bottom: 7px;
  border-radius: 999px;
}

@media (max-width: 719px) {
  :root { --dock-h: 78px; }

  .dock { padding: 0 10px; gap: 2px; }
  .dock-tab { height: calc(var(--dock-h) - 12px); padding: 0 4px; gap: 4px; }
  .tab-icon { height: 28px; }
  .dock-tab svg { width: 28px; height: 28px; }
  .tab-name { font-size: 11px; }
  .search-fab { width: var(--dock-h); height: var(--dock-h); }
  .search-fab svg { width: 26px; height: 26px; }
  .dock-indicator { top: 6px; bottom: 6px; }
}

/* ==========================================================================
   v9：1:1 对照 App Store 底栏
   - 白玻璃胶囊（几乎实心白）+ 细白边 + 柔和投影
   - 图标 30px、文字 11.5px，未选中纯黑、选中系统蓝
   - 选中态是"柔光晕"而不是硬边框胶囊
   - 搜索圆钮独立在右，与底栏等高
   ========================================================================== */
:root {
  --glass-dock: rgba(255, 255, 255, .88);
  --tab-ink: #0b0d12;
  --dock-h: 86px;
}

[data-theme="dark"] {
  --glass-dock: rgba(30, 34, 48, .86);
  --tab-ink: #f1f3fa;
}

.dock-bar {
  width: calc(100vw - 20px);
  max-width: 620px;
  gap: 9px;
  left: 0;
  right: 0;
  margin: 0 auto;
}

.dock {
  height: var(--dock-h);
  padding: 0 16px;
  gap: 6px;
  border-radius: 999px;
  background: var(--glass-dock);
  border: 1px solid rgba(255, 255, 255, .92);
  box-shadow:
    0 2px 6px rgba(20, 20, 50, .06),
    0 18px 40px -20px rgba(20, 20, 50, .28),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
}

[data-theme="dark"] .dock {
  border-color: rgba(255, 255, 255, .10);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .5),
    0 18px 40px -20px rgba(0, 0, 0, .9),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.dock-tab {
  height: calc(var(--dock-h) - 16px);
  padding: 0 10px;
  border-radius: 999px;
  gap: 5px;
}

.tab-icon { height: 30px; }
.dock-tab svg {
  width: 30px;
  height: 30px;
  fill: var(--tab-ink);
  filter: drop-shadow(0 1px 1.5px rgba(10, 12, 24, .16));
}

.tab-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tab-ink);
  opacity: .88;
}

.dock-tab[aria-selected="true"] svg {
  fill: var(--ios-blue);
  filter: drop-shadow(0 2px 5px rgba(0, 122, 255, .45));
  animation: tab-pop .58s var(--spring);
}

.dock-tab[aria-selected="true"] .tab-name {
  color: var(--ios-blue);
  opacity: 1;
}

/* 选中柔光：不是硬边胶囊 */
.dock-indicator {
  top: 3px;
  bottom: 3px;
  border: 0;
  background: radial-gradient(60% 70% at 50% 50%,
    rgba(0, 122, 255, .30) 0%,
    rgba(0, 122, 255, .14) 55%,
    rgba(0, 122, 255, 0) 78%);
  box-shadow: none;
}

[data-theme="dark"] .dock-indicator {
  background: radial-gradient(60% 70% at 50% 50%,
    rgba(10, 132, 255, .38) 0%,
    rgba(10, 132, 255, .16) 55%,
    rgba(10, 132, 255, 0) 78%);
}

.search-fab {
  width: var(--dock-h);
  height: var(--dock-h);
  border-radius: 50%;
  background: var(--glass-dock);
  border: 1px solid rgba(255, 255, 255, .92);
  box-shadow:
    0 2px 6px rgba(20, 20, 50, .06),
    0 18px 40px -20px rgba(20, 20, 50, .28),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
}

[data-theme="dark"] .search-fab {
  border-color: rgba(255, 255, 255, .10);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .5),
    0 18px 40px -20px rgba(0, 0, 0, .9),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.search-fab svg { width: 28px; height: 28px; fill: var(--tab-ink); }

@media (max-width: 719px) {
  :root { --dock-h: 80px; }

  .dock-bar { width: calc(100vw - 16px); gap: 8px; }
  .dock { padding: 0 8px; gap: 2px; }
  .dock-tab { padding: 0 4px; height: calc(var(--dock-h) - 14px); gap: 3px; }
  .tab-icon { height: 29px; }
  .dock-tab svg { width: 29px; height: 29px; }
  .tab-name { font-size: 10.5px; }
  .search-fab { width: var(--dock-h); height: var(--dock-h); }
  .search-fab svg { width: 27px; height: 27px; }
}

/* ==========================================================================
   v10：把透明度还回来（仍然是白玻璃，但能透出背后的内容）
   ========================================================================== */
:root { --glass-dock: rgba(255, 255, 255, .52); }
[data-theme="dark"] { --glass-dock: rgba(28, 32, 46, .56); }

.dock,
.search-fab {
  background: var(--glass-dock);
  backdrop-filter: blur(38px) saturate(200%) brightness(1.04);
  -webkit-backdrop-filter: blur(38px) saturate(200%) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow:
    0 2px 8px rgba(20, 20, 50, .08),
    0 22px 44px -22px rgba(20, 20, 50, .38),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(255, 255, 255, .22);
}

[data-theme="dark"] .dock,
[data-theme="dark"] .search-fab {
  border-color: rgba(255, 255, 255, .14);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, .55),
    0 22px 44px -22px rgba(0, 0, 0, .95),
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -1px 0 rgba(255, 255, 255, .04);
}

/* 透明之后，选中光晕要稍微强一点才看得清 */
.dock-indicator {
  background: radial-gradient(60% 72% at 50% 50%,
    rgba(0, 122, 255, .34) 0%,
    rgba(0, 122, 255, .16) 55%,
    rgba(0, 122, 255, 0) 80%);
}

/* ==========================================================================
   v11：更透 + 图标按底栏高度等比放大（约 45% 高）
   ========================================================================== */
:root { --glass-dock: rgba(255, 255, 255, .40); }
[data-theme="dark"] { --glass-dock: rgba(26, 30, 44, .44); }

.dock,
.search-fab {
  background: var(--glass-dock);
  backdrop-filter: blur(44px) saturate(215%) brightness(1.05);
  -webkit-backdrop-filter: blur(44px) saturate(215%) brightness(1.05);
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow:
    0 2px 8px rgba(20, 20, 50, .07),
    0 24px 48px -24px rgba(20, 20, 50, .40),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(255, 255, 255, .18);
}

[data-theme="dark"] .dock,
[data-theme="dark"] .search-fab {
  border-color: rgba(255, 255, 255, .12);
}

/* 图标：底栏高 86 → 图标 38（约 44%），文字 12 */
.tab-icon { height: 38px; }
.dock-tab svg { width: 38px; height: 38px; }
.tab-name { font-size: 12px; font-weight: 600; }
.dock-tab { gap: 3px; }

/* 搜索图标跟 tab 图标同比例 */
.search-fab svg { width: 34px; height: 34px; }

@media (max-width: 719px) {
  :root { --dock-h: 82px; }

  .tab-icon { height: 34px; }
  .dock-tab svg { width: 34px; height: 34px; }
  .tab-name { font-size: 11px; }
  .search-fab svg { width: 30px; height: 30px; }
  .dock-tab { padding: 0 3px; }
}

/* ==========================================================================
   v12：最大化液态玻璃
   - 指针跟随的高光（--mx/--my 由 JS 实时写入）
   - 细噪点纹理（feTurbulence），做出磨砂质感
   - 边缘折射：顶部强高光 + 底部弱反光 + 一圈极淡的色散
   - 模糊加到 56px，透出背后颜色的流动
   ========================================================================== */
:root { --glass-dock: rgba(255, 255, 255, .38); }
[data-theme="dark"] { --glass-dock: rgba(26, 30, 44, .42); }

.dock,
.search-fab {
  position: relative;
  isolation: isolate;
  background: var(--glass-dock);
  backdrop-filter: blur(56px) saturate(215%) brightness(1.06);
  -webkit-backdrop-filter: blur(56px) saturate(215%) brightness(1.06);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow:
    0 2px 10px rgba(20, 20, 50, .08),
    0 26px 54px -24px rgba(20, 20, 50, .42),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(255, 255, 255, .18),
    inset 0 0 22px rgba(0, 122, 255, .06);
}

/* 跟随指针的镜面高光 */
.dock::before,
.search-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(140px 90px at var(--mx, 50%) var(--my, 0%),
      rgba(255, 255, 255, .9) 0%,
      rgba(255, 255, 255, .30) 38%,
      rgba(255, 255, 255, 0) 68%),
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 42%);
  opacity: .75;
  mix-blend-mode: screen;
  transition: opacity .3s var(--ease);
}

/* 磨砂噪点 */
.dock::after,
.search-fab::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
  opacity: .055;
  mix-blend-mode: overlay;
}

[data-theme="dark"] .dock::after,
[data-theme="dark"] .search-fab::after { opacity: .09; }

/* 内容压在玻璃层之上 */
.dock-tab { position: relative; z-index: 2; }
.dock-indicator { z-index: 1; }

/* ---------- 图标与底栏的比例 ---------- */
.tab-icon { height: 36px; }
.dock-tab svg { width: 36px; height: 36px; }

.search-fab svg { width: 36px; height: 36px; }

@media (max-width: 719px) {
  :root { --dock-h: 80px; }

  .tab-icon { height: 34px; }
  .dock-tab svg { width: 34px; height: 34px; }
  .search-fab svg { width: 34px; height: 34px; }
  .tab-name { font-size: 10.5px; }
  .dock-tab { gap: 2px; padding: 0 2px; }
  .dock { padding: 0 6px; }
}

/* ==========================================================================
   v13：再透一档（.38 → .30），模糊相应加强，避免字糊
   ========================================================================== */
:root { --glass-dock: rgba(255, 255, 255, .30); }
[data-theme="dark"] { --glass-dock: rgba(24, 28, 42, .34); }

.dock,
.search-fab {
  backdrop-filter: blur(64px) saturate(220%) brightness(1.08);
  -webkit-backdrop-filter: blur(64px) saturate(220%) brightness(1.08);
  border-color: rgba(255, 255, 255, .48);
  box-shadow:
    0 2px 10px rgba(20, 20, 50, .07),
    0 26px 54px -24px rgba(20, 20, 50, .38),
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -1px 0 rgba(255, 255, 255, .14),
    inset 0 0 26px rgba(0, 122, 255, .07);
}

[data-theme="dark"] .dock,
[data-theme="dark"] .search-fab { border-color: rgba(255, 255, 255, .10); }

/* 更透之后噪点稍微提一点，保住"玻璃面"的质感 */
.dock::after,
.search-fab::after { opacity: .07; }
[data-theme="dark"] .dock::after,
[data-theme="dark"] .search-fab::after { opacity: .11; }

/* 文字加一点点阴影，透底也能读 */
.tab-name { text-shadow: 0 1px 2px rgba(255, 255, 255, .55); }
[data-theme="dark"] .tab-name { text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

/* ==========================================================================
   v14：右上角按钮跟进底栏规格
   - 同款玻璃（.30 透明 + 64px 模糊 + 白边 + 内高光）
   - 图标平时是深色，深色模式（激活）变系统蓝
   ========================================================================== */
.icon-btn {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--tab-ink);
  background: var(--glass-dock);
  border: 1px solid rgba(255, 255, 255, .48);
  backdrop-filter: blur(64px) saturate(220%) brightness(1.08);
  -webkit-backdrop-filter: blur(64px) saturate(220%) brightness(1.08);
  box-shadow:
    0 2px 8px rgba(20, 20, 50, .07),
    0 18px 34px -20px rgba(20, 20, 50, .34),
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -1px 0 rgba(255, 255, 255, .14);
  transition: color .28s var(--ease), transform .34s var(--spring), background .3s var(--ease);
}

[data-theme="dark"] .icon-btn {
  color: var(--ios-blue);
  border-color: rgba(255, 255, 255, .10);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .5),
    0 18px 34px -20px rgba(0, 0, 0, .9),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 1.5px rgba(10, 12, 24, .18));
}

.icon-btn:hover { transform: translateY(-1px) scale(1.03); }
.icon-btn:active { transform: scale(.94); }

/* 深色模式下太阳图标带一点蓝光 */
[data-theme="dark"] .icon-btn svg { filter: drop-shadow(0 1.5px 3px rgba(0, 122, 255, .40)); }

@media (max-width: 719px) {
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn svg { width: 21px; height: 21px; }
}

/* ==========================================================================
   v15：右上角直接改成系统蓝（和底栏选中项、左上角 logo 同一色）
   ========================================================================== */
.icon-btn {
  color: var(--ios-blue);
  background-color: var(--glass-dock);
  background-image: linear-gradient(rgba(0, 122, 255, .10), rgba(0, 122, 255, .10));
  border-color: rgba(0, 122, 255, .28);
  box-shadow:
    0 2px 8px rgba(20, 20, 50, .07),
    0 18px 34px -20px rgba(0, 122, 255, .30),
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -1px 0 rgba(0, 122, 255, .12);
}

[data-theme="dark"] .icon-btn {
  color: #4da3ff;
  background-color: var(--glass-dock);
  background-image: linear-gradient(rgba(10, 132, 255, .16), rgba(10, 132, 255, .16));
  border-color: rgba(10, 132, 255, .34);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .5),
    0 18px 34px -20px rgba(10, 132, 255, .45),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}

.icon-btn svg { filter: drop-shadow(0 1.5px 3px rgba(0, 122, 255, .35)); }
[data-theme="dark"] .icon-btn svg { filter: drop-shadow(0 1.5px 4px rgba(10, 132, 255, .55)); }

/* ==========================================================================
   v16：按参考图复刻"蓝"、字体与动效
   - 选中项：淡蓝圆角块 + 蓝图标 + 蓝字
   - 未选中：黑图标 + 黑字
   - 点击：图标弹跳、文字弹入、色块落位回弹
   ========================================================================== */
:root {
  --tab-blue: #007aff;
  --tab-black: #0b0d12;
}

[data-theme="dark"] {
  --tab-blue: #0a84ff;
  --tab-black: #f1f3fa;
}

.dock-tab svg { fill: var(--tab-black); }

.tab-name {
  color: var(--tab-black);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: 1;
}

.dock-tab[aria-selected="true"] svg {
  fill: var(--tab-blue);
  filter: drop-shadow(0 1.5px 4px rgba(0, 122, 255, .45));
}

.dock-tab[aria-selected="true"] .tab-name {
  color: var(--tab-blue);
  font-weight: 600;
  animation: label-pop .42s var(--spring);
}

@keyframes label-pop {
  0% { opacity: .4; transform: translateY(2px); }
  100% { opacity: 1; transform: none; }
}

/* 选中底：淡蓝圆角块（参考图那种，不是渐变光晕） */
.dock-indicator {
  top: 6px;
  bottom: 6px;
  border-radius: 18px;
  border: 1px solid rgba(0, 122, 255, .16);
  background: rgba(0, 122, 255, .13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 8px 18px -14px rgba(0, 122, 255, .85);
}

[data-theme="dark"] .dock-indicator {
  background: rgba(10, 132, 255, .22);
  border-color: rgba(10, 132, 255, .28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 8px 18px -14px rgba(0, 0, 0, .9);
}

/* 点击的手感：按下缩一点，松开回弹 */
.dock-tab { transition: transform .3s var(--spring), color .26s var(--ease); }
.dock-tab:active { transform: scale(.93); }
.dock-tab[aria-selected="true"]:active { transform: scale(.96); }

/* v16.1：选中底改成贴合 tab 的胶囊，去掉方角 */
.dock-indicator {
  top: 7px;
  bottom: 7px;
  border-radius: 999px;
  border: 0;
  background: rgba(0, 122, 255, .11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 10px 22px -16px rgba(0, 122, 255, .9);
}

[data-theme="dark"] .dock-indicator {
  background: rgba(10, 132, 255, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    0 10px 22px -16px rgba(0, 0, 0, .95);
}

/* ==========================================================================
   v17：精选右边那三个图标也走蓝色（未选中 55%，选中 100%）
   ========================================================================== */
.dock-tab svg {
  fill: var(--tab-blue);
  opacity: .55;
  filter: drop-shadow(0 1px 2px rgba(0, 122, 255, .18));
  transition: opacity .28s var(--ease), fill .28s var(--ease), filter .28s var(--ease);
}

.dock-tab[aria-selected="true"] svg {
  fill: var(--tab-blue);
  opacity: 1;
  filter: drop-shadow(0 2px 5px rgba(0, 122, 255, .45));
}

/* 文字：未选中深灰，选中蓝 */
.tab-name { color: rgba(11, 13, 18, .78); }
[data-theme="dark"] .tab-name { color: rgba(241, 243, 250, .78); }

.dock-tab[aria-selected="true"] .tab-name {
  color: var(--tab-blue);
  opacity: 1;
}

/* 搜索圆钮里的放大镜也跟着蓝 */
.search-fab svg { fill: var(--tab-blue); opacity: .85; }

/* v17.1：选中底回到柔和光斑，不再是一块实心圆 */
.dock-indicator {
  border-radius: 999px;
  border: 0;
  background: radial-gradient(62% 72% at 50% 46%,
    rgba(0, 122, 255, .22) 0%,
    rgba(0, 122, 255, .08) 58%,
    rgba(0, 122, 255, 0) 82%);
  box-shadow: none;
}

[data-theme="dark"] .dock-indicator {
  background: radial-gradient(62% 72% at 50% 46%,
    rgba(10, 132, 255, .30) 0%,
    rgba(10, 132, 255, .12) 58%,
    rgba(10, 132, 255, 0) 82%);
}

/* ==========================================================================
   v18：右上角「不限/国内/国外」统一成底栏那套（玻璃 + 蓝 + spring 滑动）
   ========================================================================== */
.region {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-dock);
  border: 1px solid rgba(255, 255, 255, .48);
  backdrop-filter: blur(44px) saturate(210%) brightness(1.05);
  -webkit-backdrop-filter: blur(44px) saturate(210%) brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -1px 0 rgba(255, 255, 255, .14),
    0 10px 24px -18px rgba(20, 20, 50, .38);
}

[data-theme="dark"] .region {
  border-color: rgba(255, 255, 255, .10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 10px 24px -18px rgba(0, 0, 0, .9);
}

.region button {
  position: relative;
  z-index: 2;
  padding: 6px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tab-black, #0b0d12);
  opacity: .72;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .26s var(--ease), opacity .26s var(--ease), transform .3s var(--spring);
}

.region button:active { transform: scale(.94); }

.region button[aria-selected="true"] {
  color: var(--ios-blue);
  opacity: 1;
  background: none;
  box-shadow: none;
}

/* 滑动的淡蓝底：和底栏选中态同一套语言 */
.region-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 1;
  width: 0;
  border-radius: 999px;
  background: rgba(0, 122, 255, .13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    0 8px 18px -14px rgba(0, 122, 255, .85);
  transition: transform .44s var(--spring), width .44s var(--spring), opacity .2s var(--ease);
}

[data-theme="dark"] .region-pill {
  background: rgba(10, 132, 255, .22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .10),
    0 8px 18px -14px rgba(0, 0, 0, .9);
}

/* ==========================================================================
   v19：底栏整体缩小一档，图标按同比例跟着缩（保持约 43%）
   桌面：86 → 76，图标 36 → 32
   手机：80 → 70，图标 34 → 30
   ========================================================================== */
:root { --dock-h: 76px; }

.dock { padding: 0 14px; }
.dock-tab { height: calc(var(--dock-h) - 12px); padding: 0 10px; gap: 3px; }
.tab-icon { height: 32px; }
.dock-tab svg { width: 32px; height: 32px; }
.tab-name { font-size: 11px; }
.search-fab { width: var(--dock-h); height: var(--dock-h); }
.search-fab svg { width: 32px; height: 32px; }
.dock-indicator { top: 6px; bottom: 6px; }

@media (max-width: 719px) {
  :root { --dock-h: 70px; }

  .dock { padding: 0 6px; }
  .dock-tab { height: calc(var(--dock-h) - 10px); padding: 0 3px; gap: 2px; }
  .tab-icon { height: 30px; }
  .dock-tab svg { width: 30px; height: 30px; }
  .tab-name { font-size: 10px; }
  .search-fab { width: var(--dock-h); height: var(--dock-h); }
  .search-fab svg { width: 30px; height: 30px; }
  .dock-indicator { top: 5px; bottom: 5px; }
  body { padding-bottom: 118px; }
}

/* ==========================================================================
   v20：底栏与「不限」区的字体改回纯黑（去掉之前的 78%/72% 灰）
   选中项仍然是蓝字，用来表示"当前在这一页"
   ========================================================================== */
.tab-name {
  color: #0b0d12;
  opacity: 1;
  font-weight: 500;
}

[data-theme="dark"] .tab-name { color: #f1f3fa; }

.dock-tab[aria-selected="true"] .tab-name {
  color: var(--ios-blue);
  font-weight: 600;
}

.region button {
  color: #0b0d12;
  opacity: 1;
  font-weight: 500;
}

[data-theme="dark"] .region button { color: #f1f3fa; }

.region button[aria-selected="true"] {
  color: var(--ios-blue);
  font-weight: 600;
}

/* v20.1：连选中项的字体也一起改回黑色（选中只靠图标和淡蓝底表达） */
.dock-tab[aria-selected="true"] .tab-name {
  color: #0b0d12;
  font-weight: 600;
}

[data-theme="dark"] .dock-tab[aria-selected="true"] .tab-name { color: #f1f3fa; }

.region button[aria-selected="true"] {
  color: #0b0d12;
  font-weight: 600;
}

[data-theme="dark"] .region button[aria-selected="true"] { color: #f1f3fa; }

/* ==========================================================================
   v21：连点残影修复
   - 去掉常驻 will-change（避免合成层不重绘留下残影）
   - 指示块改用 transform + width，但不再预提升图层
   ========================================================================== */
.dock-indicator {
  will-change: auto;
  contain: layout style;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* 连点时只让"新选中"的图标弹一下，不重复触发 */
.dock-tab svg { animation: none; }

/* 只有"刚切过去"的那个 tab 弹一次 */
.dock-tab.fresh svg,
.dock-tab.fresh .tab-name { animation: tab-pop .5s var(--spring); }

/* ==========================================================================
   v22：底栏图标改回黑色（未选中黑，选中蓝）
   ========================================================================== */
.dock-tab svg {
  fill: #0b0d12;
  opacity: 1;
  filter: drop-shadow(0 1px 1.5px rgba(10, 12, 24, .16));
}

[data-theme="dark"] .dock-tab svg {
  fill: #f1f3fa;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}

.dock-tab[aria-selected="true"] svg {
  fill: var(--ios-blue);
  opacity: 1;
  filter: drop-shadow(0 2px 5px rgba(0, 122, 255, .42));
}

[data-theme="dark"] .dock-tab[aria-selected="true"] svg {
  fill: #0a84ff;
}

/* 搜索圆钮里的放大镜也回到黑色 */
.search-fab svg {
  fill: #0b0d12;
  opacity: 1;
}

[data-theme="dark"] .search-fab svg { fill: #f1f3fa; }

/* ==========================================================================
   v23：底栏图标换成 SF Symbols 比例 + 圆角描边（iOS 那种圆润端点）
   ========================================================================== */
.dock-tab svg,
.search-fab svg {
  stroke-width: 1;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
}

.dock-tab svg {
  --icon: #0b0d12;
  fill: var(--icon);
  stroke: var(--icon);
}

[data-theme="dark"] .dock-tab svg { --icon: #f1f3fa; }

.dock-tab[aria-selected="true"] svg {
  --icon: var(--ios-blue);
  fill: var(--icon);
  stroke: var(--icon);
}

[data-theme="dark"] .dock-tab[aria-selected="true"] svg { --icon: #0a84ff; }

.search-fab svg {
  --icon: #0b0d12;
  fill: var(--icon);
  stroke: var(--icon);
}

[data-theme="dark"] .search-fab svg { --icon: #f1f3fa; }

/* ==========================================================================
   v24：导航系统（9 种形态，由后台设置切换）
   ========================================================================== */

/* 非 dock 形态下隐藏底栏 */
body[data-nav="sticky"] .dock-bar,
body[data-nav="side"] .dock-bar,
body[data-nav="hamburger"] .dock-bar,
body[data-nav="overlay"] .dock-bar { display: none; }

#nav-root { position: relative; z-index: 40; }

/* ---------- 1. 悬浮吸顶卡片 ---------- */
.nav-sticky {
  position: sticky;
  top: 10px;
  z-index: 45;
  width: min(760px, calc(100vw - 24px));
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow:
    0 2px 10px rgba(20, 20, 50, .06),
    0 22px 44px -26px rgba(20, 20, 50, .42),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  transition: top .3s var(--ease), padding .3s var(--ease), background .3s var(--ease),
              border-radius .3s var(--ease), transform .35s var(--spring);
}

[data-theme="dark"] .nav-sticky {
  background: rgba(26, 30, 44, .66);
  border-color: rgba(255, 255, 255, .12);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, .5),
    0 22px 44px -26px rgba(0, 0, 0, .95),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}

body.scrolled .nav-sticky { top: 0; border-radius: 0 0 22px 22px; }

/* 滚动收缩：变矮 + 实色 */
body.can-shrink.scrolled .nav-sticky {
  background: rgba(255, 255, 255, .9);
  padding-top: 4px;
  padding-bottom: 4px;
  transform: scale(.985);
}

[data-theme="dark"] body.can-shrink.scrolled .nav-sticky { background: rgba(24, 28, 42, .92); }

.nav-sticky-brand {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink, #0b0d12);
  text-decoration: none;
  white-space: nowrap;
}

.nav-sticky-items { display: flex; gap: 2px; flex: 1; justify-content: center; }

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tab-black, #0b0d12);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .24s var(--ease), color .24s var(--ease), transform .26s var(--spring);
  white-space: nowrap;
}

.nav-item:hover { background: rgba(0, 122, 255, .08); }
.nav-item:active { transform: scale(.95); }

.nav-item[aria-selected="true"] {
  background: rgba(0, 122, 255, .13);
  color: var(--ios-blue);
  font-weight: 600;
}

.nav-item-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; }
.nav-item-icon svg { width: 18px; height: 18px; fill: currentColor; }

.nav-search-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(0, 122, 255, .10);
  color: var(--ios-blue);
  cursor: pointer;
  flex: none;
  transition: transform .26s var(--spring), background .2s;
}

.nav-search-btn:active { transform: scale(.92); }
.nav-search-btn svg { width: 18px; height: 18px; }

/* ---------- 2. 侧边栏（可折叠） ---------- */
body[data-nav="side"] { padding-left: 236px; }
body[data-nav="side"][data-side="collapsed"] { padding-left: 88px; }
body[data-nav="side"] .topbar { padding-left: 236px; }
body[data-nav="side"][data-side="collapsed"] .topbar { padding-left: 88px; }

.nav-side {
  position: fixed;
  left: 10px;
  top: 10px;
  bottom: 10px;
  z-index: 46;
  width: 216px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 24px 50px -34px rgba(20, 20, 50, .5), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  transition: width .34s var(--spring), padding .34s var(--ease);
  overflow: hidden;
}

[data-theme="dark"] .nav-side {
  background: rgba(26, 30, 44, .62);
  border-color: rgba(255, 255, 255, .12);
}

.nav-side[data-collapsed="true"] { width: 68px; padding: 14px 8px; }

.nav-side-toggle {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(0, 122, 255, .2);
  background: rgba(255, 255, 255, .8);
  color: var(--ios-blue);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}

.nav-side-items { display: grid; gap: 4px; margin-top: 26px; }

.nav-item--row {
  height: 44px;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 12px;
  width: 100%;
  border-radius: 14px;
}

.nav-side[data-collapsed="true"] .nav-item--row {
  justify-content: center;
  padding: 0;
}

.nav-side[data-collapsed="true"] .nav-item-label { display: none; }
.nav-side[data-collapsed="true"] .nav-item-icon svg { width: 22px; height: 22px; }

/* ---------- 6. 汉堡菜单 / 7. 全屏遮罩 ---------- */
.nav-hamb {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .52);
  border-bottom: 1px solid rgba(255, 255, 255, .6);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  transition: background .3s var(--ease), padding .3s var(--ease);
}

[data-theme="dark"] .nav-hamb {
  background: rgba(24, 28, 42, .6);
  border-color: rgba(255, 255, 255, .08);
}

body.can-shrink.scrolled .nav-hamb {
  background: rgba(255, 255, 255, .92);
  padding-top: 6px;
  padding-bottom: 6px;
}

[data-theme="dark"] body.can-shrink.scrolled .nav-hamb { background: rgba(22, 26, 38, .94); }

.nav-hamb-title { font-weight: 700; font-size: 15px; flex: 1; }

.nav-hamb-btn {
  width: 40px; height: 40px;
  display: grid; place-content: center; gap: 4px;
  border: 0; border-radius: 12px;
  background: rgba(0, 122, 255, .10);
  cursor: pointer;
}

.nav-hamb-btn span {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--ios-blue);
  transition: transform .3s var(--spring), opacity .2s;
}

body.nav-drawer-open .nav-hamb-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-drawer-open .nav-hamb-btn span:nth-child(2) { opacity: 0; }
body.nav-drawer-open .nav-hamb-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 47;
  background: rgba(12, 18, 32, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
  backdrop-filter: blur(2px);
}

body.nav-drawer-open .nav-scrim { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 48;
  width: min(300px, 84vw);
  padding: 20px 14px;
  background: rgba(255, 255, 255, .86);
  border-right: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 20px 0 60px -40px rgba(20, 20, 50, .6);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  transform: translateX(-102%);
  transition: transform .38s var(--spring);
  display: grid;
  align-content: start;
  gap: 8px;
}

[data-theme="dark"] .nav-drawer {
  background: rgba(24, 28, 42, .92);
  border-color: rgba(255, 255, 255, .08);
}

body.nav-drawer-open .nav-drawer { transform: none; }

.nav-drawer-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px 10px;
}

.nav-drawer-items { display: grid; gap: 4px; }

/* 全屏遮罩导航 */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  gap: 10px;
  background: rgba(246, 249, 255, .92);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity .32s var(--ease), transform .42s var(--spring);
}

[data-theme="dark"] .nav-overlay { background: rgba(16, 20, 30, .94); }

body.nav-overlay-open .nav-overlay { opacity: 1; pointer-events: auto; transform: none; }

.nav-overlay-items {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.nav-overlay .nav-item--row {
  width: auto;
  min-width: 220px;
  justify-content: center;
  font-size: 20px;
  height: 54px;
}

.nav-overlay-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 122, 255, .2);
  background: rgba(255, 255, 255, .8);
  color: var(--ios-blue);
  font-size: 24px;
  cursor: pointer;
}

.nav-overlay-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 122, 255, .25);
  background: rgba(0, 122, 255, .1);
  color: var(--ios-blue);
  font-weight: 600;
  cursor: pointer;
}

/* ---------- 3. 面包屑 ---------- */
.breadcrumb {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 0;
  font-size: 12.5px;
  color: var(--muted);
}

body[data-breadcrumb="on"] .breadcrumb { display: flex; }

.crumb--home { color: var(--ios-blue); font-weight: 600; }
.crumb--current { color: var(--ink, #0b0d12); font-weight: 600; }
.crumb-sep { opacity: .45; }

/* ---------- 4. 二级下拉 ---------- */
.nav-dropdown {
  position: fixed;
  z-index: 55;
  min-width: 150px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 20px 40px -24px rgba(20, 20, 50, .5);
  backdrop-filter: blur(20px);
  display: none;
  grid-auto-rows: min-content;
  gap: 2px;
}

body[data-dropdown="on"] .nav-sticky:hover + .nav-dropdown:not(:empty) { display: grid; }

.dd-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--tab-black, #0b0d12);
}

.dd-item:hover { background: rgba(0, 122, 255, .10); color: var(--ios-blue); }
.dd-empty { color: var(--muted); font-size: 12px; padding: 8px 10px; }

/* ---------- 8. 锚点导航 ---------- */
.anchor-rail {
  position: sticky;
  top: 78px;
  z-index: 20;
  display: none;
  gap: 6px;
  padding: 8px 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-anchors="on"] .anchor-rail { display: flex; }
.anchor-rail::-webkit-scrollbar { display: none; }

.anchor-item {
  border: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .66);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s;
}

.anchor-item[aria-selected="true"] { background: rgba(0, 122, 255, .13); color: var(--ios-blue); }

.section-title {
  margin: 18px 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
}

/* 侧边栏形态在窄屏回落到抽屉 */
@media (max-width: 719px) {
  body[data-nav="side"] { padding-left: 0; }
  body[data-nav="side"] .topbar { padding-left: 16px; }
  body[data-nav="side"] .nav-side { display: none; }
  .nav-sticky { width: calc(100vw - 16px); padding-left: 12px; }
  .nav-sticky-brand { display: none; }
  .nav-sticky-items { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .nav-item { padding: 0 10px; }
  .nav-item-icon { display: none; }
}

/* 非 dock 形态：原顶栏隐藏，品牌与主题按钮并入新导航 */
body[data-nav="sticky"] .topbar,
body[data-nav="side"] .topbar,
body[data-nav="hamburger"] .topbar,
body[data-nav="overlay"] .topbar { display: none; }

body[data-nav="sticky"] .icon-btn,
body[data-nav="hamburger"] .icon-btn,
body[data-nav="overlay"] .icon-btn { width: 38px; height: 38px; flex: none; }

body[data-nav="side"] .nav-side .icon-btn { margin-top: auto; align-self: center; }

/* 吸顶条里给搜索/主题按钮留位 */
.nav-sticky > .icon-btn,
.nav-hamb > .icon-btn { margin-left: 4px; }

/* 全屏遮罩：菜单项等宽居中 */
.nav-overlay .nav-item--row {
  width: 280px;
  justify-content: center;
  gap: 10px;
}

.nav-overlay .nav-item-icon svg { width: 22px; height: 22px; }