:root {
  --bg: #f5f6f8;
  --card: #fff;
  --text: #1f2329;
  --muted: #8f959e;
  --primary: #267ef0;
  --danger: #e34d59;
  --line: #e5e6eb;
  --high: #f77234;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.wx-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 64px;
}
.wx-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, #1f6fd8 0%, #3a8af0 55%, #4b97f5 100%);
  color: #fff;
  min-height: 56px;
  padding: 14px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(31, 111, 216, 0.22);
}
.wx-topbar-side {
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.92);
}
.wx-topbar-left { justify-content: flex-start; }
.wx-topbar-right { justify-content: flex-end; }
.wx-topbar-title {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.wx-topbar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .98;
}
.wx-topbar-title .wx-topbar-icon {
  width: 18px;
  height: 18px;
}
.wx-topbar-back {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
}
.wx-topbar-back:active {
  background: rgba(255, 255, 255, 0.26);
}
.wx-main { padding: 12px; }
.wx-tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  height: 56px;
}
.wx-tabbar.tabs-4 {
  grid-template-columns: repeat(4, 1fr);
}
.wx-tabbar.tabs-4 .tab { font-size: 13px; }
.wx-tabbar .tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}
.wx-tabbar .tab.on { color: var(--primary); font-weight: 600; }
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; overflow-x: auto; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 6px 12px;
  white-space: nowrap;
  font-size: 13px;
}
.chip.on { background: #e8f3ff; border-color: #a8d0ff; color: var(--primary); }
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f5c0c5; }
.btn.block { width: 100%; margin-top: 8px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card a { color: inherit; text-decoration: none; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.card h3 { margin: 0; font-size: 16px; min-width: 0; }
.card h3 .badge { margin-left: 6px; margin-right: 0; }
.card-head .meta { flex-shrink: 0; white-space: nowrap; }
.meta { color: var(--muted); font-size: 12px; }
.meta-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.countdown {
  flex-shrink: 0;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
.countdown.overdue { color: var(--danger); }
.tel-link { color: var(--primary); text-decoration: none; }
.tel-link:hover { text-decoration: underline; }
.verify-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.verify-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.verify-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.verify-title-row h3 { margin: 0; }
.verify-title-row .treat-photo-empty {
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}
.btn-inline {
  width: auto;
  margin-top: 0;
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 13px;
}
.loc-text {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.5;
}
.loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.loc-row .loc-text {
  flex: 1;
  min-width: 0;
}
.loc-row .btn {
  margin-top: 0;
}
.loc-actions {
  display: flex;
  gap: 10px;
}
.loc-actions .btn {
  flex: 1;
  margin-top: 0;
}
.verify-caller { font-weight: 400; font-size: 13px; color: var(--muted); text-align: right; word-break: break-all; }
.radio-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--text);
}
.radio-row-wrap {
  flex-wrap: wrap;
  gap: 10px 16px;
}
.radio-label { color: var(--muted); flex-shrink: 0; }
.action-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--danger);
}
.radio-row.need-pick { color: var(--danger); }
.radio-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.detail .radio-opt { display: inline-flex; margin: 0; color: var(--text); }
.wait-tip { color: var(--high); font-size: 13px; margin: 8px 0; }
.btn.is-disabled, .btn:disabled { opacity: 0.45; pointer-events: none; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef0f3;
  margin-right: 4px;
}
.badge.high { background: #fff1e9; color: var(--high); }
.badge.status { background: #e8f3ff; color: var(--primary); }
.badge.st-pending_verify { background: #fff7e6; color: #c47b00; }
.badge.st-verifying { background: #e8f3ff; color: var(--primary); }
.badge.st-verified { background: #e6f6f2; color: #0f766e; }
.badge.st-pending_treat { background: #fff1e9; color: var(--high); }
.badge.st-treating { background: #e6f6f2; color: #0f766e; }
.badge.st-pending_photo_review { background: #f3e8ff; color: #6d28d9; }
.badge.st-pending_close { background: #eef2f6; color: #3d5a80; }
.badge.st-closed { background: #edf7ed; color: #2f7d32; }
.badge.st-pending { background: #fff7e6; color: #c47b00; }
.badge.st-remind,
.badge.st-extend_pending,
.badge.st-overdue_pending { background: #fdecea; color: #c62828; }
.badge.st-overdue { background: #fdecea; color: #c62828; }
.badge.st-extend_done,
.badge.st-overdue_done { background: #e8f5e9; color: #2e7d32; }
.badge.st-done { background: #edf7ed; color: #2f7d32; }
.permit-sticky,
.filter-sticky {
  position: sticky;
  top: 56px;
  z-index: 8;
  background: var(--bg);
  margin: -12px -12px 0;
  padding: 12px 12px 0;
}
.permit-stats,
.filter-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.filter-stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-stats.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.filter-stats.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.permit-stat,
.filter-stat {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(31, 35, 41, 0.04);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .12s ease;
  min-height: 52px;
}
.permit-stat:active,
.filter-stat:active { transform: scale(0.97); }
.permit-stat-icon,
.filter-stat-icon {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}
.filter-stat-value {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.1;
}
.permit-stat-label,
.filter-stat-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.15;
}
.permit-stat-num,
.filter-stat-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.permit-stat.tone-all,
.filter-stat.tone-all { --stat-accent: #267ef0; }
.permit-stat.tone-pending,
.filter-stat.tone-pending,
.filter-stat.tone-verify { --stat-accent: #c47b00; }
.permit-stat.tone-remind,
.filter-stat.tone-remind,
.filter-stat.tone-verified { --stat-accent: #267ef0; }
.permit-stat.tone-overdue,
.filter-stat.tone-overdue,
.filter-stat.tone-treat { --stat-accent: #f77234; }
.permit-stat.tone-alert,
.filter-stat.tone-alert { --stat-accent: #c62828; }
.permit-stat.tone-ok,
.filter-stat.tone-ok { --stat-accent: #2e7d32; }
.filter-stat.tone-close { --stat-accent: #3d5a80; }
.permit-stat.tone-done,
.filter-stat.tone-done,
.filter-stat.tone-closed { --stat-accent: #2f7d32; }
.permit-stat .permit-stat-icon,
.filter-stat .filter-stat-icon,
.filter-stat .permit-stat-icon { color: var(--stat-accent); }
.permit-stat.on,
.filter-stat.on {
  box-shadow: 0 2px 8px rgba(38, 126, 240, 0.14);
}
.permit-stat.tone-all.on,
.filter-stat.tone-all.on {
  background: #e8f3ff;
  border-color: #a8d0ff;
  color: var(--primary);
}
.permit-stat.tone-pending.on,
.filter-stat.tone-pending.on,
.filter-stat.tone-verify.on {
  background: #fff7e6;
  border-color: #f0d09a;
  color: #c47b00;
}
.permit-stat.tone-remind.on,
.filter-stat.tone-remind.on,
.filter-stat.tone-verified.on {
  background: #e8f3ff;
  border-color: #a8d0ff;
  color: var(--primary);
}
.permit-stat.tone-overdue.on,
.filter-stat.tone-overdue.on,
.filter-stat.tone-treat.on {
  background: #fff1e9;
  border-color: #f5b48f;
  color: var(--high);
}
.permit-stat.tone-alert.on,
.filter-stat.tone-alert.on {
  background: #fdecea;
  border-color: #ef9a9a;
  color: #c62828;
}
.permit-stat.tone-ok.on,
.filter-stat.tone-ok.on {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #2e7d32;
}
.filter-stat.tone-close.on {
  background: #eef2f6;
  border-color: #c5d0dc;
  color: #3d5a80;
}
.permit-stat.tone-done.on,
.filter-stat.tone-done.on,
.filter-stat.tone-closed.on {
  background: #edf7ed;
  border-color: #9fd0a2;
  color: #2f7d32;
}
.permit-stat.on .permit-stat-label,
.permit-stat.on .permit-stat-num,
.filter-stat.on .filter-stat-label,
.filter-stat.on .filter-stat-num,
.filter-stat.on .permit-stat-label,
.filter-stat.on .permit-stat-num { color: inherit; }
.permit-stat.on .permit-stat-icon,
.filter-stat.on .filter-stat-icon,
.filter-stat.on .permit-stat-icon { color: inherit; }
.permit-search-row {
  display: block;
  width: 100%;
  margin-bottom: 14px;
}
.permit-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
}
.permit-list,
.filter-list {
  margin-top: 2px;
}
.permit-source {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #111;
  border-radius: 10px;
}
.permit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.permit-actions .btn { flex: 1; }
.panel {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
}
.panel h2 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.detail .section { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.detail h3 { margin: 0 0 10px; font-size: 16px; }
.detail h2 { margin: 0 0 8px; font-size: 18px; }
.detail label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.detail input, .detail textarea, .detail select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
}
.detail input:disabled, .detail textarea:disabled, .detail select:disabled {
  background: #f5f6f8;
  color: var(--text);
}
.detail-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.detail-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.detail-tab.on {
  color: var(--primary);
  background: #e8f3ff;
}
.tab-pane { display: none; }
.tab-pane.on { display: block; }
.pit-list {
  display: flex;
  flex-direction: column;
}
.pit-item {
  padding: 12px 0;
}
.pit-item + .pit-item {
  border-top: 1px solid var(--line);
}
.pit-sum-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
}
.pit-sum-text {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.pit-sum-k,
.pit-sum-nums,
.pit-sum-end {
  flex: 0 0 auto;
  white-space: nowrap;
}
.pit-mat-v {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pit-edit {
  flex: 0 0 auto;
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  padding: 0;
  cursor: pointer;
}
.pit-dialog {
  width: min(400px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  text-align: left;
}
.pit-dlg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.pit-dlg-k {
  flex: 0 0 2.2em;
  font-size: 14px;
  color: var(--text);
}
.pit-dlg-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 15px;
  font-family: inherit;
  background: #f7f8fa;
}
.pit-dlg-row input[type="text"]:disabled {
  opacity: 0.45;
}
.pit-dlg-row input[type="text"]:focus,
.pit-dialog select:focus {
  outline: none;
  border-color: #a8d0ff;
  background: #fff;
}
.pit-dlg-unit {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--muted);
}
.pit-dlg-check-slot {
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pit-dlg-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  cursor: pointer;
}
.pit-dlg-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}
.pit-dlg-mat-k {
  margin: 2px 0 6px;
  font-size: 14px;
  color: var(--text);
}
.pit-dialog select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  font-family: inherit;
  background: #f7f8fa;
}
.pit-dlg-err {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--danger);
}
.pit-dlg-err[hidden] { display: none; }
.pit-dlg-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.pit-dlg-actions .btn {
  flex: 1;
  margin-top: 0;
  font-family: inherit;
}
.pit-dlg-del {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  font-family: inherit;
  padding: 8px 0 2px;
  cursor: pointer;
}
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.patrol-photo-card { width: 96px; }
.patrol-photo-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  word-break: break-all;
}
.call-log {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.submit-log-block {
  margin-top: 12px;
}
.submit-log {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}
.submit-log div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.photos img,
.repair-thumb img,
.permit-source { cursor: zoom-in; }
.photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-viewer-img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.photo-viewer-close,
.photo-viewer-nav {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}
.photo-viewer-close {
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 40px;
  padding: 0;
}
.photo-viewer-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 72px;
  border-radius: 8px;
  font-size: 34px;
  line-height: 72px;
  padding: 0;
}
.photo-viewer-nav.prev { left: 8px; }
.photo-viewer-nav.next { right: 8px; }
.photo-viewer-nav[hidden],
.photo-viewer-count[hidden] { display: none; }
.photo-viewer-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  text-align: center;
  color: #fff;
  font-size: 14px;
  pointer-events: none;
}
.photo-item {
  position: relative;
  width: 96px;
  height: 96px;
}
.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 22px;
  padding: 0;
  cursor: pointer;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.stat {
  background: #f7f8fa;
  border-radius: 10px;
  padding: 12px;
}
.stat .n { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.oauth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1f2a37, #2f3b4c);
  padding: 20px;
}
.oauth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
}
.oauth-brand { color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.oauth-card h1 { font-size: 20px; margin: 0 0 8px; }
.oauth-user {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}
.oauth-user-list { margin-top: 8px; }
.oauth-user-list form:first-child .oauth-user { margin-top: 0; }
.oauth-user strong { font-size: 16px; color: var(--text); }
.oauth-user span { font-size: 13px; color: var(--muted); }
.oauth-user:active { background: #e8f3ff; border-color: #a8d0ff; }
.oauth-card-wide { max-width: 720px; }
.oauth-doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.oauth-door {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fafbfc;
}
.oauth-door h2 { margin: 0 0 4px; font-size: 16px; }
.oauth-door > p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.oauth-door ol {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #4e5969;
  font-size: 13px;
  line-height: 1.6;
}
.oauth-user.primary {
  background: #e8f3ff;
  border-color: #a8d0ff;
}
.guide {
  background: #fff8eb;
  border: 1px solid #ffe0a3;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  position: relative;
}
.guide h3 { margin: 0 0 6px; font-size: 15px; }
.guide ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: #4e5969; }
.guide .guide-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.guide .guide-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}
@media (max-width: 700px) {
  .oauth-doors { grid-template-columns: 1fr; }
}

.admin-wrap { max-width: 960px; margin: 0 auto; }
body:has(.admin-wrap) .wx-shell { max-width: 960px; padding-bottom: 20px; }
.pre {
  white-space: pre-wrap;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
}
@media (min-width: 900px) {
  .admin-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
}

.center-dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.center-dialog {
  width: min(320px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 22px 18px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
}
.center-dialog-msg {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}
.center-dialog .btn.block {
  margin-top: 0;
}

.patrol-sticky {
  position: sticky;
  top: 56px;
  z-index: 8;
  background: var(--bg);
  margin: -12px -12px 0;
  padding: 12px 12px 0;
}
.patrol-sticky .filter-stats {
  margin-bottom: 10px;
}
.patrol-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.patrol-filters .chip {
  flex-shrink: 0;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.patrol-search {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
}
.patrol-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0;
}
.patrol-status-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.patrol-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.patrol-check input {
  margin: 0;
  width: 14px;
  height: 14px;
}
.patrol-summary-count {
  text-align: right;
  white-space: nowrap;
  margin-left: auto;
}
.patrol-head,
.patrol-row {
  display: grid;
  grid-template-columns: 20% 14% 26% 14% 12% 14%;
  gap: 4px;
  align-items: center;
}
.patrol-head {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.patrol-list { display: flex; flex-direction: column; }
.patrol-row {
  background: #fff;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
}
.patrol-row > div {
  min-width: 0;
  overflow: hidden;
}
.patrol-row .p-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.patrol-row .p-town,
.patrol-row .p-grade {
  white-space: nowrap;
  text-overflow: ellipsis;
}
.patrol-row .p-span {
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}
.patrol-row .p-detail a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.patrol-row .p-status { text-align: center; }
.patrol-row .p-detail { text-align: center; }
.patrol-empty {
  background: #fff;
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  margin-top: 10px;
}
.patrol-meta {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}
.patrol-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.patrol-meta-row > span {
  min-width: 0;
  color: var(--text);
}
.patrol-meta-row em {
  font-style: normal;
  color: var(--muted);
  margin-right: 4px;
}
.patrol-meta-full {
  flex: 1 1 100%;
  word-break: break-all;
}
.picker-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.picker-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 72vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
}
.picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.picker-head button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.picker-list {
  overflow-y: auto;
  padding-bottom: 20px;
}
.picker-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.repair-entry { margin: 0 0 10px; }
.repair-entry-hint { margin: 6px 0 12px; }
.repair-note { margin: 0 0 4px; }
.repair-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.repair-thumb { position: relative; width: 96px; height: 96px; }
.repair-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }
.repair-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  padding: 0;
  cursor: pointer;
}
.picker-item.on { color: var(--primary); font-weight: 600; background: #f5f9ff; }
.picker-item .picker-count { color: var(--muted); font-size: 13px; font-weight: 400; }
