:root {
  --page: #f4f8ff;
  --page-accent: #dbeafe;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: #f7fbff;
  --border: rgba(110, 150, 195, 0.24);
  --shadow: 0 22px 60px rgba(34, 74, 128, 0.12);
  --text: #16324f;
  --muted: #5f7895;
  --muted-strong: #3f5d7f;
  --brand: #2d7ff9;
  --brand-soft: #e6f0ff;
  --accent: #73b6ff;
  --success: #18a874;
  --danger: #e46363;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(115, 182, 255, 0.25), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 72px;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 0% 0%, rgba(115, 182, 255, 0.22), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(45, 127, 249, 0.12), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(132, 163, 204, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 163, 204, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0) 100%);
}

a {
  color: inherit;
}

.page-shell {
  width: min(1480px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card,
.control-card,
.summary-card,
.panel,
.config-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-card,
.control-card,
.summary-card,
.panel {
  border-radius: var(--radius-xl);
}

.hero-card {
  padding: 28px 32px;
  background:
    radial-gradient(circle at 88% 18%, rgba(115, 182, 255, 0.22), transparent 18%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.95) 0%, rgba(237, 246, 255, 0.92) 100%);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -54px;
  bottom: -54px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 127, 249, 0.16) 0%, rgba(45, 127, 249, 0) 68%);
}

.eyebrow,
.panel-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-card h1,
.config-card h3 {
  margin: 10px 0 12px;
  font-size: clamp(36px, 4vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.subtitle,
.panel-desc,
.help,
.summary-sub,
.panel-note,
.panel-footnote,
.control-copy p {
  color: var(--muted);
}

.subtitle {
  max-width: 900px;
  margin: 0;
  font-size: 17px;
  line-height: 1.82;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.pill {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(123, 156, 200, 0.26);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted-strong);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pill.is-loading {
  border-color: rgba(45, 127, 249, 0.3);
  color: var(--brand);
}

.pill.is-ok {
  border-color: rgba(24, 168, 116, 0.24);
  color: var(--success);
}

.pill.is-error {
  border-color: rgba(228, 99, 99, 0.22);
  color: var(--danger);
}

.control-card {
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 248, 255, 0.94) 100%);
}

.control-copy h2 {
  margin: 8px 0 10px;
  font-size: 24px;
  line-height: 1.1;
}

.control-copy p,
.panel-desc,
.help {
  margin: 0;
  line-height: 1.8;
  font-size: 14px;
}

.field label,
.config-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted-strong);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border-radius: 14px;
  border: 1px solid rgba(123, 156, 200, 0.24);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
  border-color: rgba(45, 127, 249, 0.55);
  box-shadow: 0 0 0 4px rgba(45, 127, 249, 0.12);
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(135deg, #2d7ff9 0%, #59a8ff 100%);
  box-shadow: 0 14px 26px rgba(45, 127, 249, 0.18);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(123, 156, 200, 0.24);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.summary-card {
  min-height: 178px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 250, 255, 0.92) 100%);
}

.summary-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -24px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(115, 182, 255, 0.16) 0%, rgba(115, 182, 255, 0) 72%);
}

.summary-label {
  font-size: 15px;
  color: var(--muted-strong);
}

.summary-value {
  margin-top: 18px;
  font-size: clamp(34px, 3vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.summary-sub {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.7;
}

.tone-blue {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 247, 255, 0.94) 100%);
}

.tone-cyan {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 251, 248, 0.96) 100%);
}

.tone-ice {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 246, 255, 0.96) 100%);
}

.tone-sky {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(234, 244, 255, 0.96) 100%);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.panel {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(246, 251, 255, 0.94) 100%);
}

.panel-span-7 {
  grid-column: span 7;
}

.panel-span-6 {
  grid-column: span 6;
}

.panel-span-5 {
  grid-column: span 5;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.panel h2 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.panel-note {
  max-width: 280px;
  font-size: 13px;
  line-height: 1.65;
  text-align: right;
}

.panel-desc {
  margin-top: 12px;
  font-size: 14px;
}

.panel-footnote {
  margin-top: 14px;
  font-size: 13px;
}

.chart {
  margin-top: 18px;
  min-height: 260px;
}

.chart-shell {
  border-radius: 20px;
  border: 1px solid rgba(123, 156, 200, 0.18);
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.92) 0%, rgba(255, 255, 255, 0.92) 100%);
  padding: 18px;
}

.chart-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 18px;
  border: 1px dashed rgba(123, 156, 200, 0.26);
  background: rgba(255, 255, 255, 0.74);
}

.chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted-strong);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-swatch.primary {
  background: linear-gradient(180deg, #2d7ff9 0%, #73b6ff 100%);
}

.legend-swatch.secondary {
  background: linear-gradient(180deg, #ff9f7d 0%, #ffb59c 100%);
}

.bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 200px;
}

.bar-group {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-items: end;
}

.bar-value {
  text-align: center;
  font-size: 12px;
  color: var(--muted-strong);
  white-space: nowrap;
}

.bar-stack {
  position: relative;
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bar {
  width: 100%;
  min-height: 5px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #2d7ff9 0%, #73b6ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.bar-secondary {
  position: absolute;
  inset: auto 22% 0;
  min-height: 5px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #ff9f7d 0%, #ffc1aa 100%);
}

.bar-label {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.mini-grid-tight {
  margin-top: 18px;
}

.mini-card {
  min-height: 120px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(123, 156, 200, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 249, 255, 0.96) 100%);
}

.mini-title {
  color: var(--muted);
  font-size: 14px;
}

.mini-value {
  margin-top: 18px;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.table-wrap {
  margin-top: 18px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(123, 156, 200, 0.16);
  background: rgba(255, 255, 255, 0.88);
}

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

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(248, 251, 255, 0.98);
  color: var(--muted-strong);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(123, 156, 200, 0.12);
}

tbody tr:hover {
  background: rgba(235, 244, 255, 0.7);
}

tbody td {
  color: var(--text);
  font-size: 14px;
  vertical-align: top;
}

.empty-row td {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
}

.mono {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.config-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(225, 236, 252, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.config-card {
  width: min(560px, 100%);
  padding: 30px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(115, 182, 255, 0.18), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.98) 100%);
}

.config-card h3 {
  font-size: 40px;
}

.config-card p {
  margin: 0 0 20px;
  line-height: 1.8;
  color: var(--muted);
}

body.is-authenticated .config-mask {
  display: none;
}

.mps-beian-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-top: 1px solid rgba(123, 156, 200, 0.18);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted-strong);
  font-size: 13px;
}

.mps-beian-footer a {
  text-decoration: none;
}

.mps-beian-footer a:hover {
  text-decoration: underline;
}

.mps-beian-logo {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 auto;
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: 1fr;
  }

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

  .panel-span-7,
  .panel-span-6,
  .panel-span-5 {
    grid-column: span 6;
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 22px;
  }

  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .panel-span-7,
  .panel-span-6,
  .panel-span-5 {
    grid-column: auto;
  }

  .hero-card,
  .control-card,
  .summary-card,
  .panel,
  .config-card {
    border-radius: 22px;
  }

  .hero-card,
  .control-card,
  .summary-card,
  .panel,
  .config-card {
    padding: 20px;
  }

  .hero-card h1,
  .config-card h3 {
    font-size: 34px;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .status-row {
    gap: 10px;
  }

  .pill {
    width: 100%;
    justify-content: center;
  }
}
