/* ============================================================================
   HALO Music — stylesheet
   Rewritten 2026-09-22. Replaces the previous 3.9k-line file that had grown
   ~8 stacked, mutually contradictory override layers for the mobile playback
   view. This file has ONE rule per concern, driven by explicit state:

     html[data-theme="dark|light"]                colour scheme
     body.auth-gated                              login gate
     body[data-mobile-view="search|lyrics|me"]    mobile view router
     .modal-backdrop.show                         modal visibility
     .player-panel.is-playing                     disc rotation
     .playlist-panel.mobile-playlist-overview / .mobile-playlist-detail
     .workspace-search-open / .workspace-library-open / .workspace-library-only

   Layout contract
   ---------------
   Desktop (>=761px)  full-bleed "focus" stage: disc, title, transport, lyrics.
                      Search + library live inside the workspace dialog.
   Mobile  (<=760px)  app shell: header / view / bottom nav. The lyrics view
                      renders the queue with an overlay carrying the draggable
                      current-lyric card and a now-playing transport bar.
   ========================================================================== */

/* ---------------------------------------------------------------- 1. tokens */

:root {
  --bg: #0a0c0f;
  --header-bg: rgba(10, 12, 15, .82);
  --surface-1: #12151a;
  --surface-2: #171b21;
  --surface-3: #1e232b;
  --surface-4: #262d36;
  --line: rgba(238, 243, 231, .09);
  --line-strong: rgba(238, 243, 231, .17);

  --text: #eef1ea;
  --text-sub: #99a194;
  /* Was #6b7268 — only 3.0-3.9:1 on the dark surfaces, which is what made the
     secondary text read as muddy. Now 4.9:1 on rows and 5.7:1 on the page. */
  --text-dim: #8a9186;

  --accent: #c8ee62;
  --accent-hi: #dcff86;
  --accent-ink: #10140a;
  --accent-soft: rgba(200, 238, 98, .13);
  --accent-line: rgba(200, 238, 98, .34);
  --glow: rgba(200, 238, 98, .2);

  --danger: #ef7f92;
  --danger-soft: rgba(239, 127, 146, .14);
  --danger-line: rgba(239, 127, 146, .42);
  --info: #8ba9ff;

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 10px 28px rgba(0, 0, 0, .45);
  --sh-3: 0 28px 72px rgba(0, 0, 0, .62);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --t: .16s var(--ease);

  --header-h: 58px;
  --nav-h: 62px;

  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
          "Segoe UI", Roboto, sans-serif;
  --font-num: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #eef1ea;
  --header-bg: rgba(246, 248, 242, .88);
  --surface-1: #ffffff;
  --surface-2: #f7f9f3;
  --surface-3: #eef2e7;
  --surface-4: #e3e9d8;
  --line: rgba(28, 38, 26, .11);
  --line-strong: rgba(28, 38, 26, .2);

  --text: #1a211a;
  --text-sub: #4f5949;
  /* Was #87917f — only 2.9:1 on the light background. Both tokens were pulled
     down together so the sub > dim hierarchy survives. */
  --text-dim: #5c6658;

  --accent: #4f7a1c;
  --accent-hi: #3d6112;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 122, 28, .1);
  --accent-line: rgba(79, 122, 28, .32);
  --glow: rgba(79, 122, 28, .16);

  --danger: #c65069;
  --danger-soft: rgba(198, 80, 105, .12);
  --danger-line: rgba(198, 80, 105, .4);
  --info: #3f6bd8;

  --sh-1: 0 1px 2px rgba(40, 52, 38, .08);
  --sh-2: 0 10px 28px rgba(40, 52, 38, .13);
  --sh-3: 0 28px 72px rgba(40, 52, 38, .2);
}

/* ------------------------------------------------------------ 2. reset/base */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

body {
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; }

img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Quiet, themed scrollbars everywhere the app scrolls. */
.search-results-mini,
.playlist-main,
.playlist-list,
.lyrics-container,
.workspace-content,
.modal {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-line) transparent;
}
.search-results-mini::-webkit-scrollbar,
.playlist-main::-webkit-scrollbar,
.playlist-list::-webkit-scrollbar,
.lyrics-container::-webkit-scrollbar,
.workspace-content::-webkit-scrollbar,
.modal::-webkit-scrollbar { width: 6px; height: 6px; }
.search-results-mini::-webkit-scrollbar-thumb,
.playlist-main::-webkit-scrollbar-thumb,
.playlist-list::-webkit-scrollbar-thumb,
.lyrics-container::-webkit-scrollbar-thumb,
.workspace-content::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
  border-radius: var(--r-pill);
  background: var(--accent-line);
}
.search-results-mini::-webkit-scrollbar-track,
.playlist-main::-webkit-scrollbar-track,
.playlist-list::-webkit-scrollbar-track,
.lyrics-container::-webkit-scrollbar-track,
.workspace-content::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------- 3. background */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% -14%, var(--glow) 0, transparent 34%),
    radial-gradient(circle at -6% 104%, rgba(139, 169, 255, .13) 0, transparent 40%),
    var(--bg);
}

/* -------------------------------------------------------------- 4. app shell */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.auth-gated .app {
  visibility: hidden;
  pointer-events: none;
}

header {
  position: relative;
  z-index: 30;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 clamp(14px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.brand-mark-img { width: 100%; height: 100%; object-fit: contain; }

.title-text h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .02em;
  white-space: nowrap;
}
.title-text p { display: none; }

.header-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.settings-toggle-btn,
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-sub);
  font-size: 15px;
  transition: var(--t);
}
.settings-toggle-btn:hover,
.theme-toggle-btn:hover {
  border-color: var(--accent-line);
  background: var(--surface-3);
  color: var(--accent);
}

.nav-links { display: none; }

.layout {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-1);
}

.panel-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
}
.panel-title .icon { font-size: 14px; }
.panel-title > span:last-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

footer {
  flex: 0 0 auto;
  padding: 10px 0 14px;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
}

/* ----------------------------------------------------------- 5. primitives */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
}
.btn:hover { background: var(--accent-hi); }
.btn:active { transform: scale(.97); }

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-4);
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text-sub);
}
.btn-ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--text);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1;
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: .42;
}

.input {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: var(--t);
}
.input::placeholder { color: var(--text-dim); }
.input:focus { border-color: var(--accent-line); }

.source-pill,
.lossless-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 10px;
  white-space: nowrap;
}

.source-pill { font-weight: 600; }
.source-pill.source-netease { border-color: rgba(255, 107, 107, .4); color: #ff8b8b; }
.source-pill.source-qq { border-color: rgba(77, 208, 225, .4); color: #7ee5f0; }
.source-pill.source-qishui { border-color: rgba(85, 230, 165, .4); color: #7af0b8; }
.source-pill.source-bilibili { border-color: rgba(251, 114, 153, .4); color: #fb7299; }

.lossless-pill {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .06em;
}

.status-pill { color: var(--text-dim); }

.source-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.source-dot.netease { color: #ff6b6b; }
.source-dot.qq { color: #4dd0e1; }
.source-dot.qishui { color: #55e6a5; }
.source-dot.bilibili { color: #fb7299; }

/* Ripple (injected by setupRipple in major.js). */
.ripple-target,
.btn,
.track-item,
.search-mini-item { position: relative; overflow: hidden; }

.ripple-circle,
.ripple-circle-inner {
  position: absolute;
  z-index: 20;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
}
.ripple-circle {
  border: 2px solid var(--accent-line);
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  animation: ripple-outer .75s var(--ease) forwards;
}
.ripple-circle-inner {
  z-index: 19;
  border: 1px solid rgba(139, 169, 255, .7);
  background: radial-gradient(circle, rgba(139, 169, 255, .22), transparent 70%);
  animation: ripple-inner .75s var(--ease) forwards;
}
@keyframes ripple-outer {
  to { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}
@keyframes ripple-inner {
  to { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 4000;
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  box-shadow: var(--sh-2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--t), transform var(--t);
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------- 6. modal system */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 9, .68);
  backdrop-filter: blur(10px);
}
.modal-backdrop.show { display: flex; }

.modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(460px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: var(--sh-3);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 650;
}

.modal-title-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.modal-close-btn {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  transition: var(--t);
}
.modal-close-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.modal-desc {
  margin: 0;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.modal input[type="text"],
.modal input[type="password"],
.modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: var(--t);
}
.modal input:focus,
.modal textarea:focus { border-color: var(--accent-line); }
.modal input::placeholder,
.modal textarea::placeholder { color: var(--text-dim); }

.modal textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

/* ------------------------------------------------------------ 7. search panel */

.search-panel-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px;
}

.search-row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  transition: var(--t);
}
.search-row:focus-within {
  border-color: var(--accent-line);
  background: var(--surface-3);
}
.search-prefix {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 13px;
}
.search-row .input {
  flex: 1 1 auto;
  padding: 9px 0;
  border: 0;
  background: transparent;
}
.search-row .input:focus { border: 0; }
.search-row .btn {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: var(--r-pill);
}

.search-stats {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
  color: var(--text-dim);
  font-size: 11px;
}
/* Multi-select is opt-in on touch only; desktop keeps the always-on checkboxes. */
.search-select-toggle { display: none; }
#search-status {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-batch-toolbar { flex: 0 0 auto; }
.search-batch-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-batch-select-all-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 2px;
  color: var(--text-sub);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.search-batch-select-all {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.search-batch-actions .btn-icon { width: 30px; height: 30px; }

.search-results-mini {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
}

.search-mini-item {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.search-mini-item:hover { background: var(--surface-3); }
.search-mini-item.playing {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.search-mini-item.batch-selected { border-color: var(--accent-line); }

.mini-select-control {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.mini-meta-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mini-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.mini-artist {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-dim);
  font-size: 11px;
}

.mini-right {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}
.mini-badge {
  min-width: 30px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-1);
  color: var(--text-dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ------------------------------------------------------------ 8. player panel */

.cover-wrapper {
  position: relative;
  flex: 0 0 auto;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
}
.cover-wrapper > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 40%, var(--surface-3) 0, var(--surface-1) 70%);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.cover-disc {
  position: relative;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #232a31 0 2px, #0d1013 2px 5px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .07),
    0 14px 34px rgba(0, 0, 0, .5);
}
.cover-disc::before {
  content: "";
  position: absolute;
  inset: 33%;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-hi));
}
.cover-disc::after {
  content: "";
  position: absolute;
  inset: 46%;
  border-radius: 50%;
  background: var(--bg);
}
.player-panel.is-playing .cover-disc,
.player-panel.is-playing .cover-wrapper > img { animation: disc-spin 18s linear infinite; }
@keyframes disc-spin { to { transform: rotate(360deg); } }

.cover-ring-label {
  position: absolute;
  inset: -7%;
  width: 114%;
  height: 114%;
  overflow: visible;
  pointer-events: none;
}
.cover-ring-label text {
  fill: var(--accent);
  font-family: var(--font);
  font-size: 5.4px;
  font-weight: 800;
  letter-spacing: 1.1px;
  opacity: .8;
}

.player-top {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.player-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.track-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.track-text {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}
.track-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(19px, 1.9vw, 27px);
  font-weight: 650;
  line-height: 1.25;
}
.track-artist {
  margin-top: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-sub);
  font-size: 13px;
}
.track-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
}

.player-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}
.player-btn-row { display: flex; gap: 6px; }

.btn-fav-active {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 620px;
  margin: 18px auto 0;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-time {
  flex: 0 0 auto;
  width: 46px;
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.progress-bar-wrapper {
  position: relative;
  flex: 1 1 auto;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  cursor: pointer;
}
.progress-bar-wrapper::before {
  content: "";
  position: absolute;
  inset: -9px 0;
}
.progress-bar {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}
.progress-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface-1);
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity var(--t);
}
.progress-bar-wrapper:hover .progress-handle,
.progress-bar-wrapper:focus-within .progress-handle { opacity: 1; }

.control-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.control-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.control-main .play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 19px;
}
.control-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
}
.volume-slider {
  width: 96px;
  accent-color: var(--accent);
}

.lyrics-container {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

.lyrics-inner {
  /* offsetParent for .lyrics-line: updateLyricsHighlight() scrolls the
     container by act.offsetTop, which is only correct while this element is
     the positioned ancestor. Do not remove. */
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 3vh 12px 20vh;
  text-align: center;
}

.lyrics-title-line { display: none; }

.lyrics-line {
  margin: 0;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.45;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color var(--t), transform var(--t);
}
.lyrics-line:hover { color: var(--text-sub); }
.lyrics-line.active {
  color: var(--accent-hi);
  font-weight: 650;
  transform: scale(1.06);
  text-shadow: 0 0 22px var(--glow);
}

.lyrics-empty {
  max-width: 420px;
  margin: 16vh auto 0;
  padding: 0 16px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}
.lyrics-empty-title {
  margin: 0;
  color: var(--text-sub);
  font-size: 15px;
  font-weight: 500;
}
/* Watermark so the empty card reads as deliberate space rather than a hole. */
.lyrics-empty-title::before {
  content: "♪";
  display: block;
  margin-bottom: 14px;
  color: var(--line-strong);
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
}
.lyrics-empty-hint {
  margin: 6px 0 0;
  font-size: 13px;
}

/* ----------------------------------------------------------- 9. playlist panel */

.playlist-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 0 14px 14px;
}

.playlist-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  background: var(--surface-1);
}

.playlist-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.playlist-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.playlist-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 5px 12px;
  border-radius: 7px;
  color: var(--text-sub);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--t);
  line-height: 1;
}
.playlist-tab:hover { color: var(--text); }
.playlist-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}

.playmode-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.playmode-row.is-hidden { display: none; }

.playmode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-dim);
  font-size: 0;
  transition: var(--t);
}
.playmode-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  pointer-events: none;
}
.playmode-btn > svg {
  display: block;
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.playmode-btn:hover { border-color: var(--line-strong); color: var(--text); }
.playmode-btn.active {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}

.clear-playlist-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: var(--r-xs);
  font-size: 11px;
}
.clear-playlist-btn.is-hidden { display: none; }

.playlist-select-row { display: grid; gap: 8px; }
.playlist-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.playlist-file-actions .btn {
  padding: 6px 11px;
  font-size: 11px;
}

.playlist-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.track-item {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.track-item:hover { background: var(--surface-3); }
.track-item.playing {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.track-item.batch-selected { border-color: var(--accent-line); }

.track-index {
  flex: 0 0 auto;
  width: 22px;
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.track-item.playing .track-index { color: var(--accent); }

.track-item > div:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}
.track-meta-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.track-meta-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}
.track-meta-sub > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}
.track-actions .btn-icon { width: 30px; height: 30px; }

.queue-add-btn { font-size: 14px; }

/* ------------------------------------------------------- 10. desktop workspace */

@media (min-width: 761px) {
  .layout > .search-panel,
  .layout > .playlist-panel { display: none; }

  /* Two columns straight on the starfield — no card. The disc is large enough
     to carry the left column on its own, the lyrics sit in a comfortable
     measure on the right, and a hairline separates the transport.
     .player-top / .player-main are display:contents so their children can be
     placed as grid items directly. Rows 1 and 4 are equal 1fr spacers, which
     vertically centres the disc + title group in the left column. */
  .player-panel {
    display: grid;
    /* Both tracks are capped and centred as a pair. Letting the lyrics column
       absorb all the leftover width pushed the two columns to opposite edges
       with a dead band down the middle. */
    grid-template-columns: minmax(360px, 460px) minmax(0, 560px);
    grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr) auto;
    justify-content: center;
    column-gap: clamp(36px, 4vw, 64px);
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 0 clamp(28px, 4.5vw, 72px);
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .player-panel > .panel-header { display: none; }
  .player-top,
  .player-main { display: contents; }

  /* .cover-disc is 78% of this box, so the box has to be sized up for the disc
     to read as the focal point. */
  .cover-wrapper {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    width: min(420px, 46vh, 100%);
    aspect-ratio: 1;
  }

  /* Stacked, so the title centres under the disc. */
  .track-title-row {
    grid-column: 1;
    grid-row: 3;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 28px 0 0;
  }

  /* Keep the left column to disc + title + artist: the quality pill and the
     favourite / save buttons were just clutter on a page that already has
     keyboard shortcuts and a transport row. */
  .player-actions,
  .track-tags { display: none; }

  /* Lyrics: centred in a fixed measure. The lines run 5-14 characters, so a
     left-aligned sheet leaves a ragged void to the right of every line; centred
     keeps the block balanced against the disc. The mask fades the last line out
     instead of hard-cutting it. */
  .lyrics-container {
    grid-column: 2;
    grid-row: 1 / 5;
    margin-top: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 96px), transparent 100%);
    mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 96px), transparent 100%);
  }
  /* The accent-coloured thumb is far too loud at this size. */
  .lyrics-container::-webkit-scrollbar { width: 3px; }
  .lyrics-container::-webkit-scrollbar-thumb { background: var(--line-strong); }

  .lyrics-inner {
    max-width: 480px;
    margin: 0 auto;
    padding: 5vh 0 18vh;
    text-align: center;
  }
  .lyrics-line {
    padding: 0;
    font-size: 16px;
    line-height: 2.05;
    text-align: center;
  }
  /* Size + colour carry the emphasis; no scale(), which would push lines past
     the edge and make the scroll jump. */
  .lyrics-line.active {
    font-size: 19px;
    transform: none;
  }

  /* Centre the empty state in the lyrics column. */
  .lyrics-inner:has(.lyrics-empty) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    padding: 0;
  }
  .lyrics-inner:has(.lyrics-empty) .lyrics-empty { margin: 0; text-align: center; }

  .player-controls {
    grid-column: 1 / -1;
    grid-row: 5;
    max-width: none;
    margin: 20px 0 0;
    padding: 18px 0 22px;
    border-top: 1px solid var(--line);
  }

  /* Idle: nothing to show on the left beyond the standby disc, and the
     empty-state copy lives in the lyrics column. */
  .player-panel:has(#track-title:empty) .cover-wrapper { opacity: .55; }

  .workspace-dialog {
    display: flex;
    flex-direction: column;
    width: min(760px, calc(100% - 80px));
    height: min(720px, calc(100dvh - 96px));
    padding: 16px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--surface-1);
    box-shadow: var(--sh-3);
  }
  .workspace-search-open .workspace-dialog { width: min(760px, calc(100% - 80px)); }
  .workspace-library-open .workspace-dialog { width: min(480px, calc(100% - 80px)); }

  .workspace-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  .workspace-title { font-size: 15px; font-weight: 650; }

  .workspace-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }
  .workspace-content > .panel {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .workspace-search .search-panel > .panel-header { display: none; }
  .workspace-search .search-panel-content { padding: 0; }
  /* The dialog title already names the view; the panel's own "播放列表"
     heading would contradict it. */
  .workspace-content .playlist-panel > .panel-header .panel-title { display: none; }
  .workspace-content .playlist-panel > .panel-header { justify-content: flex-end; }
  .workspace-library-only .playlist-bar { padding-top: 0; }
  .workspace-library-only .playlist-file-actions,
  .workspace-library-only .playlist-select-row { display: none; }

  /* Library cards share the row surface with queue rows. */
  .desktop-playlist-overview {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .desktop-playlist-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--text);
    text-align: left;
    transition: var(--t);
  }
  .desktop-playlist-card:hover { background: var(--surface-3); }
  .desktop-playlist-card strong { font-size: 13px; font-weight: 600; }
  .desktop-playlist-card span { color: var(--text-dim); font-size: 11px; }
  .desktop-playlist-back {
    align-self: flex-start;
    margin-bottom: 8px;
    padding: 6px 11px;
  }
}

/* ---------------------------------------------------- desktop music workspace */

@media (min-width: 761px) {
  .app {
    background:
      radial-gradient(ellipse at 53% 0%, rgba(200, 238, 98, .055), transparent 44%),
      transparent;
  }

  header {
    height: 64px;
    padding-inline: clamp(18px, 2.2vw, 34px);
    background: var(--header-bg);
  }

  .layout {
    display: grid;
    grid-template-columns: minmax(205px, .78fr) minmax(260px, 1.42fr) minmax(220px, .9fr);
    gap: clamp(10px, 1.15vw, 18px);
    padding: clamp(12px, 1.5vw, 22px);
  }

  .layout > .search-panel,
  .layout > .playlist-panel {
    display: flex;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: color-mix(in srgb, var(--surface-1) 92%, transparent);
    box-shadow: var(--sh-2);
  }

  .search-panel,
  .playlist-panel { padding: 16px 13px 12px; }

  .search-panel > .panel-header,
  .player-panel > .panel-header,
  .playlist-panel > .panel-header {
    min-height: 38px;
    padding: 0 2px 12px;
    margin-bottom: 10px;
  }

  .search-panel-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
  }

  .search-row {
    min-height: 42px;
    border-radius: var(--r-md);
  }

  .search-stats { min-height: 34px; }

  .player-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    padding: 16px clamp(14px, 1.6vw, 24px) 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background:
      radial-gradient(ellipse at 50% 20%, var(--accent-soft), transparent 48%),
      color-mix(in srgb, var(--surface-1) 92%, transparent);
    box-shadow: var(--sh-2);
  }

  .player-panel > .panel-header { display: flex; }
  .player-top { flex: 0 0 auto; gap: 15px; }
  .player-main { display: flex; width: 100%; justify-content: center; }

  .cover-wrapper {
    width: min(240px, 31vh, 66%);
    aspect-ratio: 1;
    border-radius: 50%;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .26);
  }

  .track-title-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .track-text { text-align: left; }
  .track-tags { justify-content: flex-start; }
  .track-title { font-size: clamp(18px, 1.7vw, 25px); }
  .track-tags { display: flex; }
  .player-actions { display: flex; }

  .player-controls {
    flex: 0 0 auto;
    width: 100%;
    max-width: 520px;
    margin: 15px auto 0;
    padding: 0 0 15px;
    border-bottom: 1px solid var(--line);
  }

  .control-row { justify-content: space-between; }
  .lyrics-container {
    flex: 1 1 auto;
    min-height: 110px;
    margin-top: 8px;
    grid-column: auto;
    grid-row: auto;
    border-radius: var(--r-lg);
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
    -webkit-mask-image: none;
    mask-image: none;
  }

  .lyrics-inner {
    max-width: 560px;
    padding: 12px 10px 36px;
  }

  .lyrics-line { line-height: 1.85; }

  .playlist-panel > .panel-header {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    min-height: auto;
  }

  .playlist-panel > .panel-header .panel-title { width: 100%; }
  .playlist-panel .playlist-tabs { max-width: 100%; }
  .playlist-tab { padding-inline: 9px; }
  .playlist-main { padding-inline: 2px; }
  .playlist-bar { padding-top: 5px; }
  .playlist-file-actions { flex-wrap: wrap; }
  .playlist-file-actions .btn { flex: 1 1 auto; }

  footer {
    padding: 0 12px 8px;
    color: var(--text-dim);
    font-size: 10px;
  }
}

/* --------------------------------------------------------- 11. library states */

.library-empty-state {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
  text-align: center;
}
.library-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 22px;
}
.library-empty-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 320px;
}
.library-empty-copy strong { font-size: 13px; font-weight: 650; }
.library-empty-copy span { color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.library-empty-action { margin-top: 2px; }

.queue-empty-state .library-empty-icon { font-size: 24px; }

.mobile-playlist-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.mobile-playlist-create,
.mobile-playlist-tool {
  width: 100%;
  min-width: 0;
  padding: 9px 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
}

.mobile-playlist-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-playlist-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  transition: var(--t);
}
.mobile-playlist-card:hover { background: var(--surface-3); }
.mobile-playlist-card-art {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
}
.mobile-playlist-card > span:nth-child(2) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mobile-playlist-card strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
}
.mobile-playlist-card small { color: var(--text-dim); font-size: 11px; }
.mobile-playlist-card b { color: var(--text-dim); font-size: 16px; }

.mobile-playlist-back,
.mobile-playlist-delete { display: none; }

/* --------------------------------------------------- 12. auxiliary modals */

.settings-menu { display: flex; flex-direction: column; gap: 8px; }
.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  transition: var(--t);
}
.settings-menu-item:hover {
  border-color: var(--accent-line);
  background: var(--surface-3);
}
.settings-menu-item strong { font-size: 13px; font-weight: 600; }
.settings-menu-item span { color: var(--text-dim); font-size: 11px; }

.client-download-list { display: flex; flex-direction: column; gap: 8px; }
.client-download-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: var(--t);
}
.client-download-option:hover {
  border-color: var(--accent-line);
  background: var(--surface-3);
}
.client-download-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.client-download-copy strong { font-size: 13px; font-weight: 600; }
.client-download-copy code {
  color: var(--text-dim);
  font-family: var(--font-num);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.client-download-arrow { color: var(--accent); font-size: 18px; }

.import-providers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.import-provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 600;
}
.import-modal-note {
  margin: 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.6;
}
.import-file-btn { margin-right: auto; }

.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-sub);
  font-size: 11px;
}
.login-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
.login-actions .btn { padding: 9px 20px; }
.login-notice {
  margin: 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.7;
}

.save-playlist-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.save-playlist-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  transition: var(--t);
}
.save-playlist-option:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: var(--surface-3);
}
.save-playlist-option:disabled { opacity: .5; }
.save-playlist-option > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.save-playlist-option strong { font-size: 13px; font-weight: 600; }
.save-playlist-option small { color: var(--text-dim); font-size: 11px; }
.save-playlist-option b { color: var(--accent); font-size: 14px; }
.save-playlist-empty {
  padding: 20px;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}
.save-playlist-create { align-self: flex-start; }

.announcement-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.announcement-title { font-size: 17px; font-weight: 700; }
.announcement-copy { margin: 0; color: var(--text-sub); font-size: 12px; line-height: 1.75; }
.announcement-section-label {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.announcement-updates { display: flex; flex-direction: column; gap: 10px; }
.announcement-update {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.announcement-update strong { color: var(--accent); font-size: 12px; font-weight: 650; }
.announcement-update span { color: var(--text-sub); font-size: 11px; line-height: 1.7; }
.announcement-actions { display: flex; justify-content: flex-end; gap: 8px; }

.app-download-callout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 15px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}
.app-download-eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.app-download-title { font-size: 14px; font-weight: 700; }
.app-download-detail { color: var(--text-sub); font-size: 11px; line-height: 1.7; }

.android-update-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-sub);
  font-size: 11px;
  line-height: 1.7;
}
.android-update-actions { justify-content: flex-end; }

/* --------------------------------------------------- 13. mobile shell & views */

.mobile-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}
.mobile-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  transition: color var(--t);
}
.mobile-nav button span { font-size: 18px; line-height: 1; }
.mobile-nav button small { font-size: 10px; }
.mobile-nav button[aria-current="page"] { color: var(--accent); }
.mobile-nav button[aria-current="page"] small { font-weight: 650; }

@media (max-width: 760px) {
  .app { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

  /* The particle canvas is only dimmed inside the desktop query. Left at full
     strength it reads as noise behind the mobile panels, which are transparent
     so the content sits directly on the background. */
  #bg-canvas { opacity: .3; }

  header {
    height: 48px;
    padding: 0 12px;
    gap: 10px;
  }
  .brand-mark { width: 30px; height: 30px; }
  .title-text h1 { font-size: 14px; }
  /* The workspace views are reachable from the bottom nav on mobile, so the
     settings sheet only keeps its mobile-relevant entry. */
  .settings-menu-item[data-desktop-view] { display: none; }
  #settings-modal .modal-desc { display: none; }

  /* ---- touch targets ---------------------------------------------------
     The desktop sizes are 30-34px, which is fine with a mouse and awkward
     with a thumb. Everything tappable comes up to ~44px (iOS HIG / Material
     48dp). */
  .settings-toggle-btn,
  .theme-toggle-btn {
    position: relative;
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .settings-toggle-btn::after,
  .theme-toggle-btn::after {
    content: "";
    position: absolute;
    inset: -3px;
  }
  .btn-icon { width: 44px; height: 44px; font-size: 16px; }
  /* .track-actions .btn-icon is set in a scoped base rule, so it needs its own
     override here. */
  .track-actions .btn-icon { width: 44px; height: 44px; font-size: 16px; }
  .queue-add-btn { font-size: 17px; }
  .search-batch-actions .btn-icon { width: 44px; height: 44px; }
  .search-row .btn { min-height: 44px; }
  .search-batch-select-all-wrap { font-size: 12px; }

  /* ---- visible size vs touch size --------------------------------------
     A full 44px box on every control made the tab strip and the list toolbar
     read as two stacked rows of heavy blocks. These keep a 38px visual box and
     extend the hit area to 44px with a pseudo-element, so the tap target stays
     compliant without the bulk. */
  .playmode-btn {
    position: relative;
    width: 38px;
    height: 38px;
    font-size: 0;
  }
  .playmode-btn::after {
    inset: -3px;
  }
  .playlist-bar .btn-ghost {
    position: relative;
    min-height: 38px;
    padding: 0 14px;
    font-size: 12px;
  }
  .playlist-bar .btn-ghost::after {
    content: "";
    position: absolute;
    inset: -3px 0;
  }
  .playlist-tabs { padding: 3px; }
  .playlist-tab {
    position: relative;
    min-height: 38px;
    padding: 0 14px;
    font-size: 12px;
  }
  .playlist-tab::after {
    content: "";
    position: absolute;
    inset: -3px 0;
  }
  /* ---- multi-select is opt-in ------------------------------------------
     Default state is a clean result list: no row checkboxes, no batch actions.
     Tapping 选择 swaps the status line for the batch actions and reveals the
     checkboxes. */
  .search-select-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-left: auto;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text-sub);
    font-size: 12px;
    cursor: pointer;
  }
  .search-select-toggle[aria-pressed="true"] {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    color: var(--accent-hi);
  }
  #search-batch-toolbar { display: none; }
  body.search-selecting #search-batch-toolbar { display: block; }
  body.search-selecting #search-status { display: none; }
  /* The toggle stays visible in selection mode — it becomes 取消, which is the
     only way back out. */
  body:not(.search-selecting) .mini-select-control { display: none; }
  body:not(.search-selecting) .search-batch-select-all-wrap { display: none; }

  /* A square white checkbox on every row made the list read as a to-do list.
     A quiet filled square that turns lime when checked keeps the state legible
     without the noise. */
  .mini-select-control,
  .search-batch-select-all {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface-4);
    transition: var(--t);
  }
  .mini-select-control:checked,
  .search-batch-select-all:checked {
    border-color: var(--accent);
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.6' fill='none' stroke='%2310140a' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/74% no-repeat;
  }

  /* Tapping a row already plays it (the row forwards its click to the play
     button), so an explicit play button is redundant on touch. */
  .track-actions > .btn:first-child { display: none; }

  /* The index is a hint, not a badge. */
  .mini-badge {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  /* ---- type scale ------------------------------------------------------
     10-11px is below a comfortable mobile reading size. */
  .mini-artist,
  .mini-badge,
  .track-meta-sub,
  .track-index { font-size: 12px; }

  /* ---- scrollbars ------------------------------------------------------
     The shared rule uses --accent-line, which is a loud lime stripe on a
     phone-width screen. */
  .search-results-mini,
  .playlist-main,
  .playlist-list,
  .lyrics-container,
  .workspace-content,
  .modal {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
  .search-results-mini::-webkit-scrollbar,
  .playlist-main::-webkit-scrollbar,
  .playlist-list::-webkit-scrollbar,
  .lyrics-container::-webkit-scrollbar,
  .workspace-content::-webkit-scrollbar,
  .modal::-webkit-scrollbar { width: 3px; height: 3px; }
  .search-results-mini::-webkit-scrollbar-thumb,
  .playlist-main::-webkit-scrollbar-thumb,
  .playlist-list::-webkit-scrollbar-thumb,
  .lyrics-container::-webkit-scrollbar-thumb,
  .workspace-content::-webkit-scrollbar-thumb,
  .modal::-webkit-scrollbar-thumb { background: var(--line-strong); }

  .mobile-nav { display: grid; }

  .layout {
    display: block;
    position: relative;
    padding: 8px 10px 0;
  }

  /* No card wrapper on mobile: a full-height bordered box around a short list
     reads as a large empty panel. The rows carry the visual weight instead. */
  .layout > .panel {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
  }
  body[data-mobile-view="search"] .layout > .search-panel,
  body[data-mobile-view="me"] .layout > .playlist-panel,
  body[data-mobile-view="lyrics"] .layout > .playlist-panel { display: flex; }

  footer { display: none; }

  .panel { padding: 0; }
  .panel-header { min-height: 30px; padding: 12px 14px 10px; margin-bottom: 0; }
  .panel-title { font-size: 14px; font-weight: 700; }

  /* ---- search view -------------------------------------------------- */
  body[data-mobile-view="search"] .search-panel > .panel-header { display: none; }
  .search-panel-content { padding: 10px; gap: 8px; }
  .search-row { min-height: 46px; padding-left: 12px; }
  .search-row .input { font-size: 14px; }
  .search-row .btn { padding: 9px 16px; font-size: 12px; }
  .search-stats { font-size: 12px; }
  .search-batch-actions .btn-icon { width: 44px; height: 44px; }
  .search-mini-item { padding: 10px; gap: 10px; }
  .mini-select-control { width: 22px; height: 22px; }
  #search-batch-queue { display: none; }

  /* ---- me view ------------------------------------------------------ */
  body[data-mobile-view="me"] .playlist-panel .playlist-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  body[data-mobile-view="me"] .playlist-tab[data-tab="results"] { display: none; }
  body[data-mobile-view="me"] .playlist-tab { text-align: center; }
  body[data-mobile-view="me"] .playlist-panel:not(.mobile-playlist-detail) .panel-title,
  body[data-mobile-view="me"] .playlist-panel:not(.mobile-playlist-detail) .mobile-playlist-back,
  body[data-mobile-view="me"] .playlist-panel:not(.mobile-playlist-detail) .mobile-playlist-delete { display: none; }
  body[data-mobile-view="me"] .playlist-panel.mobile-playlist-detail .panel-title { display: flex; }
  body[data-mobile-view="me"] .playlist-panel.mobile-playlist-detail .mobile-playlist-back {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: var(--surface-2);
    color: var(--text-sub);
    font-size: 14px;
  }
  body[data-mobile-view="me"] .playlist-panel.mobile-playlist-detail .mobile-playlist-delete {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: var(--r-xs);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 15px;
  }

  .playlist-main { padding: 0 10px 10px; }
  .playlist-bar { padding: 10px 0 8px; gap: 6px; }

  /* ---- lyrics (now playing) view ------------------------------------ */
  /* --ml-band-top clears the queue title + toolbar above it; --ml-band-h is
     the band's height, which the queue list reserves as padding-top. Tune
     these two together and re-run the mobile metrics probe. */
  body[data-mobile-view="lyrics"] {
    --ml-band-top: 100px;
    --ml-band-h: 164px;
    --ml-band-gap: 12px;
    /* Queue rows sit at x=35 after the panel/main/list padding chain; matching
       it keeps the band aligned with the rows instead of the screen edge. */
    --ml-band-inset: 35px;
  }
  body[data-mobile-view="lyrics"] .layout > .playlist-panel {
    display: flex;
    padding: 0 10px;
  }
  body[data-mobile-view="lyrics"] .playlist-panel > .panel-header {
    display: flex;
    padding: 12px 4px 8px;
    border-bottom: 0;
    margin-bottom: 0;
  }
  body[data-mobile-view="lyrics"] .playlist-panel .panel-title { display: flex; }
  body[data-mobile-view="lyrics"] .playlist-panel .playlist-tabs,
  body[data-mobile-view="lyrics"] .playlist-panel .mobile-playlist-back,
  body[data-mobile-view="lyrics"] .playlist-panel .mobile-playlist-delete { display: none; }
  body[data-mobile-view="lyrics"] .playlist-panel .playlist-bar {
    align-items: flex-end;
    padding: 0 4px 8px;
  }
  body[data-mobile-view="lyrics"] .playlist-panel .playlist-list {
    /* Reserve the lyrics band's height so queue rows never sit under it. */
    padding: calc(var(--ml-band-h) + var(--ml-band-gap)) 4px 150px;
  }
  body[data-mobile-view="lyrics"] .playlist-panel .track-item { padding: 8px 10px; }

  /* Player becomes a transparent overlay above the queue. */
  body[data-mobile-view="lyrics"] .layout > .player-panel {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    padding: 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    pointer-events: none;
  }
  body[data-mobile-view="lyrics"] .player-panel > .panel-header,
  body[data-mobile-view="lyrics"] .cover-wrapper,
  body[data-mobile-view="lyrics"] .track-title-row { display: none; }
  body[data-mobile-view="lyrics"] .player-top,
  body[data-mobile-view="lyrics"] .player-main { display: contents; }

  /* Now-playing transport, pinned above the bottom nav. */
  body[data-mobile-view="lyrics"] .player-controls {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 14px 12px 12px;
    gap: 8px;
    background: linear-gradient(180deg, transparent, var(--bg) 34%);
    pointer-events: auto;
  }
  body[data-mobile-view="lyrics"] .progress-time { width: 40px; font-size: 10px; }
  body[data-mobile-view="lyrics"] .control-row { gap: 0; }
  body[data-mobile-view="lyrics"] .control-main { gap: 22px; }
  body[data-mobile-view="lyrics"] .control-main .play-btn { width: 50px; height: 50px; }
  body[data-mobile-view="lyrics"] .control-secondary { display: none; }

  /* Lyrics band: a self-contained block between the queue toolbar and the
     queue list. The queue list reserves --ml-band-h + --ml-band-gap at the
     top, so the two never overlap. */
  body[data-mobile-view="lyrics"] .lyrics-container {
    position: absolute;
    top: var(--ml-band-top);
    right: var(--ml-band-inset);
    left: var(--ml-band-inset);
    height: var(--ml-band-h);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
    pointer-events: none;
    z-index: 6;
  }
  body[data-mobile-view="lyrics"] .lyrics-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface-2);
    box-shadow: var(--sh-2);
    text-align: center;
    pointer-events: auto;
  }
  /* Only the active line plus one either side are shown, so the lyrics read as
     a passage rather than one isolated line. */
  body[data-mobile-view="lyrics"] .lyrics-line { display: none; }
  body[data-mobile-view="lyrics"] .lyrics-line.mobile-lyrics-visible {
    display: block;
    /* Lines are tappable (tap to seek), so each gets a 44px target. */
    padding: 12px 0;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
    transform: none;
    text-shadow: none;
  }
  body[data-mobile-view="lyrics"] .lyrics-line.mobile-lyrics-current {
    color: var(--accent-hi);
    font-size: 18px;
    font-weight: 600;
  }
  body[data-mobile-view="lyrics"] .lyrics-empty {
    margin: 0;
    font-size: 13px;
  }

  /* Queue rows keep a thumb-friendly height. */
  .track-item { padding: 11px 12px; }
}

/* ----------------------------------------------------- mobile touch finish */

@media (max-width: 760px) {
  .app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

  header {
    height: 54px;
    border-bottom-color: transparent;
  }

  .mobile-nav {
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 7px 10px env(safe-area-inset-bottom);
    border-top-color: var(--line);
    background: color-mix(in srgb, var(--surface-1) 92%, transparent);
  }

  .mobile-nav button {
    gap: 2px;
    border-radius: var(--r-md);
  }

  .mobile-nav button span {
    display: grid;
    place-items: center;
    width: 48px;
    height: 30px;
    border-radius: var(--r-pill);
    font-size: 19px;
    transition: background var(--t), color var(--t);
  }

  .mobile-nav button[aria-current="page"] span {
    background: var(--accent-soft);
  }

  .mobile-nav button small { font-size: 10px; }

  .search-row {
    border: 1px solid var(--line-strong);
    background: var(--surface-1);
    box-shadow: var(--sh-1);
  }

  .search-row .btn { border-radius: 11px; }

  .search-mini-item,
  .track-item {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    margin-bottom: 7px;
    background: color-mix(in srgb, var(--surface-1) 94%, transparent);
  }

  .search-mini-item.playing,
  .track-item.playing {
    border-color: var(--accent-line);
    background: var(--accent-soft);
  }

  body[data-mobile-view="lyrics"] .lyrics-inner {
    border-color: var(--accent-line);
    background:
      radial-gradient(ellipse at 50% 0%, var(--accent-soft), transparent 85%),
      var(--surface-2);
  }
}

/* ----------------------------------------------------- HALO editorial system */

:root {
  --bg: #f2eee6;
  --header-bg: rgba(242, 238, 230, .9);
  --surface-1: #faf8f3;
  --surface-2: #efebe2;
  --surface-3: #e7e2d7;
  --surface-4: #dcd6ca;
  --line: rgba(40, 43, 34, .09);
  --line-strong: rgba(40, 43, 34, .17);
  --text: #262920;
  --text-sub: #66685d;
  --text-dim: #858477;
  --accent: #bd4c32;
  --accent-hi: #d26043;
  --accent-ink: #fffaf3;
  --accent-soft: rgba(189, 76, 50, .09);
  --accent-line: rgba(189, 76, 50, .27);
  --glow: rgba(189, 76, 50, .12);
  --danger: #a74445;
  --danger-soft: rgba(167, 68, 69, .1);
  --danger-line: rgba(167, 68, 69, .25);
  --r-xs: 9px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --sh-1: 0 2px 8px rgba(45, 39, 28, .04);
  --sh-2: 0 16px 44px rgba(45, 39, 28, .08);
  --sh-3: 0 28px 80px rgba(29, 28, 22, .22);
  --font: "DM Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #f2eee6;
  --header-bg: rgba(242, 238, 230, .9);
  --surface-1: #faf8f3;
  --surface-2: #efebe2;
  --surface-3: #e7e2d7;
  --surface-4: #dcd6ca;
  --line: rgba(40, 43, 34, .09);
  --line-strong: rgba(40, 43, 34, .17);
  --text: #262920;
  --text-sub: #66685d;
  --text-dim: #858477;
  --accent: #bd4c32;
  --accent-hi: #d26043;
  --accent-ink: #fffaf3;
  --accent-soft: rgba(189, 76, 50, .09);
  --accent-line: rgba(189, 76, 50, .27);
  --glow: rgba(189, 76, 50, .12);
  --danger: #a74445;
  --danger-soft: rgba(167, 68, 69, .1);
  --danger-line: rgba(167, 68, 69, .25);
  --sh-1: 0 2px 8px rgba(45, 39, 28, .04);
  --sh-2: 0 16px 44px rgba(45, 39, 28, .08);
  --sh-3: 0 28px 80px rgba(29, 28, 22, .22);
}

html[data-theme="dark"] {
  --bg: #171a17;
  --header-bg: rgba(23, 26, 23, .9);
  --surface-1: #20241f;
  --surface-2: #272b25;
  --surface-3: #30352e;
  --surface-4: #3b4038;
  --line: rgba(242, 238, 230, .085);
  --line-strong: rgba(242, 238, 230, .16);
  --text: #f2eee6;
  --text-sub: #b4b2a6;
  --text-dim: #898b7e;
  --accent: #df795d;
  --accent-hi: #f09273;
  --accent-ink: #241a16;
  --accent-soft: rgba(223, 121, 93, .13);
  --accent-line: rgba(223, 121, 93, .34);
  --glow: rgba(223, 121, 93, .15);
  --danger: #e18a84;
  --danger-soft: rgba(225, 138, 132, .13);
  --danger-line: rgba(225, 138, 132, .3);
  --sh-1: 0 2px 8px rgba(0, 0, 0, .12);
  --sh-2: 0 16px 44px rgba(0, 0, 0, .2);
  --sh-3: 0 28px 80px rgba(0, 0, 0, .48);
}

body { background: var(--bg); color: var(--text); }
#bg-canvas {
  display: none;
}
header {
  height: 70px;
  padding-inline: clamp(20px, 3.3vw, 52px);
  border-color: var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(22px);
}
.logo-area { gap: 13px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 0;
  box-shadow: none;
}
.title-text h1 { font-size: 16px; letter-spacing: -.03em; }
.header-controls { gap: 9px; }
.client-download-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.client-download-nav-button:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 65%, var(--surface-1)); }
.client-download-nav-button:active { transform: translateY(1px); }
.client-download-nav-button > span { font-size: 15px; line-height: 1; }
.settings-toggle-btn,
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-color: var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text-sub);
}
.settings-toggle-btn:hover,
.theme-toggle-btn:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

@media (min-width: 761px) {
  .layout {
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(0, 1.72fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(12px, 1.8vw, 26px);
    padding: clamp(14px, 2.2vw, 32px) clamp(16px, 3.3vw, 52px) 16px;
  }
  .layout > .search-panel,
  .layout > .playlist-panel,
  .layout > .player-panel {
    display: flex;
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    background: var(--surface-1);
    box-shadow: var(--sh-1);
  }
  .search-panel,
  .playlist-panel { padding: 20px 16px 14px; }
  .layout > .search-panel { grid-column: 1; grid-row: 1; }
  .layout > .playlist-panel { grid-column: 1; grid-row: 2; }
  .player-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    padding: 20px clamp(16px, 2vw, 30px) 16px;
    background:
      radial-gradient(ellipse at 50% 17%, var(--accent-soft), transparent 56%),
      var(--surface-1);
  }
  .player-panel > .panel-header { display: flex; }
  .panel-header {
    min-height: 42px;
    padding: 0 0 16px;
    margin-bottom: 14px;
    border-color: var(--line);
  }
  .panel-title { gap: 9px; font-size: 13px; letter-spacing: .01em; }
  .panel-title .icon { display: none; }
  .search-panel .panel-title::before,
  .player-panel .panel-title::before,
  .playlist-panel .panel-title::before {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    content: "";
  }
  .search-panel-content { padding: 0; gap: 12px; }
  .search-row {
    min-height: 46px;
    padding-left: 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg);
  }
  .search-row:focus-within { border-color: var(--accent-line); background: var(--surface-1); }
  .search-row .btn { padding-inline: 13px; border-radius: 9px; }
  .search-stats { min-height: 27px; }
  .search-results-mini { gap: 3px; margin-inline: -6px; padding: 0 6px 8px; }
  .search-mini-item {
    gap: 9px;
    padding: 11px 9px;
    border-color: transparent;
    border-radius: var(--r-sm);
    background: transparent;
  }
  .search-mini-item:hover { background: var(--surface-2); }
  .search-mini-item.playing { background: var(--accent-soft); }
  .mini-title { font-size: 13px; font-weight: 600; }
  .mini-artist { font-size: 11px; }
  .mini-badge { border: 0; background: transparent; }
  .player-top { display: flex; flex: 0 0 auto; flex-direction: column; gap: 16px; }
  .player-main { display: flex; width: 100%; }
  .cover-wrapper {
    width: min(360px, 38vh, 78%);
    aspect-ratio: 1;
    overflow: visible;
    border-radius: 5px;
    box-shadow: 16px 18px 0 -7px var(--surface-3), 17px 19px 0 -7px var(--line-strong), var(--sh-2);
  }
  .cover-wrapper > img,
  .cover-placeholder { border-radius: 5px; }
  .cover-placeholder { background: var(--surface-2); }
  .cover-disc { background: repeating-radial-gradient(circle, #35372e 0 2px, #23251f 2px 5px); }
  .cover-disc::before { background: var(--accent); }
  .cover-ring-label { display: none; }
  .track-title-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }
  .track-text { text-align: left; }
  .track-title { font-size: clamp(18px, 1.7vw, 24px); letter-spacing: -.035em; }
  .track-artist { margin-top: 4px; }
  .track-tags { display: flex; justify-content: flex-start; margin-top: 7px; }
  .player-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
  .player-controls {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    max-width: 520px;
    margin: 15px auto 0;
    padding: 0 0 15px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }
  .control-row { justify-content: space-between; }
  .control-main { gap: 17px; }
  .control-main .play-btn { width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 5px 15px var(--accent-soft); }
  .lyrics-container {
    flex: 1 1 auto;
    min-height: 100px;
    margin-top: 8px;
    overflow: auto;
    border-radius: 0;
    background: transparent;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .lyrics-inner { max-width: 560px; padding: 12px 0 36px; }
  .lyrics-line { line-height: 1.95; }
  .lyrics-line.active { color: var(--accent); text-shadow: none; }
  .playlist-panel { flex-direction: column; }
  .playlist-panel > .panel-header { flex-wrap: wrap; gap: 11px; min-height: auto; }
  .playlist-panel > .panel-header .panel-title { width: 100%; }
  .playlist-tabs { display: flex; width: 100%; gap: 4px; padding: 3px; border: 0; border-radius: 10px; background: var(--surface-2); }
  .playlist-tab { flex: 1 1 0; padding: 7px 6px; border-radius: 8px; text-align: center; }
  .playlist-tab.active { background: var(--surface-1); color: var(--accent); box-shadow: var(--sh-1); }
  .playlist-main { padding: 0 0 5px; }
  .playlist-bar { padding: 5px 0 11px; border-color: var(--line); background: var(--surface-1); }
  .playlist-list { gap: 4px; }
  .track-item { padding: 10px 8px; border-color: transparent; border-radius: var(--r-sm); background: transparent; }
  .track-item:hover { background: var(--surface-2); }
  .track-item.playing { background: var(--accent-soft); }
  .track-meta-title { font-weight: 600; }
  footer { padding: 0 12px 8px; color: var(--text-dim); font-size: 10px; }
}

@media (max-width: 760px) {
  .app { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  header { height: 58px; padding-inline: 17px; border-color: transparent; }
  .brand-mark { width: 35px; height: 35px; }
  .title-text h1 { font-size: 16px; }
  .settings-toggle-btn,
  .theme-toggle-btn { width: 40px; height: 40px; background: var(--surface-1); }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(78px + env(safe-area-inset-bottom));
    padding: 7px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: var(--header-bg);
    box-shadow: 0 -8px 28px rgba(38, 32, 22, .04);
    backdrop-filter: blur(22px);
  }
  .mobile-nav button { gap: 3px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-dim); }
  .mobile-nav button span { display: grid; place-items: center; width: 44px; height: 29px; border-radius: 12px; font-family: Georgia, serif; font-size: 21px; line-height: 1; }
  .mobile-nav button small { font-size: 10px; }
  .mobile-nav button[aria-current="page"] { color: var(--accent); }
  .mobile-nav button[aria-current="page"] span { background: var(--accent-soft); }
  .layout { display: block; padding: 0 14px 10px; }
  .layout > .panel {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body[data-mobile-view="search"] .layout > .search-panel,
  body[data-mobile-view="lyrics"] .layout > .player-panel,
  body[data-mobile-view="queue"] .layout > .playlist-panel,
  body[data-mobile-view="me"] .layout > .playlist-panel { display: flex; }
  body[data-mobile-view="lyrics"] .layout > .playlist-panel { display: none; }
  footer { display: none; }
  .panel { padding: 0; }
  .panel-header { min-height: 42px; padding: 8px 2px 12px; margin-bottom: 9px; }
  .panel-title { font-size: 15px; font-weight: 700; }
  .panel-title .icon { display: none; }
  .search-panel .panel-title::before,
  .player-panel .panel-title::before,
  .playlist-panel .panel-title::before { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); content: ""; }
  .search-panel-content { gap: 11px; padding: 2px 0 0; }
  .search-row { min-height: 50px; padding-left: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-1); box-shadow: var(--sh-1); }
  .search-row .input { font-size: 14px; }
  .search-row .btn { min-height: 42px; border-radius: 10px; }
  .search-stats { min-height: 35px; font-size: 12px; }
  .search-select-toggle { min-height: 38px; border-radius: 10px; }
  .search-results-mini { gap: 7px; }
  .search-mini-item { min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-1); }
  .search-mini-item.playing { border-color: var(--accent-line); background: var(--accent-soft); }
  .mini-title { font-weight: 600; }
  .mini-artist { font-size: 12px; }
  .player-panel {
    position: relative;
    inset: auto;
    z-index: auto;
    flex-direction: column;
    padding: 4px 4px 0;
    border: 0;
    background: transparent;
    pointer-events: auto;
  }
  .player-panel > .panel-header { display: flex; }
  body[data-mobile-view="lyrics"] .player-panel > .panel-header { display: flex; }
  .player-top { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: center; gap: clamp(18px, 4vh, 32px); }
  .player-main { display: flex; width: 100%; }
  body[data-mobile-view="lyrics"] .player-panel .player-top { display: flex; }
  body[data-mobile-view="lyrics"] .player-panel .player-main { display: flex; }
  .cover-wrapper {
    width: min(72vw, 340px, 37vh);
    aspect-ratio: 1;
    overflow: visible;
    border-radius: 5px;
    box-shadow: 13px 15px 0 -6px var(--surface-3), 14px 16px 0 -6px var(--line-strong), var(--sh-2);
  }
  body[data-mobile-view="lyrics"] .player-panel .cover-wrapper { display: block; }
  .cover-wrapper > img,
  .cover-placeholder { border-radius: 5px; }
  .cover-placeholder { background: var(--surface-2); }
  .cover-ring-label { display: none; }
  .track-title-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; width: 100%; max-width: 480px; margin: 0 auto; }
  body[data-mobile-view="lyrics"] .player-panel .track-title-row { display: flex; }
  .track-text { text-align: left; }
  .track-title { font-size: clamp(19px, 5vw, 25px); letter-spacing: -.04em; }
  .track-artist { margin-top: 4px; font-size: 13px; }
  .track-tags { display: flex; justify-content: flex-start; margin-top: 7px; }
  .player-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
  .player-btn-row { gap: 4px; }
  .player-btn-row .btn-icon { width: 40px; height: 40px; }
  .player-controls { position: static; width: 100%; max-width: 480px; margin: 17px auto 0; padding: 0 0 10px; gap: 13px; background: transparent; pointer-events: auto; }
  body[data-mobile-view="lyrics"] .player-panel .player-controls { position: static; right: auto; bottom: auto; left: auto; width: 100%; max-width: 480px; margin: 17px auto 0; padding: 0 0 10px; background: transparent; pointer-events: auto; }
  .progress-row { gap: 8px; }
  .progress-time { width: 37px; font-size: 10px; }
  .progress-bar-wrapper { height: 4px; }
  .progress-bar-wrapper::before { inset: -12px 0; }
  .control-row { justify-content: center; }
  .control-main { gap: 25px; }
  .control-main .play-btn { width: 54px; height: 54px; }
  .control-secondary { display: none; }
  .lyrics-container {
    flex: 0 1 132px;
    min-height: 96px;
    margin: 8px 0 4px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-1);
  }
  body[data-mobile-view="lyrics"] .player-panel .lyrics-container { position: relative; inset: auto; z-index: auto; flex: 0 1 132px; height: auto; margin: 8px 0 4px; overflow: hidden; background: var(--surface-1); pointer-events: auto; }
  .lyrics-inner { display: flex; flex-direction: column; justify-content: center; min-height: 100%; padding: 12px; }
  body[data-mobile-view="lyrics"] .player-panel .lyrics-inner { height: auto; padding: 12px; border: 0; background: transparent; box-shadow: none; }
  .lyrics-line { display: none; }
  .lyrics-line.mobile-lyrics-visible { display: block; padding: 6px 0; font-size: 14px; }
  .lyrics-line.mobile-lyrics-current { color: var(--accent); font-size: 16px; font-weight: 700; }
  .lyrics-empty { margin: 0 auto; font-size: 12px; }
  .lyrics-empty-title { font-size: 13px; }
  .lyrics-empty-title::before { display: none; }
  .playlist-panel { padding: 3px 0 0; }
  .playlist-panel > .panel-header { flex-wrap: wrap; gap: 10px; padding: 8px 0 11px; }
  .playlist-panel > .panel-header .panel-title { width: 100%; }
  .playlist-tabs { display: flex; width: 100%; gap: 4px; padding: 3px; border: 0; border-radius: 10px; background: var(--surface-2); }
  .playlist-tab { flex: 1 1 0; min-height: 39px; padding: 0 8px; border-radius: 8px; text-align: center; }
  .playlist-tab.active { background: var(--surface-1); color: var(--accent); box-shadow: var(--sh-1); }
  .playlist-main { padding: 0 0 10px; }
  .playlist-bar { padding: 6px 0 10px; border-color: var(--line); background: transparent; }
  .playlist-list { gap: 7px; }
  .track-item { min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-1); }
  .track-item.playing { border-color: var(--accent-line); background: var(--accent-soft); }
  .track-meta-title { font-weight: 600; }
  .track-meta-sub { font-size: 12px; }
  body[data-mobile-view="me"] .playlist-panel .playlist-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-mobile-view="me"] .playlist-tab[data-tab="results"] { display: none; }
  body[data-mobile-view="me"] .playlist-tab { text-align: center; }
  body[data-mobile-view="me"] .playlist-panel:not(.mobile-playlist-detail) .panel-title,
  body[data-mobile-view="me"] .playlist-panel:not(.mobile-playlist-detail) .mobile-playlist-back,
  body[data-mobile-view="me"] .playlist-panel:not(.mobile-playlist-detail) .mobile-playlist-delete { display: none; }
  body[data-mobile-view="me"] .playlist-panel.mobile-playlist-detail .panel-title { display: flex; }
  body[data-mobile-view="me"] .playlist-panel.mobile-playlist-detail .mobile-playlist-back,
  body[data-mobile-view="me"] .playlist-panel.mobile-playlist-detail .mobile-playlist-delete { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-1); color: var(--text-sub); }
  body[data-mobile-view="me"] .playlist-panel.mobile-playlist-overview .playlist-bar { display: none; }
  .mobile-playlist-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-1); }
  .mobile-playlist-card-art { border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
  .mobile-playlist-toolbar { gap: 7px; margin: 3px 0 13px; }
  .mobile-playlist-toolbar .btn { min-height: 42px; border-radius: 11px; }
  #search-batch-queue { display: inline-flex; }
  .settings-menu-item[data-desktop-view] { display: none; }
  #settings-modal .modal-desc { display: none; }
}

/* ------------------------------------------------------- 14. motion & print */

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

/* --------------------------------------------------------- focused desktop */

@media (min-width: 761px) {
  header {
    position: relative;
    height: 74px;
    padding-inline: clamp(24px, 4vw, 68px);
  }
  .header-controls { gap: 10px; }
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 18px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--surface-1) 72%, transparent);
  }
  .desktop-nav button {
    min-height: 35px;
    padding: 0 17px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--text-sub);
    font-size: 12px;
    transition: background var(--t), color var(--t);
  }
  .desktop-nav button:hover { color: var(--text); }
  .desktop-nav button[aria-current="page"] {
    background: var(--text);
    color: var(--bg);
  }
  .layout {
    display: block;
    padding: 0;
    overflow: hidden;
  }
  .layout > .panel {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body[data-desktop-view="lyrics"] .layout > .player-panel,
  body[data-desktop-view="search"] .layout > .search-panel,
  body[data-desktop-view="queue"] .layout > .playlist-panel,
  body[data-desktop-view="me"] .layout > .playlist-panel { display: flex; }
  .layout > .player-panel {
    align-items: center;
    flex-direction: column;
    padding: 0 clamp(24px, 5vw, 80px);
  }
  .layout > .player-panel::before {
    position: absolute;
    top: 23%;
    left: 50%;
    width: min(620px, 70vh, 70vw);
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 68%);
    content: "";
    opacity: .55;
    pointer-events: none;
    transform: translate(-50%, -18%);
  }
  .layout > .player-panel > * { position: relative; z-index: 1; }
  .player-panel > .panel-header {
    display: flex;
    align-self: stretch;
    min-height: 48px;
    padding: 19px 0 8px;
    margin: 0;
    border: 0;
  }
  .player-panel > .panel-header .panel-title { color: var(--text-dim); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
  .player-panel .panel-title::before { display: none; }
  .player-top {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 3vh, 28px);
    width: min(640px, 100%);
    margin: auto 0 0;
  }
  .player-main { display: flex; width: 100%; justify-content: center; }
  .cover-wrapper {
    width: min(360px, 39vh, 42vw);
    aspect-ratio: 1;
    border-radius: 7px;
    box-shadow: 16px 18px 0 -7px var(--surface-3), 17px 19px 0 -7px var(--line-strong), 0 30px 55px rgba(47, 38, 26, .14);
  }
  .cover-wrapper > img,
  .cover-placeholder { border-radius: 7px; }
  .track-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: min(640px, 100%);
    max-width: none;
  }
  .track-title-row .track-text { grid-column: 2; min-width: 260px; text-align: center; }
  .track-title-row .player-actions { grid-column: 3; grid-row: 1; justify-self: end; }
  .track-title { font-family: "DM Sans", "Noto Sans SC", sans-serif; font-size: clamp(23px, 2.35vw, 34px); font-weight: 600; letter-spacing: -.055em; }
  .track-artist { margin-top: 7px; font-size: 14px; }
  .player-actions { flex-direction: row; align-items: center; }
  .player-controls {
    display: flex;
    flex: 0 0 auto;
    width: min(580px, 100%);
    max-width: none;
    margin: 22px 0 0;
    padding: 0;
    border: 0;
  }
  .progress-row { gap: 14px; }
  .progress-time { font-family: var(--font-num); font-size: 10px; }
  .progress-bar-wrapper { height: 3px; background: var(--surface-3); }
  .progress-bar { background: var(--text); }
  .progress-handle { width: 9px; height: 9px; background: var(--text); }
  .control-row { justify-content: center; gap: 28px; }
  .control-main { gap: 18px; }
  .control-main .btn-icon { width: 38px; height: 38px; border: 0; background: transparent; color: var(--text-sub); font-size: 15px; }
  .control-main .play-btn { width: 54px; height: 54px; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px var(--accent-soft); }
  .control-secondary { font-size: 11px; }
  .volume-slider { width: 80px; }
  .lyrics-container {
    flex: 0 1 185px;
    width: min(620px, 100%);
    min-height: 94px;
    margin: 18px 0 auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: center;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 80%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 18%, #000 80%, transparent);
  }
  .lyrics-inner { width: 100%; max-width: 600px; margin-inline: auto; padding: 24px 0 35px; text-align: center; }
  .lyrics-line { color: var(--text-dim); font-size: 14px; line-height: 2; }
  .lyrics-line.active { color: var(--accent); font-size: 17px; font-weight: 600; transform: none; text-shadow: none; }
  .lyrics-inner:has(.lyrics-empty) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 0;
  }
  .lyrics-inner:has(.lyrics-empty) .lyrics-empty {
    width: min(100%, 420px);
    margin: 0 auto;
    text-align: center;
  }
  .lyrics-empty { color: var(--text-dim); }
  .lyrics-empty-hint { margin-inline: auto; }
  .lyrics-empty-title { color: var(--text-sub); font-size: 14px; }
  .lyrics-empty-title::before { display: none; }
  .layout > .search-panel,
  .layout > .playlist-panel { width: min(960px, calc(100% - 64px)); height: calc(100% - 44px); margin: 22px auto; padding: 25px 30px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-1); box-shadow: var(--sh-1); }
  .search-panel > .panel-header,
  .playlist-panel > .panel-header { padding: 0 0 16px; margin: 0 0 14px; }
  .search-panel .panel-title,
  .playlist-panel .panel-title { font-size: 14px; }
  .search-panel-content { padding: 0; }
  .search-row { min-height: 52px; border-radius: var(--r-sm); background: var(--bg); }
  .search-row .input { font-size: 14px; }
  .search-results-mini { gap: 5px; margin-top: 3px; }
  .search-mini-item { min-height: 58px; padding: 11px 14px; border-radius: var(--r-sm); background: transparent; }
  .search-mini-item:hover { background: var(--surface-2); }
  .playlist-panel > .panel-header { flex-wrap: wrap; }
  .playlist-panel > .panel-header .panel-title { width: auto; margin-right: auto; }
  .playlist-tabs { gap: 3px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); }
  .playlist-tab { padding: 7px 15px; border-radius: var(--r-pill); }
  .playlist-tab.active { background: var(--surface-1); color: var(--accent); box-shadow: var(--sh-1); }
  .playlist-main { padding: 0 3px; }
  .playlist-bar { background: var(--surface-1); }
  .track-item { min-height: 56px; padding: 9px 12px; border-radius: var(--r-sm); background: transparent; }
  .track-item:hover { background: var(--surface-2); }
  footer { display: none; }
}

@media (max-width: 760px) {
  .desktop-nav { display: none; }
  .header-controls { gap: 7px; }
  .client-download-nav-button { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
  .client-download-nav-button b { display: none; }
  body[data-mobile-view="queue"] .playlist-panel .playlist-tabs { display: none; }
  body[data-mobile-view="me"] .playlist-panel .playlist-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-mobile-view="me"] .playlist-panel .playlist-tab[data-tab="results"] { display: none; }
}

@media (min-width: 761px) {
  body[data-desktop-view="queue"] .playlist-panel .playlist-tabs { display: none; }
  body[data-desktop-view="me"] .playlist-panel .playlist-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-desktop-view="me"] .playlist-panel .playlist-tab[data-tab="results"] { display: none; }
}

.holiday-illustration {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #eeb98a;
}
.announcement-modal:has(.holiday-illustration) { width: min(480px, calc(100vw - 32px)); }
.announcement-modal:has(.holiday-illustration) .modal-header { margin-bottom: 7px; }
.announcement-modal:has(.holiday-illustration) .announcement-title { max-width: 360px; line-height: 1.55; }
.announcement-modal:has(.holiday-illustration) .announcement-copy { margin-bottom: 13px; }
.announcement-modal:has(.holiday-illustration) .announcement-actions { margin-top: 2px; }
.announcement-modal:has(.holiday-illustration) .announcement-actions .btn { min-width: 112px; }

@media (max-width: 520px) {
  .announcement-modal:has(.holiday-illustration) { width: min(440px, calc(100vw - 28px)); padding: 19px; }
  .announcement-modal:has(.holiday-illustration) .announcement-title { font-size: 16px; }
}

/* Account area inside My Music */
.account-profile-view[hidden] { display: none; }
.playlist-list[hidden],
.playlist-bar[hidden] { display: none !important; }
.account-profile-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr);
  align-content: start;
  gap: 16px;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 14px 4px 28px;
}
.account-profile-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 14px;
  padding: 8px 2px 17px;
  border-bottom: 1px solid var(--line);
}
.account-avatar-preview {
  display: grid;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 25px;
  font-weight: 700;
}
.account-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.account-profile-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.account-profile-heading p { margin: 4px 0 0; color: var(--text-dim); font-size: 12px; }
.account-form,
.listening-summary,
.account-session-actions {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-1);
}
.account-form { display: flex; flex-direction: column; align-items: stretch; gap: 13px; }
.account-form label,
.account-delete-details label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 550;
}
.account-form input,
.account-delete-details input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.account-form input:focus,
.account-delete-details input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.account-form > .btn { align-self: flex-start; min-height: 38px; padding-inline: 15px; }
.account-password-form h3,
.listening-summary h3 { margin: 0 0 2px; font-size: 14px; }
.account-password-form { grid-column: 1; }
.listening-summary { grid-column: 2; grid-row: 2 / span 2; }
.listening-summary-content { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.listening-summary-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.listening-stat { display: flex; flex-direction: column; gap: 4px; padding: 13px; border-radius: var(--r-sm); background: var(--surface-2); }
.listening-stat strong { font-family: var(--font-num); font-size: 23px; font-weight: 650; letter-spacing: -.04em; }
.listening-stat span,.account-muted { color: var(--text-dim); font-size: 11px; }
.listening-summary h4 { margin: 4px 0 -5px; color: var(--text-sub); font-size: 12px; font-weight: 600; }
.listening-top-tracks { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: top-track; }
.listening-top-tracks li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); counter-increment: top-track; }
.listening-top-tracks strong { min-width: 0; overflow: hidden; font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.listening-top-tracks span { color: var(--text-dim); font-size: 10px; white-space: nowrap; }
.account-session-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-delete-details { width: min(360px, 100%); color: var(--danger); font-size: 12px; }
.account-delete-details summary { cursor: pointer; }
.account-delete-details p { color: var(--text-dim); line-height: 1.6; }
.account-delete-details label { margin: 11px 0; color: var(--text-sub); }
.btn-danger { border: 1px solid var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.login-form [hidden] { display: none !important; }
.auth-brand-row { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.auth-brand-row i { margin-left: 4px; color: var(--accent); font-size: 8px; font-style: normal; }
.auth-brand-mark { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 850; letter-spacing: 0; }
.login-modal .modal { gap: 15px; width: min(430px, 100%); padding: 24px; }
.login-modal .modal-header { align-items: center; }
.login-modal .modal-title-wrap { font-size: 18px; letter-spacing: -.035em; }
.login-modal .modal-title-icon { width: 34px; height: 34px; font-size: 15px; }
.login-modal .modal-desc { padding-left: 43px; font-size: 12px; }
.login-form { gap: 14px; }
.login-form label { gap: 7px; color: var(--text-sub); font-size: 12px; font-weight: 550; }
.login-form input,
.login-form input[type="email"],
.login-form input[type="text"],
.login-form input[type="password"] {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.login-form input:focus { border-color: var(--accent); background: var(--surface-1); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-form input::placeholder { color: var(--text-dim); }
.login-actions { margin-top: 0; }
.login-actions .btn { width: 100%; min-height: 44px; border-radius: var(--r-xs); font-size: 13px; font-weight: 650; }
.login-notice { font-size: 10px; text-align: center; }
@media (max-width: 760px) {
  .account-profile-view { grid-template-columns: minmax(0, 1fr); gap: 11px; padding: 8px 0 20px; }
  .account-profile-heading { padding: 6px 2px 13px; }
  .account-avatar-preview { width: 52px; height: 52px; }
  .account-profile-heading h2 { font-size: 18px; }
  .account-form,.listening-summary,.account-session-actions { padding: 15px; }
  .account-password-form,.listening-summary { grid-column: 1; grid-row: auto; }
  .account-session-actions { flex-direction: column; }
  .login-modal { align-items: flex-end; padding: 10px; }
  .login-modal .modal,
  .login-modal .modal-title-wrap { font-size: 16px; }
  .login-modal .modal-desc { padding-left: 0; }
}
