/* ==========================================================================
   Page Music Player · base.css
   设计变量 / reset / 布局骨架 / 侧栏 / 通用组件
   纯 CSS，无外部字体与图片依赖。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* 颜色 */
  --bg: #0a0c11;
  --bg-2: #0f1219;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8ecf4;
  --text-dim: rgba(232, 236, 244, 0.62);
  --text-faint: rgba(232, 236, 244, 0.38);
  --accent: #8b6cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 108, 255, 0.14);
  --accent-soft-2: rgba(139, 108, 255, 0.24);
  --accent-ink: #d9ceff;
  --danger: #ff5d73;
  --danger-soft: rgba(255, 93, 115, 0.14);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);

  /* 圆角分级：10 / 14 / 18 / 24 */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* 阴影 / 模糊 */
  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 12px 34px rgba(0, 0, 0, 0.38);
  --shadow-3: 0 28px 80px rgba(0, 0, 0, 0.55);
  --blur: 20px;
  --ring: 0 0 0 3px rgba(139, 108, 255, 0.18);

  /* 尺寸 / 动效 */
  --sidebar-w: 248px;
  --bar-h: 88px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.2s;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
}

/* --------------------------------------------------------------------------
   2. reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 640px at 10% -12%, rgba(139, 108, 255, 0.16), transparent 62%),
    radial-gradient(920px 580px at 106% 2%, rgba(34, 211, 238, 0.1), transparent 60%),
    radial-gradient(760px 520px at 50% 118%, rgba(139, 108, 255, 0.08), transparent 66%);
  background-attachment: fixed;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 细腻网格质感（不是外部图片） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 78%);
  opacity: 0.7;
}

/* 极细噪点层 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  opacity: 0.5;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

input,
textarea,
select {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(139, 108, 255, 0.36);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 自定义滚动条：细、半透明 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.14);
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.26);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* 内联 SVG 图标通用规则（尺寸由 icons.js 的 width/height 决定） */
.icon {
  display: inline-block;
  flex: none;
  vertical-align: middle;
  pointer-events: none;
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   3. 布局骨架
   -------------------------------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* 侧栏 */
.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex: 0 0 var(--sidebar-w);
  flex-direction: column;
  gap: 4px;
  width: var(--sidebar-w);
  height: 100%;
  padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(19, 22, 31, 0.74), rgba(10, 12, 17, 0.9));
  border-right: 1px solid var(--border);
  -webkit-backdrop-filter: blur(22px) saturate(130%);
  backdrop-filter: blur(22px) saturate(130%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 16px;
}

.brand-logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 24px rgba(139, 108, 255, 0.18);
}

.brand-logo svg {
  width: 30px;
  height: 30px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-text span {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

/* 导航 */
.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-item.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139, 108, 255, 0.18), rgba(139, 108, 255, 0.05));
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(139, 108, 255, 0.65);
  transform: translateY(-50%);
}

.nav-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
}

.nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft-2);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.nav-badge:empty {
  display: none;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.source-status {
  padding: 2px 8px 8px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-faint);
}

.side-action {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.side-action:hover {
  color: var(--text);
  background: var(--surface);
}

.side-action > span {
  display: inline-flex;
  align-items: center;
}

.side-hint {
  padding: 6px 10px 0;
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* 主内容区：独立滚动，底部给播放条留白 */
.main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: calc(var(--bar-h) + 28px + env(safe-area-inset-bottom));
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.view {
  min-height: 100%;
}

/* 各路由视图容器（library / local / dav） */
.library-view,
.local-view,
.dav-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.dav-body {
  flex: 1 1 auto;
  min-height: 180px;
}

.view-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(20px, 3.2vw, 38px) clamp(16px, 3vw, 40px) 8px;
}

/* 移动端遮罩（导航） */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  visibility: hidden;
  background: rgba(4, 6, 10, 0.56);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}

body.nav-open .nav-backdrop {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* 移动端导航按钮（main.js 动态插入） */
#nav-toggle {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  z-index: 70;
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 18, 25, 0.74);
  color: var(--text-dim);
  box-shadow: var(--shadow-1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    background var(--dur) var(--ease), color var(--dur) var(--ease);
}

#nav-toggle:hover {
  color: var(--text);
  background: rgba(26, 30, 42, 0.9);
}

body.nav-open #nav-toggle,
body.now-open #nav-toggle {
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. 按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    transform 0.12s var(--ease);
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  transform: none;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, #6f4dff 55%, #5b7cff 100%);
  color: #fff;
  box-shadow:
    0 6px 18px -6px rgba(124, 92, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9a7dff 0%, #7b5bff 55%, #6a8bff 100%);
  border-color: transparent;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  border-color: transparent;
  background: var(--surface);
  color: var(--text);
}

.btn-danger {
  border-color: rgba(255, 93, 115, 0.4);
  background: var(--danger-soft);
  color: #ffb3bd;
}

.btn-danger:hover {
  border-color: rgba(255, 93, 115, 0.6);
  background: rgba(255, 93, 115, 0.22);
}

.btn-sm {
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12px;
}

.btn.is-active {
  border-color: rgba(139, 108, 255, 0.42);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform 0.12s var(--ease);
}

.icon-btn:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn:disabled {
  opacity: 0.4;
}

.icon-btn.danger {
  color: var(--danger);
}

.icon-btn.danger:hover {
  border-color: rgba(255, 93, 115, 0.35);
  background: var(--danger-soft);
  color: #ff8b9c;
}

/* --------------------------------------------------------------------------
   5. 表单
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.field-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.field-input::placeholder {
  color: var(--text-faint);
}

.field-input:hover {
  border-color: var(--border-strong);
}

.field-input:focus {
  outline: none;
  border-color: rgba(139, 108, 255, 0.65);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: var(--ring);
}

.field-hint {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-faint);
}

.field-hint code {
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 2px 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
}

.check-row input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 搜索框 */
.search-box {
  display: flex;
  flex: 1 1 240px;
  align-items: center;
  gap: 8px;
  min-width: 170px;
  max-width: 420px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.26);
  color: var(--text-faint);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.search-box:focus-within {
  border-color: rgba(139, 108, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.14);
  color: var(--text-dim);
}

.search-box .icon {
  flex: none;
}

.search-box input {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-faint);
}

.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-sm {
  flex: 0 1 220px;
  min-width: 140px;
  max-width: 260px;
  height: 30px;
  padding: 0 9px;
}

/* 原生 select 的包裹层（保留自定义外观） */
.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.select-wrap:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 0;
  height: 0;
  border-top: 5px solid var(--text-faint);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  transform: translateY(-38%);
  pointer-events: none;
}

.select-wrap .icon {
  flex: none;
  color: var(--text-faint);
}

.select-wrap select {
  height: 100%;
  max-width: 150px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.select-wrap select option {
  background: #12151d;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   6. 页面头部 / 工具栏
   -------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-sub {
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.55;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 4px 10px;
  font-size: 12px;
}

.list-count {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.list-hint {
  color: var(--text-faint);
}

.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.chip:hover {
  background: var(--surface);
  color: var(--text);
}

.chip.is-active {
  border-color: rgba(139, 108, 255, 0.42);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.chip-count {
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.chip.is-active .chip-count {
  color: rgba(217, 206, 255, 0.75);
}

/* --------------------------------------------------------------------------
   7. 横幅 / 空状态 / 骨架屏
   -------------------------------------------------------------------------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 14px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.55;
}

.banner .icon {
  flex: none;
  margin-top: 1px;
}

.banner-info {
  border-color: rgba(139, 108, 255, 0.28);
  background: rgba(139, 108, 255, 0.1);
  color: #cfc4ff;
}

.banner-info .icon {
  animation: spin 1.1s linear infinite;
}

.banner-success {
  border-color: rgba(52, 211, 153, 0.3);
  background: var(--ok-soft);
  color: #9ef0cf;
}

.banner-error {
  border-color: rgba(255, 93, 115, 0.32);
  background: var(--danger-soft);
  color: #ffb3bd;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(42px, 9vh, 86px) 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 240px at 50% 0%, rgba(139, 108, 255, 0.09), transparent 70%),
    rgba(255, 255, 255, 0.015);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-dim);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.empty-title {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.empty-hint {
  max-width: 430px;
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.7;
}

.empty-extra {
  margin-top: 18px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 40px 44px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.sk {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.11) 50%,
    rgba(255, 255, 255, 0.05) 70%
  );
  background-size: 220% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

.sk-index {
  width: 22px;
  height: 10px;
}

.sk-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.sk-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: none;
  animation: none;
  height: auto;
}

.sk-lines i {
  display: block;
  height: 9px;
  border-radius: 6px;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.11) 50%,
    rgba(255, 255, 255, 0.05) 70%
  );
  background-size: 220% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
}

.sk-lines i:first-child {
  width: 58%;
}

.sk-lines i:last-child {
  width: 38%;
  animation-delay: 0.15s;
}

.sk-time {
  width: 36px;
  height: 10px;
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   8. 弹窗
   -------------------------------------------------------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.62);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: auto;
  transition: opacity 0.18s var(--ease);
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 86vh;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(24, 28, 38, 0.97), rgba(13, 16, 23, 0.99));
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  pointer-events: auto;
  overflow: hidden;
}

.modal-backdrop.is-open .modal {
  opacity: 1;
  transform: none;
}

.modal-sm {
  max-width: 410px;
}

.modal-md {
  max-width: 560px;
}

.modal-lg {
  max-width: 740px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head-text {
  min-width: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  margin-top: 5px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.5;
}

.modal-close {
  flex: none;
  margin: -4px -6px 0 0;
}

.modal-body {
  flex: 1 1 auto;
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
}

.modal-busy {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(139, 108, 255, 0.28);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: #cfc4ff;
  font-size: 12.5px;
  line-height: 1.5;
}

/* 忙碌态：阻止重复提交，但保留视觉结构 */
.modal.is-busy .modal-body {
  pointer-events: none;
  opacity: 0.72;
}

.modal.is-busy .modal-foot .btn {
  pointer-events: none;
  opacity: 0.55;
}

.modal.is-busy .modal-close {
  opacity: 0.4;
}

.spin {
  display: inline-flex;
  flex: none;
  animation: spin 1s linear infinite;
}

.confirm-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.confirm-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 93, 115, 0.3);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: #ff8b9c;
}

.confirm-body p {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   9. toast
   -------------------------------------------------------------------------- */
.toast-root {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(16px + env(safe-area-inset-right));
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(19, 23, 32, 0.94);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  pointer-events: auto;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.toast.is-open {
  opacity: 1;
  transform: none;
}

.toast-icon {
  display: inline-flex;
  flex: none;
  color: var(--accent);
}

.toast-success .toast-icon {
  color: var(--ok);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-text {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  word-break: break-word;
}

.toast-close {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--text-faint);
}

.toast-close:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   10. 封面（渐变占位 + 真实图片）
   -------------------------------------------------------------------------- */
.cover {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: hsl(var(--cover-h, 265), 55%, 40%);
  background-image:
    linear-gradient(
      var(--cover-angle, 135deg),
      hsla(var(--cover-h, 265), 78%, 58%, 1),
      hsla(var(--cover-h2, 190), 82%, 44%, 1)
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.22);
  isolation: isolate;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 26% 20%, rgba(255, 255, 255, 0.34), transparent 52%),
    radial-gradient(circle at 82% 88%, rgba(0, 0, 0, 0.3), transparent 58%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.05) 0 2px,
      transparent 2px 5px
    );
  pointer-events: none;
}

.cover-glyph {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.cover-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-xs {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.cover-sm {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
}

.cover-md {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.cover-lg {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
}

.cover-xl {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
}

.cover-spacer {
  width: 44px;
  height: 44px;
}

/* --------------------------------------------------------------------------
   11. 曲目列表
   -------------------------------------------------------------------------- */
.track-list-wrap {
  min-height: 40px;
}

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

.track-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px 44px minmax(0, 1fr) 160px 60px 56px auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.track-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.track-row.is-active {
  background: linear-gradient(
    90deg,
    rgba(139, 108, 255, 0.16),
    rgba(139, 108, 255, 0.03) 58%,
    transparent
  );
}

.track-row.is-active:hover {
  background: linear-gradient(
    90deg,
    rgba(139, 108, 255, 0.22),
    rgba(139, 108, 255, 0.06) 58%,
    transparent
  );
}

.track-row.is-active::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(139, 108, 255, 0.55);
}

.track-row.is-active .track-title {
  color: var(--accent-ink);
}

/* 序号 / 播放 / EQ 三态 */
.track-index {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.track-row:hover .track-index {
  color: var(--text);
}

.track-row.is-active .track-index {
  color: var(--accent);
}

.track-idx-num {
  display: block;
}

.track-idx-play {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.track-idx-eq {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 15px;
}

.track-idx-eq i {
  display: block;
  width: 2.5px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  transform-origin: bottom center;
  animation: eq-bounce 0.9s ease-in-out infinite;
}

.track-idx-eq i:nth-child(2) {
  animation-delay: 0.18s;
}

.track-idx-eq i:nth-child(3) {
  animation-delay: 0.36s;
}

.track-row:hover .track-idx-num {
  display: none;
}

.track-row:hover .track-idx-play {
  display: grid;
}

.track-row.is-active .track-idx-num {
  display: none;
}

.track-row.is-active .track-idx-play {
  display: grid;
}

.track-row.is-playing .track-idx-play {
  display: none;
}

.track-row.is-playing .track-idx-eq {
  display: flex;
}

.track-main {
  min-width: 0;
}

.track-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lrc-dot {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  height: 15px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.12);
  color: #8ceafb;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1;
}

.track-album {
  min-width: 0;
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-format {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.track-time {
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.track-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  opacity: 0.55;
  transition: opacity var(--dur) var(--ease);
}

@media (hover: hover) {
  .track-row .track-actions {
    opacity: 0;
  }

  .track-row:hover .track-actions,
  .track-row:focus-within .track-actions {
    opacity: 1;
  }
}

.track-actions .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-faint);
}

.track-actions .icon-btn:hover {
  color: var(--text);
}

.track-actions .icon-btn[data-act="remove"]:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.track-act-btn {
  color: var(--text-faint);
}

.track-act-btn:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* 表头行 */
.track-row-head {
  min-height: 34px;
  padding-top: 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: default;
}

.track-row-head:hover,
.track-row-head.is-active {
  background: transparent;
}

.track-row-head::before {
  display: none;
}

.track-row-head .track-index,
.track-row-head .track-album,
.track-row-head .track-format,
.track-row-head .track-time {
  color: var(--text-faint);
  font-size: 10.5px;
}

.track-row-head .track-time {
  text-align: right;
}

/* --------------------------------------------------------------------------
   12. 来源卡片 / 状态点
   -------------------------------------------------------------------------- */
.source-cards {
  margin-bottom: 16px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
  gap: 12px;
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.source-card:hover {
  border-color: rgba(139, 108, 255, 0.35);
  background: linear-gradient(180deg, rgba(139, 108, 255, 0.08), rgba(255, 255, 255, 0.02));
  transform: translateY(-1px);
}

.source-card-top {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.source-card-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(139, 108, 255, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 108, 255, 0.22), rgba(34, 211, 238, 0.12));
  color: #c9bcff;
}

.source-card-main {
  flex: 1;
  min-width: 0;
}

.source-card-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-card-path {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.source-card-meta {
  min-width: 0;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-card-actions {
  display: flex;
  flex: none;
  gap: 2px;
}

.source-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.source-dot.is-ready {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

.source-dot.is-loading {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.18);
  animation: pulse 1.2s ease-in-out infinite;
}

.source-dot.is-error {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 93, 115, 0.16);
}

/* --------------------------------------------------------------------------
   13. 目录分组（音乐库「按目录」）
   -------------------------------------------------------------------------- */
.dir-group {
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.dir-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur) var(--ease);
}

.dir-group-head::-webkit-details-marker {
  display: none;
}

.dir-group-head:hover {
  background: var(--surface);
}

.dir-group[open] > .dir-group-head {
  border-bottom: 1px solid var(--border);
}

.dir-group-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-ink);
}

.dir-group-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-group-source {
  color: var(--text-faint);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-group-count {
  margin-left: auto;
  flex: none;
  color: var(--text-faint);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.dir-play {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.dir-group-list {
  padding: 4px 8px 8px;
}

/* --------------------------------------------------------------------------
   14. WebDAV 视图
   -------------------------------------------------------------------------- */
.dav-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.dav-side {
  position: sticky;
  top: 14px;
  align-self: start;
  max-height: calc(100vh - 210px);
  padding: 10px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.dav-side-head,
.dav-tree-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 8px;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dav-side-head > span,
.dav-tree-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dav-tree-head {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.dav-source-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dav-source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.dav-source-item:hover {
  background: var(--surface);
  color: var(--text);
}

.dav-source-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.source-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-count {
  flex: none;
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dav-empty-tip {
  padding: 10px;
  color: var(--text-faint);
  font-size: 12px;
}

.dav-tree {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tree-group {
  border-radius: 8px;
}

.tree-group > summary {
  border-radius: 7px;
}

.tree-dir-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 7px;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: left;
  list-style: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.tree-dir-row::-webkit-details-marker {
  display: none;
}

.tree-dir-row:hover {
  background: var(--surface);
  color: var(--text);
}

.tree-dir-row.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.tree-root {
  margin-bottom: 5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.tree-dir-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.tree-dir-name > span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-dir-count {
  flex: none;
  color: var(--text-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.tree-children {
  margin: 2px 0 2px 10px;
  padding-left: 8px;
  border-left: 1px dashed rgba(255, 255, 255, 0.1);
}

.tree-leaf {
  display: block;
}

.dav-main {
  min-width: 0;
}

.dav-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  font-size: 12px;
}

.crumb {
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 12px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.crumb:hover {
  background: var(--surface);
  color: var(--text);
}

.crumb.is-current {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.crumb-sep {
  display: inline-flex;
  align-items: center;
  color: var(--text-faint);
}

.dav-main-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.dav-dir-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  min-width: 0;
}

.dav-main-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* 桌面端保持单行：搜索框可收缩，避免「随机播放」按钮被挤到第二行 */
.dav-main-head .dav-main-actions {
  flex-wrap: nowrap;
}

.dav-main-actions .search-sm {
  flex: 0 1 200px;
  min-width: 108px;
}

.dav-track-wrap {
  min-height: 40px;
}

.dir-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.dir-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-dim);
  text-align: left;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform 0.15s var(--ease);
}

.dir-card:hover {
  border-color: rgba(139, 108, 255, 0.35);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-1px);
}

.dir-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 5px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent-ink);
}

.dir-card-name {
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-card-count {
  color: var(--text-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   15. 徽标 / 跳转链接
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.35;
}

.badge-lrc {
  border-color: rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.12);
  color: #8ceafb;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  transform: translateY(-160%);
  transition: transform 0.18s var(--ease);
}

.skip-link:focus {
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   16. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .track-row {
    grid-template-columns: 40px 44px minmax(0, 1fr) 120px 52px 52px auto;
    gap: 10px;
  }
}

@media (max-width: 900px) {
  /* 侧栏变抽屉 */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    width: 278px;
    max-width: 84vw;
    height: 100%;
    padding-top: calc(16px + env(safe-area-inset-top));
    transform: translateX(-103%);
    transition: transform 0.28s var(--ease);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
  }

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

  .sidebar-close {
    display: inline-grid;
  }

  #nav-toggle {
    display: grid;
  }

  .main {
    padding-top: 58px;
  }

  .view-inner {
    padding-top: 10px;
  }

  .dav-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dav-side {
    position: static;
    max-height: 260px;
  }

  /* 曲目列表：收起专辑列 */
  .track-row {
    grid-template-columns: 36px 44px minmax(0, 1fr) 54px auto;
    gap: 10px;
    padding: 6px 9px;
  }

  .track-album {
    display: none;
  }
}

@media (max-width: 640px) {
  .view-inner {
    padding: 10px 14px 8px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1 1 auto;
  }

  .toolbar {
    padding: 9px 10px;
  }

  .search-box {
    flex: 1 1 100%;
    max-width: none;
  }

  .toolbar-right {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .select-wrap {
    flex: 1 1 130px;
  }

  .select-wrap select {
    max-width: 100%;
  }

  .track-row {
    grid-template-columns: 32px 40px minmax(0, 1fr) 46px auto;
    gap: 8px;
    padding: 5px 7px;
    min-height: 52px;
  }

  .cover-sm {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }

  .track-format {
    display: none;
  }

  .track-title {
    font-size: 13px;
  }

  .track-sub {
    font-size: 11px;
  }

  .track-time {
    font-size: 11px;
  }

  .track-actions .icon-btn {
    width: 26px;
    height: 26px;
  }

  .track-row-head {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: 92vh;
  }

  .modal-foot .btn {
    flex: 1 1 auto;
  }

  .toast-root {
    right: 12px;
    left: 12px;
    align-items: stretch;
    max-width: none;
  }

  .source-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dir-cards {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }

  .dav-main-head {
    align-items: flex-start;
  }

  .dav-main-head .dav-main-actions {
    flex-wrap: wrap;
  }

  .dav-main-actions {
    width: 100%;
  }

  .dav-main-actions .search-box {
    flex: 1 1 100%;
    max-width: none;
  }

  .dav-side-head,
  .dav-tree-head {
    font-size: 10px;
  }

  .empty-state {
    padding: 44px 16px;
  }

  .empty-hint {
    font-size: 12px;
  }
}

/* --------------------------------------------------------------------------
   17. 动画
   -------------------------------------------------------------------------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes eq-bounce {
  0%,
  100% {
    transform: scaleY(0.32);
  }
  50% {
    transform: scaleY(1);
  }
}

@keyframes sk-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .main,
  .pp-lyrics {
    scroll-behavior: auto;
  }
}

/* ---------------- WebDAV 来源条目：主按钮 + 编辑/删除操作 ---------------- */
.dav-source-item {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 0;
}

.dav-source-item .dav-source-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.dav-source-item .dav-source-main:hover {
  background: var(--surface);
  color: var(--text);
}

.dav-source-item .dav-source-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.dav-source-item:hover .dav-source-actions,
.dav-source-item:focus-within .dav-source-actions,
.dav-source-item.is-active .dav-source-actions {
  opacity: 1;
}

.dav-source-item .dav-source-actions .icon-btn {
  width: 24px;
  height: 24px;
}

/* 编辑 / 删除单个 WebDAV 连接的小按钮 */
.dav-source-item .dav-source-actions .source-act {
  color: var(--text-faint);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.dav-source-item .dav-source-actions .source-act:hover {
  color: var(--text);
}

.dav-source-item .dav-source-actions .icon-btn.is-danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ---------------- 导航抽屉层级：遮罩已移入 #app，抽屉层整体上移 ---------------- */
body.nav-open .app {
  z-index: 56;
}

/* ---------------- 分享配置 / 导入口令 ---------------- */
.share-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  padding-bottom: 2px;
  border-top: 1px dashed var(--border);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  cursor: pointer;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}

.link-btn:hover {
  color: #c3b2ff;
  border-color: rgba(139, 108, 255, 0.55);
  background: var(--surface-2);
}

.link-btn:active {
  transform: translateY(1px);
}

/* ---------------- 移动端：禁止缩放、阻止下拉刷新、输入框不被放大 ---------------- */
@media (max-width: 900px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
  }

  body {
    overscroll-behavior-y: none;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* 阻止下拉刷新/滚动链：整页不产生 overscroll，内部滚动容器也限制在自身 */
html,
body {
  overscroll-behavior-y: none;
}

.main {
  overscroll-behavior-y: contain;
}

#player-page .pp-inner,
#queue-panel .queue-body {
  overscroll-behavior: contain;
}

