:root {
  color-scheme: dark;
  --bg-grad-start: #0f1219;
  --bg-grad-end: #0a0c10;
  --surface: #151922;
  --surface-elevated: #1c2130;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-focus: rgba(99, 179, 255, 0.45);
  --text-primary: #ffffff;
  --text-secondary: #a1a8b8;
  --text-tertiary: #6b7280;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent: #10b981;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-grad-start) 0%, var(--bg-grad-end) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select { font: inherit; }

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-copy { flex: 1; }

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.brand-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-text {
  margin: 12px 0 0;
  max-width: 680px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 15px;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  min-width: 220px;
}

.hero-status strong { font-size: 13px; font-weight: 600; }
.hero-status p { margin: 0; font-size: 12px; color: var(--text-secondary); }

.status-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr);
  gap: 28px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.platform-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.search-wrap { position: relative; margin-bottom: 20px; }

.search-field {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.search-input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

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

.search-input:focus {
  border-color: var(--border-focus);
  background: #1f2533;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-primary {
  padding: 14px 28px;
  border-radius: var(--radius-md);
  background: var(--primary);
  border: none;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary.loading { opacity: 0.7; cursor: not-allowed; }

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

.quality-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.quality-picker select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.result-count { font-size: 13px; color: var(--text-secondary); }

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 380px;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.track-row:hover {
  background: #232938;
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
}

.track-row.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

.track-cover {
  width: 64px; height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #0f1219;
  flex-shrink: 0;
}

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

.track-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.track-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.platform-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.track-artist {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-album {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

.track-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 90px;
}

.track-duration { font-size: 12px; color: var(--text-tertiary); }

.btn-play {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-play:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Player Panel */
.player-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.player-cover-wrap {
  position: relative;
  width: 140px;
  flex-shrink: 0;
}

.player-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #0f1219;
  box-shadow: var(--shadow-lg);
}

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

.player-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.player-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-artist {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 4px;
}

.player-album {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.player-controls { margin-top: 20px; }

.btn-control-main {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--primary);
  border: none;
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.btn-control-main:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.progress-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.time-label { font-size: 12px; color: var(--text-tertiary); min-width: 42px; }

.seek-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}

.seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5);
  transition: transform 0.15s ease;
}

.seek-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.volume-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-label { font-size: 13px; color: var(--text-secondary); }

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-secondary);
  cursor: pointer;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.info-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.lyrics-section {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
}

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

.lyrics-title { font-size: 15px; font-weight: 700; margin: 0; }
.lyrics-status { font-size: 12px; color: var(--text-secondary); }

.lyrics-content {
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.suggestions-dropdown {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 8px);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
}

.suggestion-option {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
}

.suggestion-option:hover { background: rgba(255, 255, 255, 0.05); }
.suggestion-option small { display: block; color: var(--text-tertiary); font-size: 12px; margin-top: 3px; }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-status { width: 100%; }
}

@media (max-width: 768px) {
  .app-shell { padding: 20px 16px; }
  .panel { padding: 18px; }
  .player-card { flex-direction: column; }
  .player-cover-wrap { width: 100%; max-width: 220px; margin: 0 auto; }
  .track-row { padding: 12px; }
  .track-cover { width: 52px; height: 52px; }
  .info-grid { grid-template-columns: 1fr; }
}
