:root {
  --bg: #0b0b10;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f2f5;
  --muted: #9a9aa8;
  --accent: #ec4141;
  --accent-2: #ff6b6b;
  --player-space: 190px;
}

* { box-sizing: border-box; }

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--player-space) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.aura {
  position: fixed;
  inset: -10% -30% auto -30%;
  height: 52vh;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(236, 65, 65, 0.22), transparent 60%),
    radial-gradient(ellipse at 75% 5%, rgba(120, 60, 220, 0.16), transparent 55%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.top {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, var(--accent), #a4132a);
  box-shadow: 0 8px 24px rgba(236, 65, 65, 0.35);
}

.logo svg { width: 21px; height: 21px; color: #fff; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 16px; letter-spacing: 0.06em; }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: 0.05em; margin-top: 3px; white-space: nowrap; }

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status span { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #f5a623; box-shadow: 0 0 10px rgba(245, 166, 35, 0.7); flex: 0 0 auto; }
.status.online .dot { background: #35d07f; box-shadow: 0 0 10px rgba(53, 208, 127, 0.75); }

main { position: relative; z-index: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.hero { padding: 40px 0 22px; text-align: center; }

.eyebrow { margin: 0 0 12px; font-size: 10px; letter-spacing: 0.22em; color: var(--accent-2); font-weight: 600; }

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 8.6vw, 54px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-2), #ffb1b1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede { margin: 14px auto 0; max-width: 560px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 680px;
  margin: 24px auto 0;
  padding: 6px 6px 6px 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 18, 24, 0.85);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search:focus-within { border-color: rgba(236, 65, 65, 0.55); box-shadow: 0 0 0 4px rgba(236, 65, 65, 0.1), 0 18px 40px rgba(0, 0, 0, 0.35); }

.search-icon { position: absolute; left: 16px; width: 17px; height: 17px; color: var(--muted); }

.search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  padding: 10px 0;
  appearance: none;
}

.search input::placeholder { color: #6f6f7d; font-size: 14px; }

.search button {
  flex: 0 0 auto;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #c81f38);
  box-shadow: 0 8px 20px rgba(236, 65, 65, 0.28);
  touch-action: manipulation;
}

.search button:active { transform: scale(0.97); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }

.chips button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
  touch-action: manipulation;
}

.chips button:active { color: var(--text); border-color: rgba(236, 65, 65, 0.45); background: rgba(236, 65, 65, 0.08); }

.board { padding: 18px 0 48px; }

.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding: 0 2px; }
.board-head h2 { margin: 0; font-size: 15.5px; }
.board-head span { color: var(--muted); font-size: 11.5px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

.track {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  touch-action: manipulation;
}

.track:active { background: rgba(255, 255, 255, 0.075); }
.track.active { border-color: rgba(236, 65, 65, 0.5); background: rgba(236, 65, 65, 0.1); }

.t-cover {
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #242430, #17171f);
  display: grid;
  place-items: center;
}

.t-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-cover svg { width: 19px; height: 19px; color: #55556a; }

.t-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.t-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.t-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.t-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}

.t-btn:active { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.t-btn svg { width: 17px; height: 17px; }

.t-play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, 0.08); }
.t-play svg { width: 12px; height: 12px; margin-left: 1px; }
.track.active .t-play { background: var(--accent); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 52px 0; color: #61616f; }
.empty svg { width: 34px; height: 34px; opacity: 0.6; }
.empty p { margin: 0; font-size: 13px; }

.foot { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 16px 22px; color: #55555f; font-size: 11px; text-align: center; }

.player {
  position: fixed;
  z-index: 10;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  margin: 0 auto;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  grid-template-areas:
    "cover info toggle"
    "progress progress progress"
    "actions actions actions";
  align-items: center;
  gap: 8px 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 17, 23, 0.94);
  backdrop-filter: blur(22px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

.player[hidden] { display: none; }

.p-cover { grid-area: cover; width: 44px; height: 44px; border-radius: 11px; overflow: hidden; background: linear-gradient(145deg, #2a2a36, #17171f); display: grid; place-items: center; }
.p-cover img { width: 100%; height: 100%; object-fit: cover; }
.p-cover svg { width: 18px; height: 18px; color: #55556a; }

.p-info { grid-area: info; min-width: 0; }
.p-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist { margin-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.p-toggle {
  grid-area: toggle;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #b9182f);
  box-shadow: 0 8px 20px rgba(236, 65, 65, 0.3);
  touch-action: manipulation;
}

.p-toggle svg { width: 18px; height: 18px; }
.p-toggle .icon-pause { display: none; }
.player.playing .p-toggle .icon-play { display: none; }
.player.playing .p-toggle .icon-pause { display: block; }

.p-progress { grid-area: progress; min-width: 0; }
.p-progress input { width: 100%; display: block; }
.p-times { display: flex; justify-content: space-between; margin-top: 1px; color: var(--muted); font-size: 9.5px; font-variant-numeric: tabular-nums; }

.p-actions { grid-area: actions; display: flex; gap: 7px; }

.p-act {
  flex: 1;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  padding: 0 8px;
}

.p-act.primary { background: rgba(236, 65, 65, 0.16); border-color: rgba(236, 65, 65, 0.45); color: #ffb4b4; }
.p-act.disabled, .p-act[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.p-act:active { background: rgba(255, 255, 255, 0.1); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
  margin: 0;
}

input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(236, 65, 65, 0.35); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(236, 65, 65, 0.35); }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(var(--player-space) + 12px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 12px);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(28, 28, 36, 0.97);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  :root { --player-space: 150px; }
  .top { padding: 24px 24px 0; }
  main { padding: 0 24px; }
  .hero { padding: 64px 0 28px; }
  .search { margin-top: 30px; padding: 8px 8px 8px 48px; }
  .search-icon { left: 18px; width: 19px; height: 19px; }
  .search input::placeholder { font-size: 15px; }
  .search button { min-height: 46px; padding: 0 24px; }
  .lede { font-size: 15px; }
  .chips { margin-top: 18px; }
  .chips button { min-height: 36px; padding: 0 16px; }
  .board { padding-top: 24px; }
  .board-head h2 { font-size: 17px; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .track { padding: 11px; gap: 12px; border-radius: 15px; }
  .t-cover { width: 54px; height: 54px; flex-basis: 54px; }
  .t-name { font-size: 14.5px; }
  .t-sub { font-size: 12px; }
  .t-btn { width: 36px; height: 36px; }
  .t-play { width: 34px; height: 34px; }
  .player {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    grid-template-columns: 52px minmax(0, 1fr) minmax(140px, 1.4fr) 44px auto;
    grid-template-areas: "cover info progress toggle actions";
    gap: 14px;
    padding: 12px 16px;
    border-radius: 20px;
  }
  .p-cover { width: 52px; height: 52px; border-radius: 12px; }
  .p-title { font-size: 13.5px; }
  .p-artist { font-size: 11.5px; }
  .p-actions { gap: 8px; flex: 0 0 auto; }
  .p-act { flex: 0 0 auto; min-height: 40px; padding: 0 13px; font-size: 12.5px; }
  .p-times { font-size: 10px; }
  .toast { bottom: auto; top: 24px; transform: translate(-50%, -12px); }
  .toast.show { transform: translate(-50%, 0); }
}

@media (max-width: 359px) {
  .status { display: none; }
  .brand-text small { display: none; }
  .search button { padding: 0 14px; }
  .t-cover { width: 44px; height: 44px; flex-basis: 44px; }
  .p-act { font-size: 12px; }
}
