/* 页面级样式(仍只用设计令牌)。 */
.stack.gap-4 { gap: var(--sp-4); }
.section-head { margin-bottom: var(--sp-3); }
.section-head h2 { display: flex; align-items: baseline; gap: var(--sp-2); }
.section-head .hint, h2 .hint { font-size: var(--fs-xs); color: var(--text-3); font-weight: 400; }
.icon-link { color: var(--text-3); display: inline-flex; vertical-align: -2px; }
.icon-link:hover { color: var(--accent); }
.row-dim > td { opacity: .55; }
.wrap-cell { white-space: normal; word-break: break-word; }

/* ── 登录门 ── */
.app.gated .sidebar, .app.gated .topbar { display: none; }
.login { min-height: 80vh; display: grid; place-items: center; }
.login-card { width: min(360px, 100%); padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); text-align: center; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.login-brand .logo { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--accent); color: #fff; display: grid; place-items: center; }
.login-card input[name=code] { height: 42px; text-align: center; letter-spacing: .2em; text-transform: uppercase; font-size: var(--fs-lg); font-family: var(--font-mono); }
.login-card .btn.primary { height: 40px; }
.login-card select { align-self: center; }

/* ── 指挥台 ── */
.kpi-foot { margin-top: var(--sp-2); }
.dim-mini { display: inline-flex; gap: var(--sp-3); }
.dim-mini > span { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.top-list { list-style: none; margin: 0; padding: var(--sp-1) 0; }
.top-list li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
.top-list li:last-child { border-bottom: 0; }
.top-list li:hover { background: var(--surface-hover); }
.top-list .rank { width: 20px; flex: 0 0 20px; text-align: center; font-weight: var(--fw-semibold); color: var(--text-3); font-variant-numeric: tabular-nums; }
.top-list li:nth-child(-n+3) .rank { color: var(--bad); }
.top-list .top-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; }

/* 问题卡(details) */
.issues { display: flex; flex-direction: column; }
.issue { border-bottom: 1px solid var(--border); }
.issue:last-child { border-bottom: 0; }
.issue > summary {
  list-style: none; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); cursor: pointer;
}
.issue > summary::-webkit-details-marker { display: none; }
.issue > summary:hover { background: var(--surface-hover); }
.issue > summary:focus-visible { outline-offset: -2px; }
.issue-title { flex: 1 1 auto; font-weight: var(--fw-semibold); min-width: 0; }
.issue .chev { color: var(--text-3); transition: transform var(--dur-fast) var(--ease); display: inline-flex; }
.issue[open] .chev { transform: rotate(180deg); }
.issue-body { padding: 0 var(--sp-4) var(--sp-4) calc(var(--sp-4) + 34px); display: flex; flex-direction: column; gap: var(--sp-3); }
.issue-sec h4 { font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--sp-1); }
.bullets, .fix-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.fix-list li::marker { color: var(--accent); font-weight: var(--fw-semibold); }
.issue-sec .table-wrap { border: 1px solid var(--border); border-radius: var(--r-md); }
.issue-sec table.dt thead th { position: static; }

/* ── Markdown 文档 ── */
.md { font-size: var(--fs-md); line-height: 1.65; color: var(--text); }
.md > * + * { margin-top: var(--sp-3); }
.md h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-2); letter-spacing: -.01em; }
.md h2 { font-size: var(--fs-xl); margin-top: var(--sp-8); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--border); }
.md h3 { font-size: var(--fs-lg); margin-top: var(--sp-5); }
.md h4 { font-size: var(--fs-md); margin-top: var(--sp-4); }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: 4px; }
.md strong { font-weight: var(--fw-semibold); color: var(--text); }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: var(--r-xs); font-size: .9em; }
.md pre { background: var(--bg-sunken); padding: var(--sp-3); border-radius: var(--r-md); overflow: auto; }
.md blockquote { margin: 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--warn); background: var(--warn-soft); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text); }
.md blockquote > * + * { margin-top: var(--sp-2); }
.md hr { margin: var(--sp-6) 0; }
.md .md-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.md table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.md th, .md td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.md th { background: var(--surface-2); color: var(--text-2); font-weight: var(--fw-medium); font-size: var(--fs-xs); }
.md tr:last-child td { border-bottom: 0; }
.md-doc { padding: var(--sp-6) var(--sp-8); max-width: 920px; }
.report-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.report-layout > .md-doc:only-child { grid-column: 1 / -1; }
.report-toc { position: sticky; top: calc(var(--topbar-h) + var(--sp-4)); }
.toc { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-sm); }
.toc li { display: flex; gap: var(--sp-2); align-items: flex-start; }
.toc li span:last-child { line-height: 1.4; }
@media (max-width: 1023px) { .report-layout { grid-template-columns: minmax(0, 1fr); } .report-toc { position: static; } .md-doc { padding: var(--sp-4); } }

/* ── 单店 ── */
.store-title { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.store-title .code { font-family: var(--font-mono); font-size: var(--fs-lg); color: var(--text-3); font-weight: var(--fw-medium); }
.diag {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--good);
}
.diag-availability { border-left-color: var(--dim-availability); }
.diag-traffic { border-left-color: var(--dim-traffic); }
.diag-conversion { border-left-color: var(--dim-conversion); }
.diag-fulfillment { border-left-color: var(--dim-fulfillment); }
.diag-margin { border-left-color: var(--dim-margin); }
.diag-main { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.diag-headline { font-size: var(--fs-lg); font-weight: var(--fw-semibold); line-height: 1.4; }
.diag-side { display: flex; flex-direction: column; gap: var(--sp-2); align-items: stretch; }
@media (max-width: 767px) { .diag { grid-template-columns: minmax(0, 1fr); } }
.dim-bars { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.dim-bar { display: grid; grid-template-columns: 76px minmax(40px, 1fr) 24px; align-items: center; gap: var(--sp-2); font-size: var(--fs-2xs); }
.dim-bar > span:first-child { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.dim-bar b { text-align: right; font-weight: var(--fw-semibold); }
.share-cell { display: inline-flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; }
.share-bar { width: 48px; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; display: inline-block; }
.share-bar > i { display: block; height: 100%; background: var(--accent); }

/* 溯源 / 发现 */
.trace { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); }
.panel-body > .trace { padding: 0; }
.trace-head { display: flex; flex-direction: column; gap: 2px; }
.trace-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--sp-5); }
@media (max-width: 1023px) { .trace-grid { grid-template-columns: minmax(0, 1fr); } }
.trace > .btn { align-self: flex-start; }
.findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.finding { padding: var(--sp-2) 0 var(--sp-2) var(--sp-3); border-left: 2px solid var(--border-strong); display: flex; flex-direction: column; gap: 3px; }
.sugg { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); color: var(--good); }
.sugg svg { margin-top: 3px; }
.ev + .ev { margin-top: var(--sp-3); }
.ev h4 { font-size: var(--fs-xs); color: var(--text-2); font-weight: var(--fw-medium); margin-bottom: var(--sp-1); }
.pill.est { height: 16px; padding: 0 5px; margin-left: 4px; }

/* ── 看板 ── */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); align-items: start; }
@media (max-width: 1279px) { .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .kanban { grid-template-columns: minmax(0, 1fr); } }
.kb-col { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-2); min-width: 0; }
.kb-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2) var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
.kb-head .badge { margin-left: auto; }
.kb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.kb-dot.open { background: var(--warn); }
.kb-dot.in_progress { background: var(--accent); }
.kb-dot.done { background: var(--good); }
.kb-list { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 720px; overflow-y: auto; }
.kb-empty { padding: var(--sp-3) var(--sp-2); text-align: center; }
.act-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3);
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-1); border-left: 3px solid var(--border-strong);
}
.act-card.sev-high { border-left-color: var(--bad); }
.act-card.sev-medium { border-left-color: var(--warn); }
.act-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: 1.35; }
.act-detail { font-size: var(--fs-xs); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.act-metric { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); padding: 4px 8px; background: var(--surface-2); border-radius: var(--r-sm); }
.act-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* 打法推荐 */
.pb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pb-item { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.pb-item:first-child { padding-top: 0; }
.pb-item:last-child { border-bottom: 0; padding-bottom: 0; }
.pb-item .grow { display: flex; flex-direction: column; gap: 4px; }
.pb-meta { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.pb-meta .store-name { display: inline-flex; }

/* ── 数据中心 ── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1); text-align: center;
  padding: var(--sp-8) var(--sp-4); border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.upload-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.upload-item { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.upload-result { display: flex; flex-direction: column; gap: 4px; }
.sub-results, .err-list { margin: 0; padding-left: 1.2em; }
.err-list { max-height: 160px; overflow: auto; color: var(--text-2); }
.frows { display: flex; flex-direction: column; gap: var(--sp-2); }
.frow { display: grid; grid-template-columns: 96px minmax(120px, 1.6fr) 130px repeat(3, minmax(64px, .7fr)) 26px; gap: 6px; align-items: center; }
.frow input, .frow select { width: 100%; min-width: 0; }
@media (max-width: 1500px) { .frow { grid-template-columns: repeat(3, minmax(0, 1fr)); } .frow [data-del] { justify-self: end; } }
.missing-list { margin-top: 4px; max-width: 520px; }
.steps { list-style: none; margin: 0; padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.step-detail { flex-basis: 100%; padding-left: var(--sp-6); font-family: var(--font-mono); font-size: var(--fs-2xs); word-break: break-all; }

/* ── 全渠道 ── */
table.omni-table th.pgroup.grab, table.omni-table td.pcol.grab { box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--plat-grab-bar) 5%, transparent); }
table.omni-table th.pgroup.lineman, table.omni-table td.pcol.lineman { box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--plat-lineman-bar) 6%, transparent); }
table.omni-table th.pgroup { color: var(--text); font-weight: var(--fw-semibold); }
table.omni-table th.pgroup.grab { border-bottom: 2px solid var(--plat-grab-bar); }
table.omni-table th.pgroup.lineman { border-bottom: 2px solid var(--plat-lineman-bar); }

/* ── 设置 ── */
.edit-table input.ed { height: var(--control-h-sm); }
.edit-table .btn.saved { color: var(--good); border-color: var(--good); }
.bulk { gap: var(--sp-2); }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list > li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
.link-list > li:last-child { border-bottom: 0; }
.link-list > li[hidden] { display: none; }
.linked-store { display: inline-flex; align-items: center; gap: 6px; margin: 4px var(--sp-3) 0 0; min-width: 0; }
.linked-store .store-name .code, .link-list .code { color: var(--text-3); }
.group-store { margin-top: 4px; }
.group-store .store-name { min-width: 0; }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--sp-3); }
.token-box { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); padding: var(--sp-2); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); }
.token-box code { flex: 1 1 auto; word-break: break-all; font-size: var(--fs-sm); }
.code-block { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3); overflow-x: auto; margin: var(--sp-2) 0; color: var(--text); }

/* 门店表:每店 12 周健康迷你走势 */
.row-spark { width: 72px; height: 22px; }
