/* ============================================================
   Private Web Hub — 应用中心门户样式
   主题：蓝 · 简洁 · 不浮夸（与 ZHUYE 一脉相承）
   ============================================================ */

/* 强制 hidden 属性生效：类选择器的 display 不得覆盖隐藏状态 */
[hidden] { display: none !important; }

/* ---------- 主题变量 ---------- */
:root {
  --bg:        var(--bg-day, #f5f1e6);  /* 奶油白底（默认日间；后台自定义色经 --bg-day 注入） */
  --ink:       #0a0a0a;             /* 主文字（近黑） */
  --muted:     #6b675e;             /* 次要文字（暖灰） */
  --accent:    #ff6b00;             /* 主题橙 */
  --accent-2:  #e05e00;             /* 深橙 */
  --hairline:  rgba(255, 107, 0, .30);
  --line:      rgba(10, 10, 10, .12);
  --accent-soft: rgba(255, 107, 0, .07);
  --accent-ring: rgba(255, 107, 0, .12);
  --accent-line: rgba(255, 107, 0, .38);
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --fast:      160ms;
  --slow:      460ms;
  /* 表面/部件色（默认日间奶油配色，卡片/输入框与底色拉开层次） */
  --card-bg:   rgba(255, 255, 255, .78);
  --card-hover: #fff;
  --input-bg:  rgba(255, 255, 255, .85);
  --glow:      radial-gradient(110% 85% at 24% -8%, rgba(255, 107, 0, .08) 0%, transparent 55%);
  --vignette:  rgba(200, 190, 165, .30);
  --scrollbar: rgba(10, 10, 10, .22);
  --kbd-line:  rgba(10, 10, 10, .22);
  /* 分控件独立颜色（后台可单独覆盖；默认全部跟随 --accent） */
  --c-title:   var(--accent);
  --c-card:    var(--accent);
  --c-filter:  var(--accent);
  --c-search:  var(--accent);
  --c-footer:  var(--muted);
  --c-btn:     #ffffff;
  /* 字体变量（后台可逐区覆盖，见 js/theme.js）
     默认 = Hermes Agent 官网字体：Sigurd 衬线展示体（标题）+ Rules 无衬线（正文） */
  --font-base: "RulesVariable", "Segoe UI", "Microsoft YaHei", "PingFang SC",
               "Hiragino Sans GB", system-ui, sans-serif;
  --font-title: "Sigurd_Variable", "RulesVariable", Georgia, serif;
  --font-brand: var(--font-base);
  --font-card:  var(--font-base);
  --font-footer: var(--font-base);
  --fs-title: clamp(40px, 7vw, 84px);
  --fs-brand: 13px;
  --fs-card: 17px;
  --fs-footer: 12px;
  --fw-title: 800;
  --fw-card: 600;
  --ls-title: .04em;
  --ls-card: .05em;
}

/* ---------- 夜间模式（原黑色主题，html[data-mode="night"]） ---------- */
html[data-mode="night"] {
  --bg:        #05080f;
  --card-hover: rgba(233, 238, 251, .08);
  --ink:       #e9eefb;
  --muted:     #8ea0c6;
  --accent-2:  #c95a00;
  --hairline:  rgba(255, 140, 60, .30);
  --line:      rgba(147, 163, 196, .14);
  --accent-soft: rgba(255, 140, 60, .07);
  --accent-ring: rgba(255, 140, 60, .12);
  --accent-line: rgba(255, 140, 60, .38);
  --card-bg:   rgba(10, 16, 30, .42);
  --input-bg:  rgba(8, 13, 24, .35);
  --glow:      radial-gradient(110% 85% at 24% -8%, rgba(255, 140, 60, .10) 0%, transparent 55%);
  --vignette:  rgba(2, 4, 9, .55);
  --scrollbar: rgba(147, 163, 196, .25);
  --kbd-line:  rgba(147, 163, 196, .3);
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-base);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 日/夜切换：圆形扩散（View Transitions） ---------- */
/* 新主题快照以圆形 clip-path 从开关处展开（JS 驱动）；这里禁用默认交叉淡出 */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
/* 旧快照在下层完整保留，新快照圆形覆盖其上 */
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
/* 扩散期间页面自身隐藏滚动条跳动 */
html:active {}

/* ---------- 日/夜切换过渡（不支持 View Transitions 的回落） ---------- */
/* html.theme-anim 由切换 JS 短暂添加 ~600ms，让全站颜色平滑过渡 */
html.theme-anim, html.theme-anim body,
html.theme-anim .bg, html.theme-anim .vignette, html.theme-anim .bg .bg-image,
html.theme-anim .app-card, html.theme-anim .search input,
html.theme-anim .tag, html.theme-anim .footer .keys kbd {
  transition:
    background-color 520ms var(--ease),
    background 520ms var(--ease),
    color 520ms var(--ease),
    border-color 520ms var(--ease),
    box-shadow 520ms var(--ease) !important;
}

/* ---------- 背景层：近黑深蓝 + 顶部极淡蓝光晕（缓慢呼吸） ---------- */
.bg {
  position: fixed; inset: 0;
  background: var(--bg);
}
.bg::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--glow);
  animation: glow 9s ease-in-out infinite alternate;
}
@keyframes glow { from { opacity: .65; } to { opacity: 1; } }
/* 自定义背景图（后台设置后由 theme.js 注入）：cover 铺满 + 压暗保可读 */
.bg-image {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .38;
  filter: saturate(.9);
  animation: bgFade 640ms var(--ease) both;
}
html[data-mode="day"] .bg-image { opacity: .30; }
@keyframes bgFade { from { opacity: 0; } to { opacity: .38; } }
/* 极轻暗角 */
.vignette {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(130% 130% at 50% 45%, transparent 55%, var(--vignette) 100%);
}

/* ---------- 页面骨架 ---------- */
.stage {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; flex-direction: column;
  padding: clamp(22px, 5vh, 54px) clamp(24px, 8vw, 120px);
}

/* 顶部条 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 30;
  background: transparent;
  transition: background var(--slow) var(--ease), box-shadow var(--slow) var(--ease),
              padding var(--slow) var(--ease);
}
/* 下滑后顶栏常驻：带底色投影，不遮内容可读性 */
body.is-compact .topbar {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line);
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.brand {
  font-family: var(--font-brand);
  font-size: var(--fs-brand); font-weight: 800; letter-spacing: .28em; text-transform: uppercase;
  color: var(--ink);
}
.brand b { color: var(--accent); font-weight: 800; }
.clock {
  font-size: 12px; letter-spacing: .22em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 日/夜切换按钮 ---------- */
.mode-toggle {
  appearance: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--input-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
              background var(--fast) var(--ease), transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.mode-toggle:hover {
  border-color: var(--hairline); color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.mode-toggle:active { transform: scale(.92); }
.mode-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-toggle .mode-icon {
  font-size: 15px; line-height: 1;
  display: inline-block;
  transition: transform 520ms var(--ease);
}
/* 切换瞬间：图标旋转翻面 */
.mode-toggle.is-flip .mode-icon { transform: rotate(360deg) scale(.6); }
/* 日间下按钮微调 */
html[data-mode="day"] .mode-toggle { background: rgba(255, 255, 255, .85); }

/* 中部主区：左对齐编辑式排版 */
.hero { margin-top: clamp(30px, 7vh, 72px); max-width: 46rem; }
.overline {
  display: flex; align-items: center; gap: 14px;
  color: var(--muted); font-size: 12px; letter-spacing: .34em; text-transform: uppercase;
  margin: 0;
}
.overline::before { content: ""; width: 44px; height: 1px; background: var(--accent); }
.title {
  margin: 18px 0 10px;
  font-family: var(--font-title);
  font-size: var(--fs-title);
  line-height: .98; font-weight: var(--fw-title, 800); letter-spacing: var(--ls-title, .04em);
}
.title .accent { color: var(--c-title); }
/* 标题逐字入场（JS 拆分为 .char） */
.title .char {
  display: inline-block;
  animation: charIn 560ms var(--ease) both;
  animation-delay: calc(.1s + var(--ci, 0) * 34ms);
}
@keyframes charIn {
  from { opacity: 0; transform: translateY(.32em); }
  to   { opacity: 1; transform: none; }
}
.subtitle {
  margin: 0 0 36px; color: var(--muted);
  font-size: clamp(13px, 1.4vw, 15px); letter-spacing: .12em;
}

/* ---------- 分类筛选 + 搜索 ---------- */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.filters { display: flex; align-items: center; gap: 26px; }
.filter {
  position: relative;
  appearance: none; background: none; border: 0;
  padding: 6px 0 9px; cursor: pointer;
  font-family: inherit; font-size: 13px; letter-spacing: .16em;
  color: var(--muted);
  display: inline-flex; align-items: baseline; gap: 9px;
  transition: color var(--fast) var(--ease);
}
/* 下划线：hover 半条提示，激活时从左生长 */
.filter::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--c-filter);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--slow) var(--ease);
}
.filter .f-idx { font-size: 10px; opacity: .65; font-variant-numeric: tabular-nums; }
.filter:hover { color: var(--ink); }
.filter:hover::after { transform: scaleX(.35); }
.filter.is-active { color: var(--ink); }
.filter.is-active::after { transform: scaleX(1); }
.filter.is-active .f-idx { color: var(--c-filter); opacity: 1; }
.filter:focus-visible { outline: 2px solid var(--c-filter); outline-offset: 3px; border-radius: 2px; }

.search input {
  font-family: inherit; font-size: 13px; letter-spacing: .1em;
  color: var(--ink); caret-color: var(--c-search);
  background: var(--input-bg);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; width: clamp(150px, 20vw, 240px);
  outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.search input::placeholder { color: var(--muted); opacity: .75; }
.search input:focus { border-color: var(--c-search-hairline, var(--hairline)); box-shadow: 0 0 0 3px var(--c-search-ring, var(--accent-ring)); }

/* ---------- 应用网格 ---------- */
.apps {
  flex: 1; min-height: 0;
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
  align-content: start;
  overflow-y: auto;
  padding: 4px 4px 18px 2px;         /* 顶部留白给 hover 上浮 */
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
.apps::-webkit-scrollbar { width: 6px; }
.apps::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }

.app-card {
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
  padding: 18px 18px 15px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(10, 10, 10, .04);
  text-decoration: none; color: var(--ink);
  animation: rise var(--slow) var(--ease) both;
  animation-delay: calc(var(--i) * 42ms);
  transition: transform var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
/* 底部强调线：hover 时从卡片底部中间向两边延伸 */
.app-card::before {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: var(--c-card);
  transform: scaleX(0); transform-origin: center;
  transition: transform var(--slow) var(--ease);
}
.app-card:hover, .app-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--c-card-hairline, var(--hairline));
  background: var(--card-hover);
  box-shadow: 0 8px 24px rgba(10, 10, 10, .09);
  outline: none;
}
html[data-mode="night"] .app-card:hover,
html[data-mode="night"] .app-card:focus-visible {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.app-card:hover::before, .app-card:focus-visible::before { transform: scaleX(1); }
.app-card:hover .card-title, .app-card:focus-visible .card-title { color: var(--c-card); }
.app-card:hover .card-go, .app-card:focus-visible .card-go { opacity: 1; transform: translateX(0); }

.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-no {
  font-size: 11px; letter-spacing: .18em; color: var(--muted);
  font-variant-numeric: tabular-nums;
  transition: color var(--fast) var(--ease);
}
.tag {
  font-size: 10px; letter-spacing: .22em;
  color: var(--muted); opacity: .85;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.app-card:hover .card-no, .app-card:focus-visible .card-no { color: var(--accent); }
.app-card:hover .tag, .app-card:focus-visible .tag {
  color: var(--ink); border-color: var(--accent-line);
}
.card-title {
  font-family: var(--font-card);
  font-size: var(--fs-card); font-weight: var(--fw-card, 600); letter-spacing: var(--ls-card, .05em);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  transition: color var(--fast) var(--ease);
}
.card-en {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
/* 外部链接标记：标题旁的小 ↗ */
.ext-mark {
  font-size: 10px; line-height: 1; font-style: normal;
  color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: 999px;
  padding: 2px 5px; transform: translateY(-2px);
  letter-spacing: 0;
}
.card-desc {
  margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-go {
  margin-top: 4px; font-size: 11px; letter-spacing: .2em; color: var(--c-card);
  opacity: 0; transform: translateX(-6px);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.card-go i { font-style: normal; }

/* ---------- 空状态 ---------- */
.empty {
  margin: 40px 0; text-align: center; color: var(--muted);
  font-size: 13px; letter-spacing: .18em;
  animation: rise var(--slow) var(--ease) both;
}

/* ---------- 底部 ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-footer);
  color: var(--muted); font-size: var(--fs-footer); letter-spacing: .18em;
  padding-top: 16px;
}
.footer .keys kbd {
  font-family: inherit; border: 1px solid var(--kbd-line);
  border-radius: 4px; padding: 1px 6px; font-size: 11px; color: var(--ink);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.footer .keys kbd:hover {
  color: var(--accent); border-color: var(--hairline);
  background: var(--accent-ring); transform: translateY(-1px);
}
.footer .note { opacity: .8; }

/* ---------- 入场（克制） ---------- */
.topbar { animation: rise var(--slow) var(--ease) both; }
.hero   { animation: rise var(--slow) var(--ease) .06s both; }
.footer { animation: rise var(--slow) var(--ease) .16s both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 页面切换过渡 ---------- */
/* 退场：点击卡片 → 整页淡出下沉后跳转（与入场 rise 互为镜像） */
body.is-leaving .stage {
  animation: leave 280ms var(--ease) both;
}
@keyframes leave {
  to { opacity: 0; transform: translateY(10px); }
}
/* 被点中的卡片：轻微按下（置于 hover 规则之后，优先级更高） */
.app-card.is-picked {
  transform: translateY(-3px) scale(.97);
  border-color: var(--accent);
  background: var(--accent-ring);
}
/* 分类切换：方向转场（前进 → 旧卡左出 / 新卡右入；后退 → 反向） */
.app-card.exit-left  { animation: exitLeft 120ms var(--ease) both; }
.app-card.exit-right { animation: exitRight 120ms var(--ease) both; }
.app-card.enter-from-right {
  animation: enterFromRight 240ms var(--ease) both;
  animation-delay: calc(var(--i) * 26ms);
}
.app-card.enter-from-left {
  animation: enterFromLeft 240ms var(--ease) both;
  animation-delay: calc(var(--i) * 26ms);
}
@keyframes exitLeft  { to { opacity: 0; transform: translateX(-24px); } }
@keyframes exitRight { to { opacity: 0; transform: translateX(24px); } }
@keyframes enterFromRight { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enterFromLeft  { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
/* 入场动画播完即清除 fill，恢复 hover 位移（JS 负责加 .anim-done） */
.app-card.anim-done { animation: none; }
/* 返回本页（浏览器后退 / bfcache）时重放入场 */
body.re-enter .topbar { animation: rise var(--slow) var(--ease) both; }
body.re-enter .hero   { animation: rise var(--slow) var(--ease) .06s both; }
body.re-enter .footer { animation: rise var(--slow) var(--ease) .16s both; }
body.re-enter .title .char {
  animation: charIn 560ms var(--ease) both;
  animation-delay: calc(.1s + var(--ci, 0) * 34ms);
}
body.re-enter .app-card {
  animation: rise var(--slow) var(--ease) both;
  animation-delay: calc(var(--i) * 42ms);
}

/* ---------- 响应式（手机适配） ---------- */
@media (max-width: 640px) {
  .stage {
    height: auto; min-height: 100dvh;
    padding: 18px 18px 14px;
    /* 手机上页面整体滚动，内部 .apps 不再独立滚动 */
  }
  .topbar { flex-wrap: wrap; gap: 6px; }
  .clock { font-size: 11px; letter-spacing: .14em; }
  .hero { margin-top: 22px; }
  .title { font-size: clamp(34px, 11vw, 52px); }
  .overline { font-size: 11px; letter-spacing: .26em; gap: 10px; }
  .overline::before { width: 28px; }
  .subtitle { margin-bottom: 22px; font-size: 13px; letter-spacing: .06em; }
  .filter-bar {
    flex-direction: column; align-items: stretch; gap: 12px;
    /* 筛选横向可滑动，不换行挤压 */
  }
  .filters {
    display: flex; gap: 0; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: 0 0 auto; padding: 8px 14px 10px; font-size: 13px; letter-spacing: .1em; }
  .filter .f-idx { display: none; }
  .search input { width: 100%; padding: 10px 16px; font-size: 16px; } /* ≥16px 防 iOS 聚焦自动放大 */
  .apps {
    overflow-y: visible; flex: none;
    margin-top: 20px;
    grid-template-columns: 1fr;   /* 手机单列卡片 */
    gap: 10px;
    padding: 2px 0 12px;
  }
  .app-card { padding: 15px 16px 13px; }
  .app-card:hover { transform: none; }  /* 触屏无 hover 态，避免粘滞 */
  .card-en { display: none; }
  .card-desc { font-size: 12.5px; -webkit-line-clamp: 3; }
  .card-go { opacity: 1; transform: none; }  /* 触屏常显"进入 →" */
  .footer { padding-top: 14px; }
  .footer .keys { display: none; }  /* 手机无键盘操作，隐藏键位提示 */
  .footer .note { display: block; font-size: 11px; letter-spacing: .08em; }
}
/* 极窄屏（≤380px）再收一档 */
@media (max-width: 380px) {
  .stage { padding: 14px 14px 12px; }
  .title { font-size: 30px; }
}

/* ============================================================
   音乐播放器（顶栏 ♪ 按钮 + 弹出面板）
   ============================================================ */

/* 顶栏 ♪ 按钮：与日/夜按钮同尺寸；播放中轻微呼吸 */
.mp-open-btn .mode-icon { font-size: 14px; }
.mp-open-btn.mp-btn-playing .mode-icon { animation: mpPulse 1.6s ease-in-out infinite; }
@keyframes mpPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .75; } }
.mp-open-btn.is-on { border-color: var(--hairline); color: var(--accent); }

/* ---------- 弹出面板 ---------- */
.mp-popover {
  position: fixed;
  top: 64px; right: clamp(16px, 6vw, 90px);
  z-index: 40;
  width: min(360px, calc(100vw - 24px));
  background: var(--input-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(10, 10, 10, .18);
  animation: mpPopIn 280ms var(--ease) both;
}
@keyframes mpPopIn {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.mp-pop-inner { display: flex; flex-direction: column; padding: 16px 16px 12px; }

/* 头部：唱片 + 曲名 + 进度 */
.mp-pop-head { display: flex; gap: 14px; align-items: center; }
.mp-pop-disc {
  position: relative; flex: 0 0 auto;
  width: 56px; height: 56px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--accent) 0 28%, transparent 29%),
    repeating-radial-gradient(circle at 50% 50%, var(--line) 0 1px, transparent 1px 4px),
    var(--card-bg);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 15px;
  animation: discSpin 12s linear infinite;
  animation-play-state: paused;
}
.mp-popover.mp-playing .mp-pop-disc { animation-play-state: running; }
@keyframes discSpin { to { transform: rotate(360deg); } }
.mp-pop-info { flex: 1; min-width: 0; }
.mp-pop-name {
  font-size: 14px; font-weight: 600; letter-spacing: .03em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-pop-time {
  margin-top: 3px; font-size: 11px; letter-spacing: .08em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mp-pop-progress {
  position: relative; height: 16px; margin-top: 6px;
  display: flex; align-items: center; cursor: pointer; touch-action: none;
}
.mp-pop-progress::before {
  content: ""; position: absolute; left: 0; right: 0; height: 3px;
  background: var(--line); border-radius: 2px;
}
.mp-progress-fill {
  position: absolute; left: 0; height: 3px; width: 0;
  background: var(--accent); border-radius: 2px;
  transition: width 200ms linear;
}
.mp-pop-progress:hover .mp-progress-fill { height: 5px; }
.mp-pop-progress:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* 控制按钮行 */
.mp-pop-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.mp-btn {
  appearance: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card-bg); border: 1px solid var(--line); color: var(--ink);
  font-size: 12px; line-height: 1;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.mp-btn:hover { color: var(--accent); border-color: var(--hairline); transform: translateY(-1px); }
.mp-btn:active { transform: scale(.9); }
.mp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mp-btn-main {
  width: 42px; height: 42px; font-size: 14px;
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.mp-btn-main:hover { background: var(--accent-2); color: #fff; }
.mp-btn.is-on { color: var(--accent); border-color: var(--hairline); }
.mp-vol {
  appearance: none; -webkit-appearance: none;
  flex: 1; min-width: 60px; height: 3px; border-radius: 2px;
  background: var(--line); cursor: pointer; margin-left: auto;
}
.mp-vol::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
  transition: transform var(--fast) var(--ease);
}
.mp-vol::-webkit-slider-thumb:hover { transform: scale(1.25); }
.mp-vol::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--accent); }

/* 列表 */
.mp-pop-list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mp-panel-title { font-size: 11.5px; font-weight: 700; letter-spacing: .18em; color: var(--ink); }
.mp-panel-hint { font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.mp-list {
  margin-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
.mp-list::-webkit-scrollbar { width: 5px; }
.mp-list::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
.mp-item {
  display: grid; grid-template-columns: 22px 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer;
  animation: rise var(--slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 30ms);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.mp-item:hover { background: var(--accent-soft); border-color: var(--line); }
.mp-item-no {
  font-size: 10px; letter-spacing: .12em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mp-item-name {
  font-size: 12.5px; letter-spacing: .03em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-item-dur { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-eq { display: none; align-items: flex-end; gap: 2px; height: 11px; }
.mp-item.is-current .mp-eq { display: inline-flex; }
.mp-item.is-current.mp-paused .mp-eq { display: none; }
.mp-eq i {
  width: 3px; border-radius: 1px; background: var(--accent);
  animation: mpEq 900ms ease-in-out infinite;
}
.mp-eq i:nth-child(1) { height: 60%; animation-delay: 0ms; }
.mp-eq i:nth-child(2) { height: 100%; animation-delay: 150ms; }
.mp-eq i:nth-child(3) { height: 40%; animation-delay: 300ms; }
@keyframes mpEq { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
.mp-item.is-current { background: var(--accent-soft); border-color: var(--hairline); }
.mp-item.is-current .mp-item-no::before { content: "▶"; font-size: 8px; margin-right: 3px; }
.mp-item.is-current .mp-item-name { color: var(--accent); }

/* 手机端：面板贴右全宽 */
@media (max-width: 640px) {
  .mp-popover { top: 60px; right: 12px; left: 12px; width: auto; }
  .mp-list { max-height: 200px; }
  .mp-eq { display: none !important; }
}

/* ---------- 下滑紧凑模式 ---------- */
/* 滚动离顶后：顶栏内边距、hero 上下留白、标题字号、筛选栏间距全部收紧，
   让卡片更早进入视野；所有尺寸带过渡，回顶时平滑还原 */
.stage {
  transition: padding var(--slow) var(--ease);
}
.hero {
  transition: margin-top var(--slow) var(--ease), max-width var(--slow) var(--ease);
}
.title {
  transition: font-size var(--slow) var(--ease), margin var(--slow) var(--ease);
}
.subtitle {
  transition: margin var(--slow) var(--ease), max-height var(--slow) var(--ease),
              opacity var(--fast) var(--ease);
}
.apps {
  transition: margin-top var(--slow) var(--ease);
}
.overline {
  transition: margin var(--slow) var(--ease), opacity var(--fast) var(--ease),
              max-height var(--slow) var(--ease);
}
.footer {
  transition: margin-top var(--slow) var(--ease);
}

body.is-compact .stage { padding-top: 12px; }
body.is-compact .hero { margin-top: 10px; }
body.is-compact .overline {
  max-height: 0; opacity: 0; margin-top: -4px; overflow: hidden;
}
body.is-compact .title {
  font-size: clamp(28px, 4.2vw, 48px);
  margin: 8px 0 6px;
}
body.is-compact .subtitle {
  max-height: 0; opacity: 0; margin-bottom: 10px; overflow: hidden;
}
body.is-compact .apps { margin-top: 16px; }
body.is-compact .footer { margin-top: 0; }

/* 手机端紧凑幅度更小 */
@media (max-width: 640px) {
  body.is-compact .title { font-size: clamp(24px, 7vw, 34px); }
  body.is-compact .apps { margin-top: 12px; }
}

/* ============================================================
   摩天轮式图片展示区（tasteskill.dev 同款 3D 竖直轮播）
   卡片沿 3D 弧线上升→掠顶→沉出，带景深缩放/淡出，可拖拽旋转
   ============================================================ */
.wheel-zone {
  position: fixed;
  right: clamp(-60px, 1vw, 40px);
  top: clamp(60px, 10vh, 120px);
  width: clamp(340px, 44vw, 680px);
  height: clamp(320px, 52vh, 560px);
  z-index: 0;
  pointer-events: none;
  animation: rise var(--slow) var(--ease) .1s both;
  transition: top var(--slow) var(--ease), opacity var(--slow) var(--ease);
}
.wheel-stage {
  position: relative; width: 100%; height: 100%;
  perspective: 3400px;
  pointer-events: none;         /* 舞台本身不拦截；卡片自带 auto 可拖 */
  overflow: hidden;
}
.wheel-card { cursor: grab; }
.wheel-card:active { cursor: grabbing; }
.wheel-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(3deg) rotateY(-4deg);
}
/* 卡片：JS 逐帧写入 translate3d/rotate/scale/zIndex/opacity */
.wheel-card {
  position: absolute; left: 50%; top: 50%;
  width: 54%;
  aspect-ratio: 1200 / 780;   /* 同 tasteskill 的横版截图比例 */
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 18px 44px rgba(10, 10, 10, .16);
  background: var(--card-bg);
  will-change: transform, opacity;
  user-select: none;
}
.wheel-card img {
  width: 100%; height: auto; object-fit: cover; display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
html[data-mode="night"] .wheel-card { border-color: rgba(233, 238, 251, .92); }

/* 与主内容避让 */
.stage.has-wheel .hero { max-width: 40rem; }

/* 手机端：改为底部横向流动条 */
@media (max-width: 640px) {
  .wheel-zone {
    right: 0; left: 0; top: auto; bottom: 8px;
    width: auto; height: 120px;
    overflow: hidden; opacity: .85;
  }
  .wheel-stage { perspective: none; cursor: default; }
  .wheel-inner { transform: none; }
  .wheel-card {
    position: absolute; left: auto; top: 0;
    width: 180px; height: 112px;
    border-width: 1px;
  }
}
/* 紧凑模式下上移缩小 */
body.is-compact .wheel-zone {
  top: clamp(56px, 9vh, 80px);
  opacity: .8;
}

/* ---------- 顶栏歌词 ---------- */
.lyrics {
  display: none;
  max-width: 340px;
  font-size: 12px; letter-spacing: .1em; line-height: 1.4;
  /* 歌词色：默认跟随主题色，可在后台"分控件颜色"里单独设置 */
  color: var(--c-lyrics, var(--accent));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color var(--slow) var(--ease), opacity var(--slow) var(--ease);
  animation: rise var(--slow) var(--ease) both;
}
/* 当前句：主题色实色 */
.lyrics.has-line {
  display: block;
  color: var(--c-lyrics, var(--accent));
  opacity: 1;
}
/* 前奏/间奏（还没到第一句）：同色低透明，仍然跟随主题色 */
.lyrics.is-empty {
  display: block;
  color: var(--c-lyrics, var(--accent));
  opacity: .45;
}
/* 手机端：歌词替代时钟 */
@media (max-width: 640px) {
  .lyrics { display: block; max-width: 46vw; font-size: 11.5px; }
  .lyrics.has-line ~ .clock { display: none; }   /* 有歌词时隐藏时钟 */
}
