/* ============================================================
   共享车位 MVP Demo - 小程序风格样式
   ============================================================ */

:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --yellow: #f7b500;
  --blue: #2979ff;
  --red: #fa5151;
  --bg: #f5f6f7;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #9aa0a6;
  --border: #ececec;
  --radius: 14px;
}

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

html, body {
  height: 100%;
  background: #e8eaed;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 15px;
}

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

/* 手机容器 */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.15);
}
@media (min-width: 431px) {
  .phone { height: 92vh; margin-top: 4vh; border-radius: 28px; }
}

/* 状态栏 */
.status-bar {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  z-index: 20;
}

/* 视图层 */
.view {
  position: absolute;
  inset: 34px 0 0 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
}
.view.active { display: flex; }
.view.active:has(#map) { overflow: hidden; }

/* 通用按钮 */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:active { background: var(--green-dark); }
.btn-wechat { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn-block { width: 100%; margin-top: 12px; }
.btn-logout { background: #fff; color: var(--red); border: 1px solid var(--border); margin: 16px; }

/* 顶部导航 */
.nav-bar {
  flex: 0 0 auto;
  height: 50px;
  display: flex;
  align-items: center;
  background: var(--green);
  color: #fff;
  padding: 0 8px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.nav-back { background: none; border: none; color: #fff; font-size: 30px; width: 40px; cursor: pointer; line-height: 1; }
.nav-title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; margin-right: 40px; }

/* ---------- 启动页 ---------- */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: linear-gradient(180deg, #e8fff1 0%, #f5f6f7 55%);
}
.splash-logo {
  width: 96px; height: 96px;
  background: var(--green);
  border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
  box-shadow: 0 12px 30px rgba(7,193,96,0.35);
  margin-bottom: 22px;
}
.splash-title { font-size: 30px; font-weight: 700; letter-spacing: 2px; }
.splash-sub { color: var(--muted); margin: 10px 0 60px; font-size: 16px; }
.splash-actions { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.splash-tip { margin-top: 24px; font-size: 12px; color: var(--muted); }

/* ---------- 登录页 ---------- */
.login-body { flex: 1; padding: 36px 28px; }
.login-logo { font-size: 56px; text-align: center; margin-bottom: 24px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field em { color: var(--red); font-style: normal; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--green); }
.field-code { position: relative; }
.field-code input { padding-right: 110px; }
.btn-code {
  position: absolute; right: 6px; top: 30px;
  padding: 8px 12px;
  border: none; border-radius: 8px;
  background: #e8fff1; color: var(--green);
  font-size: 13px; cursor: pointer;
}
.btn-code:disabled { color: var(--muted); }
.agree { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 6px 0 20px; }
.agree input { width: 16px; height: 16px; }
.login-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }

/* ---------- 首页 ---------- */
.home-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.loc { display: flex; align-items: center; gap: 10px; }
.loc-icon { font-size: 22px; }
.loc-text b { display: block; font-size: 15px; }
.loc-text small { color: var(--muted); font-size: 11px; }
.btn-publish-mini { background: var(--green); color: #fff; border: none; border-radius: 18px; padding: 8px 14px; font-size: 13px; cursor: pointer; }

.filter-bar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}
.filter-group { display: flex; gap: 6px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }

#map { flex: 1 1 auto; min-height: 0; background: #dfe3e6; }
.map-fallback { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); text-align: center; line-height: 1.8; padding: 20px; }

/* 底部列表 */
.list-sheet {
  flex: 0 0 42%;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.list-sheet-handle { width: 40px; height: 4px; background: #d9d9d9; border-radius: 2px; margin: 8px auto 2px; flex: 0 0 auto; }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 10px; font-size: 14px; flex: 0 0 auto; }
.list-head b { color: var(--green); }
.btn-realtime { background: #fff7e6; color: #e6a100; border: 1px solid #ffd980; border-radius: 16px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.list { flex: 1; overflow-y: auto; padding: 0 14px 14px; }

.space-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--bg);
  border-radius: 12px;
  cursor: pointer;
}
.space-card:active { transform: scale(0.99); }
.space-thumb {
  width: 56px; height: 56px; flex: 0 0 auto;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.space-info { flex: 1; min-width: 0; }
.space-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.space-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.space-meta.muted { color: #c0c4c8; }
.space-price { text-align: right; }
.space-price b { font-size: 20px; color: var(--red); }
.space-price span { font-size: 12px; color: var(--muted); }

.tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.tag-green { background: #e8fff1; color: var(--green); }
.tag-yellow { background: #fff7e6; color: #d98a00; }
.tag-locked { background: #f0f0f0; color: #888; }
.tag-free { background: #e8fff1; color: var(--green); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 地图 marker */
.space-marker { background: none; border: none; }
.marker-bubble {
  width: 40px; height: 40px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
}
.marker-bubble span { transform: rotate(45deg); color: #fff; font-size: 10px; font-weight: 700; }

/* ---------- 详情页 ---------- */
.detail-body { flex: 1; overflow-y: auto; }
.detail-hero { height: 150px; display: flex; align-items: center; justify-content: center; }
.detail-hero-icon { font-size: 60px; }
.detail-card { background: #fff; border-radius: 16px 16px 0 0; margin-top: -20px; padding: 20px 18px; position: relative; }
.detail-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.detail-tags { display: flex; gap: 8px; margin-bottom: 16px; }
.detail-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.detail-row span { color: var(--muted); flex: 0 0 auto; margin-right: 12px; }
.detail-row b { font-weight: 500; text-align: right; }
.detail-desc { margin-top: 14px; font-size: 14px; color: #555; line-height: 1.6; }
.detail-note { margin-top: 14px; padding: 12px; background: #fff7e6; border-radius: 10px; font-size: 12px; color: #a06b00; line-height: 1.6; }
.detail-footer {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
}
.detail-price b { font-size: 24px; color: var(--red); }
.detail-price span { font-size: 13px; color: var(--muted); }
.detail-footer .btn { flex: 1; }

/* ---------- 发布页 ---------- */
.publish-body { flex: 1; padding: 16px; padding-bottom: 30px; }
.publish-type { display: flex; gap: 10px; margin-bottom: 16px; }
.ptype {
  flex: 1; text-align: center; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 14px; cursor: pointer;
}
.ptype input { display: none; }
.ptype.active { border-color: var(--green); background: #e8fff1; color: var(--green); font-weight: 600; }
.upload-box {
  border: 1px dashed #ccc; border-radius: 10px;
  padding: 20px; text-align: center; color: var(--muted);
  background: #fff; cursor: pointer; margin-bottom: 18px; font-size: 14px;
}
.upload-box span { font-size: 22px; vertical-align: middle; }

/* ---------- 实时找车位 ---------- */
.rt-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 28px 32px 40px; }
.rt-radar { position: relative; width: 180px; height: 180px; margin-bottom: 30px; }
.rt-pulse {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--green);
  animation: pulse 2s infinite;
}
.rt-pulse2 { animation-delay: 1s; }
.rt-car { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 56px; }
@keyframes pulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
.rt-text { color: var(--muted); margin-bottom: 24px; text-align: center; }

/* ---------- 个人中心 ---------- */
.profile-head {
  display: flex; align-items: center; gap: 14px;
  padding: 24px 18px;
  background: linear-gradient(135deg, #07c160, #05b855);
  color: #fff;
}
.avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
}
.profile-info { flex: 1; }
.profile-info b { font-size: 18px; display: block; }
.profile-info small { font-size: 12px; opacity: 0.85; }
.btn-realname { background: #fff; color: var(--green); border: none; border-radius: 16px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.profile-stats {
  display: flex; background: #fff; margin: 12px; border-radius: 12px;
  padding: 16px 0;
}
.stat { flex: 1; text-align: center; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
.menu { background: #fff; margin: 0 12px; border-radius: 12px; overflow: hidden; }
.menu-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 15px; cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item span { color: #ccc; font-size: 18px; }

/* ---------- 底部 Tab ---------- */
.tab-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 30;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: none; border: none; font-size: 11px; color: var(--muted); cursor: pointer;
  gap: 2px;
}
.tab span { font-size: 20px; }
.tab.active { color: var(--green); font-weight: 600; }

/* ---------- Toast / Modal ---------- */
.toast {
  position: absolute; left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78); color: #fff;
  padding: 12px 22px; border-radius: 10px;
  font-size: 14px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }
.modal-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 90; padding: 40px;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 320px; }
.modal-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.modal-text { font-size: 14px; color: #444; line-height: 1.6; margin-bottom: 6px; }
.modal-text.muted { color: var(--muted); font-size: 13px; }
.modal-sub { font-size: 13px; color: var(--muted); margin: 12px 0 8px; }
.bill-breakdown { margin: 6px 0; }
.settings-row { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.settings-row:last-of-type { border-bottom: none; margin-bottom: 12px; }
.settings-row b { font-weight: 400; color: var(--muted); }

/* ============ 订单 / 计时计费 ============ */
.order-body { flex: 1; overflow-y: auto; padding: 14px; }
.order-status-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px;
}
.order-status-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.dot-green { background: var(--green); box-shadow: 0 0 0 4px #e8fff1; }
.dot-gray { background: #bbb; box-shadow: 0 0 0 4px #f0f0f0; }
.dot-red { background: var(--red); box-shadow: 0 0 0 4px #ffecec; }
.order-status-card b { font-size: 17px; display: block; }
.order-status-card small { color: var(--muted); font-size: 12px; }

.order-space { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.order-space-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.order-space-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

.order-timer { background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 12px; text-align: center; }
.order-timer-label { font-size: 13px; color: var(--muted); }
.order-timer-val { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0; color: var(--green); }
.order-timer-sub { font-size: 12px; color: var(--muted); }

.order-bill { background: #fff; border-radius: 14px; padding: 6px 16px; margin-bottom: 12px; }
.bill-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.bill-row:last-child { border-bottom: none; }
.bill-row span { color: #666; }
.bill-row b { font-weight: 600; }
.bill-row.total b { font-size: 18px; color: var(--red); }

.order-rule { font-size: 12px; color: #a06b00; background: #fff7e6; border-radius: 10px; padding: 10px 12px; line-height: 1.6; margin-bottom: 12px; }
.order-controls { display: flex; flex-direction: column; gap: 10px; }
.order-actions { display: flex; gap: 10px; }
.order-actions .btn, .order-actions .mini-btn { flex: 1; }
.order-hint { text-align: center; font-size: 12px; color: var(--muted); }
.order-hint b { color: var(--red); }
.paid-banner { text-align: center; padding: 14px; border-radius: 12px; background: #e8fff1; color: var(--green); font-weight: 600; }
.paid-banner.warn { background: #fff0f0; color: var(--red); }

.btn-ghost { background: #fff; color: #333; border: 1px solid var(--border); }
.btn-ghost.danger { color: var(--red); border-color: #ffd6d6; }
.mini-btn {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; font-size: 13px; cursor: pointer; text-align: center; color: #333;
}
.mini-btn.danger { color: var(--red); border-color: #ffd6d6; }
.mini-btn:active { background: #f5f5f5; }

.pay-method {
  display: block; width: 100%; text-align: left;
  padding: 13px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 15px; cursor: pointer;
}
.pay-method:active { background: #f5f5f5; }

.agree-opts { display: flex; gap: 10px; margin: 8px 0 4px; }
.agree-opt {
  flex: 1; padding: 14px 8px; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer;
}
.agree-opt b { display: block; font-size: 20px; color: var(--green); }
.agree-opt small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.agree-opt:active { background: #e8fff1; }

/* ============ 子列表（订单/发布/消息） ============ */
.sub-list { flex: 1; overflow-y: auto; padding: 14px; }
.order-card, .pub-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
.pub-card { cursor: default; }
.oc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.oc-top b { font-size: 15px; }
.oc-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.oc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.oc-time { font-size: 12px; color: var(--muted); }
.oc-amount { font-size: 17px; font-weight: 700; }
.pub-actions { display: flex; gap: 10px; margin-top: 12px; }
.pub-actions .mini-btn { flex: 1; }

/* ============ 钱包 ============ */
.wallet-body { flex: 1; overflow-y: auto; padding: 14px; }
.wallet-card {
  background: linear-gradient(135deg, #07c160, #05b855);
  border-radius: 16px; color: #fff; padding: 22px 18px; margin-bottom: 16px;
}
.wallet-card span { font-size: 13px; opacity: 0.9; }
.wallet-card > b { display: block; font-size: 36px; margin: 8px 0 14px; }
.wallet-actions { display: flex; gap: 10px; }
.wallet-actions .mini-btn { flex: 1; background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); color: #fff; }
.wallet-title { font-size: 13px; color: var(--muted); margin: 16px 4px 8px; }
.wallet-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 8px;
}
.wallet-icon { font-size: 24px; }
.wallet-info { flex: 1; }
.wallet-info b { display: block; font-size: 15px; }
.wallet-info small { font-size: 12px; color: var(--muted); }
.arrow { color: #ccc; font-size: 18px; }

/* ============ 消息 ============ */
.msg-item { display: flex; gap: 12px; background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.msg-icon { font-size: 26px; }
.msg-info { flex: 1; }
.msg-info b { font-size: 15px; }
.msg-info p { font-size: 13px; color: #555; line-height: 1.5; margin: 4px 0; }
.msg-info small { font-size: 11px; color: var(--muted); }

/* ============ 实时找车位表单 ============ */
.rt-form { width: 100%; margin-top: 10px; }
.rt-body { align-items: center; }
.rt-radar { margin-bottom: 20px; }

/* ============ 消息红点 ============ */
.badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  background: var(--red); color: #fff; font-size: 11px; text-align: center;
  border-radius: 9px; padding: 0 5px;
}
