* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #1f2937;
}

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 20px;
}

.container {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 40px;
  margin-bottom: 24px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 首页标题样式 */
.header-section {
  text-align: center;
  margin-bottom: 48px;
}

.main-title {
  font-size: 56px;
  font-weight: 800;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  line-height: 1.2;
}

.subtitle {
  color: #6b7280;
  font-size: 18px;
  margin: 0;
  text-align: center;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.3s ease;
  background: #f9fafb;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #667eea;
  background: #f3f4f6;
}

.upload-area.dragover {
  border-color: #667eea;
  background: #eef2ff;
}

.upload-area input[type="file"] {
  display: none;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.upload-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
}

.upload-text {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}

.upload-hint {
  font-size: 14px;
  color: #9ca3af;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  table-layout: fixed;
}

thead {
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 10;
}

th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e5e7eb;
}

td {
  padding: 16px;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  color: #374151;
  vertical-align: top;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f9fafb;
}

tbody tr.processing {
  background: #fef3c7;
}

tbody tr.completed {
  background: #d1fae5;
}

/* 对话内容列 */
.dialog-content-cell {
  max-width: 100%;
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.6;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 13px;
  color: #4b5563;
  position: relative;
}

.expand-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.expand-btn:hover {
  background: rgba(102, 126, 234, 0.2);
}

/* 解析结果列 */
.result-cell {
  max-width: 100%;
  font-size: 13px;
}

.result-question,
.result-answer {
  margin-bottom: 12px;
  padding: 10px;
  background: #f0f9ff;
  border-left: 3px solid #667eea;
  border-radius: 6px;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.6;
}

.result-answer {
  background: #f0fdf4;
  border-left-color: #10b981;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border-color: transparent;
}

.pagination-info {
  color: #6b7280;
  font-size: 14px;
  margin: 0 16px;
}

/* 状态标签 */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.processing {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.completed {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.error {
  background: #fee2e2;
  color: #991b1b;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f4f6;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 消息提示 */
.message {
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.message.info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* 操作栏 */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
}

.action-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 文本内容 */
.text-content {
  max-width: 100%;
  word-wrap: break-word;
  line-height: 1.6;
}

.text-content.original {
  color: #6b7280;
  font-style: italic;
}

.text-content.parsed {
  color: #374151;
  font-weight: 500;
}

/* 隐藏 */
.hidden {
  display: none !important;
}

/* 工具网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

/* 工具卡片链接 */
.tool-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* 工具卡片 */
.tool-card {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  border-color: #667eea;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
  transform: translateY(-4px);
}

.tool-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
}

.tool-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #1f2937;
}

.tool-description {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 20px 0;
  flex-grow: 1;
}

.tool-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-tag {
  display: inline-flex;
  padding: 4px 12px;
  background: #f3f4f6;
  color: #4b5563;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* 复选框 */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
