/* ========================================
   自助挪车系统 - 手机端样式
   配色：蓝白主题
======================================== */
:root {
  --primary: #1a6fe8;
  --primary-dark: #1456c0;
  --primary-light: #e8f1ff;
  --secondary: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #f0a500;
  --info: #17a2b8;
  --white: #ffffff;
  --bg: #f4f7fb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-sub: #6c757d;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(26,111,232,0.10);
  --header-h: 54px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; outline: none; }
input, textarea { -webkit-appearance: none; }

/* ─── 顶部导航 ──────────────────────────────────── */
.m-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--primary);
  display: flex; align-items: center; padding: 0 16px;
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26,111,232,0.3);
}
.m-header-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.btn-back { background: none; border: none; color: var(--white); font-size: 20px; padding: 8px; cursor: pointer; }
.btn-icon { background: none; border: none; color: var(--white); font-size: 20px; padding: 8px; cursor: pointer; position: relative; }
.badge-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }
.scan-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }

/* ─── 认证页 ──────────────────────────────────────── */
.auth-page { background: linear-gradient(160deg, #1a6fe8 0%, #1456c0 40%, #e8f1ff 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-wrap { width: 100%; max-width: 420px; padding: 24px 20px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 12px; }
.site-name { color: var(--white); font-size: 24px; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.site-slogan { color: rgba(255,255,255,0.8); font-size: 14px; margin-top: 4px; }
.auth-card { background: var(--white); border-radius: 20px; padding: 28px 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.auth-tips { text-align: center; color: var(--text-sub); font-size: 13px; margin-top: 16px; }

/* ─── 表单 ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.required { color: var(--danger); }
.input-row { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; background: #fafbfd; transition: border-color 0.2s; overflow: hidden; }
.input-row:focus-within { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px rgba(26,111,232,0.1); }
.input-prefix { padding: 0 12px; color: var(--text-sub); font-size: 16px; }
.input-row input { flex: 1; border: none; background: transparent; padding: 13px 12px 13px 4px; font-size: 15px; }
.code-row .btn-code { border: none; background: var(--primary-light); color: var(--primary); font-size: 13px; font-weight: 600; padding: 0 14px; height: 100%; cursor: pointer; white-space: nowrap; border-left: 1px solid var(--border); transition: background 0.2s; }
.code-row .btn-code:disabled { color: var(--text-sub); background: #f0f0f0; cursor: not-allowed; }
input[type=text], input[type=tel], input[type=number], input[type=email], textarea, select {
  display: block; width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 13px 14px; font-size: 15px; background: #fafbfd; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px rgba(26,111,232,0.1); }
textarea { resize: vertical; min-height: 80px; }
.input-plate { text-transform: uppercase; font-size: 18px; font-weight: 700; letter-spacing: 2px; text-align: center; }

/* ─── 按钮 ──────────────────────────────────────── */
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--white); border: none; border-radius: 10px; padding: 14px 24px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.1s; }
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); border-radius: 10px; padding: 13px 24px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-outline:active { background: var(--primary-light); }
.btn-success { background: var(--success); color: var(--white); border: none; border-radius: 8px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-danger { background: var(--danger); color: var(--white); border: none; border-radius: 8px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 7px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-large { padding: 16px; font-size: 16px; }
.btn-add-vehicle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: 2px dashed var(--primary); background: var(--primary-light); color: var(--primary); border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 12px; }
.btn-location { border: none; background: var(--primary-light); color: var(--primary); padding: 0 14px; font-size: 18px; cursor: pointer; border-radius: 0 10px 10px 0; min-width: 48px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ─── 用户卡片 ──────────────────────────────────── */
.user-card { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); margin: 0; padding: 20px 16px; display: flex; align-items: center; gap: 14px; }
.avatar-circle { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.25); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; border: 2px solid rgba(255,255,255,0.5); flex-shrink: 0; }
.user-info { flex: 1; }
.user-name { color: var(--white); font-size: 18px; font-weight: 700; }
.user-phone { color: rgba(255,255,255,0.8); font-size: 14px; margin-top: 2px; }
.user-card .btn-outline { border-color: rgba(255,255,255,0.7); color: var(--white); padding: 7px 14px; font-size: 13px; }

/* ─── 统计 ──────────────────────────────────────── */
.stat-row { display: flex; background: var(--white); border-bottom: 1px solid var(--border); }
.stat-item { flex: 1; text-align: center; padding: 16px 8px; cursor: pointer; transition: background 0.2s; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-item:active { background: var(--primary-light); }
.stat-num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ─── 卡片/列表 ─────────────────────────────────── */
.menu-section { background: var(--white); margin-top: 10px; padding: 16px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-left: 10px; border-left: 3px solid var(--primary); }
.form-section { background: var(--white); border-radius: var(--radius); margin-bottom: 12px; padding: 16px; }
.form-section-title { font-size: 14px; font-weight: 700; color: var(--text-sub); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-page { padding: 12px 14px 24px; }
.form-actions { margin-top: 8px; }
.list-page { padding: 10px 14px; }

/* ─── 车辆卡片 ──────────────────────────────────── */
.vehicle-card { background: var(--card-bg); border-radius: var(--radius); border: 1.5px solid var(--border); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.vehicle-card-full { background: var(--card-bg); border-radius: var(--radius); border: 1.5px solid var(--border); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.vehicle-plate { display: inline-block; background: var(--primary); color: var(--white); font-size: 18px; font-weight: 800; padding: 4px 14px; border-radius: 6px; letter-spacing: 2px; }
.vehicle-plate.plate-yellow { background: #f0a500; }
.vehicle-plate-large { font-size: 28px; font-weight: 900; color: var(--white); letter-spacing: 4px; text-align: center; margin-bottom: 8px; }
.vehicle-info { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; color: var(--text-sub); }
.vehicle-phone { color: var(--primary); }
.vehicle-actions { display: flex; gap: 8px; margin-top: 10px; }
.vc-header { background: linear-gradient(90deg, var(--primary-light), #fff); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.vc-body { padding: 12px 16px; }
.vc-row { display: flex; gap: 8px; font-size: 14px; padding: 4px 0; }
.vc-label { color: var(--text-sub); min-width: 72px; }
.vc-actions { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.plate-color-tag { font-size: 12px; background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 4px; }

/* ─── 挪车记录卡片 ──────────────────────────────── */
.record-card { border-radius: var(--radius); padding: 14px; margin-bottom: 10px; border-left: 4px solid var(--border); background: var(--white); box-shadow: var(--shadow); }
.record-card.urgency-2 { border-left-color: var(--warning); background: #fffdf5; }
.record-card.urgency-3 { border-left-color: var(--danger); background: #fff5f5; }
.record-card-full { background: var(--card-bg); border-radius: var(--radius); border: 1.5px solid var(--border); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow); }
.record-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.plate-tag { background: var(--primary); color: var(--white); font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 5px; letter-spacing: 1px; }
.urgency-tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--primary-light); color: var(--primary); }
.time-tag { font-size: 12px; color: var(--text-sub); margin-left: auto; }
.record-location { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.record-msg { font-size: 13px; color: var(--text-sub); }
.record-actions { display: flex; gap: 8px; margin-top: 10px; }
.rc-header { background: var(--primary-light); padding: 10px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-body { padding: 10px 14px; }
.rc-row { display: flex; gap: 8px; font-size: 14px; padding: 3px 0; }
.rc-time { font-size: 12px; color: var(--text-sub); margin-left: auto; }
.rc-actions { padding: 8px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.reply-row { color: var(--success); }

/* ─── 消息通知 ──────────────────────────────────── */
.notice-card { background: var(--white); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); border: 1.5px solid var(--border); }
.notice-card.unread { border-left: 3px solid var(--primary); }
.notice-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.notice-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.notice-content { font-size: 14px; color: var(--text-sub); line-height: 1.7; }
.notice-time { font-size: 12px; color: var(--text-sub); margin-left: auto; }

/* ─── 扫码挪车页 ──────────────────────────────── */
.scan-page { background: var(--bg); }
.vehicle-info-card { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); padding: 20px 16px; color: var(--white); }
.vehicle-details { font-size: 14px; color: rgba(255,255,255,0.85); margin-top: 6px; }
.owner-contact { font-size: 14px; color: rgba(255,255,255,0.9); margin-top: 8px; }
.urgency-group { display: flex; gap: 8px; }
.urgency-item { flex: 1; text-align: center; padding: 10px 6px; border-radius: 10px; border: 1.5px solid var(--border); cursor: pointer; font-size: 14px; transition: all 0.2s; background: var(--white); }
.urgency-item.active { border-color: var(--primary); background: var(--primary); color: var(--white); font-weight: 600; }
.urgency-item.urgency-2.active { background: var(--warning); border-color: var(--warning); }
.urgency-item.urgency-3.active { background: var(--danger); border-color: var(--danger); }
.location-row { display: flex; gap: 0; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; background: #fafbfd; }
.location-row:focus-within { border-color: var(--primary); }
.location-row input { border: none; border-radius: 0; background: transparent; padding: 13px 14px; flex: 1; }
.location-row input:focus { box-shadow: none; }

/* ─── 结果页 ──────────────────────────────────── */
.result-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg); }
.result-icon { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 36px; margin-bottom: 20px; }
.success-icon { background: linear-gradient(135deg, #28a745, #20c060); color: var(--white); }
.result-page h2 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.result-desc { color: var(--text-sub); font-size: 15px; text-align: center; margin-bottom: 24px; }
.countdown-box { background: var(--white); border-radius: var(--radius); padding: 20px 32px; text-align: center; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 220px; }
.countdown-label { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.countdown-timer { font-size: 42px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.poll-result { margin-bottom: 16px; text-align: center; }
.poll-status { font-size: 16px; font-weight: 600; color: var(--text); padding: 10px 20px; background: var(--white); border-radius: 8px; }
.poll-status.status-1 { color: var(--success); }
.poll-status.status-2 { color: var(--primary); }
.poll-status.status-3 { color: var(--text-sub); }
.poll-status.status-4 { color: var(--danger); }
.result-detail-card { background: var(--white); border-radius: var(--radius); padding: 16px; width: 100%; max-width: 400px; margin-bottom: 16px; }
.reply-label { font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.reply-content { font-size: 15px; color: var(--text); font-weight: 600; }
.reply-time { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* ─── 状态页 ──────────────────────────────────── */
.scan-state { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--text-sub); padding: 40px; text-align: center; }
.state-icon { font-size: 56px; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 快捷功能 ──────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item { text-align: center; padding: 14px 8px; background: var(--primary-light); border-radius: var(--radius); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.quick-item:active { transform: scale(0.95); }
.quick-icon { font-size: 24px; margin-bottom: 6px; }
.quick-label { font-size: 12px; color: var(--text); font-weight: 600; }

/* ─── 二维码弹窗 ────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-box { background: var(--white); border-radius: 20px; padding: 24px 20px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.qr-plate { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: 3px; margin-bottom: 12px; }
.qr-img { width: 240px; height: 240px; border-radius: 12px; border: 2px solid var(--border); margin: 8px auto; display: block; }
.qr-tips { font-size: 13px; color: var(--text-sub); margin: 10px 0 16px; line-height: 1.7; }

/* ─── 过滤标签 ──────────────────────────────── */
.filter-tabs { background: var(--white); display: flex; border-bottom: 1px solid var(--border); padding: 0 12px; overflow-x: auto; }
.tab { flex-shrink: 0; background: none; border: none; padding: 12px 16px; font-size: 14px; color: var(--text-sub); cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; font-weight: 500; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ─── 分页 ──────────────────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 16px; }
.pagination button { background: var(--primary); color: var(--white); border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; }
.pagination span { color: var(--text-sub); font-size: 14px; }

/* ─── 徽章 ──────────────────────────────────── */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-secondary { background: #e2e3e5; color: #383d41; }

/* ─── 空页面 ──────────────────────────────────── */
.empty-page { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-page p { color: var(--text-sub); margin-bottom: 20px; }
.empty-tip { text-align: center; color: var(--text-sub); font-size: 14px; padding: 20px; }
.loading-tip { text-align: center; color: var(--text-sub); padding: 30px; font-size: 14px; }

/* ─── 单选框 ──────────────────────────────────── */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-item { display: flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.2s; background: var(--white); }
.radio-item input:checked + .radio-item, .radio-item:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ─── Toast提示 ─────────────────────────────── */
.toast-container { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: rgba(20,30,50,0.88); color: var(--white); padding: 10px 20px; border-radius: 20px; font-size: 14px; white-space: nowrap; animation: toastIn 0.25s ease; backdrop-filter: blur(8px); }
.toast.toast-success { background: rgba(40,167,69,0.9); }
.toast.toast-error   { background: rgba(220,53,69,0.9); }
.toast.toast-info    { background: rgba(23,162,184,0.9); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Loading ────────────────────────────────── */
.loading-mask { position: fixed; inset: 0; background: rgba(255,255,255,0.8); display: flex; align-items: center; justify-content: center; z-index: 9998; }
.loading-inner { background: var(--white); border-radius: 12px; padding: 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
.loading-inner .spinner { width: 36px; height: 36px; }
.loading-inner span { font-size: 14px; color: var(--text-sub); }

/* ─── 微信登录按钮 ─────────────────────────── */
.btn-wechat { background: linear-gradient(135deg, #07c160, #06ad56); color: var(--white); border: none; border-radius: 10px; padding: 14px 24px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.1s; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; }
.btn-wechat:active { opacity: 0.85; transform: scale(0.98); }
.btn-wechat .wechat-icon { font-size: 18px; }
.auth-divider { display: flex; align-items: center; margin: 16px 0; color: var(--text-sub); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { padding: 0 12px; }

/* ─── 微信绑定卡片 ─────────────────────────── */
.wechat-bind-card { background: var(--white); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.wechat-info { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f0fdf4; border-radius: 10px; }
.wechat-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid #07c160; }
.wechat-details { flex: 1; }
.wechat-name { font-weight: 600; font-size: 15px; color: var(--text); }
.wechat-status { font-size: 12px; color: #07c160; margin-top: 2px; }
.wechat-status.unbound { color: var(--text-sub); }
.bind-qr-card { background: #f0fdf4; border-radius: 10px; padding: 16px; text-align: center; margin-top: 12px; }
.bind-qr-card p { font-size: 13px; color: var(--text-sub); margin-top: 8px; }
.bind-qr-img { width: 180px; height: 180px; border-radius: 8px; margin: 8px auto; display: block; border: 1px solid var(--border); }
.wechat-notice { font-size: 12px; color: var(--text-sub); background: #fffbeb; padding: 10px 12px; border-radius: 8px; margin-top: 12px; border-left: 3px solid var(--warning); }
.wechat-notice-title { font-weight: 600; color: var(--warning); margin-bottom: 4px; }
