/* 基础样式重置 */
* {
  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%);
  min-height: 100vh;
  color: #1e293b;
}

/* 容器 */
.document-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* 头部 */
.doc-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.doc-header h1 {
  font-size: 2.5rem;
  color: white;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.back-to-hub {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.back-to-hub:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-4px);
}

.history-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-left: auto;
}

.history-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* 主内容区 */
.doc-main {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* 上传区域 */
.upload-section {
  text-align: center;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  border: 3px dashed #cbd5e1;
  border-radius: 20px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area:hover {
  border-color: #6366f1;
  background: #f0f1ff;
}

.upload-area.drag-over {
  border-color: #6366f1;
  background: #e0e7ff;
  transform: scale(1.02);
}

.upload-icon {
  font-size: 5rem;
  margin-bottom: 20px;
}

.upload-area h2 {
  font-size: 1.75rem;
  margin-bottom: 10px;
  color: #1e293b;
}

.upload-hint {
  color: #64748b;
  margin-bottom: 5px;
}

.upload-limit {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 25px;
}

.browse-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.browse-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.upload-drag {
  color: #94a3b8;
  font-size: 0.875rem;
}

/* 文件信息 */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  margin-top: 20px;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: #065f46;
}

.file-icon {
  font-size: 1.5rem;
}

.remove-btn {
  padding: 8px 16px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: #fecaca;
}

/* 语言选择 */
.language-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #e2e8f0;
}

.language-section h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.25rem;
  color: #334155;
}

.language-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.language-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.language-select label {
  font-weight: 600;
  color: #475569;
}

.language-select select {
  padding: 12px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.language-select select:focus {
  outline: none;
  border-color: #6366f1;
}

.language-arrow {
  font-size: 1.5rem;
  color: #94a3b8;
}

/* 操作按钮 */
.action-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
  gap: 30px;
  align-items: center;
}

.start-btn {
  padding: 16px 40px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.history-link {
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
  padding: 16px 20px;
}

.history-link:hover {
  text-decoration: underline;
}

/* 加载状态 */
.loading-section {
  display: flex;
  justify-content: center;
  padding: 80px 40px;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-spinner.small {
  width: 30px;
  height: 30px;
}

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

.loading-container h3 {
  font-size: 1.5rem;
  color: #334155;
  margin-bottom: 10px;
}

.loading-container p {
  color: #64748b;
  margin-bottom: 30px;
}

.progress-bar {
  width: 300px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progressText {
  font-weight: 600;
  color: #6366f1;
}

/* 翻译结果 */
.result-section {
  margin-top: 20px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.result-header h3 {
  font-size: 1.5rem;
  color: #1e293b;
}

.result-actions {
  display: flex;
  gap: 15px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.new-btn {
  padding: 12px 24px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-btn:hover {
  background: #e2e8f0;
}

/* 并列显示 */
.compare-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.document-panel {
  background: #f8fafc;
  border-radius: 15px;
  padding: 25px;
}

.document-panel h4 {
  font-size: 1.125rem;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid;
}

.source-panel h4 {
  border-color: #6366f1;
  color: #4338ca;
}

.target-panel h4 {
  border-color: #10b981;
  color: #065f46;
}

.panel-content {
  min-height: 300px;
  line-height: 1.8;
  color: #334155;
}

/* 搜索筛选 */
.search-section {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.search-input {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
}

.search-input:focus {
  outline: none;
  border-color: #6366f1;
}

.status-filter {
  padding: 12px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
}

/* 历史记录列表 */
.history-section {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th {
  text-align: left;
  padding: 15px 20px;
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
}

.history-table td {
  padding: 15px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.file-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-completed {
  background: #dcfce7;
  color: #065f46;
}

.status-processing {
  background: #fef3c7;
  color: #b45309;
}

.status-pending {
  background: #e0e7ff;
  color: #4338ca;
}

.status-error {
  background: #fee2e2;
  color: #dc2626;
}

.action-cell {
  display: flex;
  gap: 10px;
}

.action-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn.download {
  background: #10b981;
  color: white;
  text-decoration: none;
}

.action-btn.download:hover {
  background: #059669;
}

.action-btn.delete {
  background: #fee2e2;
  color: #dc2626;
}

.action-btn.delete:hover {
  background: #fecaca;
}

/* 加载指示器 */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px;
}

.loading-indicator p {
  margin-top: 15px;
  color: #64748b;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #334155;
}

.empty-state p {
  color: #64748b;
  margin-bottom: 25px;
}

.empty-action {
  padding: 12px 24px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
}

/* 消息提示 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.toast-info {
  background: #3b82f6;
}

.toast-success {
  background: #10b981;
}

.toast-error {
  background: #ef4444;
}

/* 页脚 */
.doc-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.doc-footer .doc-mail {
  margin: 10px 0 0;
  font-size: 0.9rem;
}

.doc-footer .doc-mail a {
  color: #ffd479;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 212, 121, 0.45);
}

.doc-footer .doc-mail a:hover {
  border-bottom-color: #ffd479;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .doc-header {
    flex-direction: column;
    text-align: center;
  }

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

  .doc-main {
    padding: 20px;
  }

  .upload-area {
    padding: 40px 20px;
  }

  .language-row {
    flex-direction: column;
    gap: 15px;
  }

  .action-section {
    flex-direction: column;
    gap: 20px;
  }

  .compare-view {
    grid-template-columns: 1fr;
  }

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

  .history-table {
    font-size: 0.875rem;
  }

  .history-table th,
  .history-table td {
    padding: 10px 12px;
  }

  .action-cell {
    flex-direction: column;
    gap: 5px;
  }
}
