:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }

/* ---------- 核验端 ---------- */
.verify-wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.verify-head { text-align: center; margin-bottom: 18px; }
.verify-head h1 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.month-badge { display: inline-block; font-size: 13px; color: var(--muted); background: #e8edf5; padding: 4px 12px; border-radius: 20px; }

.engine-warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }

.status-banner { border-radius: 14px; padding: 18px; text-align: center; margin-bottom: 16px; box-shadow: var(--shadow); background: #fff7ed; border: 2px solid #f59e0b; }
.status-banner.loading { background: #eff6ff; border-color: var(--primary); }
.status-banner.fail { background: #fef2f2; border-color: var(--red); }
.status-banner-icon { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.status-banner-text { font-size: 16px; font-weight: 600; color: #374151; }
.candidate-box { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.candidate-btn { background: #fff; border: 1px solid var(--primary); color: var(--primary); padding: 8px 14px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }

.result-card { border-radius: 16px; padding: 22px 18px; text-align: center; margin-bottom: 16px; box-shadow: var(--shadow); }
.result-card.paid { background: var(--green-bg); border: 2px solid var(--green); }
.result-card.unpaid { background: var(--red-bg); border: 2px solid var(--red); }
.result-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.result-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.result-card.paid .result-title { color: var(--green); }
.result-card.unpaid .result-title { color: var(--red); }
.result-detail { font-size: 14px; color: #374151; line-height: 1.7; }
.result-plate { font-size: 18px; font-weight: 600; letter-spacing: 1px; background: rgba(255,255,255,.7); display: inline-block; padding: 3px 12px; border-radius: 6px; margin: 4px 0; }

.camera-area { width: 100%; aspect-ratio: 4/3; background: #1f2937; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 14px; }
.camera-placeholder { text-align: center; color: #9aa4b2; }
.camera-placeholder p { font-size: 13px; margin-top: 10px; }
.preview { width: 100%; height: 100%; object-fit: cover; }

.btn-row { display: flex; gap: 10px; margin-bottom: 14px; }
.btn { flex: 1; padding: 14px 8px; font-size: 16px; font-weight: 600; border: none; border-radius: 12px; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-secondary { background: #e8edf5; color: var(--text); }
.btn:disabled { opacity: .55; cursor: wait; }

.manual-area { background: var(--card); border-radius: 12px; padding: 4px 14px; box-shadow: var(--shadow); }
.manual-area summary { padding: 12px 0; font-size: 14px; color: var(--muted); cursor: pointer; }
.manual-form { display: flex; gap: 8px; padding: 8px 0; }
.manual-form input { flex: 1; min-width: 0; padding: 12px; font-size: 16px; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.manual-form input:focus { border-color: var(--primary); }
.manual-form .btn { flex: 0 0 90px; }
.manual-tip { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }

.status-line { text-align: center; font-size: 13px; color: var(--muted); min-height: 20px; margin-top: 12px; }
.verify-foot { text-align: center; margin-top: 26px; }
.verify-foot a { color: var(--muted); font-size: 13px; text-decoration: none; }

/* ---------- 管理端 ---------- */
.admin-wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.admin-head h1 { font-size: 20px; margin: 0; }
.admin-head a { color: var(--muted); font-size: 13px; text-decoration: none; }
.stats-row { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 140px; background: var(--card); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.panel { background: var(--card); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel h2 { font-size: 16px; margin: 0 0 14px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.form-grid input { width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
.form-grid input:focus { border-color: var(--primary); }
.form-actions { margin-top: 12px; display: flex; gap: 10px; }
.form-actions .btn { flex: 0 0 auto; padding: 10px 24px; font-size: 14px; }
.filter-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-row input { padding: 9px 12px; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
.filter-row .btn { flex: 0 0 auto; padding: 9px 20px; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.delete-btn { color: var(--red); background: none; border: none; cursor: pointer; font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 18px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

.login-wrap { max-width: 360px; margin: 12vh auto 0; padding: 0 16px; }
.login-card { background: var(--card); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 0 0 20px; text-align: center; }
.login-card input { width: 100%; padding: 12px; margin-bottom: 12px; font-size: 15px; border: 1px solid var(--border); border-radius: 10px; outline: none; }
.login-card input:focus { border-color: var(--primary); }
.login-card .btn { width: 100%; }
.login-error { color: var(--red); font-size: 13px; text-align: center; margin-bottom: 10px; }
.login-back { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); text-decoration: none; }
