:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --line: #dfe6ee;
  --text: #111827;
  --muted: #6b7280;
  --soft: #eef3f7;
  --accent: #0b1220;
  --good: #c9f7dc;
  --danger: #ffe0e0;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

button.secondary,
.controls button,
.recommend-actions button {
  background: var(--soft);
  color: var(--text);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 14px 18px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 34px;
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: 0;
}

.brand i {
  display: inline-block;
  width: 3px;
  height: 34px;
  background: currentColor;
  transform: translateY(2px);
}

.sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.nav a {
  min-width: 58px;
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--soft);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 12px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 0 18px 28px;
}

.now,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.now {
  grid-column: 1 / -1;
}

.side {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
}

.section-kicker {
  color: #8a99aa;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title {
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 900;
}

.now-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.now-card.empty {
  display: block;
  min-height: 58px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.song-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.song-meta,
.muted {
  min-width: 0;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.progress {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.controls button {
  min-width: 46px;
}

.volume {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 100%);
  color: var(--muted);
  font-weight: 800;
}

.volume span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.volume input {
  min-width: 150px;
  padding: 0;
}

.identity,
.row,
.segmented {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
}

.identity input {
  max-width: 180px;
}

.identity button,
.row button {
  width: 86px;
  min-width: 86px;
  padding-right: 8px;
  padding-left: 8px;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
}

.segmented {
  border-radius: 8px;
  padding: 4px;
  background: var(--soft);
}

.segmented button {
  flex: 1;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #fff;
  color: var(--text);
}

.list {
  display: grid;
  gap: 8px;
}

.song-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.song-card > div {
  min-width: 0;
}

.song-card .thumb {
  width: 72px;
  height: 72px;
}

.song-card .song-title {
  display: -webkit-box;
  max-height: 2.6em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.compact .song-card {
  grid-template-columns: 54px minmax(0, 1fr);
  padding: 8px;
}

.compact .thumb {
  width: 54px;
  height: 54px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.card-actions button {
  min-height: 34px;
  max-width: 100%;
  padding: 7px 9px;
  font-size: 13px;
}

.card-actions button.secondary {
  background: var(--soft);
  color: var(--text);
}

.recommend-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.recommend-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.recommend-actions label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.recommend-actions input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.player-view {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 0 18px 28px;
}

.youtube-frame {
  width: 100%;
  margin: 12px 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #000;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 800;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .brand {
    font-size: 30px;
  }

  .brand i {
    height: 30px;
  }

  .identity input {
    max-width: none;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .topbar {
    padding: 12px 10px 10px;
  }

  .layout,
  .player-view {
    padding: 0 10px 22px;
  }

  .now,
  .panel {
    padding: 12px;
  }

  .brand {
    font-size: 26px;
  }

  .brand i {
    width: 3px;
    height: 26px;
  }

  .nav a {
    min-width: 50px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .section-title {
    font-size: 17px;
  }

  .row {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .identity button,
  .row button {
    width: 76px;
    min-width: 76px;
    font-size: 14px;
  }

  .now-card,
  .song-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 9px;
  }

  .thumb,
  .song-card .thumb {
    width: 64px;
    height: 64px;
  }

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

  .compact .song-card {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .compact .thumb {
    width: 50px;
    height: 50px;
  }

  .controls {
    gap: 6px;
  }

  .controls button {
    min-width: 42px;
    padding: 8px 10px;
  }

  .volume {
    flex-basis: 100%;
    min-width: 0;
  }
}
