:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e2e8f0;
  --accent: #3b82f6;
  --accent-soft: #eff6ff;
  --accent-dark: #1d4ed8;
  --up: #dc2626;      /* 上涨=红（华人习惯） */
  --up-bg: #fef2f2;
  --down: #059669;    /* 下跌=绿 */
  --down-bg: #ecfdf5;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --shadow: 0 1px 2px rgba(30, 58, 138, 0.04), 0 8px 24px rgba(30, 58, 138, 0.06);
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(90deg, #0f172a, #1e40af 55%, #3b82f6);
  color: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.topbar .muted { color: rgba(255,255,255,0.72); font-size: 0.82rem; }
.container { max-width: 1280px; margin: 1.1rem auto 3rem; padding: 0 1rem; }
.container.container-wide { max-width: 1540px; padding: 0 1.25rem; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1e293b;
}
.panel h2 .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem;
}
.section-head h2 { margin: 0; }

.back { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.placeholder { color: #9ca3af; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82em; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  border-top: 3px solid var(--accent);
}
.hero h1 { margin: 0 0 0.35rem; font-size: 1.45rem; letter-spacing: 0.01em; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.55rem 1.1rem; color: var(--muted); font-size: 0.92rem; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-dark);
}
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warning { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.price-tag { font-size: 1.35rem; font-weight: 700; color: var(--accent-dark); }

/* KPI strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 0.7rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
}
.kpi-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.55rem; font-weight: 700; margin: 0.15rem 0; letter-spacing: -0.02em; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.delta { font-size: 0.78rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 6px; cursor: help; }
.delta.up { color: var(--up); background: var(--up-bg); }
.delta.down { color: var(--down); background: var(--down-bg); }
.delta.flat { color: var(--muted); background: #f3f4f6; }
.spark { width: 88px; height: 32px; display: inline-block; vertical-align: middle; }

/* Alerts + insights */
.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .split-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}

/* Alerts & Insights Header */
.section-head.alert-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.alert-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.badge.ai-badge-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
  border: 1px solid #a7f3d0;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.badge.baseline-badge-pill {
  font-size: 0.75rem;
  font-weight: normal;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.alert-count-pill, .insight-count-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Alert Filter Group */
.alert-filter-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.alert-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.alert-filter-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}
.alert-filter-btn.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}
.alert-filter-btn.filter-danger.active {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.alert-filter-btn.filter-warning.active {
  background: #d97706;
  color: #ffffff;
  border-color: #d97706;
}
.alert-filter-btn.filter-info.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.filter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.filter-dot.danger { background: #ef4444; }
.filter-dot.warning { background: #f59e0b; }
.filter-dot.info { background: #3b82f6; }
.alert-filter-btn.active .filter-dot {
  background: #ffffff;
}
.filter-count {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Alert List & Items */
.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.alert-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 1;
}
.alert-item:hover,
.alert-item:focus-within {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
  z-index: 10;
}
.alert-item:has(.rtip:hover),
.alert-item:has(.rtip:focus-within),
.alert-item.rtip-elevated {
  z-index: 100 !important;
}
.alert-item.danger {
  border-left: 5px solid #ef4444;
  background: linear-gradient(90deg, #fffafa 0%, #ffffff 120px);
}
.alert-item.warning {
  border-left: 5px solid #f59e0b;
  background: linear-gradient(90deg, #fffdf8 0%, #ffffff 120px);
}
.alert-item.info {
  border-left: 5px solid #3b82f6;
  background: linear-gradient(90deg, #f8faff 0%, #ffffff 120px);
}

.alert-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.alert-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.alert-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.alert-level-pill.danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.alert-level-pill.warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.alert-level-pill.info {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.alert-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
}
.alert-detail {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.62;
  margin-top: 0.35rem;
}

/* Suggested Action Box */
.alert-action-box {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  margin-top: 0.65rem;
}
.alert-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}
.alert-action-text {
  font-size: 0.84rem;
  color: #1e3a8a;
  line-height: 1.55;
  font-weight: 500;
}

/* Alert expand / collapse toggle */
.alert-expand-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}
.btn-alert-expand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-alert-expand:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.expand-arrow {
  font-size: 0.85rem;
  color: var(--accent);
}

/* Insights Grid & Card */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 0.95rem;
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .insight-grid {
    grid-template-columns: 1fr;
  }
}
.insight-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  border-top: 3px solid #3b82f6;
  padding: 0.9rem 1.15rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.insight-card:hover,
.insight-card:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  z-index: 10;
}
.insight-card:has(.rtip:hover),
.insight-card:has(.rtip:focus-within),
.insight-card.rtip-elevated {
  z-index: 100 !important;
}
.insight-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.insight-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.insight-topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}
.insight-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}
.insight-detail {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

/* Charts */
.chart-wrap { position: relative; height: 220px; margin-top: 0.4rem; }
.chart-box { width: 100%; height: 100%; }
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
}
.chart-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fff;
}
.chart-card h3 { margin: 0 0 0.35rem; font-size: 0.88rem; color: #374151; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th, .table td {
  text-align: left; padding: 0.5rem 0.45rem; border-bottom: 1px solid var(--border); vertical-align: top;
}
.table th {
  color: var(--muted); font-weight: 600; font-size: 0.75rem;
  background: #f8fafc; position: sticky; top: 0; z-index: 5;
}
.table tr:hover td { background: #f8fafc; }
.tag {
  display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.4rem;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 0.68rem;
}
.tag.avail { background: #eef2ff; color: #4338ca; }
.val-empty { color: #9ca3af; }

/* Accordion */
details.acc {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-top: 0.65rem;
}
details.acc summary {
  cursor: pointer; padding: 0.7rem 0.9rem; font-weight: 600; color: #374151; list-style: none;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "▾"; float: right; color: var(--accent); }
details.acc[open] summary::after { content: "▴"; }
details.acc .acc-body { padding: 0 0.75rem 0.75rem; }

html {
  scroll-behavior: smooth;
}
#kpis,
#alerts,
#insights,
#ai,
#trends,
#analysis,
section[id^="sec-"] {
  scroll-margin-top: 1.1rem;
}

/* ---- 详情页左右分栏布局与左侧纵向导航 ---- */
.detail-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.detail-sidebar {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 1.1rem;
  max-height: calc(100vh - 2.2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-sidebar::-webkit-scrollbar {
  width: 4px;
}
.detail-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.detail-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.detail-main {
  flex: 1;
  min-width: 0;
}

.side-nav-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.55rem;
  box-shadow: var(--shadow);
}

.side-nav-header {
  padding: 0.15rem 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.65rem;
}

.side-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.side-nav-back:hover {
  text-decoration: underline;
  color: var(--accent-dark);
}

.side-nav-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.06em;
  padding: 0 0.45rem 0.4rem;
}

.side-nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-nav-item .nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav-item:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
}

.side-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  border-left-color: var(--accent);
}

.side-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  flex-shrink: 0;
}
.side-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.42rem;
  min-width: 1rem;
  text-align: center;
  border-radius: 999px;
  line-height: 1.25;
  flex-shrink: 0;
}
.side-badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.side-badge.warning {
  background: var(--warn-bg);
  color: var(--warn);
}

@media (max-width: 900px) {
  .detail-layout {
    flex-direction: column;
  }
  .detail-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .side-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .side-nav-item {
    border-left: none;
    border: 1px solid var(--border);
    border-radius: 999px;
  }
  .side-nav-item.active {
    border-color: var(--accent);
  }
  .an-table-wrap {
    overflow-x: auto;
  }
}

.nav-pills {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem;
}
.nav-pills a {
  padding: 0.28rem 0.7rem; border-radius: 999px; background: #fff;
  border: 1px solid var(--border); color: #334155; font-size: 0.8rem; font-weight: 600;
}
.nav-pills a:hover { background: var(--accent-soft); text-decoration: none; color: var(--accent-dark); }

.stats-line { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.note-weak { font-size: 0.75rem; color: var(--warn); }
.as-of-note{font-size:11px;color:#9aa3af;margin-left:6px}
.multi-src{border-bottom:1px dotted #9aa3af;cursor:help}
.metric-note,.kpi-note{font-size:.75rem;margin-left:.35rem}

/* ---- 指标双列排版 (Metric Grid) ---- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2.2rem;
  row-gap: 0;
}
@media (max-width: 820px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}
.metric-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.52rem 0.35rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  gap: 0.75rem;
}
.metric-item:hover {
  background: rgba(59, 130, 246, 0.03);
  border-radius: 6px;
}
.metric-key {
  color: var(--text);
  font-size: 0.86rem;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
  line-height: 1.4;
}
.metric-label {
  font-weight: 500;
  color: #374151;
}
.metric-val {
  font-weight: 600;
  color: #111827;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  word-break: break-word;
}
.note-weak-inline {
  display: inline-block;
  font-size: 0.68rem;
  color: #b45309;
  background: #fef3c7;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
}

/* ---- 核心关键词情报表 ---- */
.kw-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin: 0.4rem 0 0.8rem;
}
.kw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 680px;
}
.kw-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  padding: 0.55rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  white-space: nowrap;
}
.kw-table td {
  padding: 0.52rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.kw-table tr:last-child td {
  border-bottom: none;
}
.kw-table tr:hover td {
  background: #f8fafc;
}
.kw-name {
  font-weight: 600;
  color: #1f2937;
}
.kw-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.2rem;
}
.kw-badge.sb { background: #e0f2fe; color: #0284c7; }
.kw-badge.sbv { background: #fef3c7; color: #b45309; }
.kw-badge.sp { background: #dcfce7; color: #15803d; }
.kw-badge.none { color: #9ca3af; }
.kw-rank-good {
  color: #16a34a;
  font-weight: 600;
}
.kw-rank-mid {
  color: #2563eb;
}
.kw-rank-none {
  color: #9ca3af;
}
.kw-share-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.kw-share-bar {
  height: 6px;
  background: #3b82f6;
  border-radius: 3px;
  min-width: 2px;
}
.kw-expand-btn {
  display: block;
  width: 100%;
  padding: 0.55rem;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  margin-top: 0.4rem;
}
.kw-expand-btn:hover {
  background: var(--accent-soft);
}

/* ---- 前台流量结构看板 ---- */
.traffic-overview {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.2fr;
  gap: 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.85rem;
}
@media (max-width: 900px) {
  .traffic-overview {
    grid-template-columns: 1fr;
  }
}
.tr-kpi-card h4 {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.tr-kpi-val {
  font-size: 1.45rem;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.dual-bar-container {
  margin-top: 0.4rem;
}
.dual-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}
.dual-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}
.dual-bar-org {
  background: #3b82f6;
  height: 100%;
}
.dual-bar-ad {
  background: #f59e0b;
  height: 100%;
}
.pos-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.pos-chip {
  font-size: 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  color: #374151;
}
.pos-chip b {
  color: #1e40af;
}

/* ---- 关联分析 ---- */
.an-toggles { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin:.25rem 0 1rem; }
.an-toggle { background:var(--accent-soft,#eff6ff); color:var(--accent,#3b82f6); border-radius:999px; padding:.3rem .8rem; font-size:.85rem; cursor:pointer; user-select:none; }
.an-toggle input { accent-color:var(--accent,#3b82f6); vertical-align:-2px; }
.an-tools { font-size:.8rem; margin-left:auto; }
.an-tools a { color:var(--accent,#3b82f6); }
.an-block { border:1px solid #dbeafe; border-radius:14px; padding:1rem 1.1rem; margin-bottom:1rem; background:#f8fafc; }
.an-block[hidden] { display:none; }
.an-head { display:flex; gap:.75rem; align-items:baseline; flex-wrap:wrap; }
.an-head h3 { margin:0; font-size:1.02rem; color:#1e40af; }
.an-head .muted { font-size:.8rem; }
.an-conclusions { margin:.6rem 0 .8rem; padding:.6rem .9rem .6rem 1.8rem; background:var(--accent-soft,#eff6ff); border-left:3px solid var(--accent,#3b82f6); border-radius:8px; }
.an-conclusions li { margin:.2rem 0; font-size:.9rem; line-height:1.5; }
.an-charts .chart-card.wide { grid-column:1 / -1; }
.an-charts.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) {
  .an-charts.cols-3 { grid-template-columns: 1fr; }
}
.an-wrap { height:260px; }
.an-table-wrap { margin-top:.6rem; }
.an-table-title { font-size:.8rem; margin-bottom:.25rem; }
.an-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--accent-soft, #eff6ff);
  color: #1e40af;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #bfdbfe;
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.08);
}
.an-table th:nth-child(n+3) { text-align: right; }
.an-table td { font-size:.85rem; }
.an-table tr.an-hl td { background:#fff1ee; font-weight:600; }
.an-table td.lvl-bad { background:#ffe3e0; color:#c0392b; font-weight:600; }
.an-table td.lvl-warn { background:#fff6dc; color:#a77b00; font-weight:600; }
.an-table td.lvl-ok { color:#2d8a6e; }

/* ---- 图表/表格切换卡片样式 ---- */
.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  gap: 0.5rem;
}
.chart-card-head h3 {
  margin: 0;
  font-size: 0.88rem;
  color: #374151;
}
.an-switch {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.an-switch-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.35;
  transition: all 0.15s ease;
  font-weight: 500;
  font-family: inherit;
}
.an-switch-btn:hover {
  color: #1e293b;
}
.an-switch-btn.active {
  background: #ffffff;
  color: #1e40af;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}
.an-wrap-table {
  overflow-y: auto;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  background: #ffffff;
  box-sizing: border-box;
}
.an-card-table {
  width: 100%;
  border-collapse: collapse;
}
.an-card-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--accent-soft, #eff6ff);
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.42rem 0.6rem;
  border-bottom: 1px solid #dbeafe;
  white-space: nowrap;
}
.an-card-table td {
  font-size: 0.82rem;
  padding: 0.38rem 0.6rem;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.an-card-table th:nth-child(2),
.an-card-table td:nth-child(2),
.an-card-table th:nth-child(3),
.an-card-table td:nth-child(3) {
  text-align: right;
}
.an-card-table tbody tr:hover td {
  background: #f8fafc;
}
.an-card-table tbody tr:first-child td,
.an-card-table tbody tr:last-child td {
  font-weight: 600;
}

/* ---- 运营事件前后对比表格样式 ---- */
.cell-date {
  white-space: nowrap !important;
  vertical-align: top !important;
  padding-top: 0.75rem !important;
  width: 76px;
}
.event-date-pill {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  background: #f1f5f9;
  color: #1e293b;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.cell-events {
  min-width: 240px;
  max-width: 360px;
  vertical-align: top !important;
  padding-top: 0.75rem !important;
}
.event-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.event-item-line {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.45;
}
.event-cat-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.event-cat-badge.badge-rating {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}
.event-cat-badge.badge-price {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.event-cat-badge.badge-ad {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.event-cat-badge.badge-other {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.event-cat-badge.badge-more {
  background: #f3f4f6;
  color: #6b7280;
}
.event-item-text {
  color: #374151;
  word-break: break-all;
}
.cell-compare {
  vertical-align: middle !important;
  text-align: right !important;
  white-space: nowrap !important;
  min-width: 105px;
}
.cmp-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}
.cmp-values {
  font-size: 0.82rem;
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}
.cmp-before {
  color: #64748b;
  font-size: 0.78rem;
}
.cmp-arrow {
  color: #94a3b8;
  font-size: 0.72rem;
}
.cmp-after {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.84rem;
}
.cmp-delta {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.06rem 0.35rem;
  border-radius: 4px;
  line-height: 1.25;
}
/* 华人习惯：上涨=红，下跌=绿 */
.delta-up, .delta.up, .cmp-delta.delta-up {
  background: var(--up-bg, #fef2f2);
  color: var(--up, #dc2626);
}
.delta-down, .delta.down, .cmp-delta.delta-down {
  background: var(--down-bg, #ecfdf5);
  color: var(--down, #059669);
}
.delta-flat, .delta.flat, .delta-neutral, .cmp-delta.delta-flat {
  background: #f3f4f6;
  color: #4b5563;
}
.delta-good {
  background: var(--up-bg, #fef2f2);
  color: var(--up, #dc2626);
}
.delta-bad {
  background: var(--down-bg, #ecfdf5);
  color: var(--down, #059669);
}

/* ---- AI 解读 ---- */
.ai-actions { display:flex; gap:.75rem; align-items:center; }
.ai-btn { background:var(--accent,#3b82f6); color:#fff; border:0; border-radius:999px; padding:.4rem 1rem; font-size:.85rem; cursor:pointer; }
.ai-btn:hover { filter:brightness(1.08); }
.ai-btn:disabled { opacity:.6; cursor:wait; }
.ai-summary { background:var(--accent-soft,#eff6ff); border-left:3px solid var(--accent,#3b82f6); border-radius:8px; padding:.8rem 1rem; line-height:1.7; font-size:.92rem; }
.ai-hl { margin:.6rem 0; padding-left:1.3rem; font-size:.88rem; line-height:1.6; }
.ai-sub { font-size:.95rem; color:#1e40af; margin:.8rem 0 .4rem; }
.ai-todos { padding-left:1.3rem; }
.ai-todos li { margin:.45rem 0; font-size:.9rem; }
.ai-todos .muted { font-size:.8rem; margin-top:.15rem; }
.ai-err { color:#a77b00; background:#fff6dc; border-radius:8px; padding:.6rem .9rem; }

/* 规则悬停说明 */
.rtip{position:relative;display:inline-flex;align-items:center;justify-content:center;width:1.05em;height:1.05em;margin-left:.2em;
  font-size:.85em;font-weight:500;color:var(--accent,#3b82f6);cursor:help;border-radius:50%;vertical-align:baseline;outline:none;z-index:2}
.rtip:hover,.rtip:focus,.rtip:focus-within{background:var(--accent-soft,#eff6ff);z-index:200}
.rtip-box{display:none;position:absolute;z-index:999;left:0;top:calc(100% + 6px);transform:translateX(var(--shift-x, 0px));width:max-content;max-width:min(380px, calc(100vw - 24px));
  padding:.6rem .75rem;background:#fff;border:1px solid #bfdbfe;border-radius:10px;box-shadow:0 8px 24px rgba(59,130,246,.18);
  color:#1e293b;font-size:12.5px;font-weight:400;line-height:1.55;text-align:left;white-space:normal;pointer-events:auto}
.rtip:hover .rtip-box,.rtip:focus .rtip-box,.rtip:focus-within .rtip-box,.rtip.force .rtip-box{display:block}
.rtip-row{display:block;margin:.15rem 0}
.rtip-row b{display:inline-block;min-width:4.5em;margin-right:.4em;color:var(--accent,#3b82f6);font-weight:600}
.rtip-elevated{z-index:100 !important}
.rule-list{margin-top:.8rem;border-top:1px dashed #dbeafe;padding-top:.6rem}
.rule-list summary{cursor:pointer;color:var(--accent,#3b82f6);font-weight:600;font-size:.92rem}
.rule-table{width:100%;border-collapse:collapse;margin-top:.5rem;font-size:12.5px}
.rule-table th,.rule-table td{padding:.35rem .4rem;border-bottom:1px solid #f1f5f9;text-align:left;vertical-align:top}
.rule-table th{color:#64748b;font-weight:500}
.rule-table tr.on td{background:#fff8f0}

.section-head h2{white-space:nowrap;display:flex;align-items:center;gap:.15rem}
#ai .section-head{flex-wrap:wrap;gap:.5rem}
#ai #ai-meta{font-size:.82rem}

/* 规则阈值配置与弹窗 */
.rule-summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; color: var(--accent,#3b82f6); font-weight: 600; font-size: .92rem; }
.rule-summary-actions { display: inline-flex; align-items: center; gap: .5rem; }
.rule-custom-pill { font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.btn-config-trigger {
  appearance: none; background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
  padding: .2rem .6rem; border-radius: 6px; font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .15s ease; line-height: 1.4;
}
.btn-config-trigger:hover { background: #dbeafe; border-color: #93c5fd; }

/* 模态弹框 */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 1.2rem;
  animation: modalFadeIn .18s ease-out;
}
.modal-overlay.open { display: flex; }
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #ffffff; width: 100%; max-width: 680px; max-height: 90vh;
  border-radius: 14px; box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalSlideUp .2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideUp {
  from { transform: translateY(12px) scale(0.98); }
  to { transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.1rem 1.3rem .8rem; border-bottom: 1px solid #f1f5f9;
}
.modal-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #0f172a; }
.modal-sub { margin: .25rem 0 0; font-size: .8rem; color: #64748b; }
.modal-close {
  appearance: none; background: transparent; border: none; font-size: 1.5rem; line-height: 1;
  color: #94a3b8; cursor: pointer; padding: 0 .2rem; border-radius: 4px;
}
.modal-close:hover { color: #0f172a; background: #f1f5f9; }

.modal-body { padding: 1rem 1.3rem; overflow-y: auto; }
.modal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  padding: .85rem 1.3rem; background: #f8fafc; border-top: 1px solid #f1f5f9;
}

.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .65rem; }
.tm-field-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: .6rem .75rem; display: flex; flex-direction: column; justify-content: space-between; }
.tm-field-header { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; font-weight: 600; color: #334155; margin-bottom: .3rem; }
.tm-unit { font-size: .75rem; color: #94a3b8; font-weight: 500; }
.tm-input-wrap { display: flex; align-items: center; }
.tm-input-wrap input {
  width: 100%; padding: .3rem .5rem; font-size: .9rem; font-family: ui-monospace, monospace;
  font-weight: 600; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 6px; outline: none;
  background: #ffffff; transition: border-color .15s;
}
.tm-input-wrap input:focus { border-color: var(--accent, #3b82f6); background: #fff; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.tm-field-desc { font-size: .72rem; color: #94a3b8; margin-top: .3rem; line-height: 1.3; }

.tm-actions-left { display: flex; align-items: center; gap: .5rem; }
.modal-footer .btn {
  appearance: none; border-radius: 6px; padding: .38rem .9rem; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all .15s ease; border: 1px solid transparent;
}
.modal-footer .btn-primary { background: var(--accent, #3b82f6); color: #fff; }
.modal-footer .btn-primary:hover { filter: brightness(1.08); }
.modal-footer .btn-primary:disabled { opacity: .6; cursor: wait; }
.modal-footer .btn-outline { background: #fff; border-color: #cbd5e1; color: #475569; }
.modal-footer .btn-outline:hover { background: #f1f5f9; color: #1e293b; }
.tm-status { font-size: .8rem; font-weight: 500; margin-left: .3rem; }
.tm-status.ok { color: #059669; }
.tm-status.err { color: #dc2626; }
.tm-tip { font-size: .75rem; color: #94a3b8; }

/* 手动更新按钮（次要小按钮，浅紫主色） */
.sync-row { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.btn-sync {
  font-size: 0.75rem; line-height: 1; padding: 0.3rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-dark); cursor: pointer; font-weight: 500;
}
.btn-sync:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 15%, #fff); border-color: var(--accent); }
.btn-sync:disabled { opacity: 0.6; cursor: not-allowed; }
.sync-msg { font-size: 0.75rem; color: var(--muted); }
.sync-msg.ok { color: var(--ok); }
.sync-msg.err { color: var(--danger); }

/* 首页列表：纯图标操作按钮（垃圾桶图标，中性素雅） */
.btn-subtle-del,
.btn-danger-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1;
}
.btn-subtle-del:hover:not(:disabled),
.btn-danger-sm:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}
.btn-subtle-del:active:not(:disabled),
.btn-danger-sm:active:not(:disabled) {
  background: #e2e8f0;
}
.btn-subtle-del:disabled,
.btn-danger-sm:disabled {
  opacity: .5;
  cursor: wait;
}
.btn-subtle-del svg {
  transition: transform .15s ease;
}
.btn-subtle-del:hover:not(:disabled) svg {
  transform: scale(1.08);
}
@keyframes icon-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin {
  animation: icon-spin 0.8s linear infinite;
  display: inline-block;
}

/* 运营定位与战略意图横幅卡片 */
.strategy-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--accent, #3b82f6);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: 10px;
}

.strategy-banner-inner {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
}

.strategy-left-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  width: 300px;
}

.strategy-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.strategy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}
.strategy-badge.stage-launch { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.strategy-badge.stage-profit { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.strategy-badge.stage-stockout { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.strategy-badge.stage-defense { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.strategy-badge.stage-clearance { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.strategy-badge.stage-custom { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.strategy-badge.stage-unset { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

.strategy-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
}

.strategy-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.btn-strategy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
  box-sizing: border-box;
  width: 100%;
}

.btn-strategy-target {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.btn-strategy-target:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.btn-strategy-target:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.btn-strategy-ai {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.22);
}
.btn-strategy-ai:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}
.btn-strategy-ai:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.22);
}
.btn-strategy:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

.strategy-prompt-preview {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.88);
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  padding: 0.75rem 1rem;
  white-space: pre-line;
  min-height: 125px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  box-sizing: border-box;
}
.strategy-prompt-preview::-webkit-scrollbar {
  width: 5px;
}
.strategy-prompt-preview::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.strategy-prompt-preview::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (max-width: 768px) {
  .strategy-banner-inner {
    flex-direction: column;
  }
  .strategy-left-col {
    width: 100%;
  }
  .strategy-actions {
    flex-direction: row;
  }
}

.btn-sm {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8rem !important;
}

/* 策略配置大弹窗 */
.modal-box-large {
  max-width: 820px !important;
}
.modal-sec-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}
.preset-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.55rem;
  margin-top: 0.45rem;
}
.preset-pill-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-pill-btn:hover {
  background: #f0f7ff;
  border-color: #93c5fd;
}
.preset-pill-btn.active {
  background: #eff6ff;
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.pill-icon {
  font-size: 1.2rem;
  line-height: 1.2;
}
.pill-text {
  display: flex;
  flex-direction: column;
}
.pill-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}
.pill-desc {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
  margin-top: 0.15rem;
}
.prompt-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.15s;
}
.prompt-textarea:focus {
  border-color: var(--accent, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.strategy-status {
  font-size: 0.82rem;
  font-weight: 500;
  margin-left: 0.4rem;
}
.strategy-status.ok { color: #059669; }
.strategy-status.err { color: #dc2626; }


/* 竞品对照：全新多维对比矩阵看板 */
.comp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}
.comp-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.comp-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.comp-search-icon {
  position: absolute;
  left: 0.65rem;
  color: #94a3b8;
  pointer-events: none;
}
.comp-add input {
  width: 260px;
  padding: 0.45rem 0.75rem 0.45rem 2.1rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 0.85rem;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.comp-add input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.comp-hint-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}
.comp-hint-badge .hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}
.btn-accent-sm {
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-accent-sm:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn-accent-sm:disabled {
  opacity: 0.6;
  cursor: default;
}
.comp-add-msg {
  font-size: 0.82rem;
  margin-left: 0.25rem;
}
.comp-add-msg.err {
  color: var(--danger);
  font-weight: 500;
}

/* 矩阵表格容器 */
.comp-matrix-container {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  margin-top: 0.5rem;
}
.comp-matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.comp-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

/* 列宽分配与基准列高亮 */
.comp-matrix-table .col-dim {
  width: 190px;
  min-width: 170px;
  max-width: 200px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 0.9rem 1rem;
  vertical-align: top;
}
.comp-matrix-table .col-mine {
  width: 270px;
  min-width: 250px;
  background: rgba(37, 99, 235, 0.025);
  border-right: 2px solid #cbd5e1;
  padding: 0.9rem 1.1rem;
  vertical-align: top;
}
.comp-matrix-table .col-comp {
  width: 260px;
  min-width: 240px;
  border-right: 1px solid #f1f5f9;
  padding: 0.9rem 1.1rem;
  vertical-align: top;
}
.comp-matrix-table th.col-comp:last-child,
.comp-matrix-table td.col-comp:last-child {
  border-right: none;
}

/* 表头卡片 */
.comp-matrix-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 0.85rem 1rem;
}
.dim-head-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}
.dim-head-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.comp-product-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.mine-card {
  background: #ffffff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.08);
}
.item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.item-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.comp-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}
.mine-badge {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.comp-num-badge {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.comp-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.comp-card-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
}
.comp-card-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}
.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: #f8fafc;
}
.comp-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.comp-brand-tag {
  font-size: 0.7rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.comp-card-asin a {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.comp-card-asin a:hover {
  text-decoration: underline;
}
.icon-ext {
  color: #94a3b8;
}
.comp-card-title {
  font-size: 0.76rem;
  color: #334155;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.comp-status-tip {
  font-size: 0.72rem;
  color: #f59e0b;
  font-weight: 500;
}

/* 删除按钮微调 */
.comp-card-top-row .comp-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}
.comp-card-top-row .comp-del:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

/* 表格数据行 */
.comp-matrix-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
}
.comp-matrix-table tbody tr:last-child {
  border-bottom: none;
}
.comp-matrix-table tbody tr:hover td {
  background-color: rgba(248, 250, 252, 0.6);
}
.comp-matrix-table tbody tr:hover td.col-mine {
  background-color: rgba(37, 99, 235, 0.045);
}

/* 维度名称 */
.dim-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e293b;
}
.dim-tip {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
  margin-top: 0.25rem;
}
.pill-weak {
  font-size: 0.68rem;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: normal;
}

/* 单元格内容排版 */
.cell-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cell-main-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.cell-main-val-sm {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.rank-val {
  color: #1e3a8a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.price-val {
  color: #0f172a;
}
.val-danger {
  color: #dc2626;
}
.val-muted {
  color: #94a3b8;
}
.cell-sub-text {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.3;
  word-break: break-word;
}
.cell-placeholder-sub {
  font-size: 0.73rem;
  color: #94a3b8;
}
.cell-count-val {
  font-size: 0.82rem;
  color: #475569;
  font-weight: 600;
}
.star-icon {
  color: #f59e0b;
  font-size: 1rem;
  margin-right: 0.15rem;
}

/* 拆分行（如评分与评论） */
.cell-split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.split-col {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.text-right {
  text-align: right;
  justify-content: flex-end;
}

/* 对比胶囊 Pill */
.cell-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.1rem;
}
.comp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  line-height: 1.3;
}
.pill-base {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}
.pill-lead {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.pill-lag {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.pill-cheaper {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.pill-pricier {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}
.pill-warn {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}
.pill-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.pill-dominant {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #f3e8ff;
}
.pill-neutral {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* 迷你胶囊 */
.comp-mini-pill {
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 0.2rem;
}

/* 核心关键词建议 CPC 胶囊网格 */
.cpc-kws-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cpc-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cpc-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 0.3rem 0.5rem;
  font-size: 0.76rem;
  transition: border-color 0.15s ease;
}
.cpc-pill:hover {
  border-color: #cbd5e1;
}
.cpc-kw-name {
  font-weight: 600;
  color: #1e293b;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cpc-kw-bid {
  font-weight: 700;
  color: #0284c7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cpc-kw-range {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
}
.cpc-grid-more {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed #e2e8f0;
}
.btn-cpc-toggle {
  display: inline-block;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0;
  text-align: left;
}
.btn-cpc-toggle:hover {
  text-decoration: underline;
}

/* ========================================================
   广告关键词分析 (Ad Keywords) 优化样式
   ======================================================== */
.akw-card-container {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* 顶部标题与操作栏 */
.akw-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.25rem;
}
.akw-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.akw-title-wrap h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e40af;
}
.akw-desc-text {
  font-size: 0.8rem;
  color: #64748b;
}
.akw-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.akw-time-badge {
  font-size: 0.74rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.akw-action-btn {
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.2);
}
.akw-status-msg {
  font-size: 0.8rem;
}

/* 核心指标概览卡片 (KPI Deck) */
.akw-kpi-deck {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 1024px) {
  .akw-kpi-deck {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .akw-kpi-deck {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.akw-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.akw-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.akw-kpi-card.akw-card-waste {
  border-color: #fecaca;
  background: #fffafa;
}
.akw-kpi-title {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.akw-kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.akw-kpi-unit {
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
}
.akw-kpi-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.4rem;
  line-height: 1.35;
}
.akw-target-pill {
  font-size: 0.68rem;
  font-weight: 600;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  vertical-align: middle;
}
.akw-color-ok { color: #059669 !important; font-weight: 600; }
.akw-color-warn { color: #d97706 !important; font-weight: 600; }
.akw-color-danger { color: #dc2626 !important; font-weight: 600; }

/* AI 决策优化区 */
.akw-ai-section {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.05);
}
.akw-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid #eff6ff;
  padding-bottom: 0.55rem;
}
.akw-ai-meta-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.akw-ai-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}
.akw-ai-date {
  font-size: 0.76rem;
}
.akw-verified-badge {
  font-size: 0.74rem;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
.akw-rejected-badge {
  font-size: 0.74rem;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

/* 策略卡片 */
.akw-strategy-card {
  background: linear-gradient(135deg, #f0f7ff, #f8fafc);
  border-left: 4px solid #3b82f6;
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
}
.akw-stg-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d4ed8;
  margin-bottom: 0.25rem;
}
.akw-stg-body {
  font-size: 0.88rem;
  color: #1e293b;
  line-height: 1.55;
  font-weight: 500;
}

/* 行动双列 */
.akw-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 768px) {
  .akw-action-grid {
    grid-template-columns: 1fr;
  }
}
.akw-action-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.akw-action-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}
.akw-steps-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.akw-step-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.83rem;
  line-height: 1.45;
}
.akw-step-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 1px;
}
.akw-step-text {
  color: #1e293b;
}

.akw-moves-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.akw-move-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
}
.akw-move-flow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 600;
}
.akw-flow-badge {
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
}
.akw-flow-from {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.akw-flow-to {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.akw-flow-arrow {
  color: #64748b;
  font-size: 0.75rem;
}
.akw-move-reason {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* AI 空状态 */
.akw-ai-empty {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.akw-ai-empty-icon {
  font-size: 1.7rem;
}
.akw-ai-empty-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.15rem;
}
.akw-ai-empty-text {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

/* 表格面板与控件 */
.akw-table-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.akw-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.akw-table-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
}
.akw-table-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.akw-pill-group {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-wrap: wrap;
}
.akw-pill-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.akw-pill-btn:hover {
  color: #1e293b;
}
.akw-pill-btn.active {
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.akw-pill-btn.akw-pill-waste.active {
  color: #dc2626;
}
.akw-pill-btn.akw-pill-star.active {
  color: #059669;
}
.akw-search-wrap {
  position: relative;
}
.akw-search-input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.26rem 0.65rem;
  font-size: 0.76rem;
  color: #1e293b;
  background: #ffffff;
  width: 150px;
  transition: all 0.15s ease;
  outline: none;
}
.akw-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
  width: 190px;
}

/* 表格可滚动容器与吸顶 */
.akw-scrollable-container {
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  position: relative;
}
.akw-scroll-h360,
.akw-scroll-h420 {
  max-height: 420px;
}
.akw-scroll-h460 {
  max-height: 480px;
}
.akw-scroll-h280 {
  max-height: 280px;
}

/* 优雅滚动条 */
.akw-scrollable-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.akw-scrollable-container::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}
.akw-scrollable-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.akw-scrollable-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 表头吸顶 */
.akw-interactive-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f1f5f9 !important;
  color: #1e293b !important;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid #cbd5e1 !important;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.akw-interactive-table td {
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.akw-interactive-table tbody tr:hover td {
  background: #f8fafc;
}

/* 高亮行区分 */
.akw-interactive-table tr.akw-row-waste td {
  background: #fff8f8;
}
.akw-interactive-table tr.akw-row-waste:hover td {
  background: #fee2e2;
}
.akw-interactive-table tr.akw-row-star td {
  background: #f8fdfa;
}
.akw-interactive-table tr.akw-row-star:hover td {
  background: #ecfdf5;
}

.akw-empty-search-hint {
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.82rem;
}

/* 同类目参考词折叠样式 */
.akw-details {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
}
.akw-details-summary {
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.akw-details-summary:hover {
  color: #1d4ed8;
}
.akw-details-badge {
  font-size: 0.74rem;
}



/* 关联分析下的子模块导航（如 广告关键词分析）；模块开关关闭时隐藏 */
.side-nav-item.side-nav-sub { padding-left: 1.75rem; font-size: 0.85em; }
.side-nav-item[hidden] { display: none !important; }

/* ── 登录 / 顶栏 / 添加 ASIN（多用户）── */
.topbar { display:flex; align-items:center; justify-content:space-between; padding:10px 24px; background:#fff; border-bottom:1px solid #e5e7eb; position:sticky; top:0; z-index:50; }
.topbar-brand { font-weight:700; color:var(--accent-dark); text-decoration:none; }
.topbar-user { display:flex; align-items:center; gap:8px; font-size:14px; }
.topbar-logout { margin-left:8px; color:var(--accent); text-decoration:none; border:1px solid var(--accent-soft); background:var(--accent-soft); padding:3px 10px; border-radius:6px; }
.topbar-logout:hover { color:var(--accent-dark); }
.add-asin-form { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:12px; }
.add-asin-form input, .add-asin-form select { padding:7px 10px; border:1px solid #cbd5e1; border-radius:8px; font-size:14px; }
.add-asin-form input { width:220px; text-transform:uppercase; }
.add-asin-form .btn-primary, .login-card .btn-primary { background:var(--accent); color:#fff; border:0; border-radius:8px; padding:8px 16px; font-size:14px; cursor:pointer; }
.add-asin-form .btn-primary:hover, .login-card .btn-primary:hover { background:var(--accent-dark); }
.add-asin-form .btn-primary:disabled { opacity:.6; cursor:default; }
.ai-stale-pill { background:#fff7ed; color:#c2410c; border:1px solid #fed7aa; margin-left:6px; }
.login-wrap { min-height:80vh; display:flex; align-items:center; justify-content:center; }
.login-card { width:360px; background:#fff; border-radius:14px; padding:32px 28px; box-shadow:0 10px 30px rgba(29,78,216,.12); border-top:4px solid var(--accent); }
.login-card h1 { margin:0 0 4px; font-size:22px; color:var(--accent-dark); }
.login-card label { display:block; font-size:13px; color:#475569; margin:16px 0 6px; }
.login-card input { width:100%; box-sizing:border-box; padding:9px 12px; border:1px solid #cbd5e1; border-radius:8px; font-size:14px; }
.login-card input:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.login-card .btn-primary { width:100%; margin-top:22px; padding:10px; font-size:15px; }
.login-error { margin-top:14px; color:#b91c1c; background:#fef2f2; border:1px solid #fecaca; padding:8px 10px; border-radius:8px; font-size:13px; }

/* ── 用户管理 / 修改密码 ── */
.topbar-link { color:var(--accent); background:none; border:0; padding:3px 6px; font-size:14px; cursor:pointer; text-decoration:none; }
.topbar-link:hover { color:var(--accent-dark); text-decoration:underline; }
.role-pill { font-size:12px; padding:1px 8px; border-radius:999px; background:var(--accent-soft); color:var(--accent-dark); }
.account-modal { max-width:420px; width:92vw; }
.form-grid label { display:block; font-size:13px; color:#475569; margin:0 0 12px; }
.form-grid input[type=password], .form-grid input[type=text] { display:block; width:100%; box-sizing:border-box; margin-top:6px; padding:8px 10px; border:1px solid #cbd5e1; border-radius:8px; font-size:14px; }
.form-grid .check { display:flex; align-items:center; gap:6px; }
.form-msg { min-height:1.2em; margin:4px 0 0; font-size:13px; }
.form-msg.err { color:#b91c1c; } .form-msg.ok { color:#15803d; }
.admin-create-form { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:12px; }
.admin-create-form input[type=text], .admin-create-form input[type=password] { padding:7px 10px; border:1px solid #cbd5e1; border-radius:8px; font-size:14px; width:180px; }
.admin-create-form .btn-primary { background:var(--accent); color:#fff; border:0; border-radius:8px; padding:8px 16px; font-size:14px; cursor:pointer; }
.admin-actions { display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap; }
.btn-mini { border:1px solid #cbd5e1; background:#fff; color:#334155; border-radius:6px; padding:3px 10px; font-size:13px; cursor:pointer; }
.btn-mini:hover { background:#f1f5f9; } .btn-mini.danger { color:#b91c1c; border-color:#fecaca; } .btn-mini.danger:hover { background:#fef2f2; }
.btn-mini:disabled { opacity:.45; cursor:not-allowed; }
.site-pill { display:inline-block; font-size:12px; line-height:1.4; padding:0 7px; border-radius:999px; background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; margin-left:6px; vertical-align:middle; }
