/* ==========================================================================
   东营市电梯安全监测预警平台 · 前端样式
   政务/工业风浅色主题：墨蓝 + 青灰，卡片式布局，紧凑数据表格
   ========================================================================== */

:root {
  --ink-900: #0e2338;
  --ink-800: #14304a;
  --ink-700: #1b3d5c;
  --brand: #1f4e79;
  --brand-600: #1a4268;
  --brand-700: #153a5b;
  --brand-050: #eaf1f7;
  --teal: #3f7d8a;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --line: #d7e0e8;
  --line-strong: #bcc9d4;
  --text: #172433;
  --text-2: #3f5062;
  --muted: #6b7c8c;
  --success: #1c7c4a;
  --success-bg: #e3f3ea;
  --warn: #7a4b00;
  --warn-bg: #fbf0dd;
  --danger: #b1372f;
  --danger-bg: #fbe9e7;
  --info: #2563a8;
  --info-bg: #e6effa;
  --side-bg: #122a41;
  --side-text: #c6d5e2;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(16, 40, 64, 0.06), 0 4px 14px rgba(16, 40, 64, 0.05);
  --focus: #3b82c4;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: var(--info);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mb-0 { margin-bottom: 0 !important; }
.mt-12 { margin-top: 12px; }
.mt-8 { margin-top: 8px; }
.truncate {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- 跳到主内容 / 启动态 ---------- */
.skip-link {
  position: fixed;
  left: -9999px;
  top: 8px;
  z-index: 120;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
}
.skip-link:focus {
  left: 8px;
}
.boot {
  padding: 90px 24px;
  text-align: center;
  color: var(--muted);
}

/* ==========================================================================
   应用外壳
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
  height: 100vh;
}
.sidebar {
  background: var(--side-bg);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 14px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand__mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 4px;
  background: linear-gradient(140deg, #3a78ad, #1b4a72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #eaf3fb;
}
.brand__name {
  font-size: 13.5px;
  line-height: 1.3;
  font-weight: 600;
  color: #e8f0f7;
}
.brand__name small {
  display: block;
  font-weight: 400;
  color: #8fa8bd;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  margin-top: 2px;
}
.sidebar__group {
  padding: 12px 10px 2px;
}
.sidebar__title {
  font-size: 10.5px;
  letter-spacing: 1.2px;
  color: #7b95ab;
  padding: 0 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin: 1px 0;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 4px;
  background: none;
  color: var(--side-text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.nav-item--active {
  background: #1b4568;
  border-left-color: #5aa9d6;
  color: #fff;
  font-weight: 600;
}
.nav-item__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex: 0 0 5px;
}
.sidebar__foot {
  margin-top: auto;
  padding: 12px 16px;
  font-size: 10.5px;
  line-height: 1.6;
  color: #7b95ab;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}
.topbar {
  height: 54px;
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.topbar__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--ink-800);
}
.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
}
.user-chip {
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.mock-badge {
  font-size: 10.5px;
  letter-spacing: 0.6px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #ecd4a8;
  padding: 2px 7px;
  border-radius: 3px;
}
.main {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 44px;
}
.page {
  max-width: 1560px;
  margin: 0 auto;
}
.nav-backdrop {
  display: none;
}

/* ---------- 页面标题 ---------- */
.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.page__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--ink-800);
}
.page__desc {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}
.page__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ==========================================================================
   KPI / 卡片 / 网格
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 11px 14px;
  box-shadow: var(--shadow);
}
.kpi__label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.kpi__value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-800);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}
.kpi__value small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}
.kpi__hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.kpi--success { border-left-color: var(--success); }
.kpi--warn { border-left-color: var(--warn); }
.kpi--danger { border-left-color: var(--danger); }
.kpi--teal { border-left-color: var(--teal); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfd, #f4f8fa);
}
.card__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-800);
}
.card__title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 1px;
  background: var(--brand);
}
.card__sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.card__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card__body {
  padding: 14px;
}
.card__body--flush {
  padding: 0;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
  align-items: start;
}
.card-grid > .card {
  margin-bottom: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack > .card {
  margin-bottom: 0;
}

/* ==========================================================================
   按钮 / 表单
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover {
  background: #f3f7fa;
  border-color: #9fb3c4;
}
.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn--primary:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.btn--danger {
  background: #fff;
  border-color: #e3b3ae;
  color: var(--danger);
}
.btn--danger:hover {
  background: var(--danger-bg);
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--line);
}
.btn--sm {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn--block {
  width: 100%;
  height: 38px;
  font-size: 14px;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.textarea {
  height: auto;
  min-height: 74px;
  padding: 7px 9px;
  line-height: 1.5;
  resize: vertical;
}
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #5c6b78 50%),
    linear-gradient(135deg, #5c6b78 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
  cursor: pointer;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.13);
}
.input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--danger);
}
.input:disabled,
.select:disabled,
.textarea:disabled {
  background: #f3f6f9;
  color: var(--muted);
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field--full {
  grid-column: 1 / -1;
}
.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.field__label .req {
  color: var(--danger);
  margin-left: 2px;
}
.field__hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.field__error {
  font-size: 11.5px;
  color: var(--danger);
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}
.inline-field .input,
.inline-field .select {
  width: auto;
  min-width: 118px;
}

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
}
.toolbar__group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.toolbar__spacer {
  margin-left: auto;
}
.toolbar .input,
.toolbar .select {
  height: 30px;
  font-size: 12.5px;
  width: auto;
  min-width: 130px;
}
.toolbar .input--wide {
  min-width: 200px;
}

/* ==========================================================================
   表格 / 分页
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  color: #42566a;
  background: #f3f7fa;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e9eff4;
  vertical-align: middle;
  color: var(--text-2);
}
.table tbody tr:hover {
  background: #f7fafc;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table--clickable tbody tr {
  cursor: pointer;
}
.table .num {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.table .cell-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.table__empty {
  padding: 38px 16px;
  text-align: center;
  color: var(--muted);
}
.table__group td {
  background: #f6f8fa;
  font-weight: 600;
  color: var(--ink-700);
}
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.pager__pages {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pager select {
  height: 26px;
  width: auto;
  font-size: 12px;
}
.page-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}
.page-btn:hover {
  background: var(--surface-2);
}
.page-btn--active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==========================================================================
   徽标 / 状态 / 提示
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.badge--neutral { background: #eef2f6; border-color: #dde5ec; color: #4a5c6e; }
.badge--success { background: var(--success-bg); border-color: #bfe3cf; color: var(--success); }
.badge--warn { background: var(--warn-bg); border-color: #eed7ad; color: var(--warn); }
.badge--danger { background: var(--danger-bg); border-color: #f0c4bf; color: var(--danger); }
.badge--info { background: var(--info-bg); border-color: #c3d9f0; color: var(--info); }
.badge--outline { background: #fff; border-color: var(--line-strong); color: var(--text-2); }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot--success { background: var(--success); }
.status-dot--warn { background: var(--warn); }
.status-dot--danger { background: var(--danger); }
.status-dot--info { background: var(--info); }

.callout {
  display: flex;
  gap: 8px;
  padding: 9px 11px;
  margin-bottom: 12px;
  border: 1px solid #cfe0f2;
  border-radius: 5px;
  background: var(--info-bg);
  color: #28527f;
  font-size: 12.5px;
  line-height: 1.55;
}
.callout--warn {
  background: var(--warn-bg);
  border-color: #eed7ad;
  color: #7d5310;
}
.callout--danger {
  background: var(--danger-bg);
  border-color: #f0c4bf;
  color: #8d2b24;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.empty__icon {
  font-size: 22px;
  opacity: 0.45;
  line-height: 1;
}

/* 骨架屏 / 加载 */
.skeleton {
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(90deg, #eef2f6 25%, #e1e8ef 37%, #eef2f6 63%);
  background-size: 400% 100%;
  animation: sk 1.2s ease infinite;
}
@keyframes sk {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.loading-block {
  display: grid;
  gap: 10px;
  padding: 18px 14px;
}
.loading-row {
  display: grid;
  grid-template-columns: 90px 1fr 70px;
  gap: 12px;
  align-items: center;
}
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #c9d6e1;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 进度条 */
.progress {
  height: 8px;
  border-radius: 99px;
  background: #e8eef4;
  overflow: hidden;
  min-width: 90px;
}
.progress__bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #2f6da3, #3f8d9a);
  transition: width 0.3s ease;
}
.progress--sm {
  height: 5px;
}

/* ==========================================================================
   KV 信息格
   ========================================================================== */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 8px 11px;
  background: #fff;
}
.kv__k {
  font-size: 11.5px;
  color: var(--muted);
}
.kv__v {
  font-size: 13px;
  color: var(--text);
  word-break: break-word;
}

/* ==========================================================================
   页签
   ========================================================================== */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 10px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 9px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover {
  color: var(--brand);
}
.tab--active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ==========================================================================
   弹窗
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  overflow-y: auto;
  background: rgba(13, 32, 50, 0.45);
}
.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(6, 20, 34, 0.35);
  animation: modal-in 0.16s ease-out;
}
.modal--lg { max-width: 780px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.modal__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-800);
}
.modal__close {
  margin-left: auto;
  padding: 2px 5px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.modal__body {
  padding: 16px;
  overflow-y: auto;
}
.modal__foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: #fafcfd;
  border-radius: 0 0 8px 8px;
}
.modal__foot .spacer {
  margin-right: auto;
}
body.modal-open {
  overflow: hidden;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast-root {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 28px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(9, 26, 42, 0.18);
  font-size: 13px;
  animation: toast-in 0.18s ease-out;
}
.toast--error { border-left-color: var(--danger); }
.toast--success { border-left-color: var(--success); }
.toast--warn { border-left-color: var(--warn); }
.toast__msg { flex: 1; word-break: break-word; }
.toast__close {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   SVG 图表
   ========================================================================== */
.chart {
  position: relative;
  padding: 4px 2px 0;
  min-height: 120px;
}
.chart__svg {
  display: block;
  width: 100%;
}
.chart__svg text {
  fill: #6b7c8c;
  font-family: var(--font);
  font-size: 11px;
}
.chart__legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 4px 6px;
  font-size: 12px;
  color: var(--text-2);
}
.chart__legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 2px;
}
.chart__tip {
  position: absolute;
  z-index: 5;
  padding: 6px 9px;
  border-radius: 4px;
  background: rgba(14, 35, 56, 0.94);
  color: #eaf1f7;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -118%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.chart__empty {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
  color: var(--muted);
  font-size: 13px;
}
.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ==========================================================================
   登录页
   ========================================================================== */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 560px at 18% -12%, #1d4a72 0%, #12293f 46%, #0b1c2b 100%);
}
.login__card {
  width: min(420px, 100%);
  padding: 28px 30px 20px;
  border-top: 3px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}
.login__brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.login__brand > div:last-child { min-width: 0; }
.login__brand .brand__mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  font-size: 15px;
}
.login__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-800);
  letter-spacing: 0.2px;
}
.login__sub {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.55px;
  line-height: 1.45;
  margin-top: 3px;
}
.login__phase {
  margin: 0 0 14px;
  font-size: 11.5px;
  color: #7d8fa3;
  letter-spacing: 0.2px;
}
.login__form {
  display: grid;
  gap: 14px;
}
.login__err {
  min-height: 16px;
  font-size: 12px;
  color: var(--danger);
}
.login__hint {
  margin-top: 14px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.login__foot {
  margin-top: 12px;
  text-align: center;
  font-size: 10.5px;
  color: #93a2b0;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   电梯详情 / 附件 / 二维码
   ========================================================================== */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfdfe;
  font-size: 12.5px;
}
.file-item__main {
  min-width: 0;
}
.file-item__name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.file-item__meta {
  color: var(--muted);
  font-size: 11.5px;
}
.file-item__actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.qr-box img,
.qr-box svg {
  width: 168px;
  height: 168px;
  display: block;
  background: #fff;
}
.qr-box__code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.4px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.metric {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfdfe;
}
.metric__k {
  font-size: 11px;
  color: var(--muted);
}
.metric__v {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-700);
  margin-top: 1px;
}
.pre {
  padding: 10px;
  border-radius: 4px;
  background: #0f2438;
  color: #cfe3f4;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow: auto;
}

/* ==========================================================================
   权限勾选 / 只读信息
   ========================================================================== */
.perm-groups {
  display: grid;
  gap: 10px;
}
.perm-group {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.perm-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
}
.perm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.perm-list .checkbox {
  font-size: 12.5px;
  font-family: var(--mono);
}
.role-list {
  display: grid;
  gap: 8px;}
.role-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.role-item:hover {
  border-color: var(--line-strong);
  background: #fbfdfe;
}
.role-item--active {
  border-color: var(--brand);
  background: var(--brand-050);
}
.role-item__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-800);
}
.role-item__meta {
  font-size: 11.5px;
  color: var(--muted);
}
.role-item__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}

/* ==========================================================================
   公共扫码页
   ========================================================================== */
.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 16px 60px;
  background: linear-gradient(180deg, #f2f6f9, #e8eef3);
}
.public-card {
  width: min(720px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.public-card__head {
  padding: 18px 20px;
  background: linear-gradient(120deg, #173c5c, #1f4e79);
  color: #eaf3fb;
}
.public-card__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.public-card__sub {
  font-size: 12px;
  color: #a9c4da;
  margin-top: 3px;
  letter-spacing: 0.5px;
}
.public-card__body {
  padding: 18px 20px 20px;
}
.public-foot {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}
.search-inline {
  display: flex;
  gap: 8px;
  width: min(460px, 100%);
}
.search-inline .input {
  flex: 1;
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1280px) {
  .main { padding: 15px 16px 36px; }
  .detail-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: 236px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
  }
  .shell.nav-open .sidebar { transform: none; }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(10, 25, 40, 0.42);
  }
  .shell.nav-open .nav-backdrop { display: block; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1101px) {
  #nav-toggle { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .user-chip { display: none; }
  .main { padding: 12px 12px 32px; }
  .page__title { font-size: 17px; }
  .kpi__value { font-size: 21px; }
  .truncate { max-width: 170px; }
  .modal-overlay { padding: 3vh 8px 8px; }
}

/* ==========================================================================
   云梯式改版（2026-10-30，对齐参考图 image6 / image16）
   - 深蓝侧栏 + 亮蓝主色 #1a73e8
   - 顶栏白底、内容浅灰、卡片圆角 8px
   - 新增组件：告警视频弹窗、行内操作按钮、过滤工具条
   ========================================================================== */
:root {
  --brand: #1a73e8;
  --brand-600: #155fc9;
  --brand-700: #0f4da6;
  --brand-050: #e9f1fd;
  --info: #1a73e8;
  --bg: #f2f5f9;
  --line: #e3e9f1;
  --line-strong: #c9d5e2;
  --side-bg: #0c1f34;
  --side-text: #aebfd0;
}

.shell { grid-template-columns: 214px minmax(0, 1fr); }
.sidebar {
  background: linear-gradient(180deg, #0d2239 0%, #0a1a2c 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}
.brand { padding: 14px 12px 13px; border-bottom-color: rgba(255, 255, 255, 0.06); }
.brand__mark {
  background: linear-gradient(140deg, #2f8cff, #155fc9);
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.4px;
}
.brand__name { font-size: 12.5px; color: #e6eef7; }
.brand__name small { font-size: 9.5px; color: #748da4; }
.sidebar__group { padding: 10px 8px 2px; }
.sidebar__title { color: #68819a; font-size: 10px; letter-spacing: 1px; }
.nav-item {
  margin: 2px 4px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  color: var(--side-text);
}
.nav-item__dot { width: 6px; height: 6px; opacity: 0.4; }
.nav-item:hover { background: rgba(47, 140, 255, 0.14); color: #fff; }
.nav-item--active {
  background: #1a73e8;
  border: 0;
  color: #fff;
  box-shadow: 0 3px 12px rgba(26, 115, 232, 0.35);
}
.nav-item--active .nav-item__dot { background: #fff; opacity: 1; }
.sidebar__foot { color: #68819a; border-top-color: rgba(255, 255, 255, 0.06); }

.topbar { height: 52px; flex: 0 0 52px; gap: 10px; padding: 0 16px; box-shadow: 0 1px 0 var(--line); }
.topbar__title { color: #1f2d3d; font-size: 15px; }
.icon-btn { border-radius: 6px; }
.user-chip { border-radius: 999px; background: #fff; }

.main { padding: 16px 18px 40px; }
.page__title { font-size: 19px; color: #16283d; }
.page__desc { color: #6f8095; }
.card { border-radius: 8px; box-shadow: 0 1px 2px rgba(15, 35, 60, 0.04), 0 6px 18px rgba(15, 35, 60, 0.04); }
.card__title::before { background: var(--brand); border-radius: 2px; }
.kpi { border-radius: 8px; border-left-color: var(--brand); }
.kpi__value { color: #16283d; }
.btn { border-radius: 5px; }
.btn--primary { background: var(--brand); border-color: var(--brand); box-shadow: 0 1px 2px rgba(26, 115, 232, 0.25); }
.btn--primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.input, .select { border-radius: 5px; }
.table th {
  background: #eef3f9;
  color: #33475b;
  font-weight: 600;
}
.table tbody tr:hover { background: #f5f9ff; }

/* 过滤工具条（告警记录等） */
.toolbar--inline { flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.toolbar--inline .field { min-width: 150px; }
.toolbar--inline .input, .toolbar--inline .select { min-width: 150px; }
.row-actions { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.link-btn {
  border: 0;
  background: none;
  padding: 2px 4px;
  color: var(--info);
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 4px;
}
.link-btn:hover { background: var(--brand-050); }

/* 告警视频弹窗 */
.alarm-video { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 1fr); gap: 16px; }
.alarm-video__player {
  background: #0b1626;
  border-radius: 8px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #93a9bf;
  border: 1px solid #1d3049;
}
.alarm-video__player::before { content: "▷"; font-size: 42px; color: #2f8cff; opacity: 0.85; }
.alarm-video__ph { font-size: 13.5px; }
.alarm-video__hint { font-size: 12px; color: #5d7794; }
.alarm-video__info { display: flex; flex-direction: column; gap: 14px; }
.info-block h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv__k { color: var(--muted); }
.kv__v { color: var(--text); text-align: right; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { width: 230px; background: linear-gradient(180deg, #0d2239 0%, #0a1a2c 100%); }
}
@media (max-width: 720px) {
  .alarm-video { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   第三阶段：电梯档案分组表单 / 门机监测 / 画像配置 / AI 维保计划 / 反推台账
   ========================================================================== */

.tab-body { margin-top: 12px; }
.tabs--sm .tab { padding: 4px 10px; font-size: 12px; }
.toolbar--wrap { flex-wrap: wrap; }
.link-btn--danger { color: var(--danger); }
.modal__foot-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- 电梯档案 55 列分组表单 ---------- */
.archive-form { display: flex; flex-direction: column; gap: 14px; }
.archive-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.archive-group__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.archive-group__title { margin: 0; font-size: 13px; font-weight: 600; color: var(--brand); }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 12px; }
.archive-grid .field { margin: 0; }
.field--span-2 { grid-column: span 2; }
@media (max-width: 900px) {
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--span-2 { grid-column: span 2; }
}

/* ---------- 门机监测：概览与六维实时卡片 ---------- */
.door-overview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.door-overview__grid { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 16px; align-items: center; }
.door-overview__title { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.door-overview__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.door-overview__kpis { display: grid; grid-template-columns: repeat(4, minmax(118px, 1fr)); gap: 10px; }
.door-kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
  min-width: 0;
}
.door-kpi__label { font-size: 11.5px; color: var(--muted); }
.door-kpi__value { font-size: 22px; font-weight: 600; line-height: 1.25; margin-top: 2px; color: var(--ink-900); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.door-kpi__hint { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.door-dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.door-dim {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
  min-width: 0;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.door-dim:hover { box-shadow: var(--shadow); }
.door-dim--warn { border-color: #e6c27a; border-left-color: #cf9b2f; background: #fdfaf2; }
.door-dim--crit { border-color: #e6a8a2; border-left-color: var(--danger); background: #fdf5f4; animation: door-pulse 2.4s ease-in-out infinite; }
@keyframes door-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(177, 55, 47, 0); }
  50% { box-shadow: 0 0 0 3px rgba(177, 55, 47, 0.12); }
}
.door-dim__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.door-dim__label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.door-dim__value { font-size: 20px; font-weight: 600; margin: 6px 0 4px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.door-dim__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.door-dim__spark { display: inline-flex; align-items: center; }
.door-dim__th { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--muted); }
@media (max-width: 1100px) {
  .door-overview__grid { grid-template-columns: minmax(0, 1fr); }
  .door-overview__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 门机监测：六维评分 ---------- */
.door-scores { display: grid; gap: 8px; }
.door-score { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) 56px; gap: 10px; align-items: center; font-size: 12px; }
.door-score__label { color: var(--text-2); }
.door-score__bar { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.door-score__fill { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.door-score__fill--success { background: var(--success); }
.door-score__fill--info { background: var(--info); }
.door-score__fill--warn { background: #cf9b2f; }
.door-score__fill--danger { background: var(--danger); }
.door-score__num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.door-score__hits { grid-column: 1 / -1; margin-top: -4px; font-size: 11px; }
.door-scores__total { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }

/* ---------- 门机监测：波形区 ---------- */
.door-chart { position: relative; min-height: 260px; }
.door-chart__meta { font-size: 11.5px; margin-bottom: 6px; }
.door-chart__wrap { position: relative; }
.door-chart__keys { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.door-chart__key { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.door-chart__key input { accent-color: var(--brand); }
.door-chart__legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.door-chart__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.door-chart__swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.door-chart__tip-time { margin-bottom: 2px; font-size: 11px; color: var(--muted); }
.door-chart__loading { display: flex; align-items: center; min-height: 240px; }

/* ---------- 画像配置 ---------- */
.profile-layout { display: grid; gap: 12px; }
.profile-detail { display: grid; gap: 12px; }
.profile-weights { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.profile-weights__item {
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 8px;
}
.profile-editor { display: grid; gap: 4px; }
.profile-editor__section-title { margin: 12px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.profile-editor__weights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; }
.profile-editor__weight { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.profile-editor__weight input { width: 84px; }
.profile-editor__sum { margin-top: 6px; font-size: 12px; }
.profile-kpis { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 16px; align-items: center; }
.profile-kpis__main { display: flex; flex-direction: column; gap: 4px; }
.profile-kpis__score { font-size: 40px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.profile-kpis__level { margin: 2px 0 6px; }
.profile-kpis__radar { display: flex; justify-content: center; }
.profile-kpis__bars { display: grid; gap: 8px; align-content: center; }
.profile-basis { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.profile-basis__actions { display: flex; gap: 8px; }
@media (max-width: 1100px) {
  .profile-kpis { grid-template-columns: minmax(0, 1fr); }
  .profile-editor__weights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .door-score { grid-template-columns: minmax(0, 1fr) 56px; }
  .door-score__bar { grid-column: 1 / -1; }
}

/* ============================== v0.4 补充 ============================== */

/* 顶栏通知铃铛 */
.topbar__right { position: relative; }
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.notif-bell:hover { border-color: var(--line-strong); color: var(--brand); }
.notif-bell:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.notif-bell__dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
  font-family: var(--mono);
}
.notif-bell__dot[hidden] { display: none; }
.notif-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 90;
  width: 360px;
  max-width: min(360px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15, 35, 56, 0.18);
  overflow: hidden;
}
.notif-dropdown[hidden] { display: none; }
.notif-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.notif-dropdown__title { font-size: 12.5px; font-weight: 700; color: var(--ink-900); }
.notif-dropdown__list { max-height: 320px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.notif-dropdown__item {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.notif-dropdown__item:hover { background: var(--surface-2); }
.notif-dropdown__item-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.notif-dropdown__item-sub { margin-top: 2px; color: var(--muted); font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-dropdown__item-time { margin-top: 3px; color: var(--muted); font-size: 11px; font-family: var(--mono); }
.notif-dropdown__empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.notif-dropdown__foot {
  display: flex;
  justify-content: center;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.notif-detail__title { font-size: 14px; font-weight: 700; color: var(--ink-900); }
.notif-detail__meta { margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.notif-detail__content { white-space: pre-wrap; line-height: 1.7; font-size: 12.5px; color: var(--text); }

/* 单元格两行文本 */
.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-stack__main { font-weight: 600; color: var(--text); }
.cell-stack__sub { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }

/* 小尺寸表单控件 */
.select--sm, .input--sm { height: 26px; padding: 0 6px; font-size: 12px; }
.select--sm { min-width: 92px; }

/* 处理时间轴 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
.timeline__item { position: relative; padding: 0 0 14px 0; }
.timeline__dot {
  position: absolute;
  left: -16px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.timeline__body { display: flex; flex-direction: column; gap: 2px; }
.timeline__title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.timeline__meta { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.timeline__note { font-size: 12px; color: var(--text-2); }
.timeline__item:last-child { padding-bottom: 2px; }

/* 故障月度柱状 */
.fault-months {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 12px 6px;
  min-height: 150px;
}
.fault-month { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.fault-month__bar { width: 100%; max-width: 46px; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 3px; }
.fault-month__num { font-size: 11.5px; font-family: var(--mono); color: var(--text-2); }
.fault-month__label { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* 知识库文章 */
.kb-article__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.kb-article__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.kb-article__text { margin: 4px 0 10px; line-height: 1.7; font-size: 12.5px; white-space: pre-wrap; }
.kb-steps { margin: 4px 0 10px; padding-left: 20px; line-height: 1.8; font-size: 12.5px; }
.kb-steps__item { margin-bottom: 2px; }

/* 物业公告 */
.notice-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.notice-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; background: var(--surface-2); }
.notice-item__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.notice-item__title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.notice-item__time { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.notice-item__content { font-size: 12px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; }

/* 实时监测 Tab */
.monitor-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.monitor-head__title { font-size: 15px; font-weight: 700; color: var(--ink-900); }
.monitor-head__sub { margin-top: 3px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.monitor-head__actions { display: flex; align-items: center; gap: 8px; }
.monitor-chart { margin-top: 4px; }
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 180px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}
.video-placeholder__icon { font-size: 30px; line-height: 1; }
.video-placeholder__text { font-size: 12px; }

/* 维保到期提醒 */
.reminder-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.reminder-col { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface-2); }
.reminder-col__title { margin-bottom: 6px; }
.reminder-list { max-height: 190px; overflow-y: auto; }
.reminder-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.reminder-item:last-child { border-bottom: 0; }
.reminder-item__name { font-weight: 600; color: var(--text); }
.reminder-item__due { color: var(--text-2); font-size: 11.5px; }
.reminder-item__due .badge { margin-left: 4px; }

/* 门机趋势 */
.door-trend { display: flex; flex-direction: column; gap: 10px; }
.door-trend__kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.door-trend__chart { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: var(--surface); overflow-x: auto; }
.door-trend__svg { width: 100%; min-width: 320px; height: 120px; display: block; }

/* 通用分组标题 */
.section-title { margin: 2px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-900); }

@media (max-width: 900px) {
  .reminder-cols { grid-template-columns: minmax(0, 1fr); }
  .door-trend__kpis { grid-template-columns: minmax(0, 1fr); }
  .notif-dropdown { width: 300px; }
}


/* ==========================================================================
   v0.5 全量视觉升级（2026-10-31）
   - 统一设计令牌：更亮的品牌蓝、10px 圆角、分层阴影、tabular 数字
   - 组件精修：KPI / 卡片 / 表格 / 标签 / 按钮 / 表单 / 页签 / 弹窗 / 空态 / 分页
   - 不改结构与类名，仅覆盖外观，保证既有页面全部生效
   ========================================================================== */
:root {
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-700: #1e40af;
  --brand-050: #eff5ff;
  --info: #2563eb;
  --info-bg: #eaf1fe;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #e5ebf3;
  --line-strong: #d3dce8;
  --text: #1a2433;
  --text-2: #475467;
  --muted: #7b8a9b;
  --ink-900: #101a2b;
  --ink-800: #16233a;
  --ink-700: #1d2d47;
  --success: #15803d;
  --success-bg: #e7f6ec;
  --warn: #b45309;
  --warn-bg: #fdf3e3;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --teal: #0e7490;
  --radius: 10px;
  --radius-sm: 8px;
  --focus: #3b82f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -8px rgba(16, 24, 40, 0.10);
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 520px at 100% -10%, rgba(37, 99, 235, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(37, 99, 235, 0.18); }
* { scrollbar-width: thin; scrollbar-color: #c8d3e0 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #cdd8e5; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b4c2d3; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 侧栏与顶栏 ---------- */
.shell { grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  background:
    radial-gradient(420px 200px at 0% 0%, rgba(37, 99, 235, 0.22), transparent 70%),
    linear-gradient(180deg, #0b1f36 0%, #081726 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}
.brand { padding: 16px 14px 14px; }
.brand__mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #4f8dff 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-size: 12px;
}
.brand__name { font-size: 13px; font-weight: 650; letter-spacing: 0.2px; color: #eef4fb; }
.brand__name small { font-size: 9.5px; letter-spacing: 0.6px; color: #7d95ad; }
.sidebar__group { padding: 12px 10px 2px; }
.sidebar__title {
  padding: 0 6px;
  color: #6d86a0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  margin: 2px 6px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: #b7c7d8;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.nav-item:hover { background: rgba(59, 130, 246, 0.16); color: #fff; transform: translateX(1px); }
.nav-item--active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.98), rgba(29, 78, 216, 0.92));
  box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.nav-item--active::before {
  content: "";
  position: absolute;
  left: -6px; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #8ab4ff;
}
.sidebar__foot { padding: 12px 14px; color: #6d86a0; font-size: 11px; }

.topbar {
  height: 56px;
  flex: 0 0 56px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}
.topbar__title { font-size: 15px; font-weight: 650; color: #16233a; letter-spacing: 0.1px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 9px;
  color: var(--text-2);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.icon-btn:hover { background: var(--brand-050); border-color: #c9dcff; color: var(--brand); }
.user-chip {
  height: 34px;
  padding: 0 12px 0 4px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.user-chip:hover { border-color: #c9dcff; }

/* ---------- 主区 / 页头 ---------- */
.main { padding: 18px 22px 44px; }
.page { animation: page-in 0.22s ease both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.page__head { gap: 14px; margin-bottom: 16px; }
.page__title { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; color: #0f1b2d; }
.page__desc { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.page__actions { gap: 8px; }

/* ---------- KPI ---------- */
.kpi-grid { gap: 12px; }
.kpi {
  position: relative;
  padding: 14px 16px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.kpi::after {
  content: "";
  position: absolute;
  right: -28px; top: -34px;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.10), transparent 70%);
  pointer-events: none;
}
.kpi:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(16, 24, 40, 0.05), 0 14px 30px -12px rgba(16, 24, 40, 0.16); }
.kpi--success::before { background: linear-gradient(180deg, #4ade80, #15803d); }
.kpi--warn::before { background: linear-gradient(180deg, #fbbf24, #b45309); }
.kpi--danger::before { background: linear-gradient(180deg, #f87171, #b42318); }
.kpi--teal::before { background: linear-gradient(180deg, #22d3ee, #0e7490); }
.kpi__label { font-size: 12px; font-weight: 600; letter-spacing: 0.2px; color: #64748b; }
.kpi__value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.4px;
  color: #0f1b2d;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi__value small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi__hint { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* ---------- 卡片 ---------- */
.card {
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.card__head { padding: 13px 16px; gap: 10px; }
.card__title { font-size: 14px; font-weight: 700; color: #16233a; }
.card__title::before { width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #60a5fa, #2563eb); }
.card__sub { font-size: 11.5px; color: var(--muted); }
.card__actions { gap: 8px; }
.card__body { padding: 14px 16px 16px; }
.card__body--flush { padding: 0; }
.card-grid { gap: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  height: 32px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-color: #2563eb;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.30), 0 6px 14px -8px rgba(37, 99, 235, 0.65);
}
.btn--primary:hover { background: linear-gradient(180deg, #2f74ef 0%, #1d4ed8 100%); border-color: #1d4ed8; box-shadow: 0 2px 4px rgba(37, 99, 235, 0.30), 0 10px 20px -10px rgba(37, 99, 235, 0.7); }
.btn--ghost { background: #fff; border-color: var(--line-strong); color: var(--text-2); }
.btn--ghost:hover { border-color: #b9cdf0; color: var(--brand); background: var(--brand-050); }
.btn--danger { background: #fff; border-color: #efc0ba; color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); border-color: #e39a92; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible,
.input:focus-visible, .select:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* ---------- 表单控件 ---------- */
.input, .select, textarea.input {
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border-color: var(--line-strong);
  background: #fff;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input::placeholder { color: #9aa8b8; }
.input:hover, .select:hover { border-color: #b9c9dd; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}
.field__label { font-size: 12px; font-weight: 600; color: #46586d; }
.field__hint { font-size: 11.5px; color: var(--muted); }
.toolbar { gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }

/* ---------- 表格 ---------- */
.table-wrap { border-radius: 10px; border-color: var(--line); background: #fff; }
.table th {
  padding: 11px 14px;
  background: #f5f8fc;
  color: #5b6b7c;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; font-size: 13px; color: var(--text); border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.table tbody tr { transition: background 0.14s ease; }
.table tbody tr:hover { background: #f7faff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .table .mono { font-variant-numeric: tabular-nums; }
.table__empty { padding: 44px 16px; color: var(--muted); }
.table__group td { background: #f7f9fc; font-weight: 650; color: var(--text-2); }

/* ---------- 标签 / 徽章 ---------- */
.badge {
  height: 22px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  border-width: 1px;
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge--success { background: var(--success-bg); border-color: #bfe6cd; color: var(--success); }
.badge--warn { background: var(--warn-bg); border-color: #f3d9ae; color: var(--warn); }
.badge--danger { background: var(--danger-bg); border-color: #f4c7c2; color: var(--danger); }
.badge--info { background: var(--info-bg); border-color: #c7dcfa; color: var(--info); }
.badge--neutral { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.badge--outline { background: #fff; border-color: var(--line-strong); color: var(--text-2); }
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.badge--plain::before, .badge--no-dot::before { display: none; }

/* ---------- 页签 ---------- */
.tabs { gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab {
  padding: 9px 13px;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.tab:hover { background: var(--brand-050); color: var(--brand); }
.tab--active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }

/* ---------- 空态 / 加载 ---------- */
.empty { padding: 40px 18px; color: var(--muted); }
.empty__icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 25%, #eaf2ff, #dbe8fb);
  color: #6f9bed;
  font-size: 22px;
  margin-bottom: 10px;
}
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.spinner { border-color: #dbe6f5; border-top-color: var(--brand); }

/* ---------- 弹窗 / 提示 ---------- */
.modal-overlay { background: rgba(10, 22, 38, 0.46); backdrop-filter: blur(3px); }
.modal {
  border-radius: 14px;
  border-color: var(--line);
  box-shadow: 0 24px 60px -18px rgba(10, 22, 38, 0.35), 0 2px 6px rgba(10, 22, 38, 0.08);
}
.modal__head { padding: 16px 18px 12px; }
.modal__title { font-size: 15px; font-weight: 700; color: #0f1b2d; }
.modal__close { width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__body { padding: 4px 18px 16px; }
.modal__foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 14px 14px; }
.toast { border-radius: 10px; box-shadow: 0 10px 30px -12px rgba(15, 30, 50, 0.35); }

/* ---------- 分页 ---------- */
.pager { padding: 12px 14px; gap: 10px; }
.pager__pages { gap: 4px; }
.pager__pages button, .pager__pages .page-btn {
  min-width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pager__pages button:hover { border-color: #bcd2f5; color: var(--brand); background: var(--brand-050); }
.pager__pages button[aria-current="page"], .pager__pages .page-btn--active {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(37, 99, 235, 0.8);
}

/* ---------- 图表 ---------- */
.chart__svg text { fill: #7b8a9b; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart__tip {
  border-radius: 10px;
  border-color: var(--line);
  box-shadow: 0 12px 28px -12px rgba(15, 30, 50, 0.35);
  font-size: 12px;
}
.chart-toolbar { gap: 8px; }

/* ---------- 时间轴 / 其它细节 ---------- */
.timeline::before { background: linear-gradient(180deg, #bfdbfe, var(--line)); }
.timeline__dot { background: #2563eb; box-shadow: 0 0 0 3px #dbeafe; border-color: #fff; }
.row-actions { gap: 2px; }
.link-btn { font-weight: 600; }
.link-btn:hover { background: var(--brand-050); color: var(--brand); }
.kv__k { color: var(--muted); }
.kv__v { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
  .kpi, .btn, .nav-item, .table tbody tr, .card { transition: none; }
  .skeleton { animation: none; }
}

/* ---------- v0.5.1 细节修正：侧栏品牌两行排版 ---------- */
.brand { align-items: flex-start; }
.brand__name { line-height: 1.3; font-size: 13px; letter-spacing: .01em; }
.brand__name small { display: block; margin-top: 3px; font-size: 8.5px; letter-spacing: .14em; opacity: .72; }

/* ---------- v0.5.1 —— 1366 笔记本/会议室投屏：KPI 一行放得下 ---------- */
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)) !important; gap: 12px; }
.kpi { padding: 14px 16px; }
.kpi__value { font-size: 23px; }
@media (max-width: 1280px) {
  .main { padding: 14px 16px; }
  .page__title { font-size: 18px; }
}

/* ==========================================================================
   v0.6 登录页品牌横幅
   ========================================================================== */
.login {
  background:
    radial-gradient(1200px 640px at 16% -16%, #1d4a72 0%, #12293f 48%, #0a1a2b 100%);
}
.login__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 52px;
  width: 100%;
  max-width: 1460px;
}
.login__hero {
  flex: 0 1 700px;
  max-width: 48vw;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 40px 96px -36px rgba(2, 10, 24, 0.8),
    0 0 0 1px rgba(120, 180, 255, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: #0b1c31;
}
.login__hero img {
  display: block;
  width: 100%;
  height: auto;
}
@media (min-width: 1201px) and (max-width: 1500px) {
  .login__hero { flex-basis: 588px; }
}
@media (max-width: 1200px) {
  .login__hero { display: none; }
}
@media (max-width: 520px) {
  .login { padding: 16px; }
}

/* 无障碍：读屏专用文本与可聚焦图表的焦点环（GAP-12） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
svg[tabindex="0"]:focus-visible {
  outline: 2px solid #1f6fb2;
  outline-offset: 2px;
}

/* ---------- 登录增强：密码显隐 / 记住项 / 短信验证码 ---------- */
.login__pw { position: relative; }
.login__pw .input { padding-right: 58px; }
.login__eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 1px solid transparent;
  background: transparent;
  color: #1f6fb2;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.login__eye:hover { background: rgba(31, 111, 178, 0.08); }
.login__eye:focus-visible { outline: 2px solid #1f6fb2; outline-offset: 1px; }
.login__opts { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 10px; }
.login__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #445668;
  cursor: pointer;
  user-select: none;
}
.login__check input { width: 15px; height: 15px; accent-color: #1f6fb2; }
.login__tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  background: #f0f4f9;
  padding: 4px;
  border-radius: 10px;
}
.login__tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: #5b6b7c;
  font-size: 13px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.login__tab[aria-selected="true"] {
  background: #fff;
  color: #1f6fb2;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.12);
}
.login__tab:focus-visible { outline: 2px solid #1f6fb2; outline-offset: 1px; }
.login__code-row { display: flex; gap: 8px; }
.login__code-row .input { flex: 1; min-width: 0; }
.login__code-row .btn { white-space: nowrap; }
.login__hint--inline {
  margin-top: 10px;
  padding: 8px 10px;
  background: #f4f8fd;
  border-radius: 8px;
  font-size: 11.5px;
  color: #33506e;
}
.login__form .btn--block { height: 36px; font-size: 13px; }

/* ==========================================================================
   列表与档案页文字密度（2026-11-01）
   列表：公司名等长文本单行省略（完整值在 title），避免一格撑高整行；
   档案：KV 信息格压缩上下留白，63 个字段不再每行 61px。
   ========================================================================== */
.elevators-table table.table { table-layout: fixed; width: 100%; }
.elevators-table td { white-space: nowrap; }
.elevators-table td .cell-clip,
.elevators-table td .truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.elevators-table .table th,
.elevators-table .table td { padding-top: 9px; padding-bottom: 9px; }
.elevators-table .mono { font-size: 12px; }

.kv { padding: 5px 9px; gap: 1px; }
.kv__k { font-size: 10.5px; line-height: 1.4; }
.kv__v { font-size: 12.5px; line-height: 1.45; }

@media (max-width: 1440px) {
  /* 1366 笔记本：品牌与所属小区让位，避免表格横向溢出（地址行已含小区） */
  .elevators-table th:nth-child(4),
  .elevators-table td:nth-child(4),
  .elevators-table th:nth-child(6),
  .elevators-table td:nth-child(6) { display: none; }
}

/* 全站列表：统一单元格内边距与两行截断（2026-11-01）
   说明：dataTable 给每个单元格内容包一层 .cell；纯展示内容最多 2 行，
   超出省略（可 hover 查看 title）；含按钮/链接的操作列不裁切。 */
.table th,
.table td { padding-top: 9px; padding-bottom: 9px; }
.table td { font-size: 12.5px; line-height: 1.45; }
.table td .cell {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.table td .cell--interactive { overflow: visible; }

/* 列表操作列：按钮更紧凑，减少动作簇撑高行 */
.table td .cell--interactive { display: flex; flex-wrap: wrap; gap: 4px 4px; align-items: center; }
.table td .cell--interactive .btn--sm { height: 24px; padding: 0 7px; font-size: 11.5px; border-radius: 6px; }

/* 编号/代码类单元格：单行省略，避免长编号被拆成两段 */
.table td .mono,
.table td .link-btn.mono {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-size: 11.5px;
}
/* 末列通常为操作列：保持单行，避免动作按钮换行把行撑高 */
.table th:last-child,
.table td:last-child { white-space: nowrap; }

/* 文字录入格：宽度自适应 + 拖拽微调（2026-11-01） */
.field__control { position: relative; display: flex; align-items: center; min-width: 0; width: 100%; }
.field__control > .input { flex: 0 0 auto; }
.field__resize {
  position: absolute;
  right: -2px;
  top: 3px;
  bottom: 3px;
  width: 9px;
  border-radius: 3px;
  cursor: ew-resize;
  opacity: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(31, 78, 121, 0.16) 50%, transparent 100%);
  transition: opacity 0.12s, background 0.12s;
}
.field__control:hover > .field__resize,
.field__resize:focus-visible { opacity: 1; }
.field__resize:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; background: rgba(31, 78, 121, 0.12); }
@media print { .field__resize { display: none; } }

/* 物业端电梯列表：与档案列表同口径的紧凑表格 + 窄屏列收敛（2026-11-01；二次修正列宽/隐藏列） */
.property-elevators table.table { table-layout: fixed; width: 100%; }
.property-elevators th, .property-elevators td { padding-top: 9px; padding-bottom: 9px; }
/* 注册代码 / 维保单位：长文本单行省略（hover 有 title），避免折行撑高行 */
.property-elevators td:nth-child(1) .cell,
.property-elevators td:nth-child(7) .cell {
  display: block; -webkit-line-clamp: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 名称 + 地址：名称一行、地址一行，各自省略 */
.property-elevators .cell-stack { min-width: 0; }
.property-elevators .cell-stack__main,
.property-elevators .cell-stack__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ≤1440：先收「小区」「最近检验」，保留状态与维保单位（原先误隐藏了状态列） */
@media (max-width: 1440px) {
  .property-elevators th:nth-child(4), .property-elevators td:nth-child(4),
  .property-elevators th:nth-child(8), .property-elevators td:nth-child(8) { display: none; }
  .property-elevators th, .property-elevators td { padding-left: 9px; padding-right: 9px; }
}
/* 状态类徽标不参与换行/收缩，避免「离线」被裁成「离」 */
.property-elevators .badge { white-space: nowrap; flex: 0 0 auto; }
.property-elevators td .cell { max-width: 100%; }

/* 详情页 KV：标签在上、值左对齐两行截断，消除右对齐锯齿与长地址撑高（2026-11-01） */
.kv { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; }
.kv__v {
  text-align: left; font-weight: 500;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
}

/* 详情右栏空态压缩：不再用半屏空白占位 */
.card .empty { padding: 22px 12px; gap: 4px; }
.card .empty__icon { font-size: 18px; }

/* 单元格高度硬上限：兜住 clamp 对嵌套块失效的情况（2026-11-01） */
.table td .cell { max-height: 40px; }

/* 角色权限：功能勾选矩阵（2026-11-01） */
.role-card { display: block; }
.role-card .card__head { align-items: flex-start; }
.role-card .card__body { padding-top: 0; }
.perm-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.perm-group__head .perm-group__title { margin-bottom: 0; }
.perm-group__count { font-size: 11.5px; color: var(--muted); }
.perm-group__actions { margin-left: auto; display: flex; gap: 10px; }
.perm-count { font-variant-numeric: tabular-nums; }
.perm-list .perm { font-family: inherit; font-size: 12.5px; gap: 6px; align-items: center; }
.perm-list .perm__name { white-space: nowrap; }
.perm-list .perm__code { font-family: var(--mono); font-size: 11px; }
.perm-list .perm[hidden], .perm-group[hidden] { display: none; }

/* 后端断连提示（app.js ensureFreshBuild 探测失败时插入） */
.offline-banner{position:fixed;left:50%;top:14px;transform:translateX(-50%);z-index:9999;display:flex;align-items:center;gap:12px;max-width:calc(100% - 32px);padding:10px 14px;border-radius:10px;background:#fff4e5;border:1px solid #f0b26b;color:#7a4b00;font-size:13px;box-shadow:0 8px 24px rgba(16,24,40,.12)}
.offline-banner .btn{flex:0 0 auto}
/* 合格证拍照识别（新建/编辑电梯） */
.cert-ocr { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fbfdff; }
.cert-ocr__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.cert-ocr__bar { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.cert-ocr__preview { margin-top: 8px; }
.cert-ocr__img { max-height: 150px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.cert-ocr__result { margin-top: 8px; font-size: 12.5px; }
.cert-ocr__meta { color: var(--muted); margin-bottom: 4px; }
.cert-ocr__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.cert-ocr__chip { background: #eef5ff; border: 1px solid #cfe1f8; color: #1f4e79; border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.cert-ocr__text summary { cursor: pointer; color: #4a6fa5; }
.cert-ocr__text pre { max-height: 160px; overflow: auto; white-space: pre-wrap; background: #f6f8fb; padding: 8px; border-radius: 6px; font-size: 11.5px; }
.cert-ocr__actions { margin-top: 6px; }
.cert-ocr__status { margin-top: 6px; font-size: 12px; }
.field--ocr { border-color: #e49b2f !important; box-shadow: 0 0 0 2px rgba(228, 155, 47, 0.15); }

/* 电梯分布示意卡（街道级聚合，非精确位置） */
.elev-map { height: 300px; border-radius: 8px; overflow: hidden; background: #eef2f6; }
.elev-map .leaflet-container { font: inherit; }
.elev-map__note { font-size: 11.5px; color: var(--warn); line-height: 1.5; margin-bottom: 8px; }
.elev-map__fallback { padding: 18px; display: grid; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.elev-map__list { margin-top: 10px; }
.elev-map__rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 14px; }
.elev-map__row { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.elev-map__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elev-map__count { font-variant-numeric: tabular-nums; color: var(--text-1); }
.elev-map__online { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11.5px; }
.elev-map__meta { margin-top: 8px; font-size: 11.5px; color: var(--text-2); }
.elev-map[data-tiles="fail"] {
  background: repeating-linear-gradient(45deg, #eef2f6, #eef2f6 10px, #e7edf4 10px, #e7edf4 20px);
}
.leaflet-tooltip.elev-map__tip {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text);
  box-shadow: none;
}
.leaflet-tooltip.elev-map__tip::before { display: none; }

/* 哨兵-1 设备控制台 */
.sentinel-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sentinel-ch { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; }
.sentinel-ch.is-alarm { border-color: #f0b4b4; background: #fff7f7; }
.sentinel-ch__head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sentinel-ch__name { font-size: 12px; color: #5b6776; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sentinel-ch__value { font-size: 20px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.sentinel-ch__meta { font-size: 11px; color: #8a97a8; margin-top: 4px; }
.sentinel-wave { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.code-block { background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-family: var(--mono); font-size: 11.5px; margin: 10px 0 0; }
@media (max-width: 1200px) { .sentinel-channels { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }


/* 登录入口切换：监管平台 / 运维平台（轻量链接式，避免与登录方式页签重复） */
.login__portals { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.login__portal-label { color: #8a97a8; font-size: 11.5px; }
.login__portal { height: auto; padding: 0; border: 0; border-radius: 0; background: none; color: #64748b; font-size: 12.5px; cursor: pointer; }
.login__portal:hover { color: #1f2937; }
.login__portal--active { color: #2f6bff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
