/* ==========================================================================
   云音乐库 —— 样式表
   主题通过 <html data-theme="light|dark"> 切换
   ========================================================================== */

:root {
  --accent: #6d5efc;
  --accent-hover: #5b4bf0;
  --accent-soft: rgba(109, 94, 252, 0.12);
  --accent-2: #ff5d8f;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.12);
  --success: #12a150;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 32, 0.06), 0 1px 3px rgba(16, 20, 32, 0.04);
  --shadow: 0 4px 16px rgba(16, 20, 32, 0.08), 0 1px 3px rgba(16, 20, 32, 0.04);
  --shadow-lg: 0 18px 48px rgba(16, 20, 32, 0.16);
  --player-h: 96px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-grad: radial-gradient(1200px 520px at 12% -12%, rgba(109, 94, 252, 0.14), transparent 62%),
             radial-gradient(900px 420px at 92% -6%, rgba(255, 93, 143, 0.12), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --surface-hover: #f7f8fc;
  --text: #14161c;
  --text-2: #454b58;
  --text-dim: #7a8291;
  --border: #e5e7ef;
  --border-strong: #d3d7e3;
  --player-bg: rgba(255, 255, 255, 0.88);
  --overlay: rgba(18, 20, 28, 0.42);
  --skel: linear-gradient(90deg, #eceef4 25%, #f5f6fa 37%, #eceef4 63%);
}

html[data-theme="dark"] {
  --bg: #0d0f14;
  --bg-grad: radial-gradient(1200px 520px at 12% -12%, rgba(109, 94, 252, 0.22), transparent 62%),
             radial-gradient(900px 420px at 92% -6%, rgba(255, 93, 143, 0.14), transparent 60%);
  --surface: #171a21;
  --surface-2: #1e222b;
  --surface-hover: #1c2029;
  --text: #edf0f6;
  --text-2: #b9c0cd;
  --text-dim: #858d9c;
  --border: #262b36;
  --border-strong: #333a48;
  --player-bg: rgba(20, 23, 30, 0.9);
  --overlay: rgba(0, 0, 0, 0.62);
  --skel: linear-gradient(90deg, #1c2029 25%, #232833 37%, #1c2029 63%);
  --accent-soft: rgba(109, 94, 252, 0.22);
  --danger-soft: rgba(229, 72, 77, 0.2);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

/*
 * hidden 属性必须始终生效。
 * 下面这些元素设置了 display:flex/grid，作者样式优先级高于浏览器默认的
 * [hidden] { display: none }，若不强制覆盖，弹窗/管理条等会一直显示。
 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom, 0px) + 8px);
  transition: background-color .25s ease, color .25s ease;
}

body.player-hidden { padding-bottom: 0; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, button { font-size: 14px; }
h1, h2, h3 { margin: 0; font-weight: 650; }

::selection { background: var(--accent-soft); }

/* 滚动条 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-dim); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================== 顶部导航 ============================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 16px rgba(109, 94, 252, .32);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16.5px; letter-spacing: .2px; }
.brand-text em { font-style: normal; font-size: 10.5px; color: var(--text-dim); letter-spacing: 1.4px; text-transform: uppercase; }

/* 搜索框 */
.search-box {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.search-icon { position: absolute; left: 13px; color: var(--text-dim); pointer-events: none; }
.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 10px;
  width: 24px; height: 24px;
  border: none; border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 17px; line-height: 1;
  display: grid; place-items: center;
}
.search-clear:hover { background: var(--border-strong); color: var(--text); }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 550;
  white-space: nowrap;
  transition: background .16s, border-color .16s, transform .12s, box-shadow .16s, color .16s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 12px rgba(109, 94, 252, .28);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-block { width: 100%; justify-content: center; }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  transition: background .16s, color .16s, border-color .16s, transform .12s;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.tiny { width: 30px; height: 30px; border: none; background: transparent; }

.text-btn {
  height: 34px; min-width: 46px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
}
.text-btn:hover { background: var(--surface-hover); color: var(--text); }

/* 主题图标切换 */
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: none; }

/* 管理员条 */
.admin-bar { display: flex; align-items: center; gap: 9px; }
.admin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}
.admin-badge b { font-weight: 700; }

/* ============================== 页面容器 ============================== */
.page { max-width: 1200px; margin: 0 auto; padding: 26px 22px 40px; }

/* Hero */
.hero {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}
.hero-text h1 {
  font-size: 30px; letter-spacing: -.4px;
  background: linear-gradient(100deg, var(--text) 25%, var(--accent) 78%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-text p { margin: 8px 0 0; color: var(--text-dim); font-size: 14px; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  min-width: 96px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.3px; white-space: nowrap; }
.stat span { font-size: 11.5px; color: var(--text-dim); }

/* 工具条 */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 12px; flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: baseline; gap: 10px; }
.toolbar-left h2 { font-size: 17px; }
.result-count { font-size: 12.5px; color: var(--text-dim); }
.toolbar-right { display: flex; align-items: center; gap: 9px; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 12px; top: 50%;
  width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg); pointer-events: none;
}
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  height: 40px; padding: 0 34px 0 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  outline: none; cursor: pointer;
}
.select-wrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ============================== 曲目列表 ============================== */
.list-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 180px 66px 58px 84px;
  gap: 12px;
  padding: 0 16px 9px;
  font-size: 11.5px;
  letter-spacing: .5px;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.list-head .col-idx { text-align: center; }
.list-head .col-time { display: flex; justify-content: flex-end; }
.list-head .col-plays { text-align: right; }

.track-list { display: flex; flex-direction: column; }

.track {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 180px 66px 58px 84px;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.track:hover { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
.track.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.track.active .t-title { color: var(--accent); }

.t-idx {
  display: grid; place-items: center;
  font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.t-idx .idx-num { display: block; }
.t-idx .idx-play { display: none; color: var(--accent); }
.track:hover .t-idx .idx-num { display: none; }
.track:hover .t-idx .idx-play { display: block; }
.track.active .t-idx .idx-num { display: none; }
.track.active .t-idx .idx-play { display: block; }
.track.active.playing .idx-play .eq-bar { animation-play-state: running; }

/* 播放中均衡器动画 */
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; height: 4px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .18s; }
.eq i:nth-child(3) { animation-delay: .36s; }
.eq i:nth-child(4) { animation-delay: .54s; }
.track:not(.playing) .eq i { animation-play-state: paused; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 14px; } }

.t-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.t-cover {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-2), var(--border));
  display: grid; place-items: center;
  color: var(--text-dim);
  box-shadow: var(--shadow-sm);
}
.t-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.t-title {
  font-size: 14.5px; font-weight: 560;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.t-sub { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub .dot { margin: 0 6px; opacity: .5; }
.t-badge {
  display: inline-block;
  padding: 0 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 10.5px; line-height: 16px;
  margin-left: 7px; vertical-align: 1px;
}

.t-album { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-plays { font-size: 13px; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.t-time { font-size: 13px; color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }

.t-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; opacity: 0; transition: opacity .15s; }
.track:hover .t-actions, .track.active .t-actions { opacity: 1; }
.t-actions .icon-btn { width: 32px; height: 32px; border: none; background: transparent; }
.t-actions .icon-btn:hover { background: var(--surface-2); }
.t-actions .act-del:hover { color: var(--danger); background: var(--danger-soft); }

/* 骨架屏 */
.skeleton-wrap { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.skeleton-row {
  height: 62px; border-radius: var(--radius);
  background: var(--skel); background-size: 400% 100%;
  animation: skel 1.4s ease infinite;
}
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 74px 20px; text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-state h3 { color: var(--text); font-size: 17px; }
.empty-state p { margin: 0; font-size: 13.5px; }
.empty-state .btn { margin-top: 10px; }

/* ============================== 播放器 ============================== */
.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--player-bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -6px 24px rgba(16, 20, 32, .08);
  animation: rise .28s ease;
}
@keyframes rise { from { transform: translateY(100%); } to { transform: translateY(0); } }

.player-progress-top { height: 3px; background: var(--border); cursor: pointer; position: relative; }
.player-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .12s linear; }

.player-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 12px 22px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

/* 当前播放 */
.now-playing { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np-cover {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #fff;
  box-shadow: var(--shadow);
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.np-meta b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta span { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 中间控制 */
.player-center { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.controls { display: flex; align-items: center; gap: 10px; }
.controls .icon-btn { width: 38px; height: 38px; border: none; background: transparent; }
.controls .icon-btn:hover { background: var(--surface-2); }
.controls .icon-btn.on { color: var(--accent); background: var(--accent-soft); }

.play-btn {
  position: relative;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px rgba(109, 94, 252, .38);
  transition: transform .12s, background .16s;
}
.play-btn:hover { background: var(--accent-hover); }
.play-btn:active { transform: scale(.93); }
.play-btn .ic-pause { display: none; }
.player.playing .play-btn .ic-play { display: none; }
.player.playing .play-btn .ic-pause { display: block; }
.play-btn .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loop-btn-wrap { position: relative; }
#loopBtn { position: relative; }
#loopBtn .loop-one {
  position: absolute; right: 4px; bottom: 3px;
  font-size: 9px; font-weight: 800; line-height: 1;
  color: var(--accent);
}

.progress-row { display: flex; align-items: center; gap: 11px; width: 100%; max-width: 560px; }
.time { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 40px; }
.time:last-child { text-align: right; }

/* Range 通用样式 */
.range {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 5px;
  border-radius: 999px;
  background: var(--border-strong);
  outline: none; cursor: pointer;
  transition: background .15s;
}
.range::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.24);
  transition: transform .12s;
}
.range::-webkit-slider-thumb:hover { transform: scale(1.18); }
.range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.24);
}
.range::-moz-range-progress { background: var(--accent); height: 5px; border-radius: 999px; }
.range-sm { height: 4px; max-width: 96px; }
.range-sm::-webkit-slider-thumb { width: 11px; height: 11px; }

/* 右侧 */
.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.volume-wrap { display: flex; align-items: center; gap: 8px; }
.volume-wrap .icon-btn { width: 34px; height: 34px; border: none; background: transparent; }
.volume-wrap .icon-btn:hover { background: var(--surface-2); }

#playlistBtn { position: relative; }
.queue-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}

/* ============================== 播放队列抽屉 ============================== */
.queue-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 90;
  width: 340px; max-width: 88vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideIn .24s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.queue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.queue-head h3 { font-size: 15px; }
.queue-head span { color: var(--text-dim); font-weight: 400; font-size: 13px; }
.queue-head .icon-btn { border: none; font-size: 20px; line-height: 1; }
.queue-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.queue-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px;
}
.queue-item:hover { background: var(--surface-hover); }
.queue-item.active { background: var(--accent-soft); color: var(--accent); }
.queue-item .qi-idx { width: 20px; text-align: center; color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.queue-item .qi-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-item .qi-dur { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.drawer-mask { position: fixed; inset: 0; z-index: 85; background: var(--overlay); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ============================== 弹窗 ============================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  animation: fade .18s ease;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
  margin: auto;
}
.modal-sm { max-width: 400px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-head .icon-btn { border: none; font-size: 21px; line-height: 1; width: 34px; height: 34px; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px 18px; border-top: 1px solid var(--border);
}
.modal-foot-inline { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.hint { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.confirm-text { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text-2); }
.confirm-text b { color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field > span { font-size: 12.5px; color: var(--text-dim); font-weight: 550; }
.field input {
  height: 42px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  outline: none; transition: border-color .16s, box-shadow .16s, background .16s;
}
.field input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.field-row { display: flex; gap: 12px; }

.form-error {
  padding: 9px 12px; border-radius: 9px;
  background: var(--danger-soft); color: var(--danger);
  font-size: 13px;
}

/* 拖拽上传区 */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-dim);
  text-align: center; cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.dropzone p { margin: 0; font-size: 14px; color: var(--text-2); }
.dropzone p b { color: var(--accent); }
.dropzone small { font-size: 12px; line-height: 1.6; }

.upload-tips { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }

/* 上传队列 */
.upload-queue { display: flex; flex-direction: column; gap: 9px; max-height: 260px; overflow-y: auto; }
.upload-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.upload-item .ui-main { flex: 1; min-width: 0; }
.upload-item .ui-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item .ui-bar { height: 4px; border-radius: 999px; background: var(--border-strong); margin-top: 7px; overflow: hidden; }
.upload-item .ui-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-item .ui-status { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.upload-item.done .ui-fill { background: var(--success); }
.upload-item.error { border-color: var(--danger); }
.upload-item.error .ui-status { color: var(--danger); }
.upload-item .ui-remove { border: none; background: transparent; color: var(--text-dim); font-size: 17px; line-height: 1; padding: 0 2px; }
.upload-item .ui-remove:hover { color: var(--danger); }

/* ============================== Toast ============================== */
.toast-wrap {
  position: fixed;
  left: 50%; bottom: calc(var(--player-h) + 22px);
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 9px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  max-width: 420px;
  padding: 11px 17px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  color: var(--text);
  animation: toastIn .26s cubic-bezier(.2,.9,.3,1.2);
}
.toast.out { animation: toastOut .22s ease forwards; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.toast.ok::before { background: var(--success); }
.toast.err::before { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ============================== 响应式 ============================== */
@media (max-width: 1040px) {
  .player-inner { grid-template-columns: minmax(0, 1fr) minmax(300px, 1.4fr); }
  .player-right { grid-column: 1 / -1; justify-content: center; padding-top: 2px; }
  :root { --player-h: 148px; }
}

@media (max-width: 900px) {
  .list-head, .track { grid-template-columns: 40px minmax(0, 1fr) 60px 72px; }
  .col-album, .t-album, .col-plays, .t-plays { display: none; }
  .hero-text h1 { font-size: 25px; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .search-box { order: 3; max-width: none; flex-basis: 100%; margin-left: 0; }
  .topbar-actions { margin-left: auto; }
  .page { padding: 18px 14px 30px; }
  .stats { width: 100%; }
  .stat { flex: 1; min-width: 0; padding: 10px 8px; }
  .stat b { font-size: 15px; }
  .stat span { font-size: 10.5px; }
  .hero { margin-bottom: 18px; }

  /* 小屏去掉序号列，把空间让给标题 */
  .list-head, .track { grid-template-columns: minmax(0, 1fr) 46px 78px; gap: 8px; padding: 8px 10px; }
  .t-idx, .col-idx { display: none; }
  .t-cover { width: 42px; height: 42px; }
  .t-main { gap: 10px; }
  .t-title { font-size: 14px; }
  .t-time { font-size: 12px; }
  .t-actions { gap: 0; }
  .t-actions .icon-btn { width: 26px; height: 26px; }

  .player-inner { grid-template-columns: 1fr; padding: 10px 14px 12px; gap: 12px; }
  .now-playing { justify-content: center; }
  .player-right { gap: 10px; }
  :root { --player-h: 196px; }
  .brand-text em { display: none; }
}

@media (max-width: 520px) {
  .admin-badge b { display: none; }
  .queue-drawer { width: 100%; max-width: 100%; }
  .range-sm { max-width: 70px; }
  .modal { max-width: 100%; }
  .field-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 触摸设备：常驻显示操作按钮（无 hover 状态） */
@media (hover: none) {
  .t-actions { opacity: 1; }
  .track:hover { background: transparent; border-color: transparent; box-shadow: none; }
  .track.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
}

/* 打印时隐藏播放器 */
@media print {
  .player, .topbar, .queue-drawer, .drawer-mask { display: none !important; }
}

