/* Inter 本地自托管(SIL OFL)。原来挂的是 fonts.googleapis.com —— 这台机器连它要 5.9 秒,
   而且那个 <link rel=stylesheet> 是阻塞渲染的:字体没到之前整页白屏,首屏被它一个人拖掉好几秒。
   这份是 latin 子集的可变字体(400~800 一个文件 47KB),中文本来就走苹方/雅黑,Inter 只管数字和字母。
   unicode-range 里带了 ↑↓(U+2191/2193),环比那两个箭头也归它渲染。 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #1a1d21; --ink2: #4a5058; --muted: #98a0aa; --line: #edeef1;
  --brand: #ff6a2c; --brand-weak: #fff3ec; --brand-ink: #d8531a;
  --blue: #2f6bff; --blue-weak: #eef3ff;
  --red: #e5484d; --red-bg: #fdecec; --orange: #d97706; --orange-bg: #fff6e8; --green: #12805c; --green-bg: #e6f6ef;
  --shadow: 0 1px 2px rgba(20,25,35,.04), 0 4px 16px rgba(20,25,35,.05);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 13px/1.55 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: radial-gradient(1200px 400px at 50% -180px, #fff, var(--bg)); min-height: 100vh; }
h1, h3 { margin: 0; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 22px; background: rgba(255,255,255,.82); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { font-size: 18px; letter-spacing: -.2px; }
.brand h1::before { content: "🛒"; margin-right: 7px; }
.brand .sub { font-size: 12px; color: var(--muted); }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; align-items: center; background: #f0f1f4; border-radius: 10px; padding: 3px; gap: 2px; }
.seg-lbl { font-size: 9px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); opacity: .6; padding: 0 5px; user-select: none; pointer-events: none; cursor: default; writing-mode: horizontal-tb; }
.seg-lbl:first-child { padding-left: 4px; }
.seg-div { width: 1px; align-self: stretch; margin: 4px 5px; background: rgba(0,0,0,.08); }
.seg button { border: 0; background: transparent; padding: 6px 13px; cursor: pointer; font-size: 12px; color: var(--ink2); border-radius: 8px; transition: .15s; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--card); color: var(--brand-ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ghost { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 13px; cursor: pointer; font-size: 12px; color: var(--ink2); transition: .15s; }
.ghost:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-weak); }
.ghost[disabled] { opacity: .55; cursor: default; }

.meta { padding: 12px 22px 4px; color: var(--muted); font-size: 12px; display: flex; gap: 20px; flex-wrap: wrap; }
.meta b { color: var(--ink); font-weight: 600; }
.meta b.b-red { color: var(--red); }

/* Subtabs / filters */
.subtabs { display: flex; gap: 7px; padding: 8px 22px 6px; flex-wrap: wrap; }
.subtabs button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 12px; color: var(--ink2); transition: .15s; }
.subtabs button:hover { border-color: #d8dbe0; }
.subtabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(255,106,44,.28); }
.subtabs button .n, .reasonbar button .n { opacity: .55; margin-left: 5px; font-variant-numeric: tabular-nums; }
.subtabs { align-items: center; }
.subtabs button.managed { border-color: #cdeeda; background: var(--green-bg); color: var(--green); font-weight: 600; }
.subtabs button.managed:hover { border-color: #a9dcc2; }
.subtabs button.managed.active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(18,128,92,.28); }
.catsel { border: 1px solid var(--line); border-radius: 999px; padding: 6px 32px 6px 14px; font-size: 12px; color: var(--ink2); cursor: pointer; appearance: none; -webkit-appearance: none; max-width: 280px; transition: .15s;
  background: var(--card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398a0aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 11px center; }
.catsel:hover { border-color: #d8dbe0; color: var(--ink); }
.catsel:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }

.toolbar { display: flex; align-items: center; gap: 14px; padding: 8px 22px 12px; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar select { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; min-width: 220px; background: var(--card); transition: .15s; }
.toolbar input[type=search]:focus, .toolbar select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.reasonbar { display: flex; gap: 7px; margin-left: auto; flex-wrap: wrap; }
.reasonbar button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 12px; color: var(--ink2); transition: .15s; }
.reasonbar button:hover { border-color: #cfd8ea; }
.reasonbar button.active { background: var(--blue-weak); border-color: #b9ccff; color: var(--blue); font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

/* Table */
.tablewrap { overflow-x: auto; padding: 4px 16px 48px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
thead th { position: sticky; top: 0; background: #fbfbfc; text-align: right; padding: 11px 12px; font-size: 11.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; z-index: 2; }
thead th.left { text-align: left; }
thead th:hover { color: var(--ink2); }
thead th.sorted::after { content: " ↓"; color: var(--brand); }
thead th.asc::after { content: " ↑"; color: var(--brand); }
tbody td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink2); }
tbody td.left { text-align: left; }
tbody td.idx { color: var(--muted); font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
/* 门店视角「同款其它规格」那行小字：表格单元格是 nowrap 的，这行要允许换行，不然会把列撑得很宽（9/19） */
.gsib { white-space: normal; max-width: 460px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
tbody tr.goods { cursor: pointer; transition: background .12s; }
tbody tr.goods:hover { background: #fbfcff; }
tr.zero td { background: var(--red-bg); }
tr.zero:hover td { background: #fce3e3; }
tr.detail td { background: #f7f9fc; padding: 0; }

/* Product cell */
.prod { display: flex; align-items: center; gap: 11px; max-width: 460px; }
.thumb { flex: none; width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: #f2f3f5; border: 1px solid var(--line); display: block; }
.thumb.noimg { display: flex; align-items: center; justify-content: center; font-size: 18px; color: #c4c8cd; }
.pinfo { min-width: 0; }
.pname { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.35; }
.pmeta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.tag { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 5px; background: #eef0f3; color: #6b7280; margin-left: 4px; vertical-align: middle; }
.tag.binglang { background: #fde8f0; color: #be185d; }
.tag.danger { background: var(--red-bg); color: var(--red); }

/* Coverage bar */
.cov { display: inline-flex; align-items: center; gap: 7px; justify-content: flex-end; }
.covbar { width: 52px; height: 7px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.covbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb088, var(--brand)); border-radius: 4px; }
.b-orange { color: var(--orange); font-weight: 600; }
.b-green { color: var(--green); font-weight: 600; }
.b-red { color: var(--red); font-weight: 600; }
.b-blue { color: #0a6ebd; font-weight: 600; }
th.rsort { cursor: pointer; user-select: none; white-space: nowrap; }
th.rsort:hover { color: var(--brand); }
th.rsort.on { color: var(--brand); }
.ownerpill { background: #eef2ff; color: #3538cd; padding: 1px 8px; border-radius: 6px; font-size: 12px; }
/* 大类涨跌卡片 */
.seg.sm button { padding: 3px 10px; font-size: 12px; }
.bigcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; padding: 12px 14px; }
.bigcard { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 4px; cursor: pointer; background: var(--card); transition: transform .1s, box-shadow .1s; overflow: hidden; }
.bigcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--muted); }
.bigcard.up::before { background: var(--red); }   /* 涨红·跌绿(A股习惯) */
.bigcard.dn::before { background: var(--green); }
.bigcard.up { background: linear-gradient(180deg, rgba(229,72,77,.05), transparent 60%); }
.bigcard.dn { background: linear-gradient(180deg, rgba(18,128,92,.05), transparent 60%); }
.bigcard:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.09); }
.bigcard.on { outline: 2px solid var(--brand); outline-offset: -1px; }
.bc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.bc-n { font-weight: 700; font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-mom { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bc-mom.up { color: var(--red); }
.bc-mom.dn { color: var(--green); }
.bc-mom.flat { color: var(--muted); }
.bc-v { font-size: 17px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.bc-v span { font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.bc-spark { display: block; margin: 2px -12px -4px; width: calc(100% + 24px); }

/* 美团类目覆盖树 */
#covTable td { padding: 6px 10px; vertical-align: middle; }
.covrow:hover { background: var(--brand-weak); }
.cov-arrow { display: inline-block; width: 16px; color: var(--muted); font-size: 11px; }
.cov-empty { background: #fff5f5; }
.cov-empty2 { background: #fffaf3; }
.covrow .lv1 { font-size: 13.5px; }
.covrow .lv2 { font-weight: 600; }
.covrow .lv3 { font-weight: 400; color: var(--ink); }

/* Reason badge */
.reason { font-size: 11px; padding: 2px 9px; border-radius: 6px; background: #eef0f3; color: #6b7280; font-weight: 500; }
.reason.b-red { background: var(--red-bg); color: var(--red); }
.reason.b-orange { background: var(--orange-bg); color: var(--orange); }
.reason.b-blue { background: #eaf6ff; color: #0a6ebd; }

/* Store breakdown */
.storebreak { padding: 12px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 5px 22px; }
.sb { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.sb .nm { width: 100px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb .bar { flex: 1; height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.sb .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb088, var(--brand)); }
.sb .v { width: 44px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.sb.zero .nm, .sb.zero .v { color: var(--muted); }

/* Store view */
.storecols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 4px 22px 48px; align-items: start; }
.storecol h3 { font-size: 13.5px; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
@media (max-width: 940px) { .storecols { grid-template-columns: 1fr; } }

/* ——— Action board (hero) ——— */
.actionboard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 12px 22px 6px; align-items: start; }
@media (max-width: 1400px) { .actionboard { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .actionboard { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .actionboard { grid-template-columns: 1fr; } }
.acol { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.acol-h { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--line); }
.acol-h b { font-size: 13px; background: rgba(0,0,0,.05); border-radius: 7px; padding: 1px 9px; }
.acol-h.up { color: var(--green); background: linear-gradient(180deg, #eefaf3, #fff); }
.acol-h.warn { color: var(--orange); background: linear-gradient(180deg, #fff6e8, #fff); }
.acol-h.bad { color: var(--red); background: linear-gradient(180deg, #fdeeee, #fff); }
.acol-h.star { color: var(--brand-ink); background: linear-gradient(180deg, var(--brand-weak), #fff); }
.acol-b { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.acol-empty { color: var(--muted); font-size: 12px; padding: 14px; text-align: center; }
.act { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.act:hover { background: #f6f8fb; }
.act .thumb { flex: none; border-radius: 9px; }
.act .ai { min-width: 0; flex: 1; }
.act .an { font-weight: 600; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act .am { font-size: 11px; color: var(--muted); margin: 1px 0; }
.act .am b { color: var(--ink2); }
.act .aa { font-size: 11.5px; color: var(--ink2); }
.act .aa b { font-weight: 700; }
.act .aa .pos { color: var(--green); }
.act.up .aa b { color: var(--green); }
.act.warn .aa b { color: var(--orange); }
.act.bad .aa b { color: var(--red); }

/* ——— Insights ——— */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 8px 22px 4px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .kv { font-size: 24px; font-weight: 700; letter-spacing: -.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi .kv .sm { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .kl { font-size: 12px; color: var(--ink2); margin-top: 2px; font-weight: 500; }
.kpi .ks { font-size: 11px; color: var(--muted); margin-top: 1px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 14px 22px 48px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card.wide { grid-column: 1 / -1; }
.card .ch { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 6px; flex-wrap: wrap; }
.card .ch h3 { font-size: 14px; }
@media (max-width: 940px) { .cards { grid-template-columns: 1fr; } }

table.mini { box-shadow: none; border-radius: 0; }
table.mini thead th { background: transparent; font-size: 11px; padding: 6px 12px; cursor: default; }
table.mini tbody td { padding: 7px 12px; }
table.mini tbody tr:hover { background: #fbfcff; }
.mini .prod { max-width: 340px; }

.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 16px 16px; }
.qb { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.qb.star { background: #f0f9f4; border-color: #cdeeda; }
.qb.flow { background: #eef4ff; border-color: #d3e0fb; }
.qb.pot { background: #fff8ea; border-color: #f3e2b8; }
.qb.watch { background: #fbf2f2; border-color: #f0d9d9; }
.qb .qt { font-weight: 700; font-size: 13px; }
.qb .qt .qn { float: right; background: rgba(0,0,0,.06); border-radius: 6px; padding: 0 7px; font-size: 12px; }
.qb .qd { font-size: 11px; color: var(--muted); margin: 1px 0 7px; }
.qb .qi { font-size: 11.5px; color: var(--ink2); display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.qb .qi span { color: var(--ink); font-variant-numeric: tabular-nums; }

.rank { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 16px 16px; }
.rankcol .rt { font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.rr { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.rr:last-child { border-bottom: 0; }
.rrk { width: 18px; color: var(--muted); text-align: center; }
.rrn { flex: 1; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrs { color: var(--ink); font-variant-numeric: tabular-nums; }

.chips-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 16px 16px; }
.elim-chip { display: inline-flex; align-items: center; gap: 6px; background: #fbf2f2; border: 1px solid #f0dada; border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 11.5px; color: #9a4040; }
.elim-chip .thumb { width: 22px; height: 22px; border-radius: 50%; }
.elim-chip i { color: var(--red); font-style: normal; font-size: 10px; }

/* ——— Detail drawer ——— */
.prod[data-sku], .qi[data-sku], .elim-chip[data-sku], .act[data-sku] { cursor: pointer; }
.qi[data-sku]:hover { text-decoration: underline; }
.ovl { position: fixed; inset: 0; background: rgba(20,25,35,.34); z-index: 60; display: none; }
.ovl.on { display: block; }
.ovl .drawer { position: absolute; top: 0; right: 0; height: 100%; width: min(560px, 94vw); background: var(--card); box-shadow: -8px 0 30px rgba(0,0,0,.14); display: flex; flex-direction: column; animation: slidein .18s ease; }
.ovl .drawer.sb { width: min(520px, 94vw); }
tr.sbrow { cursor: pointer; }
tr.sbrow:hover td { background: var(--brand-weak); }
/* 门店体检卡:可点的加指针+hover,纯统计保持平 */
.sc-t.clk { cursor: pointer; transition: .15s; }
.sc-t.clk:hover { background: var(--brand-weak); }
.sc-t.clk .sc-l::after { content: " →"; color: var(--brand); }
@keyframes slidein { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.dhead { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dhead .thumb { border-radius: 11px; }
.dh-i { flex: 1; min-width: 0; }
.dh-n { font-weight: 700; font-size: 15px; line-height: 1.35; }
.dh-m { font-size: 11px; color: var(--muted); margin-top: 3px; }
.dclose { cursor: pointer; color: var(--muted); font-size: 16px; padding: 4px 8px; border-radius: 8px; }
.dclose:hover { background: #f0f1f4; color: var(--ink); }
.dbody { overflow-y: auto; padding: 6px 18px 30px; }
.drange { padding: 14px 0; border-bottom: 1px solid var(--line); }
.drh { font-size: 13px; font-weight: 700; margin: 14px 0 10px; color: var(--brand-ink); }
.drh2 { font-size: 13px; font-weight: 700; margin: 18px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.dmini { font-size: 12px; color: var(--ink2); background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; }
.dmini b { color: var(--ink); }
table.storetbl { box-shadow: none; }
table.storetbl thead th { background: #fafbfc; font-size: 11px; padding: 7px 10px; cursor: default; }
table.storetbl tbody td { padding: 6px 10px; }
table.storetbl tbody tr.zero td { background: transparent; }
table.storetbl tbody tr.zero .snm { color: var(--muted); }
.snm { color: var(--ink2); }
.miniflag { font-size: 10px; padding: 0 6px; border-radius: 4px; margin-left: 6px; }
.miniflag.gray { background: #eef0f3; color: #8a9099; }
.miniflag.orange { background: var(--orange-bg); color: var(--orange); }
.miniflag.red { background: var(--red-bg); color: var(--red); }
.mobar { display: inline-block; width: 60px; height: 7px; border-radius: 4px; background: #eef0f3; overflow: hidden; margin-right: 8px; vertical-align: middle; }
.mobar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb088, var(--brand)); }
.dks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.dk { background: #fafbfc; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.dk span { font-size: 11px; color: var(--muted); display: block; }
.dk b { font-size: 15px; font-weight: 700; }
.dbars-h { font-size: 12px; color: var(--ink2); margin-bottom: 6px; font-weight: 600; }
.dbars { display: flex; flex-direction: column; gap: 3px; }
.dbars .sb .nm { width: 88px; }

/* —— 舒适度增强 —— */
html { scroll-behavior: smooth; }
::-webkit-scrollbar { height: 11px; width: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3d7de; border-radius: 7px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6bcc5; background-clip: content-box; }
.seg button { padding: 7px 14px; }
.kpi { transition: box-shadow .16s ease, transform .16s ease; }
.kpi:hover { box-shadow: 0 2px 6px rgba(20,25,35,.06), 0 12px 26px rgba(20,25,35,.09); transform: translateY(-1px); }
.acol, .card { transition: box-shadow .16s ease; }
.acol:hover, .card:hover { box-shadow: 0 2px 6px rgba(20,25,35,.05), 0 10px 26px rgba(20,25,35,.08); }
.tablewrap table { min-width: 700px; }
#rivalView .toolbar label { font-size: 12px; color: var(--ink2); }
#rivalView .kpis { padding-top: 6px; }
.pname { -webkit-line-clamp: 1; } /* 商品名单行更清爽,详情看全称 */

.loading { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,.75); backdrop-filter: blur(2px); font-size: 15px; color: var(--ink2); z-index: 50; }
.loading.on { display: flex; }
.loading::before { content: ""; width: 18px; height: 18px; margin-right: 10px; border: 2px solid var(--brand); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* —— 竞店对比控件（商品视角） —— */
.toolbar .cmpsel { display:inline-flex; align-items:center; gap:6px; font-size:13px; }
.toolbar .cmpsel select { max-width:240px; }
.toolbar .cmpchk { display:inline-flex; align-items:center; gap:5px; font-size:13px; color:var(--muted,#8a94a6); cursor:pointer; user-select:none; }
.toolbar .cmpchk input { margin:0; cursor:pointer; }
#rivalScope button { white-space:nowrap; }

/* —— 可点击 KPI 卡片（竞店数据） —— */
#rivalKpis .kpi.clk { cursor:pointer; transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
#rivalKpis .kpi.clk:hover { transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,.08); }
#rivalKpis .kpi.clk::after { content:"筛"; position:absolute; top:8px; right:10px; font-size:11px; color:var(--muted,#9aa4b2); opacity:.5; }
#rivalKpis .kpi.clk.on { border-color:#3b82f6; box-shadow:0 0 0 2px rgba(59,130,246,.25) inset; }
#rivalKpis .kpi.clk.on::after { content:"✓已选"; color:#3b82f6; opacity:1; }
#rivalKpis .kpi { position:relative; }

/* —— 舒适度优化 v2（行动看板/KPI 更透气、tone 色条更好扫读） —— */
.actionboard { gap: 14px; padding: 16px 22px 10px; }
.acol { border-radius: 16px; }
.acol-h { padding: 12px 15px; }
.acol-b { padding: 8px; gap: 5px; }
.act { padding: 9px 11px; gap: 11px; border-radius: 12px; }
.act .an { font-size: 13px; }
.act .am { margin: 2px 0; }
.act.up   { box-shadow: inset 3px 0 0 var(--green); }
.act.warn { box-shadow: inset 3px 0 0 var(--orange); }
.act.bad  { box-shadow: inset 3px 0 0 var(--red); }
.act.star { box-shadow: inset 3px 0 0 var(--brand); }
.act:hover { background: #f5f8fc; }
.kpis { gap: 14px; padding: 12px 22px 6px; }
.kpi { border-radius: 14px; padding: 15px 17px; }
.cards { gap: 18px; }
.subtabs { padding: 10px 22px 8px; gap: 8px; }

/* —— 品类搜索下拉（替代 385 项原生 select） —— */
.catpick { position: relative; display: inline-block; }
.catpick-btn { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 12px; color: var(--ink2); cursor: pointer; background: var(--card); transition: .15s; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catpick-btn:hover { border-color: #d8dbe0; color: var(--ink); }
.catpick-btn.active { background: var(--brand-weak); border-color: #f3cbb4; color: var(--brand-ink); font-weight: 600; }
.catpick.open .catpick-btn { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.catpick-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 320px; max-width: 86vw; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(20,25,35,.16); padding: 10px; }
.catpick-pop input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font-size: 13px; margin-bottom: 8px; }
.catpick-pop input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.catpick-list { max-height: 340px; overflow-y: auto; }
.cp-grp .cp-h { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 8px 3px; position: sticky; top: 0; background: var(--card); }
.cp-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 9px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink2); }
.cp-item:hover { background: #f4f6fa; }
.cp-item.on { background: var(--brand-weak); color: var(--brand-ink); font-weight: 600; }
.cp-item .cp-n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }

/* 子类概览:整行 + 限高滚动(修复"左空右长"的布局失衡) */
.miniscroll { max-height: 360px; overflow: auto; border-top: 1px solid var(--line); }
.miniscroll table.mini thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }

/* ==================== UI 精修 v3(暖调中性 · Sora 数字 · 更透气) ==================== */
:root {
  --bg: #f4f3f0; --card: #ffffff; --ink: #1a1713; --ink2: #57534c; --muted: #9d978c; --line: #ece8e2;
  --brand: #f2621d; --brand-weak: #fdefe6; --brand-ink: #c34c12;
  --blue: #3060e6; --blue-weak: #eef2fe;
  --red: #d83c42; --red-bg: #fceeee; --orange: #c1750a; --orange-bg: #fdf3e4; --green: #12805b; --green-bg: #e6f5ee;
  --shadow: 0 1px 2px rgba(28,22,14,.05), 0 10px 26px -10px rgba(28,22,14,.12);
  --radius: 16px;
}
body {
  font-family: "Sora", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(820px 460px at 85% -240px, #fff4ec 0%, rgba(255,244,236,0) 62%),
    radial-gradient(1000px 520px at 8% -180px, #fbfaf7 0%, var(--bg) 58%);
}

/* header */
.topbar { padding: 14px 24px; background: rgba(255,253,251,.8); }
.brand h1 { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.brand h1::before {
  content: ""; display: inline-block; width: 19px; height: 19px; border-radius: 6px; margin-right: 9px; vertical-align: -3px;
  background: linear-gradient(135deg, #ff9256, var(--brand)); box-shadow: 0 3px 8px rgba(242,98,29,.42);
}

/* segmented control */
.seg { background: #efece6; border-radius: 11px; }
.seg button.active { color: var(--brand-ink); font-weight: 700; box-shadow: 0 1px 4px rgba(28,22,14,.1); }

/* KPI cards */
.kpis { gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: linear-gradient(180deg, #fff, #fffdfb); }
.kpi .kv { font-size: 27px; font-weight: 800; letter-spacing: -.6px; }
.kpi .kl { font-size: 12px; color: var(--ink2); margin-top: 4px; font-weight: 600; }
.kpi .ks { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* action board */
.actionboard { gap: 14px; }
.acol { border: 1px solid var(--line); border-radius: 16px; }
.acol-h { padding: 13px 15px; font-weight: 800; letter-spacing: -.2px; font-size: 13px; }
.acol-h b { background: rgba(28,22,14,.06); font-weight: 700; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.acol-h.up { background: linear-gradient(180deg, #eefaf3, #fff); }
.acol-h.warn { background: linear-gradient(180deg, #fef6e8, #fff); }
.acol-h.bad { background: linear-gradient(180deg, #fdeeee, #fff); }
.acol-h.star { background: linear-gradient(180deg, var(--brand-weak), #fff); }
.act { padding: 9px 11px; border-radius: 12px; gap: 11px; }
.act:hover { background: #faf7f2; }
.act .an { font-size: 13px; font-weight: 600; }
.act.up { box-shadow: inset 3px 0 0 var(--green); }
.act.warn { box-shadow: inset 3px 0 0 var(--orange); }
.act.bad { box-shadow: inset 3px 0 0 var(--red); }
.act.star { box-shadow: inset 3px 0 0 var(--brand); }

/* cards + tables */
.cards { gap: 18px; }
.card { border: 1px solid var(--line); border-radius: 18px; }
.card .ch { padding: 16px 18px 8px; }
.card .ch h3 { font-size: 14.5px; font-weight: 800; letter-spacing: -.2px; }
table { border-radius: 16px; }
thead th { background: #faf9f6; font-size: 11px; letter-spacing: .02em; color: var(--muted); font-weight: 700; }
tbody tr.goods:hover { background: #fbf8f3; }

/* subtabs / chips accents */
.subtabs button.active { box-shadow: 0 3px 10px rgba(242,98,29,.3); }
.reason { border-radius: 7px; font-weight: 600; }

/* 详情抽屉:铺货分析 callout */
.danalysis { border-radius: 12px; padding: 12px 14px; margin: 14px 0 6px; border: 1px solid var(--line); background: #faf9f7; }
.danalysis .da-h { font-weight: 800; font-size: 13.5px; margin-bottom: 5px; letter-spacing: -.2px; }
.danalysis .da-b { font-size: 12.5px; color: var(--ink2); line-height: 1.62; }
.danalysis .da-b b { color: var(--ink); font-weight: 700; }
.danalysis.warn { background: var(--orange-bg); border-color: #f2e2bd; } .danalysis.warn .da-h { color: var(--orange); }
.danalysis.bad { background: var(--red-bg); border-color: #f2d3d3; } .danalysis.bad .da-h { color: var(--red); }
.danalysis.up { background: var(--green-bg); border-color: #c7e9d8; } .danalysis.up .da-h { color: var(--green); }
.danalysis.ok { background: #eef6f1; border-color: #d3eade; } .danalysis.ok .da-h { color: var(--green); }

/* 数据新鲜度 */
.fresh { font-weight: 700; font-size: 12px; padding: 1px 8px; border-radius: 999px; }
.fresh.ok { color: var(--green); background: var(--green-bg); }
.fresh.stale { color: var(--red); background: var(--red-bg); }
.fresh:not(.ok):not(.stale) { color: var(--orange); background: var(--orange-bg); }

/* 走势迷你图 */
.spark { display: block; margin: 4px 0 8px; border-radius: 8px; }
/* 趋势图(日/周/月 + 区间 + 数值) */
.trendbox { margin: 4px 0 10px; }
.trend-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tseg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tctl { border: 0; background: var(--card); color: var(--muted); font-size: 12px; padding: 4px 11px; cursor: pointer; border-right: 1px solid var(--line); }
.tseg .tctl:last-child { border-right: 0; }
.tctl:hover { background: var(--brand-weak); }
.tctl.on { background: var(--brand); color: #fff; font-weight: 600; }
.trend-stat { font-size: 12px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.b-brand { color: var(--brand); }
/* 流量漏斗 */
.funnel { display: flex; align-items: stretch; gap: 6px; margin: 8px 0 4px; }
.fn-step { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; text-align: center; }
.fn-v { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.fn-l { font-size: 11px; color: var(--muted); margin-top: 1px; }
.fn-r { font-size: 11px; font-weight: 700; color: var(--brand); margin-top: 3px; }
.fn-ar { align-self: center; color: var(--muted); font-size: 14px; }
.trendsvg { display: block; border: 1px solid var(--line); border-radius: 8px; background: #fffdfb; }

/* ===== 执行闭环:导出按钮 · 待办 · toast ===== */
.ghost.sm { padding: 5px 11px; font-size: 12px; }
.tbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }

/* 详情抽屉:加入待办 */
.todobar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
.tbtn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--ink2); cursor: pointer; transition: .14s; }
.tbtn:hover { border-color: #d8dbe0; transform: translateY(-1px); }
.tbtn.up:hover { border-color: #bfe6cf; color: var(--green); } .tbtn.bad:hover { border-color: #f0cfcf; color: var(--red); }
.tbtn.warn:hover, .tbtn.orange:hover { border-color: #f0dcae; color: var(--orange); } .tbtn.star:hover { border-color: #f3cbb4; color: var(--brand-ink); }
.tbtn.added { background: var(--green-bg); border-color: #bfe6cf; color: var(--green); cursor: default; }

/* 待办视图 */
#todoView { padding: 4px 22px 60px; }
.todogrp { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.todogrp-h { padding: 11px 16px; font-weight: 800; font-size: 13.5px; border-bottom: 1px solid var(--line); background: var(--raised, #faf9f7); }
.todogrp-h b { margin-left: 8px; background: rgba(28,22,14,.06); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.todogrp-h.up { color: var(--green); } .todogrp-h.bad { color: var(--red); } .todogrp-h.warn, .todogrp-h.orange { color: var(--orange); } .todogrp-h.star { color: var(--brand-ink); }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line2, #f0f1f4); }
.todo:last-child { border-bottom: 0; }
.todo .tck { width: 17px; height: 17px; cursor: pointer; flex: none; accent-color: var(--green); }
.todo .ti { flex: 1; min-width: 0; cursor: pointer; }
.todo .tn { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo .ti:hover .tn { color: var(--brand-ink); text-decoration: underline; }
.todo .tm { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo .tdel { color: var(--muted); cursor: pointer; padding: 2px 7px; border-radius: 7px; font-size: 13px; }
.todo .tdel:hover { background: var(--red-bg); color: var(--red); }
.todo.done .tn { text-decoration: line-through; color: var(--muted); font-weight: 400; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(14px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: .2s; z-index: 90; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 门店体检卡 */
.scorecard { padding: 6px 22px 2px; }
.sc-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 820px) { .sc-tiles { grid-template-columns: repeat(2, 1fr); } }
.sc-t { background: linear-gradient(180deg, #fff, #fffdfb); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; box-shadow: var(--shadow); }
.sc-v { font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.sc-v .sm { font-size: 14px; color: var(--muted); font-weight: 600; }
.sc-l { font-size: 12px; color: var(--ink2); margin-top: 3px; font-weight: 600; }
.sc-s { font-size: 11px; color: var(--muted); margin-top: 1px; }
.sc-diag { margin: 12px 0 4px; padding: 12px 15px; background: var(--brand-weak); border: 1px solid #f3d8c4; border-radius: 12px; font-size: 13px; color: var(--ink2); line-height: 1.6; }
.sc-diag b { color: var(--brand-ink); font-weight: 700; }

/* 行动看板列头可点"查看全部" */
.acol-h.clk { cursor: pointer; }
.acol-h.clk:hover { filter: brightness(.98); }
.acol-h .seeall { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 6px; opacity: 0; transition: .15s; }
.acol-h.clk:hover .seeall { opacity: 1; color: var(--brand-ink); }

/* 顺手度巡检:可下钻的 KPI/子类行/门店名 */
.kpi.clk { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.kpi.clk:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #e3d6c9; }
.kpi .seeall { font-style: normal; font-size: 11px; color: var(--muted); opacity: 0; transition: .15s; }
.kpi.clk:hover .seeall { opacity: 1; color: var(--brand-ink); }
.subtable tr.clk { cursor: pointer; }
.subtable tr.clk:hover { background: var(--brand-weak); }
.rr.clk { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding-left: 6px; padding-right: 6px; transition: background .12s; }
.rr.clk:hover { background: var(--brand-weak); }
.rr.clk:hover .rrn { color: var(--brand-ink); }

/* 品类下拉:大类标题可点选整类 */
.cp-h.clk { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: 7px; transition: background .12s; }
.cp-h.clk:hover { background: var(--brand-weak); color: var(--brand-ink); }
.cp-h.clk.on { background: var(--brand); color: #fff; }
.cp-h .cp-n { font-weight: 700; font-size: 10.5px; color: var(--brand-ink); }
.cp-h.clk:hover .cp-n { color: var(--brand-ink); }
.cp-h.clk.on .cp-n { color: rgba(255,255,255,.9); }

/* 淘汰品标签(牵牛花手动标,区别于算法"30天0销") */
.tag.tuida { background: #f0e7fb; color: #6a3cc0; }
.tag.fresh { background: #fff3e0; color: #b45309; }   /* 各店在售价:快照之后折扣工作台/派单刚改过的 */
.pc-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; padding: 6px 0 2px; }
.pc-row input { width: 80px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }
.pc-row select { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.pcbtn { border: 1px solid #b45309; color: #b45309; background: #fff7ed; border-radius: 999px; padding: 3px 12px; font-size: 12px; cursor: pointer; }
.pcbtn:disabled { opacity: .5; cursor: default; }

/* 归因下拉(替代一排chip) */
.reasonbar .catsel-wrap { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.reasonbar .catsel { margin: 0; }

/* 行动看板列自适应(容纳"缺货丢钱"第6列) */
.actionboard { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 1200px) { .actionboard { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .actionboard { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .actionboard { grid-template-columns: 1fr; } }

/* 类目价格带对比明细行(哆宜佳 vs 鲸GO) */
:root { --duo-ink: #b45f0d; --jingo-ink2: #0a726a; }
tr.catrow { cursor: pointer; }
tr.catrow:hover { background: var(--brand-weak); }
tr.catdetail > td { background: #fbfaf7; padding: 12px 16px; }
.cd { display: flex; flex-direction: column; gap: 7px; }
.cd-row { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.cd-t { display: inline-block; min-width: 52px; font-weight: 700; }
.cd-tier { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.cd-flags { font-size: 12.5px; color: var(--ink2); padding-top: 4px; border-top: 1px dashed var(--line); }
.cd-flags.muted { color: var(--muted); }

/* 神价视图 */
.dealh { font-size: 14px; font-weight: 700; margin: 18px 2px 8px; display: flex; align-items: baseline; gap: 8px; }
.dealh .muted { font-size: 12px; font-weight: 400; }
.dealh.bleed { color: var(--red); }
.dealh.hot { color: var(--brand-ink); }
table.dealtable { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dealtable th { text-align: right; padding: 7px 10px; color: var(--muted); font-weight: 600; font-size: 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.dealtable th.left, table.dealtable td.left { text-align: left; }
table.dealtable td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.dealrow { cursor: pointer; }
tr.dealrow:hover { background: var(--brand-weak); }

/* 采集健康红条 */
.healthbar { padding: 10px 22px; font-size: 13px; line-height: 1.5; border-bottom: 1px solid var(--line); }
.healthbar b { font-weight: 700; }
.healthbar.bad { background: var(--red-bg); color: var(--red); border-bottom-color: color-mix(in srgb, var(--red) 30%, transparent); }
.healthbar.warn { background: var(--orange-bg); color: var(--orange); border-bottom-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.healthbar.info { background: var(--blue-weak); color: var(--blue); border-bottom-color: color-mix(in srgb, var(--blue) 30%, transparent); }

/* 商品等级徽标 S/A/B/C/D */
.grade { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 6px; font-weight: 800; font-size: 12px; text-align: center; color: #fff; font-variant-numeric: tabular-nums; }
.grade.g-S { background: #7c3aed; }  /* 紫 · 顶级 */
.grade.g-A { background: #e5484d; }  /* 红 */
.grade.g-B { background: #ea8f27; }  /* 橙 */
.grade.g-C { background: #2563eb; }  /* 蓝 */
.grade.g-D { background: #94a3b8; }  /* 灰 · 尾部 */

/* 涨跌汇总:涨幅/跌幅并排 */
.mover-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .mover-grid { grid-template-columns: 1fr; } }
#moverProds { margin-top: 8px; }

/* 神价上/下架审核 */
.rvcell { white-space: nowrap; }
.rvb { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 3px 9px; margin-right: 4px; cursor: pointer; font-size: 11.5px; color: var(--ink2); transition: .12s; }
.rvb:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-weak); }
.rvb.up:hover { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.rvb.ok { border-color: #a9dcc2; color: var(--green); background: var(--green-bg); font-weight: 600; }
.rvb.no { border-color: #f3c6c6; color: var(--red); background: var(--red-bg); }
.rvbadge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; margin-right: 6px; }
.rvbadge.wait { background: var(--orange-bg); color: var(--orange); }
.rvbadge.done.bad { background: var(--red-bg); color: var(--red); }
.rvbadge.done.up { background: var(--green-bg); color: var(--green); }

/* 神价 KPI 卡可点(点看贴钱/爆量) */
.kpi.clk { cursor: pointer; transition: .15s; }
.kpi.clk:hover { background: var(--brand-weak); border-color: var(--brand); }
.kpi.clk.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-weak); }
.kpi .kpi-arrow { color: var(--brand); font-weight: 700; }

/* 新品标签 */
.tag.newp { background: #eaf6ff; color: #0a6ebd; font-weight: 600; }

/* 中心仓待补(缺勤)标签 */
.tag.short { background: var(--red-bg); color: var(--red); font-weight: 600; }

/* 真神价标签(美团闪购神价活动) */
.tag.deal { background: #fff0e8; color: #d9480f; font-weight: 700; }

/* ==== 今日待处理(概览重设计:清晰分组清单)==== */
.today { padding: 6px 22px 10px; }
.today-h { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 14px; }
.today-h h2 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .tgrid { grid-template-columns: 1fr; } }
.tgrp { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.tgrp.bad { border-top: 3px solid var(--red); }
.tgrp.warn { border-top: 3px solid var(--orange); }
.tgrp.up { border-top: 3px solid var(--green); }
.tgrp.new { border-top: 3px solid #0a6ebd; }
.tgrp-h { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fbfbfc; }
.tgrp-h.clk { cursor: pointer; }
.tgrp-h.clk:hover { background: var(--brand-weak); }
.tgrp-t { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.tgrp-t .tgrp-n { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.tgrp-sum { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tgrp-h .seeall { color: var(--brand); font-size: 12px; font-weight: 600; margin-left: 8px; white-space: nowrap; }
.trow { display: grid; grid-template-columns: 34px minmax(0,1fr) auto auto auto; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: #fbfcff; }
.trow-n { font-weight: 600; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-m { font-size: 12px; color: var(--ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trow-r { white-space: nowrap; text-align: right; }
.impact { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.impact.bad { color: var(--red); }
.impact.good { color: var(--green); }
.impact.muted { color: var(--muted); font-weight: 500; }
.rtag { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.rtag.bad { background: var(--red-bg); color: var(--red); }
.rtag.warn { background: var(--orange-bg); color: var(--orange); }
.rtag.muted { background: #eef0f3; color: var(--muted); }
.trow-todo { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 3px 9px; font-size: 11px; color: var(--ink2); cursor: pointer; white-space: nowrap; transition: .12s; }
.trow-todo:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-weak); }
.trow-todo.added { border-color: #a9dcc2; color: var(--green); background: var(--green-bg); }
.tgrp-empty { padding: 16px; color: var(--muted); font-size: 12.5px; }

/* ———— 登录 / 账号 ———— */
.loginovl { position: fixed; inset: 0; z-index: 80; background: rgba(28,24,20,.42); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; }
.loginovl[hidden] { display: none; }
.loginbox { width: min(360px, 92vw); background: var(--card); border-radius: 16px; padding: 26px 26px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.22); display: flex; flex-direction: column; gap: 12px; }
.lb-brand { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.lb-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 4px; }
.loginbox label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink2); }
.loginbox select, .loginbox input { font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.loginbox select:focus, .loginbox input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.lb-err { font-size: 12px; color: #c0392b; background: #fcecea; border-radius: 8px; padding: 7px 10px; }
.lb-btn { margin-top: 4px; font: inherit; font-weight: 700; font-size: 14px; padding: 10px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer; }
.lb-btn:hover { filter: brightness(1.05); }
.userchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 12px; color: var(--ink2); cursor: pointer; }
.userchip:hover { border-color: var(--brand); color: var(--brand-ink); }
.uc-av { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.acct { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.acct h3 { margin: 0; font-size: 15px; }
.acct .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.acct input, .acct select { font: inherit; font-size: 13px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.acct table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acct th, .acct td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.acct .tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; background: var(--brand-weak); color: var(--brand-ink); }
.todo .tby { color: var(--muted); font-size: 11px; }

/* ———— 抽屉复制 / 品类多选 / 神价 KPI 可点 ———— */
.dh-n.sel { user-select: text; cursor: text; }
.dh-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.dcopy { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 2px 9px; font-size: 11px; color: var(--ink2); cursor: pointer; }
.dcopy:hover { border-color: var(--brand); color: var(--brand-ink); }
.dh-deal { font-size: 11px; color: #c0392b; background: #fcecea; border-radius: 999px; padding: 2px 9px; }
.cp-ck { margin: 0 6px 0 0; cursor: pointer; accent-color: var(--brand); }
.cp-foot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 12px; }
.cp-foot span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.clk { cursor: pointer; }
.kpi.clk.on { outline: 2px solid var(--brand); }
.nm-btn { margin-left: 6px; border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 0 7px; font-size: 10px; color: var(--muted); cursor: pointer; }
.nm-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.nm-btn[disabled] { opacity: .5; cursor: default; }
/* ———— 单品一句话诊断 ———— */
.danalysis.diag { border-width: 2px; }
.dg-head { font-size: 14px; font-weight: 700; line-height: 1.45; margin: 4px 0 2px; }
.dg-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.dg-acts { display: flex; flex-direction: column; gap: 5px; }
.dg-act { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: rgba(255,255,255,.55); border-radius: 8px; padding: 5px 8px; }
.dg-n { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dg-t { flex: 1; min-width: 0; line-height: 1.4; }
.dg-act .tbtn { flex: none; }

/* ———— 大类销量排行与详情(左排行 · 右走势+大数) ———— */
.rp-grid { display: grid; grid-template-columns: minmax(360px, 420px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .rp-grid { grid-template-columns: 1fr; } }
.rp-left { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rp-lh, .rp-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 64px 58px 50px 64px; align-items: center; gap: 8px; padding: 6px 12px; }
.rp-lh { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 70%, var(--bg)); letter-spacing: .02em; }
.rp-list { max-height: 560px; overflow: auto; }
.rp-row { cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; transition: background .12s; }
.rp-row:hover { background: var(--brand-weak); }
.rp-row.on { background: var(--brand); color: #fff; }
.rp-row.on .rp-mom, .rp-row.on .rp-rk, .rp-row.on .rp-v { color: #fff; }
.rp-row.all { font-weight: 700; }
.rp-row.all:not(.on) { background: color-mix(in srgb, var(--brand-weak) 60%, var(--card)); }
.rp-row.on, .rp-row.all.on { background: var(--brand); color: #fff; }
.rp-rk { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.rp-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rp-bar { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.rp-bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.rp-bar i.up { background: var(--red); } .rp-bar i.dn { background: var(--green); } .rp-bar i.flat { background: var(--muted); }
.rp-row.on .rp-bar { background: rgba(255,255,255,.35); } .rp-row.on .rp-bar i { background: #fff; }
.rp-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-mom { font-size: 12px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-mom.up { color: var(--red); } .rp-mom.dn { color: var(--green); } .rp-mom.flat { color: var(--muted); }
.rp-sp { height: 22px; overflow: hidden; } .rp-sp svg { height: 22px; width: 100%; display: block; }
.rp-right { min-width: 0; }
.rp-title { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 8px; }
.rp-title h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.rp-right .kpis { padding: 10px 0 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ———— 概览:品类运营总览(面包屑 + 统计条 + 走势/KPI + 下钻表) ———— */
.today.ov { padding-bottom: 6px; }
.ov-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 12px; }
.ov-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ov-title h2 { font-size: 18px; font-weight: 800; margin: 0; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.crumbs i { color: var(--muted); font-style: normal; }
.crumb { padding: 3px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink2); }
.crumb.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.crumb.clk { cursor: pointer; } .crumb.clk:hover { border-color: var(--brand); color: var(--brand-ink); }
.crumb.muted { background: transparent; border-style: dashed; }
.ov-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.ov-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; min-width: 96px; }
.ov-stat .v { display: block; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; line-height: 1.1; }
.ov-stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.ov-stat .l { font-size: 11.5px; color: var(--muted); }
.ov-stat .arr { font-style: normal; font-size: 14px; margin-left: 2px; }
.ov-mid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; margin-bottom: 12px; }
@media (max-width: 1100px) { .ov-mid { grid-template-columns: 1fr; } }
.ov-chart { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 8px; min-width: 0; }
.ov-kpis { display: flex; flex-direction: column; gap: 10px; }
.ov-kpi { padding: 12px 14px; }
.ov-kpi .kv { font-size: 22px; }
.ov-tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ov-table th { font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 70%, var(--bg)); white-space: nowrap; }
.ov-table th.left, .ov-table td.left { text-align: left; }
.ov-table td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-table td.left { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.ov-table tr.clk { cursor: pointer; } .ov-table tr.clk:hover { background: var(--brand-weak); }
.ov-bar { display: inline-block; width: 60px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.ov-bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.ov-more { text-align: center; padding: 9px; font-size: 12.5px; color: var(--brand-ink); border-top: 1px solid var(--line); cursor: pointer; }
.ov-more:hover { background: var(--brand-weak); }
/* 今日待处理:标签页 + 行 + 底栏 */
.tt-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.ttab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--ink2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.ttab b { font-size: 12px; background: color-mix(in srgb, var(--line) 60%, transparent); border-radius: 999px; padding: 0 7px; }
.ttab:hover { border-color: var(--brand); }
.ttab.on { background: var(--brand); color: #fff; border-color: var(--brand); } .ttab.on b { background: rgba(255,255,255,.25); }
.tt-list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tt-row { display: grid; grid-template-columns: 18px 40px minmax(0, 1fr) 150px 92px; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tt-row:last-child { border-bottom: 0; }
.tt-row:hover { background: var(--brand-weak); }
.tt-row.sel { background: color-mix(in srgb, var(--brand-weak) 70%, var(--card)); }
.tt-row .tsel { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.tt-main { min-width: 0; }
.tt-n { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-m { font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-r { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-row .tbtn { justify-self: end; }
.tt-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 6px 2px; font-size: 12.5px; }
.tt-foot .tt-sum { margin-left: auto; color: var(--ink2); }
.tt-foot label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.tt-foot .tselall { accent-color: var(--brand); }
@media (max-width: 760px) { .tt-row { grid-template-columns: 18px 40px minmax(0, 1fr) 92px; } .tt-row .tt-r { display: none; } }

/* ———— 总览:视觉收紧(头部一张卡、走势与 KPI 等高、表格固定列宽) ———— */
.ov-strip { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--card)), var(--card) 55%); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; margin: 4px 0 12px; }
.ov-title { flex-direction: column; align-items: flex-start; gap: 8px; }
.ov-h { display: flex; align-items: baseline; gap: 12px; }
.ov-title h2 { font-size: 20px; }
.ov-stats { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ov-stat { border: 0; border-radius: 0; min-width: 118px; padding: 8px 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ov-stat:first-child { border-left: 0; }
.ov-stat .l { order: 0; font-size: 11.5px; color: var(--muted); }
.ov-stat .v { order: 1; font-size: 21px; }
.ov-stat .v small { font-size: 12px; margin-left: 2px; }
.ov-mid { grid-template-columns: minmax(0, 1fr) 320px; align-items: stretch; }
.ov-chart { display: flex; flex-direction: column; }
.ov-chart #ownerTrendHost { flex: 1; min-height: 0; }
.ov-chart .trendsvg { max-height: 250px; }
.ov-kpis { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; }
.ov-kpi { display: flex; flex-direction: column; justify-content: center; padding: 12px 14px; }
.ov-kpi .kv { font-size: 21px; }
.ov-kpi .ks { line-height: 1.4; }
.ov-table { table-layout: fixed; }
.ov-table td.left { max-width: none; }
.ov-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg) 55%, var(--card)); }
.ov-table tbody tr.clk:hover { background: var(--brand-weak); }
.ov-table td:first-child { color: var(--muted); font-size: 12px; }
.ov-table tbody tr:nth-child(-n+3) td:first-child { color: var(--brand); font-weight: 800; }
.ov-bar { width: 56px; }
@media (max-width: 1100px) { .ov-kpis { grid-template-columns: repeat(4, 1fr); } }

/* ==================== UI v4 · shadcn/ui 视觉规范移植(中性灰底 · 1px 细边 · 10px 圆角 · 克制阴影 · Inter) ==================== */
/* 来源:shadcn-ui/ui apps/v4 globals.css 的 :root 令牌(oklch 换算)+ card/table/badge/button/tabs 组件类。品牌橙只做主色点缀,其余全部中性。 */
:root {
  --bg: #fafafa; --card: #ffffff; --ink: #0a0a0a; --ink2: #404040; --muted: #737373; --line: #e5e5e5;
  --muted-bg: #f5f5f5; --accent: #f5f5f5; --ring: #a3a3a3;
  --brand: #ea580c; --brand-weak: #fff7ed; --brand-ink: #c2410c;
  --blue: #2563eb; --blue-weak: #eff6ff;
  --red: #dc2626; --red-bg: #fef2f2; --orange: #d97706; --orange-bg: #fffbeb; --green: #16a34a; --green-bg: #f0fdf4;
  --shadow: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-md: 0 1px 3px 0 rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.08);
  --radius: 10px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-xl: 14px;
}
body { font-family: "Inter", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 13.5px; letter-spacing: 0; }
h1, h2, h3 { letter-spacing: -.01em; }
/* 顶栏:白底细线,不做毛玻璃 */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 24px; backdrop-filter: none; }
.brand h1::before { background: var(--ink); box-shadow: none; width: 16px; height: 16px; border-radius: 4px; }
/* 分段控件 = shadcn Tabs(list bg-muted p-[3px] rounded-lg;active bg-background shadow-sm) */
.seg { background: var(--muted-bg); border-radius: var(--radius-md); padding: 3px; }
.seg button { border-radius: var(--radius-sm); padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.active, .seg.sm button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.seg-lbl { color: var(--muted); opacity: .7; }
/* 按钮 = shadcn Button(outline / default) */
.ghost, .catpick-btn, .userchip, .catsel, .toolbar select, .toolbar input[type=search], .dcopy, .nm-btn, .tbtn {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-md); box-shadow: 0 1px 2px rgba(0,0,0,.04); color: var(--ink); font-weight: 500; transition: background .12s, border-color .12s;
}
.ghost:hover, .catpick-btn:hover, .userchip:hover, .catsel:hover, .dcopy:hover, .nm-btn:hover { background: var(--accent); border-color: var(--line); color: var(--ink); }
.ghost { padding: 6px 12px; font-size: 13px; height: 32px; }
.ghost.sm { height: 28px; padding: 3px 10px; font-size: 12.5px; }
.catpick-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.uc-av { background: var(--ink); }
.lb-btn { background: var(--ink); border-radius: var(--radius-md); }
.subtabs button { border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--card); color: var(--ink2); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.subtabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.reasonbar button { border-radius: var(--radius-md); }
.reasonbar button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
/* 卡片 = shadcn Card(rounded-xl border bg-card shadow-sm) */
.kpi, .card, .tgrp, .ov-strip, .ov-chart, .ov-tablewrap, .tt-list, .rp-left, .loginbox, .bigcard, .danalysis, .tile, .scorecard, .tablewrap {
  border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); background: var(--card);
}
.ov-strip { background: var(--card); padding: 16px 20px; }
.kpi, .ov-kpi { padding: 16px 18px; background: var(--card); }
.kpi .kv { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.kpi .kl { font-size: 13px; color: var(--ink2); font-weight: 500; margin-top: 4px; }
.kpi .ks { font-size: 12px; color: var(--muted); }
.kpi.clk.on { outline: 2px solid var(--ink); outline-offset: -1px; }
.ov-stats { border-radius: var(--radius-lg); box-shadow: none; }
.ov-stat .v { font-weight: 700; }
.today-h h2, .ov-title h2, .rp-title h3 { font-weight: 600; letter-spacing: -.01em; }
/* 表格 = shadcn Table(header font-medium, rows border-b, hover bg-muted/50, 无斑马) */
table thead th, .ov-table th, .dealtable th, #goodsTable thead th, #rivalTable thead th, .storetbl th, table.mini th { background: var(--card); color: var(--muted); font-weight: 500; font-size: 12.5px; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--line); height: 38px; }
.ov-table tbody tr:nth-child(even) { background: transparent; }
.ov-table tbody tr.clk:hover, #goodsTable tbody tr:hover, #rivalTable tbody tr:hover, .dealtable tbody tr:hover, .tt-row:hover, .rp-row:hover { background: var(--muted-bg); }
.ov-table tbody tr:nth-child(-n+3) td:first-child { color: var(--ink); }
.ov-bar i, .rp-bar i, .mobar i, .covbar i { background: var(--ink); }
.rp-bar i.up { background: var(--red); } .rp-bar i.dn { background: var(--green); }
/* 徽标 = shadcn Badge(rounded-full border px-2 py-0.5 text-xs font-medium) */
.reason, .rvbadge, .miniflag, .dh-deal { border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 500; border: 1px solid transparent; }
.reason { background: var(--muted-bg); color: var(--ink2); border-color: var(--line); }
.reason.b-red { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.reason.b-orange { background: var(--orange-bg); color: var(--orange); border-color: #fde68a; }
.reason.b-green { background: var(--green-bg); color: var(--green); border-color: #bbf7d0; }
.reason.b-blue { background: var(--blue-weak); color: var(--blue); border-color: #bfdbfe; }
/* 今日待处理 标签 / 行 */
.ttab { border-radius: var(--radius-md); background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.04); font-weight: 500; }
.ttab.on { background: var(--ink); border-color: var(--ink); }
.ttab b { background: var(--muted-bg); color: var(--ink2); font-weight: 600; } .ttab.on b { background: rgba(255,255,255,.18); color: #fff; }
.tt-row.sel { background: var(--muted-bg); }
.tt-row .tsel, .tt-foot .tselall, .cp-ck { accent-color: var(--ink); }
/* 排行面板 / 面包屑 / 大类卡 */
.rp-row.on, .rp-row.all.on { background: var(--ink); }
.crumb.on { background: var(--ink); border-color: var(--ink); }
.bigcard.on { outline: 2px solid var(--ink); }
/* 健康条 = Alert */
.healthbar { border-radius: var(--radius-lg); margin: 8px 24px 0; border: 1px solid var(--line); font-size: 13px; }
/* 抽屉 = Sheet */
.ovl { background: rgba(0,0,0,.5); }
.ovl .drawer { box-shadow: -8px 0 30px rgba(0,0,0,.12); border-left: 1px solid var(--line); }
.dhead { border-bottom: 1px solid var(--line); }
.danalysis { border-radius: var(--radius-lg); }
.danalysis.ok { background: var(--green-bg); border-color: #bbf7d0; } .danalysis.warn { background: var(--orange-bg); border-color: #fde68a; } .danalysis.bad { background: var(--red-bg); border-color: #fecaca; }
.dg-n { background: var(--ink); }
.dg-act { background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.05); }
/* 待办动作按钮 */
.tbtn { background: var(--card); color: var(--ink); }
.tbtn:hover { background: var(--accent); }
.tbtn.added { background: var(--green-bg); color: var(--green); border-color: #bbf7d0; }
/* 品类筛选面板 / 登录框 */
.catpick-pop { border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md), 0 10px 30px -10px rgba(0,0,0,.15); }
.cp-item.on, .cp-h.on { background: var(--muted-bg); color: var(--ink); }
.loginovl { background: rgba(0,0,0,.45); backdrop-filter: none; }
.loginbox { border-radius: var(--radius-xl); box-shadow: var(--shadow-md), 0 20px 50px -20px rgba(0,0,0,.25); }
.loginbox select, .loginbox input { border-radius: var(--radius-md); background: var(--card); }
/* 输入框聚焦 = ring */
.toolbar input[type=search]:focus, .toolbar select:focus, .catsel:focus, .loginbox select:focus, .loginbox input:focus, .catpick-pop input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(163,163,163,.35); }
/* 走势图底 */
.trendsvg { background: var(--card); border-radius: var(--radius-md); }

/* ==================== UI v4.1 · 细节收拾(采集口径条 / 结构页标签 / 表头吸顶 / 门店体检卡 / 提示层) ==================== */
/* 采集口径条:从一长串灰字改成一排小 chip */
.meta { padding: 10px 24px 2px; gap: 8px; align-items: center; }
.meta .mchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.meta .mchip b { color: var(--ink); font-weight: 600; }
.meta .mchip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.meta .mchip.stale .dot { background: var(--orange); } .meta .mchip.old .dot { background: var(--red); }
/* 结构/定价 子标签 = shadcn Tabs line 变体(下划线) */
.subtabs.strat { gap: 2px; padding: 4px 24px 0; border-bottom: 1px solid var(--line); margin: 0 0 6px; }
.subtabs.strat button { border: 0; background: transparent; border-radius: 0; box-shadow: none; padding: 9px 12px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtabs.strat button:hover { color: var(--ink); background: transparent; }
.subtabs.strat button.active { background: transparent; color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
/* 页面横向节奏统一 24px */
.subtabs, .toolbar, .cards, .storecols, .kpis, .today, .tablewrap { padding-left: 24px; padding-right: 24px; }
.tablewrap { padding-top: 2px; }
/* 表头吸顶(长表往下翻还能看到列名);顶栏高度约 96px 两行时也不遮 */
.tablewrap thead th { position: sticky; top: 0; z-index: 2; }
/* 表格外框:去掉 table 自身圆角阴影,由 .tablewrap 承担 */
.tablewrap table { border-radius: 0; box-shadow: none; border: 0; min-width: 0; }
.tablewrap { overflow: auto; padding-bottom: 40px; }
.tablewrap > table { margin: 0; }
/* 卡片标题行 */
.card .ch { padding: 14px 16px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.card .ch h3 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.card .ch .muted { font-size: 12px; }
/* 四象限盒子:中性底,只留左侧 3px 语义色条 */
.qb { border-radius: var(--radius-lg); background: var(--card); border: 1px solid var(--line); border-left-width: 3px; }
.qb.star { border-left-color: var(--green); } .qb.flow { border-left-color: var(--blue); } .qb.pot { border-left-color: var(--orange); } .qb.watch { border-left-color: var(--red); }
.qb .qt .qn { background: var(--muted-bg); border-radius: 999px; }
/* 门店体检卡 */
.sc-t { background: var(--card); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.sc-v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sc-l { font-weight: 500; }
.sc-diag { background: var(--muted-bg); border-color: var(--line); border-radius: var(--radius-lg); color: var(--ink2); }
.sc-diag b { color: var(--ink); }
.rr.clk:hover { background: var(--muted-bg); } .rr.clk:hover .rrn { color: var(--ink); }
/* 等级色块:小一点的方标 */
.grade { border-radius: 6px; font-weight: 700; font-size: 11.5px; min-width: 22px; padding: 1px 6px; }
/* 提示层 */
#toast { border-radius: var(--radius-md); font-size: 13px; box-shadow: var(--shadow-md); }
.loading { background: rgba(255,255,255,.7); backdrop-filter: none; font-size: 13px; color: var(--ink2); }
.loading::before { border-color: var(--ink); border-top-color: transparent; }
/* 待办徽标(顶栏"待办 N") */
.tbadge { background: var(--ink); color: #fff; border-radius: 999px; }
/* 抽屉里各块标题 */
.drh, .drh2 { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 14px; }
.dks .dk { border-radius: var(--radius-md); background: var(--muted-bg); }
/* 排行面板/总览面包屑小字 */
.rp-lh, .ov-table th { text-transform: none; }
/* 焦点态统一(键盘可见) */
button:focus-visible, .seg button:focus-visible, .ttab:focus-visible, .ghost:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ==================== UI v5 · 加回品牌橙(照用户给的效果图):概览顶部橙色色带 + 白卡浮在上面,选中态回橙,表头橙底白字,主动作橙按钮 ==================== */
:root { --brand: #ff6a2c; --brand-2: #ff8f4d; --brand-weak: #fff1e8; --brand-ink: #d8531a; --bg: #fff8f3; }
body { background: var(--bg); }
/* 概览页:顶部一整块橙色渐变带(顶栏下方到总览统计条),白卡浮在上面 */
body[data-view="insight"] #healthBar, body[data-view="insight"] #meta, body[data-view="insight"] #subtabs { position: relative; z-index: 1; }
body[data-view="insight"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 640px; background: linear-gradient(160deg, #ff6a2c 0%, #ff8f4d 55%, #ffb27f 100%); z-index: 0; pointer-events: none; }
body[data-view="insight"] .topbar { background: rgba(255,255,255,.92); position: sticky; z-index: 30; }
body[data-view="insight"] #insightView { position: relative; z-index: 1; }
body[data-view="insight"] .meta .mchip { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.85); backdrop-filter: blur(4px); }
body[data-view="insight"] .meta .mchip b { color: #fff; } body[data-view="insight"] .meta .mchip .b-red { color: #fff; text-decoration: underline; }
body[data-view="insight"] .subtabs button, body[data-view="insight"] .catpick-btn { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); color: #fff; box-shadow: none; }
body[data-view="insight"] .subtabs button.active, body[data-view="insight"] .catpick-btn.active { background: #fff; color: var(--brand-ink); border-color: #fff; }
body[data-view="insight"] .healthbar { position: relative; }
/* 总览头:标题放白色圆角块里,统计数直接白字压在橙上(照图) */
.ov-strip { background: transparent; border: 0; box-shadow: none; padding: 6px 0 10px; }
.ov-title { background: #fff; border-radius: 14px; padding: 12px 18px; box-shadow: var(--shadow-md); }
.ov-title h2 { font-size: 20px; color: var(--ink); }
.ov-stats { background: transparent; border: 0; }
.ov-stat { border-left: 1px solid rgba(255,255,255,.35); padding: 4px 22px; }
.ov-stat .l { color: rgba(255,255,255,.85); font-size: 12px; }
.ov-stat .v { color: #fff; font-size: 24px; text-shadow: 0 1px 2px rgba(0,0,0,.08); }
.ov-stat .v.b-red, .ov-stat .v.b-green, .ov-stat .v.muted { color: #fff; }
.ov-stat .v small { color: rgba(255,255,255,.8); }
.ov-stat .arr.up { color: #ffe1c2; } .ov-stat .arr.dn { color: #d7ffe6; }
.crumb { background: rgba(255,255,255,.15); color: var(--ink2); border-color: var(--line); }
.crumb.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.crumb.clk:hover { border-color: var(--brand); color: var(--brand-ink); }
/* 走势卡与 KPI 卡:白卡、大圆角、更明显的投影 */
.ov-chart, .ov-kpi, .ov-tablewrap, .tt-list, .rp-left { border-radius: 16px; box-shadow: 0 6px 24px -12px rgba(120,60,20,.25), 0 1px 2px rgba(0,0,0,.04); border-color: #f3e6dc; }
.ov-kpi .kv { color: var(--ink); }
.ov-kpi { position: relative; }
.ov-kpi::after { content: "›"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #ccc; font-size: 18px; }
.trendsvg { background: #fff; border: 0; }
.tctl.on { background: var(--brand); color: #fff; }
/* 总览表格:橙底白字表头(照图),前三名序号橙 */
.ov-table thead th { background: var(--brand); color: #fff; font-weight: 600; font-size: 12.5px; border-bottom: 0; }
.ov-table thead th:first-child { border-top-left-radius: 0; }
.ov-table tbody tr.clk:hover { background: var(--brand-weak); }
.ov-table tbody tr:nth-child(-n+3) td:first-child { color: var(--brand); }
.ov-bar i { background: var(--brand); }
.ov-more { color: var(--brand-ink); }
/* 今日待处理:标签用红色下划线(照图 2),数字红;主动作按钮实心橙 */
.tt-bar { gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.ttab { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 8px 14px 10px; font-size: 14px; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ttab b { background: transparent; color: var(--red); font-weight: 700; font-size: 13px; padding: 0; }
.ttab:hover { color: var(--ink); background: transparent; }
.ttab.on { background: transparent; color: var(--red); border-bottom-color: var(--red); font-weight: 700; }
.ttab.on b { background: transparent; color: var(--red); }
.tt-row .tbtn { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; padding: 6px 14px; border-radius: 999px; box-shadow: 0 3px 10px rgba(255,106,44,.3); }
.tt-row .tbtn:hover { background: var(--brand-ink); }
.tt-row .tbtn.added { background: var(--green); border-color: var(--green); color: #fff; box-shadow: none; }
.tt-row .tsel, .tt-foot .tselall, .cp-ck, .tt-row .tsel:checked { accent-color: var(--brand); }
.tt-foot .tt-sum b.b-red { font-size: 15px; }
.tt-row.sel { background: var(--brand-weak); }
/* 选中态回橙(顶部分段 / 品类筛选 / 面板行 / 按钮) */
.seg button.active, .seg.sm button.on { color: var(--brand-ink); }
.subtabs button.active, .reasonbar button.active, .catpick-btn.active, .rp-row.on, .rp-row.all.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.kpi.clk.on { outline-color: var(--brand); }
.bigcard.on { outline-color: var(--brand); }
.uc-av, .lb-btn, .dg-n, .brand h1::before { background: var(--brand); }
.tbadge { background: var(--red); }
.ov-bar i, .rp-bar i, .mobar i, .covbar i { background: var(--brand); }
.rp-bar i.up { background: var(--red); } .rp-bar i.dn { background: var(--green); }
.cp-item.on, .cp-h.on { background: var(--brand-weak); color: var(--brand-ink); }
.crumb.on { background: var(--brand); }
.toolbar input[type=search]:focus, .toolbar select:focus, .catsel:focus, .loginbox select:focus, .loginbox input:focus, .catpick-pop input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.subtabs.strat button.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
button:focus-visible, .seg button:focus-visible, .ttab:focus-visible, .ghost:focus-visible { outline-color: var(--brand); }
/* 其他页面的卡片也带一点暖色投影 */
.kpi, .card, .tgrp, .sc-t, .loginbox { box-shadow: 0 4px 18px -10px rgba(120,60,20,.2), 0 1px 2px rgba(0,0,0,.04); border-color: #f0e6de; }
/* v5 修正:统计数透明底(之前白底把白字吃了);橙带只盖到筛选行,总览面板自己带橙底,整块(走势/KPI/表格)都浮在橙上 */
.ov-stat { background: transparent; border-radius: 0; box-shadow: none; }
body[data-view="insight"]::before { height: 215px; background: linear-gradient(90deg, #ff6a2c, #ff8f4d); }
.today.ov { background: linear-gradient(90deg, #ff6a2c, #ff8f4d); margin: 0 0 16px; padding: 4px 24px 22px; border-radius: 0 0 26px 26px; }
.ov-title { margin-top: 4px; }
.ov-mid { margin-bottom: 14px; }
/* v5 修正 2:橙带上的口径小标签用实心白底深字,别用半透明白字 */
body[data-view="insight"] .meta .mchip { background: #fff; border-color: #fff; color: var(--ink2); backdrop-filter: none; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
body[data-view="insight"] .meta .mchip b { color: var(--ink); } body[data-view="insight"] .meta .mchip .b-red { color: var(--red); text-decoration: none; }
body[data-view="insight"] .healthbar { background: #fff; color: var(--ink2); border-color: #fff; }
/* v5.1 · 数据状态面板 / 范围标签 */
.datapanel { margin: 6px 24px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 14px; font-size: 13px; }
.dp-h { font-weight: 600; margin-bottom: 6px; }
.dp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px 18px; }
.dp-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 70px 100px; gap: 8px; padding: 3px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.dp-n { color: var(--ink2); }
.mchip.clk { cursor: pointer; } .mchip.clk:hover { border-color: var(--brand); }
.mchip.scope b { font-weight: 600; }
/* v6 · 首页工作台:经营结果 / 优先处理 / 变化来源 / 进一步分析(折叠) */
.ov-result { padding: 0; margin-top: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.ov-result .kpi .kl { margin: 0 0 4px; font-size: 13px; color: var(--ink2); }
.ov-result .kpi .kv { font-size: 28px; }
.ov-result .kpi .ks { font-size: 12px; margin-top: 4px; }
.ov-src { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.src-h { font-weight: 600; font-size: 14px; display: flex; align-items: baseline; gap: 8px; }
.src-h .src-stat { margin-left: auto; font-size: 12px; font-weight: 500; }
.src-t { font-size: 12px; font-weight: 600; margin: 4px 0 2px; }
.src-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 48px; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.src-row:hover .src-n { color: var(--brand-ink); }
.src-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.src-m { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.pr-list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pr-row { display: grid; grid-template-columns: 26px 78px 36px minmax(0, 1fr) 180px 130px 60px 76px; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pr-row:last-child { border-bottom: 0; }
.pr-row:hover { background: var(--brand-weak); }
.pr-row.pr-head { font-size: 12px; color: var(--muted); background: var(--muted-bg); cursor: default; padding: 7px 14px; }
.pr-row.pr-head:hover { background: var(--muted-bg); }
.pr-n { font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.pr-main { min-width: 0; }
.pr-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-ev { font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-stores { font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-imp { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13.5px; }
.pr-imp .muted { font-weight: 400; font-size: 11px; }
.pr-owner { font-size: 12.5px; color: var(--ink2); }
.pr-act .tbtn { padding: 5px 12px; }
details.more { margin: 6px 24px 30px; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 10px 0; list-style: none; display: flex; gap: 10px; align-items: baseline; }
details.more > summary::before { content: "▸"; color: var(--muted); }
details.more[open] > summary::before { content: "▾"; }
details.more .cards { padding-left: 0; padding-right: 0; }
details.more .card.wide .ov-tablewrap { border: 0; box-shadow: none; border-radius: 0; }
@media (max-width: 960px) { .pr-row { grid-template-columns: 26px 70px 36px minmax(0, 1fr) 76px; } .pr-row .pr-stores, .pr-row .pr-owner, .pr-row .pr-imp { display: none; } }
.ov-strip.ov-strip { display: block; }
.ov-result.ov-result { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ov-result .kpi::after { display: none; }
@media (max-width: 900px) { .ov-result.ov-result { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* v6.1 · 抽屉:门店分布 / 竞店同款 / 已有待办 */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; }
.dot.bad { background: var(--red); } .dot.warn { background: var(--orange, #f59e0b); }
.sd-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 5px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.sd-row:first-of-type { border-top: 0; }
.sd-l { font-weight: 600; white-space: nowrap; }
.sd-n { line-height: 1.5; color: var(--ink2); }
.dcopy.sm { padding: 2px 8px; font-size: 11px; }
.rvtbl td, .rvtbl th { white-space: nowrap; }
.rvtbl td.left:nth-child(2) { white-space: normal; max-width: 260px; }

/* ==================== UI v6 · 按用户规范收口:浅灰底 #F6F7F9 / 白卡 / 墨色 #182230 / 橙只留主动作与选中 / 无大面积渐变 / 圆角 10–12 / 细边框 ==================== */
:root {
  --bg: #F6F7F9; --card: #ffffff; --ink: #182230; --ink2: #475467; --muted: #667085; --line: #E4E7EC; --muted-bg: #F2F4F7;
  --brand: #F97316; --brand-weak: #FFF4EA; --brand-ink: #EA580C;
  --red: #D92D20; --red-bg: #FEF3F2; --orange: #DC6803; --orange-bg: #FFFAEB; --green: #079455; --green-bg: #ECFDF3; --blue: #1570EF; --blue-weak: #EFF8FF;
  --shadow: none; --shadow-md: 0 1px 2px rgba(16,24,40,.05); --radius: 12px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px; --radius-xl: 12px;
}
html, body { background: var(--bg); color: var(--ink); font-size: 14px; }
/* 概览页:去掉整块橙色渐变带,顶栏/筛选条回到普通白底 */
body[data-view="insight"]::before { display: none; }
body[data-view="insight"] .topbar { background: var(--card); }
body[data-view="insight"] .meta .mchip { background: var(--card); border-color: var(--line); color: var(--ink2); backdrop-filter: none; }
body[data-view="insight"] .meta .mchip b { color: var(--ink); } body[data-view="insight"] .meta .mchip .b-red { color: var(--red); text-decoration: none; }
body[data-view="insight"] .subtabs button, body[data-view="insight"] .catpick-btn { background: var(--card); border-color: var(--line); color: var(--ink2); }
body[data-view="insight"] .subtabs button.active, body[data-view="insight"] .catpick-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 卡片:白底、细边、10–12 圆角、不用投影 */
.kpi, .card, .tgrp, .ov-chart, .ov-kpi, .ov-tablewrap, .tt-list, .rp-left, .loginbox, .bigcard, .danalysis, .tile, .scorecard, .tablewrap, .ov-title, .ov-src, .pr-list, .datapanel, .sc-t, .healthbar {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: none;
}
.ov-strip { padding: 4px 0 8px; }
.ov-title { padding: 12px 16px; }
.ov-title h2 { font-size: 18px; }
.today-h h2 { font-size: 16px; }
.ov-kpi::after { display: none; }
.kpi .kv, .ov-kpi .kv { font-size: 28px; letter-spacing: -.01em; }
.kpi .kl, .kpi .ks, .muted, .ov-h .muted, .today-h .muted { font-size: 12.5px; }
/* 表格:表头浅灰、字 12.5,数字右对齐(已是),行高紧一点 */
table thead th, .ov-table th, .dealtable th, #goodsTable thead th, #rivalTable thead th, .storetbl th, table.mini th { background: #F9FAFB; color: var(--ink2); font-weight: 600; font-size: 12.5px; height: 36px; border-bottom: 1px solid var(--line); }
.ov-table thead th { background: #F9FAFB; color: var(--ink2); }
.ov-table tbody tr:nth-child(-n+3) td:first-child { color: var(--ink2); }
tbody td { font-size: 13px; padding: 8px 10px; }
/* 商品表:# 与商品列固定在左,横向滚动时不丢 */
.tablewrap { overflow-x: auto; }
#goodsTable th:nth-child(1), #goodsTable td:nth-child(1) { position: sticky; left: 0; z-index: 3; background: var(--card); width: 40px; min-width: 40px; }
#goodsTable th:nth-child(2), #goodsTable td:nth-child(2) { position: sticky; left: 40px; z-index: 3; background: var(--card); box-shadow: 1px 0 0 var(--line); }
#goodsTable thead th:nth-child(1), #goodsTable thead th:nth-child(2) { z-index: 4; background: #F9FAFB; }
#goodsTable tbody tr:hover td:nth-child(1), #goodsTable tbody tr:hover td:nth-child(2) { background: var(--muted-bg); }
#goodsTable td.pcol { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
/* 胶囊少一点:标签用浅底细字,不再全是大写粗体 */
.reason, .miniflag, .tag { border-radius: 6px; font-weight: 600; font-size: 11.5px; padding: 1px 6px; text-transform: none; letter-spacing: 0; }
.crumb { border-radius: 6px; }
.crumb.on { background: var(--brand-weak); color: var(--brand-ink); border-color: transparent; }
/* 问题清单标签页:选中橙,不用红 */
.ttab b { color: var(--muted); font-weight: 600; }
.ttab.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.ttab.on b { color: var(--brand-ink); }
.tt-row .tbtn, .pr-act .tbtn { border-radius: 8px; box-shadow: none; padding: 5px 12px; font-weight: 600; }
.tt-row.sel { background: var(--brand-weak); }
/* 主动作橙实心;次动作描边 */
.ghost { border-radius: 8px; }
.seg { border-radius: 8px; }
.seg button.active { color: var(--brand-ink); background: var(--brand-weak); }
.subtabs button.active, .reasonbar button.active, .catpick-btn.active, .rp-row.on, .rp-row.all.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ov-bar i, .rp-bar i, .mobar i, .covbar i { background: var(--brand); opacity: .85; }
.trendsvg { background: var(--card); }
/* 走势卡 + 变化来源 */
.ov-mid { gap: 12px; }
.ov-src { padding: 12px 14px; }
details.more > summary { color: var(--ink2); }
/* 窄窗口:控件换行,表格各自滚动,页面不横滚 */
html, body { overflow-x: hidden; }
@media (max-width: 1100px) {
  .controls { flex-wrap: wrap; row-gap: 6px; }
  .ov-mid { grid-template-columns: 1fr; display: grid; }
  .ov-result.ov-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: 1fr; }
  .storecols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .brand .sub { display: none; }
  .meta { flex-wrap: wrap; }
  .ov-result.ov-result { grid-template-columns: 1fr 1fr; }
  .kpi .kv, .ov-kpi .kv { font-size: 24px; }
  .toolbar { flex-wrap: wrap; }
  .drawer { width: 100vw !important; max-width: 100vw; }
}
/* v6.2 · 经营结果+走势不再套橙色底 */
.today.ov { background: transparent !important; border: 0 !important; box-shadow: none !important; padding-left: 0; padding-right: 0; }

/* ==================== v7 · 第二轮:涨跌配色可切 / 首屏压缩 / 指标驱动 / 待处理合并 / 抽屉分层 / 窄窗任务卡 ==================== */
/* 涨跌:默认 绿涨红跌;body[data-updown=cn] 红涨绿跌。亏损/缺货一律红、增量一律绿(b-red/b-green 不受影响) */
.c-up { color: var(--green); } .c-dn { color: var(--red); }
body[data-updown="cn"] .c-up { color: var(--red); } body[data-updown="cn"] .c-dn { color: var(--green); }
.rp-bar i.up { background: var(--green); } .rp-bar i.dn { background: var(--red); }
body[data-updown="cn"] .rp-bar i.up { background: var(--red); } body[data-updown="cn"] .rp-bar i.dn { background: var(--green); }
/* 首屏压缩:副标题隐藏,顶栏/口径条更薄 */
.brand .sub { display: none; }
.topbar { padding: 8px 20px; gap: 10px; }
.controls { gap: 8px; }
.meta { padding: 8px 20px 2px; gap: 8px; }
.subtabs { padding-top: 6px; padding-bottom: 6px; }
.healthbar { margin: 6px 20px 0; padding: 8px 12px; font-size: 12.5px; }
.storebanner { margin: 6px 20px; padding: 8px 12px; background: var(--orange-bg); border: 1px solid #fde4c4; border-radius: 10px; font-size: 13px; color: var(--ink2); }
.storebanner .clk { margin-left: 8px; text-decoration: underline; cursor: pointer; }
/* 经营结果:一行标题,不再是一张大卡 */
.ov-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 2px 8px; }
.ov-head h2 { font-size: 16px; margin: 0; }
.ov-head .crumbs { display: flex; align-items: center; gap: 4px; }
.ov-result.ov-result { margin-top: 0; }
.ov-kpi.clk { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ov-kpi.clk:hover { border-color: #fdba74; }
.ov-kpi.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: linear-gradient(180deg, var(--brand-weak), var(--card) 60%); }
.ov-kpi.on .kl { color: var(--brand-ink); }
.ov-kpi .ks + .ks { margin-top: 2px; }
.src-row { grid-template-columns: minmax(0, 1fr) 76px 48px auto; }
.src-go { font-size: 11.5px; color: var(--brand-ink); white-space: nowrap; opacity: .0; transition: opacity .15s; }
.src-row:hover .src-go { opacity: 1; }
/* 待处理:综合视图行(商品 · 问题标签 · 影响 · 负责人 · 查看处理) */
.pr-row { grid-template-columns: 26px 36px minmax(0, 1fr) 150px 60px 90px; }
.pr-row.open { background: var(--brand-weak); border-bottom-color: transparent; }
.pr-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pr-tags .reason { font-size: 11.5px; }
.pr-detail { background: #FFFBF7; border-bottom: 1px solid var(--line); padding: 6px 14px 10px 76px; }
.pr-prob { display: grid; grid-template-columns: 96px minmax(0, 1fr) 120px 72px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.pr-prob:first-child { border-top: 0; }
.pr-pm { min-width: 0; line-height: 1.45; }
.pr-pi { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-pi .muted { font-size: 11px; }
.pr-foot { font-size: 12px; padding-top: 6px; }
.pr-list .tag.deal { font-size: 11px; }
/* 抽屉分层 */
.dkey { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px 10px; padding: 10px 12px; background: var(--muted-bg); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.dkey .dk { display: flex; flex-direction: column; gap: 2px; }
.dkey .dk span { font-size: 11.5px; color: var(--muted); }
.dkey .dk b { font-size: 15px; font-variant-numeric: tabular-nums; }
.dtabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 6px 0 12px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.dtab { border: 0; background: transparent; padding: 9px 14px 10px; font-size: 14px; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.dtab.on { color: var(--brand-ink); border-bottom-color: var(--brand); font-weight: 700; }
.dtab .tbadge { margin-left: 4px; }
.dpane .todobar { margin-top: 10px; }
/* 窄窗:待处理行变任务卡,抽屉标签可横滑 */
@media (max-width: 900px) {
  .pr-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "th main act" "th tags imp"; gap: 4px 10px; padding: 10px 12px; }
  .pr-row .pr-n { display: none; }
  .pr-row .thumb, .pr-row .thumb.noimg { grid-area: th; }
  .pr-row .pr-main { grid-area: main; display: contents; }
  .pr-row .pr-name { grid-area: main; white-space: normal; }
  .pr-row .pr-tags { grid-area: tags; }
  .pr-row .pr-imp { grid-area: imp; display: block; text-align: right; font-size: 12.5px; }
  .pr-row .pr-owner { display: none; }
  .pr-row .pr-act { grid-area: act; }
  .pr-row .pr-stores { display: none; }
  .pr-head { display: none !important; }
  .pr-detail { padding-left: 12px; }
  .pr-prob { grid-template-columns: 80px minmax(0, 1fr); }
  .pr-prob .pr-pi { grid-column: 2; text-align: left; }
  .pr-prob .tbtn { grid-column: 2; justify-self: start; }
  .dtabs { overflow-x: auto; }
  .dkey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==================== v8 · 竞店畅销商品库:一行摘要 / 三入口 / 五列 / 收藏 / 窄窗卡片 ==================== */
#rivalView .rv-top { padding-bottom: 2px; }
.rv-sum { font-size: 14px; color: var(--ink); }
.rv-sum b { font-size: 15px; }
.tbadge-sm:empty { display: none; }
.tbadge-sm { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; line-height: 16px; margin-left: 2px; }
#rivalTable { table-layout: fixed; min-width: 760px; }
#rivalTable th:nth-child(1) { width: auto; }
#rivalTable th:nth-child(2) { width: 96px; }
#rivalTable th:nth-child(3) { width: 130px; }
#rivalTable th:nth-child(4) { width: 300px; }
#rivalTable th:nth-child(5) { width: 150px; }
#rivalTable td { vertical-align: middle; white-space: normal; }
#rivalTable td.rv-ops { text-align: right; white-space: nowrap; }
.rv-prod { max-width: none; }
.rv-prod .thumb { width: 48px; height: 48px; }
.rv-prod .pname { font-size: 13.5px; }
.rv-prod .pmeta { font-size: 12px; margin-top: 3px; }
.rv-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.rv-sale { font-size: 16px; font-variant-numeric: tabular-nums; }
.linkbtn { border: 0; background: transparent; color: var(--brand-ink); cursor: pointer; padding: 0 2px; font: inherit; font-size: 12.5px; text-decoration: underline dotted; }
.linkbtn:hover { text-decoration: underline; }
.nm-btn { border: 1px solid var(--line); background: var(--card); border-radius: 6px; font-size: 11px; padding: 1px 6px; margin-left: 4px; cursor: pointer; color: var(--ink2); }
.nm-btn.ok { color: var(--green); border-color: #a6e3c2; }
.nm-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.rv-pick.on { background: var(--brand-weak); border-color: var(--brand); color: var(--brand-ink); }
.rv-notewrap { display: flex; gap: 6px; align-items: center; }
.rv-note { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
.rv-note:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
#rivalTable tr.more td { padding: 12px 10px; }
#rivalOverlay .dks { margin-bottom: 8px; }
@media (max-width: 760px) {
  #rivalTable { min-width: 0; table-layout: auto; }
  #rivalTable thead { display: none; }
  #rivalTable tr.rvrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "prod sale" "prod price" "mine mine" "ops ops"; gap: 2px 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  #rivalTable tr.rvrow td { display: block; border: 0; padding: 0; }
  #rivalTable tr.rvrow td:nth-child(1) { grid-area: prod; }
  #rivalTable tr.rvrow td:nth-child(2) { grid-area: sale; text-align: right; }
  #rivalTable tr.rvrow td:nth-child(2)::before, #rivalTable tr.rvrow td:nth-child(3)::before { content: attr(data-l) " "; font-size: 11px; color: var(--muted); }
  #rivalTable tr.rvrow td:nth-child(3) { grid-area: price; text-align: right; }
  #rivalTable tr.rvrow td:nth-child(4) { grid-area: mine; margin-top: 4px; }
  #rivalTable tr.rvrow td.rv-ops { grid-area: ops; text-align: left; margin-top: 4px; }
  #rivalTable tr.more { display: block; }
  #rivalTable tr.more td { display: block; }
}
/* 神价池(可报未报)标签用灰,已报名神价保持橙红 */
.tag.deal.pool { background: var(--muted-bg); color: var(--muted); font-weight: 600; }

/* 神价页翻页 / 竞店计数卡 */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 2px; }
.pager .ghost.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.rvchips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 24px 8px; }
.rvchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink2); }
.rvchip b { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rvchip:hover { border-color: var(--brand); }
.rvchip.on { background: var(--brand-weak); border-color: var(--brand); }
.rvchip.on b { color: var(--brand-ink); }

/* ==================== v9 · 品类经营:主表 + 右侧详情原地展开;神价独立页 ==================== */
.catops-bar { flex-wrap: wrap; }
.co-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0 24px 40px; align-items: start; }
.co-wrap.open { grid-template-columns: minmax(0, 1fr) 440px; }
.co-wrap .tablewrap { padding: 0; }
.co-main { max-height: calc(100vh - 230px); overflow: auto; }
#coTable { width: 100%; }
#coTable thead th { position: sticky; top: 0; z-index: 2; font-size: 13px; }
#coTable thead th.on { color: var(--brand-ink); }
#coTable td { font-size: 14px; padding: 9px 12px; vertical-align: middle; }
#coTable td .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; }
#coTable tr.corow { cursor: pointer; }
#coTable tr.corow.on { background: var(--brand-weak); box-shadow: inset 3px 0 0 var(--brand); }
.co-detail { position: sticky; top: 70px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; max-height: calc(100vh - 90px); overflow: auto; }
.co-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.co-head > div:first-child { flex: 1; min-width: 0; }
.co-title { font-size: 16px; font-weight: 700; }
.co-kv { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); margin-bottom: 8px; }
.co-sec { border-top: 1px solid var(--line); padding: 8px 0; }
.co-h { display: flex; align-items: baseline; gap: 8px; cursor: pointer; font-size: 13.5px; }
.co-h .muted { font-size: 12px; }
.co-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.co-t { font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--ink2); }
.co-list { display: flex; flex-direction: column; gap: 3px; }
/* 10/7：详情清单全部列出，框内滚动，面板不被撑长 */
.co-list.co-scroll { max-height: 340px; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }
.co-cnt { font-weight: 400; font-size: 11.5px; margin-left: 4px; }
/* 10/7：表格和详情的涨跌图。红涨绿跌跟「涨跌配色」设置走(body[data-updown]) */
.ud-up-bg { background: var(--green); } .ud-dn-bg { background: var(--red); }
body[data-updown="cn"] .ud-up-bg { background: var(--red); } body[data-updown="cn"] .ud-dn-bg { background: var(--green); }
.cobar { height: 4px; background: #eef1f5; border-radius: 99px; margin: 4px 0 0 auto; max-width: 140px; overflow: hidden; }
.cobar i { display: block; height: 100%; background: #94a3b8; border-radius: 99px; }
.cobar-act i { background: #60a5fa; } .cobar-act.low i { background: var(--orange); }
.cdiv { display: grid; grid-template-columns: 1fr 1fr; height: 7px; max-width: 140px; margin: 4px 0 0 auto; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.cdiv span { display: flex; height: 100%; } .cdiv span:first-child { justify-content: flex-end; box-shadow: inset -1px 0 0 #cbd5e1; }
.cdiv i { display: block; height: 100%; }
.co-mbar { flex: none; width: 54px; height: 6px; margin: 0 6px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.co-mbar i { display: block; height: 100%; border-radius: 99px; }
.co-trend .tsum { font-size: 12.5px; margin: 2px 0 4px; }
.co-trend svg { display: block; width: 100%; height: 92px; }
.co-trend-line { stroke: #3b82f6; } .co-trend-area { fill: rgba(59, 130, 246, .12); }
.co-trend .tax { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted, #94a3b8); }
.co-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 0; }
.co-item .thumb { width: 26px; height: 26px; border-radius: 6px; }
.co-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-v { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.co-fill { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
#mtChip { margin-left: 4px; }
@media (max-width: 1100px) { .co-wrap.open { grid-template-columns: 1fr; } .co-detail { position: static; max-height: none; } }

/* v9.1 收尾:hidden 一律生效 / 窄窗 KPI 2×2 / 搜索清空按钮 */
[hidden] { display: none !important; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sclr { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; width: 26px; height: 28px; line-height: 1; cursor: pointer; margin-left: -4px; font-size: 12px; }
.sclr:hover { color: var(--ink); border-color: var(--brand); }

/* ———— 采集页（竞店 App 采集：设备 / 任务 / 待复核 / 历史）———— */
#collectView .cl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 6px 24px 4px; }
.cl-sec { margin: 12px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.cl-sec-h { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-weight: 800; font-size: 13.5px; border-bottom: 1px solid var(--line); background: var(--raised, #faf9f7); }
.cl-sec-h .muted { font-weight: 400; }
.cl-sec-h .cl-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cl-sec table { box-shadow: none; border-radius: 0; }
.cl-sec .tablewrap { padding: 0; }
.cl-sec td, .cl-sec th { white-space: nowrap; }
.cl-sec td.wrap { white-space: normal; max-width: 420px; }
.cl-empty { padding: 18px 16px; color: var(--muted); font-size: 12.5px; }
.cl-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef0f3; color: #6b7280; }
.cl-pill.ok { background: var(--green-bg); color: var(--green); }
.cl-pill.warn { background: var(--orange-bg); color: var(--orange); }
.cl-pill.bad { background: var(--red-bg); color: var(--red); }
.cl-pill.info { background: var(--blue-weak); color: var(--blue); }
.cl-pill.brand { background: var(--brand-weak); color: var(--brand-ink); }
.cl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c4c8cd; margin-right: 6px; vertical-align: 1px; }
.cl-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.cl-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.cl-form input, .cl-form select { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-size: 13px; background: var(--card); }
.cl-form input:focus, .cl-form select:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.cl-form .primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.cl-form .primary:hover { background: var(--brand-ink); color: #fff; }
.cl-ops { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cl-ops .ghost { padding: 4px 9px; font-size: 11.5px; }
.cl-ops .ghost.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.cl-ops .ghost.ok:hover { border-color: var(--green); color: var(--green); background: var(--green-bg); }
.cl-token { margin: 10px 16px; padding: 12px 14px; background: var(--orange-bg); border: 1px solid #f2e2bd; border-radius: 12px; font-size: 13px; }
.cl-token code { display: block; margin: 8px 0; padding: 8px 10px; background: #fff; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; word-break: break-all; user-select: all; }
.cl-review { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
.cl-review:last-child { border-bottom: 0; }
.cl-review .cr-t { font-weight: 700; font-size: 13.5px; }
.cl-review .cr-m { font-size: 12px; color: var(--ink2); margin-top: 3px; line-height: 1.6; }
.cl-review .cr-m b { color: var(--orange); }
.cl-prog { font-size: 12px; color: var(--ink2); }
.cl-prog b { font-variant-numeric: tabular-nums; }
.rv-status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 0 24px 6px; font-size: 12.5px; color: var(--ink2); }
.rv-status .cl-pill { font-size: 11px; }
.rv-status .linkbtn { font-size: 12.5px; }
/* 品类筛选弹层被概览面板盖住:#subtabs 与 #insightView 同为 z-index 1 的层叠上下文,后者在 DOM 靠后就压在前者上面 → 筛选条整体抬高 */
#subtabs, body[data-view="insight"] #subtabs { position: relative; z-index: 25; }
/* 抽屉关键指标条:口径 + 周期切换 */
.dkey-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink2); margin: 2px 0 6px; }
.dkey-h .seg.sm button { padding: 3px 10px; font-size: 12px; }
.drawer-prices { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.drawer-prices .da-h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.price-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.price-cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.price-card { display: flex; flex-direction: column; gap: 7px; background: var(--muted-bg); border-radius: 8px; padding: 12px 9px; min-width: 0; }
.price-card > span, .price-card small, .price-time { font-size: 12px; color: var(--muted); }
.price-card > b { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.price-card.primary { background: #fff4e7; }
.price-card.primary > b { color: #b95000; font-size: 25px; }
.price-card small { line-height: 1.5; }
.price-time { margin: 10px 0 5px; }
.drawer-fold { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 12px; }
.drawer-fold > summary { cursor: pointer; font-size: 13px; color: var(--ink2); }
.drawer-fold[open] > summary { margin-bottom: 12px; }
@media (max-width: 520px) {
  .price-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-card.primary { grid-column: 1 / -1; }
}
/* 品类详情面板:太窄且右侧被裁 → 宽度按屏幕 42%(520~760px),列表两栏自适应,内容不溢出 */
.co-wrap.open { grid-template-columns: minmax(0, 1fr) clamp(520px, 42%, 760px); }
.co-detail { padding: 16px 18px; overflow-x: hidden; }
.co-title { font-size: 18px; }
.co-kv { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.co-kv .dk b { font-size: 16px; }
.co-two { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); min-width: 0; }
.co-two > div { min-width: 0; }
.co-item { font-size: 13px; }
.co-item .thumb { width: 30px; height: 30px; }
.co-sec { padding: 10px 0; }
.co-h { font-size: 14px; }
@media (max-width: 1360px) { .co-wrap.open { grid-template-columns: minmax(0, 1fr) 480px; } }

/* 竞店：差价清单 / 促销变化 / 缺口清单 */
.gap-up { color: #e5484d; }      /* 正数 = 我们贵 / 涨价 */
.gap-down { color: #30a46c; }    /* 负数 = 我们便宜 / 降价 */
#rivalMode button { white-space: nowrap; }
#rivalView .rv-nav-menu { position:relative; font-size:13px; }
#rivalView .rv-nav-menu summary { cursor:pointer; padding:6px 12px; border-radius:8px; list-style:none; white-space:nowrap; }
#rivalView .rv-nav-menu summary::after { content:' ▾'; color:var(--muted); }
#rivalView .rv-nav-menu.has-active summary { color:var(--brand-ink); background:var(--brand-weak); }
#rivalView .rv-nav-pop { position:absolute; z-index:40; top:100%; left:0; display:flex; flex-direction:column; min-width:190px; padding:6px; border:1px solid var(--line); border-radius:10px; background:var(--card); box-shadow:var(--shadow); }
#rivalView .rv-nav-pop a, #rivalView .rv-nav-pop button { display:block; padding:9px 12px; text-align:left; text-decoration:none; color:var(--ink); font-size:13px; border-radius:6px; }
#rivalView .rv-nav-pop a:hover, #rivalView .rv-nav-pop button:hover { background:var(--muted-bg); }
#rivalView .cg-data-warning { margin:8px 16px; padding:8px 12px; background:#fff3df; color:#805000; border-radius:6px; font-size:12px; }
#gapTable td, #promoTable td, #noneTable td { vertical-align: top; }

/* 导航条里的页面链接(月度旺季另开一页),外观同 seg 按钮 */
.seg a.seglink { text-decoration: none; padding: 6px 13px; font-size: 12px; color: var(--ink2); border-radius: 8px; transition: .15s; }
.seg a.seglink:hover { color: var(--brand-ink); background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
/* 性能:长列表行只渲染视口内的(非表格行才能用 content-visibility) */
.tt-row, .pr-row, .co-item, .src-row { content-visibility: auto; contain-intrinsic-size: auto 56px; }
.kpi.clk { transition: border-color .12s; }
.co-item, .src-row { content-visibility: visible; contain-intrinsic-size: none; }
/* 门店涨跌板块 */
.smv { margin: 6px 22px 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.smv-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.smv-h h3 { font-size: 15px; margin: 0; }
.smv-h .muted { font-size: 12px; }
.smv-t { border: 0; background: transparent; padding: 4px 12px; font-size: 13px; color: var(--ink2); cursor: pointer; border-radius: 8px; }
.smv-t.on { background: var(--brand); color: #fff; font-weight: 600; }
.smv-tip { background: var(--orange-bg); border: 1px solid #fde4c4; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; color: var(--ink2); margin-bottom: 8px; }
.smv-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.smv-t2 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.smv-list { max-height: 340px; overflow-y: auto; }
.smv-r { display: grid; grid-template-columns: 30px minmax(0,1fr) 96px 96px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13px; cursor: pointer; }
.smv-r:hover { background: var(--muted-bg); }
.smv-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smv-v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.smv-s { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) { .smv-two { grid-template-columns: 1fr; } .smv-r { grid-template-columns: 30px minmax(0,1fr) 80px; } .smv-s { display: none; } }
.smv-scope { font-size: 12px; color: var(--ink2); }
.smv-r { grid-template-columns: 30px minmax(0,1fr) 92px 300px; }
.smv-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
.smv-s b { color: var(--ink); }
@media (max-width: 1500px) { .smv-r { grid-template-columns: 30px minmax(0,1fr) 92px 210px; } .smv-s { font-size: 11.5px; } }
@media (max-width: 900px) { .smv-r { grid-template-columns: 30px minmax(0,1fr) 86px; } .smv-s { display: none; } }

/* —— 周期「自定义」弹层(整周/整月/自选起止;见 app.js wireRangePicker) —— */
.rangewrap { position: relative; }
#rangeSeg button:disabled { opacity: .45; cursor: not-allowed; }
#channelSeg.disabled { opacity: .5; }
.rangepop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 320px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 10px; }
.rangepop[hidden] { display: none; }
.rangepop .rp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rangepop .rp-grid button { padding: 7px 4px; font-size: 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; cursor: pointer; }
.rangepop .rp-grid button:hover { border-color: var(--brand-ink); color: var(--brand-ink); }
.rangepop .rp-custom { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 12px; color: var(--ink2); }
.rangepop .rp-custom input[type=date] { flex: 1; min-width: 0; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: inherit; }
.rangepop .rp-hint { margin-top: 9px; font-size: 11px; line-height: 1.7; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }

/* —— 经营分析子页签(#286，10/13)：顶栏「经营分析」下面一排，下划线样式，和再下面的大类筛选胶囊分得开 —— */
.anatabs { display: flex; gap: 2px; flex-wrap: wrap; padding: 4px 24px 0; background: var(--card); border-bottom: 1px solid var(--line); }
.anatabs[hidden] { display: none; }
.anatabs button { border: 0; background: transparent; padding: 10px 16px 9px; margin-bottom: -1px; font-size: 14px; font-weight: 600; color: var(--ink2); cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.anatabs button:hover { color: var(--ink); }
.anatabs button.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
/* 新品与下滑 / 旺季：原来另开的页整页嵌进来，高度由 app.js fitAnaFrame 按窗口算 */
.anaembed-note { margin: 10px 24px 6px; font-size: 12px; color: var(--muted); }
.anaframe { display: block; width: 100%; height: calc(100vh - 180px); border: 0; background: var(--bg); }

/* 统一分页器(9/16):页码 + 上一页/下一页 + 跳页 + 每页条数 */
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 4px; font-size: 12px; }
.pager .pg { min-width: 28px; height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: inherit; cursor: pointer; font: inherit; font-size: 12px; }
.pager .pg.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager .pg:disabled { opacity: .4; cursor: default; }
.pager .pg-gap { color: var(--muted); padding: 0 2px; }
.pager .pg-jump { width: 52px; height: 26px; text-align: center; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: inherit; font: inherit; font-size: 12px; }
.pager .pg-size { height: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: inherit; font: inherit; font-size: 12px; margin-left: auto; }
tr.pager-row td { background: transparent !important; border: 0 !important; }

/* 竞店页右上角去情报网关系图（web/rival-map.html） */
.rv-map { margin-left: 8px; font-size: 12px; color: #4c8dff; text-decoration: none; white-space: nowrap; }
.rv-map:hover { text-decoration: underline; }

/* ———— 可搜索门店下拉(2026-09-22) ————
   57 家店用原生 select 只能靠滚,中文又没法靠首字母跳。改成输入过滤。
   外观对齐 .catsel(胶囊边框 + 右侧箭头),这样头部那排控件看起来还是一套。
   深色主题那版在 web/rival-map.html 里(.combo),那是竞店页专用配色,别混用。 */
.scombo { position: relative; display: inline-block; }
.scombo > input.cbi {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 30px 6px 14px; font-size: 12px;
  color: var(--ink2); background: var(--card); width: 168px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.scombo > input.cbi::placeholder { color: var(--muted); }
.scombo:hover > input.cbi { border-color: #d8dbe0; color: var(--ink); }
.scombo > input.cbi:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); color: var(--ink); }
.scombo .cbx { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; font-style: normal; font-size: 13px; line-height: 1; user-select: none; }
.scombo .cbx:hover { color: var(--ink); }
.scombo .opts {
  display: none; position: absolute; left: 0; min-width: 100%; white-space: nowrap; top: calc(100% + 4px); z-index: 60;
  max-height: 300px; overflow: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(15, 23, 42, .12); padding: 4px;
}
.scombo.open .opts { display: block; }
.scombo .opts div { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--ink2); }
.scombo .opts div.on, .scombo .opts div:hover { background: var(--brand-weak); color: var(--ink); }
.scombo .opts div.cur { font-weight: 600; color: var(--brand); }
.scombo .opts .none { color: var(--muted); cursor: default; padding: 8px 10px; }
.scombo .opts .none:hover { background: transparent; }
@media (max-width: 720px) { .scombo > input.cbi { width: 130px; } }

/* ———— 门店视角两栏等高 + 不溢出(2026-09-22) ————
   ① 原来 align-items:start,两栏各按自己内容高。右栏每行多一句「同款共 N 个规格」,
      50 行下来比左栏高 397px,短的那栏底下就空出一大块(老板两次指出来的那个洞)。
      改成拉伸等高,两张卡底边对齐,空白落在卡内像留白,不像页面裂了。
   ② grid 子项默认 min-width:auto,撑不下就往外顶 —— 右栏那张表 min-width:700px
      比格子宽,实测溢出窗口 96px。min-width:0 让它可以收缩,
      .tablewrap 自带 overflow-x:auto,收缩后横滑,不再顶破页面。 */
.storecols { align-items: stretch; }
.storecol { display: flex; flex-direction: column; min-width: 0; }
.storecol > .tablewrap { flex: 1 1 auto; }

/* 抽屉「竞店同款」:店全名 + 距本店 一行,商品名一行;品牌下拉筛选 */
.rvtbl td.rv-main { white-space: normal; min-width: 230px; line-height: 1.45; }
.rv-store b { color: var(--ink); }
.rv-name { color: var(--ink2); margin-top: 2px; }
.rv-pt { font-size: 11px; white-space: nowrap; }
.rv-brand { font-size: 12px; font-weight: 500; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); margin: 0 6px 0 4px; max-width: 170px; vertical-align: middle; }
.rv-tier { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 5px; border-radius: 4px; background: var(--muted-bg); color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
