:root {
  color-scheme: dark;
  --bg: #111312;
  --panel: rgba(31, 35, 34, 0.78);
  --panel-strong: rgba(37, 43, 41, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f4ee;
  --muted: #b6b8b0;
  --soft: #7d837b;
  --teal: #35d0ba;
  --player-accent: #45cfbb;
  --player-accent-strong: #22b69f;
  --player-accent-soft: #8be6d9;
  --coral: #ff725e;
  --amber: #f4ba54;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.36);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(53, 208, 186, 0.22), transparent 26rem),
    radial-gradient(circle at 84% 8%, rgba(255, 114, 94, 0.18), transparent 24rem),
    linear-gradient(145deg, #111312 0%, #171a18 48%, #101413 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

.app-shell {
  position: relative;
  z-index: 1;
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  width: min(600px, 100vw - 24px);
  height: 100vh;
  height: 100dvh;
  min-height: min(760px, 100vh);
  min-height: min(760px, 100dvh);
  margin: 0 auto;
  padding: 1rem;
}

.top-stage {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  min-height: 3.5rem;
  padding: 0 0.35rem;
  overflow: visible;
}

.top-stage h1 {
  grid-column: 1;
  margin: 0;
  color: var(--text);
  font-size: 1.82rem;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 4.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  background:
    linear-gradient(110deg, rgba(53, 208, 186, 0.2), rgba(37, 43, 41, 0.92) 45%, rgba(255, 114, 94, 0.2)),
    var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  overflow: hidden;
}

.quick-search {
  grid-column: 1;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 2.4rem;
  align-items: center;
  min-width: 0;
  min-height: 3.15rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.2rem 0.25rem 0.2rem 0.85rem;
  background: rgba(0, 0, 0, 0.3);
}

.search-symbol {
  width: 1.45rem;
  height: 1.45rem;
  color: var(--muted);
  fill: currentColor;
}

.quick-search input {
  min-width: 0;
  width: 100%;
  height: 2.7rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.quick-search input::placeholder {
  color: var(--muted);
}

.search-submit,
.icon-button,
.transport-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.search-submit {
  width: 2.35rem;
  height: 2.35rem;
  border-color: transparent;
  background: rgba(53, 208, 186, 0.16);
  color: var(--teal);
}

.search-submit.is-loading svg {
  animation: spin 700ms linear infinite;
}

.icon-button {
  width: 2.8rem;
  height: 2.8rem;
}

.search-submit svg,
.icon-button svg,
.transport-button svg {
  width: 1.28rem;
  height: 1.28rem;
  fill: currentColor;
}

.search-submit:hover,
.icon-button:hover,
.transport-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.header-tools {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.tab-button {
  position: relative;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0;
}

.tab-button:hover {
  color: var(--text);
  background: rgba(53, 208, 186, 0.08);
}

.tab-button.active {
  color: var(--text);
}

.tab-button.active::after {
  position: absolute;
  right: 1.25rem;
  bottom: 0;
  left: 1.25rem;
  height: 0.2rem;
  border-radius: 999px 999px 0 0;
  background: var(--teal);
  content: "";
}

.content-area {
  min-height: 0;
  overflow: hidden;
}

.panel-view {
  display: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.panel-view.active {
  display: block;
}

.table-panel,
.player-detail {
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
}

.table-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  padding: 0 1.35rem;
  border-bottom: 1px solid var(--line);
}

.table-title span {
  font-weight: 850;
}

.table-title small {
  min-width: 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-head,
.song-row {
  display: grid;
  grid-template-columns: 3.3rem minmax(0, 1.18fr) minmax(8.5rem, 0.82fr) 3.2rem;
  align-items: center;
}

.table-head {
  min-height: 3.45rem;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
}

.song-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
}

.song-row {
  min-height: 4.7rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  transition: background 160ms ease;
}

.song-row:last-child {
  border-bottom: 0;
}

.song-row:hover,
.song-row.active {
  background: rgba(53, 208, 186, 0.08);
}

.song-row.empty {
  min-height: 7rem;
}

.song-index {
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

.song-select {
  min-width: 0;
  border: 0;
  padding: 0 0.4rem 0 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.song-name,
.artist-name,
.album-note,
.empty-title,
.empty-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-name {
  display: block;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 850;
}

.song-row.active .song-name {
  color: var(--teal);
}

.artist-name {
  color: var(--muted);
  font-size: 0.98rem;
}

.album-note {
  display: block;
  margin-top: 0.24rem;
  color: var(--soft);
  font-size: 0.8rem;
}

.song-menu {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  justify-self: end;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.song-menu:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.13);
}

.song-menu svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.empty-title {
  display: block;
  color: var(--text);
  font-weight: 850;
}

.empty-message {
  min-width: 0;
  grid-column: 2 / 4;
}

.empty-detail {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.player-detail {
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 4vw, 3.5rem);
  overflow: hidden;
}

.album-panel {
  display: grid;
  gap: 1rem;
  min-width: 0;
  align-content: center;
  justify-content: center;
}

.cover-block {
  min-width: 0;
}

.cover-block img {
  width: min(100%, 16rem);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #222725;
}

.player-copy {
  min-width: 0;
}

.player-copy span {
  display: none;
}

.player-copy h2 {
  margin: 0.45rem 0 0.3rem;
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.player-copy p {
  margin: 0 0 1.1rem;
  color: var(--muted);
  line-height: 1.7;
}

.lyrics-panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  height: min(30rem, 100%);
  min-height: 20rem;
  align-self: stretch;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 0, #000 90%, transparent 100%);
}

.lyrics-head {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6rem;
  min-height: 2rem;
  padding: 0;
  text-align: center;
  pointer-events: none;
}

.lyrics-head span {
  display: none;
}

.lyrics-head small {
  position: static;
  max-width: 5.5rem;
  min-width: 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyrics-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  padding: 0.35rem 0 7rem 0.5rem;
  text-align: center;
  scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
  scrollbar-width: thin;
}

.lyrics-list::-webkit-scrollbar {
  width: 7px;
}

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

.lyrics-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.lyric-line,
.lyric-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lyric-line {
  padding: 0.65rem 0;
  color: rgba(182, 184, 176, 0.42);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  font-weight: 800;
  overflow-wrap: anywhere;
  transition: color 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.lyric-line.active {
  color: var(--text);
  opacity: 1;
  transform: scale(1.035);
  transform-origin: center;
}

.lyric-empty {
  padding: 1rem 0;
}

.playback-bar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: 5.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
}

.dock-track {
  display: none;
  grid-template-columns: 3.3rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.dock-track img {
  width: 3.3rem;
  height: 3.3rem;
  object-fit: cover;
  border-radius: 8px;
  background: #222725;
}

.dock-track strong,
.dock-track span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-track strong {
  color: var(--text);
  font-size: 0.98rem;
}

.dock-track span {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.control-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.transport-controls {
  display: grid;
  grid-template-columns: 2.8rem 3rem 2.8rem 2.8rem;
  gap: 0.55rem;
  align-items: center;
}

.transport-button {
  width: 2.8rem;
  height: 2.8rem;
  color: var(--muted);
}

.transport-button.active {
  color: var(--teal);
  border-color: rgba(53, 208, 186, 0.42);
  background: rgba(53, 208, 186, 0.12);
}

.mode-button {
  color: var(--teal);
}

.play-transport {
  width: 3rem;
  height: 3rem;
  color: #09211d;
  border-color: rgba(139, 230, 217, 0.42);
  background: linear-gradient(145deg, var(--player-accent-soft), var(--player-accent));
  box-shadow: 0 8px 20px rgba(34, 182, 159, 0.24);
}

.play-transport:hover {
  border-color: rgba(139, 230, 217, 0.7);
  background: linear-gradient(145deg, #a1eee3, var(--player-accent-strong));
  box-shadow: 0 10px 24px rgba(34, 182, 159, 0.32);
}

input[type="range"] {
  --seek-progress: 0%;
  appearance: none;
  min-width: 0;
  width: 100%;
  height: 0.35rem;
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: linear-gradient(
    to right,
    var(--player-accent) 0,
    var(--player-accent) var(--seek-progress),
    rgba(255, 255, 255, 0.22) var(--seek-progress),
    rgba(255, 255, 255, 0.22) 100%
  );
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--player-accent-soft);
  border-radius: 50%;
  background: var(--player-accent-strong);
  box-shadow: 0 3px 10px rgba(34, 182, 159, 0.36);
}

input[type="range"]::-moz-range-thumb {
  width: 0.78rem;
  height: 0.78rem;
  border: 2px solid var(--player-accent-soft);
  border-radius: 50%;
  background: var(--player-accent-strong);
  box-shadow: 0 3px 10px rgba(34, 182, 159, 0.36);
}

.progress-area {
  display: grid;
  grid-template-columns: 2.8rem minmax(0, 1fr) 2.8rem;
  align-items: center;
  min-width: 0;
  gap: 0.5rem;
}

.time-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-title-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  min-width: 0;
}

.list-refresh {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.list-refresh svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.list-refresh:hover {
  border-color: rgba(69, 207, 187, 0.45);
  background: rgba(69, 207, 187, 0.1);
  color: var(--player-accent-soft);
}

.list-refresh.is-loading svg {
  animation: spin 700ms linear infinite;
}

.list-refresh:disabled {
  cursor: wait;
  opacity: 0.58;
}

.top-actions {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 0;
}

.top-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.25rem;
  min-height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.top-action-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.top-action-button:hover {
  border-color: rgba(69, 207, 187, 0.45);
  background: rgba(69, 207, 187, 0.1);
  color: var(--player-accent-soft);
}

.time-label-end {
  text-align: right;
}

.primary-action,
.ghost-action {
  min-height: 2.8rem;
  border-radius: 8px;
  padding: 0 1rem;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 850;
}

.primary-action {
  background: #2ebba8;
  color: #081614;
}

.ghost-action {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

.primary-action:disabled,
.search-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.quick-search:focus-within {
  border-color: rgba(53, 208, 186, 0.72);
  box-shadow: 0 0 0 3px rgba(53, 208, 186, 0.14);
}

.dynamic-island {
  position: relative;
  grid-column: 2;
  justify-self: center;
  z-index: 50;
  width: min(28rem, 100%);
  transform: scale(0.86);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(4, 5, 5, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: width 280ms ease, border-radius 280ms ease, transform 320ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;
}

.dynamic-island.visible {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.dynamic-island.expanded {
  width: min(30rem, calc(100vw - 32px));
  border-radius: 24px;
}

.island-main {
  display: grid;
  grid-template-columns: 2rem auto minmax(0, 1fr) 2.2rem;
  align-items: center;
  width: 100%;
  min-height: 3.4rem;
  border: 0;
  padding: 0.45rem 0.65rem;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.island-cover {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  background: #202624;
}

.island-status {
  margin-left: 0.7rem;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
}

.island-title {
  min-width: 0;
  margin-left: 0.5rem;
  overflow: hidden;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equalizer {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 0.18rem;
  height: 1.25rem;
}

.equalizer i {
  display: block;
  width: 0.22rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--amber);
  animation: bounce 720ms ease-in-out infinite;
}

.equalizer i:nth-child(2) {
  animation-delay: 120ms;
}

.equalizer i:nth-child(3) {
  animation-delay: 240ms;
}

.dynamic-island:not(.playing) .equalizer i {
  animation-play-state: paused;
  height: 0.3rem;
}

.island-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.85rem;
  gap: 0.75rem;
  align-items: center;
  max-height: 0;
  padding: 0 0.7rem;
  opacity: 0;
  transition: max-height 260ms ease, opacity 180ms ease, padding 260ms ease;
}

.dynamic-island.expanded .island-panel {
  max-height: 5.8rem;
  padding: 0.2rem 0.7rem 0.75rem;
  opacity: 1;
}

.island-panel p {
  margin: 0 0 0.2rem;
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.island-panel span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.island-control {
  width: 2.75rem;
  height: 2.75rem;
}

.history-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(44rem, calc(100vh - 2rem));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #1b201f;
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.56);
}

.history-dialog::backdrop {
  background: rgba(5, 8, 7, 0.72);
  backdrop-filter: blur(6px);
}

.history-dialog-content {
  display: flex;
  flex-direction: column;
  max-height: min(44rem, calc(100vh - 2rem));
  min-height: 20rem;
}

.history-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.history-dialog-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.history-dialog-head small {
  display: block;
  margin-top: 0.24rem;
  color: var(--soft);
}

.history-dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.history-clear,
.history-close {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.history-clear {
  min-height: 2.35rem;
  border-radius: 6px;
  padding: 0 0.8rem;
}

.history-close {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
}

.history-close svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.history-clear:hover,
.history-close:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.history-clear:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.history-table-head {
  flex: 0 0 auto;
}

.history-list {
  flex: 1;
  min-height: 0;
  max-height: 34rem;
}

.support-dialog,
.disclaimer-dialog {
  max-width: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #1b201f;
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.support-dialog {
  width: min(25rem, calc(100vw - 2rem));
}

.disclaimer-dialog {
  width: min(48rem, calc(100vw - 2rem));
  max-height: min(48rem, calc(100vh - 2rem));
}

.support-dialog::backdrop,
.disclaimer-dialog::backdrop {
  background: rgba(5, 8, 7, 0.78);
  backdrop-filter: blur(7px);
}

.support-dialog-content,
.disclaimer-dialog-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.disclaimer-dialog-content {
  max-height: min(48rem, calc(100vh - 2rem));
}

.support-dialog-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.support-dialog-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.support-dialog-head small {
  display: block;
  margin-top: 0.24rem;
  color: var(--soft);
}

.api-unavailable-dialog {
  width: min(26rem, calc(100vw - 2rem));
}

.api-unavailable-body {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  padding: 1.5rem;
  text-align: center;
}

.api-warning-icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: rgba(244, 186, 84, 0.12);
  color: var(--amber);
}

.api-warning-icon svg {
  width: 1.8rem;
  height: 1.8rem;
  fill: currentColor;
}

.api-unavailable-body h3 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
}

.api-unavailable-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.api-unavailable-body strong {
  color: var(--player-accent-soft);
}

.api-unavailable-body .primary-action {
  min-width: 9rem;
}

.sponsor-body {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 1.35rem;
  text-align: center;
}

.sponsor-qr-frame {
  display: grid;
  place-items: center;
  width: min(16rem, 70vw);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: #f5f7f5;
}

.sponsor-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sponsor-qr-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(9, 33, 29, 0.32);
  border-radius: 6px;
  color: #40534f;
  font-weight: 800;
}

.sponsor-qr-fallback[hidden],
.sponsor-qr-frame img[hidden] {
  display: none !important;
}

.sponsor-body p {
  max-width: 20rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.65;
}

.disclaimer-copy {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem 1.35rem;
  scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
}

.disclaimer-copy section + section {
  margin-top: 1rem;
}

.disclaimer-copy h3 {
  margin: 0 0 0.35rem;
  font-size: 0.96rem;
  letter-spacing: 0;
}

.disclaimer-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
}

.disclaimer-copy > p:last-child {
  margin-top: 1.1rem;
}

.disclaimer-warning {
  border-left: 3px solid var(--amber);
  padding: 0.7rem 0.85rem;
  background: rgba(244, 186, 84, 0.08);
  color: var(--text) !important;
}

.disclaimer-consent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--line);
  background: #202624;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  cursor: pointer;
}

.consent-check input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--player-accent);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: min(24rem, calc(100vw - 32px));
  transform: translateY(1rem);
  opacity: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@keyframes bounce {
  0%,
  100% {
    height: 0.38rem;
  }
  50% {
    height: 1.1rem;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: min(100vw - 24px, 600px);
  }

  .player-detail {
    grid-template-columns: minmax(12rem, 0.8fr) minmax(0, 1.2fr);
    align-content: center;
  }
}

@media (max-width: 680px) {
  .app-shell {
    gap: 0.75rem;
    padding: 0.8rem 0.65rem;
  }

  .top-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 18rem) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0 0.2rem;
  }

  .top-stage h1 {
    font-size: 1.38rem;
  }

  .top-action-button {
    width: 2.4rem;
    padding: 0;
  }

  .top-action-button span {
    display: none;
  }

  .dynamic-island {
    grid-column: 2;
    width: 100%;
  }

  .topbar {
    gap: 0.65rem;
    min-height: 4.5rem;
    padding: 0.75rem;
  }

  .icon-button {
    width: 2.55rem;
    height: 2.55rem;
  }

  .tabbar {
    min-height: 3.75rem;
  }

  .tab-button {
    font-size: 0.92rem;
  }

  .table-title {
    min-height: 3rem;
    padding: 0 1rem;
  }

  .table-head,
  .song-row {
    grid-template-columns: 2.7rem minmax(0, 1fr) minmax(6.8rem, 0.78fr) 2.75rem;
  }

  .table-head,
  .song-row {
    padding-right: 0.65rem;
    padding-left: 0.65rem;
  }

  .song-row {
    min-height: 4.55rem;
  }

  .song-name {
    font-size: 0.98rem;
  }

  .artist-name {
    font-size: 0.94rem;
  }

  .playback-bar {
    grid-template-columns: 1fr;
    min-height: 5rem;
    padding: 0.65rem;
  }

  .dock-track {
    display: none;
  }

  .control-strip {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    width: 100%;
  }

  .transport-controls {
    grid-template-columns: 2.55rem 2.85rem 2.55rem 2.55rem;
    gap: 0.45rem;
  }

  .transport-button {
    width: 2.55rem;
    height: 2.55rem;
  }

  .play-transport {
    width: 2.85rem;
    height: 2.85rem;
  }

  .disclaimer-consent {
    grid-template-columns: 1fr;
  }

  .disclaimer-consent .primary-action {
    width: 100%;
  }

}

@media (max-width: 500px) {
  .app-shell {
    grid-template-rows: auto auto auto auto auto;
    height: auto;
    min-height: 100vh;
  }

  .content-area {
    height: 42rem;
  }

  .tab-button {
    font-size: 0.84rem;
  }

  .table-head,
  .song-row {
    grid-template-columns: 2.35rem minmax(0, 1fr) minmax(5.8rem, 0.7fr) 2.55rem;
  }

  .table-head {
    font-size: 0.82rem;
  }

  .song-index,
  .artist-name {
    font-size: 0.88rem;
  }

  .song-menu {
    width: 2.15rem;
    height: 2.15rem;
  }

  .player-detail {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-content: start;
    overflow: auto;
  }

  .cover-block img {
    max-width: 15rem;
  }

  .player-copy h2 {
    font-size: 1.55rem;
  }

  .lyrics-panel {
    height: 17rem;
    min-height: 17rem;
  }
}

@container (max-width: 620px) {
  .top-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 18rem) minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0 0.15rem;
  }

  .top-stage h1 {
    font-size: 1.35rem;
  }

  .dynamic-island {
    grid-column: 2;
    width: 100%;
  }

  .dynamic-island.expanded {
    width: 100%;
  }

  .player-detail {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: center;
    gap: 1.2rem;
    padding: 1.15rem;
  }

  .album-panel {
    grid-template-columns: minmax(0, 16rem);
    justify-items: center;
    justify-content: center;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .cover-block img {
    width: 7.5rem;
  }

  .player-copy h2 {
    font-size: 1.55rem;
  }

  .player-copy p {
    margin-bottom: 0;
  }

  .lyrics-panel {
    height: auto;
    min-height: 18rem;
    justify-self: stretch;
  }

  .playback-bar {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.7rem;
  }

  .control-strip {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    width: 100%;
  }

  .transport-controls {
    grid-template-columns: 2.55rem 2.85rem 2.55rem 2.55rem;
    gap: 0.45rem;
  }

  .transport-button {
    width: 2.55rem;
    height: 2.55rem;
  }

  .play-transport {
    width: 2.85rem;
    height: 2.85rem;
  }

}

@media (max-width: 420px) {
  .control-strip {
    grid-template-columns: 1fr;
  }

  .transport-controls {
    justify-content: center;
  }
}

@media (max-width: 680px) {
  body {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    gap: 0.55rem;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: max(0.55rem, env(safe-area-inset-top)) 0.55rem max(0.55rem, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .top-stage {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 0 0.65rem;
    min-height: 2.6rem;
    padding: 0 0.15rem;
  }

  .top-stage h1 {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    font-size: 1.3rem;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 2;
  }

  .top-action-button {
    width: 2.35rem;
    min-height: 2.35rem;
    padding: 0;
  }

  .top-action-button span {
    display: none;
  }

  .dynamic-island {
    display: none;
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(100%, 19rem);
    max-width: 100%;
  }

  .dynamic-island.visible {
    display: block;
    margin-bottom: 0.45rem;
  }

  .dynamic-island.expanded {
    width: min(100%, 22rem);
  }

  .topbar {
    min-height: 4rem;
    padding: 0.55rem;
  }

  .quick-search {
    min-height: 2.85rem;
  }

  .quick-search input {
    height: 2.45rem;
  }

  .tabbar {
    min-height: 3.25rem;
  }

  .tab-button {
    font-size: 0.82rem;
  }

  .content-area {
    height: auto;
    min-height: 0;
  }

  .player-detail {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: stretch;
    gap: 0.7rem;
    height: 100%;
    min-height: 0;
    padding: 0.85rem;
    overflow-y: auto;
  }

  .album-panel {
    grid-template-columns: minmax(0, 13rem);
    justify-self: stretch;
    justify-items: center;
    gap: 0.55rem;
    width: 100%;
    text-align: center;
  }

  .cover-block img {
    width: 6.75rem;
    max-width: 6.75rem;
  }

  .player-copy h2 {
    margin-top: 0.25rem;
    font-size: 1.35rem;
  }

  .player-copy p {
    font-size: 0.9rem;
  }

  .lyrics-panel {
    width: 100%;
    height: 16rem;
    min-height: 16rem;
  }

  .playback-bar {
    position: relative;
    z-index: 10;
    min-height: 4.5rem;
    padding: 0.55rem;
  }

  .history-dialog,
  .support-dialog,
  .disclaimer-dialog {
    max-height: calc(100dvh - 1rem);
  }

  .disclaimer-dialog-content {
    max-height: calc(100dvh - 1rem);
  }
}

@media (max-width: 420px) {
  .control-strip {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .transport-controls {
    justify-content: center;
  }

  .progress-area {
    grid-template-columns: 2.55rem minmax(0, 1fr) 2.55rem;
  }
}
