* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f5; color: #263238; font-size: 14px; }

/* ══ APP HEADER ══════════════════════════════ */
.app-header { background: linear-gradient(135deg, #0d1b5e 0%, #1a237e 45%, #283593 100%); color: #fff; padding: 16px 32px; }
.header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.brand-logo { width: 38px; height: 38px; background: rgba(255,255,255,.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; }
.brand-sub { font-size: 11px; opacity: .6; margin-top: 2px; letter-spacing: .3px; }
.header-tag { margin-left: auto; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 4px 12px; font-size: 11px; opacity: .85; white-space: nowrap; }

/* ══ TOP NAV ═════════════════════════════════ */
.top-nav { background: #fff; border-bottom: 1px solid #e0e0e0; box-shadow: 0 2px 8px rgba(0,0,0,.07); position: sticky; top: 0; z-index: 200; }
.nav-inner { max-width: 1280px; margin: 0 auto; display: flex; padding: 0 20px; }
.nav-item { display: flex; align-items: center; gap: 6px; padding: 0 14px; height: 50px; cursor: pointer; font-size: 12px; font-weight: 600; color: #78909c; border-bottom: 3px solid transparent; transition: all .2s; white-space: nowrap; user-select: none; }
.nav-item:hover { color: #3949ab; background: #f5f7ff; }
.nav-item.active { color: #3949ab; border-bottom-color: #3949ab; }
.nav-icon { font-size: 16px; opacity: .8; }
.nav-divider { width: 1px; background: #e0e0e0; margin: 10px 0; align-self: stretch; }

/* ══ SEARCH SECTION ══════════════════════════ */
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 16px 60px; }

.view-bar { display: inline-flex; background: #e8eaf6; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 22px; }
.vbtn { padding: 8px 24px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: #7986cb; background: transparent; transition: all .2s; }
.vbtn:hover { color: #3949ab; }
.vbtn.active { background: #fff; color: #3949ab; box-shadow: 0 1px 5px rgba(57,73,171,.2); }

.month-row { margin-bottom: 18px; }
.month-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mtab { padding: 8px 20px; border: 2px solid #c5cae9; border-radius: 22px; cursor: pointer; font-size: 13px; font-weight: 600; color: #3949ab; background: #fff; transition: all .2s; }
.mtab:hover { background: #e8eaf6; }
.mtab.active { background: #3949ab; color: #fff; border-color: #3949ab; }

.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.kpi-lbl { font-size: 12px; color: #78909c; margin-bottom: 6px; }
.kpi-val { font-size: 26px; font-weight: 700; }
.kpi:nth-child(1) .kpi-val { color: #1565c0; }
.kpi:nth-child(2) .kpi-val { color: #2e7d32; }
.kpi:nth-child(3) .kpi-val { color: #6a1b9a; }

.dim-row { border-bottom: 2px solid #e0e0e0; margin-bottom: 18px; }
.dim-tabs { display: flex; flex-wrap: wrap; }
.dtab { padding: 9px 16px; cursor: pointer; font-size: 13px; color: #607d8b; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .15s; white-space: nowrap; }
.dtab:hover { color: #3949ab; }
.dtab.active { color: #3949ab; border-bottom-color: #3949ab; font-weight: 700; }

.card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 16px; }
.sec-title { font-size: 14px; font-weight: 700; color: #37474f; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.sec-title::before { content: ''; display: inline-block; width: 4px; height: 16px; background: #3949ab; border-radius: 2px; flex-shrink: 0; }
.sec-note { font-size: 11px; font-weight: 400; color: #90a4ae; margin-left: 4px; }

/* Analysis card */
.ai-card { background: linear-gradient(135deg,#fff8e7 0%,#fff 60%); border: 1px solid #ffe0b2; border-radius: 14px; padding: 18px 22px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: relative; overflow: hidden; }
.ai-card.purple { background: linear-gradient(135deg,#f3e5f5 0%,#fff 60%); border-color: #e1bee7; }
.ai-card.red { background: linear-gradient(135deg,#ffebee 0%,#fff 60%); border-color: #ffcdd2; }
.ai-card.blue { background: linear-gradient(135deg,#e8eaf6 0%,#fff 60%); border-color: #c5cae9; }
.ai-card.green { background: linear-gradient(135deg,#e8f5e9 0%,#fff 60%); border-color: #c8e6c9; }
.ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; background: #ff9800; color: #fff; font-size: 11px; font-weight: 700; }
.ai-card.purple .ai-badge { background: #7b1fa2; }
.ai-card.red .ai-badge { background: #c62828; }
.ai-card.blue .ai-badge { background: #3949ab; }
.ai-card.green .ai-badge { background: #2e7d32; }
.ai-title { font-size: 14px; font-weight: 700; color: #37474f; }
.ai-sub { font-size: 11px; color: #90a4ae; margin-left: auto; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; }
.ai-item { background: rgba(255,255,255,.7); border-radius: 10px; padding: 10px 14px; border-left: 3px solid #ff9800; }
.ai-card.purple .ai-item { border-left-color: #7b1fa2; }
.ai-card.red .ai-item { border-left-color: #c62828; }
.ai-card.blue .ai-item { border-left-color: #3949ab; }
.ai-card.green .ai-item { border-left-color: #2e7d32; }
.ai-item-lbl { font-size: 11px; color: #78909c; margin-bottom: 4px; font-weight: 600; }
.ai-item-val { font-size: 13px; color: #263238; line-height: 1.55; }
.ai-item-val b { color: #d84315; }
.ai-card.purple .ai-item-val b { color: #6a1b9a; }
.ai-card.red .ai-item-val b { color: #b71c1c; }
.ai-card.blue .ai-item-val b { color: #1a237e; }
.ai-card.green .ai-item-val b { color: #1b5e20; }
.ai-summary { font-size: 12px; color: #455a64; line-height: 1.7; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #ffcc80; }
.ai-card.purple .ai-summary { border-top-color: #ce93d8; }
.ai-card.red .ai-summary { border-top-color: #ffcdd2; }
.ai-card.blue .ai-summary { border-top-color: #9fa8da; }
.ai-card.green .ai-summary { border-top-color: #a5d6a7; }
.ai-tag { display: inline-block; padding: 2px 8px; border-radius: 8px; background: #fff3e0; color: #e65100; font-size: 11px; font-weight: 600; margin: 0 2px; }
.generic-word { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .55; }
.generic-word::after { content: ' 泛词'; font-size: 10px; font-weight: 700; margin-left: 4px; color: #90a4ae; text-decoration: none; }
.ai-card.purple .ai-tag { background: #f3e5f5; color: #6a1b9a; }
.ai-card.red .ai-tag { background: #ffebee; color: #b71c1c; }
.ai-card.blue .ai-tag { background: #e8eaf6; color: #1a237e; }
.ai-card.green .ai-tag { background: #e8f5e9; color: #1b5e20; }

/* Detail layout */
#vDetail { display: grid; grid-template-columns: 276px 1fr; gap: 18px; align-items: start; }
#detailSidebar { position: sticky; top: 70px; }
#detailMain { min-width: 0; }

/* Sidebar */
.sb-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.1); overflow: hidden; }
.sb-head { background: linear-gradient(135deg,#1a237e,#3949ab); color: #fff; padding: 14px 16px 10px; }
.sb-head-title { font-size: 13px; font-weight: 700; letter-spacing: .5px; margin-bottom: 10px; }
.stab-row { display: flex; gap: 4px; flex-wrap: wrap; }
.stab { padding: 4px 9px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.7); background: transparent; transition: all .15s; position: relative; white-space: nowrap; }
.stab:hover { border-color: rgba(255,255,255,.7); color: #fff; }
.stab.active { background: rgba(255,255,255,.22); border-color: #fff; color: #fff; }
.stab-badge { position: absolute; top: -6px; right: -6px; background: #e53935; color: #fff; border-radius: 10px; font-size: 9px; padding: 0 3px; min-width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sb-body { padding: 14px 14px 0; }
.sb-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sb-hint { font-size: 11px; color: #90a4ae; }
.sb-clear-btn { background: none; border: 1px solid #ffcdd2; border-radius: 6px; padding: 3px 10px; font-size: 11px; font-weight: 600; color: #e57373; cursor: pointer; transition: all .15s; }
.sb-clear-btn:hover { background: #ffebee; color: #e53935; border-color: #e53935; }
.sb-empty { padding: 24px 8px; text-align: center; color: #b0bec5; font-size: 12px; line-height: 2; }
.sb-empty-icon { font-size: 28px; margin-bottom: 6px; }
.sb-dim-block { margin-bottom: 12px; }
.sb-dim-hdr { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f0f2f5; margin-bottom: 5px; }
.sb-dim-lbl { font-size: 11px; font-weight: 700; color: #546e7a; }
.sb-dim-cnt { font-size: 11px; color: #90a4ae; background: #eceff1; border-radius: 10px; padding: 1px 7px; }
.sb-kw-item { display: flex; align-items: center; justify-content: space-between; padding: 3px 2px; border-radius: 4px; cursor: default; }
.sb-kw-item:hover { background: #f5f5f5; }
.sb-kw-name { font-size: 12px; color: #455a64; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 6px; }
.sb-kw-uv { font-size: 12px; font-weight: 700; color: #3949ab; white-space: nowrap; }
.sb-kw-uv.miss { color: #cfd8dc; font-weight: 400; font-style: italic; }
.sb-kw-del { font-size: 12px; color: #cfd8dc; cursor: pointer; margin-left: 4px; flex-shrink: 0; opacity: 0; transition: opacity .15s; }
.sb-kw-item:hover .sb-kw-del { opacity: 1; }
.sb-kw-del:hover { color: #e53935; }
.sb-dim-sub { font-size: 11px; color: #78909c; text-align: right; padding: 2px 2px 0; margin-bottom: 2px; }
.sb-total { background: #e8eaf6; border-radius: 10px; padding: 10px 14px; margin: 10px 0 14px; display: flex; align-items: center; justify-content: space-between; }
.sb-total-lbl { font-size: 12px; font-weight: 700; color: #3949ab; }
.sb-total-val { font-size: 20px; font-weight: 800; color: #1a237e; }
.sb-cmp { padding: 12px 14px 14px; border-top: 1px solid #f0f2f5; }
.sb-cmp-title { font-size: 11px; font-weight: 700; color: #90a4ae; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.sb-cmp-row { display: grid; grid-template-columns: 36px 1fr 60px; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 7px; margin-bottom: 2px; cursor: pointer; }
.sb-cmp-row:hover { background: #f5f5f5; }
.sb-cmp-row.cur { background: #e8eaf6; }
.sb-cmp-row.empty { opacity: .45; }
.sb-cmp-name { font-size: 12px; font-weight: 700; color: #78909c; }
.sb-cmp-row.cur .sb-cmp-name { color: #3949ab; }
.sb-cmp-bwrap { background: #eceff1; border-radius: 3px; height: 6px; overflow: hidden; }
.sb-cmp-bar { height: 6px; background: #b0bec5; border-radius: 3px; transition: width .3s; }
.sb-cmp-row.cur .sb-cmp-bar { background: #3949ab; }
.sb-cmp-uv { font-size: 11px; color: #78909c; text-align: right; font-variant-numeric: tabular-nums; }
.sb-cmp-row.cur .sb-cmp-uv { font-weight: 700; color: #1a237e; }

/* Table */
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 10px 12px; font-size: 12px; color: #90a4ae; font-weight: 600; border-bottom: 2px solid #eceff1; letter-spacing: .5px; white-space: nowrap; }
tbody tr { border-bottom: 1px solid #f5f5f5; transition: background .12s; }
tbody tr:hover { background: #fafafa; }
tbody tr:last-child { border-bottom: none; }
td { padding: 9px 12px; vertical-align: middle; }
.td-rank { width: 34px; color: #bdbdbd; font-weight: 700; font-size: 13px; }
.td-rank.top { color: #ef5350; }
.td-kw { font-size: 14px; font-weight: 600; color: #263238; }
.td-uv { font-size: 13px; color: #546e7a; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-bar { width: 200px; padding-left: 12px; }
.bar-bg { background: #eceff1; border-radius: 4px; height: 8px; overflow: hidden; }
.bar-fill { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #3949ab, #64b5f6); }
.td-cb { width: 28px; padding: 9px 4px 9px 12px; }
.kw-cb { width: 15px; height: 15px; accent-color: #3949ab; cursor: pointer; }
.row-sel { background: #e8eaf6 !important; }
.row-sel .td-kw { color: #3949ab; }
.row-sel .td-rank { color: #7986cb; }

/* Compare */
.cmp-tbl th.sortable { cursor: pointer; user-select: none; }
.cmp-tbl th.sortable:hover { color: #3949ab; }
.cmp-tbl th.s-desc::after { content: ' ▼'; font-size: 9px; }
.cmp-tbl th.s-asc::after  { content: ' ▲'; font-size: 9px; }
.td-m { text-align: right; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; padding: 8px 10px; }
.td-m.nil { color: #cfd8dc; }
.h1 { background: #e8eaf6; }
.h2 { background: #c5cae9; }
.h3 { background: #9fa8da; color: #fff; }
.h4 { background: #5c6bc0; color: #fff; }
.h5 { background: #3949ab; color: #fff; font-weight: 700; }
.metric-cmp td { text-align: center; padding: 10px 12px; }
.metric-cmp td:first-child { text-align: left; font-weight: 600; color: #455a64; }
.metric-cmp .hi { font-weight: 700; color: #1565c0; background: #e3f2fd; border-radius: 6px; }
.metric-cmp .lo { color: #b0bec5; }

/* Charts */
.chart-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.chart-card { background: #fff; border-radius: 12px; padding: 16px 16px 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #f5f5f5; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #546e7a; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.fbtn { padding: 5px 14px; border: 1.5px solid #c5cae9; border-radius: 16px; cursor: pointer; font-size: 12px; font-weight: 600; color: #5c6bc0; background: #fff; transition: all .15s; }
.fbtn:hover { border-color: #5c6bc0; }
.fbtn.active { background: #3949ab; color: #fff; border-color: #3949ab; }

/* ══ SUPPLY SECTION ══════════════════════════ */
#section-supply .wrap { padding-top: 40px; }
.supply-hero { text-align: center; padding: 48px 24px 40px; }
.supply-hero-icon { font-size: 52px; margin-bottom: 16px; }
.supply-hero h2 { font-size: 22px; font-weight: 700; color: #263238; margin-bottom: 8px; }
.supply-hero p  { font-size: 14px; color: #78909c; line-height: 1.8; }
.supply-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px; }
.prev-card { background: #fff; border-radius: 14px; padding: 22px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.08); text-align: center; border-top: 3px solid transparent; transition: box-shadow .2s; }
.prev-card:hover { box-shadow: 0 4px 16px rgba(57,73,171,.12); }
.prev-card:nth-child(1) { border-color: #3949ab; }
.prev-card:nth-child(2) { border-color: #43a047; }
.prev-card:nth-child(3) { border-color: #fb8c00; }
.prev-card:nth-child(4) { border-color: #8e24aa; }
.prev-icon { font-size: 28px; margin-bottom: 10px; }
.prev-title { font-size: 13px; font-weight: 700; color: #37474f; margin-bottom: 6px; }
.prev-desc  { font-size: 12px; color: #90a4ae; line-height: 1.6; }
.prev-badge { display: inline-block; margin-top: 10px; padding: 3px 10px; background: #f0f2f5; border-radius: 12px; font-size: 11px; color: #90a4ae; }
.supply-await { background: #fff; border-radius: 14px; padding: 28px 32px; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; align-items: center; gap: 20px; }
.await-icon { width: 48px; height: 48px; background: #e8eaf6; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.await-text h3 { font-size: 15px; font-weight: 700; color: #37474f; margin-bottom: 4px; }
.await-text p  { font-size: 13px; color: #90a4ae; line-height: 1.6; }
.await-dot { width: 8px; height: 8px; background: #fb8c00; border-radius: 50%; animation: pulse 1.5s infinite; margin-left: auto; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }

.hidden { display: none !important; }

@media (max-width: 900px) {
  #vDetail { grid-template-columns: 1fr; }
  #detailSidebar { position: static; }
  .supply-preview { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .chart-3 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .td-bar { display: none; }
  .brand-title { font-size: 15px; }
  .nav-item { padding: 0 14px; font-size: 12px; }
  .supply-preview { grid-template-columns: 1fr 1fr; }
}

/* ══ SUPPLY REAL DATA ════════════════════════ */
.sv-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.sv-title { font-size: 16px; font-weight: 700; color: #263238; }
.sv-note { font-size: 12px; color: #90a4ae; }
.attr-row { border-bottom: 2px solid #e0e0e0; margin-bottom: 18px; overflow-x: auto; }
.attr-tabs { display: flex; white-space: nowrap; }
.atab { padding: 9px 14px; cursor: pointer; font-size: 12px; color: #607d8b; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .15s; }
.atab:hover { color: #3949ab; }
.atab.active { color: #3949ab; border-bottom-color: #3949ab; font-weight: 700; }
.sv-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.sv-kpi .kpi:nth-child(1) .kpi-val { color: #e65100; }
.sv-kpi .kpi:nth-child(2) .kpi-val { color: #1565c0; }
.sv-kpi .kpi:nth-child(3) .kpi-val { color: #2e7d32; }
.yoy-up { color: #2e7d32; font-weight: 700; }
.yoy-dn { color: #e53935; font-weight: 700; }
.yoy-na { color: #90a4ae; }
.td-sales { width: 220px; padding-right: 16px; }
.sales-wrap { display: flex; align-items: center; gap: 8px; }
.sales-num { font-size: 12px; font-weight: 700; color: #1a237e; white-space: nowrap; min-width: 54px; text-align: right; }
.sales-bar-bg { flex: 1; background: #e8eaf6; border-radius: 4px; height: 8px; overflow: hidden; }
.sales-bar-fill { height: 8px; background: linear-gradient(90deg, #3949ab, #7986cb); border-radius: 4px; transition: width .3s; }
.td-supply { text-align: right; font-size: 12px; color: #546e7a; white-space: nowrap; }

/* ══ COMPETITOR SECTION ══════════════════════ */
#section-competitor .wrap { padding-top: 28px; }
.comp-view-bar { display: inline-flex; background: #e8eaf6; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 22px; }
.comp-vbtn { padding: 8px 24px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: #7986cb; background: transparent; transition: all .2s; }
.comp-vbtn:hover { color: #3949ab; }
.comp-vbtn.active { background: #fff; color: #3949ab; box-shadow: 0 1px 5px rgba(57,73,171,.2); }
.brand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.brand-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.09); overflow: hidden; border-top: 4px solid; }
.brand-card:nth-child(1) { border-color: #1a237e; }
.brand-card:nth-child(2) { border-color: #880e4f; }
.brand-card:nth-child(3) { border-color: #1b5e20; }
.bc-head { padding: 14px 16px 10px; }
.bc-name { font-size: 15px; font-weight: 800; color: #263238; margin-bottom: 8px; }
.bc-stats { display: flex; gap: 20px; margin-bottom: 4px; }
.bc-stat-val { font-size: 22px; font-weight: 800; line-height: 1; }
.bc-stat-lbl { font-size: 10px; color: #90a4ae; margin-top: 2px; }
.bc-badge { display: inline-block; padding: 3px 8px; background: #e8eaf6; border-radius: 10px; font-size: 11px; color: #5c6bc0; font-weight: 600; margin-bottom: 6px; }
.bc-body { padding: 10px 16px 14px; border-top: 1px solid #f0f2f5; }
.bc-type { font-size: 12px; font-weight: 700; color: #37474f; margin-bottom: 5px; }
.bc-desc { font-size: 12px; color: #607d8b; line-height: 1.7; }
.bc-section-lbl { font-size: 10px; color: #90a4ae; font-weight: 800; margin: 4px 0 4px; }
.bc-formula { font-size: 12px; color: #546e7a; line-height: 1.65; }
.comp-filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.brand-fbtn { padding: 5px 16px; border: 2px solid #e0e0e0; border-radius: 16px; cursor: pointer; font-size: 12px; font-weight: 700; background: #fff; color: #78909c; transition: all .15s; }
.brand-fbtn:hover { border-color: #7986cb; color: #3949ab; }
.brand-fbtn.active { background: #3949ab; color: #fff; border-color: #3949ab; }
.comp-prod-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.comp-prod-tbl th { text-align: left; padding: 8px 10px; background: #f5f7ff; color: #546e7a; font-size: 11px; font-weight: 700; border-bottom: 2px solid #e8eaf6; white-space: nowrap; }
.comp-prod-tbl td { padding: 9px 10px; border-bottom: 1px solid #f5f5f5; vertical-align: top; }
.comp-prod-tbl tr:hover td { background: #fafbff; }
.td-rank-comp { width: 36px; font-weight: 800; font-size: 14px; color: #bdbdbd; text-align: center; }
.td-rank-comp.top3 { color: #e53935; }
.td-brand-tag { display: inline-block; padding: 2px 7px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.brand-tag-yfl { background: #e8eaf6; color: #1a237e; }
.brand-tag-yy  { background: #fce4ec; color: #880e4f; }
.brand-tag-mm  { background: #e8f5e9; color: #1b5e20; }
.td-prod-name a { color: #1565c0; text-decoration: none; font-weight: 600; }
.td-prod-name a:hover { text-decoration: underline; }
.td-type-tag { display: inline-block; padding: 2px 8px; background: #fff3e0; color: #e65100; border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.td-formula { font-size: 11px; color: #37474f; line-height: 1.6; max-width: 200px; }
.td-judge { font-size: 11px; color: #607d8b; line-height: 1.6; max-width: 200px; }
.td-tag-cell { min-width: 190px; max-width: 230px; }
.cp-tag-wrap { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; }
.cp-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 8px; background: #e8eaf6; color: #1a237e; font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.cp-tag small { color: #7986cb; font-size: 10px; font-weight: 700; }
.cp-tag-attr { font-size: 11px; color: #546e7a; line-height: 1.6; }
.cp-tag-attr b { color: #3949ab; font-weight: 700; }
.cp-tag-empty { font-size: 11px; color: #b0bec5; font-style: italic; }
.cp-tag-summary { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 10px; }
.cp-tag-block { background: #fafbff; border-left: 3px solid #3949ab; border-radius: 10px; padding: 9px 11px; }
.cp-tag-block-title { font-size: 11px; color: #78909c; font-weight: 700; margin-bottom: 6px; }
.cp-tag-block-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #37474f; margin: 4px 0; }
.cp-tag-block-line span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-tag-count { color: #3949ab; font-weight: 800; white-space: nowrap; }
.comp-summary-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.comp-summary-table th { background: #f5f7ff; color: #607d8b; font-size: 11px; font-weight: 800; padding: 9px 10px; border-bottom: 2px solid #e8eaf6; text-align: left; }
.comp-summary-table td { padding: 10px; border-bottom: 1px solid #f2f4f8; vertical-align: top; line-height: 1.65; }
.comp-summary-table tr:hover td { background: #fafbff; }
.comp-month-badge { display: inline-block; min-width: 38px; padding: 2px 8px; border-radius: 10px; background: #e8eaf6; color: #1a237e; font-size: 11px; font-weight: 800; text-align: center; }
.comp-attr-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; }
.comp-attr-card { background: #fafbff; border-left: 3px solid #7b1fa2; border-radius: 10px; padding: 10px 12px; line-height: 1.7; font-size: 12px; color: #455a64; }
.comp-attr-card b { color: #6a1b9a; }
.comp-strategy-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; margin-bottom: 14px; }
.comp-strategy-card { background: #fff; border: 1px solid #e8eaf6; border-radius: 12px; padding: 13px 14px; box-shadow: 0 1px 5px rgba(0,0,0,.05); }
.comp-strategy-card .label { color: #78909c; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.comp-strategy-card .main { color: #1a237e; font-size: 16px; font-weight: 900; margin-bottom: 6px; }
.comp-strategy-card .desc { color: #546e7a; font-size: 12px; line-height: 1.65; }
.comp-heat-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 12px; min-width: 980px; }
.comp-heat-table th { text-align: left; padding: 7px 9px; color: #607d8b; font-size: 11px; font-weight: 900; border-bottom: 2px solid #eef1fb; }
.comp-heat-table td { background: #fff; padding: 10px 9px; border-top: 1px solid #eef1fb; border-bottom: 1px solid #eef1fb; vertical-align: top; }
.comp-heat-table td:first-child { border-left: 1px solid #eef1fb; border-radius: 10px 0 0 10px; }
.comp-heat-table td:last-child { border-right: 1px solid #eef1fb; border-radius: 0 10px 10px 0; }
.comp-heat-main { color: #263238; font-weight: 900; margin-bottom: 4px; }
.comp-heat-sub { color: #78909c; font-size: 11px; line-height: 1.55; }
.comp-heat-formula { color: #455a64; line-height: 1.6; max-width: 280px; }
.comp-score { display: inline-flex; align-items: center; gap: 6px; min-width: 110px; font-weight: 900; color: #1a237e; }
.comp-score-track { width: 54px; height: 6px; border-radius: 8px; background: #edf0f5; overflow: hidden; }
.comp-score-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg,#3949ab,#64b5f6); }
.comp-fit-high .comp-score-fill { background: linear-gradient(90deg,#2e7d32,#81c784); }
.comp-fit-mid .comp-score-fill { background: linear-gradient(90deg,#f57c00,#ffb74d); }
.comp-fit-low .comp-score-fill { background: linear-gradient(90deg,#b0bec5,#cfd8dc); }
.comp-matrix-note { display: inline-block; margin-top: 4px; color: #607d8b; font-size: 11px; }
.comp-market-tags { margin-top: 6px; color: #546e7a; font-size: 11px; line-height: 1.55; }
.comp-no-data { padding: 40px; text-align: center; color: #90a4ae; font-size: 14px; }
@media (max-width: 900px) {
  .brand-grid { grid-template-columns: 1fr; }
  .sv-kpi { grid-template-columns: 1fr 1fr; }
  .td-sales { width: 140px; }
}

/* ══ XHS / CONTENT / OPS SECTIONS ═══════════════ */
.section-placeholder { text-align: center; padding: 60px 24px 40px; }
.ph-icon { font-size: 52px; margin-bottom: 16px; }
.ph-title { font-size: 18px; font-weight: 700; color: #37474f; margin-bottom: 8px; }
.ph-sub { font-size: 13px; color: #90a4ae; line-height: 1.8; margin-bottom: 32px; }
.ph-tag { display: inline-block; padding: 4px 12px; background: #f5f7ff; border: 1.5px dashed #c5cae9; border-radius: 12px; font-size: 12px; color: #7986cb; margin: 4px; }
.coming-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; background: linear-gradient(135deg,#e8eaf6,#c5cae9); border-radius: 20px; font-size: 12px; font-weight: 700; color: #3949ab; margin-top: 8px; }

/* XHS Section */
.xhs-layout { display: grid; grid-template-columns: 264px 1fr; gap: 18px; align-items: start; }
.xhs-sidebar { position: sticky; top: 70px; }
.xhs-sb-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.1); overflow: hidden; }
.xhs-sb-head { background: linear-gradient(135deg,#c62828,#e53935); color: #fff; padding: 14px 16px 10px; }
.xhs-sb-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.xhs-stab { padding: 4px 9px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.7); background: transparent; transition: all .15s; }
.xhs-stab:hover { border-color: rgba(255,255,255,.7); color: #fff; }
.xhs-stab.active { background: rgba(255,255,255,.22); border-color: #fff; color: #fff; }
.xhs-dim-row { border-bottom: 2px solid #e0e0e0; margin-bottom: 18px; overflow-x: auto; }
.xhs-dim-tabs { display: flex; white-space: nowrap; }
.xdtab { padding: 9px 16px; cursor: pointer; font-size: 13px; color: #607d8b; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all .15s; }
.xdtab:hover { color: #c62828; }
.xdtab.active { color: #c62828; border-bottom-color: #c62828; font-weight: 700; }
.xhs-kpi .kpi:nth-child(1) .kpi-val { color: #c62828; }
.xhs-kpi .kpi:nth-child(2) .kpi-val { color: #ad1457; }
.xhs-kpi .kpi:nth-child(3) .kpi-val { color: #6a1b9a; }
.xhs-kpi .kpi-val { color: #c62828; }
.xhs-bar-fill { height: 8px; background: linear-gradient(90deg, #c62828, #ef9a9a); border-radius: 4px; }
.kw-cb-xhs { width: 15px; height: 15px; accent-color: #c62828; cursor: pointer; }
.row-sel-xhs { background: #ffebee !important; }
.row-sel-xhs .td-kw { color: #c62828; }
.xhs-empty { padding: 48px 24px; text-align: center; color: #90a4ae; }
.xhs-empty-icon { font-size: 40px; margin-bottom: 12px; }
.data-pending { display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff8e1; border: 1.5px dashed #ffd54f; border-radius: 10px; padding: 10px 16px; font-size: 12px; color: #f57f17; font-weight: 600; margin-bottom: 16px; }
.data-pending::before { content: '⏳'; font-size: 14px; }

/* Content Section */
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.content-sidebar { position: sticky; top: 70px; }
.content-sb-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.1); overflow: hidden; }
.content-sb-head { background: linear-gradient(135deg,#4a148c,#7b1fa2); color: #fff; padding: 14px 16px 10px; }
.content-sb-title { font-size: 13px; font-weight: 700; letter-spacing: .5px; margin-bottom: 4px; }
.content-sb-sub { font-size: 11px; opacity: .7; }
.content-sb-body { padding: 12px 14px 14px; }
.content-type-tabs { display: flex; background: #f3e5f5; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 18px; }
.ct-btn { flex: 1; padding: 8px 4px; border: none; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; color: #7b1fa2; background: transparent; transition: all .2s; text-align: center; }
.ct-btn:hover { color: #4a148c; }
.ct-btn.active { background: #fff; color: #4a148c; box-shadow: 0 1px 4px rgba(74,20,140,.2); }
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
.content-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow: hidden; cursor: pointer; transition: box-shadow .2s; border: 2px solid transparent; }
.content-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.content-card.selected { border-color: #7b1fa2; }
.cc-thumb { height: 80px; background: linear-gradient(135deg,#e1bee7,#ce93d8); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.cc-body { padding: 10px 12px; }
.cc-title { font-size: 12px; font-weight: 700; color: #37474f; margin-bottom: 4px; line-height: 1.4; }
.cc-meta { font-size: 11px; color: #90a4ae; }
.cc-checkbox { float: right; margin-top: -2px; accent-color: #7b1fa2; }
.sel-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; background: #f3e5f5; border-radius: 8px; margin-bottom: 6px; }
.sel-item-name { font-size: 12px; color: #4a148c; font-weight: 600; }
.sel-item-del { font-size: 12px; color: #ce93d8; cursor: pointer; }
.sel-item-del:hover { color: #7b1fa2; }
.content-empty { padding: 32px 16px; text-align: center; color: #ce93d8; font-size: 12px; line-height: 2; }

/* Ops Section */
.ops-layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 20px; }
.ops-col { background: #fff; border-radius: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.1); overflow: hidden; }
.ops-col.active-target { box-shadow: 0 0 0 3px rgba(57,73,171,.16), 0 4px 16px rgba(0,0,0,.12); }
.ops-col-head { padding: 16px; border-bottom: 1px solid #f0f2f5; }
.ops-col-title { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.ops-col-desc { font-size: 11px; color: #90a4ae; line-height: 1.5; }
.ops-formula { margin-top: 10px; padding: 9px 10px; background: #f8fafc; border-radius: 10px; font-size: 12px; color: #37474f; line-height: 1.6; }
.ops-formula b { color: #1a237e; }
.ops-note-input { width: 100%; min-height: 86px; margin-top: 10px; padding: 9px 10px; border: 1.5px solid #e0e0e0; border-radius: 10px; resize: vertical; font-family: inherit; font-size: 12px; line-height: 1.6; color: #37474f; outline: none; }
.ops-note-input:focus { border-color: #7986cb; box-shadow: 0 0 0 3px rgba(121,134,203,.12); }
.ops-col:nth-child(1) .ops-col-head { border-top: 4px solid #1565c0; }
.ops-col:nth-child(2) .ops-col-head { border-top: 4px solid #7b1fa2; }
.ops-col:nth-child(3) .ops-col-head { border-top: 4px solid #e65100; }
.ops-col:nth-child(1) .ops-col-title { color: #1565c0; }
.ops-col:nth-child(2) .ops-col-title { color: #7b1fa2; }
.ops-col:nth-child(3) .ops-col-title { color: #e65100; }
.ops-col-body { padding: 14px; min-height: 200px; }
.ops-kw-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; margin: 3px; cursor: pointer; transition: all .15s; }
.ops-kw-tag.src-tmall { background: #e8eaf6; color: #3949ab; border: 1.5px solid #c5cae9; }
.ops-kw-tag.src-xhs { background: #ffebee; color: #c62828; border: 1.5px solid #ffcdd2; }
.ops-kw-tag.cat-matrix { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.ops-kw-tag.cat-core { background: #f3e5f5; color: #7b1fa2; border-color: #ce93d8; }
.ops-kw-tag.cat-trend { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.ops-kw-tag .tag-src { font-size: 10px; opacity: .7; }
.ops-source-pool { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ops-pool-title { font-size: 13px; font-weight: 700; color: #37474f; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-pool-hint { font-size: 11px; color: #90a4ae; font-weight: 400; }
.ops-empty { color: #b0bec5; font-size: 12px; font-style: italic; }
.ops-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ops-leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #546e7a; }
.ops-leg-dot { width: 10px; height: 10px; border-radius: 50%; }
.ops-word-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.ops-word-card { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ops-word-card h3 { font-size: 13px; color: #37474f; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.ops-dim-line { display: grid; grid-template-columns: 78px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid #f5f5f5; }
.ops-dim-line:first-of-type { border-top: none; }
.ops-dim-name { font-size: 11px; color: #78909c; font-weight: 800; padding-top: 3px; }
.ops-formula-board { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 18px; }
.ops-formula-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ops-formula-card { border: 1px solid #eef2f7; border-top: 4px solid #1565c0; border-radius: 12px; padding: 12px 14px; background: #fbfdff; }
.ops-formula-card.core { border-top-color: #7b1fa2; }
.ops-formula-card.trend { border-top-color: #e65100; }
.ops-formula-card-title { font-size: 13px; font-weight: 800; color: #37474f; margin-bottom: 8px; }
.ops-formula-words { min-height: 30px; margin-bottom: 10px; }
.ops-month-row { display: grid; grid-template-columns: 42px 1fr 64px; align-items: center; gap: 8px; margin: 5px 0; font-size: 11px; color: #607d8b; }
.ops-month-bar { height: 6px; border-radius: 4px; background: #eceff1; overflow: hidden; }
.ops-month-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg,#3949ab,#64b5f6); }
.ops-month-val { text-align: right; font-weight: 800; color: #3949ab; }
.ops-md-panel { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 18px; }
.ops-md-grid { display: grid; grid-template-columns: minmax(320px,1fr) minmax(320px,1fr); gap: 14px; }
.ops-md-grid.preview-only { grid-template-columns: 1fr; }
.ops-md-grid.preview-only .ops-md-input { display: none; }
.ops-md-input { width: 100%; min-height: 260px; border: 1.5px solid #e0e0e0; border-radius: 12px; padding: 14px; font-family: Consolas, "Microsoft YaHei", monospace; font-size: 13px; line-height: 1.7; resize: vertical; outline: none; color: #263238; }
.ops-md-input:focus { border-color: #3949ab; box-shadow: 0 0 0 3px rgba(57,73,171,.12); }
.ops-md-preview { min-height: 260px; border: 1px solid #f0f2f5; border-radius: 12px; padding: 14px 16px; background: #fafbff; color: #37474f; line-height: 1.75; overflow: auto; }
.ops-md-preview h1 { font-size: 22px; margin: 4px 0 10px; color: #1a237e; }
.ops-md-preview h2 { font-size: 18px; margin: 12px 0 8px; color: #283593; }
.ops-md-preview h3 { font-size: 15px; margin: 10px 0 6px; color: #3949ab; }
.ops-md-preview ul { padding-left: 20px; margin: 6px 0; }
.ops-md-preview p { margin: 7px 0; }
.ops-md-preview code { background: #eef2ff; padding: 1px 5px; border-radius: 5px; font-family: Consolas, monospace; }
.ops-combo-card { border: 1px solid #eef2f7; border-radius: 10px; background: #fbfdff; padding: 10px 12px; margin-bottom: 10px; }
.ops-combo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ops-combo-title { font-size: 12px; font-weight: 800; color: #37474f; }
.ops-combo-del { border: none; background: transparent; color: #ef5350; cursor: pointer; font-size: 12px; font-weight: 800; }
.ops-confirm-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: #f8fafc; border-radius: 10px; margin-bottom: 12px; }
.ops-confirm-btn { padding: 6px 14px; border: 1.5px solid #3949ab; border-radius: 8px; background: #3949ab; color: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.ops-confirm-btn:disabled { opacity: .45; cursor: not-allowed; }
.ops-draft-box { border: 1px dashed #90caf9; background: #f7fbff; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.ops-draft-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 800; color: #1565c0; margin-bottom: 8px; }
.comp-month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.comp-brand-month { border: 1px solid #eef2f7; border-radius: 10px; padding: 12px; background: #fbfdff; }
.comp-brand-month-title { font-size: 13px; font-weight: 800; color: #37474f; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.comp-type-block { border-top: 1px solid #eef2f7; padding-top: 9px; margin-top: 9px; }
.comp-type-name { font-size: 12px; font-weight: 800; color: #3949ab; margin-bottom: 6px; }
.comp-type-formula { font-size: 11px; line-height: 1.55; color: #607d8b; background: #f8fafc; border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }
.comp-prod-line { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px; align-items: center; font-size: 12px; padding: 5px 0; }
.comp-jump-btn { padding: 3px 9px; border: 1px solid #c5cae9; border-radius: 7px; color: #3949ab; background: #fff; text-decoration: none; font-size: 11px; font-weight: 800; white-space: nowrap; }
.comp-jump-btn:hover { background: #e8eaf6; }
.xhs-search-month-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.xhs-search-month-card { background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-top: 3px solid #c62828; }
.xhs-search-month-name { font-size: 12px; font-weight: 800; color: #b71c1c; margin-bottom: 6px; }
.xhs-search-month-val { font-size: 20px; font-weight: 800; color: #263238; margin-bottom: 6px; }
.xhs-search-month-note { font-size: 11px; color: #78909c; line-height: 1.5; }
.sv-compare-table th, .sv-compare-table td { text-align: right; }
.sv-compare-table th:first-child, .sv-compare-table td:first-child { text-align: left; }
.sv-compare-up { color: #2e7d32; font-weight: 800; }
.sv-compare-down { color: #c62828; font-weight: 800; }
.sv-compare-flat { color: #90a4ae; }
@media (max-width: 900px) {
  .xhs-layout { grid-template-columns: 1fr; }
  .content-layout { grid-template-columns: 1fr; }
  .ops-layout { grid-template-columns: 1fr; }
  .ops-word-board, .ops-md-grid, .ops-formula-grid, .xhs-search-month-grid, .comp-month-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
}

/* ── XHS section ── */
.xhs-view-bar { display: inline-flex; background: #ffebee; border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 18px; }
.xhs-vbtn { padding: 8px 22px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: #c62828; background: transparent; transition: all .2s; }
.xhs-vbtn:hover { background: rgba(255,255,255,.5); }
.xhs-vbtn.active { background: #fff; color: #b71c1c; box-shadow: 0 1px 5px rgba(198,40,40,.2); }

.xhs-dim-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.xhs-dim-card { background: #fff; border: 2px solid #fce4ec; border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: all .15s; }
.xhs-dim-card:hover { border-color: #f8bbd0; transform: translateY(-1px); }
.xhs-dim-card.active { border-color: #c62828; background: #ffebee; }
.xhs-dim-name { font-size: 12px; color: #78909c; font-weight: 600; margin-bottom: 4px; }
.xhs-dim-card.active .xhs-dim-name { color: #b71c1c; }
.xhs-dim-val { font-size: 18px; font-weight: 800; color: #c62828; }
.xhs-dim-bar { height: 4px; background: #ffebee; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.xhs-dim-bar-fill { height: 100%; background: #c62828; transition: width .3s; }

.xhs-formula-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xhs-formula-row { display: grid; grid-template-columns: 100px 1fr 1fr 1fr; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #f0f2f5; align-items: start; }
.xhs-formula-row:last-child { border-bottom: none; }
.xhs-formula-row.highlight { background: linear-gradient(90deg,#ffebee,#fff); border-left: 4px solid #c62828; border-bottom: none; border-radius: 0 8px 8px 0; padding: 14px 16px; margin-top: 6px; }
.xhs-formula-mod { font-weight: 800; color: #b71c1c; font-size: 13px; }
.xhs-formula-row.highlight .xhs-formula-mod { color: #c62828; font-size: 14px; }
.xhs-formula-cell { font-size: 12px; color: #455a64; line-height: 1.6; }
.xhs-formula-cell .lbl { font-size: 10px; color: #90a4ae; font-weight: 700; display: block; margin-bottom: 3px; }

/* Topic type tags */
.tt { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tt-功能痛点 { background: #ffebee; color: #c62828; }
.tt-风格审美 { background: #f3e5f5; color: #7b1fa2; }
.tt-季节场景 { background: #e3f2fd; color: #1565c0; }
.tt-季节功能 { background: #fff3e0; color: #e65100; }
.tt-季节审美 { background: #fff8e1; color: #ff8f00; }
.tt-季节情绪 { background: #fffde7; color: #f57f17; }
.tt-日常场景 { background: #e8f5e9; color: #2e7d32; }
.tt-通勤场景 { background: #e0f2f1; color: #00695c; }
.tt-人群场景 { background: #f1f8e9; color: #558b2f; }
.tt-校园场景 { background: #e0f7fa; color: #00838f; }
.tt-情绪表达 { background: #fce4ec; color: #ad1457; }
.tt-新品趋势 { background: #ede7f6; color: #4527a0; }
.tt-周边搭配 { background: #f9fbe7; color: #827717; }
.tt-拍摄场景 { background: #efebe9; color: #5d4037; }
.tt-品质卖点 { background: #e8eaf6; color: #283593; }
.tt-风格\/合集 { background: #fce4ec; color: #880e4f; }

/* Heatmap */
.xhs-heat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.xhs-heat-table th, .xhs-heat-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid #f0f2f5; }
.xhs-heat-table th { background: #fafafa; font-weight: 700; color: #607d8b; font-size: 11px; text-align: center; }
.xhs-heat-table th.kw, .xhs-heat-table td.kw { text-align: left; }
.xhs-heat-table .heat-cell { border-radius: 4px; font-weight: 600; }
.xhs-heat-table .h0 { background: #fafafa; color: #cfd8dc; }
.xhs-heat-table .h1 { background: #ffebee; color: #c62828; }
.xhs-heat-table .h2 { background: #ffcdd2; color: #b71c1c; }
.xhs-heat-table .h3 { background: #ef9a9a; color: #fff; }
.xhs-heat-table .h4 { background: #e57373; color: #fff; }
.xhs-heat-table .h5 { background: #c62828; color: #fff; }
.xhs-judge { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.xhs-judge-稳定 { background: #e8f5e9; color: #2e7d32; }
.xhs-judge-上升 { background: #fff3e0; color: #e65100; }
.xhs-judge-回落 { background: #ffebee; color: #c62828; }
.xhs-judge-阶段性 { background: #f3e5f5; color: #7b1fa2; }

/* Topic table */
.xhs-topic-row { display: grid; grid-template-columns: 36px 1fr 90px 100px; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #f5f5f5; align-items: center; }
.xhs-topic-row:hover { background: #fafafa; }
.xhs-topic-rank { font-weight: 800; color: #c62828; text-align: center; }
.xhs-topic-rank.top3 { background: #c62828; color: #fff; border-radius: 6px; padding: 2px 0; }
.xhs-topic-name { font-size: 13px; color: #263238; font-weight: 600; }
.xhs-topic-bar-wrap { position: relative; height: 8px; background: #fce4ec; border-radius: 4px; overflow: hidden; }
.xhs-topic-bar-fill { height: 100%; background: linear-gradient(90deg,#c62828,#e57373); transition: width .3s; }
.xhs-topic-hot { font-weight: 700; color: #b71c1c; text-align: right; font-size: 13px; }

/* Matrix card */
.xhs-matrix-row { display: grid; grid-template-columns: 110px 1.4fr 1fr 1.6fr 1fr; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #f0f2f5; font-size: 12px; line-height: 1.6; }
.xhs-matrix-row:last-child { border-bottom: none; }
.xhs-matrix-row .col-type { font-weight: 800; color: #c62828; font-size: 13px; }
.xhs-matrix-row .col-cases { color: #5d4037; }
.xhs-matrix-row .col-need { color: #455a64; }
.xhs-matrix-row .col-play { color: #1565c0; }
.xhs-matrix-row .col-selling { color: #2e7d32; font-weight: 600; }

.xhs-ops-grid { display: grid; grid-template-columns: 80px 1fr 1fr 1fr 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f0f2f5; font-size: 12px; line-height: 1.6; align-items: start; }
.xhs-ops-grid.head { background: #fafafa; font-weight: 700; color: #607d8b; font-size: 11px; }
.xhs-ops-grid .col-month { font-weight: 800; color: #c62828; font-size: 13px; }
.xhs-ops-grid .col-focus { color: #b71c1c; }
.xhs-ops-grid .col-goal { color: #455a64; }
.xhs-ops-grid .col-actions { color: #1565c0; }
.xhs-ops-grid .col-products { color: #2e7d32; }

.xhs-report-row { padding: 12px 16px; border-bottom: 1px solid #f0f2f5; }
.xhs-report-row .mod { font-weight: 800; color: #c62828; font-size: 13px; margin-bottom: 6px; }
.xhs-report-row .text { font-size: 12px; color: #455a64; line-height: 1.7; }

.xhs-lib-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.xhs-lib-table th, .xhs-lib-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f2f5; vertical-align: top; line-height: 1.6; }
.xhs-lib-table th { background: #fafafa; font-weight: 700; color: #607d8b; font-size: 11px; }
.xhs-lib-table .col-dir { font-weight: 800; color: #c62828; }
.xhs-lib-table .col-title { color: #b71c1c; }
.xhs-lib-table .col-conv { color: #2e7d32; font-weight: 600; }

details.xhs-fold { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 14px; overflow: hidden; }
details.xhs-fold > summary { padding: 14px 18px; cursor: pointer; font-weight: 700; color: #b71c1c; font-size: 13px; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
details.xhs-fold > summary::-webkit-details-marker { display: none; }
details.xhs-fold > summary::before { content: '▶'; font-size: 10px; color: #c62828; transition: transform .2s; }
details.xhs-fold[open] > summary::before { transform: rotate(90deg); }
details.xhs-fold > summary:hover { background: #fafafa; }
details.xhs-fold > .fold-body { padding: 0 0 8px 0; border-top: 1px solid #f0f2f5; }


/* ── Douyin Content Section ── */
.dy-compare-wrap { overflow-x:auto; }
.dy-compare-table {
  width:100%; border-collapse:collapse; font-size:13px;
}
.dy-compare-table th {
  padding:10px 14px; text-align:left; font-size:12px; font-weight:700;
  background:#f7f8fa; color:#546e7a; border-bottom:2px solid #e8ecf0;
}
.dy-dim-col { width:120px; }
.dy-acc-col { width:calc((100% - 120px)/3); }
.dy-highlight-col {
  background:#fff2f2 !important; border-left:3px solid #e84b3a !important;
  color:#b71c1c !important;
}
.dy-compare-table td {
  padding:11px 14px; border-bottom:1px solid #f0f2f5; vertical-align:top;
  font-size:12.5px; line-height:1.6; color:#37474f;
}
.dy-dim-cell { font-weight:600; color:#546e7a; background:#fafbfc; }
.dy-highlight-cell {
  background:#fff7f7; border-left:3px solid #e84b3a;
  color:#c62828 !important; font-weight:600;
}
.dy-compare-table tr:last-child td { border-bottom:none; }
.dy-compare-table tr:hover td { background:#fafafa; }
.dy-highlight-cell:hover { background:#fef0f0 !important; }

/* Three-step flow */
.dy-step-row {
  display:flex; align-items:stretch; gap:0; flex-wrap:wrap;
}
.dy-step-card {
  flex:1; min-width:200px; background:#fff9f9; border:1px solid #fce4e4;
  border-radius:10px; padding:18px 16px; display:flex; flex-direction:column; gap:8px;
  margin:0 6px;
}
.dy-step-arrow {
  display:flex; align-items:center; font-size:22px; color:#e84b3a;
  padding:0 2px; flex-shrink:0; align-self:center;
}
.dy-step-icon { font-size:26px; line-height:1; }
.dy-step-name { font-size:13px; font-weight:700; color:#c62828; }
.dy-step-detail { font-size:12px; color:#546e7a; line-height:1.65; flex:1; }
.dy-step-goal {
  font-size:11.5px; color:#37474f; background:#fff; border-radius:6px;
  padding:7px 10px; border-left:3px solid #e84b3a; margin-top:4px;
}
.dy-goal-label {
  display:inline-block; background:#e84b3a; color:#fff; font-size:10px;
  border-radius:3px; padding:1px 5px; margin-right:5px; font-weight:700;
}

/* Pain-body mapping table */
.dy-painmap-wrap { overflow-x:auto; }
.dy-painmap-table {
  width:100%; border-collapse:collapse; font-size:12.5px;
}
.dy-painmap-table th {
  padding:9px 14px; text-align:left; font-size:12px; font-weight:700;
  background:#f7f8fa; color:#546e7a; border-bottom:2px solid #e8ecf0;
}
.dy-painmap-table td {
  padding:10px 14px; border-bottom:1px solid #f0f2f5; vertical-align:middle;
  line-height:1.6; color:#37474f;
}
.dy-body-tag {
  display:inline-block; border-radius:5px; padding:3px 9px;
  font-size:12px; font-weight:600; color:#37474f; white-space:nowrap;
}
.dy-pain-cell { color:#c62828; font-weight:600; }
.dy-style-cell { color:#1565c0; }
.dy-content-cell { color:#2e7d32; }
.dy-painmap-table tr:last-child td { border-bottom:none; }
.dy-painmap-table tr:hover td { background:#fafafa; }

/* --------------------------------------------------------------------------
   Fashion analytics redesign overrides
   -------------------------------------------------------------------------- */
:root {
  --ink: #20201d;
  --muted: #6f716d;
  --soft: #f7f4ee;
  --paper: #fffdf8;
  --line: #e6ded1;
  --accent: #9a5b3f;
  --accent-deep: #5b392f;
  --sage: #687969;
  --rose: #b45f67;
  --gold: #b98b42;
  --shadow: 0 18px 48px rgba(45, 38, 30, .10);
  --shadow-soft: 0 8px 24px rgba(45, 38, 30, .08);
}

* { letter-spacing: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 12% -8%, rgba(185, 139, 66, .16), transparent 28%),
    linear-gradient(180deg, #f6f1e8 0%, #f8f6f1 36%, #f2f4f1 100%);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: linear-gradient(90deg, rgba(32,32,29,.04) 1px, transparent 1px), linear-gradient(rgba(32,32,29,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: -1;
}

.app-header {
  min-height: 320px;
  padding: 30px 28px 34px;
  background:
    linear-gradient(90deg, rgba(30, 27, 24, .92), rgba(65, 48, 39, .80) 48%, rgba(30, 27, 24, .24)),
    url('visuals/fashion-textile.svg') center/cover no-repeat;
  color: #fffdf8;
  position: relative;
  overflow: hidden;
}
.app-header::after {
  content: '';
  position: absolute;
  right: clamp(20px, 8vw, 110px);
  bottom: -26px;
  width: min(38vw, 430px);
  aspect-ratio: 1 / 1;
  background: url('visuals/pants-silhouette.svg') center/contain no-repeat;
  opacity: .72;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.26));
}
.header-inner {
  max-width: 1320px;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 42px;
  align-items: end;
  position: relative;
  z-index: 2;
}
.brand-lockup { max-width: 760px; }
.brand-logo {
  width: auto;
  height: auto;
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,253,248,.12);
  border: 1px solid rgba(255,253,248,.24);
  color: #f3d9b2;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.brand-title {
  margin-top: 28px;
  max-width: 680px;
  font-size: clamp(34px, 5vw, 70px);
  line-height: .98;
  font-weight: 900;
  letter-spacing: 0;
}
.brand-sub {
  max-width: 660px;
  margin-top: 18px;
  color: rgba(255,253,248,.78);
  font-size: 15px;
  line-height: 1.85;
  opacity: 1;
}
.header-meta {
  display: grid;
  gap: 10px;
  align-self: end;
  justify-self: end;
  min-width: 280px;
}
.header-tag {
  margin-left: 0;
  justify-self: start;
  border-radius: 999px;
  padding: 8px 14px;
  color: #f9ead5;
  border-color: rgba(255,253,248,.28);
  background: rgba(255,253,248,.12);
  font-size: 12px;
  opacity: 1;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.hero-stat {
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid rgba(255,253,248,.22);
  border-radius: 8px;
  background: rgba(255,253,248,.10);
  backdrop-filter: blur(14px);
}
.hero-stat b { display:block; font-size: 20px; line-height: 1; color: #fff; }
.hero-stat span { display:block; margin-top: 7px; font-size: 11px; color: rgba(255,253,248,.68); white-space: nowrap; }

.top-nav {
  top: 0;
  background: rgba(255,253,248,.92);
  border-bottom: 1px solid rgba(108, 89, 70, .16);
  box-shadow: 0 10px 28px rgba(45, 38, 30, .08);
  backdrop-filter: blur(18px);
}
.nav-inner {
  max-width: 1320px;
  padding: 8px 18px;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.nav-group-label {
  align-self: center;
  margin: 0 4px 0 10px;
  color: #a19484;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.nav-item {
  height: 40px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
}
.nav-item:hover { color: var(--accent-deep); background: #f1ebe1; }
.nav-item.active {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  border-color: rgba(91,57,47,.18);
  box-shadow: 0 10px 20px rgba(91,57,47,.18);
}
.nav-icon { font-size: 14px; opacity: .95; }
.nav-divider { background: var(--line); margin: 9px 4px; }

.wrap { max-width: 1320px; padding: 28px 20px 72px; }
#section-supply .wrap, #section-competitor .wrap { padding-top: 28px; }
.view-bar, .comp-view-bar, .xhs-view-bar {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,253,248,.78);
  box-shadow: var(--shadow-soft);
}
.vbtn, .comp-vbtn, .xhs-vbtn {
  min-height: 36px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
  font-family: inherit;
}
.vbtn:hover, .comp-vbtn:hover, .xhs-vbtn:hover { color: var(--accent-deep); background: #f4ede3; }
.vbtn.active, .comp-vbtn.active, .xhs-vbtn.active {
  color: #fffdf8;
  background: var(--ink);
  box-shadow: none;
}
.month-tabs, .dim-tabs, .attr-tabs, .comp-filter-bar, .filter-bar { gap: 8px; }
.mtab, .dtab, .attr-tab, .fbtn, .brand-fbtn {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,253,248,.78);
  color: var(--muted);
  font-weight: 800;
  box-shadow: none;
}
.dtab { margin-bottom: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.mtab:hover, .dtab:hover, .attr-tab:hover, .fbtn:hover, .brand-fbtn:hover { color: var(--accent-deep); border-color: #d3bfa6; background: #fffaf1; }
.mtab.active, .dtab.active, .attr-tab.active, .fbtn.active, .brand-fbtn.active {
  color: #fffdf8;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  border-color: transparent;
}
.dim-row, .attr-row { border-bottom: 0; margin-bottom: 18px; }

.card, .kpi, .chart-card, .sb-card, .brand-card, .content-card, .xhs-sb-card, .ops-word-card, .prev-card, .supply-await {
  border: 1px solid rgba(108, 89, 70, .12);
  border-radius: 8px;
  background: rgba(255,253,248,.86);
  box-shadow: var(--shadow-soft);
}
.card { padding: 20px; margin-bottom: 18px; }
.card[style*="padding:0"] { overflow: hidden; }
.kpi {
  min-height: 112px;
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  right: -28px;
  top: -32px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: rgba(154, 91, 63, .10);
}
.kpi-lbl { color: var(--muted); font-weight: 800; }
.kpi-val { color: var(--ink) !important; font-size: clamp(22px, 2.3vw, 30px); letter-spacing: 0; }
.sec-title {
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
}
.sec-title::before { background: linear-gradient(180deg, var(--accent), var(--gold)); border-radius: 999px; }
.sec-note { color: #9b978f; }

.ai-card {
  border: 1px solid rgba(154, 91, 63, .18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,253,248,.96), rgba(246,238,226,.92));
  box-shadow: var(--shadow-soft);
}
.ai-card.purple, .ai-card.red, .ai-card.blue, .ai-card.green { background: linear-gradient(135deg, rgba(255,253,248,.96), rgba(246,238,226,.92)); border-color: rgba(154,91,63,.18); }
.ai-badge, .ai-card.purple .ai-badge, .ai-card.red .ai-badge, .ai-card.blue .ai-badge, .ai-card.green .ai-badge { background: var(--ink); color: #fffdf8; }
.ai-item { border-radius: 8px; border-left-color: var(--accent) !important; background: rgba(255,255,255,.66); }
.ai-tag { border-radius: 999px; background: #f1e6d8 !important; color: var(--accent-deep) !important; }

#vDetail { grid-template-columns: 300px minmax(0, 1fr); gap: 20px; }
#detailSidebar { top: 74px; }
.sb-head { background: linear-gradient(135deg, var(--ink), var(--accent-deep)); }
.sb-total { background: #f2eadf; }
.sb-total-lbl, .sb-total-val, .sb-kw-uv, .sb-cmp-row.cur .sb-cmp-uv, .row-sel .td-kw { color: var(--accent-deep); }
.sb-cmp-row.cur, .row-sel { background: #f3e8da !important; }
.sb-cmp-row.cur .sb-cmp-bar, .bar-fill { background: linear-gradient(90deg, var(--accent-deep), var(--gold)); }

.table-scroll, .dy-compare-wrap, .dy-painmap-wrap { overflow-x: auto; }
thead th, .comp-summary-table th, .xhs-heat-table th, .xhs-lib-table th, .dy-compare-table th, .dy-painmap-table th {
  color: #7f7a71;
  background: #f5efe6;
  border-bottom-color: var(--line);
  font-weight: 900;
}
tbody tr:hover, .comp-summary-table tr:hover td, .dy-compare-table tr:hover td, .dy-painmap-table tr:hover td { background: #fff8ee; }
td, .comp-summary-table td, .xhs-lib-table td { border-bottom-color: #eee5d8; }
.td-rank.top { color: var(--rose); }
.td-kw { color: #2c2b27; }
.h1 { background: #f8eee3; }
.h2 { background: #ecd8c7; }
.h3 { background: #d7ad8f; color: #fff; }
.h4 { background: #ad755a; color: #fff; }
.h5 { background: #704536; color: #fff; }

.sv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid rgba(108,89,70,.12);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,253,248,.95), rgba(244,235,223,.82));
  box-shadow: var(--shadow-soft);
}
.sv-title { color: var(--ink); font-size: 22px; font-weight: 900; }
.sv-note { color: var(--muted); line-height: 1.7; }
.brand-card { border-top-width: 0; padding: 18px; }
.brand-card:nth-child(1), .brand-card:nth-child(2), .brand-card:nth-child(3) { border-color: rgba(108,89,70,.12); }
.brand-card::before, .content-card::before {
  content: '';
  display: block;
  height: 3px;
  margin: -18px -18px 14px;
  background: linear-gradient(90deg, var(--accent), var(--sage), var(--gold));
}
.content-card.selected, .xhs-dim-card.active { border-color: var(--accent); background: #fff7ec; }
.xhs-dim-card { border-radius: 8px; border-color: #eedfd8; background: rgba(255,253,248,.86); }
.xhs-dim-card:hover { border-color: #d8b59d; transform: translateY(-1px); }
.xhs-dim-card.active .xhs-dim-name, .xhs-dim-card.active .xhs-dim-val { color: var(--accent-deep); }

.ops-layout { gap: 16px; }
.ops-col {
  border: 1px solid rgba(108,89,70,.14);
  border-radius: 8px;
  background: rgba(255,253,248,.88);
  box-shadow: var(--shadow-soft);
}
.ops-col.active-target { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154,91,63,.12), var(--shadow-soft); }
.ops-col-head { background: linear-gradient(180deg, #fffaf1, #f6ede2); border-bottom-color: var(--line); }
.ops-kw-tag { border-radius: 999px; }
.ops-source-pool, .ops-md-panel {
  border: 1px solid rgba(108,89,70,.12);
  border-radius: 8px;
  background: rgba(255,253,248,.88);
  box-shadow: var(--shadow-soft);
}
.ops-note-input, .ops-md-input { border-radius: 8px; border-color: var(--line); background: #fffdf8; }
.ops-note-input:focus, .ops-md-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154,91,63,.12); }

.chart-3 { gap: 16px; }
.legend { border-top-color: var(--line); }
.legend-dot { border-radius: 3px; }
svg text { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }

@media (max-width: 980px) {
  .app-header { min-height: 360px; padding: 24px 18px 28px; }
  .app-header::after { opacity: .42; width: 60vw; right: -4vw; }
  .header-inner { grid-template-columns: 1fr; gap: 28px; }
  .header-meta { justify-self: start; width: 100%; }
  .hero-stats { max-width: 520px; }
  #vDetail { grid-template-columns: 1fr; }
  #detailSidebar { position: static; }
  .sv-header { align-items: flex-start; flex-direction: column; }
  .ops-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .wrap { padding: 20px 12px 56px; }
  .brand-title { font-size: 38px; }
  .brand-sub { font-size: 13px; }
  .hero-stats, .kpi-row, .sv-kpi, .chart-3, .supply-preview { grid-template-columns: 1fr !important; }
  .nav-inner { padding: 8px 10px; }
  .nav-group-label { display: none; }
  .nav-item { height: 38px; padding: 0 12px; }
  .view-bar, .comp-view-bar, .xhs-view-bar { width: 100%; overflow-x: auto; }
  .vbtn, .comp-vbtn, .xhs-vbtn { flex: 1 0 auto; }
  .card { padding: 16px; }
  .sv-title { font-size: 18px; }
  .td-bar { width: 120px; }
  table { min-width: 620px; }
  #detailTable, #svTable, #svCompare, #xhsSearchTable, #xhsTopicTable, #xhsTrendHeat, #cpProdTable { overflow-x: auto; }
}

/* Figma-style visual polish pass */
.insight-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  gap: 18px;
  align-items: stretch;
  margin: 0 0 22px;
}
.brief-copy {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 26px 28px;
  border: 1px solid rgba(108, 89, 70, .14);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255,253,248,.98), rgba(246,235,220,.90)),
    radial-gradient(circle at 92% 12%, rgba(185,139,66,.22), transparent 28%);
  box-shadow: var(--shadow);
}
.brief-copy::after {
  content: '';
  position: absolute;
  right: 24px;
  bottom: -46px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(154, 91, 63, .16);
  border-radius: 999px;
}
.brief-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #2b211d;
  color: #fff8ee;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.brief-copy h2 {
  max-width: 620px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
  font-weight: 950;
}
.brief-copy p {
  max-width: 680px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}
.brief-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.brief-card {
  min-height: 190px;
  padding: 18px;
  border: 1px solid rgba(108, 89, 70, .14);
  border-radius: 10px;
  background: rgba(255,253,248,.90);
  box-shadow: var(--shadow-soft);
}
.brief-card span {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f0e5d6;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 900;
}
.brief-card b {
  display: block;
  margin-top: 34px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}
.brief-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.card:hover, .kpi:hover, .chart-card:hover, .brand-card:hover, .brief-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(45, 38, 30, .12);
}
.card, .kpi, .chart-card, .brand-card, .brief-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.top-nav::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(154,91,63,.32), transparent);
}
.nav-item:focus-visible,
.vbtn:focus-visible,
.mtab:focus-visible,
.dtab:focus-visible,
.fbtn:focus-visible,
.comp-vbtn:focus-visible,
.xhs-vbtn:focus-visible {
  outline: 3px solid rgba(185,139,66,.32);
  outline-offset: 2px;
}
.view-bar, .month-row, .dim-row, .attr-row {
  position: relative;
  z-index: 3;
}
.month-row, .dim-row, .attr-row {
  padding: 2px;
  border-radius: 12px;
}
.sv-header::before {
  content: '';
  width: 42px;
  align-self: stretch;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  opacity: .18;
}
.sv-header > div:first-child { flex: 1; }
.kpi-row, .sv-kpi, .chart-3, .brand-grid, .xhs-dim-grid {
  align-items: stretch;
}
.kpi-val, .td-uv, .td-m, .sb-total-val {
  font-variant-numeric: tabular-nums;
}
tbody tr {
  background-clip: padding-box;
}
.ops-col-title, .sv-title, .sec-title, .brief-copy h2 {
  text-wrap: balance;
}

.comp-store-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}
.comp-store-card .bc-name {
  color: var(--accent-deep);
  font-size: 17px;
  line-height: 1.25;
}
.comp-link {
  color: var(--accent-deep);
  font-weight: 800;
  text-decoration: none;
}
.comp-link:hover {
  color: #2b211d;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.comp-type-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 2px;
}
.comp-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(154, 91, 63, .18);
  border-radius: 999px;
  background: #fff8ee;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}
.comp-type-pill b {
  color: #fffdf8;
  background: var(--accent-deep);
  border-radius: 999px;
  padding: 1px 7px;
}
.comp-prod-tbl th,
.comp-prod-tbl td {
  line-height: 1.55;
}
.comp-prod-tbl .td-prod-name {
  max-width: 360px;
}
.comp-prod-tbl .td-judge {
  color: #5d6259;
  font-size: 12px;
}
.td-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1e6d8;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.td-rank-comp.top3 {
  color: #b14e43;
  font-weight: 950;
}
.brand-fbtn {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comp-month-board,
.comp-focus-board {
  border-color: rgba(154, 91, 63, .16);
}
.comp-month-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 16px;
}
.comp-month-chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.comp-month-chip.active,
.comp-month-chip:hover {
  color: #fffdf8;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.comp-hot-style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.comp-hot-style-card {
  padding: 15px;
  border: 1px solid rgba(108,89,70,.14);
  border-radius: 8px;
  background: #fffaf2;
}
.comp-hot-style-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
}
.comp-hot-style-head b {
  color: #fffdf8;
  background: var(--accent-deep);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
}
.comp-hot-style-meta {
  margin: 9px 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.comp-hot-style-products {
  display: grid;
  gap: 6px;
}
.comp-mini-link {
  color: var(--accent-deep);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}
.comp-mini-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.comp-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.comp-focus-card {
  padding: 18px;
  border: 1px solid rgba(108,89,70,.14);
  border-radius: 8px;
  background: linear-gradient(135deg, #fffdf8, #f6ede2);
}
.comp-focus-name {
  color: var(--accent-deep);
  font-size: 20px;
  font-weight: 950;
}
.comp-focus-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.comp-focus-stats div {
  padding: 10px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.68);
}
.comp-focus-stats b,
.comp-focus-stats span {
  display: block;
}
.comp-focus-stats b {
  color: var(--ink);
  font-size: 18px;
}
.comp-focus-stats span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.comp-focus-line {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}
.comp-focus-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.comp-focus-line b {
  color: var(--ink);
  line-height: 1.4;
}
.comp-focus-product {
  display: block;
  line-height: 1.5;
}
.comp-focus-table td:first-child {
  font-weight: 900;
  color: var(--accent-deep);
}
.comp-analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.comp-store-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.comp-store-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.comp-store-chip b {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1e6d8;
  color: var(--accent-deep);
  text-align: center;
}
.comp-store-chip.active,
.comp-store-chip:hover {
  color: #fffdf8;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.comp-store-chip.active b,
.comp-store-chip:hover b {
  background: rgba(255,255,255,.18);
  color: #fffdf8;
}
.comp-focus-month {
  margin-bottom: 14px;
}
.comp-dim-card {
  margin-top: 16px;
}
.comp-dim-leaders {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}
.comp-dim-month {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(108,89,70,.14);
  border-radius: 8px;
  background: #fffaf4;
}
.comp-dim-month span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.comp-dim-month b {
  color: var(--accent-deep);
  font-size: 14px;
  line-height: 1.35;
}
.comp-dim-month em {
  color: var(--ink);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}
.comp-dim-table th,
.comp-dim-table td {
  white-space: nowrap;
}
.comp-trend-cell {
  display: grid;
  gap: 2px;
  min-width: 56px;
}
.comp-trend-cell b {
  color: var(--ink);
  font-size: 13px;
}
.comp-trend-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.comp-prod-tbl td:nth-child(6) .td-type-tag {
  background: #edf2e8;
  color: var(--sage);
}

@media (max-width: 1100px) {
  .insight-brief { grid-template-columns: 1fr; }
  .brief-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comp-store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-hot-style-grid,
  .comp-focus-grid,
  .comp-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-dim-leaders { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .insight-brief { gap: 12px; }
  .brief-copy { min-height: auto; padding: 22px 18px; }
  .brief-cards { grid-template-columns: 1fr; }
  .brief-card { min-height: auto; }
  .brief-card b { margin-top: 18px; }
  .sv-header::before { width: 100%; height: 5px; }
  .comp-store-grid { grid-template-columns: 1fr; }
  .comp-hot-style-grid,
  .comp-focus-grid,
  .comp-analysis-grid { grid-template-columns: 1fr; }
  .comp-dim-leaders { grid-template-columns: 1fr; }
}
