/* 推广中心 /ads（app/f_adshub.py）。版面数值、颜色照内容总图 B6、B7；颜色只用 tokens.css 的变量，黑色只给字。
   壳线的 components.css 管 .blk .tbl .hub-tabs .act-row 这些；这里 :where() 包着的是壳线还没交来时的兜底（特异度 0，壳线一有就听壳线的）。 */

/* ---------- 兜底（壳线的类，特异度 0） ---------- */
:where(.adh) :where(.blk) { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 16px; }
:where(.adh) :where(.blk-h) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 4px; }
:where(.adh) :where(.blk-h h3) { font-size: 16px; font-weight: 600; margin: 0; }
:where(.adh) :where(.blk-say) { font-size: 15px; font-weight: 600; margin: 4px 0 8px; }
:where(.adh) :where(.blk-who) { font-size: 13px; color: var(--muted, #6b6560); margin: 0 0 10px; }
:where(.adh) :where(.hub-tabs, .sub-tabs) { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
:where(.adh) :where(.hub-tabs a) { font-size: 15px; padding: 10px 16px; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; }
:where(.adh) :where(.sub-tabs a) { font-size: 14px; padding: 7px 12px; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
:where(.adh) :where(.hub-tabs a.on, .sub-tabs a.on) { background: var(--pop-soft); color: var(--pop-ink); border-bottom-color: var(--pop); }
:where(.adh) :where(.hub-tabs small, .sub-tabs small) { font-size: 12px; color: var(--muted, #6b6560); margin-left: 4px; }
:where(.adh) :where(.badge) { background: var(--pop); color: #fff; font-style: normal; font-size: 12px; border-radius: 9px; padding: 0 6px; margin-left: 4px; }
:where(.adh) :where(.pg-head) { margin: 4px 0 14px; }
:where(.adh) :where(.pg-head h1) { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
:where(.adh) :where(.pg-head .say) { font-size: 17px; font-weight: 600; line-height: 1.55; margin: 0; }
:where(.adh) :where(.pg-head .say em, .blk-say em) { color: var(--pop); font-style: normal; }
:where(.adh) :where(.pg-tools) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
:where(.adh) :where(.asof) { font-size: 13px; color: var(--muted, #6b6560); }
:where(.adh) :where(.tbl) { width: 100%; border-collapse: collapse; font-size: 14px; }
:where(.adh) :where(.tbl th) { font-size: 13px; font-weight: 600; color: var(--muted, #6b6560); text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); background: #fff; white-space: nowrap; }
:where(.adh) :where(.tbl td) { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
:where(.adh) :where(.tbl .num) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
:where(.adh) :where(.tbl tfoot td) { font-weight: 600; }
:where(.adh) :where(.scroll-x) { overflow-x: auto; }
:where(.adh) :where(.tbl.sticky thead th) { position: sticky; top: 0; z-index: 1; }
:where(.adh) :where(form.filters) { display: inline-flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; }
:where(.adh) :where(form.filters label span) { font-size: 13px; color: var(--muted, #6b6560); margin-right: 4px; }
:where(.adh) :where(select.filter-select) { height: 32px; font-size: 14px; }
:where(.adh) :where(.btn.warn) { background: #fff; color: var(--red, #b42318); border-color: var(--red-soft, #f6d4d0); }
:where(.adh) :where(.btn.soft) { background: var(--pop-soft); color: var(--pop-ink); border-color: transparent; }
:where(.adh) :where(.copy-btn, .csv-btn) { font-size: 13px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 3px 8px; cursor: pointer; text-decoration: none; }
:where(.adh) :where(details.how) { margin-top: 10px; font-size: 13px; color: var(--muted, #6b6560); }
:where(.adh) :where(details.fold > summary.more) { display: inline-block; font-size: 15px; color: var(--pop-ink); background: var(--pop-soft); border-radius: 8px; padding: 6px 12px; margin: 8px 0; cursor: pointer; list-style: none; }

/* 要做的事：一行一网格（B6） */
:where(.adh) :where(.acts) { margin: 0; }
:where(.adh) :where(.act-row) { display: grid; grid-template-columns: 28px 140px minmax(220px, 1.4fr) minmax(160px, 1fr) 180px 110px minmax(150px, auto); gap: 6px 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: start; font-size: 15px; }
:where(.adh) :where(.act-src) { font-size: 13px; color: var(--muted, #6b6560); }
:where(.adh) :where(.act-src small, .act-due small, .act-what small) { display: block; font-size: 13px; color: var(--muted, #6b6560); font-weight: 400; }
:where(.adh) :where(.act-what b) { font-weight: 600; }
:where(.adh) :where(.act-how, .act-check) { font-size: 13px; }
:where(.adh) :where(.act-btns) { display: flex; flex-wrap: wrap; gap: 6px; }
:where(.adh) :where(.act-bar) { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--pop-soft); border-radius: 0 0 8px 8px; font-size: 14px; }
:where(.adh) :where(.act-empty) { color: var(--muted, #6b6560); margin: 6px 0; }
@media (max-width: 760px) {
  :where(.adh) :where(.act-row) { grid-template-columns: 28px 1fr; }
  :where(.adh) :where(.act-row > :not(.act-pick)) { grid-column: 2; }
  :where(.adh) :where(.btn) { min-height: 36px; }
}

/* ---------- 推广中心自己的 ---------- */
.adh .pg-head .blk.adh-lead { border: 0; padding: 0; margin: 0; background: none; box-shadow: none; }
.adh .pg-head .blk.adh-lead .blk-who { margin: 4px 0 0; }
.adh .tbl td:first-child { white-space: nowrap; }
.adh .adh-did { margin: 0 0 12px; }
/* 依据表、笔记投放表（ADS.{p}.计划.4、ADS.xhs.计划.5）：不再套 72vh 的内层滚动框（11/17：页面里再滚一层、最后一行切半）；
   短列不折行（以前「品」挤成 44px、一字一行），计划名、标题、建议怎么调给最小宽度；列多时整张表左右滑（外面的 .scroll-x） */
.adh .adh-tall { max-height: none; overflow-y: visible; }
.adh #adh-plans th, .adh #adh-plans td, .adh #adh-notes th, .adh #adh-notes td { white-space: nowrap; }
.adh #adh-plans td.adh-name, .adh #adh-notes td.adh-name { white-space: normal; min-width: 180px; max-width: 300px; }
.adh #adh-notes td.adh-how { white-space: normal; min-width: 200px; max-width: 320px; }
.adh .adh-more a.more { display: inline-block; font-size: 15px; color: var(--pop-ink); background: var(--pop-soft); border-radius: 8px; padding: 6px 12px; margin: 0 4px; text-decoration: none; }
.adh .adh-sub { display: block; font-size: 12px; color: var(--muted, #6b6560); font-weight: 400; }
.adh .adh-wrap { min-width: 180px; max-width: 320px; font-size: 13px; }
.adh .adh-btns { white-space: nowrap; }
.adh .adh-btns form, .adh .adh-btns details { display: inline-block; margin: 0 4px 4px 0; }
.adh .adh-spark svg { display: block; width: 90px; height: 24px; }
.adh .adh-pending { margin: 4px 0; padding: 8px 12px; background: var(--amber-soft, #fdf2df); color: var(--amber, #a35c00); border-radius: 8px; font-size: 14px; }
.adh .adh-fine, .adh .adh-line, .adh .adh-more { font-size: 14px; color: var(--muted, #6b6560); margin: 8px 0 0; }
.adh .adh-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.adh .act-why { display: inline-block; }
.adh .act-why > summary { list-style: none; cursor: pointer; }
.adh .act-why > summary::-webkit-details-marker { display: none; }
.adh .act-why-in { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.adh .act-why-in .in { min-width: 180px; }
.adh .act-fix { margin: 4px 0 0; padding-left: 16px; }
.adh .act-row.st-done, .adh .act-row.st-skip { opacity: .7; }
.adh .adh-req { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.adh .adh-req .in { min-width: 200px; }
.adh code { font-size: 13px; }
@media (max-width: 760px) {
  .adh .adh-wrap { min-width: 140px; }
}
.adh .adh-where { min-width: 130px; }
.adh .adh-diag .t { white-space: nowrap; }

/* ---------- 11/17 视觉一遍（逐页版面 /ads）：KPI 一排、走势 ‖ 占比、问题卡、并排两块 ---------- */
.adh .kpis.adh-kpis { margin: 0 0 16px; }
.adh .adh-charts .blk.adh-chart { padding: 14px 16px 12px; }
.adh .adh-charts .chart { border: 0; padding: 0; margin: 0; box-shadow: none; background: none; }
.adh .adh-charts .chart-h { margin: 0 0 8px; font-size: 13px; color: var(--mute, #6b6560); }
.adh .adh-charts .chart-h b { color: var(--ink); font-size: 15px; font-weight: 600; }
.adh .adh-pair { align-items: start; }
.adh .adh-pair > .blk, .adh .adh-stack > .blk { margin: 0; min-width: 0; }
.adh .adh-stack { display: grid; gap: 16px; min-width: 0; align-content: start; }
.adh .cols + .blk, .adh .cols + .cols { margin-top: 16px; }
.adh .cols { margin-bottom: 16px; }
/* 问题出在哪：一条一张卡（灵犀「在投诊断」） */
.adh .adh-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.adh .adh-cat { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--tint, #f7f6f3); border: 1px solid var(--line); }
.adh .adh-cat small { font-size: 12px; color: var(--mute, #6b6560); }
.adh .adh-cat b { font: 600 15px/1.3 var(--num, inherit); color: var(--ink); }
.adh .adh-sort { display: inline-flex; align-items: center; gap: 2px; padding: 2px; margin: 0 0 10px; border-radius: 8px; background: var(--gray-soft, #f1efec); font-size: 13px; }
.adh .adh-sort span { padding: 0 6px 0 8px; color: var(--mute, #6b6560); }
.adh .adh-sort button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font: inherit; color: var(--ink-2, #3d3a36); cursor: pointer; }
.adh .adh-sort button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 20, 20, .08); }
.adh .adh-pcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adh .adh-pc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; display: grid; gap: 6px; }
.adh .adh-pc-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.adh .adh-pc-h .rank-i { flex: none; }
.adh .adh-pc:nth-child(-n+3) .rank-i { background: var(--pop-soft); color: var(--pop-ink); }
.adh .adh-pc-h .adh-where { font-size: 13px; color: var(--mute, #6b6560); min-width: 0; }
.adh .adh-pc-m { margin-left: auto; display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.adh .adh-pc-m small { font-size: 12px; color: var(--mute, #6b6560); }
.adh .adh-pc-m b { font: 700 20px/1.1 var(--num, inherit); color: var(--ink); letter-spacing: -.01em; }
.adh .adh-pc-q { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; }
.adh .adh-pc-q .adh-sub { font-weight: 400; margin-top: 2px; }
.adh .adh-pc-bac { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 3px 8px; margin: 0; font-size: 13px; line-height: 1.5; }
.adh .adh-pc-bac dt { color: var(--mute, #6b6560); }
.adh .adh-pc-bac dd { margin: 0; color: var(--ink-2, #3d3a36); }
.adh .adh-pc-f { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--mute, #6b6560); }
.adh .adh-pc-f b { color: var(--ink); font-family: var(--num, inherit); }
.adh .adh-pc-f .adh-btns { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.adh .adh-pc-f .adh-btns form { margin: 0; }
/* 一行状态小牌不折 */
.adh .adh-pc .t { white-space: nowrap; }
@container main (min-width: 1500px) { .adh .adh-pcs.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 要做的事放在并排的半栏里（主栏旁边只剩 ~400px）：一行竖着摞「来源·店｜事｜怎么做｜复核｜谁·截止｜按钮」，表头收掉、怎么做和复核带小标题，字一个不少 */
@container acts (max-width: 560px) {
  .adh .acts-head.acts-head { display: none; }
  .adh .act-row.act-row { grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "pick src" "pick what" "pick how" "pick check" "pick due" "pick btns"; row-gap: 4px; }
  .adh .act-row.act-row:not(:has(.act-pick)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "src" "what" "how" "check" "due" "btns"; }
  .adh .act-pick { grid-area: pick; } .adh .act-src { grid-area: src; } .adh .act-what { grid-area: what; } .adh .act-how { grid-area: how; }
  .adh .act-check { grid-area: check; } .adh .act-due { grid-area: due; } .adh .act-btns { grid-area: btns; justify-content: flex-start; }
  .adh .act-how:not(:empty)::before { content: "怎么做 "; color: var(--mute); font-weight: 600; }
  .adh .act-check:not(:empty):not(:has(> span))::before { content: "复核 "; font-weight: 600; }
  .adh .act-how:empty, .adh .act-check:empty { display: none; }
  .adh .act-row .act-btns { display: flex; flex-wrap: wrap; gap: 6px; }
}
/* 推广页整页包在 .adh 里：壳给 .pmain > div 的 flow-root 会让整个 .adh 一直让开右栏（过了右栏的底，宽表也只有 850 宽）。
   .adh 自己不做 BFC，由里面的块各自让开右栏（壳 :where(.pmain > div > section.blk…) 已经给了 flow-root），宽表过了右栏的底回到满宽 */
.pmain > .adh { display: block; }
.adh > .hub-tabs, .adh > .sub-tabs, .adh > .note, .adh > .kpis, .adh > .cols, .adh > p, .adh > div { display: flow-root; }
.adh > .kpis, .adh > .cols { display: grid; }
/* 问题卡：半栏里一张一行，主栏旁边两张并排，满宽三张 */
.adh .adh-pcs { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); align-items: start; }
/* 11/17 复核第 3 条：依据表、笔记投放表在 1150 宽里放不下，状态、负责人、建议、投产被横滑藏住。
   决定列（建议、状态、负责人 / 投产、建议怎么调、交给谁、做到哪）挪到名字后面；表头折行、长文字列限宽折行、格子收窄 */
.adh #adh-plans th, .adh #adh-notes th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.adh #adh-plans th, .adh #adh-plans td, .adh #adh-notes th, .adh #adh-notes td { padding-left: 7px; padding-right: 7px; }
.adh #adh-plans td.adh-name, .adh #adh-notes td.adh-name { min-width: 150px; max-width: 220px; }
.adh #adh-notes td.adh-how { min-width: 160px; max-width: 240px; }
.adh #adh-plans td:nth-last-child(2) { white-space: normal; min-width: 90px; max-width: 160px; font-size: 13px; }
.adh #adh-plans td.adh-spark svg { width: 72px; }
.adh #adh-plans code, .adh #adh-notes code { font-size: 12px; }
/* 11/17 复核第 3 条：/ads 各平台表要 1386 宽、只有 1150：表头折行、格子收窄、占比小条缩窄，花费异常、低于线的花费不再被横滑藏住 */
.adh #adh-home-2 th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.adh #adh-home-2 th, .adh #adh-home-2 td { padding-left: 6px; padding-right: 6px; }
.adh #adh-home-2 .mbar { max-width: 56px; }
.adh #adh-home-2 td .adh-sub { white-space: nowrap; }
.adh #adh-plans td:first-child, .adh #adh-plans td.adh-st, .adh #adh-notes td:nth-child(6), .adh #adh-notes td:nth-child(7), .adh #adh-notes td:nth-child(8) { white-space: normal; min-width: 64px; max-width: 110px; }
.adh #adh-plans td:nth-child(8), .adh #adh-notes td:first-child { white-space: normal; max-width: 130px; }
.adh #adh-plans td code, .adh #adh-notes td code { word-break: break-all; }
.adh #adh-plans td.adh-name, .adh #adh-notes td.adh-name { min-width: 120px; }
.adh #adh-plans td.adh-spark svg { width: 60px; }
/* 11/17 复核第 3 条：人群·每个品——「加这些省 / 排除这些省」挪到单数后面（在右栏旁边 814 宽也看得到），两个按钮上下排 */
.adh #adh-crowd td.adh-cbtns { white-space: normal; min-width: 96px; }
.adh #adh-crowd td.adh-cbtns > * { display: block; margin: 0 0 4px; }
.adh #adh-crowd th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
