:root {
  --bg: #07060c;
  --bg-2: #120c1c;
  --card: rgba(22, 16, 32, 0.86);
  --line: rgba(255, 70, 180, 0.22);
  --text: #f6f1ff;
  --muted: #b7a8c9;
  --pink: #ff2f9b;
  --cyan: #3cefff;
  --gold: #ffd56a;
  --danger: #ff5d73;
  --ok: #5dffb2;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 47, 155, 0.16), transparent 32%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
  overflow-x: hidden;
}
body.has-player { padding-bottom: 110px; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-orb {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
}
.bg-orb-a { background: #ff2f9b; top: -80px; right: -80px; }
.bg-orb-b { background: #4a1bff; bottom: 10%; left: -120px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 12, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark, .brand-name {
  font-family: Orbitron, "Noto Sans SC", sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.brand-mark { color: var(--pink); font-size: 1.4rem; }
.brand-name { color: var(--cyan); font-size: 1.4rem; }
.brand-sub { color: var(--muted); font-size: 0.85rem; margin-left: 4px; }
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.nav a { color: var(--text); }
.nav-user { color: var(--muted); font-size: 0.9rem; }

.page { width: min(1160px, calc(100% - 32px)); margin: 24px auto 48px; }
.hero { margin-bottom: 24px; }
.hero.slim { margin-bottom: 16px; }
.eyebrow {
  font-family: Orbitron, sans-serif;
  color: var(--pink);
  letter-spacing: 0.22em;
  font-size: 0.76rem;
  margin: 0 0 8px;
}
h1, h2, h3 { margin: 0 0 10px; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: 0.02em; }
.lead, .muted, .hint { color: var(--muted); }
.hint { font-size: 0.9rem; }

.flash-wrap { width: min(1160px, calc(100% - 32px)); margin: 16px auto 0; }
.flash {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: rgba(60, 239, 255, 0.12);
  border: 1px solid rgba(60, 239, 255, 0.3);
}
.flash-success { background: rgba(93, 255, 178, 0.12); border-color: rgba(93, 255, 178, 0.35); }
.flash-error { background: rgba(255, 93, 115, 0.14); border-color: rgba(255, 93, 115, 0.4); }

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 20px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.count { color: var(--gold); font-size: 0.9rem; }

.ann-list { list-style: none; margin: 0; padding: 0; }
.ann-list li + li { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.ann-body { white-space: pre-wrap; line-height: 1.7; }

.upload-form, .chat-form, .stack-form, .auth-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.upload-form { grid-template-columns: 1.2fr 1fr auto; align-items: center; }
input[type="text"], input[type="email"], input[type="password"], input[type="file"], textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8, 7, 14, 0.8);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-size: 0.92rem; }

.btn, .link-btn, .play-btn {
  font: inherit;
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: #160314;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 0.9rem; }
.btn-block { width: 100%; }
.btn-danger { background: linear-gradient(135deg, #ff8aa0, var(--danger)); color: #2b0008; }
.link-btn {
  border: 0;
  background: none;
  color: var(--cyan);
  padding: 0;
}
.link-btn.danger { color: var(--danger); }
.inline-form { display: inline; }

.track-list { list-style: none; margin: 16px 0 0; padding: 0; }
.track-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
}
.track-item:hover, .track-item.is-playing {
  background: rgba(255, 47, 155, 0.12);
}
.play-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #1b1226;
  color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(60, 239, 255, 0.4);
  flex: none;
}
.track-meta { display: grid; gap: 3px; min-width: 0; }
.track-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-panel { display: flex; flex-direction: column; min-height: 520px; }
.chat-log {
  flex: 1;
  overflow: auto;
  max-height: 480px;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg p { margin: 4px 0 0; }
.chat-meta { color: var(--muted); font-size: 0.8rem; display: flex; gap: 8px; justify-content: space-between; }
.chat-meta b { color: var(--gold); font-weight: 600; }

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10, 8, 16, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 30;
}
.player-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player audio { width: min(640px, 58vw); }
.live-dot {
  width: 10px;
  height: 10px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--pink);
}

.auth-card {
  width: min(460px, 100%);
  margin: 40px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}
.stat b { display: block; font-size: 1.6rem; color: var(--cyan); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
.edit-card { display: grid; gap: 8px; margin-bottom: 6px; }
.row-actions, .danger-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 10px 16px 30px;
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .grid-main, .stats, .upload-form { grid-template-columns: 1fr; }
  .chat-panel { min-height: 360px; }
  .player { flex-direction: column; align-items: stretch; }
  .player audio { width: 100%; }
  body.has-player { padding-bottom: 150px; }
}
