/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #3B82F6;
  --bg-light: #F8FAFC;
  --bg-white: #FFFFFF;
  --text-dark: #1E293B;
  --text-muted: #64748B;
  --text-light: #FFFFFF;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --purple: #8B5CF6;
  --gold: #D97706;
  --silver: #9CA3AF;
  --bronze: #B45309;
  --border: #E2E8F0;
  --font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
  font-family: var(--font-family);
  background: var(--bg-light);
  color: var(--text-dark);
  margin: 0 auto;
  min-height: 100vh;
  max-width: 1440px;
  padding: 0 16px;
}

/* Header - 浅色 */
.header {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  color: var(--text-dark);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.header .meta { font-size: 13px; color: var(--text-muted); }

/* Tabs */
.tab-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.tab-item {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Cards grid - 固定两列 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 24px 32px;
}

/* Category card */
.cat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  position: relative;
}
.cat-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}
.cat-card .card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F1F5F9;
}
.cat-card .card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

/* Metric block - 横排四列 */
.metric-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.metric-col {
  min-width: 0;
  border-right: 1px solid #F1F5F9;
  padding-right: 8px;
}
.metric-col:last-child { border-right: none; padding-right: 0; }
.metric-col-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: #EFF6FF;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  text-align: center;
  white-space: nowrap;
}
.top-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 11px;
  border-bottom: 1px solid #F8FAFC;
}
.top-item:last-child { border-bottom: none; }
.top-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.top-item-info .brand-name {
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}
.top-item-info .act-name {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-badge {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #F59E0B, #D97706); }
.rank-2 { background: linear-gradient(135deg, #9CA3AF, #6B7280); }
.rank-3 { background: linear-gradient(135deg, #D97706, #92400E); }
.top-item .rate-value { font-weight: 600; color: var(--primary); min-width: 40px; text-align: right; font-size: 11px; flex-shrink: 0; }

/* Table - 浅色表头 */
.detail-table-wrap {
  padding: 0 32px 32px;
  overflow-x: auto;
}
.detail-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.detail-table thead th {
  background: #F1F5F9;
  color: var(--text-dark);
  padding: 10px 12px;
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 12px;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
}
.detail-table thead th.group-header {
  background: #E2E8F0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-light);
  color: var(--primary);
}
.detail-table tbody tr { transition: background 0.15s; }
.detail-table tbody tr:hover { background: #F8FAFC; }
.detail-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #F1F5F9;
  white-space: nowrap;
}

/* Rate cell coloring */
.rate-high { background: rgba(16, 185, 129, 0.08); color: #059669; font-weight: 600; }
.rate-mid { background: rgba(245, 158, 11, 0.08); color: #D97706; font-weight: 500; }
.rate-low { background: rgba(239, 68, 68, 0.08); color: #DC2626; font-weight: 500; }

/* Filter bar - 左右布局 */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}
.filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-right {
  flex-shrink: 0;
}
.filter-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.filter-bar select, .filter-bar input {
  padding: 6px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-white);
  outline: none;
  transition: border-color 0.2s;
}
.filter-bar input { max-width: 130px; }
.filter-bar select:focus, .filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-secondary {
  background: var(--bg-white);
  color: var(--text-dark);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Multi-select dropdown */
.multi-select-wrap {
  position: relative;
  display: inline-block;
}
.multi-select-btn {
  padding: 8px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-white);
  cursor: pointer;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
  transition: border-color 0.2s;
}
.multi-select-btn:hover, .multi-select-btn.open {
  border-color: var(--primary);
}
.multi-select-btn .arrow { font-size: 10px; color: var(--text-muted); }
.multi-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
  padding: 6px 0;
}
.multi-select-dropdown.show { display: block; }
.multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.multi-select-option:hover { background: #F1F5F9; }
.multi-select-option input { accent-color: var(--primary); }
.multi-select-count {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Top action bar */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}
.pagination button {
  min-width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .info { font-size: 13px; color: var(--text-muted); margin: 0 12px; }

/* Checkbox */
.custom-check { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* Loading */
.loading { text-align: center; padding: 60px; color: var(--text-muted); }
.loading .spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Export canvas area */
#export-canvas-area { position: absolute; left: -9999px; top: -9999px; }

/* Section title */
.section-title { font-size: 18px; font-weight: 600; color: var(--text-dark); padding: 20px 32px 0; margin: 0; }

/* Diagnostics section */
.diag-section { padding: 20px 32px 16px; }
.diag-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 16px;
}
.diag-search-wrap {
  position: relative;
  min-width: 340px;
}
.diag-search-input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-white);
  outline: none;
  transition: border-color 0.2s;
}
.diag-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.diag-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
}
.diag-search-dropdown.show { display: block; }
.diag-search-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  justify-content: space-between;
}
.diag-search-item:hover { background: #EFF6FF; }
.diag-search-item .brand-info { font-weight: 500; }
.diag-search-item .cat-info { color: var(--text-muted); font-size: 12px; }

/* Diagnostics card */
.diag-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 1200px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow-x: auto;
}
.diag-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
}
.diag-brand-name { font-size: 22px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.diag-cat { font-size: 13px; color: var(--text-muted); }
.diag-subtitle { font-size: 15px; font-weight: 600; color: var(--text-dark); margin: 12px 0 8px; padding-left: 4px; }
.diag-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.diag-table thead th {
  background: #F1F5F9;
  color: var(--text-dark);
  padding: 8px 10px;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  white-space: nowrap;
}
.diag-table tbody td { padding: 8px 10px; border-bottom: 1px solid #F1F5F9; white-space: nowrap; }
.diag-table tbody tr:hover { background: #F8FAFC; }
.diag-table tfoot td { padding: 8px 10px; }
.rate-above { color: var(--success); font-weight: 600; }
.rate-below { color: var(--danger); font-weight: 500; }
.diag-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

/* 异常标记 */
.anomaly-row { background: rgba(239, 68, 68, 0.03) !important; }
.anomaly-row:hover { background: rgba(239, 68, 68, 0.06) !important; }
.anomaly-value { color: #DC2626; font-weight: 600; }

/* ============================================================
   三层交互 - 业态最佳实践
   ============================================================ */

/* 第一层：指标 Tab */
.bp-metric-tabs {
  display: flex; gap: 0; padding: 0 32px; margin-bottom: 0;
  background: var(--bg-white); border-bottom: 1px solid var(--border);
}
.bp-metric-tab {
  padding: 12px 24px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 3px solid transparent; cursor: pointer;
  transition: all 0.2s;
}
.bp-metric-tab:hover { color: var(--primary); }
.bp-metric-tab.active {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 700;
  background: #EFF6FF;
}

/* 第一层：卡片网格 */
.bp-card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; padding: 24px 32px;
}
.bp-card {
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; cursor: pointer;
  transition: all 0.25s ease; position: relative;
}
.bp-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.bp-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.bp-card-emoji { font-size: 24px; }
.bp-card-cat { font-size: 16px; font-weight: 700; }
.bp-card-top1 { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.bp-card-top1-info { flex: 1; min-width: 0; }
.bp-top1-label { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 2px; }
.bp-top1-act { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.bp-card-top1-rate { text-align: right; flex-shrink: 0; }
.bp-rate-label { font-size: 11px; color: var(--text-muted); }
.bp-rate-value { font-size: 28px; font-weight: 800; line-height: 1.1; }

/* 迷你柱状图 */
.bp-card-bars { margin-bottom: 12px; }
.bp-bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; }
.bp-bar-rank { width: 32px; color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.bp-bar-track { flex: 1; height: 8px; background: #F1F5F9; border-radius: 4px; overflow: hidden; }
.bp-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.bp-bar-pct { width: 42px; text-align: right; font-weight: 600; color: var(--text-dark); font-size: 12px; flex-shrink: 0; }
.bp-bar-name { width: 80px; color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.bp-bar-empty { color: var(--text-muted); }

.bp-card-link { font-size: 13px; font-weight: 600; text-align: right; cursor: pointer; }
.bp-card-link:hover { text-decoration: underline; }

/* 第二层：Overlay + Drawer */
.bp-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0);
  z-index: 200; transition: background 0.3s;
}
.bp-overlay.show { background: rgba(0,0,0,0.3); }

.bp-drawer {
  position: fixed; top: 0; right: -440px; bottom: 0; width: 440px;
  background: var(--bg-white); z-index: 201; overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1); transition: right 0.3s ease;
}
.bp-drawer.show { right: 0; }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.drawer-title { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.drawer-close {
  width: 32px; height: 32px; border: none; background: #F1F5F9;
  border-radius: 50%; font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text-muted);
}
.drawer-close:hover { background: #E2E8F0; }

.drawer-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.drawer-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
}
.drawer-tab.active { font-weight: 700; }

.drawer-body { padding: 16px 24px; }

.drawer-card {
  background: #FAFBFC; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 14px; cursor: pointer; transition: all 0.2s;
}
.drawer-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: var(--primary-light); }

.drawer-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.drawer-medal { font-size: 24px; }
.drawer-card-info { flex: 1; min-width: 0; }
.drawer-brand { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.drawer-act { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.drawer-metrics {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 12px;
}
.drawer-metric-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 8px; border-radius: 6px; font-size: 12px;
}
.drawer-metric-item.active { background: #EFF6FF; }
.dm-label { color: var(--text-muted); }
.dm-value { font-weight: 500; color: var(--text-dark); }

.drawer-funnel-mini {
  display: flex; align-items: center; gap: 4px;
  background: #F1F5F9; border-radius: 8px; padding: 8px 12px;
}
.funnel-step { text-align: center; flex: 1; }
.funnel-label { display: block; font-size: 10px; color: var(--text-muted); }
.funnel-num { display: block; font-size: 13px; font-weight: 600; color: var(--text-dark); }
.funnel-arrow { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }

/* 渐变漏斗图 */
.drawer-funnel-gradient { display: flex; align-items: center; gap: 2px; padding: 10px 12px; background: #F8FAFC; border-radius: 8px; margin-top: 8px; }
.fg-step { flex-shrink: 1; min-width: 0; }
.fg-bar { border-radius: 6px; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; color: #fff; min-height: 44px; justify-content: center; }
.fg-label { font-size: 10px; font-weight: 600; opacity: 0.9; }
.fg-num { font-size: 12px; font-weight: 700; white-space: nowrap; }
.fg-arrow { color: var(--text-muted); font-size: 8px; flex-shrink: 0; }
.est-mark { font-size: 9px; opacity: 0.8; }
.fg-est-label { text-align: center; font-size: 9px; color: #8C8C8C; margin-top: 2px; cursor: help; }

/* 第三层：模态弹窗 */
.bp-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: background 0.3s;
}
.bp-modal.show { background: rgba(0,0,0,0.5); }

.bp-modal-content {
  background: var(--bg-white); border-radius: 16px; width: 90%; max-width: 900px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.95); opacity: 0; transition: all 0.3s;
}
.bp-modal.show .bp-modal-content { transform: scale(1); opacity: 1; }

.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px 28px 16px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 20px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); }
.modal-close {
  width: 36px; height: 36px; border: none; background: #F1F5F9;
  border-radius: 50%; font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0;
}
.modal-close:hover { background: #E2E8F0; }

.modal-body { display: flex; gap: 0; padding: 24px 28px; align-items: stretch; }
.modal-left { flex: 1; padding-right: 24px; border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.modal-right { flex: 1; padding-left: 24px; display: flex; flex-direction: column; }

/* 漏斗 */
.funnel-full { display: flex; flex-direction: column; align-items: center; gap: 0; flex: 1; justify-content: space-between; }
.funnel-level {
  color: #fff; padding: 16px 20px; text-align: center;
  border-radius: 6px; margin: 0 auto; min-width: 120px;
}
.fl-text { font-size: 14px; font-weight: 600; }
.funnel-transition {
  text-align: center; padding: 8px 0; font-size: 12px;
}
.ft-label { color: var(--text-muted); }
.ft-conv { color: var(--text-dark); font-weight: 500; }
.ft-loss { color: var(--text-muted); }
.est-sup { font-size: 9px; color: #FAAD14; cursor: help; }
.est-tag { cursor: help; }

/* 对比表 */
.cmp-title { font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 16px; }
.cmp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.cmp-table thead th {
  padding: 8px 12px; font-weight: 500; color: var(--text-muted);
  border-bottom: 1px solid var(--border); font-size: 12px;
}
.cmp-table tbody td { padding: 10px 12px; border-bottom: 1px solid #F1F5F9; }
.cmp-label { font-weight: 500; color: var(--text-dark); }
.cmp-val { font-weight: 700; font-size: 15px; }
.cmp-med { color: var(--text-muted); }
.cmp-good { color: var(--success); }
.cmp-bad { color: var(--danger); }
.cmp-diff { font-size: 11px; }
.cmp-note { margin-top: 16px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* ============================================================
   品牌诊断模块
   ============================================================ */
.diag-report { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 24px; margin-top: 16px; }

/* A区 */
.diag-area-a { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.diag-brand-name { font-size: 24px; font-weight: 800; color: var(--text-dark); }
.diag-cat-tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 4px; background: #EFF6FF; color: #1677FF; margin-left: 8px; vertical-align: middle; }
.diag-brand-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.diag-brand-stats { display: flex; gap: 32px; margin-top: 16px; }
.dbs-item { text-align: center; }
.dbs-num { font-size: 20px; font-weight: 700; color: var(--text-dark); }
.dbs-label { font-size: 12px; color: var(--text-muted); }
.diag-health-ring { text-align: center; flex-shrink: 0; }

/* 气泡提示 */
.diag-bubble { padding: 10px 16px; border-radius: 8px; font-size: 13px; margin: 12px 0; }
.diag-bubble-warn { background: #FFF1F0; color: #FF4D4F; border: 1px solid #FFD6D6; }
.diag-bubble-ok { background: #F6FFED; color: #52C41A; border: 1px solid #D9F7BE; }

/* B区 */
.diag-area-b { display: flex; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.diag-radar-wrap { flex-shrink: 0; }
.diag-metrics-table-wrap { flex: 1; min-width: 0; }
.diag-metrics-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.diag-metrics-table th { padding: 8px 10px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 500; }
.diag-metrics-table td { padding: 10px 10px; border-bottom: 1px solid #F1F5F9; }
.diag-metric-row:hover { background: #F8FAFC; }
.diag-metric-row.selected { background: #EFF6FF; border-left: 3px solid #1677FF; }
.diag-row-weak { background: #FFF1F0 !important; }
.diag-status-good { color: #52C41A; font-size: 11px; font-weight: 500; }
.diag-status-bad { color: #FF4D4F; font-size: 11px; font-weight: 500; }

/* C区 */
.diag-area-c { padding: 20px 0; border-bottom: 1px solid var(--border); }
.diag-section-title { font-size: 16px; font-weight: 700; color: var(--text-dark); margin: 0 0 12px; }
.diag-t3-list { display: flex; flex-direction: column; gap: 8px; }
.diag-t3-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #F8FAFC; border-radius: 8px; }
.diag-t3-medal { font-size: 20px; flex-shrink: 0; }
.diag-t3-info { flex: 1; min-width: 0; }
.diag-t3-brand { font-size: 13px; font-weight: 500; }
.diag-t3-val { font-size: 16px; font-weight: 700; color: #1677FF; flex-shrink: 0; }

/* D区 */
.diag-area-d { padding: 20px 0 0; }
.diag-act-list { display: flex; flex-direction: column; gap: 12px; }
.diag-act-card { background: #F8FAFC; border-radius: 8px; padding: 14px 16px; }
.diag-act-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.diag-act-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-bottom: 10px; }
.diag-act-mb { }
.damb-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.damb-bar-wrap { position: relative; height: 6px; background: #E5E7EB; border-radius: 3px; }
.damb-bar { height: 100%; border-radius: 3px; transition: width 0.3s; }
.damb-med { position: absolute; top: -2px; width: 2px; height: 10px; background: #8C8C8C; }
.damb-val { font-size: 11px; margin-top: 2px; }
.diag-act-funnel { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.daf-step { color: #fff; padding: 4px 10px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.daf-arrow { color: var(--text-muted); font-size: 10px; flex-shrink: 0; }

/* 响应式：小屏两列 */
@media (max-width: 1024px) { .bp-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .bp-card-grid { grid-template-columns: 1fr; } .modal-body { flex-direction: column; } .modal-left { border-right: none; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 20px; } .modal-right { padding-left: 0; padding-top: 20px; } }
