﻿:root {
  --bg: #030712;
  --panel: #0b1220;
  --panel-soft: #111a2d;
  --text: #f3f7ff;
  --muted: #9fb3d8;
  --line: #22314f;
  --green: #3ddc97;
  --yellow: #f8c74e;
  --red: #ff6f61;
  --gray: #8492a8;
  --accent: #58a6ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #173560, transparent 35%), radial-gradient(circle at 90% 0%, #2a2358, transparent 35%), var(--bg);
  min-height: 100vh;
}

.bg-orb { position: fixed; width: 40vw; height: 40vw; pointer-events: none; border-radius: 50%; filter: blur(80px); opacity: 0.15; }
.orb-a { top: -12vw; right: -10vw; background: #56d3ff; }
.orb-b { bottom: -15vw; left: -12vw; background: #ff8fa3; }

.app-shell { width: min(1100px, 100%); margin: 0 auto; padding: 1rem 1rem 2rem; position: relative; z-index: 2; }

.hero {
  display: flex; flex-direction: column; gap: 0.9rem; padding: 1rem;
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(130deg, rgba(11, 18, 32, 0.96), rgba(17, 26, 45, 0.9));
  box-shadow: 0 10px 30px rgba(2, 8, 23, 0.45);
}

.eyebrow { margin: 0; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
h1 { margin: 0.2rem 0; font-size: clamp(1.35rem, 4.4vw, 2rem); line-height: 1.2; }
.sub { margin: 0; color: var(--muted); font-size: 0.95rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; }

.chip { margin: 0; display: inline-flex; align-items: center; gap: 0.4rem; border-radius: 999px; padding: 0.35rem 0.7rem; font-size: 0.8rem; font-weight: 700; }
.chip::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.chip-neutral { color: var(--gray); background: rgba(132, 146, 168, 0.18); }
.chip-live { color: var(--green); background: rgba(61, 220, 151, 0.18); }
.chip-polling { color: var(--yellow); background: rgba(248, 199, 78, 0.2); }

.meta-text { margin: 0; color: var(--muted); font-size: 0.84rem; }
.section { margin-top: 1rem; }
.section h2 { margin: 0 0 0.65rem; font-size: 1.05rem; }

.overall-card,
.dimension-card,
.indicator-card,
.chart-card,
.allocation-grid > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(11, 18, 32, 0.96), rgba(17, 26, 45, 0.92));
  box-shadow: 0 10px 30px rgba(2, 8, 23, 0.45);
}

.overall-card { padding: 0.9rem; display: grid; gap: 0.7rem; }
.overall-status { margin: 0.2rem 0 0; font-size: 1.2rem; font-weight: 900; text-transform: uppercase; }
.strategy-mode { margin: 0.2rem 0; font-weight: 700; }
.strategy-text { margin: 0; color: var(--muted); font-size: 0.88rem; }
.label { margin: 0; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }

.dimension-grid,
.indicator-grid,
.allocation-grid { display: grid; gap: 0.7rem; }

.dimension-card { padding: 0.85rem; }
.dimension-name { margin: 0; color: var(--muted); font-size: 0.82rem; }
.dimension-status { margin: 0.35rem 0; font-size: 1rem; font-weight: 800; }
.dimension-msg { margin: 0; color: var(--muted); font-size: 0.85rem; }

.indicator-card { padding: 0.75rem; cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease; }
.indicator-card:focus,
.indicator-card:hover,
.indicator-card.active { border-color: var(--accent); transform: translateY(-1px); }

.indicator-top { display: flex; justify-content: space-between; gap: 0.6rem; }
.indicator-name { margin: 0; font-size: 0.86rem; font-weight: 700; }
.indicator-badge { font-size: 0.72rem; padding: 0.15rem 0.45rem; border-radius: 999px; border: 1px solid var(--line); }
.indicator-value { margin: 0.45rem 0 0.15rem; font-size: 1.3rem; font-weight: 900; }
.indicator-meta { margin: 0; color: var(--muted); font-size: 0.78rem; }
.sparkline { width: 100%; height: 56px; margin-top: 0.5rem; opacity: 0.95; }

.detail-wrap { overflow: hidden; }
.detail-head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; margin-bottom: 0.55rem; }
.range-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.range-btn { border: none; background: transparent; color: var(--muted); padding: 0.35rem 0.7rem; font-weight: 700; }
.range-btn.active { color: var(--text); background: rgba(88, 166, 255, 0.22); }

.chart-card { padding: 0.75rem; }
#detailChart {
  width: 100%; height: 220px; display: block;
  background: rgba(2, 8, 23, 0.45);
  border: 1px solid rgba(88, 166, 255, 0.18);
  border-radius: 10px;
}
.chart-meta { margin-top: 0.55rem; color: var(--muted); font-size: 0.84rem; }

.allocation-grid > div { padding: 0.8rem; }
.allocation-title { margin: 0; color: var(--muted); font-size: 0.8rem; }
.allocation-value { margin: 0.3rem 0 0; font-size: 1.25rem; font-weight: 900; }
.risk-trigger { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.85rem; }

.color-green { color: var(--green); }
.color-yellow { color: var(--yellow); }
.color-red { color: var(--red); }
.color-gray { color: var(--gray); }

@media (min-width: 720px) {
  .app-shell { padding: 1.4rem 1.4rem 2.4rem; }
  .hero { padding: 1.2rem; flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .overall-card { grid-template-columns: 1fr 1.4fr; }
  .dimension-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .indicator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .allocation-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .indicator-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
