/* =========================================================
   汽水音乐解析 · 薄荷绿清新风
   ========================================================= */

:root {
  /* 主色：薄荷绿 */
  --brand: #10b981;
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --brand-200: #a7f3d0;
  --brand-300: #6ee7b7;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;

  /* 背景与前景 */
  --bg: #f4fbf7;
  --bg-sidebar: #e9f7ef;
  --bg-card: #ffffff;
  --bg-card-hover: #f6fbf8;

  --text: #0f2b21;
  --text-muted: #5c7a6c;
  --text-subtle: #8fa79c;
  --border: #d6ebe0;
  --border-strong: #b7dfc9;

  /* 标签色 */
  --accent: #0ea5e9;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* 形状 */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(16, 185, 129, 0.06), 0 1px 3px rgba(15, 43, 33, 0.04);
  --shadow: 0 6px 18px rgba(16, 185, 129, 0.08), 0 2px 6px rgba(15, 43, 33, 0.04);
  --shadow-lg: 0 20px 50px -20px rgba(16, 185, 129, 0.25), 0 10px 24px -10px rgba(15, 43, 33, 0.08);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(110, 231, 183, 0.35), transparent 60%),
    radial-gradient(1000px 600px at 110% 0%, rgba(52, 211, 153, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #f0faef 100%);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code {
  background: var(--brand-50);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}

/* =========================================================
   布局
   ========================================================= */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  min-height: 100vh;
  gap: 0;
}

/* 侧边栏 */
.sidebar {
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, #f2faf5 100%);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar-section + .sidebar-section { margin-top: 22px; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  padding: 0 8px 8px;
  text-transform: uppercase;
}

.nav-menu { display: flex; flex-direction: column; gap: 4px; }
.nav-secondary .nav-item { opacity: 0.9; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(16, 185, 129, 0.08);
  color: var(--brand-700);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.nav-icon { font-size: 16px; }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 10px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
}
.nav-item:not(.active) .nav-badge {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-100);
}

/* 侧边栏数据统计 */
.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all .15s ease;
}

.stat-item:hover {
  border-color: var(--brand-200);
  box-shadow: 0 2px 8px rgba(16,185,129,.06);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-600);
  font-family: 'SF Mono', 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* 侧边栏卡片 */
.sidebar-card {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.form-row { margin-bottom: 12px; }
.form-row:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-label-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.link-icon { font-size: 13px; opacity: 0.7; }

.form-select,
.url-input,
.cookie-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  transition: all .15s ease;
  outline: none;
}

.form-select:focus,
.url-input:focus,
.cookie-input:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23059669'><path d='M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.24 4.38a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding-right: 32px;
}

/* =========================================================
   主区域
   ========================================================= */
.main {
  padding: 36px 48px 80px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.page-header { margin-bottom: 28px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.page-title {
  font-size: 34px;
  font-weight: 800;
  margin: 10px 0 6px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-title .accent {
  background: linear-gradient(135deg, var(--brand-500), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-subtitle {
  color: var(--text-muted);
  max-width: 680px;
  font-size: 14px;
  margin: 0;
}

/* 面板 */
.panel {
  margin-bottom: 28px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-left: 2px;
}
.panel-number {
  color: var(--brand-500);
  font-weight: 800;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 18px;
  opacity: 0.8;
}
.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  padding-left: 2px;
}
.panel-title::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-300));
}

.panel-dim { opacity: 0.85; }

/* 输入卡片 */
.input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.input-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(110,231,183,0.3) 0%, transparent 70%);
  pointer-events: none;
}

.input-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.hint-dot { flex-shrink: 0; }

.form-row-labeled { margin-bottom: 14px; }

.input-with-sample {
  position: relative;
  display: flex;
  align-items: center;
}

.url-input {
  padding: 12px 14px;
  font-size: 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fafffc);
}

.btn-clear-inline {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--brand-50);
  color: var(--text-subtle);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  transition: all .15s ease;
}
.btn-clear-inline:hover { background: var(--danger); color: #fff; }

.input-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  border: 1px solid transparent;
  user-select: none;
}
.btn-icon { font-size: 15px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-small { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-ghost {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--brand-100);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}
.btn-warning:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.45);
}

.btn-outline {
  background: #fff;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--brand-400);
  color: var(--brand-700);
  background: var(--brand-50);
}

.btn-tab {
  background: var(--brand-50);
  color: var(--text-muted);
  padding: 5px 14px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--brand-100);
}
.btn-tab.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}
.btn-success:hover:not(:disabled) { transform: translateY(-1px); }

/* 状态行 */
.status-row, .error-row {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.status-row {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}
.loader-mini {
  width: 16px;
  height: 16px;
  border: 2px solid var(--brand-200);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-row {
  background: #fef3f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.error-icon { font-size: 16px; }
.error-text { flex: 1; }

/* =========================================================
   解析结果
   ========================================================= */
.info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.info-icon {
  width: 36px; height: 36px;
  background: var(--brand-50);
  color: var(--brand-600);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--brand-100);
}
.info-title { font-weight: 700; color: var(--text); font-size: 13.5px; }
.info-desc { font-size: 12px; color: var(--text-muted); }

/* 歌曲卡 */
.song-card {
  background: linear-gradient(135deg, #ffffff 0%, #f7fdfa 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.song-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(52,211,153,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.song-cover-wrap {
  width: 160px; height: 160px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--brand-50);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15, 43, 33, 0.12);
}

.song-cover {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.song-cover-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--brand-400);
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.song-meta { position: relative; }
.album-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
  font-weight: 500;
}

.song-title {
  font-size: 24px;
  font-weight: 800;
  margin: 2px 0 10px;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.25;
}

.artist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  margin-bottom: 18px;
  font-size: 13.5px;
  flex-wrap: wrap;
}

.avatar-mini {
  width: 22px; height: 22px;
  background: var(--brand-100);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.track-id-chip {
  margin-left: auto;
  background: var(--brand-50);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 8px;
  font-family: 'SF Mono', 'Consolas', monospace;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-copy {
  background: none;
  border: none;
  color: var(--brand-600);
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  opacity: 0.8;
}
.chip-copy:hover { opacity: 1; transform: scale(1.15); }

/* 播放器行 */
.player-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.play-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
  transition: transform .15s ease;
}
.play-circle:hover { transform: scale(1.05); }
.play-circle:active { transform: scale(0.98); }

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.time-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Consolas', monospace;
  min-width: 34px;
  text-align: center;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  border-radius: 999px;
  transition: width 0.1s linear;
}

.quality-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 1px dashed var(--border);
}
.q-pill {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.q-hint { font-size: 12px; color: var(--text-subtle); }

/* 字段网格 */
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.field-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.field-card.highlight {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}
.field-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.field-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  word-break: break-all;
}

/* =========================================================
   音质列表
   ========================================================= */
.quality-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quality-item {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid transparent;
  transition: all .15s ease;
  cursor: pointer;
}
.quality-item:hover {
  border-color: var(--brand-100);
  background: var(--brand-50);
}
.quality-item.active {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 2px var(--brand-100);
}

.q-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  justify-self: flex-start;
}
.q-badge.space {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}
.q-badge.hires {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.q-badge.standard {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
}
.q-badge.higher {
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-200);
}
.q-badge.exhigh {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.q-badge.preview {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.q-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.q-format {
  background: #f1f5f3;
  color: var(--text);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 11.5px;
  font-weight: 600;
}
.q-size { font-variant-numeric: tabular-nums; }

/* 音质列表中的 VIP/HQ 标记 */
.q-badge-vip-mark {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #d4af37, #f5d76e);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.q-badge-hq-mark {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #ff2d55;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.q-btn {
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.q-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15), transparent);
  opacity: 0;
  transition: opacity .2s;
}
.q-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}
.q-btn:hover:not(:disabled)::before { opacity: 1; }
.q-btn:active:not(:disabled) { transform: translateY(0); }
.q-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.q-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.q-btn-text {
  white-space: nowrap;
}
.q-btn.loading {
  pointer-events: none;
  opacity: 0.85;
}
.spinning {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================================================
   歌词
   ========================================================= */
.lyric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow);
}

.lyric-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 10px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 10px;
}
.lyric-right-actions { margin-left: auto; display: flex; gap: 6px; }

.lyric-textarea {
  width: 100%;
  min-height: 260px;
  padding: 14px;
  border: none;
  background: linear-gradient(180deg, #fff, #fafffc);
  color: var(--text);
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.9;
  border-radius: var(--radius);
  resize: vertical;
  outline: none;
  letter-spacing: 0.01em;
}
.lyric-textarea::placeholder { color: var(--text-subtle); }

/* =========================================================
   文档文本
   ========================================================= */
.doc-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--text-muted);
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
}

/* =========================================================
   Toast
   ========================================================= */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--brand-500);
  font-size: 13.5px;
  color: var(--text);
  max-width: 400px;
  animation: toast-in .25s ease;
  pointer-events: auto;
}
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warn); }
.toast.success { border-left-color: var(--brand-500); }
@keyframes toast-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =========================================================
   API分析侧栏（右侧）
   ========================================================= */
.api-sidebar {
  background: linear-gradient(180deg, #f0faf5 0%, #f7fcf9 100%);
  border-left: 1px solid var(--border);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  font-size: 12.5px;
  line-height: 1.7;
}

.api-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.api-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-sidebar-title .dot {
  width: 6px;
  height: 6px;
  background: var(--brand-500);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.api-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}

.api-refresh-btn:hover {
  background: var(--brand-100);
  border-color: var(--brand-300);
}

.api-refresh-btn .refresh-icon {
  width: 14px;
  height: 14px;
}

.api-refresh-btn.loading .refresh-icon {
  animation: spin 0.8s linear infinite;
}

/* API状态条 */
.api-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 12px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}

.status-indicator.online {
  background: var(--brand-500);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-indicator.offline {
  background: var(--danger);
}

.status-indicator.testing {
  background: var(--warn);
  animation: blink 0.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status-text {
  flex: 1;
  color: var(--text-muted);
}

.status-latency {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
  color: var(--brand-700);
  font-weight: 600;
}

.api-section {
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 10px;
}

.api-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-700);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.api-section-title .icon { font-size: 14px; }

.api-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.api-row:last-child { margin-bottom: 0; }

.api-key {
  color: var(--text-subtle);
  min-width: 64px;
  flex-shrink: 0;
  font-weight: 500;
}

.api-val {
  color: var(--text);
  word-break: break-all;
  flex: 1;
}

.param-code {
  display: inline-block;
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  margin: 1px 2px;
}

.api-code-block {
  background: #f0faf5;
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 11px;
  color: var(--brand-700);
  overflow-x: auto;
  margin-top: 8px;
  line-height: 1.5;
}

.api-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

.api-tag-success { background: var(--brand-100); color: var(--brand-700); }
.api-tag-warn { background: #fef3c7; color: #92400e; }
.api-tag-info { background: #e0f2fe; color: #075985; }
.api-tag-danger { background: #fee2e2; color: #991b1b; }

.api-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 8px 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin-top: 8px;
}

.api-note strong { color: #92400e; }

.api-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.api-list li {
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.api-list li:last-child { border-bottom: none; }

.api-list .q-name { color: var(--text); font-weight: 500; }
.api-list .q-desc { color: var(--text-subtle); font-size: 11px; }

.api-endpoint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f0faf5;
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 11px;
  color: var(--brand-700);
  margin-bottom: 8px;
}

.api-endpoint .method {
  background: var(--brand-500);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.api-endpoint .path { flex: 1; word-break: break-all; }

/* Meta grid (状态/超时/格式) */
.api-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.api-meta-item {
  background: #f0faf5;
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}

.api-meta-item .meta-val {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-700);
  font-family: 'SF Mono', Consolas, monospace;
}

.api-meta-item .meta-label {
  display: block;
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Subsection title */
.api-sub-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin: 10px 0 6px;
  padding-left: 2px;
}

/* Compact list */
.api-list-compact li {
  padding: 4px 0;
  font-size: 11.5px;
}

/* Details (可折叠) */
.api-details {
  margin-top: 8px;
}

.api-details summary {
  cursor: pointer;
  font-size: 11px;
  color: var(--brand-600);
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 1px dashed var(--brand-200);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.api-details summary::before {
  content: '▶';
  font-size: 8px;
  transition: transform .15s ease;
}

.api-details[open] summary::before {
  transform: rotate(90deg);
}

.api-details summary:hover {
  color: var(--brand-700);
}

/* Flow diagram */
.api-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 4px;
}

.api-flow-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  background: #f0faf5;
  border: 1px solid var(--brand-100);
  border-radius: 10px;
  font-size: 12px;
  transition: all .15s ease;
}

.api-flow-step:hover {
  background: var(--brand-100);
  border-color: var(--brand-200);
}

.api-flow-step .step-num {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.api-flow-step .step-body {
  flex: 1;
  min-width: 0;
}

.api-flow-step .step-title {
  font-weight: 700;
  color: var(--brand-700);
  font-size: 12px;
  margin-bottom: 2px;
}

.api-flow-step .step-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.flow-arrow {
  text-align: center;
  color: var(--brand-400);
  font-size: 14px;
  line-height: 1;
  margin: 2px 0;
}

/* Danger note */
.api-note.api-note-danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.api-note.api-note-danger strong {
  color: #991b1b;
}

/* =========================================================
   歌单解析
   ========================================================= */

/* 歌单头部 */
.playlist-header {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, var(--brand-50), #fff);
  border-radius: 14px;
  margin-bottom: 20px;
}

.playlist-cover-wrap {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.playlist-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.playlist-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.playlist-owner {
  font-size: 14px;
  color: var(--text-secondary);
}

.playlist-stats {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.stat-item {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-item strong {
  color: var(--brand-600);
  font-weight: 700;
}

/* 歌曲列表 */
.playlist-tracks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-item {
  display: grid;
  grid-template-columns: 36px 48px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.track-item:hover {
  background: var(--brand-50);
  border-color: var(--brand-100);
}

.track-item.playing {
  background: var(--brand-50);
  border-color: var(--brand-300);
}

.track-index {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-align: center;
  font-family: 'SF Mono', Consolas, monospace;
}

.track-item.playing .track-index {
  color: var(--brand-600);
}

.track-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

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

.track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.track-duration {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', Consolas, monospace;
  white-space: nowrap;
}

.track-actions {
  display: flex;
  gap: 6px;
}

.track-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.track-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-600);
}

.track-btn.loading {
  pointer-events: none;
  opacity: 0.5;
}

.track-btn.playing {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

/* 视图切换 */
.view-section {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   移动端顶栏 & 侧边栏抽屉
   ========================================================= */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 900;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(244, 251, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--brand-700);
  cursor: pointer;
  transition: all .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:active { background: var(--brand-50); }

.mobile-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.mobile-header-spacer { flex: 1; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 940;
  background: rgba(15, 43, 33, 0.45);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1100px) {
  .app-layout { grid-template-columns: 240px 1fr; }
  .api-sidebar { display: none; }
  .main { padding: 28px 28px 60px; }
  .song-card { grid-template-columns: 140px 1fr; }
  .song-cover-wrap { width: 140px; height: 140px; }
}

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main { padding: 24px 18px 48px; }
  .page-title { font-size: 26px; }
  .song-card { grid-template-columns: 1fr; }
  .song-cover-wrap { width: 100%; max-width: 200px; height: 200px; margin: 0 auto; }
  .field-grid { grid-template-columns: 1fr; }
  .quality-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .player-row { flex-wrap: wrap; }
  .quality-tag {
    border-left: none;
    border-top: 1px dashed var(--border);
    padding-left: 0;
    padding-top: 8px;
    width: 100%;
  }
  .sidebar-card { display: none; }
}

/* =========================================================
   移动端（< 768px）
   ========================================================= */
@media (max-width: 768px) {
  html, body {
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
  }

  /* 顶栏 + 抽屉菜单 */
  .mobile-header { display: flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 264px;
    height: 100vh;
    z-index: 950;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.22,1,.36,1);
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 30px rgba(15,43,33,.10);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }

  .main { padding: 16px 14px 80px; }

  /* 页头 */
  .page-header { margin-bottom: 20px; }
  .page-title { font-size: 22px; }
  .page-subtitle { font-size: 13px; }

  /* 面板与输入 */
  .panel { padding: 14px; }
  .input-hint { font-size: 12px; }
  .form-row { gap: 8px; }
  .url-input {
    font-size: 16px; /* 防止 iOS 聚焦自动缩放 */
    padding: 12px 12px;
    min-height: 46px;
  }
  .input-actions { flex-wrap: wrap; }
  .input-actions .btn {
    flex: 1;
    min-width: 120px;
    min-height: 44px;
    justify-content: center;
  }

  /* 按钮通用点击区域 */
  .btn { min-height: 40px; }

  /* 歌曲卡片 */
  .song-card { gap: 14px; padding: 14px; }
  .song-title { font-size: 18px; }
  .artist-row { flex-wrap: wrap; gap: 6px; }

  /* 播放器 */
  .player-row { flex-wrap: wrap; gap: 10px; }
  .progress-wrap { flex: 1 1 100%; order: 3; }
  .quality-tag {
    border: none;
    padding: 0;
    width: auto;
    flex: 1 1 auto;
    order: 4;
  }
  .play-circle { width: 44px; height: 44px; }

  /* 字段卡 */
  .field-grid { gap: 8px; }
  .field-card { padding: 10px 12px; }

  /* 歌单/专辑头部 */
  .playlist-header {
    flex-direction: row;
    gap: 14px;
    padding: 14px;
  }
  .playlist-cover-wrap { width: 96px; height: 96px; }
  .playlist-title { font-size: 16px; }
  .playlist-owner { font-size: 12px; }
  .playlist-stats { flex-wrap: wrap; gap: 8px; }
  .playlist-stats .btn { min-height: 36px; }

  /* 歌曲列表 - 紧凑布局 */
  .track-item {
    grid-template-columns: 38px 1fr auto;
    gap: 10px;
    padding: 8px 10px;
  }
  .track-index { display: none; }
  .track-cover { width: 38px; height: 38px; border-radius: 8px; }
  .track-title { font-size: 13px; line-height: 1.3; }
  .track-artist { font-size: 11px; }
  .track-duration { display: none; }
  .track-actions { gap: 2px; }
  .track-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  /* 歌词 */
  .lyric-textarea { font-size: 13px; min-height: 200px; }

  /* 音质列表 */
  .quality-item { padding: 10px 12px; }

  /* 下载器 */
  .dl-task-item { padding: 12px; }
  .dl-cart-actions { flex-wrap: wrap; }
  .dl-cart-actions .btn { flex: 1; min-width: 130px; }
  /* 购物车列表项 - 触摸优化 */
  .dl-cart-list { max-height: none; gap: 6px; }
  .dl-cart-item { padding: 10px 12px; gap: 10px; }
  .cart-cover { width: 40px; height: 40px; border-radius: 8px; }
  .cart-remove { width: 36px; height: 36px; font-size: 14px; }
  .cart-title { font-size: 14px; }
  .cart-artist { font-size: 12px; }
  .dl-cart-actions { margin-top: 12px; }
  .dl-cart-actions .btn { min-height: 44px; }
  .modal-card {
    width: calc(100vw - 32px);
    max-height: 80vh;
    margin: 0;
  }
  .dl-task-item .dl-task-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 短链结果 */
  .shortlink-row { flex-wrap: wrap; }
  .shortlink-input { min-height: 42px; font-size: 13px; }
  .shortlink-row .btn { min-height: 42px; }

  /* Toast */
  .toast { min-width: 200px; max-width: 85vw; }
}

/* ============================================================
   下载器
   ============================================================ */
.dl-task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dl-task-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  transition: box-shadow .15s;
}
.dl-task-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.dl-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dl-task-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
}

.dl-task-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.dl-status-pending {
  background: #fef3c7;
  color: #92400e;
}
.dl-status-done {
  background: #d1fae5;
  color: #065f46;
}

.dl-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
}

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

.dl-pending-text {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
}

.dl-empty {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 14px;
}

/* 下载器弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay[style*="flex"] {
  display: flex !important;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #1e293b;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover {
  color: #475569;
}

.modal-body {
  padding: 16px 20px;
}

.dl-detail-section {
  margin-bottom: 16px;
}
.dl-detail-section h4 {
  font-size: 14px;
  color: #1e293b;
  margin: 0 0 8px;
}

.dl-detail-row {
  font-size: 13px;
  color: #475569;
  padding: 4px 0;
}
.dl-detail-row a {
  color: #6366f1;
  word-break: break-all;
}

.dl-detail-songs {
  max-height: 300px;
  overflow-y: auto;
}

.dl-detail-song {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.dl-detail-song:last-child {
  border-bottom: none;
}

.dl-detail-song-index {
  width: 24px;
  text-align: right;
  color: #94a3b8;
  font-size: 11px;
  flex-shrink: 0;
}

.dl-detail-song-info {
  flex: 1;
  color: #334155;
}

.dl-detail-song-album {
  color: #94a3b8;
  font-size: 11px;
  flex-shrink: 0;
}

/* 提交下载按钮（track-item内） */
.track-btn-submit {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.track-btn-submit:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

/* 面板徽章 */
.panel-badge {
  font-size: 12px;
  color: #94a3b8;
  margin-left: auto;
}

/* ============================================================
   购物篮（打包列表）
   ============================================================ */
.dl-cart-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.dl-cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background .15s;
}
.dl-cart-item:hover {
  background: var(--brand-50);
}

.cart-idx {
  width: 24px;
  text-align: right;
  font-size: 12px;
  color: #94a3b8;
  font-family: 'SF Mono', Consolas, monospace;
  flex-shrink: 0;
}

.cart-cover {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-info {
  flex: 1;
  min-width: 0;
}

.cart-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-artist {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cart-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}

.dl-cart-empty {
  /* empty state */
}

.dl-cart-actions {
  /* action buttons */
}

/* ============================================================
   VIP / HQ 徽章
   ============================================================ */
.song-badges {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  vertical-align: middle;
}
.badge-vip-pill {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #d4af37, #f5d76e);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.badge-hq-pill {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #ff2d55;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

/* 歌单/专辑列表中的徽章 */
.track-badges-inline {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.track-badge-vip {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #d4af37, #f5d76e);
  padding: 1px 5px;
  border-radius: 3px;
}
.track-badge-hq {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #ff2d55;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ============================================================
   短链生成结果
   ============================================================ */
.shortlink-result {
  margin-top: 10px;
}
.shortlink-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.shortlink-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: all .15s ease;
}
.shortlink-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
