/* ==========================================================================
   商务风统一层（biz.css）——最后加载，统一覆盖 app / extra / ui 里的碎样式
   --------------------------------------------------------------------------
   设计原则（改样式前先读一遍，别再各页面自己发明）：
   1. 一页只有一种「指标卡」：.stat / .kpi 共用同一套尺寸与字级，靠内容区分，
      不靠颜色区分；只有风险项（超期、逾期、待处理）才允许出现一条 2px 提示线。
   2. 卡片一律「白底 + 1px 细线 + 10px 圆角 + 无阴影」，信息靠留白和字级分层。
   3. 数字一律 tabular-nums，金额与台数在纵向能对齐。
   4. 彩色只用于状态语义（成功 / 警告 / 危险），不做装饰性渐变和彩色图标块；
     指标卡的数字一律墨色，风险只在卡片顶部留一条 2px 提示线。
   5. 同一层级的控件高度一致：按钮 34、输入 34、下拉 34、工具条内 32、小按钮 28。
   6. 列表页的筛选条与下方表格并成一张卡：上面是工具栏，下面是表格，不再两个盒子叠着。
   7. 模板里不写 <style> 块、不写死 padding；页面用到的 class 必须在这里有定义
     （tools/audit_ui.php 会检查，裸奔的 class 直接报错）。
   ========================================================================== */

html[data-theme="light"] {
    /* 商务蓝：比原来的 #3b82f6 更深一档，配白底不刺眼 */
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, .08);
    --success: #15803d;
    --warn: #b45309;
    --danger: #c0392b;
    --card: var(--panel);
    /* 统一细线：卡片、表格、分隔都用它，避免每处灰不一样 */
    --line: #e6eaf0;
    --line-strong: #d8dee7;
}

:root {
    --biz-radius: 10px;
    --biz-radius-sm: 7px;
    --biz-gap: 12px;
    --stat-h: 88px;
    --card: var(--panel);
    /* 深色皮肤下的细线，亮色在下面 html[data-theme="light"] 里覆盖 */
    --line: #232b3a;
    --line-strong: #2d3648;
}

/* 正文字号收一档：原来 body 14px，表格 13px，标签 11.5px，同一屏三种基准 */
body {
    font-size: 13px;
    line-height: 1.62;
}
h2 { font-size: 16px; }
h3 { font-size: 14px; }

/* ---------------- 左侧导航：分组标题收成小号字，层级靠字重与色阶 ---------------- */

.nav-group-title {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--muted);
    padding: 9px 10px 5px;
    border-radius: 0;
}
.nav-group-title:hover { background: transparent; color: var(--text); }
.nav-item {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
}
.nav-item .ni-ico { width: 16px; font-size: 13px; opacity: .7; }
.nav-item.is-active .ni-ico { opacity: 1; }
.nav-list { border-left-color: var(--line); }

/* 品牌块：去掉蓝绿渐变，深色方块更像企业标识 */
.brand-logo {
    background: #0f172a;
    border-radius: 8px;
    font-size: 14px;
    letter-spacing: 0;
}
html[data-theme="dark"] .brand-logo { background: #1e293b; }
.brand-title { font-size: 13.5px; font-weight: 600; }
.brand-sub { font-size: 10.5px; letter-spacing: .08em; }

/* ---------------- 内容区与页头 ---------------- */

.content { padding: 18px 24px 56px; }

.page-head {
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 2px;
}
.page-head h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.005em;
    line-height: 1.35;
}
.page-desc {
    font-size: 12.5px;
    line-height: 1.7;
    margin-top: 4px;
    max-width: 880px;
}
.page-actions { gap: 8px; }
.title-row { gap: 8px; }

/* ---------------- 卡片 ---------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--biz-radius);
    box-shadow: none;
    margin-bottom: var(--biz-gap);
}
.card-head {
    padding: 0 16px;
    min-height: 46px;
    border-bottom: 1px solid var(--line);
    gap: 10px;
    background: var(--panel);
}
.card-head h3 {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .005em;
    color: var(--text);
}
.card-head .muted,
.card-head .head-sub { font-size: 11.5px; }
.card-head .link { font-size: 12px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 12px; }
/* 卡片正文里的小件：内边距统一交给 card-body，子元素不再自带左右留白 */
.card-body > .callout { margin: 12px 0 0; }
.card-body > .badge-row { margin-left: 0; }
.card-body > .form-subtitle { margin: 14px 0 8px; }
.card-body > .inline-form { padding: 0; }
.card-body > .table-wrap { margin: 0 -16px -16px; }
.cell-clamp { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.card-foot { padding: 11px 16px; border-top: 1px solid var(--line); }
.card + .card { margin-top: 0; }

/* ---------------- 指标卡：.stat 与 .kpi 统一 ---------------- */

.stat-strip {
    gap: 10px;
    margin-bottom: var(--biz-gap);
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
/* 指标多（6 个以上）时用固定四列，避免最后一行只剩一两张卡 */
.stat-strip.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stat-strip.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 老页面写的是 .stat-row（索赔、退货、保险、信保等 40+ 处），历史上一直没有样式，
   四个指标卡会一张一行、每行拉满整个工作区。这里补成与 .stat-strip 相同的自适应栅格。 */
.stat-row {
    display: grid;
    gap: 10px;
    margin-bottom: var(--biz-gap);
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.kpi-grid {
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.stat,
.kpi {
    position: relative;
    display: block;
    min-height: var(--stat-h);
    padding: 12px 15px 11px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--biz-radius);
    box-shadow: none;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
}
a.stat:hover,
a.kpi:hover,
.kpi.is-drill:hover {
    border-color: var(--line-strong);
    background: var(--panel);
    text-decoration: none;
    transform: none;
}
/* 旧的彩色竖条与悬停高亮一律停用 */
.stat::after,
.kpi::after,
.kpi.is-drill::before { display: none; content: none; }

/* 风险提示线：默认无色，只有 is-warn / is-danger 才出现 */
.stat::before,
.kpi::before {
    content: "";
    position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: transparent;
}
.stat.is-warn::before, .kpi.kpi-warn::before { background: #d9a441; }
.stat.is-danger::before, .kpi.kpi-danger::before { background: var(--danger); }
.stat.is-ok::before, .kpi.kpi-green::before { background: #4f9d69; }

.stat-label,
.kpi-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .02em;
    line-height: 1.5;
}
.stat b,
.kpi-value {
    display: block;
    margin-top: 2px;
    font-size: clamp(19px, 1.55vw, 23px);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}
.stat em,
.kpi-foot {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    font-style: normal;
    color: var(--muted);
    line-height: 1.5;
}
.kpi-value small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.stat b small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }
/* 指标数字统一墨色：红/绿/橙只留给表格里的状态和顶部 2px 提示线，数字不上色 */
.stat b.text-red, .stat b.text-green, .stat b.text-orange, .stat b.text-blue,
.stat b.text-warn, .stat b.text-danger, .stat b.text-muted { color: var(--text) !important; }
.stat.is-warn b, .stat.is-danger b { color: var(--text); }
.stat b.is-masked,
.kpi-value.is-masked { letter-spacing: .1em; color: var(--muted); font-size: 17px; }
.stat em a,
.stat em .link { color: var(--primary); }
.stat em a:hover { text-decoration: underline; }
.kpi-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
/* 旧的彩色小图标块：收敛成右上角一枚极浅的标记，不抢数字 */
.kpi-icon {
    width: auto; height: auto; min-width: 0;
    padding: 0; border-radius: 0;
    background: none !important;
    color: var(--muted) !important;
    font-size: 11px; font-weight: 500; line-height: 1.4;
    display: inline-block;
}
.stat-grid.tight .stat,
.kpi-grid.tight .kpi { min-height: 76px; }

/* ---------------- 分区标题（卡片外的二级标题） ---------------- */

.section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13.5px; font-weight: 600;
    margin: 4px 0 10px;
}
.section-title .muted { font-weight: 400; font-size: 12px; }

/* ---------------- 页签 ---------------- */

.tab-strip {
    gap: 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--biz-gap);
    padding: 0 2px;
}
.tab-strip .tab {
    position: relative;
    padding: 9px 14px 10px;
    font-size: 13px;
    color: var(--text-2);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab-strip .tab:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.tab-strip .tab.is-on {
    color: var(--text);
    font-weight: 600;
    border-bottom-color: var(--text);
    background: transparent;
}

/* ---------------- 表格 ---------------- */

table.table { font-size: 13px; }
table.table th {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--muted);
    background: var(--panel-2);
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
}
table.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: var(--panel-2); }
html[data-theme="light"] table.table th { background: var(--panel-2); }
html[data-theme="light"] table.table tbody tr:hover { background: #f8fafc; }
table.table .num,
table.table th.num,
table.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table tr.is-warn > td { background: rgba(217, 164, 65, .07); }
table.table tr.is-danger > td { background: rgba(192, 57, 43, .06); }
.cell-sub { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------------- 表单控件统一高度 ---------------- */

.btn { height: 34px; padding: 0 14px; border-radius: var(--biz-radius-sm); font-size: 13px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 40px; font-size: 14px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); filter: none; }
.btn-outline {
    background: var(--panel);
    border-color: var(--line-strong);
    color: var(--text-2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--panel); }
.btn-ghost { color: var(--text-2); }
.btn:hover { filter: none; }

.form-control {
    height: 34px;
    border-radius: var(--biz-radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--panel);
    font-size: 13px;
}
/* app.css 用「.form-control, select.form-control, textarea.form-control」成组写了 38px、
   灰底和 13.5px，权重比这里的 .form-control 高，下拉和文本域必须单独压回来 */
select.form-control,
textarea.form-control {
    height: 34px;
    border-color: var(--line-strong);
    background-color: var(--panel);
    color: var(--text);
    font-size: 13px;
}
textarea.form-control { height: auto; }
select.form-control {
    padding-right: 30px;
    background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px;
}
.filter-bar select.form-control,
.inline-form select.form-control { height: 32px; background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; }
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    outline: none;
}
textarea.form-control { height: auto; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.form-hint { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.form-actions { margin-top: 14px; display: flex; gap: 8px; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--biz-radius);
    padding: 10px 12px;
    margin-bottom: var(--biz-gap);
}
.filter-bar > .filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 100%; }
.filter-bar > .filter-row + .filter-row { margin-top: 2px; }
.filter-bar .form-control { height: 32px; font-size: 12.5px; width: auto; }
.filter-bar .filter-row > .form-control { flex: 0 1 150px; min-width: 112px; }
.filter-bar .filter-kw { flex: 1 1 240px; min-width: 200px; }
.filter-bar .btn { height: 32px; flex: 0 0 auto; }
.filter-bar .spacer { flex: 1 1 auto; }
.inline-form { gap: 8px; align-items: flex-end; margin: 0; }
.inline-form .form-control { height: 32px; font-size: 12.5px; width: auto; flex: 0 1 170px; min-width: 120px; }
.inline-form .form-control[type="file"] { flex: 1 1 240px; }
.inline-form .btn { height: 32px; flex: 0 0 auto; }

/* 卡片里的表单/网格：以前有的页面套了 card-body、有的没套，靠这条兜住内边距 */
.card > .form-grid,
.card > form.form-grid,
.card > .inline-form,
.card > form.inline-form,
.card > form.stack-form { padding: 14px 16px; }
.card > .form-grid + .form-actions,
.card > form > .form-actions { padding: 0 16px 14px; }
.card > .card-body > .form-grid { padding: 0; }
.card > .card-body > .form-actions { padding: 0; }
.card > .filter-bar { margin: 12px 16px; }

/* 筛选条 + 下方表格卡并成一张「工具栏 + 表格」：
   以前是两个各自带圆角的盒子，中间 12px 缝，一页两个盒子看着散 */
.filter-bar:has(+ .card) {
    border-bottom-color: transparent;
    border-radius: var(--biz-radius) var(--biz-radius) 0 0;
    margin-bottom: 0;
}
.filter-bar + .card {
    border-radius: 0 0 var(--biz-radius) var(--biz-radius);
    margin-top: 0;
}
.filter-bar + .card > .card-head { border-radius: 0; }

/* ---------------- 标签 / 徽章 ---------------- */

.badge {
    font-size: 11.5px;
    font-weight: 500;
    padding: 1px 7px;
    border-radius: 5px;
    line-height: 1.6;
    background: var(--panel-3);
    color: var(--text-2);
}
.badge-blue { background: rgba(37, 99, 235, .09); color: #1d4ed8; }
.badge-green { background: rgba(21, 128, 61, .10); color: #15803d; }
.badge-orange { background: rgba(180, 83, 9, .10); color: #b45309; }
.badge-red { background: rgba(192, 57, 43, .10); color: #b3352a; }
.badge-gray { background: var(--panel-3); color: var(--text-2); }
.badge-purple { background: rgba(37, 99, 235, .09); color: #1d4ed8; }
.badge-accent { background: rgba(13, 148, 136, .10); color: #0f766e; }

/* ---------------- 卡片内直接落地的列表：统一左右留白 ---------------- */

.card > .cost-lines,
.card > .mini-kpi,
.card > .profit-lines { padding: 6px 16px 12px; margin-top: 0; }
.card > .cost-lines > div:last-child { border-bottom: 0; }
.card > .masked-box { margin: 12px 16px; }
.card > .mini-list { padding: 0; }
.card > .guide-box,
.card > .alert,
.card > .rev-next { margin: 12px 16px; }
.card > .guide-box + .form-grid { padding-top: 0; }

/* 侧栏「快捷入口」：文字行，不用胶囊（胶囊只给顶栏筛选） */
.quick-list { display: grid; padding: 6px 8px; }
.quick-row {
    display: block;
    padding: 8px 10px;
    border-radius: var(--biz-radius-sm);
    color: var(--text-2);
}
.quick-row:hover { background: var(--panel-2); text-decoration: none; }
.quick-row b { display: block; font-size: 12.5px; font-weight: 500; color: var(--text); }
.quick-row span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; line-height: 1.55; }

/* ---------------- 卡片内的内嵌小卡（流程卡 / 门店卡 / 场景卡） ---------------- */
.flow-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--biz-radius);
    padding: 14px 16px;
    box-shadow: none;
}
.flow-card h4 { font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }
.grid-cards { gap: var(--biz-gap); }
.card-head.is-bare {
    min-height: 0;
    padding: 0;
    border: 0;
    margin-bottom: 6px;
    background: transparent;
}
.card-body.is-flush-bottom { padding-bottom: 0; }

/* ---------------- 键值区 / 侧栏小列表 ---------------- */
.kv-grid { gap: 12px 20px; }
.kv-grid > div > span { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.kv-grid > div > b { font-size: 13px; font-weight: 500; }

.mini-list { display: grid; gap: 0; }
.mini-list > li {
    display: block;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
}
.mini-list > li:last-child { border-bottom: 0; }
.mini-list > li b { font-weight: 600; margin-right: 8px; }
.mini-list > li span { float: right; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-list > li em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.todo-line {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--text);
}
.todo-line:last-child { border-bottom: 0; }
.todo-line:hover { background: #f8fafc; text-decoration: none; }
.todo-line b { font-weight: 500; }
.todo-line span { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------------- 提示条 ---------------- */

.alert {
    border-radius: var(--biz-radius);
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 10px 12px;
    margin-bottom: var(--biz-gap);
    font-size: 12.5px;
    line-height: 1.7;
}
.alert-info {
    background: var(--panel-2);
    border-color: var(--line);
    color: var(--text-2);
}
.alert-danger,
.alert-error { background: rgba(192, 57, 43, .06); border-color: rgba(192, 57, 43, .22); color: #b3352a; }
.alert-warn { background: rgba(180, 83, 9, .06); border-color: rgba(180, 83, 9, .22); color: #a16207; }
.alert-success { background: rgba(21, 128, 61, .06); border-color: rgba(21, 128, 61, .22); color: #15803d; }
/* 亮色皮肤下 app.css 有更高优先级的配色，这里逐条盖掉 */
html[data-theme="light"] .alert-info { color: var(--text-2); background: var(--panel-2); border-color: var(--line); }
html[data-theme="light"] .alert-success { color: #166534; background: #f4faf6; border-color: #d3e8da; }
html[data-theme="light"] .alert-warn { color: #7c4a06; background: #fffbf2; border-color: #f0e0bd; }
html[data-theme="light"] .alert-error,
html[data-theme="light"] .alert-danger { color: #8f2f24; background: #fdf6f5; border-color: #f0d5d1; }
.alert > span:first-child { opacity: .55; font-size: 12px; }
.alert code { font-size: 12px; }
.demo-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--panel-3);
    color: var(--text-2);
    margin-right: 8px;
    vertical-align: 1px;
}
/* 演示提示：压成一条细线提示，不再抢占首屏 */
.demo-note {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 7px 12px;
    margin-bottom: var(--biz-gap);
    border: 1px solid var(--line);
    border-radius: var(--biz-radius-sm);
    background: var(--panel-2);
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.65;
}
.demo-note .demo-tag { flex: 0 0 auto; margin-right: 4px; }
.demo-note b { font-weight: 600; color: var(--text); }
.demo-note code { font-size: 11.5px; }

/* ---------------- 明细双栏 ---------------- */

.detail-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--biz-gap); }
.detail-main, .detail-side { gap: var(--biz-gap); }
/* 长表格撑宽时，先压住栅格子项，再交给 .table-wrap 横向滚动 */
.detail-main > *, .detail-side > * { min-width: 0; }
/* 长表格撑宽时，先压住栅格子项，再交给 .table-wrap 横向滚动 */
.detail-main > *, .detail-side > * { min-width: 0; }

/* ---------------- 顶栏快捷入口：从胶囊收成小圆角，选中态不用蓝底 ---------------- */

.topbar { border-bottom-color: var(--line); }
.quick-item {
    height: 30px;
    border-radius: 8px;
    border-color: var(--line);
    font-size: 12.5px;
    color: var(--text-2);
}
.quick-item:hover { border-color: var(--line-strong); color: var(--text); }
.quick-item.is-active {
    background: var(--panel-2);
    border-color: var(--line-strong);
    color: var(--text);
    font-weight: 600;
}
.quick-item .qi-badge,
.icon-btn .ib-badge {
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}

/* ---------------- 说明框：去掉蓝色虚线与浅蓝底，改成中性折叠块 ---------------- */

.guide-box {
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: var(--biz-radius);
    background: var(--panel-2);
    padding: 0 14px;
    margin: 0 0 var(--biz-gap);
    font-size: 12.5px;
}
.guide-box summary { color: var(--text-2); font-weight: 500; font-size: 12.5px; padding: 9px 0; }
.guide-box summary:hover { color: var(--text); }
.guide-box[open] summary { color: var(--text); font-weight: 600; }
.guide-box ul { font-size: 12px; line-height: 1.8; color: var(--text-2); }

/* ---------------- 空状态 ---------------- */

.empty { color: var(--muted); font-size: 12.5px; padding: 22px 12px; text-align: center; }
.empty.small { padding: 16px 12px; font-size: 12px; }
.empty-state { padding: 38px 20px; }
.empty-state-title { font-size: 13.5px; color: var(--text-2); }

/* ---------------- 分组导航（设置页左侧 / 快捷入口） ---------------- */

.side-nav { display: grid; gap: 2px; padding: 8px; }
.side-nav a {
    display: block;
    padding: 8px 10px;
    border-radius: var(--biz-radius-sm);
    font-size: 12.5px;
    color: var(--text-2);
}
.side-nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side-nav a b { display: block; font-weight: 500; }
.side-nav a em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------------- 驾驶舱（/）：12 栏 + 图表 + 待办 + 品牌分布 ---------------- */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--biz-gap);
    margin-bottom: var(--biz-gap);
}
.dash-grid > .card { margin-bottom: 0; }
.dash-grid > .span-3 { grid-column: span 3; }
.dash-grid > .span-4 { grid-column: span 4; }
.dash-grid > .span-5 { grid-column: span 5; }
.dash-grid > .span-6 { grid-column: span 6; }
.dash-grid > .span-7 { grid-column: span 7; }
.dash-grid > .span-8 { grid-column: span 8; }
.dash-grid > .span-9 { grid-column: span 9; }
.dash-grid > .span-12 { grid-column: span 12; }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.card-head .badge-row { margin-left: auto; }
.badge-row .badge:hover { opacity: .85; text-decoration: none; }

.legend { font-size: 11.5px; gap: 12px; }
.legend .dot { margin-right: 4px; vertical-align: 1px; }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.dot-blue { background: #2f5fde; }
.dot-indigo { background: #7c9bf5; }
.dot-amber { background: #e8a13a; }

.chart-wrap { padding: 8px 12px 0; }
.line-chart { display: block; width: 100%; height: auto; }
.axis-text { font-size: 10.5px; fill: var(--muted); }
.chart-tip { font-size: 10.5px; font-weight: 500; fill: var(--text-2); }
.chart-foot {
    display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 8px 16px 12px;
    font-size: 11.5px; color: var(--muted);
}

.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 16px 16px 8px; flex-wrap: wrap; }
.donut { position: relative; width: 116px; height: 116px; border-radius: 50%; flex: 0 0 116px; }
.donut-hole {
    position: absolute; inset: 19px;
    background: var(--panel); border-radius: 50%;
    display: grid; place-content: center; text-align: center;
}
.donut-hole b { font-size: 20px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.donut-hole span { font-size: 11px; color: var(--muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1 1 150px; min-width: 148px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.donut-legend li b { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.donut-legend li em { font-style: normal; font-size: 11.5px; color: var(--muted); min-width: 32px; text-align: right; }

.callout {
    margin: 6px 16px 14px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-2);
}
.callout-warn { background: rgba(217, 164, 65, .08); border-color: rgba(217, 164, 65, .3); color: var(--warn); }

.todo-list { display: grid; }
.todo-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { background: var(--panel-2); text-decoration: none; }
.todo-tag {
    flex: 0 0 auto;
    font-size: 11px; font-weight: 500;
    padding: 1px 7px; border-radius: 5px;
    background: var(--panel-3); color: var(--text-2);
}
.tag-red { background: rgba(192, 57, 43, .10); color: #b3352a; }
.tag-blue { background: rgba(37, 99, 235, .09); color: #1d4ed8; }
.tag-amber { background: rgba(180, 83, 9, .10); color: #b45309; }
.tag-slate { background: var(--panel-3); color: var(--text-2); }
.todo-main { flex: 1 1 auto; min-width: 0; }
.todo-main b {
    display: block; font-size: 12.5px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.todo-main small {
    display: block; font-size: 11.5px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.todo-arrow { color: var(--muted); font-size: 12px; }

.bar-list { display: grid; gap: 10px; padding: 14px 16px 6px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bar-label { flex: 0 0 76px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1 1 auto; height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--primary); opacity: .8; }
.bar-value { flex: 0 0 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 条形下面的口径说明：渠道/车型那一行要看成交，不只看客流 */
.bar-note { margin: -4px 0 0 86px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- 到店转化漏斗 ---------------- */

.funnel { padding: 12px 16px 4px; display: grid; gap: 9px; }.funnel-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 150px; align-items: center; gap: 10px; }
.funnel-name { font-size: 12.5px; color: var(--text-2); }
.funnel-bar { position: relative; height: 28px; border-radius: 8px; background: var(--panel-3); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--primary), rgba(13, 148, 136, .5)); }
.funnel-bar b {
    position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px;
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text);
}
.funnel-meta { text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel-meta b { display: block; font-size: 13px; color: var(--text); }
.funnel-foot {
    display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 11px 16px 13px; margin-top: 6px;
    border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted);
}
.funnel-foot b { color: var(--text); font-weight: 600; }
.funnel-tabs { margin: 0 14px 6px; }
.card-head.sub-head { margin-top: 4px; border-top: 1px dashed var(--line); }
@media (max-width: 900px) {
    .funnel-row { grid-template-columns: 66px minmax(0, 1fr); }
    .funnel-meta { grid-column: 2; text-align: left; }
    .funnel-meta b { display: inline; margin-right: 6px; }
    .bar-note { margin-left: 0; }
}
.quick-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.quick-links a {
    font-size: 12px; color: var(--text-2);
    border: 1px solid var(--line); border-radius: 6px;
    padding: 4px 9px; background: var(--panel);
}
.quick-links a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ---------------- 列表/详情通用零件 ---------------- */

.vehicle-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v-thumb {
    width: 46px; height: 34px; border-radius: 6px; overflow: hidden;
    background: var(--panel-3); display: grid; place-items: center;
    flex: 0 0 46px; font-size: 13px; color: var(--muted);
}
.v-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-name { font-weight: 500; color: var(--text); }
.v-name:hover { color: var(--primary); text-decoration: none; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px 16px; }
.photo-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.photo-grid img { width: 100%; height: 108px; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 6px 8px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.card > .photo-grid + form.inline-form { padding-top: 0; }

.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 12px 16px 16px; }
.vehicle-mini {
    display: block; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel-2); color: var(--text);
}
.vehicle-mini:hover { border-color: var(--primary); text-decoration: none; }
.vm-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.vm-head b { font-weight: 600; }
.vm-head span { font-size: 11.5px; color: var(--muted); }
.vm-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.vm-price { margin-top: 6px; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }

.due-card .due-list { display: grid; }
.due-list a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text); font-size: 12.5px;
}
.due-list a:last-child { border-bottom: 0; }
.due-list a:hover { background: var(--panel-2); text-decoration: none; }
.due-list a b { flex: 0 0 auto; font-weight: 500; }
.due-list a span { flex: 1 1 auto; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-list a em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* 详情页的折叠操作组：统一成细线折叠块，不再用浏览器默认三角 */
details.fold { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); margin-top: 8px; }
details.fold > summary {
    display: flex; align-items: center; gap: 7px;
    padding: 8px 12px; cursor: pointer;
    font-size: 12.5px; color: var(--text-2);
    list-style: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "+"; width: 10px; color: var(--muted); font-size: 13px; }
details.fold[open] > summary::before { content: "−"; }
details.fold[open] > summary { color: var(--text); font-weight: 500; border-bottom: 1px solid var(--line); }
details.fold > form,
details.fold > div { padding: 10px 12px; }
details.fold .stack-xs { gap: 8px; }

.follow-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px 16px; }
.follow-form .form-control { height: 32px; font-size: 12.5px; width: auto; }
.follow-form select.form-control { flex: 0 0 104px; }
.follow-form input[name="content"] { flex: 1 1 220px; min-width: 180px; }
.follow-form input[type="date"] { flex: 0 0 148px; }
.follow-form .btn { height: 32px; flex: 0 0 auto; }

/* 跟进/投诉时间线：竖线 + 节点，读起来像流水台账 */
.timeline { list-style: none; margin: 0; padding: 6px 16px 12px; }
.timeline li { position: relative; padding: 0 0 14px 20px; font-size: 12.5px; color: var(--text-2); }
.timeline li::before { display: none; }
.timeline li::after {
    content: ""; position: absolute; left: 4px; top: 14px; bottom: -2px;
    width: 1px; background: var(--line);
}
.timeline li:last-child::after { display: none; }
.tl-dot {
    position: absolute; left: 0; top: 4px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--panel); border: 2px solid var(--line-strong);
}
.tl-body { min-width: 0; }
.tl-body b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.tl-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); }

.input-sm { height: 30px; font-size: 12px; min-width: 0; }
.text-muted { color: var(--muted) !important; }
.badge-amber { background: rgba(180, 83, 9, .10); color: #b45309; }
.nav-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; }
.tab-strip .tab b { font-weight: 500; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.tab-strip .tab.is-on b { color: var(--text-2); }

/* ==========================================================================
   零件库：以下都是页面里已经在用的 class，以前没有定义，靠浏览器默认样式裸奔
   ========================================================================== */

/* 消息中心（/notifications）：细线分行，未读用左侧 2px 蓝线，不用整行底色 */
.msg-item {
    display: flex;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    border-left: 2px solid transparent;
}
.msg-item:last-child { border-bottom: 0; }
.msg-item.is-unread { border-left-color: var(--primary); background: var(--panel-2); }
.msg-dot {
    flex: 0 0 8px; width: 8px; height: 8px;
    margin-top: 6px; border-radius: 50%;
    background: var(--line-strong);
}
.msg-dot.info { background: #94a3b8; }
.msg-dot.success { background: #4f9d69; }
.msg-dot.warn { background: #d9a441; }
.msg-dot.danger { background: var(--danger); }
.msg-body { flex: 1 1 auto; min-width: 0; }
.msg-title {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13px; font-weight: 500; line-height: 1.5;
}
.msg-title a { color: var(--text); }
.msg-title a:hover { color: var(--primary); text-decoration: none; }
.msg-text {
    margin-top: 3px;
    font-size: 12.5px; color: var(--text-2); line-height: 1.65;
}
.msg-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* 全局搜索 */
.search-bar { padding: 0; }
.search-bar .card-body { padding: 14px 16px; }
.search-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-inline .form-control { flex: 1 1 320px; min-width: 200px; }
.search-inline .btn { flex: 0 0 auto; }
.search-bar kbd {
    display: inline-block; padding: 0 5px;
    border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px;
    background: var(--panel-2); font-size: 11px; font-family: inherit; color: var(--text-2);
}
.search-summary {
    padding: 2px 2px 10px;
    font-size: 12.5px; color: var(--text-2);
}
.search-summary b { font-weight: 600; color: var(--text); }

/* 设置 · 界面外观 */
.theme-grid, .accent-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
.theme-card {
    width: 148px; padding: 8px;
    border: 1px solid var(--line); border-radius: var(--biz-radius);
    background: var(--panel); cursor: pointer;
}
.theme-card:hover { border-color: var(--line-strong); }
.theme-card.is-on, .accent-card.is-on {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
}
.theme-card b { display: block; font-size: 12.5px; font-weight: 500; }
.tc-prev {
    position: relative; display: block; height: 62px;
    margin-bottom: 7px; border-radius: 6px;
    border: 1px solid var(--line); overflow: hidden;
}
.tc-prev i { position: absolute; left: 0; top: 0; bottom: 0; width: 26px; display: block; }
.accent-card {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer;
    border: 1px solid var(--line); border-radius: var(--biz-radius-sm);
    background: var(--panel);
}
.accent-card:hover { border-color: var(--line-strong); }
.accent-card i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.accent-card b { font-size: 12.5px; font-weight: 500; }
.accent-card[data-accent="blue"] i { background: #2563eb; }
.accent-card[data-accent="teal"] i { background: #0d9488; }
.accent-card[data-accent="indigo"] i { background: #4f46e5; }
.accent-card[data-accent="amber"] i { background: #d97706; }
.accent-card[data-accent="rose"] i { background: #e11d48; }

/* 收车定价计算器（/appraisal） */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--biz-gap); align-items: start; }
.calc-layout > .card { margin-bottom: 0; }
.calc-layout > form > .form-grid { padding: 14px 16px 0; }
.calc-layout > form > .btn { margin: 14px 16px 16px; }
.calc-result .calc-big { padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.calc-result .calc-big span { display: block; font-size: 12px; color: var(--muted); }
.calc-result .calc-big b { display: block; margin-top: 2px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.calc-result .calc-big em { display: block; margin-top: 4px; font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.calc-lines { display: grid; padding: 6px 16px; }
.calc-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.calc-lines > div:last-child { border-bottom: 0; }
.calc-lines > div span { color: var(--muted); }
.calc-lines > div b { font-weight: 500; font-variant-numeric: tabular-nums; }
.calc-lines .calc-total { border-top: 1px solid var(--line-strong); border-bottom: 0; margin-top: 2px; padding-top: 10px; }
.calc-lines .calc-total span { color: var(--text); font-weight: 600; }
.calc-lines .calc-total b { font-size: 15px; font-weight: 650; }
.calc-layout .callout { margin: 4px 16px 16px; }

/* 评估结果（/leads/{id}）：2 列小格 + 评分条 */
.calc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calc-cell { background: var(--panel); padding: 10px 14px; }
.calc-cell span { display: block; font-size: 11.5px; color: var(--muted); }
.calc-cell b { display: block; margin-top: 1px; font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.calc-cell.highlight { background: var(--panel-2); }
.calc-cell.highlight b { font-weight: 650; }
.score-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 14px 16px; }
.score span { display: block; font-size: 11.5px; color: var(--muted); }
.score b { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-bar { margin-top: 5px; height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 3px; background: var(--primary); opacity: .75; }

/* 同行求购（/wholesale/demands）：可折叠表单 + 匹配车源 */
details.fold-card { margin-bottom: var(--biz-gap); }
details.fold-card > summary {
    display: flex; align-items: center; gap: 7px;
    padding: 12px 16px; cursor: pointer;
    font-size: 13px; font-weight: 500; color: var(--text-2);
    list-style: none;
}
details.fold-card > summary::-webkit-details-marker { display: none; }
details.fold-card > summary::before { content: "+"; width: 10px; color: var(--muted); }
details.fold-card[open] > summary { color: var(--text); border-bottom: 1px solid var(--line); }
details.fold-card[open] > summary::before { content: "−"; }
details.fold-card > form > .form-grid { padding: 14px 16px 0; }
details.fold-card > form > .btn { margin: 14px 16px 16px; }
.match-list { display: grid; gap: 2px; }
.match-list a { font-size: 12px; color: var(--text-2); }
.match-list a:hover { color: var(--primary); }

/* 同行档案里的额度占用条 */
.credit-bar { margin-top: 4px; height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; }
.credit-bar i { display: block; height: 100%; background: var(--text-2); opacity: .55; }
.credit-bar i.is-warn { background: #d9a441; opacity: 1; }
.credit-bar i.is-danger { background: var(--danger); opacity: 1; }

/* 表格里的「记催收」折叠入口 */
summary.link-like { cursor: pointer; font-size: 12px; color: var(--primary); list-style: none; }
summary.link-like::-webkit-details-marker { display: none; }
summary.link-like:hover { text-decoration: underline; }

/* 车辆变更流水里的 旧值 → 新值 */
.tl-diff { display: block; margin-top: 1px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 单车成本卡：金额靠右对齐，合计加一条实线 */
.cost-card .cost-lines { display: grid; padding: 6px 16px 12px; }
.cost-card .cost-lines > div {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 6px 0; border-bottom: 1px dashed var(--line);
    font-size: 12.5px;
}
.cost-card .cost-lines > div:last-child { border-bottom: 0; }
.cost-card .cost-lines > div span { color: var(--muted); }
.cost-card .cost-lines > div b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* 键值区单列（车辆信息侧栏） */
.kv-grid.single { grid-template-columns: minmax(0, 1fr); }

/* 四列键值区：额度 / 逾期这类数字多，窄屏两列，避免数字被挤成竖排 */
.kv-grid.kv-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .kv-grid.kv-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; } }

/* 报价单快速操作：纵向按钮组 */
.stack-actions { display: grid; gap: 8px; padding: 14px 16px; }
.stack-actions .btn { width: 100%; }
.alert-warning { background: rgba(180, 83, 9, .06); border-color: rgba(180, 83, 9, .22); color: #a16207; }
html[data-theme="light"] .alert-warning { color: #7c4a06; background: #fffbf2; border-color: #f0e0bd; }

/* 工单提示列表 */
.tip-list { list-style: none; margin: 0; padding: 6px 16px 12px; }
.tip-list li {
    position: relative; padding: 5px 0 5px 14px;
    font-size: 12.5px; color: var(--text-2); line-height: 1.65;
    border-bottom: 1px solid var(--line);
}
.tip-list li:last-child { border-bottom: 0; }
.tip-list li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

/* 异常中心 */
.anomaly-body { min-width: 0; }

/* 导入页：编号规则与字段示例 */
.rule-list { margin: 0; padding: 12px 16px 12px 34px; font-size: 12.5px; color: var(--text-2); line-height: 1.9; }
.code-block {
    margin: 12px 16px 16px; padding: 10px 12px;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--biz-radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px; line-height: 1.7; color: var(--text-2);
    overflow-x: auto; white-space: pre;
}

/* 页签右侧的统计说明 */
.tab-spacer { flex: 1 1 auto; }
.tab-note { font-size: 11.5px; color: var(--muted); padding-bottom: 10px; white-space: nowrap; }

/* 平台端指标卡角标：不再用彩色字 */
.kpi-icon.i-blue, .kpi-icon.i-green, .kpi-icon.i-amber { color: var(--muted) !important; background: none !important; }

/* 指标卡五列 */
.stat-strip.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* 表格行悬停（部分页面单独写了 table-hover） */
table.table-hover tbody tr:hover { background: var(--panel-2); }
html[data-theme="light"] table.table-hover tbody tr:hover { background: #f8fafc; }

/* 打印页工具条与主色对齐（打印稿本身仍走 print/_head.php 里的独立样式） */

/* 侧栏开关只在窄屏出现：模板不再写内联 display:none 和小 <style> 块 */
.sidebar-toggle { display: none !important; }
@media (max-width: 1040px) { .sidebar-toggle { display: inline-grid !important; } }

/* 403 / 404：独立页，与后台同一套卡片、字号和按钮 */
.err-page { max-width: 720px; margin: 8vh auto; padding: 0 16px; }
.err-card { text-align: center; padding: 42px 24px; }
.err-code {
    font-size: 36px; font-weight: 650; line-height: 1;
    letter-spacing: .04em; color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.err-title { margin-top: 12px; font-size: 15px; font-weight: 600; }
.err-desc { margin: 6px auto 0; max-width: 470px; font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.err-actions { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------------- 窄屏：指标卡两列 ---------------- */

@media (max-width: 1100px) {
    .content { padding: 14px 14px 48px; }
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .dash-grid > .span-3, .dash-grid > .span-4, .dash-grid > .span-5,
    .dash-grid > .span-6, .dash-grid > .span-7, .dash-grid > .span-8,
    .dash-grid > .span-9, .dash-grid > .span-12 { grid-column: span 1; }
    .stat-strip, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-strip.cols-4, .stat-strip.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .calc-layout { grid-template-columns: minmax(0, 1fr); }
    .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .score-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .stat-strip, .kpi-grid { grid-template-columns: minmax(0, 1fr); }
    .stat-strip.cols-4, .stat-strip.cols-5 { grid-template-columns: minmax(0, 1fr); }
    .page-head h1 { font-size: 18px; }
    .calc-grid, .score-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* P01~P03 物流轨迹时间线：节点用色区分正常 / 异常 / 已签收 */
.tl-dot.is-ok { border-color: var(--ok, #1f9d55); background: var(--ok, #1f9d55); }
.tl-dot.is-bad { border-color: var(--danger, #d64545); background: var(--danger, #d64545); }
.tl-dot.is-warn { border-color: var(--warn, #d99000); background: var(--warn, #d99000); }
.tl-dot.is-info { border-color: var(--primary); background: var(--panel); }
.tl-dot.is-gray { border-color: var(--line-strong); }
.tl-note { margin-top: 2px; color: var(--text-2); }
.tl-flag { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--muted); border: 1px dashed var(--line); border-radius: 3px; padding: 0 4px; }

/* 客户只读页（无侧栏） */
.pub-body { background: var(--bg, #f5f6f8); }
.pub-head { background: var(--panel, #fff); border-bottom: 1px solid var(--line, #e6e8eb); }
.pub-head-inner { max-width: 960px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pub-brand { display: flex; align-items: center; gap: 10px; }
.pub-brand-name { font-size: 15px; font-weight: 700; }
.pub-brand-sub { font-size: 11.5px; color: var(--muted); }
.pub-search { display: flex; gap: 6px; }
.pub-search .form-control { width: 220px; }
.pub-main { max-width: 960px; margin: 18px auto 40px; padding: 0 18px; }
.pub-foot { max-width: 960px; margin: 0 auto 28px; padding: 0 18px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.pub-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.pub-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.pub-milestone { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.pub-milestone span { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pub-milestone span.is-on { border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* ==========================================================================
   数据字典管理（/settings/dicts）
   左类型 / 右选项两栏；窄屏堆成一栏。
   ========================================================================== */
.dict-layout {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.dict-types { position: sticky; top: 12px; }
.dict-type-list { max-height: 62vh; overflow: auto; padding: 6px; }

.dict-type {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 7px;
    text-decoration: none;
    color: var(--text-2);
    font-size: 12.5px;
    border: 1px solid transparent;
}
.dict-type:hover { background: var(--panel-3); text-decoration: none; color: var(--text); }
.dict-type.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.dt-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-code { display: none; font-size: 10.5px; color: var(--muted); }
.dict-type.is-on .dt-code { display: inline; }
.dt-tag {
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 15px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--panel-3);
    color: var(--muted);
}
.dt-tag.is-custom { background: rgba(21, 128, 61, .12); color: var(--success); }

.dict-newtype { border-top: 1px solid var(--border-soft); padding: 10px 12px 12px; }
.dict-newtype-label { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.dict-newtype-row { display: flex; gap: 6px; }
.dict-newtype-row .form-control { flex: 1; min-width: 0; }

.dict-hint { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 6px 0 0; }

.dict-table td { padding: 5px 8px; vertical-align: middle; }
.dict-table .form-control { height: 30px; }
.dict-table tr.is-off td { opacity: .55; }

.dict-switch { display: inline-flex; align-items: center; cursor: pointer; }
.dict-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.dict-switch span {
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: var(--panel-3);
    border: 1px solid var(--border);
    position: relative;
    transition: background .15s, border-color .15s;
    display: block;
}
.dict-switch span::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform .15s, background .15s;
}
.dict-switch input:checked + span { background: var(--primary-soft); border-color: var(--primary); }
.dict-switch input:checked + span::after { transform: translateX(15px); background: var(--primary); }

.dict-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dict-foot .btn-primary { margin-left: auto; }

@media (max-width: 900px) {
    .dict-layout { grid-template-columns: 1fr; }
    .dict-types { position: static; }
    .dict-type-list { max-height: 210px; }
}
