/* ==========================================================================
   主播歌单页 · 浅色治愈系
   设计变量集中在此，换主色/圆角只需改 :root
   ========================================================================== */
:root {
  /* 色彩 */
  --paper: #faf6f1;
  --paper-2: #fffdfa;
  --ink: #3d3531;
  --ink-2: #6f635b;
  --ink-3: #a2948a;
  --line: #ece2d7;
  --line-soft: #f4ece3;
  --clay: #c98b72;          /* 主色：陶土 */
  --clay-deep: #b0725a;
  --clay-wash: #fbeee6;
  --sage: #8fa899;
  --gold: #d9b48f;

  /* 形状 */
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 12px;
  --shadow-soft: 0 2px 4px rgba(93, 71, 58, .03), 0 12px 32px -12px rgba(93, 71, 58, .14);
  --shadow-lift: 0 4px 8px rgba(93, 71, 58, .04), 0 22px 44px -18px rgba(93, 71, 58, .22);

  /* 字体 */
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 背景氛围：柔光斑 + 细颗粒 */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
}
.blob-a {
  width: 46vw; height: 46vw; min-width: 320px; min-height: 320px;
  top: -14vw; left: -8vw;
  background: radial-gradient(circle at 30% 30%, #f6dcc9, #f6dcc900 70%);
}
.blob-b {
  width: 52vw; height: 52vw; min-width: 340px; min-height: 340px;
  top: 24vw; right: -16vw;
  background: radial-gradient(circle at 50% 50%, #dfe9e0, #dfe9e000 70%);
}
.grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(120, 96, 80, .10) .6px, transparent .6px);
  background-size: 4px 4px;
  opacity: .35;
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 32px 56px;
}

/* ---------- 通用 ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; margin: 0; }
p { margin: 0; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.fallback-bar {
  max-width: var(--maxw); margin: 16px auto -16px; padding: 10px 16px;
  background: #fff6e8; border: 1px solid #f0dfc4; color: #8a6a3f;
  border-radius: var(--r-sm); font-size: 13px;
}
.fallback-bar strong { color: #6f5227; }

/* ==========================================================================
   主播信息区
   ========================================================================== */
.hero {
  position: relative;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #fffdfa 0%, #fdf8f2 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.hero-cover {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(26px) saturate(.85);
  opacity: .22; transform: scale(1.12);
  transition: background-image .5s ease;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(255, 253, 250, .96) 42%, rgba(255, 253, 250, .72) 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 40px;
  padding: 34px 36px;
}

.identity { display: flex; gap: 24px; align-items: flex-start; min-width: 0; }
.avatar-wrap { position: relative; flex: none; }
.avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; display: block;
  border: 3px solid #fff; box-shadow: 0 8px 22px -8px rgba(120, 90, 70, .45);
  background: var(--clay-wash);
}
.live-dot {
  position: absolute; right: 4px; bottom: 6px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #cfd6d0; border: 3px solid #fff;
  transition: background .3s;
}
.live-dot.is-live { background: #e2725b; box-shadow: 0 0 0 0 rgba(226, 114, 91, .55); animation: pulse 2.4s infinite; }
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(226, 114, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 114, 91, 0); }
}

.identity-text { min-width: 0; }
.live-state {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: .08em; color: var(--ink-3);
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 2px 10px; margin-bottom: 10px;
}
.live-state.is-live { color: #b4482f; border-color: #f0cdc3; background: #fff3ef; }

.name {
  font-size: 34px; line-height: 1.25; margin-bottom: 6px;
}
.tagline {
  font-family: var(--serif); font-size: 15px; color: var(--clay-deep);
  margin-bottom: 8px;
}
.bio {
  font-size: 13.5px; color: var(--ink-2); max-width: 46ch;
  line-height: 1.8;
}
.stats {
  display: flex; gap: 0; list-style: none; margin: 18px 0 0; padding: 0;
}
.stats li {
  display: flex; flex-direction: column; padding-right: 22px; margin-right: 22px;
  border-right: 1px solid var(--line);
}
.stats li:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stats b { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.2; }
.stats span { font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; }

.hero-side {
  flex: none; width: 240px; display: flex; flex-direction: column; gap: 14px;
  align-items: stretch;
}
.on-air {
  background: rgba(255, 255, 255, .78);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  backdrop-filter: blur(6px);
}
.on-air-label { font-size: 10.5px; letter-spacing: .22em; color: var(--ink-3); }
.on-air-text { font-family: var(--serif); font-size: 16px; margin-top: 6px; color: var(--ink); }
.on-air-sub { display: block; font-size: 12px; color: var(--ink-2); margin-top: 4px; }

.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; transition: .22s;
}
.socials a:hover { border-color: var(--clay); color: var(--clay-deep); background: var(--clay-wash); }

/* ==========================================================================
   歌单封面与标题
   ========================================================================== */
.playlist-card {
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: 36px;
  align-items: center;
  margin-top: 26px;
  padding: 30px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
}
.cover-box { position: relative; }
.cover {
  width: 208px; height: 208px; display: block;
  border-radius: var(--r-md);
  object-fit: cover;
  background: #f3e9df;
  box-shadow: 0 18px 34px -18px rgba(120, 88, 66, .55);
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.cover-box:hover .cover { transform: translateY(-3px) rotate(-.6deg); }
.cover-badge {
  position: absolute; left: 12px; top: 12px;
  font-size: 9.5px; letter-spacing: .2em; color: #fff;
  background: rgba(61, 53, 49, .45); backdrop-filter: blur(4px);
  padding: 3px 9px; border-radius: 999px;
}

.pl-body { min-width: 0; }
.kicker {
  font-size: 10.5px; letter-spacing: .3em; color: var(--clay);
  display: block; margin-bottom: 8px;
}
.pl-title { font-size: 30px; line-height: 1.3; }
.pl-sub { font-family: var(--serif); font-size: 15.5px; color: var(--ink-2); margin-top: 8px; }
.pl-desc { font-size: 13px; color: var(--ink-3); margin-top: 10px; max-width: 52ch; }
.pl-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3); margin-top: 14px;
}
.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 10px 20px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .18s, box-shadow .22s, background .22s, border-color .22s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--clay); color: #fff;
  box-shadow: 0 10px 22px -12px rgba(201, 139, 114, .95);
}
.btn-primary:hover { background: var(--clay-deep); box-shadow: 0 14px 26px -12px rgba(176, 114, 90, .95); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--clay); color: var(--clay-deep); background: var(--clay-wash); }
.hint { font-size: 12px; color: var(--ink-3); }

/* ==========================================================================
   分类标签 + 搜索
   ========================================================================== */
.filters {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 30px 0 14px;
  flex-wrap: wrap;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-family: var(--sans); font-size: 13px;
  padding: 6px 14px; border-radius: 999px;
  transition: .2s;
}
.chip:hover { border-color: #dfcdbd; color: var(--ink); }
.chip[aria-selected="true"] {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.chip .chip-count { font-size: 11px; opacity: .62; margin-left: 4px; }

.search-box {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; color: var(--ink-3);
  transition: border-color .2s, box-shadow .2s;
  min-width: 240px;
}
.search-box:focus-within { border-color: var(--clay); box-shadow: 0 0 0 4px rgba(201, 139, 114, .12); }
.search-box input {
  border: 0; outline: 0; background: transparent; flex: 1;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink); min-width: 0;
}
.search-box input::placeholder { color: #b9aba0; }

/* ==========================================================================
   歌曲列表
   ========================================================================== */
.list {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.list-head {
  display: grid;
  grid-template-columns: 54px minmax(0, 1.05fr) minmax(0, 1.5fr) 104px 76px;
  gap: 12px;
  padding: 14px 26px;
  font-size: 11px; letter-spacing: .16em; color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft);
  background: #fffdfa;
}
.list-head .col-idx { text-align: center; }
.list-head .col-act { text-align: right; }
.songs { list-style: none; margin: 0; padding: 8px 10px 14px; }

.song {
  display: grid;
  grid-template-columns: 54px minmax(0, 1.05fr) minmax(0, 1.5fr) 104px 76px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  position: relative;
  cursor: pointer;
  transition: background .2s;
}
.song:hover { background: var(--line-soft); }
.song:focus-visible { outline: 2px solid var(--clay); outline-offset: -2px; }

.song .idx {
  font-family: var(--serif); font-size: 14px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; text-align: center;
}
.song-title { min-width: 0; }
.song-name {
  font-size: 15px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.song-artist { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.song-note {
  font-family: var(--serif); font-size: 12.5px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 6px;
}
.song-note.is-empty { color: #cfc3b9; }
.song-tag {
  justify-self: start;
  font-size: 11.5px; color: var(--ink-2);
  background: var(--line-soft); border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}
.song-tag.is-plain { background: transparent; color: var(--ink-3); border: 1px dashed var(--line); }

.song .act { justify-self: end; }
.copy-btn {
  appearance: none; border: 1px solid transparent; background: transparent;
  color: var(--ink-3); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 6px 10px; border-radius: 999px;
  opacity: .42; transition: .2s;
}
.song:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: #fff; border-color: var(--line); color: var(--clay-deep); }

/* 随机选中的高亮 */
.song.is-picked {
  background: var(--clay-wash);
  box-shadow: inset 3px 0 0 var(--clay);
  animation: picked 1.8s ease-out;
}
@keyframes picked {
  0% { background: #f8e0d1; }
  100% { background: var(--clay-wash); }
}
.song.is-picked .song-name { color: var(--clay-deep); }

/* 复制成功瞬时反馈 */
.song.is-copied { background: #eef4ef; }
.song.is-copied .copy-btn { opacity: 1; color: #4f7a5f; }

.list-foot {
  padding: 0 26px 18px; font-size: 12px; color: var(--ink-3);
}

.empty { padding: 54px 24px 60px; text-align: center; }
.empty-title { font-family: var(--serif); font-size: 17px; color: var(--ink-2); }
.empty-sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

/* 骨架屏 */
.skeleton .song { cursor: default; }
.sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #f2e9e0 25%, #f9f2ea 37%, #f2e9e0 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   页脚 / Toast
   ========================================================================== */
.foot { margin-top: 40px; text-align: center; }
.foot-main { font-family: var(--serif); font-size: 13px; color: var(--ink-2); }
.foot-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 20px);
  background: rgba(61, 53, 49, .94); color: #fdf8f2;
  font-size: 13.5px; padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 18px 36px -16px rgba(61, 53, 49, .8);
  opacity: 0; pointer-events: none; transition: .28s cubic-bezier(.2, .8, .3, 1);
  max-width: min(86vw, 520px); text-align: center;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 900px) {
  .page { padding: 28px 20px 44px; }
  .hero-inner { flex-direction: column; gap: 22px; padding: 28px; }
  .hero-side { width: 100%; flex-direction: row; align-items: stretch; }
  .on-air { flex: 1; }
  .socials { flex: 1; align-content: flex-start; }
  .playlist-card { grid-template-columns: 168px 1fr; gap: 24px; padding: 24px; }
  .search-box { flex: 1 1 100%; }
  .cover { width: 168px; height: 168px; }
  .pl-title { font-size: 25px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .page { padding: 18px 14px 36px; }
  .hero { border-radius: var(--r-md); }
  .hero-inner { padding: 22px 20px; gap: 18px; }
  .identity { gap: 16px; }
  .avatar { width: 68px; height: 68px; border-width: 2px; }
  .live-dot { width: 13px; height: 13px; bottom: 2px; right: 2px; }
  .name { font-size: 25px; }
  .tagline { font-size: 13.5px; }
  .bio { font-size: 12.5px; }
  .stats { margin-top: 14px; }
  .stats li { padding-right: 14px; margin-right: 14px; }
  .stats b { font-size: 16px; }
  .hero-side { flex-direction: column; }
  .on-air { padding: 12px 14px; }

  /* 封面标题改为上下堆叠 */
  .playlist-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
    margin-top: 16px;
    border-radius: var(--r-md);
  }
  .cover-box { display: flex; justify-content: center; }
  .cover { width: 148px; height: 148px; border-radius: 16px; }
  .pl-body { text-align: left; }
  .pl-title { font-size: 22px; }
  .pl-sub { font-size: 14px; }
  .actions { margin-top: 16px; gap: 10px; }
  .btn { padding: 9px 16px; font-size: 13.5px; }
  .hint { display: none; }

  .filters { flex-direction: column; align-items: stretch; gap: 12px; margin: 20px 0 12px; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none; -ms-overflow-style: none;
    scroll-snap-type: x proximity;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; scroll-snap-align: start; }
  .search-box { min-width: 0; width: 100%; }

  .list { border-radius: var(--r-md); }
  .list-head { display: none; }
  .songs { padding: 6px 6px 10px; }

  /* 移动端：两行卡片式 */
  .song {
    grid-template-columns: 30px 1fr auto;
    grid-template-areas:
      "idx title act"
      ".    note  note";
    gap: 2px 8px;
    padding: 12px 10px;
    align-items: start;
  }
  .song .idx { grid-area: idx; padding-top: 2px; font-size: 12.5px; }
  .song-title { grid-area: title; }
  .song-name { font-size: 14.5px; white-space: normal; }
  .song-note {
    grid-area: note; margin-top: 2px; padding-right: 0;
    font-size: 12px; color: var(--ink-3);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal;
  }
  .song-note.is-empty { display: none; }
  .song-tag { display: none; }
  .song .act { grid-area: act; align-self: start; }
  .copy-btn { opacity: .55; padding: 4px 6px; }
  .copy-btn span { display: none; }
  .list-foot { padding: 0 18px 14px; }
  .toast { bottom: 22px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 打印：给主播打印一份歌单 */
@media print {
  .ambient, .hero-side, .actions, .filters, .copy-btn, .toast { display: none !important; }
  body { background: #fff; }
  .hero, .playlist-card, .list { box-shadow: none; border: 1px solid #ddd; }
}

/* hidden 属性会被 .playlist-card / .filters / .stats 的 display 覆盖，统一兜底 */
[hidden] { display: none !important; }
