/* ============ 快送 - 全局样式（用户端 + 骑手端，手机/平板自适应） ============ */
:root {
  --brand: #FF6B00;
  --brand2: #FF9A3D;
  --brand-dark: #E85D00;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --text: #1F2329;
  --sub: #8A9099;
  --line: #ECEEF2;
  --green: #00B578;
  --blue: #2563EB;
  --red: #F53F3F;
  --orange: #FF8F1F;
  --grad: linear-gradient(135deg, #FF9A3D 0%, #FF6B00 100%);
  --shadow: 0 4px 16px rgba(31, 35, 41, 0.06);
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}
body.rider { --brand: #2563EB; --brand2: #60A5FA; --brand-dark: #1D4ED8; --grad: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }
input, textarea { font-family: inherit; font-size: 1rem; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar .back {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--text); flex-shrink: 0;
}
.topbar h1 { font-size: 17px; font-weight: 600; flex: 1; }
.topbar .logo-mini { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--brand-dark); }
.topbar .logo-mini img { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 30;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--sub); padding: 4px 0;
}
.bottom-nav a.active { color: var(--brand); font-weight: 600; }
.bottom-nav svg { width: 24px; height: 24px; }

.page { padding: 16px 16px 80px; }
.page-no-nav { padding: 16px 16px 40px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  background: var(--grad);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 32px; text-align: center; color: #fff;
}
.login-wrap .login-logo { width: 96px; height: 96px; border-radius: 26px; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.35); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-wrap .login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-wrap h1 { margin-top: 18px; font-size: 30px; font-weight: 800; letter-spacing: 2px; }
.login-wrap .slogan { margin-top: 8px; font-size: 14px; opacity: 0.92; }
.login-wrap .btn-white {
  margin-top: 44px; width: 100%; max-width: 300px;
  height: 50px; border-radius: 25px;
  background: #fff; color: var(--brand-dark);
  font-size: 17px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-wrap .login-tip { margin-top: 14px; font-size: 12px; opacity: 0.8; }
.login-wrap .btn-white svg { width: 20px; height: 20px; }

/* ---------- 首页菜单卡片 ---------- */
.home-hero {
  background: var(--grad);
  border-radius: 18px; color: #fff;
  padding: 22px 20px; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(255, 107, 0, 0.22);
}
.home-hero .hello { font-size: 15px; opacity: 0.92; }
.home-hero .app-name { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; }
.home-hero .app-name img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.home-hero .desc { font-size: 13px; opacity: 0.9; margin-top: 8px; }

.menu-list { display: flex; flex-direction: column; gap: 14px; }
.menu-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border-radius: 18px; padding: 20px 18px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.menu-card .mc-icon {
  width: 62px; height: 62px; border-radius: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.menu-card .mc-icon svg { width: 34px; height: 34px; }
.menu-card.pkg .mc-icon { background: #FFF3E6; color: var(--brand); }
.menu-card.food .mc-icon { background: #E8F3FF; color: var(--blue); }
.menu-card .mc-title { font-size: 18px; font-weight: 700; }
.menu-card .mc-desc { font-size: 13px; color: var(--sub); margin-top: 3px; }
.menu-card .mc-arrow { margin-left: auto; color: #C8CBD1; }
.menu-card .mc-arrow svg { width: 20px; height: 20px; }

/* ---------- 卡片 / 表单 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { border: 2px solid var(--line); border-radius: 14px; padding: 16px 10px; text-align: center; font-size: 15px; font-weight: 600; background: var(--card); transition: all .15s; }
.opt.selected { border-color: var(--brand); color: var(--brand); background: #FFF7EF; }
.opt .opt-sub { display: block; font-size: 11px; color: var(--sub); font-weight: 400; margin-top: 2px; }
.opt.selected .opt-sub { color: var(--brand); }

.company-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.company-grid .opt { padding: 14px 6px; font-size: 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.input {
  width: 100%; height: 48px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #FAFBFC;
  padding: 0 14px; font-size: 16px; outline: none;
}
.input:focus { border-color: var(--brand); background: #fff; }
.input::placeholder { color: #B8BDC4; }
.input-code { letter-spacing: 6px; font-weight: 700; text-align: center; font-size: 20px; }
.tip { font-size: 12px; color: var(--sub); margin-top: 6px; }

/* 金额条 */
.amount-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #FFF7EF; border: 1px solid #FFE3C7; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px;
}
.amount-bar .ab-label { font-size: 14px; color: #B45A00; }
.amount-bar .ab-num { font-size: 24px; font-weight: 800; color: var(--brand); }

/* 支付方式 */
.pay-method {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
}
.pay-method.selected { border-color: var(--brand); background: #FFF7EF; }
.pay-method img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.pay-method .pm-name { font-size: 15px; font-weight: 600; }
.pay-method .pm-sub { font-size: 12px; color: var(--sub); }
.pay-method .pm-check { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #D8DBE0; display: flex; align-items: center; justify-content: center; }
.pay-method.selected .pm-check { border-color: var(--brand); background: var(--brand); }
.pay-method.selected .pm-check::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

/* ---------- 按钮 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border-radius: 25px;
  font-size: 17px; font-weight: 700; color: #fff;
  background: var(--grad); box-shadow: 0 6px 18px rgba(255, 107, 0, 0.25);
}
.btn:disabled { opacity: 0.55; box-shadow: none; }
.btn svg { width: 20px; height: 20px; }
.btn-ghost { background: var(--bg); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn-small { height: 38px; font-size: 14px; border-radius: 19px; padding: 0 18px; width: auto; box-shadow: none; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1; }
.btn-green { background: linear-gradient(135deg, #26D091 0%, #00B578 100%); box-shadow: 0 6px 18px rgba(0, 181, 120, 0.22); }

/* ---------- 步骤指示 ---------- */
.steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 20px; }
.steps .step-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.steps .step-item .num { width: 22px; height: 22px; border-radius: 50%; background: #E9EBEF; color: var(--sub); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.steps .step-item.active { color: var(--brand); font-weight: 600; }
.steps .step-item.active .num { background: var(--brand); color: #fff; }
.steps .step-item.done .num { background: var(--green); color: #fff; }
.steps .step-line { width: 26px; height: 2px; background: #E9EBEF; }
.steps .step-line.done { background: var(--green); }

/* ---------- 支付二维码页 ---------- */
.qr-box {
  width: 200px; height: 200px; margin: 6px auto 0;
  border: 2px dashed #E4A11B; border-radius: 16px;
  background: #FFFDF6;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 12px; color: #B08A3E;
}
.qr-box svg { width: 56px; height: 56px; margin-bottom: 10px; }
.qr-box .qr-title { font-size: 15px; font-weight: 700; color: #8A6A1F; }
.qr-box .qr-sub { font-size: 12px; margin-top: 4px; }
.pay-state { text-align: center; font-size: 14px; margin-top: 12px; min-height: 22px; color: var(--sub); }
.pay-state.error { color: var(--red); font-weight: 600; }
.pay-state.ok { color: var(--green); font-weight: 600; }

/* 支付成功结果 */
.success-panel { text-align: center; padding: 12px 0 4px; }
.success-panel .ok-icon {
  width: 68px; height: 68px; margin: 0 auto 12px;
  background: var(--green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.success-panel .ok-icon svg { width: 36px; height: 36px; }
.success-panel h2 { font-size: 20px; font-weight: 800; }
.success-panel .sub { color: var(--sub); font-size: 14px; margin-top: 6px; }
.order-no-box {
  background: #F5F6FA; border-radius: 10px; padding: 10px 14px; margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; font-size: 14px;
}
.order-no-box .on-label { color: var(--sub); }
.order-no-box .on-val { font-weight: 700; letter-spacing: 1px; }

/* ---------- 订单卡片 ---------- */
.order-card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.order-card .oc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.type-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.type-badge.express { background: #FFF3E6; color: var(--brand); }
.type-badge.takeout { background: #E8F3FF; color: var(--blue); }
.status-badge { margin-left: auto; font-size: 13px; font-weight: 700; }
.status-badge.s-pending { color: var(--orange); }
.status-badge.s-accepted { color: var(--blue); }
.status-badge.s-picked { color: #7C5CFF; }
.status-badge.s-delivered { color: var(--green); }
.status-badge.s-unpaid { color: var(--red); }
.order-card .oc-info { font-size: 13px; color: #4A5058; }
.order-card .oc-info div { margin-bottom: 3px; display: flex; gap: 6px; }
.order-card .oc-info .k { color: var(--sub); flex-shrink: 0; }
.order-card .oc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.order-card .oc-amount { font-size: 16px; font-weight: 800; color: var(--brand); }
.order-card .oc-time { font-size: 12px; color: var(--sub); }
.order-card .oc-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 时间线 */
.timeline { display: flex; margin-top: 12px; }
.timeline .tl-step { flex: 1; text-align: center; position: relative; }
.timeline .tl-step .tl-dot { width: 14px; height: 14px; border-radius: 50%; background: #E3E5EA; margin: 0 auto 6px; position: relative; z-index: 2; }
.timeline .tl-step .tl-label { font-size: 11px; color: var(--sub); }
.timeline .tl-step .tl-time { font-size: 10px; color: #B8BDC4; margin-top: 2px; }
.timeline .tl-step.done .tl-dot { background: var(--green); }
.timeline .tl-step.done .tl-label { color: var(--text); font-weight: 600; }
.timeline .tl-step.current .tl-dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(255,107,0,0.15); }
.timeline .tl-step.current .tl-label { color: var(--brand); font-weight: 700; }
.timeline .tl-step::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: #E3E5EA; z-index: 1; }
.timeline .tl-step:first-child::before { display: none; }
.timeline .tl-step.done::before { background: var(--green); }
.timeline .tl-step.current::before { background: var(--green); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--sub); }
.empty svg { width: 72px; height: 72px; margin: 0 auto 14px; color: #C8CBD1; }
.empty .empty-title { font-size: 15px; font-weight: 600; color: #6A7078; }
.empty .empty-sub { font-size: 13px; margin-top: 4px; }

/* ---------- 骑手端 ---------- */
.rider-hero {
  background: var(--grad); border-radius: 18px; color: #fff;
  padding: 20px; margin-bottom: 16px; box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
  display: flex; align-items: center; gap: 16px;
}
.rider-hero .rh-earn { flex: 1; }
.rider-hero .rh-label { font-size: 13px; opacity: 0.9; }
.rider-hero .rh-num { font-size: 30px; font-weight: 800; margin-top: 2px; }
.rider-hero .rh-done { text-align: right; font-size: 13px; opacity: 0.95; }
.rider-hero .rh-done b { font-size: 20px; display: block; }

.tabs { display: flex; background: #E9EBEF; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.tabs .tab { flex: 1; text-align: center; padding: 9px 0; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--sub); }
.tabs .tab.active { background: #fff; color: var(--brand); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }

.rider-card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.rider-card .rc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rider-card .rc-info { font-size: 13px; color: #4A5058; }
.rider-card .rc-info div { margin-bottom: 3px; display: flex; gap: 6px; }
.rider-card .rc-info .k { color: var(--sub); flex-shrink: 0; }
.rider-card .rc-reward { font-size: 12px; color: var(--orange); margin-top: 4px; font-weight: 600; }
.rider-card .rc-actions { margin-top: 10px; }

/* ---------- 提示 toast ---------- */
.toast {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%);
  z-index: 99; max-width: 84%;
  background: rgba(31, 35, 41, 0.92); color: #fff;
  padding: 11px 20px; border-radius: 24px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  opacity: 0; pointer-events: none; transition: opacity .25s;
  text-align: center;
}
.toast.show { opacity: 1; }
.toast.toast-error { background: rgba(245, 63, 63, 0.95); }
.toast.toast-ok { background: rgba(0, 181, 120, 0.95); }

.hidden { display: none !important; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.center { text-align: center; }

/* ---------- 滑块验证（人机验证） ---------- */
.slider {
  position: relative; height: 46px; border-radius: 23px;
  background: #E9EBEF; overflow: hidden;
  user-select: none; -webkit-user-select: none; touch-action: none;
  cursor: grab;
}
.slider.sm { height: 40px; border-radius: 20px; }
.slider-progress {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, var(--brand2), var(--brand));
  border-radius: 23px; opacity: .35; pointer-events: none;
}
.slider-text {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #8A9099; pointer-events: none;
}
.slider.sm .slider-text { font-size: 13px; }
.slider-thumb {
  position: absolute; left: 3px; top: 3px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); transition: left .25s ease;
}
.slider.sm .slider-thumb { width: 34px; height: 34px; }
.slider-thumb.dragging { transition: none; }
.slider-thumb svg { width: 22px; height: 22px; }
.slider.sm .slider-thumb svg { width: 18px; height: 18px; }
.slider.ok { background: var(--green); cursor: default; }
.slider.ok .slider-text { color: #fff; font-weight: 600; }
.slider.ok .slider-thumb { color: var(--green); }

/* ---------- 确认弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  width: 100%; max-width: 520px;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  animation: modalUp .25s ease;
}
@keyframes modalUp { from { transform: translateY(40px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.modal-sub { text-align: center; font-size: 13px; color: var(--sub); margin-bottom: 16px; }
.modal-info {
  background: #F7F8FA; border-radius: 12px; padding: 12px 14px;
  font-size: 14px; color: #4A5058; line-height: 1.9; margin-bottom: 16px;
}
.modal-info .k { color: var(--sub); }
.modal .btn { margin-top: 14px; }
.modal-close {
  position: absolute; right: 16px; top: 16px; width: 30px; height: 30px;
  border-radius: 50%; background: #F2F3F5; color: #8A9099;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
