/* ============================================
   公共数据抓取助手 v4.0 — 合规性数据抓取与分析
   Design System: Clean, Professional, Compliance-focused
   ============================================ */

/* === CSS Variables === */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-bg: #eff6ff;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --cyan: #0891b2;
  --cyan-bg: #ecfeff;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --pink: #db2777;
  --pink-bg: #fdf2f8;
  --orange: #ea580c;
  --orange-bg: #fff7ed;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1e3a5f;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 240px;
  --topbar-height: 60px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* === Sidebar === */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.logo-text {
  color: #fff; font-size: 15px; font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-sub {
  color: var(--text-muted); font-size: 11px; font-weight: 500;
}

.sidebar-nav { flex: 1; padding: 12px 10px; }

.nav-section-title {
  color: rgba(148,163,184,0.6);
  font-size: 10px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 16px 12px 8px;
}

.nav-section-title:first-child { padding-top: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border: none; border-radius: var(--radius);
  background: transparent;
  color: var(--text-sidebar);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: rgba(148,163,184,0.5);
  font-size: 11px; text-align: center;
  line-height: 1.5;
}

/* === Main Content === */
.main-content {
  flex: 1; margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.topbar-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

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

.content-area { flex: 1; padding: 24px 28px; overflow-y: auto; }

.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s ease; }

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

/* === Cards === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border-light); }

/* === Stats Grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 0 0 100%;
  opacity: 0.06;
}

.stat-card.card-blue::after { background: var(--primary); }
.stat-card.card-green::after { background: var(--success); }
.stat-card.card-purple::after { background: var(--purple); }
.stat-card.card-cyan::after { background: var(--cyan); }

.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); margin: 4px 0; }
.stat-trend { font-size: 11px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* === Charts === */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.chart-container { position: relative; height: 300px; }

/* === Badges & Tags === */
.badge-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
}

.badge-pill.online { background: var(--success-bg); color: var(--success); }
.badge-pill.offline { background: var(--danger-bg); color: var(--danger); }
.badge-pill.warning { background: var(--warning-bg); color: var(--warning); }

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px; font-weight: 600;
}

.tag-b { background: #eff6ff; color: #2563eb; }
.tag-g { background: #ecfdf5; color: #059669; }
.tag-c { background: #ecfeff; color: #0891b2; }
.tag-p { background: #f5f3ff; color: #7c3aed; }
.tag-o { background: #fff7ed; color: #ea580c; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }

.btn-outline { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

/* === Source Grid === */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.source-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.source-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.source-card-inner { padding: 20px; }

.source-card-top {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 12px;
}

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

.source-card-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.source-card-category { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.source-card-desc {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-card-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.source-meta-item {
  font-size: 11px; padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.source-meta-item strong { color: var(--text-primary); }

.source-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.source-count { font-size: 12px; color: var(--text-muted); }
.source-count strong { color: var(--text-primary); font-size: 15px; }

/* === Data Source Detail Modal === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 90%; max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-card); z-index: 1;
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  border: none; border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px; cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); }

/* === Proposals === */
.proposal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.proposal-card:hover { box-shadow: var(--shadow-md); }

.proposal-card-header {
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}

.proposal-num {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.proposal-title { font-size: 15px; font-weight: 700; }
.proposal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.proposal-card-body {
  padding: 0 20px 20px;
  display: none;
}

.proposal-card.expanded .proposal-card-body { display: block; }
.proposal-card.expanded { border-color: var(--primary-light); }

.proposal-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 16px;
}

.proposal-detail-item {
  background: var(--bg); padding: 12px 14px;
  border-radius: var(--radius);
}

.proposal-detail-item .label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.proposal-detail-item .value { font-size: 13px; color: var(--text-primary); margin-top: 4px; font-weight: 500; }

.proposal-section {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.proposal-section h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }

/* === Alert === */
.alert {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13px;
}

.alert-info { background: var(--primary-bg); color: var(--primary-dark); border: 1px solid rgba(37,99,235,0.15); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(5,150,105,0.15); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217,119,6,0.15); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220,38,38,0.15); }
.alert-icon { font-size: 16px; flex-shrink: 0; }

/* === Process Timeline === */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute; left: 15px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--cyan));
}

.timeline-item {
  position: relative;
  padding: 0 0 28px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute; left: -25px; top: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  background: var(--primary);
  z-index: 1;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.timeline-step { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; }
.timeline-title { font-size: 15px; font-weight: 700; margin: 4px 0 8px; }
.timeline-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.timeline-duration { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.timeline-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; background: var(--primary-bg); color: var(--primary); }

/* === Crawler Monitor === */
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.monitor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.monitor-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.monitor-card-title { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.monitor-card-value { font-size: 24px; font-weight: 800; }

.progress-bar {
  height: 6px; border-radius: 3px;
  background: var(--border-light);
  margin-top: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.6s ease;
}

.log-panel {
  background: #0f172a;
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: 350px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.log-entry {
  padding: 3px 0;
  display: flex; gap: 10px;
  color: #94a3b8;
}

.log-entry .log-time { color: #64748b; flex-shrink: 0; }
.log-entry .log-level { width: 50px; flex-shrink: 0; font-weight: 600; }
.log-entry.info .log-level { color: #38bdf8; }
.log-entry.success .log-level { color: #4ade80; }
.log-entry.warn .log-level { color: #fbbf24; }
.log-entry.error .log-level { color: #f87171; }
.log-entry .log-msg { color: #cbd5e1; word-break: break-all; }

/* === File Analysis Page === */
.file-analyzer-container {
  display: grid; grid-template-columns: 380px 1fr;
  gap: 20px;
}

.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.file-upload-zone:hover, .file-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.file-upload-zone .upload-icon { font-size: 40px; margin-bottom: 12px; }
.file-upload-zone .upload-text { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.file-upload-zone .upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.ip-score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 32px; font-weight: 800;
  position: relative;
}

/* === Analysis Page === */
.analysis-tabs {
  display: flex; gap: 4px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}

.analysis-tab {
  flex: 1; padding: 10px 16px;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.analysis-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.analysis-tab:hover:not(.active) { color: var(--text-primary); }

/* === Table Styles === */
.data-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.data-table-wrapper th {
  background: var(--bg);
  padding: 10px 14px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}

.data-table-wrapper td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table-wrapper tr:hover td { background: var(--bg); }

/* === Scenes Grid (申报方案应用场景) === */
.scenes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.scene-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.2s, transform 0.15s;
}

.scene-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.scene-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.scene-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scene-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.scene-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 10px;
}

.scene-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* === Highlight Box === */
.highlight-box {
  animation: fadeInUp 0.4s ease;
}

/* === Utility Classes === */
.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }

.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-lg { font-size: 17px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }

.hidden { display: none !important; }

/* === Color Backgrounds === */
.bg-blue { background: var(--primary-bg); color: var(--primary); }
.bg-green { background: var(--success-bg); color: var(--success); }
.bg-cyan { background: var(--cyan-bg); color: var(--cyan); }
.bg-purple { background: var(--purple-bg); color: var(--purple); }
.bg-pink { background: var(--pink-bg); color: var(--pink); }
.bg-orange { background: var(--orange-bg); color: var(--orange); }

.bg-blue-solid { background: var(--primary); color: #fff; }
.bg-green-solid { background: var(--success); color: #fff; }
.bg-cyan-solid { background: var(--cyan); color: #fff; }
.bg-purple-solid { background: var(--purple); color: #fff; }
.bg-orange-solid { background: var(--orange); color: #fff; }
.bg-pink-solid { background: var(--pink); color: #fff; }

/* === Status Badges === */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}

.status-badge.idle { background: var(--bg); color: var(--text-muted); }
.status-badge.running { background: var(--success-bg); color: var(--success); }
.status-badge.error { background: var(--danger-bg); color: var(--danger); }

/* === Animations === */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.animate-pulse { animation: pulse 2s infinite; }

/* === Loading Spinner === */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* === Quick Actions Bar === */
.quick-actions {
  display: flex; gap: 8px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.quick-action-btn {
  flex: 1; padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  font-family: inherit;
}

.quick-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

/* === Tab Navigation === */
.tab-nav {
  display: flex; gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 18px;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

/* === Responsive === */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .monitor-grid { grid-template-columns: 1fr; }
  .file-analyzer-container { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .content-area { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === Animations === */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === File Analysis Generated Proposal === */
#generated-proposal-container .proposal-card {
  animation: fadeInUp 0.4s ease;
  border-left: 4px solid var(--primary);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
#generated-proposal-container .proposal-card-header {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  cursor: default;
}
#generated-proposal-container .proposal-detail-item {
  background: #f8fafc;
}
/* 方案生成区域分隔 */
.file-analysis-divider {
  border: none;
  border-top: 2px dashed var(--border);
  margin: 24px 0 20px;
}

/* ==================== v4.0 合规中心&专利账号样式 ==================== */

/* 合规中心信息网格 */
.info-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: center;
}

.info-grid div:nth-child(odd) {
  color: var(--text-muted);
  text-align: right;
}

/* 合规检查项目 */
.compliance-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.compliance-check-item:hover {
  background: #f8fafc;
}

/* 合法性说明卡片 */
.legality-card {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #f8fafc;
  transition: box-shadow 0.2s;
}

.legality-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 数据源网格 */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.source-card {
  padding: 16px;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.source-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.source-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Toast 动画 */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 统计卡片网格 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-card-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

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

/* 图表卡片 */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

/* Tab 按钮 */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 1200px) {
  .charts-row { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .source-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
  .stat-cards { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 100px 1fr; }
}
