:root {
  --navy: #17324d;
  --navy-2: #1f4463;
  --blue: #2d72a8;
  --blue-soft: #e8f2f9;
  --green: #3d9b78;
  --green-soft: #e6f4ee;
  --amber: #c8871f;
  --amber-soft: #fdf3e0;
  --red: #c45650;
  --red-soft: #fbeceb;
  --purple: #7a63a8;
  --purple-soft: #f0ecf8;
  --ink: #22303c;
  --muted: #7a8a95;
  --line: #e3e9ee;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --radius: 9px;
  --shadow: 0 1px 2px rgba(23, 50, 77, .05), 0 6px 20px rgba(23, 50, 77, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 13px; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
table { border-collapse: collapse; }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { position: relative; padding: 56px 60px; color: #e8f1f7; background: linear-gradient(150deg, #16304a 0%, #1d4a6b 52%, #256584 100%); display: flex; flex-direction: column; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(126,197,229,.22), transparent 68%); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-logo { width: 38px; height: 38px; border-radius: 10px; background: #2e719d; display: grid; place-items: center; color: #fff; font-size: 19px; font-weight: 800; }
.auth-brand b { font-size: 17px; letter-spacing: .4px; color: #fff; }
.auth-brand small { display: block; color: #9db9cc; font-size: 11px; margin-top: 3px; }
.auth-hero-main { margin-top: auto; margin-bottom: auto; max-width: 430px; }
.auth-hero-main h1 { font-size: 31px; line-height: 1.35; color: #fff; letter-spacing: .5px; }
.auth-hero-main p { margin: 18px 0 0; color: #b7cddc; font-size: 13px; line-height: 1.85; }
.auth-points { display: grid; gap: 12px; margin-top: 34px; }
.auth-point { display: flex; align-items: center; gap: 10px; color: #cfe0eb; font-size: 12px; }
.auth-point i { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.13); display: grid; place-items: center; font-style: normal; font-size: 11px; color: #9fd8bd; }
.auth-hero-foot { color: #7f9db1; font-size: 11px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.auth-card { width: min(360px, 100%); }
.auth-card h2 { font-size: 23px; color: var(--navy); }
.auth-card p.sub { color: var(--muted); font-size: 12px; margin: 7px 0 26px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { color: #5b6b77; font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #dbe3e9; border-radius: 7px; background: #fff; color: var(--ink); outline: 0; transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8db6cd; box-shadow: 0 0 0 3px rgba(45,114,168,.1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 15px; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #25628f; }
.btn.primary:disabled { background: #a9c4d5; cursor: not-allowed; }
.btn.ghost { background: #fff; border: 1px solid #dbe3e9; color: #4f6070; }
.btn.ghost:hover { border-color: #b9c9d4; background: #f8fafb; }
.btn.danger { background: #fff; border: 1px solid #eec8c6; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.block { width: 100%; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 11px; border-radius: 6px; }
.auth-error { display: none; margin-bottom: 14px; padding: 10px 12px; border-radius: 7px; background: var(--red-soft); color: #a3443f; font-size: 12px; }
.auth-error.show { display: block; }
.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap input { padding-right: 52px; }
.pwd-eye { position: absolute; right: 4px; height: 30px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: #6d7d89; font-size: 11px; font-weight: 600; cursor: pointer; }
.pwd-eye:hover { background: #f1f5f8; color: #2d5f82; }
.auth-tip { margin-top: 22px; padding: 12px 14px; border-radius: 8px; background: #f5f8fa; border: 1px solid #e8eef2; color: #6d7d89; font-size: 11px; line-height: 1.75; }
.auth-tip b { color: var(--navy); }

/* ---------- 布局 ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; background: var(--navy); color: #d7e3ec; display: flex; flex-direction: column; padding: 20px 13px 14px; z-index: 20; overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 0 9px 20px; }
.sb-logo { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #2e719d; color: #fff; font-weight: 800; font-size: 17px; }
.sb-brand b { display: block; color: #fff; font-size: 14px; letter-spacing: .4px; }
.sb-brand small { display: block; color: #8fa9bb; font-size: 10px; margin-top: 3px; }
.sb-group { padding: 14px 12px 6px; color: #6d8ba1; font-size: 10px; letter-spacing: .12em; }
.nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 39px; padding: 0 11px; border-radius: 7px; color: #adc2d1; font-size: 13px; text-align: left; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { background: #1f4460; color: #fff; }
.nav-item.active { background: #244f6f; color: #fff; box-shadow: inset 3px 0 0 #66b0d7; }
.nav-item .badge { margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 9px; background: rgba(255,255,255,.12); color: #cfe2ee; }
.sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.sb-user { display: flex; align-items: center; gap: 9px; padding: 8px 6px; width: 100%; border-radius: 7px; text-align: left; }
.sb-user:hover { background: #1f4460; }
.sb-ico { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: #8fa9bb; flex: 0 0 auto; }
.sb-ico:hover { background: rgba(255,255,255,.1); color: #fff; }
.sb-ico svg { width: 15px; height: 15px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #d8e8ef; color: #24546d; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.sb-user b { display: block; color: #fff; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user small { display: block; color: #8fa9bb; font-size: 10px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; margin-left: 232px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 12; height: 62px; display: flex; align-items: center; gap: 16px; padding: 0 28px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.crumb b { color: var(--ink); font-weight: 600; }
.top-search-wrap { position: relative; margin-left: auto; width: min(340px, 34vw); }
.top-search { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 12px; border: 1px solid #e8eef2; background: #f7f9fb; border-radius: 8px; color: #93a2ad; }
.top-search:focus-within { border-color: #9ec4da; background: #fff; box-shadow: 0 0 0 3px rgba(45,114,168,.09); }
.top-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; color: var(--ink); min-width: 0; }
.search-pop { position: absolute; top: 44px; left: 0; right: 0; z-index: 60; max-height: min(60vh, 480px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 44px rgba(10,30,45,.18); padding: 6px; }
.sp-empty { padding: 20px 12px; text-align: center; color: var(--muted); font-size: 11.5px; }
.sp-group + .sp-group { border-top: 1px solid #f0f3f5; margin-top: 4px; padding-top: 4px; }
.sp-type { display: flex; align-items: center; justify-content: space-between; padding: 7px 9px 4px; color: #8a99a4; font-size: 10px; letter-spacing: .06em; }
.sp-type span { color: #a7b4bd; }
.sp-item { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: 6px; }
.sp-item:hover { background: #f3f8fb; }
.sp-item b { display: block; font-size: 12px; color: var(--ink); }
.sp-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.notif-wrap { position: relative; }
.notif-btn { position: relative; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: #6d7d89; border: 1px solid #e8eef2; background: #f7f9fb; }
.notif-btn:hover { background: #eef4f8; color: var(--navy); }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 9px; font-style: normal; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.notif-panel { position: absolute; top: 44px; right: -8px; z-index: 60; width: min(370px, calc(100vw - 30px)); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 44px rgba(10,30,45,.18); overflow: hidden; }
.notif-panel .np-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.notif-panel .np-head b { font-size: 13px; color: var(--navy); }
.notif-panel .np-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.np-list { max-height: min(60vh, 420px); overflow: auto; }
.np-item { display: flex; align-items: flex-start; gap: 9px; padding: 12px 15px; border-bottom: 1px solid #f2f5f7; cursor: pointer; }
.np-item:last-child { border-bottom: 0; }
.np-item:hover { background: #f8fbfd; }
.np-item.read { opacity: .68; }
.np-item .grow { flex: 1; min-width: 0; }
.np-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: var(--blue); }
.np-dot.red { background: var(--red); }
.np-dot.amber { background: var(--amber); }
.np-dot.purple { background: var(--purple); }
.np-dot.blue { background: var(--blue); }
.np-title { display: flex; align-items: center; gap: 7px; }
.np-title b { font-size: 12px; color: var(--ink); }
.np-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.np-item em { display: block; margin-top: 5px; color: #a3b0b9; font-size: 9.5px; font-style: normal; }

.ops-table { min-width: 0; table-layout: fixed; }
.ops-table th, .ops-table td { padding: 10px 10px; }
.ops-table td.mono { word-break: break-all; font-size: 10px; line-height: 1.5; }
.ops-table th:nth-child(1), .ops-table td:nth-child(1) { width: 74px; }
.ops-table th:nth-child(3), .ops-table td:nth-child(3) { width: 58px; }
.ops-table th:nth-child(4), .ops-table td:nth-child(4) { width: 76px; }

.checklist { display: grid; }
.checklist-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f3f5; }
.checklist-row:last-child { border-bottom: 0; }
.checklist-row .grow { flex: 1; min-width: 0; }
.checklist-row b { display: block; font-size: 12px; color: var(--ink); }
.checklist-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.cl-no { width: 22px; height: 22px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; flex: 0 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 12px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.pill.green { background: var(--green-soft); color: #2f7d5f; }
.pill.blue { background: var(--blue-soft); color: #23638f; }
.pill.amber { background: var(--amber-soft); color: #a06f16; }
.pill.red { background: var(--red-soft); color: #a3443f; }
.pill.purple { background: var(--purple-soft); color: #62518c; }
.pill.gray { background: #f0f3f5; color: #74838e; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.content { max-width: 1440px; margin: 0 auto; padding: 26px 28px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.page-head h1 { font-size: 24px; color: var(--navy); margin-top: 7px; letter-spacing: .3px; }
.page-head p { color: var(--muted); font-size: 12px; margin: 8px 0 0; line-height: 1.65; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片与表格 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14px; color: var(--navy); }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 16px 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 15px 17px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 11px; }
.stat strong { display: block; margin: 9px 0 6px; font-size: 25px; color: var(--navy); letter-spacing: .5px; }
.stat small { color: #93a2ad; font-size: 10px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; }
.input-sm { height: 32px; padding: 0 10px; border: 1px solid #e0e7ec; border-radius: 6px; background: #fff; outline: 0; font-size: 12px; color: var(--ink); min-width: 130px; }
.input-sm:focus { border-color: #8db6cd; box-shadow: 0 0 0 3px rgba(45,114,168,.1); }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; min-width: 820px; }
table.tbl th { padding: 10px 14px; text-align: left; background: #f8fafb; color: #71818c; font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid #f0f3f5; font-size: 12px; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { cursor: pointer; }
table.tbl tbody tr:hover { background: #f9fbfc; }
table.tbl td b { color: var(--ink); font-weight: 600; }
table.tbl td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.empty b { display: block; color: #5b6b77; margin-bottom: 6px; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f3f5; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { display: block; font-size: 12px; color: var(--ink); }
.list-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

/* ---------- 抽屉 / 弹窗 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16,35,49,.42); z-index: 40; display: flex; }
.overlay.center { align-items: center; justify-content: center; padding: 18px; }
.overlay.right { justify-content: flex-end; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: #fff; border-radius: 11px; box-shadow: 0 20px 60px rgba(10,30,45,.26); }
.modal.lg { width: min(960px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.modal-head h2 { font-size: 18px; color: var(--navy); }
.modal-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.modal-body { padding: 4px 22px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.x-btn { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: #7c8b96; font-size: 18px; line-height: 1; }
.x-btn:hover { background: #f1f4f6; color: var(--navy); }
.drawer { width: min(680px, 100%); height: 100%; overflow: auto; background: #fff; box-shadow: -16px 0 50px rgba(10,30,45,.2); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 10px; }
.drawer-head h2 { font-size: 19px; color: var(--navy); }
.drawer-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.drawer-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 24px 16px; }
.section { padding: 16px 24px 0; }
.section h3 { font-size: 13px; color: var(--navy); padding-bottom: 10px; border-bottom: 1px solid #eef1f3; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.kv span { color: var(--muted); font-size: 10px; }
.kv b { display: block; margin-top: 4px; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .field { margin-bottom: 0; }
.form-grid .field input, .form-grid .field select { height: 36px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.7; }
.err { margin: 10px 0 0; padding: 9px 11px; border-radius: 6px; background: var(--red-soft); color: #a3443f; font-size: 11px; }
.note { margin-top: 12px; padding: 11px 13px; border-radius: 7px; background: #f6f9fb; border: 1px solid #eaf0f4; color: #6d7d89; font-size: 11px; line-height: 1.7; }

/* 附件 */
.file-list { display: grid; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid #e8eef2; border-radius: 7px; background: #fbfcfd; }
.file-ico { width: 28px; height: 28px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.file-item .grow { flex: 1; min-width: 0; }
.file-item b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.expiry-note { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 8px; background: var(--amber-soft); border: 1px solid #f0dfbe; }
.expiry-note b { color: #966713; font-size: 12px; }
.expiry-note small { color: #a1804a; font-size: 10.5px; }
.expiry-note.red { background: var(--red-soft); border-color: #f2d4d2; }
.expiry-note.red b { color: #a3443f; }
.expiry-note.red small { color: #a8706c; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px; background: #f1f4f6; color: #6f7f8a; font-size: 10px; }

/* 权限矩阵 */
.matrix { width: 100%; min-width: 700px; }
.matrix th, .matrix td { padding: 9px 10px; border-bottom: 1px solid #eef1f3; font-size: 11px; text-align: left; }
.matrix th { background: #f8fafb; color: #71818c; font-weight: 600; }
.matrix td.c { text-align: center; }
.chk { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1.5px solid #cfd9e0; border-radius: 4px; background: #fff; color: #fff; font-size: 10px; }
.chk.on { background: var(--blue); border-color: var(--blue); }
.chk.disabled { opacity: .45; cursor: not-allowed; }
.role-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.role-tab { padding: 7px 13px; border-radius: 20px; border: 1px solid #e0e7ec; background: #fff; color: #5d6d78; font-size: 11px; }
.role-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 12px; box-shadow: 0 12px 34px rgba(10,30,45,.3); }
.toast.err { background: #a3443f; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 11px; }
.loader { padding: 60px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; padding: 26px 20px; background: linear-gradient(170deg, #16304a 0%, #1d4a6b 42%, #fff 42%); align-items: flex-start; padding-top: 12vh; }
  .auth-card { background: #fff; padding: 24px; border-radius: 14px; box-shadow: 0 18px 50px rgba(10,30,45,.22); }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 15px; height: 56px; gap: 10px; }
  .crumb { display: none; }
  .top-search-wrap { width: auto; flex: 1; margin-left: 0; }
  .top-search { width: 100%; }
  .notif-panel { right: -8px; }
  .topbar .pill.blue { display: none; }
  .content { padding: 18px 15px 44px; }
  .page-head { display: block; }
  .page-head h1 { font-size: 21px; }
  .head-actions { margin-top: 14px; }
  .head-actions .btn { flex: 1; }
  .stats { gap: 9px; }
  .stat { padding: 12px 13px; }
  .stat strong { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .kv { grid-template-columns: 1fr; }
  .modal { border-radius: 12px 12px 0 0; }
  .overlay.center { align-items: flex-end; padding: 0; }
  .toast { left: 15px; right: 15px; bottom: 18px; justify-content: center; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; height: 60px; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); z-index: 30; }
  .mobile-nav button { display: grid; place-items: center; align-content: center; gap: 2px; font-size: 10px; color: #93a2ad; }
  .mobile-nav button.active { color: var(--navy); font-weight: 600; }
  .mobile-nav svg { width: 18px; height: 18px; }
  .main { padding-bottom: 62px; }
  .content { padding-bottom: 78px; }
}
@media (min-width: 821px) { .mobile-nav { display: none; } }

/* 防止宽表格撑破移动端布局 */
.content, .card, .tbl-wrap, .grid-2 > * { min-width: 0; }
.content { overflow-x: clip; }
@media (max-width: 820px) {
  .content { padding-right: 15px; }
  .card { width: 100%; }
}

/* ============ P2 工单中心 / 保养计划 ============ */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi .kpi-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.kpi .kpi-ico.blue { background: var(--blue-soft); color: var(--blue); }
.kpi .kpi-ico.amber { background: var(--amber-soft); color: var(--amber); }
.kpi .kpi-ico.red { background: var(--red-soft); color: var(--red); }
.kpi .kpi-ico.green { background: var(--green-soft); color: var(--green); }
.kpi b { display: block; font-size: 21px; color: var(--navy); line-height: 1.2; }
.kpi span { color: var(--muted); font-size: 11px; }
.kpi small { display: block; color: #9aa8b2; font-size: 10px; margin-top: 2px; }

.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: #eef2f5; gap: 2px; }
.seg button { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 11px; color: #6b7b86; }
.seg button.active { background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 1px 2px rgba(23,50,77,.12); }

.wo-list { display: grid; gap: 10px; }
.wo-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 17px; display: grid; grid-template-columns: minmax(210px, 1.35fr) minmax(160px, 1fr) minmax(230px, 1.35fr) 150px; gap: 18px; align-items: center; cursor: pointer; transition: border-color .15s, transform .08s; }
.wo-card:hover { border-color: #b8cddb; }
.wo-card:active { transform: scale(.998); }
.wo-card .wo-title b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.wo-card .wo-title small { color: var(--muted); font-size: 10.5px; display: block; line-height: 1.5; }
.wo-card .wo-cust b { display: block; font-size: 12px; }
.wo-card .wo-cust small { color: var(--muted); font-size: 10.5px; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.wo-card .wo-node { display: grid; gap: 7px; }
.wo-card .wo-node-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wo-card .wo-node-top b { font-size: 11.5px; color: var(--blue); }
.wo-card .wo-node-top span { font-size: 10px; color: var(--muted); }
.wo-card .wo-foot { display: grid; gap: 6px; justify-items: end; text-align: right; }
.wo-card .wo-foot small { color: var(--muted); font-size: 10px; }
.wo-card .due-overdue { color: var(--red); font-weight: 600; }
.track { height: 6px; border-radius: 6px; background: #edf1f4; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4d90bd, #3d9b78); }

.node-steps { display: flex; gap: 4px; margin: 2px 0 14px; overflow-x: auto; padding-bottom: 4px; }
.node-step { flex: 1 0 auto; min-width: 28px; height: 5px; border-radius: 4px; background: #e8edf1; }
.node-step.done { background: var(--green); }
.node-step.current { background: var(--blue); box-shadow: 0 0 0 2px rgba(45,114,168,.18); }
.node-step.skipped { background: #c8b6df; }

.node-timeline { display: grid; gap: 0; }
.nt-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.nt-item:last-child { padding-bottom: 0; }
.nt-item::before { content: ""; position: absolute; left: 14px; top: 22px; bottom: -2px; width: 2px; background: #e7edf1; }
.nt-item:last-child::before { display: none; }
.nt-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 700; background: #eff3f6; color: #8494a0; z-index: 1; border: 2px solid #fff; }
.nt-item.done .nt-dot { background: var(--green-soft); color: var(--green); }
.nt-item.current .nt-dot { background: var(--blue); color: #fff; box-shadow: 0 0 0 3px var(--blue-soft); }
.nt-item.skipped .nt-dot { background: var(--purple-soft); color: var(--purple); }
.nt-body b { font-size: 12px; }
.nt-body small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 3px; line-height: 1.6; }
.nt-body .nt-data { margin-top: 5px; padding: 7px 9px; border-radius: 6px; background: #f7fafb; border: 1px solid #edf2f5; font-size: 10.5px; color: #5f707c; line-height: 1.7; }
.nt-body .nt-data b { font-size: 10.5px; color: #425765; }

.node-panel { border: 1px solid #d7e5ef; border-radius: 9px; background: linear-gradient(180deg, #f8fbfd, #fff); padding: 15px; }
.node-panel .np-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.node-panel .np-head b { font-size: 13px; color: var(--navy); }
.node-panel .np-head .pill { font-size: 10px; }
.node-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; }
.node-form label { display: grid; gap: 5px; font-size: 11px; color: #5b6b77; }
.node-form .span-2 { grid-column: span 2; }
.node-form input, .node-form select, .node-form textarea { width: 100%; border: 1px solid #dbe3e9; border-radius: 6px; padding: 7px 9px; font-size: 12px; background: #fff; }
.node-form textarea { resize: vertical; line-height: 1.6; }
.check-list { display: grid; gap: 6px; margin-bottom: 12px; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #e5ebef; border-radius: 6px; background: #fff; font-size: 11.5px; text-align: left; }
.check-row.done { border-color: #bfe1d2; background: #f3fbf7; color: #2f7d5e; }
.check-box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #c9d5dd; display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.check-row.done .check-box { background: var(--green); border-color: var(--green); }
.evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.evidence-tile { display: grid; place-items: center; gap: 5px; min-height: 66px; border: 1px dashed #cfdce4; border-radius: 7px; color: #7f929e; font-size: 10.5px; background: #fbfdfe; text-align: center; padding: 8px; }
.evidence-tile.has { border-style: solid; border-color: #dce8ef; background: #fff; color: #4c6575; }
.evidence-tile.has b { display: block; font-size: 10.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-tile.add { cursor: pointer; }
.evidence-tile.add:hover { border-color: var(--blue); color: var(--blue); }

/* 保养月历 */
.calendar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: #f6f9fb; border-bottom: 1px solid var(--line); }
.cal-head span { padding: 10px 8px; text-align: center; font-size: 11px; color: #71818c; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 98px; border-right: 1px solid #eef2f5; border-bottom: 1px solid #eef2f5; padding: 7px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.dim { background: #fbfcfd; }
.cal-cell.today { background: #f2f8fc; }
.cal-date { font-size: 11px; color: #8494a0; margin-bottom: 5px; }
.cal-cell.today .cal-date { color: var(--blue); font-weight: 700; }
.cal-plan { display: block; width: 100%; text-align: left; margin-bottom: 3px; padding: 3px 6px; border-radius: 4px; background: var(--blue-soft); color: #26618a; font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-plan.done { background: var(--green-soft); color: #2f7d5e; }
.cal-plan.warn { background: var(--amber-soft); color: #966713; }
.cal-more { font-size: 9px; color: var(--muted); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wo-card { grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .wo-card .wo-foot { justify-items: start; text-align: left; }
}
@media (max-width: 820px) {
  .kpis { gap: 8px; }
  .kpi { padding: 11px 12px; gap: 9px; }
  .kpi b { font-size: 18px; }
  .wo-card { grid-template-columns: 1fr; gap: 10px; padding: 13px 14px; }
  .wo-card .wo-foot { grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .node-form { grid-template-columns: 1fr; }
  .node-form .span-2 { grid-column: span 1; }
  .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-cell { min-height: 62px; padding: 4px; }
  .cal-plan { font-size: 8.5px; padding: 2px 3px; }
  .cal-head span { padding: 8px 2px; font-size: 10px; }
  .cal-date { font-size: 10px; }
}

.mobile-menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mobile-menu-grid button { display: grid; place-items: center; gap: 6px; padding: 14px 8px; border: 1px solid #e3e9ee; border-radius: 9px; background: #fff; font-size: 11px; color: #4f6070; }
.mobile-menu-grid button.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }

.contract-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contract-item { padding: 11px 12px; border: 1px solid #e6edf2; border-radius: 8px; background: #fbfdfe; display: grid; gap: 4px; }
.contract-item b { font-size: 11.5px; color: var(--navy); }
.contract-item small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.contract-item code { font-family: "SF Mono", Menlo, monospace; font-size: 10px; color: var(--blue); background: var(--blue-soft); padding: 3px 6px; border-radius: 4px; justify-self: start; }
@media (max-width: 1100px) { .contract-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .contract-grid { grid-template-columns: 1fr; } }

.bar-list, .node-bars { display: grid; gap: 10px; }
.bar-row, .node-bar { display: grid; grid-template-columns: 92px 1fr 34px; gap: 10px; align-items: center; font-size: 11.5px; }
.node-bar { grid-template-columns: 36px 1fr 30px; }
.bar-row span, .node-bar span { color: #5d6d78; }
.bar { height: 8px; border-radius: 5px; background: #eef2f5; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #4d90bd, #2d72a8); }
.bar.amber i { background: linear-gradient(90deg, #e0a83f, #c8871f); }
.bar-row b, .node-bar b { text-align: right; color: var(--navy); font-size: 11.5px; }
