/* 直付通多租户SaaS平台 - 全局样式 */
:root {
    --primary: #1677ff;
    --primary-dark: #0958d9;
    --primary-weak: #e6f4ff;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text: #1f2329;
    --text-weak: #646a73;
    --border: #e5e6eb;
    --bg: #f5f7fa;
    --panel: #ffffff;
    --sidebar-w: 228px;
    --sidebar-collapsed: 72px;
    --header-h: 60px;
    --radius-lg: 12px;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(20, 30, 50, .06);
    --shadow-md: 0 8px 28px rgba(20, 30, 50, .14);
    --focus-ring: 0 0 0 3px rgba(22, 119, 255, .16);
    --mono-font: Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* 布局 */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar .logo {
    padding: 20px 18px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.08);
    letter-spacing: .5px;
}

.sidebar .menu { flex: 1; padding: 12px 0; overflow-y: auto; }

.sidebar .menu a {
    display: block;
    padding: 11px 20px;
    color: rgba(255,255,255,.65);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar .menu a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar .menu a.active { color: #fff; background: rgba(22,119,255,.18); border-left-color: var(--primary); }
.sidebar .menu .group-title {
    padding: 14px 20px 6px;
    font-size: 12px;
    color: rgba(255,255,255,.35);
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.header {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header .title { font-size: 16px; font-weight: 600; }

.header .user-info { display: flex; align-items: center; gap: 14px; color: var(--text-weak); }

.content { padding: 20px 24px 40px; flex: 1; }

/* 卡片 */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 20px; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
}
.stat-card .label { color: var(--text-weak); font-size: 13px; }
.stat-card .value { font-size: 24px; font-weight: 600; margin-top: 6px; }

/* 表单 */
.form-item { margin-bottom: 16px; }
.form-item label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-item .tip { color: var(--text-weak); font-size: 12px; margin-top: 4px; }
.form-item input[type=text],
.form-item input[type=password],
.form-item input[type=number],
.form-item select,
.form-item textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.form-item textarea { min-height: 90px; font-family: Consolas, monospace; font-size: 12px; }
.form-item input[type=file] {
    width: 100%;
    padding: 8px 12px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fafbfc;
}
/* 证书上传区 */
.upload-box { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; background: #fff; }
.upload-box + .upload-box { margin-top: 14px; }
.upload-box .name { font-weight: 500; margin-bottom: 8px; font-size: 14px; }
.upload-box .desc { color: var(--text-weak); font-size: 12px; margin-bottom: 8px; }
.cert-section { margin-top: 20px; }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.cert-grid .upload-box + .upload-box { margin-top: 0; }
@media (max-width: 900px) { .cert-grid { grid-template-columns: 1fr; } }
.dlg-mask { position: fixed; inset: 0; background: rgba(15,20,30,.45); display: flex; align-items: center; justify-content: center; z-index: 999; }
.dlg { background: #fff; border-radius: 10px; width: min(560px, 92vw); max-height: 80vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dlg-head h3 { margin: 0; font-size: 15px; }
.dlg-close { border: none; background: none; font-size: 20px; line-height: 1; color: var(--text-weak); cursor: pointer; padding: 0 4px; }
.dlg-close:hover { color: var(--text); }
.dlg-body { padding: 10px 18px 16px; }
.dlg-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.dlg-row:last-child { border-bottom: none; }
.dlg-k { color: var(--text-weak); min-width: 150px; flex-shrink: 0; }
.dlg-v { word-break: break-all; text-align: right; flex: 1; }
.ub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.ub-head .name { margin: 0; }
.ub-head .tag { flex-shrink: 0; }
.ub-head .ub-file { margin-left: auto; max-width: 300px; font-size: 12px; }
.cert-info { font-size: 12px; color: var(--text-weak); margin-top: 8px; line-height: 1.9; }
.cert-info .mono { color: var(--text); word-break: break-all; }
.ub-kv { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.ub-kv span { white-space: nowrap; }
.ub-kv .mono { white-space: normal; }
.cert-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin-top: 12px; }
@media (max-width: 900px) { .manual-grid { grid-template-columns: 1fr; } .ub-head .ub-file { margin-left: 0; } }
details.manual { margin-top: 12px; }
details.manual summary { cursor: pointer; color: var(--text-weak); font-size: 12px; }
details.manual textarea { margin-top: 8px; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pager-info { color: var(--text-weak); font-size: 12px; margin-right: 8px; }
.pager-btn {
    display: inline-block;
    min-width: 32px;
    padding: 5px 10px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
}
.pager-btn:hover { border-color: var(--primary); color: var(--primary); }
.pager-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-btn.disabled { color: var(--text-weak); background: #f5f6f7; cursor: not-allowed; }

.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.form-inline input, .form-inline select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn:disabled, .btn.disabled { background: #d9d9d9; border-color: #d9d9d9; cursor: not-allowed; color: #fff; }
.btn-default { background: #fff; color: var(--text); border-color: var(--border); }
.btn-default:hover { background: #f5f7fa; color: var(--text); border-color: #c9cdd4; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { display: block; width: 100%; }

/* 表格 */
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.grid th { background: #fafbfc; font-weight: 600; color: var(--text-weak); white-space: nowrap; }
table.grid tr:hover td { background: #fafbff; }
table.grid td.nowrap, table.grid th.nowrap { white-space: nowrap; }

/* 标签 */
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 20px; }
.tag-success { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.tag-warning { background: #fffbe6; color: #d46b08; border: 1px solid #ffe58f; }
.tag-danger  { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.tag-info    { background: #e6f4ff; color: #0958d9; border: 1px solid #91caff; }
.tag-default { background: #f5f5f5; color: #8c8c8c; border: 1px solid #d9d9d9; }

/* 提示条 */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.alert-warning { background: #fffbe6; border: 1px solid #ffe58f; color: #ad6800; }
.alert-error   { background: #fff2f0; border: 1px solid #ffccc7; color: #a8071a; }
.alert-info    { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #237804; }

/* JSON 报文高亮（通知报文弹窗） */
pre.pretty-json { max-height: 340px; overflow: auto; font-size: 12px; line-height: 1.7; background: #fafbfc; margin: 6px 0; }
.jk-key  { color: #0958d9; }
.jk-str  { color: #389e0d; }
.jk-num  { color: #d4380d; }
.jk-bool { color: #d46b08; }
.jk-null { color: #8c8c8c; }
.copy-json { align-self: flex-start; }

/* 统一空状态（P0）：图标 + 文案 + 操作引导 */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 18px; }
.empty-icon { color: #bfbfbf; margin-bottom: 2px; }
.empty-icon .mi { width: 34px; height: 34px; }
.empty-state .empty-actions { margin-top: 10px; }
/* 表格列设置（P0）：头部按钮 + 勾选面板 */
.col-toggle { position: relative; display: inline-flex; margin-left: auto; }
.col-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 80;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 20, 30, .12);
    padding: 10px 12px; min-width: 150px; max-height: 320px; overflow: auto;
    display: flex; flex-direction: column; gap: 6px;
}
.col-panel label { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; cursor: pointer; }
/* 二次确认弹窗（P0 高危操作） */
.confirm-dlg { width: min(440px, 92vw); }
.confirm-dlg.is-danger .dlg-head h3 { color: var(--danger); }
.confirm-text { font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; }
.confirm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }

/* 草稿提示条 */
.draft-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 批量操作条 */
.batch-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--border); background: #fafbfc; }
/* 列表内驳回提示（红字摘要，点击操作区「驳回原因」看完整原文） */
.reject-tip { margin-top: 4px; font-size: 12px; color: var(--danger); max-width: 220px; line-height: 1.5; }
/* 空状态操作区（P0 全局统一空状态） */
.empty-actions { margin-top: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.empty .muted { margin-top: 6px; font-size: 12.5px; }

/* 后台任务进度条（对账异步任务） */
.task-progress { display: flex; align-items: center; gap: 10px; }
.task-bar { flex: 1; max-width: 420px; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.task-bar-inner { height: 100%; width: 0; background: var(--primary, #1677ff); transition: width .3s ease; }
.task-bar-inner.is-done { background: #52c41a; }
.task-bar-inner.is-failed { background: var(--danger, #cf1322); }
.task-percent { font-size: 12.5px; color: #595959; min-width: 40px; }

/* 证书有效期预警清单 */
.cert-expire-list { margin: 8px 0 0; padding-left: 20px; }
.cert-expire-list li { margin-top: 4px; }
/* 回调地址风险提示（醒目：左侧色条 + 边框加粗） */
.notify-url-warn-box { border-left: 4px solid #faad14; border-width: 1px 1px 1px 4px; margin-top: 8px; }
.notify-url-warn-box.alert-error { border-left-color: #ff4d4f; }
/* 自检结果逐项清单 */
.check-result { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.check-result.is-pass { border-color: #b7eb8f; background: #f6ffed; }
.check-result.is-fail { border-color: #ffccc7; background: #fff2f0; }
.check-result .chk-line { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); line-height: 1.7; }
.check-result .chk-line:last-of-type { border-bottom: none; }
.check-result .chk-tag { flex-shrink: 0; font-weight: 600; }
.check-result .chk-ok .chk-tag { color: var(--success); }
.check-result .chk-fail .chk-tag { color: var(--danger); }
.check-result .chk-tail { margin-top: 8px; font-weight: 600; }
.check-result .chk-tail.chk-ok { color: var(--success); }
.check-result .chk-tail.chk-fail { color: var(--danger); }

/* 原始报文 */
pre.raw {
    background: #f7f8fa;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-family: Consolas, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 360px;
    overflow: auto;
    margin: 0;
}

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: 380px; background: #fff; border-radius: 10px; padding: 32px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.login-box h2 { margin: 0 0 6px; font-size: 20px; }
.login-box .sub { color: var(--text-weak); font-size: 13px; margin-bottom: 22px; }
.login-box .captcha-row { display: flex; gap: 8px; }
.login-box .captcha-row input { flex: 1; }
.login-box .captcha-row img { height: 38px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; background: #f3f6fb; }

/* 空状态 */
.empty { padding: 40px; text-align: center; color: var(--text-weak); }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 14px 0; }
.pager a { padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 弹窗（简化为整页 Toast） */
#toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 6px;
    background: rgba(0,0,0,.8);
    color: #fff;
    font-size: 14px;
    z-index: 9999;
    display: none;
}

.muted { color: var(--text-weak); }
.mono { font-family: Consolas, monospace; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.checkbox-inline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* 官方 MCC 类目搜索下拉 */
.mcc-box { position: relative; }
.mcc-panel { position: absolute; z-index: 30; top: calc(100% - 8px); left: 0; right: 0; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.mcc-item { padding: 7px 12px; cursor: pointer; font-size: 13px; }
.mcc-item:hover { background: rgba(22,119,255,.08); }
.mcc-code { font-family: monospace; color: var(--primary); font-weight: 600; }
.mcc-cat { float: right; }
.mcc-empty { padding: 12px; text-align: center; color: var(--text-weak); }

/* ============================================================
   双端后台重构新增样式（2026-09-27）
   1) 面包屑导航  2) 菜单当前项高亮 / 证书缺失置灰  3) 报文代码预览组件
   ============================================================ */
.breadcrumb { padding: 10px 22px; font-size: 13px; color: var(--text-weak); background: #fff; border-bottom: 1px solid var(--border); }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: var(--text-weak); }

.sidebar .menu a.active { background: rgba(22,119,255,.10); color: var(--primary); font-weight: 600; border-left: 3px solid var(--primary); padding-left: 13px; }
.sidebar .menu a.disabled { color: var(--text-weak); opacity: .55; cursor: not-allowed; }
.sidebar .menu a.disabled:hover { background: transparent; color: var(--text-weak); }

.code-preview { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 10px 0; background: #fff; }
.code-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.code-title { flex: 1; font-size: 12px; color: var(--text-weak); }
.code-preview pre.raw { margin: 0; border: 0; border-radius: 0; max-height: 320px; }
.code-preview.folded pre.raw { max-height: 120px; overflow: hidden; }

/* ============================================================
   商用 UI 基线（2026-09-28）
   目标：可折叠/可移动适配的外壳、一致的卡片表格表单语言、
        反馈闭环（loading / toast / 命令面板）、可打印的对账账单。
   约定：本节放在文件末尾，用于覆盖上面的早期规则，**不删除旧类**，
        保证历史页面（20+ 视图）零改动即可享受新样式。
   ============================================================ */

/* ---------- 图标 ---------- */
svg.mi {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
svg.mi.lg { width: 22px; height: 22px; flex-basis: 22px; }

/* ---------- 外壳：侧边栏 / 顶栏 ---------- */
.layout { min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    transition: width .18s ease;
    background: linear-gradient(180deg, #001529 0%, #002140 100%);
}

.sidebar .logo {
    height: var(--header-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar .logo .brand-mark {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #36cfc9 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidebar .logo .logo-text { overflow: hidden; text-overflow: ellipsis; }

.sidebar .menu { padding: 10px 0 20px; }
.sidebar .menu .group-title {
    padding: 16px 20px 6px;
    letter-spacing: .5px;
}
.sidebar .menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.sidebar .menu a .label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar .menu a.active { padding-left: 15px; background: rgba(22, 119, 255, .12); }

/* 折叠态（仅桌面）：收为图标轨 */
.layout-collapsed .sidebar { width: var(--sidebar-collapsed); }
.layout-collapsed .sidebar .logo { justify-content: center; padding: 0 6px; }
.layout-collapsed .sidebar .logo .logo-text { display: none; }
.layout-collapsed .sidebar .menu .group-title { height: 1px; padding: 8px 0 0; overflow: hidden; color: transparent; background: rgba(255, 255, 255, .08); margin: 10px 12px 6px; }
.layout-collapsed .sidebar .menu a { justify-content: center; padding: 10px 0; gap: 0; }
.layout-collapsed .sidebar .menu a .label { display: none; }
.layout-collapsed .main { --sidebar-w: var(--sidebar-collapsed); }

/* ---------- 顶栏 ---------- */
.header { height: var(--header-h); padding: 0 20px; gap: 16px; position: sticky; top: 0; z-index: 60; }
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-weak);
    cursor: pointer;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-weak); }

.search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px 0 12px;
    min-width: 200px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    color: var(--text-weak);
    font-size: 13px;
    cursor: pointer;
}
.search-trigger:hover { border-color: var(--primary); color: var(--text); }
.search-trigger .flex-1 { flex: 1; text-align: left; }

kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #fff;
    color: var(--text-weak);
    font-family: inherit;
    font-size: 11px;
    line-height: 18px;
}

/* 用户下拉 */
.user-menu { position: relative; }
.um-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
}
.um-trigger:hover { background: var(--bg); }
.um-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-weak);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.um-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 80;
}
.um-panel .um-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.um-panel .um-head .uname { font-weight: 600; font-size: 13px; }
.um-panel .um-head .umeta { color: var(--text-weak); font-size: 12px; margin-top: 2px; }
.um-panel a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
}
.um-panel a:hover { background: var(--bg); color: var(--primary); }
.um-panel a.danger { color: var(--danger); }
.um-panel a.danger:hover { background: #fff2f0; }

/* ---------- 内容区 ---------- */
.content { padding: 18px 22px 44px; }

.card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: 14px 18px; gap: 12px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.stat-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px 18px; position: relative; overflow: hidden; }
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .value { font-size: 22px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.stat-card::after {
    content: '';
    position: absolute;
    right: -18px;
    top: -18px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(22, 119, 255, .10), transparent 70%);
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { min-width: 100%; }
table.grid th { position: sticky; top: 0; z-index: 1; }
table.grid tbody td { background: #fff; }
table.grid tbody tr:nth-child(even) td { background: #fcfdff; }
table.grid tbody tr:hover td { background: #f2f7ff !important; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 反馈：Toast / loading / 进度条 ---------- */
#toast { display: none !important; }         /* 旧单点 Toast 退役，改由顶部居中堆叠层接管 */
#toast-layer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    max-width: 420px;
}
.toast-msg {
    padding: 10px 14px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    box-shadow: var(--shadow-md);
    color: var(--text);
    font-size: 13px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}
.toast-msg.show { opacity: 1; transform: none; }
.toast-msg.is-success { border-left-color: var(--success); }
.toast-msg.is-error { border-left-color: var(--danger); }

.btn.loading { opacity: .72; pointer-events: none; }
.btn.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    vertical-align: -1px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ui-spin .7s linear infinite;
}
.btn-default.loading::after { border-color: rgba(22, 119, 255, .3); border-top-color: var(--primary); }
@keyframes ui-spin { to { transform: rotate(360deg); } }

#page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    z-index: 9998;
    background: linear-gradient(90deg, var(--primary), #36cfc9);
    box-shadow: 0 0 6px rgba(22, 119, 255, .6);
    transition: width .25s ease, opacity .3s ease;
    opacity: 0;
}
#page-progress.on { opacity: 1; width: 70%; }

.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-weak);
    box-shadow: var(--shadow-sm);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 70;
}
.back-top.show { display: flex; }
.back-top:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 命令面板（Ctrl+K） ---------- */
.cmdk-mask { position: fixed; inset: 0; background: rgba(15, 20, 30, .48); z-index: 9000; display: flex; justify-content: center; padding-top: 12vh; }
.cmdk { width: min(560px, 92vw); background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.cmdk-input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; font-size: 14px; font-family: inherit; }
.cmdk-input:focus { outline: none; box-shadow: none; }
.cmdk-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text); cursor: pointer; }
.cmdk-item .meta { margin-left: auto; color: var(--text-weak); font-size: 12px; }
.cmdk-item.active { background: var(--primary-weak); color: var(--primary-dark); }
.cmdk-empty { padding: 22px; text-align: center; color: var(--text-weak); font-size: 13px; }

/* ---------- 表单 ---------- */
.form-item input[type=text],
.form-item input[type=password],
.form-item input[type=number],
.form-item select,
.form-item textarea { border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.form-item input:disabled { background: #f7f8fa; color: var(--text-weak); }
.form-item .req { color: var(--danger); margin-left: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; }
.form-inline { gap: 12px; }
.form-inline input, .form-inline select { border-radius: var(--radius-sm); }
.form-inline input:focus, .form-inline select:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }

.btn:focus-visible, .btn-icon:focus-visible, .search-trigger:focus-visible, .um-trigger:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn-link { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; font-size: 12px; }


/* ============================================================
   二级商户手动进件页 UI（2026-09-28）
   纯展示层：卡片分组 / 帮助 tooltip / 图片上传卡 / 提交预览 / 吸顶操作栏。
   ⚠️ 不涉及任何业务字段与提交逻辑，仅作用于本页新增的类名。
   ============================================================ */

/* ---------- 吸顶操作栏 ---------- */
.apply-bar {
    position: sticky;
    top: var(--header-h);
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.apply-bar .ab-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.apply-bar .ab-name { font-size: 15px; font-weight: 600; }
.apply-bar .ab-method { font-size: 12px; color: var(--text-weak); word-break: break-all; }
.apply-bar .ab-right { display: flex; align-items: center; gap: 10px; }
.ab-count { font-size: 12.5px; }
.ab-count.is-missing { color: var(--danger); }
.ab-count.is-ok { color: var(--success); }

/* ---------- 顶部提示（压缩高度，官方原文移入 tooltip）---------- */
.notice-compact { padding: 8px 12px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.7; }

/* ---------- 卡片分组 ---------- */
/* overflow:visible：tooltip / MCC 下拉不被卡片裁切 */
.apply-card { margin-bottom: 20px; overflow: visible; transition: opacity .2s ease; }
.apply-card > .card-header { align-items: center; }
.card-title { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-sub { font-size: 12.5px; font-weight: 400; display: inline-flex; align-items: center; gap: 6px; }
.ch-right { display: flex; align-items: center; gap: 10px; }
/* card-header 右侧工具行（筛选表单 + 操作按钮）：单行 flex 对齐，空间不足时整组换行不散排 */
.ch-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.ch-tools .form-inline { display: flex; align-items: center; gap: 8px; }
.ch-tools .form-inline input, .ch-tools .form-inline select { width: auto; min-width: 96px; }

/* ---------- 表单细节 ---------- */
.field-code { font-size: 12px; color: #8c8c8c; font-weight: 400; margin-left: 4px; }
.readonly-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #f7f8fa;
    color: var(--text-weak);
    font-size: 14px;
    font-family: inherit;
}
.readonly-input:disabled { cursor: not-allowed; }
.col-full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; padding: 2px 0 8px; }

.form-item .field-error { margin-top: 4px; font-size: 12px; color: var(--danger); }
.form-item.has-error input[type=text],
.form-item.has-error select { border-color: var(--danger); }
.form-item.has-error input:focus,
.form-item.has-error select:focus { box-shadow: 0 0 0 3px rgba(255, 77, 79, .14); }

/* 支付产品：一行 4 个 */
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; padding: 4px 0; }
.svc-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.svc-disabled { opacity: .7; }
@media (max-width: 1200px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 折叠子区块（商户站点） */
.sub-block { margin-top: 14px; border: 1px dashed var(--border); border-radius: var(--radius); }
.sub-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fafbfc; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.sub-title { font-weight: 600; font-size: 13.5px; }
.sub-block > div[id] { padding: 14px; transition: opacity .18s ease; }

/* ---------- 帮助 tooltip（承载官方原文，hover / focus 展示）---------- */
.help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 5px;
    border-radius: 50%;
    background: var(--primary-weak);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    vertical-align: middle;
    cursor: help;
    position: relative;
    flex: 0 0 15px;
}
.help::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%) translateY(-4px);
    width: 320px;
    max-width: 78vw;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(23, 26, 33, .94);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.7;
    text-align: left;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
    z-index: 90;
}
.help:hover::after, .help:focus::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 资质图片上传卡片 ---------- */
.img-grid { gap: 14px; }
.img-item { transition: opacity .2s ease; }
@media (max-width: 1100px) { .img-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.upload-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 0;
    background: #fff;
}
.upload-card .uc-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.upload-card .uc-name { font-weight: 600; font-size: 13.5px; }
.upload-card .uc-head .field-code { margin-left: auto; }
.upload-card .uc-body { display: flex; gap: 12px; align-items: flex-start; }
.upload-card .uc-thumb {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.upload-card .uc-thumb .uc-empty { font-size: 12px; color: #b6bac1; }
.upload-card .uc-img { display: none; width: 100%; height: 100%; object-fit: cover; }
.upload-card.has-img .uc-img { display: block; }
.upload-card.has-img .uc-empty { display: none; }
.upload-card .uc-actions { flex: 1; min-width: 0; }
.upload-card .uc-actions input[type=file] { width: 100%; font-size: 12px; padding: 6px 10px; }
.upload-card .uc-actions .img-status { font-size: 12px; margin-top: 4px; word-break: break-all; }
.upload-card .uc-actions .file-picked { margin-top: 4px; }

/* ---------- 提交预览：三张子卡片（校验汇总置顶 / 基础信息 / 图片清单）---------- */
.pv-bar { background: #fafbfc; } /* 浅灰色标题栏 */
.pv-bar .card-title { font-size: 14.5px; }

.pv-card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; margin-bottom: 14px; }
.pv-card:last-child { margin-bottom: 0; }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #fafbfc; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.pv-body { padding: 14px; }
.pv-scroll { max-height: 460px; overflow-y: auto; } /* 内容过多时卡片内独立滚动，不挤压页面 */

/* 分组：小标题 + 两列字段行 */
.pv-group + .pv-group { margin-top: 18px; }
.pv-group-title { padding: 6px 10px; margin-bottom: 10px; background: #f7f8fa; border-left: 3px solid var(--primary); border-radius: 4px; font-size: 13px; font-weight: 600; }
.pv-group-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
@media (max-width: 900px) { .pv-group-body { grid-template-columns: minmax(0, 1fr); } }

.pv-row { display: flex; align-items: baseline; gap: 6px; font-size: 13px; line-height: 1.9; }
.pv-k { flex: 0 0 auto; max-width: 55%; }
.pv-k::after { content: '：'; color: var(--text-weak); }
.pv-name { font-weight: 400; }
.pv-name.is-req { font-weight: 600; } /* 必填字段加粗 */
.pv-key { margin-left: 4px; font-size: 11.5px; color: #a0a3a9; }
.pv-v { flex: 1; min-width: 0; word-break: break-all; }
.pv-row.is-missing .pv-name, .pv-row.is-missing .pv-v { color: var(--danger); }

/* 汇总栏：总数 + 缺失大类（不再枚举一长串字段名） */
.pm-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.pv-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-cat { padding: 2px 9px; border: 1px solid #ffccc7; border-radius: 10px; background: #fff1f0; font-size: 12px; color: var(--danger); }

/* 图片清单：网格布局，一行最多 4 个 */
.pv-img-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .pv-img-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pv-img-card { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; text-align: center; }
.pv-img-card .pi-thumb {
    width: 100%;
    height: 78px;
    margin-bottom: 8px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfc;
    color: #b6bac1;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.pv-img-card .pi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pv-img-card .pi-name { font-size: 12.5px; font-weight: 500; }
.pv-img-card .pi-state { margin-top: 4px; font-size: 12px; }
.pv-img-card.is-ok { border-color: #b7eb8f; }
.pv-img-card.is-ok .pi-thumb { border-style: solid; border-color: #b7eb8f; }
.pv-img-card.is-ok .pi-state { color: var(--success); }
/* 上传中 / 本地已选（尚未取得官方 image_id）：琥珀色中间态，与「未上传」红态区分 */
.pv-img-card.is-pending { border-color: #ffd591; background: #fffbe6; }
.pv-img-card.is-pending .pi-thumb { border-style: solid; border-color: #ffd591; }
.pv-img-card.is-pending .pi-state { color: #d48806; }
.pv-img-card.is-weak .pi-state { color: var(--text-weak); }
.pv-img-card.is-missing { border-color: var(--danger); background: #fff8f8; }
.pv-img-card.is-missing .pi-thumb { border-color: var(--danger); background: #fff1f0; color: var(--danger); }
.pv-img-card.is-missing .pi-state { color: var(--danger); }

/* ---------- 空状态 ---------- */
.empty { padding: 42px 20px; }

/* ---------- 登录页（商用品牌感） ---------- */
/* ⚠️ 旧段（上方）已设 display:flex（横向）。覆盖段必须显式重写全部布局关键属性，
   否则 .login-footnote 会作为第二个 flex 项被排到登录卡旁边（已踩坑，见回归报告 §1.36 缺陷 D1.36-1） */
.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(1100px 520px at 12% -10%, rgba(22, 119, 255, .16), transparent 60%),
        radial-gradient(900px 480px at 88% 110%, rgba(54, 207, 201, .16), transparent 60%),
        linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
}
.login-box {
    width: 400px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px 30px 24px;
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, #fff 0%, #fcfdff 100%);
}
.login-box .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.login-box .brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #36cfc9 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.login-box h2 { font-size: 19px; }
.login-box .sub { margin-bottom: 20px; }
.login-box .login-tip { border-top: 1px dashed var(--border); padding-top: 12px; }
.login-footnote { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-weak); }
.pwd-row { position: relative; }
.pwd-row input { padding-right: 58px; }
.pwd-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: none;
    color: var(--text-weak);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
}

/* ---------- 移动端抽屉 ---------- */
/* 同一个按钮两种语义：桌面 = 收起为图标轨，窄屏 = 打开抽屉 */
.drawer-toggle { display: inline-flex; }
.drawer-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 90; display: none; }
body.drawer-open .drawer-mask { display: block; }

@media (max-width: 1280px) {
    .search-trigger { min-width: 160px; }
}

@media (max-width: 1024px) {
    .drawer-toggle { display: inline-flex; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 95;
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
        transition: transform .22s ease;
    }
    body.drawer-open .sidebar { transform: none; }
    .layout { --sidebar-w: 0px; }
    .sidebar { width: var(--sidebar-w); }
    body.drawer-open .sidebar, .layout-collapsed .sidebar { width: 260px; }
    body.drawer-open .sidebar .menu a .label,
    body.drawer-open .sidebar .logo .logo-text { display: inline; }
    body.drawer-open .sidebar .menu .group-title { height: auto; padding: 16px 20px 6px; color: rgba(255, 255, 255, .35); background: none; margin: 0; }
    body.drawer-open .sidebar .menu a { justify-content: flex-start; padding: 10px 18px; gap: 10px; }
    body.drawer-open .sidebar .logo { justify-content: flex-start; padding: 0 18px; }
    .search-trigger .flex-1, .search-trigger kbd { display: none; }
    .search-trigger { min-width: 34px; padding: 0 8px; }
    .um-trigger .um-name { display: none; }
}

@media (max-width: 768px) {
    body { font-size: 14px; }
    .header { padding: 0 12px; gap: 10px; }
    .content { padding: 14px 12px 36px; }
    .breadcrumb { padding: 9px 14px; }
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; }
    .stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card .value { font-size: 19px; }
    .form-grid { grid-template-columns: 1fr !important; }
    .form-inline { flex-direction: column; align-items: stretch; }
    .form-inline input, .form-inline select { width: 100%; }
    .cert-actions .btn { flex: 1 1 auto; text-align: center; }
    .pager { justify-content: center; }
    #toast-layer { left: 12px; right: 12px; max-width: none; transform: none; } /* 小屏铺满顶部，取消居中位移 */
    .login-box { width: 100%; padding: 26px 20px 20px; }
    .dlg { width: 94vw; }
}

@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr; }
    .header .title { font-size: 15px; }
    .search-trigger { display: none; }
}

/* ---------- 经营概览：周期筛选 / 告警 / 统计卡 / 快捷入口 ---------- */
.ov-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.ov-bar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.ov-range, .ov-updated { font-size: 12.5px; }

/* 周期分段控件 */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg a {
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-weak);
    border-right: 1px solid var(--border);
    background: #fff;
    transition: background .15s, color .15s;
}
.seg a:last-child { border-right: 0; }
.seg a:hover { background: #f5f7fa; color: var(--text); }
.seg a.active { background: var(--primary); color: #fff; }

/* 全局告警 */
.ov-alerts { margin-bottom: 16px; }
.ov-alerts .alert + .alert { margin-top: 8px; }
.ov-alert-text { margin-top: 4px; font-size: 12.5px; font-weight: 400; }

/* 统计卡：可点击跳转 + 图标 + hover + 更新时间 + 空态 */
a.stat-card {
    display: block;
    position: relative;
    padding: 18px 20px 34px;
    color: inherit;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    text-decoration: none;
}
a.stat-card:hover .label { color: var(--primary); }
a.stat-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat-card .stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #f2f6ff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.stat-card .stat-icon .mi { width: 18px; height: 18px; }
.stat-card .stat-sub { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--text-weak); }
.stat-card .stat-empty { margin-top: 6px; font-size: 12px; color: var(--text-weak); }
.stat-card.is-empty .value { color: var(--text-weak); }
.stat-card .stat-ft {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 12px;
    font-size: 11.5px;
    color: #a0a3a9;
}

/* 快捷入口分层：高频主色 / 次要边框 */
.quick-sec + .quick-sec { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.quick-sec-title { font-size: 12.5px; font-weight: 600; color: var(--text-weak); margin-bottom: 10px; }
.quick-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.quick-bar .btn-default { background: #fff; border-color: var(--border); color: var(--text); }
.quick-bar .btn-default:hover { border-color: var(--primary); color: var(--primary); background: #f7f9ff; }

/* ---------- 环境标识（本地 / 沙箱 / 生产） ---------- */
.env-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 1px 9px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    vertical-align: middle;
}
/* 环境配色：本地灰 / 沙箱橙 / 生产红（生产必须最醒目，避免联调误操作生产） */
.env-local   { color: #595959; background: #f5f5f5; border-color: #d9d9d9; }
.env-sandbox { color: #d46b08; background: #fff7e6; border-color: #ffd591; }
.env-prod    { color: #cf1322; background: #fff1f0; border-color: #ffa39e; }

/* ---------- 侧边菜单：分组间距 / 分组折叠 / 待办角标 ---------- */
.sidebar .menu .group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 14px 20px 6px;
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}
.sidebar .menu .group-title:first-child { margin-top: 0; }
.sidebar .menu .group-title:hover { color: #fff; }
.gt-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .55;
    transition: transform .18s ease;
}
.sidebar .menu .group-title.is-collapsed .gt-arrow { transform: rotate(-90deg); }
.sidebar .menu a.group-hidden { display: none; }
.layout-collapsed .sidebar .menu .group-title { pointer-events: none; }
.layout-collapsed .gt-arrow { display: none; }

.sidebar .menu a { position: relative; }
.sidebar .menu a .badge {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}
.layout-collapsed .sidebar .menu a .badge {
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    font-size: 10px;
    line-height: 14px;
}

/* ---------- 打印（对账单 / 明细表常见诉求） ---------- */
@media print {
    .sidebar, .header, .breadcrumb, .drawer-mask, .back-top, #toast-layer, #page-progress, .card-header .btn, .pager { display: none !important; }
    body { background: #fff; }
    .layout { display: block; }
    .main { display: block; }
    .content { padding: 0; }
    .card { border: 0; box-shadow: none; break-inside: avoid; }
    .table-wrap { overflow: visible !important; }
    table.grid { font-size: 12px; }
    table.grid th, table.grid td { padding: 6px 8px; }
    a[href]::after { content: ''; }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}