/* ===================== 油耗确认 · 明亮浅色科技风 ===================== */
:root {
  --bg0: #e9eefa;
  --bg1: #f6f9ff;
  --panel: #ffffff;
  --panel-2: #f1f5fd;
  --border: rgba(60, 100, 180, 0.14);
  --border-strong: rgba(40, 110, 210, 0.30);
  --text: #16203a;
  --muted: #66748e;
  --accent: #0aa2e6;     /* cyan */
  --accent-2: #7c5cff;   /* violet */
  --accent-3: #12b886;   /* eco green */
  --green: #12b886;      /* 实际支付/节省 */
  --accent-4: #ff4d6d;   /* red (receipt delete) */
  --danger: #ff4d6d;
  --pink-deep: #0aa2e6;  /* 兼容旧引用：数值统一用青色 */
  --shadow: 0 8px 24px rgba(30, 60, 120, 0.10);
  --glow: 0 0 12px rgba(10, 162, 230, 0.22);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(1200px 700px at 82% -12%, rgba(124, 92, 255, 0.12), transparent 60%),
              radial-gradient(900px 600px at -10% 8%, rgba(10, 162, 230, 0.12), transparent 55%),
              linear-gradient(180deg, var(--bg1), var(--bg0));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* 网格背景（浅） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(60, 120, 200, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 120, 200, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 82%);
}
#app-glow {
  position: fixed; left: 50%; top: -160px; width: 520px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(10, 162, 230, 0.10), transparent 65%);
  filter: blur(20px); z-index: -1; pointer-events: none;
}

#view { max-width: 560px; margin: 0 auto; padding: 0 14px 96px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding: 18px 14px 14px; margin: 0 -14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.66));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 {
  margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 1.5px;
  background: linear-gradient(90deg, #16203a, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .sub {
  margin-top: 5px; font-size: 12.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: rgba(10, 162, 230, 0.07);
}
.topbar .sub::before { content: "▾"; color: var(--accent); font-size: 10px; }
.topbar .act {
  border: 1px solid var(--border-strong); background: rgba(10, 162, 230, 0.10);
  color: var(--accent); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 10px;
  cursor: pointer; box-shadow: var(--glow); white-space: nowrap;
}
.topbar .act:active { transform: scale(0.97); }

/* ---------- stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-box::after {
  content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px;
  background: radial-gradient(circle, rgba(10, 162, 230, 0.12), transparent 70%); filter: blur(6px);
}
.stat-box .lbl { font-size: 11.5px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.stat-box .val { margin-top: 6px; font-size: 22px; font-weight: 800; font-family: var(--mono);
  color: var(--text); letter-spacing: 0.5px; }
.stat-box .val small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-box.accent { border-color: var(--border-strong);
  background: linear-gradient(135deg, rgba(10, 162, 230, 0.12), rgba(124, 92, 255, 0.08)); }
.stat-box.accent .val { color: var(--accent); }
.stat-box.save { border-color: rgba(18, 184, 134, 0.45);
  background: linear-gradient(135deg, rgba(18, 184, 134, 0.14), rgba(10, 162, 230, 0.06)); }
.stat-box.save .val { color: var(--green); }

/* ---------- cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .12s;
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 12px 30px rgba(30, 60, 120, 0.16); }
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card .nm { font-weight: 700; font-size: 16px; }
.card .mt { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card .muted { color: var(--muted); }
.card .big-num { font-family: var(--mono); font-weight: 800; color: var(--text); letter-spacing: 0.5px; }

/* ---------- tags ---------- */
.tag {
  display: inline-flex; align-items: center; font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.tag.amb { color: var(--accent); border-color: var(--border-strong); background: rgba(10, 162, 230, 0.08); }
.tag.full { color: var(--accent-3); border-color: rgba(18, 184, 134, 0.4); background: rgba(18, 184, 134, 0.10); }
.tag.blue { color: var(--accent); border-color: var(--border-strong); background: rgba(10, 162, 230, 0.08); }
.tag.photo { color: var(--accent-2); border-color: rgba(124, 92, 255, 0.45); background: rgba(124, 92, 255, 0.12); cursor: pointer; }
.tag.photo:hover { background: rgba(124, 92, 255, 0.22); }

/* ---------- receipt photo ---------- */
.receipt-empty { font-size: 12.5px; color: var(--muted); padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; text-align: center; }
.receipt-thumb { position: relative; width: max-content; max-width: 100%; }
.receipt-thumb img { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border-strong); box-shadow: 0 0 14px rgba(10, 162, 230, 0.18); cursor: zoom-in; }
.receipt-del { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: none;
  background: var(--accent-4); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(255, 77, 109, 0.5); }

/* ---------- section title ---------- */
.section-title { display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px; font-size: 14px; font-weight: 700; letter-spacing: 0.5px; }
.section-title .bar { width: 4px; height: 16px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: var(--glow); }

/* ---------- chart ---------- */
.chart { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 4px; box-shadow: var(--shadow); }
.chart svg polyline { filter: drop-shadow(0 1px 3px rgba(10, 162, 230, 0.4)); }

/* ---------- detail row ---------- */
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--muted); }
.detail-row b { font-family: var(--mono); color: var(--accent); }

/* ---------- entry card ---------- */
.entry-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; margin: 12px 0;
  border: 1.5px dashed var(--border-strong); border-radius: 16px; cursor: pointer;
  background: rgba(10, 162, 230, 0.04); color: var(--accent); transition: background .2s, box-shadow .2s;
}
.entry-card:hover { background: rgba(10, 162, 230, 0.09); box-shadow: var(--glow); }
.entry-card .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(10, 162, 230, 0.12); border: 1px solid var(--border-strong); color: var(--accent); }
.entry-card .t { font-weight: 700; color: var(--text); }
.entry-card .d { font-size: 12.5px; color: var(--muted); }

/* ---------- empty ---------- */
.empty { text-align: center; color: var(--muted); padding: 30px 16px; }
.empty .em { font-size: 40px; display: inline-block; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: 11px; padding: 11px 16px; font-size: 15px; font-weight: 700;
  cursor: pointer; color: #ffffff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(10, 162, 230, 0.30); transition: transform .12s, box-shadow .2s;
}
.btn:hover { box-shadow: 0 8px 22px rgba(10, 162, 230, 0.42); }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: var(--panel); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn.ghost:hover { border-color: var(--border-strong); background: var(--panel-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(255, 77, 109, 0.5); box-shadow: none; }
.btn.danger:hover { background: rgba(255, 77, 109, 0.10); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btnrow { display: flex; gap: 10px; margin-top: 4px; }
.btnrow .btn { flex: 1; }

/* ---------- form fields ---------- */
.field { margin: 10px 0; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.5px; }
.input, .select {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--border);
  background: #ffffff; color: var(--text); font-size: 15px; font-family: var(--sans);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: var(--glow); }
.select { appearance: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auto-badge { float: right; font-size: 11px; color: var(--accent); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 1px 8px; cursor: pointer; background: rgba(10, 162, 230, 0.08); }

/* ---------- modal & sheet ---------- */
.modal-mask, .sheet-mask {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 35, 70, 0.35); backdrop-filter: blur(4px); padding: 16px;
}
.sheet-mask { align-items: flex-end; padding: 0; }
.modal-mask.hidden, .sheet-mask.hidden { display: none; }
.modal, .sheet-card {
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-strong); border-radius: 18px; padding: 18px;
  box-shadow: 0 20px 50px rgba(20, 40, 90, 0.22);
}
.sheet-card { max-width: 560px; border-radius: 20px 20px 0 0; border-bottom: none;
  animation: slideUp .25s ease; padding-bottom: 26px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal h3, .sheet-card h3 { margin: 0 0 14px; font-size: 18px; letter-spacing: 0.5px;
  background: linear-gradient(90deg, #16203a, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.modal-actions .btn { flex: 0 0 auto; }

/* sheet items (车辆切换) */
.sheet-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 12px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 8px;
  background: var(--panel); cursor: pointer; }
.sheet-item.sel { border-color: var(--border-strong); background: rgba(10, 162, 230, 0.08); }
.sheet-item .nm { font-weight: 700; }
.sheet-item .mt { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- cloud bits ---------- */
.glass-panel { background: linear-gradient(135deg, rgba(10, 162, 230, 0.06), rgba(124, 92, 255, 0.06)); }
.cloud-dot { width: 9px; height: 9px; border-radius: 50%; background: #c2ccdd; box-shadow: 0 0 0 3px rgba(194, 204, 221, 0.3); }
.cloud-dot.on { background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3), 0 0 0 3px rgba(18, 184, 134, 0.2); }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0; }
.hint { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6;
  border-left: 2px solid var(--border-strong); padding-left: 10px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px;
  display: flex; justify-content: space-around; z-index: 40;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.97));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1;
  color: var(--muted); font-size: 11px; text-decoration: none; padding: 5px 0; cursor: pointer;
  border-radius: 12px; transition: color .2s; }
.bottom-nav a svg { stroke: currentColor; transition: filter .2s, transform .2s; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active svg { filter: drop-shadow(0 1px 4px rgba(10, 162, 230, 0.6)); transform: translateY(-1px); }
.bottom-nav a.active::after { content: ""; width: 18px; height: 3px; border-radius: 3px;
  background: var(--accent); box-shadow: var(--glow); margin-top: 1px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 60;
  background: rgba(22, 32, 58, 0.94); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(20, 40, 90, 0.3); max-width: 86%; text-align: center;
}
.toast.hidden { display: none; }

/* ---------- misc ---------- */
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.checkbox-row label { font-size: 14px; color: var(--text); margin: 0; cursor: pointer; }

/* ---------- 未登录云端提醒横幅 ---------- */
.cloud-banner {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px;
  border-radius: 12px; background: linear-gradient(135deg, #fff4e6, #ffe6cf);
  border: 1px solid #ffb27a; color: #7a4a12; font-size: 13px; line-height: 1.4;
  cursor: pointer; box-shadow: 0 6px 16px rgba(255, 140, 40, 0.18);
  animation: cbbounce .35s ease;
}
@keyframes cbbounce { from { transform: translateY(-6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cloud-banner .cb-ico { font-size: 18px; flex: none; }
.cloud-banner .cb-txt { flex: 1; }
.cloud-banner .cb-txt b { color: #b3540a; }
.cloud-banner .cb-x {
  flex: none; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.06); color: #7a4a12; font-size: 16px; line-height: 1;
  cursor: pointer; transition: background .15s;
}
.cloud-banner .cb-x:hover { background: rgba(0, 0, 0, 0.12); }

/* ---------- 个人资料：昵称 + 头像 ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; }
.avatar-wrap { position: relative; flex: none; cursor: pointer; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border-strong);
  background: var(--panel-2); box-shadow: var(--shadow); display: block;
}
.avatar-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: var(--accent);
  background: linear-gradient(135deg, #e7f3ff, #efe9ff);
}
.avatar.sm { width: 42px; height: 42px; font-size: 18px; }
.avatar-edit {
  position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: var(--glow);
}
.profile-meta { flex: 1; min-width: 0; }
.profile-meta .field { margin: 0; }
.profile-meta .field label { font-size: 12px; }
