:root {
  --orange: #ff7a00;
  --orange-dark: #e56a00;
  --orange-soft: #fff2e5;
  --orange-line: #ffd9b3;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #7b8794;
  --line: #eef0f3;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #2563eb;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
}

.topbar .title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.topbar .back-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--text);
  padding: 4px 6px;
  cursor: pointer;
}

.topbar .spacer {
  width: 28px;
}

.view {
  flex: 1;
  padding: 16px 16px 96px;
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}

.tabbar button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0 8px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.tabbar button .ico {
  font-size: 19px;
  line-height: 1;
}

.tabbar button.active {
  color: var(--orange);
  font-weight: 600;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card.soft {
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
  box-shadow: none;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title .dot {
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--orange);
  display: inline-block;
}

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:active {
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.28);
}

.btn-secondary {
  background: var(--orange-soft);
  color: var(--orange-dark);
  border: 1px solid var(--orange-line);
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: #fff;
  color: var(--red);
  border: 1px solid #f3d1d1;
}

.btn-sm {
  width: auto;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-row .btn {
  flex: 1;
}

.hero-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  width: 100%;
  padding: 26px 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 122, 0, 0.3);
  margin-bottom: 12px;
}

.hero-btn .hero-ico {
  font-size: 30px;
  display: block;
  margin-bottom: 8px;
}

.hero-btn .hero-title {
  font-size: 20px;
  font-weight: 700;
}

.hero-btn .hero-desc {
  font-size: 13px;
  opacity: 0.92;
  margin-top: 4px;
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.entry-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.entry-card.soft {
  background: var(--orange-soft);
  border-color: var(--orange-line);
}

.entry-card .ico {
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}

.entry-card .t {
  font-size: 15px;
  font-weight: 600;
}

.entry-card .d {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.field {
  margin-bottom: 14px;
}

.field > label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field .req {
  color: var(--red);
  margin-left: 2px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.plate-input {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  font-size: 19px;
  text-align: center;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  color: var(--muted);
  flex: 0 0 auto;
}

.kv .v {
  text-align: right;
  font-weight: 500;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  border: 1px solid var(--orange-line);
}

.badge.green {
  background: #e8f8ee;
  color: var(--green);
  border-color: #c6ecd4;
}

.badge.gray {
  background: #f1f3f5;
  color: var(--muted);
  border-color: var(--line);
}

.list-item {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.list-item .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.list-item .plate {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}

.list-item .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 14px;
}

.empty .ico {
  font-size: 34px;
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 20px);
  background: rgba(31, 41, 55, 0.94);
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  max-width: 84%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(185, 28, 28, 0.95);
}

.toast.success {
  background: rgba(21, 128, 61, 0.95);
}

/* 识别中的大提示：半透明遮罩 + 白色圆角卡片 */
.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 95;
}

.loading-mask.show {
  display: flex;
}

.loading-box {
  background: #fff;
  border-radius: 18px;
  padding: 30px 36px;
  text-align: center;
  min-width: 220px;
  max-width: 84%;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.22);
}

.loading-box .big-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--orange-soft);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-box .loading-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.loading-box .loading-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}

/* ---------------- 水印相机（调手机自带相机拍照，只加水印） ---------------- */
/* ---------------- 表单里的现场照片字段 ---------------- */
/* 表单封面 / 主题色 / 说明段 / 单选多选 / 手写签名 */
.form-cover {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #f3f4f6;
  display: block;
}

.form-section {
  background: #f6f7f9;
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
}

.choice {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text);
}

.choice input {
  width: 18px;
  height: 18px;
  min-width: auto;
  flex: 0 0 auto;
  accent-color: var(--orange);
}

.sign-box {
  position: relative;
  border: 1px dashed #c9d1da;
  border-radius: 10px;
  background: #fff;
  height: 140px;
}

.sign-canvas {
  width: 100%;
  height: 140px;
  display: block;
  touch-action: none;
  border-radius: 10px;
}

.sign-tip {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: #b6bcc4;
  font-size: 13px;
  pointer-events: none;
}

.photo-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.photo-thumb {
  position: relative;
  display: inline-block;
  /* 用户 2026-10-10："上传后显示比例不要变" —— 不要再固定成正方形（那样会把照片裁掉），
     容器跟着图片走，只在图片上限制最大边 */
  line-height: 0;
}

.photo-thumb img,
img.photo-thumb-img {
  max-width: 110px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f3f4f6;
  display: block;
  cursor: pointer;
}

.photo-thumb .photo-del,
.photo-del {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.photo-empty {
  font-size: 12.5px;
  color: var(--muted);
}

/* 「＋」加照片格子：所有上传照片的地方都统一用它，点一下直接打开手机相册 */
.photo-add {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  color: #94a3b8;
  cursor: pointer;
  background: #fff;
  user-select: none;
}

.photo-add:active {
  background: #f8fafc;
}

.thumbs .photo-add {
  flex: none;
}

/* 电话号码：完整号码点一下就能拨号 */
.phone-link {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}

.phone-link::after {
  content: ' 📞';
  font-weight: 400;
}

.wmcam {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #0b0d10;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 14px calc(10px + env(safe-area-inset-bottom));
}

.wmcam-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wmcam-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* 返回业务系统：带文字的按钮，比一个 ✕ 好找 */
.wmcam-back {
  width: auto;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 13.5px;
}

/* 「水印设置」面板里的小预览：面板会挡住画面，所以面板自己带一张 */
.wm-sheet-preview {
  margin-bottom: 14px;
}

.wm-sheet-preview canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.wm-sheet-preview .hint {
  margin-top: 6px;
}

.wmcam-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.wmcam-geo {
  flex: 0 0 auto;
  max-width: 44%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wmcam-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 12px 0 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 实时画面：视频 + 上面盖一层透明画布，水印直接画在画布上（所见即所得） */
.wmcam-stage video,
.wmcam-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 12px;
}

.wmcam-stage video {
  object-fit: cover;
  background: #000;
}

.wmcam-overlay {
  pointer-events: none;
}

/* 没有摄像头时的"水印预览"卡片 */
.wmcam-previewbox {
  position: relative;
  max-width: 92%;
  max-height: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.wmcam-previewbox canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.wmcam-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* 竖屏 / 横屏预览切换 */
.wmcam-zoom {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 2px 0 8px;
}

.wmcam-zoom button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.wmcam-zoom button.active {
  background: var(--orange);
  border-color: var(--orange);
  font-weight: 600;
}

.wmcam-orient {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}

.wmcam-orient button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.wmcam-orient button.active {
  background: var(--orange);
  border-color: var(--orange);
  font-weight: 600;
}

/* 水印设置里的勾选项 */
.wm-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text);
}

.wm-opt input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--orange);
}

.wmcam-note {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  padding: 0 2px 8px;
  min-height: 17px;
}

.wmcam-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 18px 6px;
}

.wmcam-side {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 10.5px;
  line-height: 1.3;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.wmcam-side .ico {
  font-size: 18px;
}

.wmcam-shutter {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: var(--orange);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.wmcam-shutter:active {
  transform: scale(0.95);
}

/* 正在生成水印 / 上传：按钮转个圈，但不影响继续拍 */
.wmcam-shutter.busy {
  position: relative;
  color: transparent;
}

.wmcam-shutter.busy::after {
  content: '';
  position: absolute;
  inset: 16px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wmcam-spin 0.8s linear infinite;
}

@keyframes wmcam-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 缩略图上的上传状态 */
.wm-thumb {
  position: relative;
}

.wm-thumb .wm-thumb-state {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 0 0 8px 8px;
}

.wm-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 14px 2px;
}

.wm-thumbs .wm-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 78px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.wm-thumbs .wm-thumb img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  display: block;
}

.wm-thumbs .wm-thumb .tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 2px 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 90;
}

.overlay.show {
  display: flex;
}

.sheet {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px 26px;
  max-height: 88vh;
  overflow-y: auto;
}

.sheet-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.camera-box {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  aspect-ratio: 4 / 3;
}

.camera-box video,
.camera-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-frame {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 26%;
  height: 30%;
  border: 2px solid var(--orange);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28);
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.thumb {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f6f7f9;
  line-height: 0;
}

.thumb img {
  /* 同上：按原比例显示，只限最大边 */
  max-width: 110px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 9px;
  display: block;
}

.thumb .del {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
}

.thumb.add {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.section-gap {
  height: 8px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #fff6ee 0%, #ffffff 42%);
  max-width: 480px;
  margin: 0 auto;
}

.login-logo {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 18px;
  box-shadow: 0 8px 20px rgba(255, 122, 0, 0.3);
}

.login-title {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* 登录页顶部的小区小标（小区名由后端按域名返回，主域名不显示） */
.login-badge {
  display: table;
  margin: 0 auto 8px;
  background: var(--orange-soft, #fff2e5);
  color: var(--orange-dark, #b35a00);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 26px;
}

.loading {
  text-align: center;
  color: var(--muted);
  padding: 26px;
  font-size: 14px;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--orange-soft);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  animation: fade 0.18s ease-in;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-box .n {
  font-size: 22px;
  font-weight: 700;
  color: var(--orange);
}

.stat-box .l {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ==========================================================================
   蓝色主题（参考设计稿：浅蓝底 + 白色卡片 + 蓝绿橙紫彩色图标块）
   说明：这里统一覆盖主色与几个关键组件，页面里所有 --orange 变量都会变成蓝色。
   ========================================================================== */

:root {
  --orange: #2f6bff;
  --orange-dark: #1f56e0;
  --orange-soft: #eaf1ff;
  --orange-line: #d6e4ff;
  --bg: #f4f7fd;
  --line: #e8eefb;
  --blue: #2f6bff;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(28, 62, 138, 0.07);
  --brand-grad: linear-gradient(135deg, #2f6bff 0%, #5b8cff 100%);
}

body {
  background: linear-gradient(180deg, #e9f1ff 0%, #f5f8ff 300px, #f4f7fd 100%);
  background-attachment: fixed;
}

.app-shell {
  background: transparent;
}

/* 顶部：蓝色渐变条 */
.topbar {
  display: block;
  background: var(--brand-grad);
  border-bottom: none;
  color: #fff;
  min-height: 0;
  padding: 8px 14px 10px;
  box-shadow: 0 4px 12px rgba(47, 107, 255, 0.16);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .title {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0.3px;
  opacity: 0.95;
}

.topbar .back-btn {
  color: #fff;
  font-size: 20px;
  padding: 0 2px;
}

/* 二级页面（带返回箭头）标题恢复成正常大小，只有首页那种标签页用小标题 */
.topbar.has-back {
  padding: 13px 14px 15px;
}

.topbar.has-back .title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  opacity: 1;
}

.topbar.has-back .back-btn {
  font-size: 24px;
}

.topbar-sub {
  margin-top: 4px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
}

/* 卡片：更圆、更轻的阴影 */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.soft {
  background: #fff;
  border: 1px solid var(--line);
}

/* 大按钮：蓝色渐变 + 右侧白色箭头圆钮 */
.hero-btn {
  position: relative;
  overflow: hidden;
  background: var(--brand-grad);
  border-radius: var(--radius);
  padding: 22px 18px 24px;
  box-shadow: 0 12px 26px rgba(47, 107, 255, 0.26);
}

.hero-btn::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.hero-btn .hero-ico {
  font-size: 26px;
  margin-bottom: 6px;
}

.hero-btn .hero-title {
  font-size: 21px;
}

.hero-btn .hero-arrow {
  position: absolute;
  right: 18px;
  bottom: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #2f6bff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 40, 100, 0.18);
}

/* 功能入口卡：浅色底 + 彩色图标块 + 右侧箭头 */
.entry-card {
  position: relative;
  border-radius: var(--radius);
  padding: 14px 40px 14px 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 6px 16px rgba(28, 62, 138, 0.06);
}

.entry-card .ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
  background: rgba(47, 107, 255, 0.12);
}

.entry-card .t {
  font-size: 15px;
  font-weight: 600;
}

.entry-card .d {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.entry-card .chev {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  background: rgba(47, 107, 255, 0.12);
  color: #2f6bff;
}

.entry-card.tone-blue {
  background: #eef4ff;
  border-color: #e2ebff;
}
.entry-card.tone-blue .ico {
  background: rgba(47, 107, 255, 0.16);
}

.entry-card.tone-green {
  background: #eafaf1;
  border-color: #d9f3e6;
}
.entry-card.tone-green .ico {
  background: rgba(34, 181, 115, 0.16);
}

.entry-card.tone-orange {
  background: #fff4e8;
  border-color: #ffe6cd;
}
.entry-card.tone-orange .ico {
  background: rgba(255, 138, 61, 0.18);
}

.entry-card.tone-purple {
  background: #f1edff;
  border-color: #e5ddff;
}
.entry-card.tone-purple .ico {
  background: rgba(122, 92, 255, 0.16);
}

.entry-card.tone-teal {
  background: #e7f8f8;
  border-color: #d3f0ef;
}
.entry-card.tone-teal .ico {
  background: rgba(23, 162, 162, 0.16);
}

.entry-card.tone-slate {
  background: #f2f5fb;
  border-color: #e6ecf7;
}
.entry-card.tone-slate .ico {
  background: rgba(90, 116, 163, 0.16);
}

/* 底部标签栏与按钮 */
.tabbar {
  border-top: none;
  box-shadow: 0 -6px 18px rgba(28, 62, 138, 0.06);
}

.tabbar button.active {
  color: #2f6bff;
}

.btn-primary {
  background: var(--brand-grad);
  border: none;
  box-shadow: 0 8px 18px rgba(47, 107, 255, 0.22);
}

.card-title .dot {
  background: #2f6bff;
}

.login-wrap {
  background: linear-gradient(180deg, #e9f1ff 0%, #ffffff 45%);
}

/* ---------------- 车牌键盘 / 最近查过 / 设置开关行 ---------------- */

/* 拍照页、相册页下面那行"识别成功后直接出结果"的小开关 */
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 2px 0;
  font-size: 13px;
  color: var(--muted);
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

/* 车牌键盘：省份简称 + 字母数字，点一下就填 */
.plate-keypad {
  padding: 12px 10px;
}

.plate-keypad .card-title {
  margin-bottom: 8px;
}

.pk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.pk-key {
  flex: 1 0 auto;
  min-width: 30px;
  height: 40px;
  padding: 0 6px;
  border: none;
  border-radius: 9px;
  background: #f2f4f8;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.pk-key:active {
  background: #e3e8f2;
}

.pk-row.pk-func {
  margin-top: 8px;
}

.pk-key.pk-wide {
  flex: 1 1 0;
  font-size: 14px;
}

.pk-key.pk-ok {
  background: var(--orange);
  color: #fff;
}

/* 最近查过的车牌：点一下就填进输入框 */
.plate-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pk-chip {
  border: 1px solid var(--orange-line);
  background: var(--orange-soft);
  color: var(--orange-dark);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ---------------- 工单：完工前/后对比 + 进度节点 + A4 打印单 ---------------- */

/* 完工前 / 完工后：两列大图，手机上也能直接看清（不用先保存再翻相册） */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.compare-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.compare-tag {
  align-self: flex-start;
  font-size: 12px;
  color: #fff;
  background: rgba(17, 24, 39, .72);
  border-radius: 6px;
  padding: 2px 8px;
}

.compare-tag.after {
  background: var(--orange);
}

.compare-img {
  width: 100%;
  height: auto;
  /* 用户 2026-10-10："比例不要变，以合适大小展示" —— 以前强行套 4:3 再裁掉两边，
     竖着拍的照片只能看到中间一条。现在按原比例整张显示，太高时限制个最大高。 */
  max-height: 460px;
  object-fit: contain;
  border-radius: 10px;
  background: #eef1f5;
  cursor: zoom-in;
}

.compare-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 18px 8px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* 进度节点：一条竖线时间轴 */
.timeline {
  margin-top: 6px;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}

.tl-item {
  position: relative;
  padding-bottom: 12px;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-dot {
  position: absolute;
  left: -21px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
}

.tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tl-del {
  margin-top: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}

.pk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

/* ---------------- 工单处理单（A4 打印页） ---------------- */

.print-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 12px 40px;
}

.print-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.print-sheet {
  background: #fff;
  color: #111827;
  border-radius: 6px;
  padding: 18px 20px 22px;
  box-shadow: 0 3px 16px rgba(17, 24, 39, .12);
  font-size: 13px;
}

.print-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #111827;
}

.print-title {
  font-size: 18px;
  font-weight: 700;
}

.print-sub {
  color: #4b5563;
  font-size: 12px;
}

table.print-info {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

table.print-info th,
table.print-info td {
  border: 1px solid #cbd5e1;
  padding: 5px 8px;
  font-size: 12px;
  text-align: left;
  white-space: normal;
}

table.print-info th {
  background: #f3f4f6;
  color: #4b5563;
  font-weight: 600;
  white-space: nowrap;
  width: 78px;
}

.print-sec {
  margin-top: 14px;
  padding-left: 8px;
  border-left: 4px solid var(--orange);
  font-weight: 700;
  font-size: 13px;
}

.print-text {
  margin-top: 6px;
  padding-left: 10px;
  white-space: pre-wrap;
  font-size: 12.5px;
}

.print-text.small {
  color: #374151;
  padding-left: 0;
}

.print-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.print-photos.small img.print-photo {
  width: calc(25% - 6px);
  max-width: 160px;
}

img.print-photo {
  width: calc(50% - 4px);
  max-width: 320px;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  page-break-inside: avoid;
}

.print-photo.empty {
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 3px;
  color: #6b7280;
  font-size: 12px;
}

.print-steps {
  margin-top: 6px;
}

.print-step {
  padding: 4px 0 8px 10px;
  border-left: 2px solid #e5e7eb;
  margin-left: 4px;
  page-break-inside: avoid;
}

.print-step-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.print-step-head span {
  color: #6b7280;
}

.print-sign {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed #9ca3af;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12.5px;
}

.print-foot {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  font-size: 11px;
}

/* 打印时：只留这张单，按钮 / 顶部栏 / 底部导航都藏掉；照片多了自动换页 */
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  .topbar,
  .tabbar,
  #back-to-camera,
  .toast,
  .overlay,
  .loading-mask,
  .print-toolbar,
  .btn {
    display: none !important;
  }

  html,
  body,
  .app-shell {
    background: #fff !important;
  }

  .print-page {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .print-sheet {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  table.print-info,
  .print-step,
  .print-sign {
    page-break-inside: avoid;
  }
}

/* ---------------- 水印样式选择（8 种真实小样） ---------------- */

.wm-style-grid {
  display: grid;
  /* 一行三个（用户 2026-09-25 要求"水印相式排为一行三个"） */
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
}

.wm-style-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
}

.wm-style-item.on {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px var(--orange-soft);
}

.wm-style-item canvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.wm-style-item .t {
  font-size: 11px;
  margin-top: 3px;
  color: var(--text);
  line-height: 1.2;
}

/* ---------------- 随手笔记（用户 2026-09-30） ---------------- */

/* 笔记正文：保留换行和空格，长内容自动折行，不撑破卡片 */
.note-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.65;
  color: #1f2937;
  margin-top: 6px;
}

/* ---------------- 网盘（用户 2026-09-30） ---------------- */

/* 文件夹 / 文件都用卡片排：一行两个，手机上正好 */
.drive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.drive-folder,
.drive-file {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  font: inherit;
  color: inherit;
}

.drive-folder:active,
.drive-file:active {
  transform: scale(0.985);
}

.drive-folder-ico {
  font-size: 26px;
  line-height: 1.2;
}

.drive-folder-name,
.drive-file-name {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
}

.drive-folder-meta,
.drive-file-meta {
  font-size: 11px;
  color: var(--muted);
}

.drive-file img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef1f6;
}

.drive-file-ico {
  width: 100%;
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: #f1f4f9;
  border-radius: 8px;
}

.drive-file .btn-row {
  margin-top: 6px;
}

/* 上传队列：一条一个进度条 */
.drive-task {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.drive-task:first-of-type {
  border-top: none;
}

.drive-task-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.drive-task-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-task-state {
  color: var(--muted);
  font-size: 12px;
}

.drive-bar {
  height: 6px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
  margin: 8px 0 6px;
}

.drive-bar i {
  display: block;
  height: 100%;
  background: var(--orange, #ff7a00);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.drive-task-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

.drive-task-btns {
  display: flex;
  gap: 10px;
}

.drive-task-btns button {
  border: none;
  background: none;
  color: var(--orange, #ff7a00);
  font-size: 12px;
  padding: 0;
}

/**
 * 上传 / 下载进度：收成一个**小圆球**停在屏幕右边中间，
 * 点一下才展开进度和下载记录（用户 2026-09-30："以小圆球的形式停放在右侧中间悬浮，点击展开查看进度记录"）。
 */
.drive-ball-wrap {
  position: fixed;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
}

.drive-ball {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

/* 球上的小徽标：还在传时显示任务数 */
.drive-ball .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--orange, #ff7a00);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

.drive-ball .ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffb454;
  animation: drive-spin 1s linear infinite;
}

.drive-ball.done .ring {
  animation: none;
  border-color: #22c55e;
  border-top-color: #22c55e;
  background: #22c55e;
}

@keyframes drive-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 展开的面板：贴着球的左边 */
.drive-ball-panel {
  width: min(340px, calc(100vw - 80px));
  max-height: 62vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.drive-ball-close {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
}

.drive-record {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.drive-record:first-of-type {
  border-top: none;
}

.drive-record .r1 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}

.drive-record .r2 {
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}

/* 多选下载 */
.drive-pick {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #16a34a;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}

.drive-file-wrap {
  position: relative;
}

.drive-selbar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 72;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* 水印图片的"存放目录"：小区名一行 + 每天一行（和后台那棵树一个样子，用户 2026-09-30） */
.drive-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drive-day {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 15px;
}

.drive-day.root {
  background: #fff3e6;
  font-weight: 600;
  color: #b45309;
}

.drive-day:not(.root):active {
  background: #f3f5f9;
}

.drive-day .ico {
  font-size: 18px;
}

.drive-day .name {
  flex: 1;
}

.drive-day .count {
  color: #6b7280;
  font-size: 14px;
  margin-right: 6px;
}

.drive-day-dl {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
}
