:root {
  /* 亮色模式 */
  --bg-primary: #f9fafb;
  --bg-secondary: #ffffff;
  --bg-accent: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --accent-primary: #4f46e5;
  --accent-secondary: #7c3aed;
  --accent-tertiary: #c084fc;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c084fc 100%);
  --card-bg: rgba(255, 255, 255, 0.8);
  --backdrop-filter: blur(10px);
}

[data-theme="dark"] {
  /* 深色模式 */
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-accent: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-tertiary: #9ca3af;
  --accent-primary: #818cf8;
  --accent-secondary: #a78bfa;
  --accent-tertiary: #c084fc;
  --border: #374151;
  --shadow: rgba(0, 0, 0, 0.3);
  --card-bg: rgba(31, 41, 55, 0.8);
  --backdrop-filter: blur(10px) brightness(80%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
  background-color: var(--bg-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.header h1 {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.025em;
}

.header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* 主要内容区域 */
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* 确保两个卡片高度一致 */
.drop-area,
.file-list-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: 0 10px 25px var(--shadow);
  backdrop-filter: var(--backdrop-filter);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* 使文件列表容器占满可用空间 */
.file-list-container {
  display: flex;
  flex-direction: column;
}

.file-list-body {
  flex-grow: 1;
  max-height: none;
  min-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tertiary) transparent;
}

/* 调整拖放区域，使其内容更好地居中 */
.drop-area {
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  transition: all 0.3s;
}

@media (max-width: 992px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .drop-area,
  .file-list-container {
    min-height: 200px;
  }
}

.settings-card {
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: 0 10px 25px var(--shadow);
  backdrop-filter: var(--backdrop-filter);
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.setting-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setting-title i {
  color: var(--accent-primary);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setting-value {
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--bg-accent);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  text-align: center;
}

/* 拖放区域细节样式 */
.drop-area:hover,
.drop-area-highlight {
  transform: translateY(-5px);
  box-shadow: 0 20px 30px var(--shadow);
  border-color: var(--accent-primary);
}

.drop-area::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient);
  opacity: 0.05;
  z-index: -1;
  border-radius: 0.8rem;
}

.drop-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: var(--accent-primary);
  background: var(--bg-accent);
  width: 8rem;
  height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
}

.drop-area h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
}

.drop-area p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
}

.browse-btn {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.9rem 2.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.browse-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

.file-input {
  display: none;
}

/* 文件列表样式 */
.file-list-header {
  background: var(--bg-accent);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.file-list-header,
.file-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr 5rem 8rem 5rem;
  padding: 1rem 1.5rem;
  align-items: center;
}

.file-list-body::-webkit-scrollbar {
  width: 6px;
}

.file-list-body::-webkit-scrollbar-track {
  background: transparent;
}

.file-list-body::-webkit-scrollbar-thumb {
  background-color: var(--text-tertiary);
  border-radius: 6px;
}

.file-item {
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}

.file-item:hover {
  background: var(--bg-accent);
}

.file-item:last-child {
  border-bottom: none;
}

.file-num {
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem;
  font-weight: 500;
}

.file-duration,
.file-size {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.file-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.file-actions button {
  background: none;
  border: none;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.play-btn {
  color: var(--accent-primary);
  background: rgba(79, 70, 229, 0.1);
}

.play-btn:hover {
  background: rgba(79, 70, 229, 0.2);
  transform: scale(1.1);
}

.remove-btn {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.remove-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

/* 无文件状态的显示，使其垂直居中 */
.no-files-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  color: var(--text-tertiary);
  font-style: italic;
}

/* 操作按钮 */
.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.action-btn {
  padding: 0.9rem 2.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  font-size: 1rem;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.convert-btn {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.convert-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

.clear-btn {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.clear-btn:hover:not(:disabled) {
  background: var(--bg-accent);
  transform: translateY(-2px);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* 等待遮罩 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loader {
  width: 70px;
  height: 70px;
  position: relative;
  margin-bottom: 2rem;
}

.loader:before,
.loader:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--gradient);
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite alternate;
}

.loader:after {
  animation-delay: -1s;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.2);
    opacity: 0.1;
  }
}

.overlay-text {
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.overlay-subtext {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.5rem;
}

/* 页脚 */
footer {
  text-align: center;
  margin-top: 4rem;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  padding-bottom: 1rem;
}

footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

/* 背景装饰 */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
}

.circle-1 {
  top: 10%;
  left: 5%;
  width: 400px;
  height: 400px;
  background: var(--accent-primary);
  opacity: 0.15;
  animation: float 15s ease-in-out infinite;
}

.circle-2 {
  bottom: 15%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: var(--accent-tertiary);
  opacity: 0.1;
  animation: float 12s ease-in-out infinite reverse;
}

.circle-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: var(--accent-secondary);
  opacity: 0.08;
  animation: pulse 20s ease-in-out infinite;
}

/* 主题切换 */
.theme-switch {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 10px 15px var(--shadow);
  z-index: 100;
  transition: all 0.3s;
}

.theme-switch:hover {
  transform: scale(1.1) rotate(15deg);
}

/* 动画效果 */
@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(5deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

/* 额外美化效果 */
.playing-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: var(--success);
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
}

.playing-indicator::before,
.playing-indicator::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.7;
  animation: ripple 1.5s infinite;
}

.playing-indicator::after {
  animation-delay: 0.5s;
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

[data-theme="dark"] .shimmer::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

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

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .file-list-header,
  .file-item {
    grid-template-columns: 2rem 1fr 3rem;
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .file-duration,
  .file-size {
    display: none;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
  }

  .drop-area {
    padding: 1.5rem 1rem;
  }

  .theme-switch {
    bottom: 1rem;
    right: 1rem;
  }
}
