:root {
  --bg: #08080a;
  --card: rgba(255, 255, 255, .045);
  --line: rgba(255, 255, 255, .09);
  --text: #f2f3f5;
  --muted: #8b8f98;
  --red: #ec4141;
  --radius: 16px;
  --shadow: 0 16px 44px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 500px at 50% -8%, rgba(236, 65, 65, .16), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "HarmonyOS Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  padding: env(safe-area-inset-top) 0 calc(120px + env(safe-area-inset-bottom));
}

.shell { max-width: 560px; margin: 0 auto; padding: 16px 14px 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 14px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #d6d9df; font-size: 15px; }
.brand .ico { color: var(--red); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); color: var(--text); cursor: pointer;
}
.icon-btn.small { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn .ico { width: 15px; height: 15px; }
.icon-btn:active { transform: scale(.95); }
.icon-btn.spin .ico { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
}
h2 { font-size: 17px; margin: 0 0 6px; font-weight: 600; }
.h3 { font-size: 14px; color: #cfd3da; margin: 20px 2px 8px; font-weight: 600; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 12.5px; }
.err { color: #ff7b7b; font-size: 13px; margin: 10px 0 0; }
.block { display: flex; width: 100%; margin-top: 12px; }
#viewLogin > .small { margin-top: 12px; }
.seg-btn { border: 1px solid transparent; }

.seg { display: flex; gap: 6px; margin: 14px 0 4px; padding: 4px; background: rgba(255, 255, 255, .05); border-radius: 12px; }
.seg-btn {
  flex: 1; padding: 9px 0; border: 0; border-radius: 9px; background: none;
  color: #9aa0aa; font-size: 13.5px; cursor: pointer;
}
.seg-btn.on { background: rgba(236, 65, 65, .16); color: var(--text); font-weight: 600; border: 1px solid rgba(236, 65, 65, .3); }

.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field input, input {
  width: 100%; padding: 12px 13px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
  color: var(--text); font-size: 15px; outline: none;
}
input:focus { border-color: rgba(236, 65, 65, .6); box-shadow: 0 0 0 3px rgba(236, 65, 65, .14); }

.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline input { flex: 1; min-width: 0; }
.nowrap { flex: none; padding: 0 14px; height: 44px; white-space: nowrap; }

.primary {
  width: 100%; margin-top: 18px; padding: 13px 16px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #f05252, #d92f2f); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.primary:active { filter: brightness(.94); }
.primary:disabled { opacity: .6; }

.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04); color: #cfd3da; font-size: 14px; text-decoration: none; cursor: pointer;
}
.link { border: 0; background: none; color: #f08a8a; font-size: 13px; cursor: pointer; padding: 0; }
.link.danger { color: #ff8f8f; }

.captcha { width: 96px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }

.qr-wrap {
  position: relative; margin: 14px auto; width: 210px; height: 210px;
  display: grid; place-items: center; background: #fff; border-radius: 14px; padding: 10px;
}
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: none; }
.qr-blank { position: absolute; inset: 0; display: grid; place-items: center; color: #6b7280; font-size: 13px; }

.profile { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: rgba(255, 255, 255, .08); flex: none; }
.p-info { flex: 1; min-width: 0; }
.profile h2 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 6px; margin: 2px 0 14px; overflow-x: auto; padding-bottom: 2px; }
.tab {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04); color: #9aa0aa; font-size: 13.5px; cursor: pointer; white-space: nowrap;
}
.tab.on { background: rgba(236, 65, 65, .16); border-color: rgba(236, 65, 65, .35); color: var(--text); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pl-card { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; }
.pl-card:active { background: rgba(255, 255, 255, .08); }
.pl-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #1a1a1f; }
.pl-card .pl-meta { padding: 9px 10px 11px; }
.pl-card .pl-name { font-size: 13.5px; line-height: 1.35; height: 2.7em; overflow: hidden; }
.pl-card .pl-count { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.songlist { list-style: none; margin: 0; padding: 0; }
.song {
  display: flex; align-items: center; gap: 11px; padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .06); cursor: pointer;
}
.song:last-child { border-bottom: 0; }
.song:active { background: rgba(255, 255, 255, .05); }
.song .idx { width: 22px; text-align: center; color: #6c727c; font-size: 12.5px; flex: none; }
.song .cov { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; flex: none; background: #1a1a1f; }
.song .s-info { flex: 1; min-width: 0; }
.song .s-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .s-meta { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .s-dur { font-size: 11.5px; color: #6c727c; flex: none; }

.detail-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.detail-head img { width: 74px; height: 74px; border-radius: 12px; object-fit: cover; flex: none; background: #1a1a1f; }
.detail-head .d-name { font-size: 15.5px; font-weight: 600; }
.detail-head .d-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: rgba(12, 12, 15, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.player-name { font-size: 12.5px; color: #cfd3da; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#playerFrame { width: 100%; height: 66px; border: 0; border-radius: 10px; background: #111; }

.toast {
  position: fixed; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: 84vw; padding: 9px 15px; border-radius: 999px;
  background: rgba(22, 22, 26, .94); border: 1px solid var(--line); color: #e8ebef; font-size: 13px; box-shadow: var(--shadow);
}

@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f5f5f7; --card: rgba(255, 255, 255, .94); --line: rgba(15, 20, 30, .1); --text: #17181c; --muted: #6b717b; --shadow: 0 8px 24px rgba(15, 20, 30, .08); }
  body { background: radial-gradient(900px 420px at 50% -6%, #ffe9e9, transparent 70%), var(--bg); }
  .brand { color: #4a505a; }
  .song { border-bottom-color: rgba(15, 20, 30, .07); }
  .player { background: rgba(255, 255, 255, .97); }
  .player-name { color: #4a505a; }
  .toast { background: rgba(255, 255, 255, .96); color: #17181c; }
}

@media (prefers-color-scheme: light) {
  .ghost { color: #4a5058; background: rgba(15, 20, 30, .04); border-color: rgba(15, 20, 30, .1); }
  .ghost:active { background: rgba(15, 20, 30, .08); }
  .icon-btn { color: #33383f; }
}
