*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1677FF;
  --primary-light: #E6F4FF;
  --text-primary: rgba(0,0,0,0.88);
  --text-secondary: rgba(0,0,0,0.45);
  --text-tertiary: rgba(0,0,0,0.25);
  --border: #F0F0F0;
  --border-secondary: #D9D9D9;
  --bg: #F5F5F5;
  --bg-card: #FFFFFF;
  --bg-hover: #FAFAFA;
  --radius: 6px;
  --player-h: 80px;
  --topbar-h: 56px;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text-primary); }

#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── 顶部栏 ── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  height: var(--topbar-h); padding: 0 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-icon { width: 22px; height: 22px; color: var(--primary); }
.brand-name { font-size: 16px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 400px; height: 36px;
  padding: 0 12px; background: var(--bg-hover);
  border: 1px solid var(--border-secondary); border-radius: 18px;
  color: var(--text-secondary);
}
.search-box input { border: none; background: transparent; outline: none; width: 100%; font-size: 13px; color: var(--text-primary); }
.search-box input::placeholder { color: var(--text-secondary); }
.btn-primary {
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 36px;
  background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 13px; font-weight: 500; flex-shrink: 0;
  transition: background .2s;
}
.btn-primary:hover { background: #4096FF; }

.btn-admin {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; height: 36px;
  background: #fff; color: var(--text-primary);
  border: 1px solid var(--border-secondary); border-radius: var(--radius);
  cursor: pointer; font-size: 13px; flex-shrink: 0;
  transition: all .15s;
}
.btn-admin:hover { color: var(--primary); border-color: var(--primary); }
.btn-admin.is-admin { color: #389E0D; border-color: #B7EB8F; background: #F6FFED; }
.btn-admin.is-admin:hover { color: #237804; border-color: #95DE64; }

/* 仅管理员可见 */
body:not(.is-admin) .admin-only { display: none !important; }
body:not(.is-admin) .col-action { display: none !important; }

/* 登录提示 */
.error-text { color: #FF4D4F !important; }

/* ── 健康面板 ── */
.health-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.health-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; background: var(--bg-card);
}
.health-card .label {
  font-size: 11px; color: var(--text-secondary);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.health-card .value {
  font-size: 18px; font-weight: 600; color: var(--text-primary);
}
.health-card .sub {
  font-size: 11px; color: var(--text-secondary); margin-top: 2px;
}
.health-card.ok .value { color: #389E0D; }
.health-card.warn .value { color: #D46B08; }
.health-card.error .value { color: #CF1322; }
.health-section {
  margin-top: 14px; font-size: 12px; font-weight: 600;
  color: var(--text-primary); display: flex; align-items: center; gap: 6px;
}
.health-section::before {
  content: ''; width: 3px; height: 12px; background: var(--primary); border-radius: 2px;
}
.error-list {
  margin-top: 8px; max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.error-item {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.error-item:last-child { border-bottom: none; }
.error-item .err-time { color: var(--text-secondary); font-size: 11px; }
.error-item .err-where { color: #CF1322; font-weight: 600; margin: 0 6px; }
.error-item .err-msg { color: var(--text-primary); }

.btn-section {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; height: 28px; margin-left: auto;
  background: #fff; color: var(--text-primary);
  border: 1px solid var(--border-secondary); border-radius: var(--radius);
  cursor: pointer; font-size: 12px; font-family: inherit;
  transition: all .15s;
}
.btn-section:hover { color: var(--primary); border-color: var(--primary); }

/* 表单输入字段 + 内联按钮 */
.field-with-action {
  display: flex; gap: 6px; align-items: stretch;
}
.field-with-action input { flex: 1; }
.btn-input-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 10px; height: 32px;
  background: #fff; color: var(--text-primary);
  border: 1px solid var(--border-secondary); border-radius: var(--radius);
  cursor: pointer; font-size: 12px; font-family: inherit; flex-shrink: 0;
  transition: all .15s;
}
.btn-input-action:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ── Layout ── */
.layout { display: flex; flex: 1; overflow: hidden; }

/* ── 侧边栏 ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 12px; overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; height: 40px; border-radius: var(--radius);
  font-size: 14px; color: var(--text-primary);
  cursor: pointer; transition: background .15s;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item.active svg { color: var(--primary); }
.sidebar-divider { height: 1px; background: var(--border); margin: 12px 0; }
.sidebar-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 0 12px; margin-bottom: 4px; }
.playlist-item {
  padding: 0 12px; height: 32px; display: flex; align-items: center;
  font-size: 13px; color: var(--text-primary); border-radius: var(--radius);
  cursor: pointer; transition: background .15s;
}
.playlist-item:hover { background: var(--bg-hover); }
.playlist-item.active-pl { color: var(--primary); font-weight: 500; }

/* ── 侧边栏分类项 ── */
.cat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; height: 36px; border-radius: var(--radius);
  font-size: 13px; color: var(--text-primary);
  cursor: pointer; transition: background .15s;
}
.cat-item:hover { background: var(--bg-hover); }
.cat-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.cat-item .cat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-right: 8px;
}
.cat-item .cat-name { flex: 1; display: inline-flex; align-items: center; }
.cat-item .cat-count {
  font-size: 11px; color: var(--text-secondary);
  background: var(--bg-hover); padding: 0 6px; border-radius: 9px;
  height: 18px; line-height: 18px; min-width: 18px; text-align: center;
}
.cat-item.active .cat-count { background: rgba(22,119,255,0.15); color: var(--primary); }

/* ── 侧边栏标签项 ── */
.tag-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; height: 32px; border-radius: var(--radius);
  font-size: 12px; color: var(--text-secondary);
  cursor: pointer; transition: background .15s, color .15s;
}
.tag-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.tag-item.active { background: #f0f5ff; color: var(--primary); font-weight: 500; }
.tag-item .tag-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-item .tag-item-count {
  font-size: 11px; color: var(--text-secondary);
  background: var(--bg-hover); padding: 0 6px; border-radius: 9px;
  height: 18px; line-height: 18px; min-width: 18px; text-align: center;
  margin-left: 6px; flex-shrink: 0;
}
.tag-item.active .tag-item-count { background: rgba(22,119,255,0.15); color: var(--primary); }
.sidebar-empty { font-size: 12px; color: var(--text-tertiary); padding: 8px 12px; }

/* ── 表单中的分类选择器 ── */
.category-selector { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pill {
  padding: 0 14px; height: 28px; border-radius: 14px;
  border: 1px solid var(--border-secondary); background: #fff;
  font-size: 13px; color: var(--text-primary); cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); }
.cat-pill.selected {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ── 主内容 ── */
.main-content {
  flex: 1; min-height: 0; min-width: 0; overflow: hidden;
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ── 上传区 ── */
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 32px;
  background: var(--bg-hover);
  border: 1.5px dashed var(--border-secondary); border-radius: 8px;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.upload-title { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.upload-hint { font-size: 12px; color: var(--text-secondary); }

/* ── 上传进度 ── */
.upload-progress-list { display: flex; flex-direction: column; gap: 8px; }
.upload-progress-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px;
}
.upload-progress-item .filename { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-item .progress-mini { flex: 2; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.upload-progress-item .progress-mini-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }
.upload-progress-item .status-text { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.upload-progress-item .status-text.success { color: #52C41A; }
.upload-progress-item .status-text.error { color: #FF4D4F; }

/* ── Section Header ── */
.section-header { display: flex; align-items: center; gap: 12px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.section-meta { font-size: 12px; color: var(--text-secondary); }
.section-actions { margin-left: auto; display: flex; gap: 6px; }
.section-actions .btn-section { margin-left: 0; }

/* ── 批量工具条 ── */
.batch-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--primary-light);
  border: 1px solid #91caff; border-radius: var(--radius);
  font-size: 13px;
}
.batch-count { color: var(--primary); }
.batch-count strong { font-weight: 700; }
.btn-section.danger { color: #FF4D4F; border-color: #FFA39E; }
.btn-section.danger:hover { color: #fff !important; background: #FF4D4F; border-color: #FF4D4F; }
.btn-section-ghost {
  display: inline-flex; align-items: center;
  padding: 0 10px; height: 28px;
  background: transparent; color: var(--text-secondary);
  border: none; border-radius: var(--radius);
  cursor: pointer; font-size: 12px; font-family: inherit;
}
.btn-section-ghost:hover { color: var(--text-primary); }

/* ── 表头排序 ── */
.sortable { cursor: pointer; user-select: none; transition: color .15s; }
.sortable:hover { color: var(--text-primary); }
.sort-indicator { display: inline-block; margin-left: 4px; opacity: .25; font-size: 10px; line-height: 1; }
.sortable.sort-asc .sort-indicator,
.sortable.sort-desc .sort-indicator { opacity: 1; color: var(--primary); }
.sortable.sort-asc .sort-indicator::before { content: "▲"; }
.sortable.sort-desc .sort-indicator::before { content: "▼"; }

/* ── 复选框列 ── */
.col-checkbox { width: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.col-checkbox input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }
.song-row.row-selected { background: #f5faff; }
.song-row.row-selected.playing { background: var(--primary-light); }

/* ── 长列表性能优化 ── */
.song-row {
  content-visibility: auto;
  contain-intrinsic-size: 60px;
}

/* ── 批量编辑勾选框 label ── */
.be-check { margin-right: 6px; cursor: pointer; accent-color: var(--primary); }
.form-field label { display: flex; align-items: center; }

/* ── 重复歌曲列表 ── */
.dup-group {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; overflow: hidden;
}
.dup-group-header {
  padding: 8px 12px; background: var(--bg-hover);
  font-size: 12px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.dup-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dup-row:last-child { border-bottom: none; }
.dup-row .dup-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-row .dup-meta { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; }
.dup-row button {
  padding: 2px 8px; border: 1px solid #FFA39E; background: #FFF1F0;
  color: #FF4D4F; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.dup-row button:hover { background: #FF4D4F; color: #fff; }

/* ── 歌曲表格 ── */
.song-table {
  flex: 1; min-height: 0;
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; overflow: hidden;
}

.table-header {
  display: flex; align-items: center;
  padding: 0 16px; height: 44px; flex-shrink: 0;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  position: sticky; top: 0; z-index: 1;
}

#songList { flex: 1; overflow-y: auto; min-height: 0; }

.song-row {
  display: flex; align-items: center;
  padding: 0 16px; height: 60px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  position: relative;
}
.song-row:last-child { border-bottom: none; }
.song-row:hover { background: var(--bg-hover); }
.song-row.playing { background: var(--primary-light); }
.song-row.playing .col-title-text { color: var(--primary); font-weight: 600; }
.song-row.playing .col-idx { color: var(--primary); }

.col-idx { width: 40px; flex-shrink: 0; color: var(--text-secondary); font-size: 13px; }
.col-title { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.col-title-cover {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 6px; background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
}
.col-title-info { min-width: 0; }
.col-title-text { font-size: 14px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-title-sub { font-size: 12px; color: var(--text-secondary); }
.col-artist { width: 180px; flex-shrink: 0; font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-album { width: 180px; flex-shrink: 0; font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-rating { width: 110px; flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.col-duration { width: 60px; flex-shrink: 0; font-size: 13px; color: var(--text-secondary); text-align: right; }

/* ── 星级评分 ── */
.star-rating { display: inline-flex; align-items: center; gap: 1px; cursor: pointer; }
.star-rating .star {
  width: 14px; height: 14px; display: inline-block;
  color: #d9d9d9; transition: color .15s, transform .1s;
}
.star-rating .star.filled { color: #faad14; }
.star-rating .star:hover { transform: scale(1.15); }
.star-rating[data-readonly="true"] { cursor: default; pointer-events: none; }
body:not(.is-admin) .star-rating { pointer-events: none; }

/* 质量警告徽章 */
.quality-warn {
  display: inline-flex; align-items: center; gap: 2px;
  margin-left: 4px; padding: 1px 5px;
  background: #fff7e6; border: 1px solid #ffd591; color: #d46b08;
  border-radius: 3px; font-size: 10px; line-height: 1.4;
  cursor: help;
}
.quality-warn.bad { background: #fff1f0; border-color: #ffa39e; color: #cf1322; }

/* ── 审核模式 ── */
.audit-card {
  text-align: center; padding: 12px 0 16px;
}
.audit-cover {
  width: 100px; height: 100px; margin: 0 auto 12px;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.audit-title { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.audit-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.audit-tech {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-secondary);
  padding: 8px 12px; background: var(--bg-hover);
  border-radius: var(--radius); margin-bottom: 14px;
}
.audit-tech b { color: var(--text-primary); font-weight: 600; }
.audit-flags {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px;
}
.audit-rating {
  display: flex; justify-content: center; gap: 4px; padding: 12px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.audit-rating .star-big {
  width: 32px; height: 32px; cursor: pointer;
  color: #d9d9d9; transition: color .15s, transform .1s;
}
.audit-rating .star-big:hover { transform: scale(1.15); }
.audit-rating .star-big.filled { color: #faad14; }
.audit-controls {
  display: flex; justify-content: center; gap: 10px;
}
.audit-controls button {
  padding: 6px 14px; height: 32px; border-radius: var(--radius);
  border: 1px solid var(--border-secondary); background: #fff;
  cursor: pointer; font-family: inherit; font-size: 13px;
}
.audit-controls button:hover { color: var(--primary); border-color: var(--primary); }
.audit-controls .danger { color: #FF4D4F; border-color: #FFA39E; }
.audit-controls .danger:hover { color: #fff !important; background: #FF4D4F; border-color: #FF4D4F; }
kbd {
  display: inline-block; padding: 1px 5px; font-size: 11px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 3px; font-family: monospace;
}
.col-action { width: 84px; flex-shrink: 0; display: flex; justify-content: flex-end; }

.delete-btn {
  background: none; border: 1px solid transparent; cursor: pointer;
  padding: 6px; color: var(--text-secondary); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.song-row:hover .delete-btn { color: var(--text-primary); border-color: var(--border); }
.delete-btn:hover { color: #FF4D4F !important; background: #FFF1F0; border-color: #FFA39E !important; }

/* ── 空状态 ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px; gap: 12px; color: var(--text-secondary);
}
.empty-state p { font-size: 14px; }

/* ── 底部播放器 ── */
.player {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--player-h); padding: 0 24px;
  background: var(--bg-card); border-top: 1px solid var(--border);
  flex-shrink: 0; z-index: 10;
}

.player-left { display: flex; align-items: center; gap: 12px; width: 260px; }
.player-cover {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 6px;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); overflow: hidden; font-size: 18px; font-weight: 700; color: #fff;
}
.player-info { min-width: 0; flex: 1; }
.player-title { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-artist { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; max-width: 540px; }
.player-controls { display: flex; align-items: center; gap: 16px; }

.icon-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.icon-btn.active { color: var(--primary); }

.play-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background .2s, transform .1s;
}
.play-btn:hover { background: #4096FF; }
.play-btn:active { transform: scale(.95); }

.progress-bar-wrap {
  display: flex; align-items: center; gap: 10px; width: 100%;
}
.time { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; width: 32px; }
#totalTime { text-align: right; }
.progress-track {
  flex: 1; height: 4px; background: var(--border); border-radius: 2px;
  position: relative; cursor: pointer;
}
.progress-track:hover .progress-thumb { opacity: 1; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; width: 0; pointer-events: none; }
.progress-thumb {
  position: absolute; top: 50%; right: calc(100% - var(--pct, 0%) ); transform: translate(50%, -50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--primary);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}

.player-right { display: flex; align-items: center; gap: 10px; width: 200px; justify-content: flex-end; }
.volume-track {
  width: 100px; height: 4px; background: var(--border); border-radius: 2px; cursor: pointer; position: relative;
}
.volume-fill { height: 100%; background: var(--primary); border-radius: 2px; }

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #BFBFBF; }

/* ── 确认弹窗 ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; animation: fadeIn .15s ease;
}
.modal-box {
  background: #fff; border-radius: 8px; box-shadow: 0 6px 32px rgba(0,0,0,.16);
  padding: 24px; min-width: 360px; max-width: 480px;
  animation: scaleIn .2s ease;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.modal-content { font-size: 14px; color: var(--text-primary); margin-bottom: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-default, .btn-danger {
  padding: 6px 16px; border-radius: var(--radius); font-size: 14px;
  cursor: pointer; transition: all .15s; border: 1px solid var(--border-secondary);
  background: #fff; color: var(--text-primary);
}
.btn-default:hover { color: var(--primary); border-color: var(--primary); }
.btn-danger { background: #FF4D4F; color: #fff; border-color: #FF4D4F; }
.btn-danger:hover { background: #ff7875; border-color: #ff7875; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-mask.hidden { display: none; }

/* ── 表单弹窗 ── */
.form-box {
  width: 520px; max-width: 92vw; max-height: 90vh;
  padding: 0; display: flex; flex-direction: column;
}
.form-box-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.form-box-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.form-box-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 4px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.form-box-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.form-box-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.form-box-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.hidden { display: none !important; }

.file-info-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--bg-hover);
  border-radius: var(--radius); margin-bottom: 16px;
}
.file-info-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 6px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.file-info-text { min-width: 0; flex: 1; }
.file-info-name {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-info-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.form-field input,
.form-field select {
  padding: 0 12px; height: 32px;
  border: 1px solid var(--border-secondary); border-radius: var(--radius);
  font-size: 14px; outline: none; background: #fff;
  font-family: inherit; color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus,
.form-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
.form-hint { font-size: 12px; color: var(--text-secondary); }

/* ── Tag chip 输入 ── */
.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 4px 8px; min-height: 32px;
  border: 1px solid var(--border-secondary); border-radius: var(--radius);
  background: #fff; transition: border-color .15s, box-shadow .15s;
  cursor: text;
}
.tag-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.12);
}
.tag-input input {
  flex: 1; min-width: 100px;
  border: none; outline: none;
  height: 22px; padding: 0;
  font-size: 13px; font-family: inherit;
  background: transparent; color: var(--text-primary);
}
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 6px; height: 22px;
  background: #f0f5ff; border: 1px solid #adc6ff;
  border-radius: 4px; font-size: 12px; color: var(--primary);
}
.tag-chip-x {
  cursor: pointer; opacity: .6; font-size: 14px; line-height: 1;
  padding: 0 2px; user-select: none;
}
.tag-chip-x:hover { opacity: 1; }

/* ── Form action button ── */
.btn-primary-action {
  padding: 0 16px; height: 32px; border-radius: var(--radius);
  font-size: 14px; cursor: pointer; transition: all .15s;
  background: var(--primary); color: #fff;
  border: 1px solid var(--primary); font-weight: 500;
}
.btn-primary-action:hover { background: #4096FF; border-color: #4096FF; }
.btn-primary-action:disabled { background: #bfdbff; border-color: #bfdbff; cursor: not-allowed; }

/* ── 行内标签展示 ── */
.col-title-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; align-items: center;
}
.row-tag {
  display: inline-flex; align-items: center;
  height: 18px; padding: 0 6px;
  border: 1px solid var(--border); background: var(--bg-hover);
  border-radius: 3px; font-size: 11px; color: var(--text-secondary);
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.row-tag:hover { border-color: var(--primary); color: var(--primary); }
.row-tag.genre {
  background: #fff7e6; border-color: #ffd591; color: #d46b08;
}
.row-tag.genre:hover { border-color: #fa8c16; color: #fa8c16; }
.row-tag.artist-sub { font-size: 12px; color: var(--text-secondary); border: none; background: transparent; padding: 0; height: auto; }

/* ── 行操作按钮组 ── */
.col-action {
  display: flex; gap: 4px; justify-content: flex-end;
}
.row-action-btn {
  background: none; border: 1px solid transparent; cursor: pointer;
  padding: 6px; color: var(--text-secondary); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.song-row:hover .row-action-btn { color: var(--text-primary); border-color: var(--border); }
.row-action-btn:hover { background: var(--bg-hover); color: var(--primary) !important; border-color: var(--primary) !important; }
.row-action-btn.danger:hover { background: #FFF1F0; color: #FF4D4F !important; border-color: #FFA39E !important; }

/* ── 通知 toast ── */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 1000;
  padding: 10px 16px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  font-size: 13px; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
  animation: slideIn .25s ease;
}
.toast.success { border-color: #B7EB8F; background: #F6FFED; color: #389E0D; }
.toast.error { border-color: #FFA39E; background: #FFF1F0; color: #CF1322; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── 路径查询对话框 ── */
.path-info {
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px 0;
}
.path-field {
  display: flex; flex-direction: column; gap: 6px;
}
.path-field label {
  font-size: 12px; color: var(--text-secondary);
  font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.path-value {
  font-size: 14px; color: var(--text-primary);
  padding: 8px 12px; background: var(--bg);
  border-radius: var(--radius);
  word-break: break-all;
}
.path-value.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
}
.path-value.path-full {
  max-height: 60px; overflow-y: auto;
}
.path-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 4px;
  font-size: 13px; font-weight: 500;
}
.path-status.exists {
  background: #F6FFED; color: #389E0D;
  border: 1px solid #B7EB8F;
}
.path-status.missing {
  background: #FFF1F0; color: #CF1322;
  border: 1px solid #FFA39E;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 16px; border-top: 1px solid var(--border);
  margin-top: 8px;
}
.btn-ghost {
  padding: 0 16px; height: 32px; border-radius: var(--radius);
  font-size: 14px; cursor: pointer; transition: all .15s;
  background: #fff; color: var(--text-primary);
  border: 1px solid var(--border-secondary); font-weight: 500;
}
.btn-ghost:hover {
  border-color: var(--primary); color: var(--primary);
}

/* ── 专辑封面图 ── */
.col-title-cover.cover-img { background-size: cover; background-position: center; color: transparent; }
.album-item { display: flex; align-items: center; gap: 8px; }
.album-thumb { width: 28px; height: 28px; border-radius: 5px; flex-shrink: 0;
  background-size: cover; background-position: center; }
.album-item .tag-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
