/* 耕信SAAS — macOS 风格 */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  --accent: #007aff; --accent-weak: rgba(0,122,255,.12); --accent-ring: rgba(0,122,255,.32);
  --fg: #1d1d1f; --fg2: #3c3c43; --sub: #6e6e73; --muted: #a1a1a6;
  --bg: #ffffff; --bg2: #f5f5f7; --panel: #ffffff; --sidebar: rgba(236,236,238,.82);
  --line: rgba(0,0,0,.08); --line2: rgba(0,0,0,.14); --hover: rgba(0,0,0,.04); --sel: rgba(0,0,0,.075);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05); --shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.05);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
  --c-blue:#007aff; --c-green:#34c759; --c-orange:#ff9500; --c-red:#ff3b30; --c-purple:#af52de; --c-pink:#ff2d55;
  --c-teal:#30b0c7; --c-indigo:#5856d6; --c-gray:#8e8e93; --c-yellow:#ffcc00; --c-mint:#00c7be; --c-brown:#a2845e;
  --t-green:#248a3d; --t-red:#d70015; --t-orange:#c93400; --t-blue:#0062cc;
  --bar: #007aff; --bar-weak: rgba(0,122,255,.16);
  --r: 10px; --r-lg: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #0a84ff; --accent-weak: rgba(10,132,255,.2); --accent-ring: rgba(10,132,255,.45);
    --fg: #f5f5f7; --fg2: #d1d1d6; --sub: #98989d; --muted: #6e6e73;
    --bg: #1e1e1e; --bg2: #161617; --panel: #2a2a2c; --sidebar: rgba(40,40,42,.78);
    --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.16); --hover: rgba(255,255,255,.05); --sel: rgba(255,255,255,.1);
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25); --shadow-lg: 0 20px 60px rgba(0,0,0,.55);
    --c-blue:#0a84ff; --c-green:#30d158; --c-orange:#ff9f0a; --c-red:#ff453a; --c-purple:#bf5af2; --c-pink:#ff375f;
    --c-teal:#40c8e0; --c-indigo:#5e5ce6; --c-gray:#98989d; --c-yellow:#ffd60a; --c-mint:#63e6e2; --c-brown:#ac8e68;
    --t-green:#30d158; --t-red:#ff6961; --t-orange:#ffb340; --t-blue:#409cff;
    --bar: #0a84ff; --bar-weak: rgba(10,132,255,.22);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--fg); background: var(--bg2); -webkit-font-smoothing: antialiased; overflow: hidden; }
html.is-desktop body { background: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-ring); }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--sub); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ───── 布局 */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.side { background: var(--sidebar); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; -webkit-user-select: none; user-select: none; }
html.is-desktop .side { background: transparent; backdrop-filter: none; }
.side-top { height: 52px; flex: none; -webkit-app-region: drag; }
html:not(.is-desktop) .side-top { height: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 16px 14px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: #fff; padding: 3px; object-fit: contain; flex: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 .5px rgba(0,0,0,.08); }
.brand b { font-size: 15px; letter-spacing: -.01em; display: block; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--sub); }
.nav { flex: 1; overflow-y: auto; padding: 0 10px 10px; }
.nav-h { font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 8px 4px; display: flex; justify-content: space-between; align-items: center; }
.nav-h button { border: 0; background: none; color: var(--sub); padding: 0 2px; border-radius: 4px; display: flex; }
.nav-h button:hover { color: var(--fg); background: var(--hover); }
.nav-i { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: 7px; color: var(--fg); cursor: default; font-size: 14px; }
.nav-i:hover { background: var(--hover); }
.nav-i.on { background: var(--sel); font-weight: 500; }
.nav-i .ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none; }
.nav-i .ico svg.i { width: 13px; height: 13px; stroke-width: 2.1; }
.nav-i .ico.plain { color: var(--accent); background: none; }
.nav-i .ico.plain svg.i { width: 16px; height: 16px; stroke-width: 1.8; }
.nav-i .cnt { margin-left: auto; font-size: 12px; color: var(--sub); }
.nav-i .tag { margin-left: auto; font-size: 11px; color: var(--sub); border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; line-height: 15px; }
.side-foot { border-top: 1px solid var(--line); padding: 10px; position: relative; }
.me { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px; cursor: default; }
.me:hover { background: var(--hover); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: none;
  background: linear-gradient(145deg, #a1a1a6, #6e6e73); }
.me b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.me span { font-size: 12px; color: var(--sub); }
.conn { font-size: 11.5px; color: var(--muted); padding: 4px 8px 0; display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-green); display: inline-block; flex: none; }

.main { background: var(--bg); display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.bar { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 22px; -webkit-app-region: drag; border-bottom: 1px solid transparent; transition: border-color .2s; }
.bar.scrolled { border-bottom-color: var(--line); }
.bar > * { -webkit-app-region: no-drag; }
.bar .crumb { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; -webkit-app-region: drag; }
.bar .crumb .muted { font-weight: 400; }
.bar .grow { flex: 1; align-self: stretch; -webkit-app-region: drag; }
.content { flex: 1; overflow: auto; padding: 4px 28px 40px; min-height: 0; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin: 6px 0 18px; }
.page-h h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.page-h p { margin: 4px 0 0; color: var(--sub); }
.page-h .act { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ───── 控件 */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line2);
  background: var(--panel); color: var(--fg); font-size: 14px; font-weight: 500; cursor: default; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { background: color-mix(in srgb, var(--panel) 92%, var(--fg)); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(0,122,255,.3); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { color: var(--c-red); }
.btn.danger.fill { background: var(--c-red); color: #fff; border-color: transparent; }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--sub); }
.btn.ghost:hover { background: var(--hover); color: var(--fg); }
.btn.icon { width: 28px; padding: 0; justify-content: center; }
.btn.sm { height: 24px; padding: 0 9px; font-size: 13px; border-radius: 6px; }
.btn svg.i { width: 15px; height: 15px; }

.seg { display: inline-flex; background: var(--hover); border-radius: 8px; padding: 2px; gap: 2px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; height: 24px; padding: 0 14px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: var(--fg2); display: flex; align-items: center; gap: 5px; }
.seg button.on { background: var(--panel); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.05); }
.seg button svg.i { width: 14px; height: 14px; }

.field-in, .inp { width: 100%; height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line2); background: var(--panel); color: var(--fg); outline: none; transition: box-shadow .15s, border-color .15s; }
textarea.inp { height: auto; min-height: 76px; padding: 7px 10px; resize: vertical; line-height: 1.5; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-ring); }
.inp::placeholder { color: var(--muted); }
select.inp { -webkit-appearance: none; appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
.inp.err { border-color: var(--c-red); box-shadow: 0 0 0 3px rgba(255,59,48,.18); }
.inp[readonly], .inp:disabled { background: var(--hover); color: var(--sub); }
.affix { position: relative; }
.affix .inp { padding-left: 24px; }
.affix.suffix .inp { padding-left: 10px; padding-right: 28px; }
.affix > span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; color: var(--sub); pointer-events: none; }
.affix:not(.suffix) > span { left: 10px; }
.affix.suffix > span { right: 10px; }
.affix .eye { position: absolute; right: 4px; top: 3px; pointer-events: auto; }

.search { position: relative; width: 240px; }
.search svg.i { position: absolute; left: 9px; top: 7px; width: 15px; height: 15px; color: var(--sub); }
.search input { padding-left: 30px; height: 30px; border-radius: 8px; background: var(--hover); border-color: transparent; }
.search input:focus { background: var(--panel); }

.pill-sel { height: 30px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); padding: 0 26px 0 12px; font-size: 13.5px;
  -webkit-appearance: none; appearance: none; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; max-width: 180px; }
.pill-sel.active { border-color: var(--accent); background-color: var(--accent-weak); color: var(--accent); font-weight: 500; }
.pill-sel:focus { box-shadow: 0 0 0 3px var(--accent-ring); }

.chk { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.toggle { position: relative; width: 32px; height: 19px; flex: none; }
.toggle input { opacity: 0; position: absolute; inset: 0; margin: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 10px; background: var(--line2); transition: .2s; pointer-events: none; }
.toggle span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: .2s; }
.toggle input:checked + span { background: var(--c-green); }
.toggle input:checked + span::after { transform: translateX(13px); }

/* ───── 卡片 / 表格 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; }
.card-h h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-h .sub { color: var(--sub); font-size: 13px; }
.card-h .r { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 8px 16px 16px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .sp { flex: 1; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; background: var(--panel); box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; font-size: 13px; color: var(--sub); padding: 0 12px; height: 34px;
  background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; -webkit-user-select: none; user-select: none; }
.tbl th.sortable:hover { color: var(--fg); }
.tbl th .arr { font-size: 11px; margin-left: 3px; color: var(--accent); }
.tbl td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tbl tbody tr { cursor: default; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tbody tr.on td { background: var(--accent-weak); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.cb, .tbl th.cb { width: 36px; padding-right: 0; }
.tbl .title-cell { font-weight: 500; }
.empty { text-align: center; padding: 60px 20px; color: var(--sub); }
.empty .big { font-size: 16px; color: var(--fg); font-weight: 600; margin-bottom: 4px; }
.empty svg.i { width: 40px; height: 40px; stroke-width: 1.3; color: var(--muted); margin-bottom: 10px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 2px; color: var(--sub); font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 11px; font-size: 13px; font-weight: 500;
  background: var(--hover); color: var(--fg2); white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-gray); }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 12.5px; background: var(--hover); color: var(--fg2); margin-right: 3px; }
.owner-cell { display: inline-flex; align-items: center; gap: 6px; }
.owner-cell .avatar { width: 20px; height: 20px; font-size: 11px; }
.unassigned { color: var(--c-orange); font-size: 13px; }

/* ───── 双栏（渠道树） */
.split { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.tree { position: sticky; top: 0; padding: 6px; }
.tree-i { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px; border-radius: 7px; cursor: default; font-size: 14px; }
.tree-i:hover { background: var(--hover); }
.tree-i.on { background: var(--accent); color: #fff; }
.tree-i.on .cnt { color: rgba(255,255,255,.85); }
.tree-i .cnt { margin-left: auto; font-size: 12.5px; color: var(--sub); }
.tree-i .chev { width: 12px; height: 12px; transition: transform .15s; }
.tree-i .chev.open { transform: rotate(90deg); }
.tree-sub { padding-left: 18px; }
.tree-sub .tree-i { height: 28px; font-size: 13.5px; }
.tree-h { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px 4px; }

/* ───── 看板 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 14px 16px 15px; }
.kpi .l { font-size: 13px; color: var(--sub); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 15px; font-weight: 600; margin-left: 1px; color: var(--sub); }
.kpi .tone { width: 6px; height: 6px; border-radius: 50%; }
.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .ax { font-size: 11.5px; fill: var(--sub); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .bar-r { fill: var(--bar); }
.chart .bar-r.cur { fill: var(--bar); }
.chart .bar-r.dim { fill: var(--bar-weak); }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar-r, .chart g.col:hover .bar-r { opacity: .8; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow); border-radius: 8px;
  padding: 6px 10px; font-size: 13px; white-space: nowrap; z-index: 5; transform: translate(-50%, -100%); margin-top: -8px; opacity: 0; transition: opacity .1s; }
.tip.show { opacity: 1; }
.tip b { font-size: 14px; }
.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 92px 1fr 64px; align-items: center; gap: 10px; font-size: 13.5px; }
.hbar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg2); display: flex; align-items: center; gap: 6px; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; background: var(--bar); min-width: 3px; }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); }
.hbar .val small { color: var(--sub); }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 4px 0 14px; }
.stack div { height: 100%; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; }
.legend div { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: default; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover .t { color: var(--accent); }
.alert-row .t { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.days { font-size: 12.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.days.over { background: rgba(255,59,48,.12); color: var(--t-red); }
.days.soon { background: rgba(255,149,0,.14); color: var(--t-orange); }
.scope-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); background: var(--hover); border-radius: 12px; padding: 3px 10px; }

/* 概览 */
.ov-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ov-card { padding: 16px; cursor: default; transition: box-shadow .2s, transform .2s; }
.ov-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.ov-card .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ov-card .hd .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.ov-card .hd b { font-size: 16px; }
.ov-card .hd .total { margin-left: auto; text-align: right; font-size: 12px; color: var(--sub); }
.ov-card .hd .total strong { display: block; font-size: 20px; color: var(--fg); font-weight: 700; line-height: 1.1; }
.ov-k { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ov-k div { background: var(--bg2); border-radius: 9px; padding: 8px 10px; }
html.is-desktop .ov-k div, .main .ov-k div { background: var(--hover); }
.ov-k span { font-size: 12px; color: var(--sub); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-k strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.spark { margin-top: 12px; height: 34px; }
.act-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.act-row:last-child { border-bottom: 0; }
.act-row .who { font-weight: 600; flex: none; }
.act-row .what { flex: 1; color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-row .when { color: var(--muted); font-size: 12.5px; flex: none; }

/* ───── 抽屉 / 弹窗 */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.18); z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 92vw; background: var(--bg); z-index: 41; box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.drawer.show { transform: none; }
.drawer-h { padding: 18px 20px 0; flex: none; }
.drawer-h .top { display: flex; align-items: center; gap: 8px; }
.drawer-h h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-h .meta { color: var(--sub); font-size: 13px; margin: 6px 0 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.drawer-b { flex: 1; overflow: auto; padding: 16px 20px 30px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 0 9px; font-weight: 500; color: var(--sub); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.kv > div { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv > div.full { grid-column: 1 / -1; }
.kv .k { font-size: 12.5px; color: var(--sub); margin-bottom: 2px; }
.kv .v { font-size: 14.5px; word-break: break-all; white-space: pre-wrap; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.kv .v .btn { -webkit-app-region: no-drag; }
.timeline { position: relative; }
.tl { display: flex; gap: 11px; padding: 10px 0; }
.tl .bul { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--hover); color: var(--sub); }
.tl .bul svg.i { width: 13px; height: 13px; }
.tl.follow .bul { background: var(--accent-weak); color: var(--accent); }
.tl .body { flex: 1; min-width: 0; }
.tl .hd { font-size: 13px; color: var(--sub); display: flex; gap: 6px; align-items: center; }
.tl .hd b { color: var(--fg); font-weight: 600; }
.tl .hd .x { margin-left: auto; opacity: 0; }
.tl:hover .hd .x { opacity: 1; }
.tl .txt { margin-top: 3px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.tl.follow .txt { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.tl .chg { font-size: 13px; color: var(--fg2); margin-top: 2px; }
.tl .chg s { color: var(--sub); }
.composer { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 8px; margin-bottom: 14px; }
.composer textarea { border: 0; outline: 0; width: 100%; resize: none; min-height: 60px; background: none; padding: 4px; }
.composer .row { display: flex; justify-content: space-between; align-items: center; }

.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 30px; background: rgba(0,0,0,.22); opacity: 0; transition: opacity .18s; }
.modal-wrap.show { opacity: 1; }
.modal { background: var(--bg); border-radius: 14px; box-shadow: var(--shadow-lg), 0 0 0 .5px var(--line2); width: 640px; max-width: 100%; max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; transform: scale(.97) translateY(6px); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.modal-wrap.show .modal { transform: none; }
.modal.sm { width: 420px; }
.modal.lg { width: 820px; }
.modal-h { padding: 18px 22px 4px; display: flex; align-items: center; gap: 10px; }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.modal-b { padding: 12px 22px 18px; overflow: auto; }
.modal-f { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; align-items: center; background: var(--bg2); border-radius: 0 0 14px 14px; }
.modal-f .l { margin-right: auto; color: var(--sub); font-size: 13px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.fi { min-width: 0; }
.fi.full { grid-column: 1 / -1; }
.fi > label { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--fg2); margin-bottom: 5px; }
.fi > label .req { color: var(--c-red); }
.fi > label .add-opt { margin-left: auto; font-weight: 400; font-size: 12.5px; cursor: default; }
.fi > label .lock { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: auto; }
.fi .hint { font-size: 12.5px; color: var(--sub); margin-top: 4px; }
.fi .hint.e { color: var(--c-red); }
.form-sec { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 12px; }
.form-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line2); background: var(--panel); font-size: 13.5px; }
.chips button.on { background: var(--accent); color: #fff; border-color: transparent; }

.menu { position: fixed; z-index: 60; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 180px; }
.menu .mi { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 28px; border-radius: 6px; font-size: 14px; cursor: default; }
.menu .mi:hover { background: var(--accent); color: #fff; }
.menu .mi.danger { color: var(--c-red); }
.menu .mi.danger:hover { color: #fff; background: var(--c-red); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.menu label.mi { gap: 8px; }

.toast-box { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(30,30,32,.92); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px); animation: tin .25s ease; display: flex; align-items: center; gap: 8px; }
.toast.err { background: rgba(215,0,21,.94); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ───── 登录 */
.auth { height: 100vh; display: grid; place-items: center; -webkit-app-region: drag; background:
  radial-gradient(1200px 600px at 20% -10%, rgba(0,122,255,.16), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(175,82,222,.12), transparent 60%), var(--bg2); }
.auth-card { width: 360px; padding: 34px 32px 28px; -webkit-app-region: no-drag; background: color-mix(in srgb, var(--panel) 80%, transparent);
  backdrop-filter: blur(30px) saturate(180%); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.auth-card .brand-mark { display: block; width: 56px; height: 56px; border-radius: 14px; padding: 6px; margin: 0 auto 14px; }
.auth-card h1 { text-align: center; font-size: 21px; margin: 0; letter-spacing: -.01em; }
.auth-card p { text-align: center; color: var(--sub); margin: 4px 0 22px; }
.auth-card .fi { margin-bottom: 12px; }
.auth-card .inp { height: 36px; border-radius: 9px; }
.auth-card .btn.primary { width: 100%; height: 36px; justify-content: center; border-radius: 9px; font-size: 15px; margin-top: 6px; }
.auth-card .err { color: var(--c-red); font-size: 13px; text-align: center; min-height: 18px; margin-top: 8px; }
.auth-foot { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ───── 管理页 */
.list-rows .lr { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-rows .lr:last-child { border-bottom: 0; }
.perm-grid { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.perm-row { display: grid; grid-template-columns: 1fr 210px 150px; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.perm-row:last-child { border-bottom: 0; }
.perm-row.h { background: var(--bg2); font-size: 12.5px; color: var(--sub); font-weight: 500; padding: 7px 12px; }
.seg.sm button { height: 22px; padding: 0 10px; font-size: 13px; }
.dict-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.dict-types { padding: 6px; max-height: calc(100vh - 190px); overflow: auto; }
.dict-items .di { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.dict-items .di:last-child { border-bottom: 0; }
.dict-items .di.off { opacity: .5; }
.dict-items .di .lab { flex: 1; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.dict-items .di .handle { color: var(--muted); cursor: grab; display: flex; }
.dict-items .di.drag { opacity: .4; }
.dict-items .di.over { box-shadow: inset 0 2px 0 var(--accent); }
.color-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.color-pick button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.color-pick button.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.icon-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-pick button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); display: grid; place-items: center; }
.icon-pick button.on { background: var(--accent); color: #fff; border-color: transparent; }
.fields-ed .fe { display: grid; grid-template-columns: 22px 1.3fr 1fr 1fr auto auto 28px; gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.fields-ed .fe:last-child { border-bottom: 0; }
.fields-ed .fe.h { font-size: 12.5px; color: var(--sub); background: var(--bg2); font-weight: 500; }
.fields-ed .fe .inp { height: 28px; }
.fields-ed .fe label { display: flex; gap: 4px; align-items: center; font-size: 13px; white-space: nowrap; }
.core-tag { font-size: 11px; color: var(--sub); border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; }
.log-row { display: grid; grid-template-columns: 140px 90px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.log-row:last-child { border-bottom: 0; }
.log-row .chg { color: var(--sub); font-size: 13px; margin-top: 2px; }
.notice { background: var(--accent-weak); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--fg2); display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.notice svg.i { color: var(--accent); margin-top: 2px; }
.notice.warn { background: rgba(255,149,0,.12); }
.notice.warn svg.i { color: var(--c-orange); }

@media (max-width: 1180px) { .grid2 { grid-template-columns: 1fr; } .split { grid-template-columns: 180px 1fr; } }

/* 门店联想 */
.fi { position: relative; }
.ac { position: absolute; left: 0; right: 0; z-index: 6; margin-top: 4px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 4px; max-height: 280px; overflow: auto; }
.ac-i { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 7px; cursor: default; }
.ac-i b { font-weight: 500; font-size: 14px; }
.ac-i span { font-size: 12.5px; color: var(--sub); }
.ac-i em { font-style: normal; font-size: 11.5px; color: #fff; background: var(--c-green); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.ac-i:hover, .ac-i.on { background: var(--accent-weak); }
.ac-empty { padding: 10px 12px; color: var(--sub); font-size: 13px; }

/* 导入向导 */
.imp-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.imp-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.imp-step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.imp-opt { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--fg2); padding: 2px 4px; }
.imp-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.imp-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; max-height: 220px; overflow: auto; }
.imp-box b { display: block; margin-bottom: 6px; font-size: 14px; }
.imp-box div { padding: 2px 0; }
.imp-box.err { border-color: rgba(255,59,48,.35); background: rgba(255,59,48,.05); }

/* 列表页顶部统计卡（紧凑版） */
.kpis.mini { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpis.mini .kpi { padding: 12px 14px 12px; }
.kpis.mini .kpi .v { font-size: 26px; margin-top: 2px; }
.kpi .s { font-size: 12.5px; color: var(--sub); margin-top: 2px; }

/* 行内操作 */
.tbl th.ops-col, .tbl td.ops-col { position: sticky; right: 0; background: var(--panel); text-align: right; width: 130px; box-shadow: -8px 0 8px -8px rgba(0,0,0,.08); }
.tbl tbody tr:hover td.ops-col { background: color-mix(in srgb, var(--panel) 96%, var(--fg)); }
.tbl .op { font-size: 13.5px; font-weight: 500; color: var(--accent); margin-left: 12px; cursor: default; }
.tbl .op:hover { text-decoration: underline; }
.tbl .op.danger { color: var(--c-red); }

/* ───── 登录页（左品牌 / 右表单） */
:root { --brand: #07913A; --brand-2: #2F9960; --brand-leaf: #8EC31F; }
.auth2 { height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--panel); }
.auth-brand { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 48px; -webkit-app-region: drag;
  background: radial-gradient(900px 560px at 15% 0%, rgba(142,195,31,.22), transparent 60%),
              radial-gradient(760px 560px at 100% 100%, rgba(47,153,96,.20), transparent 62%),
              linear-gradient(160deg, #f5fbf6 0%, #e8f5ec 100%); }
.auth-brand-in { position: relative; z-index: 1; text-align: center; }
.auth-mark { width: min(240px, 30vh); height: auto; filter: drop-shadow(0 22px 40px rgba(7,145,58,.20)); animation: markIn .7s cubic-bezier(.2,.8,.2,1) both; }
.auth-word { margin-top: 22px; font-size: 44px; font-weight: 800; letter-spacing: .14em; color: var(--brand); line-height: 1; display: flex; align-items: baseline; justify-content: center; gap: 12px; }
.auth-word span { font-size: 30px; letter-spacing: .06em; font-weight: 700; color: var(--brand-2); font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif; }
.auth-slogan { margin-top: 16px; font-size: 16px; line-height: 1.8; color: #3d6b4f; letter-spacing: .08em; }
.auth-wm { position: absolute; right: -90px; bottom: -110px; width: 420px; opacity: .06; transform: rotate(-12deg); pointer-events: none; }
.auth-copy { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-size: 13px; color: rgba(30,70,45,.45); }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 48px 40px; background: var(--panel); }
.auth-box { width: 100%; max-width: 360px; }
.auth-mini { display: none; width: 52px; height: 52px; margin-bottom: 14px; }
.auth-box h1 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.auth-box .auth-sub { color: var(--sub); margin: 6px 0 28px; font-size: 15px; }
.auth-box .fi { margin-bottom: 16px; }
.auth-box .fi > label { font-size: 13.5px; }
.auth-box .inp { height: 42px; border-radius: 10px; font-size: 15px; padding: 0 14px; }
.auth-box .inp:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3.5px rgba(47,153,96,.22); }
.btn.brand { width: 100%; height: 42px; justify-content: center; border-radius: 10px; font-size: 16px; margin-top: 8px; background: var(--brand); box-shadow: 0 6px 16px rgba(7,145,58,.25); }
.btn.brand:hover { background: #067c32; }
.auth-box .err { color: var(--c-red); font-size: 13.5px; min-height: 20px; margin-top: 10px; text-align: center; }
.auth-tip { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.auth-box .auth-foot { text-align: center; margin-top: 28px; font-size: 12.5px; color: var(--muted); }
@keyframes markIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-brand { background: radial-gradient(900px 560px at 15% 0%, rgba(142,195,31,.14), transparent 60%),
    radial-gradient(760px 560px at 100% 100%, rgba(47,153,96,.18), transparent 62%), linear-gradient(160deg, #10241a 0%, #0c1d14 100%); }
  :root:not([data-theme="light"]) .auth-word { color: #3fbf6f; }
  :root:not([data-theme="light"]) .auth-slogan { color: #9cc7ab; }
  :root:not([data-theme="light"]) .auth-copy { color: rgba(200,230,210,.4); }
}
@media (max-width: 860px) {
  .auth2 { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mini { display: block; }
  .auth-side { padding: 32px 16px; }
}

/* 收款状态胶囊（已收 / 未收 / 退单 / 免单） */
.pay-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 13px; font-size: 13.5px; font-weight: 600;
  color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, transparent); white-space: nowrap; }
.pay-unpaid { --pc: var(--c-orange) !important; }
.secret-cell { display: inline-flex; align-items: center; gap: 2px; }
.secret-cell .mono { letter-spacing: .05em; }

/* 密钥字段：用样式遮挡而不是 type=password，避免浏览器当成登录框自动保存/回填 */
.secret-in.masked { -webkit-text-security: disc; text-security: disc; letter-spacing: .08em; }
