/* ============================================
 * 佛心 AI 综合站 — 配色和原佛心 AI 一致
 * 主色:#1677FF  背景:#FFFFFF  气泡:#F0F2F5
 * 严格规范:全站无外露滚动条 / 顶栏 60px / 圆角统一
 * ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }

:root {
  --primary: #1677FF;
  --primary-hover: #4096FF;
  --primary-active: #0958D9;
  --primary-bg: rgba(22, 119, 255, 0.08);
  --primary-bg-strong: rgba(22, 119, 255, 0.14);
  --bg: #FFFFFF;
  --bg-sidebar: #FAFAFA;
  --bg-hover: #F0F2F5;
  --bg-card: #FFFFFF;
  --bg-bubble-ai: #F0F2F5;
  --bg-bubble-user: #1677FF;
  --text: #1A1A1A;
  --text-2: #595959;
  --text-3: #8C8C8C;
  --text-4: #BFBFBF;
  --border: #F0F0F0;
  --border-strong: #E5E5E5;
  --error: #FF4D4F;
  --success: #52C41A;
  --warning: #FAAD14;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --composer-h: 72px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea { font-family: inherit; }

/* 通用 */
.hidden { display: none !important; }
.flex { display: flex; }
.f1 { flex: 1; min-width: 0; }
.center { display: flex; align-items: center; justify-content: center; }

/* AI 头像(纯 CSS,不用 emoji) */
.avatar-ai {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #1677FF 0%, #4096FF 100%);
  color: white; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 6px rgba(22,119,255,.25);
  letter-spacing: -0.5px;
}
.avatar-user {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* 布局:左侧栏 + 主区 */
.app { display: flex; height: 100vh; width: 100vw; }

/* ============== 左侧栏 ============== */
.sidebar {
  width: 10vw;             /* PC 默认展开 = 屏幕宽度 1/10 */
  min-width: 140px;
  max-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0; position: relative;
  height: 100vh;
  transition: width .2s;
}
.sidebar.collapsed { width: 60px; min-width: 60px; max-width: 60px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item .lbl,
.sidebar.collapsed .conv-section,
.sidebar.collapsed .user-info .user-name,
.sidebar.collapsed .user-info .user-action { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .brand { padding: 0; justify-content: center; }
.sidebar.collapsed .user-info { justify-content: center; padding: 10px 0; }
.brand { cursor: pointer; user-select: none; }
.brand:hover { background: var(--bg-hover); }
.brand {
  height: var(--topbar-h);
  padding: 0 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sidebar);
  flex-shrink: 0;
}
.brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #1677FF 0%, #4096FF 100%);
  color: white; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.5px;
}
.brand-text { font-size: 16px; font-weight: 600; color: var(--text); }

/* 菜单 */
.nav { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px;
  cursor: pointer; transition: all .15s;
  background: transparent; border: none; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.nav-item .icon { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }

/* 对话列表 */
.conv-section {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 16px 12px 80px;  /* 底部 80px 给用户信息让位置 */
  overflow: hidden;
}
.conv-section.hidden { display: none; }
.conv-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 8px 8px;
  font-size: 12px; color: var(--text-3); font-weight: 500;
}
.conv-header .icon-btn {
  width: 22px; height: 22px;
  border: none; background: transparent;
  border-radius: 4px; cursor: pointer;
  color: var(--text-3); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.conv-header .icon-btn:hover { background: var(--bg-hover); color: var(--primary); }
.conv-list { flex: 1; overflow-y: auto; padding-right: 4px; }
.conv-empty { padding: 20px 8px; text-align: center; color: var(--text-4); font-size: 12px; }
.conv-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px;
  color: var(--text-2); transition: all .15s;
  margin-bottom: 1px;
}
.conv-item:hover { background: var(--bg-hover); color: var(--text); }
.conv-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.conv-item .conv-title {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item .conv-del {
  opacity: 0; width: 18px; height: 18px;
  border: none; background: transparent; border-radius: 4px;
  cursor: pointer; color: var(--text-3); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.conv-item:hover .conv-del { opacity: 1; }
.conv-item .conv-del:hover { background: var(--error); color: white; }

/* 用户信息(钉在左下角) */
.user-info {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
  background: transparent; z-index: 10;
}
.user-info:hover { background: var(--bg-hover); }
.user-info .avatar { width: 32px; height: 32px; flex-shrink: 0; }
.user-info .user-name { flex: 1; font-size: 13px; color: var(--text); font-weight: 500; }
.user-info .user-action { font-size: 16px; color: var(--text-3); }

/* ============== 主区 ============== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

/* 顶栏(60px,跟左栏 brand 高度一致) */
.topbar {
  height: var(--topbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 5;
}
.topbar .title {
  font-size: 16px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.topbar .title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.topbar .spacer { flex: 1; }

.model-pick {
  height: 36px; padding: 0 32px 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px; color: var(--text);
  cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1L5 5L9 1' stroke='%238C8C8C' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color .15s;
}
.model-pick:hover, .model-pick:focus { border-color: var(--primary); }

/* 顶栏右上模型信息(脱敏后只显示内部名) */
.model-info {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--primary-bg);
  border-radius: 20px;
  font-size: 12px; color: var(--primary);
  cursor: default; user-select: none;
}
.model-info .model-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
  animation: pulse 2s infinite;
}

.icon-btn {
  width: 36px; height: 36px;
  border: none; background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--primary); }

/* 移动端菜单按钮 */
.menu-btn {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 200;
  width: 40px; height: 40px;
  background: white; border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer; font-size: 18px;
  align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* ============== AI 聊天 ============== */
.mode { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.mode.hidden { display: none; }

/* 消息流 */
.messages {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 24px 20px 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.msg { display: flex; gap: 12px; max-width: 820px; width: 100%; margin: 0 auto; }
.msg.user { flex-direction: row-reverse; }

.msg-body { display: flex; flex-direction: column; max-width: calc(100% - 56px); }
.msg.user .msg-body { align-items: flex-end; }
.msg.assistant .msg-body { align-items: flex-start; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px; line-height: 1.65;
  word-break: break-word; white-space: pre-wrap;
  max-width: 100%;
}
.msg.assistant .msg-bubble { background: var(--bg-bubble-ai); color: var(--text); }
.msg.user .msg-bubble { background: var(--primary); color: white; }

.msg-actions { display: flex; gap: 4px; margin-top: 4px; padding: 0 4px; }
.msg-action {
  border: none; background: transparent;
  font-size: 13px; color: var(--text-3);
  cursor: pointer; padding: 4px 8px; border-radius: 4px;
  display: flex; align-items: center; gap: 4px;
  transition: all .15s;
}
.msg-action:hover { background: var(--bg-hover); color: var(--primary); }
.msg-action.tts-loading { color: var(--warning); pointer-events: none; }
.msg-action.tts-error { color: var(--error); }

.empty-tip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-3); text-align: center; gap: 8px;
  flex: 1; min-height: 200px;
}
.empty-tip .greet {
  font-size: 28px; font-weight: 600; color: var(--text);
  margin-bottom: 4px;
}
.empty-tip .sub { font-size: 14px; color: var(--text-3); }

.typing { display: flex; gap: 4px; align-items: center; padding: 6px 0; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3);
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1); } }

/* composer 全宽白条 */
.composer {
  flex-shrink: 0;
  width: 100%;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 12px 20px 16px;
  display: flex; gap: 12px; align-items: flex-end;
}
.composer-inner {
  max-width: 820px; width: 100%; margin: 0 auto;
  display: flex; gap: 12px; align-items: flex-end;
}
.composer .input-wrap {
  flex: 1;
  background: var(--bg-hover);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex; align-items: flex-end; gap: 8px;
  transition: border-color .15s, background .15s;
  min-height: 44px;
}
.composer .input-wrap:focus-within { background: white; border-color: var(--primary); }
.composer .input {
  flex: 1; min-width: 0;
  border: none; background: transparent; outline: none;
  resize: none; font-size: 14px; line-height: 1.5;
  color: var(--text);
  max-height: 120px;
  padding: 0; font-family: inherit;
}
.composer .voice-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  border: none; background: transparent; border-radius: 50%;
  cursor: pointer; font-size: 16px; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.composer .voice-btn:hover { background: rgba(0,0,0,0.04); color: var(--primary); }
.composer .voice-btn.rec {
  background: var(--error); color: white;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,79,.4); } 50% { box-shadow: 0 0 0 8px rgba(255,77,79,0); } }

.send-btn {
  height: 44px; min-width: 72px; padding: 0 18px;
  border: none; border-radius: var(--radius);
  background: var(--primary); color: white;
  font-size: 14px; font-weight: 500;
  cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.send-btn:hover:not(:disabled) { background: var(--primary-hover); }
.send-btn:active:not(:disabled) { background: var(--primary-active); }
.send-btn:disabled { background: #D9D9D9; color: white; cursor: not-allowed; }

/* ============== 音乐 ============== */
.music-body {
  flex: 1; min-height: 0;
  display: flex; gap: 20px;
  padding: 20px 24px;
  overflow: hidden;
  position: relative;
}
.now-playing {
  width: 360px; flex-shrink: 0;
  height: 100%;       /* 撑满父容器高度(音乐区) */
  min-height: 0;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center;
  overflow: hidden;
}
.cover {
  width: 240px; height: 240px;
  border-radius: var(--radius);
  overflow: hidden; background: linear-gradient(135deg, #F0F2F5, #E5E5E5);
  margin-bottom: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.cover { transition: width .3s, height .3s; }
@media (max-height: 800px) { .cover { width: 200px; height: 200px; } }
@media (max-height: 700px) { .cover { width: 180px; height: 180px; } }

/* 桌面/手机 元素显隐 */
.desktop-only { display: flex; }
.mobile-only { display: none !important; }
@media (max-width: 900px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
}

@media (max-width: 900px) {
  .menu-btn { display: flex; }
  /* 手机端隐藏桌面右侧大播放器(全宽列表优先) */
  .now-playing { display: none !important; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: -160px;
    width: 140px;
    z-index: 100;
    box-shadow: 4px 0 16px rgba(0,0,0,.1);
    transition: left .25s;
  }
  .sidebar.show { left: 0; width: 140px; }
  .sidebar.show .brand-text,
  .sidebar.show .nav-item .lbl,
  .sidebar.show .conv-section,
  .sidebar.show .user-info .user-name,
  .sidebar.show .user-info .user-action { display: block; }
  .sidebar.show .nav-item { justify-content: flex-start; padding: 0 10px; gap: 6px; font-size: 13px; }
  .sidebar.show .brand { padding: 0 14px; justify-content: flex-start; }
  .sidebar.show .user-info { justify-content: flex-start; padding: 8px 10px; gap: 8px; }
  .sidebar.show .user-info .user-name { font-size: 12px; }
  .sidebar.show .nav { padding: 12px 6px 0; }
  .sidebar.show .conv-section { padding: 12px 6px 80px; }
  .sidebar:not(.show).collapsed,
  .sidebar:not(.show) { width: 0; border: none; overflow: hidden; }
  body.sidebar-open .menu-btn { display: none; }
  .topbar { padding: 0 12px 0 60px; }
  .topbar .title { font-size: 15px; }
  .messages { padding: 16px 12px 8px; }
  .composer { padding: 10px 12px 12px; }
  .model-pick { font-size: 12px; padding: 0 28px 0 10px; }
  .now-playing { width: 100%; }
  .music-body { flex-direction: column; padding: 12px; gap: 0; }
  .cover { width: 180px; height: 180px; }
  .lyric-box { height: 120px; }
  .mini-player {
    position: fixed; left: 0; right: 0; bottom: 0;
    height: 56px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    padding: 0 12px;
    z-index: 50;
    box-shadow: 0 -2px 8px rgba(0,0,0,.04);
    cursor: pointer;
  }
  .mini-cover {
    width: 40px; height: 40px; border-radius: 6px;
    object-fit: cover; background: var(--bg-hover); flex-shrink: 0;
  }
  .mini-info { flex: 1; min-width: 0; overflow: hidden; }
  .mini-name { font-size: 14px; font-weight: 500; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mini-artist { font-size: 12px; color: var(--text-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mini-play {
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: #333; color: white;
    font-size: 14px; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .full-player {
    position: fixed; inset: 0; z-index: 200;
    background: white;
    display: flex; flex-direction: column; align-items: center;
    padding: 16px 24px 24px;
  }
  .full-close {
    position: absolute; top: 12px; right: 12px;
    width: 40px; height: 40px; border: none; background: transparent;
    font-size: 24px; cursor: pointer; color: var(--text-2);
    border-radius: 50%;
  }
  .full-close:hover { background: var(--bg-hover); }
  .cover-lg {
    width: 240px; height: 240px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(135deg, #F0F2F5, #E5E5E5);
    margin-top: 40px; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }
  .cover-lg img { width: 100%; height: 100%; object-fit: cover; }
  .cover-lg .placeholder { font-size: 80px; color: var(--text-4); }
  .song-name-lg { font-size: 18px; font-weight: 600; margin-bottom: 4px;
    max-width: 100%; text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .song-artist-lg { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }
  .lyric-box-lg {
    width: 100%; height: 200px;
    overflow: hidden; position: relative;
    text-align: center; font-size: 13px; line-height: 2; color: var(--text-3);
    margin-bottom: 20px;
  }
  .lyric-box-lg::before, .lyric-box-lg::after {
    content: ''; position: absolute; left: 0; right: 0; height: 40px;
    z-index: 2; pointer-events: none;
  }
  .lyric-box-lg::before { top: 0; background: linear-gradient(to bottom, white, rgba(255,255,255,0)); }
  .lyric-box-lg::after { bottom: 0; background: linear-gradient(to top, white, rgba(255,255,255,0)); }
  .progress-row { padding: 0 8px; }
  .ctrl-row { gap: 24px; }
}

@media (max-width: 480px) {
  .modal { padding: 20px; }
  .composer .input-wrap { padding: 8px 10px; }
  .cover-lg { width: 200px; height: 200px; }
  .lyric-box-lg { height: 160px; }
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .placeholder { font-size: 80px; color: var(--text-4); }

.song-name { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px;
  text-align: center; max-width: 100%; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-artist { font-size: 13px; color: var(--text-3); margin-bottom: 16px;
  text-align: center; max-width: 100%; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 歌词区(无滚动条,渐变遮罩) - 高度自适应 */
.lyric-box {
  width: 100%; flex: 1; min-height: 100px;
  max-height: 280px;
  overflow: hidden;
  position: relative;
  text-align: center;
  font-size: 13px; line-height: 2;
  color: var(--text-3);
  margin-bottom: 16px;
}
.lyric-box::before, .lyric-box::after {
  content: ''; position: absolute; left: 0; right: 0; height: 32px;
  z-index: 2; pointer-events: none;
}
.lyric-box::before { top: 0; background: linear-gradient(to bottom, white, rgba(255,255,255,0)); }
.lyric-box::after { bottom: 0; background: linear-gradient(to top, white, rgba(255,255,255,0)); }
.lyric-track { position: absolute; left: 0; right: 0; transition: transform .4s ease; padding: 64px 0; }
.lyric-line {
  padding: 4px 8px; transition: all .3s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lyric-line.active { color: var(--primary); font-size: 15px; font-weight: 600; transform: scale(1.05); }
.lyric-empty { padding: 64px 16px; color: var(--text-4); font-size: 13px; text-align: center; }

/* 进度条 */
.progress-row {
  display: flex; gap: 8px; align-items: center;
  width: 100%; margin-bottom: 8px; flex-shrink: 0;
}
.time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 36px; text-align: center; }
.progress {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--border-strong); border-radius: 2px; outline: none;
  cursor: pointer;
}
.progress::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
  border: 2px solid white; box-shadow: 0 0 0 1px var(--border-strong);
}
.progress::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: 2px solid white;
}

.ctrl-row { display: flex; gap: 20px; align-items: center; margin-top: 4px; flex-shrink: 0; padding-bottom: 4px; }
.ctrl-btn {
  border: none; background: transparent;
  cursor: pointer; font-size: 22px; color: var(--text);
  padding: 8px; border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.ctrl-btn:hover { background: var(--bg-hover); }
.ctrl-btn.play {
  width: 56px; height: 56px;
  background: var(--primary); color: white;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(22,119,255,.3);
  display: flex; align-items: center; justify-content: center;
}
.ctrl-btn.play svg { color: white; }
.ctrl-btn.play:hover { background: var(--primary-hover); }
/* 清除描边/伪元素可能造成的三色 */
.ctrl-btn.play, .ctrl-btn.play *, .ctrl-btn.play::before, .ctrl-btn.play::after { outline: none; box-shadow: 0 4px 12px rgba(22,119,255,.3); }

/* 搜索 + 列表 */
.search-results {
  flex: 1; min-width: 0; height: 100%; min-height: 0;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.search-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 8px;
}
.search-input {
  flex: 1; height: 40px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg); font-size: 14px;
  outline: none; transition: border-color .15s;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-4); }
.search-go {
  height: 40px; padding: 0 20px;
  border: none; border-radius: var(--radius);
  background: var(--primary); color: white;
  font-size: 14px; cursor: pointer;
  transition: background .15s;
}
.search-go:hover { background: var(--primary-hover); }

.quick-tabs { display: flex; gap: 24px; padding: 12px 20px 0; border-bottom: 1px solid var(--border); }
.tab {
  padding: 8px 0 12px; color: var(--text-3);
  cursor: pointer; font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  user-select: none;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.mylist-count { font-size: 12px; color: var(--text-3); margin-left: 2px; }
.tab.active .mylist-count { color: var(--primary); }

.mode-btn {
  height: 32px; padding: 0 12px;
  background: var(--primary-bg); color: var(--primary);
  border: none; border-radius: 16px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.mode-btn:hover { background: var(--primary); color: white; }

.pl-tabs {
  display: flex; gap: 16px; overflow-x: auto;
  padding: 8px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.pl-tabs::-webkit-scrollbar { display: none; }
.pl-tab {
  flex-shrink: 0; font-size: 13px; color: var(--text-3);
  cursor: pointer; padding: 4px 0;
  white-space: nowrap; user-select: none;
  border-bottom: 2px solid transparent;
}
.pl-tab:hover { color: var(--text); }
.pl-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.result-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.result-empty { padding: 80px 20px; text-align: center; color: var(--text-4); font-size: 13px; }
.song-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 20px; cursor: pointer;
  transition: background .12s;
}
.song-item:hover { background: var(--bg-hover); }
.song-item.playing { background: var(--primary-bg); }
.song-num { width: 32px; color: var(--text-3); text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.song-item.playing .song-num { color: var(--primary); }
.song-meta { flex: 1; min-width: 0; }
.song-title { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-item.playing .song-title { color: var(--primary); font-weight: 500; }
.song-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-added {
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  color: var(--text-3); font-size: 18px;
  transition: all .15s;
}
.song-added:hover { background: var(--primary-bg); color: var(--primary); }
.song-added.on { color: var(--error); }
.song-remove {
  width: 24px; height: 24px;
  background: transparent; border: none;
  color: var(--text-3); font-size: 18px;
  cursor: pointer; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.song-remove:hover { background: var(--error); color: white; }

/* 右键菜单 */
.ctx-menu {
  position: fixed; z-index: 10000;
  background: white; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  border: 1px solid var(--border);
  padding: 4px 0; min-width: 140px;
  font-size: 13px;
}
.ctx-item {
  padding: 8px 14px; cursor: pointer;
  transition: background .12s;
}
.ctx-item:hover { background: var(--bg-hover); color: var(--primary); }

/* 登录弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-mask.hidden { display: none; }
.modal {
  width: 100%; max-width: 400px;
  background: white; border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
}
.modal h3 { font-size: 18px; margin-bottom: 20px; font-weight: 600; }
.modal-input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; margin-bottom: 12px;
  transition: border-color .15s;
}
.modal-input:focus { border-color: var(--primary); }
.modal-err { color: var(--error); font-size: 12px; min-height: 18px; margin-bottom: 8px; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.modal-btn {
  height: 38px; padding: 0 18px;
  border: 1px solid var(--border-strong); background: white;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px;
  transition: all .15s;
}
.modal-btn:hover { border-color: var(--primary); color: var(--primary); }
.modal-btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.modal-btn.primary:hover { background: var(--primary-hover); }
.modal-foot { text-align: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.modal-foot a { color: var(--primary); font-size: 13px; text-decoration: none; }
.modal-foot a:hover { text-decoration: underline; }
.modal-wide { max-width: 460px; }
.reg-step { animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.reg-step.hidden { display: none; }
.reg-tip { color: var(--text-3); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.reg-tip b { color: var(--primary); }
.reg-username-hint { font-size: 12px; margin: -8px 0 12px; padding: 0 4px; color: var(--text-3); transition: color .15s; }
.reg-username-hint.ok { color: var(--success); }
.reg-username-hint.bad { color: var(--error); }
.reg-inbox-tip { margin-bottom: 12px; }
.reg-inbox-tip summary { cursor: pointer; color: var(--primary); font-size: 13px; padding: 6px 0; }
.reg-inbox { background: var(--bg-hover); border-radius: 8px; padding: 12px; margin-top: 8px; }
.reg-inbox-empty { color: var(--text-3); font-size: 12px; text-align: center; padding: 12px; }
.reg-mail { font-size: 13px; }
.reg-mail-hd { display: flex; justify-content: space-between; color: var(--text-2); margin-bottom: 8px; }
.reg-mail-sub { font-weight: 500; }
.reg-mail-date { color: var(--text-3); font-size: 11px; }
.reg-mail-code { padding: 8px 12px; background: white; border-radius: 6px; margin: 8px 0; font-family: ui-monospace, monospace; }
.reg-mail-code b { color: var(--primary); font-size: 18px; letter-spacing: 2px; }
.reg-mail-fill { background: var(--primary); color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.reg-mail-fill:hover { background: var(--primary-hover); }
.reg-username-row { position: relative; }
.reg-username-row .modal-input { padding-right: 60px; }
.reg-username-row .reg-username-hint { position: absolute; right: 12px; top: 12px; font-size: 12px; }
.reg-debug-code {
  background: #FFF7E6; color: #874D00;
  padding: 8px 12px; border-radius: 6px; font-size: 12px;
  margin-bottom: 8px; border: 1px solid #FFD591;
}
.reg-debug-code b { color: #1677FF; font-size: 14px; letter-spacing: 1px; }
.captcha-row {
  display: flex; gap: 8px; align-items: stretch;
  margin-bottom: 12px;
}
.captcha-row .modal-input { flex: 1; margin: 0; }
.captcha-img {
  width: 120px; height: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #F0F2F5; cursor: pointer; object-fit: contain;
}
.captcha-img.loading { opacity: 0.5; }
.captcha-refresh {
  width: 44px; height: 44px;
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 18px; color: var(--text-2);
}
.captcha-refresh:hover { background: var(--bg-hover); color: var(--primary); }
.reg-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.modal-err.ok { color: var(--success); }

/* Toast */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 20px; background: rgba(0,0,0,.78); color: white;
  border-radius: 20px; font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--error); }
.toast.success { background: var(--success); }

/* 调试面板 */
#debugPanel {
  position: fixed; top: 80px; right: 20px;
  width: 480px; max-width: calc(100vw - 40px);
  max-height: 60vh;
  background: rgba(20, 24, 30, 0.96);
  color: #E6E6E6;
  border-radius: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.5;
  z-index: 99999;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all .2s;
}
#debugPanel.hidden { display: none; }
#debugPanel.pinned {
  top: 10px !important;
  box-shadow: 0 0 0 2px var(--error), 0 8px 24px rgba(0,0,0,.4);
}
.dbg-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  user-select: none;
}
.dbg-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #52C41A;
  flex-shrink: 0;
  transition: background .2s;
}
.dbg-dot.err { background: var(--error); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.dbg-title { flex: 1; font-weight: 600; color: white; font-size: 12px; }
.dbg-head button {
  background: rgba(255,255,255,0.1);
  border: none; color: white;
  width: 22px; height: 22px;
  border-radius: 4px; cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.dbg-head button:hover { background: rgba(255,255,255,0.2); }
.dbg-body {
  flex: 1; overflow-y: auto; padding: 4px 0;
  font-variant-numeric: tabular-nums;
}
.dbg-body.collapsed { max-height: 0; overflow: hidden; padding: 0; }
.dbg-line {
  display: flex; gap: 8px; padding: 2px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  word-break: break-all;
}
.dbg-line:hover { background: rgba(255,255,255,0.04); }
.dbg-t { color: #888; flex-shrink: 0; }
.dbg-l { font-weight: 700; flex-shrink: 0; min-width: 50px; }
.dbg-m { flex: 1; min-width: 0; }
.dbg-info .dbg-l { color: #5B9BD5; }
.dbg-warn .dbg-l { color: #FAAD14; }
.dbg-error { background: rgba(255, 77, 79, 0.12); }
.dbg-error .dbg-l { color: #FF4D4F; }
.dbg-ok .dbg-l { color: #52C41A; }
.dbg-user .dbg-l { color: #B37FEB; }
.dbg-api .dbg-l { color: #13C2C2; }
.dbg-api .dbg-m { color: #B5E0F0; }

/* 3D 频谱全屏背景 */
.spectrum3d-bg {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  display: block;
}
/* 播放中:整个页面内容半透明,3D 频谱透出来 */
body.music-playing .app { background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(2px); }
body.music-playing .sidebar { background: rgba(250, 250, 250, 0.7); }
body.music-playing .now-playing,
body.music-playing .search-results { background: rgba(255, 255, 255, 0.65); }
body.music-playing .topbar { background: rgba(255, 255, 255, 0.65); backdrop-filter: blur(8px); }
body.music-playing .mini-player { background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(8px); }
body.music-playing .composer { background: rgba(255, 255, 255, 0.65); }
body.music-playing .mode-btn { background: rgba(255, 255, 255, 0.7); }

