:root {
  --ink: #0c1a2b;
  --ink-2: #34445a;
  --muted: #6b7b8f;
  --faint: #9aa8b8;
  --line: #e4eaf1;
  --line-2: #eef2f7;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --brand: #1552d8;
  --brand-ink: #0e3fa8;
  --brand-soft: #eaf0ff;
  --accent: #0b9e93;
  --accent-soft: #e6f7f5;
  --ok: #0e8f62;
  --ok-soft: #e6f6ef;
  --warn: #b46a05;
  --warn-soft: #fdf3e3;
  --danger: #c62a2a;
  --danger-soft: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(150deg, #1f63ff, #0b3eb0);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 10px -3px rgba(21, 82, 216, .5);
}
.brand-name { font-size: 14px; font-weight: 650; line-height: 1.25; }
.brand-tag { font-size: 11px; color: var(--faint); letter-spacing: .02em; }

.role-switch {
  margin: 0 12px 14px; padding: 3px; background: var(--line-2); border-radius: 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.role-switch button {
  border: 0; background: transparent; color: var(--muted); padding: 7px 4px; border-radius: 8px;
  font-size: 12.5px; font-weight: 550; transition: .18s;
}
.role-switch button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(16,24,40,.1); }

.nav { padding: 4px 10px; overflow-y: auto; flex: 1; }
.nav-label {
  font-size: 10.5px; letter-spacing: .1em; color: var(--faint); font-weight: 650;
  padding: 14px 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; margin-bottom: 1px; transition: .15s;
}
.nav-item:hover { background: #f4f7fb; color: var(--ink); }
.nav-item.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav-item .ico { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav-item.on .ico { opacity: 1; }
.nav-count {
  margin-left: auto; font-size: 11px; min-width: 19px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 6px; background: #f0f3f8; color: var(--muted); font-weight: 600;
}
.nav-item.on .nav-count { background: #fff; color: var(--brand); }
.nav-count.alert { background: var(--danger-soft); color: var(--danger); }

.side-foot { border-top: 1px solid var(--line); padding: 12px; }
.who { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 10px; }
.who:hover { background: #f6f8fb; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #dbe6ff; color: #1a4bc4; font-weight: 650; font-size: 12px; flex: none;
}
.avatar.g { background: var(--accent-soft); color: #07756c; }
.who-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.who-role { font-size: 11px; color: var(--faint); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(180%) blur(8px);
  background: rgba(244, 247, 251, .86); border-bottom: 1px solid var(--line);
  padding: 12px 28px; display: flex; align-items: center; gap: 14px;
}
.crumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; padding: 6px 10px; width: 230px; color: var(--faint);
}
.search input { border: 0; outline: 0; width: 100%; font-size: 13px; color: var(--ink); background: transparent; }
.search input::placeholder { color: var(--faint); }
.icon-btn {
  width: 33px; height: 33px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; color: var(--ink-2); position: relative;
}
.icon-btn:hover { border-color: #cfdae8; }
.dot-alert { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }

.view { padding: 24px 28px 56px; max-width: 1420px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 21px; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .spacer { flex: 1; }

/* ---------- primitives ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); padding: 7px 13px; border-radius: 9px;
  font-size: 13px; font-weight: 550; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #c9d6e6; background: #fbfcfe; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px -2px rgba(21,82,216,.45); }
.btn.primary:hover { background: #1046c0; border-color: #1046c0; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card.pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 15px 20px 0; }
.card-h h3 { font-size: 14px; }
.card-h .spacer { flex: 1; }
.card-b { padding: 14px 20px 18px; }
.link { color: var(--brand); font-size: 12.5px; font-weight: 550; cursor: pointer; }
.link:hover { text-decoration: underline; }

.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2, .g3 { grid-template-columns: minmax(0, 1fr); }
}

/* KPI */
.kpi { padding: 16px 18px 14px; position: relative; overflow: hidden; }
.kpi-label { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi-val { font-size: 28px; font-weight: 680; letter-spacing: -.03em; line-height: 1.25; margin-top: 6px; }
.kpi-val small { font-size: 13px; font-weight: 550; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.trend-up { color: var(--ok); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }
.kpi-spark { position: absolute; right: 12px; bottom: 10px; opacity: .9; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap;
  background: #f1f4f9; color: var(--muted);
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--brand-soft); color: var(--brand-ink); }
.badge.teal { background: var(--accent-soft); color: #07756c; }
.badge.gray { background: #f1f4f9; color: #6b7b8f; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfcfe; white-space: nowrap;
}
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .13s; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.t-right { text-align: right; }
.t-nowrap { white-space: nowrap; }

/* tabs & filters */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  border: 0; background: transparent; padding: 8px 13px 11px; font-size: 13px; color: var(--muted);
  font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab .c { font-size: 11px; color: var(--faint); margin-left: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.select, .input {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 10px;
  font-size: 13px; color: var(--ink); outline: none; font-family: inherit;
}
.select:focus, .input:focus { border-color: #a9c0e8; box-shadow: 0 0 0 3px rgba(21,82,216,.08); }

/* progress */
.bar { height: 6px; border-radius: 4px; background: #eef2f7; overflow: hidden; width: 100%; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: #e0912a; }
.bar.danger > i { background: var(--danger); }

/* meta rows */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; }
.meta .k { font-size: 11.5px; color: var(--faint); margin-bottom: 2px; }
.meta .v { font-size: 13.5px; font-weight: 550; color: var(--ink); }

.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

/* list rows */
.row-item {
  display: flex; gap: 12px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line-2);
  transition: background .13s;
}
.row-item:first-child { border-top: 0; }
.row-item:hover { background: #fafcff; }
.row-item.clickable { cursor: pointer; }
.row-ico {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: #f2f5fa; color: var(--ink-2); font-size: 13px; font-weight: 650;
}
.row-ico.danger { background: var(--danger-soft); color: var(--danger); }
.row-ico.warn { background: var(--warn-soft); color: var(--warn); }
.row-ico.ok { background: var(--ok-soft); color: var(--ok); }
.row-ico.info { background: var(--brand-soft); color: var(--brand); }
.row-t { font-size: 13px; font-weight: 600; }
.row-s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.row-end { margin-left: auto; text-align: right; display: flex; align-items: center; gap: 10px; }

/* timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 10px; width: 1.5px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before {
  content: ''; position: absolute; left: -21px; top: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid #c6d2e2;
}
.tl-item.act::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tl-time { font-size: 11.5px; color: var(--faint); }
.tl-title { font-size: 13px; font-weight: 600; margin-top: 1px; }
.tl-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* device card */
.dev-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: .18s; }
.dev-card:hover { border-color: #c7d6ea; box-shadow: var(--shadow); transform: translateY(-1px); }
.dev-top { display: flex; gap: 10px; align-items: flex-start; }
.dev-name { font-size: 13.5px; font-weight: 650; }
.dev-loc { font-size: 11.5px; color: var(--faint); }
.dev-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dev-metric { background: #f8fafd; border-radius: 9px; padding: 7px 9px; }
.dev-metric .k { font-size: 10.5px; color: var(--faint); }
.dev-metric .v { font-size: 14px; font-weight: 650; letter-spacing: -.02em; }

/* checklist */
.chk-row { display: grid; grid-template-columns: 22px minmax(0,1fr) 86px 1fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.chk-row:last-child { border-bottom: 0; }
.chk-idx { width: 20px; height: 20px; border-radius: 6px; background: #f1f5fa; color: var(--muted); font-size: 11px; display: grid; place-items: center; font-weight: 600; }
.chk-name { font-weight: 550; }
.chk-std { font-size: 11.5px; color: var(--faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* gauge */
.gauge { position: relative; display: grid; place-items: center; }
.gauge-txt { position: absolute; text-align: center; }
.gauge-txt .v { font-size: 22px; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; }
.gauge-txt .k { font-size: 11px; color: var(--faint); }

/* empty */
.empty { text-align: center; padding: 44px 20px; color: var(--faint); font-size: 13px; }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

/* modal */
.overlay {
  position: fixed; inset: 0; background: rgba(12, 26, 43, .38); backdrop-filter: blur(2px);
  z-index: 100; display: grid; place-items: center; padding: 24px; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 16px; width: min(620px, 100%); max-height: 88vh; overflow: auto;
  box-shadow: 0 24px 60px -12px rgba(12,26,43,.35); animation: pop .2s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-h { padding: 18px 22px 14px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.modal-h h3 { font-size: 15.5px; }
.modal-b { padding: 18px 22px; }
.modal-f { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 9px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-row .input, .form-row .select, .form-row textarea { width: 100%; }
.form-row textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-family: inherit; font-size: 13px; resize: vertical; outline: none; }
.form-row textarea:focus { border-color: #a9c0e8; box-shadow: 0 0 0 3px rgba(21,82,216,.08); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(10px);
  background: #0c1a2b; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px;
  z-index: 200; opacity: 0; transition: .22s; pointer-events: none; box-shadow: 0 8px 24px rgba(12,26,43,.3);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* banner */
.banner {
  display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 12px;
  background: var(--brand-soft); border: 1px solid #d4e0ff; color: var(--brand-ink); font-size: 12.5px;
}
.banner.warn { background: var(--warn-soft); border-color: #f5e2c4; color: #8a5104; }
.banner .spacer { flex: 1; }

/* hero (client portal) */
.hero {
  border-radius: 16px; padding: 22px 24px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #0b2b6b 0%, #1449b8 52%, #0b8f88 130%);
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.16), transparent 68%);
}
.hero h2 { font-size: 19px; letter-spacing: -.01em; }
.hero p { margin: 5px 0 0; font-size: 12.5px; color: rgba(255,255,255,.72); }
.hero-stats { display: flex; gap: 26px; margin-left: auto; position: relative; z-index: 1; }
.hero-stat .v { font-size: 24px; font-weight: 680; letter-spacing: -.02em; line-height: 1.2; }
.hero-stat .k { font-size: 11.5px; color: rgba(255,255,255,.66); }

/* report print */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { border: 1px solid #ddd; box-shadow: none; break-inside: avoid; }
  .report-page { padding: 0 10mm; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; height: auto; z-index: 40; flex-direction: row; align-items: center;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 10px; gap: 10px; overflow: hidden;
  }
  .brand { padding: 6px 4px; flex: none; }
  .brand-tag { display: none; }
  .brand-mark { width: 28px; height: 28px; font-size: 13px; }
  .brand-name { font-size: 13px; }
  .role-switch { margin: 0; width: 150px; flex: none; }
  .role-switch button { font-size: 11.5px; padding: 5px 2px; }
  .nav { display: flex; gap: 2px; overflow-x: auto; padding: 0; flex: 1; }
  .nav-label, .nav-count, .side-foot { display: none; }
  .nav-item { white-space: nowrap; padding: 6px 9px; font-size: 12.5px; flex: none; }
  .nav-item .ico { display: none; }
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .search { width: 100%; order: 9; }
  .view { padding: 16px 14px 40px; }
  .g4, .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
  .card-b { overflow-x: auto; }
  .hero { padding: 18px; }
  .hero-stats { margin-left: 0; gap: 18px; flex-wrap: wrap; width: 100%; }
  .modal { max-height: 92vh; }
  .form-2 { grid-template-columns: 1fr; }
  .chk-row { grid-template-columns: 20px minmax(0,1fr) 64px; }
  .chk-row > div:last-child { display: none; }
}

.icon-btn svg, .banner svg, .btn svg { width: 14px; height: 14px; flex: none; }
.btn.sm svg { width: 12px; height: 12px; }
.search svg { width: 13px; height: 13px; flex: none; }
.back { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 12px; white-space: nowrap; }
.nav-item svg { width: 16px; height: 16px; }

.devgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 960px) { .devgrid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 微信扫码登录 ---------- */
body.auth-mode { background: #fff; }
body.auth-mode .sidebar, body.auth-mode .topbar { display: none; }
body.auth-mode .app { grid-template-columns: minmax(0, 1fr); }
body.auth-mode .view { padding: 0; max-width: none; }

.auth { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); min-height: 100vh; }
.auth-left {
  padding: 44px 56px 40px; color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: linear-gradient(155deg, #08255f 0%, #1449b8 56%, #0b8f88 135%);
}
.auth-left::after {
  content: ''; position: absolute; right: -120px; top: -140px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 66%);
}
.auth-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 60px; position: relative; z-index: 1; }
.auth-brand .brand-mark { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); box-shadow: none; }
.auth-brand .brand-name { color: #fff; font-size: 15px; }
.auth-brand .brand-tag { color: rgba(255,255,255,.58); }
.auth-left h1 { font-size: 31px; line-height: 1.38; letter-spacing: -.02em; font-weight: 680; position: relative; z-index: 1; }
.auth-sub { color: rgba(255,255,255,.72); font-size: 13.5px; margin: 15px 0 34px; max-width: 430px; line-height: 1.75; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 17px; max-width: 450px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; }
.pt-ico { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: none; }
.pt-ico svg { width: 15px; height: 15px; }
.auth-points b { display: block; font-size: 13.5px; font-weight: 600; }
.auth-points i { font-style: normal; font-size: 12px; color: rgba(255,255,255,.62); line-height: 1.7; }
.auth-foot { margin-top: auto; padding-top: 30px; font-size: 11.5px; color: rgba(255,255,255,.48); position: relative; z-index: 1; }

.auth-right { display: grid; place-items: center; padding: 40px 24px; background: #f7f9fc; }
.qr-card {
  width: 376px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px -30px rgba(12, 26, 43, .35); padding: 24px 26px 18px;
}
.qr-head { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.wx-dot { width: 7px; height: 7px; border-radius: 50%; background: #07c160; }
.qr-card h2 { font-size: 20px; margin: 9px 0 4px; }
.qr-sub { font-size: 12px; color: var(--muted); margin: 0 0 16px; line-height: 1.65; }
.qr-box {
  position: relative; width: 192px; height: 192px; margin: 0 auto; padding: 9px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
}
.qr-img { width: 100%; height: 100%; }
.qr-corner { position: absolute; width: 15px; height: 15px; border: 2.5px solid var(--brand); border-radius: 3px; }
.qr-corner.c1 { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.qr-corner.c2 { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.qr-corner.c3 { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.qr-corner.c4 { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.qr-overlay {
  position: absolute; inset: 0; border-radius: 14px; background: rgba(255,255,255,.95);
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: .2s;
}
.qr-box.scanned .qr-overlay, .qr-box.denied .qr-overlay, .qr-box.expired .qr-overlay { opacity: 1; pointer-events: auto; }
.qr-ok, .qr-fail { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; font-size: 12.5px; font-weight: 650; }
.qr-ok i, .qr-fail i { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.qr-ok svg { width: 30px; height: 30px; color: #07c160; padding: 5px; border: 2px solid #07c160; border-radius: 50%; }
.qr-fail svg { width: 26px; height: 26px; color: var(--danger); }
.qr-tip { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; color: var(--ink-2); margin-top: 12px; }
.qr-tip svg { width: 14px; height: 14px; color: #07c160; }
.qr-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; padding: 0 2px; }
.qr-meta a { color: var(--brand); cursor: pointer; }
.qr-demo { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.demo-label { font-size: 10.5px; color: var(--faint); margin-bottom: 7px; letter-spacing: .01em; }
.acc-list { display: flex; flex-direction: column; gap: 5px; max-height: 208px; overflow: auto; padding-right: 2px; }
.acc-chip {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 9px; transition: .15s;
}
.acc-chip:hover { border-color: #b9cdf0; background: #fafcff; }
.acc-chip .avatar { width: 27px; height: 27px; font-size: 11px; }
.acc-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.acc-txt b { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.acc-txt i { font-style: normal; font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-chip .badge { margin-left: auto; font-size: 10.5px; padding: 1px 6px; }
.acc-chip.off { opacity: .58; }
.off-tag { font-style: normal; font-size: 9.5px; font-weight: 500; color: var(--danger); border: 1px solid #f2caca; border-radius: 4px; padding: 0 3px; }
.acc-chip.denied { margin-top: 6px; border-style: dashed; color: var(--muted); }

/* ---------- 服务后台：员工登录表单 ---------- */
.login-card { padding-bottom: 20px; }
.lock-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
}
.lock-dot svg { width: 11px; height: 11px; }
#staffForm { margin-top: 2px; }
.lf { display: block; margin-bottom: 12px; }
.lf-label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 550; }
.lf-wrap { position: relative; display: block; }
.lf-wrap input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; font: inherit; font-size: 13.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s; outline: none;
}
.lf-wrap input::placeholder { color: var(--faint); }
.lf-wrap input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(21, 82, 216, .12); }
.lf-wrap input:disabled { opacity: .55; cursor: not-allowed; }
#staffPwd { padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; background: transparent; color: var(--faint);
  display: grid; place-items: center; border-radius: 7px; transition: .15s;
}
.pwd-eye:hover { color: var(--ink-2); background: var(--line-2); }
.pwd-eye.on { color: var(--brand); }
.pwd-eye svg { width: 14px; height: 14px; }
.lf-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 12px; font-size: 11.5px; }
.lf-check { display: flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; }
.lf-check input { width: 13px; height: 13px; accent-color: var(--brand); margin: 0; cursor: pointer; }
.lf-row a { color: var(--brand); cursor: pointer; }
.lf-err {
  display: none; margin: 0 0 10px; padding: 7px 10px; font-size: 11.5px; line-height: 1.6;
  color: var(--danger); background: var(--danger-soft); border-radius: 8px;
}
.lf-err.show { display: block; }
.lf-err b { font-variant-numeric: tabular-nums; }
.lf-submit { width: 100%; height: 40px; justify-content: center; font-size: 13.5px; font-weight: 600; }
.lf-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); text-align: center; }
.lf-foot a { color: var(--brand); }
.lf-demo { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.demo-pass { margin-top: 7px; font-size: 11px; color: var(--faint); text-align: center; }
.demo-pass b { color: var(--ink-2); font-weight: 600; letter-spacing: .02em; }
.shake { animation: shake .4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.acc-chip.denied > svg { width: 16px; height: 16px; margin-left: 5px; flex: none; }
.qr-terms { margin-top: 12px; font-size: 10px; color: var(--faint); text-align: center; }

/* ---------- 集团子公司筛选 ---------- */
.pillbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.pill { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 5px 13px; font-size: 12.5px; font-weight: 550; transition: .15s; }
.pill:hover { border-color: #c3d3ec; }
.pill.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px -2px rgba(21, 82, 216, .42); }
.pill-note { margin-left: auto; font-size: 11.5px; color: var(--faint); }

@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-left { display: none; }
  .auth-right { padding: 22px 14px; align-items: start; }
  .qr-card { padding: 20px 18px 16px; }
  .pill-note { display: none; }
}

.nav-btn { width: 100%; border: 0; background: transparent; text-align: left; font-family: inherit; font-size: 13.5px; cursor: pointer; }
.nav-btn:hover { background: #f4f7fb; }

/* ---------- 登录页：默认仅二维码，演示模式默认隐藏 ---------- */
.qr-demo { display: none; }
.qr-demo.show { display: block; }
.demo-label { display: flex; align-items: center; justify-content: space-between; }
.demo-label span { color: var(--brand); font-weight: 600; }
.demo-label a { color: var(--muted); cursor: pointer; }
.demo-label a:hover { color: var(--ink-2); }
.qr-card .qr-terms { margin-top: 14px; }
.qr-box { cursor: default; -webkit-user-select: none; user-select: none; }

/* ---------- 云同步：工程师小程序现场记录 ---------- */
.sync-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: #fff; white-space: nowrap;
}
.sync-tag svg { width: 12px; height: 12px; }
.sync-tag.ok { color: #07756c; background: var(--accent-soft); border-color: transparent; }
.sync-tag.err { color: #a53434; background: #fdf1f1; border-color: #f4d6d6; cursor: pointer; font-family: inherit; }
.sync-tag.err:hover { background: #fbe7e7; }

.live-row { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-top: 1px dashed var(--line); cursor: pointer; }
.live-row:first-child { border-top: 0; }
.live-row:hover .live-t { color: var(--brand); }
.live-score {
  width: 34px; height: 34px; border: 1.6px solid; border-radius: 9px; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 680; flex: none; background: #fff;
}
.live-main { min-width: 0; }
.live-t { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.live-s { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.live-end { margin-left: auto; color: var(--faint); display: flex; }
.live-end svg { width: 14px; height: 14px; transform: rotate(180deg); }

.tag-mp {
  margin-left: 6px; font-size: 9.5px; font-weight: 600; color: #07756c; background: var(--accent-soft);
  border-radius: 4px; padding: 1px 5px; vertical-align: 1px; white-space: nowrap;
}

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; }
.photos .ph { display: block; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #f4f7fb; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 960px) {
  .live-s { white-space: normal; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

.live-h { flex-wrap: wrap; row-gap: 6px; }
.live-h h3 { white-space: nowrap; }
@media (max-width: 960px) {
  .live-h .sync-tag { margin-left: auto; }
}

/* ============ 员工账号管理 ============ */
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; letter-spacing: -.1px; }

.btn.danger { color: var(--danger); border-color: #f0cfd2; }
.btn.danger:hover { background: var(--danger-soft); border-color: #e6b6bb; color: #a8312f; }

.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.role-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
  background: #fbfcfe; min-width: 0;
}
.role-card .hint { font-size: 11.5px; line-height: 1.6; }

.cred-box {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fbfcfe;
}
.cred-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.cred-row:last-child { border-bottom: 0; }
.cred-row > span { color: var(--muted); width: 76px; flex: none; font-size: 12.5px; }
.cred-row > b { font-weight: 620; color: var(--ink); word-break: break-all; }

@media (max-width: 960px) {
  .role-grid { grid-template-columns: 1fr; }
  .cred-row > span { width: 64px; }
}

/* ===== 微信真扫码登录（iframe 版） ===== */
.qr-card.wx-wide { width: 400px; }
.qr-box.wx-frame { width: 300px; height: 392px; padding: 0; overflow: hidden; background: #fff; }
.wx-qr-frame { display: block; width: 300px; height: 392px; border: 0; background: #fff; }
.qr-loading { display: flex; flex-direction: column; gap: 9px; align-items: center; justify-content: center; height: 100%; font-size: 12.5px; color: var(--muted); }
.qr-loading svg { width: 22px; height: 22px; color: var(--brand); animation: qrspin 1.6s linear infinite; }
@keyframes qrspin { to { transform: rotate(360deg); } }
.wx-alert {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 11px; padding: 9px 11px;
  border-radius: 10px; background: #fff7e6; color: #a86400; font-size: 12px; line-height: 1.6;
}
.wx-alert svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }

/* ===== 待绑定微信列表 ===== */
.wx-bind-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.wx-bind-main { display: flex; align-items: baseline; gap: 8px; flex: 1 1 240px; min-width: 0; }
.wx-bind-main b { font-weight: 650; white-space: nowrap; }
.wx-bind-main .hint { font-style: normal; }
