:root {
  --dash-bg: #0a0f18;
  --dash-card: rgba(29, 45, 66, 0.6);
  --dash-card-border: rgba(157, 198, 228, 0.1);
  --dash-ink: #e8e4df;
  --dash-sub: #8a9ab0;
  --dash-warm: #901204;
  --dash-accent: #d4a04a;
  --dash-sky: #9dc6e4;
  --dash-nang: #e8a83e;
  --dash-line: rgba(157, 198, 228, 0.08);
}

* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100vh; }

body {
  font-family: "Noto Sans SC", sans-serif;
  color: var(--dash-ink);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(144, 18, 4, 0.12), transparent 40%),
    radial-gradient(ellipse at 90% 100%, rgba(157, 198, 228, 0.08), transparent 40%),
    var(--dash-bg);
  overflow-x: hidden;
}

/* ── Header ─────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid var(--dash-line);
  background: rgba(10, 15, 24, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--dash-sub);
  font-size: 0.82rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--dash-card-border);
  border-radius: 999px;
  transition: color 200ms, border-color 200ms;
}

.dash-back:hover {
  color: var(--dash-ink);
  border-color: var(--dash-sky);
}

.dash-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.dash-title span {
  color: var(--dash-accent);
}

.dash-time {
  font-size: 0.78rem;
  color: var(--dash-sub);
  font-variant-numeric: tabular-nums;
}

/* ── Stats Strip ─────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  padding: 1rem clamp(1rem, 2vw, 2rem);
}

.stat-card {
  background: var(--dash-card);
  border: 1px solid var(--dash-card-border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.warm { background: rgba(144, 18, 4, 0.2); color: #e8574a; }
.stat-icon.accent { background: rgba(212, 160, 74, 0.15); color: var(--dash-accent); }
.stat-icon.sky { background: rgba(157, 198, 228, 0.15); color: var(--dash-sky); }
.stat-icon.nang { background: rgba(232, 168, 62, 0.15); color: var(--dash-nang); }

.stat-info {}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--dash-sub);
  margin-top: 0.25rem;
}

/* ── Charts Grid ─────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 0.8rem;
  padding: 0 clamp(1rem, 2vw, 2rem) 1.5rem;
}

.chart-card {
  background: var(--dash-card);
  border: 1px solid var(--dash-card-border);
  border-radius: 14px;
  padding: 1rem;
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.chart-card.span-2 {
  grid-column: span 2;
}

.chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dash-sub);
  letter-spacing: 0.03em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-fullscreen-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--dash-card-border);
  border-radius: 6px;
  background: transparent;
  color: var(--dash-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms, border-color 200ms;
}

.chart-fullscreen-btn:hover {
  color: var(--dash-ink);
  border-color: var(--dash-sky);
}

.chart-body {
  flex: 1;
  min-height: 0;
}

/* ── Progress Bars ───────────────────────── */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.3rem;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--dash-sub);
}

.progress-label span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--dash-ink);
  font-weight: 600;
}

.progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 800ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
}

.progress-fill.warm { background: linear-gradient(90deg, #901204, #ca140d); }
.progress-fill.accent { background: linear-gradient(90deg, #d4a04a, #e8a83e); }
.progress-fill.sky { background: linear-gradient(90deg, #5a9cc0, #9dc6e4); }
.progress-fill.nang { background: linear-gradient(90deg, #c48a28, #e8a83e); }

/* ── Word Cloud (CSS version) ────────────── */
.wordcloud-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  flex: 1;
}

.wc-word {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 200ms;
  cursor: default;
  line-height: 1.3;
}

.wc-word:hover {
  background: rgba(212, 160, 74, 0.15);
}

/* ── Region Map (SVG scatter) ────────────── */
.region-map-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.region-map-wrap svg {
  width: 100%;
  max-height: 220px;
}

.map-dot {
  transition: r 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.map-dot.active {
  filter: drop-shadow(0 0 4px var(--dash-accent));
}

/* ── Fullscreen ──────────────────────────── */
.chart-card:fullscreen,
.chart-card:-webkit-full-screen {
  background: var(--dash-bg);
  border-radius: 0;
  padding: 2rem;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card.span-2 { grid-column: span 1; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .dash-title { font-size: 0.9rem; }
  .stat-value { font-size: 1.2rem; }
}
