/* 星音sumi 歌切电台 —— 单文件样式，无外部字体/CDN */
:root {
  --bg: #080b11;
  --bg-soft: #0e131c;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9eef7;
  --muted: #94a3b8;
  --dim: #64748b;
  --pink: #ff5d8f;
  --pink-soft: rgba(255, 93, 143, 0.16);
  --cyan: #7dd3fc;
  --player-h: 84px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(255, 93, 143, 0.16), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(125, 211, 252, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", sans-serif;
  line-height: 1.5;
  padding-bottom: calc(var(--player-h) + 34px);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 头部 ---------- */
.hero {
  padding: 34px 0 8px;
  position: relative;
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #12161f;
  background: linear-gradient(140deg, var(--pink), #ffb3c7 60%, var(--cyan));
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(255, 93, 143, 0.25);
}
h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.stats {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.stats .sep { color: var(--dim); }

/* ---------- 工具栏 ---------- */
.toolbar {
  margin: 18px 0 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.search {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  height: 42px;
  transition: border-color 0.15s, background 0.15s;
}
.search:focus-within {
  border-color: rgba(255, 93, 143, 0.55);
  background: var(--panel-strong);
}
.search .ico { color: var(--dim); font-size: 18px; }
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 14px;
  height: 100%;
}
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { display: none; }
.q-clear {
  border: 0;
  background: var(--panel-strong);
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  font-size: 15px;
}
.q-clear:hover { color: var(--text); }

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tabs button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  background: linear-gradient(140deg, rgba(255, 93, 143, 0.9), rgba(255, 93, 143, 0.65));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 93, 143, 0.25);
}

/* ---------- 列表 ---------- */
.list {
  max-width: 1180px;
  margin: 10px auto 0;
  padding: 0 22px;
}
.group { margin-top: 26px; }
.group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.group-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.3px;
}
.group-head .count {
  color: var(--dim);
  font-size: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 16px;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  background: var(--panel-strong);
  border-color: rgba(255, 255, 255, 0.16);
}
.card:focus-visible { box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.6); }
.card .cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #111722;
  overflow: hidden;
}
.card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.2s ease;
}
.card:hover .cover img { transform: scale(1.04); }
.card .cover.noimg { display: grid; place-items: center; }
.card .cover.noimg .ph { color: var(--dim); font-size: 30px; }
.card .playico {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 11, 17, 0.62);
  color: #fff;
  font-size: 13px;
  padding-left: 2px;
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.16s, transform 0.16s;
}
.card:hover .playico, .card.playing .playico { opacity: 1; transform: none; }
.card.playing { border-color: rgba(255, 93, 143, 0.65); }
.card.playing::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 93, 143, 0.65);
  pointer-events: none;
}
.card .meta { padding: 11px 13px 13px; }
.card .title {
  font-size: 14.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .artist {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 11.5px;
}
.card .row .dot { opacity: 0.6; }
.card .row .kind {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: #ffb3c7;
  font-size: 11px;
}
.card .bili {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(8, 11, 17, 0.66);
  color: #cfe6ff;
  font-size: 11px;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.16s;
  backdrop-filter: blur(4px);
}
.card:hover .bili { opacity: 1; }
.card .bili:hover { background: rgba(8, 11, 17, 0.85); }

/* ---------- 空状态 / 页脚 ---------- */
.empty {
  padding: 70px 0;
  text-align: center;
  color: var(--muted);
}
.empty-ico { font-size: 34px; color: var(--dim); }
.foot {
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 22px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.7;
  border-top: 1px solid var(--line);
}
.foot p { margin: 0; }
.foot .dim { margin-top: 4px; color: #4b5563; }

/* ---------- 底部播放器 ---------- */
.player[hidden] { display: none; }
.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px max(18px, calc(50vw - 570px));
  background: rgba(10, 13, 19, 0.82);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  min-height: var(--player-h);
}
.p-cover {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: #111722;
}
.p-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-main { min-width: 0; }
.p-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.p-title {
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-state {
  color: var(--pink);
  font-size: 11.5px;
  flex: 0 0 auto;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.p-artist {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-bili {
  flex: 0 0 auto;
  color: #9fd4ff;
  font-size: 11.5px;
  text-decoration: none;
  border: 1px solid rgba(125, 211, 252, 0.35);
  padding: 0 6px;
  border-radius: 6px;
}
.p-bar {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.p-time {
  color: var(--dim);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}
.p-time:last-child { text-align: right; }
.seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 93, 143, 0.2);
}
.seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--pink);
}
.p-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctrl {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ctrl:hover { background: var(--panel-strong); color: var(--text); }
.ctrl.play {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--pink), #ff8fb0);
  color: #1a1016;
  font-size: 15px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(255, 93, 143, 0.3);
}
.ctrl.play:hover { filter: brightness(1.06); color: #1a1016; }
.ctrl.speed { width: auto; padding: 0 8px; font-size: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + 18px);
  transform: translateX(-50%);
  background: rgba(20, 25, 35, 0.96);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  max-width: min(92vw, 480px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  :root { --player-h: 76px; }
  .hero { padding-top: 24px; }
  h1 { font-size: 21px; }
  .logo { width: 44px; height: 44px; font-size: 20px; border-radius: 13px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card .meta { padding: 9px 10px 11px; }
  .card .title { font-size: 13.5px; }
  .card .row { font-size: 11px; }
  .player {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 14px;
  }
  .p-cover { width: 44px; height: 44px; }
  .p-artist { display: none; }
  .p-ctrl { gap: 2px; }
  .ctrl { width: 30px; height: 30px; }
  .ctrl.play { width: 38px; height: 38px; }
  .ctrl.speed { display: none; }
  .toast { bottom: calc(var(--player-h) + 12px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
