*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f8f9fa;
  --surface:      #ffffff;
  --surface-2:    #f3f4f6;
  --surface-3:    #e5e7eb;
  --border:       #e5e7eb;
  --border-light: #d1d5db;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --text-dim:     #4b5563;
  --accent:       #ff4081;
  --accent-dim:   #e91e63;
  --accent-glow:  rgba(255,64,129,.08);
  --green:        #22c55e;
  --yellow:       #eab308;
  --red:          #ef4444;
  --orange:       #f97316;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --bg-secondary: var(--surface-2);
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: #c4c8cf; border-radius: 3px; }

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s ease;
  box-shadow: 1px 0 3px rgba(0,0,0,.04);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* 工作空间选择器 */
.workspace-selector {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.workspace-selector-current {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .15s;
}
.workspace-selector-current:hover {
  background: var(--surface-3);
}
.workspace-selector-info {
  flex: 1;
  min-width: 0;
}
.workspace-selector-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-selector-scope {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-selector-scope:empty {
  display: none;
}
.workspace-selector-quota-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}
.workspace-selector-quota {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-selector-quota-pool {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.88;
  line-height: 1.35;
}
.workspace-selector-quota-pool:empty {
  display: none;
}
.workspace-selector-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform .2s;
}
.workspace-selector.open .workspace-selector-arrow {
  transform: rotate(180deg);
}

/* 工作空间下拉框 */
.workspace-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 6px;
  right: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  z-index: 200;
  max-height: min(320px, 55vh);
  overflow-y: auto;
  overflow-x: hidden;
}
.workspace-selector.open .workspace-dropdown {
  display: block;
}
.workspace-dropdown-list {
  padding: 4px 0;
}
.workspace-dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .15s;
}
.workspace-dropdown-item:hover {
  background: var(--surface-2);
}
.workspace-dropdown-item.active {
  background: var(--accent-glow);
}
/* 标题行：名称占满宽，角标贴右，互不抢行 */
.workspace-dropdown-item .ws-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.workspace-dropdown-item .ws-item-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-dropdown-item .ws-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.workspace-dropdown-item .ws-item-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 2px;
}
.workspace-dropdown-item .ws-personal,
.workspace-dropdown-item .ws-team,
.workspace-dropdown-item .ws-other {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1.2;
}
.workspace-dropdown-item .ws-personal {
  color: var(--accent);
  background: var(--accent-glow);
}
.workspace-dropdown-item .ws-team {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.workspace-dropdown-item .ws-other {
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
}
.workspace-dropdown-item .ws-invite-btn,
.workspace-dropdown-item .ws-rename-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 5px;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.workspace-dropdown-item .ws-invite-btn:hover,
.workspace-dropdown-item .ws-rename-btn:hover {
  color: var(--accent);
  background: var(--surface-2);
}
.nav-item .nav-report-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.workspace-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.workspace-dropdown-create {
  color: var(--accent);
  font-weight: 500;
}
.workspace-dropdown-create svg {
  flex-shrink: 0;
}
.logo-icon {
  width: 32px; height: 32px; background: linear-gradient(135deg, #ff4081, #e91e63);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.logo-text { font-size: 15px; font-weight: 600; }
.logo-sub  { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
  padding: 14px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-dim);
  font-size: 13.5px; transition: background .15s, color .15s;
  position: relative; text-decoration: none;
}
.nav-item:hover  { background: rgba(255,64,129,.06); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.nav-icon { width: 18px; height: 18px; opacity: .8; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; font-size: 11px; background: var(--accent);
  color: #fff; padding: 1px 6px; border-radius: 10px; font-weight: 600;
}

.sidebar-footer {
  padding: 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #ff4081, #e91e63);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-name  { font-size: 13px; font-weight: 500; }
.avatar-role  { font-size: 11px; color: var(--text-muted); }

.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0; /* 避免宽表格（如矩阵 max-content）撑开整页产生横向滚动 */
}

.topbar {
  height: 56px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  background: var(--surface); position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.topbar-breadcrumb span { color: var(--text); font-weight: 500; }
.topbar-spacer { flex: 1; }
.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); color: var(--text-dim); font-size: 13px;
  cursor: pointer; transition: border-color .15s, color .15s; white-space: nowrap;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--text); }
.topbar-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.topbar-btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }

/* 页面标题栏右侧操作区（与顶栏按钮间距一致） */
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/*
 * 通用按钮：与 .topbar-btn 同一主题（弹窗底部、工具页头部等）
 * 使用 class="btn btn-primary" / btn-secondary / btn-danger
 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--text-dim);
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: #fff;
}
.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border-light);
  color: var(--text-dim);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}
.btn-danger {
  background: var(--surface-2);
  border-color: var(--border-light);
  color: var(--text-dim);
}
.btn-danger:hover {
  border-color: var(--red);
  background: rgba(239, 68, 68, .08);
  color: var(--red);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  gap: 4px;
  border-radius: var(--r-sm);
}

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; margin-right: 8px;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-dim); border-radius: 2px;
}

.page { padding: 24px; flex: 1; min-width: 0; }
.page-section { display: none; }
.page-section.active { display: block; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { font-size: 20px; font-weight: 700; }
.page-desc  { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-icon {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
}
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
/* 指标主数值 + 弱化对比项（如同期总回复数） */
.stat-value-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px;
  overflow: visible;
}
.br-stat-value-denom {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-size: 15px; font-weight: 500; color: var(--text-muted); line-height: 1.2;
}
.br-stat-value-denom__slash { opacity: 0.4; font-weight: 400; margin-right: 1px; }
.br-stat-mentions-value .br-stat-value-denom .br-tip {
  margin-left: 3px; width: 13px; height: 13px; font-size: 9px;
}
.stat-change { font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }
.stat-change.neutral { color: var(--text-muted); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); padding: 6px 10px;
}
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 160px;
}
.search-box input::placeholder { color: var(--text-muted); }

.filter-btn {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); font-size: 13px; color: var(--text-dim);
  cursor: pointer; white-space: nowrap;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface-2); }
th {
  text-align: left; padding: 10px 16px;
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
td {
  padding: 13px 16px; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(0,0,0,.02); }
tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:nth-child(even):hover { background: rgba(0,0,0,.03); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 100px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge::before {
  content: ""; display: block; width: 6px; height: 6px; border-radius: 50%;
}
.badge-green  { background: rgba(34,197,94,.12);  color: var(--green);  }
.badge-green::before  { background: var(--green); }
.badge-yellow { background: rgba(234,179,8,.12);  color: var(--yellow); }
.badge-yellow::before { background: var(--yellow); animation: pulse 1.4s infinite; }
.badge-red    { background: rgba(239,68,68,.12);  color: var(--red);    }
.badge-red::before    { background: var(--red); }
.badge-blue   { background: rgba(255,64,129,.1); color: var(--accent); }
.badge-blue::before   { background: var(--accent); }
.badge-gray   { background: rgba(107,114,128,.12); color: var(--text-muted); }
.badge-gray::before   { background: var(--text-muted); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

.tag {
  display: inline-block; padding: 2px 7px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 4px; font-size: 11.5px; color: var(--text-dim); margin: 1px 2px 1px 0;
}
.tag-more { color: var(--accent); cursor: pointer; }
.platform-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: var(--accent-glow); border: 1px solid rgba(255,64,129,.25);
  border-radius: 4px; font-size: 11.5px; color: var(--accent); margin: 1px 2px 1px 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); font-size: 12px; color: var(--text-dim);
  cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s, background .15s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn-danger:hover { border-color: var(--red); color: var(--red); }
.action-btn-run {
  background: var(--accent-glow); border-color: rgba(255,64,129,.3); color: var(--accent);
}

.switch {
  width: 34px; height: 19px; border-radius: 100px;
  background: var(--border-light); position: relative; cursor: pointer;
  flex-shrink: 0; transition: background .2s;
}
.switch.on { background: var(--accent); }
.switch::after {
  content: ""; position: absolute;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  top: 3px; left: 3px; transition: left .2s;
}
.switch.on::after { left: 18px; }

.progress-wrap { width: 100px; }
.progress-bar { height: 5px; border-radius: 10px; background: var(--surface-2); overflow: hidden; margin-bottom: 3px; }
.progress-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--accent), #ff80ab); }
.progress-text { font-size: 11px; color: var(--text-muted); }

.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 20px; }
.tab {
  padding: 12px 16px; font-size: 13.5px; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover:not(.active) { color: var(--text); }

/* 任务管理页面 Tab 样式 */
.task-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  width: fit-content;
}
.task-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  border: none;
  background: transparent;
}
.task-tab-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.task-tab-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
}
.task-tab-content {
  display: none;
}
.task-tab-content.active {
  display: block;
}

/* 任务配置内：小号文字链 + 下划线（与一级 task-tabs 区分） */
.task-config-subnav {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 14px;
}
.task-config-subnav-sep {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  user-select: none;
  opacity: 0.7;
}
.task-config-link {
  background: none;
  border: none;
  padding: 2px 0 5px;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s;
}
.task-config-link:hover {
  color: var(--text);
}
.task-config-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.task-config-panel {
  display: none;
}
.task-config-panel.active {
  display: block;
}

/* 系统配置管理 Tab 样式 */
.sysconfig-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  width: fit-content;
}
.sysconfig-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  border: none;
  background: transparent;
}
.sysconfig-tab-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sysconfig-tab-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
}
.sysconfig-tab-content {
  display: none;
}
.sysconfig-tab-content.active {
  display: block;
}

.pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 4px; padding: 12px 16px; border-top: 1px solid var(--border);
}
.pg-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); font-size: 13px; color: var(--text-dim); cursor: pointer;
}
.pg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.pg-info { font-size: 12px; color: var(--text-muted); margin-right: 8px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px; }
.form-col-full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: .02em; }
.form-input {
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); padding: 9px 12px;
  color: var(--text); font-size: 13.5px; outline: none; font-family: inherit;
  transition: border-color .15s; width: 100%;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.form-select { appearance: none; cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); }

.tag-input-area {
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); padding: 8px 10px;
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 44px;
}
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-glow); border: 1px solid rgba(255,64,129,.25);
  border-radius: 4px; padding: 2px 8px; font-size: 12px; color: var(--accent);
}
.tag-chip-green { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); color: var(--green); }
.tag-chip-remove { cursor: pointer; opacity: .6; font-size: 14px; line-height: 1; }
.tag-input-box { border: none; background: none; outline: none; color: var(--text); font-size: 13px; flex: 1; min-width: 80px; }
.tag-input-box::placeholder { color: var(--text-muted); }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-item {
  display: flex; align-items: center; gap: 7px; padding: 7px 12px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: var(--r-sm); cursor: pointer; font-size: 13px; color: var(--text-dim);
  transition: border-color .15s, color .15s;
}
.checkbox-item.checked { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.checkbox-item-dot {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid var(--border-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.checkbox-item.checked .checkbox-item-dot { background: var(--accent); border-color: var(--accent); }

.checkbox-item--muted {
  cursor: not-allowed;
  opacity: 0.78;
  border-style: dashed;
  pointer-events: none;
}
.checkbox-item--muted .checkbox-item-dot {
  border-color: var(--border-light);
  background: var(--surface);
}
.platform-soon-badge {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.task-readonly-box {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  min-height: 40px;
}
.task-readonly-box--multiline {
  white-space: pre-wrap;
  word-break: break-word;
}

.schedule-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.schedule-extra { margin-top: 10px; }

.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-light);
  color: var(--text-dim); transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.weekday-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 200; display: none; align-items: flex-start;
  justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--r-lg); width: 100%; max-width: 680px;
  flex-shrink: 0; animation: slideUp .22s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border-light);
  transition: color .15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* Search Prompts / Tags：列表与卡片内操作按钮（复用 .action-btn） */
.prompt-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  opacity: 0;
  transition: opacity .15s;
}
.prompt-list-row:hover .prompt-list-actions {
  opacity: 1;
}
.tag-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity .15s;
}
.tag-card:hover .tag-card-actions {
  opacity: 1;
}

/* Search Prompts：标签筛选 chip（与 .filter-chip 同系） */
.tag-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--text-dim);
  transition: border-color .15s, color .15s, background .15s;
}
.tag-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.tag-filter-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.3); z-index: 90;
}
.sidebar-overlay.open { display: block; }

.alert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 20px; }
.alert-channel-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px;
}
.alert-channel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.alert-channel-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.channel-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.ch-wecom    { background: rgba(34,197,94,.15); }
.ch-dingtalk { background: rgba(249,115,22,.15); }
.ch-feishu   { background: rgba(99,102,241,.15); }

.filter-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px; font-size: 12px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-light);
  color: var(--text-dim); transition: background .12s, border-color .12s, color .12s;
  user-select: none;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
.filter-chip-green.active { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.35); color: var(--green); }
.filter-chip-red.active   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.35);  color: var(--red); }

.result-kw-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: 16px; overflow: hidden;
}
.result-kw-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; cursor: pointer;
  transition: background .15s;
}
.result-kw-header:hover { background: rgba(0,0,0,.02); }
.result-kw-title { font-size: 15px; font-weight: 600; flex: 1; }
.result-kw-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.result-kw-body { border-top: 1px solid var(--border); display: none; }
.result-kw-body.open { display: block; }
.result-source-row {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 0; border-bottom: 1px solid var(--border);
}
.result-source-row:last-child { border-bottom: none; }
.result-source-left {
  padding: 14px 16px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.result-source-right { padding: 14px 16px; }
.result-source-title {
  font-size: 13.5px; font-weight: 500; color: var(--accent);
  text-decoration: none; display: block; line-height: 1.4;
}
.result-source-title:hover { text-decoration: underline; }
.result-source-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.6; margin-top: 4px; }
.result-source-url  { font-size: 11px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-brand-hit {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.2);
  font-size: 12px; color: var(--green); font-weight: 500;
}
.result-brand-miss {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(107,114,128,.1); border: 1px solid rgba(107,114,128,.2);
  font-size: 12px; color: var(--text-muted);
}
.result-expand-arrow {
  transition: transform .2s; flex-shrink: 0;
  color: var(--text-muted);
}
.result-expand-arrow.open { transform: rotate(180deg); }
.result-summary-row {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 20px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.result-summary-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.result-summary-val  { color: var(--text); font-weight: 600; }

.kw-tree-item { border-bottom: 1px solid var(--border); }
.kw-tree-item:last-child { border-bottom: none; }
.kw-tree-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background .12s;
}
.kw-tree-head:hover { background: rgba(0,0,0,.02); }
.kw-tree-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.kw-tree-summary { display: flex; gap: 6px; align-items: center; }
.kw-tree-arrow { color: var(--text-muted); transition: transform .2s; flex-shrink:0; }
.kw-tree-arrow.open { transform: rotate(180deg); }
.kw-platform-list { display: none; padding: 0 14px 10px 30px; }
.kw-platform-list.open { display: block; }
.kw-platform-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .12s;
  margin-bottom: 2px;
}
.kw-platform-row:hover { background: var(--surface-3); }
.kw-platform-name { font-size: 12.5px; font-weight: 500; width: 68px; flex-shrink: 0; }
.kw-platform-brands { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.kw-platform-view {
  font-size: 11.5px; color: var(--accent); flex-shrink: 0;
  display: flex; align-items: center; gap: 3px; opacity: .8;
}
.kw-platform-view:hover { opacity: 1; text-decoration: underline; }

.match-chip {
  padding: 1px 6px; border-radius: 3px; font-size: 11px;
  background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.25);
}

.export-stat-wrap { position: relative; }
.export-stat-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--r-md); box-shadow: 0 8px 32px rgba(0,0,0,.12);
  width: 280px; z-index: 500;
  display: none; flex-direction: column;
  animation: slideUp .18s ease;
}
.export-stat-menu.open { display: flex; }

.sub-modal {
  background: var(--surface); border: 1px solid var(--border-light);
  border-radius: var(--r-lg); width: 100%; max-width: 760px;
  flex-shrink: 0; animation: slideUp .22s ease;
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .alert-grid  { grid-template-columns: 1fr; }
  .result-source-row { grid-template-columns: 1fr; }
  .result-source-left { border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .page { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; }
  .search-box input { width: 110px; }
  .topbar { padding: 0 14px; }
  .modal-overlay { padding: 20px 12px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 22px; }
  .page-header { flex-direction: column; }
  .result-kw-meta { gap: 6px; }
}

/* Visibility charts grid */
.vis-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 768px) { .vis-chart-grid { grid-template-columns: 1fr; } }

/* Filter Panel - Collapsible Groups */
.filter-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.filter-section-vertical {
  display: flex;
  flex-direction: column;
}

.filter-group {
  border-right: 1px solid var(--border);
}

.filter-group:last-child {
  border-right: none;
}

.filter-group-row {
  border-right: none;
  border-bottom: 1px solid var(--border);
}

.filter-group-row:last-child {
  border-bottom: none;
}

.filter-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
  min-height: 44px;
}

.filter-group-header:hover {
  background: rgba(0,0,0,.02);
}

.filter-group-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  width: 72px;
  flex-shrink: 0;
}

.filter-group-count {
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 40px;
}

.filter-search {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  max-width: 140px;
  transition: border-color .15s;
}

.filter-search:focus {
  border-color: var(--accent);
}

.filter-search::placeholder {
  color: var(--text-muted);
}

.filter-group-toggle {
  font-size: 10px;
  color: var(--text-muted);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
  transition: transform .2s;
}

.filter-group.open .filter-group-toggle {
  transform: rotate(90deg);
}

.filter-group-body {
  display: none;
  padding: 0 16px 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.filter-group.open .filter-group-body {
  display: block;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  max-height: 120px;
  overflow-y: auto;
}

.filter-chips:empty::after {
  content: "无匹配项";
  color: var(--text-muted);
  font-size: 12px;
}

/* ==========================================================================
   下拉选择器样式
   ========================================================================== */

.filter-field {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filter-select {
  position: relative;
  min-height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 4px 8px;
  gap: 4px;
  transition: border-color .15s;
}

.filter-select:hover {
  border-color: var(--accent);
}

.filter-select.open {
  border-color: var(--accent);
}

.filter-select-searchable {
  padding: 0;
  flex-wrap: nowrap;
  align-items: stretch;
}

.filter-select-search {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  min-width: 0;
}

.filter-select-search::placeholder {
  color: var(--text-muted);
}

.filter-select-search:focus {
  background: var(--surface-2);
}

.filter-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 8px;
  flex: 1;
  min-height: 26px;
  align-items: center;
}

.filter-select-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(255, 64, 129, .25);
  border-radius: 4px;
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-select-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-select-tag-remove {
  cursor: pointer;
  opacity: .6;
  font-size: 14px;
  line-height: 1;
  margin-left: 2px;
  flex-shrink: 0;
}

.filter-select-tag-remove:hover {
  opacity: 1;
}

.filter-select-searchable {
  padding: 0;
  flex-direction: column;
}

.filter-select-searchable .filter-select-search {
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  border-bottom: 1px solid var(--border-light);
}

.filter-select-searchable .filter-select-search::placeholder {
  color: var(--text-muted);
}

.filter-select-searchable .filter-select-tags {
  padding: 4px 8px;
  min-height: 26px;
}

.filter-select-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  padding: 0 4px;
}

.filter-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.filter-select.open .filter-select-dropdown {
  display: block;
}

.filter-select-dropdown-header {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-select-dropdown-header .count {
  color: var(--accent);
  font-weight: 600;
}

.filter-select-dropdown-actions {
  display: flex;
  gap: 6px;
}

.filter-select-action-btn {
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background .12s;
}

.filter-select-action-btn:hover {
  background: var(--accent-glow);
}

.filter-select-option {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .12s;
}

.filter-select-option:hover {
  background: var(--surface-2);
}

.filter-select-option.selected {
  color: var(--accent);
  background: var(--accent-glow);
}

.filter-select-option-check {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-select-option.selected .filter-select-option-check {
  background: var(--accent);
  border-color: var(--accent);
}

.filter-select-option-check::after {
  content: "";
  display: block;
  width: 8px;
  height: 5px;
  border: 2px solid #fff;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg) translate(1px, -1px);
}

.filter-select-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 768px) {
  .filter-section {
    grid-template-columns: 1fr;
  }

  .filter-group {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .filter-group:last-child {
    border-bottom: none;
  }

  .filter-search {
    max-width: 100px;
  }
}

/* Data Table for User Management */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

.data-table .badge {
  font-size: 11px;
}

.data-table .action-btn {
  padding: 4px 12px;
  font-size: 12px;
}

/* ==========================================================================
   可折叠菜单样式
   ========================================================================== */

/* 分组头部 */
.nav-section {
  margin-bottom: 8px;
}
.nav-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 10px 6px;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0;
}
.nav-section-add {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.nav-section-add:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.nav-section-content {
  /* 内容容器 */
}

/* 可折叠组 */
.nav-group {
  margin: 2px 0;
}
.nav-group-toggle {
  cursor: pointer;
  user-select: none;
}
.nav-group-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-arrow {
  width: 14px;
  height: 14px;
  transition: transform .2s ease;
  margin-left: auto;
  flex-shrink: 0;
  opacity: .5;
}
.nav-group.open > .nav-group-toggle .nav-arrow {
  transform: rotate(180deg);
}
.nav-group-items {
  display: none;
  overflow: hidden;
}
.nav-group.open > .nav-group-items {
  display: block;
}

/* 子菜单项 */
/* 侧栏：敬请期待弱化标记 */
.nav-soon {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.72;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.nav-soon--inline {
  font-size: 9.5px;
  margin-left: 6px;
  font-weight: 400;
}
.nav-item-text-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-group-label--with-soon {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-sub-item--row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-sub-item {
  padding-left: 34px !important;
  font-size: 12.5px !important;
}
.nav-sub-item .nav-icon {
  width: 16px;
  height: 16px;
}
.nav-sub-item--pro {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.nav-item--pro-tool .nav-item-text-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tool-pro-gate-card {
  margin-top: 8px;
}

/* 品牌报告 · 情绪分析：能力预览（对标竞品信息架构，原创文案） */
#page-brand_sentiment .br-sentiment-showcase {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}
#page-brand_sentiment .br-sentiment-showcase__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
#page-brand_sentiment .br-sentiment-showcase__lead {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.55;
}
#page-brand_sentiment .br-sentiment-showcase__panel {
  padding: 22px 22px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  background: var(--surface);
}
#page-brand_sentiment .br-sentiment-showcase__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 900px) {
  #page-brand_sentiment .br-sentiment-showcase__grid {
    grid-template-columns: 1fr;
  }
}
#page-brand_sentiment .br-sentiment-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) {
  #page-brand_sentiment .br-sentiment-split {
    grid-template-columns: 1fr;
  }
}
#page-brand_sentiment .br-sentiment-split__col {
  padding: 16px 16px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-light);
  background: var(--surface-2);
}
#page-brand_sentiment .br-sentiment-split__col--pos {
  border-left: 3px solid var(--green);
}
#page-brand_sentiment .br-sentiment-split__col--neg {
  border-left: 3px solid var(--red);
}
#page-brand_sentiment .br-sentiment-split__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
#page-brand_sentiment .br-sentiment-split__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
#page-brand_sentiment .br-sentiment-split__icon--ok {
  background: rgba(34, 197, 94, 0.18);
  color: var(--green);
}
#page-brand_sentiment .br-sentiment-split__icon--risk {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}
#page-brand_sentiment .br-sentiment-split__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
#page-brand_sentiment .br-sentiment-split__list {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-muted);
}
#page-brand_sentiment .br-sentiment-split__list li {
  margin-bottom: 6px;
}
#page-brand_sentiment .br-sentiment-topics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#page-brand_sentiment .br-sentiment-topic {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
}
#page-brand_sentiment .br-sentiment-topic__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}
#page-brand_sentiment .br-sentiment-topic__ex {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}
#page-brand_sentiment .br-sentiment-chart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 32px;
  padding: 8px 0 4px;
}
#page-brand_sentiment .br-sentiment-chart__donut {
  position: relative;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  flex-shrink: 0;
  /* 示意比例：正面约 64%、中性约 20%、负面约 8%、风险约 8% */
  background: conic-gradient(
    from -90deg,
    var(--green) 0deg 230.4deg,
    #3b82f6 230.4deg 302.4deg,
    var(--red) 302.4deg 331.2deg,
    #f97316 331.2deg 360deg
  );
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
#page-brand_sentiment .br-sentiment-chart__donut::after {
  content: '舆情\A关注';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52%;
  height: 52%;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: pre;
  box-sizing: border-box;
}
#page-brand_sentiment .br-sentiment-chart__legend {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 220px;
}
#page-brand_sentiment .br-sentiment-chart__legend li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
#page-brand_sentiment .br-sentiment-chart__sw {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-top: 4px;
  flex-shrink: 0;
}
#page-brand_sentiment .br-sentiment-chart__sw--pos {
  background: var(--green);
}
#page-brand_sentiment .br-sentiment-chart__sw--neu {
  background: #3b82f6;
}
#page-brand_sentiment .br-sentiment-chart__sw--neg {
  background: var(--red);
}
#page-brand_sentiment .br-sentiment-chart__sw--risk {
  background: #f97316;
}
#page-brand_sentiment .br-sentiment-chart__note {
  margin: 12px 0 0;
  font-size: 11px;
  text-align: center;
}
#page-brand_sentiment .br-pro-gate-card {
  margin-top: 0;
}

.nav-pro-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.12), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(233, 30, 99, 0.22);
  line-height: 1.2;
}

/* 品牌报告名称 */
.nav-report-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 空状态 */
.nav-empty {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

/* ---------- 品牌报告仪表盘（布局辅助，视觉与全局主题一致） ---------- */
.br-dash-filters-inner {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  padding: 16px 20px 12px;
}
.br-filters-row .br-filter-dd {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.br-filter-dd--range { flex: 0 0 auto; min-width: 200px; }
.br-filter-dd--tags { flex: 1 1 220px; min-width: 200px; max-width: 360px; }
.br-filter-dd--platform { flex: 1 1 260px; min-width: 220px; max-width: 440px; }
.br-filter-dd__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.br-filter-dd__trigger {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface, #fff);
  font-size: 14px;
  color: var(--text, #1a1a2e);
  cursor: pointer;
  background-image: 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='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.br-filter-dd__trigger:hover {
  border-color: var(--accent, #E91E63);
}
.br-filter-dd__trigger:focus {
  outline: none;
  border-color: var(--accent, #E91E63);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.12);
}

/*
 * Tom Select 初始化前，原生 select[multiple] 会按多行列表框绘制（大块空白）。
 * 在与 .br-filter-dd__trigger 一致的尺寸内占位，避免刷新 / 首次请求期间的闪烁。
 * 初始化后 Tom Select 为原 select 添加 .ts-hidden-accessible，不占布局。
 */
#page-brand_overview .br-filter-dd__select[multiple],
#page-brand_prompts .br-filter-dd__select[multiple],
#page-brand_citations .br-filter-dd__select[multiple],
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd__select[multiple] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface, #fff);
  font-size: 14px;
  line-height: 1.25;
  color: var(--text-muted, #6b7280);
  overflow: hidden;
  cursor: default;
}

.br-filter-summary {
  margin: 0;
  padding: 0 20px 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.br-filter-summary strong {
  color: var(--text-dim, #374151);
  font-weight: 600;
}

/* Flatpickr：品牌报告时期选择器左侧快捷项 */
.flatpickr-calendar.br-fp--with-presets {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}
.br-fp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.br-fp-presets {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  padding: 10px 0;
  min-width: 132px;
  background: #fafafa;
  border-radius: 12px 0 0 12px;
}
.br-fp-preset-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.br-fp-preset-btn:hover {
  background: rgba(233, 30, 99, 0.08);
  color: #E91E63;
}

/* Tom Select — 品牌报告 / 提示词列表筛选（主题色：--accent / --accent-dim） */
#page-brand_overview .br-filter-dd .ts-wrapper,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper {
  min-height: 40px;
}
#page-brand_overview .br-filter-dd .ts-wrapper .ts-control,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper .ts-control {
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: none;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
#page-brand_overview .br-filter-dd .ts-wrapper.focus .ts-control,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper.focus .ts-control {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
#page-brand_overview .br-filter-dd .ts-wrapper .ts-control > input,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper .ts-control > input {
  min-height: 26px;
  color: var(--text);
}
#page-brand_overview .br-filter-dd .ts-wrapper .ts-control > input::placeholder,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper .ts-control > input::placeholder {
  color: var(--text-muted);
}
#page-brand_overview .br-filter-dd .ts-wrapper.multi .ts-control,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper.multi .ts-control {
  padding: 5px 8px 4px;
}
/* 已选标签 / 平台 chip：与主色一致，去掉 Tom Select 默认蓝 */
#page-brand_overview .br-filter-dd .ts-wrapper.multi .ts-control > .item,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper.multi .ts-control > .item {
  margin: 2px 5px 2px 0;
  padding: 3px 6px 3px 8px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(255, 64, 129, 0.12), rgba(255, 64, 129, 0.06));
  border: 1px solid rgba(255, 64, 129, 0.3);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
  text-shadow: none;
  background-image: none;
}
#page-brand_overview .br-filter-dd .ts-wrapper.multi .ts-control > .item.active,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .ts-wrapper.multi .ts-control > .item.active {
  background: linear-gradient(180deg, rgba(255, 64, 129, 0.2), rgba(255, 64, 129, 0.1));
  border-color: rgba(255, 64, 129, 0.45);
}
#page-brand_overview .br-filter-dd .plugin-remove_button .item .remove,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .plugin-remove_button .item .remove {
  border-left: 1px solid rgba(255, 64, 129, 0.28);
  padding: 0 5px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
#page-brand_overview .br-filter-dd .plugin-remove_button .item .remove:hover,
#page-tools_search_prompts #prompts-ts-filters-card .br-filter-dd .plugin-remove_button .item .remove:hover {
  background: rgba(255, 64, 129, 0.12);
}
/* 挂在 body 上 */
body > .ts-dropdown.br-report-ts-dd {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(26, 26, 46, 0.12);
  margin-top: 0;
  margin-left: 0;
  overflow: hidden;
  z-index: 10050;
  background: var(--surface);
}
body > .ts-dropdown.br-report-ts-dd .option {
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-2);
  transition: background 0.12s;
}
body > .ts-dropdown.br-report-ts-dd .option:last-child {
  border-bottom: none;
}
body > .ts-dropdown.br-report-ts-dd .option:hover {
  background: var(--accent-glow);
}
body > .ts-dropdown.br-report-ts-dd .active {
  background: rgba(255, 64, 129, 0.1);
}
body > .ts-dropdown.br-report-ts-dd .ts-dropdown-content {
  max-height: 280px;
}
.br-ts-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.br-ts-row--plat {
  min-height: 28px;
}
.br-ts-row--plat-item {
  align-items: center;
}
.br-ts-plat-logo-wrap {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
}
.br-ts-plat-logo-wrap--sm {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}
.br-ts-plat-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.br-ts-plat-logo--sm {
  padding: 1px;
  box-sizing: border-box;
}
.br-ts-ico--plat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.br-ts-ico--plat-sm {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-radius: 5px;
}
.br-ts-plat-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.br-ts-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--br-pill-border, #d1d5db);
  background: var(--br-pill-bg, #f3f4f6);
  color: var(--br-pill-fg, #374151);
}
.br-ts-pill--item {
  margin: 2px 4px 2px 0;
}
#br-dash-loading:not([hidden]) { color: var(--accent); font-weight: 500; }
.br-dash-loading-text { padding: 0 20px 14px; }
.br-filters-card { margin-bottom: 20px; overflow: visible; }
.br-card-body { padding: 20px; }
.br-viewall-btn { margin-top: 10px; }
.br-empty-state {
  padding: 48px 24px; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center;
}
.br-empty-state p { font-size: 14px; margin: 0; max-width: 360px; line-height: 1.6; }
.br-subpage-loading { color: var(--accent) !important; font-weight: 500; }
@keyframes br-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.br-subpage-loading { animation: br-pulse 1.2s ease-in-out infinite; }

/* 指标帮助提示 tooltip（向下弹出，避免被 card overflow:hidden 裁剪） */
.br-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface-2, #f3f4f6);
  border: 1px solid var(--border-light, #e5e7eb);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  vertical-align: middle;
  margin-left: 5px;
  flex-shrink: 0;
  line-height: 1;
}
.br-tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text, #1a1a2e);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, visibility .15s;
  z-index: 9999;
}
.br-tip::before {
  content: '';
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--text, #1a1a2e);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, visibility .15s;
  z-index: 9999;
}
.br-tip:hover::after,
.br-tip:hover::before { opacity: 1; visibility: visible; }
/* 当 tooltip 靠近左边界时向右偏移 */
th:first-child .br-tip::after,
td:first-child .br-tip::after { left: 0; transform: none; }
th:first-child .br-tip::before,
td:first-child .br-tip::before { left: 8px; transform: none; }
/* 当 tooltip 靠近右边界时向左偏移 */
th:last-child .br-tip::after,
td:last-child .br-tip::after { left: auto; right: 0; transform: none; }
th:last-child .br-tip::before,
td:last-child .br-tip::before { left: auto; right: 8px; transform: none; }
/* 表头内 tooltip */
th .br-tip { margin-left: 4px; }
/* stat-card 内 tooltip */
.stat-label .br-tip { width: 14px; height: 14px; font-size: 10px; }
/* tooltip 所在容器需要允许溢出显示 */
.card-header { overflow: visible; }
.card-title { overflow: visible; }
.stat-top { overflow: visible; }
.stat-label { overflow: visible; }
/* 品牌报告表格区域允许 tooltip 溢出 */
#page-brand_overview .table-wrap,
#page-brand_prompts .table-wrap,
#page-brand_citations .table-wrap { overflow: visible; }
#page-brand_overview .table-wrap table,
#page-brand_prompts .table-wrap table,
#page-brand_citations .table-wrap table { overflow-x: auto; }
/* 品牌报告 card 允许 tooltip 溢出 */
#page-brand_overview .card,
#page-brand_prompts .card,
#page-brand_citations .card { overflow: visible; }
/* 提示词详情 · 回复表 tooltip 不被裁剪 */
#br-pd-panel-replies .br-pd-replies-card,
#br-pd-panel-replies .br-pd-replies-table-wrap { overflow: visible; }
/* 保持 card 的圆角视觉（用 border-radius 而非 overflow:hidden 裁剪） */

/* 品牌可见度页 · 品牌排名表可排序表头 */
#br-table-brand-rank.br-sortable-table thead th.br-sortable-th {
  cursor: pointer;
  user-select: none;
  vertical-align: bottom;
}
#br-table-brand-rank .br-sortable-th-inner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
#br-table-brand-rank .br-sort-icon {
  display: inline-block;
  min-width: 0.65em;
  font-size: 9px;
  line-height: 1;
  opacity: 0.28;
  color: var(--text-muted);
}
#br-table-brand-rank th.br-sorted-asc .br-sort-icon::after,
#br-table-brand-rank th.br-sorted-desc .br-sort-icon::after {
  opacity: 1;
  color: var(--accent, #e91e63);
  font-weight: 700;
}
#br-table-brand-rank th.br-sorted-asc .br-sort-icon::after { content: '▲'; }
#br-table-brand-rank th.br-sorted-desc .br-sort-icon::after { content: '▼'; }
#br-table-brand-rank thead th.br-sortable-th:hover {
  background: rgba(233, 30, 99, 0.05);
}
#br-table-brand-rank thead th.br-sortable-th:hover .br-sort-icon {
  opacity: 0.55;
}

.br-section-body-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
  min-width: 0;
}
.br-section-body-grid > * {
  min-width: 0;
}
/* 趋势图 + 右侧 KPI：等高拉伸，右侧双卡压缩高度与左侧图区对齐 */
.br-trend-split-grid {
  align-items: stretch;
}
.br-chart-block.br-ec-trend-block {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.br-ec-trend-block .br-ec-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #0f172a);
  margin: 0 0 8px;
  line-height: 1.35;
}
.br-ec-trend-block .br-ec-host {
  flex: 1 1 220px;
  min-height: 220px;
  height: auto;
  max-height: none;
}
.br-kpi-stack--trend {
  gap: 10px;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}
.br-kpi-stack--trend .stat-card {
  flex: 1 1 0;
  min-height: 0;
  padding: 10px 12px;
  gap: 6px;
  justify-content: flex-start;
  overflow: hidden;
}
.br-kpi-stack--trend .stat-label {
  font-size: 11px;
}
.br-kpi-stack--trend .stat-value {
  font-size: 20px;
}
.br-kpi-stack--trend .stat-change {
  font-size: 11px;
  margin-top: 2px;
}
.br-kpi-stack--trend .br-stat-sublist {
  margin-top: 4px;
  font-size: 11px;
}
.br-kpi-stack--trend .br-stat-sublist li {
  padding: 4px 0;
}
.br-kpi-coverage-period-note {
  margin: 0 0 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted, #64748b);
}
.br-kpi-coverage-main-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 2px;
}
.br-kpi-coverage-main-row .stat-value {
  line-height: 1.2;
}
.br-kpi-coverage-main-row .stat-change {
  margin: 0;
  white-space: nowrap;
}
.br-kpi-coverage-weak {
  font-size: 11px;
  line-height: 1.35;
  min-height: 0;
}
.br-kpi-coverage-main-row .br-kpi-coverage-weak {
  margin: 0;
}
.br-kpi-coverage-weak:empty {
  display: none;
}
.br-kpi-coverage-subhead {
  margin: 6px 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
}
.br-stat-sublist--brand-rates {
  margin-top: 2px;
}
.br-kpi-brand-rate-li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 6px 10px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border-light, rgba(0, 0, 0, 0.08));
  font-size: 12px;
}
.br-kpi-brand-rate-li--empty {
  grid-template-columns: 1fr;
  border-bottom: none;
}
.br-kpi-brand-rate-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim, #475569);
}
.br-kpi-brand-rate-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text, #0f172a);
}
.br-kpi-brand-rate-weak {
  font-size: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.br-kpi-stack--trend .br-stat-url-list {
  margin-top: 2px;
  font-size: 11px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.br-kpi-stack--trend .br-stat-url-list li {
  padding: 5px 0;
  line-height: 1.35;
}
/* 品牌可见度 · 趋势卡：整体加高，保证右侧两张 KPI 与左侧按日图区舒适可见 */
#page-brand_overview .br-trend-split-grid {
  min-height: min(560px, 88vh);
}
#page-brand_overview .br-chart-block.br-ec-trend-block {
  min-height: 460px;
}
#page-brand_overview .br-ec-trend-block .br-ec-host {
  flex: 1 1 360px;
  min-height: 360px;
}
#page-brand_overview .br-kpi-stack--trend {
  min-height: 0;
  gap: 8px;
}
/* 提及率卡：按内容增高、不出现滚动条；下方「平均位置」卡吸收剩余高度 */
#page-brand_overview .br-kpi-stack--trend .stat-card:first-child {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  padding: 8px 12px;
  gap: 3px;
  overflow: visible;
}
#page-brand_overview .br-kpi-stack--trend .stat-card:last-child {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}
#page-brand_overview .br-kpi-coverage-period-note {
  margin-bottom: 2px;
}
#page-brand_overview .br-kpi-coverage-main-row {
  margin-top: 0;
}
#page-brand_overview .br-kpi-coverage-subhead {
  margin-top: 4px;
  margin-bottom: 1px;
}
#page-brand_overview .br-stat-sublist--brand-rates {
  margin-top: 0;
}

/* 引用分析 · 域名引用率趋势：右侧 Top3 双卡不与左侧图强制等高，列表取消内滚动 */
#page-brand_citations .br-trend-split-grid {
  align-items: start;
}
#page-brand_citations .br-kpi-stack--trend {
  gap: 8px;
}
#page-brand_citations .br-kpi-stack--trend .stat-card {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  padding: 8px 12px;
  gap: 4px;
}
#page-brand_citations .br-kpi-stack--trend .br-stat-url-list {
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
  max-height: none;
  margin-top: 0;
}
#page-brand_citations .br-kpi-stack--trend .br-stat-url-list li {
  padding: 4px 0;
  line-height: 1.3;
}

@media (max-width: 960px) {
  .br-section-body-grid { grid-template-columns: 1fr; }
  #page-brand_overview .table-wrap { -webkit-overflow-scrolling: touch; }
  #page-brand_overview .br-trend-split-grid {
    min-height: 0;
  }
  #page-brand_overview .br-chart-block.br-ec-trend-block {
    min-height: 0;
  }
  #page-brand_overview .br-ec-trend-block .br-ec-host {
    min-height: 300px;
    flex: 1 1 300px;
  }
  .br-kpi-stack--trend .stat-card {
    flex: 0 1 auto;
    min-height: auto;
  }
  #page-brand_overview .br-kpi-stack--trend .stat-card:first-child,
  #page-brand_overview .br-kpi-stack--trend .stat-card:last-child {
    flex: 0 1 auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
  .br-kpi-stack--trend .br-stat-url-list {
    max-height: 160px;
  }
  #page-brand_citations .br-kpi-stack--trend .br-stat-url-list {
    max-height: none;
    overflow: visible;
  }
}

.br-prompt-domain-matrix-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.br-cit-matrix-card {
  margin-bottom: 20px;
}
.br-prompt-domain-matrix-wrap--cit {
  margin-top: 0;
  padding: 16px 20px 20px;
  border-top: none;
  box-sizing: border-box;
}
.br-cit-th {
  vertical-align: top;
  min-width: 0;
}
.br-cit-th-expand {
  width: 42px;
}
.br-cit-th--num {
  min-width: 7rem;
}
.br-cit-th-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}
#page-brand_citations .br-citations-data-table thead th {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-dim);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
}
#page-brand_citations .br-citations-data-table thead .br-cit-col-filter {
  font-size: 12px;
  padding: 6px 9px;
  min-height: 34px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.br-cit-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border-light);
}
.br-cit-pager .pagination {
  margin: 0;
}
.br-cit-pager .pg-btn {
  width: auto;
  min-width: 72px;
  padding: 0 12px;
  font-size: 12px;
}
.br-cit-pager .pg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.br-cit-pager-info {
  font-size: 13px;
}
/* 与 .card-header(16px 20px)、.br-card-body(20px) 对齐，避免矩阵贴边 */
.br-pr-summary-card .card-title {
  margin: 0;
  padding: 16px 20px 10px;
}
.br-pr-summary-scroll {
  overflow-x: auto;
  padding: 0 20px 20px;
  box-sizing: border-box;
}
.br-pr-summary-root {
  min-width: min(100%, 320px);
}
.br-pr-sum-dash {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* 提示词 × 平台矩阵：独立面板（与引用页「域名引用×提示词矩阵」视觉区分） */
.br-prm-panel {
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.08));
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg, var(--surface, #fff));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.br-prm-panel-head {
  padding: 12px 14px 10px;
  background: var(--surface-2, #f8fafc);
  border-bottom: 1px solid var(--border-light, rgba(0, 0, 0, 0.06));
}
.br-prm-head-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.br-prm-row--metric {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.br-prm-row--metric .br-prm-field-label {
  margin: 0;
  white-space: nowrap;
}
.br-prm-row--metric .br-prm-select {
  flex: 1 1 200px;
  min-width: min(200px, 100%);
  max-width: min(440px, 100%);
}
.br-prm-matrix-head-tip.br-tip {
  flex-shrink: 0;
}
.br-prm-row--viz-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.br-prm-row--viz-export .br-prm-field-label {
  margin: 0;
  white-space: nowrap;
}
.br-prm-row--viz-export .br-ec-type-segments {
  flex: 1 1 auto;
  min-width: 0;
}
.br-prm-row--viz-export #br-prm-export-btn {
  margin-left: auto;
}
@media (max-width: 560px) {
  .br-prm-row--viz-export #br-prm-export-btn {
    margin-left: 0;
  }
}
.br-prm-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 0 0 auto;
  min-width: min(240px, 100%);
}
.br-prm-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted, #64748b);
}
.br-prm-select {
  min-width: min(260px, 100%);
  max-width: min(100vw - 48px, 520px);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border-color: var(--border, #e2e8f0);
  background: var(--card-bg, #fff);
}
.br-prm-note {
  margin: 8px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
}
.br-prm-legend-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light, rgba(0, 0, 0, 0.08));
}
.br-prm-legend-row .br-pdm-heat-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
}
.br-prm-table-shell {
  background: var(--card-bg, #fff);
  padding: 0;
}
.br-prm-data-table {
  margin-bottom: 0;
}
.br-prm-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2, #f1f5f9);
  box-shadow: 0 1px 0 var(--border-light, rgba(0, 0, 0, 0.08));
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim, #475569);
  padding-top: 7px;
  padding-bottom: 7px;
}
.br-prm-data-table thead th.br-pdm-corner {
  left: 0;
  z-index: 6;
}
.br-pr-sum-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.br-pr-sum-field label {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
}
.br-pr-sum-select {
  min-width: 200px;
  max-width: min(100vw - 48px, 520px);
  font-size: 13px;
}
.br-pr-sum-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .br-pr-sum-charts {
    grid-template-columns: 1fr;
  }
}
.br-pr-sum-chart-card {
  padding: 0 0 12px;
  margin: 0;
  box-shadow: none;
  border: 1px solid var(--border-light);
}
.br-pr-sum-chart-card .card-title {
  padding: 12px 16px 0;
  margin-bottom: 0;
  font-size: 14px;
}
.br-pr-sum-canvas-wrap {
  position: relative;
  height: 240px;
  padding: 8px 12px 0;
}
.br-pr-sum-canvas-wrap canvas {
  max-height: 220px;
}
.br-pr-sum-chart-card .br-legend {
  padding: 4px 16px 0;
}
.br-pr-sum-bar-hint {
  margin: 4px 16px 0;
  font-size: 12px;
}
.br-pr-sum-heat-card {
  margin: 0;
}
.br-pr-sum-heat-sub {
  margin: 0 16px 8px;
  font-size: 12px;
}
.br-pr-sum-heat-wrap {
  max-height: 360px;
  overflow: auto;
}
.br-pr-sum-heat-table {
  font-size: 12px;
}
.br-pr-sum-heat-btn {
  background: none;
  border: none;
  padding: 2px 4px;
  margin: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  width: 100%;
  text-align: right;
}
.br-pr-sum-heat-btn:hover {
  text-decoration: underline;
}
.br-pr-sum-heat-plain {
  display: block;
  text-align: right;
  padding: 2px 4px;
}
.br-pr-sum-block {
  margin-bottom: 28px;
}
.br-pr-sum-block:last-child {
  margin-bottom: 0;
}
.br-pr-sum-prompt-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.br-pr-sum-table {
  font-size: 13px;
  min-width: 720px;
}
.br-pr-sum-table th.br-pr-sum-plat-head {
  text-align: center;
  background: var(--bg-muted, #f3f4f6);
  border-bottom: 1px solid var(--border-light);
}
.br-pr-sum-table .br-pr-sum-sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card-bg, #fff);
  box-shadow: 1px 0 0 var(--border-light);
  white-space: nowrap;
}
.br-pr-sum-total-row td {
  background: var(--bg-muted, #f9fafb);
  border-top: 1px solid var(--border-light);
}
.br-pr-sum-hit {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--accent, #2563eb);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.br-pr-sum-hit:hover {
  opacity: 0.85;
}
.br-pr-sum-rate {
  margin-left: 4px;
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  white-space: nowrap;
}
.br-pr-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border-light);
}
.br-pr-pager .pagination {
  margin: 0;
}
.br-pr-pager .pg-btn {
  width: auto;
  min-width: 72px;
  padding: 0 12px;
  font-size: 12px;
}
.br-pr-pager .pg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.br-pr-pager-info {
  font-size: 13px;
}

/* 品牌报告 · 专业版门禁（情绪分析 / 官网引用监控） */
.br-pro-gate-card {
  max-width: 640px;
  margin: 0 auto 32px;
  border: 1px solid var(--border-light);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
}
.br-pro-gate-inner {
  position: relative;
  padding: 32px 28px 28px;
  text-align: center;
}
@media (min-width: 640px) {
  .br-pro-gate-inner {
    padding: 40px 36px 32px;
  }
}
.br-pro-gate-inner::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e91e63, #7c3aed, #2563eb);
  opacity: 0.9;
}
.br-pro-gate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 20px;
  color: #e91e63;
  background: rgba(233, 30, 99, 0.1);
  border: 1px solid rgba(233, 30, 99, 0.18);
}
.br-pro-gate-icon--audit {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
}
.br-pro-gate-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
}
.br-pro-gate-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.br-pro-gate-lead {
  margin: 0 auto 20px;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
}
.br-pro-gate-list {
  margin: 0 auto 28px;
  padding: 0;
  max-width: 28em;
  list-style: none;
  text-align: left;
}
.br-pro-gate-list li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}
.br-pro-gate-list li:last-child {
  border-bottom: none;
}
.br-pro-gate-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}
.br-pro-gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.br-pro-gate-foot {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}
.br-pro-gate-list strong {
  color: var(--text-dim);
  font-weight: 600;
}
.br-pro-gate-list em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

.br-matrix-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.br-matrix-toolbar-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px 0;
  min-width: 0;
  flex: 1;
}
.br-matrix-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
}
.br-matrix-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px 10px;
  flex-shrink: 0;
}
.br-pdm-viz-field--toolbar {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.br-pdm-viz-field--toolbar .br-pdm-viz-label {
  margin: 0;
  white-space: nowrap;
}
.br-matrix-title { font-weight: 600; font-size: 14px; }
.br-matrix-note { font-size: 12px; }
.br-matrix-scroll {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* 提示词×平台矩阵：不启用横向/纵向内层滚动，表格铺满宽度、略收紧单元格 */
.br-matrix-scroll.br-prm-matrix-scroll {
  overflow: visible;
}
.br-prm-data-table.br-pdm-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
}
.br-prm-data-table.br-pdm-table td.br-pdm-cell {
  padding: 5px 6px;
}
.br-prm-data-table .br-pdm-cell--grid .br-prm-cell-stack {
  min-width: 0;
  gap: 2px;
  align-items: stretch;
}
.br-prm-data-table .br-pdm-domain {
  max-width: none;
}
.br-pdm-table {
  font-size: 12px;
  width: max-content;
}
.br-pdm-table th.br-pdm-prompt-col {
  max-width: 10em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.br-pdm-corner { min-width: 8.5em; }
.br-pdm-table th .br-prm-th-label {
  margin-right: 4px;
}
.br-pdm-table th .br-tip {
  vertical-align: middle;
}
.br-pdm-domain {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}
.br-pdm-site-name {
  display: block;
  font-weight: 600;
  line-height: 1.35;
}
.br-pdm-domain-host {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}
.br-pdm-table th:first-child,
.br-pdm-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card-bg, var(--surface, #fff));
  box-shadow: 1px 0 0 var(--border, rgba(0, 0, 0, 0.06));
}
.br-pdm-total-row td { background: var(--surface2, rgba(0, 0, 0, 0.03)); }

/* 域名引用×提示词矩阵：热力格（与 Excel 条件格式、GA 热力图类似，浅→深表示相对高低） */
.br-matrix-toolbar-meta .br-pdm-heat-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
@media (max-width: 720px) {
  .br-matrix-toolbar {
    flex-wrap: wrap;
  }
  .br-matrix-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.br-pdm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.br-pdm-legend-label {
  font-weight: 600;
  color: var(--text-dim);
}
.br-pdm-legend-scale {
  display: inline-block;
  width: 72px;
  height: 10px;
  border-radius: 5px;
  border: 1px solid var(--border-light);
}
.br-pdm-legend-scale--count {
  background: linear-gradient(
    90deg,
    rgba(233, 30, 99, 0.07) 0%,
    rgba(233, 30, 99, 0.48) 100%
  );
}
.br-pdm-legend-scale--share {
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.08) 0%,
    rgba(59, 130, 246, 0.45) 100%
  );
}
/* 提示词×平台矩阵：主指标 + 次行「提及·回复」 */
.br-pdm-cell--grid .br-prm-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  min-width: 4.5rem;
}
.br-prm-cell-main {
  line-height: 1.2;
  width: 100%;
  text-align: right;
}
.br-prm-cell-main .br-pr-sum-heat-btn,
.br-prm-cell-main .br-pr-sum-heat-plain {
  display: block;
  width: 100%;
}
.br-prm-cell-sub {
  font-size: 10px;
  line-height: 1.25;
  color: var(--text-muted, #64748b);
  font-weight: 400;
  letter-spacing: -0.02em;
  opacity: 0.88;
  white-space: nowrap;
}
.br-pdm-total-row-metric {
  vertical-align: middle;
}
.br-pdm-total-row-metric .br-prm-cell-sub {
  font-size: 10px;
  opacity: 0.92;
}
.br-pdm-table td.br-pdm-cell {
  min-width: 2.5em;
  padding: 8px 10px;
  text-align: right;
  transition: box-shadow 0.12s ease, filter 0.12s ease;
  vertical-align: middle;
}
.br-pdm-table tbody tr:not(.br-pdm-total-row) td.br-pdm-cell:hover {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
  filter: brightness(0.98);
}
.br-pdm-table td.br-pdm-cell--grid:empty,
.br-pdm-table td.br-pdm-cell--grid:not(:empty) {
  font-variant-numeric: tabular-nums;
}

.br-chart-block {
  min-width: 0;
  min-height: 320px;
  position: relative;
}
.br-chart-block.br-ec-block {
  height: auto;
  display: flex;
  flex-direction: column;
}
.br-ec-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
  margin-bottom: 8px;
}
.br-ec-toolbar-label {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
.br-ec-type-select {
  min-width: 140px;
  max-width: 100%;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
}
.br-ec-type-segments {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.br-ec-type-segments--compact {
  gap: 2px;
}
.br-ec-type-segments--disabled {
  opacity: 0.45;
  pointer-events: none;
}
.br-ec-seg {
  appearance: none;
  margin: 0;
  border: 1px solid var(--border-light, rgba(0, 0, 0, 0.12));
  background: var(--bg-panel, #fff);
  color: var(--text, #334155);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.br-ec-seg:hover {
  border-color: var(--accent, #6366f1);
  color: var(--accent, #6366f1);
}
.br-ec-seg.active {
  background: var(--accent, #6366f1);
  border-color: var(--accent, #6366f1);
  color: #fff;
  font-weight: 500;
}
.br-ec-feature-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 2px;
  white-space: nowrap;
}
.br-ec-host {
  width: 100%;
  height: 280px;
  min-height: 260px;
  flex: 1;
}
.br-prm-ec-wrap,
.br-pdm-ec-wrap {
  padding: 4px 4px 8px;
  border-top: 1px dashed var(--border-light, rgba(0, 0, 0, 0.08));
}
.br-prm-ec-host,
.br-pdm-ec-host {
  width: 100%;
  height: min(520px, 68vh);
  min-height: 300px;
}
.br-pdm-viz-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  min-width: min(200px, 100%);
}
.br-pdm-viz-label {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
.br-pdm-viz-select {
  min-width: 160px;
  font-size: 13px;
}
.br-legend {
  display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; justify-content: center;
}
.br-legend-item {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim);
  cursor: pointer; user-select: none;
}
.br-legend-item input { accent-color: var(--accent); }
.br-legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

.br-kpi-stack { display: flex; flex-direction: column; gap: 14px; }

.br-stat-sublist {
  list-style: none; margin: 10px 0 0; padding: 0;
  font-size: 12px; color: var(--text-dim);
}
.br-stat-sublist li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed var(--border-light);
}
.br-stat-url-list {
  list-style: none; margin: 8px 0 0; padding: 0;
  font-size: 12px; color: var(--text-dim);
}
.br-stat-url-list li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  word-break: break-all;
}

.br-modal-wide.modal { max-width: 960px; }

#page-brand_overview .data-table { font-size: 13px; }
#page-brand_overview .data-table th { text-transform: none; letter-spacing: normal; font-size: 12px; }

/* 品牌报告子页：提示词分析 / 引用分析 */
.br-subpage-breadcrumb { font-size: 13px; margin-bottom: 6px; }
.br-subpage-header .page-title { font-size: 22px; }
.br-subpage-search-dd { flex: 1 1 200px; min-width: 180px; max-width: 320px; }
.br-subpage-hint { margin: 0 0 4px; padding: 0 4px; font-size: 12px; color: var(--text-muted); }
.br-subpage-empty { padding: 32px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }
.br-col-expand { width: 44px; text-align: center; vertical-align: middle; }
.br-expand-btn {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 16px; line-height: 1; color: var(--text-muted);
}
.br-expand-btn:hover { border-color: var(--accent); color: var(--accent); }
.br-prompt-link {
  color: #E91E63; font-weight: 500; text-decoration: none; cursor: pointer;
}
.br-prompt-link:hover { text-decoration: underline; }
.br-prompt-link--inline { font-size: 13px; }
.br-comp-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.br-comp-name {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  line-height: 1.35;
}
.br-comp-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text);
}
.br-yes-no { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.br-yes-no--yes { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.br-yes-no--no { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.br-sub-row td { padding: 0 !important; border-bottom: 1px solid var(--border); }
.br-sub-row-inner { padding: 14px 16px 16px; background: var(--surface-2); }
.br-nested-table { font-size: 12px; margin: 0; }
.br-nested-table th { font-size: 11px; }
.br-cit-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.br-cit-url { font-size: 12px; word-break: break-all; }
.br-cit-url a { color: var(--text-muted); }
.br-plat-code { font-size: 11px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
/* 品牌报告：表格/回复行内「logo + 平台名」 */
.br-inline-plat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  max-width: 100%;
}
.br-inline-plat-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
/* 提示词详情 · 「人工智能搜索引擎的回复」整块 */
.br-pd-replies-card {
  margin: 4px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.br-pd-replies-section-head {
  padding: 13px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(233, 30, 99, 0.045) 0%, transparent 72%),
    var(--surface);
}
.br-pd-replies-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.br-pd-replies-table-wrap {
  padding: 0 0 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.br-pd-replies-table {
  margin: 0;
}
/* 覆盖全局 data-table 表头：中文标题 + 筛选行，取消全大写与字距 */
.br-pd-replies-table thead th {
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  padding: 13px 14px 15px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.br-pd-replies-table thead th:not(:last-child) {
  border-right: 1px solid rgba(15, 23, 42, 0.06);
}
.br-pd-replies-th {
  vertical-align: top;
  min-width: 0;
}
.br-pd-replies-th--date {
  min-width: 168px;
}
.br-pd-replies-table .br-pd-th-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 5px;
  margin-bottom: 9px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}
.br-pd-replies-table .br-pd-th-main > span:first-child {
  color: var(--text);
  font-weight: 600;
}
.br-pd-replies-table .br-pd-th-main .br-tip {
  width: 15px;
  height: 15px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 1px;
  opacity: 0.88;
  flex-shrink: 0;
}
.br-pd-replies-table thead .br-pd-col-filter {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px 10px;
  min-height: 36px;
  font-size: 12.5px;
  line-height: 1.35;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.br-pd-replies-table thead .br-pd-col-filter:hover {
  border-color: rgba(15, 23, 42, 0.14);
}
.br-pd-replies-table thead .br-pd-col-filter:focus {
  border-color: rgba(233, 30, 99, 0.5);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.09);
  outline: none;
}
.br-pd-replies-table thead select.br-pd-col-filter--select {
  cursor: pointer;
  appearance: auto;
  padding-right: 8px;
}
.br-pd-date-filter-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}
.br-pd-replies-table .br-pd-filter-date-range {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.br-pd-replies-table .btn.btn-sm.br-pd-filter-date-clear {
  flex-shrink: 0;
  align-self: center;
  margin: 0;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: none;
}
.br-pd-replies-table .btn.btn-sm.br-pd-filter-date-clear:hover {
  border-color: rgba(233, 30, 99, 0.35);
  color: #c2185b;
  background: rgba(233, 30, 99, 0.06);
}

.br-pd-reply-plat-cell {
  display: inline-block;
  margin-right: 8px;
  vertical-align: top;
}
.br-pd-reply-lead {
  display: block;
  line-height: 1.45;
}
.br-rd-pill--plat {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  gap: 4px;
}
.br-rd-pill--plat .br-inline-plat { gap: 8px; }

/* 子页 Tom Select 与 Overview 一致 */
#page-brand_prompts .br-filter-dd .ts-wrapper,
#page-brand_citations .br-filter-dd .ts-wrapper { min-height: 40px; }
#page-brand_prompts .br-filter-dd .ts-wrapper .ts-control,
#page-brand_citations .br-filter-dd .ts-wrapper .ts-control {
  min-height: 40px; padding: 6px 10px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface);
}
#page-brand_prompts .br-filter-dd .ts-wrapper.focus .ts-control,
#page-brand_citations .br-filter-dd .ts-wrapper.focus .ts-control {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
#page-brand_prompts .br-filter-dd .ts-wrapper.multi .ts-control > .item,
#page-brand_citations .br-filter-dd .ts-wrapper.multi .ts-control > .item {
  margin: 2px 5px 2px 0; padding: 3px 6px 3px 8px; border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(255, 64, 129, 0.12), rgba(255, 64, 129, 0.06));
  border: 1px solid rgba(255, 64, 129, 0.3); font-size: 12px; font-weight: 500;
}

/* 品牌报告：右侧抽屉（提示词详情 / 回复明细） */
.br-drawer-overlay {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.br-drawer-overlay .modal.br-drawer-panel {
  animation: none;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 64px rgba(15, 23, 42, 0.12);
  border-left: 1px solid var(--border-light);
}
.br-drawer-overlay.open .modal.br-drawer-panel {
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .br-drawer-overlay .modal.br-drawer-panel {
    transition: none;
    transform: none;
  }
}
.br-pd-drawer {
  max-width: min(960px, 100%);
}
.br-reply-drawer {
  max-width: min(640px, 100%);
}
@media (min-width: 1400px) {
  .br-pd-drawer {
    max-width: min(1040px, 100%);
  }
  .br-reply-drawer {
    max-width: min(720px, 100%);
  }
}
.br-drawer-overlay .modal-header.br-drawer-header {
  flex-shrink: 0;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.br-drawer-overlay .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  -webkit-overflow-scrolling: touch;
}
.br-drawer-overlay--reply { z-index: 220; }

/* 提示词详情（抽屉内） */
.br-pd-body { padding-top: 0; }
.br-pd-hero {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding: 18px 22px; margin-bottom: 12px;
  border-radius: var(--r-md);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.br-pd-hero-label { font-size: 12px; margin-bottom: 6px; }
.br-pd-hero-text { font-size: 15px; line-height: 1.55; font-weight: 500; }
.br-pd-hero-aside { font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.br-pd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.br-pd-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  border: none; background: none; cursor: pointer; font-size: 14px;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.br-pd-tab svg { opacity: 0.7; }
.br-pd-tab.active { color: #E91E63; border-bottom-color: #E91E63; font-weight: 600; }
.br-pd-tab.active svg { opacity: 1; stroke: #E91E63; }
.br-pd-meta-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.br-pd-meta-card {
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface);
}
.br-pd-meta-label { font-size: 11px; margin-bottom: 6px; }
.br-pd-meta-value { font-size: 14px; font-weight: 500; }
.br-pd-chart-card .card-title { padding: 14px 24px 0; font-size: 15px; }
.br-pd-body .card:not(.br-pd-chart-card) > .card-title {
  padding: 16px 24px 0;
}
#br-pd-chart-coverage { max-height: 240px; }
.br-pd-replies-table tbody td {
  font-size: 13px;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}
.br-pd-replies-table tbody tr:last-child td {
  border-bottom: none;
}
.br-pd-reply-date-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}
.br-pd-reply-date-rel {
  font-weight: 500;
  line-height: 1.3;
}
.br-pd-reply-date-abs {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-muted);
  opacity: 0.88;
  font-variant-numeric: tabular-nums;
}
.br-pd-replies-table .br-pd-reply-row { cursor: pointer; }
.br-pd-replies-table .br-pd-reply-row:hover {
  background: rgba(233, 30, 99, 0.05);
}
.br-pd-reply-row--focus {
  outline: 2px solid rgba(233, 30, 99, 0.35);
  background: rgba(233, 30, 99, 0.06);
}
.br-pd-my-hit {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  max-width: min(260px, 40%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* 回复明细抽屉（设计稿式分区） */
.br-rd-header {
  align-items: flex-start;
  gap: 12px;
}
.br-rd-header-text { min-width: 0; flex: 1; }
.br-rd-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.br-rd-headline {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.br-rd-sheet { padding-top: 4px; }
.br-rd-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.br-rd-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(233, 30, 99, 0.1);
  color: #c2185b;
  border: 1px solid rgba(233, 30, 99, 0.22);
}
.br-rd-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.45;
}
.br-rd-datetime {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.br-rd-section { margin-bottom: 22px; }
.br-rd-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.br-rd-section--reply .br-rd-section-label {
  padding-left: 10px;
  border-left: 3px solid #E91E63;
}
.br-rd-text-card {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.68;
  padding: 18px 20px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  max-height: min(58vh, 560px);
  overflow-y: auto;
  color: var(--text);
}
/* 人工智能响应：固定视口比例高度，iframe / 纯文本区 flex 撑满并可滚动 */
.br-rd-text-card.br-rd-reply-body-wrap {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(320px, 40vh);
  height: min(58vh, 560px);
  max-height: min(58vh, 560px);
  white-space: normal;
}
.br-rd-reply-iframe {
  display: block;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  border: none;
  background: #fff;
  align-self: stretch;
}
.br-rd-reply-text-plain {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.68;
  padding: 18px 20px;
  color: var(--text);
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  align-self: stretch;
}
.br-rd-kv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.br-rd-kv {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 14px;
  align-items: start;
  font-size: 13px;
}
.br-rd-kv--full {
  grid-template-columns: 100px 1fr;
}
.br-rd-kv-k { color: var(--text-muted); font-weight: 500; }
.br-rd-kv-v { font-weight: 500; }
.br-rd-kv-v--wrap { min-width: 0; }
.br-rd-brand-hit {
  display: inline-block;
  margin-left: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  vertical-align: middle;
}
.br-rd-link-box {
  font-size: 13px;
  word-break: break-all;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
}
.br-rd-share-link {
  color: #E91E63;
  font-weight: 500;
  text-decoration: none;
}
.br-rd-share-link:hover { text-decoration: underline; }
.br-rd-source-list { display: flex; flex-direction: column; gap: 12px; }
.br-rd-source-item {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.br-rd-source-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #E91E63;
  text-decoration: none;
  line-height: 1.45;
}
.br-rd-source-title:hover { text-decoration: underline; }
.br-rd-source-host { font-size: 11px; margin-top: 4px; }
.br-rd-source-empty { padding: 8px 0; font-size: 13px; }

