/* Tab Controls */
.tab-controls {
  display: flex;
  gap: 4px;
  background: rgb(31, 41, 55 ,0.5);
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: rgb(59, 130, 246 ,0.2);
  color: #fff;
}

/* Stats View */
.stats-section {
  margin-bottom: 24px;
}

.stats-section h4 {
  margin: 0 0 12px 0;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
}

.stats-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-label {
  width: 80px;
  text-align: right;
  font-size: 0.85rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-bar-bg {
  flex: 1;
  height: 20px;
  background: rgba(51, 65, 85, 0.4);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.stat-bar {
  height: 100%;
  background: rgba(59, 131, 246, 0.3);
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-count {
  width: 40px;
  font-size: 0.85rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* 标签分类颜色 */
.stat-bar.cat-elem {
  background: rgba(14, 164, 233, 0.7);
}

.stat-bar.cat-nation {
  background: rgba(234, 179, 8, 0.7);
}

.stat-bar.cat-weapon {
  background: rgba(239, 68, 68, 0.7);
}

.stat-bar.cat-body {
  background: rgba(34, 197, 94, 0.7);
}

/* 角色条颜色 */
.stat-bar.char-bar {
  background: rgb(105 154 191 / 70%);
}

/* Line Chart */
.line-chart-container {
  width: 100%;
  height: 480px;
  background: rgba(51, 65, 85, 0.2);
  border-radius: 8px;
  padding: 16px 12px 24px 12px;
  box-sizing: border-box;
  position: relative;
}

.line-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.4));
}

.chart-area {
  fill: url(#lineGradient);
  opacity: 0.2;
}

@keyframes revealArea {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

.area-anim {
  animation: revealArea 1s ease forwards;
}

.chart-point {
  fill: #3b82f6;
  stroke: #a6aebc;
  transition: r 0.2s ease;
}

.chart-point:hover {
  r: 6;
}

.chart-axis {
  stroke: #475569;
  stroke-width: 1;
}

.chart-label {
  font-size: 10px;
  fill: #94a3b8;
  text-anchor: middle;
}

.chart-label-y {
  text-anchor: end;
}

.chart-grid {
  stroke: rgba(71, 85, 105, 0.3);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-tooltip {
  position: absolute;
  background: #1e293b;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #334155;
  z-index: 10;
  white-space: nowrap;
}