:root {
  color-scheme: dark;
  --bg: #0b0d0c;
  --panel: #111512;
  --panel-2: #181d19;
  --line: #2b322c;
  --text: #f5f7f3;
  --muted: #929b94;
  --lime: #c6f36a;
  --lime-ink: #172007;
  --coral: #ff7967;
  --sidebar-width: 218px;
  --queue-width: 304px;
  --player-height: 94px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input { font: inherit; }

button { color: inherit; }

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  height: calc(100vh - var(--player-height));
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--queue-width);
}

.sidebar,
.queue-panel { background: #0f1210; }

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 25px 16px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px 33px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--lime);
  color: var(--lime-ink);
}

.brand-mark svg { width: 20px; }

.main-nav { display: grid; gap: 6px; }

.nav-item {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.nav-item svg { width: 18px; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--lime); }

.source-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: auto 10px 2px;
  color: var(--muted);
  font-size: 12px;
}

.source-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgb(198 243 106 / 9%);
}

.main-content {
  min-width: 0;
  overflow-y: auto;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 27px;
  border-bottom: 1px solid rgb(43 50 44 / 72%);
  background: rgb(11 13 12 / 92%);
  backdrop-filter: blur(14px);
}

.search-form {
  display: flex;
  width: min(580px, 100%);
  height: 42px;
  align-items: center;
  gap: 10px;
  padding-left: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.search-form:focus-within { border-color: var(--lime); }
.search-form > svg { width: 18px; flex: 0 0 auto; color: var(--muted); }

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

.search-form input::placeholder { color: #717a72; }

.search-submit {
  height: 100%;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: var(--lime);
  cursor: pointer;
  font-weight: 700;
}

.search-submit:hover { background: var(--panel-2); }

.icon-button,
.main-play,
.primary-button,
.track-play,
.genre-tab,
.queue-row,
.page-overlay {
  border: 0;
  cursor: pointer;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.icon-button:hover { background: var(--panel-2); color: var(--text); }
.icon-button.active { color: var(--lime); }
.icon-button svg { width: 19px; height: 19px; }
.queue-button { position: relative; margin-left: auto; }

.queue-badge {
  position: absolute;
  top: -1px;
  right: -3px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 9px;
  background: var(--coral);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.mobile-menu { display: none; }

.hero {
  position: relative;
  min-height: 340px;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #0b0d0c 0%, rgb(11 13 12 / 90%) 32%, rgb(11 13 12 / 26%) 72%),
    linear-gradient(0deg, #0b0d0c 0%, transparent 38%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 340px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 42px 46px 58px;
}

.eyebrow,
.section-label {
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 11px 0 13px;
  font-size: clamp(36px, 4.5vw, 64px);
  line-height: 1.03;
}

.hero p {
  max-width: 460px;
  margin: 0 0 24px;
  color: #c0c7c1;
  line-height: 1.7;
}

.primary-button {
  display: inline-flex;
  height: 43px;
  align-items: center;
  gap: 9px;
  padding: 0 17px;
  border-radius: 6px;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 800;
}

.primary-button:hover { background: #d5fa87; }
.primary-button svg { width: 17px; fill: currentColor; }

.catalog { padding: 6px 28px 52px; }

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.catalog-heading h2 { margin: 6px 0 0; font-size: 27px; }
.section-label { color: var(--coral); }
.result-count { color: var(--muted); font-size: 12px; }

.genre-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 23px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.genre-tabs::-webkit-scrollbar { display: none; }

.genre-tab {
  height: 34px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
}

.genre-tab:hover { border-color: #5c665e; color: var(--text); }
.genre-tab.active { border-color: var(--lime); background: var(--lime); color: var(--lime-ink); font-weight: 700; }

.track-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 26px 18px;
}

.track-card { min-width: 0; }

.cover-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--panel-2);
}

.cover-wrap::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(0 0 0 / 50%), transparent 45%);
  content: "";
  opacity: 0;
  transition: opacity .2s ease;
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.track-card:hover .cover-wrap img { transform: scale(1.035); }
.track-card:hover .cover-wrap::after { opacity: 1; }

.track-play {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  box-shadow: 0 8px 22px rgb(0 0 0 / 58%);
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .2s ease, transform .2s ease;
}

.track-play svg { width: 18px; fill: currentColor; }
.track-card:hover .track-play,
.track-card:focus-within .track-play,
.track-card.playing .track-play { opacity: 1; transform: translateY(0); }

.track-info {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}

.track-copy { min-width: 0; flex: 1; }
.track-copy strong,
.track-copy span,
.player-copy strong,
.player-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-copy strong { font-size: 14px; }
.track-copy span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.track-actions { display: flex; flex: 0 0 auto; align-items: center; }
.download-button,
.favorite-button { width: 34px; height: 34px; }
.favorite-button.saved { color: var(--coral); }
.favorite-button.saved svg { fill: currentColor; }

.loading-state,
.empty-state,
.error-state {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--muted);
  text-align: center;
}

.loading-state svg { animation: spin 1s linear infinite; }
.loading-state[hidden] { display: none; }
.empty-state h3,
.error-state h3 { margin: 5px 0 0; color: var(--text); }
.empty-state p,
.error-state p { margin: 0; font-size: 13px; }
.empty-state svg,
.error-state svg { width: 38px; height: 38px; }

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

.queue-panel {
  overflow-y: auto;
  padding: 23px 16px;
  border-left: 1px solid var(--line);
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 17px;
}

.queue-header h2 { margin: 5px 0 0; font-size: 20px; }
.queue-list { display: grid; gap: 5px; }

.queue-row {
  display: grid;
  width: 100%;
  grid-template-columns: 43px minmax(0, 1fr) 27px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.queue-row:hover { background: var(--panel); }
.queue-row.active { background: var(--panel-2); }
.queue-row img { width: 43px; height: 43px; border-radius: 4px; object-fit: cover; }
.queue-row strong,
.queue-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row strong { font-size: 12px; }
.queue-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.queue-index { margin: 0 !important; color: var(--muted); font-size: 11px !important; text-align: center; }
.queue-row.active .queue-index { color: var(--lime); }

.page-overlay { display: none; }

.player-bar {
  position: relative;
  z-index: 50;
  display: grid;
  height: var(--player-height);
  grid-template-columns: minmax(230px, 1fr) minmax(360px, 1.35fr) minmax(160px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 11px 21px;
  border-top: 1px solid var(--line);
  background: #101311;
}

.playing-info { display: flex; min-width: 0; align-items: center; gap: 11px; }
.player-cover-wrap { position: relative; width: 58px; height: 58px; flex: 0 0 auto; }
.player-cover-wrap img { width: 100%; height: 100%; border-radius: 5px; object-fit: cover; }

.playing-bars {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: none;
  height: 14px;
  align-items: end;
  gap: 2px;
  padding: 3px;
  border-radius: 3px;
  background: rgb(0 0 0 / 72%);
}

body.is-playing .playing-bars { display: flex; }
.playing-bars i { width: 2px; height: 35%; background: var(--lime); animation: bars .7s ease-in-out infinite alternate; }
.playing-bars i:nth-child(2) { animation-delay: .2s; }
.playing-bars i:nth-child(3) { animation-delay: .4s; }
@keyframes bars { to { height: 100%; } }

.player-copy { min-width: 0; flex: 1; }
.player-copy strong { font-size: 14px; }
.player-copy span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.player-main { display: grid; gap: 6px; }
.transport { display: flex; align-items: center; justify-content: center; gap: 8px; }
.small-control { width: 32px; height: 32px; }

.main-play {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: #111411;
}

.main-play:hover { background: var(--lime); }
.main-play svg { width: 19px; fill: currentColor; }

.progress-line {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 35px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.range { width: 100%; height: 4px; margin: 0; accent-color: var(--lime); cursor: pointer; }
.volume-box { display: flex; width: min(170px, 100%); align-items: center; justify-self: end; gap: 6px; }

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 112px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #242a25;
  box-shadow: 0 12px 30px rgb(0 0 0 / 55%);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px);
  transition: .2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1240px) {
  :root { --queue-width: 278px; }
  .track-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 74px minmax(0, 1fr) var(--queue-width); }
  .sidebar { padding-inline: 10px; }
  .brand { justify-content: center; margin-inline: 0; }
  .brand-name,
  .nav-item span,
  .source-note { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .hero-content { padding-left: 34px; }
}

@media (max-width: 820px) {
  :root { --player-height: 142px; }
  .app-shell { display: block; height: calc(100vh - var(--player-height)); }
  .main-content { height: 100%; }
  .sidebar,
  .queue-panel {
    position: fixed;
    z-index: 70;
    top: 0;
    bottom: var(--player-height);
    width: min(282px, 86vw);
    transition: transform .22s ease;
  }
  .sidebar { left: 0; transform: translateX(-100%); box-shadow: 20px 0 50px rgb(0 0 0 / 60%); }
  .queue-panel { right: 0; transform: translateX(100%); box-shadow: -20px 0 50px rgb(0 0 0 / 60%); }
  body.menu-open .sidebar,
  body.queue-open .queue-panel { transform: translateX(0); }
  .brand { justify-content: flex-start; margin-inline: 8px; }
  .brand-name,
  .nav-item span,
  .source-note { display: flex; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .page-overlay { position: fixed; z-index: 60; inset: 0 0 var(--player-height); background: rgb(0 0 0 / 52%); }
  body.menu-open .page-overlay,
  body.queue-open .page-overlay { display: block; }
  .mobile-menu { display: inline-grid; }
  .topbar { padding-inline: 16px; }
  .hero { min-height: 315px; }
  .hero-content { min-height: 315px; padding: 34px 25px 52px; }
  .catalog { padding-inline: 18px; }
  .player-bar {
    height: var(--player-height);
    grid-template-columns: minmax(0, 1fr) 42px;
    grid-template-rows: 62px 58px;
    gap: 5px 10px;
    padding: 8px 14px;
  }
  .playing-info { grid-column: 1; grid-row: 1; }
  .player-main { grid-column: 1 / -1; grid-row: 2; }
  .volume-box { grid-column: 2; grid-row: 1; width: 38px; }
  .volume-box .range { display: none; }
}

@media (max-width: 580px) {
  .search-submit { display: none; }
  .search-form { padding-right: 10px; }
  .hero h1 { font-size: 39px; }
  .hero-shade { background: linear-gradient(90deg, #0b0d0c 0%, rgb(11 13 12 / 82%) 67%, rgb(11 13 12 / 26%)), linear-gradient(0deg, #0b0d0c, transparent 48%); }
  .track-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 23px 13px; }
  .catalog-heading h2 { font-size: 23px; }
  .result-count { display: none; }
  .track-play { width: 39px; height: 39px; opacity: 1; transform: none; }
  .player-cover-wrap { width: 50px; height: 50px; }
  .transport { gap: 4px; }
  .toast { right: 16px; bottom: 158px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
