/* =========================================================================
   features.css — 顶栏功能面板 · 页首 · 列表引擎 · 专属版型 · 图片与档案 · 偏好设定
   ========================================================================= */

/* ---------- 顶栏 ---------- */
.app-topbar { gap: 6px; }
.mode-chip { cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.mode-chip:hover, .mode-chip.pop-open { border-color: var(--accent-line); background: var(--surface-3); }
.clock { height: 32px; padding: 0 8px; border-radius: var(--r-sm); cursor: pointer; }
.clock:hover, .clock.pop-open { background: var(--surface-hover); }
.tb-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; flex: none; }
.tb-badges { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.tb-badges .icon-btn { width: 32px; height: 32px; }
.icon-btn .bubble {
  position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--chrome); font-variant-numeric: tabular-nums;
}
.icon-btn.pop-open { background: var(--surface-hover); color: var(--text); }
.icon-btn.on-state { color: var(--brand); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: var(--r-sm); }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.lang-btn { width: auto; padding: 0 8px; display: inline-flex; gap: 4px; }
.lang-btn .lang-k { font-size: 11px; font-weight: 700; color: var(--text-dim); }
@keyframes ring { 0%,100%{ transform: rotate(0); } 15%{ transform: rotate(14deg); } 30%{ transform: rotate(-12deg); } 45%{ transform: rotate(9deg); } 60%{ transform: rotate(-6deg); } 75%{ transform: rotate(3deg); } }
.icon-btn.ring > .ic { animation: ring .9s var(--ease); transform-origin: 50% 10%; }
.crumbs .c { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a.c:hover { color: var(--text); }
.crumbs .c .ic { width: 16px; height: 16px; }
.crumbs .c-btn { cursor: pointer; padding: 3px 6px; margin: -3px -6px; border-radius: var(--r-xs); }
.crumbs .c-btn:hover, .crumbs .c-btn.pop-open { background: var(--surface-hover); color: var(--text); }
.crumbs .c-btn .ic { width: 13px; height: 13px; opacity: .7; }
@media (max-width: 1440px) { .mode-chips .k { display: none; } }
@media (max-width: 1280px) { .clock, .tb-sep { display: none; } .cmd-trigger { width: 220px; } }
@media (max-width: 1100px) { .tb-badges { display: none; } }
@media (max-width: 640px) { .cmd-trigger span:not(.kbd) { display: none; } .cmd-trigger { width: 40px; } #soundBtn, #langBtn { display: none; } }

/* ---------- 侧栏补充 ---------- */
.rail-brand { color: inherit; }
.rail-search { padding: 10px 10px 2px; flex: none; }
.rail-find { width: 100%; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 9px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-faint); font-size: var(--fs-12); }
.rail-find:hover { border-color: var(--line-2); color: var(--text-dim); }
.rail-find .ic { width: 14px; height: 14px; }
.rail-find .kbd { margin-left: auto; font-size: 10px; }
.app.rail-collapsed .rail-search { padding: 10px 8px 2px; }
.app.rail-collapsed .rail-find span { display: none; }
.app.rail-collapsed .rail-find { justify-content: center; padding: 0; }
.nav-item .g-n { font-size: 10px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.nav-item .count[hidden] { display: none; }
.app.rail-collapsed .nav-item .g-n { display: none; }
.rail-foot .who { cursor: pointer; padding: 4px; margin: -4px; border-radius: var(--r-sm); text-align: left; color: inherit; }
.rail-foot .who:hover, .rail-foot .who.pop-open { background: var(--surface-hover); }
.rail-foot .who > .ic { width: 15px; height: 15px; color: var(--text-faint); margin-left: auto; flex: none; }
.app.rail-collapsed .rail-foot .who > .ic { display: none; }

/* ---------- 下拉面板 ---------- */
.pop { position: fixed; z-index: 120; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop-in var(--t) var(--ease-out); max-height: min(78vh, 680px); display: flex; flex-direction: column; }
.pop-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: var(--fs-14); flex: none; }
.pop-head .spacer { flex: 1; }
.pop-head .link-btn { margin-left: auto; }
.pop-body { padding: 12px 14px; overflow-y: auto; }
.pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex: none; }
.pop-foot .ic { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.pop-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.pop-tabs button { position: relative; padding: 7px 10px 9px; font-size: var(--fs-12); color: var(--text-dim); display: inline-flex; gap: 5px; align-items: center; }
.pop-tabs button:hover { color: var(--text); }
.pop-tabs button.on { color: var(--text); font-weight: 600; }
.pop-tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand-grad); }
.tab-n { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.menu { padding: 6px; display: flex; flex-direction: column; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--fs-13); color: var(--text-dim); text-align: left; width: 100%; }
.menu-item .ic { width: 16px; height: 16px; flex: none; }
.menu-item:hover { background: var(--surface-hover); color: var(--text); }
.menu-item.on { color: var(--text); background: var(--accent-weak); }
.menu-item.on .ic { color: var(--brand); }
.menu-item.danger { color: var(--danger); }
.link-btn { color: var(--accent-text); font-size: var(--fs-12); font-weight: 550; cursor: pointer; background: none; border: none; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* 通知 / 站内信清单 */
.notif-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.notif { position: relative; display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--r-md); text-align: left; width: 100%; color: inherit; }
.notif:hover { background: var(--surface-hover); }
.notif .n-ic { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; }
.notif .n-ic .ic { width: 16px; height: 16px; }
.notif .n-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.notif .n-t { font-size: var(--fs-13); font-weight: 600; color: var(--text); }
.notif .n-b { font-size: var(--fs-12); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif .n-time { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.notif .n-dot { position: absolute; right: 10px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--accent-weak); }
.notif.read .n-t { font-weight: 500; color: var(--text-dim); }
.notif.read { opacity: .78; }
.empty.sm { padding: 26px 12px; font-size: var(--fs-12); flex-direction: row; justify-content: center; gap: 8px; }
.empty.sm .ic { width: 18px; height: 18px; }

/* 用户选单 */
.user-pop .up-head { display: flex; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.avatar.big { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--brand-grad); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex: none; }

/* 系统模式单选卡 */
.radio-card { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; margin-bottom: 8px; }
.radio-card:last-child { margin-bottom: 0; }
.radio-card.on { border-color: var(--accent-line); background: var(--accent-weak); }
.radio-card input { accent-color: var(--brand); margin-top: 3px; }
.radio-card > span { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-13); }
.radio-card .faint { font-size: var(--fs-12); }

/* ---------- 页首 ---------- */
.page-head .ph-l { min-width: 0; }
.page-head .sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.page-head .sub-t { color: var(--text-dim); font-size: var(--fs-13); }
.page-note { margin-bottom: 14px; display: inline-flex; }
.page-note .ic { width: 14px; height: 14px; flex: none; }

/* ---------- 筛选 ---------- */
.filter-card { margin-bottom: 16px; }
.filter-card .filters { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.filter-bar .field { min-width: 0; }
.range { display: flex; align-items: center; gap: 6px; }
.range .input { width: 150px; }
.range span { color: var(--text-faint); }
.phone-in { display: flex; }
.phone-in .select { width: 82px; border-top-right-radius: 0; border-bottom-right-radius: 0; flex: none; }
.phone-in .input { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.fx-dtype .select { width: 160px; }
.pill-row.quick { align-self: flex-end; padding-bottom: 3px; }
.segmented.chips { margin-bottom: 14px; flex-wrap: wrap; }
.segmented .chip-n { margin-left: 6px; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.segmented .chip-n:empty { display: none; }
.segmented.wrap { flex-wrap: wrap; }

/* ---------- 统计 / 汇总 ---------- */
.kpis { margin-bottom: 16px; }
.unit { font-size: 15px; font-weight: 500; }
.stat-btn { text-align: left; width: 100%; cursor: pointer; color: inherit; font: inherit; }
.stat-btn:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.sum-strip { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.sum-strip:empty { display: none; }
.sum-strip.bottom { margin: 12px 0 0; }
.sum-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-right: 1px solid var(--line); min-width: 150px; flex: 1 1 auto; }
.sum-item:last-child { border-right: none; }
.sum-item span { font-size: var(--fs-12); color: var(--text-dim); }
.sum-item b { font-size: var(--fs-18); font-weight: 650; letter-spacing: -0.02em; }

/* ---------- 工具列 ---------- */
.toolbar .btn-c-good { background: var(--good-weak); color: var(--good); }
.toolbar .btn-c-good:hover { filter: brightness(1.1); }
.tb-select { display: inline-flex; align-items: center; }
.tb-select .select { width: auto; min-width: 110px; }
.tb-select .select:disabled { opacity: .5; cursor: not-allowed; }
.sel-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-full); background: var(--accent-weak); color: var(--accent-text); font-size: var(--fs-12); }
.sel-chip[hidden] { display: none; }
.online-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-12); color: var(--text-dim); }
.online-pill b { color: var(--text); }
.tb-search { width: 220px; }
.tb-size { width: 112px; }

/* ---------- 表格 ---------- */
.table-wrap.flat { border: none; border-radius: 0; }
table.data th.ck, table.data td.ck { width: 44px; min-width: 44px; padding-right: 4px; }
table.data tr.sel td { background: var(--accent-weak); }
table.data tr.seen td { opacity: .5; }
table.data th .so .ic { width: 13px; height: 13px; }
.ops-col { text-align: right; }
.row-ops { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: nowrap; }
.op { height: 26px; padding: 0 8px; border-radius: var(--r-sm); font-size: var(--fs-12); font-weight: 550; color: var(--accent-text); white-space: nowrap; }
.op:hover { background: var(--accent-weak); }
.op.danger { color: var(--danger); } .op.danger:hover { background: var(--danger-weak); }
.op.good { color: var(--good); } .op.good:hover { background: var(--good-weak); }
.rank-no { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 8px; background: var(--surface-3); font-weight: 650; font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
tr:nth-child(1) .rank-no { background: linear-gradient(135deg,#f9d46b,#e3a52f); color: #3b2800; }
tr:nth-child(2) .rank-no { background: linear-gradient(135deg,#e6e9ee,#aab3bd); color: #1d232a; }
tr:nth-child(3) .rank-no { background: linear-gradient(135deg,#f0b48a,#c27845); color: #2d1405; }
.thumb { display: inline-grid; place-items: center; width: 52px; height: 32px; border-radius: 6px; background: var(--surface-3); color: var(--text-faint); border: 1px solid var(--line); }
.thumb .ic { width: 15px; height: 15px; }
.thumb.qr { width: 32px; }
.avatar-sm.prov { background: var(--surface-3); }
.tag.sm-tag { height: 18px; padding: 0 6px; font-size: 10.5px; }
.tag.lvl { font-weight: 700; letter-spacing: .03em; font-size: 11px; }
.lvl-bronze { background: rgba(205,127,50,.16); color: #e0a06a; border-color: transparent; }
.lvl-silver { background: rgba(192,199,208,.16); color: #c7ced6; border-color: transparent; }
.lvl-gold { background: rgba(245,181,68,.16); color: #f5b544; border-color: transparent; }
.lvl-platinum { background: rgba(169,139,255,.16); color: #b9a2ff; border-color: transparent; }
.lvl-diamond { background: rgba(56,211,201,.16); color: #38d3c9; border-color: transparent; }
:root[data-theme="light"] .lvl-bronze { color: #9a5a1c; } :root[data-theme="light"] .lvl-silver { color: #5c6670; } :root[data-theme="light"] .lvl-gold { color: #9b6a0d; }
:root[data-theme="light"] .lvl-platinum { color: #6243e0; } :root[data-theme="light"] .lvl-diamond { color: #0b8a82; }
.menu-check { display: flex !important; width: 100%; padding: 6px 8px; border-radius: var(--r-sm); }
.menu-check:hover { background: var(--surface-hover); }
.col-list { max-height: 360px; padding: 6px; }
.pop-cols .pop-head .link-btn { margin-left: auto; }

/* ---------- 表单 / 弹窗补充 ---------- */
.modal.xwide { width: min(1040px, 100%); }
.modal-head .mt { display: flex; align-items: center; gap: 9px; }
.modal-head .mt .ic { width: 18px; height: 18px; color: var(--brand); }
.modal-foot .spacer-left { margin-right: auto; }
.modal-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-dim); font-size: var(--fs-12); line-height: 1.5; }
.modal-note .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.confirm-msg { font-size: var(--fs-14); line-height: 1.65; color: var(--text-dim); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea, .field.invalid .file-pick .btn { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.field .hint { color: var(--text-faint); font-size: var(--fs-12); }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.input-unit { display: flex; align-items: center; }
.input-unit .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-unit > span { height: 36px; display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-left: none; border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--surface-3); color: var(--text-faint); font-size: var(--fs-12); white-space: nowrap; }
.input-unit.sm .input { height: 32px; min-width: 64px; }
.input-unit.sm > span { height: 32px; }
.file-pick { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.file-pick .fname { font-size: var(--fs-12); color: var(--text-dim); }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.file-chip .ic { width: 18px; height: 18px; color: var(--brand); }
.link-box { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); word-break: break-all; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kv-list.two-col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.kv-list.two-col .kv { grid-template-columns: 110px 1fr; }
.list-box { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
.list-row > :first-child { flex: 1; min-width: 0; }
table.perm th.c, table.perm td.c { text-align: center; }
table.perm td.c .check { justify-content: center; }
.msg-meta { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-13); }
.msg-body { font-size: var(--fs-14); line-height: 1.7; }
.dh-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.drawer-head .btn { flex: none; }
.btn.busy { pointer-events: none; opacity: .75; }
.btn.busy > .ic { animation: spin .8s linear infinite; }
.toast-act { margin-left: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-sm); background: var(--accent-weak); color: var(--accent-text); font-size: var(--fs-12); font-weight: 600; flex: none; }

/* ---------- 设定页 ---------- */
.dirty-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--warn); font-size: var(--fs-12); font-weight: 600; }
.dirty-tag .ic { width: 12px; height: 12px; }
.dirty-tag[hidden] { display: none; }
.saved-at { margin-top: 10px; font-size: var(--fs-12); }
.site-pick { margin-bottom: 14px; }
.site-pick .select { width: 280px; }
.ro-val { padding: 8px 0; color: var(--text-dim); }
.color-in { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.color-in input[type=color] { width: 38px; height: 30px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: none; padding: 2px; cursor: pointer; }
.layout-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.lp { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface-2); font-size: var(--fs-12); color: var(--text-dim); }
.lp:hover { border-color: var(--line-strong); }
.lp.on { border-color: var(--accent-line); box-shadow: var(--glow); color: var(--text); }
.lp-art { width: 120px; height: 76px; border-radius: 6px; background: var(--surface-3); position: relative; overflow: hidden; display: block; }
.lp-art i { position: absolute; background: var(--line-strong); border-radius: 3px; display: block; }
.lp-0 i:nth-child(1) { left: 6px; right: 6px; top: 6px; height: 12px; } .lp-0 i:nth-child(2) { left: 6px; width: 30px; top: 22px; bottom: 6px; } .lp-0 i:nth-child(3) { left: 40px; right: 6px; top: 22px; bottom: 6px; background: var(--accent-line); }
.lp-1 i:nth-child(1) { left: 0; right: 0; top: 0; height: 38px; background: var(--accent-line); } .lp-1 i:nth-child(2) { left: 6px; width: 50px; top: 44px; bottom: 6px; } .lp-1 i:nth-child(3) { left: 62px; right: 6px; top: 44px; bottom: 6px; }
.lp-2 i:nth-child(1) { left: 30px; right: 30px; top: 8px; height: 8px; } .lp-2 i:nth-child(2) { left: 14px; right: 14px; top: 24px; height: 26px; background: var(--accent-line); } .lp-2 i:nth-child(3) { left: 30px; right: 30px; top: 56px; height: 8px; }
.form-card { max-width: 680px; }
.result-card { display: flex; align-items: center; gap: 12px; margin-top: 16px; max-width: 680px; }
.result-card > .ic { width: 26px; height: 26px; color: var(--good); flex: none; }
.result-card > div { flex: 1; }

/* ---------- 矩阵 / 返水 / 全民代理 ---------- */
table.matrix .input { min-width: 96px; height: 32px; }
table.matrix .input:disabled { background: transparent; border-color: transparent; color: var(--text); opacity: 1; cursor: default; padding-left: 0; }
.input.bad { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-weak); }
.prob-bar { display: inline-flex; gap: 8px; align-items: center; margin: 0 0 14px 10px; font-size: var(--fs-13); color: var(--text-dim); }
.prob-bar b { font-size: var(--fs-16); }
.set-strip { margin-bottom: 16px; }
.form-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.g4 { grid-template-columns: repeat(4, 1fr); }
.select:disabled, .input:disabled { opacity: .75; cursor: default; }
.vm-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.vm-row .vm-l { font-size: var(--fs-12); color: var(--text-dim); font-weight: 600; margin-right: 6px; }
@media (max-width: 1100px) { .form-grid.g3, .form-grid.g4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 等级精灵 ---------- */
.steps { display: flex; gap: 10px; margin-bottom: 16px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--text-dim); font-weight: 600; font-size: var(--fs-13); }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: var(--fs-12); flex: none; }
.step .n .ic { width: 14px; height: 14px; }
.step .st-d { margin-left: auto; font-weight: 450; font-size: var(--fs-12); color: var(--text-faint); }
.step.active { border-color: var(--accent-line); color: var(--text); box-shadow: var(--glow); }
.step.active .n { background: var(--brand-grad); color: var(--brand-ink); }
.step.done .n { background: var(--good-weak); color: var(--good); }
.level-block { margin-bottom: 16px; }
.lv-no { width: 44px; }

/* ---------- 账户纪录 ---------- */
.stats-who { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: var(--fs-14); }
.stats-who .ic { width: 18px; height: 18px; color: var(--brand); }
.stat-group { margin-bottom: 16px; }
.sg-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.sg-cell { padding: 16px 18px; border-right: 1px solid var(--line); }
.sg-cell:last-child { border-right: none; }
.sg-l { font-size: var(--fs-12); color: var(--text-dim); }
.sg-v { font-size: var(--fs-22); font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; }

/* ---------- IP 墙 ---------- */
.ip-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ip-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-align: left; transition: border-color var(--t-fast), transform var(--t-fast); }
.ip-item:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.ip-item.blocked { opacity: .6; }
.ip-v { flex: 1; font-size: var(--fs-13); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ip-n { min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-dim); font-weight: 700; font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.ip-n.warn { background: var(--warn-weak); color: var(--warn); }
.ip-n.hot { background: var(--danger-weak); color: var(--danger); }
.legend .lg .ip-n { margin-right: 4px; }

/* ---------- 营运报表 / 留存 ---------- */
.biz-charts { margin-bottom: 16px; }
.ret-c { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 指挥中心（数据总览） ---------- */
.ov-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-size: var(--fs-16); font-weight: 650; }
.ov-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; margin-bottom: 14px; }
.ov-a, .ov-b { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ov-big { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 6px; margin: -6px; border-radius: var(--r-md); color: inherit; }
.ov-big:hover, .ov-cell:hover { background: var(--surface-hover); }
.ov-big .ov-v { font-size: var(--fs-34); font-weight: 680; letter-spacing: -0.03em; }
.ov-l { font-size: var(--fs-12); color: var(--text-dim); font-weight: 500; }
.ov-v { font-size: var(--fs-18); font-weight: 650; letter-spacing: -0.02em; }
.ov-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ov-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ov-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.ov-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; align-items: center; }
.ov-cell { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); text-align: left; color: inherit; min-width: 0; }
.ov-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.ov-5 .ov-cell { padding: 14px; background: var(--surface); }
.ov-5 .ov-cell.tone-a { border-top: 2px solid var(--info); }
.ov-5 .ov-cell.tone-b { border-top: 2px solid var(--good); }
.rank-grid { margin-bottom: 16px; }
.rank-card .card-head .ct .ic { color: currentColor; }
@media (max-width: 1200px) { .ov-grid { grid-template-columns: 1fr; } .ov-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .ov-4, .ov-5 { grid-template-columns: repeat(2, 1fr); } .ov-top { grid-template-columns: 1fr; } }

/* ---------- 智能中枢 ---------- */
.qs-grid { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.qs-grid.narrow { grid-template-columns: 340px 1fr; }
@media (max-width: 1100px) { .qs-grid, .qs-grid.narrow { grid-template-columns: 1fr; } }
.saved-q { display: flex; flex-direction: column; gap: 4px; }
.saved-q .sq { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; border-radius: var(--r-sm); background: var(--surface-2); }
.m360-head { margin-bottom: 16px; }
.m360-av { width: 64px; height: 64px; border-radius: 16px; font-size: 24px; background: var(--brand-grad); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.m360-name { font-size: 22px; font-weight: 650; }
.m360-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- 客服工作台 / 对话 ---------- */
.cs { display: grid; grid-template-columns: 240px 1fr; gap: 0; height: calc(100vh - 140px); margin: -20px; }
.cs-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; }
.cs-sec { padding: 10px 8px 6px; }
.cs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: var(--r-md); text-align: left; color: inherit; }
.cs-item:hover { background: var(--surface-hover); }
.cs-item.on { background: var(--accent-weak); }
.cs-m { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cs-m b { font-size: var(--fs-13); }
.cs-m span { font-size: var(--fs-12); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sm-sel { height: 30px; width: auto; font-size: var(--fs-12); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cs .chat-log { min-height: 0; }
.bubble { max-width: 76%; display: flex; flex-direction: column; gap: 3px; }
.bubble .bt { padding: 9px 12px; border-radius: 14px; font-size: var(--fs-13); line-height: 1.55; background: var(--surface-2); border: 1px solid var(--line); }
.bubble .bm { font-size: 10.5px; color: var(--text-faint); padding: 0 6px; }
.bubble.me { align-self: flex-end; align-items: flex-end; }
.bubble.me .bt { background: var(--accent-weak); border-color: var(--accent-line); border-bottom-right-radius: 4px; }
.bubble.them .bt { border-bottom-left-radius: 4px; }
.bubble.sys { align-self: center; max-width: 90%; }
.bubble.sys .bt { background: transparent; border: 1px dashed var(--line-2); color: var(--text-faint); font-size: var(--fs-12); padding: 4px 10px; }
.cs-qr { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 0; }
.pill.ghost { background: transparent; display: inline-flex; align-items: center; gap: 4px; }
.pill.ghost .ic { width: 12px; height: 12px; }
.cs-input { display: flex; gap: 8px; padding: 10px 16px 14px; align-items: flex-end; }
.cs-input .textarea { min-height: 44px; flex: 1; }
.cs-closed { padding: 14px 16px; text-align: center; font-size: var(--fs-12); border-top: 1px solid var(--line); }
@media (max-width: 760px) { .cs { grid-template-columns: 1fr; } .cs-list { max-height: 180px; border-right: none; border-bottom: 1px solid var(--line); } }

/* ---------- 偏好设定抽屉 ---------- */
.pref-sec { padding: 4px 0 18px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.pref-sec:last-child { border-bottom: none; }
.pref-sec > .sect-label { margin-bottom: 8px; }
.pref-sec.flash { animation: flash 1.2s var(--ease); border-radius: var(--r-md); }
@keyframes flash { 0%{ background: var(--accent-weak); } 100%{ background: transparent; } }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.pref-row .pr-l { font-size: var(--fs-13); font-weight: 550; }
.pref-row .pr-h { font-size: var(--fs-12); color: var(--text-faint); margin-top: 2px; max-width: 300px; }
.pref-row .pr-c { flex: none; display: flex; align-items: center; justify-content: flex-end; }
.pref-row .pr-c .select { width: 220px; }
.pref-row .check-grid { max-width: 280px; justify-content: flex-end; }
.kbd-list { display: flex; flex-direction: column; gap: 2px; }
.kbd-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: var(--fs-13); }
.about-box { display: flex; gap: 12px; align-items: center; }
.about-box img { width: 40px; height: 40px; }

/* ---------- 登出 ---------- */
.logout-ov { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(900px 500px at 50% 0%, rgba(84,214,92,.12), transparent 60%), var(--bg); animation: fade-in var(--t) var(--ease); }
.lo-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 48px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); text-align: center; }
.lo-card img { height: 40px; }
.lo-t { font-size: var(--fs-22); font-weight: 650; }

/* ---------- 命令面板补充 ---------- */
.cmdk-foot { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-faint); flex: none; }
.cmdk-foot .kbd { margin-right: 3px; }

/* ---------- 密度：紧凑 ---------- */
:root[data-density="compact"] table.data tbody td { padding: 6px 12px; }
:root[data-density="compact"] table.data thead th { padding: 8px 12px; }
:root[data-density="compact"] .stat { padding: 12px 14px; }
:root[data-density="compact"] .stat .st-val { font-size: var(--fs-22); margin-top: 6px; }
:root[data-density="compact"] .card-body { padding: 14px; }
:root[data-density="compact"] .card.pad { padding: 14px; }
:root[data-density="compact"] .view-pad { padding-top: 14px; }
:root[data-density="compact"] .page-head { margin-bottom: 12px; }
:root[data-density="compact"] .page-head .ttl { font-size: var(--fs-22); }
:root[data-density="compact"] .nav-item { padding-top: 6px; padding-bottom: 6px; }

/* ---------- 减少动态 ---------- */
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }

/* ---------- 修正 ---------- */
.rail-foot .who .meta { display: flex; flex-direction: column; min-width: 0; }
.rail-foot .who .meta b, .rail-foot .who .meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segmented button { white-space: nowrap; }
.cmd-trigger span:not(.kbd) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head .actions { flex-wrap: wrap; justify-content: flex-end; }
.cs-input .textarea.filled { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-weak); }
.mode-chip { white-space: nowrap; flex: none; }
.mode-chips { flex: none; }
.switch { display: inline-block; vertical-align: middle; }
.tabs { overflow-y: hidden; }
/* rail 永远深色：浅色主题下补齐 surface / line 变数 */
:root[data-theme="light"] .app-rail {
  --surface-2: #171c20; --surface-3: #1e242a; --line-2: rgba(255,255,255,.12); --line-strong: rgba(255,255,255,.2);
  --accent-weak: rgba(84,214,92,.14); --accent-text: #86e98a; color: var(--text);
}
:root[data-theme="light"] .app-rail .kbd { color: #9aa3ab; }

/* ---------- 图片 / 档案 ---------- */
.thumb { position: relative; cursor: pointer; overflow: hidden; padding: 0; transition: border-color var(--t-fast), transform var(--t-fast); }
.thumb:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.qr { width: 34px; height: 34px; background: #fff; }
.thumb.qr .qr-art { width: 100%; height: 100%; }
.thumb.file { width: 52px; gap: 2px; flex-direction: column; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); }
.thumb.file b { font-size: 9px; letter-spacing: .04em; }
.thumb .up { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; opacity: 0; transition: opacity var(--t-fast); }
.thumb .up .ic { width: 15px; height: 15px; }
.thumb.ph:hover .up { opacity: 1; }
.ph-art { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 750; font-size: 12px; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 55% 46%), hsl(calc(var(--h) + 40) 60% 34%)); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.ph-art .ic { width: 15px; height: 15px; opacity: .9; }
.ph-art.big { font-size: 40px; border-radius: var(--r-md); }
.ph-art.big .ic { width: 40px; height: 40px; }
td.drop-over { outline: 2px dashed var(--brand); outline-offset: -4px; background: var(--accent-weak) !important; }
.link-cell { background: none; border: none; padding: 0; font: inherit; text-align: left; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-text { color: var(--danger) !important; }

.img-mgr { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.im-stage { position: relative; border-radius: var(--r-lg); border: 1px solid var(--line-2); background:
  repeating-conic-gradient(var(--surface-3) 0% 25%, var(--surface-2) 0% 50%) 50% / 18px 18px; min-height: 260px; display: grid; place-items: center; overflow: hidden; padding: 14px; }
.im-stage img { max-width: 100%; max-height: 360px; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow); }
.im-stage .ph-art.big { width: 200px; height: 140px; }
.im-stage .qr-art { width: 200px; height: 200px; border-radius: 8px; }
.im-stage .im-drop { position: absolute; inset: 10px; border: 2px dashed var(--accent-line); border-radius: var(--r-md); display: none; place-items: center; gap: 8px;
  background: rgba(0,0,0,.55); color: #fff; font-weight: 600; grid-auto-flow: column; }
.im-stage .im-drop .ic { width: 20px; height: 20px; }
.im-stage.over .im-drop { display: grid; }
.file-big { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-dim); }
.file-big .ic { width: 48px; height: 48px; }
.im-side .kv { grid-template-columns: 96px 1fr; padding: 8px 0; }
.im-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.im-acts .spacer { flex: 1; }
@media (max-width: 760px) { .img-mgr { grid-template-columns: 1fr; } }

.img-field { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--surface-2); transition: border-color var(--t-fast), background var(--t-fast); }
.img-field.over { border-color: var(--brand); background: var(--accent-weak); }
.imf-prev { width: 96px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); }
.imf-prev img { width: 100%; height: 100%; object-fit: cover; }
.imf-prev .qr-art { width: 64px; height: 64px; }
.imf-prev .ph-art { font-size: 18px; }
.imf-prev > .ic { width: 26px; height: 26px; color: var(--text-dim); }
.imf-meta { min-width: 0; flex: 1; }
.imf-name { font-size: var(--fs-13); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imf-sub { font-size: var(--fs-12); }
.resize-ask { display: flex; gap: 14px; align-items: center; }
.ra-prev { width: 120px; height: 90px; border-radius: 8px; overflow: hidden; flex: none; background: var(--surface-3); display: grid; place-items: center; }
.ra-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.desc .dv .img-field { max-width: 560px; }
.nav-item .g-n { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--surface-3); display: inline-grid; place-items: center; }

/* ---------- 可点击的汇总列 / 移线提示 ---------- */
tr.click-row { cursor: pointer; }
tr.click-row:hover td { background: var(--surface-hover); }
.ml-hint:empty { display: none; }
.ml-hint b { color: var(--text); font-weight: 600; }

/* ---------------- 伺服器模式：登入 / 开机 / 载入中 / 币种标签 ---------------- */
.login-ov { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 500px at 50% 0%, rgba(84,214,92,.14), transparent 60%), var(--bg); animation: fade-in var(--t) var(--ease); }
.login-card { width: min(380px, 100%); align-items: stretch; text-align: left; }
.login-card img { align-self: center; }
.login-card .lo-t { text-align: center; }
.login-card .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.login-card .btn.block { width: 100%; justify-content: center; }
.login-msg { text-align: center; color: var(--text-dim); font-size: 13px; }
.login-err { color: var(--danger); font-size: 13px; background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); padding: 8px 10px; border-radius: var(--r-sm); }
.boot-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); color: var(--text); padding: 16px; text-align: center; }
.boot-screen img { height: 44px; }
.boot-screen .et { font-size: 18px; font-weight: 600; }
.empty.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-busy { opacity: .6; pointer-events: none; }
.cur-tag { display: inline-block; margin-left: 4px; font-size: 10px; letter-spacing: .3px; color: var(--text-faint); vertical-align: 1px; }
/* VIP 等级（依等级序号） */
.lvl-0 { background: rgba(140,150,160,.14); color: #a9b2bb; border-color: transparent; }
.lvl-1 { background: rgba(205,127,50,.16); color: #e0a06a; border-color: transparent; }
.lvl-2 { background: rgba(192,199,208,.16); color: #c7ced6; border-color: transparent; }
.lvl-3 { background: rgba(245,181,68,.16); color: #f5b544; border-color: transparent; }
.lvl-4 { background: rgba(169,139,255,.16); color: #b9a2ff; border-color: transparent; }
.lvl-5 { background: rgba(56,211,201,.16); color: #38d3c9; border-color: transparent; }
.lvl-6 { background: rgba(255,94,120,.16); color: #ff8aa0; border-color: transparent; }
:root[data-theme="light"] .lvl-0 { color: #5c6670; } :root[data-theme="light"] .lvl-1 { color: #9a5a1c; } :root[data-theme="light"] .lvl-2 { color: #5c6670; }
:root[data-theme="light"] .lvl-3 { color: #9b6a0d; } :root[data-theme="light"] .lvl-4 { color: #6243e0; } :root[data-theme="light"] .lvl-5 { color: #0b8a82; } :root[data-theme="light"] .lvl-6 { color: #c2264a; }
