:root {
  color-scheme: dark;
  --bg: #080d1a;
  --bg-soft: #0e1528;
  --panel: rgba(20, 29, 54, 0.72);
  --panel-strong: rgba(17, 26, 48, 0.94);
  --border: rgba(165, 190, 255, 0.13);
  --border-strong: rgba(165, 190, 255, 0.24);
  --text: #f2f6ff;
  --muted: #94a1c4;
  --muted-strong: #b8c4e4;
  --accent: #56e1ff;
  --accent-soft: rgba(86, 225, 255, 0.12);
  --pink: #ff6ec7;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 132px;
  color: var(--text);
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 12% -8%, rgba(70, 104, 255, 0.28), transparent 38%),
    radial-gradient(circle at 92% 8%, rgba(255, 110, 199, 0.16), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(32, 198, 189, 0.08), transparent 40%),
    linear-gradient(180deg, #0a1020 0%, #080d1a 55%, #070b16 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.32;
}

.ambient-one {
  top: -210px;
  left: -140px;
  background: #3553ff;
}

.ambient-two {
  top: 18%;
  right: -220px;
  background: #c93c9e;
  opacity: 0.18;
}

.page {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 10px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  color: #07101e;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #8ff4ff 0%, #56e1ff 34%, #7d6bff 68%, #ff6ec7 100%);
  box-shadow: 0 12px 32px rgba(86, 225, 255, 0.22);
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.brand-copy h1 span {
  color: var(--muted);
  font-size: 0.54em;
  font-weight: 500;
  letter-spacing: 0;
}

.brand-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.source-state {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.035);
}

.source-state.stale {
  color: #ffd18b;
  border-color: rgba(255, 209, 139, 0.32);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-ghost {
  color: var(--muted-strong);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.button-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
}

.button-primary {
  color: #06111f;
  background: linear-gradient(135deg, #8ff4ff, #56e1ff 55%, #78b7ff);
}

.button-icon {
  font-size: 15px;
  line-height: 1;
}

.toolbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 26px 0 20px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(11, 17, 35, 0.78);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.search-box {
  display: flex;
  flex: 1 1 320px;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 15px;
  border: 1px solid rgba(165, 190, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 160ms ease, background 160ms ease;
}

.search-box:focus-within {
  border-color: rgba(86, 225, 255, 0.48);
  background: rgba(86, 225, 255, 0.055);
}

.search-icon {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transform: translateY(-1px);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #6f7c9f;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.switch-line input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #273250;
  transition: background 160ms ease;
}

.switch-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #95a1bf;
  transition: transform 160ms ease, background 160ms ease;
}

.switch-line input:checked + .switch-track {
  background: #2f6bff;
}

.switch-line input:checked + .switch-track .switch-dot {
  transform: translateX(16px);
  background: #fff;
}

.switch-line input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.stats {
  flex: 1 1 230px;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}

.content {
  min-height: 58vh;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 60px 24px;
  border: 1px dashed rgba(165, 190, 255, 0.17);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.025);
}

.state h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 19px;
}

.state p {
  max-width: 580px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.loading-state {
  gap: 16px;
  min-height: 280px;
}

.loading-state p {
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(86, 225, 255, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.error-state .button {
  margin-top: 20px;
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}

.song-section-title {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.song-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(26, 37, 67, 0.78), rgba(13, 20, 39, 0.94));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  animation: card-in 260ms ease both;
}

.song-card:hover {
  transform: translateY(-3px);
  border-color: rgba(86, 225, 255, 0.32);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.3);
}

.song-card.is-playing {
  border-color: rgba(86, 225, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(86, 225, 255, 0.14), 0 20px 44px rgba(22, 172, 206, 0.16);
}

.cover {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #25355f 0%, #111a30 70%);
}

.cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 48%, rgba(5, 9, 18, 0.64) 100%);
  pointer-events: none;
}

.cover-letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.15);
  font-size: 62px;
  font-weight: 800;
  letter-spacing: -0.06em;
  background:
    radial-gradient(circle at 28% 22%, rgba(86, 225, 255, 0.18), transparent 36%),
    radial-gradient(circle at 78% 80%, rgba(255, 110, 199, 0.16), transparent 42%);
}

.cover-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 240ms ease;
}

.cover-img.is-loaded {
  opacity: 1;
}

.type-badge,
.new-badge {
  position: absolute;
  z-index: 3;
  top: 10px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.4;
  backdrop-filter: blur(8px);
}

.type-badge {
  left: 10px;
  color: #bfefff;
  background: rgba(5, 12, 25, 0.65);
}

.type-badge.type-dx {
  color: #ffc3e7;
  border-color: rgba(255, 110, 199, 0.36);
}

.new-badge {
  right: 10px;
  color: #ffe2a8;
  border-color: rgba(255, 209, 139, 0.4);
  background: rgba(42, 29, 10, 0.65);
}

.song-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 13px 14px 15px;
}

.song-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.song-artist {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 1px;
}

.meta-pill {
  padding: 2px 6px;
  border-radius: 5px;
  color: #7f8cae;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.045);
}

.meta-pill.meta-banquet {
  color: #ffd18a;
  background: rgba(255, 178, 58, 0.14);
}

.levels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.level-chip {
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #b8c4e4;
  font-size: 9.5px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.04);
}

.level-chip.lv-0 {
  color: #9edcff;
  border-color: rgba(86, 225, 255, 0.16);
  background: rgba(86, 225, 255, 0.07);
}

.level-chip.lv-1 {
  color: #a9f0bc;
  border-color: rgba(80, 220, 130, 0.16);
  background: rgba(80, 220, 130, 0.07);
}

.level-chip.lv-2 {
  color: #ffe399;
  border-color: rgba(255, 209, 90, 0.16);
  background: rgba(255, 209, 90, 0.07);
}

.level-chip.lv-3 {
  color: #ffb7a0;
  border-color: rgba(255, 125, 95, 0.18);
  background: rgba(255, 125, 95, 0.08);
}

.level-chip.lv-4 {
  color: #e6b8ff;
  border-color: rgba(196, 125, 255, 0.2);
  background: rgba(196, 125, 255, 0.08);
}

.level-chip.lv-5 {
  color: #ffc4e8;
  border-color: rgba(255, 110, 199, 0.2);
  background: rgba(255, 110, 199, 0.08);
}

.card-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(86, 225, 255, 0.16);
  border-radius: 9px;
  color: #bfefff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  background: rgba(86, 225, 255, 0.07);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.card-play:hover:not(:disabled) {
  border-color: rgba(86, 225, 255, 0.38);
  background: rgba(86, 225, 255, 0.12);
}

.card-play:disabled,
.card-play.is-disabled {
  color: #7180a6;
  cursor: default;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.song-card.is-playing .card-play {
  color: #ffd0ec;
  border-color: rgba(255, 110, 199, 0.35);
  background: rgba(255, 110, 199, 0.12);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 26px 0 8px;
}

.page-info {
  min-width: 100px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.player {
  position: fixed;
  bottom: 16px;
  left: 50%;
  z-index: 40;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(320px, 1.7fr);
  align-items: center;
  gap: 14px;
  width: min(1100px, calc(100% - 32px));
  padding: 10px 14px;
  border: 1px solid rgba(165, 190, 255, 0.18);
  border-radius: 18px;
  background: rgba(12, 19, 38, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateX(-50%);
}

.player-cover {
  position: relative;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #26365f, #121a30);
}

.player-cover .cover-letter {
  font-size: 22px;
}

.player-cover img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 200ms ease;
}

.player-cover img.is-loaded {
  opacity: 1;
}

.player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.player-info strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(86, 225, 255, 0.22);
  border-radius: 50%;
  color: #07101e;
  cursor: pointer;
  font-size: 13px;
  background: linear-gradient(135deg, #8ff4ff, #56e1ff);
}

.time {
  min-width: 34px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seek {
  flex: 1;
  min-width: 80px;
  height: 4px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 98px;
  left: 50%;
  z-index: 60;
  max-width: min(90vw, 420px);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  background: rgba(17, 26, 48, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .page {
    width: min(1440px, calc(100% - 28px));
    padding-top: 24px;
  }

  .hero {
    align-items: flex-start;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 16px;
  }

  .brand-copy p {
    display: none;
  }

  .source-state {
    display: none;
  }

  .stats {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }

  .player {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px 12px;
  }

  .player-cover {
    width: 48px;
    height: 48px;
  }

  .player-controls {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: 170px;
  }

  .page {
    width: calc(100% - 20px);
  }

  .hero {
    gap: 10px;
  }

  .brand {
    gap: 11px;
  }

  .brand-copy h1 {
    font-size: 25px;
  }

  .hero-actions .button {
    width: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 0;
  }

  .hero-actions .button-icon {
    font-size: 17px;
  }

  .toolbar {
    top: 8px;
    gap: 9px;
    padding: 9px;
    border-radius: 15px;
  }

  .search-box {
    flex-basis: 100%;
    height: 42px;
  }

  .song-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .song-body {
    padding: 10px 10px 12px;
  }

  .song-title {
    font-size: 13px;
  }

  .level-chip,
  .meta-pill {
    font-size: 9px;
  }

  .card-play {
    padding: 7px 6px;
    font-size: 10px;
  }

  .player {
    bottom: 8px;
    width: calc(100% - 16px);
    padding: 9px 10px;
    border-radius: 15px;
  }
}
