:root {
  --primary-color: #4361ee;
  --primary-hover: #3a56d4;
  --secondary-color: #48cae4;
  --secondary-hover: #30a9c3;
  --accent-color: #4895ef;
  --accent-hover: #3a7fd0;
  --text-color: #2b2d42;
  --text-light: #6c757d;
  --background: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #e9ecef;
  --border-radius: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background);
  padding: 20px;
}

.container {
  max-width: 1000px;
  margin: 40px auto;
  background-color: var(--card-bg);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

h1 {
  text-align: center;
  margin-bottom: 40px;
  color: var(--text-color);
  font-weight: 700;
  font-size: 2.5rem;
}

h2 {
  margin-bottom: 20px;
  color: var(--text-color);
  font-weight: 600;
}

.upload-area {
  margin-bottom: 40px;
  text-align: center;
  padding: 30px;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  background-color: #f8f9fa;
  transition: var(--transition);
}

.upload-area:hover {
  border-color: var(--primary-color);
  background-color: #f1f3f9;
}

input[type="file"] {
  display: none;
}

.upload-button {
  display: inline-block;
  padding: 14px 28px;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.upload-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.file-name {
  margin-top: 15px;
  font-size: 15px;
  color: var(--text-light);
}

.result-container {
  margin-top: 30px;
  padding: 25px;
  border-radius: var(--border-radius);
  background-color: #f8f9fa;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.toc-result {
  margin-bottom: 25px;
  white-space: pre-wrap;
  font-family: 'Monaco', 'Consolas', monospace;
  max-height: 450px;
  overflow-y: auto;
  padding: 15px;
  background-color: var(--card-bg);
  border: 1px solid #eee;
  border-radius: var(--border-radius);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.toc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-light);
  text-align: center;
}

.toc-empty-state svg {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
  fill: #d1d5db;
}

.toc-empty-state p {
  font-size: 16px;
  max-width: 300px;
  line-height: 1.5;
}

.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

.btn {
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(72, 149, 239, 0.3);
}

.btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 149, 239, 0.4);
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.format-selector {
  margin-bottom: 20px;
  display: flex;
  gap: 25px;
  justify-content: center;
  padding: 15px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.format-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 20px;
  transition: var(--transition);
}

.format-selector label:hover {
  background-color: #f1f3f9;
}

.format-selector input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 50%;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.format-selector input[type="radio"]:checked {
  border-color: var(--primary-color);
}

.format-selector input[type="radio"]::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary-color);
  opacity: 0;
  transition: var(--transition);
}

.format-selector input[type="radio"]:checked::after {
  opacity: 1;
}

/* 添加响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 25px;
    margin: 20px auto;
  }
  
  h1 {
    font-size: 2rem;
    margin-bottom: 30px;
  }
  
  .upload-area {
    padding: 20px;
  }
  
  .export-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
}

.footer {
  text-align: center;
  margin-top: 30px;
  padding: 15px 0;
  color: #666;
  font-size: 14px;
}

.github-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(67, 97, 238, 0.08);
  color: var(--primary-color);
  transition: all 0.3s ease;
}

.github-link:hover {
  background-color: rgba(67, 97, 238, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
}

.github-icon {
  fill: var(--primary-color);
  transition: transform 0.3s ease;
}

.github-link:hover .github-icon {
  transform: scale(1.1);
}
