/* ========================================
   Dusk Radio — 深色日落风样式表 v2
   视觉方向：黑胶唱片质感 + 日落渐变
   色系: 金 #c9a66b / 橙 #e8875c / 粉 #d4637a / 紫 #7b5ea7
   背景: #0c0c14 / 卡片: #14141f / 文字: #e2ddd2
   ======================================== */

/* ---- 设计令牌 ---- */
:root {
  --gold: #c9a66b;
  --warm-orange: #e8875c;
  --sunset-pink: #d4637a;
  --dusk-purple: #7b5ea7;
  --deep-bg: #0c0c14;
  --card-bg: #14141f;
  --card-bg-alpha: rgba(20, 20, 31, 0.65);
  --text: #e2ddd2;
  --text-dim: rgba(226, 221, 210, 0.6);
  --text-muted: rgba(226, 221, 210, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-gold: rgba(201, 166, 107, 0.15);
  --glass-blur: blur(24px);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(201, 166, 107, 0.12);
  --tab-height: 56px;
}

/* ---- 全局重置 ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  background: #0c0c14;
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 1.6;
  position: relative;
}

/* Three.js 流体背景画布 — 全屏底层，鼠标穿透 */
#fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* 流体降级兜底：WebGL 不可用时使用静态渐变 */
body.fluid-fallback::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(123, 94, 167, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(212, 99, 122, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a14 0%, #0c0c14 50%, #0a0a14 100%);
  z-index: 0;
}

/* 有流体时隐藏旧渐变（body::before 不再需要，由 canvas 接管） */

/* ========================================
   悬浮玻璃卡片主容器
   ======================================== */
.app-container {
  width: 100%;
  max-width: 720px;
  height: 100vh;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  border-radius: 24px 24px 18px 18px;
  background: rgba(16, 16, 26, 0.45);
  backdrop-filter: blur(32px) saturate(1.3);
  -webkit-backdrop-filter: blur(32px) saturate(1.3);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(201, 166, 107, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    inset 0 0 0 1px rgba(201, 166, 107, 0.05);
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: background 0.6s ease;
}
/* 空闲状态：高度透明，让流体背景透过来 */
.app-container:not(.is-playing) {
  background: rgba(16, 16, 26, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* 噪点纹理叠加 — 已禁用，避免遮挡透明背景 */
/* body::after { ... } */

/* ========================================
   空闲状态：智能音箱时钟
   ======================================== */
.idle-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  cursor: pointer;
  user-select: none;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-container.is-playing .idle-view {
  opacity: 0;
  transform: translateY(-30px) scale(0.95);
  pointer-events: none;
  position: absolute;
  inset: 0;
}
.app-container:not(.is-playing) .idle-view {
  flex: 1;
}
.app-container:not(.is-playing) #player-section,
.app-container:not(.is-playing) .queue-section,
.app-container:not(.is-playing) .chat-section,
.app-container:not(.is-playing) .input-bar {
  display: none;
}

/* 歌曲 Tab 激活时：隐藏空闲视图和播放器，显示歌曲列表 + 队列 + 对话 */
.app-container.show-songs .idle-view,
.app-container.show-songs #player-section {
  display: none !important;
}
.app-container.show-songs .queue-section,
.app-container.show-songs .chat-section,
.app-container.show-songs .input-bar {
  display: flex !important;
}
.app-container.show-songs .songs-view {
  display: flex !important;
}

/* 问候语 */
.greeting {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 24px;
  letter-spacing: 1px;
}
.greeting .emoji { font-size: 1.1rem; }

/* 时钟 */
.clock-display {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 5.5rem;
  font-weight: 700;
  letter-spacing: 10px;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--gold);
  text-shadow:
    0 0 10px rgba(201, 166, 107, 0.5),
    0 0 30px rgba(201, 166, 107, 0.2),
    0 0 60px rgba(201, 166, 107, 0.08);
}

/* 日期 */
.date-display {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 32px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* 天气卡片 */
.weather-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px 24px;
  margin-bottom: 24px;
}
.weather-icon { font-size: 2rem; }
.weather-text { font-size: 0.85rem; color: var(--text-dim); }
.weather-temp { font-size: 1.1rem; color: var(--text); font-weight: 500; }

/* 播放提示按钮 */
.idle-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: 1px solid rgba(201,166,107,0.15);
  border-radius: 24px;
  background: rgba(201,166,107,0.05);
  transition: all 0.3s;
  cursor: pointer;
}
.idle-hint:hover {
  color: var(--gold);
  background: rgba(201,166,107,0.1);
  border-color: rgba(201,166,107,0.3);
}
.idle-hint i { font-size: 1.2rem; }

/* ON AIR 指示器（播放器左上角，仅播放状态显示） */
.on-air {
  position: absolute;
  top: 16px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: #4ade80;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.app-container.is-playing .on-air { opacity: 1; }
.on-air-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: on-air-pulse 2s ease-in-out infinite;
}
@keyframes on-air-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(74, 222, 128, 0.5); }
  50% { opacity: 0.5; box-shadow: 0 0 12px rgba(74, 222, 128, 0.3); }
}

/* 返回按钮 */
.back-to-idle {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  z-index: 15;
}
.back-to-idle:hover { color: var(--gold); }
.app-container.is-playing .back-to-idle { opacity: 1; }

/* 缩小时钟 — 已移除 */

.hidden { display: none !important; }

/* Focus 状态 — 无障碍 */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

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

/* ---- 动画定义 ---- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}
@keyframes cover-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(201, 166, 107, 0.35); }
  70%  { box-shadow: 0 0 0 20px rgba(201, 166, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 166, 107, 0); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 4px 24px rgba(201, 166, 107, 0.25),
                0 0 0 0 rgba(201, 166, 107, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 40px rgba(201, 166, 107, 0.45),
                0 0 30px rgba(201, 166, 107, 0.12);
    transform: scale(1.04);
  }
}
@keyframes cover-glow {
  0%, 100% {
    box-shadow:
      0 10px 32px rgba(0, 0, 0, 0.5),
      0 0 48px rgba(201, 166, 107, 0.10),
      0 0 80px rgba(201, 166, 107, 0.05),
      0 0 0 1px rgba(201, 166, 107, 0.1);
  }
  50% {
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.45),
      0 0 64px rgba(201, 166, 107, 0.18),
      0 0 110px rgba(201, 166, 107, 0.08),
      0 0 0 1px rgba(201, 166, 107, 0.18);
  }
}
@keyframes dot-breathe {
  0%, 100% {
    box-shadow:
      0 0 6px rgba(201, 166, 107, 0.5),
      0 0 16px rgba(201, 166, 107, 0.2);
  }
  50% {
    box-shadow:
      0 0 12px rgba(201, 166, 107, 0.8),
      0 0 28px rgba(201, 166, 107, 0.35);
  }
}

/* ========================================
   播放器区域 — 暖金柔光优化
   ======================================== */
.player-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px 14px;
  position: relative;
  animation: fade-up 0.7s ease;
}
/* 播放器暖金内嵌柔光 */
.player-section::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  height: 420px;
  background: radial-gradient(circle,
    rgba(212,99,122,0.12) 0%,
    rgba(232,135,92,0.08) 30%,
    rgba(201,166,107,0.04) 55%,
    transparent 70%);
  pointer-events: none;
}

/* ========================================
   音频律动可视化 — 封面两侧细线频谱（延伸至边界）
   ======================================== */
.visualizer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}
.viz-canvas-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.cover-area {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  z-index: 1;
}
.cover-area .cover-skeleton,
.cover-area .cover-img {
  position: absolute;
  top: 0; left: 0;
}

/* 封面骨架屏 */
.cover-skeleton {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(232,135,92,0.12), rgba(212,99,122,0.08));
  animation: skeleton-pulse 2.5s ease-in-out infinite;
}

/* 封面图片 — 增强发光 */
.cover-img {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.5),
    0 0 48px rgba(201, 166, 107, 0.10),
    0 0 80px rgba(201, 166, 107, 0.05),
    0 0 0 1px rgba(201, 166, 107, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
}
.cover-img.playing {
  animation: cover-breathe 5s ease-in-out infinite, pulse-ring 2.5s ease-in-out infinite, cover-glow 4s ease-in-out infinite;
}

/* 封面外层光晕环（黑胶装饰） */
.cover-img::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px dashed rgba(201, 166, 107, 0.08);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.cover-img.playing::after { opacity: 1; }

/* 歌曲信息 */
.player-info { text-align: center; margin-top: 10px; }
.song-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.8px;
  text-shadow: 0 0 20px rgba(201, 166, 107, 0.15);
}
.song-artist {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 3px;
  font-weight: 300;
  letter-spacing: 0.5px;
}
.song-album { font-size: 0.72rem; color: var(--text-muted); }

/* ---- 进度条 ---- */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 8px;
}
.time {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: 4px;
  cursor: pointer;
  transition: height 0.2s ease;
  position: relative;
}
.progress-track:hover { height: 8px; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--warm-orange));
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s linear;
  position: relative;
  box-shadow: 0 0 6px rgba(201, 166, 107, 0.25);
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 0 8px rgba(201, 166, 107, 0.5);
}
.progress-track:hover .progress-fill::after {
  transform: translateY(-50%) scale(1);
}

/* ---- 控制按钮 ---- */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  position: relative;
  width: 100%;
  max-width: 320px;
}
.controls-left {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
}
.controls-center {
  display: flex;
  align-items: center;
  gap: 16px;
}
.controls-right {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ctrl-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.15s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.ctrl-btn:hover  { opacity: 1; background: rgba(255,255,255,0.04); }
.ctrl-btn:active { transform: scale(0.88); }

/* 播放键 */
.ctrl-play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--warm-orange));
  color: var(--deep-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 1;
  box-shadow: 0 4px 20px rgba(201, 166, 107, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ctrl-play:hover  { box-shadow: 0 6px 32px rgba(201, 166, 107, 0.45); }
.ctrl-play:active { transform: scale(0.88); }
.ctrl-play.playing {
  animation: glow-pulse 3s ease-in-out infinite;
  transition: none;
}

/* 模式按钮 */
.ctrl-mode {
  width: 44px;
  height: 44px;
  font-size: 1.35rem;
  opacity: 0.5;
  position: relative;
}
.ctrl-mode:hover { opacity: 0.85; }
.mode-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mode-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  color: #0c0c14;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}
.mode-label {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  pointer-events: none;
}

/* 自定义 tooltip — 替代浏览器默认 title 浮窗 */
.ctrl-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: rgba(20, 20, 31, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 166, 107, 0.15);
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.ctrl-btn[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* 音量控制 */
.volume-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.volume-icon { font-size: 0.8rem; opacity: 0.35; color: var(--text); }
.volume-slider {
  width: 60px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(201, 166, 107, 0.4);
}

/* ========================================
   队列区域 — 深紫渐变底色 + 呼吸指示灯
   ======================================== */
.queue-section {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg,
      rgba(123, 94, 167, 0.08) 0%,
      rgba(90, 70, 130, 0.05) 50%,
      transparent 100%);
}
.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
}
.queue-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.queue-count {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* 队列列表 — 固定高度 2 首歌，始终展开可滚动 */
.queue-list {
  height: 85px;
  overflow-y: auto;
  padding: 0 20px 8px;
}

/* 队列项 — 圆点指示器风格 */
.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, background 0.2s;
  border-radius: var(--radius-sm);
}
.queue-item:hover { opacity: 0.9; background: rgba(255,255,255,0.03); }
.queue-item.active {
  opacity: 1;
  background: rgba(201, 166, 107, 0.06);
}

/* 播放状态圆点指示器 — 呼吸发光 */
.queue-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s, box-shadow 0.2s;
}
.queue-item.active .queue-dot {
  background: var(--gold);
  box-shadow:
    0 0 8px rgba(201, 166, 107, 0.6),
    0 0 20px rgba(201, 166, 107, 0.25);
  animation: dot-breathe 2s ease-in-out infinite;
}
.queue-item-info { flex: 1; min-width: 0; }
.queue-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}
.queue-item.active .queue-item-title { color: var(--gold); font-weight: 500; }
.queue-item-artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-remove {
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  cursor: pointer;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.queue-item:hover .queue-remove { opacity: 0.4; }
.queue-item:hover .queue-remove:hover { opacity: 1; color: var(--sunset-pink); }

/* ========================================
   对话区域 — 黄昏渐变底色 + 胶片噪点
   ======================================== */
.chat-section {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  min-height: 0;
  background:
    linear-gradient(180deg,
      rgba(232,135,92,0.04) 0%,
      rgba(212,99,122,0.03) 30%,
      rgba(123,94,167,0.05) 70%,
      rgba(123,94,167,0.03) 100%);
  position: relative;
}
/* 聊天区极低密度胶片噪点 */
.chat-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(rgba(255,255,255,0.008) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px;
  pointer-events: none;
  border-radius: inherit;
}
.msg {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.msg > div:not(.msg-avatar) {
  min-width: 0;
  max-width: 80%;
}
.msg-ai  { flex-direction: row; }
.msg-user {
  flex-direction: row-reverse;
  animation: slide-in-right 0.3s ease;
}
.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(201, 166, 107, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  line-height: 1.6;
  word-break: normal;
  overflow-wrap: break-word;
  position: relative;
}
.msg-ai .msg-bubble {
  background: rgba(35, 28, 45, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(123, 94, 167, 0.12);
  color: var(--text);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.25),
    0 0 20px rgba(123, 94, 167, 0.05);
}
.msg-user .msg-bubble {
  background: linear-gradient(135deg,
    rgba(201,166,107,0.22) 0%,
    rgba(232,135,92,0.14) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(201, 166, 107, 0.15);
  color: var(--text);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.2),
    0 0 24px rgba(201, 166, 107, 0.08);
}
.msg-time {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.msg-user .msg-time { text-align: right; }

/* ========================================
   输入栏 — 提亮底色 + 聚焦高光
   ======================================== */
.input-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(16, 16, 26, 0.5);
}
/* AI 推荐范围按钮 */
.scope-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(201, 166, 107, 0.08);
  border: 1px solid rgba(201, 166, 107, 0.15);
  border-radius: 16px;
  padding: 5px 10px;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}
.scope-btn:hover {
  background: rgba(201, 166, 107, 0.15);
  color: var(--gold);
}
.scope-btn i { font-size: 0.75rem; }
#chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 166, 107, 0.12);
  border-radius: var(--radius-lg);
  padding: 9px 16px;
  color: var(--text);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
#chat-input:focus {
  border-color: rgba(201, 166, 107, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 3px rgba(201, 166, 107, 0.1),
    0 0 20px rgba(201, 166, 107, 0.08);
}
#chat-input::placeholder { color: var(--text-muted); }
.btn-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--warm-orange));
  border: none;
  color: var(--deep-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(201, 166, 107, 0.2);
}
.btn-send:hover { box-shadow: 0 4px 20px rgba(201, 166, 107, 0.35); }
.btn-send:active { transform: scale(0.88); }

/* ========================================
   底部 Tab 导航 — 选中发光增强
   ======================================== */
.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--tab-height);
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(201, 166, 107, 0.1);
  flex-shrink: 0;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 16px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, color 0.2s, text-shadow 0.2s;
  color: var(--text);
  text-decoration: none;
  border: none;
  background: none;
  font-size: 0.65rem;
  position: relative;
}
.tab-item i { font-size: 1.1rem; }
.tab-item:hover { opacity: 0.8; }
.tab-item.active {
  opacity: 1;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(201, 166, 107, 0.4);
}
.tab-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2.5px;
  background: linear-gradient(90deg, var(--gold), var(--warm-orange));
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(201, 166, 107, 0.3);
}

/* ========================================
   WebSocket 状态提示
   ======================================== */
.ws-status {
  position: fixed;
  bottom: calc(var(--tab-height) + 12px);
  right: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}
.ws-reconnect {
  background: var(--gold);
  color: var(--deep-bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.ws-reconnect:hover { opacity: 0.85; }

/* 断连状态 */
body.disconnected .input-bar {
  opacity: 0.3;
  pointer-events: none;
}
body.disconnected::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--sunset-pink), var(--warm-orange));
  z-index: 1000;
}

/* ========================================
   歌曲浏览视图
   ======================================== */
.songs-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.songs-header {
  padding: 12px 16px 8px;
  flex-shrink: 0;
}
.songs-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 166, 107, 0.12);
  border-radius: var(--radius-lg);
  padding: 0 14px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.songs-search-bar:focus-within {
  border-color: rgba(201, 166, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(201, 166, 107, 0.1);
}
.songs-search-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.songs-search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.84rem;
  padding: 9px 0;
  outline: none;
}
.songs-search-bar input::placeholder { color: var(--text-muted); }
.songs-scope-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 166, 107, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}
.songs-scope-select option {
  background: #1a1a28;
  color: #e2ddd2;
}

/* 歌曲列表 */
.songs-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 8px;
}
.songs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 0.84rem;
  gap: 12px;
}
.songs-empty i { font-size: 2rem; opacity: 0.3; }

/* 歌曲项 */
.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.song-item:hover { background: rgba(255, 255, 255, 0.04); }
.song-item.active {
  background: rgba(201, 166, 107, 0.06);
}
.song-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--gold);
}
.song-item-cover {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}
.song-item-info {
  flex: 1;
  min-width: 0;
}
.song-item-title {
  font-size: 0.84rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.song-item.active .song-item-title {
  color: var(--gold);
  font-weight: 500;
}
.song-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.song-item-source {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.5;
}
.song-item-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(201, 166, 107, 0.15);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(201, 166, 107, 0.3); }
