/* 同城跑腿 - 全局样式（移动端优先，PC 端居中展示） */
:root {
    --primary: #ff5a26;
    --primary-dark: #e8461c;
    --primary-light: #fff1ec;
    --accent: #ffb300;
    --text: #1f2937;
    --muted: #8b95a5;
    --line: #edeff3;
    --bg: #f4f5f7;
    --card: #ffffff;
    --success: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --radius: 14px;
    --shadow: 0 2px 12px rgba(17, 24, 39, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #e9ebef;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }

/* 手机壳容器 */
.phone {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, .08);
    padding-bottom: 62px;
}
.page { padding: 12px; }

/* 顶部导航 */
.navbar {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(135deg, #ff7a45, #ff5a26);
    color: #fff;
    padding: 14px 16px;
    display: flex; align-items: center; gap: 10px;
    min-height: 52px;
}
.navbar .title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.navbar .nav-btn { width: 34px; font-size: 20px; text-align: center; cursor: pointer; opacity: .95; }
.navbar.plain { background: #fff; color: var(--text); border-bottom: 1px solid var(--line); }

/* 通用卡片 */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.card.tight { padding: 10px 12px; }
.card-title {
    font-size: 15px; font-weight: 600; margin-bottom: 10px;
    display: flex; align-items: center; justify-content: space-between;
}
.card-title .more { font-size: 12px; color: var(--muted); font-weight: 400; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; border-radius: 10px; padding: 10px 16px;
    font-size: 14px; cursor: pointer; background: #f1f2f5; color: var(--text);
    transition: .15s; font-family: inherit;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 13px 16px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 表单 */
.form-item { margin-bottom: 12px; }
.form-item label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 12px; font-size: 14px; background: #fff; color: var(--text);
    font-family: inherit; outline: none; transition: .15s;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-item textarea { min-height: 70px; resize: vertical; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }
.form-inline { display: flex; gap: 8px; align-items: center; }
.form-inline input { flex: 1; }

/* 徽章 */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 12px; background: #f1f2f5; color: var(--muted);
}
.badge.primary { background: var(--primary-light); color: var(--primary); }
.badge.success { background: #e8f8ee; color: var(--success); }
.badge.warn { background: #fff5e6; color: var(--warn); }
.badge.done { background: #eef0f4; color: #6b7280; }
.badge.muted { background: #f1f2f5; color: #9aa3af; }

/* 列表 */
.list .list-item {
    background: #fff; border-radius: var(--radius); padding: 12px 14px;
    margin-bottom: 10px; box-shadow: var(--shadow);
    display: block; position: relative;
}
.list-item .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.list-item .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 价格 */
.price { color: var(--primary); font-weight: 700; }
.price.lg { font-size: 22px; }
.price.sm { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }

/* 服务入口 */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.service-card {
    background: #fff; border-radius: var(--radius); padding: 14px 8px; text-align: center;
    box-shadow: var(--shadow); border: 2px solid transparent; transition: .15s; cursor: pointer;
}
.service-card.active { border-color: var(--primary); background: var(--primary-light); }
.service-card .icon { font-size: 26px; }
.service-card .name { font-weight: 600; margin-top: 4px; }
.service-card .desc { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 首页头部 */
.hero {
    background: linear-gradient(135deg, #ff7a45, #ff5a26);
    color: #fff; padding: 18px 16px 26px; border-radius: 0 0 20px 20px;
}
.hero .brand { font-size: 19px; font-weight: 700; }
.hero .slogan { font-size: 12px; opacity: .9; margin-top: 2px; }
.hero .stats { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; opacity: .95; }
.hero .stats b { font-size: 16px; display: block; }

/* 轮播 */
.banner {
    background: linear-gradient(120deg, #ffb300, #ff7a45);
    color: #fff; border-radius: var(--radius); padding: 16px;
    margin: -14px 12px 12px; box-shadow: var(--shadow); position: relative; z-index: 2;
}
.banner .b-title { font-size: 16px; font-weight: 700; }
.banner .b-sub { font-size: 12px; opacity: .92; margin-top: 2px; }

/* 步骤条 */
.steps { display: flex; align-items: center; margin: 16px 0; }
.steps .step { flex: 1; text-align: center; font-size: 11px; color: var(--muted); position: relative; }
.steps .step .dot {
    width: 12px; height: 12px; border-radius: 50%; background: #dfe2e8;
    margin: 0 auto 6px; border: 2px solid #fff; box-shadow: 0 0 0 1px #dfe2e8;
}
.steps .step.on .dot { background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.steps .step.on { color: var(--primary); font-weight: 600; }
.steps .line { height: 2px; background: #dfe2e8; flex: 1; margin-bottom: 20px; }

/* 空状态 */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .icon { font-size: 42px; opacity: .5; }
.empty .text { margin-top: 8px; font-size: 13px; }

/* 底部导航 */
.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
    background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 60;
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
    flex: 1; text-align: center; padding: 8px 0 6px; font-size: 11px; color: var(--muted);
}
.tabbar a .ti { font-size: 19px; display: block; line-height: 1.2; }
.tabbar a.on { color: var(--primary); font-weight: 600; }

/* 提示条 */
.notice-bar {
    background: #fff8e6; color: #b45309; font-size: 12px; padding: 8px 12px;
    border-radius: 10px; margin-bottom: 12px; display: flex; gap: 6px; align-items: center;
}

/* Toast / 弹窗 */
.toast {
    position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .82); color: #fff; padding: 12px 18px;
    border-radius: 10px; font-size: 14px; z-index: 999; max-width: 80%; text-align: center;
}
.mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 900; display: flex; align-items: center; justify-content: center; }
.dialog { background: #fff; border-radius: 16px; width: 86%; max-width: 340px; padding: 20px; }
.dialog h3 { font-size: 16px; margin-bottom: 8px; text-align: center; }
.dialog .dialog-body { font-size: 13px; color: var(--muted); text-align: center; }

/* 价格明细 */
.fee-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: #4b5563; }
.fee-row.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-size: 15px; font-weight: 700; color: var(--text); }

/* 地址卡片 */
.addr-block { background: #fafbfc; border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
.addr-block + .addr-block { margin-top: 10px; }
.addr-block .tag { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--primary-light); color: var(--primary); }

/* 标签切换 */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.tabs a {
    padding: 6px 14px; border-radius: 20px; background: #fff; font-size: 13px;
    color: var(--muted); white-space: nowrap; border: 1px solid var(--line);
}
.tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 骑手卡片 */
.rider-card { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 44px; height: 44px; border-radius: 50%; background: var(--primary-light);
    display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none;
}

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; padding: 14px 0; font-size: 13px; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); }
.pager span.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============ 后台 ============ */
.admin { display: flex; min-height: 100vh; }
.admin-side {
    width: 210px; background: #1f2937; color: #cbd5e1; padding: 16px 0; flex: none;
    position: fixed; top: 0; bottom: 0; overflow-y: auto;
}
.admin-side .logo { color: #fff; font-size: 16px; font-weight: 700; padding: 0 18px 16px; }
.admin-side a {
    display: block; padding: 10px 18px; font-size: 13px; color: #cbd5e1; border-left: 3px solid transparent;
}
.admin-side a:hover { background: #273244; color: #fff; }
.admin-side a.on { background: #273244; color: #fff; border-left-color: var(--primary); }
.admin-side .group { font-size: 11px; color: #64748b; padding: 14px 18px 6px; }
.admin-main { flex: 1; margin-left: 210px; background: #f4f5f7; min-height: 100vh; }
.admin-top {
    background: #fff; padding: 14px 20px; border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 20;
}
.admin-body { padding: 18px 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; color: var(--muted); }
.stat-card .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat-card .value.warn { color: var(--warn); }
.stat-card .value.primary { color: var(--primary); }
.table-wrap { background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.tb th { background: #fafbfc; font-weight: 600; color: #4b5563; }
table.tb tr:hover td { background: #fafbfc; }
.admin-form { background: #fff; padding: 16px; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 14px; }
.admin-form .line { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.admin-form .line > div { min-width: 150px; }
.admin-form input, .admin-form select {
    border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; width: 100%; font-family: inherit;
}
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.chart-bars .bar { flex: 1; background: var(--primary-light); border-radius: 6px 6px 0 0; position: relative; min-height: 3px; }
.chart-bars .bar span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.chart-bars .bar i { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); font-style: normal; }

/* ============ 后台：汉堡按钮 / 遮罩 / 顶栏退出 ============ */
.admin-top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-top-left b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-menu-btn {
    display: none; width: 34px; height: 32px; flex: none; cursor: pointer;
    border: 1px solid var(--line); background: #fff; border-radius: 8px;
    font-size: 16px; line-height: 1; color: #374151;
}
.admin-mask {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45); z-index: 50;
}
.admin-mask.show { display: block; }
.admin-logout {
    flex: none; font-size: 13px; color: #b91c1c; text-decoration: none;
    border: 1px solid #f0c9c9; background: #fff5f5; border-radius: 8px; padding: 6px 10px;
}
.admin-logout:hover { background: #fee2e2; }

/* ============ 后台移动端适配（窄屏侧边栏改为抽屉） ============ */
@media (max-width: 768px) {
    .admin-side {
        width: 220px; z-index: 60;
        transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: 2px 0 14px rgba(0,0,0,.25);
    }
    .admin-side.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
    .admin-top { padding: 10px 12px; gap: 8px; }
    .admin-top .admin-when { display: none; }
    .admin-body { padding: 12px; }
    .admin-form .line > div { min-width: 140px; flex: 1 1 140px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card .value { font-size: 20px; }
    .admin-form input, .admin-form select { font-size: 16px; }  /* 防 iOS 聚焦缩放 */
}
