:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #111622;
  --bg-tertiary: #182032;
  --bg-card: rgba(20, 26, 40, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.35);
  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-glow: 0 0 24px -4px rgba(99, 102, 241, 0.25);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 顶部环境渐变发光装饰 */
body::before {
  content: "";
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  position: relative;
  z-index: 1;
}

/* 头部导航 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

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

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text h1 span.tag {
  font-size: 11px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 7px;
  border-radius: 20px;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}

/* 主网格排版 */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* 上传工作台卡片 */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s ease;
}

.panel-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 拖拽投递箱 */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-secondary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.dropzone-text h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.dropzone-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dropzone-tips {
  display: inline-flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-dim);
}

/* 预设卡片组 */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.preset-card {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.preset-card.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-primary);
  box-shadow: 0 0 16px -2px rgba(99, 102, 241, 0.3);
}

.preset-radio {
  margin-top: 3px;
  accent-color: var(--accent-primary);
}

.preset-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preset-info h4 .badge {
  font-size: 10px;
  background: #10b981;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: normal;
}

.preset-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 控制项 */
.control-group {
  margin-bottom: 16px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.control-label span.value {
  color: var(--accent-secondary);
  font-weight: 600;
}

.range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  accent-color: var(--accent-primary);
  outline: none;
  cursor: pointer;
}

.select-box {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.select-box:focus {
  border-color: var(--accent-primary);
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 对比工作区 (Before / After Split Viewer) */
.comparison-section {
  display: none;
  margin-bottom: 32px;
}

.comparison-section.active {
  display: block;
}

.compare-box {
  position: relative;
  width: 100%;
  max-height: 600px;
  min-height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 600px;
}

.compare-image {
  display: block;
  max-width: 100%;
  max-height: 560px;
  object-fit: contain;
}

.compare-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.6);
}

.compare-overlay .compare-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  height: 100%;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: ew-resize;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  z-index: 10;
  pointer-events: none;
}

.compare-badge {
  position: absolute;
  top: 16px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  z-index: 5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-before {
  left: 16px;
  background: rgba(220, 38, 38, 0.75);
  color: #fff;
}

.badge-after {
  right: 16px;
  background: rgba(16, 185, 129, 0.75);
  color: #fff;
}

/* 元数据对比指标条 */
.meta-diff-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .meta-diff-bar {
    grid-template-columns: 1fr;
  }
}

.meta-diff-col {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.meta-diff-col.danger {
  border-left: 3px solid #ef4444;
}

.meta-diff-col.success {
  border-left: 3px solid #10b981;
}

.meta-diff-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meta-diff-item {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.meta-diff-item:last-child {
  border-bottom: none;
}

/* 批处理列表 */
.batch-section {
  display: none;
  margin-bottom: 32px;
}

.batch-section.active {
  display: block;
}

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: all 0.2s ease;
}

.batch-item:hover {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}

.batch-thumb {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--border-color);
}

.batch-info {
  flex: 1;
  min-width: 0;
}

.batch-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.batch-detail {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

.batch-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.status-waiting {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

.status-processing {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.status-done {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.batch-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  padding: 6px 10px;
  font-size: 12px;
}

/* 原理与 FAQ 区域 */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

.faq-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.faq-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Toast 提示 */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.2s ease forwards;
}

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