/* ===================== 基础（后台页 + 大屏共享） ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #040a1a;
  --bg2: #081228;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #e8f2ff;
  --text-dim: #7e95b8;
  --accent: #2563eb;
  --cyan: #2563eb;
  --cyan2: #1b7fd6;
  --blue: #1d4ed8;
  --mint: #34f5c5;
  --green: #34f5c5;
  --gold: #ffd166;
  --yellow: #ffc53d;
  --red: #ff5d73;
  --rose: #ff5d73;
  --violet: #a78bfa;
  --line: rgba(240, 238, 234, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --tech: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(249, 69, 157, 0.08), transparent 60%),
    radial-gradient(1000px 700px at 90% 110%, rgba(29, 78, 216, 0.08), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
button {
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  transition: all .15s;
}
button:hover { background: rgba(255, 255, 255, 0.12); }
button.primary { background: var(--accent); border-color: var(--accent); color: #f0eeea; font-weight: 600; }
button.primary:hover { background: #3b82f6; }
button.danger { color: var(--red); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea {
  font-family: var(--font);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(249, 69, 157, 0.14); }
label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 4px; }
.hidden { display: none !important; }

/* ===================== 大屏 HUD（ji-gua 风格：近黑暖底 + 品红主色 + 极简） ===================== */
body.screen {
  overflow: hidden;
  /* ji-gua 风格变量覆盖（仅大屏） */
  --bg: #09080b;
  --bg2: #100d12;
  --card: rgba(255, 255, 255, 0.03);
  --card-border: rgba(240, 238, 234, 0.08);
  --text: #f0eeea;
  --text-dim: #8a8790;
  --accent: #f9459d;
  --cyan: #f9459d;
  --cyan2: #ff6bb4;
  --blue: #c9368a;
  --mint: #4ade80;
  --green: #34d399;
  --gold: #ffd166;
  --yellow: #ffc53d;
  --red: #ff4d6d;
  --rose: #f9459d;
  --violet: #b48ef0;
  --line: rgba(249, 69, 157, 0.14);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(249, 69, 157, 0.07), transparent 60%),
    var(--bg);
}

/* 静态网格线框：ji-gua 极简，仅保留超淡品红点阵 */
body.screen::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(249, 69, 157, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(249, 69, 157, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(120% 100% at 50% 40%, #000 35%, transparent 100%);
  mask-image: radial-gradient(120% 100% at 50% 40%, #000 35%, transparent 100%);
}
/* 透视地面网格：移除（ji-gua 无此特效） */
body.screen::after { display: none; }

#fxCanvas { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

.scanline { display: none; }

#screen { position: relative; z-index: 2; height: 100vh; padding: 24px 40px 20px; display: flex; flex-direction: column; gap: 14px; }

/* ---- 头部（ji-gua 极简导航） ---- */
.screen header { display: flex; align-items: center; flex-wrap: wrap; row-gap: 8px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 14px; flex: none; }
.brand .logo { position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.logo-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(249, 69, 157, 0.5); box-shadow: 0 0 14px rgba(249, 69, 157, 0.25); animation: spin 18s linear infinite; }
.logo-core {
  position: relative; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #0a0810;
  background: radial-gradient(circle at 35% 30%, #ff8ac4, #f9459d 58%, #b02c74);
  box-shadow: 0 0 20px rgba(249, 69, 157, 0.55), inset 0 0 6px rgba(255, 255, 255, 0.4);
}
.brand-title {
  font-family: var(--tech); font-size: 22px; font-weight: 700; letter-spacing: 1px; line-height: 1;
  color: #f0eeea;
}
.brand-sub { font-family: var(--ui); font-size: 10px; letter-spacing: 1.5px; color: rgba(240, 238, 234, 0.5); margin-top: 5px; }
.header-divider { flex: 1; height: 1px; margin: 0 24px; background: rgba(240, 238, 234, 0.08); }
.header-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: rgba(240, 238, 234, 0.65); flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.sys-status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--ui); font-size: 11px; letter-spacing: 1px; color: var(--mint); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.eq i { width: 3px; background: var(--mint); border-radius: 1px; transform-origin: bottom; }
.eq i:nth-child(1) { height: 50%; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { height: 90%; animation: eq .8s ease-in-out .1s infinite; }
.eq i:nth-child(3) { height: 65%; animation: eq 1.1s ease-in-out .2s infinite; }
.eq i:nth-child(4) { height: 100%; animation: eq .7s ease-in-out .3s infinite; }
.eq i:nth-child(5) { height: 45%; animation: eq .95s ease-in-out .15s infinite; }
.update-status { font-size: 12px; }
.clock { font-family: var(--tech); font-size: 21px; font-weight: 600; letter-spacing: 1px; color: #f0eeea; }
.badge { background: rgba(255, 197, 61, 0.1); border: 1px solid rgba(255, 197, 61, 0.4); color: var(--gold); font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; letter-spacing: 1px; }
.fs-btn { background: transparent; border: 1px solid rgba(240, 238, 234, 0.18); color: rgba(240, 238, 234, 0.85); padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; letter-spacing: 1px; font-family: var(--ui); white-space: nowrap; }
.fs-btn:hover { background: rgba(240, 238, 234, 0.08); border-color: rgba(240, 238, 234, 0.35); color: #fff; }
.fs-btn.logout { border-color: rgba(255, 77, 109, 0.4); color: #ff9aab; }
.fs-btn.logout:hover { background: rgba(255, 77, 109, 0.15); border-color: #ff4d6d; color: #fff; }
.user-name { font-size: 12px; color: rgba(240, 238, 234, 0.6); letter-spacing: 1px; }

/* ---- 汇总条：ji-gua 整体可视化面板 ---- */
.summary { display: block; }
.hero-panel {
  position: relative; border-radius: 14px; padding: 20px 26px 18px;
  display: flex; gap: 30px; align-items: stretch;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(240, 238, 234, 0.09);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.hero-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(249, 69, 157, 0.6), transparent); }
.hero-left { flex: 1.35; min-width: 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.hero-title { font-family: var(--ui); font-size: 12px; letter-spacing: 2px; color: var(--text-dim); display: flex; align-items: center; gap: 10px; }
.hero-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 1px; padding: 2px 8px; border-radius: 20px;
  color: #ffd9a0; background: rgba(255, 184, 107, 0.08); border: 1px solid rgba(255, 184, 107, 0.3);
}
.hero-value {
  font-family: var(--tech); font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: .5px;
  color: #f0eeea;
}
.hero-delta { font-size: 16px; font-weight: 600; margin-left: 6px; vertical-align: middle; font-family: var(--mono); }
.hero-delta .up { color: var(--red); }
.hero-delta .down { color: var(--green); }
.hero-delta .flat { color: var(--text-dim); }
.hero-chart { margin-top: 4px; }
.hero-sub { font-size: 11px; color: var(--text-dim); font-family: var(--mono); letter-spacing: .5px; }
.hero-sub b { color: #ffd166; font-weight: 600; }

/* ---- 大屏主趋势图（近30天GMV）----
   日期/数值标签全部为 HTML 覆盖层：SVG 用 preserveAspectRatio="none"
   自适应拉伸时，文字不会跟着拉变形 */
.big-trend { width: 100%; }
.big-trend-body { position: relative; }
.big-trend-body svg { display: block; }
.big-dot {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: #eaffff;
  box-shadow: 0 0 10px rgba(249, 69, 157, 0.9), 0 0 3px #fff;
  transform: translate(-50%, -50%); pointer-events: none;
}
.y-tick {
  position: absolute; left: 0; width: 40px; text-align: right;
  font-size: 9px; font-family: var(--mono); line-height: 1;
  color: rgba(240, 238, 234, 0.38);
  transform: translateY(-50%); pointer-events: none;
}
.big-trend-x { position: relative; height: 15px; margin-top: 2px; }
.ax-tick {
  position: absolute; top: 0;
  font-size: 10px; font-family: var(--mono); letter-spacing: .5px;
  color: rgba(240, 238, 234, 0.45); white-space: nowrap;
  transform: translateX(-50%);
}
.ax-tick.first { transform: none; }
.ax-tick.last { transform: translateX(-100%); }
.hero-right {
  flex: 1; display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 2px 28px; align-content: center; min-width: 0;
  padding-left: 26px; border-left: 1px solid rgba(240, 238, 234, 0.07);
}
.hero-metric {
  display: flex; flex-direction: column; gap: 2px;
  padding: 5px 0;
}
.hm-label { font-family: var(--ui); font-size: 11px; letter-spacing: 1px; color: var(--text-dim); }
.hm-value { font-family: var(--tech); font-size: 24px; font-weight: 700; line-height: 1.15; color: var(--c, #fff); }
.hm-sub { font-size: 10px; color: var(--text-dim); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-metric .up { color: var(--red); }
.hero-metric .down { color: var(--green); }
.hero-metric .flat { color: var(--text-dim); }
.hero-metric.gmv { --c: #ffd166; }
.hero-metric.roi { --c: #34f5c5; }
.hero-metric.orders { --c: #f9459d; }
.hero-metric.visitors { --c: #b48ef0; }
.hero-metric.conv { --c: #4ade80; }
@media (max-width: 1100px) {
  .hero-panel { flex-direction: column; gap: 16px; }
  .hero-value { font-size: 36px; }
  .hero-right { grid-template-columns: repeat(5, 1fr); padding-left: 0; border-left: none; }
  .hero-metric { padding: 4px 0; }
  .hm-value { font-size: 18px; }
}
@media (max-width: 760px) {
  .hero-right { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 店铺卡片（ji-gua 简洁风） ---- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; flex: 1; min-height: 0; overflow-y: auto; align-content: stretch; }
.shop-card {
  position: relative; border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 11px; cursor: pointer; min-height: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(240, 238, 234, 0.09);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.shop-card::before { content: ''; position: absolute; top: 0; left: 14px; right: 14px; height: 1.5px; background: linear-gradient(90deg, transparent, rgba(249, 69, 157, 0.5), transparent); opacity: 0; transition: opacity .18s; }
.shop-card:hover { transform: translateY(-2px); border-color: rgba(249, 69, 157, 0.4); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45); }
.shop-card:hover::before { opacity: 1; }
/* 拖拽排序状态 */
.shop-card.dragging { opacity: .45; cursor: grabbing; }
.shop-card.drag-over { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); transform: translateY(-2px); }
.shop-head { display: flex; align-items: center; gap: 9px; }
.shop-name { font-size: 15px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .5px; color: #f0eeea; }
.shop-last { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; position: relative; }
.dot.ok { background: var(--green); }
.dot.scraping { background: var(--yellow); animation: pulse 1s infinite; }
.dot.error, .dot.need_relogin, .dot.login_error { background: var(--red); }
.dot.idle, .dot.paused { background: #4a5266; }
.dot.live { background: #ff5d73; animation: pulse 1s infinite; }
.shop-main { display: flex; align-items: center; gap: 14px; }
.gmv-block { flex: 1; min-width: 0; }
.gmv-label { font-family: var(--ui); font-size: 11px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 3px; text-transform: uppercase; }
.gmv-value { font-family: var(--tech); font-size: 30px; font-weight: 700; color: #ffd166; line-height: 1.05; transition: filter .35s, color .35s; }
.gmv-delta { font-size: 12px; margin-top: 4px; font-family: var(--mono); }
.gmv-delta.up { color: var(--red); }
.gmv-delta.down { color: var(--green); }
.gmv-delta.flat { color: var(--text-dim); }
.gmv30-line { font-size: 13px; color: #b48ef0; margin-top: 3px; font-weight: 600; font-family: var(--tech); }
.spark-block { text-align: center; flex: none; }
.spark-label { font-family: var(--ui); font-size: 10px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 3px; }
.shop-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; border-top: 1px solid rgba(240, 238, 234, 0.07); padding-top: 10px; }
.shop-stats .stat { text-align: center; position: relative; }
.shop-stats .stat:not(:first-child)::before { content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 1px; background: rgba(240, 238, 234, 0.07); }
.shop-stats .k { font-family: var(--ui); font-size: 10px; letter-spacing: 1px; color: var(--text-dim); }
.shop-stats .v { font-size: 14px; font-weight: 600; font-family: var(--tech); color: #f0eeea; }

/* ---- 底部面板 ---- */
.bottom-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; min-height: 160px; }
.panel {
  position: relative; border-radius: 12px; padding: 14px 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 30px rgba(0, 0, 0, 0.4);
}
.panel::before, .panel::after { content: ''; position: absolute; width: 13px; height: 13px; pointer-events: none; filter: drop-shadow(0 0 5px rgba(249, 69, 157, 0.7)); }
.panel::before { top: -1px; left: -1px; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); border-top-left-radius: 6px; }
.panel::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); border-bottom-right-radius: 6px; }
.panel-title { font-family: var(--ui); font-size: 14px; font-weight: 600; letter-spacing: 1px; margin-bottom: 10px; display: flex; align-items: center; gap: 9px; color: #f0eeea; }
.pt-ico { color: var(--cyan); font-size: 13px; text-shadow: 0 0 10px var(--cyan); }
table.prod { width: 100%; border-collapse: collapse; font-size: 13px; }
table.prod th { text-align: left; color: var(--text-dim); font-family: var(--ui); letter-spacing: 1px; font-weight: 500; padding: 5px 8px; border-bottom: 1px solid rgba(240, 238, 234, 0.08); font-size: 11px; text-transform: uppercase; }
table.prod td { padding: 4px 8px; border-bottom: 1px solid rgba(240, 238, 234, 0.06); }
table.prod tr { transition: background .15s; }
table.prod tbody tr:hover { background: rgba(249, 69, 157, 0.07); }
table.prod tr:last-child td { border-bottom: none; }
table.prod td.num { font-family: var(--tech); text-align: right; color: #f0eeea; font-size: 12px; }
.rank { width: 26px; height: 26px; border-radius: 6px; background: rgba(249, 69, 157, 0.08); border: 1px solid rgba(249, 69, 157, 0.25); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; font-family: var(--tech); color: #f9459d; }
.rank.top { background: linear-gradient(135deg, rgba(249, 69, 157, 0.9), rgba(176, 44, 116, 0.9)); color: #f0eeea; box-shadow: 0 0 12px rgba(249, 69, 157, 0.5); border-color: transparent; }
.live-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid rgba(240, 238, 234, 0.06); font-size: 13px; }
.live-row:last-child { border-bottom: none; }
.live-row .shop-name { font-size: 13px; flex: none; max-width: 120px; }
.live-row .live-room { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.live-row .num { font-family: var(--tech); color: var(--cyan); font-size: 12px; }

/* 底部面板内容限高滚动，把垂直空间留给上面的店铺数据 */
#productsPanel, #livePanel { max-height: 210px; overflow-y: auto; }

.empty { color: var(--text-dim); text-align: center; padding: 40px 0; font-size: 14px; line-height: 2; letter-spacing: 1px; }
.spark-empty { color: var(--text-dim); font-size: 11px; padding: 10px 0; }

/* ---- 近30天趋势表（店铺卡内） ---- */
.trend30 { border-top: 1px solid rgba(240, 238, 234, 0.08); padding-top: 8px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.trend30-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-dim); margin-bottom: 6px; flex-wrap: wrap; }
.trend30-head .up { color: var(--red); }
.trend30-head .down { color: var(--green); }
.trend30-head .flat { color: var(--text-dim); }
.trend30-scroll { flex: 1; min-height: 80px; overflow-y: auto; border: 1px solid rgba(240, 238, 234, 0.08); border-radius: 6px; }
.trend30-t { width: 100%; border-collapse: collapse; font-size: 11px; }
.trend30-t th { text-align: left; color: var(--text-dim); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid rgba(240, 238, 234, 0.08); background: rgba(12, 9, 14, 0.92); position: sticky; top: 0; }
.trend30-t td { padding: 3px 6px; border-bottom: 1px solid rgba(249, 69, 157, 0.07); font-family: var(--mono); color: #d8d4dc; }
.trend30-t td.num, .trend30-t th.num { text-align: right; }
.trend30-t td.q, .trend30-t th.q { text-align: right; white-space: nowrap; }
.trend30-t td.d { white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend30-t .d-tag {
  font-style: normal; font-size: 9px; font-weight: 600; margin-left: 5px;
  color: var(--mint); border: 1px solid rgba(52, 243, 197, 0.4);
  border-radius: 8px; padding: 0 5px; letter-spacing: .5px;
}
.trend30-t tr.latest td { background: rgba(249, 69, 157, 0.07); }
.trend30-t tr.latest td.d { color: #ffd166; }
.trend30-t .up { color: var(--red); }
.trend30-t .down { color: var(--green); }
.trend30-t .flat { color: var(--text-dim); }
.trend30-empty { color: var(--text-dim); font-size: 11px; text-align: center; padding: 8px 0; }

/* ---- 载体分布 ---- */
.carrier { border-top: 1px solid rgba(240, 238, 234, 0.08); padding-top: 8px; }
.carrier-bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; gap: 1px; }
.carrier-bar .seg { height: 100%; }
.carrier-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11px; color: var(--text-dim); }
.carrier-legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.carrier-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.carrier-empty { color: var(--text-dim); font-size: 11px; padding: 6px 0; }

/* ---- 单店聚焦大屏 ---- */
#focusOverlay {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; padding: 30px 48px; gap: 18px; overflow: auto;
  background: radial-gradient(1200px 700px at 50% -10%, rgba(249, 69, 157, 0.08), transparent 60%), rgba(9, 8, 11, 0.97);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#focusOverlay .fo-head { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(240, 238, 234, 0.12); }
#focusOverlay .fo-title { font-family: var(--tech); font-size: 28px; font-weight: 700; flex: 1; letter-spacing: 1px; color: #f0eeea; text-shadow: 0 0 22px rgba(249, 69, 157, 0.4); }
#focusOverlay .close-btn { font-size: 14px; padding: 8px 20px; letter-spacing: 1px; }
/* 顶部指标：4 核心卡 + 次要指标条 */
.fo-stats { display: flex; flex-direction: column; gap: 10px; }
.fo-core { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fo-core-item {
  padding: 10px 16px; border-radius: 10px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
}
.fo-core-item .k { display: block; font-size: 11px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 4px; }
.fo-core-item .v { display: block; font-size: 22px; font-weight: 700; color: #f0eeea; font-family: var(--tech); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fo-core-item.hot { border-color: rgba(249, 69, 157, 0.4); box-shadow: inset 0 0 18px rgba(249, 69, 157, 0.12); }
.fo-core-item.hot .v { color: #f9459d; text-shadow: 0 0 16px rgba(249, 69, 157, 0.5); }
.fo-sub { display: flex; flex-wrap: wrap; gap: 5px 18px; }
.fo-sub-item { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; white-space: nowrap; }
.fo-sub-item i { font-style: normal; color: var(--text-dim); }
.fo-sub-item b { font-weight: 600; color: #f0eeea; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.fo-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; flex: 1; align-items: start; }
/* 固定高度 + flex 布局，让近30天明细在面板内滚动而不是溢出压到下方面板 */
.fo-trend { display: flex; flex-direction: column; height: 250px; overflow: hidden; }
.fo-products table { font-size: 14px; }
.trend-line { stroke-dasharray: none; stroke-dashoffset: 0; }

/* ---- 店铺画像面板（人群画像 / 购买地域画像） ---- */
.fo-portrait, .fo-region { max-height: 460px; overflow-y: auto; }
.p-block { margin-bottom: 20px; }
.p-block:last-child { margin-bottom: 0; }
.p-label { font-family: var(--ui); font-size: 11px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 9px; }
.hbar-list { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 88px 1fr 108px; gap: 10px; align-items: center; font-size: 12px; }
.hbar-label { color: rgba(240, 238, 234, 0.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 11px; background: rgba(240, 238, 234, 0.08); border-radius: 6px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 6px; box-shadow: 0 0 8px rgba(249, 69, 157, 0.25); }
.hbar-val { text-align: right; font-family: var(--mono); color: rgba(240, 238, 234, 0.65); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-val em { font-style: normal; color: #ffd166; margin-left: 5px; font-size: 11px; }
.sex-track { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 2px; }
.sex-track i { display: block; height: 100%; }
.sex-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 9px; font-size: 12px; color: var(--text-dim); }
.sex-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sex-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.empty-hint { font-size: 11px; color: var(--muted); }

/* ---- 动画 ---- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 22px rgba(249, 69, 157, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.45); }
  50% { box-shadow: 0 0 40px rgba(249, 69, 157, 0.9), inset 0 0 10px rgba(255, 255, 255, 0.6); }
}
@keyframes shimmer { 0% { filter: brightness(1); } 50% { filter: brightness(1.35); } 100% { filter: brightness(1); } }
@keyframes scan { 0% { transform: translateY(0); } 100% { transform: translateY(calc(100vh + 240px)); } }
@keyframes gridFlow { to { background-position: 0 54px, 0 0; } }
@keyframes dividerScan { from { left: -30%; } to { left: 105%; } }
@keyframes barPulse { 0%, 100% { opacity: .15; } 50% { opacity: .85; } }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }

/* ===================== 响应式全屏适配 ===================== */
/* 中等屏（14 寸笔记本等）：改为可滚动 + 降列，避免覆盖/溢出 */
@media (max-width: 1600px) {
  body.screen { overflow-y: auto; }
  #screen { height: auto; min-height: 100vh; }
  .summary { grid-template-columns: repeat(4, 1fr); }
  .shop-grid { grid-template-columns: repeat(2, minmax(320px, 1fr)); overflow: visible; }
  .bottom-grid { grid-template-columns: 1fr; }
  .trend30 { flex: none; }
  .trend30-scroll { max-height: 260px; }
  .sum-card .value { font-size: 25px; }
  .gmv-value { font-size: 28px; }
  .brand-title { font-size: 20px; }
}

/* 导航栏溢出控制：中等屏逐步隐藏次要状态元素 */
@media (max-width: 1400px) {
  .sys-status { display: none; }
}
@media (max-width: 1200px) {
  .update-status { display: none; }
}

/* 平板 / 小笔记本 */
@media (max-width: 1000px) {
  .summary { grid-template-columns: repeat(3, 1fr); }
  .shop-grid { grid-template-columns: 1fr; }
  .fo-core { grid-template-columns: repeat(2, 1fr); }
  .fo-body { grid-template-columns: 1fr; }
  .brand-sub, .sys-status, .update-status, .clock, .header-divider { display: none; }
}

/* 手机 */
@media (max-width: 680px) {
  #screen { padding: 12px 12px 20px; gap: 10px; }
  .summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sum-card { padding: 10px 12px; }
  .sum-card .value { font-size: 19px; }
  .sum-card .label { font-size: 10px; }
  .sum-card .sub, .sum-card .sub30 { font-size: 10px; }
  .sum-card .sub30 { font-size: 13px; }
  .brand-title { font-size: 20px; letter-spacing: 1px; }
  .brand-sub, .sys-status, .update-status, .header-divider, .clock, .user-name { display: none; }
  .header-right { gap: 8px; flex-wrap: nowrap; flex: 1 0 100%; justify-content: flex-end; }
  .fs-btn { padding: 5px 10px; font-size: 12px; }
  .gmv-value { font-size: 22px; }
  .gmv-delta { font-size: 11px; }
  .gmv30-line { font-size: 12px; }
  .shop-card { padding: 12px 14px; }
  .shop-stats .k { font-size: 9px; }
  .shop-stats .v { font-size: 13px; }
  .trend30-scroll { max-height: 220px; }
  .fo-core { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .fo-core-item { padding: 8px 12px; }
  .fo-core-item .v { font-size: 17px; }
  .fo-sub { gap: 4px 14px; }
  .fo-sub-item { font-size: 11px; }
  /* 手机端聚焦页：趋势面板高度自适应，靠明细表自身滚动，避免压到下方热销商品 */
  .fo-trend { height: auto; min-height: 180px; overflow: visible; }
  #focusOverlay { padding: 14px 14px 30px; gap: 12px; }
  #focusOverlay .fo-title { font-size: 18px; }
  #focusOverlay .close-btn { font-size: 12px; padding: 6px 14px; }
}

/* ===================== 静态模式：关闭所有动态效果 ===================== */
body.screen, body.screen::before, body.screen::after,
body.screen *, body.screen *::before, body.screen *::after {
  animation: none !important;
  transition: none !important;
}

/* ===================== 滚动条 + 下拉框（蓝色系） ===================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(249, 69, 157, 0.06); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(249, 69, 157, 0.45); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(249, 69, 157, 0.75); }
select {
  background: rgba(249, 69, 157, 0.1);
  border: 1px solid rgba(249, 69, 157, 0.4);
  color: #ffd9ea;
}
select option { background: #1a0d14; color: #f0eeea; }

/* ===================== 大屏增强（v2 · 2026-09-03） ===================== */

/* ---- 时钟分块：日期 / 星期 / 时间 / 秒 ---- */
#clock { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
#clock .d-date { color: rgba(240, 238, 234, 0.55); font-size: 14px; letter-spacing: 1px; font-family: var(--ui); font-weight: 500; }
#clock .d-week { color: var(--accent); font-size: 14px; letter-spacing: 2px; padding: 1px 8px; border: 1px solid rgba(249, 69, 157, 0.35); border-radius: 4px; background: rgba(249, 69, 157, 0.08); font-family: var(--ui); font-weight: 600; }
#clock .d-time { font-size: 21px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
#clock .d-sec { font-style: normal; color: rgba(240, 238, 234, 0.45); font-size: 14px; margin-left: 1px; font-weight: 500; }

/* ---- Hero badge 增强 ---- */
.hero-badge { display: inline-flex; align-items: center; gap: 4px; }
.hero-badge.fallback { background: rgba(255, 197, 61, 0.12); border-color: rgba(255, 197, 61, 0.5); color: #ffd166; }
.hero-badge:not(.fallback) { background: rgba(52, 243, 197, 0.08); border-color: rgba(52, 243, 197, 0.3); color: #34f5c5; }

/* ---- Hero 实时直播条 ---- */
.hero-live { display: flex; gap: 24px; margin-top: 10px; padding: 8px 14px; background: rgba(255, 255, 255, 0.025); border: 1px solid rgba(240, 238, 234, 0.07); border-radius: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .5px; color: rgba(240, 238, 234, 0.6); }
.hero-live .hl-item { display: inline-flex; align-items: center; gap: 6px; }
.hero-live .hl-item b { color: #f0eeea; font-weight: 700; font-family: var(--tech); font-size: 14px; }
.hero-live .hl-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5d73; box-shadow: 0 0 8px #ff5d73; animation: pulse 1.2s ease-in-out infinite; display: inline-block; }

/* ---- Hero metric warn ---- */
.hero-metric.roi.warn { --c: #ff4d6d; }
.hero-metric.roi.warn .hm-value { text-shadow: 0 0 14px rgba(255, 77, 109, 0.45); }

/* ---- 店铺卡片告警 / 暂停 ---- */
.shop-card.alert { border-color: rgba(255, 77, 109, 0.45); box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.15), 0 10px 28px rgba(255, 77, 109, 0.12); }
.shop-card.alert::before { background: linear-gradient(90deg, transparent, rgba(255, 77, 109, 0.7), transparent); opacity: 1; }
.shop-card.disabled { opacity: .55; }

/* 后台页面滚动条（非大屏页保持蓝色调） */
body:not(.screen)::-webkit-scrollbar-track { background: rgba(37, 99, 235, 0.06); }
body:not(.screen)::-webkit-scrollbar-thumb { background: rgba(37, 99, 235, 0.5); }
body:not(.screen)::-webkit-scrollbar-thumb:hover { background: rgba(37, 99, 235, 0.8); }

/* ---- GMV 待更新态 ---- */
.gmv-value.pending { color: var(--text-dim); font-size: 26px; letter-spacing: 2px; }
.gmv-pending-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #ffd166; margin-left: 4px; box-shadow: 0 0 6px #ffd166; animation: pulse 1.2s ease-in-out infinite; vertical-align: middle; }

/* ---- 店铺统计 v 高亮 ---- */
.shop-stats .v.warn { color: #ff4d6d; text-shadow: 0 0 10px rgba(255, 77, 109, 0.3); }
.shop-stats .v.good { color: #34f5c5; }
