/* ── ECharts Container ── */
.echart-container {
  width: 100%;
  min-height: 320px;
  height: clamp(280px, 40vw, 480px);
  margin: 10px 0;
  border-radius: 8px;
  background: #fafbfe;
}

/* ── Chart Wrapper & Toolbar ── */
.chart-wrapper {
  position: relative;
  margin: 10px 0;
}
.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: #f8f9fc;
  border-radius: 8px 8px 0 0;
  border: 1px solid #eef0f5;
  border-bottom: none;
}
.chart-toolbar .tb-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: pointer;
  transition: all .15s;
}
.chart-toolbar .tb-btn:hover { background: rgba(var(--color-primary-rgb),0.1); color: var(--color-primary); }
.chart-toolbar .tb-btn.active { background: rgba(var(--color-primary-rgb),0.12); color: var(--color-primary); }
.chart-toolbar .tb-btn svg { width: 16px; height: 16px; fill: currentColor; }
.chart-toolbar .tb-btn .tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
  background: #333;
  color: #fff;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}
.chart-toolbar .tb-btn .tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #333;
}
.chart-toolbar .tb-btn:hover .tip { display: block; }
.chart-toolbar .tb-sep {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: #ddd;
}
.chart-toolbar .tb-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ── Chart Data Panel ── */
.chart-data-panel {
  display: none;
  border: 1px solid #eef0f5;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  max-height: 300px;
  overflow-y: auto;
}
.chart-data-panel.open { display: block; }
.chart-data-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.chart-data-panel th {
  background: #f0f1f5;
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  position: sticky;
  top: 0;
}
.chart-data-panel td {
  padding: 5px 10px;
  border-top: 1px solid #eee;
  color: #333;
}
.chart-data-panel tr:hover td { background: #fafbfe; }
.chart-data-actions {
  display: flex;
  justify-content: flex-end;
  padding: 6px 10px;
  background: #f8f9fc;
  border-top: 1px solid #eee;
}
.chart-data-actions button {
  font-size: 11px;
  padding: 4px 14px;
  border: none;
  border-radius: 4px;
  background: var(--gradient-primary);
  color: #fff;
  cursor: pointer;
}
