/* 中性灰 + 站点蓝；平台页通过 --t0…--t7 / --brand / --btn 切换为该平台的主题色阶 */
:root {
  --bg: #F7F8FA; --surface: #FFFFFF; --line: #EAECF0; --line-2: #F2F4F7; --input: #D0D5DD;
  --ink: #101828; --ink-2: #344054; --ink-3: #475467; --muted: #667085; --faint: #98A2B3;
  --fill: #F2F4F7; --fill-2: #F9FAFB;
  --ok: #067647; --ok-bg: #ECFDF3; --warn: #B54708; --warn-bg: #FFFAEB; --warn-mark: #F79009; --err: #B42318; --err-bg: #FEF3F2;
  --link: #1C5CAB;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --t0: #EEF4FC; --t1: #DCE9FA; --t2: #B7D3F6; --t3: #86B6EF; --t4: #5A97E3; --t5: #2A78D6; --t6: #1C5CAB; --t7: #0D366B;
  --brand: #2A78D6; --btn: #101828;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, 'Noto Sans SC', system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: #104281; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid #2A78D6; outline-offset: 2px; }
.boot { padding: 48px; color: var(--muted); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }

/* ---------- 布局 ---------- */
.top { position: sticky; top: 0; z-index: 30; min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.icon-btn { width: 36px; height: 36px; flex: none; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--fill-2); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; font-weight: 600; }
.logo:hover { color: var(--ink); }
.logo i { width: 28px; height: 28px; border-radius: 7px; background: #101828; display: flex; align-items: center; justify-content: center; }
.grow { flex: 1 1 auto; }
.role { height: 34px; padding: 0 12px; border-radius: 999px; background: #EEF4FC; color: #1C5CAB; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; }
.role.viewer { background: var(--fill); color: var(--ink-3); }
.shell { display: flex; align-items: stretch; min-height: calc(100vh - 60px); }
.nav { width: 232px; flex: none; border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 20px; background: var(--surface); position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.nav[hidden] { display: none; }
.nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); }
.nav a:hover { background: var(--fill-2); color: var(--ink); }
.nav a.cur { background: var(--fill); color: var(--ink); font-weight: 600; }
.nav .group { display: flex; flex-direction: column; gap: 2px; }
.nav .group-label { padding: 0 10px 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.nav a.proj { color: var(--ink); font-weight: 500; }
.nav a.sub { height: 32px; padding: 0 10px 0 36px; font-size: 13px; color: var(--ink-3); }
/* 项目分组：项目名和折叠箭头同在一个圆角块里，箭头靠右；点项目名进入项目页 */
.nav .proj-group { display: flex; flex-direction: column; }
.nav .proj-group + .proj-group { margin-top: 2px; }
.nav .proj-row { display: flex; align-items: center; border-radius: 8px; padding-right: 4px; transition: background .12s; }
.nav .proj-row:hover { background: var(--fill-2); }
.nav .proj-row.cur { background: var(--fill); }
.nav .proj-row a.proj, .nav .proj-row a.proj:hover, .nav .proj-row a.proj.cur { flex: 1 1 auto; min-width: 0; background: transparent; }
.nav .fold { width: 26px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--faint); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s, color .12s; }
.nav .fold:hover { background: var(--line); color: var(--ink-2); }
.nav .fold svg { transform: rotate(90deg); transition: transform .18s ease; }
.nav .folded .fold svg { transform: rotate(0deg); }
.nav .in .fold { color: var(--muted); }
.nav .subs { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease, opacity .18s ease; }
.nav .folded .subs { grid-template-rows: 0fr; opacity: 0; }
.nav .subs-in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding-top: 2px; }
.nav a.sub .n { font-size: 12px; color: var(--faint); }
.nav a.sub.cur { background: var(--t1); color: var(--t7); font-weight: 600; }
.badge-sq { width: 20px; height: 20px; flex: none; border-radius: 5px; background: #EEF4FC; color: #1C5CAB; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.content { flex: 1 1 auto; min-width: 0; }
.page { max-width: 1200px; margin: 0 auto; padding: 24px 32px 56px; display: flex; flex-direction: column; gap: 28px; }
.page.tight { gap: 20px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: -8px; }
.crumbs a { color: var(--ink-3); }
.crumbs b { color: var(--ink); font-weight: 500; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.page-head .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.page-head.center { align-items: center; }
.proj-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.proj-head h1 { font-size: 22px; }
.proj-head .links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 4px; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #EEF4FC; color: #1C5CAB; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sec { display: flex; flex-direction: column; gap: 12px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.sec-head h2 { font-size: 16px; font-weight: 600; }
.sec-head span { font-size: 12px; color: var(--muted); }
.g { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 250px)), 1fr)); }
.g.fill { grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 250px)), 1fr)); }
.g6 { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.g-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }

/* ---------- 按钮与控件 ---------- */
.btn { height: 36px; padding: 0 14px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.btn:hover { background: var(--fill-2); color: var(--ink); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: #101828; border-color: #101828; color: #FFFFFF; box-shadow: none; }
.btn.primary:hover { background: #1D2939; color: #FFFFFF; }
.btn.theme { background: var(--btn); border-color: var(--btn); color: #FFFFFF; box-shadow: none; }
.btn.theme:hover { filter: brightness(1.08); color: #FFFFFF; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.danger { color: var(--err); }
.seg { display: inline-flex; border: 1px solid var(--input); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { height: 36px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink-3); font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--input); }
.seg button[aria-pressed="true"] { background: var(--fill); color: var(--ink); font-weight: 600; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--fill); border-radius: 8px; padding: 3px; }
.tabs button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--t7); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.tabs.plain { background: transparent; padding: 0; }
.tabs.plain button { font-size: 12px; padding: 0 10px; color: var(--muted); }
.tabs.plain button[aria-selected="true"] { background: var(--fill); color: var(--ink); box-shadow: none; }
.presets { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.presets button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); font-size: 12px; cursor: pointer; }
.presets button[aria-pressed="true"] { background: #101828; color: #FFFFFF; font-weight: 500; }
.field input, .field select { height: 36px; padding: 0 10px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.field textarea, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; color: var(--ink); resize: vertical; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; min-width: 0; text-align: left; color: var(--ink); }
button.card, a.card { cursor: pointer; font: inherit; transition: border-color .12s, box-shadow .12s; }
button.card:hover, a.card:hover { border-color: var(--input); box-shadow: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04); color: var(--ink); }
.card.flush { padding: 0; gap: 0; }
.card.p20 { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.card-head.top-align { align-items: flex-start; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title.sm { font-size: 14px; }
.card-sub { font-size: 12px; color: var(--muted); line-height: 1.5; font-weight: 400; }
.title-box { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big b { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.big span { font-size: 12px; color: var(--ink-3); }
.delta { font-size: 12px; font-weight: 500; color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.delta.flat { color: var(--ink-3); background: var(--fill); }
.foot-row { display: flex; justify-content: space-between; gap: 10px; width: 100%; border-top: 1px solid var(--line-2); padding-top: 12px; font-size: 13px; color: var(--ink-3); }
.foot-row b { color: var(--ink); font-weight: 600; }
.foot-row b.warn { color: var(--warn); }
.note-warn { font-size: 12px; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 6px 8px; }
.stretch { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.stretch.center { justify-content: center; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-card { grid-column: 1 / -1; }

/* 关键数字格子 */
.kgrid { display: flex; flex-wrap: wrap; gap: 1px; width: 100%; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kc { flex: 1 1 84px; background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* 用户支持：上排三个计数，下排两个用时加宽 */
.kgrid.issue-k { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.issue-k .kc { grid-column: span 2; }
.issue-k .kc:nth-child(n+4) { grid-column: span 3; }
.kl { font-size: 12px; color: var(--muted); }
.kv { font-size: 18px; font-weight: 600; white-space: nowrap; }
.kd { font-size: 11px; color: var(--muted); }
.kd.ok { color: var(--ok); }

/* 平台页指标条 */
.kstrip { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 1px; background: var(--line); }
@media (max-width: 1100px) { .kstrip { grid-template-columns: repeat(var(--half, 3), minmax(0, 1fr)); } }
@media (max-width: 560px) { .kstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kstrip > div { background: var(--surface); padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kstrip .k-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink-3); }
.kstrip .k-top em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--ok); white-space: nowrap; }
.kstrip .k-top em.flat { color: var(--muted); }
.kstrip .k-top em.down { color: var(--err); }
.kstrip .k-v { font-size: 24px; font-weight: 600; }
.kstrip .k-foot { font-size: 11px; color: var(--faint); }

/* 横幅 */
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: 12px; background: var(--t0); border: 1px solid var(--t1); }
.banner h1 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; }
.banner .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; margin-top: 8px; color: var(--ink-3); }
.banner .chips a { color: var(--t7); font-weight: 500; }
.plogo { width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--brand); color: #FFFFFF; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chip { font-weight: 500; border-radius: 999px; padding: 2px 8px; background: #FFFFFF; border: 1px solid var(--t2); color: var(--t7); display: inline-flex; align-items: center; gap: 6px; }
.pill { font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 8px; white-space: nowrap; background: var(--fill); color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--err-bg); color: var(--err); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--fill); font-size: 12px; color: var(--ink-2); }

/* ---------- 图表 ---------- */
.dot { display: inline-block; flex: none; border-radius: 50%; }
.sq { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bars { display: flex; align-items: stretch; gap: 3px; width: 100%; height: 120px; }
.bars.h48 { height: 48px; }
.bars.h56 { height: 56px; }
.bars.h180 { height: 180px; }
.bars.fill { flex: 1 1 auto; height: auto; min-height: 200px; }
.bars.gap4 { gap: 4px; }
.bars .col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bars .plot { flex: 1 1 auto; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.bars .bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--t2); }
.bars .bar.hi { background: var(--brand); }
.bars .bar.na { height: 8%; background: transparent; border: 1px dashed var(--faint); border-bottom: 0; }
.bars .lab { height: 12px; font-size: 10px; color: var(--ink-3); text-align: center; line-height: 12px; white-space: nowrap; }
.bars .marks { height: 6px; display: flex; justify-content: center; gap: 1px; }
.bars .marks i { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.bars .col:hover .bar:not(.na) { filter: brightness(.92); }
.axis { display: flex; justify-content: space-between; width: 100%; font-size: 11px; color: var(--faint); }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 400; color: var(--muted); }
.chart-legend .na-key { width: 10px; height: 6px; border: 1px dashed var(--faint); border-radius: 2px; }
.linebox { position: relative; width: 100%; }
.linebox svg { display: block; }
/* 负外边距让折线基线与右侧周内分布的柱底对齐 */
.linebox.fill { flex: 1 1 auto; min-height: 180px; margin-bottom: -10px; }
.linebox.fill svg { position: absolute; inset: 0; }
.lmarks { position: absolute; inset: 0; pointer-events: none; }
.lmarks span { position: absolute; bottom: 6px; display: flex; gap: 1px; transform: translateX(-50%); }
.lmarks i { width: 5px; height: 5px; border-radius: 50%; }
.hover-cols { position: absolute; inset: 0; display: flex; }
.hover-cols span { flex: 1 1 0; }
.hover-cols.at span { position: absolute; top: 0; bottom: 0; }
.hover-cols span:hover { background: linear-gradient(90deg, transparent calc(var(--gx, 50%) - .5px), #98A2B3 calc(var(--gx, 50%) - .5px), #98A2B3 calc(var(--gx, 50%) + .5px), transparent calc(var(--gx, 50%) + .5px)); }
.spark { display: block; }
.rows { flex: 1 1 auto; display: flex; flex-direction: column; gap: 10px; width: 100%; min-height: 0; }
.rows.g8 { gap: 8px; }
.hrow { flex: 1 1 0; min-height: 18px; display: grid; gap: 10px; font-size: 13px; }
.hname { align-self: center; display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-3); white-space: nowrap; }
.hv { align-self: center; text-align: right; font-weight: 600; white-space: nowrap; }
.hp { align-self: center; text-align: right; color: var(--muted); }
.track { display: flex; border-radius: 6px; background: var(--fill); min-height: 16px; }
.track .fill { display: block; border-radius: 6px; }
.track.thin { min-height: 6px; height: 6px; border-radius: 3px; }
.track.thin .fill { border-radius: 3px; }
.stack { display: flex; gap: 2px; height: 100%; border-radius: 6px; overflow: hidden; }
.stack-row { flex: 1 1 0; min-height: 44px; max-height: 76px; display: flex; flex-direction: column; gap: 6px; }
.stack-row .st-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.stack-row .st-top span:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stack-row .st-top span:last-child { color: var(--ink-3); white-space: nowrap; }
.stack-row .st-top b { font-weight: 600; color: var(--ink); }
.stack-row .st-bar { flex: 1 1 auto; min-height: 18px; max-height: 44px; display: flex; border-radius: 6px; background: var(--fill); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line-2); padding-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend.bare { border-top: 0; padding-top: 0; }
.wc { flex: 1 1 auto; min-height: 180px; width: 100%; border-radius: 8px; background: var(--fill-2); padding: 14px 16px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; align-items: baseline; gap: 4px 12px; line-height: 1.25; }
.wc .neg { text-decoration: underline wavy var(--warn-mark); text-underline-offset: 4px; }
.empty-wc { color: var(--faint); align-items: center; font-size: 13px; }
.wc-key { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.wc-key .neg { color: var(--warn); text-decoration: underline wavy var(--warn-mark); text-underline-offset: 3px; }
.funnel-step { flex: 1 1 0; min-height: 46px; display: flex; flex-direction: column; gap: 6px; }
.funnel-step .fs-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.funnel-step .fs-top b { color: var(--ink); font-weight: 600; }
.funnel-step .track { flex: 1 1 auto; min-height: 20px; }
.tiles { flex: 1 1 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; width: 100%; }
.tiles > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile { flex: 1 1 0; min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; border-radius: 6px; font-size: 13px; }
.tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.tile b { font-weight: 600; }
.issue-row { flex: 1 1 0; min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border-radius: 8px; background: #F6F8FA; font-size: 13px; }
.issue-row span { color: var(--ink-2); }
.issue-row b { color: var(--ok); font-weight: 500; white-space: nowrap; }
.issue-row b.open { color: var(--warn); }
.split { display: flex; flex-direction: column; gap: 7px; width: 100%; border-top: 1px solid var(--line-2); padding-top: 10px; }
.split .sp { display: grid; grid-template-columns: 56px minmax(0, 1fr) 48px; align-items: center; gap: 8px; font-size: 12px; }
.split .sp > span:first-child { display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.split .sp b { text-align: right; font-weight: 500; }
.keyed { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.keyed > span { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.keyed b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.num-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; color: #FFFFFF; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.scatter { width: 100%; height: auto; display: block; }
.mult { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.mult .m-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.mult .m-top b { color: var(--ink); }
.mult .bars { flex: 1 1 auto; height: auto; min-height: 60px; }

/* ---------- 列表与表格 ---------- */
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.list li:first-child { border-top: 0; }
.list .li-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list .li-main b { font-weight: 500; }
.list .li-main span { font-size: 12px; color: var(--muted); }
.list .li-date { width: 40px; flex: none; font-size: 12px; color: var(--muted); align-self: flex-start; padding-top: 1px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: relative; background: var(--fill-2); color: var(--ink-3); font-size: 12px; font-weight: 500; text-align: left; padding: 8px 12px; white-space: nowrap; }
.tbl td { padding: 9px 12px; border-top: 1px solid var(--line-2); white-space: nowrap; }
/* 表格铺满容器；有 .flex 列时其余列收缩到内容宽度，.flex 列（对比条、长名称）分剩余空间 */
.tbl:has(th.flex) th:not(.flex) { width: 1%; }
.tbl td.wrap { white-space: normal; min-width: 10em; }
/* 名称列贴合文字，过长省略（完整文字在 title 里） */
.tbl .name-cell .ell { max-width: 26em; }
@media (max-width: 640px) { .tbl .name-cell .ell { max-width: 12em; } }
/* 点表头排序：再点一次切换升降序 */
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink-2); }
.tbl th.sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.tbl th[aria-sort="ascending"], .tbl th[aria-sort="descending"] { color: var(--ink); font-weight: 600; }
.tbl th[aria-sort="ascending"]::after { content: ' ↑'; }
.tbl th[aria-sort="descending"]::after { content: ' ↓'; }
/* 用户拖过列宽后改为固定布局，只按记下的宽度排 */
.tbl.rz { table-layout: fixed; }
.tbl.rz th, .tbl.rz td { overflow: hidden; text-overflow: ellipsis; }
/* 手柄完全在本列内（吸顶表头各自成层，越界部分会被下一列盖住） */
.col-rz { position: absolute; top: 0; right: 0; z-index: 2; width: 9px; height: 100%; cursor: col-resize; touch-action: none; }
.col-rz::after { content: ''; position: absolute; top: 28%; bottom: 28%; right: 0; width: 1px; background: var(--line); transition: background .12s, top .12s, bottom .12s; }
.tbl th:last-child > .col-rz::after { right: 1px; }
.tbl th:hover > .col-rz::after { background: var(--input); }
.col-rz:hover::after, .col-rz.on::after { top: 0; bottom: 0; width: 2px; background: var(--brand); }
html.col-resizing, html.col-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (pointer: coarse) { .col-rz { width: 18px; } }
.name-cell { display: inline-flex; align-items: center; gap: 6px; min-width: 0; vertical-align: middle; }
.tbl .r { text-align: right; }
.tbl tbody tr:hover td { background: var(--fill-2); }
.tbl td.pl, .tbl th.pl { padding-left: 20px; }
.tbl td.pr, .tbl th.pr { padding-right: 20px; }
.tbl .cellbar { display: inline-flex; align-items: center; gap: 8px; }
.tbl .cellbar .track { width: 64px; min-height: 8px; height: 8px; border-radius: 4px; }
.tbl .cellbar .fill { border-radius: 4px; }
.tbl .cellbar span:last-child { min-width: 44px; }
.tbl .t-title { display: flex; flex-direction: column; gap: 2px; }
.tbl .t-title a { color: var(--ink); font-weight: 500; }
.tbl .t-title a:hover { color: var(--link); }
.tbl .t-title span { font-size: 12px; color: var(--muted); }
.scroll-x { overflow-x: auto; }
.scroll-y { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.scroll-y thead th { position: sticky; top: 0; z-index: 1; }
.c-item { display: grid; grid-template-columns: minmax(0, 1fr) 60px 52px 52px 56px; align-items: center; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line-2); font-size: 13px; }
.c-item .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; }
.c-item .t a { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-item .t a:hover { color: var(--link); }
.c-item .t span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.c-item > span { text-align: right; }
.c-item > span i { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.c-item .t .thread-tag, .thread-tag { display: inline-flex; flex: none; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; background: var(--fill); color: var(--ink-2); font-size: 11px; }
.c-item.ranked { grid-template-columns: 24px minmax(0, 1fr) 60px 52px 52px 56px; padding: 10px 24px; }
.c-item .rank { color: var(--faint); font-size: 12px; text-align: left; }
.thread-btn { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px 0 8px; border: 1px solid var(--input); border-radius: 6px; background: var(--surface); color: var(--ink-2); font-size: 11px; cursor: pointer; }
.thread-btn:hover { background: var(--fill-2); }
.thread-btn[aria-expanded="true"] svg { transform: rotate(-90deg); }
.thread-btn svg { transform: rotate(90deg); width: 12px; height: 12px; }
.thread-kids { background: var(--fill-2); padding: 2px 0 10px; }
.c-item.sub { border-top: 0; padding-top: 6px; padding-bottom: 6px; font-size: 12px; color: var(--ink-3); }
.c-item.sub .t .kid { flex-direction: row; gap: 8px; padding-left: 12px; min-width: 0; color: var(--ink-2); font-size: 12px; }
.c-item.sub .t a { font-weight: 400; color: var(--ink-2); }
.c-item.sub > span i { display: none; }
.thread-kids .note { margin: 4px 24px 0 60px; font-size: 11px; color: var(--muted); }
.list-more { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; width: 100%; border: 0; border-top: 1px solid var(--line-2); border-radius: 0 0 12px 12px; background: var(--fill-2); color: var(--link); font-size: 13px; font-weight: 500; cursor: pointer; }
.list-more:hover { background: var(--fill); }
.list-more > span { color: var(--muted); font-weight: 400; }
.modal.wide { width: min(760px, calc(100vw - 32px)); }
.modal.all-content { padding: 0; gap: 0; overflow: hidden; display: flex; }
.all-content .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 12px; }
.all-content .all-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 0 24px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.all-content .all-list { overflow-y: auto; min-height: 0; }
@media (max-width: 640px) {
  .c-item.ranked { grid-template-columns: minmax(0, 1fr) 56px 48px; padding: 10px 16px; }
  .c-item.ranked > span:first-child, .c-item.ranked > span:nth-child(5), .c-item.ranked > span:nth-child(6) { display: none; }
  .c-item.ranked > span:nth-child(4) { display: block; }
  .thread-kids .note { margin-left: 16px; }
}
.comment-list { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.comment-list li { list-style: none; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--fill-2); display: flex; gap: 10px; justify-content: space-between; }
.comment-list li span { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 首页 */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); min-width: 0; }
a.kpi:hover { border-color: var(--input); color: var(--ink); }
.kpi .kpi-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-3); }
.kpi .kpi-v { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.kpi .kpi-b { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .kpi-b svg { width: 64px; flex: none; }
.add-card { min-height: 300px; border: 1.5px dashed var(--input); border-radius: 12px; background: var(--surface); color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; padding: 24px; }
.add-card:hover { border-color: var(--faint); }
.add-card i { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); display: flex; align-items: center; justify-content: center; }
.add-card b { font-size: 15px; color: var(--ink); }
.add-card span { font-size: 13px; color: var(--muted); max-width: 240px; text-align: center; line-height: 1.6; }
.pcard { gap: 16px; padding: 20px; }
.pcard .p-top { display: flex; align-items: center; gap: 12px; }
.pcard .avatar { width: 40px; height: 40px; font-size: 14px; }
.pcard .p-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pcard .p-name b { font-size: 15px; }
.pcard .p-name span { font-size: 12px; color: var(--muted); }
.pcard .p-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard .p-foot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.pcard .p-foot b { color: var(--link); font-weight: 500; }

/* ---------- 弹窗 ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; overflow: visible; }
dialog::backdrop { background: rgba(16, 24, 40, .40); }
.detail { width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .25); }
.d-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.d-head .eyebrow { font-size: 12px; color: var(--muted); }
.d-head h2 { font-size: 20px; font-weight: 600; }
.d-head .src { font-size: 12px; color: var(--muted); }
.d-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 24px; background: var(--fill-2); border-bottom: 1px solid var(--line); }
.d-filter .dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.d-filter .dp-trigger { height: 34px; font-size: 13px; }
.d-filter .note { font-size: 12px; color: var(--muted); }
.d-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 22px; }
/* 指标格按内容宽度排、放不下自动换行，每行拉伸铺满；文字不截断 */
.d-kpis { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.d-kpis > span { flex: 1 1 auto; background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.d-kpis .kl { white-space: nowrap; }
.d-kpis b { font-size: 19px; font-weight: 600; white-space: nowrap; }
.d-kpis b.up { color: var(--ok); }
.d-kpis b.down { color: var(--err); }
.d-kpis b.na { color: var(--faint); }
.d-kpis b.warn { color: var(--warn); }
.d-kpis > span.x { background: var(--t0); }
.d-kpis > span.x .kl { color: var(--t6); }
.d-kpis > span.x b { color: var(--t7); }
.d-charts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 24px; }
.d-charts > div { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.week { flex: 1 1 auto; display: flex; align-items: stretch; gap: 8px; min-height: 180px; }
.week .wcol { flex: 1 1 0; display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 11px; color: var(--ink-3); }
.week .wcol .plot { flex: 1 1 auto; width: 100%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.week .wcol .bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--t2); }
.week .wcol .bar.hi { background: var(--brand); }
.week .wcol .wl { color: var(--muted); }
.d-sec { display: flex; flex-direction: column; gap: 8px; }
.d-sec h3 { font-size: 14px; font-weight: 600; }
.d-sec .pctcell { display: flex; align-items: center; gap: 8px; min-width: 150px; }
@media (max-width: 640px) { .d-sec .pctcell { min-width: 72px; } }
.d-sec .pctcell .track { flex: 1 1 auto; }
.d-sec .pctcell span:last-child { width: 40px; text-align: right; color: var(--ink-3); }
.d-sec .pctcell > span:last-child:empty { display: none; }
.d-foot { font-size: 12px; color: var(--muted); }
.modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .25); padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal h2 { font-size: 18px; font-weight: 600; }
.modal .hint { font-size: 12px; color: var(--muted); margin: 0; font-weight: 400; }
.modal .err { color: var(--err); font-size: 13px; margin: 0; }
.modal .err:empty { display: none; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; }
.modal .list li { padding: 10px 0; }
/* 导入：说明、拖放上传区、选中文件、预览结果 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.imp-intro { display: flex; flex-direction: column; gap: 10px; margin-top: -4px; }
.imp-lead { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.imp-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.imp-steps li { display: inline-flex; align-items: center; gap: 6px; }
.imp-steps li + li::before { content: ''; width: 16px; height: 1px; margin-right: 2px; background: var(--input); }
.imp-steps b { width: 18px; height: 18px; border-radius: 50%; background: var(--fill); color: var(--ink-2); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.imp-pick { position: relative; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px 16px 22px; border: 1.5px dashed var(--input); border-radius: 12px; background: var(--fill-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.drop:hover { border-color: var(--t4); background: var(--t0); }
.drop:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.imp-pick.over .drop { border-color: var(--brand); border-style: solid; background: var(--t0); box-shadow: 0 0 0 4px var(--t1); }
.drop-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--brand); display: flex; align-items: center; justify-content: center; transition: transform .15s ease; }
.drop:hover .drop-ic, .imp-pick.over .drop-ic { transform: translateY(-2px); }
.drop-t { font-size: 14px; font-weight: 500; color: var(--ink); }
.drop-t u { text-decoration: none; color: var(--link); }
.drop-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.drop-tags span { padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font: 500 11px/1.4 ui-monospace, Menlo, monospace; }
.drop-file { display: none; align-items: center; gap: 12px; padding: 12px 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.imp-pick.has-file .drop { display: none; }
.imp-pick.has-file .drop-file { display: flex; }
.imp-pick.over.has-file .drop-file { border-color: var(--brand); box-shadow: 0 0 0 4px var(--t1); }
.imp-pick.busy { opacity: .6; pointer-events: none; }
.drop-file-ic { width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--t0); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.drop-file .li-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.drop-file .li-main b { font-size: 13px; font-weight: 500; color: var(--ink); }
.drop-file .li-main span { font-size: 12px; color: var(--muted); }
.icon-btn.sm { width: 30px; height: 30px; border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.sm:hover { background: var(--fill); color: var(--ink); }
.imp-loading { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--fill-2); font-size: 13px; color: var(--muted); }
.spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.imp-box { display: flex; flex-direction: column; gap: 12px; font-size: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--fill-2); }
.imp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.imp-title { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--ink); }
.imp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.imp-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; }
.imp-stat b { font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--ok); }
.imp-stat b.zero { color: var(--faint); }
.imp-stat .sub { font-size: 11px; color: var(--muted); }
.imp-dup { margin: 0; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 12px; }
.imp-table { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.imp-box .tbl td { padding: 8px 12px; }
.imp-box .tbl tbody tr:first-child td { border-top: 0; }
.n3 { display: inline-flex; gap: 8px; font-size: 12px; color: var(--ink-3); }
.n3 b { font-weight: 600; color: var(--ink); }
.n3 .zero, .n3 .zero b { color: var(--faint); font-weight: 500; }
.imp-issues { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-3); }
.imp-box code { font-size: 12px; color: var(--ink); }
.imp-box.err-box { background: var(--err-bg); border-color: #FECDCA; }
.imp-box.err-box .imp-title { color: var(--err); }
.imp-box.warn-box { background: var(--warn-bg); border-color: #FEDF89; }
.imp-box.warn-box .imp-title { color: var(--warn); }

/* 日期选择器：年 → 月 → 日 */
.dp-field { display: inline-flex; min-width: 0; }
.field .dp-field { display: flex; }
.dp-trigger { height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 400; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: border-color .12s, box-shadow .12s; }
.field .dp-trigger { width: 100%; }
.dp-trigger svg { flex: none; color: var(--muted); }
.dp-trigger:hover { border-color: var(--faint); }
.dp-trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--t1); }
.dp-trigger.empty .dp-text { color: var(--faint); }
.dp-pop { position: fixed; left: 0; top: 0; z-index: 200; width: 280px; max-width: calc(100vw - 16px); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 13px; box-shadow: 0 16px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08); display: flex; flex-direction: column; gap: 10px; animation: dp-in .14s ease-out; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px); } }
.dp-head { display: flex; align-items: center; gap: 4px; }
.dp-crumbs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 2px; }
.dp-crumb { height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
button.dp-crumb { cursor: pointer; }
button.dp-crumb:hover { background: var(--t0); color: var(--t7); }
.dp-crumb.now:not(:only-child) { color: var(--muted); font-weight: 500; font-size: 13px; }
.dp-sep { color: var(--faint); }
.dp-nav { width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dp-nav:hover { background: var(--fill); color: var(--ink); }
.dp-grid { display: grid; gap: 4px; }
.dp-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dp-grid.g7 { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dp-wd { padding: 2px 0 4px; text-align: center; font-size: 11px; color: var(--faint); }
.dp-cell { position: relative; height: 42px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 13px; cursor: pointer; transition: background .1s, color .1s; }
.dp-grid.g7 .dp-cell { height: 34px; }
.dp-cell:hover { background: var(--fill); color: var(--ink); }
.dp-cell.out { color: var(--faint); }
.dp-cell.today { color: var(--t6); font-weight: 600; }
.dp-cell.today::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.dp-cell[aria-selected="true"] { background: #101828; color: #FFFFFF; font-weight: 600; }
.dp-cell[aria-disabled="true"] { background: transparent; color: var(--input); cursor: not-allowed; }
.dp-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dp-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.dp-link { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--link); font-size: 13px; font-weight: 500; cursor: pointer; }
.dp-link:hover { background: var(--t0); }
.dp-link.muted { color: var(--ink-3); }
.dp-link.muted:hover { background: var(--fill); }
.dp-link:disabled { background: transparent; color: var(--faint); cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  .nav .subs, .nav .fold svg, .drop, .drop-ic, .dp-cell { transition: none; }
  .dp-pop { animation: none; }
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field select { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
/* 提示框与通知 */
#tip { position: fixed; z-index: 100; left: 0; top: 0; pointer-events: none; max-width: 260px; padding: 6px 10px; border-radius: 8px; background: #101828; color: #FFFFFF; font-size: 12px; line-height: 1.5; box-shadow: 0 4px 12px rgba(16, 24, 40, .2); opacity: 0; transition: opacity .08s; white-space: pre-line; }
#tip.show { opacity: 1; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 120; padding: 10px 16px; border-radius: 10px; background: #101828; color: #FFFFFF; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .g-main, .d-charts { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; z-index: 40; left: 0; top: 60px; box-shadow: 0 12px 24px rgba(16, 24, 40, .12); }
}
@media (max-width: 640px) {
  .page { padding: 16px 16px 40px; gap: 22px; }
  .top { padding: 10px 16px; }
  .c-item { grid-template-columns: minmax(0, 1fr) 56px 48px; }
  .c-item > span:nth-child(4), .c-item > span:nth-child(5) { display: none; }
  .d-head, .d-filter, .d-body { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .d-kpis > span { flex-basis: 40%; }
}

/* 每日口径与采集完整性：沿用卡片风格，长来源说明允许换行。 */
.data-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.data-evidence { display: grid; gap: 10px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.data-evidence > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.data-evidence b { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.data-source { display: block; font-size: 11px; line-height: 1.5; color: var(--muted); white-space: normal; max-width: 190px; }
.kstrip .k-foot, .kpi .delta { white-space: normal; overflow-wrap: anywhere; }
.week .bar.na { height: 18px; background: transparent; border: 1px dashed var(--faint); }

.bars .bar.negative { background: var(--err); }
.kstrip .k-top { flex-wrap: wrap; }
.kstrip .k-top em { white-space: normal; }
.data-evidence span { line-height: 1.6; }
@media (max-width: 640px) {
  .kpi .kpi-b { flex-wrap: wrap; }
  .d-kpis b { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- 主页（统一入口）：登录、等待授权、面板卡片 ---------- */
.pt-logo i { color: #FFFFFF; }
.pt-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pt-center.pt-under-top { min-height: calc(100vh - 60px); }
.pt-login, .pt-wait, .pt-empty { width: 100%; background: var(--surface); border-radius: 14px; box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 0 0 1px rgba(16, 24, 40, .05); padding: 28px; display: flex; flex-direction: column; }
.pt-login { max-width: 380px; gap: 18px; }
.pt-brand { display: flex; flex-direction: column; gap: 8px; }
.pt-brand .logo { font-size: 17px; }
.pt-brand p { margin: 0; color: var(--ink-3); }
.pt-notice { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.pt-notice.warn { background: var(--warn-bg); color: var(--warn); }
.pt-notice.err { background: var(--err-bg); color: var(--err); }
.pt-feishu, .pt-auto { height: 44px; border-radius: 8px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.pt-feishu { background: #1C5CAB; color: #FFFFFF; }
.pt-feishu:hover { background: #0D366B; color: #FFFFFF; }
.pt-auto { background: #EEF4FC; color: #0D366B; }
@keyframes pt-spin { to { transform: rotate(360deg); } }
.spin { animation: pt-spin .9s linear infinite; }
.pt-divider { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.pt-divider span { flex: 1; height: 1px; background: var(--line); }
.pt-code { display: flex; gap: 8px; }
.pt-input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); font: inherit; color: var(--ink); }
.pt-input::placeholder, .am-input::placeholder { color: var(--muted); }
.pt-input:focus, .am-input:focus { outline: none; border-color: #2A78D6; box-shadow: 0 0 0 3px #DCE9F9; }
.pt-enter { height: 40px; padding: 0 16px; font-weight: 600; }
.pt-err { margin: -6px 0 0; color: var(--err); font-size: 13px; }
.pt-err:empty { display: none; }

.pt-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 220px; font-weight: 500; color: var(--ink-2); }
.pt-avatar { width: 30px; height: 30px; flex: none; border-radius: 999px; background: #EEF4FC; color: #1C5CAB; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.pt-avatar img, .am-av img { width: 100%; height: 100%; object-fit: cover; }
.pt-avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.pt-top .role { height: 30px; padding: 0 10px; }
.pt-top .role.viewer { color: var(--ink-2); }
.pt-exp { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.pt-manage[aria-expanded="true"] { border-color: #2A78D6; background: #EEF4FC; color: #0D366B; box-shadow: 0 0 0 3px #DCE9F9; font-weight: 600; }
.pt-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #B54708; color: #FFFFFF; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.pt-badge[hidden] { display: none; }

.pt-main { max-width: 1200px; margin: 0 auto; padding: 56px 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.pt-intro { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pt-intro h1 { font-size: 24px; font-weight: 600; }
.pt-intro p { margin: 0; color: var(--ink-3); }
.pt-boards { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.pt-board { flex: 1 1 420px; max-width: 540px; min-width: 0; aspect-ratio: 4 / 3; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; color: var(--ink); transition: box-shadow .2s, border-color .2s; }
.pt-board:hover { border-color: var(--input); box-shadow: 0 12px 24px -8px rgba(16, 24, 40, .12), 0 2px 4px rgba(16, 24, 40, .04); color: var(--ink); }
.pt-board:focus-visible { outline-offset: 3px; }
.pt-board-text { flex: none; padding: 18px 24px 20px; display: flex; flex-direction: column; gap: 6px; }
.pt-board-text h2 { font-size: 20px; font-weight: 600; }
.pt-board-text p { margin: 0; color: var(--ink-3); line-height: 1.6; }
.pt-board-foot { margin-top: 2px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pt-board-count { font-size: 13px; color: var(--ink-3); }
.pt-board-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #1C5CAB; white-space: nowrap; }
.pt-board:hover .pt-board-go { color: #0D366B; }
.pt-empty { max-width: 420px; margin: 0 auto; gap: 6px; text-align: center; }
.pt-empty h2 { font-size: 16px; font-weight: 600; }
.pt-empty p { margin: 0; color: var(--ink-3); }

.pt-wait { max-width: 420px; align-items: center; gap: 16px; text-align: center; }
.pt-wait-av { position: relative; display: inline-flex; }
.pt-wait-mark { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 999px; background: #FFFAEB; box-shadow: 0 0 0 2px #FFFFFF; color: #B54708; display: flex; align-items: center; justify-content: center; }
.pt-wait-mark svg { width: 13px; height: 13px; }
.pt-wait-text { display: flex; flex-direction: column; gap: 6px; }
.pt-wait-name { font-weight: 500; color: var(--ink-3); }
.pt-wait-text h1 { font-size: 20px; font-weight: 600; }
.pt-wait-text p { margin: 0; color: var(--ink-3); line-height: 1.6; }
.pt-refresh { width: 100%; height: 40px; justify-content: center; font-weight: 600; }

/* 面板缩略图：占位色块，只露出界面左上部分 */
.bt-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.bt-product { background: #EEF4FC; }
.bt-ops { background: #ECFDF3; }
.bt-wrap i { display: block; }
.bt-shot { position: absolute; top: 32px; left: 32px; width: 640px; height: 420px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .06); overflow: hidden; font-size: 11px; display: flex; flex-direction: column; transition: transform .25s; }
.pt-board:hover .bt-shot, .pt-board:focus-visible .bt-shot { transform: translate(4px, -4px); }
.bt-top { height: 40px; flex: none; padding: 0 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.bt-logo { width: 18px; height: 18px; border-radius: 5px; background: #101828; }
.bt-seg { height: 24px; padding: 2px; border-radius: 7px; background: #F2F4F7; display: inline-flex; gap: 2px; font-size: 10px; }
.bt-seg b { height: 20px; padding: 0 8px; border-radius: 5px; display: inline-flex; align-items: center; color: #667085; font-weight: 400; }
.bt-seg b.on { background: #FFFFFF; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); color: #101828; font-weight: 600; }
.bt-grow { flex: 1; }
.bt-role { height: 20px; padding: 0 8px; border-radius: 999px; background: #EEF4FC; color: #1C5CAB; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; }
.bt-me { width: 22px; height: 22px; border-radius: 999px; background: #EEF4FC; }
.bt-body { flex: 1; min-height: 0; display: flex; }
.bt-side { width: 150px; flex: none; padding: 12px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.bt-side > span { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px; border-radius: 5px; }
.bt-side > span.cur { background: #EEF4FC; }
.bt-main { flex: 1; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.bt-h { display: flex; align-items: center; justify-content: space-between; }
.bt-h strong { font-size: 12px; font-weight: 600; color: #101828; }
.bt-h > span { display: inline-flex; gap: 4px; }
.bt-panel { padding: 10px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.bt-gantt { gap: 4px; }
.bt-g { display: flex; align-items: center; gap: 8px; height: 22px; }
.bt-g em { width: 30px; font-style: normal; font-size: 10px; font-weight: 600; color: #344054; }
.bt-g > span { position: relative; flex: 1; height: 12px; border-radius: 4px; background: #F9FAFB; }
.bt-g > span i { position: absolute; top: 0; height: 12px; border-radius: 4px; }
.bt-row { display: flex; gap: 8px; }
.bt-box { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.bt-tag { display: block; width: 34px; height: 14px; border-radius: 4px; }
.bt-tag i { width: 18px; height: 4px; margin: 5px 8px; border-radius: 2px; }
.bt-line { display: flex; align-items: center; gap: 4px; }
.bt-legend { display: flex; justify-content: space-between; }
.bt-legend > span { display: inline-flex; gap: 6px; }
.bt-panel svg { display: block; width: 100%; height: 90px; }

@media (max-width: 640px) {
  .pt-main { padding: 24px 16px; gap: 16px; }
  .pt-intro { align-items: flex-start; text-align: left; }
  .pt-intro h1 { font-size: 20px; }
  .pt-boards { gap: 16px; }
  .pt-board { flex-basis: 100%; }
  .bt-shot { top: 20px; left: 20px; }
  .pt-board-text { padding: 14px 18px 16px; }
  .pt-top { padding: 12px 16px; gap: 8px 10px; }
  .pt-top .btn { height: 44px; }
  .pt-exp { order: 10; flex-basis: 100%; }
}
@media (max-width: 480px) {
  .pt-who .ell { display: none; }
  .pt-login, .pt-wait { padding: 22px; }
}

/* ---------- 运营面板顶栏：返回主页与面板切换 ---------- */
.home-link { width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); font-size: 0; display: inline-flex; align-items: center; justify-content: center; }
.home-link::before { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.home-link:hover { background: var(--fill-2); color: var(--ink); }
.bs { height: 38px; padding: 3px; border-radius: 10px; background: #F2F4F7; display: inline-flex; gap: 2px; flex: none; }
.bs-seg { height: 32px; padding: 0 12px; border-radius: 8px; color: var(--ink-3); font-weight: 500; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.bs-seg:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.bs-seg.on { background: #FFFFFF; box-shadow: 0 1px 3px rgba(16, 24, 40, .10), 0 1px 2px rgba(16, 24, 40, .06); color: var(--ink); font-weight: 600; }
.bs-seg.on svg, .bs-static svg { color: #067647; }
.bs-static { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.bs-static:hover { color: var(--ink); }
.bs-crumb { display: inline-flex; flex: none; }
.bs-proj { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 280px; font-weight: 600; color: var(--ink); }
.bs-proj:hover { color: var(--ink); }
.ops-top { flex-wrap: nowrap; }
@media (max-width: 640px) {
  .ops-top { gap: 8px; }
  .ops-top .icon-btn, .home-link { width: 40px; height: 40px; }
  .bs { height: 40px; }
  .bs-seg { width: 42px; height: 34px; padding: 0; justify-content: center; }
  .bs-l { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .bs-crumb, .bs-proj .badge-sq, .ops-top .role { display: none; }
}

/* ---------- 授权管理弹出面板 ---------- */
.am-pop { position: fixed; z-index: 60; background: #F7F8FA; border-radius: 16px; box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .24), 0 0 0 1px rgba(16, 24, 40, .08); padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.am-pop:focus { outline: none; }
.am-head { display: flex; align-items: center; gap: 10px; padding: 8px 4px 0; flex: none; }
.am-head h2 { flex: 1; font-size: 16px; font-weight: 600; }
.am-x { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.am-x:hover { background: var(--fill); color: var(--ink); }
.am-scroll { min-height: 0; overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin: 0 -12px -12px; padding: 2px 12px 12px; }
.am-card { flex: none; background: var(--surface); border-radius: 12px; box-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 0 0 1px rgba(16, 24, 40, .05); display: flex; flex-direction: column; }
.am-acc { width: 100%; height: 60px; padding: 0 16px; border: 0; border-radius: 12px; background: transparent; display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left; }
.am-acc:hover { background: var(--fill-2); }
.am-ico { width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--fill); color: var(--ink-2); display: flex; align-items: center; justify-content: center; }
.am-ico.blue { background: #EEF4FC; color: #1C5CAB; }
.am-acc-t { font-size: 15px; font-weight: 600; white-space: nowrap; }
.am-acc-n { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.am-pending { height: 22px; padding: 0 8px; border-radius: 999px; background: #FFFAEB; color: #B54708; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap; }
.am-acc-go { height: 32px; padding: 0 6px; color: #1C5CAB; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chev { flex: none; transition: transform .18s; }
.am-acc[aria-expanded="true"] .chev, .am-well-toggle[aria-expanded="true"] .chev, .am-link-btn[aria-expanded="true"] .chev, .am-sel-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.am-sec-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.am-sec-body[hidden] { display: none; }
.am-loading { margin: 0; padding: 16px; text-align: center; color: var(--ink-3); }
.am-well { border-radius: 10px; background: #F7F8FA; padding: 0 10px 10px; }
.am-well[hidden] { display: none; }
.am-well-h { height: 44px; padding: 0 4px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.am-q { position: relative; width: 16px; height: 16px; flex: none; padding: 0; border: 1.5px solid #98A2B3; border-radius: 999px; background: #FFFFFF; color: var(--ink-3); font: 600 10px/1 Inter, sans-serif; display: inline-flex; align-items: center; justify-content: center; cursor: help; }
.am-q::after { content: ''; position: absolute; inset: -5px; }
.am-box { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; }
.am-pend-list > li + li, .am-li + .am-li { border-top: 1px solid var(--line-2); }
.am-pend-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 10px 0 12px; }
.am-av { width: 28px; height: 28px; flex: none; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.am-av.admin { background: #EEF4FC; color: #1C5CAB; }
.am-row-user .am-av { width: 26px; height: 26px; }
.am-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.am-pend-row .am-name { flex: 1; }
.am-first { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: default; border-radius: 4px; }
.am-text, .am-link-btn, .am-danger { height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.am-text { color: var(--ink-3); }
.am-text:hover { background: var(--fill); color: var(--ink); }
.am-link-btn { color: #1C5CAB; }
.am-pend-row .am-link-btn { font-weight: 600; }
.am-link-btn:hover { background: #EEF4FC; color: #0D366B; }
.am-link-btn .chev { width: 15px; height: 15px; }
.am-danger { color: var(--err); }
.am-danger:hover { background: var(--err-bg); }
.am-danger.armed, .am-danger.armed:hover { background: var(--err); color: #FFFFFF; }
.am-link-btn.armed { background: #1C5CAB; color: #FFFFFF; }
.am-text:disabled, .am-link-btn:disabled, .am-danger:disabled, .am-chip:disabled, .am-btn:disabled { opacity: .6; cursor: progress; }
.am-form { margin: 0 10px 10px; padding: 12px; border-radius: 10px; background: #F7F8FA; display: flex; flex-direction: column; gap: 12px; }
.am-actions { display: flex; justify-content: flex-end; gap: 8px; }
.am-primary { height: 34px; padding: 0 16px; border: 0; border-radius: 8px; background: #101828; color: #FFFFFF; font-weight: 600; cursor: pointer; white-space: nowrap; }
.am-primary:hover { background: #1D2939; }
.am-primary:disabled { background: #98A2B3; cursor: not-allowed; }
.am-btn { height: 32px; padding: 0 12px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; }
.am-btn:hover { background: var(--fill-2); color: var(--ink); }
.am-field, .am-label, .am-select { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.am-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.am-label { display: inline-flex; align-items: center; gap: 6px; }
.am-input { width: 100%; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); }
select.am-input { padding: 0 10px; }
.am-select { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.am-form .am-select { width: 180px; }
.am-sel-btn { width: 100%; min-width: 0; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); font-size: 14px; font-weight: 400; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; }
.am-sel-btn .chev { color: var(--muted); }
.am-sel-btn[aria-expanded="true"] { border-color: #2A78D6; box-shadow: 0 0 0 3px #DCE9F9; }
.am-listbox, .am-multi-list { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; width: 300px; max-width: calc(100vw - 48px); padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 16px 32px -8px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .06); display: flex; flex-direction: column; gap: 2px; }
.am-listbox[hidden], .am-multi-list[hidden] { display: none; }
.am-opt { padding: 8px 10px; border-radius: 6px; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.am-opt > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.am-opt b { font-size: 14px; font-weight: 600; color: var(--ink); }
.am-opt > span > span { font-size: 13px; font-weight: 400; color: var(--ink-3); line-height: 1.45; }
.am-opt svg { flex: none; margin-top: 3px; color: #1C5CAB; visibility: hidden; }
.am-opt:hover { background: var(--fill-2); }
.am-opt[aria-selected="true"] { background: var(--fill); }
.am-opt[aria-selected="true"] svg { visibility: visible; }
.am-opt:focus-visible { outline-offset: -2px; }
.am-multi { position: relative; }
.am-multi-list { width: 100%; min-width: 220px; max-height: 240px; overflow-y: auto; }
.am-multi-list:focus, .am-listbox:focus { outline: none; }
.am-check { min-height: 36px; padding: 0 10px; border-radius: 6px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; }
.am-check:hover { background: var(--fill-2); }
.am-check input, .am-matrix input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: #1C5CAB; cursor: pointer; }
.am-matrix { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.am-matrix table { width: 100%; border-collapse: collapse; }
.am-matrix thead th { height: 38px; background: var(--fill-2); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.am-matrix thead th:first-child { padding: 0 12px; text-align: left; font-weight: 600; }
.am-matrix thead th + th { width: 120px; }
.am-matrix label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.am-matrix thead th:first-child label { gap: 8px; }
.am-matrix tbody th { height: 40px; padding: 0 12px; text-align: left; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.am-matrix tbody td { text-align: center; }
.am-matrix tbody tr + tr > * { border-top: 1px solid var(--line-2); }
.am-matrix tbody input { width: 18px; height: 18px; }
.am-empty { padding: 24px 14px; text-align: center; color: var(--ink-3); list-style: none; }
.am-search { padding: 10px 10px 8px; }
.am-search label { position: relative; display: block; }
.am-search svg { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.am-search input { width: 100%; height: 34px; padding: 0 12px 0 34px; border: 1px solid transparent; border-radius: 8px; background: #F2F4F7; font: inherit; color: var(--ink); }
.am-search input::placeholder { color: #5B6475; }
.am-search input:focus { background: var(--surface); outline: none; border-color: #2A78D6; box-shadow: 0 0 0 3px #DCE9F9; }
.am-cols { display: grid; column-gap: 8px; align-items: center; height: 32px; padding: 0 14px; background: var(--fill-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.am-cols .c-role { text-align: center; }
.am-cols .c-exp-h { padding-left: 8px; }
.am-list { margin: 0; padding: 0 0 4px; list-style: none; }
.am-scroll-list { max-height: 248px; overflow-y: auto; }
.am-row { display: grid; column-gap: 8px; align-items: center; min-height: 48px; padding: 0 14px; }
.am-row:hover { background: var(--fill-2); }
.am-row-user { grid-template-columns: minmax(0, 1fr) 60px 92px 96px 84px; }
.am-row-code { grid-template-columns: minmax(0, 1fr) 52px 92px 52px 116px 64px; }
.am-row-token { grid-template-columns: minmax(0, 1fr) 64px 112px 104px; }
.am-row .c-role { justify-self: center; }
.am-row .c-act { justify-self: end; display: inline-flex; align-items: center; gap: 2px; }
.am-who { min-width: 0; display: flex; align-items: center; gap: 10px; }
.am-role { padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.am-role.admin { background: #EEF4FC; color: #1C5CAB; }
.am-role.off { background: var(--err-bg); color: var(--err); }
.am-li.off .am-who, .am-li.off .c-grant, .am-li.off .c-last { opacity: .6; }
.am-li.revoked .am-name, .am-li.expired .am-name { color: var(--ink-3); }
.am-grants { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; cursor: default; }
.am-badge { height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.am-badge.p { background: #EEF4FC; color: #1C5CAB; }
.am-badge.o { background: #ECFDF3; color: #067647; }
.am-none { font-size: 13px; color: var(--muted); }
.am-cell-tip { font-size: 13px; color: var(--ink-2); white-space: nowrap; cursor: default; border-radius: 4px; }
.am-views { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: default; border-radius: 4px; }
.am-views.none { color: var(--muted); }
.am-lock { width: 28px; height: 28px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.am-off-tag { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.am-exp-text { padding-left: 8px; font-size: 13px; color: var(--ink-2); }
/* 到期格：悬停或聚焦时整格上滑成蓝底「延长」按钮 */
.am-date { position: relative; width: 112px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; font-size: 13px; overflow: hidden; cursor: pointer; transition: background-color .22s ease; }
.am-date .d, .am-date .x { position: absolute; inset: 0; display: flex; align-items: center; transition: transform .26s cubic-bezier(.2, .7, .2, 1), opacity .2s ease; }
.am-date .d { padding-left: 8px; color: var(--ink-2); }
.am-date.expired .d { color: var(--warn); }
.am-date .x { justify-content: center; gap: 6px; color: #FFFFFF; font-weight: 600; transform: translateY(100%); opacity: 0; }
.am-date:hover, .am-date:focus-visible, .am-date[aria-expanded="true"] { background: #1C5CAB; }
.am-date:hover .d, .am-date:focus-visible .d, .am-date[aria-expanded="true"] .d { transform: translateY(-100%); opacity: 0; }
.am-date:hover .x, .am-date:focus-visible .x, .am-date[aria-expanded="true"] .x { transform: translateY(0); opacity: 1; }
.am-ext { margin: 0 14px 10px; padding: 8px 10px; border-radius: 8px; background: #EEF4FC; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.am-ext-l { font-size: 13px; font-weight: 500; color: #0D366B; }
.am-chip { height: 28px; padding: 0 10px; border: 1px solid #A9C7EE; border-radius: 999px; background: #FFFFFF; color: #1C5CAB; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.am-chip:hover { border-color: #2A78D6; color: #0D366B; }
.am-create { padding: 0; }
.am-well-toggle { width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; display: flex; align-items: center; gap: 10px; font-weight: 600; text-align: left; cursor: pointer; }
.am-well-toggle:hover { background: #F2F4F7; }
.am-well-toggle .chev { color: var(--ink-3); }
.am-plus { width: 22px; height: 22px; flex: none; border-radius: 6px; background: #101828; color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.am-create-body { padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 16px; }
.am-create-body[hidden] { display: none; }
.am-create-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px 112px; gap: 10px; align-items: end; }
.am-create-row .am-listbox { left: auto; right: 0; }
.am-create-body .am-primary, .am-token-create .am-primary { height: 36px; padding: 0 18px; }
.am-token-create { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.am-token-create .am-secret { grid-column: 1 / -1; }
.am-secret { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.am-secret:empty { display: none; }
.am-secret-v { min-width: 0; font: 600 16px/1.4 ui-monospace, Menlo, monospace; letter-spacing: .04em; color: var(--ink); overflow-wrap: anywhere; }
.am-secret-n { grid-column: 1; font-size: 13px; color: var(--warn); }
.am-secret .am-btn { grid-column: 2; grid-row: 1 / 3; }
@media (prefers-reduced-motion: reduce) {
  .am-date, .am-date .d, .am-date .x, .chev, .bt-shot, .pt-board { transition: none; }
  .spin { animation: none; }
}
@media (max-width: 640px) {
  .am-pop { padding: 4px 8px 8px; }
  .am-scroll { margin: 0 -8px -8px; padding: 2px 8px 8px; }
  .am-acc { padding: 0 12px; gap: 10px; }
  .am-sec-body { padding: 0 12px 12px; }
  .am-cols { display: none; }
  .am-row { padding: 10px 12px; row-gap: 6px; grid-template-columns: minmax(0, 1fr) auto auto; }
  .am-row .c-name { grid-area: name; }
  .am-row .c-role { grid-area: role; justify-self: end; }
  .am-row .c-act { grid-area: act; }
  .am-row .c-grant { grid-area: grant; }
  .am-row .c-last { grid-area: last; justify-self: end; }
  .am-row .c-views { grid-area: views; }
  .am-row .c-exp { grid-area: exp; justify-self: end; }
  .am-row .c-act { justify-self: end; }
  .am-row-user { grid-template-areas: "name role act" "grant last last"; grid-template-columns: minmax(0, 1fr) auto minmax(80px, auto); }
  .am-row-code { grid-template-areas: "name role act" "grant views exp"; grid-template-columns: minmax(0, 1fr) minmax(56px, auto) minmax(112px, auto); }
  .am-row-token { grid-template-areas: "name name act" "grant last last"; }
  .am-pend-row { flex-wrap: wrap; padding: 10px 12px; row-gap: 4px; }
  .am-first { order: 5; flex-basis: 100%; padding-left: 38px; }
  .am-form { margin: 0 8px 8px; }
  .am-form .am-select { width: 100%; }
  .am-matrix thead th + th { width: 96px; }
  .am-create-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .am-create-row > :first-child { grid-column: 1 / -1; }
  .am-listbox { width: calc(100vw - 96px); }
  .am-create-row .am-listbox { left: 0; right: auto; }
  .am-token-create { grid-template-columns: minmax(0, 1fr); }
  .am-ext { margin: 0 12px 10px; }
  .am-scroll-list { max-height: 380px; }
  .am-secret { grid-template-columns: minmax(0, 1fr); }
  .am-secret .am-btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 6px; }
}
