:root {
  --navy: #06274a;
  --navy-deep: #021d39;
  --blue: #1f76ff;
  --sky: #36a3ff;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #66758d;
  --line: #e7edf5;
  --red: #e94f62;
  --orange: #f5a623;
  --green: #2fbf71;
  --purple: #7966e8;
  --shadow: 0 10px 28px rgba(20, 45, 80, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: #d7e6ff;
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  overflow-y: auto;
}

.side-brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 5px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.side-brand strong {
  display: block;
  color: #fff;
  line-height: 1.25;
  font-size: 18px;
}

.side-brand small {
  display: block;
  margin-top: 4px;
  color: #a8bbd5;
  font-size: 12px;
}

.side-nav {
  padding: 14px 10px;
}

.side-nav p {
  margin: 22px 10px 8px;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 4px;
  color: #c7d8ef;
  font-size: 15px;
}

.side-nav a.active,
.side-nav a:hover {
  color: #fff;
  background: linear-gradient(90deg, #1474ff, #0c54d8);
}

.side-nav span {
  width: 20px;
  text-align: center;
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  padding: 16px 28px;
  color: #fff;
  background: #06254a;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.topbar p {
  margin: 5px 0 0;
  color: #b6c9e4;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 5px;
  color: #526071;
  background: #fff;
}

.month-picker span {
  color: var(--muted);
  font-size: 13px;
}

.month-picker input {
  width: 130px;
  min-height: 34px;
  border: 0;
  color: var(--text);
  background: transparent;
}

.quick-report {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #052344;
  background: linear-gradient(135deg, #d9f5ff, #65d9ff);
  cursor: pointer;
  font-weight: 800;
}

.quick-nav {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.quick-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  color: #dbeaff;
  font-size: 13px;
}

.quick-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.dashboard {
  padding: 22px 24px 34px;
}

.page-title h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  min-height: 124px;
  padding: 22px 20px;
}

.kpi-card:first-child {
  background:
    radial-gradient(circle at 88% 20%, rgba(0, 229, 255, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(49, 72, 112, 0.92), rgba(7, 18, 37, 0.96));
}

.kpi-card:first-child > div {
  min-width: 0;
  flex: 1;
}

.kpi-card span,
.kpi-card small {
  color: var(--muted);
}

.kpi-card strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1;
}

.kpi-card:first-child strong {
  width: max-content;
  max-width: 100%;
  padding: 8px 12px 9px;
  border: 1px solid rgba(145, 231, 255, 0.2);
  background: linear-gradient(90deg, rgba(0, 213, 255, 0.12), rgba(255, 255, 255, 0.04));
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.05;
  white-space: nowrap;
  text-shadow: 0 0 18px rgba(0, 213, 255, 0.34);
}

.kpi-card em {
  color: var(--red);
  font-style: normal;
}

.kpi-icon {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-style: normal;
  font-weight: 900;
  font-size: 21px;
}

.kpi-card:first-child .kpi-icon {
  align-self: flex-start;
  flex-basis: 46px;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  font-size: 21px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(135deg, #0de0ff, #3868ff 48%, #794bff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -10px 18px rgba(0, 0, 0, 0.25),
    0 0 28px rgba(0, 213, 255, 0.44);
}

.purple { color: #fff; background: rgba(121, 102, 232, 0.92); }
.blue { color: #fff; background: rgba(54, 163, 255, 0.95); }
.red { color: #fff; background: rgba(233, 79, 98, 0.94); }
.gold { color: #fff; background: rgba(245, 166, 35, 0.95); }
.cyan { color: #fff; background: rgba(23, 178, 220, 0.95); }

.panel {
  margin-top: 16px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px 12px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 19px;
}

.panel-heading span,
.panel-heading small {
  color: var(--muted);
  font-weight: 500;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: #176fff;
}

.secondary-btn,
.ghost-btn {
  color: #1f4e8a;
  background: #eef5ff;
  border: 1px solid #cfe0f5;
}

.ai-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.4fr 1.1fr 1.1fr;
  gap: 1px;
  padding: 0 16px 16px;
}

.ai-grid article {
  min-height: 178px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.ai-grid article > span,
.month-judge > span {
  display: block;
  margin-bottom: 12px;
  color: #2f3c50;
  font-weight: 800;
}

.arrow-up {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 8px auto 12px;
  border-radius: 50%;
  color: var(--red);
  background: #fde8ec;
  font-size: 56px;
  line-height: 1;
}

.month-judge {
  text-align: center;
}

.month-judge strong {
  color: var(--red);
  font-size: 22px;
}

.month-judge p {
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.insight-list.compact {
  display: grid;
  gap: 9px;
  max-height: 142px;
  overflow: hidden;
}

.insight-item {
  color: #2f3c50;
  line-height: 1.5;
  font-size: 14px;
}

.insight-item strong {
  display: inline;
  margin-right: 6px;
}

.insight-item p {
  display: inline;
  margin: 0;
  color: var(--muted);
}

.type-breakdown {
  display: grid;
  gap: 10px;
}

.type-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.type-row header {
  display: contents;
}

.type-row header span {
  color: var(--muted);
}

.type-row small {
  display: none;
}

.bar-track {
  height: 7px;
  border-radius: 999px;
  background: #e9eef5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f15d50, #f5a623);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
}

.donut,
.big-donut {
  border-radius: 50%;
  background: conic-gradient(#f05d50 0 34%, #f5a623 34% 59%, #36a3ff 59% 78%, #2fbf71 78% 90%, #c8d0dc 90% 100%);
}

.donut {
  width: 118px;
  height: 118px;
  position: relative;
}

.donut::after,
.big-donut::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #fff;
}

.donut::after {
  inset: 34px;
}

.reason-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
  color: #41506a;
  font-size: 13px;
}

.reason-legend b {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
}

.red-dot { background: #f05d50; }
.orange-dot { background: #f5a623; }
.blue-dot { background: #36a3ff; }
.green-dot { background: #2fbf71; }
.gray-dot { background: #c8d0dc; }

.visual-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1.2fr;
  gap: 16px;
}

.chart-panel {
  background: linear-gradient(180deg, #0b2344, #071a32);
  border-color: #163d6b;
}

.chart-panel .panel-heading {
  color: #eaf6ff;
}

.chart-panel .panel-heading span,
.chart-panel .panel-heading small {
  color: #91b9df;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  padding: 0;
  border-radius: 10px;
  box-sizing: border-box;
}

.donut-panel,
.heatmap-panel,
.progress-panel {
  position: relative;
  overflow: hidden;
}

.donut-panel::before,
.heatmap-panel::before,
.progress-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent, rgba(54, 163, 255, 0.08), transparent);
}

.big-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  margin: 10px auto 24px;
  box-shadow: 0 0 34px rgba(54, 163, 255, 0.18);
}

.big-donut::after {
  inset: 58px;
}

.big-donut > div {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}

.big-donut strong {
  font-size: 22px;
}

.big-donut span {
  color: var(--muted);
  font-size: 12px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 28px 10px;
}

.heat-cell {
  position: relative;
  min-height: 70px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  color: #1b2638;
  text-align: center;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 8px 18px rgba(18, 55, 88, 0.12);
  overflow: hidden;
}

.heat-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.34), transparent 58%);
  pointer-events: none;
}

.heat-cell strong,
.heat-cell small {
  display: block;
}

.heat-cell span {
  font-size: 18px;
}

.heat-cell small {
  color: rgba(27, 38, 56, 0.74);
  font-size: 11px;
}

.pending-cell {
  color: #7b8797;
  background: linear-gradient(135deg, #edf2f7, #dfe8f2) !important;
  box-shadow: none;
}

.heat-legend {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 28px 18px;
  color: var(--muted);
}

.heat-legend span {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #56bf80, #ffd36a, #ef5d50);
}

.heat-legend em {
  font-style: normal;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr;
  gap: 16px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.station-analysis-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
  max-height: 430px;
  overflow: auto;
}

.station-analysis-card {
  position: relative;
  padding: 14px;
  border: 1px solid #dce8f6;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 8px 18px rgba(20, 45, 80, 0.06);
  overflow: hidden;
}

.station-analysis-card.is-open {
  grid-column: 1 / -1;
  border-color: rgba(0, 229, 255, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 0 34px rgba(0, 213, 255, 0.18),
    0 18px 46px rgba(0, 0, 0, 0.35);
}

.station-analysis-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent, rgba(54, 163, 255, 0.08), transparent);
}

.station-analysis-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.station-analysis-card header span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #0d54a8;
  background: #e8f3ff;
  font-weight: 800;
  font-size: 12px;
}

.station-analysis-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.station-analysis-metrics div {
  padding: 8px;
  border-radius: 6px;
  background: #eef6ff;
}

.station-analysis-metrics small {
  display: block;
  color: var(--muted);
}

.station-analysis-metrics b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.station-analysis-card p {
  margin: 12px 0 0;
  color: #526071;
  line-height: 1.55;
  font-size: 13px;
}

.station-detail-btn {
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid rgba(0, 213, 255, 0.28);
  border-radius: 6px;
  color: #c7efff;
  background: linear-gradient(135deg, rgba(0, 116, 255, 0.24), rgba(0, 213, 255, 0.08));
  cursor: pointer;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 18px rgba(0, 213, 255, 0.12);
}

.station-detail-btn:hover {
  color: #fff;
  border-color: rgba(141, 235, 255, 0.55);
  background: linear-gradient(135deg, rgba(0, 116, 255, 0.34), rgba(0, 213, 255, 0.16));
}

.station-deep-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(118, 205, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 213, 255, 0.1), transparent 36%),
    rgba(2, 10, 22, 0.42);
}

.deep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.deep-grid div {
  padding: 8px;
  border: 1px solid rgba(104, 206, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 160, 255, 0.08);
}

.deep-grid small,
.station-deep-panel li span {
  display: block;
  color: #9cb5d3;
  font-size: 12px;
}

.deep-grid b {
  display: block;
  margin-top: 4px;
  color: #f5fbff;
  font-size: 13px;
  line-height: 1.35;
}

.station-deep-panel ul {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.station-deep-panel li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(120, 205, 255, 0.12);
}

.station-deep-panel li b,
.station-deep-panel li em {
  color: #e9f8ff;
  font-style: normal;
  font-size: 12px;
}

.deep-advice {
  color: #b9d8ee !important;
}

.ranking-list {
  padding: 0 18px 18px;
}

.rank-row {
  display: grid;
  grid-template-columns: 48px 1fr 120px 110px 130px;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  color: #273246;
  font-size: 14px;
  transition: background 160ms ease, transform 160ms ease;
}

.rank-row:hover {
  background: linear-gradient(90deg, rgba(31, 118, 255, 0.07), rgba(54, 163, 255, 0.02));
  transform: translateX(2px);
}

.rank-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #176fff, #36d4ff);
  font-weight: 800;
}

.rank-row strong {
  display: block;
}

.rank-row small {
  color: var(--muted);
}

.rank-score {
  color: var(--red);
  font-weight: 800;
}

.progress-panel {
  min-height: 260px;
}

.progress-ring {
  display: grid;
  place-content: center;
  width: 160px;
  height: 160px;
  margin: 12px auto;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 56%, transparent 57%), conic-gradient(#21e6a1 0 90%, #e6edf5 90% 100%);
  text-align: center;
  box-shadow: 0 0 30px rgba(33, 230, 161, 0.18);
}

.progress-ring strong {
  font-size: 34px;
}

.progress-ring span {
  color: var(--muted);
}

.progress-panel p {
  text-align: center;
  color: var(--muted);
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}

.progress-dots span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #21d89d;
  box-shadow: 0 0 10px rgba(33, 216, 157, 0.45);
}

.progress-dots span.missing-dot {
  background: #d8e0ea;
}

.missing strong {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--red);
  background: #fde8ec;
}

.entry-panel,
.records-panel {
  scroll-margin-top: 92px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  border: 1px solid #d8e1ee;
  border-radius: 6px;
  background: #fff;
}

.entry-notice {
  margin: 0 20px 14px;
  padding: 11px 12px;
  color: #276548;
  border-radius: 6px;
  background: #eaf8f1;
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  margin: 0 20px 18px;
  padding: 22px;
  border: 1px dashed rgba(118, 214, 255, 0.45);
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 213, 255, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(7, 25, 48, 0.92), rgba(3, 11, 23, 0.94));
  box-shadow: inset 0 0 32px rgba(0, 213, 255, 0.09), 0 0 28px rgba(0, 140, 255, 0.12);
  overflow: hidden;
}

.upload-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-core {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  max-width: 720px;
  text-align: center;
}

.upload-orbit {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
  border: 1px solid rgba(157, 236, 255, 0.45);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0, 229, 255, 0.18) 0 28%, transparent 30%),
    conic-gradient(from 90deg, transparent, rgba(0, 229, 255, 0.9), transparent 38%);
  box-shadow: 0 0 30px rgba(0, 213, 255, 0.24);
  animation: orbitSpin 4s linear infinite;
}

.upload-orbit::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #9df7ff;
  box-shadow: 0 0 22px rgba(157, 247, 255, 0.8);
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

.upload-core strong {
  color: #f4fbff;
  font-size: 22px;
}

.upload-core small {
  max-width: 660px;
  margin: 10px 0 16px;
  color: #9ebbd8;
  line-height: 1.7;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.upload-zone p {
  position: relative;
  z-index: 2;
  margin: 12px 0 0;
  color: #8feaff;
  font-size: 13px;
}

.upload-beam {
  position: absolute;
  inset: -30% 20%;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.32), transparent),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(157, 247, 255, 0.16) 27px 28px);
  filter: blur(0.2px);
  transform: scaleX(0.2);
  pointer-events: none;
}

.upload-zone.is-dragging {
  border-color: rgba(157, 247, 255, 0.9);
  box-shadow: inset 0 0 42px rgba(0, 213, 255, 0.18), 0 0 36px rgba(0, 213, 255, 0.22);
}

.upload-zone.is-sucking .upload-beam {
  opacity: 1;
  animation: dataSuction 1.2s ease-in-out infinite;
}

.upload-zone.is-sucking .upload-core {
  animation: uploadPulse 0.9s ease-in-out infinite;
}

@keyframes dataSuction {
  0% { transform: scaleX(0.2) translateY(42px); opacity: 0; }
  45% { transform: scaleX(0.88) translateY(0); opacity: 1; }
  100% { transform: scaleX(0.18) translateY(-46px); opacity: 0; }
}

@keyframes uploadPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.upload-manager {
  margin: 0 20px 18px;
  border: 1px solid rgba(118, 214, 255, 0.26);
  background:
    linear-gradient(135deg, rgba(0, 213, 255, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(7, 23, 45, 0.94), rgba(3, 10, 22, 0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 28px rgba(0, 140, 255, 0.12);
}

.upload-manager[hidden] {
  display: none;
}

.upload-manager-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(118, 214, 255, 0.16);
}

.upload-manager-head strong,
.upload-preview header strong {
  display: block;
  color: #f5fbff;
  font-size: 17px;
}

.upload-manager-head small,
.upload-preview header small,
.upload-source-card small,
.upload-source-card span {
  color: #9ebbd8;
}

.upload-manager-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.upload-source-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(118, 214, 255, 0.18);
  background: rgba(5, 17, 34, 0.72);
}

.upload-source-card.active {
  border-color: rgba(0, 229, 255, 0.48);
  box-shadow: inset 0 0 24px rgba(0, 213, 255, 0.1);
}

.upload-source-card strong {
  display: block;
  color: #eaf8ff;
  margin-bottom: 5px;
}

.upload-source-card span {
  display: block;
  margin-top: 7px;
  font-size: 13px;
}

.upload-source-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-preview {
  padding: 0 16px 16px;
}

.upload-preview header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.upload-preview-table {
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(118, 214, 255, 0.16);
}

.upload-preview-table table {
  min-width: 920px;
}

.model-signal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.model-signal {
  padding: 12px;
  border: 1px solid rgba(118, 214, 255, 0.18);
  background: rgba(0, 213, 255, 0.07);
}

.model-signal small,
.model-signal span {
  display: block;
  color: #9ebbd8;
  line-height: 1.5;
}

.model-signal strong {
  display: block;
  margin: 5px 0;
  color: #f6fbff;
  font-size: 22px;
}

.risk-matrix {
  padding: 0 18px 18px;
  overflow-x: auto;
}

.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: 118px repeat(4, minmax(104px, 1fr));
  gap: 8px;
  min-width: 620px;
  align-items: stretch;
}

.matrix-head {
  margin-bottom: 8px;
  color: #9ebbd8;
  font-size: 12px;
  font-weight: 800;
}

.matrix-head span,
.matrix-row strong,
.matrix-row span {
  padding: 10px;
  border: 1px solid rgba(118, 214, 255, 0.14);
  background: rgba(5, 17, 34, 0.6);
}

.matrix-row {
  margin-bottom: 8px;
}

.matrix-row strong {
  color: #eaf8ff;
}

.matrix-row span {
  background:
    linear-gradient(135deg, rgba(0, 229, 255, calc(var(--level) * 0.42)), rgba(48, 105, 255, calc(var(--level) * 0.28))),
    rgba(5, 17, 34, 0.74);
  box-shadow: inset 0 0 18px rgba(0, 213, 255, calc(var(--level) * 0.22));
}

.matrix-row b,
.matrix-row small {
  display: block;
}

.matrix-row b {
  color: #f7fcff;
  font-size: 18px;
}

.matrix-row small {
  margin-top: 4px;
  color: #9ebbd8;
}

.priority-model {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.priority-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 50px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(118, 214, 255, 0.16);
  background: rgba(5, 17, 34, 0.68);
}

.priority-row > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #06121f;
  background: linear-gradient(135deg, #9cf7ff, #39a8ff);
  font-weight: 900;
}

.priority-row strong,
.priority-row em {
  color: #f6fbff;
  font-style: normal;
}

.priority-row small {
  display: block;
  margin: 4px 0 8px;
  color: #9ebbd8;
}

.priority-row i {
  display: block;
  height: 7px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.priority-row i b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #2b6dff);
  box-shadow: 0 0 14px rgba(0, 213, 255, 0.5);
}

.table-wrap {
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #526071;
  background: #f8fafc;
  font-size: 13px;
}

td {
  color: #273246;
  font-size: 14px;
}

td:last-child,
th:last-child {
  min-width: 86px;
}

td:nth-last-child(2),
th:nth-last-child(2) {
  min-width: 220px;
}

.delete-btn {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #ffd0d5;
  border-radius: 6px;
  color: #d9364e;
  background: #fff1f3;
  cursor: pointer;
  font-weight: 700;
}

.delete-btn:hover {
  background: #ffe4e8;
}

.empty-state,
.empty-cell {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    display: none;
  }

  .kpi-grid,
  .visual-grid,
  .bottom-grid,
  .analysis-grid,
  .ai-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .top-actions {
    display: grid;
    align-items: stretch;
  }

  .dashboard {
    padding: 16px;
  }

  .kpi-grid,
  .visual-grid,
  .bottom-grid,
  .analysis-grid,
  .ai-grid,

  .heatmap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .station-analysis-list {
    grid-template-columns: 1fr;
  }

  .deep-grid,
  .station-deep-panel li {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 40px 1fr;
  }

  .rank-score {
    grid-column: 2;
  }

  .upload-manager-head,
  .upload-source-card,
  .upload-preview header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .upload-source-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .model-signal-list {
    grid-template-columns: 1fr;
  }

  .priority-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .priority-row em {
    grid-column: 2;
  }
}

/* Dark industrial technology skin */
:root {
  --bg: #050912;
  --card: rgba(8, 18, 34, 0.82);
  --text: #eaf6ff;
  --muted: #8ea6c3;
  --line: rgba(100, 189, 255, 0.26);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.44);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 180, 255, 0.22), transparent 360px),
    radial-gradient(circle at 78% 0%, rgba(72, 90, 255, 0.18), transparent 420px),
    linear-gradient(180deg, rgba(2, 8, 18, 0.42), rgba(2, 8, 18, 0.92)),
    url("./assets/tech-bg-4k.png") top center / cover no-repeat fixed,
    #050912;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(90, 205, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 205, 255, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, transparent 0 48%, rgba(120, 210, 255, 0.07) 50%, transparent 52% 100%);
  background-size: 42px 42px, 42px 42px, 220px 220px;
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 38%, rgba(0, 213, 255, 0.11) 49%, transparent 58% 100%);
  animation: scanSweep 7s ease-in-out infinite;
}

@keyframes scanSweep {
  0%, 28% { transform: translateX(-120%); opacity: 0; }
  42%, 54% { opacity: 1; }
  78%, 100% { transform: translateX(120%); opacity: 0; }
}

.sidebar,
.topbar {
  background:
    linear-gradient(180deg, rgba(8, 26, 52, 0.86), rgba(3, 11, 24, 0.9)),
    rgba(7, 17, 32, 0.82);
  border-right: 1px solid rgba(103, 197, 255, 0.2);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05), 0 0 40px rgba(0, 153, 255, 0.14);
  backdrop-filter: blur(8px) saturate(1.08);
}

.topbar {
  border-right: 0;
  border-bottom: 1px solid rgba(103, 197, 255, 0.24);
}

.side-brand,
.topbar {
  position: relative;
  overflow: hidden;
}

.side-brand::after,
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 225, 255, 0.85), transparent);
  box-shadow: 0 0 16px rgba(0, 225, 255, 0.7);
}

.dashboard {
  background: linear-gradient(180deg, rgba(6, 12, 24, 0.66), rgba(4, 8, 17, 0.72));
}

.page-title h2,
.panel-heading h3,
.topbar h1,
.side-brand strong {
  color: #f5fbff;
  text-shadow: 0 0 18px rgba(63, 203, 255, 0.22);
}

.kpi-card,
.panel,
.ai-grid article,
.station-analysis-card {
  position: relative;
  color: var(--text);
  border: 1px solid rgba(122, 205, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(13, 31, 56, 0.86), rgba(5, 13, 27, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 18px 46px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 213, 255, 0.06);
  backdrop-filter: blur(7px) saturate(1.1);
  overflow: hidden;
}

.kpi-card::before,
.panel::before,
.station-analysis-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(0, 225, 255, 0.28), transparent 18% 82%, rgba(0, 225, 255, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 38%);
  opacity: 0.55;
}

.kpi-card > *,
.panel > *,
.station-analysis-card > * {
  position: relative;
  z-index: 1;
}

.panel-heading::before,
.kpi-card div::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border-top: 1px solid rgba(178, 235, 255, 0.55);
  border-left: 1px solid rgba(178, 235, 255, 0.55);
  transform: translate(-10px, -8px);
}

.panel-heading,
.kpi-card div {
  position: relative;
}

.kpi-card::after,
.panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: -45%;
  width: 42%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(141, 229, 255, 0.13), transparent);
  animation: panelGlint 8s ease-in-out infinite;
}

@keyframes panelGlint {
  0%, 34% { transform: translateX(0); opacity: 0; }
  46% { opacity: 1; }
  68%, 100% { transform: translateX(360%); opacity: 0; }
}

.kpi-card span,
.kpi-card small,
.panel-heading span,
.panel-heading small,
.rank-row small,
.station-analysis-metrics small,
.station-analysis-card p,
.progress-panel p,
.empty-state,
.empty-cell,
label {
  color: #9cb5d3;
}

.kpi-card strong,
.rank-row strong,
.station-analysis-card header strong,
.big-donut strong,
.progress-ring strong {
  color: #f7fbff;
}

.kpi-icon,
.rank-index {
  border: 1px solid rgba(190, 236, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 0 22px rgba(48, 185, 255, 0.32);
}

.side-nav a {
  border: 1px solid transparent;
}

.side-nav a.active,
.side-nav a:hover {
  background: linear-gradient(90deg, rgba(13, 91, 184, 0.95), rgba(0, 210, 255, 0.32));
  border-color: rgba(120, 221, 255, 0.28);
  box-shadow: inset 0 0 18px rgba(41, 184, 255, 0.22), 0 0 20px rgba(0, 160, 255, 0.12);
}

.month-picker,
input,
select {
  color: #dcefff;
  border: 1px solid rgba(125, 205, 255, 0.28);
  background: linear-gradient(180deg, rgba(12, 29, 53, 0.9), rgba(4, 12, 25, 0.86));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.month-picker span,
input::placeholder {
  color: #88a4c4;
}

.quick-report,
.primary-btn {
  color: #eaffff;
  background: linear-gradient(135deg, #0057ff, #00d5ff);
  box-shadow: 0 0 22px rgba(0, 196, 255, 0.38), inset 0 1px 0 rgba(255,255,255,0.2);
}

.quick-nav,
.secondary-btn,
.ghost-btn {
  border-color: rgba(126, 205, 255, 0.25);
  background: rgba(9, 26, 50, 0.72);
}

.quick-nav a,
.secondary-btn,
.ghost-btn {
  color: #bfe4ff;
}

.ai-grid article,
.month-judge p,
.reason-legend,
.type-row,
.ranking-list,
.table-wrap {
  color: #dcefff;
}

.arrow-up {
  color: #ff6a7c;
  background: radial-gradient(circle, rgba(255, 91, 118, 0.28), rgba(255, 91, 118, 0.08));
  box-shadow: 0 0 28px rgba(255, 91, 118, 0.24);
}

.donut::after,
.big-donut::after {
  background: #081326;
}

.big-donut {
  box-shadow: 0 0 38px rgba(0, 210, 255, 0.28), inset 0 0 20px rgba(255,255,255,0.08);
}

.heat-cell {
  color: #eefaff;
  border-color: rgba(217, 248, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 0 22px rgba(0, 160, 255, 0.18);
}

.heat-cell small {
  color: rgba(240, 250, 255, 0.78);
}

.pending-cell {
  color: #8fb0cd;
  background: linear-gradient(135deg, rgba(20, 39, 66, 0.86), rgba(8, 19, 36, 0.94)) !important;
}

.heat-legend span {
  box-shadow: 0 0 16px rgba(0, 213, 255, 0.22);
}

.rank-row {
  color: #dcefff;
  border-bottom-color: rgba(120, 205, 255, 0.16);
}

.rank-row:hover {
  background: linear-gradient(90deg, rgba(0, 213, 255, 0.12), rgba(72, 90, 255, 0.06));
}

.station-analysis-metrics div {
  background: rgba(0, 160, 255, 0.1);
  border: 1px solid rgba(104, 206, 255, 0.14);
}

.station-analysis-card header span {
  color: #caf4ff;
  background: rgba(0, 213, 255, 0.12);
  border: 1px solid rgba(0, 213, 255, 0.22);
}

.progress-ring {
  background: radial-gradient(circle, #081326 0 56%, transparent 57%), conic-gradient(#00f0b4 0 0%, rgba(80, 103, 129, 0.42) 0% 100%);
  box-shadow: 0 0 34px rgba(0, 240, 180, 0.24), inset 0 0 18px rgba(255,255,255,0.08);
}

.progress-dots span.missing-dot {
  background: rgba(102, 127, 154, 0.5);
  box-shadow: none;
}

th {
  color: #b8dfff;
  background: #091b33;
}

td {
  color: #dbeeff;
  border-bottom-color: rgba(120, 205, 255, 0.14);
}

.delete-btn {
  color: #ffccd4;
  border-color: rgba(255, 105, 128, 0.36);
  background: rgba(255, 67, 98, 0.12);
}

.delete-btn:hover {
  background: rgba(255, 67, 98, 0.2);
}

/* AI narrative report */
.ai-narrative-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 16px 18px;
  padding: 18px;
  min-height: 250px;
  border: 1px solid rgba(138, 220, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(0, 213, 255, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(8, 26, 50, 0.94), rgba(3, 9, 19, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 0 36px rgba(0, 176, 255, 0.16);
  overflow: hidden;
}

.ai-narrative-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 12px),
    linear-gradient(90deg, transparent, rgba(0, 225, 255, 0.11), transparent);
  animation: narrativeScan 7s linear infinite;
}

.ai-narrative-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00e5ff, transparent);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.75);
}

@keyframes narrativeScan {
  from { background-position: 0 0, -220px 0; }
  to { background-position: 0 84px, 420px 0; }
}

.narrative-stage {
  position: relative;
  z-index: 1;
}

.report-space {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.particle-brain {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, 92%);
  height: 250px;
  transform: translate(-50%, -50%);
  opacity: 0;
  filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.45));
}

.particle-brain::before,
.particle-brain::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(156, 247, 255, 0.2);
  border-radius: 48% 52% 44% 50%;
  box-shadow: inset 0 0 26px rgba(0, 213, 255, 0.08), 0 0 22px rgba(0, 213, 255, 0.12);
}

.particle-brain::before {
  left: 46px;
  top: 30px;
  width: 118px;
  height: 128px;
}

.particle-brain::after {
  right: 42px;
  top: 28px;
  width: 128px;
  height: 132px;
}

.particle-brain em {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 4px);
  height: var(--s, 4px);
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 18%, #9cf7ff 22% 58%, rgba(0, 229, 255, 0.12) 62%);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.92), 0 0 34px rgba(43, 109, 255, 0.42);
}

.particle-brain em:nth-child(1) { --x: 25%; --y: 18%; --s: 5px; --dx: -170px; --dy: -80px; }
.particle-brain em:nth-child(2) { --x: 32%; --y: 13%; --s: 4px; --dx: -120px; --dy: -120px; }
.particle-brain em:nth-child(3) { --x: 41%; --y: 15%; --s: 5px; --dx: -60px; --dy: -130px; }
.particle-brain em:nth-child(4) { --x: 51%; --y: 16%; --s: 4px; --dx: 20px; --dy: -135px; }
.particle-brain em:nth-child(5) { --x: 62%; --y: 13%; --s: 5px; --dx: 90px; --dy: -130px; }
.particle-brain em:nth-child(6) { --x: 72%; --y: 19%; --s: 4px; --dx: 160px; --dy: -95px; }
.particle-brain em:nth-child(7) { --x: 19%; --y: 28%; --s: 5px; --dx: -180px; --dy: -20px; }
.particle-brain em:nth-child(8) { --x: 27%; --y: 29%; --s: 4px; --dx: -160px; --dy: 60px; }
.particle-brain em:nth-child(9) { --x: 36%; --y: 27%; --s: 5px; --dx: -90px; --dy: -90px; }
.particle-brain em:nth-child(10) { --x: 46%; --y: 29%; --s: 4px; --dx: -35px; --dy: 95px; }
.particle-brain em:nth-child(11) { --x: 55%; --y: 29%; --s: 5px; --dx: 35px; --dy: -95px; }
.particle-brain em:nth-child(12) { --x: 64%; --y: 27%; --s: 4px; --dx: 95px; --dy: 85px; }
.particle-brain em:nth-child(13) { --x: 73%; --y: 30%; --s: 5px; --dx: 165px; --dy: 35px; }
.particle-brain em:nth-child(14) { --x: 80%; --y: 38%; --s: 4px; --dx: 195px; --dy: -15px; }
.particle-brain em:nth-child(15) { --x: 17%; --y: 42%; --s: 4px; --dx: -210px; --dy: 30px; }
.particle-brain em:nth-child(16) { --x: 26%; --y: 43%; --s: 5px; --dx: -155px; --dy: 125px; }
.particle-brain em:nth-child(17) { --x: 35%; --y: 40%; --s: 4px; --dx: -70px; --dy: -135px; }
.particle-brain em:nth-child(18) { --x: 44%; --y: 43%; --s: 5px; --dx: -20px; --dy: 135px; }
.particle-brain em:nth-child(19) { --x: 53%; --y: 43%; --s: 4px; --dx: 25px; --dy: -130px; }
.particle-brain em:nth-child(20) { --x: 62%; --y: 40%; --s: 5px; --dx: 80px; --dy: 130px; }
.particle-brain em:nth-child(21) { --x: 72%; --y: 43%; --s: 4px; --dx: 160px; --dy: -60px; }
.particle-brain em:nth-child(22) { --x: 83%; --y: 50%; --s: 5px; --dx: 210px; --dy: 60px; }
.particle-brain em:nth-child(23) { --x: 19%; --y: 56%; --s: 5px; --dx: -200px; --dy: -70px; }
.particle-brain em:nth-child(24) { --x: 29%; --y: 56%; --s: 4px; --dx: -145px; --dy: -125px; }
.particle-brain em:nth-child(25) { --x: 38%; --y: 58%; --s: 5px; --dx: -75px; --dy: 110px; }
.particle-brain em:nth-child(26) { --x: 47%; --y: 57%; --s: 4px; --dx: -15px; --dy: -150px; }
.particle-brain em:nth-child(27) { --x: 56%; --y: 57%; --s: 5px; --dx: 20px; --dy: 150px; }
.particle-brain em:nth-child(28) { --x: 65%; --y: 58%; --s: 4px; --dx: 85px; --dy: -115px; }
.particle-brain em:nth-child(29) { --x: 75%; --y: 58%; --s: 5px; --dx: 170px; --dy: 110px; }
.particle-brain em:nth-child(30) { --x: 79%; --y: 67%; --s: 4px; --dx: 205px; --dy: -70px; }
.particle-brain em:nth-child(31) { --x: 23%; --y: 69%; --s: 4px; --dx: -175px; --dy: 110px; }
.particle-brain em:nth-child(32) { --x: 32%; --y: 72%; --s: 5px; --dx: -125px; --dy: -85px; }
.particle-brain em:nth-child(33) { --x: 42%; --y: 75%; --s: 4px; --dx: -50px; --dy: 140px; }
.particle-brain em:nth-child(34) { --x: 51%; --y: 78%; --s: 5px; --dx: 10px; --dy: -145px; }
.particle-brain em:nth-child(35) { --x: 61%; --y: 75%; --s: 4px; --dx: 85px; --dy: 120px; }
.particle-brain em:nth-child(36) { --x: 70%; --y: 70%; --s: 5px; --dx: 160px; --dy: -95px; }
.particle-brain em:nth-child(37) { --x: 39%; --y: 86%; --s: 4px; --dx: -80px; --dy: 150px; }
.particle-brain em:nth-child(38) { --x: 50%; --y: 89%; --s: 5px; --dx: 0; --dy: 155px; }
.particle-brain em:nth-child(39) { --x: 61%; --y: 86%; --s: 4px; --dx: 90px; --dy: 145px; }
.particle-brain em:nth-child(40) { --x: 49%; --y: 25%; --s: 3px; --dx: -15px; --dy: -180px; }
.particle-brain em:nth-child(41) { --x: 50%; --y: 35%; --s: 4px; --dx: 0; --dy: -160px; }
.particle-brain em:nth-child(42) { --x: 50%; --y: 47%; --s: 3px; --dx: 0; --dy: 165px; }
.particle-brain em:nth-child(43) { --x: 50%; --y: 60%; --s: 4px; --dx: 0; --dy: 180px; }
.particle-brain em:nth-child(44) { --x: 46%; --y: 68%; --s: 3px; --dx: -30px; --dy: 170px; }
.particle-brain em:nth-child(45) { --x: 55%; --y: 69%; --s: 3px; --dx: 35px; --dy: 170px; }
.particle-brain em:nth-child(46) { --x: 30%; --y: 22%; --s: 3px; --dx: -150px; --dy: -145px; }
.particle-brain em:nth-child(47) { --x: 36%; --y: 21%; --s: 3px; --dx: -95px; --dy: -165px; }
.particle-brain em:nth-child(48) { --x: 67%; --y: 21%; --s: 3px; --dx: 115px; --dy: -165px; }
.particle-brain em:nth-child(49) { --x: 72%; --y: 25%; --s: 3px; --dx: 165px; --dy: -135px; }
.particle-brain em:nth-child(50) { --x: 23%; --y: 36%; --s: 3px; --dx: -205px; --dy: -10px; }
.particle-brain em:nth-child(51) { --x: 33%; --y: 36%; --s: 3px; --dx: -105px; --dy: -150px; }
.particle-brain em:nth-child(52) { --x: 67%; --y: 36%; --s: 3px; --dx: 120px; --dy: 150px; }
.particle-brain em:nth-child(53) { --x: 76%; --y: 40%; --s: 3px; --dx: 200px; --dy: 0; }
.particle-brain em:nth-child(54) { --x: 25%; --y: 63%; --s: 3px; --dx: -190px; --dy: 85px; }
.particle-brain em:nth-child(55) { --x: 34%; --y: 64%; --s: 3px; --dx: -110px; --dy: 150px; }
.particle-brain em:nth-child(56) { --x: 66%; --y: 64%; --s: 3px; --dx: 115px; --dy: -150px; }
.particle-brain em:nth-child(57) { --x: 75%; --y: 65%; --s: 3px; --dx: 190px; --dy: 95px; }
.particle-brain em:nth-child(58) { --x: 34%; --y: 79%; --s: 3px; --dx: -125px; --dy: 130px; }
.particle-brain em:nth-child(59) { --x: 66%; --y: 79%; --s: 3px; --dx: 125px; --dy: 130px; }
.particle-brain em:nth-child(60) { --x: 50%; --y: 82%; --s: 3px; --dx: 0; --dy: 170px; }

.brainstorm-core {
  position: relative;
  width: 118px;
  height: 84px;
  margin: 18px 0 8px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  background:
    linear-gradient(90deg, transparent 49%, rgba(0, 229, 255, 0.24) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(0, 229, 255, 0.18) 50%, transparent 51%);
  box-shadow: inset 0 0 22px rgba(0, 213, 255, 0.08);
}

.brainstorm-core i,
.brainstorm-core b {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.brainstorm-core i {
  width: 13px;
  height: 13px;
  background: #9df7ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.85);
}

.brainstorm-core i:nth-child(1) { left: 16px; top: 16px; }
.brainstorm-core i:nth-child(2) { right: 18px; top: 20px; }
.brainstorm-core i:nth-child(3) { left: 34px; bottom: 15px; }
.brainstorm-core i:nth-child(4) { right: 30px; bottom: 12px; }

.brainstorm-core b {
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffffff 0 18%, #00e5ff 20% 58%, rgba(0, 229, 255, 0.08) 60%);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.9);
}

.analysis-status {
  width: max-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 7px 11px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  color: #9df4ff;
  background: rgba(0, 213, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.narrative-stage {
  min-width: 0;
  padding: 2px 2px 0;
}

.narrative-lead {
  margin: 0 0 14px;
  padding: 14px 16px;
  color: #dff6ff;
  border: 1px solid rgba(0, 213, 255, 0.18);
  background: rgba(0, 213, 255, 0.08);
  line-height: 1.72;
}

.narrative-scroll {
  max-height: 230px;
  padding: 0 12px 0 0;
  overflow-y: auto;
  scroll-snap-type: y proximity;
}

.narrative-scroll::-webkit-scrollbar {
  width: 8px;
}

.narrative-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.narrative-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00e5ff, #2b6dff);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0, 213, 255, 0.55);
}

.narrative-step {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 0 0 18px;
  scroll-snap-align: start;
}

.narrative-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 42px;
  bottom: 2px;
  width: 1px;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.7), rgba(0, 229, 255, 0.08));
}

.narrative-step > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 34px;
  color: #07101f;
  background: linear-gradient(135deg, #9cf7ff, #39a8ff);
  border: 1px solid rgba(224, 250, 255, 0.7);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(0, 213, 255, 0.35);
}

.narrative-step div {
  padding: 0 0 2px;
}

.narrative-step strong {
  display: block;
  margin-bottom: 6px;
  color: #f7fbff;
  font-size: 16px;
}

.narrative-step p {
  margin: 0;
  color: #aecaeb;
  line-height: 1.7;
}

.ai-summary.is-thinking .ai-narrative-card {
  animation: brainstormGlow 1.6s ease-in-out;
}

.ai-summary.is-thinking .ai-narrative-card::before {
  animation-duration: 2.4s;
}

.ai-summary.is-thinking .narrative-stage::after {
  content: "头脑风暴中";
  position: absolute;
  top: 0;
  right: 0;
  padding: 6px 10px;
  color: #06121f;
  background: linear-gradient(135deg, #9cf7ff, #ffffff);
  border: 1px solid rgba(224, 250, 255, 0.8);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(0, 213, 255, 0.45);
}

.ai-summary.is-thinking .narrative-step > span {
  animation: brainstormNode 0.8s ease-in-out infinite;
}

.ai-summary.is-thinking .report-space {
  opacity: 1;
  animation: spacePulse 1.2s ease-in-out infinite;
}

.ai-summary.is-thinking .particle-brain {
  opacity: 1;
  animation: brainAssemble 0.72s ease-out both, brainHold 1.4s ease-in-out 0.72s infinite;
}

.ai-summary.is-thinking .particle-brain em {
  animation: particleConverge 0.72s cubic-bezier(0.12, 0.82, 0.22, 1) var(--delay, 0s) both, particleFlash 0.56s ease-in-out calc(var(--delay, 0s) + 0.72s) infinite;
}

@keyframes brainstormGlow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 0 36px rgba(0,176,255,0.16); }
  45% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 0 62px rgba(0,229,255,0.38), 0 0 26px rgba(255,255,255,0.18); }
}

@keyframes brainstormPanel {
  0%, 100% { filter: brightness(1); transform: translateY(0); }
  50% { filter: brightness(1.35); transform: translateY(-1px); }
}

@keyframes brainstormCore {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes brainstormNode {
  0%, 100% { filter: brightness(1); transform: translateY(0); }
  50% { filter: brightness(1.45); transform: translateY(-2px); }
}

@keyframes spacePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.55); }
}

@keyframes brainAssemble {
  0% { transform: translate(-50%, -50%) scale(0.92); filter: blur(5px) brightness(2.1); }
  100% { transform: translate(-50%, -50%) scale(1); filter: blur(0) brightness(1.18); }
}

@keyframes brainHold {
  0%, 100% { filter: brightness(1.12); }
  50% { filter: brightness(1.45); }
}

@keyframes particleConverge {
  0% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
  35% { opacity: 1; }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes particleFlash {
  0%, 100% { opacity: 0.58; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.9); }
}

.ai-support-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 1180px) {
  .ai-narrative-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .ai-narrative-card {
    margin: 0 12px 14px;
    padding: 14px;
  }

  .narrative-step {
    grid-template-columns: 52px minmax(0, 1fr);
  }

}

/* Layout polish: keep dense dashboard readable across app-browser widths */
.topbar {
  flex-wrap: wrap;
  align-items: flex-start;
}

.topbar > div:first-child {
  min-width: min(100%, 320px);
}

.top-actions {
  min-width: min(100%, 360px);
}

.quick-nav {
  max-width: 100%;
  overflow-x: auto;
}

.quick-nav a {
  white-space: nowrap;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.kpi-card {
  min-width: 0;
}

.kpi-card > div {
  min-width: 0;
}

.kpi-card strong {
  font-size: clamp(22px, 2vw, 30px);
  overflow-wrap: anywhere;
}

.kpi-card:first-child strong {
  width: 100%;
  white-space: normal;
}

.visual-grid,
.bottom-grid,
.analysis-grid {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

.chart-panel {
  min-width: 0;
  overflow-x: auto;
}

.chart-panel canvas {
  min-width: 0;
}

.risk-matrix {
  overflow-x: auto;
}

.heatmap-grid {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.station-analysis-list {
  max-height: none;
  overflow: visible;
}

.ai-grid,
.ai-support-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel-heading {
  flex-wrap: wrap;
}

.panel-heading h3 {
  min-width: 0;
}

.panel-heading span,
.panel-heading small {
  display: inline-block;
}

.narrative-lead,
.narrative-step p,
.station-analysis-card p {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    display: none;
  }

  .dashboard {
    padding: 16px;
  }

  .topbar {
    padding: 14px 16px;
  }

  .top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .kpi-grid,
  .visual-grid,
  .bottom-grid,
  .analysis-grid,
  .ai-grid,
  .ai-support-grid,
  .station-analysis-list {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: 18px 16px;
  }

  .kpi-icon,
  .kpi-card:first-child .kpi-icon {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .chart-panel canvas {
    min-width: 0;
  }

  .narrative-step {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .narrative-step > span {
    width: 36px;
  }

  .station-analysis-metrics,
  .deep-grid,
  .station-deep-panel li {
    grid-template-columns: 1fr;
  }
}
