:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #fff7ed;
  --text: #18202d;
  --muted: #667085;
  --line: #e6e9ef;
  --orange: #f97316;
  --orange-strong: #ea580c;
  --amber: #f59e0b;
  --teal: #0f9f8f;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --purple: #7c3aed;
  --shadow: 0 18px 45px rgba(20, 26, 38, .08);
  --radius: 8px;
  --sidebar: 220px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

/* ===== 布局骨架（与供应链系统一致） ===== */

.app {
  display: block;
  min-height: 100vh;
  max-width: 100vw;
  padding-left: var(--sidebar);
  overflow-x: hidden;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar);
  height: 100vh;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--orange), #ffb020);
  border-radius: var(--radius);
  color: #fff;
  box-shadow: 0 10px 28px rgba(249, 115, 22, .25);
  flex: 0 0 auto;
}

.brand .brand-mark strong {
  font-size: 18px;
  line-height: 1;
  color: #fff;
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.nav { display: grid; gap: 6px; min-width: 0; }

.nav-group { position: relative; }

.nav button, .nav a {
  border: 0;
  background: transparent;
  height: 44px;
  min-height: 44px;
  border-radius: var(--radius);
  color: #475467;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  text-decoration: none;
}

.nav button:hover, .nav a:hover {
  background: #f3f5f8;
  color: var(--text);
}

.nav button.active, .nav a.active {
  background: var(--surface-soft);
  color: var(--orange-strong);
  font-weight: 700;
}

.nav-caret {
  width: 14px;
  height: 14px;
  margin-left: auto;
  opacity: .6;
}

.nav-sub {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  min-width: 248px;
  width: max-content;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.nav-sub::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 0;
  width: 12px;
  height: 100%;
}

.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.nav button.nav-child, .nav a.nav-child {
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
}

.nav i, .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav .nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
}

.nav .nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1;
  flex: 1 1 auto;
}

.nav .nav-caret {
  width: 14px;
  height: 14px;
  min-width: 14px;
  flex: 0 0 14px;
  display: block;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 12px;
}

.workspace-badge {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #122034;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}

.workspace-badge strong,
.workspace-badge span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-badge strong { font-size: 13px; }

.workspace-badge span {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 68px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 9;
}

.topbar-left { min-width: 0; }

.topbar-left h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.sync-hint {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sync-hint b { color: var(--text); }

.content {
  padding: 24px 28px 34px;
  display: grid;
  gap: 20px;
  min-width: 0;
  overflow-x: hidden;
}

.page { display: none; gap: 20px; }
.page.active { display: grid; }

/* ===== 通用组件（与供应链系统一致） ===== */

.band {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.band.pad { padding: 18px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap;
}

.primary-btn {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 24px rgba(249, 115, 22, .22);
}

.primary-btn:hover { background: var(--orange-strong); }

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.secondary-btn {
  background: #fff;
  border-color: var(--line);
  color: #344054;
}

.secondary-btn:hover {
  border-color: #ffd0ad;
  color: var(--orange-strong);
  background: #fff9f4;
}

.ghost-btn {
  background: transparent;
  color: #475467;
  padding: 0 8px;
  border-color: transparent;
}

.ghost-btn:hover {
  color: var(--orange-strong);
  background: #fff7ed;
}

.primary-btn svg,
.secondary-btn svg,
.ghost-btn svg {
  width: 15px;
  height: 15px;
}

.status-pill,
.chip,
.tag {
  min-height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
}

.status-pill.warning {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.status-pill.danger {
  background: #fef2f2;
  color: #b42318;
  border-color: #fecaca;
}

.status-pill.plain {
  background: #f2f4f7;
  color: #475467;
  border-color: #eaecf0;
}

.chip {
  background: #f2f4f7;
  color: #475467;
  border: 1px solid #eaecf0;
}

.chip.orange {
  background: #fff7ed;
  color: var(--orange-strong);
  border-color: #fed7aa;
}

.chip.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.chip.teal {
  background: #ecfdfa;
  color: #0f766e;
  border-color: #99f6e4;
}

.chip.green {
  background: #ecfdf3;
  color: #067647;
  border-color: #abefc6;
}

.chip.purple {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.chip-row,
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.layout-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .9fr);
  gap: 16px;
}

.kpi {
  min-height: 122px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(20, 26, 38, .05);
}

.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #fff7ed;
  color: var(--orange-strong);
  flex: 0 0 auto;
}

.kpi-icon svg { width: 17px; height: 17px; }

.kpi:nth-child(2) .kpi-icon {
  background: #ecfdfa;
  color: var(--teal);
}

.kpi:nth-child(3) .kpi-icon {
  background: #eff6ff;
  color: var(--blue);
}

.kpi:nth-child(4) .kpi-icon {
  background: #f5f3ff;
  color: var(--purple);
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  font-size: 26px;
  margin-top: 6px;
  letter-spacing: 0;
}

.delta {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.delta.warn { color: var(--red); }

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  background: #fafbfc;
  white-space: nowrap;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fafbfc;
  box-shadow: inset 0 -1px 0 #dfe3e8;
}

tbody tr:last-child td { border-bottom: 0; }

tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: #fff7ed; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.num-strong { color: var(--orange-strong); font-weight: 800; }

.cell-title {
  font-weight: 700;
  color: var(--text);
}

.cell-title .trend-product-link {
  color: var(--orange-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}

.selling-point-summary { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.selling-point-chip { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #fff1e8; color: var(--orange-strong); font-size: 11px; white-space: nowrap; }
.selling-point-btn { min-height: 28px; padding: 0 8px; font-size: 11px; }
.trend-insight-cell { min-width: 168px; max-width: 280px; }
.trend-insight-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.trend-insight-row .selling-point-summary, .trend-insight-row .customer-need-summary { margin: 0; flex: 1 1 90px; min-width: 0; }
.customer-need-summary { display: flex; flex-wrap: wrap; gap: 4px; }
.customer-need-chip { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 11px; white-space: nowrap; }
.customer-need-btn { min-height: 28px; padding: 0 8px; font-size: 11px; }
.customer-need-keywords, .customer-need-themes { padding: 0 22px 16px; }
.customer-need-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.selling-points-modal { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.selling-points-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 20px 22px; }
.selling-point-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.selling-point-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.selling-point-group h3 { margin: 0; font-size: 14px; }
.selling-point-confidence { font-size: 11px; color: var(--muted); }
.selling-point-confidence.fact { color: #087443; }.selling-point-confidence.page_claim { color: var(--orange-strong); }.selling-point-confidence.inferred { color: #667085; }
.selling-point-evidence { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.trend-category-list { display: grid; gap: 10px; margin: 16px 0; }
.trend-category-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 6px 20px; }
.trend-level2-tabs { flex-wrap: nowrap; gap: 8px; overflow-x: auto; }
.trend-level2-tabs .trend-category-card { flex: 1 1 0; min-width: 0; padding: 10px 8px; }
.trend-level2-tabs .trend-category-card strong { font-size: 12px; line-height: 1.3; }
.trend-level2-tabs .trend-category-card span { font-size: 10px; }
.trend-category-card { display: grid; gap: 5px; min-width: 170px; flex: 1 1 190px; padding: 13px 15px; border: 1px solid #e7d8c8; border-radius: 12px; background: #fff; color: #46505d; text-align: left; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.trend-category-card strong { font-size: 14px; line-height: 1.35; }
.trend-category-card span { color: #7a8491; font-size: 11px; line-height: 1.5; }
.trend-category-card.candy-1 { background: #fff7ed; border-color: #fed7aa; }
.trend-category-card.candy-2 { background: #ecfdfa; border-color: #99f6e4; }
.trend-category-card.candy-3 { background: #eff6ff; border-color: #bfdbfe; }
.trend-category-card.candy-4 { background: #f5f3ff; border-color: #ddd6fe; }
.trend-category-card.candy-5 { background: #ecfdf3; border-color: #abefc6; }
.trend-category-card:hover:not(.active), .trend-category-card:focus-visible:not(.active) { border-color: #fdba74; background: #fffaf5; outline: none; }
.trend-category-card.active { background: #fff7ed; border-color: #f97316; color: #9a3412; box-shadow: 0 0 0 2px rgba(249, 115, 22, .22); }
.trend-category-card.active strong { color: #9a3412; }
.trend-category-card.active span { color: #c2410c; }
.trend-selected-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 14px 6px 7px; padding: 0 4px; }
.trend-selected-summary strong { font-size: 18px; }
.trend-selected-summary span { color: var(--muted); font-size: 12px; }
.trend-selling-point-list { display: grid; gap: 0; margin: 16px 6px; padding: 0 4px; }
.trend-selling-point-row { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px 8px; border-bottom: 1px solid #eee9e3; }
.trend-selling-point-row-label { padding-top: 6px; color: #4b5563; font-size: 14px; font-weight: 700; }
.trend-selling-point-tags { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; min-width: 0; }
.trend-selling-point-tag { border: 1px solid transparent; border-radius: 999px; padding: 8px 11px; color: #4b5563; font-size: 12px; line-height: 1.2; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
.trend-selling-point-tag:hover, .trend-selling-point-tag:focus-visible { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(71,78,88,.11); outline: 3px solid rgba(180,193,202,.25); outline-offset: 1px; }
.trend-selling-point-tag b { margin-left: 3px; font-weight: 800; }
.trend-selling-point-tag.level-4 { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.trend-selling-point-tag.level-3 { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.trend-selling-point-tag.level-2 { background: #ecfdfa; border-color: #99f6e4; color: #0f766e; }
.trend-selling-point-tag.level-1 { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.trend-category-row { display: grid; grid-template-columns: minmax(180px, 230px) minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.trend-category-meta { display: grid; gap: 5px; }
.trend-category-meta strong { font-size: 15px; }
.trend-category-meta span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.trend-category-tags { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; min-width: 0; }
.trend-selling-tag { border: 0; border-radius: 999px; padding: 6px 10px; font-size: 12px; line-height: 1; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.trend-selling-tag:hover, .trend-selling-tag:focus-visible { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(16,24,40,.14); outline: none; }
.trend-selling-tag b { margin-left: 3px; font-weight: 800; }
.trend-selling-tag.level-4 { background: #c2410c; color: #fff; }.trend-selling-tag.level-3 { background: #fed7aa; color: #9a3412; }.trend-selling-tag.level-2 { background: #dbeafe; color: #1d4ed8; }.trend-selling-tag.level-1 { background: #f2f4f7; color: #667085; }
.trend-tag-detail { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 8px 14px; width: 100%; margin-top: 2px; padding: 10px 12px; border-radius: 8px; background: #f7f5f2; color: #7a8491; font-size: 11px; line-height: 1.6; }
.trend-tag-detail span { min-width: 0; }
.trend-opportunity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.trend-pending-note { margin: 12px 0; }
.trend-opportunity-head { margin-top: 24px; }
.trend-opportunity-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }
.trend-opportunity-card h3 { margin: 0 0 10px; font-size: 15px; }
.trend-opportunity-card p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }

.cell-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  font-weight: 400;
}

/* ===== 总览 Hero ===== */

.hero-dashboard {
  min-height: 218px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .95fr);
  overflow: hidden;
}

.hero-copy {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(135deg, #fff 0%, #fff7ed 48%, #effdf8 100%);
}

.hero-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.hero-copy p {
  margin: 8px 0 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-tile {
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(230, 233, 239, .86);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 86px;
}

.metric-tile span {
  color: var(--muted);
  font-size: 12px;
  display: block;
}

.metric-tile strong {
  display: block;
  font-size: 23px;
  margin-top: 8px;
}

.hero-visual {
  min-height: 218px;
  position: relative;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 18px;
  background:
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, .18), transparent 42%),
    radial-gradient(circle at 20% 85%, rgba(15, 159, 143, .16), transparent 46%),
    linear-gradient(135deg, #122034, #1d3354);
  color: #fff;
}

.hero-quote {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

.hero-quote em {
  font-style: normal;
  color: #ffb020;
}

.hero-visual-note {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  line-height: 1.6;
}

/* ===== 方法卡片 ===== */

.method-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.method-card:hover {
  border-color: #fdba74;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.method-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.method-index {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  background: #fff7ed;
  color: var(--orange-strong);
  flex: 0 0 auto;
}

.method-card:nth-of-type(2) .method-index { background: #ecfdfa; color: var(--teal); }
.method-card:nth-of-type(3) .method-index { background: #eff6ff; color: var(--blue); }
.method-card:nth-of-type(4) .method-index { background: #f5f3ff; color: var(--purple); }

.method-card-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.method-card-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  margin-top: 2px;
}

.method-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.method-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.method-card-foot b { font-size: 18px; }
.method-card-foot span { color: var(--muted); font-size: 12px; }

/* ===== 流程步骤条 ===== */

.flow-steps {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 18px;
  overflow-x: auto;
}

.flow-step {
  flex: 1 0 150px;
  display: grid;
  gap: 6px;
  align-content: start;
  position: relative;
  padding-right: 26px;
}

.flow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-top: 2px solid #fdba74;
  border-right: 2px solid #fdba74;
  transform: rotate(45deg);
}

.flow-no {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff7ed;
  color: var(--orange-strong);
  font-size: 12px;
  font-weight: 800;
}

.flow-step b { font-size: 13px; }

.flow-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* ===== 筛选工具栏 ===== */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.filter-bar label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  min-width: 160px;
}
.trend-search-bar { flex-wrap: wrap; }
.trend-search-bar input[type="search"] { min-width: 180px; flex: 1 1 180px; }
.trend-search-bar select { min-width: 170px; }

.filter-bar input[type="text"]:focus,
.filter-bar input[type="search"]:focus,
.filter-bar select:focus {
  outline: none;
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}

.seg-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.seg-group button {
  border: 0;
  background: transparent;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  color: #475467;
  font-weight: 700;
}

.seg-group button + button { border-left: 1px solid var(--line); }

.seg-group button.active {
  background: #fff7ed;
  color: var(--orange-strong);
}

/* ===== 机会评分 ===== */

.score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.score-bar {
  display: inline-block;
  width: 54px;
  height: 6px;
  border-radius: 999px;
  background: #f2f4f7;
  overflow: hidden;
  vertical-align: middle;
}

.score-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fdba74, #ea580c);
}

/* ===== 趋势迷你柱 ===== */

.sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
}

.sparkline i {
  width: 9px;
  border-radius: 3px 3px 0 0;
  background: #fed7aa;
  min-height: 4px;
}

.sparkline i.hot { background: var(--orange); }
.sparkline i.down { background: #e4e7ec; }

/* ===== 价格段份额条 ===== */

.share-bar {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.share-track {
  height: 8px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
  position: relative;
}

.share-track i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
}

.share-track i.ours { background: linear-gradient(90deg, #f97316, #ffb020); }
.share-track i.rival { background: #b9c2d0; }

.share-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ===== 方法论卡片 ===== */

.knowledge-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.knowledge-card .chip-row { margin-top: 2px; }

.knowledge-card h3 {
  margin: 0;
  font-size: 15px;
}

.knowledge-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.knowledge-mapping {
  display: grid;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.knowledge-mapping .map-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.knowledge-mapping .map-row b { flex: 0 0 auto; }

.knowledge-mapping .map-row span { color: var(--muted); }

/* ===== 数据源状态点 ===== */

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .14); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
.dot.offline { background: #98a2b3; box-shadow: 0 0 0 3px rgba(152, 162, 179, .16); }

/* ===== 预测平台可读取目录 ===== */

.yuce-catalog { border-top: 3px solid var(--orange); }

.source-live-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.yuce-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 24px;
}

.yuce-summary {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  background: #fffaf5;
  border: 1px solid #fed7aa;
  border-radius: 10px;
}

.yuce-summary strong { color: var(--text); font-size: 14px; line-height: 1.35; }
.yuce-summary span { color: var(--muted); font-size: 12px; }

.yuce-subhead { margin-top: 20px; }
.yuce-subhead h3 { margin: 0; font-size: 15px; }
.yuce-subhead p { margin: 0; }

.yuce-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.source-module-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}

.source-module-card:hover { border-color: #fdba74; box-shadow: 0 4px 12px rgba(249, 115, 22, .08); }

.source-module-head { display: flex; align-items: flex-start; gap: 9px; }
.source-module-head h3 { margin: 0 0 3px; font-size: 14px; }
.source-module-card p { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.source-module-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); flex: 0 0 auto; }
.source-code { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.yuce-note { margin-top: 16px; }

/* ===== 页面标签 ===== */
.page-tabs { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 16px; padding: 0 2px 2px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f6f8fb; }
.login-card { width: min(390px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 8px; font-size: 24px; color: var(--text); }.login-card p { color: var(--muted); font-size: 13px; }.login-card form { display: grid; gap: 14px; margin-top: 22px; }.login-card label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }.login-card input { min-height: 42px; border: 1px solid var(--line); border-radius: 7px; padding: 0 11px; font-size: 14px; }.login-error { min-height: 18px; color: var(--red); font-size: 12px; }
.page-tab { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; max-width: 220px; min-height: 34px; padding: 0 10px 0 13px; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: #f8fafc; color: var(--muted); font-size: 12px; cursor: pointer; }
.page-tab.active { background: var(--surface); color: var(--orange-strong); border-color: #fdba74; font-weight: 700; }
.page-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-tab-close { width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.page-tab-close:hover { color: var(--red); }
.page-tab-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; padding-left: 8px; }
.page-tab-tools .ghost-btn { min-height: 28px; padding: 0 8px; font-size: 11px; }

/* ===== 用户管理 ===== */
.user-filter-bar { margin-bottom: 16px; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; white-space: nowrap; }
.user-actions .ghost-btn { min-height: 28px; padding: 0 9px; font-size: 12px; }
.danger-text { color: var(--red) !important; }
.empty-permission { text-align: center; padding: 50px 20px; }
.role-permission-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 20px; }
.role-list { display: flex; flex-direction: column; gap: 8px; }
.role-list-item { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 12px; cursor: pointer; color: var(--text); }
.role-list-item.active { background: #fff7ed; border-color: #fdba74; color: var(--brand); }
.role-list-item strong, .role-list-item span { display: block; }
.role-list-item span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 10px; margin: 20px 0; }
.permission-item { display: flex; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.role-save-actions { justify-content: flex-end; display: flex; }
@media (max-width: 760px) { .role-permission-layout { grid-template-columns: 1fr; } .permission-grid { grid-template-columns: 1fr; } }
.empty-permission h2 { margin: 0 0 8px; }
.empty-permission p { color: var(--muted); margin: 0 0 20px; }
.user-modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(18, 32, 52, .35); }
.user-modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 12px; box-shadow: 0 24px 70px rgba(18, 32, 52, .25); }
.user-modal-head, .user-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.user-modal-head h2 { margin: 0 0 4px; font-size: 18px; }
.user-modal-head p { margin: 0; color: var(--muted); font-size: 12px; }
.user-modal-foot { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.icon-btn { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
.user-modal form { padding: 20px; }
.user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.user-form-grid label { display: grid; gap: 7px; color: var(--text); font-size: 13px; font-weight: 700; }
.user-form-grid label.full { grid-column: 1 / -1; }
.user-form-grid input, .user-form-grid select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 400; }
.user-form-grid input:focus, .user-form-grid select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249, 115, 22, .12); }
.required { color: var(--red); margin-left: 3px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 12px; }

/* ===== 说明面板 ===== */

.note-panel {
  background: #fffdf9;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  gap: 8px;
}

.note-panel h4 {
  margin: 0;
  font-size: 13px;
  color: var(--orange-strong);
}

.note-panel p {
  margin: 0;
  color: #5b6474;
  font-size: 13px;
  line-height: 1.7;
}

.note-panel ul {
  margin: 0;
  padding-left: 18px;
  color: #5b6474;
  font-size: 13px;
  line-height: 1.8;
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #122034;
  color: #fff;
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(18, 32, 52, .3);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  max-width: 70vw;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== 空状态 ===== */

.empty-cell { color: #98a2b3; }

/* ===== 响应式 ===== */

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2 { grid-template-columns: 1fr; }
  .hero-dashboard { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .yuce-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yuce-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .app { padding-left: 0; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .topbar-actions .secondary-btn { display: none; }
  .sync-hint { display: none; }
  .yuce-summary-grid, .yuce-module-grid { grid-template-columns: 1fr; }
  .user-form-grid { grid-template-columns: 1fr; }
  .user-form-grid label.full { grid-column: auto; }
  .selling-points-grid { grid-template-columns: 1fr; padding: 16px; }
  .trend-category-grid { margin-left: 2px; margin-right: 2px; }
  .trend-category-card { min-width: 145px; flex-basis: 145px; padding: 12px 13px; }
  .trend-level2-tabs .trend-category-card { min-width: 96px; flex-basis: 0; padding: 9px 6px; }
  .trend-selected-summary { margin-left: 2px; margin-right: 2px; }
  .trend-selling-point-list { margin-left: 2px; margin-right: 2px; padding: 0; }
  .trend-selling-point-row { grid-template-columns: 1fr; gap: 8px; padding: 14px 4px; }
  .trend-selling-point-row-label { padding-top: 0; }
  .trend-category-row { grid-template-columns: 1fr; gap: 8px; }
  .trend-opportunity-grid { grid-template-columns: 1fr; }
  .trend-insight-cell { max-width: none; }
  .customer-need-themes { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
}

/* Evidence-reviewed product analysis, scoped to the existing detail dialog. */
.selling-points-modal .selling-point-analysis { margin: 0 24px 20px; padding: 20px; background: #f5f7fa; border: 1px solid #e4e9ef; border-radius: 14px; overflow-wrap: anywhere; }
.selling-point-analysis p { line-height: 1.8; margin: 10px 0; }
.selling-point-analysis h4 { margin-top: 18px; }
.selling-point-analysis summary { cursor: pointer; padding: 8px 0; }
.selling-point-analysis summary:focus-visible { outline: 2px solid #798caa; outline-offset: 3px; }
.selling-point-analysis .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) { .selling-points-modal .selling-point-analysis { margin: 0 12px 16px; padding: 14px; } }
