/* ========================================
   NeonVoice KTV v4 — Styles
   Cyberpunk theme with neon accents
   ======================================== */

:root {
  --bg-deep: #0a0a1a;
  --bg-panel: #0f0f2a;
  --bg-card: #141430;
  --bg-input: #1a1a3a;
  --border: #1e1e4a;
  --text: #e0e0f0;
  --text-dim: #7070a0;
  --cyan: #00f0ff;
  --magenta: #ff00ff;
  --green: #00ff88;
  --yellow: #ffb347;
  --red: #ff4757;
  --purple: #a855f7;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font-main: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Orbitron', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

#bgCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

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

/* ========== Navigation ========== */
.main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(10,10,26,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo { font-size: 1.6rem; }

.brand-text {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}

.brand-text .accent { color: var(--cyan); }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--cyan); background: rgba(0,240,255,0.1); }

.nav-right { display: flex; align-items: center; }

.admin-btn {
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 4px 8px;
  border-radius: 6px;
}

.admin-btn:hover { opacity: 1; background: rgba(255,255,255,0.05); }

/* ========== Sections ========== */
.section {
  display: none;
  position: relative;
  z-index: 1;
  padding-top: 80px;
  min-height: 100vh;
}

.section.active { display: block; }

/* ========== Hero ========== */
.hero {
  text-align: center;
  padding: 60px 20px 30px;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.glitch {
  position: relative;
  color: #fff;
  text-shadow: 0 0 10px rgba(0,240,255,0.8), 0 0 40px rgba(255,0,255,0.4);
}

.hero-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  letter-spacing: 2px;
}

/* ========== Search ========== */
.search-container {
  position: relative;
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 0 20px;
}

.search-box-wrapper {
  display: flex;
  gap: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0,240,255,0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box-wrapper:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(0,240,255,0.15);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-main);
  padding: 14px 18px;
}

.search-input::placeholder { color: var(--text-dim); }

.search-btn {
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  border: none;
  color: #fff;
  font-size: 0.95rem;
  font-family: var(--font-main);
  font-weight: 500;
  padding: 14px 28px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.search-btn:hover { opacity: 0.9; }

/* Suggestions Dropdown */
.suggestions-dropdown {
  display: none;
  position: absolute;
  left: 20px; right: 20px;
  top: 100%;
  margin-top: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 10px 18px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: rgba(0,240,255,0.08); color: var(--cyan); }

/* ========== Search History ========== */
.search-history {
  display: none;
  max-width: 640px;
  margin: 0 auto 20px;
  padding: 0 20px;
}

.history-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.history-tag:hover { border-color: var(--cyan); color: var(--cyan); }

.history-tag .del {
  opacity: 0.4;
  font-size: 0.7rem;
  margin-left: 4px;
}

.history-tag .del:hover { opacity: 1; color: var(--red); }

/* ========== Search Results ========== */
.search-results {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.results-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 1rem;
}

.hot-keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
}

.tag {
  display: inline-block;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.1);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.result-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,240,255,0.1);
  transform: translateY(-1px);
}

.result-cover {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0,240,255,0.2), rgba(255,0,255,0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}

.result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-info { flex: 1; min-width: 0; }

.result-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-artist {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.result-meta { margin-top: 4px; }

.result-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  background: rgba(0,240,255,0.1);
  color: var(--cyan);
  border-radius: 4px;
}

.vip-badge {
  background: rgba(255,215,0,0.15) !important;
  color: #ffd700 !important;
  font-weight: 600;
  border: 1px solid rgba(255,215,0,0.3);
}

/* Playlist Categories */
.playlist-categories {
  margin-bottom: 24px;
  text-align: center;
}

.categories-label {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.categories-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.category-tab {
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.category-tab:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,240,255,0.1);
}

/* Vocal Analysis Section */
.vocal-analysis-section {
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.vocal-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.va-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.va-item.va-highlight {
  border-color: rgba(255,215,0,0.3);
  background: rgba(255,215,0,0.05);
}

.va-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.va-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 60px;
}

.va-value {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 600;
  margin-left: auto;
  text-align: right;
}

.category-tab.active {
  background: rgba(0,240,255,0.15);
  border-color: var(--cyan);
  color: var(--cyan);
}

.result-karaoke {
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.result-card:hover .result-karaoke { opacity: 1; }

/* ========== Karaoke ========== */
.karaoke-container {
  display: flex;
  gap: 24px;
  padding: 20px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.karaoke-left { flex: 1; min-width: 0; }
.karaoke-right { width: 380px; flex-shrink: 0; }

.song-info {
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.song-info-placeholder {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 8px;
}

/* Song Info Row (with cover) */
.song-info-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.song-cover {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(0,240,255,0.2), rgba(255,0,255,0.2));
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-cover-placeholder {
  font-size: 1.8rem;
  opacity: 0.5;
}

.song-details { flex: 1; min-width: 0; }

.song-name {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.song-source {
  font-size: 0.7rem;
  color: var(--cyan);
  margin-top: 4px;
  opacity: 0.7;
}

/* ========== Karaoke Mode Selector ========== */
.mode-selector {
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.mode-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 12px;
}

.mode-options {
  display: flex;
  gap: 10px;
}

.mode-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mode-option:hover {
  border-color: rgba(0,240,255,0.3);
  box-shadow: 0 0 15px rgba(0,240,255,0.05);
}

.mode-option.active {
  border-color: var(--cyan);
  background: rgba(0,240,255,0.08);
  box-shadow: 0 0 20px rgba(0,240,255,0.12);
}

.mode-option input[type="radio"] {
  display: none;
}

.mode-icon {
  font-size: 1.5rem;
}

.mode-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.mode-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.mode-song-name {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.accompany-status {
  font-size: 0.75rem;
  margin-top: 8px;
  width: 100%;
  text-align: center;
  min-height: 1.2em;
}

/* Score value label */
.score-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-left: 8px;
  min-width: 28px;
  text-align: right;
}

/* Section label for recommendations */
.section-label {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

/* Visualizer */
.visualizer-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
  margin-bottom: 12px;
}

.spectrum-canvas {
  width: 100%;
  height: 200px;
  display: block;
}

.pitch-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-deep);
  margin-bottom: 16px;
}

.pitch-canvas {
  width: 100%;
  height: 140px;
  display: block;
}

/* Controls */
.karaoke-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ctrl-btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-main);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.ctrl-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ctrl-btn.record {
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  color: #fff;
}

.ctrl-btn.stop { background: var(--red); color: #fff; }
.ctrl-btn.playback { background: var(--green); color: #000; }
.ctrl-btn.download { background: var(--bg-card); color: var(--cyan); border: 1px solid var(--cyan); }
.ctrl-btn.preview { background: var(--bg-card); color: var(--yellow); border: 1px solid var(--yellow); }
.ctrl-btn.preview.active { background: var(--yellow); color: #000; box-shadow: 0 0 20px rgba(255,179,71,0.4); }

.k-status {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-left: auto;
}

/* Lyrics */
.lyrics-container {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lyrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
}

.lyrics-tools { display: flex; gap: 8px; }

.lyrics-tool {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.75rem;
  padding: 4px 8px;
  font-family: var(--font-main);
  cursor: pointer;
}

.lyrics-content {
  padding: 20px 16px;
  max-height: 500px;
  overflow-y: auto;
  font-size: 18px;
  line-height: 2.2;
  text-align: center;
}

.lyric-line {
  padding: 4px 0;
  color: var(--text-dim);
  transition: all 0.3s;
}

.lyric-line.active {
  color: var(--cyan);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0,240,255,0.6);
  font-size: 1.1em;
}

/* Score Panel */
.score-panel {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.score-header {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.score-main { text-align: center; margin-bottom: 16px; }

.score-big {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 900;
}

.score-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.score-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.score-bar-item label {
  width: 36px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: right;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.score-bar-fill.cyan { background: linear-gradient(90deg, var(--cyan), var(--purple)); }
.score-bar-fill.magenta { background: linear-gradient(90deg, var(--magenta), var(--yellow)); }

.radar-canvas {
  display: block;
  margin: 16px auto 0;
}

.pitch-chart-container {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.pitch-chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 10px;
  text-align: center;
}

.pitch-chart-canvas {
  display: block;
  width: 100%;
  height: 160px;
  border-radius: 8px;
  background: rgba(0,0,0,0.3);
}

.pitch-chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.score-suggestions { margin-top: 16px; }

.suggestion {
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.suggestion strong { color: var(--cyan); display: block; margin-bottom: 4px; }
.suggestion .detail { color: var(--text-dim); font-size: 0.8rem; }

/* ========== History ========== */
.history-container { max-width: 700px; margin: 0 auto; padding: 20px; }

.section-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  margin-bottom: 24px;
  text-align: center;
}

.k-history-list { display: flex; flex-direction: column; gap: 8px; }

.k-history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.k-history-item:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.08);
}

.kh-title { font-weight: 500; color: #fff; }
.kh-meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
.kh-score {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  margin-left: auto;
}

.kh-del {
  opacity: 0;
  color: var(--red);
  font-size: 0.9rem;
  padding: 4px 8px;
  transition: opacity 0.2s;
}

.k-history-item:hover .kh-del { opacity: 0.6; }
.kh-del:hover { opacity: 1 !important; }

.history-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}

/* ========== About ========== */
.about-container { max-width: 600px; margin: 0 auto; padding: 20px; }

.about-content {
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 2;
}

.about-content p { margin-bottom: 4px; }

/* ========== Win10 Login ========== */
.win-login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.win-login-overlay.show { display: flex; }

.win-login-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  opacity: 0.95;
}

.win-login-box {
  position: relative;
  z-index: 1;
  margin: auto;
  text-align: center;
  width: 320px;
}

.win-login-avatar {
  font-size: 4rem;
  margin-bottom: 12px;
}

.win-login-name {
  font-size: 1.3rem;
  color: #fff;
  font-weight: 500;
  margin-bottom: 24px;
}

.win-login-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-main);
  outline: none;
  text-align: center;
}

.win-login-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.2);
}

.win-login-input::placeholder { color: rgba(255,255,255,0.3); }

.win-login-hint {
  margin-top: 12px;
  font-size: 0.85rem;
  min-height: 20px;
}

.win-login-attempts {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.win-login-btn {
  margin-top: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.win-login-btn:hover { border-color: var(--cyan); background: rgba(0,240,255,0.1); }

.win-login-footer {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
}

/* ========== Admin Panel ========== */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
}

.admin-overlay.show { display: flex; align-items: center; justify-content: center; }

.admin-panel {
  width: 520px;
  max-height: 80vh;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(0,240,255,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-title { font-weight: 600; font-size: 1rem; }
.admin-close { cursor: pointer; font-size: 1.2rem; opacity: 0.5; }
.admin-close:hover { opacity: 1; }

.admin-body {
  padding: 20px;
  overflow-y: auto;
}

.admin-section {
  margin-bottom: 16px;
}

.admin-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.admin-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.active { background: var(--green); box-shadow: 0 0 8px var(--green); }

.admin-log-item {
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--cyan);
}

.admin-log-full {
  padding: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: monospace;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.8;
}

.log-time { color: var(--text-dim); }

.admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.admin-action-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-action-btn:hover { border-color: var(--cyan); }

.admin-action-btn.danger { color: var(--red); }
.admin-action-btn.danger:hover { border-color: var(--red); background: rgba(255,71,87,0.1); }

/* ========== Chorus ========== */
.chorus-container { max-width: 700px; margin: 0 auto; padding: 20px; }

.chorus-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  text-align: center;
}

.chorus-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.room-pwd-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.room-info {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.room-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.room-title {
  font-weight: 600;
  color: var(--cyan);
  font-size: 1rem;
}

.room-members {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.room-members-list {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.room-member {
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.room-member.me {
  border-color: var(--cyan);
  color: var(--cyan);
}

.room-chat-container {
  background: var(--bg-deep);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.room-chat {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.room-chat-msg {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.room-chat-msg .msg-user {
  color: var(--cyan);
  font-weight: 600;
  margin-right: 8px;
}

.room-chat-msg .msg-time {
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-left: 8px;
}

.room-chat-input {
  display: flex;
  gap: 8px;
}

.room-sub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 12px;
}

.room-recordings-list {
  max-height: 200px;
  overflow-y: auto;
}

.room-recording-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.room-recording-item .rec-user {
  color: var(--cyan);
  font-weight: 600;
}

.room-recording-item .rec-time {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.room-recording-item .rec-play {
  padding: 4px 12px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.public-rooms { margin-top: 24px; }

.public-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.public-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.public-room-item .room-name {
  font-weight: 600;
  color: #fff;
}

.public-room-item .room-count {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .karaoke-container { flex-direction: column; }
  .karaoke-right { width: 100%; }
  .nav-links { display: none; }
  .results-grid { grid-template-columns: 1fr; }
  .mode-options { flex-direction: column; }
  .lyrics-content { max-height: 350px; font-size: 16px; }
  .effects-presets { gap: 6px; }
  .effect-preset { font-size: 0.75rem; padding: 6px 10px; }
  body { padding-bottom: 70px; }
}

/* Mobile bottom tab bar */
.mobile-tabs {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(15,15,42,0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,240,255,0.15);
  padding: 6px 8px;
  justify-content: space-around;
}

@media (max-width: 900px) {
  .mobile-tabs { display: flex; }
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.3rem;
  border-radius: 8px;
  transition: all 0.2s;
  min-width: 50px;
}

.mobile-tab span {
  font-size: 0.6rem;
  line-height: 1;
}

.mobile-tab.active {
  color: var(--cyan);
}

.mobile-tab:active {
  background: rgba(0,240,255,0.1);
}

/* Spectrogram mode popup */
.spec-mode-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spec-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 360px;
  padding: 16px;
  background: var(--bg-panel);
  border-radius: 16px;
  border: 1px solid rgba(0,240,255,0.2);
}

@media (max-width: 400px) {
  .spec-mode-grid { grid-template-columns: 1fr; max-width: 280px; }
}

.spec-mode-item {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.spec-mode-item strong { display: block; color: var(--text); font-size: 0.85rem; margin-bottom: 4px; }
.spec-mode-item small { color: var(--text-dim); font-size: 0.7rem; }
.spec-mode-item:hover { background: rgba(0,240,255,0.08); border-color: rgba(0,240,255,0.3); }
.spec-mode-item.active { background: rgba(0,240,255,0.12); border-color: var(--cyan); }
.spec-mode-item.active strong { color: var(--cyan); }

/* Effect slider */
.effect-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}
.effect-slider-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 30px;
}
.effect-intensity {
  flex: 1;
  height: 4px;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}
.effect-intensity::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
}
.effect-intensity-val {
  font-size: 0.75rem;
  color: var(--cyan);
  min-width: 32px;
  text-align: right;
}

/* Mobile back button */
@media (max-width: 900px) {
  .mobile-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: 8px;
  }
}

/* ========== Visualizer Toggle (声谱图/MV) ========== */
.viz-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  justify-content: center;
}

.viz-tab {
  padding: 5px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.viz-tab.active {
  background: linear-gradient(135deg, var(--cyan), rgba(0,240,255,0.2));
  color: #000;
  border-color: var(--cyan);
  font-weight: 600;
}

.viz-tab:hover:not(.active) {
  color: var(--text);
  border-color: var(--cyan);
}

.mv-video {
  width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  object-fit: contain;
  background: #000;
}

.mv-upload-prompt {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-dim);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.mv-upload-prompt p { margin: 8px 0; }

.mv-upload-btn {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  color: #000;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}

.mv-hint { font-size: 0.7rem; opacity: 0.5; }

/* Load more button */
.load-more-btn {
  display: inline-block;
  padding: 8px 24px;
  background: rgba(0,240,255,0.1);
  border: 1px solid rgba(0,240,255,0.3);
  color: var(--cyan);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;


/* Lyrics lock indicator */
.lyrics-lock-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
  padding: 6px 14px;
  background: rgba(0,240,255,0.9);
  color: #000;
  border: none;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Audio Progress Bar ========== */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  margin-bottom: 12px;
}

.time-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 36px;
  text-align: center;
  user-select: none;
}

.progress-track {
  flex: 1;
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  cursor: pointer;
  overflow: visible;
}

.progress-track:hover { height: 8px; }

.progress-buffered {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  transition: width 0.2s;
}

.progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  border-radius: 3px;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(0,240,255,0.4);
}

.progress-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0,240,255,0.6);
  opacity: 0.6; /* Always visible on PC for usability */
  transition: opacity 0.2s, transform 0.1s ease;
  pointer-events: none;
  z-index: 2;
}

.progress-track:hover .progress-handle,
.progress-track.dragging .progress-handle {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.3);
}

/* Hover time tooltip */
.hover-time-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: rgba(0,240,255,0.9);
  color: #000;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
  font-weight: bold;
}
.hover-time-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: rgba(0,240,255,0.9) transparent transparent transparent;
}

/* ========== Audio Effects Panel ========== */
.effects-panel {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(0,240,255,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.effects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.effects-label {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.monitor-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.monitor-toggle input {
  accent-color: var(--cyan);
  width: 14px;
  height: 14px;
}

.effects-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.effect-preset {
  padding: 7px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.effect-preset:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.effect-preset.active {
  background: rgba(0,240,255,0.08);
  border-color: rgba(0,240,255,0.2);
  color: var(--cyan);
}
