/* ============================================================
   数据分析中心 · NJMEINIAN DATA HUB
   Design: deep-navy mission console + pale-blue glow
   ============================================================ */

:root {
  --bg-0: #050B16;
  --bg-1: #0A1526;
  --panel: rgba(13, 28, 52, 0.72);
  --panel-solid: #0D1C34;
  --line: rgba(110, 170, 255, 0.16);
  --line-strong: rgba(110, 170, 255, 0.30);
  --blue: #62B6FF;
  --blue-soft: #8FD3FF;
  --blue-deep: #2E7BFF;
  --cyan: #4FE3FF;
  --text: #EAF2FF;
  --muted: #8FA6C4;
  --faint: #5A7091;
  --good: #3DDC97;
  --warn: #FFB454;
  --alert: #FF7A85;
  --radius: 16px;
  --shadow: 0 18px 48px rgba(2, 8, 20, 0.55);
  --font: "Segoe UI", -apple-system, "PingFang SC", "Microsoft YaHei",
          "HarmonyOS Sans SC", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Code", Consolas, "SF Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
strong { font-weight: 600; }

.wrap {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

/* ============ background scene ============ */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(46, 123, 255, 0.16), transparent 62%),
    radial-gradient(900px 480px at 8% 12%, rgba(79, 227, 255, 0.09), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 52%, #040911 100%);
}
#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.bg-glow-a {
  width: 520px; height: 520px; top: -140px; right: -120px;
  background: rgba(46, 123, 255, 0.18);
}
.bg-glow-b {
  width: 420px; height: 420px; top: 42%; left: -160px;
  background: rgba(79, 227, 255, 0.10);
}

/* ============ topbar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  background: rgba(6, 13, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { flex: none; filter: drop-shadow(0 0 12px rgba(79, 227, 255, 0.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.06em;
  font-weight: 650;
}
.brand-text span {
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--faint);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}
.clock {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--blue-soft);
  font-variant-numeric: tabular-nums;
}

/* ============ hero ============ */
.hero {
  padding: 62px 0 24px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--blue);
  border: 1px solid var(--line-strong);
  background: rgba(98, 182, 255, 0.08);
  padding: 7px 16px;
  border-radius: 999px;
}
.tick {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.hero-title {
  margin-top: 22px;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.18;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(92deg, var(--blue-soft) 0%, var(--cyan) 52%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 42px rgba(79, 227, 255, 0.25);
}
.hero-sub {
  margin-top: 18px;
  max-width: 720px;
  color: var(--muted);
  font-size: 15.5px;
}
/* ============ sections ============ */
.section { padding: 34px 0 18px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.section-head h2 {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sec-no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  border: 1px solid rgba(79, 227, 255, 0.35);
  background: rgba(79, 227, 255, 0.10);
  border-radius: 6px;
  padding: 3px 8px;
}
.section-desc {
  color: var(--muted);
  font-size: 13.5px;
}
.section-desc strong { color: var(--blue-soft); }

/* ============ portal cards ============ */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.portal-grid-wide {
  grid-template-columns: repeat(2, 1fr);
}
.portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 18px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}
.portal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(98, 182, 255, 0.12), transparent 42%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.portal-card:hover {
  transform: translateY(-6px);
  border-color: rgba(98, 182, 255, 0.55);
  box-shadow: 0 22px 54px rgba(20, 90, 200, 0.30), 0 0 0 1px rgba(98, 182, 255, 0.18) inset;
}
.portal-card:hover::before { opacity: 1; }
.portal-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.portal-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--blue-soft);
  border: 1px solid var(--line-strong);
  background: rgba(98, 182, 255, 0.10);
}
.portal-icon svg { width: 26px; height: 26px; }
.icon-yy { color: #7DE0FF; background: rgba(79, 227, 255, 0.12); }
.icon-qw { color: #7DD3FC; background: rgba(125, 211, 252, 0.12); }
.icon-26 { color: #FFB454; background: rgba(255, 180, 84, 0.12); }
.icon-27 { color: #8FA8FF; background: rgba(143, 168, 255, 0.13); }
.icon-khfj { color: #3DDC97; background: rgba(61, 220, 151, 0.12); }
.icon-khqa { color: #A78BFA; background: rgba(167, 139, 250, 0.12); }

.portal-card h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.45;
}
.portal-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.72;
  flex: 1;
}
.portal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 14px;
  border-top: 1px dashed rgba(110, 170, 255, 0.18);
}
.portal-url {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.portal-go {
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.portal-go i {
  font-style: normal;
  transition: transform 0.25s ease;
}
.portal-card:hover .portal-go i { transform: translate(3px, -3px); }

/* ============ KPI ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.kpi {
  position: relative;
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  top: 0; left: 22px; right: 22px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, rgba(98, 182, 255, 0.75), transparent);
}
.kpi-alert::after {
  background: linear-gradient(90deg, transparent, rgba(255, 122, 133, 0.8), transparent);
}
.kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.10em;
}
.kpi-label span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.kpi-num {
  margin-top: 12px;
  font-size: 33px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.kpi-num i {
  font-style: normal;
  font-size: 15px;
  font-weight: 500;
  color: var(--blue);
  margin-left: 6px;
}
.kpi-alert .kpi-num { color: var(--alert); }
.kpi-alert .kpi-num i { color: var(--alert); opacity: 0.8; }
.kpi-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--faint);
}
.kpi-sub b { color: var(--blue-soft); font-weight: 600; }
.kpi-bar {
  margin-top: 14px;
  height: 5px;
  border-radius: 999px;
  background: rgba(110, 170, 255, 0.12);
  overflow: hidden;
}
.kpi-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-deep), var(--cyan));
  box-shadow: 0 0 12px rgba(79, 227, 255, 0.45);
}
.kpi-alert .kpi-bar span {
  background: linear-gradient(90deg, #C2415A, var(--alert));
  box-shadow: 0 0 12px rgba(255, 122, 133, 0.4);
}

/* ============ board panels ============ */
.board-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 16px;
  margin-top: 16px;
}
.panel-full {
  margin-top: 16px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.panel-head h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.panel-head p {
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* donut */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  flex: 1;
}
.donut {
  width: 180px;
  height: 180px;
  flex: none;
}
.donut-track {
  fill: none;
  stroke: rgba(110, 170, 255, 0.10);
  stroke-width: 18;
}
.donut-seg {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
  transform: rotate(-90deg);
  transform-origin: 90px 90px;
}
/* 几何由 JS/HTML 属性决定；此处仅定义各数据源颜色 */
.seg-dg { stroke: var(--blue-deep); }
.seg-zx { stroke: var(--cyan); }
.seg-zf { stroke: var(--warn); }
.donut-center-l {
  text-anchor: middle;
  fill: var(--faint);
  font-size: 12px;
  font-family: var(--font);
}
.donut-center-v {
  text-anchor: middle;
  fill: var(--text);
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font);
}

.legend {
  list-style: none;
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sw {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex: none;
}
.sw-dg { background: var(--blue-deep); box-shadow: 0 0 10px rgba(46, 123, 255, 0.6); }
.sw-zx { background: var(--cyan); box-shadow: 0 0 10px rgba(79, 227, 255, 0.55); }
.sw-zf { background: var(--warn); box-shadow: 0 0 10px rgba(255, 180, 84, 0.5); }
.legend div { flex: 1; line-height: 1.35; }
.legend b { display: block; font-size: 13.5px; font-weight: 600; }
.legend small {
  display: block;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.legend em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--blue-soft);
}

.mini-stats {
  margin-top: auto;
  padding-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mini-stats div {
  background: rgba(110, 170, 255, 0.07);
  border: 1px solid rgba(110, 170, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
}
.mini-stats span {
  display: block;
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.06em;
}
.mini-stats b {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mini-stats small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.legend .dim {
  opacity: 0.72;
}

/* flow */
.flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.flow-node {
  flex: 1;
  min-width: 110px;
  background: rgba(98, 182, 255, 0.09);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
}
.flow-node-ghost {
  background: rgba(255, 180, 84, 0.08);
  border-color: rgba(255, 180, 84, 0.28);
}
.flow-label {
  display: block;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.12em;
}
.flow-node b {
  display: block;
  margin-top: 6px;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.flow-node small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.flow-arrow {
  width: 74px;
  text-align: center;
  position: relative;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
}
.flow-arrow::before {
  content: "";
  position: absolute;
  top: calc(50% + 9px);
  left: 4px; right: 4px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}
.flow-arrow::after {
  content: "";
  position: absolute;
  top: calc(50% + 9px);
  right: 4px;
  width: 6px; height: 6px;
  border-top: 1.5px solid var(--cyan);
  border-right: 1.5px solid var(--cyan);
  transform: translateY(-50%) rotate(45deg);
}
.flow-arrow-2::before { background: linear-gradient(90deg, transparent, var(--warn)); }
.flow-arrow-2::after { border-color: var(--warn); }
.flow-arrow-2 { color: var(--warn); }
.flow-arrow span {
  position: relative;
  display: inline-block;
  padding: 0 4px;
  z-index: 1;
}

.scope-note {
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.8;
  border-left: 2px solid rgba(98, 182, 255, 0.35);
  padding-left: 12px;
}

/* rules */
.rule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.rule-list li {
  position: relative;
  padding: 10px 12px 10px 38px;
  background: rgba(110, 170, 255, 0.055);
  border: 1px solid rgba(110, 170, 255, 0.10);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
}
.rule-list li::before {
  content: "›";
  position: absolute;
  left: 13px;
  top: 8px;
  color: var(--cyan);
  font-size: 16px;
  font-weight: 700;
}
.rule-list b {
  color: var(--blue-soft);
  margin-right: 8px;
  font-weight: 620;
}

/* ============ footer ============ */
.footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: rgba(5, 11, 22, 0.6);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 26px 0;
}
.footer p {
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 12px;
  color: var(--muted);
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--cyan); }

/* ============ board controls: campaign switch / refresh ============ */
.section-head-board {
  align-items: flex-start;
}
.board-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.seg-camp {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: rgba(13, 28, 52, 0.8);
  border: 1px solid var(--line-strong);
  gap: 4px;
}
.camp-btn,
.angle-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.camp-btn:hover,
.angle-btn:hover { color: var(--text); }
.camp-btn.is-active,
.angle-btn.is-active {
  color: #061224;
  background: linear-gradient(120deg, var(--blue-soft), var(--cyan));
  border-color: rgba(79, 227, 255, 0.55);
  box-shadow: 0 6px 18px rgba(79, 227, 255, 0.28);
}
.tier-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: auto;
}
.tier-controls .camp-btn,
.tier-controls .angle-btn {
  padding: 7px 13px;
  font-size: 12px;
}
.btn-refresh {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 28, 52, 0.8);
  color: var(--muted);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 11px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn-refresh:hover {
  color: var(--cyan);
  border-color: rgba(79, 227, 255, 0.5);
}
.btn-refresh.is-spinning svg {
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* notice bar */
.notice-bar {
  margin: -6px 0 16px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 180, 84, 0.32);
  background: rgba(255, 180, 84, 0.10);
  color: #FFD9A6;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* loading state */
.kpi-grid, .section-head-board {
  transition: opacity 0.22s ease;
}
.kpi-grid.is-loading, .section-head-board.is-loading {
  opacity: 0.55;
}

/* ============ tier analysis (卡种分析) ============ */
.tier-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tier-row {
  display: grid;
  grid-template-columns: 78px 1fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(110, 170, 255, 0.055);
  border: 1px solid rgba(110, 170, 255, 0.10);
}
.tier-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tier-metric { min-width: 0; }
.tier-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.tier-head span {
  font-size: 10px;
  color: var(--faint);
  letter-spacing: 0.12em;
}
.tier-head b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tier-head em {
  font-style: normal;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--blue-soft);
}
.tier-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(110, 170, 255, 0.10);
  overflow: hidden;
}
.tier-bar i {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-deep), var(--cyan));
  box-shadow: 0 0 10px rgba(79, 227, 255, 0.35);
}
.tier-bar-cnt i {
  background: linear-gradient(90deg, rgba(79, 227, 255, 0.55), var(--blue-soft));
  box-shadow: none;
}
.tier-empty {
  font-size: 12.5px;
  color: var(--faint);
  padding: 8px 2px;
}

/* ============ entrance (CSS only, 截图/虚拟时间友好) ============ */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.hero-eyebrow, .hero-title, .hero-sub,
.portal-card, .kpi, .panel {
  animation: riseIn 0.62s cubic-bezier(0.22, 0.75, 0.3, 1) both;
}
.hero-title { animation-delay: 0.05s; }
.hero-sub { animation-delay: 0.12s; }
.portal-card:nth-child(1) { animation-delay: 0.10s; }
.portal-card:nth-child(2) { animation-delay: 0.18s; }
.portal-card:nth-child(3) { animation-delay: 0.26s; }
.portal-card:nth-child(4) { animation-delay: 0.34s; }
.portal-card:nth-child(5) { animation-delay: 0.42s; }
.kpi:nth-child(1) { animation-delay: 0.10s; }
.kpi:nth-child(2) { animation-delay: 0.16s; }
.kpi:nth-child(3) { animation-delay: 0.22s; }
.kpi:nth-child(4) { animation-delay: 0.28s; }
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow, .hero-title, .hero-sub,
  .portal-card, .kpi, .panel {
    animation: none;
  }
}

/* ============ responsive ============
   原则：≥1081px 为 PC 基准样式，不做任何改动；
   以下断点只影响平板 / 手机，尽量保持与 PC 一致的视觉结构。 */

/* —— 小笔记本 / 平板竖屏 / 手机横屏（≤1080px）—— */
@media (max-width: 1080px) {
  .portal-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .board-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-num { font-size: 28px; }
  .panel-full { margin-top: 14px; }
}

/* —— 手机竖屏（≤760px）—— */
@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }

  /* 顶栏 */
  .topbar-inner { height: 54px; }
  .brand { gap: 9px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-text strong { font-size: 14px; }
  .clock { font-size: 10.5px; letter-spacing: 0.04em; }

  /* Hero */
  .hero { padding: 38px 0 16px; }
  .hero-eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.14em;
    padding: 5px 12px;
  }
  .hero-title { font-size: clamp(25px, 7.2vw, 38px); margin-top: 16px; }
  .hero-sub { font-size: 13.5px; margin-top: 12px; }

  /* 区块标题与看板控件 */
  .section { padding: 24px 0 12px; }
  .section-head { gap: 10px; margin-bottom: 16px; }
  .section-head h2 { font-size: 19px; }
  .sec-no { font-size: 10px; }
  .section-desc { font-size: 11.5px; line-height: 1.7; }
  .board-controls {
    margin-left: 0;
    width: 100%;
    gap: 8px;
  }
  .seg-camp { flex: 1; }
  .camp-btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 12.5px;
    text-align: center;
  }
  .btn-refresh { padding: 9px 12px; font-size: 12px; }
  .notice-bar {
    font-size: 11px;
    padding: 9px 12px;
    margin: -2px 0 12px;
    line-height: 1.7;
  }

  /* 分析入口：2 列紧凑卡片（结构与 PC 一致） */
  .portal-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .portal-card {
    padding: 15px 12px 12px;
    gap: 8px;
    border-radius: 13px;
  }
  .portal-icon {
    width: 38px; height: 38px;
    border-radius: 11px;
  }
  .portal-icon svg { width: 19px; height: 19px; }
  .portal-card h3 { font-size: 13px; line-height: 1.4; }
  .portal-card p {
    font-size: 10.5px;
    line-height: 1.7;
  }
  .portal-foot {
    padding-top: 10px;
    gap: 4px 8px;
  }
  .portal-url { font-size: 8.5px; }
  .portal-go { font-size: 10.5px; }

  /* KPI：2×2 */
  .kpi-grid { gap: 10px; }
  .kpi { padding: 15px 13px 12px; border-radius: 13px; }
  .kpi-label { font-size: 11px; letter-spacing: 0.06em; }
  .kpi-label span { font-size: 9.5px; }
  .kpi-num { font-size: 23px; margin-top: 9px; }
  .kpi-num i { font-size: 12px; }
  .kpi-sub { font-size: 10px; margin-top: 6px; }
  .kpi-bar { margin-top: 10px; }

  /* 图表面板 */
  .panel { padding: 15px 13px; border-radius: 13px; }
  .panel-head { margin-bottom: 13px; }
  .panel-head h3 { font-size: 14px; }
  .panel-head p { font-size: 10px; }
  .board-grid { gap: 12px; margin-top: 12px; }
  .panel-full { margin-top: 12px; }

  /* 环形图：图上例下 */
  .donut-wrap {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .donut { width: 152px; height: 152px; }
  .legend {
    width: 100%;
    min-width: 0;
    gap: 10px;
  }
  .legend b { font-size: 12px; }
  .legend small { font-size: 9.5px; }
  .legend em { font-size: 12px; }
  .mini-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-top: 14px;
  }
  .mini-stats b { font-size: 14px; }

  /* 转化流：改为纵向 */
  .flow {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .flow-node {
    width: 100%;
    min-width: 0;
    padding: 13px 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
  }
  .flow-node .flow-label {
    order: 1;
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .flow-node b {
    order: 2;
    margin-top: 0;
    font-size: 19px;
  }
  .flow-node small {
    order: 3;
    margin-top: 0;
    font-size: 10px;
  }
  .flow-arrow {
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .flow-arrow::before {
    top: 2px;
    bottom: 2px;
    left: 50%;
    right: auto;
    width: 1.5px;
    height: auto;
    transform: translateX(-50%);
    background: linear-gradient(180deg, transparent, var(--cyan));
  }
  .flow-arrow::after {
    top: auto;
    bottom: 4px;
    right: auto;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }
  .flow-arrow-2::before {
    background: linear-gradient(180deg, transparent, var(--warn));
  }
  .flow-arrow span {
    background: var(--panel-solid);
    padding: 1px 8px;
    border-radius: 6px;
  }
  .scope-note {
    margin-top: 12px;
    font-size: 10.5px;
    line-height: 1.8;
    padding-left: 10px;
  }

  /* 卡种分析 */
  .tier-controls {
    margin-left: 0;
    width: 100%;
  }
  .tier-controls .seg-camp { flex: 1; }
  .tier-controls .camp-btn,
  .tier-controls .angle-btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 11.5px;
    text-align: center;
  }
  .tier-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .tier-name { font-size: 13.5px; }
  .tier-head b { font-size: 12px; }
  .tier-head em { font-size: 11.5px; }

  /* 口径速览 */
  .rule-list { gap: 8px; }
  .rule-list li {
    padding: 9px 10px 9px 30px;
    font-size: 10.5px;
    line-height: 1.75;
  }
  .rule-list li::before { left: 10px; top: 6px; }
  .rule-list b { margin-right: 6px; }

  /* 页脚 */
  .footer { margin-top: 36px; }
  .footer-inner {
    padding: 18px 0;
    gap: 10px;
  }
  .footer p { font-size: 10.5px; }
  .footer-links { gap: 14px; flex-wrap: wrap; }
  .footer-links a { font-size: 11px; }
}

/* —— 手机横屏（高度受限）—— */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding: 22px 0 10px; }
  .hero-title { font-size: 26px; margin-top: 12px; }
  .hero-sub { font-size: 12px; }
  .section { padding: 18px 0 10px; }
}

/* —— 超窄屏（≤340px）：退回单列，数字放大 —— */
@media (max-width: 340px) {
  .portal-grid,
  .portal-grid-wide { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-num { font-size: 28px; }
  .hero-title { font-size: 24px; }
  .brand-text { display: none; }
}

/* —— 刘海屏 / 手势条安全区 —— */
@supports (padding: env(safe-area-inset-bottom)) {
  .topbar-inner {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .footer-inner {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}
