/* VS-AI Music Player Styles - Modernized Version */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --accent-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --background-primary: #0f0f23;
  --background-secondary: #1a1a2e;
  --background-tertiary: #16213e;
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Global Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* remove default list markers globally */
ul,
ol {
  list-style: none;
}


html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--background-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main Container */
#main {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

/* Loading Animation */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--background-primary), var(--background-secondary));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeOut 1s ease-in-out 2s forwards;
}

.loading-spinner {
  position: relative;
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
  animation-delay: 0.2s;
  border-top-color: var(--secondary-color);
}

.spinner-ring:nth-child(3) {
  animation-delay: 0.4s;
  border-top-color: var(--accent-color);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Music List Section */
#musicList {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--background-primary), var(--background-secondary));
  position: relative;
  overflow: hidden;
}

.list_title {
  width: 100%;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 10;
}

.list_title::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

.list_title h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.list_title {
  width: 100%;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 10;
}

.title_text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 1;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.title_text.active {
  opacity: 1;
}

.list_tip {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.list_tip:hover {
  background: var(--primary-color);
  color: var(--text-primary);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}


.list_content {
  position: absolute;
  top: 70px;
  bottom: 80px;
  left: 0;
  right: 0;
  /* allow vertical scrolling so list can be scrolled on both mobile and desktop
     (overflow:hidden was preventing interaction when content exceeded the
     container). */
  overflow-y: auto;
  /* hide horizontal overflow just in case */
  overflow-x: hidden;
  /* smooth touch scrolling on iOS/modern browsers */
  -webkit-overflow-scrolling: touch;
  /* allow vertical pan gestures; prevents parent from intercepting touches */
  touch-action: pan-y;
  /* keep the scroll within the container on overscroll (optional) */
  overscroll-behavior: contain;
  padding: 10px;
}

.list_content ul {
  width: 100%;
  position: relative;
  transform: translate3d(0, 0, 0);
  transition: transform 0.3s ease;
}

.list_content li {
  width: 100%;
  height: 70px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.list_content li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.list_content li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.list_content li.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.list_content li.active::before {
  width: 4px;
}

.list_content li .title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.list_content li .name {
  font-size: 14px;
  color: var(--text-muted);
}

/* Message hint */
.message_hint {
  text-align: center;
  padding: 20px;
  margin: 20px 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-size: 14px;
}

.message_hint p {
  margin: 0;
  opacity: 0.8;
}

/* Audio Player Bar */
.list_audio {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 10;
}

.list_audioImg {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.list_audioImg:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.list_audioText {
  flex: 1;
  margin-left: 15px;
  overflow: hidden;
}

.list_audioText .title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.list_audioText .name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list_audioBtn {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
  margin-left: 15px;
}

.list_audioBtn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
  background: var(--secondary-color);
}

.list_audioBtn::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 8px solid white;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

/* Music Details Section */
#musicDetails {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--background-secondary), var(--background-tertiary));
  transform: translate3d(0, 100vh, 0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
}

.details_title {
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.details_name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
}

.details_name span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

.details_tip {
  width: 36px;
  height: 36px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.details_tip:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

.details_tip::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-left: none;
  border-bottom: none;
  transform: rotate(45deg);
  margin-left: -2px;
}

/* Lyrics Section */
.details_lyric {
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 200px;
  overflow: hidden;
  padding: 20px;
  transition: transform 0.5s ease;
}

.details_lyric ul {
  width: 100%;
  position: relative;
  transform: translate3d(0, 0, 0);
  transition: transform 0.3s ease;
  text-align: center;
}

.details_lyric li {
  height: 50px;
  line-height: 50px;
  font-size: 14px;
  color: var(--text-muted);
  transition: var(--transition);
  opacity: 0.7;
}

.details_lyric li.active {
  color: var(--accent-color);
  font-size: 16px;
  font-weight: 600;
  opacity: 1;
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Audio Controls */
.details_audio {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  padding: 20px;
  transition: transform 0.5s ease;
}

.details_audioAll {
  max-width: 400px;
  margin: 0 auto;
}

.details_audioPro {
  width: 100%;
  height: 6px;
  background: var(--glass-bg);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  margin-bottom: 30px;
  overflow: hidden;
}

.details_audioProUp {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 3px;
  transition: width 0.1s linear;
  position: relative;
}

.details_audioProUp::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.details_audioProBar {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.details_audioProBar:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: var(--shadow-hover);
}

.details_nowTime,
.details_allTime {
  font-size: 12px;
  color: var(--text-muted);
  position: absolute;
  top: -25px;
}

.details_nowTime { left: 0; }
.details_allTime { right: 0; }

.controls_wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.details_prev,
.details_next,
.details_play {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.details_prev:hover,
.details_next:hover,
.details_play:hover {
  transform: scale(1.1);
  background: var(--primary-color);
  box-shadow: var(--shadow-hover);
}

.details_play {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.details_play::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 12px solid white;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 2px;
  transition: var(--transition);
}

.details_play.pause::before {
  border: none;
  width: 16px;
  height: 16px;
  background: white;
  margin-left: 0;
}

.details_prev::before {
  content: '';
  width: 8px;
  height: 12px;
  background: white;
  clip-path: polygon(100% 0%, 0% 50%, 100% 100%);
  margin-right: 2px;
}

.details_prev::after {
  content: '';
  width: 4px;
  height: 12px;
  background: white;
  margin-right: 8px;
}

.details_next::before {
  content: '';
  width: 4px;
  height: 12px;
  background: white;
  margin-left: 8px;
}

.details_next::after {
  content: '';
  width: 8px;
  height: 12px;
  background: white;
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
  margin-left: 2px;
}

/* Message Section */
.details_message {
  position: absolute;
  top: 70px;
  left: 0; /* 从左侧开始，使用 transform 控制显示 */
  /* width: calc(100vw - 40px); */
  width: 94%;
  height: calc(100vh - 150px);
  background: var(--glass-bg);
  border-radius: var(--border-radius-lg);
  margin: 20px;
  padding: 25px;
  transition: transform 0.5s ease;
  transform: translate3d(100vw, 0, 0); /* 默认隐藏到右侧 */
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  overflow-y: auto;
}

.details_message h3 {
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 25px;
  font-size: 18px;
  font-weight: 600;
}

.details_message form {
  margin-bottom: 30px;
}

.details_message label {
  display: block;
  margin: 15px 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.details_message input,
.details_message textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--background-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
  font-family: inherit;
}

.details_message input:focus,
.details_message textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: var(--background-secondary);
}

.details_message input::placeholder,
.details_message textarea::placeholder {
  color: var(--text-muted);
}

.details_message input {
  height: 48px;
}

.details_message textarea {
  height: 100px;
  resize: vertical;
  min-height: 80px;
}

#detailsMessageBtn {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  border-radius: var(--border-radius);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 20px;
  box-shadow: var(--shadow);
}

#detailsMessageBtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

#detailsMessageBtn:active {
  transform: translateY(0);
}

.details_message ul {
  margin-top: 30px;
}

.details_message li {
  background: var(--background-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 12px;
  transition: var(--transition);
  border-left: 3px solid var(--primary-color);
}

.details_message li:hover {
  transform: translateX(5px);
  background: var(--background-secondary);
}

/* Message hint styling */
.message-hint {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--border-radius) !important;
  margin: 10px 0 !important;
  list-style: none !important;
}

.message-hint div {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Bottom Navigation */
.details_btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 30;
}

.details_btn li {
  padding: 10px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.details_btn li.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.details_btn li:hover:not(.active) {
  background: var(--background-secondary);
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .list_title h1 {
    font-size: 16px;
  }

  .list_content li {
    height: 60px;
    padding: 0 15px;
  }

  .list_audio {
    height: 70px;
    padding: 0 15px;
  }

  .details_audioAll {
    max-width: 100%;
  }

  .controls_wrapper {
    gap: 20px;
  }

  .details_prev,
  .details_next,
  .details_play {
    width: 50px;
    height: 50px;
  }

  .details_play {
    width: 60px;
    height: 60px;
  }

  .details_message {
    width: calc(100vw - 20px);
    margin: 10px;
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .list_title {
    height: 60px;
  }

  .list_content {
    top: 60px;
    bottom: 70px;
  }

  .details_title {
    height: 60px;
  }

  .details_lyric {
    top: 60px;
    bottom: 180px;
  }

  .details_audio {
    height: 180px;
  }

  .controls_wrapper {
    gap: 15px;
  }

  .details_prev,
  .details_next {
    width: 45px;
    height: 45px;
  }

  .details_play {
    width: 55px;
    height: 55px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
.list_content li:focus,
.list_audioBtn:focus,
.details_prev:focus,
.details_next:focus,
.details_play:focus,
.details_tip:focus,
.details_btn li:focus,
#detailsMessageBtn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.3);
  }
}

/* Notification System */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  color: white;
  font-weight: 500;
  z-index: 10000;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  animation: slideInRight 0.3s ease-out;
}

.notification.success {
  background: var(--success-color);
}

.notification.error {
  background: var(--error-color);
}

.notification.warning {
  background: var(--warning-color);
}

.notification.info {
  background: var(--primary-color);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading button state */
#detailsMessageBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Loading item in music list */
.loading-item {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 20px;
  background: var(--glass-bg);
  border-radius: var(--border-radius);
  margin: 8px 0;
  border: 1px solid var(--glass-border);
}