/* ============================================
   投标书自动生成系统 - 主样式文件
   设计风格：深色商务 + 蓝紫渐变 + 玻璃拟态
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ---- CSS 变量 ---- */
:root {
  --bg-primary: #0A0E1A;
  --bg-secondary: #0F1628;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-active: rgba(99, 102, 241, 0.5);

  --accent-primary: #6366F1;
  --accent-secondary: #8B5CF6;
  --accent-blue: #3B82F6;
  --accent-cyan: #06B6D4;
  --accent-green: #10B981;
  --accent-amber: #F59E0B;
  --accent-red: #EF4444;
  --accent-pink: #EC4899;

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #475569;

  --gradient-main: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.05));
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* ---- 基础重置 ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---- 背景粒子效果 ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---- 导航栏 ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

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

.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-logo-text {
  font-size: 16px;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.nav-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  color: var(--accent-primary);
}

/* ---- 步骤进度条 ---- */
.steps-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-muted);
  font-size: 13px;
}

.step-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.step-item.completed {
  color: var(--accent-green);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.step-item.completed .step-num {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.step-connector {
  width: 20px;
  height: 1px;
  background: var(--border-glass);
}

/* ---- 主内容区 ---- */
.main-content {
  position: relative;
  z-index: 1;
  padding-top: 64px;
  min-height: 100vh;
}

/* ---- 英雄区 ---- */
.hero-section {
  text-align: center;
  padding: 60px 32px 40px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent-primary);
  margin-bottom: 20px;
}

.hero-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #F1F5F9 30%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title span {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ---- 步骤卡片容器 ---- */
.step-container {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
  animation: fadeInUp 0.4s ease both;
}

.step-container.active {
  display: block;
}

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

/* ---- 卡片样式 ---- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
}

.card-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-body {
  padding: 24px 28px;
}

/* ---- 标签页 ---- */
.tab-nav {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  font-weight: 500;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- 输入区域 ---- */
.url-input-group {
  display: flex;
  gap: 10px;
}

.url-input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition-fast);
  outline: none;
}

.url-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.url-input::placeholder { color: var(--text-muted); }

.btn-primary {
  padding: 14px 24px;
  background: var(--gradient-main);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 12px 22px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ---- 上传区域 ---- */
.upload-zone {
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(99, 102, 241, 0.03);
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.upload-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-input { display: none; }

.uploaded-files {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.uploaded-file-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent-green);
}

/* ---- 文本输入区 ---- */
.text-input {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
  line-height: 1.7;
}

.text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.text-input::placeholder { color: var(--text-muted); }

/* ---- 加载动画 ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.loading-overlay.show { display: flex; }

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.loading-steps {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  max-width: 300px;
}

/* ---- 需求识别结果 ---- */
.requirement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.req-card {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition-fast);
}

.req-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.1);
}

.req-card-label {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.req-card-value {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}

.req-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 需求点列表 */
.req-points-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.req-point-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.req-point-item:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3);
}

.req-point-tag {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-mandatory {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.tag-recommended {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tag-optional {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.req-point-text {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

/* ---- 资质匹配 ---- */
.match-score-banner {
  background: var(--gradient-card);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.match-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--accent-green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  position: relative;
}

.match-score-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-green);
  line-height: 1;
}

.match-score-label {
  font-size: 11px;
  color: var(--text-muted);
}

.match-summary {
  flex: 1;
}

.match-summary h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.match-summary p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.qual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.qual-item {
  padding: 14px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-fast);
}

.qual-item:hover { background: rgba(0,0,0,0.3); }

.qual-status {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.qual-status.matched {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.qual-status.partial {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.qual-status.missing {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.qual-info { flex: 1; }
.qual-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

/* ---- 标书类型选择 ---- */
.bid-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.bid-type-card {
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: rgba(0,0,0,0.2);
}

.bid-type-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.05);
  transform: translateY(-2px);
}

.bid-type-card.selected {
  border-color: transparent;
  background: var(--bg-card);
  box-shadow: 0 0 0 2px var(--accent-primary), 0 8px 24px rgba(99,102,241,0.2);
}

.bid-type-card.selected::before {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  background: var(--accent-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  font-weight: 700;
}

.bid-type-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.bid-type-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.bid-type-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.selection-hint {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- 生成预览 ---- */
.preview-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  min-height: 500px;
}

.doc-tree {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.doc-tree-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-glass);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.doc-tree-body { padding: 12px; }

.tree-bid-type {
  margin-bottom: 8px;
}

.tree-type-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

.tree-type-label:hover { background: rgba(255,255,255,0.05); }
.tree-type-label.active { background: rgba(99,102,241,0.15); color: var(--accent-primary); }

.tree-chapters {
  padding-left: 20px;
  margin-top: 4px;
}

.tree-chapter {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.tree-chapter:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.tree-chapter.active { color: var(--accent-primary); background: rgba(99,102,241,0.1); }

.doc-preview {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.doc-preview-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-preview-title {
  font-size: 15px;
  font-weight: 600;
}

.doc-preview-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.9;
  white-space: pre-wrap;
  font-family: 'Noto Sans SC', sans-serif;
}

/* ---- 操作按钮区 ---- */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
}

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

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

/* ---- 导出成功提示 ---- */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 14px 20px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--accent-green);
  font-weight: 500;
  z-index: 300;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show { transform: translateX(0); }

/* ---- 分隔线 ---- */
.section-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 20px 0;
}

/* ---- 标签组 ---- */
.tags-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent-primary);
}

/* ---- 进度条 ---- */
.progress-bar {
  height: 4px;
  background: var(--border-glass);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--gradient-main);
  transition: width 1s ease;
}

/* ---- 空状态 ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

/* ---- 响应式适配 ---- */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .steps-nav { display: none; }
  .step-container { padding: 0 16px 40px; }
  .preview-layout { grid-template-columns: 1fr; }
  .bid-type-grid { grid-template-columns: 1fr 1fr; }
  .match-score-banner { flex-direction: column; text-align: center; }
}

/* ---- 滚动条样式 ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---- 选中文本颜色 ---- */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: white;
}

/* ---- 样本展示 Banner ---- */
.demo-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--accent-amber);
}

.sample-btn {
  padding: 5px 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-amber);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
  margin-left: auto;
}

.sample-btn:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* ---- 统计栏 ---- */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.stat-chip-num {
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-primary);
}

.stat-chip-label { color: var(--text-muted); }

/* ---- 生成完成动画 ---- */
.success-banner {
  text-align: center;
  padding: 40px;
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(6,182,212,0.05));
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
}

.success-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bounceIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent-green);
}

.success-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================
   OCR 相关样式
   ============================================ */

/* OCR 进度区域 */
.ocr-progress-box {
  margin-top: 16px;
  padding: 16px 18px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
}

.ocr-progress-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ocr-progress-icon {
  font-size: 18px;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.ocr-progress-label {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.ocr-progress-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-primary);
  min-width: 40px;
  text-align: right;
}

.ocr-progress-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* OCR 结果框 */
.ocr-result-box {
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
}

.ocr-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-green);
}

.ocr-char-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  flex: 1;
}

.ocr-toggle-btn {
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-green);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-fast);
}

.ocr-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.18);
}

/* OCR 原始文字预览区 */
.ocr-raw-text {
  margin-top: 12px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  border: 1px solid var(--border-glass);
}

/* 上传成功后的区域变化 */
.upload-zone.has-files {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
  padding: 24px;
}

.upload-zone.ocr-running {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
  cursor: default;
  pointer-events: none;
}

/* 解析结果高亮标注 */
.parsed-field-highlight {
  display: inline;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--accent-primary);
}

/* OCR 模式标记 */
.ocr-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-green);
  margin-left: 8px;
}

