/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 渐变背景和现代样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background-attachment: fixed;
  font-size: 16px;
}

.container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 40px;
  max-width: 650px;
  width: 100%;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.container:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

h1 {
  text-align: center;
  color: #4a5568;
  margin-bottom: 32px;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}

h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

/* 标题下的注释信息 */
.note {
  max-width: 580px;
  margin: 0 auto 24px;
  padding: 14px 18px;
  background-color: rgba(102, 126, 234, 0.08);
  border-left: 4px solid #667eea;
  border-radius: 12px;
  color: #4a5568;
  line-height: 1.7;
}

.note p {
  font-size: 14px;
}

.input-container {
  margin-bottom: 32px;
}

#link-input {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
  background-color: rgba(255, 255, 255, 0.7);
}

::placeholder {
  color: #a0aec0;
}

#link-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  background-color: white;
  transform: translateY(-2px);
}

#parse-button {
  width: 100%;
  padding: 16px;
  margin-top: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#parse-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

#parse-button:active {
  transform: translateY(0);
}

#parse-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#parse-button:active::after {
  width: 300px;
  height: 300px;
}

#parse-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.result-container {
  min-height: 100px;
  position: relative;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.error-message, .success-message {
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
  border-left: 4px solid transparent;
  animation: fadeIn 0.5s ease;
}

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

.error-message {
  background-color: rgba(245, 34, 45, 0.05);
  border-color: #ff4d4f;
  color: #f5222d;
  box-shadow: 0 2px 8px rgba(245, 34, 45, 0.1);
}

.success-message {
  background-color: rgba(82, 196, 26, 0.05);
  border-color: #52c41a;
  color: #389e0d;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.1);
}

#web-link {
  display: block;
  margin: 12px 0;
  padding: 12px;
  background-color: #f0f0f0;
  border-radius: 6px;
  color: #1890ff;
  text-decoration: none;
  word-break: break-all;
  transition: background-color 0.3s;
  border: 1px solid rgba(24, 144, 255, 0.25);
}

#web-link:hover {
  background-color: #e6f7ff;
  text-decoration: underline;
}

.copy-button {
  padding: 8px 16px;
  background-color: #52c41a;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.25);
}

.copy-button:hover {
  background-color: #73d13d;
}

.copy-button:active {
  background-color: #389e0d;
}

.copy-button:focus-visible,
#parse-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.hidden {
  display: none;
}

audio {
  width: 100%;
  margin-top: 20px;
  border-radius: 12px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

audio:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 加载状态样式 */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 音频列表项样式 */
.audio-item {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.audio-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.audio-title {
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .container {
    padding: 20px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  #link-input, #parse-button {
    font-size: 14px;
  }
}
