/* ============================================================
   Bug 测试轻系统 — 全局样式
   参考飞书多维表格设计语言：浅灰背景，白色卡片，清晰层次
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e4e8f0;
  --border-light: #eef0f5;
  --text-primary: #1a1f2e;
  --text-secondary: #5c6472;
  --text-placeholder: #b0b8c8;
  --primary: #3b7df8;
  --primary-hover: #2563eb;
  --primary-light: #eaf1ff;

  /* 状态颜色 */
  --status-new: #ef4444;
  --status-new-bg: #fef2f2;
  --status-fixing: #f97316;
  --status-fixing-bg: #fff7ed;
  --status-verified: #10b981;
  --status-verified-bg: #ecfdf5;
  --status-deferred: #8b5cf6;
  --status-deferred-bg: #f5f3ff;

  /* 严重程度颜色 */
  --sev-high: #ef4444;
  --sev-high-bg: #fef2f2;
  --sev-mid: #f97316;
  --sev-mid-bg: #fff7ed;
  --sev-low: #10b981;
  --sev-low-bg: #ecfdf5;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 8px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-panel: -8px 0 32px rgba(0,0,0,0.08);
  --transition: 0.15s ease;
}

/* ============================================================
   主题变量 — 覆盖 :root 中的颜色变量
   ============================================================ */

/* 暗夜 Dark */
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2e3d;
  --border-light: #222536;
  --text-primary: #e8eaf2;
  --text-secondary: #7c8299;
  --text-placeholder: #4a5068;
  --primary: #5b9cf6;
  --primary-hover: #7ab3ff;
  --primary-light: #1a2540;

  --status-new: #f87171;
  --status-new-bg: #2d1a1a;
  --status-fixing: #fb923c;
  --status-fixing-bg: #2d1e0f;
  --status-verified: #34d399;
  --status-verified-bg: #0d2a1e;
  --status-deferred: #a78bfa;
  --status-deferred-bg: #1e1530;

  --sev-high: #f87171;
  --sev-high-bg: #2d1a1a;
  --sev-mid: #fb923c;
  --sev-mid-bg: #2d1e0f;
  --sev-low: #34d399;
  --sev-low-bg: #0d2a1e;

  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.5), 0 1px 6px rgba(0,0,0,0.4);
  --shadow-panel: -8px 0 32px rgba(0,0,0,0.5);
}

/* 森绿 Sage */
[data-theme="sage"] {
  --bg: #f0f7f4;
  --surface: #ffffff;
  --border: #d6ece4;
  --border-light: #e8f5f0;
  --text-primary: #1a2e26;
  --text-secondary: #4d7066;
  --text-placeholder: #9fc3b8;
  --primary: #1a9e72;
  --primary-hover: #158a60;
  --primary-light: #e0f5ee;

  --status-new: #e53e3e;
  --status-new-bg: #fff5f5;
  --status-fixing: #d97706;
  --status-fixing-bg: #fffbeb;
  --status-verified: #059669;
  --status-verified-bg: #ecfdf5;
  --status-deferred: #7c3aed;
  --status-deferred-bg: #f5f3ff;

  --sev-high: #e53e3e;
  --sev-high-bg: #fff5f5;
  --sev-mid: #d97706;
  --sev-mid-bg: #fffbeb;
  --sev-low: #059669;
  --sev-low-bg: #ecfdf5;
}

/* 紫调 Violet */
[data-theme="violet"] {
  --bg: #f5f3ff;
  --surface: #ffffff;
  --border: #ddd6fe;
  --border-light: #ede9fe;
  --text-primary: #1e1b3a;
  --text-secondary: #6d5fa6;
  --text-placeholder: #c4b8f0;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-light: #ede9fe;

  --status-new: #ef4444;
  --status-new-bg: #fef2f2;
  --status-fixing: #f59e0b;
  --status-fixing-bg: #fffbeb;
  --status-verified: #10b981;
  --status-verified-bg: #ecfdf5;
  --status-deferred: #8b5cf6;
  --status-deferred-bg: #f5f3ff;

  --sev-high: #ef4444;
  --sev-high-bg: #fef2f2;
  --sev-mid: #f59e0b;
  --sev-mid-bg: #fffbeb;
  --sev-low: #10b981;
  --sev-low-bg: #ecfdf5;
}

/* 暖橙 Amber */
[data-theme="amber"] {
  --bg: #fdf8f0;
  --surface: #ffffff;
  --border: #f0dfc0;
  --border-light: #f7eedc;
  --text-primary: #2d1f0a;
  --text-secondary: #7a5c30;
  --text-placeholder: #c8a878;
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-light: #fef3c7;

  --status-new: #ef4444;
  --status-new-bg: #fef2f2;
  --status-fixing: #f97316;
  --status-fixing-bg: #fff7ed;
  --status-verified: #10b981;
  --status-verified-bg: #ecfdf5;
  --status-deferred: #8b5cf6;
  --status-deferred-bg: #f5f3ff;

  --sev-high: #ef4444;
  --sev-high-bg: #fef2f2;
  --sev-mid: #f97316;
  --sev-mid-bg: #fff7ed;
  --sev-low: #10b981;
  --sev-low-bg: #ecfdf5;
}

/* ===== 暗夜主题下特殊覆盖 ===== */
[data-theme="dark"] thead th { background: #1e2230; }
[data-theme="dark"] tbody tr:hover { background: #212538; }
[data-theme="dark"] .kanban-col[data-status="新建"] { background: #2a1a1a; border-color: #4a2222; }
[data-theme="dark"] .kanban-col[data-status="修复完成-待验证"] { background: #2a1e10; border-color: #4a3020; }
[data-theme="dark"] .kanban-col[data-status="验证通过"] { background: #0f2a1e; border-color: #1a4a30; }
[data-theme="dark"] .kanban-col[data-status="延期搁置"] { background: #1a1030; border-color: #30204a; }
[data-theme="dark"] .kanban-col[data-status="非Bug"] { background: #1a1d27; border-color: #2a2e3d; }
[data-theme="dark"] .text-popup { background: #252836; border-color: #3a3e52; color: #c8cce0; }
[data-theme="dark"] .text-popup::after { border-top-color: #3a3e52; }
[data-theme="dark"] .text-popup::before { border-top-color: #252836; }
[data-theme="dark"] #pagination { background: #151821; }
[data-theme="dark"] td[data-field]:not(:has(input)):not(:has(select)):hover { background: #1e2434 !important; }
[data-theme="dark"] .inline-input, [data-theme="dark"] .inline-select, [data-theme="dark"] .inline-textarea { background: #1a1d27; color: #e8eaf2; }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.6); }
[data-theme="dark"] .tag-type-agent { background: #0f2040; color: #60a5fa; }
[data-theme="dark"] .tag-type-工程化 { background: #252836; color: #9ca3af; }
[data-theme="dark"] .tag-type-两者都有 { background: #20103a; color: #c084fc; }
[data-theme="dark"] .tag-status-非Bug { background: #252836; color: #9ca3af; }

/* ===== 主题切换器 ===== */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.theme-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-secondary);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  height: 32px;
  min-width: 96px;
}

.theme-select:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.theme-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
}

/* ===== 导航 ===== */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0,0,0,0.04);
}

.nav-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.nav-logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  transition: var(--transition);
  font-weight: 450;
}

.nav-link:hover { background: var(--bg); color: var(--text-primary); }
.nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ===== 页面容器 ===== */
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

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

.page-title {
  font-size: 18px;
  font-weight: 600;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

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

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg); border-color: #c0c4cc; }

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

.btn-danger { background: #fff1f0; color: var(--status-new); border-color: #ffc0c0; }
.btn-danger:hover { background: #ffe0e0; }

.btn-sm { padding: 4px 10px; font-size: 13px; }

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--surface);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.filter-bar select, .filter-bar input[type="text"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: var(--transition);
}
.filter-bar select:focus, .filter-bar input[type="text"]:focus {
  border-color: var(--primary);
  background: #fff;
}

/* ===== 表格 ===== */
.table-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: visible;
  box-shadow: var(--shadow);
}

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

thead th {
  background: #f8f9fc;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f5f7ff; }

tbody td {
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 13px;
  vertical-align: middle;
}

.cell-desc {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tag-status-新建 { background: var(--status-new-bg); color: var(--status-new); }
.tag-status-修复完成-待验证 { background: var(--status-fixing-bg); color: var(--status-fixing); }
.tag-status-验证通过 { background: var(--status-verified-bg); color: var(--status-verified); }
.tag-status-延期搁置 { background: var(--status-deferred-bg); color: var(--status-deferred); }
.tag-status-非Bug { background: #f3f4f6; color: #6b7280; }

.tag-sev-严重 { background: var(--sev-high-bg); color: var(--sev-high); }
.tag-sev-中 { background: var(--sev-mid-bg); color: var(--sev-mid); }
.tag-sev-低 { background: var(--sev-low-bg); color: var(--sev-low); }

.tag-type-agent { background: #e6f4ff; color: #0958d9; }
.tag-type-工程化 { background: #f0f0f0; color: #595959; }
.tag-type-两者都有 { background: #f9f0ff; color: #531dab; }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required { color: var(--status-new); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(42,111,219,0.12);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ===== 截图上传 ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 13px;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.upload-preview {
  margin-top: 10px;
}

.upload-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: contain;
}

/* ===== 表格行内编辑 ===== */
.inline-input, .inline-select {
  width: 100%;
  padding: 2px 6px;
  border: 1.5px solid var(--primary);
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(42,111,219,0.12);
  min-width: 0;
}
td[data-field] {
  cursor: text;
  position: relative;
}
td[data-field]:not(:has(input)):not(:has(select)):hover {
  background: #f0f4ff !important;
}
td[data-field].cell-saving { opacity: 0.5; }
td[data-field].cell-saved { outline: 2px solid var(--status-verified); outline-offset: -2px; }
td[data-field].cell-error { outline: 2px solid var(--status-new); outline-offset: -2px; }

/* ===== 详情面板（侧边栏） ===== */
.detail-panel {
  position: fixed;
  right: 0;
  top: 54px;
  bottom: 0;
  width: 496px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 150;
  overflow-y: auto;
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
}

.detail-panel-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  background: linear-gradient(to bottom, var(--surface) 90%, transparent);
}

.detail-panel-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.detail-field {
  margin-bottom: 16px;
}

.detail-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-field-value {
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}

.detail-field-value.mono {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 13px;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
}

.detail-screenshot img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.detail-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-text { font-size: 14px; }

/* ===== 加载 ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

/* ===== Kanban ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 1100px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

.kanban-col {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 300px;
  border: 1px solid var(--border);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid transparent;
}

.kanban-col[data-status="新建"] { background: #fef9f9; border-color: #fde8e8; }
.kanban-col[data-status="修复完成-待验证"] { background: #fffbf5; border-color: #fde8d0; }
.kanban-col[data-status="验证通过"] { background: #f5fdf9; border-color: #d0f0e0; }
.kanban-col[data-status="延期搁置"] { background: #faf8ff; border-color: #e4dcff; }
.kanban-col[data-status="非Bug"] { background: #f9fafb; border-color: #e5e7eb; }

.kanban-col[data-status="新建"] .kanban-col-header { border-color: var(--status-new); }
.kanban-col[data-status="修复完成-待验证"] .kanban-col-header { border-color: var(--status-fixing); }
.kanban-col[data-status="验证通过"] .kanban-col-header { border-color: var(--status-verified); }
.kanban-col[data-status="延期搁置"] .kanban-col-header { border-color: var(--status-deferred); }
.kanban-col[data-status="非Bug"] .kanban-col-header { border-color: #9ca3af; }

.kanban-col-title {
  font-weight: 600;
  font-size: 13px;
}

.kanban-col[data-status="新建"] .kanban-col-title { color: var(--status-new); }
.kanban-col[data-status="修复完成-待验证"] .kanban-col-title { color: var(--status-fixing); }
.kanban-col[data-status="验证通过"] .kanban-col-title { color: var(--status-verified); }
.kanban-col[data-status="延期搁置"] .kanban-col-title { color: var(--status-deferred); }
.kanban-col[data-status="非Bug"] .kanban-col-title { color: #6b7280; }

.kanban-count {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.kanban-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.kanban-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: #d0d7e8; }
.kanban-card:last-child { margin-bottom: 0; }

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ===== 统计卡片 ===== */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.stat-card-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-card-value.primary { color: var(--primary); }
.stat-card-value.primary ~ .stat-card::before, .stat-card:has(.primary)::before { background: var(--primary); }
.stat-card-value.danger { color: var(--status-new); }
.stat-card-value.success { color: var(--status-verified); }
.stat-card-value.warning { color: var(--status-fixing); }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card-full { grid-column: 1 / -1; }

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

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

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

/* ===== 关闭按钮 ===== */
.close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
  transition: var(--transition);
  flex-shrink: 0;
}
.close-btn:hover { background: var(--bg); color: var(--text-primary); }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== 图片灯箱 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ===== 工具 ===== */
.flex { display: flex; }
.flex-center { align-items: center; }
.gap-8 { gap: 8px; }
.ml-auto { margin-left: auto; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-secondary); }
.fw-medium { font-weight: 500; }
.hidden { display: none !important; }
