/* ============================================================
   艮安挪车 · 全局设计系统（晴空浅色 · 明亮大气）
   ============================================================ */

:root {
  --bg-0: #f2f8ff;
  --ink: #0d2b4e;          /* 主文字：深藏蓝 */
  --ink-dim: #4a6489;      /* 次级文字 */
  --ink-faint: #5b7898;    /* 弱化文字（对白底 ≈4.6:1，满足 WCAG AA） */
  --brand: #0ea5e9;
  --brand-2: #22d3ee;
  --brand-deep: #0369a1;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --card: rgba(255, 255, 255, 0.78);
  --card-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(43, 108, 176, 0.16);
  --line-soft: rgba(43, 108, 176, 0.09);
  --radius: 24px;
  --radius-s: 14px;
  --shadow: 0 18px 50px rgba(30, 100, 170, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
          "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-0);
  min-height: 100vh;
  line-height: 1.55;
}

/* hidden 属性优先级最高（防止被 display:flex 等覆盖） */
[hidden] { display: none !important; }

/* ---------- 背景：晴空渐变 + 柔光 + 细网格 ---------- */
.app-bg {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(56, 189, 248, 0.20), transparent 62%),
    radial-gradient(720px 520px at -15% 32%, rgba(34, 211, 238, 0.16), transparent 62%),
    radial-gradient(860px 620px at 50% 115%, rgba(14, 165, 233, 0.18), transparent 62%),
    linear-gradient(180deg, #f7fbff 0%, #e9f5ff 46%, #ddf0ff 100%);
}
.app-bg::before, .app-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}
.app-bg::before {
  width: 420px; height: 420px; top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%);
}
.app-bg::after {
  width: 360px; height: 360px; bottom: -100px; left: -80px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.30), transparent 70%);
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(43, 108, 176, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 108, 176, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 95% 62% at 50% 0%, #000 28%, transparent 78%);
          mask-image: radial-gradient(ellipse 95% 62% at 50% 0%, #000 28%, transparent 78%);
}

/* ---------- 玻璃卡片（白） ---------- */
.glass {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.95);
  outline: 1px solid var(--line-soft);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
}
.glass-soft {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- 按钮 ---------- */
button { font-family: inherit; cursor: pointer; border: 0; }

.btn-hero {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 17px 24px;
  font-size: 19px; font-weight: 800; letter-spacing: 2px;
  color: #fff;
  /* 渐变整体加深一档：白字最浅处对比度 ≥3.5:1（大字标准），户外强光下仍清晰 */
  background: linear-gradient(135deg, #0a8ed0 0%, #0369a1 55%, #055e8c 100%);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(3, 105, 161, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-hero::after {
  content: ""; position: absolute; inset: -6px;
  border-radius: 999px;
  border: 1.5px solid rgba(3, 105, 161, 0.4);
  animation: pulse-ring 2.4s ease-out infinite;
  pointer-events: none;
}
.btn-hero:active { transform: scale(0.97); filter: brightness(1.06); }
.btn-hero:disabled { filter: grayscale(0.5) brightness(1.02) opacity(0.65); cursor: not-allowed; }
.btn-hero:disabled::after { animation: none; opacity: 0; }

@keyframes pulse-ring {
  0%   { transform: scale(0.98); opacity: 0.9; }
  70%  { transform: scale(1.06); opacity: 0; }
  100% { transform: scale(1.06); opacity: 0; }
}

.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 24px;
  font-size: 16px; font-weight: 600;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(30, 100, 170, 0.07);
  transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}
.btn-ghost:active { transform: scale(0.98); }
.btn-ghost:hover { background: #fff; color: var(--ink); }

.btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  font-size: 14px; font-weight: 600;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.32);
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.12s ease;
}
.btn-line:active { transform: scale(0.97); }
.btn-line:hover { background: rgba(14, 165, 233, 0.16); }

/* ---------- 输入框 ---------- */
.field { width: 100%; }
.field label { display: block; font-size: 14px; color: var(--ink-dim); margin-bottom: 8px; }
.input {
  width: 100%; padding: 14px 16px;
  font-size: 16px; font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #d3e3f3;
  border-radius: var(--radius-s);
  outline: none;
  box-shadow: 0 4px 14px rgba(30, 100, 170, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input::placeholder { color: #a4b9d4; }
.input:focus { border-color: #38bdf8; box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16); }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(12, 42, 82, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease;
}
@media (min-width: 560px) { .overlay { align-items: center; } }

.sheet {
  width: 100%; max-width: 480px;
  max-height: 86vh; overflow-y: auto;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #ffffff, #f5faff);
  border: 1px solid rgba(255, 255, 255, 1);
  outline: 1px solid var(--line-soft);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 60px rgba(12, 42, 82, 0.25);
  animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
}
@media (min-width: 560px) {
  .sheet { border-radius: 28px; margin: 0 16px; box-shadow: 0 24px 70px rgba(12, 42, 82, 0.28); }
}
.sheet-title { font-size: 19px; font-weight: 800; text-align: center; color: var(--ink); }
.sheet-sub { font-size: 13.5px; color: var(--ink-dim); text-align: center; margin-top: 6px; }
.sheet-close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  color: var(--ink-dim); background: rgba(43, 108, 176, 0.08);
  font-size: 16px; line-height: 1;
}

/* ---------- 吐司 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 99;
  transform: translateX(-50%);
  max-width: 82vw;
  padding: 11px 20px;
  font-size: 14.5px; text-align: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(12, 42, 82, 0.22);
  animation: toast-in 0.25s ease;
}
.toast.err { border-color: rgba(239, 68, 68, 0.45); color: #b91c1c; }
.toast.ok  { border-color: rgba(16, 185, 129, 0.45); color: #047857; }

/* ---------- 通用小元素 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-size: 12.5px; font-weight: 700;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #047857;
}
.pill.blue { background: rgba(14, 165, 233, 0.1); border-color: rgba(14, 165, 233, 0.32); color: #0369a1; }
.pill.warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.38); color: #b45309; }
.pill.err  { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.35); color: #b91c1c; }
.pill.gray { background: rgba(74, 100, 137, 0.08); border-color: var(--line); color: var(--ink-dim); }

/* ---------- 动画 ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.25, 1) backwards; }
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.13s; }
.d3 { animation-delay: 0.2s; }
.d4 { animation-delay: 0.27s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
