/* ============================================================
   月色の小窝 — design system
   Visual language adapted from komichi-vup.com (fan site),
   re-themed for VTuber 月色_Moon (moonlight silver-violet).
   ============================================================ */

:root {
  --brand: #a9bdf5;
  --brand-deep: #6678c8;
  --brand-glow: rgba(169, 189, 245, 0.65);
  --bg: #07070f;
  --bg-soft: #0d0d1a;
  --ink: #f2f3fa;
  --ink-dim: rgba(242, 243, 250, 0.62);
  --ink-faint: rgba(242, 243, 250, 0.38);
  --line: rgba(242, 243, 250, 0.16);
  --line-strong: rgba(242, 243, 250, 0.32);
  --selection-bg: #cdd6f7;
  --selection-fg: #1b1e33;
  --font-sans: Inter, "SF Pro Display", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "Noto Serif SC", Georgia, "Songti SC", "STSong", "SimSun", serif;
  --h1-size: clamp(2.2rem, 7vw, 4.8rem);
  --radius-pill: 999px;
  /* 动效令牌: 全站统一缓动与时长 */
  --ease-out: cubic-bezier(0.22, 0.9, 0.32, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.15, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);   /* 匀速偏柔, 用于壁纸淡入 */
  --dur-1: 0.14s;
  --dur-2: 0.24s;
  --dur-3: 0.38s;
  --dur-4: 0.6s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100svh;
}

::selection { background: var(--selection-bg); color: var(--selection-fg); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; }

/* ---------- animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes twinkle {
  from { opacity: 0.15; transform: scale(0.7); }
  to   { opacity: 0.9;  transform: scale(1); }
}
@keyframes trafficFloat {
  from { transform: translate(-50%, -50%) translateY(-4px); }
  to   { transform: translate(-50%, -50%) translateY(4px); }
}
@keyframes moonPulse {
  0%, 100% { box-shadow: 0 0 24px 4px var(--brand-glow); }
  50%      { box-shadow: 0 0 40px 10px var(--brand-glow); }
}

.fade-up { animation: fadeUp 0.7s cubic-bezier(0.22, 0.9, 0.32, 1) both; }
.d1 { animation-delay: 120ms; }
.d2 { animation-delay: 240ms; }
.d3 { animation-delay: 380ms; }
.d4 { animation-delay: 480ms; }

/* ---------- loading overlay ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #191a2e, #101020 55%, #08080f);
  opacity: 1; transition: opacity 0.55s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-overlay .stars { position: absolute; inset: 0; overflow: hidden; }
.loading-overlay .stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #fff; opacity: 0.8;
  animation: twinkle 1.6s ease-in-out infinite alternate;
}
.loading-overlay .stars i:nth-child(1) { left: 12%; top: 22%; }
.loading-overlay .stars i:nth-child(2) { left: 26%; top: 64%; animation-delay: 0.3s; }
.loading-overlay .stars i:nth-child(3) { left: 38%; top: 16%; animation-delay: 0.6s; }
.loading-overlay .stars i:nth-child(4) { left: 58%; top: 70%; animation-delay: 0.2s; }
.loading-overlay .stars i:nth-child(5) { left: 72%; top: 28%; animation-delay: 0.8s; }
.loading-overlay .stars i:nth-child(6) { left: 86%; top: 56%; animation-delay: 0.5s; }
.loading-overlay .stars i:nth-child(7) { left: 48%; top: 84%; animation-delay: 1s; }
.loading-overlay .stars i:nth-child(8) { left: 8%;  top: 78%; animation-delay: 0.7s; }
.loading-overlay .stars i:nth-child(9) { left: 92%; top: 14%; animation-delay: 0.4s; }
.loading-overlay .orbit { position: relative; width: 150px; height: 150px; }
.loading-overlay .moon-lamp {
  position: absolute; top: 50%; left: 50%;
  width: 54px; height: 54px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 34% 30%, #ffffff, #c9d4f6 48%, #8fa1dd 78%, #6d7cba);
  box-shadow: 0 0 30px 8px rgba(200, 212, 250, 0.35),
              inset -6px -8px 12px rgba(30, 34, 68, 0.55);
  animation: trafficFloat 2.2s ease-in-out infinite alternate;
}
.loading-overlay .text {
  position: absolute; bottom: calc(50% - 120px);
  font-size: 11px; letter-spacing: 0.5em; text-indent: 0.5em;
  color: var(--ink-dim); text-transform: uppercase;
}

/* ---------- top progress bar ---------- */
.progress-bar {
  pointer-events: none; position: fixed; inset-inline: 0; top: 0;
  z-index: 100; height: 2px; overflow: hidden;
}
.progress-bar > i {
  display: block; height: 100%; width: 100%;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand-glow);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav .crumbs {
  min-width: 0; flex: 1 1 0;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.12em;
  color: var(--ink-dim);
}
.nav .crumbs a:hover { color: var(--brand); }
.nav .crumbs .sep { color: var(--ink-faint); }
.nav .crumbs .here {
  max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.nav .pill-group {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: rgba(10, 10, 22, 0.55);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 2px;
}
.nav .pill-group a {
  border-radius: var(--radius-pill);
  padding: 7px 9px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.25s, background 0.25s;
  white-space: nowrap;
}
.nav .pill-group a:hover { color: var(--ink); background: rgba(255,255,255,0.08); }
.nav .pill-group a.active { color: #141630; background: var(--brand); }
.nav .ext-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  padding: 8px; font-size: 12px; font-weight: 500;
  color: var(--ink-dim);
  background: rgba(10, 10, 22, 0.55);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: color 0.25s, border-color 0.25s;
}
.nav .ext-btn:hover { color: var(--ink); border-color: var(--brand); }
.nav .ext-btn svg { width: 14px; height: 14px; }
.nav .ext-btn span { display: none; }
@media (max-width: 639px) {
  .nav .crumbs { display: none; }
  .nav { justify-content: flex-end; }
}
@media (min-width: 640px) {
  .nav .ext-btn { padding: 8px 14px; }
  .nav .ext-btn span { display: inline; }
  .nav .pill-group a { padding: 7px 12px; font-size: 10px; }
}

/* ---------- hero (home) ---------- */
.hero {
  position: relative; display: flex; flex-direction: column;
  min-height: 100svh; width: 100%; overflow: hidden;
  padding-top: calc(env(safe-area-inset-top, 0px) + 64px);
}
.hero .bg {
  position: absolute; inset: 0; z-index: -3;
  background-image: var(--hero-img, url("../wallpaper/pc-01.webp"));
  background-position: var(--hero-pos, center 22%);
  background-size: cover;
  background-repeat: no-repeat;
  animation: fadeIn 1.2s ease both;
  filter: saturate(0.9);
  transition: opacity 0.5s ease;
}
@media (max-width: 639px) {
  /* 窄屏与宽屏同一套: 整屏清晰壁纸 + 底部渐变压暗放文字。
     壁纸按高度放大到 140%, 这样有纵向取景余地, 能把人物脸放在文字上方 */
  .hero .bg {
    background-size: var(--hero-size-m, cover);   /* 兜底: 铺满; JS 按图片尺寸精算(见 applyHeroMobile) */
    background-position: var(--hero-pos-m2, center 30%);
    background-repeat: no-repeat;
  }
  .link-card { padding: 12px 14px; }
  .link-card .zh { font-size: 15px; letter-spacing: 0.12em; }
  .link-card .en { font-size: 9px; letter-spacing: 0.22em; }
}
@media (max-width: 340px) {
  .link-card .zh { font-size: 14px; letter-spacing: 0.04em; max-width: 2.4em; text-align: center; margin: 0 auto; }
  .link-card { align-items: center; }
}
.hero .bg.switching { opacity: 0; }
/* 换壁纸按钮（komichi 同款：hero 右上小圆钮） */
.wp-switch {
  position: absolute; z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 74px); right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  padding: 8px 10px;
  font-size: 10px; letter-spacing: 0.18em; color: var(--ink-dim);
  background: rgba(10, 10, 22, 0.45);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: color 0.25s, border-color 0.25s, opacity 0.25s;
  opacity: 0.75;
}
.wp-switch:hover { color: var(--brand); border-color: var(--brand); opacity: 1; }
.wp-switch svg { width: 14px; height: 14px; }
.wp-switch .zh-label { display: none; }
@media (min-width: 640px) { .wp-switch .zh-label { display: inline; } }

.hero .bg-overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to left, rgba(7, 7, 15, 0.88) 0%, rgba(7, 7, 15, 0.45) 38%, rgba(7, 7, 15, 0.15) 62%),
    radial-gradient(ellipse at center, transparent 30%, rgba(7, 7, 15, 0.55) 78%),
    linear-gradient(to top, var(--bg) 4%, rgba(7, 7, 15, 0.72) 34%, rgba(7, 7, 15, 0.28) 62%, rgba(7, 7, 15, 0.55)),
    rgba(7, 7, 15, 0.30);
}
.hero .content {
  position: relative; margin-top: auto; margin-left: auto;
  display: flex; flex-direction: column; align-items: flex-end; gap: 20px;
  padding: 24px 24px max(20px, env(safe-area-inset-bottom, 0px));
  max-width: 56rem; width: 100%;
  text-align: right;
}
@media (min-width: 640px) { .hero .content { padding: 40px 48px 48px; gap: 26px; } }

.hero .kicker { flex-direction: row-reverse; }
.hero .kicker::before { margin-left: 0; }

.kicker {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.42em;
  color: var(--ink-dim); text-transform: uppercase;
}
.kicker::before { content: ""; display: inline-block; height: 1px; width: 40px; background: var(--brand); }

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  line-height: 0.95; font-weight: 900; letter-spacing: -0.02em;
}
.hero h1 .latin {
  margin-left: 0.18em;
  font-family: Georgia, serif; font-weight: 600; letter-spacing: -0.02em;
  font-style: italic; color: var(--brand);
}
.hero .roman {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.5vw, 1.05rem);
  font-weight: 600; letter-spacing: 0.5em;
  color: var(--ink-dim); text-transform: uppercase;
}
@media (max-width: 639px) {
  .hero .roman { letter-spacing: 0.3em; font-size: 0.72rem; }
}
.hero .intro {
  max-width: 34rem; font-size: 13px; line-height: 1.9; color: var(--ink-dim);
}

.card-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; max-width: 42rem;
}
.link-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 14px 20px;
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.link-card:hover {
  border-color: var(--brand);
  background: rgba(169, 189, 245, 0.07);
  transform: translateY(-2px);
}
.link-card .zh { font-size: 17px; font-weight: 600; letter-spacing: 0.28em; }
.link-card .en {
  font-size: 10px; font-weight: 500; letter-spacing: 0.34em;
  color: var(--ink-faint); text-transform: uppercase;
  transition: color 0.3s;
}
.link-card:hover .en { color: var(--brand); }
.link-card .badge {
  position: absolute; right: -1px; top: -1px;
  background: var(--brand); color: #141630;
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  padding: 3px 10px; border-radius: 0 0 0 8px;
}

/* live status strip */
.live-strip {
  display: inline-flex; align-items: center; gap: 10px;
  align-self: flex-end;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 8px 16px; font-size: 12px; letter-spacing: 0.08em;
  color: var(--ink-dim);
  background: rgba(10, 10, 22, 0.5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s;
}
.live-strip:hover { border-color: var(--brand); }
.live-strip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #565c7a;
}
.live-strip.live .dot { background: #ff5b7f; box-shadow: 0 0 8px rgba(255, 91, 127, 0.9); animation: twinkle 1.2s infinite alternate; }
.live-strip.live { color: var(--ink); }

/* ---------- subpage layout ---------- */
/* 全站贯通的毛玻璃壁纸层(app.js 自动注入子页面) */
.page-bg {
  position: fixed; inset: 0; z-index: -3; overflow: hidden;
  background: var(--bg);
  /* 毛玻璃"透明度" --glass(0~1): 只改各层的不透明度, 不改图片亮度 */
}
.page-bg img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: var(--page-pos, center);
  /* --glass(0~1) = 背景清晰度: 0 → 完全模糊, 1 → 几乎清晰; 亮度固定不参与 */
  filter: blur(calc(2px + 46px * (1 - var(--glass, 0.6)))) saturate(1.1) brightness(0.8);
  transform: scale(1.06);
  animation: fadeIn 1s ease both;
}
.page-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(7,7,15,0.34), rgba(7,7,15,0.58) 72%, rgba(7,7,15,0.86));
  opacity: 0.62;                                        /* 固定压暗: 只保证文字可读, 不随滑块变 */
}
.page {
  position: relative; min-height: 100svh; width: 100%;
}
.page .bg-glow {
  pointer-events: none; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 50% 40% at 85% -5%, var(--brand-glow), transparent 70%);
  opacity: 0.22;
  transition: background 0.5s ease;
}
.page .wrap {
  position: relative; margin-inline: auto;
  display: flex; flex-direction: column; min-height: 100svh;
  width: 100%; max-width: 64rem;
  padding: 40px 24px 0;
}
@media (min-width: 640px) { .page .wrap { padding: 56px 40px 0; } }

.page header.page-head { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.page h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1; font-weight: 900; letter-spacing: -0.01em;
}
.page .lede { max-width: 42rem; font-size: 13px; line-height: 1.9; color: var(--ink-dim); }

/* ---------- buttons / inputs / pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em;
  color: var(--ink-dim); white-space: nowrap;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.btn:hover { color: var(--ink); border-color: var(--brand); background: rgba(169,189,245,0.06); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #141630; }
.btn.primary:hover { background: #c0cffa; }

.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-faint); pointer-events: none;
}
.search-box input {
  height: 36px; width: 100%; max-width: 220px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  padding: 0 32px 0 36px;
  font-size: 13px; color: var(--ink); outline: none;
  transition: border-color 0.25s, background 0.25s;
}
.search-box input::placeholder { color: var(--ink-faint); }
.search-box input:focus { border-color: var(--brand); background: rgba(169,189,245,0.07); }

.tag-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pills button {
  height: 32px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em;
  color: var(--ink-dim);
  transition: all 0.25s;
}
.tag-pills button:hover { border-color: var(--brand); color: var(--ink); }
.tag-pills button.active { background: var(--brand); border-color: var(--brand); color: #141630; }

/* ---------- song table ---------- */
.song-table { width: 100%; border-collapse: collapse; text-align: left; }
.song-table thead th {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 10px; font-weight: 500; letter-spacing: 0.4em;
  color: var(--ink-faint); text-transform: uppercase;
  white-space: nowrap;
}
.song-table tbody td {
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px; vertical-align: middle;
}
.song-table tbody tr { transition: background 0.2s; }
.song-table tbody tr:hover { background: rgba(169, 189, 245, 0.05); }
.song-table .name { font-weight: 600; cursor: pointer; transition: color 0.2s; }
.song-table .name:hover { color: var(--brand); }
.song-table .name .idx { color: var(--ink-faint); font-size: 11px; margin-right: 10px; font-weight: 400; font-variant-numeric: tabular-nums; }
.song-table .singer { color: var(--ink-dim); font-size: 13px; }
.song-table .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.song-table .tags i {
  font-style: normal; font-size: 10px; letter-spacing: 0.1em;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 2px 9px; color: var(--ink-faint); white-space: nowrap;
}
.song-table .copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; letter-spacing: 0.1em; color: var(--ink-faint);
  transition: color 0.2s; white-space: nowrap;
}
.song-table .copy-btn:hover { color: var(--brand); }
.song-table .copy-btn svg { width: 13px; height: 13px; }

/* mobile: table becomes cards */
@media (max-width: 639px) {
  .song-table thead { display: none; }
  .song-table, .song-table tbody, .song-table tr, .song-table td { display: block; width: 100%; }
  .song-table tbody tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .song-table tbody td { border: none; padding: 3px 0; }
  .song-table td.tags-cell { padding-top: 6px; }
}

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; gap: 12px; }
.pager button {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--ink-dim); transition: all 0.25s;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button:disabled { opacity: 0.3; cursor: default; }
.pager button svg { width: 14px; height: 14px; }
.pager .num { font-size: 12px; letter-spacing: 0.2em; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
/* 页码可直接输入跳转 */
.pager .jump { display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.12em; }
.pager .jump input {
  width: 38px; height: 32px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font: inherit; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--ink); letter-spacing: 0; transition: border-color 0.2s, background 0.2s;
}
.pager .jump input:hover { border-color: var(--brand); }
.pager .jump input:focus {
  outline: none; border-color: var(--brand);
  background: rgba(169, 189, 245, 0.12);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.pager .jump b { font-weight: 500; color: var(--ink-dim); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; z-index: 200;
  transform: translate(-50%, 20px);
  border: 1px solid var(--brand); border-radius: var(--radius-pill);
  background: rgba(10, 10, 22, 0.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px 22px; font-size: 13px; letter-spacing: 0.06em;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  max-width: min(90vw, 480px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 表格容器毛玻璃化(透明度跟随外观设置) */
#table-anchor {
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(10, 10, 22, var(--panel-alpha, 0.26));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 6px 18px 14px;
}
.song-table thead th, .sing-table thead th { border-bottom-color: var(--line-strong); }

/* ---------- SPA 视图切换 ---------- */
.view { display: none; }
.view.active { display: block; }
#page-bg.hide { display: none; }

/* ---------- 唱过的歌 · 控制区 ---------- */
.sing-controls {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.sing-controls-left { display: flex; gap: 8px; flex-wrap: wrap; }
.sing-meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.sing-count {
  margin-left: auto; font-size: 12px; letter-spacing: 0.2em;
  color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.sort-pills { display: flex; gap: 6px; margin-left: auto; }
.sort-pills button {
  height: 28px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint);
  transition: all 0.25s;
}
.sort-pills button:hover { border-color: var(--brand); color: var(--ink); }
.sort-pills button.active { background: var(--brand); border-color: var(--brand); color: #141630; }
.sing-hint {
  margin: 14px 0 0; font-size: 11px; letter-spacing: 0.12em;
  color: var(--ink-faint); text-align: center;
}
@media (max-width: 720px) {
  .sing-count { margin-left: 0; }
  .sort-pills { margin-left: 0; }
}

/* 点歌行可点提示 */
.song-table tbody tr { cursor: pointer; }

/* ---------- 播放列表面板: 清空/移除/拖动 ---------- */
.qp-actions { display: flex; gap: 6px; }
.qp-actions button {
  font-size: 11px; letter-spacing: 0.1em; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 3px 10px; transition: all 0.2s;
}
.qp-actions button:hover { color: var(--brand); border-color: var(--brand); }
.qp-empty {
  padding: 28px 16px; text-align: center;
  font-size: 12px; color: var(--ink-dim); line-height: 2;
}
.qp-empty span { font-size: 11px; color: var(--ink-faint); }
.qp-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px 8px 16px; text-align: left;
  font-size: 13px; color: var(--ink-dim); cursor: pointer;
  transition: background 0.15s, color 0.15s;
  touch-action: pan-y;          /* 手机可上下滚动列表 */
}
.qp-row .q-handle { touch-action: none; }   /* 手柄区域用于拖动 */
.qp-row:hover { background: rgba(169, 189, 245, 0.07); color: var(--ink); }
.qp-row.playing { color: var(--brand); }
.qp-row.dragging { background: rgba(169, 189, 245, 0.16); opacity: 0.92; }
.qp-row .q-idx {
  width: 22px; flex-shrink: 0; text-align: right;
  font-size: 10px; color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.qp-row.playing .q-idx { color: var(--brand); }
.qp-row .q-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qp-row .q-dur { flex-shrink: 0; font-size: 10px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.qp-row .q-remove {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  font-size: 14px; line-height: 1; color: var(--ink-faint);
  transition: color 0.2s, background 0.2s;
}
.qp-row .q-remove:hover { color: #ff7a9c; background: rgba(255, 122, 156, 0.12); }
.qp-row .q-handle {
  flex-shrink: 0; padding: 0 4px; cursor: grab;
  font-size: 13px; color: var(--ink-faint); letter-spacing: -2px;
  transition: color 0.2s;
}
.qp-row .q-handle:hover { color: var(--brand); }
body.dragging-row { user-select: none; cursor: grabbing; }

/* 音量 */
.vol-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.vol-wrap #vol-range {
  -webkit-appearance: none; appearance: none;
  width: 68px; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  accent-color: var(--brand); cursor: pointer; outline: none;
}
.vol-wrap #vol-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 6px var(--brand-glow);
}
.vol-wrap #vol-range::-moz-range-thumb {
  width: 11px; height: 11px; border: none; border-radius: 50%;
  background: var(--brand);
}
.vol-wrap #vol-range::-moz-range-track {
  height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.18);
}
@media (max-width: 720px) {
  .vol-wrap #vol-range { display: none; }   /* 手机上隐藏滑块, 保留静音按钮 */
}

/* 播放列表按钮(位于进度/时间右侧) */
.player-bar .queue-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  color: var(--ink-dim); transition: color 0.2s, background 0.2s;
}
.player-bar .queue-btn:hover { color: var(--brand); background: rgba(169, 189, 245, 0.1); }
.player-bar .queue-btn.on { color: var(--brand); }
.player-bar .queue-btn svg { width: 16px; height: 16px; }

/* 拖动排序的动效(不加横向缩放, 否则会撑出横向滚动条) */
.qp-row { will-change: transform; }
.qp-row.dragging {
  background: rgba(169, 189, 245, 0.18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--brand) inset;
  border-radius: 10px;
  opacity: 0.96;
  z-index: 2; position: relative;
  cursor: grabbing;
}
.qp-row.shifting { transition: transform 0.18s cubic-bezier(0.22, 0.9, 0.32, 1); }
.qp-body.drop-active { background: rgba(169, 189, 245, 0.04); }

/* ---------- 外观设置面板 ---------- */
.appearance-panel {
  position: fixed; right: 12px; z-index: 80;
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  width: min(300px, calc(100vw - 24px));
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(10, 10, 22, 0.94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  transform: translateY(-8px) scale(0.98); opacity: 0; pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}
.appearance-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.ap-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; letter-spacing: 0.2em;
}
.ap-head button {
  font-size: 11px; letter-spacing: 0.1em; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 3px 10px; transition: all 0.2s;
}
.ap-head button:hover { color: var(--brand); border-color: var(--brand); }
.ap-body { padding: 14px 16px 18px; }
.ap-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: 0.14em; color: var(--ink-dim); margin-bottom: 10px;
}
.ap-label b { color: var(--brand); font-variant-numeric: tabular-nums; }
.ap-body #frost-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.18); accent-color: var(--brand);
  outline: none; cursor: pointer;
}
.ap-body #frost-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 8px var(--brand-glow);
}
.ap-body #frost-range::-moz-range-thumb {
  width: 14px; height: 14px; border: none; border-radius: 50%; background: var(--brand);
}
.ap-hint { font-size: 10px; line-height: 1.8; color: var(--ink-faint); margin-top: 10px; }

/* ---------- 右键菜单 ---------- */
.ctx-menu {
  position: fixed; z-index: 200; min-width: 148px;
  display: none; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(12, 12, 24, 0.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 5px; overflow: hidden;
}
.ctx-menu.open { display: flex; }
.ctx-menu button {
  text-align: left; padding: 9px 14px; border-radius: 8px;
  font-size: 13px; color: var(--ink-dim); transition: background 0.15s, color 0.15s;
}
.ctx-menu button:hover { background: rgba(169, 189, 245, 0.12); color: var(--ink); }
.ctx-menu button.danger:hover { background: rgba(255, 122, 156, 0.14); color: #ff7a9c; }

/* ---------- footer ---------- */
.footer {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 22px 24px 28px;
}
.footer .brand-line {
  font-size: 10px; font-weight: 500; letter-spacing: 0.24em;
  color: var(--ink-faint); text-transform: uppercase;
}
.footer .links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer .links a {
  font-size: 10px; font-weight: 500; letter-spacing: 0.24em;
  color: var(--ink-dim); text-transform: uppercase;
  transition: color 0.25s;
}
.footer .links a:hover { color: var(--brand); }

/* ---------- about page ---------- */
.about-grid { display: grid; gap: 14px; margin-top: 40px; }
@media (min-width: 720px) { .about-grid { grid-template-columns: 1fr 1fr; } }
.info-card {
  border: 1px solid var(--line); border-radius: 18px;
  background: rgba(13, 13, 26, calc(var(--panel-alpha, 0.26) + 0.06));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 12px;
}
.info-card h2 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.34em;
  color: var(--brand); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.info-card h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.info-card p, .info-card li { font-size: 13px; line-height: 1.9; color: var(--ink-dim); }
.info-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.info-card a.link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink); font-size: 13px;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
  width: fit-content;
}
.info-card a.link:hover { color: var(--brand); border-color: var(--brand); }
.info-card .avatar {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1px solid var(--line-strong);
}

.stat-row { display: flex; gap: 28px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 10px; letter-spacing: 0.28em; color: var(--ink-faint); text-transform: uppercase; }

/* ---------- player（唱过的歌） ---------- */
/* 播放条占位: 高度由 JS 实时设置, 保证页脚/内容不被悬浮播放条压住 */
.player-spacer { height: 0; width: 100%; pointer-events: none; }
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  border-top: 1px solid var(--line);
  background: rgba(10, 10, 22, 0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px;
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.22, 0.9, 0.32, 1);
}
.player-bar.on { transform: translateY(0); }
.player-bar .cover {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  animation: spin 14s linear infinite paused;
}
.player-bar.playing .cover { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-bar .meta { min-width: 0; width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.player-bar .meta b {
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-bar .meta span {
  font-size: 10px; letter-spacing: 0.14em; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-bar .ctrl {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.player-bar .ctrl button {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  color: var(--ink-dim); transition: color 0.2s, background 0.2s;
}
.player-bar .ctrl button:hover { color: var(--brand); background: rgba(169,189,245,0.1); }
.player-bar .ctrl .play-btn {
  width: 42px; height: 42px;
  border: 1px solid var(--brand);
  color: var(--brand);
}
.player-bar .ctrl .play-btn:hover { background: var(--brand); color: #141630; }
.player-bar .ctrl svg { width: 17px; height: 17px; }
.player-bar .prog-wrap {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
}
.player-bar .time {
  font-size: 10px; letter-spacing: 0.08em; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.player-bar .prog {
  flex: 1; height: 18px; display: flex; align-items: center; cursor: pointer; min-width: 40px;
}
.player-bar .prog .rail {
  position: relative; width: 100%; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
.player-bar .prog .fill {
  position: absolute; inset: 0; width: 0%;
  background: var(--brand); border-radius: 3px;
  box-shadow: 0 0 8px var(--brand-glow);
}
@media (max-width: 720px) {
  .player-bar .prog-wrap { position: absolute; left: 0; right: 0; top: -8px; padding: 0 12px; }
  .player-bar .time { display: none; }
  .player-bar { gap: 10px; }
  .player-bar .meta { width: auto; flex: 1; }
}
/* 窄屏: 播放条紧凑化, 避免封面/歌名/按钮互相挤压 */
@media (max-width: 639px) {
  .player-bar { padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .player-bar .cover { width: 38px; height: 38px; }
  .player-bar .meta b { font-size: 12px; }
  .player-bar .meta span { font-size: 9px; letter-spacing: 0.08em; }
  .player-bar .ctrl { gap: 2px; }
  .player-bar .ctrl button { width: 31px; height: 31px; }
  .player-bar .ctrl .play-btn { width: 40px; height: 40px; }
  .player-bar .ctrl svg { width: 15px; height: 15px; }
  .player-bar .queue-btn { width: 31px; height: 31px; }
  .player-bar .vol-wrap { gap: 0; }
  .player-bar #vol-range { display: none; }
}
/* 极窄屏: 播放模式移入播放列表头部, 播放条只留核心操作 */
@media (max-width: 430px) {
  .player-bar #p-mode { display: none; }
  .player-bar #p-vol, .player-bar .vol-wrap { display: none; }
}

/* 唱过的歌 — 播放器式曲目表 */
.sing-table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
.sing-table thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 10px; font-weight: 500; letter-spacing: 0.3em;
  color: var(--ink-faint); text-transform: uppercase;
  white-space: nowrap;
}
.sing-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sing-table tbody tr { cursor: pointer; transition: background 0.2s; }
.sing-table tbody tr:hover { background: rgba(169, 189, 245, 0.06); }
.sing-table tbody tr.playing { background: rgba(169, 189, 245, 0.1); }
.sing-table tbody tr.playing .st-name { color: var(--brand); }
.sing-table .st-idx {
  width: 40px; font-size: 13px; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; letter-spacing: 0.05em;
}
.sing-table .st-title { overflow: hidden; }
.sing-table .st-title-in { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.sing-table .st-cover {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line); background: var(--bg-soft);
}
.sing-table .st-names { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sing-table .st-name {
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sing-table .st-sub {
  font-size: 11px; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sing-table .st-album { font-size: 12px; color: var(--ink-dim); letter-spacing: 0.06em; white-space: nowrap; }
.sing-table .st-fav { width: 48px; }
.sing-table .fav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  color: var(--ink-faint); transition: color 0.2s, transform 0.2s;
}
.sing-table .fav-btn:hover { color: var(--brand); transform: scale(1.12); }
.sing-table .fav-btn.on { color: #ff6b9d; }
.sing-table .fav-btn svg { width: 16px; height: 16px; }
.sing-table .st-dur {
  width: 64px; font-size: 12px; color: var(--ink-dim);
  font-variant-numeric: tabular-nums; letter-spacing: 0.06em; white-space: nowrap;
}
@media (max-width: 639px) {
  .sing-table thead { display: none; }
  .sing-table .st-album { display: none; }
  .sing-table .st-idx { width: 28px; font-size: 11px; padding-right: 0; }
  .sing-table tbody td { padding: 8px 6px; }
  .sing-table .st-cover { width: 40px; height: 40px; }
}
/* 更窄的屏幕: 再压缩各列, 给歌名留出空间 */
@media (max-width: 400px) {
  .sing-table tbody td { padding: 7px 3px; }
  .sing-table .st-idx { width: 24px; font-size: 10px; }
  .sing-table .st-cover { width: 34px; height: 34px; }
  .sing-table .st-name { font-size: 13px; }
  .sing-table .st-sub { font-size: 10px; }
  .sing-table .st-fav { width: 36px; }
  .sing-table .st-dur { width: 44px; font-size: 11px; }
  .sing-table .st-title-in { gap: 8px; }
}
/* 播放模式按钮高亮 + 播放列表面板 */
.player-bar .ctrl button.mode-shuffle { color: var(--brand); }
.queue-panel {
  position: fixed; right: 16px; z-index: 70;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 32px)); max-height: 52vh;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(10, 10, 22, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transform: translateY(12px); opacity: 0; pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
  overflow: hidden;
}
.queue-panel.open { transform: none; opacity: 1; pointer-events: auto; }
@media (max-width: 639px) {
  .queue-panel {
    left: 0; right: 0; bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: 100%; max-height: 60vh;
    border-radius: 18px 18px 0 0;
    border-left: none; border-right: none;
  }
}
.qp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; letter-spacing: 0.2em;
}
.qp-head .qp-count { font-size: 10px; color: var(--ink-faint); letter-spacing: 0.14em; }
.qp-body { overflow-y: auto; overflow-x: hidden; }
.qp-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 16px; text-align: left;
  font-size: 13px; color: var(--ink-dim);
  transition: background 0.15s, color 0.15s;
}
.qp-row:hover { background: rgba(169, 189, 245, 0.07); color: var(--ink); }
.qp-row.playing { color: var(--brand); }
.qp-row .q-idx {
  width: 22px; flex-shrink: 0; text-align: right;
  font-size: 10px; color: var(--ink-faint); font-variant-numeric: tabular-nums;
}
.qp-row.playing .q-idx { color: var(--brand); }
.qp-row .q-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qp-row .q-dur { flex-shrink: 0; font-size: 10px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* 给播放器留出底部空间(body 上的内联 padding 会按播放条真实高度动态设置) */
/* 底部空间由 .player-spacer 动态撑开(不再固定 padding) */

/* ============================================================
   动效系统 —— 统一的关键帧 / 时长 / 缓动
   ============================================================ */

/* 视图切换: 淡入 + 轻微上移(每次切换重新播放) */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.view.active { animation: viewIn var(--dur-3) var(--ease-out) both; }

/* 列表逐行入场: 由 JS 写入 style="--row-i:N" 控制错峰 */
@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.sing-table tbody tr,
.song-table tbody tr {
  animation: rowIn var(--dur-2) var(--ease-out) both;
  animation-delay: calc(var(--row-i, 0) * 14ms);
}

/* 卡片 / 按钮 / 药丸: 统一缓动, 悬停有"抬起"感 */
.link-card { transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.link-card:hover { transform: translateY(-3px); }
.link-card:active { transform: translateY(-1px) scale(0.995); }
.pill, .pager button, .ext-btn, .btn, .qp-actions button, .icon-btn {
  transition-timing-function: var(--ease-out);
}

/* 播放器: 换曲时封面淡入; 播放键按下有回弹 */
@keyframes coverIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: none; }
}
.player-bar .cover { animation: coverIn var(--dur-2) var(--ease-out) both; }
.player-bar .ctrl .play-btn { transition: transform var(--dur-1) var(--ease-out), background var(--dur-2) var(--ease-out); }
.player-bar .ctrl .play-btn:active { transform: scale(0.9); }
.player-bar .ctrl button:active { transform: scale(0.92); }
.player-bar .ctrl button { transition: transform var(--dur-1) var(--ease-out), color var(--dur-2) var(--ease-out); }

/* 进度条: 已播放部分平滑过渡, 拖动时禁用(JS 会加 .dragging) */
.prog-fill { transition: width 0.25s linear; }
.prog-wrap.dragging .prog-fill { transition: none; }

/* 播放列表面板: 从右下角弹出 */
.queue-panel {
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}
.queue-panel.open { transform: none; }

/* 右键 / 长按菜单 */
@keyframes menuIn {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.ctx-menu.open { display: flex; animation: menuIn var(--dur-1) var(--ease-out) both; transform-origin: top left; }

/* 外观面板: 从右上角展开 */
.appearance-panel {
  transform-origin: top right;
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}
.appearance-panel:not(.open) { transform: translateY(-8px) scale(0.97); }

/* 主题色可过渡: 把品牌色注册成 <color>, 换壁纸时颜色跟着图片一起渐变而不是突变 */
@property --brand {
  syntax: '<color>'; inherits: true; initial-value: #a9bdf5;
}
@property --brand-deep {
  syntax: '<color>'; inherits: true; initial-value: #6678c8;
}
@property --brand-glow {
  syntax: '<color>'; inherits: true; initial-value: rgba(169, 189, 245, 0.65);
}
:root {
  transition: --brand 1.3s var(--ease-soft),
              --brand-deep 1.3s var(--ease-soft),
              --brand-glow 1.3s var(--ease-soft);
}

/* 壁纸切换: 双层交叉淡入(新图在上层淡入, 旧图不动), 不会先变黑再亮 */
.hero .bg-next {
  z-index: -2;
  opacity: 0;
  animation: none;
  transition: opacity 1.3s var(--ease-soft);
  will-change: opacity;
}
.hero .bg-next.on { opacity: 1; }

/* 主题色驱动的"填充"不要自己再做过渡:
   --brand 本身已在 :root 上以 1.3s 平滑动画; 元素若再带 background 过渡,
   会产生约等于过渡时长的固定滞后 —— 看起来就是"导航比壁纸慢半拍"。
   这里显式把 background 从过渡属性里剔除, 让填充色严格跟随变量动画。 */
.nav .pill-group a.active,
.tag-pills button.active,
.sort-pills button.active,
.btn.primary {
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out),
              transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

/* toast: 从底部滑入 */
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast.show { animation: toastIn var(--dur-2) var(--ease-out) both; }

/* 键盘聚焦可见(鼠标点击不显示) */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 尊重系统"减少动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .view.active, .sing-table tbody tr, .song-table tbody tr { animation: none !important; }
}
