* {
  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, #f5f7fa 0%, #eef1f7 100%);
  min-height: 100vh;
}

/* ====== Header - 紫色主题 ====== */
header {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  padding: 14px 0;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: #667eea;
}

nav a {
  text-decoration: none;
  color: #666;
  margin-left: 30px;
  font-size: 14px;
  transition: color 0.3s;
}

nav a:hover,
nav a.active {
  color: #667eea; /* 紫色高亮 */
}

/* ====== Main ====== */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 60px 20px;
}

.search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.search-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 50px 60px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.08); /* 紫色调阴影 */
  text-align: center;
  max-width: 920px;
  width: 100%;
}

.search-card h1 {
  font-size: 32px;
  color: #333; /* 标题保持深色 */
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 30px;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
}

.search-box input {
  flex: 1;
  padding: 15px 20px;
  border: 1.5px solid #e0e4ec; /* 淡紫灰边框 */
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: #fafbfc;
}

.search-box input:focus {
  border-color: #667eea; /* 紫色聚焦 */
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 紫蓝渐变按钮 */
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35); /* 紫色按钮阴影 */
  white-space: nowrap;
}

.search-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(102, 126, 234, 0.45);
}

.search-box button:disabled {
  background: #c5cae9;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.search-progress {
  width: 100%;
  margin-top: 10px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #e8eaf0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2); /* 紫蓝进度条 */
  border-radius: 3px;
  animation: progress 2s ease-in-out infinite;
  width: 0%;
}

@keyframes progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

.progress-text {
  display: block;
  text-align: center;
  color: #667eea; /* 紫色进度文字 */
  font-size: 14px;
  margin-top: 10px;
}

.history-search {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.history-search span {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.history-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.history-tag {
  padding: 5px 14px;
  background: #f0efff; /* 淡紫背景 */
  border-radius: 20px;
  font-size: 14px;
  color: #5b6ce0; /* 紫色文字 */
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  border: 1px solid transparent;
  font-weight: 500;
}

.history-tag:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.privacy-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  background: #f8f6ff; /* 淡紫提示背景 */
  border-radius: 10px;
  font-size: 12px;
  color: #6b5fb5; /* 紫灰色文字 */
  border: 1px solid #ede9fd;
}

.info-icon {
  font-size: 14px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  width: 100%;
  max-width: 920px;
}

.feature-card {
  background: #ffffff;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.06); /* 淡紫阴影 */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.feature-card h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

/* ====== Results ====== */
.results-container {
  margin-top: 40px;
  background: #ffffff;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.06);
  max-width: 100%;
  overflow: hidden;
}

.results-container h2 {
  font-size: 20px;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.result-card {
  border: 1px solid #eef0f6; /* 淡紫边框 */
  border-radius: 16px;
  padding: 28px 24px;
  transition: all 0.3s ease;
  background: linear-gradient(145deg, #ffffff 0%, #fafbff 100%);
  text-align: center;
}

.result-card:hover {
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.12); /* 紫色悬停阴影 */
  border-color: #d4daf5;
  transform: translateY(-2px);
}

.result-card .file-name {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  word-break: break-all;
  line-height: 1.4;
}

.result-card .file-info {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-card .actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 32px;
  border: none !important;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-play {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 紫蓝渐变播放按钮 */
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-play:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-download {
  background: linear-gradient(135deg, #7c9cf5 0%, #5b7fe0 100%); /* 蓝紫渐变下载按钮 */
  color: white;
  box-shadow: 0 4px 15px rgba(91, 156, 245, 0.4);
  font-weight: 600;
  border: none !important;
}

.btn-download:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(91, 156, 245, 0.5);
  background: linear-gradient(135deg, #6a8ce8 0%, #4a70d0 100%);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #000;
  padding: 20px;
  border-radius: 15px;
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

#videoPlayer {
  max-width: 100%;
  max-height: 80vh;
}

footer {
  background: #ffffff;
  color: #666;
  text-align: center;
  padding: 26px 20px 22px;
  margin-top: 60px;
  border-top: 1px solid #eee;
}

footer p {
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.6;
  font-weight: 500;
}

footer p:last-child {
  margin-bottom: 0;
}

.footer-copy {
  margin-bottom: 4px;
}

.footer-icp {
  color: #888;
  font-size: 13px;
  font-weight: 500;
}

.footer-link {
  color: #5b6ce0;
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 600;
}

.footer-link:hover {
  color: #764ba2;
  text-decoration: underline;
}

.results-footer {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  padding-top: 20px;
  border-top: 1px solid #f0f1f5;
}

.results-disclaimer {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 16px 20px 0;
  line-height: 1.6;
}

.btn-back {
  padding: 14px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 紫蓝返回按钮 */
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  width: auto;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(102, 126, 234, 0.45);
}

/* ====== 页面内嵌播放器 ====== */
.inline-player-section {
  margin-top: 24px;
  background: #ffffff;
  border: 1px solid #e8eaf2;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
}

.inline-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.inline-player-title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.btn-close-inline {
  padding: 7px 20px !important;
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.5px;
}

.btn-close-inline:hover {
  background: rgba(255, 80, 80, 0.85) !important;
  border-color: transparent !important;
  transform: scale(1.03);
}

/* 转码进度 */
.transcode-progress-box {
  padding: 28px 24px 22px;
  text-align: center;
  background: linear-gradient(135deg, #f8f9fc 0%, #eef1f7 100%);
  border-bottom: 1px solid #eee;
}

.tp-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.tp-top span {
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.tp-bar-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.tp-bar-track {
  width: 100%;
  height: 16px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tp-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 8px;
  transition: width 0.4s ease;
  position: relative;
}

.tp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 2s infinite;
}

.tp-percent-overlay {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 10;
}

.tp-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 520px;
  margin: 12px auto 0;
}

.tp-bottom span:first-child {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
}

.tp-bottom span:last-child {
  color: #9ca3af;
  font-size: 11px;
}

/* DPlayer容器 */
.dplayer-container {
  display: none;
}
.dplayer-container.dplayer-visible {
  display: block;
}

@media (max-width: 768px) {
  .search-card {
    padding: 30px 25px;
  }

  .search-card h1 {
    font-size: 24px;
  }

  .search-box {
    flex-direction: column;
  }

  .features {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  nav a {
    margin-left: 15px;
    margin-right: 15px;
  }
}

/* 转码进度条旋转动画 */
.spin-icon {
  animation: spin 1.2s linear infinite;
  transform-origin: center;
}

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

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