/* ============ 长顺县同城跑腿系统 - 全局样式 ============ */
:root {
  --primary: #0e7490;
  --primary-dark: #155e75;
  --primary-light: #ecfeff;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --ink: #0f172a;
  --ink-2: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 15px; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,116,144,.12); }
textarea { resize: vertical; min-height: 72px; }
label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 6px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 11px 18px; font-size: 15px; font-weight: 600;
  background: var(--primary); color: #fff; transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); }
.btn-accent { background: var(--accent); }
.btn-success { background: var(--success); }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.muted { color: var(--ink-2); font-size: 13px; }
.price { color: #e11d48; font-weight: 700; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.tag-green { background: #dcfce7; color: #15803d; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-amber { background: #fef3c7; color: #b45309; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: #e2e8f0; color: #475569; }
.tag-purple { background: #ede9fe; color: #6d28d9; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 420px; }
.brand { text-align: center; margin-bottom: 22px; }
.brand .logo {
  width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 18px;
  background: linear-gradient(135deg, #0e7490, #22d3ee); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800;
}
.brand h1 { margin: 0; font-size: 22px; }
.brand p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.role-tabs { display: flex; background: #e2e8f0; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.role-tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.role-tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.demo-row { display: flex; gap: 8px; margin-top: 14px; }
.demo-row button { flex: 1; font-size: 13px; padding: 9px; }
.switch-line { text-align: center; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.switch-line a { font-weight: 600; }
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.form-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }

/* ===== 移动端外壳 ===== */
.app-shell { max-width: 860px; margin: 0 auto; min-height: 100vh; }
.app-header {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.93);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
}
.app-header .logo-sm {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #0e7490, #22d3ee); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.app-header h2 { margin: 0; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  border: 0; background: #f1f5f9; width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; position: relative; font-size: 17px;
}
.icon-btn .count {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.main { padding: 14px 14px 90px; }
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 860px; background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 40; padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1; border: 0; background: transparent; padding: 9px 0 7px;
  color: var(--ink-2); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bottom-nav button.active { color: var(--primary); font-weight: 700; }
.bottom-nav .nav-ico { font-size: 20px; line-height: 1; }

/* ===== 首页 ===== */
.hero-card {
  background: linear-gradient(135deg, #0e7490, #06b6d4); color: #fff; border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px; position: relative; overflow: hidden;
}
.hero-card h2 { margin: 0 0 6px; font-size: 20px; }
.hero-card p { margin: 0; opacity: .85; font-size: 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.quick-item {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px 6px;
  text-align: center; border: 0;
}
.quick-item .q-ico { font-size: 24px; display: block; margin-bottom: 4px; }
.quick-item span { font-size: 12px; color: var(--ink-2); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.stat-card .v { font-size: 22px; font-weight: 800; }
.stat-card .l { font-size: 12px; color: var(--ink-2); }

/* ===== 订单卡片 ===== */
.order-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.order-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-card .no { font-size: 12px; color: var(--ink-2); }
.order-card .title { font-weight: 700; margin: 8px 0 4px; font-size: 15px; }
.order-card .addr { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; margin: 2px 0; }
.order-card .addr b { color: var(--primary); font-weight: 700; flex: none; }
.order-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.route-line { position: relative; padding-left: 16px; }
.route-line::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.route-line .dot { position: absolute; left: 0; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.route-line .dot.gray { background: var(--ink-2); }

/* ===== 报价预览 ===== */
.price-preview {
  background: var(--primary-light); border-radius: 12px; padding: 12px; margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.price-preview .p { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.price-lines { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.price-lines div { display: flex; justify-content: space-between; padding: 2px 0; }

/* ===== 订单详情 ===== */
.detail-hero {
  background: linear-gradient(135deg, #0e7490, #06b6d4); color: #fff; border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
}
.detail-hero .st { font-size: 20px; font-weight: 800; }
.detail-hero .sub { opacity: .85; font-size: 13px; margin-top: 4px; }
.detail-hero .rider {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.25);
}
.detail-hero .avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.25); object-fit: cover; }
.timeline { margin-top: 6px; }
.timeline .step { display: flex; gap: 10px; position: relative; padding: 0 0 16px; }
.timeline .step:last-child { padding-bottom: 0; }
.timeline .tl-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--line); flex: none; margin-top: 3px; }
.timeline .step.done .tl-dot { border-color: var(--primary); background: var(--primary); }
.timeline .step.now .tl-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
.timeline .step::before { content: ""; position: absolute; left: 5px; top: 17px; bottom: 0; width: 2px; background: var(--line); }
.timeline .step:last-child::before { display: none; }
.timeline .tl-title { font-weight: 600; font-size: 14px; }
.timeline .tl-time { font-size: 12px; color: var(--ink-2); }

/* ===== 追踪地图 ===== */
.map-canvas-wrap { background: #e3f2f5; border-radius: var(--radius); overflow: hidden; position: relative; margin-bottom: 14px; }
.map-canvas-wrap canvas { display: block; width: 100%; height: 260px; }
.map-tip {
  position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); border-radius: 8px;
  padding: 4px 10px; font-size: 12px; color: var(--ink-2);
}

/* ===== 聊天 ===== */
.chat-box { height: 260px; overflow-y: auto; background: #f8fafc; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.chat-msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.sys { align-self: center; background: #eef2ff; color: #3730a3; font-size: 12px; border-radius: 999px; padding: 4px 12px; }
.chat-msg .t { font-size: 11px; opacity: .65; margin-top: 3px; }
.chat-input { display: flex; gap: 8px; margin-top: 10px; }

/* ===== 商城 / 列表 ===== */
.mall-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mall-item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mall-item .img { height: 100px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.mall-item .body { padding: 12px; }
.mall-item .name { font-weight: 600; font-size: 14px; }
.mall-item .pts { color: var(--accent); font-weight: 800; font-size: 13px; margin-top: 4px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 14px; }
.list-item .li-sub { font-size: 12px; color: var(--ink-2); }

/* ===== 管理后台 ===== */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; background: #0f172a; color: #cbd5e1; flex: none;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .brand { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; }
.admin-side .brand .logo { width: 40px; height: 40px; font-size: 18px; margin: 0 0 8px; }
.admin-side .brand h2 { margin: 0; font-size: 15px; color: #fff; }
.admin-side nav { padding: 10px 8px; }
.admin-side nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 0; color: #cbd5e1; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; margin-bottom: 2px;
}
.admin-side nav button:hover { background: rgba(255,255,255,.06); }
.admin-side nav button.active { background: var(--primary); color: #fff; font-weight: 600; }
.admin-main { flex: 1; min-width: 0; padding: 22px; }
.admin-main .page-title { font-size: 20px; font-weight: 800; margin: 0 0 18px; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 22px; background: #fff; border-bottom: 1px solid var(--line);
}
.admin-topbar .right { display: flex; align-items: center; gap: 10px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .k-label { font-size: 12px; color: var(--ink-2); }
.kpi .k-value { font-size: 24px; font-weight: 800; margin-top: 4px; }
.kpi .k-sub { font-size: 12px; color: var(--success); margin-top: 2px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.chart-card h4 { margin: 0 0 10px; font-size: 14px; }
.chart-box { position: relative; height: 260px; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; color: var(--ink-2); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; min-width: 140px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .15s;
}
@media (min-width: 640px) { .modal-mask { align-items: center; } }
.modal {
  position: relative; background: #fff; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0;
  max-height: 88vh; overflow-y: auto; padding: 18px; animation: slideUp .18s;
}
@media (min-width: 640px) { .modal { border-radius: 18px; } }
.modal h3 { margin: 0 0 12px; font-size: 17px; }
.modal .close-x {
  position: absolute; top: 10px; right: 10px; border: 0; background: #f1f5f9;
  width: 30px; height: 30px; border-radius: 50%; font-size: 16px; z-index: 2;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Toast ===== */
#toast-box { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: slideDown .2s; max-width: 90vw; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes slideDown { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== 大屏 ===== */
.bigscreen { background: #0b1220; color: #e2e8f0; min-height: 100vh; padding: 20px; }
.bigscreen h1 { margin: 0 0 16px; font-size: 24px; color: #fff; display: flex; gap: 12px; align-items: center; }
.bigscreen .live-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.bs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.bs-kpi { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 14px; }
.bs-kpi .v { font-size: 26px; font-weight: 800; color: #22d3ee; }
.bs-kpi .l { font-size: 12px; color: #94a3b8; }
.bs-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bs-order { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px; }
.bs-order .head { display: flex; justify-content: space-between; gap: 8px; }
.bs-order .no { font-size: 11px; color: #64748b; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 16px; font-size: 14px; }
.skeleton { color: var(--ink-2); padding: 30px; text-align: center; }
.hidden { display: none !important; }
.section-title { font-size: 16px; font-weight: 700; margin: 18px 0 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.link-btn { border: 0; background: none; color: var(--primary); font-size: 13px; padding: 4px; }
@media (max-width: 760px) {
  .admin-side { display: none; }
  .admin-wrap { display: block; }
  .admin-topbar { display: flex; }
  .mobile-menu { display: block; }
}
@media (min-width: 761px) { .mobile-menu { display: none; } }
