/* v3 overrides on top of forge-v2.css:
   1. the four small-boxes and the map card use the official AdminLTE Dashboard v1 colours
      (text-bg-primary #0d6efd, text-bg-success #198754, text-bg-warning #ffc107 with black text,
      text-bg-danger #dc3545, map card = bg-primary + bg-gradient) in BOTH colour modes, exactly as the
      official demo does;
   2. the four boxes share one height in every state (未接入 / GMV 预览, light / dark, tablet). */

:root, [data-bs-theme="dark"] {
  --forge-box-1-bg: #0d6efd; --forge-box-1-fg: #ffffff;
  --forge-box-2-bg: #198754; --forge-box-2-fg: #ffffff;
  --forge-box-3-bg: #ffc107; --forge-box-3-fg: #000000;
  --forge-box-4-bg: #dc3545; --forge-box-4-fg: #ffffff;
  --forge-box-footer: rgba(0, 0, 0, 0.07);
  --forge-box-footer-hover: rgba(0, 0, 0, 0.1);
  --forge-box-icon: rgba(0, 0, 0, 0.15);
  --forge-mapcard-bg: linear-gradient(rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0)) #0d6efd;
  --forge-mapcard-fg: #ffffff;
  --forge-mapcard-muted: rgba(255, 255, 255, 0.75);
  --forge-mapcard-border: #0d6efd;
  --forge-mapcard-land: rgba(222, 226, 232, 0.9);        /* official jsVectorMap region fill #dee2e8 */
  --forge-mapcard-land-border: rgba(13, 110, 253, 0.9);
  --forge-mapcard-seq-lo: #ffe69c;                        /* markets: warning yellow scale on blue */
  --forge-mapcard-seq-hi: #ffc107;
  --forge-mapcard-divider: rgba(255, 255, 255, 0.2);
  --forge-box-height: 160px;
}

/* ---- equal heights ------------------------------------------------------------------------------- */
#boxes > [class*="col-"] { display: flex; }
.forge-box { height: var(--forge-box-height); min-height: 0; width: 100%; border-radius: 0.375rem; box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2); }
.forge-box > .inner { display: flex; flex-direction: column; padding: 12px 16px 8px; min-height: 0; }
.forge-box .box-value { margin: 4px 0 4px; font-size: 30px; }
.forge-box .box-sub { flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.55; gap: 0; }
.forge-box .box-sub > * { margin-right: 8px; vertical-align: middle; }
.forge-box .box-footer { flex: 0 0 auto; padding: 5px 10px; }
.forge-box .box-icon { width: 60px; height: 60px; top: 14px; right: 14px; }

/* the warning box keeps black text like the official one; chips and footer follow */
.forge-box.box-3 .box-sub .delta { background: rgba(0, 0, 0, 0.1); }
.forge-box.box-3 .box-footer { color: #000; }

/* 成交未接入：keep the official red base, but stripe it, dash the border and label it plainly */
.forge-box.box-na {
  --forge-box-bg: #dc3545; --forge-box-fg: #ffffff;
  background-color: #dc3545;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, 0.13) 6px 8px);
  border: 1px dashed rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
}
.forge-box.box-na .box-icon { color: rgba(0, 0, 0, 0.15); }
.forge-box.box-na .box-sub .delta { background: rgba(255, 255, 255, 0.22); }
.forge-box.box-na .box-footer { background: rgba(0, 0, 0, 0.12); color: #fff; }
.forge-box .na-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; background: #ffffff; color: #dc3545; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }

/* preview tag (合成预览) on the red box: white on red for contrast */
.forge-box.box-4 .preview-tag { background: rgba(255, 255, 255, 0.92); color: #842029; border-color: transparent; }

/* ---- map card: official-style controls ------------------------------------------------------------- */
.map-card { border: 0; }
.map-card .seg { background: rgba(0, 0, 0, 0.12); border-color: rgba(255, 255, 255, 0.25); }
.map-card .seg button { color: rgba(255, 255, 255, 0.8); }
.map-card .seg button.active { background: #ffffff; color: #0d6efd; }
.map-card .seg button[disabled] { color: rgba(255, 255, 255, 0.55); }
.map-card .chart-foot { color: rgba(255, 255, 255, 0.75); }
.map-card .market-list small { color: rgba(255, 255, 255, 0.7); }

/* ---- responsive ------------------------------------------------------------------------------------- */
@media (max-width: 1399.98px) { :root, [data-bs-theme="dark"] { --forge-box-height: 166px; } }
@media (max-width: 991.98px) {
  :root, [data-bs-theme="dark"] { --forge-box-height: 148px; }
  .forge-box .box-value { font-size: 26px; }
  .forge-box .box-icon { width: 48px; height: 48px; }
}
@media (max-width: 575.98px) {
  :root, [data-bs-theme="dark"] { --forge-box-height: 132px; }
  .forge-box .box-sub .sub-text { display: none; }
}
