* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-start: #0f0c29;
  --bg-mid: #302b63;
  --bg-end: #24243e;
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --accent: #7c6cf0;
  --accent-hover: #6a5ae0;
  --accent-light: #a78bfa;
  --accent-glow: rgba(124, 108, 240, 0.35);
  --success: #4ade80;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
}

html { color-scheme: dark; }

body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

.container { width: 100%; max-width: 480px; }

.header { text-align: center; margin-bottom: 32px; }

.header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p { color: var(--text-secondary); font-size: 14px; margin-top: 8px; }

.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view { width: 100%; }
.hidden { display: none !important; }

.btn-primary {
  padding: 14px 36px;
  background: linear-gradient(135deg, #7c6cf0, #a78bfa);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s;
  box-shadow: 0 6px 20px rgba(124, 108, 240, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(124, 108, 240, 0.6);
}

.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }

.btn-load-songs { padding: 10px 24px; font-size: 14px; }

.user-pic {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-light);
  box-shadow: 0 0 30px var(--accent-glow);
  margin-bottom: 16px;
  animation: popIn 0.4s ease;
  background: linear-gradient(135deg, #7c6cf0, #f0abfc);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.user-nick { font-size: 18px; font-weight: 600; margin-bottom: 6px; }

.user-id {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'Menlo', 'Consolas', monospace;
  margin-bottom: 20px;
}

.user-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.song-list-section {
  margin-top: 20px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.song-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.song-list-header h3 {
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.song-count { font-size: 12px; color: var(--text-secondary); }

.song-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  padding-right: 4px;
}

.song-list::-webkit-scrollbar { width: 6px; }
.song-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.song-list-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 30px 0;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  cursor: pointer;
  animation: itemIn 0.25s ease;
}

@keyframes itemIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.song-item:hover {
  background: rgba(124, 108, 240, 0.12);
  border-color: rgba(167, 139, 250, 0.25);
  transform: translateX(3px);
}

.song-item-cover {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, #7c6cf0, #f0abfc);
}

.song-item-info { flex: 1; min-width: 0; }

.song-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.song-item-singer {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-item-duration {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'Menlo', 'Consolas', monospace;
  flex-shrink: 0;
}

.song-item-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(124, 108, 240, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  transition: background 0.2s, color 0.2s;
}

.song-item:hover .song-item-play {
  background: var(--accent);
  color: #fff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-page {
  padding: 8px 18px;
  background: rgba(124, 108, 240, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 8px;
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-page:hover:not(:disabled) {
  background: rgba(124, 108, 240, 0.3);
  border-color: rgba(167, 139, 250, 0.55);
  color: #fff;
}

.btn-page:active:not(:disabled) { transform: scale(0.96); }

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.page-info {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'Menlo', 'Consolas', monospace;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.5px;
}

.page-info strong {
  color: var(--accent-light);
  font-weight: 700;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal.show { display: flex; }

.modal-content {
  background: linear-gradient(135deg, #1a1a2e, #25254a);
  padding: 32px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.3s ease;
  min-width: 300px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h3 {
  font-size: 18px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-content p { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }

.modal-content img {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: block;
  margin: 0 auto;
}

.qr-status {
  margin-top: 16px;
  font-size: 13px;
  color: var(--accent-light);
  min-height: 20px;
  font-weight: 600;
}

.qr-status.success { color: var(--success); }
.qr-status.error { color: var(--danger); }

.modal-content .btn-secondary { margin-top: 16px; }

@media (max-width: 480px) {
  body { padding: 20px 14px; }
  .header h1 { font-size: 22px; }
  .card { padding: 30px 16px; }
  .user-actions { flex-direction: column; }
  .btn-load-songs, .user-actions .btn-secondary { width: 100%; }
  .song-list { max-height: 380px; }
  .btn-page { padding: 8px 12px; font-size: 12px; }
  .page-info { min-width: 50px; font-size: 12px; }
}