:root {
  --bg: #121212;
  --bg-elev: #181818;
  --bg-soft: #1f1f1f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --muted: #a7a7a7;
  --dim: #6f6f6f;
  --accent: #e11d48;
  --accent-soft: rgba(225, 29, 72, 0.18);
  --radius: 10px;
  --player-h: 0px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Outfit", "Noto Sans SC", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1080px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover {
  background: rgba(225, 29, 72, 0.5);
}

body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

body.page-listen {
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(225, 29, 72, 0.12), transparent 55%),
    radial-gradient(700px 360px at 90% 8%, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--bg);
  padding-bottom: calc(var(--player-h) + 28px);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

body.page-listen .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.5rem;
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}

.brand-badge {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.45rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fb7185, var(--accent));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.page-listen .nav {
  display: flex;
  gap: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

body.page-listen .nav a {
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.2s var(--ease);
}

body.page-listen .nav a:hover,
body.page-listen .nav a.is-active {
  color: var(--text);
}

body.page-listen .nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.search {
  justify-self: center;
  width: min(100%, 360px);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: #2a2a2a;
  color: var(--dim);
  border: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.search:focus-within {
  border-color: rgba(225, 29, 72, 0.45);
  background: #323232;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search input::placeholder {
  color: var(--dim);
}

.user-slot {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.auth-slot a,
.auth-slot .linkish,
.auth-slot .admin-link {
  color: var(--text);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.auth-slot a:hover,
.auth-slot .linkish:hover,
.auth-slot .admin-link:hover {
  color: #fda4af;
}

.auth-slot .admin-link {
  color: #fda4af;
}

.auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.auth-slot a,
.auth-slot .linkish,
.auth-slot .admin-link {
  color: var(--text);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.auth-slot a:hover,
.auth-slot .linkish:hover,
.auth-slot .admin-link:hover {
  color: #fda4af;
}

.auth-slot .admin-link {
  color: #fda4af;
}

.page {
  width: min(100% - 2.5rem, var(--max));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

.artists {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.artist-card {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 14px;
  padding: 1rem 0.9rem 1.05rem;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.artist-card:hover,
.artist-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(225, 29, 72, 0.45);
  background: #1c1c1c;
}

.artist-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 0.85rem;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
}

.artist-name {
  font-weight: 600;
  margin: 0;
}

.artist-count {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.library {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}

.lyrics-panel {
  position: sticky;
  top: 5.2rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 16px;
  padding: 1rem 1rem 1.15rem;
  min-height: 360px;
}

.lyrics-stage {
  position: relative;
  height: min(58vh, 520px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
}

.lyrics-stage::-webkit-scrollbar {
  width: 6px;
}

.lyrics-stage::-webkit-scrollbar-track {
  background: transparent;
}

.lyrics-stage::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.lyrics-stage::-webkit-scrollbar-thumb:hover {
  background: rgba(225, 29, 72, 0.55);
}

.lyrics-stage::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.lyrics-placeholder {
  margin: 4rem 0 0;
  text-align: center;
  color: var(--dim);
  font-size: 0.92rem;
}

.lyrics-lines {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 2.5rem 0.35rem;
}

.lyrics-line {
  margin: 0;
  color: var(--dim);
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.25s var(--ease);
  opacity: 0.55;
}

.lyrics-line.is-active {
  color: #fff;
  font-size: 1.18rem;
  font-weight: 600;
  opacity: 1;
  transform: scale(1.02);
}

.lyrics-line.is-near {
  color: var(--muted);
  opacity: 0.85;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.linkish {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

.linkish:hover {
  text-decoration: underline;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.song-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.song-row:hover,
.song-row.is-active {
  background: var(--bg-elev);
  border-color: var(--line);
}

.song-row.is-playing .song-title {
  color: #fda4af;
}

.cover {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  flex-shrink: 0;
}

.song-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.song-artist {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.song-action {
  color: var(--muted);
  font-size: 0.86rem;
  min-width: 3rem;
  text-align: right;
}

.song-row.is-playing .song-action,
.song-row:hover .song-action {
  color: var(--accent);
}

.empty {
  color: var(--muted);
  padding: 1.5rem 0.25rem;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.playlist-card {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  padding: 0;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.playlist-card:hover {
  transform: translateY(-2px);
  border-color: rgba(225, 29, 72, 0.4);
}

.playlist-cover {
  aspect-ratio: 1;
}

.playlist-body {
  padding: 0.85rem 0.95rem 1rem;
}

.playlist-body h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.playlist-body p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(280px, 1.6fr) minmax(140px, 0.9fr);
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(24, 24, 24, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.now {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.now-art {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(225, 29, 72, 0.55), transparent 55%),
    linear-gradient(160deg, #2a2a2a, #141414);
  flex-shrink: 0;
}

.now-meta {
  min-width: 0;
}

.now-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-sub {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transport {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ctrl {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.ctrl:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ctrl-main {
  position: relative;
  width: 2.85rem;
  height: 2.85rem;
  background: #fff;
  color: #111;
}

.ctrl-main .icon-play,
.ctrl-main .icon-pause {
  display: block;
}

.ctrl-main .icon-play[hidden],
.ctrl-main .icon-pause[hidden] {
  display: none !important;
}

.ctrl-main:hover {
  background: #fff;
  transform: scale(1.04);
}

.progress {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.progress input[type="range"],
.vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  outline: none;
  cursor: pointer;
}

.progress input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) var(--seek-pct, 0%),
    #3a3a3a var(--seek-pct, 0%),
    #3a3a3a 100%
  );
}

.vol input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #3a3a3a;
}

.progress input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #3a3a3a;
}

.progress input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.vol input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: #3a3a3a;
}

.progress input[type="range"]::-webkit-slider-thumb,
.vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.vol input[type="range"]::-webkit-slider-thumb {
  margin-top: -5px;
  width: 12px;
  height: 12px;
}

.progress input[type="range"]::-moz-range-thumb,
.vol input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 0;
}

.extras {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.vol {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: min(100%, 140px);
  color: var(--muted);
}

@media (max-width: 920px) {
  body.page-listen .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand user"
      "nav nav"
      "search search";
    gap: 0.75rem;
  }

  body.page-listen .brand { grid-area: brand; }
  body.page-listen .nav { grid-area: nav; overflow-x: auto; }
  body.page-listen .search { grid-area: search; width: 100%; justify-self: stretch; }
  body.page-listen .user-slot { grid-area: user; }

  .library {
    grid-template-columns: 1fr;
  }

  .lyrics-panel {
    position: static;
    min-height: 280px;
  }

  .lyrics-stage {
    height: 280px;
  }

  .player {
    grid-template-columns: 1fr;
    height: auto;
    padding: 0.75rem 1rem 0.9rem;
    gap: 0.55rem;
  }

  .extras {
    display: none;
  }

  .now-art {
    width: 44px;
    height: 44px;
  }
}

.guest-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}

.guest-gate[hidden] {
  display: none;
}

.guest-gate-card {
  width: min(100%, 380px);
  padding: 1.35rem 1.4rem 1.25rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #222 0%, #171717 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.guest-gate-card h3 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
}

.guest-gate-card p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.guest-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: var(--accent);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 1.5rem, var(--max));
  }

  .guest {
    display: none;
  }

  .song-row {
    grid-template-columns: 48px 1fr;
  }

  .song-action {
    display: none;
  }
}
