/* ========== 基础（深色主题：黑底 + 薄荷绿主色 + 粉色点缀） ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #7ce3cf;              /* 薄荷绿主色（取自头像发色） */
  --primary-dim: rgba(124, 227, 207, 0.14);
  --accent: #f2a0b4;               /* 粉色点缀（取自头像发饰） */
  --accent-dim: rgba(242, 160, 180, 0.16);
  --bg: #0b0d12;                   /* 近黑背景 */
  --card: #151823;                 /* 深色卡片 */
  --card-hover: #1a1e2c;
  --text: #e8eaf0;
  --text-light: #9aa1b2;
  --border: #262b3a;
}

html { color-scheme: dark; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== 复制成功提示（toast） ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #0b0d12;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========== 背景图位置自适应（星空等图片背景） ========== */
/* 桌面端：居中铺满 */
.bg-image {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -3;
  display: none;
}
/* 平板端：保持居中，优先展示星空主体 */
@media (min-width: 481px) and (max-width: 1024px) {
  .bg-image { background-position: center center; }
}
/* 移动端：竖屏比例下取中上部，避免星空主体被裁掉 */
@media (max-width: 480px) {
  .bg-image { background-position: center top; }
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 18, 0);
  z-index: -2;
  display: none;
}
/* 启用图片背景时深色蒙层保证内容可读 */
body.has-bg-image .bg-image,
body.has-bg-image .bg-overlay { display: block; }

/* ========== 顶部氛围光晕（纯装饰） ========== */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}
.glow-mint {
  width: 420px; height: 420px;
  top: -160px; left: -120px;
  background: rgba(124, 227, 207, 0.10);
}
.glow-pink {
  width: 380px; height: 380px;
  top: -100px; right: -120px;
  background: rgba(242, 160, 180, 0.08);
}

.container {
  position: relative;
  max-width: 1020px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* ========== 头部：居中头像 + 标题 ========== */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}
.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--primary), var(--accent)) border-box;
  box-shadow: 0 0 0 6px rgba(124, 227, 207, 0.08), 0 8px 28px rgba(0, 0, 0, 0.5);
  margin-bottom: 18px;
}
.header h1 {
  font-size: 26px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  background: linear-gradient(120deg, var(--primary), #ffffff 55%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-light); font-size: 14px; }

/* ========== 筛选栏（类型 / 语种 / 付费 下拉，仿参考图） ========== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.filter-select {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-select:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.fs-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding-right: 10px;
  border-right: 1px solid var(--border);
}
.filter-select select {
  flex: 1;
  min-width: 0;
  padding: 9px 4px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-light);
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
}
.filter-select select option {
  background: var(--card);
  color: var(--text);
}

/* ========== 搜索框 ========== */
.search-box { position: relative; margin-bottom: 14px; }
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.7;
}
#searchInput {
  width: 100%;
  padding: 13px 16px 13px 40px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#searchInput::placeholder { color: var(--text-light); }
#searchInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* ========== 工具栏 ========== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sort-btn {
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}
.sort-btn:hover { background: var(--primary-dim); }
.sort-btn.active { background: var(--primary); color: #0b0d12; font-weight: 600; }
.count-info { font-size: 13px; color: var(--text-light); }

/* ========== 歌曲表格 ========== */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;           /* 小屏横向滚动，不破坏布局 */
  -webkit-overflow-scrolling: touch;
}
.song-table {
  width: 100%;
  min-width: 860px;           /* 低于此宽度出现横向滚动条 */
  border-collapse: collapse;
  font-size: 14px;
}
.song-table thead th {
  position: sticky;
  top: 0;
  background: #1a1e2c;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  padding: 11px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.song-table tbody tr {
  cursor: pointer; /* 点击复制歌名 */
  border-bottom: 1px solid rgba(38, 43, 58, 0.55);
  transition: background 0.15s;
}
.song-table tbody tr:last-child { border-bottom: none; }
.song-table tbody tr:hover {
  background: rgba(124, 227, 207, 0.05);
}
.song-table td {
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--text);
}

/* 有图片背景时表格略带透明感 */
body.has-bg-image .table-wrap { background: rgba(21, 24, 35, 0.9); }
body.has-bg-image .filter-select { background: rgba(21, 24, 35, 0.9); }
body.has-bg-image #searchInput { background: rgba(21, 24, 35, 0.9); }

.td-idx {
  width: 44px;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}
.td-title { font-weight: 600; min-width: 150px; }
.title-zh {
  display: block;            /* 中文译名换行小字，避免列过宽 */
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  margin-top: 1px;
}
.td-artist { color: var(--text-light); min-width: 120px; }
/* 语言列：固定不换行，避免挤成两行 */
.td-lang { white-space: nowrap; }
.song-table th:nth-child(5) { min-width: 56px; }

.type-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--primary-dim);
  color: var(--primary);
  white-space: nowrap;
}

.paid-yes {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.td-muted { color: var(--text-light); }

.td-note { color: var(--accent); font-size: 12.5px; min-width: 100px; }

.song-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.song-link:hover { text-decoration: underline; }

/* ========== 空状态 & 页脚 ========== */
.empty-tip { text-align: center; color: var(--text-light); padding: 40px 0; }
.footer { text-align: center; margin-top: 36px; }
.admin-link { font-size: 13px; color: var(--text-light); text-decoration: none; }
.admin-link:hover { color: var(--primary); }

/* ========== 移动端适配 ========== */
@media (max-width: 480px) {
  .header h1 { font-size: 21px; }
  .avatar { width: 88px; height: 88px; }
  .filter-bar { gap: 8px; }
  .filter-select { min-width: 100%; }
  .container { padding: 24px 10px 40px; }
  .table-wrap { border-radius: 12px; }
  /* 提示用户表格可横向滑动 */
  .table-wrap { position: relative; }
}
