:root {
  --bg: #101114;
  --side: #202124;
  --panel: #f7f8fb;
  --card: #ffffff;
  --line: #e3e8f1;
  --line-dark: #34363b;
  --text: #111827;
  --muted: #667085;
  --light: #f8fafc;
  --white: #ffffff;
  --accent: #2563eb;
  --accent-2: #0891b2;
  --green: #24b47e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--white);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.app-side {
  position: sticky;
  top: 0;
  height: 100vh;
  flex: 0 0 248px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--side);
  color: var(--white);
  border-right: 1px solid var(--line-dark);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, #9aa3b2);
  color: #111;
  font-weight: 700;
}
.brand small,
.shell-note span {
  display: block;
  margin-top: 4px;
  color: #a9afbb;
}
.main-nav {
  display: grid;
  gap: 6px;
}
.main-nav button {
  padding: 0 12px;
  text-align: left;
  background: transparent;
  color: #b7bdc8;
}
.main-nav button.active,
.main-nav button:hover {
  color: #fff;
  background: #1d4ed8;
}
.shell-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  background: #141518;
  line-height: 1.6;
}
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f7f9fc 0%, #edf2f8 100%);
  color: var(--text);
}
body.next-locked .app-shell {
  display: none;
}
body.next-locked .app-main {
  display: none;
}
.next-auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #101114;
}
.next-auth-gate[hidden] {
  display: none;
}
.next-auth-gate > div {
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid #33333a;
  border-radius: 8px;
  background: #18181b;
  box-shadow: 0 22px 56px rgba(0, 0, 0, .32);
}
.next-auth-gate h1 {
  margin: 7px 0 10px;
  font-size: 28px;
}
.next-auth-gate p {
  color: #a9afbb;
  line-height: 1.7;
}
.next-userbar a {
  color: #f4f1ff;
  text-decoration: none;
}
.next-login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.next-login-form label {
  display: grid;
  gap: 7px;
  color: #d7dbe5;
  font-weight: 600;
}
.next-login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #343741;
  border-radius: 8px;
  background: #23242a;
  color: #fff;
  outline: none;
}
.next-login-form input:focus {
  border-color: rgba(109, 69, 255, .8);
  box-shadow: 0 0 0 3px rgba(109, 69, 255, .18);
}
.next-login-form button {
  min-height: 44px;
  padding: 0 14px;
  border-color: transparent;
  background: #6d45ff;
  color: #fff;
  font-weight: 600;
}
.next-login-form button:disabled {
  cursor: wait;
  opacity: .62;
}
.next-login-form small {
  min-height: 20px;
  color: #a9afbb;
}
.next-login-form small.error {
  color: #ff9da8;
}
.next-login-form small.ok {
  color: #7ee2bd;
}
.next-login-form small.loading {
  color: #9ed7ff;
}
.next-login-fallback {
  display: inline-block;
  margin-top: 12px;
  color: #a9afbb;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.next-eyebrow {
  margin: 0;
  color: #7bc8c3;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.next-userbar {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 20;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #33333a;
  border-radius: 10px;
  background: rgba(21, 21, 23, .94);
  color: #f4f1ff;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .26);
}
.next-userbar[hidden] {
  display: none;
}
.next-userbar span {
  color: #d9ceff;
  font-weight: 600;
}
.next-userbar a {
  color: #9c9ca6;
  font-size: 13px;
}
.next-userbar button {
  min-height: 30px;
  padding: 0 10px;
  border-color: #3b3d45;
  background: #25262c;
  color: #f4f1ff;
  font-size: 13px;
  font-weight: 600;
}
.next-userbar button:hover {
  border-color: rgba(143, 124, 246, .55);
  color: #d9ceff;
}
.module-view {
  display: none;
  min-height: 100vh;
  padding: 24px 22px 34px;
}
.module-view.active {
  display: block;
}
.next-back-button {
  position: fixed;
  left: 22px;
  top: 22px;
  z-index: 20;
  min-height: 42px;
  border: 1px solid #33333a;
  border-radius: 10px;
  background: rgba(21, 21, 23, .94);
  color: #f4f1ff;
  padding: 0 14px;
  font-weight: 600;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .26);
}
.next-back-button:hover {
  border-color: rgba(143, 124, 246, .55);
  color: #d9ceff;
}
.home-dashboard {
  max-width: 1460px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}
.home-hero,
.home-panel,
.home-health-grid article,
.kpi-card,
.store-summary-card,
.issue-card,
.workflow-card,
.home-module-grid button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.home-hero {
  padding: 24px 24px 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.home-kicker {
  margin: 0 0 8px;
  color: #3f76ef;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.home-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}
.home-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}
.home-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.home-hero-actions button,
.home-panel-head button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 700;
}
.home-primary-action,
.home-panel-head button {
  border-color: transparent;
  background: #2563eb;
  color: #fff;
}
.home-secondary-action {
  border-color: var(--line);
  background: #f8fbff;
  color: var(--text);
}
.home-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: 14px;
}
.home-health-grid article,
.home-source-strip article,
.kpi-card {
  padding: 18px 18px 16px;
  min-height: 104px;
}
.home-health-grid span,
.home-source-strip span,
.kpi-card span,
.store-summary-head span,
.issue-card span,
.workflow-card span,
.home-module-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}
.home-health-grid strong,
.home-source-strip strong,
.kpi-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}
.home-health-grid small,
.home-source-strip small,
.kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}
.home-source-panel {
  padding-bottom: 16px;
}
.home-source-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.source-card {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.source-card span {
  color: #3f76ef;
}
.source-card strong {
  font-size: 22px;
}
.source-card small {
  font-size: 13px;
}
.source-card.ok {
  border-color: #b7e4d1;
  background: #f7fffb;
}
.source-card.warn {
  border-color: #fed7aa;
  background: #fffaf4;
}
.source-card.muted {
  background: #f8fafc;
}
.home-analysis-scope-panel {
  background: #ffffff;
}
.home-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}
.scope-card {
  display: grid;
  gap: 14px;
  min-height: 258px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfdff;
}
.scope-card.ok {
  border-color: #b7e4d1;
  background: #f7fffb;
}
.scope-card.warn {
  border-color: #fed7aa;
  background: #fffaf4;
}
.scope-card.muted {
  border-color: #e5e7eb;
  background: #f8fafc;
}
.scope-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.scope-card-head span,
.scope-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.scope-card-head strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.35;
}
.scope-card-head b {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12px;
}
.scope-card.ok .scope-card-head b { background: #047857; }
.scope-card.warn .scope-card-head b { background: #b45309; }
.scope-card.muted .scope-card-head b { background: #475569; }
.scope-meta {
  display: grid;
  gap: 9px;
}
.scope-meta div {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, .25);
}
.scope-meta p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}
.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.kpi-card span {
  color: #4f6fad;
}
.kpi-card strong {
  font-size: 25px;
}
.kpi-card-error {
  border-color: #f39ba7;
}
.home-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, .9fr);
  gap: 14px;
  align-items: start;
}
.home-lower-grid {
  grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr);
}
.home-panel {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.home-panel-wide {
  min-width: 0;
}
.home-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.home-panel-head span {
  color: #3f76ef;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.home-panel-head h2 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 18px;
}
.home-period-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.home-bi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr);
  gap: 14px;
  align-items: stretch;
}
.home-bi-middle {
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
}
.home-bi-bottom {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
}
.kpi-change {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 12px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.kpi-change.up,
.efficiency-card.up {
  background: #ecfdf5;
  color: #047857;
}
.kpi-change.down,
.efficiency-card.down {
  background: #fef2f2;
  color: #b91c1c;
}
.kpi-card.sales,
.kpi-card.net,
.kpi-card.roi {
  border-color: #bfdbfe;
}
.kpi-card.spend {
  border-color: #bae6fd;
}
.kpi-card.refund {
  border-color: #fecaca;
}
.kpi-card.orders {
  border-color: #dbeafe;
}
.home-chart,
.home-funnel,
.home-store-bars,
.home-efficiency,
.home-product-rank {
  min-height: 280px;
}
.home-chart {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}
.home-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.home-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home-chart-legend i {
  width: 18px;
  height: 3px;
  border-radius: 8px;
}
.home-line-chart {
  width: 100%;
  min-height: 280px;
  overflow: visible;
}
.chart-grid line {
  stroke: #e2e8f0;
  stroke-width: 1;
}
.chart-lines path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dots circle {
  stroke: #fff;
  stroke-width: 2;
}
.chart-labels text {
  fill: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.home-funnel {
  display: grid;
  gap: 12px;
  align-content: start;
}
.funnel-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.funnel-row span,
.efficiency-card span,
.product-rank-head,
.product-rank-row small,
.store-bar-metrics {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.funnel-row strong,
.efficiency-card strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 18px;
}
.funnel-row small,
.efficiency-card small {
  display: block;
  margin-top: 5px;
  color: #64748b;
  line-height: 1.45;
}
.funnel-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f0;
}
.funnel-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}
.home-store-bars {
  display: grid;
  gap: 14px;
  align-content: start;
}
.store-bar-row {
  display: grid;
  gap: 9px;
}
.store-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
}
.store-bar-head span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.store-bar-head strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 15px;
}
.store-bar-head b {
  color: #0f172a;
  font-size: 17px;
  white-space: nowrap;
}
.store-bar-track {
  height: 11px;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f0;
}
.store-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}
.store-bar-track i.good {
  background: #0f766e;
}
.store-bar-track i.warn {
  background: #dc2626;
}
.store-bar-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.home-efficiency {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}
.efficiency-card {
  min-height: 118px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.efficiency-card.muted {
  background: #f8fafc;
  color: #475569;
}
.home-product-rank {
  display: grid;
  gap: 8px;
  align-content: start;
  overflow-x: auto;
}
.product-rank-head,
.product-rank-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.35fr) 92px repeat(4, minmax(78px, .7fr));
  gap: 10px;
  align-items: center;
  min-width: 650px;
}
.product-rank-head {
  min-height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid #e2e8f0;
}
.product-rank-row {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: #0f172a;
  font-size: 13px;
}
.product-rank-row strong {
  display: block;
  overflow: hidden;
  color: #0f172a;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-rank-row small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-issue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.home-visual-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 14px;
}
.home-scatter {
  position: relative;
  min-height: 360px;
  padding: 18px;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,251,255,.98)),
    radial-gradient(circle at 0 0, rgba(59,130,246,.08), transparent 42%);
  border: 1px solid var(--line);
}
.scatter-grid-lines {
  position: absolute;
  inset: 18px;
  border-radius: 12px;
  background:
    linear-gradient(to right, transparent 24.5%, rgba(148,163,184,.35) 24.5%, rgba(148,163,184,.35) 25.5%, transparent 25.5%, transparent 49.5%, rgba(148,163,184,.35) 49.5%, rgba(148,163,184,.35) 50.5%, transparent 50.5%, transparent 74.5%, rgba(148,163,184,.35) 74.5%, rgba(148,163,184,.35) 75.5%, transparent 75.5%),
    linear-gradient(to top, transparent 24.5%, rgba(148,163,184,.35) 24.5%, rgba(148,163,184,.35) 25.5%, transparent 25.5%, transparent 49.5%, rgba(148,163,184,.35) 49.5%, rgba(148,163,184,.35) 50.5%, transparent 50.5%, transparent 74.5%, rgba(148,163,184,.35) 74.5%, rgba(148,163,184,.35) 75.5%, transparent 75.5%);
  opacity: .42;
  pointer-events: none;
}
.scatter-axis {
  position: absolute;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  pointer-events: none;
  z-index: 1;
}
.scatter-x { right: 18px; bottom: 12px; }
.scatter-y { left: 18px; top: 14px; }
.scatter-point {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--point-size, 28px) minmax(110px, 1fr);
  align-items: center;
  gap: 8px;
  width: clamp(160px, 36%, 230px);
  transform: translate(calc(var(--point-size, 28px) / -2), -50%);
  color: var(--text);
  pointer-events: auto;
}
.scatter-point.label-left {
  grid-template-columns: minmax(110px, 1fr) var(--point-size, 28px);
  transform: translate(calc(-100% + var(--point-size, 28px) / 2), -50%);
  text-align: right;
}
.scatter-point i {
  grid-row: 1 / span 2;
  width: var(--point-size, 28px);
  height: var(--point-size, 28px);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
}
.scatter-point.label-left i {
  grid-column: 2;
}
.scatter-point.label-left strong,
.scatter-point.label-left span {
  grid-column: 1;
}
.scatter-point strong {
  display: block;
  font-size: 11px;
  line-height: 1.1;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scatter-point span {
  display: block;
  font-size: 10px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scatter-point.platform-tmall i { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.scatter-point.platform-douyin i { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.scatter-point.platform-pdd i { background: linear-gradient(135deg, #9333ea, #c084fc); }
.home-store-list {
  display: grid;
  gap: 12px;
}
.store-summary-card {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.store-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.store-summary-head h3 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 17px;
}
.store-summary-head strong {
  color: var(--text);
  font-size: 18px;
}
.store-summary-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 14px;
}
.store-summary-metrics span {
  color: var(--muted);
  font-size: 12px;
}
.store-summary-metrics b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
}
.home-issue-list,
.home-workflow {
  display: grid;
  gap: 12px;
}
.issue-card,
.workflow-card {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.issue-card strong,
.workflow-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 16px;
}
.issue-card p,
.workflow-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.issue-empty {
  padding: 20px 16px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}
.home-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.home-module-grid button {
  min-height: 94px;
  padding: 16px 14px;
  text-align: left;
  color: var(--text);
}
.home-module-grid button strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}
.home-module-grid button span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.home-module-grid button:hover {
  border-color: rgba(37, 99, 235, .28);
  background: #f8fbff;
}
.module-shell {
  max-width: 1240px;
  margin: 0 auto;
}
.module-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}
.module-head span {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}
.module-head h1 {
  margin: 6px 0 0;
  font-size: 26px;
}
.module-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}
.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.placeholder-card {
  min-height: 140px;
  padding: 16px;
  border: 1px dashed #bfd0e8;
  border-radius: 12px;
  background: #f7fbff;
}
.placeholder-card strong,
.placeholder-card span {
  display: block;
}
.placeholder-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}
body.next-module-loading::after {
  content: "正在加载模块...";
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  padding: 10px 12px;
  border: 1px solid #c8d6e7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #1e2c3b;
  box-shadow: 0 10px 30px rgba(25, 43, 68, 0.12);
  font-size: 13px;
}

/* ===== Module render error boundary ===== */
.next-error-boundary {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 32px;
}
.next-error-card {
  width: min(520px, 100%);
  padding: 32px 28px;
  border: 1px solid #e85d6b;
  border-radius: 16px;
  background: var(--white);
  text-align: center;
  box-shadow: 0 18px 48px rgba(232, 93, 107, .15);
}
.next-error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff0f1;
  color: #e85d6b;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}
.next-error-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  color: var(--text);
  font-weight: 700;
}
.next-error-module {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}
.next-error-module strong {
  color: var(--text);
  font-weight: 600;
}
.next-error-detail {
  margin: 0 0 20px;
  padding: 12px;
  border-radius: 8px;
  background: #f6f8fa;
  color: #c0392b;
  font-size: 13px;
  font-family: Consolas, monospace;
  word-break: break-all;
  line-height: 1.6;
}
.next-error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.next-error-actions button {
  min-height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.next-error-back {
  border: 1px solid var(--line);
  background: var(--light);
  color: var(--text);
}
.next-error-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.next-error-reload {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
}
.next-error-reload:hover {
  opacity: .9;
}

@media (max-width: 980px) {
  .next-back-button {
    left: 12px;
    top: 12px;
  }
  .next-userbar {
    left: 12px;
    right: 12px;
    top: 62px;
    justify-content: space-between;
  }
  .app-shell {
    display: block;
  }
  .app-side {
    position: static;
    width: auto;
    height: auto;
  }
  .main-nav,
  .placeholder-grid,
  .home-health-grid,
  .home-kpi-grid,
  .home-bi-grid,
  .home-bi-middle,
  .home-bi-bottom,
  .home-main-grid,
  .home-lower-grid,
  .home-visual-row,
  .home-scope-grid,
  .home-module-grid {
    grid-template-columns: 1fr;
  }
  .home-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-hero-actions {
    justify-content: flex-start;
  }
  .home-efficiency {
    grid-template-columns: 1fr;
  }
  .funnel-row {
    grid-template-columns: 1fr;
  }
  .scatter-point {
    max-width: 44%;
  }
}
