:root {
  --bg: #f4f7fb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #38bdf8;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --card: #ffffff;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.07), 0 3px 10px rgba(15, 23, 42, 0.04);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(56, 189, 248, 0.2), transparent 62%),
    radial-gradient(720px 460px at -12% 8%, rgba(37, 99, 235, 0.12), transparent 58%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

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

[hidden] {
  display: none !important;
}

.wrap {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 48px;
}

.topbar {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.28);
}

.brand-tag {
  padding: 5px 10px;
  border-radius: 999px;
  color: #475569;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 12px;
  font-weight: 600;
}

.hero {
  padding: 22px 2px 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.28;
  letter-spacing: -0.03em;
}

.hero .sub {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.push-preview {
  width: min(360px, 100%);
  margin: 22px auto 0;
  padding: 15px 16px 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
  transform: rotate(-1.2deg);
}

.push-app {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.push-app .brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 11px;
  box-shadow: none;
}

.push-time {
  margin-left: auto;
  color: #94a3b8;
  font-weight: 500;
}

.push-body {
  margin-top: 9px;
  padding-left: 32px;
}

.push-body strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.push-body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card {
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.card .hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.card-head .eyebrow {
  margin-bottom: 8px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #f8fafc;
  color: var(--ink);
  font-size: 16px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input:focus {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.input::placeholder {
  color: #94a3b8;
}

.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-hint .masked-key {
  display: inline-block;
  margin-right: 4px;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08em;
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}

.btn {
  appearance: none;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.985);
}

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

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.26);
}

.btn-primary:disabled {
  box-shadow: none;
}

.btn-ghost {
  color: #334155;
  background: #f1f5f9;
}

.btn-sm {
  width: auto;
  height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 14px;
}

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

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

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

.icon-btn,
.text-btn {
  flex: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

.text-btn {
  border-color: transparent;
  background: #f8fafc;
  color: var(--brand);
}

.plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 9px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18),
    0 8px 18px rgba(29, 78, 216, 0.24);
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.pill.green {
  background: #ecfdf5;
  color: #047857;
}

.pill.amber {
  background: #fffbeb;
  color: #b45309;
}

.pill.red {
  background: #fef2f2;
  color: #b91c1c;
}

.qr-box {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
}

#qrcode {
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  line-height: 0;
}

#qrcode canvas,
#qrcode img {
  display: block;
  width: 220px !important;
  height: 220px !important;
}

.notice-item {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #f1f5f9;
}

.notice-item:last-child {
  border-bottom: 0;
}

.notice-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.notice-dot.sent {
  background: var(--green);
}

.notice-dot.failed {
  background: var(--red);
}

.notice-dot.no_key,
.notice-dot.quota {
  background: var(--amber);
}

.notice-main {
  flex: 1;
  min-width: 0;
}

.notice-title {
  font-size: 14px;
  font-weight: 600;
}

.notice-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.footnote {
  margin: 6px 2px 0;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 50;
  max-width: calc(100% - 40px);
  padding: 11px 18px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.25s, transform 0.25s;
}

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

.toast.error {
  background: #b91c1c;
}

/* 访客页 */
.visitor-main {
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 48px;
}

.visitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px;
  color: #334155;
}

.visitor-title-sm {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink);
}

.head-pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.brand-mark.small {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.25);
}

.visitor-card {
  padding: 26px 22px 24px;
  text-align: center;
}

.car-stage {
  display: flex;
  justify-content: center;
  margin: 6px 0 16px;
}

.car-img {
  display: block;
  width: min(340px, 86%);
  height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(30, 64, 175, 0.14);
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .car-img {
    animation: none;
  }
}

.visitor-card .eyebrow {
  margin-bottom: 7px;
}

.visitor-title {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.visitor-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.visitor-plate {
  margin-bottom: 22px;
}

.notify-btn {
  height: 58px;
  font-size: 17px;
}

.notify-btn:disabled {
  opacity: 1;
  background: #e2e8f0;
  color: #64748b;
  box-shadow: none;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -4px;
  animation: spin 0.7s linear infinite;
}

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

.result {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 2px 0 18px;
  padding: 14px 15px;
  border-radius: 16px;
  font-size: 14px;
  text-align: left;
  line-height: 1.55;
}

.result.ok {
  background: #ecfdf5;
  color: #065f46;
}

.result.warn {
  background: #fffbeb;
  color: #92400e;
}

.result.err {
  background: #fef2f2;
  color: #991b1b;
}

.result.info {
  background: #eff6ff;
  color: #1e40af;
}

.result-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 21px;
  height: 21px;
  margin-top: 1px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.result.ok .result-icon {
  background: #10b981;
}

.result.warn .result-icon {
  background: #f59e0b;
}

.result.err .result-icon {
  background: #ef4444;
}

.result strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
}

.result-detail {
  opacity: 0.9;
}

.footer-note {
  margin-top: 20px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

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

.loading-state .spinner {
  border-color: rgba(37, 99, 235, 0.18);
  border-top-color: var(--brand);
}

.invalid-art {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 8px auto 16px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 28px;
  font-weight: 800;
}

@media (min-width: 640px) {
  .topbar {
    padding-top: 32px;
  }

  .wrap {
    width: min(600px, calc(100% - 48px));
  }
}

/* 车主端车辆图片 */
.car-preview {
  display: grid;
  place-items: center;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
}

.car-preview img {
  width: min(320px, 100%);
  height: auto;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(30, 64, 175, 0.12);
}

.car-preview-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
