/* ==========================================================================
   Admetric · Editorial Precision Design System
   静谧纸灰画布 + 轻盈浅石膏侧栏 + 曜石黑/深翡翠绿金融终端配色
   ========================================================================== */
:root {
  --bg-canvas: #f5f5f2;
  --bg-sidebar: #ededeb;
  --bg-surface: #ffffff;
  --bg-subtle: #fafaf8;
  --bg-muted: #f0f0ec;
  --bg-obsidian: #15171a;
  --bg-obsidian-2: #1f2328;

  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --muted-2: #a1a1aa;

  --line: #e4e4df;
  --line-strong: #d4d4cd;
  --line-soft: #f0f0ec;

  --brand: #18181b;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --accent-bd: #a7f3d0;

  /* ROAS 四档克制语义色 */
  --roas-great-fg: #047857;
  --roas-great-bg: #ecfdf5;
  --roas-great-bd: #bbf7d0;
  --roas-good-fg: #0f766e;
  --roas-good-bg: #f0fdfa;
  --roas-good-bd: #99f6e4;
  --roas-warn-fg: #b45309;
  --roas-warn-bg: #fffbeb;
  --roas-warn-bd: #fde68a;
  --roas-low-fg: #be123c;
  --roas-low-bg: #fff1f2;
  --roas-low-bd: #fecdd3;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --ctrl-h: 34px;
  --ctrl-h-sm: 30px;
  --ctrl-focus: 0 0 0 3px rgba(24, 24, 27, 0.08);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --shadow-xs: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04), 0 1px 1px rgba(24, 24, 27, 0.02);
  --shadow-md: 0 12px 32px rgba(24, 24, 27, 0.10);

  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg-canvas);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg-canvas); color: var(--ink); }
button, select, input { font: inherit; color: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus { outline: none; }
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 小数部分微妙降调，呈现专业财务报表数字质感 */
.num-dec {
  font-size: 0.78em;
  opacity: 0.58;
  font-weight: 500;
}

/* ==================== 轻盈双栏壳层 ==================== */
.layout {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: 100vh;
}

aside {
  background: var(--bg-sidebar);
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 22px;
}

.brandmark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(21, 23, 26, 0.16);
}
.brandmark svg { width: 100%; height: 100%; display: block; }

.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.brand-name {
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
}
.brand-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-bd);
  border-radius: 5px;
  padding: 1.5px 6px;
  line-height: 1.25;
}

.workspace {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
}

.workicon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #e6f4f1;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e4e4df;
  color: var(--ink-2);
  flex-shrink: 0;
}

.workspace strong, .sidefoot strong { font-size: 13px; font-weight: 650; display: block; color: var(--ink); }
.workspace small, .sidefoot small { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }

.navlabel {
  margin: 24px 10px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.icon { width: 16px; height: 16px; display: block; flex-shrink: 0; }

nav { display: grid; gap: 3px; }
nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  color: #52525b;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 520;
  transition: background 0.14s ease, color 0.14s ease;
}
nav a .icon { opacity: 0.7; }
nav a:hover { background: rgba(24, 24, 27, 0.05); color: var(--ink); }
nav a.active {
  background: var(--bg-surface);
  color: var(--ink);
  font-weight: 640;
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.07), 0 0 0 1px rgba(24, 24, 27, 0.05);
}
nav a.active .icon { color: var(--accent); opacity: 1; }
nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidefoot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 0;
}

/* ==================== 顶栏与主体 ==================== */
main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 52px;
  background: rgba(245, 245, 242, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb .icon { color: var(--muted-2); width: 15px; height: 15px; }
.crumb b, footer b { font-weight: 400; color: var(--line-strong); }
.crumb strong { font-weight: 620; color: var(--ink); }

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--ink-2);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}
.sync-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.content {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 22px 28px 20px;
  flex: 1;
}

/* ==================== 标题区与通用按钮控件 ==================== */
.headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.headline-text { min-width: 0; }
.headline-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h1 { font-size: clamp(22px, 1.9vw, 27px); font-weight: 740; letter-spacing: -0.035em; line-height: 1.2; color: var(--ink); }
h2 { font-size: 15.5px; font-weight: 660; letter-spacing: -0.02em; color: var(--ink); }
.headline p { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-bd);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.daily-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.segmented {
  display: inline-flex;
  align-items: center;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  padding: 5.5px 11px;
  border-radius: 6px;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.segmented button:hover { color: var(--ink); }
.segmented button.is-active {
  background: var(--bg-surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
}
.segmented-sm button { padding: 4.5px 9.5px; font-size: 12px; }

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 7.5px 13px;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.btn-primary {
  background: var(--bg-obsidian);
  color: #fff;
  border: 1px solid var(--bg-obsidian);
}
.btn-primary:hover { background: #27272a; border-color: #27272a; }
.btn-primary .icon, .btn-secondary .icon { width: 14px; height: 14px; }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:enabled { background: var(--bg-subtle); border-color: #a1a1aa; color: var(--ink); }
.btn-secondary:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
.link-btn:hover { background: var(--accent-soft); }

/* 通用基础卡片 */
.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-header-left { min-width: 0; }
.eyebrow {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.card-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.meta-pill {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
  background: var(--bg-muted);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ==================== 视图 1：#overview 经营驾驶舱 ==================== */
.hero-banner {
  background: radial-gradient(circle at 88% 12%, rgba(15, 118, 110, 0.28) 0%, transparent 45%),
              linear-gradient(135deg, #141619 0%, #1c2026 100%);
  color: #f4f4f5;
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(225px, 1.05fr) minmax(158px, 0.72fr) minmax(430px, 2.15fr);
  gap: 24px;
  align-items: center;
  box-shadow: 0 10px 28px rgba(24, 24, 27, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-primary {
  padding-right: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-label {
  font-size: 12px;
  font-weight: 550;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #e4e4e7;
  white-space: nowrap;
}
.hero-badge.great { background: rgba(16, 185, 129, 0.24); color: #34d399; }
.hero-badge.good { background: rgba(20, 184, 166, 0.2); color: #6ee7b7; }
.hero-badge.warn { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.hero-badge.low { background: rgba(244, 63, 94, 0.22); color: #fda4af; }

.hero-amount {
  font-size: clamp(26px, 2.2vw, 33px);
  font-weight: 740;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #ffffff;
  margin: 12px 0 14px;
  white-space: nowrap;
}
.hero-subline {
  display: flex;
  align-items: center;
  gap: 9px 16px;
  flex-wrap: wrap;
  font-size: 12px;
  line-height: 1.45;
  color: #a1a1aa;
}
.hero-subline strong { color: #e4e4e7; font-weight: 600; }

.hero-metric {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 2px;
  min-width: 0;
}
.hero-metric-val {
  font-size: clamp(22px, 1.8vw, 27px);
  font-weight: 720;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.15;
  white-space: nowrap;
}
.hero-metric-val.is-green, .hero-metric-val.is-great { color: #34d399; }
.hero-metric-val.is-good { color: #6ee7b7; }
.hero-metric-val.is-warn { color: #fcd34d; }
.hero-metric-val.is-low { color: #fda4af; }
.hero-metric-sub { font-size: 12px; color: #a1a1aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-metric-foot { font-size: 11.5px; color: #71717a; margin-top: 2px; white-space: nowrap; }
.hero-progress {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 4px;
}
.hero-progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: #34d399;
  transition: width 0.2s ease, background-color 0.2s ease;
}

/* 总览右上方：收益核算（收益+入账/预估赔付+返点=收益合计）与综合 ROI 面板 */
.hero-roi-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(260px, 1.52fr) minmax(140px, 0.78fr);
  gap: 20px;
  align-items: center;
  min-width: 0;
}
.hero-calc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.hero-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  min-height: 22px;
}
.hero-calc-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #a1a1aa;
  white-space: nowrap;
  min-width: 0;
}
.hero-calc-op {
  display: inline-grid;
  place-items: center;
  width: 14px;
  font-weight: 700;
  color: #71717a;
  flex-shrink: 0;
}
.hero-calc-tag {
  font-size: 10px;
  font-weight: 550;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1.5px 6px;
  line-height: 1.35;
}
.hero-calc-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 580;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.35;
  white-space: nowrap;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.hero-calc-link:hover {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.45);
  background: rgba(16, 185, 129, 0.14);
}
.hero-calc-link.is-active {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(16, 185, 129, 0.12);
}
.hero-calc-val {
  font-size: 13px;
  font-weight: 620;
  color: #e4e4e7;
  white-space: nowrap;
}
.hero-calc-val.is-accent { color: #6ee7b7; }
.hero-calc-val.is-muted { color: #71717a; font-weight: 520; }
.hero-calc-breakdown {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding-left: 21px;
  padding-bottom: 2px;
  margin-top: -3px;
  font-size: 11px;
  line-height: 1.5;
  color: #71717a;
}
.hero-calc-breakdown b { font-weight: 600; color: #a1a1aa; }
.hero-calc-breakdown em { font-style: normal; color: #a1a1aa; font-weight: 580; }
.hero-bd-sep { font-style: normal; opacity: 0.45; }

.hero-calc-divider {
  border: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  margin: 4px 0;
}
.hero-calc-row.is-total .hero-calc-label {
  color: #f4f4f5;
  font-weight: 640;
}
.hero-calc-row.is-total .hero-calc-op {
  color: #6ee7b7;
}
.hero-calc-row.is-total .hero-calc-val {
  font-size: 15px;
  font-weight: 740;
  color: #ffffff;
}

.hero-roi-summary {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.hero-roi-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #a1a1aa;
}
.hero-roi-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-roi-meta strong { font-weight: 620; color: #e4e4e7; }

.ov-grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.ov-trend-card, .ov-zone-card, .ov-rank-card, .ov-ladder-card, .ov-country-card {
  padding: 18px 20px;
  min-width: 0;
}

.chart-legend-inline { display: flex; align-items: center; gap: 13px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot-bar { width: 9px; height: 9px; border-radius: 2.5px; background: #27272a; display: inline-block; }
.dot-line { width: 14px; height: 2.5px; border-radius: 2px; background: var(--accent); display: inline-block; }
.dot-ref { width: 14px; border-top: 1.5px dashed #a1a1aa; display: inline-block; }

.daily-svg-wrap {
  position: relative;
  width: 100%;
  height: 215px;
  margin-top: 14px;
  user-select: none;
}
.daily-svg-compact { height: 150px; margin-top: 0; }
.daily-svg-wrap svg { display: block; width: 100%; height: 100%; overflow: visible; }

.chart-tooltip {
  position: absolute;
  z-index: 15;
  top: 6px;
  background: rgba(20, 22, 25, 0.96);
  color: #f4f4f5;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  min-width: 188px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.chart-tooltip-date {
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.chart-tooltip-row { display: flex; justify-content: space-between; gap: 14px; color: #a1a1aa; }
.chart-tooltip-row strong { color: #fff; font-weight: 620; }

/* 时区横向堆叠占比条 + 结构列表（取代千篇一律的环形图） */
.zone-stack-bar {
  display: flex;
  gap: 3px;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  margin: 18px 0 16px;
  background: var(--bg-muted);
}
.zone-stack-seg { height: 100%; transition: width 0.25s ease; }

.zone-list { display: grid; gap: 12px; }
.zone-row {
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  display: grid;
  gap: 6px;
}
.zone-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.zone-name-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink); }
.zone-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.zone-pct { font-size: 14px; font-weight: 720; color: var(--ink); }
.zone-row-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* 总览底部双栏榜单 */
.ov-grid-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rank-list { display: grid; gap: 8px; margin-top: 14px; }
.rank-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.rank-item:hover { background: #fff; border-color: var(--line-strong); }
.rank-no {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-muted);
  color: var(--muted);
}
.rank-no.top { background: var(--bg-obsidian); color: #fff; }
.rank-info { min-width: 0; }
.rank-name { font-size: 13px; font-weight: 620; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar-track { height: 4px; border-radius: 99px; background: var(--bg-muted); margin-top: 6px; overflow: hidden; }
.rank-bar-track i { display: block; height: 100%; border-radius: 99px; background: #27272a; }
.rank-nums { text-align: right; white-space: nowrap; }
.rank-spend { display: block; font-size: 13px; font-weight: 680; color: var(--ink); }
.rank-roas { display: inline-block; font-size: 11.5px; font-weight: 650; margin-top: 2px; }

.ov-ladder-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.mini-ladder-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}
.mini-ladder-cell span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.mini-ladder-cell strong { display: block; font-size: 13px; font-weight: 720; margin-top: 4px; color: var(--ink); }

.ov-recent-list { display: grid; gap: 6px; margin-top: 12px; }
.recent-row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) minmax(116px, auto) 78px;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.12s ease;
}
.recent-row:hover { background: var(--bg-subtle); }
.recent-date { font-weight: 620; color: var(--ink); white-space: nowrap; }
.recent-date small { color: var(--muted); font-weight: 450; margin-left: 5px; }
.recent-spend { text-align: center; font-weight: 650; color: var(--ink); }
.recent-rev { text-align: center; color: var(--muted); font-size: 12px; }

/* 投放总览右下角：国家消耗占比与回收 */
.country-stack-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  gap: 2px;
  margin: 14px 0 12px;
  background: var(--bg-muted);
}
.country-stack-seg {
  height: 100%;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.country-stack-seg:hover { opacity: 0.85; }
.country-list { display: grid; gap: 8px; }
.country-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.country-item:hover { background: #fff; border-color: var(--line-strong); }
.country-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.country-info { min-width: 0; }
.country-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.country-name-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.country-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-pct-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.country-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-bar-track {
  height: 4px;
  border-radius: 99px;
  background: var(--bg-muted);
  margin-top: 6px;
  overflow: hidden;
}
.country-bar-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
}
.country-nums { text-align: right; white-space: nowrap; }
.country-spend {
  display: block;
  font-size: 13px;
  font-weight: 680;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.country-roas {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 650;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.country-item.is-other {
  background: transparent;
  border-style: dashed;
}
.country-item.is-other:hover { background: var(--bg-subtle); }
.country-drill-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.country-drill-tabs {
  display: inline-flex;
  background: var(--bg-muted);
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}
.country-drill-tabs button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.country-drill-tabs button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.country-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.country-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.country-legend-chip:hover { color: var(--ink); }
.country-legend-chip b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.drill-country-link {
  cursor: pointer;
  transition: background 0.12s ease;
}
.drill-country-link:hover { background: var(--bg-subtle); }

/* ==================== 视图 2：#daily 顶部财务核算带（左2核心 + 右5项赔付返点） ==================== */
.daily-finance-strip {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: minmax(190px, 0.95fr) minmax(205px, 1fr) minmax(460px, 2.55fr);
  margin-bottom: 14px;
  overflow: hidden;
}

.daily-finance-strip .strip-cell {
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.subsidy-board {
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #fafaf8 0%, #ffffff 100%);
  padding: 11px 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.subsidy-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.subsidy-board-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
}
.subsidy-sum-pill {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-muted);
  border-radius: 999px;
  padding: 1.5px 8px;
}
.subsidy-roi-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.subsidy-roi-pill.great { background: var(--roas-great-bg); color: var(--roas-great-fg); border-color: var(--roas-great-bd); }
.subsidy-roi-pill.good { background: var(--roas-good-bg); color: var(--roas-good-fg); border-color: var(--roas-good-bd); }
.subsidy-roi-pill.warn { background: var(--roas-warn-bg); color: var(--roas-warn-fg); border-color: var(--roas-warn-bd); }
.subsidy-roi-pill.low { background: var(--roas-low-bg); color: var(--roas-low-fg); border-color: var(--roas-low-bd); }
.subsidy-roi-pill.neutral { background: var(--bg-muted); color: var(--muted); }

.subsidy-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.subsidy-item {
  background: var(--bg-surface);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 7px 9px;
  min-width: 0;
}
.subsidy-item-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.subsidy-item-label em {
  font-style: normal;
  font-size: 10px;
  color: var(--accent);
  font-weight: 650;
}
.subsidy-item-val {
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 720;
  color: var(--ink);
  margin-top: 3px;
  white-space: nowrap;
}
.subsidy-item-val.is-zero { color: var(--muted-2); font-weight: 600; }
.subsidy-item-val.is-active { color: var(--accent); }

.money-pos { color: var(--accent); font-weight: 620; }
.money-zero { color: #b4b4bc; font-weight: 450; }
.total-val { color: var(--ink); font-weight: 700; }

/* 返点比例配置弹窗 */
.rates-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  width: min(420px, 92vw);
  padding: 20px 22px;
  color: var(--ink);
  box-shadow: 0 22px 60px rgba(24, 24, 27, 0.22);
}
.rates-dialog::backdrop { background: rgba(24, 24, 27, 0.45); backdrop-filter: blur(2px); }
.rates-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.rates-form { display: grid; gap: 12px; margin-top: 16px; }
.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-2);
}
.rate-input-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  height: 36px;
  width: 124px;
}
.rate-input-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08); }
.rate-input-box input { border: 0; background: transparent; width: 100%; font-size: 13.5px; font-weight: 650; text-align: right; outline: none; }
.rate-input-box em { font-style: normal; font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.rates-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ==================== 视图 2：#daily 紧凑财务指标带 + 专业报表 ==================== */
.metrics-strip {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
}

.strip-cell {
  padding: 13px 18px;
  position: relative;
  min-width: 0;
}
.strip-cell + .strip-cell { border-left: 1px solid var(--line); }
.strip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 550;
}
.strip-val {
  font-size: clamp(19px, 1.55vw, 23px);
  font-weight: 740;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 5px 0 4px;
  white-space: nowrap;
}
.strip-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.strip-sub strong { color: var(--ink-2); font-weight: 620; }
.strip-sub strong.pos { color: var(--roas-great-fg); }
.strip-sub strong.neg { color: var(--roas-warn-fg); }

.kpi-tag {
  font-size: 10.5px;
  font-weight: 650;
  padding: 1.5px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.kpi-tag.neutral { background: var(--bg-muted); color: var(--ink-2); }
.kpi-tag.great { background: var(--roas-great-bg); color: var(--roas-great-fg); }
.kpi-tag.good { background: var(--roas-good-bg); color: var(--roas-good-fg); }
.kpi-tag.warn { background: var(--roas-warn-bg); color: var(--roas-warn-fg); }
.kpi-tag.low { background: var(--roas-low-bg); color: var(--roas-low-fg); }

/* 日报主工作台卡片 */
.daily-workspace { overflow: hidden; }

.daily-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-surface);
  flex-wrap: wrap;
}
.daily-panel-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.view-tabs { display: inline-flex; align-items: center; gap: 4px; }
.view-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6.5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.view-tabs button .icon { width: 14px; height: 14px; opacity: 0.7; }
.view-tabs button:hover { background: var(--bg-muted); color: var(--ink); }
.view-tabs button.is-active {
  background: var(--bg-obsidian);
  color: #fff;
}
.view-tabs button.is-active .icon { color: #34d399; opacity: 1; }

.tab-count {
  font-size: 11px;
  font-weight: 650;
  background: rgba(24, 24, 27, 0.08);
  color: inherit;
  padding: 1px 6.5px;
  border-radius: 999px;
}
.view-tabs button.is-active .tab-count { background: rgba(255, 255, 255, 0.18); color: #fff; }

.daily-mini-chart-drawer {
  padding: 14px 18px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}

/* 筛选条 */
.daily-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 12px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-field label { font-size: 11px; font-weight: 620; color: var(--muted); }
.filter-search { flex: 1 1 240px; max-width: 340px; }
.filter-dates { flex: 0 1 auto; }
.filter-select { flex: 0 1 146px; min-width: 130px; }
.filter-actions { margin-left: auto; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--muted-2); pointer-events: none; }
.input-wrap input {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 30px;
  font-size: 12.5px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.input-wrap input::placeholder { color: var(--muted-2); }
.input-wrap input:hover, .date-range-group:hover, .custom-select-btn:hover { border-color: #a1a1aa; }
.input-wrap input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08); }
.input-clear {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.input-clear:hover { background: var(--line-strong); color: var(--ink); }

.date-range-group {
  display: inline-flex;
  align-items: center;
  height: var(--ctrl-h);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 9px;
  gap: 6px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.date-range-group:focus-within { border-color: var(--ink); box-shadow: var(--ctrl-focus); }
.date-range-group .date-range-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.date-range-group input[type="date"] {
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  height: 30px;
  width: 116px;
  outline: none;
  padding: 0;
  cursor: pointer;
}
.date-range-group input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: opacity 0.14s ease, background 0.14s ease;
}
.date-range-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: var(--bg-muted);
}
.range-sep { font-size: 11.5px; color: var(--muted-2); user-select: none; }

/* 自定义下拉框 */
.custom-select { position: relative; width: 100%; }
.custom-select-btn {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--ink);
  text-align: left;
}
.custom-select.is-open .custom-select-btn { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08); }
.custom-select-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-caret {
  width: 5.5px;
  height: 5.5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-1.5px) rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.14s ease;
}
.custom-select.is-open .custom-select-caret { transform: translateY(1.5px) rotate(-135deg); border-color: var(--ink); }
.custom-select-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  min-width: 152px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  padding: 4px;
  z-index: 40;
  display: grid;
  gap: 2px;
}
.custom-select-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 6.5px 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
  white-space: nowrap;
}
.custom-select-opt:hover { background: var(--bg-muted); color: var(--ink); }
.custom-select-opt.is-selected { background: var(--accent-soft); color: var(--accent); font-weight: 620; }
.custom-select-opt.is-selected::after { content: '✓'; font-size: 11.5px; font-weight: 700; }
.filter-actions .btn-secondary { height: 34px; padding: 0 11px; }

.daily-meta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.meta-info-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-info-item .icon { width: 13.5px; height: 13.5px; color: var(--muted-2); }
.daily-legend-strip { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.roas-key { display: inline-flex; align-items: center; gap: 4.5px; font-size: 11.5px; color: var(--ink-2); }
.swatch { width: 7.5px; height: 7.5px; border-radius: 50%; display: inline-block; }
.swatch.s-great { background: var(--roas-great-fg); }
.swatch.s-good { background: var(--roas-good-fg); }
.swatch.s-warn { background: var(--roas-warn-fg); }
.swatch.s-low { background: var(--roas-low-fg); }
.swatch-pending { width: 13px; border-bottom: 2px dotted var(--muted); display: inline-block; }

/* 专业数据表格 */
.tablewrap { overflow: auto; }
.daily-wrap { max-height: 66vh; position: relative; background: #fff; }
.daily-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; white-space: nowrap; }
.daily-table th, .daily-table td { padding: 11px 14px; text-align: center; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.daily-table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
}
.daily-table th.col-left, .daily-table td.col-left { text-align: left; padding-left: 18px; padding-right: 16px; }
.daily-table th:last-child, .daily-table td:last-child { padding-right: 16px; }

.daily-table .sticky-col-1 { position: sticky; left: 0; z-index: 4; background: #fff; }
.daily-table thead .sticky-col-1 { z-index: 8; background: var(--bg-subtle); }
.daily-table .sticky-col-2 { position: sticky; left: 184px; z-index: 4; background: #fff; box-shadow: 4px 0 8px -4px rgba(24, 24, 27, 0.08); }
.daily-table thead .sticky-col-2 { z-index: 8; background: var(--bg-subtle); }

.th-sort { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; padding: 1px 0; color: inherit; font: inherit; white-space: nowrap; }
.th-sort:hover { color: var(--ink); }
.th-sort .sort-arrow { font-size: 10px; color: var(--muted-2); width: 10px; text-align: center; }
.th-sort.is-sorted { color: var(--ink); }
.th-sort.is-sorted .sort-arrow { color: var(--accent); font-weight: 700; }
.adv-acc-head .th-sort { font-size: inherit; font-weight: inherit; }

.daily-summary-body tr { background: #f3f5f4; font-weight: 650; }
.daily-summary-body td { border-bottom: 1.5px solid var(--line-strong); color: var(--ink); }
.daily-summary-body .sticky-col-1, .daily-summary-body .sticky-col-2 { background: #f3f5f4; }
.summary-badge {
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: var(--bg-obsidian);
  padding: 2px 7.5px;
  border-radius: 5px;
}

#daily-rows tr { cursor: pointer; transition: background 0.1s ease; }
#daily-rows tr:nth-child(even),
#daily-rows tr:nth-child(even) .sticky-col-1,
#daily-rows tr:nth-child(even) .sticky-col-2 { background: #fcfcfb; }
#daily-rows tr:hover,
#daily-rows tr:hover .sticky-col-1,
#daily-rows tr:hover .sticky-col-2 { background: #f0f7f5; }

.date-cell { display: flex; align-items: center; gap: 8px; min-width: 154px; }
.date-main { font-weight: 620; color: var(--ink); }
.date-week { font-size: 11.5px; color: var(--muted-2); }
.badge-intraday {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 650;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-bd);
  border-radius: 999px;
  padding: 1px 7px;
}
.badge-intraday::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.account-cell { display: flex; flex-direction: column; gap: 2px; max-width: 225px; }
.account-name { font-weight: 620; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.account-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.tz-chip { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--bg-muted); color: var(--ink-2); }

.cov-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 68px; }
.cov-text { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.cov-text small { color: var(--muted-2); font-weight: 400; }
.cov-bar { width: 54px; height: 3.5px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; }
.cov-bar i { display: block; height: 100%; border-radius: 99px; background: #71717a; }

.spend-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 108px; }
.spend-val { font-weight: 680; color: var(--ink); }
.spend-bar { width: 80px; height: 3.5px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; }
.spend-bar i { display: block; height: 100%; border-radius: 99px; background: #27272a; }

.rev-val { color: var(--ink-2); font-weight: 550; }
.val-empty { color: #d4d4d8; }

.roas-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 680;
  padding: 2.5px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  min-width: 66px;
}
.roas-pill.great { background: var(--roas-great-bg); color: var(--roas-great-fg); border-color: var(--roas-great-bd); }
.roas-pill.good { background: var(--roas-good-bg); color: var(--roas-good-fg); border-color: var(--roas-good-bd); }
.roas-pill.warn { background: var(--roas-warn-bg); color: var(--roas-warn-fg); border-color: var(--roas-warn-bd); }
.roas-pill.low { background: var(--roas-low-bg); color: var(--roas-low-fg); border-color: var(--roas-low-bd); }

.roas-num { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.roas-num.great { color: var(--roas-great-fg); }
.roas-num.good { color: var(--roas-good-fg); }
.roas-num.warn { color: var(--roas-warn-fg); }
.roas-num.low { color: var(--roas-low-fg); }
.is-pending { text-decoration: underline dotted var(--muted-2); text-underline-offset: 4px; }
.pending-dot { width: 4.5px; height: 4.5px; border-radius: 50%; background: var(--muted-2); display: inline-block; }

.row-arrow { color: var(--line-strong); font-size: 16px; transition: transform 0.14s ease, color 0.14s ease; display: inline-block; }
#daily-rows tr:hover .row-arrow { color: var(--accent); transform: translateX(2px); }

.daily-empty { text-align: center; padding: 44px 20px; color: var(--muted); font-size: 13px; }
.daily-table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.pager { display: flex; align-items: center; gap: 10px; }
.pager-info { font-size: 12px; font-weight: 600; color: var(--ink-2); }

/* ==================== 视图 3：#campaigns 广告系列管理台 ==================== */
.control-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.control {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--ink);
}
.control .icon { position: absolute; left: 10px; width: 14px; color: var(--muted); pointer-events: none; }
.control select { border: 0; background: transparent; padding: 6.5px 10px 6.5px 30px; font-size: 12.5px; cursor: pointer; }

.camp-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.highlight-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.highlight-card.is-dark {
  background: linear-gradient(135deg, #16181c, #20242a);
  color: #fff;
  border-color: transparent;
}
.highlight-card.is-dark .eyebrow { color: #a1a1aa; }
.highlight-card.is-dark .hl-sub { color: #a1a1aa; }
.hl-title { font-size: 16px; font-weight: 700; margin-top: 2px; }
.hl-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hl-metric { text-align: right; white-space: nowrap; }
.hl-metric strong { display: block; font-size: 24px; font-weight: 740; letter-spacing: -0.03em; }
.hl-metric span { font-size: 11.5px; opacity: 0.7; }

.tableheading { display: flex; align-items: center; gap: 9px; }
.clean-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.clean-table th, .clean-table td { padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.clean-table th { font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--bg-subtle); border-bottom: 1px solid var(--line); }
.clean-table th.col-left, .clean-table td.col-left { text-align: left; padding-left: 18px; padding-right: 16px; }
.clean-table th.col-center, .clean-table td.col-center { text-align: center; }
.clean-table th:last-child, .clean-table td:last-child { padding-right: 18px; }
.clean-table tr:last-child td { border-bottom: 0; }
.clean-table tbody tr:hover { background: var(--bg-subtle); }

.rowname, .rowinfo { display: inline-flex; gap: 11px; align-items: center; text-align: left; border: 0; background: transparent; padding: 0; }
.rowname:hover strong { color: var(--accent); }
.rowname strong { font-size: 13.5px; font-weight: 620; color: var(--ink); }
.rowname small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.brandtile { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-content: center; flex-shrink: 0; }
.brandtile svg { width: 17px; height: 17px; }
.status { background: var(--roas-great-bg); color: var(--roas-great-fg); font-size: 11.5px; font-weight: 620; border-radius: 999px; padding: 2.5px 9px; }
.status.paused { background: var(--roas-warn-bg); color: var(--roas-warn-fg); }

/* ==================== 视图 4：#channels 跨渠道横向对比 ==================== */
.channel-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.ch-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ch-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ch-card-brand { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 15px; }
.ch-share-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg-muted); color: var(--ink); }
.ch-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.ch-stat span { display: block; font-size: 11.5px; color: var(--muted); }
.ch-stat strong { display: block; font-size: 17px; font-weight: 720; margin-top: 2px; color: var(--ink); }
.ch-stat strong.is-roas { color: var(--accent); }
.ch-bar { height: 5px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; }
.ch-bar i { display: block; height: 100%; border-radius: 99px; }

.ch-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 16px; }
.ch-trend-card, .ch-table-card { padding: 18px 20px; min-width: 0; }
.ch-table-card .tablewrap { margin: 14px -20px -18px; border-top: 1px solid var(--line); }
.ch-table-card .clean-table th, .ch-table-card .clean-table td { padding: 11px 14px; font-size: 12.5px; }
.ch-table-card .clean-table th.col-left, .ch-table-card .clean-table td.col-left { padding-left: 16px; }
.ch-table-card .clean-table th:last-child, .ch-table-card .clean-table td:last-child { padding-right: 16px; }
.ch-trend-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.metric-select-pill {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--bg-subtle);
  padding: 0 6px;
}
.metric-select-pill select { border: 0; background: transparent; font-size: 12px; font-weight: 600; padding: 5px 4px; cursor: pointer; }
.light-plot { position: relative; height: 225px; margin-top: 14px; }
.light-plot > svg { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.tooltip {
  position: absolute;
  z-index: 5;
  background: rgba(20, 22, 25, 0.95);
  color: #f4f4f5;
  border-radius: 8px;
  padding: 8px 11px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}

/* ==================== 弹窗 ==================== */
dialog#detail {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  width: min(420px, 92vw);
  padding: 22px;
  color: var(--ink);
  box-shadow: 0 22px 60px rgba(24, 24, 27, 0.22);
}
dialog#detail::backdrop, .drill-dialog::backdrop { background: rgba(24, 24, 27, 0.45); backdrop-filter: blur(2px); }
.modalhead { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.detailrow { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); padding: 11px 0; font-size: 13.5px; }
.detailmeta { margin: 8px 0 14px; color: var(--muted); font-size: 12.5px; }

.modal-close {
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink-2);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--bg-muted); color: var(--ink); }

.drill-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  width: min(980px, 95vw);
  max-height: 86vh;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(24, 24, 27, 0.26);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.drill-dialog:not([open]) { display: none; }
.drill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.drill-eyebrow { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.drill-head h2 { font-size: 17.5px; font-weight: 720; }
.drill-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.drill-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 22px; background: var(--bg-subtle); border-bottom: 1px solid var(--line); }
.drill-kpi { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.drill-kpi span { display: block; font-size: 11px; color: var(--muted); }
.drill-kpi strong { display: block; font-size: 16.5px; font-weight: 720; color: var(--ink); margin-top: 3px; }
.drill-curve-box { padding: 12px 22px; background: #fff; border-bottom: 1px solid var(--line); }
.drill-curve-title { font-size: 12px; font-weight: 650; color: var(--ink-2); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.roas-ladder { display: grid; grid-template-columns: repeat(13, minmax(54px, 1fr)); gap: 5px; overflow-x: auto; }
.ladder-item { background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 7px; padding: 6px 4px; text-align: center; }
.ladder-item span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.ladder-item strong { display: block; font-size: 11.5px; font-weight: 700; margin-top: 3px; }
.drill-table-wrap { overflow: auto; flex: 1; background: #fff; }
.drill-table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.drill-table th, .drill-table td { padding: 11px 14px; text-align: center; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.drill-table th { position: sticky; top: 0; background: var(--bg-subtle); font-size: 11.5px; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); }
.drill-table th:first-child, .drill-table td:first-child { text-align: left; padding-left: 18px; padding-right: 16px; }
.drill-table th:last-child, .drill-table td:last-child { padding-right: 18px; }
.drill-table .account-cell { max-width: 230px; }
.drill-table tbody tr:hover { background: var(--bg-subtle); }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
  padding: 18px 2px 4px;
  gap: 10px;
  flex-wrap: wrap;
}
footer b { padding: 0 4px; }

/* ==================== 全响应式适配 ==================== */
@media (max-width: 1220px) {
  .layout { grid-template-columns: 192px minmax(0, 1fr); }
  .content { padding: 18px 20px; }
  .topbar { padding: 0 20px; }
  .hero-banner { grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 1fr); }
  .hero-primary { border-right: 1px solid rgba(255, 255, 255, 0.1); padding: 0 18px 0 0; }
  .hero-roi-panel { grid-column: 1 / -1; }
  .ov-grid-main, .ov-grid-bottom, .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .daily-finance-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subsidy-board { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-cell:nth-child(3) { border-left: 0; }
  .strip-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
  .channel-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .layout { grid-template-columns: 62px minmax(0, 1fr); }
  aside { align-items: center; padding-inline: 8px; }
  .brand-text, .workspace, .navlabel, .sidefoot { display: none; }
  .brand { margin: 0 0 22px; }
  nav { width: 100%; }
  nav a { justify-content: center; padding: 10px; }
  nav a span { display: none; }
  nav a .icon { width: 18px; height: 18px; }
}

@media (max-width: 720px) {
  .layout { display: block; }
  aside {
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .brand { margin: 0; gap: 8px; }
  .brandmark { width: 28px; height: 28px; }
  .brand-text { display: inline-flex; }
  .brand-name { font-size: 15.5px; }
  .brand-badge { font-size: 10.5px; padding: 1px 5px; }
  nav { display: flex; width: auto; gap: 3px; flex-wrap: wrap; }
  nav a { padding: 6px 10px; font-size: 12px; gap: 0; }
  nav a span { display: inline; }
  nav a .icon, nav a.active::before { display: none; }

  .topbar { height: 44px; padding: 0 14px; }
  .crumb-root, .crumb b { display: none; }
  .content { padding: 16px 14px; }
  .headline { align-items: flex-start; gap: 12px; margin-bottom: 14px; }
  .daily-head-actions { width: 100%; justify-content: space-between; }

  .hero-banner { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; gap: 14px; }
  .hero-primary { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding: 0 0 14px; }
  .hero-roi-panel { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .hero-roi-summary { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-left: 0; padding-top: 12px; }
  .ov-ladder-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .recent-row { grid-template-columns: 105px minmax(0, 1fr) auto; }
  .recent-rev { display: none; }

  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .subsidy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip-cell { padding: 11px 12px; }
  .strip-val { font-size: 18px; }

  .camp-highlights, .channel-cards { grid-template-columns: minmax(0, 1fr); }

  .daily-panel-top { padding: 11px 14px; gap: 8px; }
  .view-tabs { width: 100%; }
  .view-tabs button { flex: 1; justify-content: center; padding: 6px 8px; font-size: 12.5px; }
  .view-tabs button .icon { display: none; }
  .daily-filter-bar { padding: 11px 14px; }
  .filter-search, .filter-dates, .filter-select { flex: 1 1 100%; max-width: none; }
  .date-range-group { width: 100%; justify-content: space-between; }
  .date-range-group input[type="date"] { flex: 1; width: auto; min-width: 0; }
  .filter-actions, .filter-actions .btn-secondary { margin-left: 0; width: 100%; }

  .daily-table th, .daily-table td { padding: 9px 9px; font-size: 12px; }
  .daily-table th.col-left, .daily-table td.col-left { padding-left: 14px; }
  .daily-table .sticky-col-2 { position: static; box-shadow: none; }
  .drill-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 14px; }
  .roas-ladder { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
}

@media (max-width: 440px) {
  .metrics-strip, .hero-banner, .daily-finance-strip { grid-template-columns: minmax(0, 1fr); }
  .subsidy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-cell + .strip-cell { border-left: 0; border-top: 1px solid var(--line); }
  .btn-primary { width: 100%; }
  .segmented { width: 100%; justify-content: space-between; }
  .segmented button { flex: 1; text-align: center; padding: 5.5px 4px; }
}

/* ==================== 视图 5 & 6：广告主列表 & 代理商列表 ==================== */
.dir-page { display: flex; flex-direction: column; gap: 14px; }
.dir-workspace { overflow: hidden; }

.dir-kpi-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.1fr 1.15fr;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dir-kpi {
  padding: 15px 18px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
}
.dir-kpi:first-child { border-left: 0; }
.dir-kpi.is-dark {
  background: radial-gradient(circle at 90% 10%, rgba(15, 118, 110, 0.28) 0%, transparent 55%),
              linear-gradient(135deg, #141619 0%, #1d2127 100%);
  color: #fff;
}
.dir-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.dir-kpi.is-dark .dir-kpi-top { color: #a1a1aa; }
.dir-kpi-pill {
  font-size: 10.5px;
  font-weight: 650;
  padding: 1.5px 7.5px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--ink-2);
  white-space: nowrap;
}
.dir-kpi.is-dark .dir-kpi-pill { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.dir-kpi-pill.great, .dir-kpi-pill.good { background: var(--roas-great-bg); color: var(--roas-great-fg); }
.dir-kpi-pill.warn { background: var(--roas-warn-bg); color: var(--roas-warn-fg); }
.dir-kpi-pill.low { background: var(--roas-low-bg); color: var(--roas-low-fg); }

.dir-kpi-val {
  font-size: clamp(21px, 1.9vw, 27px);
  font-weight: 740;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
}
.dir-kpi-val small { font-size: 13px; font-weight: 520; opacity: 0.65; }
.dir-kpi-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.dir-kpi.is-dark .dir-kpi-sub { color: #a1a1aa; }
.dir-kpi-sub strong { color: var(--ink-2); font-weight: 630; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.dir-kpi.is-dark .dir-kpi-sub strong { color: #e4e4e7; }

.dir-mini-bar, .dir-stack-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--bg-muted);
  overflow: hidden;
  display: flex;
  gap: 2px;
}
.dir-mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.dir-stack-seg { display: block; height: 100%; }

/* 快捷药丸栏 & 筛选条 */
.dir-chips-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.dir-chips-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dir-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 580;
  padding: 4.5px 10px;
  border-radius: 999px;
  transition: all 0.14s ease;
}
.dir-chip:hover { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.dir-chip.is-active { background: var(--bg-obsidian); border-color: var(--bg-obsidian); color: #fff; }
.dir-chip em { font-style: normal; font-size: 11px; opacity: 0.72; font-weight: 620; }

.dir-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  padding: 4.5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
}
.dir-toggle-pill input { accent-color: var(--accent); margin: 0; cursor: pointer; }
.dir-toggle-pill.is-on { border-color: var(--accent-bd); background: var(--accent-soft); color: var(--accent); }

.dir-native-select {
  width: 100%;
  height: var(--ctrl-h);
  appearance: none;
  -webkit-appearance: none;
  background: #fff var(--select-chevron) no-repeat right 10px center;
  background-size: 12px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 28px 0 10px;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.dir-native-select:hover { border-color: #a1a1aa; }
.dir-native-select:focus { border-color: var(--ink); box-shadow: var(--ctrl-focus); }
.dir-select-wide { flex: 0 1 210px; min-width: 170px; }

.dir-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 18px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.dir-strip b { color: var(--ink); font-weight: 680; }
.dir-strip-hint { font-size: 11.5px; color: var(--muted); }

/* 广告主分组卡片 */
.adv-groups-wrap { padding: 14px 18px 18px; display: grid; gap: 12px; background: var(--bg-subtle); }
.adv-company-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.14s ease;
}
.adv-company-card.is-open { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.adv-company-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
  flex-wrap: wrap;
}
.adv-company-head:hover { background: var(--bg-subtle); }
.adv-company-left { display: flex; align-items: flex-start; gap: 10px; min-width: 0; flex: 1; }
.adv-chevron {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--bg-muted);
  color: var(--ink-2);
  font-size: 12px;
  transition: transform 0.16s ease, background 0.14s ease;
  flex-shrink: 0;
  margin-top: 1px;
}
.adv-company-card.is-open .adv-chevron { transform: rotate(90deg); background: var(--bg-obsidian); color: #fff; }
.adv-company-title-wrap { min-width: 0; }
.adv-company-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adv-company-title-row h3 { font-size: 15px; font-weight: 700; color: var(--ink); }
.adv-company-sub {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}
.adv-company-sub b { color: var(--ink-2); font-weight: 600; }
.adv-company-right { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.adv-company-metric { text-align: right; white-space: nowrap; }
.adv-company-metric span { display: block; font-size: 11px; color: var(--muted); }
.adv-company-metric strong { display: block; font-size: 15.5px; font-weight: 720; color: var(--ink); margin-top: 2px; white-space: nowrap; }
.adv-company-metric strong .num-dec { display: inline; }

.ag-inline-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 620;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-bd);
  border-radius: 5px;
  padding: 1px 6.5px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ag-inline-tag.is-none {
  color: var(--muted);
  background: var(--bg-muted);
  border-color: var(--line);
}

.adv-acc-list { border-top: 1px solid var(--line); }
.adv-acc-head, .adv-acc-row {
  display: grid;
  grid-template-columns: minmax(215px, 1.8fr) minmax(135px, 1fr) 142px 128px 104px 148px;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
}
.adv-acc-head {
  background: var(--bg-muted);
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.adv-acc-row {
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.adv-acc-row:last-child { border-bottom: 0; }
.adv-acc-row:hover { background: #f6f8f7; }
.adv-acc-head span:nth-child(n+3), .adv-acc-head .r, .adv-acc-num.r { text-align: center; }

.adv-acc-main { min-width: 0; }
.adv-acc-main strong {
  display: block;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adv-acc-id-line { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.adv-acc-bc { min-width: 0; }
.adv-acc-bc span { display: block; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-acc-bc small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.adv-acc-meta { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.status-dot-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--roas-great-fg);
  background: var(--roas-great-bg);
  padding: 1.5px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.adv-acc-num strong { display: block; font-size: 13px; font-weight: 680; color: var(--ink); }
.adv-acc-num small { display: block; font-size: 10.5px; color: var(--muted); }
.adv-acc-actions { display: flex; align-items: center; justify-content: center; gap: 5px; }

.copy-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5.5px;
  border-radius: 4px;
  line-height: 1.35;
}
.copy-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.mini-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3.5px 7px;
  border-radius: 6px;
  transition: all 0.12s ease;
}
.mini-action:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.adv-flat-tr { cursor: pointer; }
.adv-flat-table th, .adv-flat-table td { padding: 11px 14px; font-size: 12.5px; }
.adv-flat-table th.col-left, .adv-flat-table td.col-left { padding-left: 16px; padding-right: 16px; }
.adv-flat-table th:last-child, .adv-flat-table td:last-child { padding-right: 16px; }
.adv-flat-name { max-width: clamp(190px, 22vw, 290px); }
.adv-comp-cell { display: block; max-width: clamp(120px, 14vw, 185px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; }
.adv-bc-cell { display: block; max-width: clamp(110px, 13vw, 175px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 540; color: var(--ink-2); }

/* 账户资料弹窗 */
.adv-dialog { width: min(820px, 94vw); }
.adv-dlg-body { padding: 16px 22px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: #fff; }
.adv-dlg-section h4 { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.adv-dlg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.adv-dlg-cell {
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px 11px;
  min-width: 0;
}
.adv-dlg-cell span { display: block; font-size: 11px; color: var(--muted); }
.adv-dlg-cell div { margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adv-dlg-cell b { font-size: 12.5px; font-weight: 620; color: var(--ink); word-break: break-all; }
.adv-dlg-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.adv-raw-details { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; background: var(--bg-subtle); }
.adv-raw-details summary { font-size: 12.5px; font-weight: 640; color: var(--accent); cursor: pointer; }
.adv-raw-details[open] summary { margin-bottom: 10px; }

/* ==================== 代理商列表：季度切换栏 + 双栏工作台 + 多季度矩阵 ==================== */
.ag-quarter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  flex-wrap: wrap;
}
.ag-quarter-left, .ag-quarter-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ag-quarter-title {
  font-size: 12px;
  font-weight: 680;
  color: var(--muted);
  white-space: nowrap;
}
.ag-quarter-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.ag-q-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 620;
  padding: 5px 10px;
  border-radius: 999px;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.ag-q-pill:hover { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.ag-q-pill.is-active {
  background: var(--bg-obsidian);
  border-color: var(--bg-obsidian);
  color: #fff;
}
.ag-q-pill em {
  font-style: normal;
  font-size: 10.5px;
  opacity: 0.72;
  font-weight: 640;
}
.ag-q-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.ag-quarter-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.ag-quarter-meta b { color: var(--ink); font-weight: 660; }

.agency-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.agency-layout.is-matrix-full {
  grid-template-columns: minmax(0, 1fr);
}
.ag-qoq-pill {
  font-size: 10.5px;
  font-weight: 640;
  padding: 1px 6px;
  border-radius: 999px;
}
.ag-qoq-pill.is-up { background: var(--roas-great-bg); color: var(--roas-great-fg); }
.ag-qoq-pill.is-down { background: var(--roas-warn-bg); color: var(--roas-warn-fg); }
.ag-qoq-pill.is-flat { background: var(--bg-muted); color: var(--muted); }

.ag-brand-stats { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ag-brand-stats b { color: var(--ink-2); font-weight: 640; }
.ag-link-inline {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-weight: 640;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ag-link-inline:hover { color: #065f46; }

/* 多季度点位矩阵表 */
.ag-matrix-table th, .ag-matrix-table td { padding: 12px 16px; }
.ag-matrix-live {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--roas-great-fg);
  background: var(--roas-great-bg);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}
.ag-mcell {
  cursor: pointer;
  transition: background 0.12s ease;
  vertical-align: middle;
}
.ag-mcell:hover { background: var(--accent-soft) !important; }
.ag-mcell.is-current-q { background: #f8fcfa; }
.ag-mcell.is-empty span { color: var(--muted-2); font-size: 12px; }
.ag-mcell-sum { display: block; font-size: 14px; font-weight: 740; color: var(--ink); }
.ag-mcell-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.ag-mcell-diff { display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 680; margin-top: 2px; padding: 0 5px; border-radius: 4px; }
.ag-mcell-diff.up { color: var(--roas-great-fg); background: var(--roas-great-bg); }
.ag-mcell-diff.down { color: var(--roas-warn-fg); background: var(--roas-warn-bg); }
.ag-quick-group { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ag-quick-label { font-size: 11.5px; color: var(--muted); font-weight: 560; }

.ag-add-drawer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-bd);
  flex-wrap: wrap;
}
.ag-add-drawer > input[type="text"] {
  flex: 1 1 180px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.ag-mini-input { width: 102px; height: 34px; }

.ag-list { padding: 14px 18px; display: grid; gap: 10px; background: var(--bg-subtle); }
.ag-item-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.ag-item-card:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.06); }
.ag-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ag-item-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-soft);
  flex-wrap: wrap;
}
.ag-item-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ag-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12.5px;
  font-weight: 740;
  flex-shrink: 0;
}
.ag-brand-meta { min-width: 0; }
.ag-brand-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ag-brand-title strong { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.ag-brand-meta small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.ag-state-pill {
  font-size: 10.5px;
  font-weight: 650;
  padding: 1px 6.5px;
  border-radius: 999px;
}
.ag-state-pill.is-ok { background: var(--roas-great-bg); color: var(--roas-great-fg); }
.ag-state-pill.is-dirty { background: var(--roas-warn-bg); color: var(--roas-warn-fg); }
.ag-state-pill.is-empty { background: var(--bg-muted); color: var(--muted); }

.ag-item-inputs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ag-field { display: flex; flex-direction: column; gap: 4px; }
.ag-field span { font-size: 11px; font-weight: 600; color: var(--muted); }
.ag-field .rate-input-box { width: 118px; height: 34px; }

.ag-item-summary { text-align: right; min-width: 126px; }
.ag-total-label { display: block; font-size: 11px; color: var(--muted); }
.ag-total-line { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.ag-total-val { font-size: 18px; font-weight: 750; color: var(--accent); line-height: 1.1; }
.ag-total-usd { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.ag-item-ops { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ag-del-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.ag-del-btn:hover { background: var(--roas-low-bg); border-color: var(--roas-low-bd); color: var(--roas-low-fg); }

.ag-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}
.ag-footer-bar.is-dirty { background: #fffdf5; border-top-color: var(--roas-warn-bd); }
.ag-status-wrap { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.ag-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ag-status-dot.is-ok { background: #10b981; }
.ag-status-dot.is-warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.ag-footer-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 右侧返点试算与对比栏 */
.ag-side-stack { display: grid; gap: 14px; }
.ag-sim-card, .ag-note-card { padding: 18px 20px; }
.ag-side-desc { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.55; }
.ag-sim-input-row { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.ag-sim-input-row label { font-size: 11.5px; font-weight: 620; color: var(--muted); }
.ag-money-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  height: 36px;
  padding: 0 11px;
  gap: 6px;
}
.ag-money-input:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08); }
.ag-money-input span { color: var(--muted); font-weight: 650; font-size: 14px; }
.ag-money-input input { border: 0; background: transparent; width: 100%; font-size: 15px; font-weight: 700; outline: none; }

.ag-sim-presets { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.ag-sim-presets button {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4.5px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.ag-sim-presets button:hover { border-color: var(--line-strong); background: #fff; }
.ag-sim-presets button.is-active { background: var(--bg-obsidian); color: #fff; border-color: var(--bg-obsidian); }

.ag-compare-list { margin-top: 16px; display: grid; gap: 12px; }
.ag-cmp-row { display: grid; gap: 5px; }
.ag-cmp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.ag-cmp-top strong { font-weight: 650; color: var(--ink); }
.ag-cmp-top b { color: var(--accent); font-weight: 720; }
.ag-cmp-track { height: 7px; border-radius: 99px; background: var(--bg-muted); overflow: hidden; display: flex; gap: 1.5px; }
.ag-cmp-track .seg-base { background: #18181b; display: block; height: 100%; }
.ag-cmp-track .seg-creative { background: #10b981; display: block; height: 100%; }
.ag-cmp-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }

.ag-note-card h3 { font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.ag-tips-list { margin: 10px 0 0; padding-left: 16px; display: grid; gap: 7px; font-size: 12px; color: var(--muted); line-height: 1.55; }
.ag-tips-list strong { color: var(--ink-2); }
.ag-tips-list code { background: var(--bg-muted); padding: 1px 5px; border-radius: 4px; font-size: 11px; color: var(--ink); }

/* 全局轻量 Toast */
.dir-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(21, 23, 26, 0.94);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 560;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 999;
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1180px) {
  .dir-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dir-kpi:nth-child(3) { border-left: 0; }
  .dir-kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .agency-layout { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .adv-acc-head { display: none; }
  .adv-acc-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 11px 14px; }
  .adv-acc-bc, .adv-acc-meta { grid-column: 1 / -1; }
  .adv-acc-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .ag-item-card { grid-template-columns: 1fr; gap: 10px; }
  .ag-item-summary { text-align: left; }
}
@media (max-width: 600px) {
  .dir-kpi-grid { grid-template-columns: 1fr; }
  .dir-kpi { border-left: 0; border-top: 1px solid var(--line); }
  .dir-kpi:first-child { border-top: 0; }
  .ag-item-inputs { flex-wrap: wrap; }
}


/* ==================== 实时投放 (#realtime) 专属样式 ==================== */
.rt-empty-card {
  padding: 36px 28px;
  text-align: center;
  display: grid;
  gap: 10px;
}
.rt-empty-card h2 { font-size: 16px; font-weight: 700; }
.rt-empty-card p { font-size: 13px; color: var(--muted); }
.rt-empty-card code { background: var(--bg-muted); padding: 2px 6px; border-radius: 5px; font-size: 12px; color: var(--ink); }

.rt-hero-banner {
  background: linear-gradient(135deg, var(--bg-obsidian) 0%, #1d2229 100%);
  color: #f4f4f5;
  border-radius: var(--radius-xl);
  padding: 18px 22px 13px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.rt-hero-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.rt-hero-card {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rt-hero-card:first-child { padding-left: 0; border-left: 0; }
.rt-kpi-label { font-size: 11.5px; color: #a1a1aa; font-weight: 560; letter-spacing: 0.01em; }
.rt-kpi-val { font-size: 24px; font-weight: 740; letter-spacing: -0.02em; color: #ffffff; line-height: 1.2; }
.rt-kpi-val small { font-size: 13px; font-weight: 560; opacity: 0.72; }
.rt-kpi-compact { font-size: 20px; }
.rt-kpi-roas.t-great { color: #34d399; }
.rt-kpi-roas.t-good { color: #2dd4bf; }
.rt-kpi-roas.t-warn { color: #fbbf24; }
.rt-kpi-roas.t-low { color: #fb7185; }
.rt-kpi-sub { font-size: 11.5px; color: #a1a1aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-kpi-delta { font-size: 11.5px; font-weight: 600; }
.rt-kpi-delta.is-up { color: #34d399; }
.rt-kpi-delta.is-down { color: #fbbf24; }

.rt-hero-foot {
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #a1a1aa;
  flex-wrap: wrap;
}
.rt-hero-foot-right { margin-left: auto; color: #d4d4d8; font-weight: 540; }
.rt-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
  flex-shrink: 0;
}
.rt-live-dot.is-busy {
  background: #fbbf24;
  animation: rtPulse 1.1s infinite ease-in-out;
}
@keyframes rtPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.45; }
}

.rt-workspace { overflow: visible; }
.rt-top-bar { flex-wrap: wrap; gap: 10px; }
.rt-level-tabs { flex-wrap: wrap; }
.rt-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt-auto-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 560;
  color: var(--ink-2);
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  cursor: pointer;
  user-select: none;
}
.rt-auto-pill input { accent-color: var(--accent); margin: 0; }
#rt-refresh-btn.is-loading svg { animation: rtSpin 0.9s linear infinite; }
@keyframes rtSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.rt-filter-bar {
  display: grid;
  grid-template-columns: 174px 162px 134px minmax(185px, 1.15fr) minmax(190px, 1.25fr) auto;
  gap: 10px 12px;
  align-items: end;
}
.rt-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.rt-actual-date {
  font-size: 11px;
  color: var(--accent);
  font-weight: 580;
  white-space: nowrap;
}
.rt-filter-btns { display: flex; align-items: center; gap: 6px; height: 34px; }
.rt-filter-btns button { height: 34px; padding: 0 13px; }

/* 统一纸白 Editorial Precision 自定义下拉与日期弹出层 */
.rt-select, .rt-picker { position: relative; width: 100%; }
.rt-select-btn {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.rt-select-btn:hover { border-color: #a1a1aa; }
.rt-select.is-open .rt-select-btn,
.rt-picker.is-open .rt-select-btn {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}
.rt-select-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.rt-select-left .icon {
  width: 13.5px;
  height: 13.5px;
  color: var(--muted);
  flex-shrink: 0;
}
.rt-select-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rt-select-caret {
  width: 5.5px;
  height: 5.5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-1.5px) rotate(45deg);
  flex-shrink: 0;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.rt-select.is-open .rt-select-caret,
.rt-picker.is-open .rt-select-caret {
  transform: translateY(1.5px) rotate(-135deg);
  border-color: var(--ink);
}

.rt-select-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 100%;
  max-height: 292px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(24, 24, 27, 0.12), 0 2px 6px rgba(24, 24, 27, 0.04);
  padding: 5px;
  z-index: 60;
  display: grid;
  gap: 2px;
}
.rt-select-menu-wide { min-width: 340px; }
.rt-select-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}
.rt-select-opt:hover { background: var(--bg-muted); color: var(--ink); }
.rt-select-opt.is-selected { background: var(--accent-soft); color: var(--accent); font-weight: 620; }
.rt-opt-main { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-opt-meta {
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rt-select-opt.is-selected .rt-opt-meta { color: var(--accent); opacity: 0.85; }
.rt-opt-check { flex-shrink: 0; font-size: 11.5px; font-weight: 700; color: var(--accent); }

/* 自定义日历弹出框 */
.rt-date-popover {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 266px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 14px 34px rgba(24, 24, 27, 0.12), 0 2px 6px rgba(24, 24, 27, 0.04);
  padding: 10px;
  z-index: 65;
  display: grid;
  gap: 8px;
}
.rt-cal-quicks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.rt-cal-quick {
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink-2);
  border-radius: 6px;
  padding: 4.5px 0;
  font-size: 11.5px;
  font-weight: 600;
}
.rt-cal-quick:hover { background: var(--bg-muted); color: var(--ink); }
.rt-cal-quick.is-active {
  background: var(--bg-obsidian);
  border-color: var(--bg-obsidian);
  color: #fff;
}
.rt-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}
.rt-cal-title { font-size: 12.5px; font-weight: 680; color: var(--ink); }
.rt-cal-nav {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.rt-cal-nav:hover { background: var(--bg-muted); color: var(--ink); }
.rt-cal-week, .rt-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.rt-cal-week span { font-size: 11px; color: var(--muted); padding: 2px 0; font-weight: 560; }
.rt-cal-day {
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
  font-weight: 540;
  color: var(--ink);
  position: relative;
}
.rt-cal-day:hover:not(:disabled) { background: var(--bg-muted); }
.rt-cal-day:disabled { color: var(--muted-2); opacity: 0.45; cursor: not-allowed; }
.rt-cal-day.is-today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.rt-cal-day.is-selected {
  background: var(--bg-obsidian);
  color: #fff;
  font-weight: 660;
}
.rt-cal-day.is-selected::after { background: #34d399; }
.rt-spend-pill { height: 34px; padding: 0 10px; margin: 0; }

.rt-drill-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 18px;
  background: #f0f9ff;
  border-top: 1px solid #e0f2fe;
  border-bottom: 1px solid #e0f2fe;
  font-size: 12px;
}
.rt-drill-prefix { color: #0369a1; font-weight: 650; }
.rt-drill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  padding: 3px 8px 3px 10px;
  border-radius: 999px;
  font-weight: 560;
  max-width: 320px;
}
.rt-drill-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-drill-chip button {
  border: 0;
  background: transparent;
  color: #0284c7;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.rt-drill-clear { margin-left: auto; font-size: 12px; color: #0369a1; }

.rt-chart-card {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfcfa 0%, #ffffff 100%);
}
.rt-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rt-chart-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt-chart-title-row h2 { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.rt-chart-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.rt-chart-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rt-dot-blue { background: #2563eb !important; }
.rt-prev-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 560;
  cursor: pointer;
}
.rt-prev-toggle input { accent-color: var(--accent); margin: 0; }

.rt-svg-host { position: relative; width: 100%; }
.rt-hero-svg { width: 100%; height: auto; max-height: 260px; display: block; overflow: visible; }
.rt-axis-text { font-size: 10.5px; fill: #71717a; font-variant-numeric: tabular-nums; }
.rt-axis-right { fill: #0f766e; }
.rt-ref-label { font-size: 10px; fill: #059669; font-weight: 600; }
.rt-bar { transition: opacity 0.12s ease; }
.rt-hit { cursor: crosshair; }
.rt-chart-empty { padding: 36px; text-align: center; color: var(--muted); font-size: 13px; }

.rt-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  min-width: 215px;
  background: rgba(21, 23, 26, 0.95);
  color: #f4f4f5;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  display: grid;
  gap: 5px;
}
.rt-tt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.rt-tt-head strong { font-size: 13px; color: #fff; }
.rt-tt-head span { font-size: 11px; color: #a1a1aa; }
.rt-tt-row { display: flex; justify-content: space-between; gap: 14px; }
.rt-tt-row span { color: #a1a1aa; }
.rt-tt-row b { font-weight: 650; color: #fff; }
.rt-tt-roas.t-great { color: #34d399; }
.rt-tt-roas.t-good { color: #2dd4bf; }
.rt-tt-roas.t-warn { color: #fbbf24; }
.rt-tt-roas.t-low { color: #fb7185; }

.rt-table th.rt-col-idx, .rt-table td.rt-col-idx { width: 48px; text-align: center; color: var(--muted); font-size: 12px; }
.rt-table th.rt-col-name, .rt-table td.rt-col-name { min-width: 220px; max-width: 268px; }
.rt-table .account-cell { max-width: none; width: 100%; gap: 3px; }
.rt-table .account-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.rt-table th.rt-col-date, .rt-table td.rt-col-date { width: 104px; text-align: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.rt-table th.rt-col-balance, .rt-table td.rt-col-balance { min-width: 124px; width: 132px; text-align: right; white-space: nowrap; }
.rt-bal-val {
  font-weight: 620;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rt-bal-val.is-low { color: #dc2626; font-weight: 680; }
.rt-table th.rt-col-hour, .rt-table td.rt-col-hour { min-width: 118px; width: 126px; text-align: right; white-space: nowrap; }
.rt-table th.rt-col-budget, .rt-table td.rt-col-budget { min-width: 96px; width: 104px; text-align: right; white-space: nowrap; }
.rt-table th.rt-col-bid, .rt-table td.rt-col-bid { min-width: 82px; width: 88px; text-align: right; white-space: nowrap; }
.rt-bid-val {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  user-select: text;
}
.rt-table th.rt-col-spark, .rt-table td.rt-col-spark { width: 142px; text-align: center; }

.rt-hour-th {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.rt-hour-sort-pill {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: all 0.14s ease;
}
.rt-hour-sort-pill:hover {
  border-color: var(--ink-2);
  color: var(--ink);
  background: var(--bg-subtle);
}
.rt-hour-sort-pill.is-sorted {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
.rt-hour-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.25;
}
.rt-hour-val {
  font-weight: 640;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.rt-hour-val.is-zero {
  color: var(--muted-2, #a1a1aa);
  font-weight: 500;
}
.rt-hour-sub {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.rt-hour-badge {
  font-weight: 620;
  letter-spacing: -0.01em;
}
.rt-hour-badge.is-up { color: #059669; }
.rt-hour-badge.is-down { color: #dc2626; }
.rt-hour-badge.is-flat { color: var(--muted); font-weight: 540; }
.rt-hour-badge.is-new {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(15, 118, 110, 0.11);
  color: #0f766e;
  font-size: 10.5px;
  font-weight: 640;
}
.rt-hour-cur {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}
.rt-sp-trail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 3px;
  padding-top: 5px;
  border-top: 1px dashed var(--line-soft);
}
.rt-sp-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 4px;
  border-radius: 6px;
  background: var(--bg-subtle);
  font-size: 10.5px;
  font-weight: 620;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rt-sp-chip em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
}
.rt-sp-chip.is-cur {
  background: rgba(29, 78, 216, 0.09);
  color: #1d4ed8;
}
.rt-table th.rt-col-act, .rt-table td.rt-col-act { width: 132px; text-align: center; white-space: nowrap; }

.rt-spark-wrap { display: inline-flex; align-items: center; justify-content: center; width: 132px; height: 34px; }
.rt-spark { width: 132px; height: 34px; display: block; }
.rt-spark-clickable { cursor: pointer; }
.rt-spark-clickable:hover .rt-spark-wrap { background: rgba(37, 99, 235, 0.06); border-radius: 6px; }

.rt-table tbody tr { cursor: pointer; }
.rt-table tbody tr.is-focused td { background: #eff6ff !important; }
.rt-summary-tr td { background: #fafaf8 !important; font-weight: 650; }
.rt-summary-tr.is-focused td { background: #eff6ff !important; }
.rt-sum-cnt { margin-left: 8px; font-size: 12px; color: var(--muted); font-weight: 500; }

.rt-sub-row { flex-wrap: nowrap; gap: 5px; overflow: hidden; align-items: center; }
.rt-tag {
  display: inline-block;
  padding: 0.5px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 580;
  background: var(--bg-muted);
  color: var(--ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.rt-tag-drama { background: #eef2ff; color: #4338ca; max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
.rt-sub-acct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; color: var(--muted); }
.rt-sub-date { color: var(--muted); font-size: 11px; white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rt-adv-id { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer; transition: color 0.12s ease; }
.rt-adv-id:hover { color: var(--accent); text-decoration: underline; }
.rt-copy-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-2, #a1a1aa);
  border-radius: 5px;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease;
}
.rt-copy-icon-btn svg { width: 12.5px; height: 12.5px; display: block; }
.rt-copy-icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.rt-id-chip {
  border: 0;
  background: transparent;
  padding: 0 2px;
  color: var(--muted-2, #a1a1aa);
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.12s ease, background 0.12s ease;
}
.rt-id-chip:hover { color: var(--ink); background: var(--bg-muted); }

.rt-act-group { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rt-act-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3.5px 8px;
  border-radius: 6px;
  transition: all 0.12s ease;
}
.rt-act-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--bg-subtle); }
.rt-act-btn.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }
.rt-act-drill { color: var(--accent); border-color: var(--accent-bd); background: var(--accent-soft); }
.rt-act-drill:hover { background: #d1fae5; border-color: var(--accent); color: #065f46; }
.rt-hint-chip { font-size: 11px; color: #2563eb; font-weight: 600; }

@media (max-width: 1240px) {
  .rt-hero-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-hero-card:nth-child(3) { border-left: 0; padding-left: 0; }
  .rt-filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .rt-hero-main { grid-template-columns: 1fr; }
  .rt-hero-card { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 10px; }
  .rt-hero-card:first-child { border-top: 0; padding-top: 0; }
  .rt-filter-bar { grid-template-columns: 1fr; }
}

/* 分档徽标与策略弹窗 */
.rt-tier-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.rt-tier-t1 { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.rt-tier-t2 { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.rt-tier-t3 { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.rt-tier-t4 { background: #f4f4f5; color: #71717a; border: 1px solid #e4e4e7; }
.rt-sync-ago { font-size: 11px; color: var(--muted); white-space: nowrap; }

.rt-tiers-dialog { width: min(920px, 94vw); max-height: 88vh; }
.rt-tiers-body { padding: 16px 22px 22px; overflow-y: auto; display: grid; gap: 20px; }
.rt-tiers-section { display: grid; gap: 10px; }
.rt-tiers-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rt-tiers-sec-head h3 { font-size: 14px; font-weight: 700; color: var(--ink); }
.rt-tiers-quick-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rt-jobs-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rt-jobs-table { width: 100%; font-size: 12.5px; }
.rt-jobs-table tr.is-running td { background: #fffbeb; }

.rt-cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rt-cfg-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  background: var(--bg-subtle);
  display: grid;
  gap: 8px;
}
.rt-cfg-card h4 { margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--ink); }
.rt-cfg-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
}
.rt-cfg-card input[type="number"] {
  width: 78px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
}
.rt-cfg-pair { display: inline-flex; gap: 6px; }
@media (max-width: 720px) {
  .rt-cfg-grid { grid-template-columns: 1fr; }
}

/* 小时趋势大图弹窗 */
.rt-trend-dialog { width: min(940px, 94vw); max-height: 88vh; }
.rt-trend-modal-body { padding: 14px 22px 22px; display: grid; gap: 12px; }
.rt-trend-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rt-table th.rt-col-name, .rt-table td.rt-col-name { min-width: 248px; max-width: 304px; }
.rt-table th.rt-col-spark, .rt-table td.rt-col-spark { width: 132px; text-align: center; }
.rt-spark-wrap, .rt-spark { width: 124px; height: 32px; }

/* 行内迷你趋势曲线实时分时悬浮卡片 */
.rt-spark-wrap, .rt-spark { width: 132px; height: 34px; cursor: crosshair; }
.rt-spark-popover {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  min-width: 196px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  box-shadow: 0 14px 32px rgba(24, 24, 27, 0.14), 0 2px 6px rgba(24, 24, 27, 0.05);
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.rt-sp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.rt-sp-head strong { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.rt-sp-head span { font-size: 11px; color: var(--muted); }
.rt-sp-spend {
  font-size: 16px;
  font-weight: 740;
  color: #1d4ed8;
  letter-spacing: -0.015em;
  padding: 1px 0 2px;
}
.rt-sp-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
}
.rt-sp-row span { color: var(--muted); }
.rt-sp-row b { font-weight: 640; color: var(--ink); }
.rt-sp-roas.t-great { color: var(--roas-great-fg); }
.rt-sp-roas.t-good { color: var(--roas-good-fg); }
.rt-sp-roas.t-warn { color: var(--roas-warn-fg); }
.rt-sp-roas.t-low { color: var(--roas-low-fg); }
.rt-sp-foot {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  color: var(--muted-2);
  text-align: center;
}

/* 消除表格容器焦点绿框 */
.rt-tablewrap:focus,
.rt-tablewrap:focus-visible {
  outline: none !important;
}


/* ==========================================================================
   任务与脚本管理中心 (#tasks)
   ========================================================================== */
.tc-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tc-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-obsidian);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tc-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.tc-toast.is-error {
  background: #be123c;
}

.tc-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1120px) {
  .tc-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tc-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}
.tc-stat-card.is-dark {
  background: linear-gradient(145deg, var(--bg-obsidian), var(--bg-obsidian-2));
  border-color: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
}
.tc-stat-card.is-dark .tc-stat-label { color: #a1a1aa; }
.tc-stat-card.is-dark .tc-stat-sub { color: #d4d4d8; }
.tc-stat-card.is-dark .tc-stat-foot { color: #a1a1aa; border-top-color: rgba(255, 255, 255, 0.1); }

.tc-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tc-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.tc-stat-main {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.tc-stat-main small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.tc-stat-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}
.tc-stat-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.tc-pill.is-ok { background: var(--roas-great-bg); color: var(--roas-great-fg); border: 1px solid var(--roas-great-bd); }
.tc-pill.is-warn { background: var(--roas-warn-bg); color: var(--roas-warn-fg); border: 1px solid var(--roas-warn-bd); }
.tc-pill.is-err { background: var(--roas-low-bg); color: var(--roas-low-fg); border: 1px solid var(--roas-low-bd); }

.tc-mini-toggle {
  border: 1px solid var(--line-strong);
  background: var(--bg-subtle);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.tc-mini-toggle.is-on {
  background: var(--accent-soft);
  border-color: var(--accent-bd);
  color: var(--accent);
}
.tc-mini-toggle:hover {
  filter: brightness(0.96);
}

.tc-card {
  padding: 18px 20px;
}
.tc-head-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tc-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}
.tc-hist-wrap {
  max-height: 360px;
  overflow-y: auto;
}
.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tc-table th,
.tc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  text-align: center;
}
.tc-table th {
  background: var(--bg-subtle);
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}
.tc-table th.col-left,
.tc-table td.col-left {
  text-align: left;
  padding-left: 16px;
  padding-right: 16px;
}
.tc-table tbody tr {
  transition: background-color 0.14s ease;
}
.tc-table tbody tr:hover {
  background: var(--bg-subtle);
}
.tc-table tr.is-muted-row {
  opacity: 0.56;
}

.tc-job-title {
  font-weight: 650;
  color: var(--ink);
  font-size: 13.5px;
}
.tc-job-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}
.tc-script-code {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}
.tc-inline-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-muted);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.tc-interval-sel {
  height: var(--ctrl-h-sm);
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-surface) var(--select-chevron) no-repeat right 8px center;
  background-size: 11px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 0 24px 0 9px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.tc-interval-sel:hover { border-color: #a1a1aa; }
.tc-interval-sel:focus { border-color: var(--ink); box-shadow: var(--ctrl-focus); }
.tc-cal-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.tc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.tc-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.tc-switch-track {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #d4d4d8;
  transition: background 0.16s ease;
  position: relative;
}
.tc-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.16s ease;
}
.tc-switch input:checked + .tc-switch-track {
  background: var(--accent);
}
.tc-switch input:checked + .tc-switch-track::after {
  transform: translateX(14px);
}

.tc-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tc-status-badge.is-ok { background: var(--roas-great-bg); color: var(--roas-great-fg); border: 1px solid var(--roas-great-bd); }
.tc-status-badge.is-running { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.tc-status-badge.is-warn { background: var(--roas-warn-bg); color: var(--roas-warn-fg); border: 1px solid var(--roas-warn-bd); }
.tc-status-badge.is-err { background: var(--roas-low-bg); color: var(--roas-low-fg); border: 1px solid var(--roas-low-bd); }
.tc-status-badge.is-idle { background: var(--bg-muted); color: var(--muted); border: 1px solid var(--line); }

.tc-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0ea5e9;
  animation: tc-pulse 1.2s ease-in-out infinite;
}
@keyframes tc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.tc-time-main {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink);
}
.tc-time-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.tc-res-detail {
  font-size: 11.5px;
  color: var(--accent);
  margin-top: 3px;
}
.tc-err-detail,
.tc-err-text {
  font-size: 11.5px;
  color: var(--roas-low-fg);
  margin-top: 3px;
  word-break: break-word;
}
.tc-countdown {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.tc-tier-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 4px;
}
.tc-tier-tag.is-t1 { background: #fef2f2; color: #b91c1c; }
.tc-tier-tag.is-t2 { background: #fffbeb; color: #b45309; }
.tc-tier-tag.is-t3 { background: #f0fdfa; color: #0f766e; }
.tc-tier-tag.is-t4 { background: var(--bg-muted); color: var(--muted); }

.tc-cat-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.tc-cat-tag.is-batch { background: #eef2ff; color: #3730a3; }
.tc-cat-tag.is-rt { background: #ecfdf5; color: #047857; }

.tc-empty-cell {
  padding: 28px 12px !important;
  color: var(--muted);
  text-align: center !important;
}
.tc-error-banner {
  grid-column: 1 / -1;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--roas-low-bg);
  border: 1px solid var(--roas-low-bd);
  color: var(--roas-low-fg);
  font-size: 13px;
}

.tc-log-pre {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-obsidian);
  color: #e4e4e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ==================== 视觉动效与金融终端微交互系统 ==================== */
@keyframes pageFadeLift {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes titleSlideIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(12px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dialogPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes syncRipple {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  55% { transform: scale(1.18); box-shadow: 0 0 0 9px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes heroAmbientDrift {
  0%, 100% { transform: translate3d(12px, -8px, 0) scale(0.84); opacity: 0.36; }
  50% { transform: translate3d(-34px, 14px, 0) scale(1.26); opacity: 0.96; }
}
@keyframes heroTopBeam {
  0% { transform: translateX(-110%); opacity: 0; }
  18% { opacity: 0.9; }
  62% { opacity: 0.9; }
  82%, 100% { transform: translateX(220%); opacity: 0; }
}
@keyframes heroCardBreathe {
  0%, 100% {
    box-shadow: 0 10px 28px rgba(24, 24, 27, 0.15), 0 0 0 1px rgba(52, 211, 153, 0.06);
  }
  50% {
    box-shadow: 0 14px 36px rgba(15, 118, 110, 0.22), 0 0 0 1px rgba(52, 211, 153, 0.22);
  }
}
@keyframes roiPanelBreathe {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.042);
    box-shadow: inset 0 0 0 0 rgba(52, 211, 153, 0);
  }
  50% {
    border-color: rgba(52, 211, 153, 0.36);
    background: rgba(16, 185, 129, 0.075);
    box-shadow: inset 0 0 24px rgba(52, 211, 153, 0.08);
  }
}
@keyframes metricGlowBreathe {
  0%, 100% { text-shadow: 0 0 0 rgba(52, 211, 153, 0); }
  50% { text-shadow: 0 0 18px rgba(52, 211, 153, 0.42); }
}
@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes liveBadgeBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.18); border-color: var(--accent-bd); }
  50% { box-shadow: 0 0 12px 1px rgba(16, 185, 129, 0.24); border-color: #34d399; }
}
@keyframes navGlowBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.2); opacity: 0.85; }
  50% { box-shadow: 0 0 10px 1px rgba(16, 185, 129, 0.55); opacity: 1; }
}
@keyframes svgPulseRing {
  0% { r: 3.5; opacity: 0.85; stroke-width: 2; }
  75% { r: 11; opacity: 0; stroke-width: 0.8; }
  100% { r: 11; opacity: 0; stroke-width: 0.8; }
}
@keyframes barGrowX {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes chartBarRise {
  from { transform: scaleY(0); opacity: 0.25; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes chartDotPop {
  from { opacity: 0; transform: scale(0.3); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes tipReveal {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 顶栏实时状态呼吸波纹、Live 徽标与品牌微交互 */
.sync-dot {
  animation: syncRipple 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.platform-badge {
  animation: liveBadgeBreathe 3.6s ease-in-out infinite;
}
.platform-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: syncRipple 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.brandmark {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}
.brand:hover .brandmark {
  transform: translateY(-1.5px) scale(1.03);
  box-shadow: 0 5px 14px rgba(15, 118, 110, 0.24);
}

/* 导航切换质感与激活竖条呼吸 */
nav a {
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
nav a:hover { transform: translateX(2px); }
nav a.active { transform: none; }
nav a.active::before {
  animation: navGlowBreathe 3.4s ease-in-out infinite;
}

/* 页面视图切换入场与标题微动 */
.page-section.is-entering {
  animation: pageFadeLift 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.headline-text.is-entering {
  animation: titleSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 总览与核心视图卡片阶梯显现 */
#view-overview.is-entering .hero-banner { animation: cardRise 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0ms both, heroCardBreathe 4.8s ease-in-out 0.4s infinite; }
#view-overview.is-entering .ov-trend-card { animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 55ms both; }
#view-overview.is-entering .ov-zone-card { animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 100ms both; }
#view-overview.is-entering .ov-rank-card { animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 145ms both; }
#view-overview.is-entering .ov-ladder-card,
#view-overview.is-entering .ov-country-card { animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 185ms both; }

#view-daily.is-entering .daily-finance-strip,
#view-realtime.is-entering .rt-hero-banner,
#view-advertisers.is-entering .dir-kpi-grid,
#view-agencies.is-entering .dir-kpi-grid,
#view-tasks.is-entering .tc-summary-grid {
  animation: cardRise 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0ms both;
}
#view-agencies.is-entering .ag-quarter-bar {
  animation: cardRise 0.36s cubic-bezier(0.22, 1, 0.36, 1) 45ms both;
}
#view-daily.is-entering .daily-workspace,
#view-realtime.is-entering .surface-card,
#view-advertisers.is-entering .dir-workspace,
#view-agencies.is-entering .agency-layout {
  animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 65ms both;
}
#view-tasks.is-entering .tc-card:nth-of-type(1) { animation: cardRise 0.36s cubic-bezier(0.22, 1, 0.36, 1) 50ms both; }
#view-tasks.is-entering .tc-card:nth-of-type(2) { animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 95ms both; }
#view-tasks.is-entering .tc-card:nth-of-type(3) { animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 140ms both; }
#view-tasks.is-entering .tc-card:nth-of-type(4) { animation: cardRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 180ms both; }

/* 曜石黑英雄横幅与各页深色首卡：双层极光呼吸 + 顶边流光扫描 */
.hero-banner,
.rt-hero-banner {
  position: relative;
  overflow: hidden;
  animation: heroCardBreathe 4.8s ease-in-out infinite;
}
.daily-finance-strip > .strip-cell:first-child {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #141619 0%, #1d2127 100%);
  color: #f4f4f5;
}
.daily-finance-strip > .strip-cell:first-child .strip-top { color: #a1a1aa; }
.daily-finance-strip > .strip-cell:first-child .strip-val { color: #ffffff; }
.daily-finance-strip > .strip-cell:first-child .strip-sub { color: #a1a1aa; }
.daily-finance-strip > .strip-cell:first-child .strip-sub strong { color: #e4e4e7; }
.daily-finance-strip > .strip-cell:first-child .kpi-tag.neutral {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}
.dir-kpi.is-dark,
.tc-stat-card.is-dark {
  position: relative;
  overflow: hidden;
}
.tc-stat-card.is-dark {
  animation: heroCardBreathe 5.2s ease-in-out infinite;
}
.tc-stat-card.is-dark .tc-pill.is-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.36);
}
.hero-banner::before,
.rt-hero-banner::before,
.daily-finance-strip > .strip-cell:first-child::before,
.dir-kpi.is-dark::before,
.tc-stat-card.is-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 44%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(110, 231, 183, 0.85) 50%, transparent 100%);
  pointer-events: none;
  z-index: 2;
  animation: heroTopBeam 5.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.hero-banner::after,
.rt-hero-banner::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -70px;
  width: 420px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at 55% 45%, rgba(52, 211, 153, 0.34) 0%, rgba(14, 165, 233, 0.14) 42%, transparent 72%);
  filter: blur(26px);
  pointer-events: none;
  z-index: 0;
  animation: heroAmbientDrift 4.8s ease-in-out infinite;
}
.daily-finance-strip > .strip-cell:first-child::after,
.dir-kpi.is-dark::after,
.tc-stat-card.is-dark::after {
  content: '';
  position: absolute;
  right: -28px;
  top: -36px;
  width: 210px;
  height: 165px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.34) 0%, rgba(14, 165, 233, 0.14) 48%, transparent 72%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
  animation: heroAmbientDrift 4.8s ease-in-out infinite;
}
.hero-banner > *,
.rt-hero-banner > *,
.daily-finance-strip > .strip-cell:first-child > *,
.dir-kpi.is-dark > *,
.tc-stat-card.is-dark > * {
  position: relative;
  z-index: 1;
}
.hero-roi-panel {
  animation: roiPanelBreathe 4.8s ease-in-out infinite;
}
.hero-metric-val.is-green,
.hero-metric-val.is-great,
.hero-metric-val.is-good,
.rt-kpi-roas.t-great,
.rt-kpi-roas.t-good {
  animation: metricGlowBreathe 4.2s ease-in-out infinite;
}

/* 各页状态呼吸点、实时指标与展开微动效 */
@keyframes cyanRipple {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.55); }
  60% { transform: scale(1.16); box-shadow: 0 0 0 8px rgba(14, 165, 233, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}
@keyframes drawerSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sparkLastBreathe {
  0%, 100% { opacity: 0.55; r: 2; }
  50% { opacity: 1; r: 3.1; }
}
.rt-live-dot:not(.is-busy),
.ag-q-dot,
.ag-status-dot.is-ok {
  animation: syncRipple 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.rt-spark-last {
  animation: sparkLastBreathe 2.6s ease-in-out infinite;
}
.subsidy-roi-pill.great {
  animation: liveBadgeBreathe 3.8s ease-in-out infinite;
}
.daily-mini-chart-drawer:not([hidden]),
.adv-acc-list:not([hidden]),
.ag-add-drawer:not([hidden]) {
  animation: drawerSlideIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.custom-select-menu:not([hidden]),
.rt-select-menu:not([hidden]),
.rt-date-popover:not([hidden]),
.rt-cols-popover:not([hidden]) {
  animation: tipReveal 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tc-pulse-dot {
  animation: cyanRipple 1.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}
.tc-status-badge.is-running {
  box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.25);
  animation: liveBadgeBreathe 2.6s ease-in-out infinite;
}
.tc-stat-card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.18s ease;
}
.tc-stat-card:not(.is-dark):hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 6px 18px rgba(24, 24, 27, 0.06);
}
.tc-log-pre {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* 进度条能量流光 + 展开 */
.hero-progress i {
  position: relative;
  transform-origin: left center;
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.48) 50%, rgba(255, 255, 255, 0) 100%);
  background-size: 200% 100%;
  animation: barGrowX 0.55s cubic-bezier(0.22, 1, 0.36, 1) both, progressShimmer 2.8s linear 0.55s infinite;
}
.rank-bar-track i,
.spend-bar i,
.dir-mini-bar i,
.dir-stack-seg,
.ag-cmp-track .seg-base,
.ag-cmp-track .seg-creative {
  transform-origin: left center;
  animation: barGrowX 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.zone-stack-seg {
  transform-origin: left center;
  animation: barGrowX 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 组合趋势图：柱体生长、折线绘制、末端实时脉冲环 */
.chart-pulse-ring {
  fill: none;
  stroke: #10b981;
  pointer-events: none;
  animation: svgPulseRing 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* 组合趋势图 SVG 柱体生长、折线绘制与节点弹出 */
.chart-bar-anim {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: chartBarRise 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: opacity 0.15s ease, filter 0.15s ease;
}
.chart-bar-anim:hover {
  filter: brightness(1.18);
}
.chart-dot-anim {
  transform-box: fill-box;
  transform-origin: center;
  animation: chartDotPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.chart-tooltip:not([hidden]),
.rt-tooltip:not([hidden]) {
  animation: tipReveal 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* 卡片、子项与控件悬停/按压微反馈 */
.surface-card {
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}
.ov-trend-card:hover,
.ov-zone-card:hover,
.ov-rank-card:hover,
.ov-ladder-card:hover,
.ov-country-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 6px 20px rgba(24, 24, 27, 0.055);
}
.rank-item,
.zone-row,
.recent-row,
.mini-ladder-cell,
.subsidy-item,
.ag-item-card,
.adv-company-card,
.ag-mcell {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.rank-item:hover,
.mini-ladder-cell:hover,
.subsidy-item:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(24, 24, 27, 0.06);
}
.zone-row:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--line);
}
.recent-row:hover {
  transform: translateX(2px);
}
.ag-item-card:hover,
.adv-company-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 5px 16px rgba(24, 24, 27, 0.055);
}

.btn-primary:active:enabled,
.btn-secondary:active:enabled,
.segmented button:active,
.view-tabs button:active,
.dir-chip:active,
.ag-q-pill:active,
.mini-action:active,
.rt-act-btn:active,
.tc-mini-toggle:active {
  transform: scale(0.97);
}
.hero-calc-link {
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.hero-calc-link:hover {
  transform: translateY(-0.5px);
}

/* 弹窗平滑入场 */
dialog[open] {
  animation: dialogPopIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
dialog[open]::backdrop {
  animation: backdropFade 0.2s ease both;
}

/* 尊重系统减弱动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 自定义显示列浮层与扩展指标色标 */
.rt-cols-wrap { position: relative; }
.rt-cols-wrap.is-open #rt-cols-btn {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
  color: var(--ink);
}
.rt-cols-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 310px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 14px 34px rgba(24, 24, 27, 0.13), 0 2px 6px rgba(24, 24, 27, 0.04);
  padding: 12px;
  z-index: 70;
  display: grid;
  gap: 10px;
}
.rt-cols-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.rt-cols-head strong { font-size: 13px; font-weight: 700; color: var(--ink); }
.rt-cols-head span { font-size: 11px; color: var(--muted); }
.rt-cols-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.rt-cols-preset {
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--ink-2);
  border-radius: 6px;
  padding: 5px 0;
  font-size: 11.5px;
  font-weight: 600;
}
.rt-cols-preset:hover { background: var(--bg-muted); color: var(--ink); border-color: var(--line-strong); }
.rt-cols-list {
  max-height: 310px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding-right: 2px;
}
.rt-cols-group { display: grid; gap: 4px; }
.rt-cols-gtitle {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  padding: 2px 4px;
}
.rt-cols-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.rt-cols-item:hover { background: var(--bg-muted); }
.rt-cols-item.is-checked { background: var(--accent-soft); }
.rt-cols-item input {
  grid-row: 1 / 3;
  accent-color: var(--accent);
  margin: 0;
  width: 14px;
  height: 14px;
}
.rt-cols-name { font-size: 12.5px; font-weight: 620; color: var(--ink); }
.rt-cols-item.is-checked .rt-cols-name { color: var(--accent); }
.rt-cols-hint { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rt-net-pos { color: var(--roas-great-fg); font-weight: 640; }
.rt-net-neg { color: var(--roas-low-fg); font-weight: 620; }
.rt-delta-up { color: var(--roas-great-fg); font-weight: 640; }
.rt-delta-down { color: var(--roas-warn-fg); font-weight: 640; }
.rt-muted-num { color: var(--muted); font-weight: 560; }

/* 账户日报下钻弹窗：赔付触发依据说明条与逐条推广系列算式抽屉 */
.drill-table .tz-chip { white-space: nowrap; }
.drill-payout-explain {
  padding: 11px 22px;
  background: #f6fbf9;
  border-bottom: 1px solid #d1fae5;
  display: grid;
  gap: 6px;
}
.dpe-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}
.dpe-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-bd);
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
}
.dpe-sum { color: var(--ink); font-size: 12.5px; }
.dpe-sum b { color: var(--accent); }
.dpe-tip { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.dpe-rules {
  display: grid;
  gap: 3px;
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.dpe-rules strong { color: var(--ink); }
.dpe-rules code {
  background: #ffffff;
  border: 1px solid #d1fae5;
  color: #065f46;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.drill-payout-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--accent-bd);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 7px;
  padding: 3.5px 8px;
  font-size: 12px;
  font-weight: 660;
  transition: all 0.12s ease;
}
.drill-payout-btn:hover { background: #d1fae5; border-color: var(--accent); color: #065f46; }
.drill-payout-btn.is-active { background: var(--bg-obsidian); border-color: var(--bg-obsidian); color: #fff; }
.drill-payout-btn .dpb-cnt { font-size: 10.5px; opacity: 0.8; font-weight: 560; }

.drill-payout-drawer {
  background: #fafaf8;
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 22px 14px;
  display: grid;
  gap: 10px;
  max-height: 44vh;
  overflow: hidden;
}
.dpd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dpd-title-wrap { display: grid; gap: 2px; }
.dpd-title-wrap strong { font-size: 13px; color: var(--ink); }
.dpd-title-wrap span { font-size: 11.5px; color: var(--muted); }
.dpd-title-wrap b { color: var(--accent); }
.dpd-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dpd-table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: auto;
  max-height: 28vh;
}
.dpd-table { width: 100%; border-collapse: collapse; font-size: 11.5px; white-space: nowrap; }
.dpd-table th, .dpd-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; vertical-align: middle; }
.dpd-table th { position: sticky; top: 0; background: var(--bg-subtle); color: var(--muted); font-weight: 640; border-bottom: 1px solid var(--line); }
.dpd-table th:first-child, .dpd-table td:first-child { text-align: left; }
.dpd-col-name { max-width: 240px; }
.dpd-cname { font-weight: 620; color: var(--ink); overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.dpd-cid { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dpd-col-target { text-align: left !important; color: var(--ink-2); }
.dpd-col-target small { display: block; font-size: 10.5px; color: var(--muted); }
.dpd-col-ev { color: var(--roas-great-fg); font-weight: 600; }
.dpd-col-formula { text-align: left !important; }
.dpd-formula { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dpd-formula b { color: var(--accent); font-weight: 720; }
.dpd-more { font-size: 11px; color: var(--muted); padding: 8px 12px; background: var(--bg-subtle); border-top: 1px solid var(--line-soft); }

/* 代理商官方品牌 Logo 样式 */
.ag-avatar.has-logo {
  background: #ffffff !important;
  border: 1px solid var(--line);
  padding: 5px;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
  overflow: hidden;
}
.ag-avatar.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ag-cmp-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ag-mini-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}
.rt-opt-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}
.rt-tag-agency {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}
.rt-tag-logo {
  width: 12px;
  height: 12px;
  object-fit: contain;
  display: block;
}
