/* ==========================================================================
   计量与实验室 · CMM Workspace v3
   设计语言：纸白底、墨黑字、1px 细边、克制的语义色
   前缀 cm-
   可读性基线：正文 14.5px / 1.65，表格 13.5px / 1.55，最小文字 12px（仅代码与角标）
   ========================================================================== */

:root {
    --cm-ink: #1b1b1f;
    --cm-ink-2: #3d3d45;
    --cm-ink-3: #52525b;
    --cm-ink-4: #74747d;
    --cm-ink-5: #a1a1a9;

    --cm-line: #e5e5e1;
    --cm-line-2: #efefeb;
    --cm-line-3: #f5f5f2;

    --cm-paper: #f7f7f5;
    --cm-card: #ffffff;
    --cm-sink: #fafaf8;

    --cm-accent: #2c4a63;
    --cm-accent-soft: #edf1f5;
    --cm-accent-line: #d2dde7;

    --cm-green: #2c6b45;
    --cm-green-soft: #edf5f0;
    --cm-green-line: #cfe4d8;

    --cm-amber: #8a5c14;
    --cm-amber-soft: #fbf4e6;
    --cm-amber-line: #eddfc4;

    --cm-rose: #9c3427;
    --cm-rose-soft: #fbeeeb;
    --cm-rose-line: #eed5cf;

    --cm-violet: #53427a;
    --cm-violet-soft: #f2eef8;
    --cm-cyan: #24626f;
    --cm-cyan-soft: #eaf3f5;

    --cm-r-sm: 7px;
    --cm-r: 10px;
    --cm-r-lg: 14px;

    --cm-shadow-1: 0 1px 2px rgba(24, 24, 27, .04);
    --cm-shadow-2: 0 10px 30px -16px rgba(24, 24, 27, .22), 0 2px 6px rgba(24, 24, 27, .04);
    --cm-shadow-3: 0 30px 70px -30px rgba(24, 24, 27, .32), 0 4px 14px rgba(24, 24, 27, .06);

    --cm-side-w: 240px;
    --cm-top-h: 62px;

    --cm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    --cm-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.cm-body {
    margin: 0;
    font-family: var(--cm-font);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--cm-ink);
    background: var(--cm-paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.cm-body ::selection { background: #dbe4ee; }
.cm-body a { color: inherit; text-decoration: none; }
.cm-body button { font-family: inherit; cursor: pointer; }
.cm-body input, .cm-body select, .cm-body textarea { font-family: inherit; font-size: 14px; color: var(--cm-ink); }
.cm-body h1, .cm-body h2, .cm-body h3, .cm-body h4, .cm-body h5 { margin: 0; font-weight: 600; letter-spacing: -.008em; }
.cm-body p { margin: 0; }
.cm-body ul, .cm-body ol { margin: 0; padding: 0; list-style: none; }
.cm-body dl, .cm-body dd, .cm-body dt { margin: 0; }
.cm-body table { border-collapse: collapse; }

.cm-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cm-ico-sm { width: 14px; height: 14px; }
.cm-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* 兼容旧标记：图标雪碧图不参与文档流，避免在页面顶部撑出大片留白 */
.oq-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.cm-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.cm-mono { font-family: var(--cm-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cm-muted { color: var(--cm-ink-4); }
.cm-nowrap { white-space: nowrap; }

/* ==========================================================================
   布局
   ========================================================================== */
.cm-app { display: flex; min-height: 100vh; }

.cm-side {
    width: var(--cm-side-w);
    flex: none;
    background: var(--cm-card);
    border-right: 1px solid var(--cm-line);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.cm-side::-webkit-scrollbar { width: 0; }

.cm-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--cm-line-2);
    flex: none;
}
.cm-brand-mark {
    width: 30px; height: 30px; border-radius: 8px; flex: none;
    background: var(--cm-ink); color: #fff;
    display: grid; place-items: center;
}
.cm-brand-mark svg { width: 17px; height: 17px; }
.cm-brand-text { min-width: 0; line-height: 1.25; }
.cm-brand-text strong { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.cm-brand-text small { display: block; font-size: 10.5px; color: var(--cm-ink-5); letter-spacing: .12em; text-transform: uppercase; }

.cm-nav { padding: 12px 10px 18px; flex: 1; }
.cm-nav-group { margin-bottom: 16px; }
.cm-nav-group:last-child { margin-bottom: 0; }
.cm-nav-label {
    font-size: 12px; font-weight: 600; color: var(--cm-ink-5);
    letter-spacing: .08em; padding: 0 10px 6px;
}
.cm-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--cm-r-sm);
    font-size: 13.5px; color: var(--cm-ink-2); line-height: 1.4;
    transition: background .15s, color .15s;
}
.cm-nav-item + .cm-nav-item { margin-top: 1px; }
.cm-nav-item:hover { background: var(--cm-line-3); color: var(--cm-ink); }
.cm-nav-item.is-on { background: var(--cm-ink); color: #fff; }
.cm-nav-item.is-on .cm-ico { stroke-width: 1.8; }
.cm-nav-item .cm-ico { width: 16px; height: 16px; color: var(--cm-ink-4); }
.cm-nav-item.is-on .cm-ico { color: #fff; }
.cm-nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-nav-badge {
    flex: none; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--cm-rose-soft); color: var(--cm-rose);
    font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
    font-variant-numeric: tabular-nums;
}
.cm-nav-item.is-on .cm-nav-badge { background: rgba(255, 255, 255, .18); color: #fff; }
.cm-nav-badge.is-quiet { background: var(--cm-line-3); color: var(--cm-ink-4); }

.cm-side-foot { flex: none; border-top: 1px solid var(--cm-line-2); padding: 10px; }
.cm-user { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--cm-r-sm); }
.cm-user:hover { background: var(--cm-sink); }
.cm-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    background: var(--cm-accent-soft); color: var(--cm-accent);
    display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
}
.cm-user-meta { min-width: 0; flex: 1; line-height: 1.3; }
.cm-user-meta strong { display: block; font-size: 13px; font-weight: 600; }
.cm-user-meta small { display: block; font-size: 11.5px; color: var(--cm-ink-5); }

.cm-main { flex: 1; min-width: 0; margin-left: var(--cm-side-w); display: flex; flex-direction: column; }

/* 顶栏 */
.cm-top {
    height: var(--cm-top-h); flex: none;
    display: flex; align-items: center; gap: 14px;
    padding: 0 26px;
    background: rgba(247, 247, 245, .88);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--cm-line);
    position: sticky; top: 0; z-index: 40;
}
.cm-top-title { min-width: 0; }
.cm-top-title h1 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.cm-top-title p { font-size: 12.5px; color: var(--cm-ink-4); margin-top: 1px; }
.cm-top-spacer { flex: 1; }
.cm-search {
    display: flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 12px;
    border: 1px solid var(--cm-line); border-radius: 20px;
    background: var(--cm-card); color: var(--cm-ink-4);
    min-width: 220px;
}
.cm-search input { border: 0; background: none; outline: none; width: 100%; font-size: 13px; }
.cm-search:focus-within { border-color: #cfd3d8; box-shadow: 0 0 0 3px rgba(44, 74, 99, .06); }

.cm-view { flex: 1; min-width: 0; }
.cm-page { padding: 16px 26px 72px; max-width: 1400px; margin: 0 auto; }

/* ==========================================================================
   通用组件
   ========================================================================== */
.cm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cm-head h2 { font-size: 21px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; }
.cm-head p { font-size: 13.5px; color: var(--cm-ink-3); margin-top: 5px; max-width: 720px; }
.cm-head-note {
    position: relative; padding-left: 14px; margin: 2px 0 0;
    max-width: 84ch; font-size: 13.2px; line-height: 1.75; color: var(--cm-ink-3);
}
.cm-head-note::before {
    content: ""; position: absolute; left: 0; top: .42em; bottom: .42em;
    width: 2px; border-radius: 2px; background: #dcdfe3;
}
.cm-head-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.cm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px;
    border: 1px solid var(--cm-line); border-radius: var(--cm-r-sm);
    background: var(--cm-card); color: var(--cm-ink-2);
    font-size: 13.5px; font-weight: 500; white-space: nowrap;
    transition: border-color .15s, background .15s, color .15s;
}
.cm-btn:hover { border-color: #cfd3d8; background: #fff; color: var(--cm-ink); }
.cm-btn:active { transform: translateY(.5px); }
.cm-btn-primary { background: var(--cm-ink); border-color: var(--cm-ink); color: #fff; }
.cm-btn-primary:hover { background: #2c2c33; border-color: #2c2c33; color: #fff; }
.cm-btn-ghost { background: transparent; border-color: transparent; color: var(--cm-ink-3); }
.cm-btn-ghost:hover { background: var(--cm-line-3); border-color: transparent; }
.cm-btn-sm { height: 29px; padding: 0 10px; font-size: 12.5px; }
.cm-btn:disabled { opacity: .45; pointer-events: none; }

.cm-card {
    background: var(--cm-card);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-r);
    box-shadow: var(--cm-shadow-1);
}
.cm-card + .cm-card { margin-top: 14px; }
.cm-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 18px; border-bottom: 1px solid var(--cm-line-2);
}
.cm-card-head h3 { font-size: 14.5px; font-weight: 600; }
.cm-card-head p { font-size: 12.5px; color: var(--cm-ink-4); margin-top: 2px; }
.cm-card-body { padding: 18px; }
.cm-card-body.is-flush { padding: 0; }

.cm-grid { display: grid; gap: 14px; }
.cm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cm-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cm-grid-main { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 14px; align-items: start; }

/* 统计块：无底色、只用 1px 分隔，避免大色块 */
.cm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--cm-line); border-radius: var(--cm-r); background: var(--cm-card); overflow: hidden; box-shadow: var(--cm-shadow-1); }
.cm-stat { padding: 18px 20px; min-width: 0; }
.cm-stat + .cm-stat { border-left: 1px solid var(--cm-line-2); }
.cm-stat-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--cm-ink-3); }
.cm-stat-label .cm-ico { width: 14px; height: 14px; color: var(--cm-ink-5); }
.cm-stat-value { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.cm-stat-value strong { font-size: 29px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.cm-stat-value strong.is-warn { color: var(--cm-amber); }
.cm-stat-value span { font-size: 12.5px; color: var(--cm-ink-4); }
.cm-stat-foot { font-size: 12px; color: var(--cm-ink-4); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.cm-stat.is-alert .cm-stat-value strong { color: var(--cm-rose); }
.cm-stat.is-warn .cm-stat-value strong { color: var(--cm-amber); }
.cm-stat-link { display: block; padding: 18px 20px; min-width: 0; transition: background .15s; color: inherit; }
.cm-stat-link:hover { background: var(--cm-sink); }

/* 徽标 / 状态 */
.cm-tag {
    display: inline-flex; align-items: center; gap: 4px;
    height: 21px; padding: 0 7px;
    border-radius: 5px; border: 1px solid var(--cm-line);
    background: var(--cm-sink); color: var(--cm-ink-3);
    font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.cm-tag-green { background: var(--cm-green-soft); border-color: var(--cm-green-line); color: var(--cm-green); }
.cm-tag-amber { background: var(--cm-amber-soft); border-color: var(--cm-amber-line); color: var(--cm-amber); }
.cm-tag-rose { background: var(--cm-rose-soft); border-color: var(--cm-rose-line); color: var(--cm-rose); }
.cm-tag-accent { background: var(--cm-accent-soft); border-color: var(--cm-accent-line); color: var(--cm-accent); }
.cm-tag-violet { background: var(--cm-violet-soft); border-color: #ddd5eb; color: var(--cm-violet); }
.cm-tag-cyan { background: var(--cm-cyan-soft); border-color: #cfe4e8; color: var(--cm-cyan); }
.cm-tag-muted { background: var(--cm-line-3); border-color: var(--cm-line-2); color: var(--cm-ink-4); }

.cm-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }

/* 表格：行高与留白优先 */
.cm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cm-table { width: 100%; font-size: 13.5px; line-height: 1.5; }
.cm-table th {
    text-align: left; font-weight: 600; font-size: 12.5px;
    color: var(--cm-ink-3); background: var(--cm-sink);
    padding: 10px 14px; border-bottom: 1px solid var(--cm-line);
    white-space: nowrap;
}
.cm-table td { padding: 12px 14px; border-bottom: 1px solid var(--cm-line-3); vertical-align: middle; }
.cm-table tbody tr:last-child td { border-bottom: 0; }
.cm-table tbody tr { transition: background .12s; }
.cm-table tbody tr:hover { background: #fcfcfb; }
.cm-table .is-strong { font-weight: 500; color: var(--cm-ink); }
.cm-table .is-code { font-family: var(--cm-mono); font-size: 12.5px; color: var(--cm-ink-3); }
.cm-table .is-sub { display: block; font-size: 12px; color: var(--cm-ink-4); margin-top: 2px; line-height: 1.45; }
.cm-clip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-table .is-right { text-align: right; }
.cm-table .is-nowrap { white-space: nowrap; }
.cm-cell-title { font-weight: 500; color: var(--cm-ink); }
.cm-cell-title:hover { text-decoration: underline; text-underline-offset: 2px; }

/* 列表行（非表格，适合移动端） */
.cm-rows { display: flex; flex-direction: column; }
.cm-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px; border-bottom: 1px solid var(--cm-line-3);
    transition: background .12s;
}
.cm-row:last-child { border-bottom: 0; }
.cm-row:hover { background: #fcfcfb; }
.cm-row-main { flex: 1; min-width: 0; }
.cm-row-title { font-size: 13.8px; font-weight: 500; line-height: 1.45; }
.cm-row-sub { font-size: 12.5px; color: var(--cm-ink-4); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 10px; }
.cm-row-side { flex: none; display: flex; align-items: center; gap: 8px; }

/* 过滤条 */
.cm-filters {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 12px 16px; border-bottom: 1px solid var(--cm-line-2); background: var(--cm-card);
}
.cm-input, .cm-select {
    height: 32px; padding: 0 10px;
    border: 1px solid var(--cm-line); border-radius: var(--cm-r-sm);
    background: #fff; outline: none; font-size: 13.5px;
    min-width: 0;
}
.cm-input:focus, .cm-select:focus { border-color: #c3cbd4; box-shadow: 0 0 0 3px rgba(44, 74, 99, .07); }
.cm-input::placeholder { color: var(--cm-ink-5); }
.cm-search-lg { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px; border: 1px solid var(--cm-line); border-radius: var(--cm-r-sm); background: #fff; color: var(--cm-ink-4); min-width: 210px; }
.cm-search-lg input { border: 0; outline: none; background: none; width: 100%; font-size: 13.5px; }
.cm-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cm-chip {
    height: 28px; padding: 0 11px; border-radius: 14px;
    border: 1px solid var(--cm-line); background: #fff;
    font-size: 12.8px; color: var(--cm-ink-3);
    display: inline-flex; align-items: center; gap: 5px;
}
.cm-chip:hover { border-color: #ccd2d8; color: var(--cm-ink); }
.cm-chip.is-on { background: var(--cm-ink); border-color: var(--cm-ink); color: #fff; }
.cm-chip em { font-style: normal; font-size: 11.5px; opacity: .7; font-variant-numeric: tabular-nums; }

/* 进度条 */
.cm-bar { height: 5px; border-radius: 3px; background: var(--cm-line-2); overflow: hidden; min-width: 60px; }
.cm-bar i { display: block; height: 100%; border-radius: 3px; background: var(--cm-ink-3); }
.cm-bar i.is-green { background: var(--cm-green); }
.cm-bar i.is-amber { background: #b78a3c; }
.cm-bar i.is-rose { background: #b0564a; }

.is-late-text { color: #9c3427; }

/* 迷你柱状图 */
.cm-chart { display: flex; align-items: flex-end; gap: 10px; height: 132px; padding: 4px 2px 0; }
.cm-chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.cm-chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.cm-chart-bar { width: 12px; max-width: 34%; border-radius: 2px 2px 0 0; background: var(--cm-line); position: relative; }
.cm-chart-bar.is-done { background: var(--cm-ink); }
.cm-chart-bar span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--cm-ink-4); font-variant-numeric: tabular-nums; }
.cm-chart-label { font-size: 11.5px; color: var(--cm-ink-4); white-space: nowrap; flex: none; }

/* 分页 */
.cm-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--cm-line-2); flex-wrap: wrap; }
.cm-pager-info { font-size: 12.5px; color: var(--cm-ink-4); }
.cm-pager-links { display: flex; align-items: center; gap: 4px; }
.cm-pager-links a, .cm-pager-links span {
    min-width: 30px; height: 30px; padding: 0 9px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--cm-line); border-radius: var(--cm-r-sm);
    background: #fff; font-size: 12.8px; color: var(--cm-ink-3);
    font-variant-numeric: tabular-nums;
}
.cm-pager-links a:hover { border-color: #ccd2d8; color: var(--cm-ink); }
.cm-pager-links .is-on { background: var(--cm-ink); border-color: var(--cm-ink); color: #fff; }
.cm-pager-links .is-off { opacity: .4; pointer-events: none; }

/* 时间线 */
.cm-timeline { position: relative; padding-left: 18px; }
.cm-timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--cm-line); }
.cm-tl-item { position: relative; padding: 0 0 16px; }
.cm-tl-item:last-child { padding-bottom: 0; }
.cm-tl-item::before {
    content: ""; position: absolute; left: -18px; top: 6px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #fff; border: 1.5px solid var(--cm-ink-5);
}
.cm-tl-item.is-done::before { border-color: var(--cm-green); background: var(--cm-green); }
.cm-tl-item.is-late::before { border-color: var(--cm-rose); background: var(--cm-rose); }
.cm-tl-item.is-now::before { border-color: var(--cm-ink); background: #fff; box-shadow: 0 0 0 3px rgba(27, 27, 31, .07); }
.cm-tl-date { font-size: 11.5px; color: var(--cm-ink-4); font-variant-numeric: tabular-nums; }
.cm-tl-title { font-size: 13.5px; font-weight: 500; margin-top: 1px; }
.cm-tl-sub { font-size: 12.5px; color: var(--cm-ink-4); margin-top: 1px; }

/* 键值列表 */
.cm-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.cm-kv dt { font-size: 12px; color: var(--cm-ink-4); margin-bottom: 2px; }
.cm-kv dd { font-size: 13.8px; line-height: 1.5; word-break: break-word; }

/* 空状态 */
.cm-empty { padding: 46px 20px; text-align: center; color: var(--cm-ink-4); }
.cm-empty .cm-ico { width: 26px; height: 26px; margin: 0 auto 10px; color: var(--cm-ink-5); stroke-width: 1.4; }
.cm-empty p { font-size: 13.5px; }
.cm-empty small { display: block; font-size: 12.5px; margin-top: 4px; color: var(--cm-ink-5); }

/* 分段 tabs */
.cm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--cm-line); overflow-x: auto; }
.cm-tab {
    position: relative; padding: 10px 14px; font-size: 13.5px; color: var(--cm-ink-3);
    white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.cm-tab:hover { color: var(--cm-ink); }
.cm-tab.is-on { color: var(--cm-ink); font-weight: 600; border-bottom-color: var(--cm-ink); }
.cm-tab em { font-style: normal; margin-left: 5px; font-size: 11.5px; color: var(--cm-ink-4); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   抽屉 / 表单
   ========================================================================== */
.cm-drawer { position: fixed; inset: 0; z-index: 90; display: none; }
.cm-drawer.is-on { display: block; }
.cm-drawer-scrim { position: absolute; inset: 0; background: rgba(24, 24, 27, .34); }
.cm-drawer-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 560px; max-width: 94vw;
    background: var(--cm-card); border-left: 1px solid var(--cm-line);
    box-shadow: var(--cm-shadow-3);
    display: flex; flex-direction: column;
    animation: cm-slide .22s ease;
}
@keyframes cm-slide { from { transform: translateX(18px); opacity: .6; } to { transform: none; opacity: 1; } }
.cm-drawer-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--cm-line-2); }
.cm-drawer-head h3 { font-size: 16px; font-weight: 600; }
.cm-drawer-head p { font-size: 12.5px; color: var(--cm-ink-4); margin-top: 3px; }
.cm-drawer-close { margin-left: auto; width: 30px; height: 30px; border: 0; background: none; border-radius: 6px; color: var(--cm-ink-4); display: grid; place-items: center; }
.cm-drawer-close:hover { background: var(--cm-line-3); color: var(--cm-ink); }
.cm-drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.cm-drawer-foot { flex: none; padding: 13px 20px; border-top: 1px solid var(--cm-line-2); background: var(--cm-sink); display: flex; justify-content: flex-end; gap: 8px; }
.cm-drawer-foot:empty { display: none; }

.cm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.cm-field { min-width: 0; }
.cm-field.is-full { grid-column: 1 / -1; }
.cm-field label { display: block; font-size: 12.5px; color: var(--cm-ink-3); margin-bottom: 5px; }
.cm-field label em { font-style: normal; color: var(--cm-rose); margin-left: 2px; }
.cm-field input, .cm-field select, .cm-field textarea {
    width: 100%; height: 36px; padding: 0 11px;
    border: 1px solid var(--cm-line); border-radius: var(--cm-r-sm);
    background: #fff; outline: none; font-size: 13.8px;
    transition: border-color .15s, box-shadow .15s;
}
.cm-field textarea { height: auto; min-height: 78px; padding: 9px 11px; line-height: 1.6; resize: vertical; }
.cm-field input:focus, .cm-field select:focus, .cm-field textarea:focus {
    border-color: #bfc8d2; box-shadow: 0 0 0 3px rgba(44, 74, 99, .07);
}
.cm-field small { display: block; font-size: 11.8px; color: var(--cm-ink-5); margin-top: 4px; line-height: 1.5; }
.cm-field.is-error input, .cm-field.is-error select { border-color: var(--cm-rose-line); background: #fffbfa; }
.cm-hint { font-size: 12.5px; color: var(--cm-ink-4); margin-top: -4px; }

/* 单选组 */
.cm-seg { display: inline-flex; border: 1px solid var(--cm-line); border-radius: var(--cm-r-sm); overflow: hidden; }
.cm-seg button { height: 32px; padding: 0 13px; border: 0; background: #fff; font-size: 13px; color: var(--cm-ink-3); }
.cm-seg button + button { border-left: 1px solid var(--cm-line); }
.cm-seg button.is-on { background: var(--cm-ink); color: #fff; }

/* 提示 */
.cm-toast {
    position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 12px);
    background: var(--cm-ink); color: #fff; font-size: 13.5px;
    padding: 10px 18px; border-radius: 22px; z-index: 120;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
    box-shadow: var(--cm-shadow-2);
}
.cm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.cm-toast.is-error { background: #8b2f23; }

/* ==========================================================================
   首页专用
   ========================================================================== */
.cm-hero {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
    padding: 22px 0 20px; flex-wrap: wrap;
}
.cm-hero h2 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.cm-hero p { font-size: 13.8px; color: var(--cm-ink-3); margin-top: 6px; max-width: 760px; }
.cm-hero-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--cm-ink-4); }

.cm-todo { display: flex; flex-direction: column; }
.cm-todo-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; border-bottom: 1px solid var(--cm-line-3);
    transition: background .12s;
}
.cm-todo-item:last-child { border-bottom: 0; }
.cm-todo-item:hover { background: #fcfcfb; }
.cm-todo-ico {
    width: 30px; height: 30px; border-radius: 8px; flex: none;
    display: grid; place-items: center;
    background: var(--cm-sink); border: 1px solid var(--cm-line-2); color: var(--cm-ink-3);
}
.cm-todo-ico .cm-ico { width: 15px; height: 15px; }
.cm-todo-body { flex: 1; min-width: 0; }
.cm-todo-title { font-size: 13.6px; font-weight: 500; }
.cm-todo-sub { font-size: 12.3px; color: var(--cm-ink-4); margin-top: 1px; }
.cm-todo-count { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }

.cm-leglist { display: flex; flex-direction: column; }
.cm-legitem { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.cm-legitem + .cm-legitem { border-top: 1px solid var(--cm-line-3); }
.cm-legswatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* 风险清单 */
.cm-risk { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--cm-line-3); }
.cm-risk:last-child { border-bottom: 0; }
.cm-risk:hover { background: #fcfcfb; }
.cm-risk-level { width: 4px; height: 34px; border-radius: 2px; background: var(--cm-line); flex: none; }
.cm-risk-level.is-overdue { background: var(--cm-rose); }
.cm-risk-level.is-urgent { background: #c07a2a; }
.cm-risk-level.is-warn { background: #c9a54a; }
.cm-risk-level.is-soon { background: #9aa6b1; }
.cm-risk-body { flex: 1; min-width: 0; }
.cm-risk-title { font-size: 13.6px; font-weight: 500; }
.cm-risk-sub { font-size: 12.4px; color: var(--cm-ink-4); margin-top: 2px; }
.cm-risk-days { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; flex: none; min-width: 74px; }
.cm-risk-days strong { font-size: 15px; font-weight: 600; }
.cm-risk-days small { display: block; font-size: 11.5px; color: var(--cm-ink-5); }

/* 详情头 */
.cm-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.cm-detail-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cm-detail-mark {
    width: 42px; height: 42px; border-radius: 10px; flex: none;
    background: var(--cm-accent-soft); color: var(--cm-accent);
    display: grid; place-items: center; border: 1px solid var(--cm-accent-line);
}
.cm-detail-id h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.cm-detail-id p { font-size: 12.8px; color: var(--cm-ink-4); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 移动端 */
.cm-scrim { position: fixed; inset: 0; background: rgba(24, 24, 27, .3); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 45; }
.cm-scrim.is-on { opacity: 1; pointer-events: auto; }
.cm-burger { display: none; width: 34px; height: 34px; border: 1px solid var(--cm-line); border-radius: var(--cm-r-sm); background: #fff; align-items: center; justify-content: center; color: var(--cm-ink-2); }
.cm-bottomnav { display: none; }

@media (max-width: 1180px) {
    .cm-grid-main { grid-template-columns: minmax(0, 1fr); }
    .cm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-stat:nth-child(3) { border-left: 0; }
    .cm-stat:nth-child(n+3) { border-top: 1px solid var(--cm-line-2); }
    .cm-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .cm-side { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--cm-shadow-3); }
    .cm-side.is-on { transform: none; }
    .cm-main { margin-left: 0; }
    .cm-top { padding: 0 14px; gap: 10px; }
    .cm-burger { display: inline-flex; }
    .cm-top-title p { display: none; }
    .cm-top .cm-search { display: none; }
    .cm-page { padding: 12px 14px 78px; }
    .cm-hero { padding: 12px 0 16px; }
    .cm-hero h2 { font-size: 20px; }
    .cm-grid-2, .cm-grid-3, .cm-grid-4 { grid-template-columns: minmax(0, 1fr); }
    .cm-kv { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .cm-form { grid-template-columns: minmax(0, 1fr); }
    .cm-drawer-panel { width: 100%; max-width: 100%; }
    .cm-head { margin-bottom: 14px; }
    .cm-head h2 { font-size: 19px; }
    .cm-table { font-size: 13px; }
    .cm-table th, .cm-table td { padding: 10px 12px; }
    .cm-table th:first-child, .cm-table td:first-child {
        position: sticky; left: 0; z-index: 1; background: var(--cm-card);
        box-shadow: 1px 0 0 var(--cm-line-2);
    }
    .cm-table th:first-child { background: var(--cm-sink); }
    .cm-row { padding: 12px 14px; }
}

@media (max-width: 640px) {
    .cm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-stat { padding: 14px 15px; }
    .cm-stat-value strong { font-size: 24px; }
    .cm-chart { height: 108px; gap: 6px; }
}

/* 窄屏表格：低优先级列隐藏 + 右侧渐隐提示，避免「半截字」 */
.cm-scroll-hint {
    display: none; align-items: center; gap: 6px;
    padding: 8px 14px 0; font-size: 12px; color: var(--cm-ink-4);
}
.cm-scroll-hint svg { width: 13px; height: 13px; }

@media (max-width: 900px) {
    .cm-scroll-hint { display: flex; }
    .cm-table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
    .cm-hide-sm { display: none; }
}

@media (max-width: 720px) {
    .cm-hide-xs { display: none; }
}

@media print {
    .cm-side, .cm-top, .cm-bottomnav, .cm-drawer { display: none !important; }
    .cm-main { margin: 0; }
    .cm-card { box-shadow: none; }
}
