:root {
  /* ── 基础背景与文本 ── */
  --bg: #07111f;
  --bg-2: #0d1623;
  --panel: rgba(17, 28, 42, 0.9);
  --panel-2: rgba(22, 33, 48, 0.95);
  --text: #f6f8fc;
  --muted: #94a4b8;
  --line: rgba(109, 135, 163, 0.32);
  --accent: #18d9d2;
  --warn: #ffbf45;
  --bad: #ff4d68;
  --shadow-soft: 0 22px 48px rgba(0, 0, 0, 0.24);

  /* ── 平台品牌色 ── */
  --color-total: #16d9e8;
  --color-taobao: #ff3b4f;
  --color-jd: #ff6b18;
  --color-dewu: #35d47f;
  --color-douyin: #18c7f3;
  --color-vip: #c45cff;
  --color-other: #8ea0b8;
  /* 小红书：品牌红偏玫红，和天猫的红（#ff3b4f）拉开距离，一眼能分辨 */
  --color-xiaohongshu: #ff5c8a;

  /* ── 语义状态颜色（Carbon / Radix 规范：实色 / 背景 / 边框三层） ── */
  --status-ok-text:     var(--accent);
  --status-ok-bg:       rgba(24, 217, 210, 0.12);
  --status-ok-border:   rgba(24, 217, 210, 0.30);

  --status-warn-text:   var(--warn);
  --status-warn-bg:     rgba(255, 191, 69, 0.15);
  --status-warn-border: rgba(255, 191, 69, 0.35);

  --status-bad-text:    var(--bad);
  --status-bad-bg:      rgba(255, 77, 104, 0.15);
  --status-bad-border:  rgba(255, 77, 104, 0.35);

  --status-info-text:   #18c7f3;
  --status-info-bg:     rgba(24, 199, 243, 0.13);
  --status-info-border: rgba(24, 199, 243, 0.30);

  --status-muted-text:   var(--muted);
  --status-muted-bg:     rgba(148, 164, 184, 0.12);
  --status-muted-border: rgba(148, 164, 184, 0.28);

  /* ── 动效标准化（Open Props 风格：fast/normal/slow + standard easing） ── */
  --duration-fast:   150ms;
  --duration-normal: 220ms;
  --duration-slow:   400ms;
  --ease-standard:   cubic-bezier(0.4, 0, 0.2, 1);   /* 进入+离开通用 */
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);      /* 元素进入画面 */
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);      /* 元素离开画面 */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 190, 255, 0.10), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(130, 74, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #050914 0%, #07111d 100%);
  color: #f8fbff;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 36, 52, 0.92);
  color: var(--text);
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard),
              opacity var(--duration-fast) var(--ease-standard);
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: saturate(0.72);
}

button:disabled:hover {
  border-color: var(--line);
}

button.primary {
  background: linear-gradient(135deg, #22d8aa, #18d9d2);
  border-color: rgba(24, 217, 210, 0.85);
  color: #04130f;
  font-weight: 800;
}

button.danger {
  border-color: rgba(255, 77, 104, 0.75);
  color: var(--bad);
}

h1,
h2,
p {
  margin: 0;
}

.app-header {
  height: 72px;
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(max-content, 1fr) auto;
  align-items: center;
  column-gap: 28px;
  padding: 0 32px;
  background: rgba(5, 10, 18, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-logo {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 10px;
}

.header-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-title span,
.task-meta,
.debug-lines,
.store-foot,
label,
.sample-panel,
.health-box {
  color: var(--muted);
}

.header-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 42px;
  min-width: max-content;
  white-space: nowrap;
  height: 100%;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-break: keep-all;
  font-size: 18px;
  line-height: 1;
  font-weight: 750;
  color: rgba(255, 255, 255, 0.58);
  padding: 27px 0 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-standard);
}

.nav-item.active {
  color: #ffffff;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 92px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #18e1df;
  box-shadow: 0 0 18px rgba(24, 225, 223, 0.85);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-width: 0;
  white-space: nowrap;
}

.mobile-yoy-row {
  display: none;
}

.test-dataset-nav-row {
  display: none;
  pointer-events: none;
}

body.public-dashboard-mode .test-dataset-nav-row,
body.test-dashboard-mode .test-dataset-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  overflow-x: auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}

.test-dataset-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: center;
  overflow-x: auto;
  /* 只声明 overflow-x 时，另一轴按 CSS Overflow 规范会从 visible 计算成 auto —— 于是这个 40px 高的
     标签行也能长出纵向滚动条。Windows 用"经典滚动条"时，横条占掉高度会让内容装不下，浏览器再补一条
     纵向条（就是那对很突兀的上下箭头），点标签把胶囊滚进视野时最明显。这里明确关掉纵向。 */
  overflow-y: hidden;
  min-height: 36px;
}

/* 顶栏这几个容器只保留"能滚"（窄屏横滑、键盘 Tab 滚进视野），一律不画原生滚动条：
   桌面端此前只给 .test-dataset-nav-row 隐藏了滚动条，子层 .test-dataset-bar 还是 auto/auto，
   是唯一能冒出原生滚动条的地方。 */
.test-dataset-nav-row,
.test-dataset-bar,
.header-nav {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.test-dataset-nav-row::-webkit-scrollbar,
.test-dataset-bar::-webkit-scrollbar,
.header-nav::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.test-dataset-bar.is-loading {
  opacity: 0.78;
}

/* 公网/测试看板（≥769px）：波次标签条占顶栏中间一列，固定一行，不再换行。
   左右两列等宽 → 中列正好落在页面正中（之前中列吃的是"品牌列剩下的空间"，整条偏右 ~150px）；
   右列的 min-content 兜住「活动 + 连接状态」两个胶囊，挤不下时宁可让中列偏一点，也不重叠。
   之前还是绝对定位居中：内容一多就换行，整块高 98px 塞进 72px 的顶栏，selector 会顶到页面最上沿。 */
@media (min-width: 769px) {
  body.dashboard-page.public-dashboard-mode .app-header,
  body.dashboard-page.test-dashboard-mode .app-header {
    grid-template-columns: minmax(0, 1fr) auto minmax(min-content, 1fr);
  }

  body.dashboard-page.public-dashboard-mode .app-header .test-dataset-nav-row,
  body.dashboard-page.test-dashboard-mode .app-header .test-dataset-nav-row {
    position: static;
    left: auto;
    transform: none;
    width: auto;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body.dashboard-page.public-dashboard-mode .app-header .test-dataset-nav-row::-webkit-scrollbar,
  body.dashboard-page.test-dashboard-mode .app-header .test-dataset-nav-row::-webkit-scrollbar {
    display: none;
  }

  body.dashboard-page.public-dashboard-mode .app-header .test-dataset-bar,
  body.dashboard-page.test-dashboard-mode .app-header .test-dataset-bar {
    flex-wrap: nowrap;
    width: auto;
    min-width: 0;
    min-height: 0;
  }
}

/* ===== 顶栏三个控件（波次标签 / 活动下拉 / 连接状态）共用一套尺寸 =====
   三者同高、同字号、同水平内边距、同圆角、同图标盒子 --bar-icon（桌面 9px、窄屏 7px）。
   要改尺寸只动这里的变量；在各自规则里再写死一套，就会又对不齐。 */
.app-header {
  --bar-h: 44px;
  --bar-font: 16px;
  --bar-pad: 16px;
  --bar-icon: 9px;
}

/* 波次标签：和活动、连接状态一样是"整个 40/44px 高的胶囊"（不再塞在带内边距的容器里，
   否则标签本体只有 32px，看起来永远比旁边两个小一号） */
.test-dataset-chip {
  flex: 0 0 auto;
  height: var(--bar-h);
  padding: 0 var(--bar-pad);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(8, 16, 27, 0.72);
  color: #b6c6d8;
  font-size: var(--bar-font);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

/* ===== 波次标签行：只放标签，整行落在页面正中（活动下拉在右侧控制区） ===== */
.dataset-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* 顶栏导航分两组：口径视图（实时 / 累计至今 / 全周期）在前，
   波次（第一波 / 第二波）用细分隔线 + 「波次」小标 + 更轻的标签样式跟在后面。
   两组是同一层级的视图切换，但波次属于"活动内部的细分"，视觉上必须一眼分开，
   否则一排等高胶囊会读成 5 个并列视图。几何尺寸仍统一走 --bar-h / --bar-font / --bar-pad。 */
.dataset-tabs-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.dataset-tabs-group.is-waves {
  margin-left: 2px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.dataset-tabs-caption {
  color: var(--muted);
  font-size: calc(var(--bar-font) - 3px);
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.85;
  white-space: nowrap;
  user-select: none;
}

/* 波次标签：默认无底色无描边（比口径胶囊轻），选中态用青色下划线而不是整块填充，
   这样"当前波次"和"当前口径"一眼能分开（次要导航不该和主视图长得一样）。 */
.dataset-tabs-group.is-waves .test-dataset-chip {
  position: relative;
  background: transparent;
  border-color: transparent;
  color: rgba(214, 226, 240, 0.86);
}

.dataset-tabs-group.is-waves .test-dataset-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.dataset-tabs-group.is-waves .test-dataset-chip.is-active {
  background: rgba(24, 217, 210, 0.1);
  border-color: transparent;
  color: #ffffff;
}

.dataset-tabs-group.is-waves .test-dataset-chip.is-active::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* 本机控制台（/，非公网/测试看板）也放出波次标签行：单独占顶栏第二行，
   品牌 / 导航 / 控制区仍在第一行三列（显式排位，否则控制区会被挤到第三行）；
   ≤768px 的窄屏仍按原来的横滑布局，不额外占行。 */
@media (min-width: 769px) {
  body.dashboard-page:not(.public-dashboard-mode):not(.test-dashboard-mode) .app-header {
    height: auto;
    min-height: 72px;
    row-gap: 6px;
    padding-top: 8px;
    padding-bottom: 10px;
    grid-template-rows: auto auto;
  }

  body.dashboard-page:not(.public-dashboard-mode):not(.test-dashboard-mode) .app-header .header-brand {
    grid-area: 1 / 1 / 2 / 2;
  }

  body.dashboard-page:not(.public-dashboard-mode):not(.test-dashboard-mode) .app-header .header-nav {
    grid-area: 1 / 2 / 2 / 3;
  }

  body.dashboard-page:not(.public-dashboard-mode):not(.test-dashboard-mode) .app-header .header-actions {
    grid-area: 1 / 3 / 2 / 4;
  }

  body.dashboard-page:not(.public-dashboard-mode):not(.test-dashboard-mode) .app-header .test-dataset-nav-row {
    grid-area: 2 / 1 / 3 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  body.dashboard-page:not(.public-dashboard-mode):not(.test-dashboard-mode) .app-header .test-dataset-nav-row::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 768px) {
  .dataset-tabs-group.is-waves {
    padding-left: 12px;
  }

  .dataset-tabs-caption {
    display: none;
  }
}

/* 活动筛选：右侧控制区的独立胶囊，和连接状态并排（同高、圆角一致），
   左边是「活动」小字标签 + 当前活动 + 箭头，点开是自绘深色弹层。 */
.dataset-scope-slot {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.dataset-scope-slot[hidden] {
  display: none;
}

/* 活动下拉：右侧控制区的独立胶囊（和连接状态胶囊并排、同高同圆角），
   描边 + 半透明青底表示"可选"，展开时填充加深。（弹层原因见 .activity-filter-menu） */
.activity-filter {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.test-dataset-activity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--bar-h);
  padding: 0 var(--bar-pad);
  border: 1px solid rgba(24, 217, 210, 0.3);
  border-radius: 999px;
  background: rgba(24, 217, 210, 0.09);
  color: #ffffff;
  font-size: var(--bar-font);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.test-dataset-activity:hover {
  background: rgba(24, 217, 210, 0.16);
  border-color: rgba(24, 217, 210, 0.5);
}

.test-dataset-activity:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(24, 217, 210, 0.28);
}

.test-dataset-activity[aria-expanded="true"] {
  background: rgba(24, 217, 210, 0.2);
  border-color: rgba(24, 217, 210, 0.6);
}

.test-dataset-activity:disabled {
  cursor: wait;
  opacity: 0.6;
}

.activity-filter-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(206, 231, 245, 0.52);
}

.activity-filter-value {
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 图标盒子 = --bar-icon，和连接状态的圆点同尺寸、同垂直居中方式 */
.activity-filter-caret {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--bar-icon);
  height: var(--bar-icon);
}

.activity-filter-caret::before {
  content: "";
  width: 0;
  height: 0;
  border-left: calc(var(--bar-icon) / 2) solid transparent;
  border-right: calc(var(--bar-icon) / 2) solid transparent;
  border-top: calc(var(--bar-icon) * 0.66) solid #7fe9e4;
  transition: transform 0.18s ease;
}

.test-dataset-activity[aria-expanded="true"] .activity-filter-caret::before {
  transform: rotate(180deg);
}

/* 弹出层挂在 body 上（position: fixed），不会被导航的横向滚动容器裁掉 */
.activity-filter-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: min(340px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid rgba(24, 217, 210, 0.26);
  border-radius: 14px;
  background: #0c1622;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(0, 0, 0, 0.35);
  animation: activity-menu-in 0.14s var(--ease-standard);
}

.activity-filter-menu[hidden] {
  display: none;
}

.activity-filter-menu:focus,
.activity-filter-menu:focus-visible {
  outline: none;
}

@keyframes activity-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-filter-menu {
    animation: none;
  }
}

.activity-filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #c6d9ec;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.activity-filter-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-filter-option.is-active {
  background: rgba(24, 217, 210, 0.14);
  color: #ffffff;
}

.activity-filter-option.is-selected {
  color: #ffffff;
}

.activity-filter-option.is-selected::after {
  content: "✓";
  color: #19e2d6;
  font-size: 13px;
  font-weight: 800;
}

.test-dataset-chip:hover {
  background: rgba(24, 217, 210, 0.12);
  border-color: rgba(24, 217, 210, 0.45);
  color: #ffffff;
}

.test-dataset-chip.is-active {
  background: rgba(24, 217, 210, 0.2);
  border-color: rgba(24, 217, 210, 0.6);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(24, 217, 210, 0.2) inset;
}

.test-dataset-chip.is-disabled,
.test-dataset-chip:disabled {
  cursor: wait;
  opacity: 0.6;
}

.test-dataset-empty {
  color: rgba(220, 231, 245, 0.75);
  font-size: 13px;
  padding: 4px 0;
}

.test-dataset-empty.is-bad {
  color: #ff8d8d;
}

.header-actions .test-dataset-refresh-btn {
  display: none;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(24, 217, 210, 0.06);
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

body.public-dashboard-mode .header-actions .test-dataset-refresh-btn,
body.test-dashboard-mode .header-actions .test-dataset-refresh-btn {
  display: inline-flex;
}

.header-actions .test-dataset-refresh-btn:hover {
  background: rgba(24, 217, 210, 0.16);
  border-color: rgba(24, 217, 210, 0.5);
  color: #ffffff;
}

.header-actions .test-dataset-refresh-btn.is-refreshing,
.header-actions .test-dataset-refresh-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.control-label {
  font-size: 12px;
  line-height: 1;
  color: #aab7c9;
  white-space: nowrap;
}

.control-select {
  height: 34px;
  min-width: 150px;
  max-width: 210px;
  border-radius: 7px;
  padding: 0 12px;
  color: #ffffff;
  background: #0d1624;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
  outline: none;
}

.control-select option {
  background: #0d1624;
  color: #ffffff;
}

.control-input {
  height: 34px;
  width: 84px;
  border-radius: 7px;
  padding: 0 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
  outline: none;
}

.debug-toggle-button {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(24, 225, 223, 0.35);
  background: rgba(24, 225, 223, 0.10);
  color: #d7ffff;
  font-weight: 700;
  cursor: pointer;
}

.debug-toggle-button:hover {
  border-color: rgba(24, 225, 223, 0.75);
  box-shadow: 0 0 18px rgba(24, 225, 223, 0.18);
}

.debug-status-panel {
  position: fixed;
  top: 88px;
  right: 24px;
  z-index: 1000;
  width: min(380px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(8, 14, 24, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  color: #f8fbff;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.debug-status-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.debug-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.debug-status-head strong {
  display: block;
  font-size: 16px;
}

.debug-status-head span {
  display: block;
  margin-top: 4px;
  color: #9fb0c6;
  font-size: 12px;
}

.debug-status-head button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
}

.debug-status-body {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.debug-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.debug-kv span {
  color: #aab7c9;
  font-size: 12px;
}

.debug-kv b {
  min-width: 0;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffffff;
  font-size: 12px;
}

.debug-token-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #aab7c9;
  font-size: 12px;
}

.debug-token-field input {
  height: 36px;
  border-radius: 9px;
  padding: 0 11px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  outline: none;
}

.debug-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debug-status-message {
  min-height: 18px;
  margin-top: 10px;
  color: #9fb0c6;
  font-size: 12px;
}

.collect-all-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  color: #08131e;
  background: #18e1df;
  border: none;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

/* 演练模拟标识：模拟日生效时顶栏亮出来（琥珀色区别于青色实时胶囊），
   提醒所有人此刻看板不是真实当天；本机可点击一键清除，公网只读入口只做提示。 */
.simulate-badge {
  flex: 0 0 auto;
  height: var(--bar-h);
  padding: 0 var(--bar-pad);
  border-radius: 999px;
  border: 1px dashed rgba(255, 191, 69, 0.65);
  background: rgba(255, 191, 69, 0.16);
  color: var(--warn);
  font-size: var(--bar-font);
  font-weight: 800;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.simulate-badge[hidden] {
  display: none;
}

.simulate-badge:hover {
  background: rgba(255, 191, 69, 0.26);
}

.simulate-badge.is-readonly,
.simulate-badge.is-readonly:hover {
  cursor: default;
  border-style: solid;
  background: rgba(255, 191, 69, 0.16);
}

.live-pill {
  height: var(--bar-h);
  max-width: min(34vw, 360px);
  padding: 0 var(--bar-pad);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #19e2d6;
  background: rgba(0, 199, 178, 0.16);
  font-size: var(--bar-font);
  font-weight: 800;
  white-space: nowrap;
}

/* 告警文案可能很长：胶囊里省略号收尾（完整内容在 title 里），别把顶栏撑成两行 */
.live-pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1600px) {
  .app-header {
    grid-template-columns: minmax(280px, 360px) minmax(max-content, 1fr) auto;
    column-gap: 22px;
    padding: 0 24px;
    /* 顶栏控件统一缩一档（同高同字号，图标仍 9px） */
    --bar-h: 40px;
    --bar-font: 15px;
    --bar-pad: 16px;
    --bar-icon: 9px;
  }

  .header-title {
    font-size: 23px;
  }

  .header-nav {
    gap: 28px;
  }

  .nav-item {
    font-size: 16px;
  }

  .control-select {
    min-width: 130px;
    max-width: 170px;
  }
}

@media (max-width: 1366px) {
  .app-header {
    grid-template-columns: minmax(240px, 300px) 1fr auto;
    column-gap: 16px;
    padding: 0 18px;
  }

  .header-title {
    font-size: 20px;
  }

  .header-nav {
    gap: 20px;
  }

  .nav-item {
    font-size: 15px;
  }

  .control-label {
    display: none;
  }

  .control-select {
    min-width: 120px;
  }

  .control-input {
    width: 66px;
  }
}

.live-dot {
  flex: 0 0 auto;
  width: var(--bar-icon);
  height: var(--bar-icon);
  border-radius: 50%;
  background: #20e6d3;
  box-shadow: 0 0 14px rgba(32, 230, 211, 0.85);
}

.scheduler-button {
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(24, 36, 52, 0.82);
  color: rgba(246, 248, 252, 0.82);
  white-space: nowrap;
}

.scheduler-button.active {
  color: var(--accent);
  border-color: rgba(24, 217, 210, 0.78);
  background: rgba(24, 217, 210, 0.14);
}

.icon-button {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(24, 36, 52, 0.82);
  color: rgba(246, 248, 252, 0.82);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12);
}
.icon-button:hover {
  background: rgba(24, 217, 210, 0.14);
  border-color: rgba(24, 217, 210, 0.5);
}

.pill {
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(24, 217, 210, 0.14);
  color: var(--accent);
  white-space: nowrap;
}

.pill::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill.warn {
  color: var(--warn);
}

.pill.bad {
  color: var(--bad);
}

main {
  padding: 20px 28px 36px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.2fr) 2.4fr;
  gap: 14px;
  margin-bottom: 18px;
}

.total-card,
.platform-card,
.platform-group,
.store-card,
.config-panel,
.preview-panel,
.manager-card,
.debug-panel,
.manager-tools,
.empty-card {
  background: linear-gradient(145deg, rgba(15, 29, 45, 0.92), rgba(9, 18, 31, 0.96));
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.total-card {
  position: relative;
  min-height: 144px;
  padding: 20px 28px;
  overflow: hidden;
  border-color: rgba(24, 217, 210, 0.42);
}

.total-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.18);
}

.total-spark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 70px;
}

.platform-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
}

.platform-card {
  position: relative;
  min-height: 144px;
  padding: 16px 20px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--card-color) 58%, var(--line));
  box-shadow: 0 0 22px var(--card-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.platform-head,
.group-head,
.store-title,
.task-head,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.task-head {
  position: relative;
}

.platform-head {
  justify-content: flex-start;
  font-size: 20px;
}

.platform-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--card-color, var(--group-color, var(--accent)));
  color: white;
  font-size: 16px;
  font-weight: 900;
  flex: none;
}

.platform-value {
  margin-top: 12px;
  font-size: 24px;
  font-weight: 900;
}

.share {
  color: var(--card-color);
  margin-top: 10px;
  font-weight: 800;
}

.sparkline {
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 150px;
  height: 62px;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.filter-row.compact {
  margin: 0;
}

.chip {
  min-width: 88px;
  border-radius: 999px;
  padding: 9px 18px;
}

.chip.active {
  color: var(--accent);
  border-color: rgba(24, 217, 210, 0.75);
  background: rgba(24, 217, 210, 0.14);
}

.dashboard-section {
  margin-top: 12px;
}

.section-title {
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 22px;
}

.platform-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
}

.platform-group {
  padding: 16px 18px;
  border-color: color-mix(in srgb, var(--group-color) 66%, var(--line));
  box-shadow: 0 0 20px var(--group-glow);
}

.group-head {
  margin-bottom: 12px;
}

.group-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-head b {
  font-size: 20px;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1600px) {
  .store-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 1366px) {
  .store-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.store-card {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 13px 15px 11px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(12, 24, 40, 0.96), rgba(7, 13, 24, 0.96));
  border: 1px solid color-mix(in srgb, var(--platform-color) 70%, transparent);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 12px 30px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--duration-normal) var(--ease-standard),
              border-color var(--duration-normal) var(--ease-standard),
              box-shadow var(--duration-normal) var(--ease-standard);
}

.store-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 5px;
  width: 100%;
  border-radius: 14px 14px 999px 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--platform-color) 76%, #04111d) 0%,
    color-mix(in srgb, var(--platform-color) 92%, #0a1a2d) 22%,
    var(--platform-color) 50%,
    color-mix(in srgb, var(--platform-color) 92%, #0a1a2d) 78%,
    color-mix(in srgb, var(--platform-color) 76%, #04111d) 100%
  );
  background-size: 130% 100%;
  background-position: 50% 50%;
  box-shadow: 0 0 8px color-mix(in srgb, var(--platform-color) 46%, transparent);
}

.store-card.is-alert {
  border-color: rgba(255, 77, 104, 0.72);
}

.store-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-bottom: 8px;
  min-width: 0;
}

.store-title-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
}


.store-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.platform-mini-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--platform-color);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.store-name {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-title {
  font-weight: 800;
}

.store-title span {
  border-radius: 6px;
  background: var(--group-color);
  padding: 4px 8px;
  color: white;
  font-size: 13px;
}

.store-card strong {
  display: block;
  margin-top: 14px;
  font-size: 28px;
}

.store-foot {
  margin-top: 8px;
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: calc(100vh - 150px);
}

.config-panel,
.preview-panel,
.manager-tools,
.debug-panel {
  padding: 18px;
}

.config-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.setup-workbench {
  display: grid;
  gap: 12px;
  height: 100%;
  align-content: start;
}

.setup-title {
  margin-bottom: 0;
}

.setup-step-card,
.setup-current-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 10, 18, 0.42);
}

.setup-step-card,
.setup-current-card {
  padding: 14px;
}

.setup-step-card.is-active,
.setup-guide-card {
  border-color: rgba(24, 217, 210, 0.45);
  box-shadow: 0 0 0 1px rgba(24, 217, 210, 0.08), inset 0 0 0 1px rgba(24, 217, 210, 0.06);
}

.setup-step-card.is-muted {
  opacity: 0.78;
}

.setup-current-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.setup-current-kicker {
  color: var(--muted);
  font-size: 12px;
}

.setup-current-head strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.setup-current-meta,
.bind-context,
.helper-text,
.inline-tip,
.setup-next-step,
.setup-summary-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.setup-current-meta,
.bind-context {
  margin-top: 10px;
}

.setup-next-step {
  margin-top: 10px;
  color: var(--text);
}

.setup-summary-line {
  margin-top: 8px;
}

.setup-actions {
  margin-top: 12px;
  grid-template-columns: 1fr 1fr;
}

.setup-block-title {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text);
}

.helper-text {
  margin-bottom: 8px;
}

.inline-tip {
  margin-top: 8px;
}

.health-box {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 10, 18, 0.36);
  font-size: 13px;
  line-height: 1.6;
}

.edge-session-meta {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 191, 69, 0.22);
  border-radius: 8px;
  background: rgba(255, 191, 69, 0.08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.edge-session-meta b {
  color: var(--text);
}

label {
  display: block;
  margin-top: 12px;
}

input,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #091421;
  color: var(--text);
  padding: 10px;
}

.two-cols,
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wide-button {
  width: 100%;
  margin-top: 10px;
}

.coords {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
}

.setup-hidden-fields {
  display: none;
}

.message {
  margin-top: 8px;
  color: var(--warn);
  min-height: 24px;
  white-space: pre-wrap;
}

.bad-text {
  color: var(--bad);
}

.preview-wrap {
  position: relative;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  background: #07101c;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#previewImage {
  display: none;
  max-width: 100%;
  user-select: none;
  -webkit-user-drag: none;
  cursor: crosshair;
}

#selectionBox {
  position: absolute;
  display: none;
  border: 2px solid var(--accent);
  background: rgba(24, 217, 210, 0.12);
  pointer-events: none;
}

.preview-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 150px);
}

.preview-toolbar {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.preview-toolbar button {
  min-width: 138px;
}

.flow-guide-panel {
  display: grid;
  gap: 16px;
}

.flow-guide-content {
  display: grid;
  gap: 18px;
}

.flow-hero-card,
.flow-guide-card {
  border-radius: 16px;
  border: 1px solid rgba(109, 135, 163, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 26%),
    linear-gradient(145deg, rgba(12, 22, 36, 0.94), rgba(8, 16, 28, 0.98));
  box-shadow: var(--shadow-soft);
}

.flow-guide-card {
  padding: 20px;
}

.flow-guide-card h3 {
  margin: 0;
  font-size: 22px;
  color: var(--text);
}

.flow-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

.flow-hero-card::before {
  content: "";
  position: absolute;
  inset: auto -60px -90px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 217, 210, 0.22), transparent 68%);
  pointer-events: none;
}

.flow-hero-kicker,
.flow-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #89f6ee;
}

.flow-hero-kicker::before,
.flow-card-kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.flow-hero-copy {
  position: relative;
  z-index: 1;
}

.flow-hero-copy h3 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
}

.flow-hero-copy p,
.flow-step-node p,
.flow-branch-card p,
.flow-module-card p,
.flow-playbook-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.flow-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-self: end;
  position: relative;
  z-index: 1;
}

.flow-metric {
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(24, 217, 210, 0.18);
  background: rgba(8, 18, 31, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.flow-metric strong {
  display: block;
  font-size: 32px;
  line-height: 1;
  color: var(--text);
}

.flow-metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.flow-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.flow-card-tag {
  border-radius: 999px;
  padding: 7px 12px;
  border: 1px solid rgba(24, 217, 210, 0.24);
  background: rgba(24, 217, 210, 0.08);
  color: #a2faf4;
  font-size: 12px;
  white-space: nowrap;
}

.flow-mindmap {
  display: grid;
  gap: 18px;
}

.flow-root-node {
  position: relative;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(24, 217, 210, 0.42);
  background:
    radial-gradient(circle at top right, rgba(24, 217, 210, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(10, 31, 44, 0.98), rgba(6, 17, 29, 0.98));
  box-shadow: 0 0 32px rgba(24, 217, 210, 0.12);
}

.flow-root-node strong {
  display: block;
  margin-top: 12px;
  font-size: 24px;
}

.flow-root-node p {
  margin: 12px 0 0;
  color: #bfd0e4;
  line-height: 1.7;
}

.flow-step-stream {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.flow-step-node {
  position: relative;
  min-height: 100%;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(109, 135, 163, 0.24);
  background: rgba(8, 15, 26, 0.86);
  overflow: hidden;
}

.flow-step-node::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, rgba(24, 217, 210, 0.85), rgba(24, 217, 210, 0));
}

.flow-step-node h4,
.flow-module-card h4 {
  margin: 10px 0 10px;
  font-size: 18px;
}

.flow-node-tag {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(24, 217, 210, 0.12);
  color: #95f8f2;
  font-size: 11px;
  letter-spacing: 0.8px;
}

.flow-node-bullets,
.flow-branch-actions,
.flow-module-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.flow-node-bullets span,
.flow-branch-actions span,
.flow-module-items span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(109, 135, 163, 0.16);
  color: #dce7f4;
  font-size: 12px;
  line-height: 1.5;
}

.flow-branch-grid,
.flow-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.flow-branch-card,
.flow-module-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(109, 135, 163, 0.22);
  background: rgba(7, 14, 25, 0.82);
}

.flow-branch-card {
  position: relative;
}

.flow-branch-card::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 44px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 191, 69, 0.92), rgba(255, 191, 69, 0));
}

.flow-branch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-top: 8px;
}

.flow-branch-head strong {
  font-size: 17px;
}

.flow-branch-head span,
.flow-module-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 191, 69, 0.12);
  color: #ffd38a;
  font-size: 12px;
}

.flow-module-badge {
  background: rgba(24, 217, 210, 0.1);
  color: #95f8f2;
}

.flow-playbook {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.flow-playbook-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(109, 135, 163, 0.2);
  background: rgba(8, 15, 26, 0.84);
}

.flow-playbook-index {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d8aa, #18d9d2);
  color: #04130f;
  font-weight: 800;
  font-size: 14px;
}

.ocr-result {
  margin-top: 12px;
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.6;
  min-height: 88px;
}

.ocr-crop-preview {
  display: block;
  max-width: min(900px, 100%);
  max-height: 220px;
  object-fit: contain;
  margin: 8px 0 12px;
  border: 1px solid rgba(151, 176, 208, 0.34);
  background: #06111e;
}

.manager-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 14px;
  flex-wrap: wrap;
}

.manager-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.manager-platform-section {
  width: 100%;
}

.manager-platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
  color: var(--muted);
  flex-wrap: wrap;
}

.manager-platform-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.manager-platform-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.manager-action-btn {
  border: 1px solid rgba(21, 213, 224, 0.3);
  background: rgba(21, 213, 224, 0.08);
  color: #b8e6eb;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.manager-action-btn:hover {
  background: rgba(21, 213, 224, 0.18);
  border-color: rgba(21, 213, 224, 0.5);
  color: #ffffff;
}

.manager-action-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

.manager-action-btn-danger {
  border-color: rgba(255, 77, 104, 0.4);
  background: rgba(255, 77, 104, 0.06);
  color: #fca5a5;
}

.manager-action-btn-danger:hover {
  background: rgba(255, 77, 104, 0.15);
  border-color: rgba(255, 77, 104, 0.55);
  color: #ffffff;
}

.manager-platform-count {
  color: var(--muted);
  white-space: nowrap;
}

.manager-platform-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 900;
}

.manager-platform-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.manager-card {
  padding: 15px;
  cursor: pointer;
}

.manager-card-info {
  min-width: 0;
}

.manager-card.status-ok {
  border-color: rgba(24, 217, 210, 0.58);
}

.manager-card.status-suspect {
  border-color: rgba(255, 77, 104, 0.76);
}

.manager-card.is-paused {
  border-color: rgba(123, 150, 182, 0.5);
  background: linear-gradient(145deg, rgba(14, 24, 37, 0.94), rgba(8, 15, 27, 0.98));
  box-shadow: inset 0 0 0 1px rgba(140, 168, 201, 0.04);
}

.task-title {
  font-weight: 900;
  font-size: 17px;
}

.status {
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(109, 135, 163, 0.18);
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  flex: none;
  white-space: nowrap;
}

.status.tone-ok {
  background: rgba(24, 217, 210, 0.15);
  color: var(--accent);
  border-color: rgba(24, 217, 210, 0.3);
  box-shadow: 0 0 14px rgba(24, 217, 210, 0.12);
}

.status.tone-pending {
  background: rgba(255, 191, 69, 0.16);
  color: var(--warn);
  border-color: rgba(255, 191, 69, 0.32);
  box-shadow: 0 0 14px rgba(255, 191, 69, 0.1);
}

.status.tone-bad {
  background: rgba(255, 77, 104, 0.16);
  color: var(--bad);
  border-color: rgba(255, 77, 104, 0.3);
  box-shadow: 0 0 14px rgba(255, 77, 104, 0.1);
}

.status.tone-neutral {
  background: rgba(109, 135, 163, 0.18);
  color: #bfd0e4;
  border-color: rgba(140, 168, 201, 0.22);
}

.manager-value {
  margin: 12px 0;
  font-size: 30px;
  font-weight: 900;
}

.debug-lines {
  display: grid;
  gap: 5px;
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-preview-box {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(109, 135, 163, 0.34);
  border-radius: 8px;
  background: rgba(4, 10, 18, 0.7);
}

.page-preview-box.tone-ok {
  border-color: rgba(24, 217, 210, 0.38);
}

.page-preview-box.tone-pending {
  border-color: rgba(255, 191, 69, 0.42);
}

.page-preview-box.tone-bad {
  border-color: rgba(255, 77, 104, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 104, 0.08);
}

.page-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050b14;
}

.page-preview-placeholder {
  color: var(--muted);
  font-weight: 800;
}

.page-preview-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(3, 8, 14, 0.78);
  color: #e8f2ff;
  font-size: 12px;
}

.page-preview-overlay small {
  color: var(--muted);
  white-space: nowrap;
}

.page-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
  gap: 16px;
}

.page-monitor-card {
  display: grid;
  gap: 12px;
}

.page-monitor-card.tone-bad {
  border-color: rgba(255, 77, 104, 0.76);
}

.page-preview-monitor {
  min-height: 260px;
}

.page-monitor-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.page-monitor-url,
.task-meta {
  overflow-wrap: anywhere;
}

.page-monitor-value {
  font-size: 28px;
  font-weight: 900;
}

.page-monitor-lines {
  display: grid;
  gap: 5px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.edge-launch-button {
  border-color: rgba(255, 131, 85, 0.62);
  color: #ff9a76;
  background: rgba(255, 122, 69, 0.1);
  box-shadow: 0 0 16px rgba(255, 122, 69, 0.08);
}

.edge-launch-button:hover {
  border-color: rgba(255, 131, 85, 0.9);
  background: rgba(255, 122, 69, 0.16);
}

.edge-launch-button.platform {
  padding: 6px 12px;
  font-weight: 700;
}

.edge-button-start {
  border-color: rgba(24, 217, 210, 0.62);
  color: #7ff6ee;
  background: rgba(24, 217, 210, 0.12);
  box-shadow: 0 0 16px rgba(24, 217, 210, 0.08);
}

.edge-button-start:hover {
  border-color: rgba(24, 217, 210, 0.9);
  background: rgba(24, 217, 210, 0.18);
}

.edge-button-show {
  border-color: rgba(255, 170, 93, 0.62);
  color: #ffc38a;
  background: rgba(255, 160, 76, 0.1);
}

.edge-button-show:hover {
  border-color: rgba(255, 170, 93, 0.9);
  background: rgba(255, 160, 76, 0.16);
}

.edge-button-hide {
  border-color: rgba(151, 176, 208, 0.48);
  color: #d2deec;
  background: rgba(109, 135, 163, 0.14);
  box-shadow: none;
}

.edge-button-hide:hover {
  border-color: rgba(151, 176, 208, 0.76);
  background: rgba(109, 135, 163, 0.2);
}

.edge-button-close {
  border-color: rgba(255, 77, 104, 0.62);
  color: #ff8aa0;
  background: rgba(255, 77, 104, 0.11);
  box-shadow: 0 0 16px rgba(255, 77, 104, 0.08);
}

.edge-button-close:hover {
  border-color: rgba(255, 77, 104, 0.9);
  background: rgba(255, 77, 104, 0.18);
}

.debug-panel {
  margin-top: 18px;
}

.sample-panel {
  min-height: 110px;
  overflow: auto;
}

.sample-item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  line-height: 1.6;
}

.empty-card {
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .hero-grid,
  .platform-groups {
    grid-template-columns: 1fr;
  }

  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-resize-handle {
    display: none;
  }

  .platform-cards {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .flow-hero-card,
  .flow-step-stream,
  .flow-playbook {
    grid-template-columns: 1fr;
  }

  .flow-branch-grid,
  .flow-module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .top-actions {
    justify-self: start;
    flex-wrap: wrap;
  }

  .tabs {
    height: 56px;
    gap: 16px;
  }

  .pill {
    justify-self: start;
  }

  main {
    padding: 16px;
  }

  .platform-cards {
    grid-template-columns: 1fr;
  }

  .flow-guide-card,
  .flow-hero-card {
    padding: 16px;
  }

  .flow-card-head,
  .flow-branch-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .flow-metrics {
    grid-template-columns: 1fr;
  }

  .page-monitor-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 绑定表格 ===== */
.bind-table {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bind-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgba(24, 36, 52, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.bind-shop { min-width: 0; }
.bind-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bind-platform { font-size: 11px; color: var(--muted); }
.bind-arrow { color: var(--muted); font-size: 16px; }
.bind-page { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bind-page-select { font-size: 12px; width: 100%; }
.bind-page-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(24, 36, 52, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.bind-page-card.is-selected {
  border-color: rgba(37, 208, 124, 0.6);
  box-shadow: 0 0 0 1px rgba(37, 208, 124, 0.18) inset;
}
.bind-page-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bind-page-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bind-page-card-url {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.bind-page-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bind-page-card-actions {
  display: flex;
  align-items: center;
}
.bind-page-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}
.bind-page-badge.is-bound {
  color: #8ff0bf;
  background: rgba(37, 208, 124, 0.14);
}
.bind-page-badge.is-match {
  color: #ffd479;
  background: rgba(255, 184, 77, 0.14);
}
.bind-recovery-card {
  padding: 12px;
  border: 1px dashed rgba(255, 184, 77, 0.45);
  border-radius: 8px;
  background: rgba(255, 184, 77, 0.08);
}
.bind-recovery-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.bind-recovery-detail {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.bind-recovery-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ===== 实时看板新 UI 样式 ===== */
body.dashboard-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.dashboard-view.active {
  display: grid;
  gap: 16px;
}

.dashboard-top-frame,
.dashboard-brand-section {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(109, 135, 163, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 26%),
    linear-gradient(145deg, rgba(8, 18, 31, 0.92), rgba(5, 11, 22, 0.96));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 18px 42px rgba(0, 0, 0, 0.24);
}

.dashboard-top-frame {
  padding: 14px 16px 16px;
}

.dashboard-brand-section {
  padding: 16px;
  margin-top: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 0;
  margin-bottom: 0;
  overflow: visible;
}

.summary-card-row {
  display: grid;
  grid-template-columns: repeat(var(--summary-columns, 4), minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.platform-summary-grid {
  display: contents;
}

.summary-time-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 30px;
  pointer-events: none;
}

.total-card-shell {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
  min-width: 0;
  grid-column: span var(--total-span, 2);
}

.total-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 12px;
  padding: 18px 24px 20px;
  min-height: 218px;
  background: linear-gradient(145deg, rgba(8, 27, 44, 0.95), rgba(6, 18, 32, 0.95));
  border: 1px solid rgba(21, 213, 224, 0.4);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 16px 42px rgba(0, 0, 0, 0.32),
    0 0 28px rgba(21, 213, 224, 0.10);
  overflow: hidden;
}

.total-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #15d5e0, #2df5e7);
  box-shadow: 0 0 18px rgba(21, 213, 224, 0.7);
}

.total-card-time-left {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  pointer-events: none;
}

.total-card-date-range {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: #8899b4;
  white-space: nowrap;
}

.total-card-time-label {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  color: #b7c6da;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(21, 213, 224, 0.10);
}

.total-card-time-value {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  color: #eef4ff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}

.total-card-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
}

.total-gmv {
  font-size: clamp(44px, 3.4vw, 64px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -1.8px;
  color: #ffffff;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.10);
}

.total-metrics {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
}

.total-card-bottom {
  display: flex;
  flex-direction: column;
  margin-top: auto;
}

.metric-label {
  font-size: 13px;
  color: #aab7c9;
  margin-bottom: 4px;
}

.total-target {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.total-progress-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: #ffffff;
}

.total-metrics-sep {
  font-size: 24px;
  color: var(--line);
  font-weight: 300;
  align-self: center;
  user-select: none;
}

.total-yoy-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: var(--muted);
}

.total-yoy-value.is-up {
  color: #ffffff;
}

.total-progress-value.is-below-target {
  color: var(--bad);
}

.total-yoy-value.is-down {
  color: var(--bad);
}

.total-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
  margin-top: 10px;
}

.total-sparkline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 70px;
  pointer-events: none;
  opacity: 0.65;
}

.total-progress-fill {
  height: 100%;
  width: var(--progress-width);
  border-radius: inherit;
  background: linear-gradient(90deg, #19d7df, #2df5e7);
  box-shadow: 0 0 18px rgba(29, 226, 224, 0.72);
}

.summary-card-row[data-layout="featured-line"] .total-card,
.summary-card-row[data-layout="featured-line"] .platform-summary-card {
  min-height: 196px;
}

.summary-card-row[data-layout="featured-line"] .total-card {
  padding: 18px 22px 20px;
}

.summary-card-row[data-layout="featured-line"] .total-gmv {
  font-size: clamp(44px, 3.2vw, 58px);
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.platform-summary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 12px;
  padding: 14px 16px 20px;
  min-height: 218px;
  background: linear-gradient(145deg, rgba(13, 24, 39, 0.96), rgba(8, 13, 24, 0.96));
  border: 1px solid color-mix(in srgb, var(--platform-color) 65%, transparent);
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.28),
    0 0 22px color-mix(in srgb, var(--platform-color) 12%, transparent);
}

.platform-summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--platform-color);
  box-shadow: 0 0 18px var(--platform-color);
}

.platform-summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.platform-summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--platform-color);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
}

.platform-summary-name {
  font-size: 21px;
  font-weight: 850;
  color: #fff;
}

.platform-current-label {
  font-size: 14px;
  color: #aab7c9;
  margin-bottom: 4px;
}

.platform-gmv {
  max-width: 100%;
  font-size: clamp(22px, 1.55vw, 28px);
  line-height: 1;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  margin-bottom: 10px;
}

.platform-target-row,
.platform-progress-row,
.platform-yoy-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.platform-target-label,
.platform-progress-label,
.platform-yoy-label {
  font-size: 14px;
  color: #aab7c9;
}

.platform-target-value {
  min-width: 0;
  font-size: clamp(12px, 0.9vw, 15px);
  font-weight: 700;
  color: #e3ebf6;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.platform-progress-value {
  min-width: 0;
  font-size: clamp(18px, 1.15vw, 21px);
  line-height: 1;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.platform-yoy-value {
  min-width: 0;
  font-size: clamp(18px, 1.15vw, 21px);
  line-height: 1;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.platform-yoy-value.is-up {
  color: #ffffff;
}

.platform-progress-value.is-below-target {
  color: var(--bad);
}

.platform-yoy-value.is-down {
  color: var(--bad);
}

.platform-card-bottom {
  display: flex;
  flex-direction: column;
  margin-top: auto;
}

.platform-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
  margin-top: auto;
}

.platform-progress-fill {
  height: 100%;
  width: var(--progress-width);
  background: var(--platform-color);
  border-radius: inherit;
  box-shadow: 0 0 12px color-mix(in srgb, var(--platform-color) 70%, transparent);
}

.platform-progress-fill.is-empty {
  width: 0%;
  background: transparent;
  box-shadow: none;
}

.store-grid {
  display: block;
  width: 100%;
  margin-top: 0;
}

.brand-area-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  width: 100%;
}

.brand-panel {
  position: relative;
  box-sizing: border-box;
  min-height: 476px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(11, 22, 38, 0.78), rgba(6, 13, 24, 0.88));
  border: 1px solid rgba(138, 160, 190, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.025) inset,
    0 14px 34px rgba(0, 0, 0, 0.20);
  overflow: hidden;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(80, 140, 180, 0.10), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(100, 110, 150, 0.08), transparent 30%);
  opacity: 0.65;
}

.brand-panel > * {
  position: relative;
  z-index: 1;
}

.brand-panel-main {
  border-color: rgba(110, 155, 180, 0.28);
  background: linear-gradient(145deg, rgba(11, 25, 40, 0.82), rgba(6, 14, 26, 0.88));
}

.brand-panel-sub {
  border-color: rgba(135, 120, 170, 0.28);
  background: linear-gradient(145deg, rgba(13, 20, 38, 0.82), rgba(7, 13, 25, 0.88));
}

.brand-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.brand-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-panel-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  color: #dce7f5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  flex-shrink: 0;
}

.brand-panel-icon-main {
  color: #dcefff;
  background: rgba(90, 150, 180, 0.14);
}

.brand-panel-icon-sub {
  color: #e4dcff;
  background: rgba(135, 120, 170, 0.16);
}

.brand-panel-title {
  margin: 0;
  font-size: 21px;
  line-height: 1;
  font-weight: 900;
  color: #f8fbff;
  letter-spacing: -0.3px;
}

.brand-store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.brand-panel-empty {
  grid-column: 1 / -1;
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(145, 166, 195, 0.28);
  border-radius: 12px;
  color: #8ea0b8;
  background: rgba(8, 16, 30, 0.22);
}

.store-card {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 13px 15px 11px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(12, 24, 40, 0.96), rgba(7, 13, 24, 0.96));
  border: 1px solid color-mix(in srgb, var(--platform-color) 70%, transparent);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 12px 30px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--duration-normal) var(--ease-standard),
              border-color var(--duration-normal) var(--ease-standard),
              box-shadow var(--duration-normal) var(--ease-standard);
}

.store-card > :not(.top-bloom) {
  position: relative;
  z-index: 4;
}

.store-card:not(.is-alert):hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--platform-color) 90%, transparent);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 18px 40px rgba(0, 0, 0, 0.32),
    0 0 20px color-mix(in srgb, var(--platform-color) 18%, transparent);
}

.store-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(100% - 32px);
  height: 8px;
  border-radius: 0 0 999px 999px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--platform-color) 68%, #04111d) 0%,
    color-mix(in srgb, var(--platform-color) 88%, #0a1a2d) 22%,
    var(--platform-color) 50%,
    color-mix(in srgb, var(--platform-color) 88%, #0a1a2d) 78%,
    color-mix(in srgb, var(--platform-color) 68%, #04111d) 100%
  );
  box-shadow:
    0 0 12px color-mix(in srgb, var(--platform-color) 56%, transparent),
    0 0 24px color-mix(in srgb, var(--platform-color) 22%, transparent);
  opacity: 0.96;
  pointer-events: none;
  z-index: 2;
}

.store-card::after {
  content: "";
  position: absolute;
  left: 50%;
  width: calc(100% - 32px);
  top: -6px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--platform-color) 28%, transparent) 0%,
    color-mix(in srgb, var(--platform-color) 54%, #ffffff) 26%,
    color-mix(in srgb, var(--platform-color) 24%, #ffffff) 50%,
    color-mix(in srgb, var(--platform-color) 54%, #ffffff) 74%,
    color-mix(in srgb, var(--platform-color) 28%, transparent) 100%
  );
  filter: blur(4px);
  opacity: 0;
  transform: translateX(-50%) scaleX(0.98);
  transform-origin: center top;
  pointer-events: none;
  z-index: 3;
}

.top-bloom {
  position: absolute;
  left: 50%;
  width: calc(100% - 36px);
  top: 2px;
  height: 30px;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--platform-color) 34%, #ffffff) 0%,
    color-mix(in srgb, var(--platform-color) 18%, transparent) 42%,
    transparent 74%
  );
  filter: blur(14px);
  opacity: 0;
  transform: translateX(-50%) scaleX(0.86);
  transform-origin: center top;
  pointer-events: none;
  z-index: 1;
}

.store-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-bottom: 8px;
  min-width: 0;
}

.store-title-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.platform-badge {
  height: 24px;
  min-width: 34px;
  padding: 0 7px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  flex-shrink: 0;
}

.platform-badge.platform-taobao {
  background: #ff3652;
}

.platform-badge.platform-jd {
  background: #ff7a18;
}

.platform-badge.platform-vip {
  background: #93a4b8;
}

.platform-badge.platform-douyin {
  background: #18c7f3;
}

.platform-badge.platform-dewu {
  background: #35d47f;
}

.platform-badge.platform-xiaohongshu {
  background: #ff5c8a;
}

.platform-badge.platform-other {
  background: #8ea0b8;
}

.store-chip {
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b9c6d8;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.card-badge {
  flex-shrink: 0;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 0 5px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.store-source-pill {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  color: #dbe7f6;
  background: rgba(109, 135, 163, 0.18);
  border: 1px solid rgba(140, 168, 201, 0.24);
}
.badge-warn  { background: var(--status-warn-bg);  color: var(--status-warn-text);  border: 1px solid var(--status-warn-border); }
.badge-bad   { background: var(--status-bad-bg);   color: var(--status-bad-text);   border: 1px solid var(--status-bad-border); }
.badge-muted { background: var(--status-muted-bg); color: var(--status-muted-text); border: 1px solid var(--status-muted-border); }
.badge-info  { background: var(--status-info-bg);  color: var(--status-info-text);  border: 1px solid var(--status-info-border); }

/* 数值更新动画 (边框) */
@keyframes border-flash-anim {
  0% {
    background: var(--platform-color);
    box-shadow: 0 0 18px var(--platform-color);
    filter: brightness(1);
  }
  15% {
    background: var(--platform-color);
    box-shadow: 0 0 35px var(--platform-color), 0 0 15px var(--platform-color);
    filter: brightness(1.6) saturate(1.2);
  }
  100% {
    background: var(--platform-color);
    box-shadow: 0 0 18px var(--platform-color);
    filter: brightness(1);
  }
}

@keyframes store-top-flash {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleX(0.98);
  }
  22% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
  }
  58% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scaleX(1.02);
  }
}

@keyframes store-top-border-pulse {
  0% {
    filter: brightness(1);
    box-shadow:
      0 0 12px color-mix(in srgb, var(--platform-color) 56%, transparent),
      0 0 24px color-mix(in srgb, var(--platform-color) 22%, transparent);
  }
  22% {
    filter: brightness(1.7) saturate(1.2);
    box-shadow:
      0 0 16px color-mix(in srgb, var(--platform-color) 26%, #ffffff),
      0 0 34px color-mix(in srgb, var(--platform-color) 52%, #ffffff),
      0 0 64px color-mix(in srgb, var(--platform-color) 72%, transparent);
  }
  100% {
    filter: brightness(1);
    box-shadow:
      0 0 12px color-mix(in srgb, var(--platform-color) 56%, transparent),
      0 0 24px color-mix(in srgb, var(--platform-color) 22%, transparent);
  }
}

@keyframes store-top-bloom-pulse {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleX(0.86);
  }
  24% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1.02);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scaleX(1.08);
  }
}

@keyframes border-flash-total-anim {
  0% {
    background: linear-gradient(90deg, #15d5e0, #2df5e7);
    box-shadow: 0 0 18px rgba(21, 213, 224, 0.7);
    filter: brightness(1);
  }
  15% {
    background: linear-gradient(90deg, #15d5e0, #2df5e7);
    box-shadow: 0 0 35px rgba(21, 213, 224, 1), 0 0 20px rgba(21, 213, 224, 0.8);
    filter: brightness(1.4) saturate(1.2);
  }
  100% {
    background: linear-gradient(90deg, #15d5e0, #2df5e7);
    box-shadow: 0 0 18px rgba(21, 213, 224, 0.7);
    filter: brightness(1);
  }
}

.store-card.is-flashing::before {
  animation: store-top-border-pulse 1.05s ease-out forwards;
}

.store-card.is-flashing::after {
  animation: store-top-flash 0.72s ease-out forwards;
}

.store-card.is-flashing .top-bloom {
  animation: store-top-bloom-pulse 1.05s ease-out forwards;
}

.store-card.is-flashing .store-gmv {
  animation: store-gmv-highlight 0.92s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes store-gmv-highlight {
  0% {
    transform: translateY(0);
    filter: brightness(1);
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.1);
  }
  18% {
    transform: translateY(-2px);
    filter: brightness(1.1);
    text-shadow:
      0 0 14px color-mix(in srgb, var(--platform-color) 32%, #ffffff),
      0 0 30px color-mix(in srgb, var(--platform-color) 58%, transparent);
  }
  52% {
    transform: translateY(-1px);
    filter: brightness(1.05);
    text-shadow:
      0 0 10px color-mix(in srgb, var(--platform-color) 22%, #ffffff),
      0 0 22px color-mix(in srgb, var(--platform-color) 42%, transparent);
  }
  100% {
    transform: translateY(0);
    filter: brightness(1);
    text-shadow: 0 0 22px rgba(255, 255, 255, 0.1);
  }
}

.platform-summary-card.is-flashing::before {
  animation: border-flash-anim 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.total-card.is-flashing::before {
  animation: border-flash-total-anim 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 告警卡片脉冲动画 */
.store-card.is-alert {
  animation: card-pulse-border 2.4s ease-in-out infinite;
}
@keyframes card-pulse-border {
  0%, 100% { border-color: rgba(255,191,69,0.35); box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 12px 30px rgba(0,0,0,0.26); }
  50%       { border-color: rgba(255,191,69,0.72); box-shadow: 0 0 0 1px rgba(255,255,255,0.03) inset, 0 0 24px rgba(255,191,69,0.22), 0 12px 30px rgba(0,0,0,0.26); }
}

.platform-mini-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--platform-color);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.store-name {
  min-width: 0;
  font-size: 16px;
  line-height: 1;
  font-weight: 850;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-gmv {
  position: relative;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 16px;
  transform-origin: left center;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.1);
}

/* 「无实时GMV数据」直接占"实时GMV"的数字位：角标太小、扫视时看不见（用户反馈两轮），
   这里按"小标题"级别排：比金额小两档但加粗、近白，保证远距离也能读到。 */
.store-gmv.is-hint,
.platform-gmv.is-hint {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.2px;
  /* 行高对齐金额那一行（28px）：卡片高度不能被这行提示顶高 */
  line-height: 28px;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.16);
  white-space: nowrap;
}

/* 累计口径的视图里，小红书这类"无实时"渠道的角标比常规状态胶囊长一点，单独收窄字号 */
.store-card-status.is-no-live {
  font-size: 10px;
  padding: 3px 7px;
}

/* 「累计至 T-1」：绝对定位贴在累计金额下方，占的是 .store-gmv 的 16px 下边距空地，
   一点高度都不占 —— 这样小红书卡和其它店铺卡严格同高（180px），不会被这一行顶高。 */
.store-gmv-note {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.1;
  white-space: nowrap;
}

.store-card-bottom {
  margin-top: auto;
  padding-top: 10px;
}

.store-metrics {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  margin-bottom: 8px;
}

.store-metric-label {
  font-size: 15px;
  color: #aab7c9;
}

.store-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: #dce6f5;
}

.store-metrics > div:first-child .store-metric-value {
  font-size: 15px;
}

.store-metric-value.is-up {
  color: #ffffff;
}

.store-metric-value.is-below-target {
  color: var(--bad);
}

.store-metric-value.is-down {
  color: var(--bad);
}

.store-metrics-sep {
  font-size: 18px;
  color: var(--line);
  font-weight: 300;
  user-select: none;
  align-self: center;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
  margin-bottom: 7px;
}

.progress-fill {
  height: 100%;
  width: var(--progress-width);
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--platform-color),
    color-mix(in srgb, var(--platform-color) 70%, #ffffff)
  );
  box-shadow: 0 0 12px color-mix(in srgb, var(--platform-color) 65%, transparent);
}

.progress-fill.is-empty {
  width: 0%;
  background: transparent;
  box-shadow: none;
}

.platform-taobao { --platform-color: var(--color-taobao); }
.platform-jd { --platform-color: var(--color-jd); }
.platform-dewu { --platform-color: var(--color-dewu); }
.platform-douyin { --platform-color: var(--color-douyin); }
.platform-vip { --platform-color: var(--color-vip); }
.platform-xiaohongshu { --platform-color: var(--color-xiaohongshu); }
.platform-other { --platform-color: var(--color-other); }

@media (max-width: 1366px) {
  .dashboard-top-frame,
  .dashboard-brand-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand-area-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .brand-store-grid {
    grid-template-columns: 1fr;
  }
}

.last-update-hint {
  font-size: 13px;
  color: #7f8da3;
  white-space: nowrap;
  font-weight: 500;
}

/* ===== Responsive dashboard: tablet and mobile ===== */
@media (max-width: 1180px) {
  .brand-area-layout {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .mobile-yoy-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 21px;
    font-size: 12px;
    color: #8899b4;
    white-space: nowrap;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.dashboard-page {
    min-width: 0;
  }

  .app-header {
    height: auto;
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    align-items: center;
    row-gap: 8px;
    column-gap: 10px;
    padding: 10px 12px;
    /* 窄屏档：三个控件再缩一档，图标同步到 7px */
    --bar-h: 34px;
    --bar-font: 13px;
    --bar-pad: 12px;
    --bar-icon: 7px;
  }

  .header-brand {
    grid-area: brand;
    min-width: 0;
    gap: 10px;
  }

  .header-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .header-title {
    min-width: 0;
    font-size: 18px;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    grid-area: actions;
    gap: 8px;
    min-width: 0;
  }

  .activity-filter-label {
    font-size: 11px;
  }

  .header-actions > :not(#refreshCacheBtn):not(#wsStatus):not(#fullscreenToggle):not(#testDatasetScope),
  .header-actions .control-group {
    display: none !important;
  }

  .header-actions .test-dataset-refresh-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  #wsStatus {
    max-width: min(46vw, 220px);
  }

  .header-nav,
  body.dashboard-page.public-dashboard-mode .app-header .test-dataset-nav-row,
  body.dashboard-page.test-dashboard-mode .app-header .test-dataset-nav-row {
    grid-area: nav;
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .header-nav::-webkit-scrollbar,
  .test-dataset-nav-row::-webkit-scrollbar,
  .test-dataset-bar::-webkit-scrollbar {
    display: none;
  }

  .header-nav {
    height: 38px;
  }

  .nav-item {
    flex: 0 0 auto;
    font-size: 15px;
    padding: 10px 2px 12px;
  }

  .nav-item.active::after {
    bottom: 2px;
    width: 70px;
    height: 3px;
  }

  .test-dataset-bar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  main {
    width: 100%;
    max-width: 100%;
    padding: 10px 10px 24px;
    overflow-x: hidden;
  }

  .dashboard-view.active {
    gap: 12px;
  }

  .dashboard-top-frame,
  .dashboard-brand-section {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    padding: 10px;
    overflow: hidden;
  }

  .summary-grid,
  .summary-card-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .platform-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .summary-time-row {
    display: none;
  }

  .total-card-shell,
  .total-card {
    grid-column: 1 / -1;
  }

  .total-card,
  .platform-summary-card,
  .brand-panel,
  .store-card {
    min-width: 0;
  }

  .total-card {
    min-height: auto;
    padding: 16px;
    border-radius: 12px;
  }

  .total-card-title {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .total-gmv {
    font-size: clamp(36px, 12vw, 52px);
    letter-spacing: -1px;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }

  .total-card-bottom {
    padding-top: 18px;
  }

  .total-metrics {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "target ."
      "progress yoy";
    gap: 10px 14px;
  }

  .total-metrics > div {
    min-width: 0;
  }

  .total-metrics > div:nth-child(1) {
    grid-area: target;
  }

  .total-metrics > div:nth-child(2) {
    grid-area: progress;
  }

  .total-metrics > div:nth-child(4) {
    grid-area: yoy;
  }

  .total-metrics > div:nth-child(2) {
    text-align: left !important;
  }

  .total-metrics > div:nth-child(4) {
    text-align: right !important;
  }

  .total-metrics-sep {
    display: none;
  }

  .metric-label {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .total-target {
    font-size: clamp(17px, 5vw, 22px);
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }

  .total-progress-value,
  .total-yoy-value {
    font-size: clamp(24px, 8vw, 34px);
  }

  .total-progress-track {
    height: 9px;
    margin-top: 12px;
  }

  .platform-summary-card {
    min-height: auto;
    padding: 11px 10px 12px;
    border-radius: 10px;
    box-shadow:
      0 8px 20px rgba(0, 0, 0, 0.22),
      0 0 12px color-mix(in srgb, var(--platform-color) 8%, transparent);
  }

  .platform-summary-header {
    gap: 6px;
    margin-bottom: 7px;
    min-width: 0;
  }

  .platform-summary-icon {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    font-size: 14px;
    flex: 0 0 auto;
  }

  .platform-summary-name {
    min-width: 0;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .platform-current-label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .platform-gmv {
    max-width: 100%;
    font-size: clamp(19px, 5.7vw, 26px);
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    margin-bottom: 12px;
  }

  .platform-target-row,
  .platform-progress-row,
  .platform-yoy-row {
    gap: 6px;
    margin-bottom: 4px;
  }

  .platform-target-label,
  .platform-progress-label,
  .platform-yoy-label {
    font-size: 11px;
    flex: 0 0 auto;
  }

  .platform-target-value,
  .platform-progress-value,
  .platform-yoy-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }

  .platform-target-value {
    font-size: 11px;
  }

  .platform-progress-value,
  .platform-yoy-value {
    font-size: 16px;
  }

  .platform-progress-track {
    height: 8px;
  }

  .brand-area-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .brand-store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .brand-panel {
    min-height: auto;
    padding: 10px;
    border-radius: 12px;
  }

  .brand-panel-header {
    margin-bottom: 10px;
  }

  .brand-panel-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 15px;
  }

  .brand-panel-title {
    min-width: 0;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .store-card {
    min-height: auto;
    padding: 11px 10px 12px;
    border-radius: 10px;
  }

  .store-card:not(.is-alert):hover {
    transform: none;
  }

  .store-title-wrap,
  .store-status-tags {
    min-width: 0;
  }

  .store-card-header {
    gap: 6px;
    margin-bottom: 7px;
    min-width: 0;
  }

  .store-title-wrap {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
  }

  .store-name {
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .store-status-tags {
    flex: 0 0 auto;
    margin-left: auto;
    gap: 4px;
  }

  .store-card .store-chip,
  .store-card .status-badge {
    font-size: 10px;
    padding: 1px 6px;
  }

  .store-gmv {
    max-width: 100%;
    font-size: clamp(18px, 5.6vw, 23px);
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    margin-bottom: 12px;
  }

  .store-metrics {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
  }

  .store-metrics > div:not(.store-metrics-sep) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    text-align: left !important;
  }

  .store-metric-label {
    font-size: 11px;
    flex: 0 0 auto;
  }

  .store-metric-value {
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    text-align: right;
  }

  .store-metrics > div:first-child .store-metric-value {
    font-size: 11px;
  }

  .store-metrics-sep {
    display: none;
  }
}

@media (max-width: 420px) {
  .app-header {
    padding: 9px 10px;
    /* ≤420 再缩一档：三个控件一起缩，图标 6px */
    --bar-h: 32px;
    --bar-font: 12px;
    --bar-pad: 10px;
    --bar-icon: 6px;
  }

  .header-title {
    font-size: 16px;
  }

  .header-logo {
    width: 30px;
    height: 30px;
  }

  .header-actions .test-dataset-refresh-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  main {
    padding: 8px 8px 20px;
  }

  .dashboard-top-frame,
  .dashboard-brand-section {
    padding: 8px;
    border-radius: 10px;
  }

  .total-card {
    padding: 14px;
  }

  .total-gmv {
    font-size: clamp(34px, 11vw, 46px);
  }

  .total-metrics {
    gap: 8px 10px;
  }

  .total-target {
    font-size: clamp(15px, 4.8vw, 19px);
  }

  .platform-summary-card,
  .store-card {
    padding-left: 8px;
    padding-right: 8px;
  }

  .platform-gmv {
    font-size: clamp(18px, 5.6vw, 23px);
  }

  .store-gmv {
    font-size: clamp(18px, 5.6vw, 23px);
  }

  .store-metric-value {
    font-size: 16px;
  }

  .store-metrics > div:first-child .store-metric-value,
  .platform-target-value {
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .store-gmv {
    font-size: clamp(17px, 5.4vw, 22px);
  }

  .store-name {
    font-size: 12px;
  }

  .store-metric-value {
    font-size: 15px;
  }

  .store-metrics > div:first-child .store-metric-value,
  .platform-target-value {
    font-size: 9px;
  }
}

/* 看板店铺卡右上角的状态胶囊：与任务管理卡同一套文案/配色，靠标题行右端对齐。 */
.store-card-status {
  margin-left: auto;
  padding: 3px 9px;
  font-size: 11px;
  box-shadow: none;
}


/* ============================================================================
   任务管理页修复（2026-10-01 UI/UX 复审）
   约定来源：.page-preview-box(1841-1885) / .debug-status-panel(397-419) / .status.tone-*(1790+)
   .global-message 为 HEAD 原样恢复（本次重构误删的三条规则）
   ==========================================================================*/

/* ---- P0：缩略图尺寸约束（未约束的 720px 巡检图会撑破整页栅格） ---- */
.manager-card-main {
  display: block;
  margin-bottom: 10px;
  min-width: 0;
}

.task-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 132px;
  padding: 0;
  overflow: hidden;
  line-height: 0;
  border: 1px solid rgba(109, 135, 163, 0.34);
  border-radius: 8px;
  background: rgba(4, 10, 18, 0.7);
  cursor: zoom-in;
}

.task-thumb:hover {
  border-color: rgba(24, 217, 210, 0.55);
}

.task-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050b14;
}

.task-thumb-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

/* 角标必须留在画面上：原来排进 inline 流、随图片宽度漂移 */
.task-thumb-tag,
.task-thumb-error {
  position: absolute;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(3, 8, 14, 0.78);
  color: #e8f2ff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-thumb-tag { right: 8px; }
.task-thumb-tag.is-stale { color: #bfd0e4; }
.task-thumb-tag.is-refreshing { color: var(--warn); }
.task-thumb-error { left: 8px; color: var(--bad); }

/* ---- P0：缩略图大图弹层（原来整族类零规则 = 点了没反应） ---- */
.thumb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(3, 8, 14, 0.72);
}

.thumb-lightbox-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(1040px, 100%);
  max-height: 100%;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background: rgba(8, 14, 24, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  color: #f8fbff;
}

.thumb-lightbox-panel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.thumb-lightbox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.thumb-lightbox-title { font-size: 16px; font-weight: 800; }
.thumb-lightbox-hint { color: var(--muted); font-size: 12px; }

.thumb-lightbox-body {
  display: grid;
  place-items: center;
  min-height: 200px;
  min-width: 0;
}

.thumb-lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 10px;
  background: #050b14;
}

.thumb-lightbox-loading {
  display: grid;
  gap: 10px;
  justify-items: center;
  color: var(--muted);
}

.thumb-lightbox-retry {
  justify-self: center;
}

/* ---- P0：全局反馈提示条（HEAD:1219-1245 被删，core.js 仍在生成该节点） ---- */
.global-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid rgba(128, 154, 255, 0.32);
  border-radius: 14px;
  background: rgba(7, 13, 28, 0.92);
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--duration-normal) var(--ease-standard),
              transform var(--duration-normal) var(--ease-standard);
}

.global-message.show { opacity: 1; transform: translateY(0); }
.global-message.bad-text { color: var(--bad); border-color: rgba(255, 77, 104, 0.42); }

/* ---- P1：卡片信息区（胶囊/品牌/Edge 状态行原来全零规则） ---- */
.manager-live { min-width: 0; }

.task-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* 与看板店铺卡同一套胶囊尺寸（.store-card-status: 3px 9px / 11px） */
.task-tags .status,
.edge-status-chips .status {
  padding: 3px 9px;
  font-size: 11px;
  box-shadow: none;
}

.task-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.manager-value {
  font-variant-numeric: tabular-nums;
}

.edge-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.edge-status-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-brand {
  padding: 2px 8px;
  border: 1px solid var(--status-muted-border);
  border-radius: 999px;
  background: var(--status-muted-bg);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ---- P1：卡片状态边框（与徽标 tone 同源；等待类不再是红框） ---- */
.manager-card.status-pending {
  border-color: rgba(255, 191, 69, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 191, 69, 0.06);
}

/* ---- P1：键盘焦点与触控目标（全站此前 0 条 :focus 规则） ---- */
button:focus-visible,
select:focus-visible,
input:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

.manager-action-btn {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.task-actions button { min-height: 36px; }

@media (pointer: coarse) {
  .manager-action-btn,
  .task-actions button,
  .chip { min-height: 44px; padding: 10px 14px; }
}

/* ---- P1：断线状态色（HEAD:563/639 被删，core.js 仍切 bad 类） ---- */
.live-pill.bad { color: var(--bad); background: rgba(255, 77, 104, 0.15); }
.live-pill.bad .live-dot { background: var(--bad); box-shadow: 0 0 14px rgba(255, 77, 104, 0.85); }

/* ---- P1：大屏只读测试面板（零规则；长 source_url 曾把整页撑到 5220px） ---- */
.readonly-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.readonly-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.readonly-controls select { min-width: 220px; }

.readonly-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.readonly-log {
  margin: 12px 0 0;
  padding: 12px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07101c;
  color: #cfe0f5;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- P1：调试面板展开时不要压住任务卡（.debug-status-panel 是 fixed 浮层） ---- */
@media (min-width: 1100px) {
  body:has(#debugStatusPanel.is-open) main { padding-right: 424px; }
}

/* ---- P1：任务管理页此前完全没有响应式规则 ---- */
@media (max-width: 1366px) {
  .manager-platform-row { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

@media (max-width: 768px) {
  .manager-platform-row { grid-template-columns: minmax(0, 1fr); }
  .manager-platform-head { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .manager-tools { align-items: flex-start; }
  .task-thumb { min-height: 96px; }
  .manager-card { padding: 12px; }
  .task-actions button { flex: 1 1 auto; }
}

/* ===== 店铺配置页（云端配置库） ===== */
.config-block {
  margin-top: 18px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(15, 29, 45, 0.92), rgba(9, 18, 31, 0.96));
  border: 1px solid var(--line);
  border-radius: 16px;
}

.config-block h3 {
  font-size: 17px;
  margin: 0;
}

.config-block .section-title {
  align-items: center;
  gap: 12px;
}

#config .button-row {
  grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
  justify-content: start;
}

.config-table-wrap {
  margin-top: 10px;
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 13, 24, 0.6);
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.config-table th,
.config-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(109, 135, 163, 0.18);
  text-align: left;
  white-space: nowrap;
}

.config-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(9, 18, 31, 0.98);
  color: var(--muted);
  font-weight: 600;
}

.config-table input[type="text"],
.config-table input[type="number"] {
  width: 100%;
  min-width: 90px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 13, 24, 0.85);
  color: var(--text);
  font-size: 13px;
}

.config-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.config-row-remove {
  padding: 3px 8px;
  border: 1px solid var(--status-bad-border);
  border-radius: 8px;
  background: transparent;
  color: var(--status-bad-text);
  cursor: pointer;
}

.config-textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 13, 24, 0.85);
  color: var(--text);
  font-family: ui-monospace, Consolas, "Cascadia Mono", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}

.config-message {
  min-height: 20px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--status-muted-border);
  border-radius: 10px;
  background: var(--status-muted-bg);
  color: var(--muted);
  font-size: 13px;
}

.config-message.is-ok {
  border-color: var(--status-ok-border);
  background: var(--status-ok-bg);
  color: var(--status-ok-text);
}

.config-message.is-warn {
  border-color: var(--status-warn-border);
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.config-message.is-bad {
  border-color: var(--status-bad-border);
  background: var(--status-bad-bg);
  color: var(--status-bad-text);
}

/* 演练模拟：原生日期控件（color-scheme 让 Windows 的弹层跟深色主题一致） */
.config-date-input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 13, 24, 0.85);
  color: var(--text);
  font-size: 13px;
  color-scheme: dark;
}

.config-simulate-hint {
  align-self: center;
  color: var(--muted);
}
