:root {
  --bg: #08131d;
  --bg-soft: rgba(8, 19, 29, 0.62);
  --panel: rgba(10, 24, 37, 0.76);
  --panel-strong: rgba(13, 31, 47, 0.92);
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef5fb;
  --muted: #9db3c5;
  --accent: #f7ba63;
  --accent-soft: rgba(247, 186, 99, 0.14);
  --secondary: #6edfd0;
  --secondary-soft: rgba(110, 223, 208, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Segoe UI",
    "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(247, 186, 99, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(110, 223, 208, 0.18), transparent 24%),
    linear-gradient(180deg, #09131d 0%, #071019 100%);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

button,
input,
audio {
  font: inherit;
}

.background {
  position: fixed;
  inset: auto;
  width: 36rem;
  height: 36rem;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.6;
}

.background-left {
  top: -10rem;
  left: -8rem;
  background: rgba(247, 186, 99, 0.22);
}

.background-right {
  right: -8rem;
  bottom: -12rem;
  background: rgba(110, 223, 208, 0.2);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 168px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero,
.controls-panel,
.content-grid {
  animation: rise-in 0.8s ease both;
}

.hero {
  display: grid;
  gap: 24px;
  padding: 30px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 720px;
}

.hero-kicker,
.section-kicker {
  margin: 0 0 10px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--secondary);
}

.hero-text,
.panel-tip,
.track-meta,
.upload-description {
  color: var(--muted);
}

.hero-text {
  margin: 14px 0 0;
  max-width: 56ch;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-badges span,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.92rem;
}

.controls-panel {
  margin-top: 22px;
  padding: 24px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.upload-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 168px;
  padding: 18px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--panel-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-card:hover {
  border-color: rgba(247, 186, 99, 0.35);
}

.upload-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.upload-card input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.upload-card input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), #f29d52);
  color: #09131d;
  font-weight: 700;
  cursor: pointer;
}

.upload-card-button {
  justify-content: space-between;
}

.ghost-button {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(110, 223, 208, 0.35);
  border-radius: 999px;
  background: var(--secondary-soft);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(110, 223, 208, 0.6);
  background: rgba(110, 223, 208, 0.22);
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.now-playing {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.now-playing h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.7vw, 2.2rem);
}

.track-meta {
  margin: 10px 0 0;
  line-height: 1.6;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audio-player {
  display: none;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 22px;
}

.content-grid > .panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h3 {
  margin: 0;
  font-size: 1.5rem;
}

.panel-tip {
  margin: 0;
  text-align: right;
  line-height: 1.5;
}

.playlist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.track-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.track-item:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 186, 99, 0.34);
}

.track-item.active {
  background:
    linear-gradient(135deg, rgba(247, 186, 99, 0.2), rgba(110, 223, 208, 0.14)),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(247, 186, 99, 0.5);
}

.track-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.track-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state,
.empty-lyrics {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.lyrics-panel {
  min-height: 560px;
}

.lyrics {
  position: relative;
  margin-top: 22px;
  height: 100%;
  max-height: 640px;
  overflow: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.lyrics::-webkit-scrollbar,
.playlist::-webkit-scrollbar {
  width: 10px;
}

.lyrics::-webkit-scrollbar-thumb,
.playlist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.lyrics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 24px;
}

.lyric-line {
  position: relative;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
  color: rgba(238, 245, 251, 0.34);
  text-align: left;
  line-height: 1.7;
  cursor: pointer;
  opacity: 0.56;
  filter: blur(0.2px);
  transform: translateY(0) scale(0.985);
  transform-origin: center;
  will-change: transform, opacity, background-color;
  transition:
    color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.lyric-line:hover {
  color: rgba(238, 245, 251, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.92;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.lyric-line[data-distance="1"] {
  color: rgba(238, 245, 251, 0.72);
  opacity: 0.82;
  filter: blur(0);
  transform: translateY(0) scale(0.994);
}

.lyric-line[data-distance="2"] {
  color: rgba(238, 245, 251, 0.58);
  opacity: 0.72;
  filter: blur(0);
}

.lyric-line[data-distance="3"] {
  color: rgba(238, 245, 251, 0.46);
  opacity: 0.62;
}

.lyric-line.active {
  color: var(--text);
  border-color: rgba(247, 186, 99, 0.46);
  background:
    linear-gradient(135deg, rgba(247, 186, 99, 0.18), rgba(110, 223, 208, 0.1)),
    rgba(255, 255, 255, 0.06);
  opacity: 1;
  filter: blur(0);
  box-shadow: 0 12px 34px rgba(6, 12, 18, 0.22);
  transform: translateY(0) scale(1.018);
}

.lyric-line.active .lyric-time {
  color: var(--accent);
}

.lyric-time {
  display: inline-block;
  min-width: 72px;
  margin-right: 12px;
  color: rgba(157, 179, 197, 0.8);
  font-variant-numeric: tabular-nums;
}

.lyric-text {
  vertical-align: middle;
}

.bottom-player {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(180px, 260px) minmax(320px, 1fr);
  align-items: center;
  gap: 18px;
  width: min(1180px, calc(100vw - 32px));
  padding: 16px 18px;
  background: rgba(9, 21, 32, 0.88);
  border-radius: 24px;
  transform: translateX(-50%);
}

.transport-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.transport-button,
.play-toggle {
  min-width: 84px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.transport-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.play-toggle {
  min-width: 96px;
  border: 1px solid rgba(247, 186, 99, 0.45);
  background: linear-gradient(120deg, rgba(247, 186, 99, 0.22), rgba(242, 157, 82, 0.28));
}

.transport-button:hover:not(:disabled),
.play-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
}

.transport-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.play-toggle:hover:not(:disabled) {
  border-color: rgba(247, 186, 99, 0.72);
}

.transport-button:disabled,
.play-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bottom-track-copy {
  min-width: 0;
}

.bottom-track-title,
.bottom-track-meta {
  margin: 0;
}

.bottom-track-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-track-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.bottom-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.progress-time {
  min-width: 48px;
  color: var(--muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  width: 100%;
  height: 6px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.progress-bar:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .upload-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .bottom-player {
    grid-template-columns: 1fr;
  }

  .transport-controls,
  .bottom-track-copy,
  .bottom-progress {
    grid-column: 1 / -1;
  }

  .now-playing,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-tip {
    text-align: left;
  }

  .lyrics-panel {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 20px;
    padding-bottom: 216px;
  }

  .hero,
  .controls-panel,
  .content-grid > .panel {
    padding: 18px;
  }

  .hero-badges,
  .status-row {
    gap: 8px;
  }

  .hero-badges span,
  .status-pill {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.84rem;
  }

  .upload-card {
    min-height: auto;
  }

  .bottom-player {
    width: min(100vw - 16px, 100%);
    bottom: 8px;
    gap: 14px;
    padding: 14px;
  }

  .transport-controls {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .transport-button,
  .play-toggle {
    width: 100%;
  }

  .bottom-progress {
    gap: 10px;
  }

  .lyrics {
    max-height: 58vh;
  }

  .lyric-line {
    padding: 12px 14px;
  }

  .lyric-time {
    display: block;
    margin-bottom: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero,
  .controls-panel,
  .content-grid,
  .track-item,
  .ghost-button,
  .lyric-line,
  .transport-button,
  .play-toggle {
    animation: none;
    transition: none;
  }
}
