:root {
  --bg: #0a0014;
  --deck: #12001f;
  --panel: rgba(8, 2, 18, 0.84);
  --panel-strong: rgba(14, 3, 27, 0.94);
  --text: #f8fbff;
  --muted: rgba(248, 251, 255, 0.72);
  --faint: rgba(248, 251, 255, 0.48);
  --line: rgba(0, 255, 255, 0.32);
  --cyan: #00ffff;
  --magenta: #ff006e;
  --green: #00ff41;
  --amber: #ffb000;
  --shadow: rgba(0, 255, 255, 0.2);
  --radius: 8px;
  font-family: "Space Mono", "IBM Plex Mono", Consolas, "Microsoft YaHei", monospace;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 0, 110, 0.3), transparent 30%),
    radial-gradient(circle at 86% 20%, rgba(0, 255, 255, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(18, 0, 31, 0.88), rgba(10, 0, 20, 0.98) 42%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 0, 110, 0.052) 1px, transparent 1px),
    radial-gradient(circle at center, transparent 34%, rgba(10, 0, 20, 0.58) 100%);
  background-size: auto, 80px 80px, 80px 80px, auto;
  mix-blend-mode: screen;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

a {
  color: inherit;
}

.three-music-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.68;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 42px;
  padding: 10px;
  border: 1px solid rgba(0, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(7, 0, 18, 0.66);
  box-shadow: 0 0 0 1px rgba(255, 0, 110, 0.08), 0 18px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.brand,
.nav-button,
.primary-button,
.secondary-button,
.ghost-button,
.primary-link,
.play-link,
.missing-link {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
  background: rgba(10, 0, 20, 0.72);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark,
.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--magenta), var(--cyan));
  box-shadow: 0 0 26px rgba(0, 255, 255, 0.36);
}

.brand-mark {
  width: 32px;
  height: 32px;
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  border-radius: 999px;
}

.brand-mark::before {
  inset: 7px;
  border: 2px solid rgba(10, 0, 20, 0.88);
}

.brand-mark::after {
  width: 6px;
  height: 6px;
  background: rgba(10, 0, 20, 0.88);
}

.nav-actions,
.home-entry-actions,
.form-actions,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-button,
.secondary-button,
.ghost-button {
  padding: 0 18px;
  background: rgba(10, 0, 20, 0.62);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-color: rgba(0, 255, 255, 0.78);
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.92), rgba(0, 255, 255, 0.86));
  box-shadow: 0 0 28px var(--shadow);
  font-weight: 900;
  text-decoration: none;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.brand:hover,
.nav-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.play-link:hover {
  border-color: rgba(0, 255, 255, 0.68);
  background: rgba(0, 255, 255, 0.08);
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.12);
}

.primary-button:hover,
.primary-link:hover {
  filter: saturate(1.18) brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(0, 255, 255, 0.26);
}

.compact {
  min-height: 40px;
  padding: 0 16px;
}

.page-host {
  min-height: 620px;
}

.home-entry,
.form-layout,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  align-items: start;
}

.home-entry {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 360px;
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.home-entry::after {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: min(34vw, 330px);
  height: min(34vw, 330px);
  border: 1px solid rgba(0, 255, 255, 0.22);
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle, transparent 0 13%, rgba(0, 255, 255, 0.22) 13.5% 14.2%, transparent 14.8% 29%, rgba(255, 0, 110, 0.24) 29.5% 30.2%, transparent 30.8% 48%, rgba(0, 255, 255, 0.16) 48.5% 49.2%, transparent 49.8%);
  opacity: 0.72;
  pointer-events: none;
}

.home-entry-actions {
  justify-content: flex-end;
}

.section-label {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(0, 255, 255, 0.56);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 5.8vw, 5.3rem);
  line-height: 0.98;
  letter-spacing: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Arial Black", "Space Mono", sans-serif;
  font-weight: 950;
  text-shadow:
    0 0 18px rgba(0, 255, 255, 0.38),
    2px 0 rgba(255, 0, 110, 0.48),
    -2px 0 rgba(0, 255, 255, 0.42);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.hero-text,
.form-intro p,
.empty-state p {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.glass-panel,
.chain-card,
.song-card,
.stat-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, var(--panel-strong), rgba(10, 0, 20, 0.62)),
    linear-gradient(90deg, rgba(0, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 24px 24px;
  box-shadow: 0 0 0 1px rgba(255, 0, 110, 0.12), 0 24px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.chain-meta,
.song-meta,
.muted {
  margin: 0;
  color: var(--muted);
}

.content-section {
  margin-top: 42px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 0 4px;
}

.section-heading h2 {
  max-width: 760px;
}

.chain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.chain-card {
  display: grid;
  gap: 18px;
  min-height: 210px;
  padding: 22px;
  text-align: left;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.chain-card::before,
.song-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: linear-gradient(to bottom, var(--cyan), var(--magenta));
  opacity: 0.88;
}

.chain-card:hover,
.song-card:hover {
  transform: translateY(-3px);
  transition: transform 180ms ease;
  border-color: rgba(255, 0, 110, 0.58);
}

.chain-card h3 {
  font-size: 1.45rem;
}

.chain-stats,
.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  padding: 14px;
  background: rgba(0, 255, 255, 0.07);
}

.stat-value {
  display: block;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--green);
}

.stat-label {
  color: var(--faint);
  font-size: 0.88rem;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 32px;
  text-align: center;
}

.form-intro {
  position: sticky;
  top: 24px;
}

.form-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-color: rgba(0, 255, 255, 0.36);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(0, 255, 255, 0.24);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: rgba(4, 0, 14, 0.86);
}

input {
  height: 48px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 13px 14px;
}

input:focus,
textarea:focus {
  border-color: rgba(0, 255, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.14);
}

::placeholder {
  color: rgba(248, 251, 255, 0.4);
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.lookup-button {
  white-space: nowrap;
}

.lookup-preview {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(0, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(0, 255, 255, 0.06);
}

.lookup-cover {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid rgba(0, 255, 255, 0.38);
  border-radius: var(--radius);
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.2);
}

.lookup-cover-fallback {
  display: grid;
  place-items: center;
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.82), rgba(0, 255, 255, 0.82));
  font-size: 1.8rem;
  font-weight: 950;
}

.lookup-preview strong,
.lookup-preview span {
  display: block;
  overflow-wrap: anywhere;
}

.lookup-preview strong {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1.1rem;
}

.lookup-preview span {
  color: var(--muted);
}

.detail-header {
  display: grid;
  gap: 22px;
  margin-bottom: 20px;
}

.detail-header h1 {
  max-width: 820px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.detail-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.latest-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 38px;
  padding: 24px;
  border-color: rgba(255, 0, 110, 0.48);
  position: relative;
  overflow: hidden;
}

.latest-panel::before {
  position: absolute;
  inset: auto 24px 18px 238px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.7), transparent);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.32);
}

.latest-cover-wrap {
  position: relative;
  width: 190px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 255, 0.42);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.82), rgba(0, 255, 255, 0.82));
  box-shadow:
    0 0 30px rgba(0, 255, 255, 0.24),
    0 0 44px rgba(255, 0, 110, 0.18);
}

.latest-cover-wrap::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.08));
}

.latest-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-cover-fallback {
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 3.8rem;
  font-weight: 950;
}

.latest-song-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 18px;
  margin-bottom: 10px;
}

.latest-song-title,
.latest-song-artist,
.latest-song-separator {
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.latest-song-title {
  color: var(--text);
}

.latest-song-artist,
.latest-song-separator {
  color: rgba(248, 251, 255, 0.72);
}

.latest-actions {
  display: grid;
  gap: 12px;
  min-width: 210px;
}

.history-heading {
  margin-top: 0;
}

.timeline::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 27px;
  width: 2px;
  content: "";
  background: linear-gradient(to bottom, var(--cyan), var(--magenta));
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.46);
}

.song-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 20px;
  overflow: hidden;
}

.avatar,
.song-cover {
  width: 56px;
  height: 56px;
}

.avatar {
  color: var(--text);
  font-weight: 900;
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.2);
}

.song-cover {
  position: relative;
  z-index: 1;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(0, 255, 255, 0.36);
  border-radius: var(--radius);
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.24);
}

.song-content {
  min-width: 0;
}

.song-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.song-title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 8px 0 6px;
}

.song-title,
.song-artist,
.song-separator {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.song-artist,
.song-separator {
  color: rgba(248, 251, 255, 0.72);
}

.score-pill,
.pending-pill,
.order-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  white-space: nowrap;
  font-weight: 900;
}

.score-pill {
  gap: 8px;
  color: #001014;
  background: var(--amber);
}

.score-pill small {
  font-size: 0.8rem;
}

.pending-pill,
.order-pill {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 255, 255, 0.06);
}

.order-pill {
  color: var(--cyan);
}

.reason-box,
.comment-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(0, 255, 255, 0.055);
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.song-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.play-link,
.missing-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  background: rgba(10, 0, 20, 0.62);
  text-decoration: none;
  font-weight: 800;
}

.missing-link {
  color: var(--muted);
}

.missing-link.large {
  min-height: 46px;
  padding: 0 18px;
}

.join-preview {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.rating-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 12px 14px;
  border: 1px solid rgba(0, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(0, 255, 255, 0.06);
}

.rating-row label {
  display: inline-flex;
}

.rating-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.rating-choice,
.star {
  display: block;
  background: rgba(248, 251, 255, 0.28);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
}

.rating-choice {
  width: 34px;
  height: 34px;
  transition: background 160ms ease, transform 160ms ease;
}

.rating-choice.filled,
.rating-row label:hover .rating-choice {
  background: var(--amber);
  transform: translateY(-1px);
}

.rating-hint {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.stars {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.star {
  width: 14px;
  height: 14px;
}

.star.filled {
  background: #001014;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100% - 48px));
  padding: 14px 18px;
  border: 1px solid rgba(0, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(10, 0, 20, 0.94);
  box-shadow: 0 0 34px rgba(0, 255, 255, 0.22);
}

@media (max-width: 900px) {
  .home-entry,
  .form-layout,
  .detail-layout,
  .latest-panel {
    grid-template-columns: 1fr;
  }

  .latest-cover-wrap {
    width: min(220px, 58vw);
  }

  .latest-panel::before {
    inset: auto 22px 18px 22px;
  }

  .form-intro {
    position: static;
  }

  .home-entry-actions,
  .latest-actions {
    justify-content: stretch;
  }

  .chain-grid {
    grid-template-columns: 1fr;
  }

  .detail-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 28px;
  }

  .home-entry {
    min-height: 0;
    padding: 24px;
  }

  .home-entry::after {
    right: -56px;
    bottom: -56px;
    width: 220px;
    height: 220px;
    opacity: 0.38;
  }

  .nav-actions,
  .home-entry-actions,
  .form-actions,
  .detail-actions {
    width: 100%;
  }

  .nav-actions > *,
  .home-entry-actions > *,
  .form-actions > *,
  .detail-actions > * {
    flex: 1 1 auto;
  }

  .field-pair,
  .chain-stats,
  .detail-stats {
    grid-template-columns: 1fr;
  }

  .song-card {
    grid-template-columns: 44px 1fr;
    padding: 16px;
  }

  .avatar,
  .song-cover {
    width: 44px;
    height: 44px;
  }

  .timeline::before {
    left: 21px;
  }

  .song-title-row {
    flex-direction: column;
  }

  .lookup-row {
    grid-template-columns: 1fr;
  }

  .latest-song-main {
    gap: 4px 10px;
  }
}
