/* ===== 基础与组件（工业风格：方正、蓝灰主色、橙色警示） ===== */
:root {
    --brand: #0d5fb0;
    --brand-d: #0a3d75;
    --brand-l: #e8f1fa;
    --accent: #ff9f1c;
    --bg: #f2f4f7;
    --card: #ffffff;
    --line: #e2e8f0;
    --line-d: #cbd5e1;
    --text: #1b2733;
    --muted: #6b7a8d;
    --ok: #17915a;
    --warn: #d98009;
    --bad: #d64545;
    --radius: 4px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-d); }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
ul { margin: 0; padding-left: 18px; }

.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.money { color: var(--bad); font-weight: 600; }
.money-ok { color: var(--ok); font-weight: 600; }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.flex { display: flex; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hidden { display: none; }

/* 卡片 */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
}
.card-hd {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}
.card-bd { padding: 14px; }
.card-ft { padding: 10px 14px; border-top: 1px solid var(--line); background: #fafbfc; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 7px 14px;
    border: 1px solid var(--line-d);
    background: #fff;
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #3a2600; }
.btn-danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* 徽标 */
.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 12px;
    border: 1px solid transparent;
    line-height: 18px;
}
.badge-ok { background: #e7f6ee; color: var(--ok); border-color: #bfe5d0; }
.badge-warn { background: #fdf3e3; color: var(--warn); border-color: #f5dcb4; }
.badge-info { background: var(--brand-l); color: var(--brand); border-color: #c5ddf3; }
.badge-bad { background: #fdecec; color: var(--bad); border-color: #f6c9c9; }
.badge-muted { background: #f1f3f5; color: var(--muted); border-color: #e3e8ee; }

/* 表单 */
.form-item { margin-bottom: 12px; }
.form-item > label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 13px; }
.input, select.input, textarea.input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--line-d);
    border-radius: var(--radius);
    background: #fff;
    font-size: 14px;
    color: var(--text);
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(13, 95, 176, .12); }
textarea.input { min-height: 76px; resize: vertical; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .form-item { margin-bottom: 0; }
.check-list label { margin-right: 14px; }

/* 表格 */
table.tb { width: 100%; border-collapse: collapse; background: #fff; }
table.tb th, table.tb td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
table.tb th { background: #f6f8fa; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tb tr:hover td { background: #fafcfe; }
table.tb td.num, table.tb th.num { text-align: right; }
.tb-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* 描述列表 */
.dl { display: grid; grid-template-columns: 110px 1fr; row-gap: 6px; column-gap: 10px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-all; }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line-d);
}
.timeline li.ok::before { background: var(--ok); }
.timeline li.info::before { background: var(--brand); }
.timeline li.warn::before { background: var(--warn); }
.timeline li.bad::before { background: var(--bad); }
.timeline .t { font-weight: 600; }
.timeline .d { color: var(--muted); font-size: 13px; }
.timeline .a { color: var(--muted); font-size: 12px; }

/* 空态 */
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* 分页 */
.pager { display: flex; gap: 6px; align-items: center; padding: 12px 0; flex-wrap: wrap; }
.pager a { padding: 4px 10px; border: 1px solid var(--line-d); border-radius: var(--radius); background: #fff; color: var(--text); }
.pager a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager span { color: var(--muted); margin-right: 8px; }

/* 提示条 */
.alert { padding: 9px 12px; border-radius: var(--radius); margin-bottom: 12px; border: 1px solid; }
.alert-info { background: var(--brand-l); border-color: #c5ddf3; color: var(--brand-d); }
.alert-warn { background: #fdf3e3; border-color: #f5dcb4; color: #8a5a00; }
.alert-bad { background: #fdecec; border-color: #f6c9c9; color: #9c2b2b; }
.alert-ok { background: #e7f6ee; border-color: #bfe5d0; color: #106b41; }

/* 统计块 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius);
    padding: 12px;
}
.stat .v { font-size: 20px; font-weight: 700; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat.warn { border-left-color: var(--accent); }
.stat.ok { border-left-color: var(--ok); }
.stat.bad { border-left-color: var(--bad); }

/* 步骤条 */
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.steps span {
    padding: 3px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 12px;
    color: var(--muted);
}
.steps span.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps span.done { background: #e7f6ee; border-color: #bfe5d0; color: var(--ok); }

/* 开关列表 */
.kv-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv-row:last-child { border-bottom: 0; }

/* 标签 */
.tag { display: inline-block; padding: 1px 6px; background: #f1f3f5; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; color: var(--muted); margin-right: 4px; }

/* 上传/图片占位 */
.img-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border: 1px dashed var(--line-d);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 12px;
    background: #fafbfc;
}

/* 签名画布 */
.sign-pad { border: 1px solid var(--line-d); border-radius: var(--radius); background: #fff; display: block; touch-action: none; }
