:root {
  color-scheme: light;
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --soft: #eef0f6;
  --line: #e7e9f0;
  --line-strong: #d8dbe6;
  --text: #151824;
  --text-2: #454c60;
  --muted: #7c8397;
  --accent: #0f766e;
  --accent-dark: #0b5d57;
  --accent-soft: #e6f4f1;
  --ok: #2f9e44;
  --ok-soft: #ebf7ee;
  --warn: #e8590c;
  --warn-soft: #fff1e6;
  --danger: #d6336c;
  --danger-soft: #ffeef4;
  --danger-line: #f2d7d7;
  --warn-line: #f2d8a8;
  --warn-strong: #8a5a00;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --chart-bar-1: #cfe9e4;
  --login-glow-1: #dff3ef;
  --login-glow-2: #fdf3e3;
  --tag-ok-text: #0b5d57;
  --tag-warn-text: #c05621;
  --tag-info-text: #1c5fa8;
  --tag-info-bg: #e7f0fb;
  --tag-danger-text: #d6336c;
  --sunken: #f7f8fc;
  --shadow: 0 1px 2px rgba(21, 24, 36, 0.04), 0 8px 24px -12px rgba(21, 24, 36, 0.12);
  --radius: 14px;
}

/* -------- Win11 风格深色主题（参照 Windows 11 深色模式） -------- */
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #202020;
  --surface: #2b2b2b;
  --surface-2: #323232;
  --soft: #383838;
  --line: #3d3d3d;
  --line-strong: #4d4d4d;
  --text: #ffffff;
  --text-2: #d6d6d6;
  --muted: #b4b4b4;
  --accent: #14b8a6;
  --accent-dark: #0d9488;
  --accent-soft: rgba(20, 184, 166, 0.16);
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.14);
  --warn: #ffa94d;
  --warn-soft: rgba(255, 169, 77, 0.14);
  --danger: #f06595;
  --danger-soft: rgba(240, 101, 149, 0.14);
  --danger-line: rgba(240, 101, 149, 0.34);
  --warn-line: rgba(255, 169, 77, 0.34);
  --warn-strong: #ffc078;
  --topbar-bg: rgba(32, 32, 32, 0.86);
  --chart-bar-1: #2f6b64;
  --login-glow-1: rgba(20, 184, 166, 0.14);
  --login-glow-2: rgba(245, 158, 11, 0.08);
  --tag-ok-text: #5eead4;
  --tag-warn-text: #ffc078;
  --tag-info-text: #8fc3f5;
  --tag-info-bg: rgba(90, 160, 240, 0.16);
  --tag-danger-text: #ffa8c4;
  --sunken: #262626;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ------------------------------- 登录页 ------------------------------- */

#login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(900px 500px at 15% 0%, var(--login-glow-1) 0%, transparent 60%),
    radial-gradient(700px 500px at 100% 100%, var(--login-glow-2) 0%, transparent 55%), var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 34px 30px;
  box-shadow: 0 24px 60px -30px rgba(21, 24, 36, 0.3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #14a08f, #0b5d57);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.5px;
  box-shadow: 0 6px 16px -6px rgba(15, 118, 110, 0.55);
}

.brand-name {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

.login-title {
  font-size: 22px;
  font-weight: 650;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.login-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}

.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 550;
  margin-bottom: 6px;
}

.input,
.select,
textarea.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.input {
  height: auto;
  padding: 9px 12px;
  resize: vertical;
  min-height: 64px;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237c8397' d='M6 8.5 1.8 4.3l.9-.9L6 6.7l3.3-3.3.9.9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
  border-color: #c9cddb;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-block {
  width: 100%;
  height: 42px;
  margin-top: 8px;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--soft);
  border-color: transparent;
  color: var(--text);
}

.btn-danger {
  color: var(--danger);
  border-color: #f2d5e0;
  background: var(--danger-soft);
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: #eeb0c6;
}

.alert {
  background: var(--danger-soft);
  border: 1px solid #ffd8d8;
  color: #c92a2a;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.login-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.login-hint code {
  background: var(--soft);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--text-2);
  font-size: 11.5px;
}

/* ------------------------------- 布局 ------------------------------- */

#app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  padding: 20px 18px 18px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.nav {
  padding: 12px 10px;
  overflow-y: auto;
  flex: 1;
}

.nav-group-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.6px;
  padding: 12px 10px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background 0.14s, color 0.14s;
  user-select: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  opacity: 0.85;
}

.nav-item:hover {
  background: var(--soft);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-color: #cfe9e4;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 13px;
  flex: 0 0 32px;
}

.who {
  flex: 1;
  min-width: 0;
}

.who-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.who-role {
  font-size: 11.5px;
  color: var(--muted);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 66px;
  padding: 10px clamp(12px, 1.9vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar > div:first-child,
.topbar > .topbar-title {
  min-width: 0;
}
.topbar-title {
  flex: 1 1 auto;
}

/* 手机端汉堡按钮与抽屉遮罩：桌面端不占位 */
.nav-toggle,
.nav-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.nav-toggle:active,
.nav-close:active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 深浅色主题切换按钮：桌面与手机顶栏均显示 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}
.theme-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 55;
}
.nav-mask.show {
  opacity: 1;
  pointer-events: auto;
}
#topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.2px;
  margin: 0;
}

.page-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
}

.content {
  padding: clamp(14px, 1.6vw, 28px) clamp(12px, 1.9vw, 32px) 48px;
  max-width: min(1560px, 100%);
  width: 100%;
  margin-inline: auto;
}

/* ------------------------------- 卡片 ------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 650;
  margin: 0;
}

.card-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}

.card-body {
  padding: 18px;
}

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.6px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}

.stat-foot {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.stat-accent {
  position: absolute;
  right: -26px;
  top: -26px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.7;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* ------------------------------- 表格 ------------------------------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 窄屏表格可横向滑动提示（由 app.js 在表格确实超宽时插入） */
.scroll-hint {
  display: none;
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 2px 6px;
  letter-spacing: 0.2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.2px;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--soft);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-2);
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

th.num {
  text-align: right;
}

.cell-main {
  font-weight: 550;
}

.cell-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--soft);
  color: var(--text-2);
  white-space: nowrap;
}

.tag-in {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag-out {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag-danger {
  background: var(--danger-soft);
  color: var(--tag-danger-text);
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  height: 38px;
  width: 230px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%237c8397' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")
    no-repeat 11px center;
}

.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* 拍照 / 选择文件按钮行（上传区内部） */
.upload-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.upload-actions .btn,
.voucher-zone .upload-actions .btn {
  background: var(--surface);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--soft);
  border-radius: 9px;
  gap: 2px;
}

.segmented button {
  height: 30px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 550;
}

.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(21, 24, 36, 0.12);
}

/* ------------------------------- 图表 ------------------------------- */

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 62px;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 12.8px;
}

.bar-track {
  height: 7px;
  background: var(--soft);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4fb3a4, #0f766e);
}

.bar-label {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-val {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- 表单页 ------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.amount-preview {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.amount-preview b {
  font-size: 16px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- 弹窗 ------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 35, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.14s ease;
}

.modal {
  width: 100%;
  min-width: 0;
  max-width: 480px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 32px 80px -24px rgba(21, 24, 36, 0.45);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: pop 0.16s ease;
}

.modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15.5px;
  font-weight: 650;
  margin: 0;
}

.modal-body {
  padding: 18px 20px 8px;
  overflow-y: auto;
}

.modal-foot {
  padding: 14px 20px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

/* ------------------------------- 提示条 ------------------------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(12px);
  background: #1c2030;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#toast.error {
  background: #b02a37;
}

#toast.warn {
  background: #b45309;
}

/* ------------------------------- 响应式 ------------------------------- */

@media (max-width: 1080px) {
  .grid-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 平板（iPad 横竖屏 768–1024、安卓平板 800–1280）：侧栏收成图标栏，宽度让给内容；
   这一层同时接管原先 960px 的规则，避免 960–1024 之间出现「侧栏占 232px、内容只剩 790px」的夹缝 */
@media (max-width: 1024px) {
  .sidebar {
    width: 64px;
    flex: 0 0 64px;
  }
  .sidebar .brand {
    justify-content: center;
    padding: 16px 8px;
  }
  .brand-text {
    display: none;
  }
  .nav-item span,
  .nav-group-label,
  .who {
    display: none;
  }
  .nav-item {
    justify-content: center;
  }
  .sidebar-foot {
    justify-content: center;
  }
  .stat-value {
    font-size: 21px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .table-wrap table {
    min-width: 620px;
  }
  /* 平板上表格用指头点，行高比桌面松一点更好按 */
  th,
  td {
    padding: 11px 12px;
  }
  .table-wrap table {
    font-size: 13px;
  }
  .card-head {
    flex-wrap: wrap;
  }
  .card-head > .row-actions {
    flex-wrap: wrap;
  }
  .rpt-scroll .rpt-table {
    min-width: 620px;
  }

  /* 平板上表格一定会横向滑动，滚动提示要显形（原先只在手机显示，平板看不到提示） */
  .scroll-hint {
    display: block;
  }
  /* 弹窗给足宽度，平板填表单不必迁就手机尺寸 */
  .modal {
    max-width: 560px;
  }
  .content {
    padding: 18px 16px 40px;
  }
  .topbar {
    padding: 9px 16px;
  }
}

/* 平板竖屏及更窄：主次分区不再并排 */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 平板 / 小屏：单列堆叠与可滚动表格 */
@media (max-width: 720px) {
  .card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .card-head > .row-actions {
    justify-content: flex-start;
    width: 100%;
  }
  /* 纵向堆叠时，卡片头子元素的内联 flex:1 1 300px 会变成 300px 高度，需复位 */
  .card-head > * {
    flex: 0 0 auto !important;
    width: 100%;
    min-width: 0;
  }
  .card-head .toolbar {
    flex-wrap: wrap;
  }
  .card-head .toolbar > * {
    flex: 1 1 120px;
    width: auto !important;
  }
  .table-wrap table {
    min-width: 560px;
    font-size: 12.6px;
  }
  #tbl-staff {
    min-width: 760px;
  }
  th,
  td {
    padding: 9px 10px;
  }
  .overlay {
    padding: 12px;
  }
  .modal {
    max-height: 92vh;
  }
  .modal-body {
    padding: 14px 14px 6px;
  }
  .modal-head,
  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
  .rpt-filter-hint {
    display: none;
  }
  .rpt-filter-modal .rpt-ctl {
    flex: 1 1 40%;
  }
}

/* 手机：顶部横向导航 + 全屏弹窗 */
@media (max-width: 640px) {
  #app {
    flex-direction: column;
  }

  /* 侧边栏改为抽屉：默认收起，点汉堡展开；只渲染当前账号有权限的模块 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 302px);
    flex: 0 0 auto;
    height: 100%;
    flex-direction: column;
    align-items: stretch;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-103%);
    transition: transform 0.22s ease;
    z-index: 60;
    box-shadow: none;
    overflow: hidden;
  }
  .sidebar.open {
    transform: none;
    box-shadow: 0 24px 60px -18px rgba(15, 23, 42, 0.42);
  }
  .sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    border-right: none;
    justify-content: flex-start;
  }
  .sidebar .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 9px;
  }
  .sidebar .brand-text {
    display: block;
    flex: 1;
    min-width: 0;
  }
  .nav-close {
    display: inline-flex;
  }
  .nav {
    display: block;
    padding: 8px 10px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
  }
  .nav-group {
    display: block;
  }
  .nav-group-label {
    display: block;
    padding: 12px 10px 6px;
  }
  .nav-item {
    height: 44px;
    padding: 0 12px;
    white-space: nowrap;
    justify-content: flex-start;
    gap: 10px;
  }
  .nav-item span {
    display: inline;
    font-size: 14.5px;
  }
  .sidebar-foot {
    display: flex;
  }
  .who {
    display: block;
  }

  /* 抽屉遮罩 */
  .nav-mask {
    display: block;
  }
  body.nav-open {
    overflow: hidden;
  }

  .main {
    width: 100%;
  }
  .topbar {
    position: sticky;
    top: 0;
    padding: 9px 12px;
    gap: 8px 10px;
    align-items: center;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .topbar-title {
    flex: 1 1 120px;
  }
  .page-title {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-sub {
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #topbar-actions {
    flex: 0 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    justify-content: flex-end;
    padding-bottom: 1px;
    order: 3;
  }
  /* 手机端顶栏顺序：☰ → 标题 → 主题按钮 → 工具区，避免空工具区把主题按钮挤到第三行 */
  .topbar-title {
    order: 1;
  }
  .theme-toggle {
    order: 2;
    margin-left: auto;
  }
  #topbar-actions:empty {
    display: none;
  }
  #topbar-actions .btn {
    flex: 0 0 auto;
  }
  .content {
    padding: 12px 12px 40px;
  }
  .overlay {
    padding: 0;
  }
  .modal {
    max-width: none !important;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .modal-foot {
    padding-bottom: 14px;
  }
  .toolbar {
    width: 100%;
  }
  .search {
    width: 100%;
    min-width: 0;
  }
  .strip {
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  }
  .btn {
    padding: 0 12px;
  }
  .row-actions {
    flex-wrap: wrap;
  }
  .scroll-hint {
    display: block;
  }

  /* 卡片内的筛选控件（分段页签 / 搜索框）窄屏不再把卡片撑出屏幕，改为自身横向滑动 */
  .content > *,
  .card,
  .card-head,
  .toolbar {
    min-width: 0;
  }
  .card-head .toolbar {
    flex-wrap: wrap;
  }
  .segmented {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .segmented::-webkit-scrollbar {
    display: none;
  }
  .segmented button {
    flex: 0 0 auto;
  }
  /* 搜索框独占一行：与分段页签挤在同一行时会被压到只剩一百多像素，输入内容看不见 */
  .card-head .toolbar > .search {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  .strip {
    grid-template-columns: minmax(0, 1fr);
  }
  .rpt-card .rpt-ctl,
  .rpt-filter-modal .rpt-ctl {
    flex: 1 1 100%;
    max-width: none;
  }
  .rpt-card .rpt-filter-ico,
  .rpt-filter-modal .rpt-filter-ico {
    flex: 0 0 100%;
  }
  .login-card {
    padding: 26px 20px 22px;
    border-radius: 16px;
  }
  .bar-row {
    grid-template-columns: 74px minmax(0, 1fr) 56px;
    gap: 8px;
    font-size: 12px;
  }
  .scope-choices,
  .redeem-grid,
  .detail-list,
  .two-col {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .segmented {
    width: 100%;
    overflow-x: auto;
  }
  .segmented button {
    flex: 0 0 auto;
  }
}

/* ============================ 物业管理扩展组件 ============================ */

.tag-rented {
  background: var(--accent-soft);
  color: var(--tag-ok-text);
}
.tag-vacant {
  background: var(--warn-soft);
  color: var(--tag-warn-text);
}
.tag-maint {
  background: var(--tag-info-bg);
  color: var(--tag-info-text);
}
.tag-grey {
  background: var(--soft);
  color: var(--muted);
}

/* 顶部统计条
   分隔线由格自己用 inset 阴影画，容器只做裁剪与描边。
   若沿用「gap:1px + 容器底色」的老写法，格子数除不尽列数时最后一行空位会透出灰块
   （平板/窄屏尤其明显），改成全部同底色后空位与格子同色，看不出缺口。 */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(168px, 100%), 1fr));
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.strip-cell {
  padding: clamp(12px, 1.2vw, 16px) clamp(12px, 1.4vw, 18px);
  background: var(--surface);
  min-width: 0;
  box-shadow: inset -1px 0 0 var(--line), inset 0 -1px 0 var(--line);
}
.strip-label {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-value {
  font-size: clamp(17px, 1.35vw, 21px);
  font-weight: 680;
  letter-spacing: -0.4px;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.strip-value small {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

/* 出租率进度 */
.progress {
  height: 6px;
  border-radius: 4px;
  background: var(--soft);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4fb3a4, #0f766e);
}
.progress.warn > i {
  background: linear-gradient(90deg, #ffc078, #e8590c);
}

.legend-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 10px;
}
.legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-row i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

/* 列表条目 */
.list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--soft);
}
.list-item:last-child {
  border-bottom: none;
}
.list-main {
  flex: 1;
  min-width: 0;
}
.list-title {
  font-size: 13.2px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}
.list-side {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}

/* 工单看板 */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kanban-col {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  min-height: 180px;
}
.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
}
.kanban-count {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  padding: 0 6px;
}
.wo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(21, 24, 36, 0.04);
  cursor: pointer;
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.14s;
}
.wo-card:hover {
  border-color: #b9d9d3;
  box-shadow: 0 6px 16px -10px rgba(15, 118, 110, 0.5);
  transform: translateY(-1px);
}
.wo-title {
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 5px;
  line-height: 1.45;
}
.wo-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* 详情列表（弹窗内） */
.detail-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}
.detail-row {
  display: flex;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid #f2f3f8;
  font-size: 13px;
}
.detail-row:last-child {
  border-bottom: none;
}
.detail-row > span:first-child {
  width: 92px;
  flex: 0 0 92px;
  color: var(--muted);
}
.detail-row > span:last-child {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

/* 收款输入 */
.pay-box {
  display: flex;
  gap: 10px;
}
.pay-box .input {
  flex: 1;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.stack-8 > * + * {
  margin-top: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 16px;
}

/* 看板的 2 列切换已在 ≤1024 的平板层统一处理，此处不再重复定义 */
@media (max-width: 720px) {
  .kanban {
    grid-template-columns: minmax(0, 1fr);
  }
  /* 手机端统计条固定两列，最后一张占满整行避免留白 */
  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .strip > .strip-cell:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* ============================ 公摊分摊过程 ============================ */
.alloc-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.alloc-block:last-child {
  margin-bottom: 0;
}
.alloc-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.alloc-title {
  font-size: 13.5px;
  font-weight: 650;
}
.alloc-eq {
  font-size: 12.5px;
  color: var(--tag-ok-text);
  background: var(--accent-soft);
  border: 1px solid #cfe9e4;
  border-radius: 8px;
  padding: 5px 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}
.alloc-block table {
  font-size: 12.8px;
}
.alloc-block td,
.alloc-block th {
  padding: 8px 14px;
}
.alloc-block details summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 550;
  list-style: none;
  user-select: none;
}
.alloc-block details summary::-webkit-details-marker {
  display: none;
}
.alloc-block details summary::before {
  content: '▸ ';
}
.alloc-block details[open] summary::before {
  content: '▾ ';
}
.alloc-block details[open] summary {
  border-bottom: 1px solid var(--soft);
}

/* ---------------- 审批轨迹 ---------------- */
.tl {
  list-style: none;
  margin: 0;
  padding: 0 2px;
  position: relative;
}
.tl-item {
  display: flex;
  gap: 12px;
  padding: 0 0 14px;
  position: relative;
}
.tl-item:last-child {
  padding-bottom: 0;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: #e8eaf2;
}
.tl-item:last-child::before {
  display: none;
}
.tl-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  margin-top: 3px;
  flex: none;
  z-index: 1;
}
.tl-body {
  flex: 1;
  min-width: 0;
}
.tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}

/* ---------------- 材料上传 ---------------- */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 16px;
  border: 1.5px dashed #cfd5e6;
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
  text-align: center;
}
.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.upload-zone.busy {
  opacity: 0.65;
  pointer-events: none;
}
.upload-ico svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  stroke-width: 1.7;
}
.upload-title {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
}
.upload-hint {
  font-size: 12px;
  color: var(--muted);
}
.attach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.attach-item:hover {
  background: var(--surface-2);
}
.attach-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--soft);
}
.attach-ico svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  stroke-width: 1.6;
}
.attach-ico.pdf {
  background: var(--danger-soft);
}
.attach-ico.pdf svg {
  stroke: #d6336c;
}
.attach-ico.image {
  background: #e8f4f1;
}
.attach-ico.image svg {
  stroke: #0f766e;
}
.attach-main {
  flex: 1;
  min-width: 0;
}
.attach-name {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-meta {
  font-size: 11.8px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------------- 楼栋卡片 ---------------- */
.bld-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 14px;
}
.bld-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 14px;
  box-shadow: 0 1px 2px rgba(20, 28, 50, 0.04);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.bld-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 14px rgba(20, 28, 50, 0.07);
}
.bld-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.bld-name {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.bld-meta {
  font-size: 11.8px;
  color: var(--muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bld-floors {
  font-size: 20px;
  font-weight: 650;
  color: var(--accent);
  line-height: 1;
  flex: none;
  padding-top: 2px;
}
.bld-floors small {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.bld-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.bld-stats div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 4px 7px;
  text-align: center;
}
.bld-stats b {
  display: block;
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.25;
}
.bld-stats span {
  font-size: 11px;
  color: var(--muted);
}
.bld-stats div.is-ok b {
  color: var(--ok);
}
.bld-stats div.is-warn b {
  color: var(--warn);
}
.bld-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.4px;
  color: var(--muted);
  padding: 4px 0;
}
.bld-line > span:first-child {
  color: var(--muted);
  flex: none;
}
.bld-line > span:last-child {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 一键导入 ---------------- */
.imp-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.imp-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.imp-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-top: 1px;
}
.imp-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.imp-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.6;
}
.imp-zone {
  padding: 16px 14px;
  margin-bottom: 0;
}
.imp-zone .upload-ico svg {
  width: 20px;
  height: 20px;
}
.imp-paste {
  min-height: 66px;
  font-size: 12.4px;
  resize: vertical;
}
.imp-update {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.4px;
  color: var(--muted);
  cursor: pointer;
}
.imp-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}
.imp-errs {
  margin: 8px 0 0;
  padding: 10px 12px 10px 26px;
  background: var(--danger-soft);
  border: 1px solid #fbdce5;
  border-radius: 9px;
  font-size: 12.2px;
  color: var(--danger);
  line-height: 1.8;
}
.imp-table {
  font-size: 12.2px;
}
.imp-table th,
.imp-table td {
  padding: 7px 10px;
  white-space: nowrap;
}

/* ---------------- 报表预览 / 打印 ---------------- */
.rpt-card {
  padding: 15px 17px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.rpt-card-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}
.rpt-card-desc {
  font-size: 11.9px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 4px;
}
.rpt-doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.rpt-doc-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 4px;
}
.rpt-scroll {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.2px;
}
.rpt-table th,
.rpt-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--soft);
  white-space: nowrap;
  text-align: left;
  vertical-align: top;
}
.rpt-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--accent-soft);
  font-weight: 650;
  color: var(--text);
  border-bottom: 1px solid #dfe6e3;
}
.rpt-table td.num,
.rpt-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rpt-table tr:hover td {
  background: var(--surface-2);
}
.rpt-table .rpt-sec td {
  background: var(--soft);
  font-weight: 650;
  color: var(--text-2);
}
.rpt-table .rpt-head th {
  position: static;
  background: var(--surface-2);
  font-weight: 600;
}
.rpt-table .rpt-note td {
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 12px;
}

/* ------------------------- 商户停车减免码 ------------------------- */

.pass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(318px, 100%), 1fr));
  gap: 14px;
}

.pass-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}
.pass-card:hover {
  border-color: #bfdcd6;
  box-shadow: 0 10px 26px -18px rgba(11, 93, 87, 0.55);
}
.pass-card.is-paused {
  opacity: 0.62;
  background: var(--soft);
}

.pass-qr {
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px;
  background: var(--surface);
}
.pass-qr img {
  width: 100%;
  height: 100%;
  display: block;
}

.pass-body {
  flex: 1;
  min-width: 0;
}
.pass-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pass-name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pass-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.pass-sub code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.6px;
  color: var(--text-2);
}
.pass-rule {
  margin-top: 7px;
  font-size: 11.8px;
  color: var(--tag-ok-text);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 3px 7px;
  display: inline-block;
}
.pass-usage {
  margin-top: 9px;
}
.pass-usage-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 5px;
}
.pass-amt {
  color: var(--accent-dark);
  font-weight: 600;
}
.pass-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 核销弹窗 */
.redeem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.redeem-grid .field:first-child {
  grid-column: 1 / -1;
}
.redeem-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px 14px;
}
.redeem-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.8px;
  padding: 5px 0;
  color: var(--text-2);
}
.redeem-line b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.redeem-hl b {
  color: var(--accent-dark);
}
.redeem-pay {
  margin-top: 4px;
  padding-top: 9px;
  border-top: 1px dashed var(--line-strong);
  font-size: 14px;
}
.redeem-pay b {
  font-size: 19px;
  color: var(--danger);
}
.redeem-warn {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 6px;
  padding: 5px 8px;
}

/* 商户端减免码 */
.pass-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, #0b5d57, #12857c);
  border-radius: 18px;
  padding: 22px 24px;
  color: #fff;
  box-shadow: 0 18px 40px -26px rgba(11, 93, 87, 0.85);
}
.pass-hero-qr {
  flex: 0 0 168px;
  width: 168px;
  height: 168px;
  background: var(--surface);
  border-radius: 12px;
  padding: 8px;
}
.pass-hero-qr img {
  width: 100%;
  height: 100%;
  display: block;
}
.pass-hero-info {
  flex: 1;
  min-width: 0;
}
.pass-hero-name {
  font-size: 20px;
  font-weight: 650;
  display: flex;
  align-items: center;
}
.pass-hero-sub {
  margin-top: 4px;
  font-size: 12.5px;
  opacity: 0.78;
}
.pass-hero-rules {
  display: flex;
  gap: 26px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pass-hero-rules span {
  display: block;
  font-size: 11.5px;
  opacity: 0.75;
}
.pass-hero-rules b {
  font-size: 15px;
  font-weight: 650;
}
.pass-hero-rules b.big {
  font-size: 20px;
  color: #ffe08a;
}
.pass-hero-usage {
  margin-top: 16px;
  max-width: 460px;
}
.pass-hero-usage .pass-usage-top {
  color: rgba(255, 255, 255, 0.86);
}
.pass-hero-usage .progress {
  background: rgba(255, 255, 255, 0.24);
}
.pass-hero-usage .progress i {
  background: #ffe08a;
}
.pass-hero-left {
  margin-top: 7px;
  font-size: 11.5px;
  opacity: 0.78;
}
.pass-hero .tag-rented {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@media (max-width: 720px) {
  .pass-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .redeem-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------- 公共表计抄表 ------------------------- */

.pub-read-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pub-read-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--surface-2);
}
.pub-read-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pub-read-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.pub-read-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}
.pub-read-input .input {
  flex: 0 0 150px;
  font-variant-numeric: tabular-nums;
}
.pub-read-hint {
  font-size: 12px;
  color: var(--muted);
}
.pub-read-hint.pub-ok {
  color: var(--accent-dark);
  font-weight: 600;
}
.pub-read-hint.pub-bad {
  color: var(--danger);
  font-weight: 600;
}

/* ------------------------- 分摊基数展示 ------------------------- */

.alloc-title .alloc-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  vertical-align: 2px;
}

.alloc-base {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}
.alloc-base b {
  color: var(--text-2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.alloc-base span:first-child b {
  color: var(--accent-dark);
}

/* ------------------------- 公共表计按楼栋分组 ------------------------- */

.pub-group td {
  background: var(--soft);
  border-top: 1px solid var(--line);
  padding: 9px 12px;
}
.pub-group:hover td {
  background: var(--soft);
}
.pub-group-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pub-group-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--accent-dark);
  letter-spacing: 0.3px;
}
.pub-group-meta {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------- 费用单：用户能耗 / 公共能耗分列 ------------------------- */

.split-note {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.split-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.split-chip.self {
  background: var(--soft);
  color: var(--text-2);
}
.split-chip.pub {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.split-mini,
.split-sum-bar {
  position: relative;
  display: flex;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--soft);
}
.split-mini {
  width: 132px;
  margin-top: 5px;
}
.split-mini i,
.split-sum-bar i {
  display: block;
  height: 100%;
  background: #b9c0d4;
}
.split-mini em,
.split-sum-bar em {
  display: block;
  height: 100%;
  background: var(--accent);
}

.split-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.split-sum-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
}
.split-sum-item b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.split-sum-item.pub b {
  color: var(--accent-dark);
}
.split-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: #b9c0d4;
}
.split-sum-item.pub .split-dot {
  background: var(--accent);
}
.split-sum-hint {
  font-size: 12px;
  color: var(--muted);
}
.split-sum-bar {
  width: 150px;
  height: 5px;
}

.split-flag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--warn-soft);
  color: var(--warn);
}
.split-warn {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--warn);
}

/* ------------------------- 公共表计台账（独立目录） ------------------------- */

.pub-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
  gap: 12px;
}
.pub-mini {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.pub-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pub-mini-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.pub-mini-amt {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
.pub-mini-meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.flow-note {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid #d5ece8;
  font-size: 12.5px;
  color: var(--text-2);
}
.flow-note b {
  color: var(--accent-dark);
}

/* ------------------------- 表计计量铺位 ------------------------- */

.scope-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.scope-choice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface-2);
}
.scope-choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.scope-choice input {
  margin-top: 3px;
}
.scope-choice b {
  display: block;
  font-size: 13px;
}
.scope-choice i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.scope-note {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}
.unit-picker {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
}
.unit-picker-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.unit-picker-head [data-unit-hint] {
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
}
.unit-picker-list {
  max-height: 230px;
  overflow: auto;
  display: grid;
  gap: 10px;
}
.unit-group-name {
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-dark);
  margin-bottom: 4px;
}
.unit-group-name span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}
.unit-group-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(118px, 100%), 1fr));
  gap: 6px;
}
.unit-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
.unit-item input {
  margin: 0;
}
.unit-item-code {
  font-family: ui-monospace, monospace;
}
.unit-item-area {
  color: var(--muted);
  font-size: 11px;
}
.unit-item-tag {
  font-size: 10px;
  color: var(--tag-warn-text);
  background: var(--warn-soft);
  border-radius: 4px;
  padding: 0 3px;
}
.unit-item.is-vacant {
  opacity: 0.8;
}
.unit-item.is-disabled {
  display: none;
}

/* ------------------------- 分摊：指定铺位表计直摊 ------------------------- */

.alloc-eq-direct {
  margin-top: 6px;
  color: var(--warn);
  font-size: 12px;
}
.alloc-direct {
  border-top: 1px dashed var(--line-strong);
  margin-top: 2px;
  padding: 12px 14px 4px;
}
.alloc-direct-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.alloc-direct-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent-dark);
}
.alloc-direct-desc {
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------- 收款凭证上传 / 预览 ------------------------- */

.voucher-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 16px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.voucher-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.voucher-zone.busy {
  opacity: 0.65;
  pointer-events: none;
}
.voucher-plus {
  font-size: 20px;
  color: var(--accent);
  line-height: 1;
}
.voucher-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.voucher-hint {
  font-size: 11px;
  color: var(--muted);
}
.voucher-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.voucher-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.voucher-chip img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  cursor: zoom-in;
  border: 1px solid var(--line);
}
.voucher-chip-ico {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--soft);
  color: var(--text-2);
  cursor: pointer;
}
.voucher-chip-ico svg,
.voucher-tile-ico svg {
  width: 20px;
  height: 20px;
}
.voucher-chip-main {
  flex: 1;
  min-width: 0;
}
.voucher-chip-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.voucher-chip-name:hover {
  color: var(--accent);
}
.voucher-chip-meta {
  font-size: 11px;
  color: var(--muted);
}

.voucher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 12px;
}
.voucher-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
}
.voucher-tile:hover {
  border-color: var(--accent);
}
.voucher-tile img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  background: var(--soft);
}
.voucher-tile-ico {
  height: 130px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--text-2);
}
.voucher-tile-name {
  padding: 6px 8px 0;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voucher-tile-meta {
  padding: 0 8px 8px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------------- 报表筛选 ---------------- */
.rpt-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
}
.rpt-filter-ico {
  font-size: 11px;
  font-weight: 650;
  color: var(--accent);
  letter-spacing: 0.5px;
  padding: 0 2px 0 1px;
  white-space: nowrap;
}
.rpt-ctl {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  max-width: 132px;
}
select.rpt-ctl {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%237c8397' d='M6 8.5 1.8 4.3l.9-.9L6 6.7l3.3-3.3.9.9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
}
.rpt-ctl:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.rpt-ctl-kw {
  flex: 1 1 130px;
  min-width: 110px;
  max-width: 220px;
}
.rpt-reset {
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.rpt-reset:hover {
  color: var(--danger);
  border-color: #f2d6de;
  background: var(--danger-soft);
}
.rpt-filter-modal {
  background: var(--surface-2);
  border-style: solid;
  border-color: #d5e8e4;
  margin-bottom: 12px;
  padding: 9px 11px;
}
.rpt-filter-modal .rpt-ctl-kw {
  max-width: 260px;
}
.rpt-filter-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.rpt-empty {
  padding: 46px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
.rpt-card .row-actions {
  margin: 0;
}
.rpt-card .rpt-filter {
  gap: 6px 5px;
}
.rpt-card .rpt-ctl {
  flex: 1 1 42%;
  min-width: 0;
  max-width: none;
}
.rpt-card .rpt-ctl-kw {
  flex: 1 1 100%;
  max-width: none;
}
.rpt-card .rpt-filter-ico {
  flex: 0 0 100%;
  margin-bottom: -2px;
}
.rpt-card .rpt-reset {
  margin-left: auto;
}

/* ------------------------------ 分级权限（RBAC） ------------------------------ */

.lv-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--lv, #8a94ab);
  white-space: nowrap;
}
.lv-badge i {
  font-style: normal;
  font-weight: 500;
  opacity: 0.95;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(248px, 100%), 1fr));
  gap: 12px;
}
.role-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}
.role-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.role-card.locked {
  background: var(--surface-2);
}
.role-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.role-card-name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
}
.role-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  min-height: 19px;
}
.role-card-perm {
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  line-height: 1.55;
  word-break: break-word;
}
.role-card.locked .role-card-perm {
  background: var(--bg);
}
.role-card-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.role-card-meta .dot {
  opacity: 0.6;
}
.role-card .row-actions {
  margin-top: 4px;
  justify-content: flex-start;
}

.perm-matrix {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.perm-hint {
  font-size: 12px;
  color: var(--text-2);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.6;
}
.perm-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(268px, 100%), 1fr));
  gap: 10px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 2px;
}
.perm-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
}
.perm-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.perm-group-head b {
  font-weight: 650;
}
.perm-group-head span {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.perm-items {
  display: flex;
  flex-direction: column;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--soft);
}
.perm-item:last-child {
  border-bottom: 0;
}
.perm-item:hover {
  background: var(--surface-2);
}
.perm-item input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
}
.perm-item .perm-name {
  flex: 1 1 auto;
  min-width: 0;
}
.perm-item .perm-key {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.perm-item.off {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface-2);
}
.perm-item.off .perm-key {
  color: #bcc2cf;
}
.perm-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.perm-total {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .perm-groups {
    grid-template-columns: 1fr;
    max-height: 52vh;
  }
  .role-grid {
    grid-template-columns: 1fr;
  }
  .perm-item .perm-key {
    display: none;
  }
}

/* ------------------------------ 停车系统接入 ------------------------------ */

.int-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 12px;
}
.int-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.int-card.is-manual {
  background: var(--surface-2);
}
.int-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.int-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.4;
}
.int-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  word-break: break-word;
}
.int-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(64px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.int-metrics > div {
  background: var(--surface);
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.int-metrics b {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.int-metrics span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.int-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.int-logs {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.int-logs > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 600;
  padding: 4px 0;
  list-style: none;
}
.int-logs > summary::-webkit-details-marker {
  display: none;
}
.int-logs > summary::before {
  content: '▸ ';
  color: var(--muted);
}
.int-logs[open] > summary::before {
  content: '▾ ';
}
.int-logs .table-wrap {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.int-empty {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.lot-secret {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lot-secret-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  flex-wrap: wrap;
}
.lot-secret-row > span {
  color: var(--muted);
  flex: 0 0 76px;
}
.lot-secret-row code,
.lot-secret-tip code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
  word-break: break-all;
  color: var(--text);
}
.lot-secret-tip {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.75;
}
.lot-secret .btn {
  align-self: flex-start;
}

/* 远程抄表接入 */
.int-sub-title {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.code-block {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow: auto;
  color: var(--text);
}

/* 临时停车收费 */
.charge-sum {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
}
.charge-cell {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.charge-label {
  font-size: 12px;
  color: var(--muted);
}
.charge-value {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-top: 2px;
  color: var(--text);
}
.charge-value small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 3px;
}
.charge-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.gate-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.gate-strip-label {
  font-size: 12px;
  color: var(--muted);
}
.gate-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--accent-soft);
  border: 1px solid #cfe8e3;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--accent-dark);
}
.gate-chip b {
  font-weight: 600;
}
.gate-chip em {
  font-style: normal;
  color: var(--warn);
}
.charge-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12.5px;
}
.charge-info span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}
.charge-info b {
  color: var(--text);
  font-weight: 600;
}

/* 减免核销自动识别 / 规则试算 */
.redeem-empty {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}
.redeem-empty.is-warn {
  color: var(--warn);
}
.redeem-ok {
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 7px 10px;
}
.rule-preview {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
}
.rule-preview-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.rule-preview-title span {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  margin-left: 6px;
}
.rule-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.rule-preview th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 11.5px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
}
.rule-preview td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.rule-preview tr:last-child td {
  border-bottom: 0;
}
.rule-preview .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 设备管理台账 */
.qr-mini {
  width: 44px;
  height: 44px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.qr-panel {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.qr-big {
  width: 200px;
  height: 200px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.qr-meta {
  min-width: 0;
  flex: 1;
}
.qr-link {
  margin-top: 8px;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
}
.ll-bind {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.65;
  text-align: left;
}
.ll-bind.is-on {
  background: #eef7f1;
  border: 1px solid #cfe8d8;
  color: #2b5e42;
}
.ll-bind.is-off {
  background: var(--warn-soft);
  border: 1px solid #f2dfb6;
  color: #7a5b16;
}
.ll-bind-tag {
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}
.ll-bind-text b {
  font-weight: 600;
}
/* 免密登录弹窗：微信内置浏览器拦截提示 */
.ll-wx {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  border: 1px solid #f2dfb6;
  color: #7a5b16;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.7;
}
.ll-wx-title {
  font-weight: 650;
  margin-bottom: 3px;
}
.ll-wx-text b {
  font-weight: 650;
}
.label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 10px;
}
.label-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  background: var(--surface);
}
.label-card img {
  width: 100%;
  max-width: 130px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.label-code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  color: var(--text-2);
  margin-top: 4px;
}
.label-sub {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logs {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow: auto;
}
.logs li {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.logs li:last-child {
  border-bottom: 0;
}
.logs .lt {
  flex: none;
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 6px;
  padding: 2px 7px;
  height: 20px;
  white-space: nowrap;
}
.logs b {
  font-size: 13px;
  font-weight: 600;
}
.logs .ld {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.logs .lm {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.logs .empty {
  color: var(--muted);
  font-size: 12.5px;
}

/* ============================ 设备巡检（实时影像 + 留证） ============================ */
.insp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 880px) {
  .insp-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.insp-live,
.insp-side {
  min-width: 0;
}
.live-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #050a12;
  line-height: 0;
  box-shadow: 0 12px 28px -20px rgba(4, 12, 22, 0.95);
}
.live-stage img {
  width: 100%;
  display: block;
}
.live-rec {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(3, 9, 17, 0.72);
  color: #fecaca;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.4;
}
.live-rec i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: liveBlink 1.3s infinite;
}
@keyframes liveBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}
.live-ts {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(3, 9, 17, 0.62);
  color: #9fb6c9;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.live-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.insp-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  min-height: 56px;
  overflow-x: auto;
}
.insp-th {
  position: relative;
  flex: none;
  width: 84px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.insp-th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.insp-th i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 9, 17, 0.66);
  color: #e2e8f0;
  font-style: normal;
  font-size: 10px;
  text-align: center;
  line-height: 1.5;
}
.thumb-play {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1626;
  color: #7dd3fc;
  font-size: 16px;
}
.insp-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.insp-dev {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
}
.insp-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.insp-checks {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.chk {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--surface);
}
.chk input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--accent);
}
.chk b {
  font-weight: 500;
  display: block;
}
.chk i {
  font-style: normal;
  font-size: 11px;
  color: var(--ok);
}
.chk input:not(:checked) ~ span b {
  color: var(--danger);
}
.chk input:not(:checked) ~ span i {
  font-size: 0;
}
.chk input:not(:checked) ~ span i::after {
  content: '异常待说明';
  font-size: 11px;
  color: #d6336c;
}
.insp-side .field {
  margin: 0;
}
.insp-side .field span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.insp-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 8px;
}
.insp-cat {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--surface);
}
.insp-cat input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}
.insp-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.media-thumb {
  position: relative;
  width: 56px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-thumb i {
  position: absolute;
  right: 0;
  bottom: 0;
  background: rgba(16, 24, 40, 0.72);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  padding: 0 4px;
  border-radius: 6px 0 0 0;
}
.insp-detail-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.insp-h4 {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  margin: 14px 0 8px;
}
.dl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.dl-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-2);
}
.dl-item span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  color: #fff;
  flex: none;
  margin-top: 1px;
}
.dl-item.ok span {
  background: #2f9e44;
}
.dl-item.bad span {
  background: #d6336c;
}
.dl-item.bad b {
  color: #b02a37;
}
.insp-remark {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 9px 11px;
  border-radius: 8px;
}
.insp-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 10px;
}
.insp-media {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.insp-media img,
.insp-media video {
  width: 100%;
  display: block;
  background: #050a12;
}
.insp-media figcaption {
  font-size: 11px;
  color: var(--muted);
  padding: 5px 8px;
}
.live-cap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
}
.live-cap i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: liveBlink 1.3s infinite;
}
.media-thumb .thumb-n {
  position: absolute;
  right: 3px;
  top: 3px;
  background: rgba(16, 24, 40, 0.82);
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  min-width: 15px;
  text-align: center;
  border-radius: 4px;
  padding: 0 3px;
  font-style: normal;
}

/* ============================ 物业人员管理 ============================ */
.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cert-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11.5px;
  background: var(--surface-2);
  line-height: 1.5;
}
.cert-chip i {
  font-style: normal;
  color: var(--muted);
  font-size: 10.5px;
}
.cert-chip.cert-warn {
  border-color: #f1c2b8;
  background: var(--danger-soft);
}
.cert-chip.cert-warn i {
  color: var(--danger);
}
.staff-detail {
  min-width: 0;
}
.staff-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.staff-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex: none;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 9px 14px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}
.grid4 span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}
.grid4 b {
  font-size: 12.8px;
  font-weight: 600;
  word-break: break-all;
}
.staff-h4 {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  margin: 14px 0 8px;
}
.cert-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.cert-items .cert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12.5px;
  background: var(--surface);
}
.cert-items .cert-item.warn {
  border-color: #f1c2b8;
  background: var(--danger-soft);
}
.cert-items .empty {
  color: var(--muted);
  font-size: 12.5px;
}
.btn-warn {
  color: var(--warn);
  border-color: #ecd3ae;
}
.btn-warn:hover {
  background: var(--warn-soft);
}

/* 人员业务联动（人员详情） */
.wk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.wk-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--surface-2);
}
.wk-cell span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}
.wk-cell b {
  display: block;
  font-size: 19px;
  color: var(--text);
  line-height: 1.3;
}
.wk-cell i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.wk-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
.wk-h {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  margin-bottom: 4px;
}
.wk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.wk-list li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 9px;
  font-size: 11.8px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
}
.wk-list li:first-child {
  border-top: 0;
}
.wk-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wk-list li i {
  font-style: normal;
  color: var(--muted);
  white-space: nowrap;
}
.wk-list li.empty {
  color: var(--muted);
}
@media (max-width: 720px) {
  .wk-grid,
  .wk-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- 手持设备扫码面板 ---------- */
.scan-camera {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #10141c;
  aspect-ratio: 4 / 3;
}
.scan-camera video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 10%;
  height: 2px;
  background: #38e08a;
  box-shadow: 0 0 10px #38e08a;
  animation: scanmove 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scanmove {
  0% { top: 8%; }
  50% { top: 88%; }
  100% { top: 8%; }
}
.scan-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 10px;
  text-align: center;
  font-size: 12px;
  color: #fff;
  background: rgba(10, 14, 22, 0.55);
}

/* ===== 品质巡查：检查项问题登记 + 整改前后影像对比 ===== */
.qc-hint{font-size:12px;color:var(--muted);margin:10px 0 8px;line-height:1.7}
.qc-rows{display:flex;flex-direction:column;gap:8px}
.qc-row{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--surface-2)}
.qc-row-top{display:flex;align-items:center;gap:10px}
.qc-row-name{width:84px;font-size:13px;color:var(--text-2);flex-shrink:0}
.qc-select{width:112px}
.qc-row-issue{display:grid;grid-template-columns:1fr 1fr 150px;gap:8px;margin-top:8px}
.qc-row-issue [data-qc-note]{grid-column:1/-1}
.qc-row-media{grid-column:1/-1;border:1px dashed var(--line);border-radius:10px;padding:8px;background:var(--surface-2)}
.qc-row-media-head{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--text-2);margin-bottom:6px;gap:8px}
.qc-stage-list{display:flex;flex-wrap:wrap;gap:6px;min-height:28px;align-items:center}
.qc-stage-thumb{position:relative;width:72px;height:72px;border-radius:8px;overflow:hidden;border:1px solid var(--line);background:#000;display:flex;align-items:center;justify-content:center}
.qc-stage-thumb img,.qc-stage-thumb video{width:100%;height:100%;object-fit:cover;display:block}
.qc-stage-del{position:absolute;top:2px;right:2px;width:18px;height:18px;line-height:1;border:0;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;font-size:11px;cursor:pointer;padding:0;z-index:2}
.qc-stage-del:hover{background:#c92a2a}
.qc-thumb{width:72px;height:72px;border-radius:8px;overflow:hidden;position:relative;border:1px solid var(--line);background:var(--bg);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted);flex-shrink:0}
.qc-thumb img,.qc-thumb video{width:100%;height:100%;object-fit:cover;display:block}
.qc-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;background:rgba(0,0,0,.3);font-size:15px}
.qc-thumbs{display:flex;flex-wrap:wrap;gap:6px;min-height:72px;align-items:center}
.qc-empty{font-size:12px;color:var(--muted)}
.qc-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}
.qc-col{border:1px solid var(--line);border-radius:10px;padding:8px;background:var(--surface-2)}
.qc-col-head{display:flex;justify-content:space-between;font-size:12px;color:var(--text-2);margin-bottom:6px}
.qc-col-n{color:var(--muted)}
.qc-upload-actions{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.qc-issue{border:1px solid var(--danger-line);background:var(--danger-soft);border-radius:12px;padding:10px 12px;margin-top:10px}
.qc-issue-head{display:flex;align-items:center;gap:8px;font-size:13.5px;flex-wrap:wrap}
.qc-issue-note{font-size:13px;color:var(--text-2);margin-top:4px}
.qc-issue-meta{font-size:12px;color:var(--muted);margin-top:4px}
.qc-issue-fix{font-size:12.5px;color:var(--accent);background:var(--accent-soft);border-radius:8px;padding:6px 8px;margin-top:6px}
.qc-issue-actions{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.qc-notice-card{margin-bottom:14px;border-color:var(--warn-line);background:var(--warn-soft)}
.qc-notice-head{font-size:14px;font-weight:600;color:var(--warn-strong);display:flex;align-items:center;gap:8px}
.qc-notice-list{display:flex;flex-direction:column;gap:8px;padding:0 16px 14px}
.qc-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:10px;padding:8px 12px;background:var(--surface)}
.qc-notice-title{font-size:13px;color:var(--text-2);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.qc-notice-sub{font-size:12px;color:var(--muted);margin-top:3px}
.qc-dot{width:7px;height:7px;border-radius:50%;background:#e03131;display:inline-block}
@media (max-width:900px){.qc-row-issue{grid-template-columns:1fr 1fr}.qc-row-issue [data-qc-due]{grid-column:1/-1}.qc-pair{grid-template-columns:1fr}}

/* ------------------- 深色主题补丁（覆盖零散浅色硬编码） ------------------- */
html[data-theme='dark'] .nav-item.active {
  border-color: rgba(20, 184, 166, 0.45);
}
html[data-theme='dark'] .unit-item-tag {
  color: var(--warn);
}
/* 深色下 11.5px 小字需要更高对比，否则表格里的编号/联系人/面积发灰看不清 */
html[data-theme='dark'] .cell-sub,
html[data-theme='dark'] th {
  color: #c2c2c2;
}
/* 工单看板：列是凹槽（比卡片暗），卡片浮起；深色下描边与阴影要可见 */
html[data-theme='dark'] .kanban-col {
  border-color: var(--line-strong);
}
html[data-theme='dark'] .wo-card {
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px -10px rgba(0, 0, 0, 0.6);
}
html[data-theme='dark'] .wo-meta {
  color: #c2c2c2;
}
html[data-theme='dark'] .bld-card {
  border-color: var(--line-strong);
}
html[data-theme='dark'] .bld-stats span {
  color: #c2c2c2;
}
html[data-theme='dark'] .pass-hero-usage .progress i {
  background: var(--warn);
}
/* 彩色软底（警告/危险）上的说明文字再提一档，避免与底色糊在一起 */
html[data-theme='dark'] .qc-notice-sub,
html[data-theme='dark'] .qc-issue-meta,
html[data-theme='dark'] .qc-issue-note {
  color: #d6d6d6;
}
html[data-theme='dark'] .pub-group td {
  background: var(--surface-2);
}
html[data-theme='dark'] .ll-bind.is-on {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.35);
}
html[data-theme='dark'] .ll-bind.is-off,
html[data-theme='dark'] .ll-wx {
  color: var(--warn);
  border-color: rgba(255, 169, 77, 0.35);
}
html[data-theme='dark'] .cert-chip.cert-warn {
  border-color: rgba(255, 169, 77, 0.4);
}
html[data-theme='dark'] .wk-h,
html[data-theme='dark'] .wk-list li.empty,
html[data-theme='dark'] .qc-empty {
  color: var(--muted);
}
/* 页面里内联的语义色文字（危险/警示/成功）在深色下提亮 */
html[data-theme='dark'] [style*='#b02a37']:not([style*='background']) {
  color: #ff8787 !important;
}
html[data-theme='dark'] [style*='#b45309'] {
  color: #ffa94d !important;
}
html[data-theme='dark'] [style*='#2f9e44'] {
  color: #69db7c !important;
}
html[data-theme='dark'] [style*='#e8590c'] {
  color: #ff922b !important;
}
html[data-theme='dark'] [style*='#d6336c'] {
  color: #ff8fab !important;
}

/* 深色主题：前端内联色的统一提亮（列表金额、状态标签、浅底面板） */
html[data-theme='dark'] [style*='color:#0b5d57'] {
  color: #5eead4 !important;
}
html[data-theme='dark'] [style*='color:#454c60'] {
  color: var(--text-2) !important;
}
html[data-theme='dark'] [style*='color:#7c8397'],
html[data-theme='dark'] [style*='color:#9aa1b2'],
html[data-theme='dark'] [style*='color:#a3a9b8'],
html[data-theme='dark'] [style*='color:#5d7176'],
html[data-theme='dark'] [style*='color:#7c8d93'] {
  color: var(--muted) !important;
}
html[data-theme='dark'] [style*='background:#fafbfe'],
html[data-theme='dark'] [style*='background:#f6f7fb'],
html[data-theme='dark'] [style*='background:#f7faf9'],
html[data-theme='dark'] [style*='background:#f4f5fa'],
html[data-theme='dark'] [style*='background:#f2f7f6'] {
  background: var(--surface-2) !important;
}
html[data-theme='dark'] [style*='background:#fffaf4'],
html[data-theme='dark'] [style*='background:#fff8dc'],
html[data-theme='dark'] [style*='background:#fff7dc'] {
  background: var(--warn-soft) !important;
}

/* ======================== 平板 / 触屏适配 ======================== */

/* iOS Safari 的地址栏会吃掉 100vh 的一部分，dvh 更准；不支持的浏览器忽略第二行 */
#app {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  height: 100vh;
  height: 100dvh;
}

/* ---- 触屏通用（手机 / 平板都生效，只改「好不好按」不改布局宽度） ---- */
@media (pointer: coarse) {
  button,
  [data-action],
  .nav-item,
  .segmented button,
  .theme-toggle,
  .strip-cell {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* 表格行内、看板卡片内的按钮：比常规小一号但不再压到 30px 以下 */
  .table-wrap .btn,
  .table-wrap .btn-sm,
  .wo-card .btn-sm,
  .dl-item .btn-sm,
  .rpt-reset {
    min-height: 32px;
  }

  .chk {
    padding: 11px 12px;
    font-size: 13px;
  }

  .chk input {
    width: 18px;
    height: 18px;
  }

  .tag {
    padding: 3px 9px;
  }

  /* iOS 在输入框字号 <16px 时聚焦会强制放大整页且不还原，触屏一律 16px。
     .rpt-ctl / .search 等带类名的控件特异性更高，必须一起写进来才盖得住 */
  input:not([type='checkbox']):not([type='radio']):not([type='range']),
  select,
  textarea,
  .rpt-ctl,
  .search {
    font-size: 16px;
  }
}

/* ---- 平板触屏（≥641px）：点击目标进一步放大到 40–44px ---- */
@media (pointer: coarse) and (min-width: 641px) {
  .btn {
    height: 42px;
    padding: 0 18px;
  }

  .btn-sm {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  /* 表格内的按钮由上面的 min-height 控制，这里把内边距补齐 */
  .table-wrap .btn,
  .table-wrap .btn-sm,
  .wo-card .btn-sm,
  .dl-item .btn-sm {
    padding: 0 11px;
    font-size: 12.8px;
  }

  /* 报表筛选条：30px 高 / 12px 字在平板上点不中 */
  .rpt-ctl {
    height: 38px;
  }

  .rpt-reset {
    height: 32px;
  }

  .segmented button {
    height: 36px;
    padding: 0 16px;
    font-size: 13.5px;
  }

  .theme-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .nav-item {
    height: 44px;
  }

  .search {
    height: 42px;
    width: 260px;
  }

  /* 触屏没有 hover，靠 hover 才显形的图标按钮常显底色，明确「这里可按」 */
  .row-actions .btn-ghost {
    background: var(--surface-2);
  }
}

/* ---- 平板屏幕布局（641–1024px，手机 640 层维持原设计） ---- */
@media (min-width: 641px) and (max-width: 1024px) {
  /* 侧栏在平板上改成「图标 + 文字」竖排窄栏（96px）。
     纯图标栏（64px）在触屏上没有 hover 提示，点之前根本不知道是哪个模块；
     96px 双行仍比桌面 232px 省一半宽度，且一屏能放下全部模块。 */
  .sidebar {
    width: 96px;
    flex: 0 0 96px;
  }

  .sidebar .brand {
    padding: 14px 8px;
  }

  .nav {
    padding: 8px 7px 14px;
  }

  .nav-group-label {
    display: block;
    padding: 12px 2px 6px;
    font-size: 10px;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: 58px;
    padding: 0 3px;
    margin-bottom: 3px;
    white-space: normal;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
  }

  /* 最长标签 6 字（品质维修工单 / 公共表计台账），10.5px 一行放得下 */
  .nav-item span {
    display: block;
    font-size: 10.5px;
    line-height: 1.15;
    letter-spacing: -0.2px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-foot {
    padding: 10px 6px;
  }

  /* 看板 4 列在 1024 下每列只剩 ~180px，标题全断行、优先级标签换行，改 2×2。
     必须写在这里 —— .kanban 的基础定义在文件中部，写在前面会被它覆盖 */
  .kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .page-title {
    font-size: 18px;
  }

  /* 平板上的表格：中文可以任意断行，列一挤就把「1# 冷水机组」压成五行、
     行高失控。改为不换行 + 横向滑动，配已有的「← 左右滑动 →」提示，
     一屏行数反而更多、每行只占一两行高。 */
  .table-wrap th,
  .table-wrap td {
    white-space: nowrap;
  }

  /* 行内操作按钮横排：竖排会把每行撑到 190px 高，一屏只剩两条数据 */
  .table-wrap .row-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
}

/* ---- 平板窄屏（641–900px）：顶栏空间紧张，标题可收缩、按钮不把主题键挤下去 ---- */
@media (min-width: 641px) and (max-width: 900px) {
  .topbar-title {
    flex: 1 1 200px;
    min-width: 0;
  }

  .page-title,
  .page-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 按钮在右侧竖排成一行，主题按钮永远留在同一行 */
  #topbar-actions {
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 62%;
  }

  #topbar-actions .btn {
    padding: 0 14px;
  }
}
