:root {
  --bg: #10100f;
  --surface: rgba(31, 30, 27, .78);
  --line: rgba(255, 243, 220, .1);
  --text: #f4efe7;
  --muted: #a39b8e;
  --soft: #6f695f;
  --accent: #e0af76;
  --accent-soft: rgba(224, 175, 118, .16);
}

* { box-sizing: border-box; }
body {
  height: 100vh; height: 100dvh; margin: 0; overflow: hidden;
  color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 80% -10%, rgba(215, 153, 82, .2), transparent 34rem),
    radial-gradient(circle at -12% 84%, rgba(86, 104, 87, .18), transparent 28rem), var(--bg);
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.radio {
  width: min(100%, 720px); height: 100vh; height: 100dvh; margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) clamp(18px, 5vw, 36px) max(18px, env(safe-area-inset-bottom));
  display: grid; grid-template-rows: auto 1fr auto; gap: 14px; overflow: hidden;
}
.radio.has-lyrics { grid-template-rows: auto minmax(0, 38vh) minmax(180px, 1fr) auto; }

.player-bar { padding: 2px 2px 8px; }
.brand, .section-head, .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.brand { color: var(--accent); display: flex; gap: 7px; align-items: center; }
.brand span:last-child { color: var(--soft); font-weight: 600; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.song-stage { display: flex; align-items: center; gap: 17px; margin: 16px 0 13px; }
.cover-wrap { position: relative; width: 66px; height: 66px; flex: 0 0 auto; }
.cover-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
  opacity: 0; transition: opacity .5s ease; z-index: 1;
}
.cover-art.show { opacity: 1; }
.cover-art.show + .record { opacity: 0; transform: scale(.8); }
.record {
  position: absolute; inset: 0; width: 66px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: repeating-radial-gradient(circle, #20201e 0 2px, #151513 3px 5px, #282621 6px 7px);
  box-shadow: 0 9px 23px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255,255,255,.06);
  transition: box-shadow .6s ease, opacity .4s ease, transform .4s ease; z-index: 0;
}
.record.spinning {
  animation: spin 3s linear infinite;
  box-shadow: 0 9px 32px rgba(224, 175, 118, .18), 0 0 0 2px rgba(224, 175, 118, .09), inset 0 0 0 1px rgba(255,255,255,.06);
}
.record-center { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #402d1c; background: var(--accent); font-size: 11px; font-weight: 800; }

/* 频谱跳动条 */
.viz { display: none; gap: 3px; align-items: flex-end; height: 24px; margin-left: 4px; }
.radio.is-playing .viz { display: flex; }
.viz-bar { width: 3px; border-radius: 3px; background: var(--accent); animation: bounce .72s ease-in-out infinite; }
.viz-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.viz-bar:nth-child(2) { height: 16px; animation-delay: .15s; }
.viz-bar:nth-child(3) { height: 11px; animation-delay: .3s; }
.viz-bar:nth-child(4) { height: 18px; animation-delay: .45s; }
.viz-bar:nth-child(5) { height: 6px; animation-delay: .58s; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 100% { transform: scaleY(1); } 35% { transform: scaleY(.25); } 70% { transform: scaleY(1.35); } }
.song-title.playing + .song-artist ~ * { color: inherit; }
.song-meta { min-width: 0; flex: 1; overflow: hidden; }
.eyebrow { margin: 0 0 5px; color: var(--soft); }
.song-title { overflow: hidden; margin: 0; font-size: clamp(23px, 6vw, 30px); font-weight: 650; letter-spacing: -.04em; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
.song-title.playing { color: var(--accent); }
.song-artist { overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.player-controls { display: flex; align-items: center; gap: 9px; }
.player-controls button { border: 0; color: var(--text); cursor: pointer; transition: transform .18s ease, opacity .18s ease, background .18s ease; }
.player-controls button:active { transform: scale(.94); }
.btn-play { width: 48px; height: 48px; border-radius: 50%; color: #2c1d10 !important; background: var(--accent); box-shadow: 0 8px 20px rgba(224,175,118,.2); font-size: 17px; }
.btn-next { height: 40px; padding: 0 14px; border: 1px solid var(--line) !important; border-radius: 22px; background: rgba(255,255,255,.035); font-size: 13px; }
.btn-next:disabled { cursor: wait; opacity: .45; }
.hidden { display: none !important; }

.lyrics-area, .conversation-panel { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(42,40,35,.75), rgba(21,21,19,.7)); box-shadow: 0 14px 42px rgba(0,0,0,.12); transition: border-color .6s ease; }
.radio.is-playing .lyrics-area { border-color: rgba(224,175,118,.18); }
.section-head { position: relative; z-index: 2; display: flex; justify-content: space-between; padding: 14px 17px 11px; color: var(--accent); }
.section-head > span:last-child { color: var(--soft); font-size: 10px; letter-spacing: .08em; }
.lyrics-content { position: relative; z-index: 1; height: calc(100% - 38px); overflow-y: auto; padding: 30px 24px 42px; text-align: center; scrollbar-width: none; }
.lyrics-content::-webkit-scrollbar, .conversation::-webkit-scrollbar { display: none; }
.lrc-line {
  min-height: 2.45em; color: var(--soft);
  font-size: clamp(15px, 4vw, 17px); line-height: 2.45;
  transition: color .35s ease, transform .35s cubic-bezier(.34,1.56,.64,1), font-weight .35s ease, text-shadow .35s ease, letter-spacing .35s ease;
  position: relative;
}
.lrc-line.active {
  color: #fff; font-size: clamp(18px, 4.7vw, 21px); font-weight: 650;
  transform: scale(1.04);
  text-shadow: 0 0 18px rgba(224,175,118,.35), 0 0 40px rgba(224,175,118,.12);
  letter-spacing: .02em;
}
/* 活跃行底部指示点 */
.lrc-line.active::after {
  content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(224,175,118,.5);
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse { 0%, 100% { opacity: .5; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.6); } }
.lyrics-fade { position: absolute; z-index: 2; right: 0; left: 0; height: 36px; pointer-events: none; }
.lyrics-fade-top { top: 38px; background: linear-gradient(var(--surface), transparent); }
.lyrics-fade-bottom { bottom: 0; background: linear-gradient(transparent, rgba(23,22,20,.96)); }

.conversation-panel { display: flex; flex-direction: column; }
.conversation { min-height: 0; overflow-y: auto; padding: 2px 15px 16px; display: flex; flex-direction: column; gap: 11px; scrollbar-width: none; }
.conv-msg { display: flex; align-items: flex-start; gap: 9px; animation: message-in .28s ease both; }
.conv-msg.user { flex-direction: row-reverse; }
.conv-avatar { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 800; }
.conv-msg.user .conv-avatar { color: var(--text); background: rgba(255,255,255,.08); }
.conv-bubble { max-width: min(82%, 500px); padding: 10px 13px; border: 1px solid transparent; border-radius: 4px 15px 15px; background: rgba(255,255,255,.055); color: var(--text); font-size: 14px; line-height: 1.65; word-break: break-word; }
.conv-msg.user .conv-bubble { border-radius: 15px 4px 15px 15px; background: var(--accent-soft); border-color: rgba(224,175,118,.1); }
.conv-msg.broadcast .conv-bubble { border-color: rgba(224,175,118,.2); background: linear-gradient(135deg, rgba(224,175,118,.14), rgba(255,255,255,.045)); }
.conv-msg.broadcast .conv-bubble::before { content: 'NOW PLAYING'; display: block; margin-bottom: 5px; color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.seg { color: var(--muted); transition: color .25s ease, background .25s ease; }
.seg.active { color: #fff; border-radius: 4px; background: rgba(224,175,118,.24); box-shadow: 0 0 0 2px rgba(224,175,118,.07); }
.seg.done { color: var(--text); }
.live-status { display: flex; align-items: center; gap: 5px; }
.live-status i { width: 6px; height: 6px; border-radius: 50%; background: #75b98b; box-shadow: 0 0 0 4px rgba(117,185,139,.1); }
.live-status.busy i { background: var(--accent); animation: pulse .8s infinite; }

.input-bar { align-self: end; display: flex; align-items: center; gap: 9px; padding: 6px; border: 1px solid var(--line); border-radius: 17px; background: rgba(26,25,23,.82); box-shadow: 0 12px 26px rgba(0,0,0,.18); }
.input-bar:focus-within { border-color: rgba(224,175,118,.45); box-shadow: 0 0 0 3px rgba(224,175,118,.08); }
.input-bar input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 10px 11px; color: var(--text); background: transparent; font-size: 15px; }
.input-bar input::placeholder { color: var(--soft); }
.input-bar button { width: 39px; height: 39px; border: 0; border-radius: 12px; color: #2f2011; background: var(--accent); cursor: pointer; font-size: 20px; line-height: 1; transition: transform .18s ease, opacity .18s ease; }
.input-bar button:disabled { opacity: .5; }
.input-bar button:active { transform: scale(.92); }
audio { display: none; }

@keyframes message-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-height: 680px) { .radio { gap: 9px; padding-top: 14px; } .radio.has-lyrics { grid-template-rows: auto minmax(0, 26vh) minmax(140px, 1fr) auto; } .song-stage { margin: 10px 0; } .record { width: 54px; } .section-head { padding-top: 11px; padding-bottom: 8px; } }
@media (max-width: 390px) { .radio { padding-right: 14px; padding-left: 14px; } .brand span:last-child, .btn-next span { display: none; } .song-title { font-size: 23px; } }
