/* insights.css — 数据透视页面样式（G7）作者：玲玲 */
.insights-container { padding: 20px; max-width: 1200px; }
.insights-tab-bar { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; }
.insights-tab-btn { padding: 8px 18px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: #6b7280; transition: all .15s; position: relative; bottom: -2px; }
.insights-tab-btn:hover { background: #f3f4f6; color: #374151; }
.insights-tab-btn.active { background: #fff; border-color: #e5e7eb; color: #1f2937; font-weight: 600; border-bottom-color: #fff; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; text-align: center; }
.kpi-card .kpi-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.kpi-card .kpi-label { font-size: 12px; color: #6b7280; margin-top: 4px; }
.kpi-card .kpi-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* SVG chart containers */
.chart-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.chart-box { flex: 1; min-width: 300px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.chart-box h4 { margin: 0 0 10px; font-size: 14px; color: #374151; }

/* Tag health table / anomaly table */
.health-table, .anomaly-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.health-table th, .anomaly-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid #e5e7eb; font-weight: 600; color: #6b7280; font-size: 12px; white-space: nowrap; }
.health-table td, .anomaly-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.health-table tr:hover td, .anomaly-table tr:hover td { background: #f9fafb; }
.health-table .th-sort { cursor: pointer; user-select: none; }
.health-table .th-sort:hover { color: #1f2937; }
.tags-color-dot-sm { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 4px; border: 1px solid rgba(0,0,0,.1); }
.source-badge { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.source-badge.system { background: #eff6ff; color: #3b82f6; }
.source-badge.custom { background: #f0fdf4; color: #16a34a; }

/* Anomaly sub-tabs */
.anomaly-cat-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.anomaly-cat-btn { padding: 5px 14px; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 500; transition: all .15s; }
.anomaly-cat-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Drill-down clickable */
.drill-link { color: #2563eb; cursor: pointer; font-weight: 600; }
.drill-link:hover { text-decoration: underline; }
.tag-name-link { color: #374151; cursor: pointer; }
.tag-name-link:hover { color: #2563eb; text-decoration: underline; }

/* Sub-tab for movie/tv in health */
.sub-tab-bar { display: flex; gap: 4px; margin-bottom: 12px; }
.sub-tab-btn { padding: 4px 14px; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; font-size: 12px; color: #6b7280; }
.sub-tab-btn.active { background: #f3f4f6; color: #1f2937; font-weight: 600; }

/* Trend charts */
.trend-chart-container { display: flex; flex-direction: column; gap: 20px; }
.trend-chart-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.trend-chart-box h4 { margin: 0 0 10px; font-size: 14px; color: #374151; }

/* Insight loading/error */
.insights-loading { padding: 40px; text-align: center; color: #94a3b8; }
.insights-error { padding: 40px; text-align: center; color: #dc2626; }

/* Export CSV button in resources actions */
.btn-csv-export { display: inline-flex; align-items: center; gap: 4px; }

/* Trend sub-tab for movie/tv */
.trend-sub-tab { display: flex; gap: 4px; margin-bottom: 12px; }


/* G7-fix2: 富集异常 Tab 顶部工具栏 + 多选 */
.anomaly-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 0; margin-bottom: 8px;
  border-bottom: 1px dashed #e5e7eb;
}
.anomaly-btn-primary {
  padding: 8px 18px; border: none; border-radius: 6px; cursor: pointer;
  background: #2563eb; color: #fff; font-size: 13px; font-weight: 600;
}
.anomaly-btn-primary:hover { background: #1d4ed8; }
.anomaly-btn-action {
  padding: 8px 16px; border: 1px solid #2563eb; border-radius: 6px; cursor: pointer;
  background: #fff; color: #2563eb; font-size: 13px; font-weight: 500;
}
.anomaly-btn-action:hover { background: #eff6ff; }
.anomaly-btn-secondary {
  padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer;
  background: #fff; color: #6b7280; font-size: 13px;
}
.anomaly-btn-secondary:hover { background: #f3f4f6; }
.anomaly-toolbar-tip {
  margin-left: auto; color: #9ca3af; font-size: 12px;
}
.anomaly-table input[type=checkbox] { cursor: pointer; }
