/* ============================================================
   龙泉古镇·戏剧幻城 — 景区原创音乐站
   国风写意 · 宣纸风 前端样式
   ============================================================ */
:root {
  --paper:   #F5F0E4;
  --paper-2: #EDE6D6;
  --ink:     #2B2B28;
  --ink-2:   #6E6A60;
  --ink-3:   #8A867C;
  --line:    #C9C2B0;
  --cinnabar: #A93B32;   /* 主题色，后台可覆盖 */
  --gold:    #9C7A28;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(43, 43, 40, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
a { color: var(--cinnabar); }
::selection { background: rgba(169, 59, 50, 0.18); }

/* ---------- 背景层：宣纸底纹 + 景区背景图 + 洗练遮罩 ---------- */
.bg-layer { position: fixed; inset: 0; z-index: -2; background: var(--paper); }
.bg-layer.has-image { background-size: cover; background-position: center; background-repeat: no-repeat; }
.bg-wash {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% 30%, rgba(245, 240, 228, 0.35), rgba(245, 240, 228, 0.92) 75%),
    linear-gradient(180deg, rgba(245, 240, 228, 0.55), rgba(245, 240, 228, 0.88));
  opacity: var(--bg-overlay, 0.55);
  transition: opacity 0.4s;
}
.paper-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.ink-stain {
  position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  filter: blur(60px); opacity: 0.06;
  background: radial-gradient(circle, #6E6A60, transparent 70%);
}
.ink-stain.s1 { width: 40vw; height: 40vw; top: -12vw; right: -10vw; }
.ink-stain.s2 { width: 46vw; height: 46vw; bottom: -16vw; left: -14vw; }

/* ---------- PC 对联装饰 ---------- */
.couplet { display: none; }
@media (min-width: 1280px) {
  .couplet {
    display: block; position: fixed; top: 50%; transform: translateY(-50%); z-index: 0;
    writing-mode: vertical-rl; font-family: var(--serif); font-size: 15px;
    letter-spacing: 0.6em; color: var(--ink-3); user-select: none;
  }
  .couplet.left  { left: 46px; }
  .couplet.right { right: 46px; }
}

/* ---------- 主舞台 ---------- */
.stage {
  position: relative; z-index: 1;
  max-width: 1060px; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px 40px;
}

/* 品牌头 */
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 2px 18px; }
.brand .seal {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: var(--cinnabar); color: var(--paper);
  font-family: var(--serif); font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(245, 240, 228, 0.35), inset 0 0 0 4px var(--cinnabar), inset 0 0 0 5px rgba(245, 240, 228, 0.35);
}
.brand h1 { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.04em; }
.brand p { font-size: 12px; color: var(--ink-2); letter-spacing: 0.12em; margin-top: 1px; }
.brand .stamp {
  margin-left: auto; font-family: var(--serif); font-size: 11px; color: var(--cinnabar);
  border: 1px solid var(--cinnabar); border-radius: 6px; padding: 3px 8px;
  writing-mode: vertical-rl; letter-spacing: 0.2em; line-height: 1.1; height: 44px;
}

/* ---------- 播放器 ---------- */
.player {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 20px 22px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.player::before {
  content: ""; display: block; width: 34px; height: 3px; margin: 0 auto 18px;
  background: var(--cinnabar); border-radius: 2px; opacity: 0.85;
}

.disc-wrap { position: relative; width: min(74vw, 290px); aspect-ratio: 1; margin: 4px auto 20px; }
.disc {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #34302A 0 1.5px, #282420 1.5px 4.5px),
    #2C2823;
  box-shadow: 0 8px 24px rgba(43, 43, 40, 0.25);
  animation: spin 16s linear infinite; animation-play-state: paused;
}
.disc-wrap.playing .disc { animation-play-state: running; }
.disc::after {
  content: ""; position: absolute; inset: 46%; border-radius: 50%;
  background: var(--paper); box-shadow: 0 0 0 1px var(--line);
}
@keyframes spin { to { transform: rotate(360deg); } }

.cover {
  position: absolute; left: 0; top: 12%; width: 64%; aspect-ratio: 1;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px rgba(43, 43, 40, 0.28);
  background: var(--paper-2);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }

.np-info { text-align: center; margin-bottom: 14px; }
.np-info h2 {
  font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-info p { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; letter-spacing: 0.06em; }

/* 歌词 */
.lyrics {
  height: 76px; overflow: hidden; text-align: center; margin: 2px 0 10px;
  display: flex; flex-direction: column; justify-content: center; gap: 7px;
  mask-image: linear-gradient(180deg, transparent, #000 32%, #000 68%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 32%, #000 68%, transparent);
}
.lyric-line {
  font-size: 13px; color: var(--ink-3); line-height: 1.5;
  transition: color 0.3s, transform 0.3s, opacity 0.3s;
  opacity: 0.55; transform: scale(0.94); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lyric-line.on { color: var(--cinnabar); font-family: var(--serif); font-size: 15px; opacity: 1; transform: scale(1); }
.lyric-line.empty { cursor: default; }

/* 进度条 */
.progress { padding: 2px 2px 0; }
.bar { height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.bar-track { position: relative; width: 100%; height: 3px; border-radius: 2px; background: var(--line); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--ink); }
.bar-dot {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px; border-radius: 50%;
  background: var(--cinnabar); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(169, 59, 50, 0.14);
  transition: box-shadow 0.2s;
}
.bar.dragging .bar-dot { box-shadow: 0 0 0 7px rgba(169, 59, 50, 0.2); }
.times { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: -2px; }

/* 控制区 */
.controls { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 16px; }
.btn-icon {
  width: 46px; height: 46px; border-radius: 50%; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s; position: relative;
}
.btn-icon svg { width: 22px; height: 22px; }
.btn-icon.on { color: var(--cinnabar); }
.btn-icon.on::after {
  content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--cinnabar);
}
.btn-play {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--cinnabar); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  margin: 0 8px; box-shadow: 0 8px 20px rgba(169, 59, 50, 0.32);
  transition: transform 0.15s, opacity 0.2s;
}
.btn-play:active { transform: scale(0.93); }
.btn-play svg { width: 26px; height: 26px; }
.btn-play.loading { opacity: 0.65; }
.btn-play .icon-pause { display: none; }
.player.playing .btn-play .icon-play { display: none; }
.player.playing .btn-play .icon-pause { display: block; }

/* 操作行 */
.actions { display: flex; gap: 10px; }
.btn-download {
  flex: 1; height: 46px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 14px; letter-spacing: 0.12em;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-download:active { transform: scale(0.98); opacity: 0.9; }
.btn-download svg { width: 17px; height: 17px; }
.btn-ghost {
  height: 46px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.5);
  font-size: 13px; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.btn-ghost svg { width: 16px; height: 16px; }
.btn-ghost:active { background: var(--paper-2); }

/* ---------- 歌曲列表 ---------- */
.list-section { margin-top: 26px; }
.list-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list-head h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: 0.06em; }
.list-head h3 small { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; width: 170px;
}
.search svg { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.search input { border: none; outline: none; background: none; font-size: 13px; width: 100%; }
.search input::placeholder { color: var(--ink-3); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 14px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.55); color: var(--ink-2);
  transition: all 0.2s; letter-spacing: 0.04em;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.song-list { display: flex; flex-direction: column; gap: 8px; }
.song-row {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
  background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; text-align: left; width: 100%;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.song-row:active { transform: scale(0.985); }
.song-row.on { border-color: var(--cinnabar); background: rgba(255, 255, 255, 0.9); }
.song-row .thumb { position: relative; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.song-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.song-row .meta { min-width: 0; }
.song-row .meta h4 {
  font-family: var(--serif); font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.song-row.on .meta h4 { color: var(--cinnabar); }
.song-row .meta p { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.song-row .side .dur { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.song-row .side .plays { font-size: 10.5px; color: var(--ink-3); }
.song-row .dl {
  font-size: 11px; color: var(--cinnabar); border: 1px solid var(--cinnabar);
  border-radius: 999px; padding: 3px 10px; letter-spacing: 0.05em;
}
.song-row .dl:active { background: rgba(169, 59, 50, 0.1); }

/* 播放中的均衡器动效 */
.eq { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.song-row.on.playing .eq { display: flex; }
.song-row.on.playing .side .dur { display: none; }
.eq i { width: 3px; background: var(--cinnabar); border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(1) { height: 5px;  animation-delay: 0s; }
.eq i:nth-child(2) { height: 11px; animation-delay: 0.25s; }
.eq i:nth-child(3) { height: 7px;  animation-delay: 0.5s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

.list-empty { text-align: center; padding: 48px 0; color: var(--ink-3); font-size: 13px; }
.list-empty .seal-ghost {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 12px;
  border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 22px; color: var(--ink-3);
}

/* ---------- 页脚 ---------- */
.footer { text-align: center; margin-top: 34px; padding-bottom: env(safe-area-inset-bottom); }
.footer .line { width: 60px; height: 1px; background: var(--line); margin: 0 auto 12px; }
.footer p { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.14em; }
.footer .qr-hint { margin-top: 6px; font-size: 10.5px; color: var(--ink-3); opacity: 0.8; }

/* ---------- 播放列表面板 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 40; background: rgba(43, 43, 40, 0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}
.mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--paper); border-radius: 20px 20px 0 0;
  max-height: 72dvh; display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0.24, 1);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
}
.sheet.show { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; padding: 14px 18px 10px; }
.sheet-head h3 { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.sheet-head .count { font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.sheet-head .close { margin-left: auto; color: var(--ink-2); font-size: 20px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.sheet-body { overflow-y: auto; padding: 4px 14px 18px; -webkit-overflow-scrolling: touch; }
.sheet .song-row { background: rgba(255, 255, 255, 0.75); }
@media (min-width: 960px) {
  .sheet { max-width: 460px; left: auto; right: 24px; bottom: 24px; border-radius: 18px; border: 1px solid var(--line); }
  .sheet.show { transform: translateY(0); }
  .sheet:not(.show) { transform: translateY(calc(100% + 40px)); }
}

/* ---------- 微信下载引导浮层（页内） ---------- */
.wx-modal {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(43, 43, 40, 0.45); backdrop-filter: blur(3px);
}
.wx-modal.show { display: flex; }
.wx-modal .card {
  width: 100%; max-width: 400px; background: var(--paper);
  border-radius: 18px; padding: 26px 22px; text-align: center;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: pop 0.3s cubic-bezier(0.34, 1.4, 0.5, 1);
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }
.wx-modal h3 { font-family: var(--serif); font-size: 17px; margin-bottom: 8px; }
.wx-modal p { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-bottom: 16px; }
.wx-modal .row { display: flex; gap: 10px; }
.wx-modal .row .btn-download, .wx-modal .row .btn-ghost { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; z-index: 80;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper);
  font-size: 13px; padding: 10px 20px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
  max-width: 82vw; text-align: center;
}
.toast.show { opacity: 0.94; transform: translateX(-50%) translateY(0); }

/* ---------- 桌面双栏 ---------- */
@media (min-width: 960px) {
  .stage { display: grid; grid-template-columns: 400px 1fr; gap: 28px; align-items: start; padding-top: 34px; }
  .brand { grid-column: 1 / -1; padding-bottom: 8px; }
  .player { position: sticky; top: 28px; }
  .list-section { margin-top: 0; }
  .disc-wrap { width: min(300px, 78%); }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .disc { animation: none !important; }
  * { transition-duration: 0.01s !important; }
}
