/* 校园跑腿 H5 样式：移动优先，无外部依赖 */
:root {
    --primary: #2b7fff;
    --primary-dark: #1f63d6;
    --accent: #ff8a3d;
    --ink: #111827;
    --ink-2: #4b5563;
    --ink-3: #9ca3af;
    --line: #e5e7eb;
    --bg: #f4f6fa;
    --card: #ffffff;
    --ok: #16a34a;
    --warn: #f59e0b;
    --danger: #e5484d;
    --radius: 14px;
    --shadow: 0 6px 20px rgba(17, 24, 39, .06);
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 76px; background: var(--bg); }

/* ---------- 顶栏 ---------- */
.app-header {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, #5b9bff 100%);
    color: #fff;
}
.app-header .brand { display: flex; align-items: center; gap: 10px; }
.app-header .brand img { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18); padding: 3px; }
.app-header .brand h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.app-header .brand p { margin: 0; font-size: 12px; opacity: .85; }
.app-header .header-link { font-size: 13px; color: #fff; background: rgba(255,255,255,.16); padding: 6px 12px; border-radius: 999px; }

/* ---------- 通用 ---------- */
.section { padding: 0 16px; margin-top: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h2 { font-size: 16px; margin: 0; font-weight: 600; }
.section-head a { font-size: 13px; color: var(--ink-3); }

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.muted { color: var(--ink-3); font-size: 13px; }
.small { font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row + .row { margin-top: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.price { color: var(--accent); font-weight: 700; }
.price small { font-size: 12px; font-weight: 500; }

/* ---------- 轮播 ---------- */
.banner-wrap { padding: 16px 16px 0; }
.banner { position: relative; border-radius: 18px; overflow: hidden; background: #dbe6ff; aspect-ratio: 2.4 / 1; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-fallback { display: flex; align-items: center; justify-content: center; height: 100%; color: #fff; background: linear-gradient(135deg, #2b7fff, #7aa9ff); font-size: 22px; font-weight: 700; letter-spacing: 2px; }

/* ---------- 服务入口 ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grid-item {
    background: var(--card); border-radius: var(--radius); padding: 14px 6px 12px;
    text-align: center; box-shadow: var(--shadow); transition: transform .15s ease;
}
.grid-item:active { transform: scale(.97); }
.grid-item img { width: 30px; height: 30px; margin: 0 auto 8px; }
.grid-item span { display: block; font-size: 13px; color: var(--ink-2); }

/* ---------- 价格卡 ---------- */
.price-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.price-item { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.price-item strong { display: block; font-size: 15px; }
.price-item .amount { color: var(--accent); font-weight: 700; font-size: 18px; }
.price-item .amount small { font-size: 12px; }

/* ---------- 表单 ---------- */
.form { background: var(--card); border-radius: var(--radius); padding: 4px 16px; box-shadow: var(--shadow); }
.field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: none; }
.field label { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; border: none; outline: none; font-size: 15px; color: var(--ink);
    background: transparent; padding: 2px 0; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 60px; }
.field-inline { display: flex; align-items: center; gap: 10px; }
.field-note { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; padding: 14px 18px; border: none; border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #5b9bff);
    color: #fff; font-size: 16px; font-weight: 600;
    box-shadow: 0 8px 18px rgba(43, 127, 255, .28); cursor: pointer;
}
.btn:disabled { opacity: .6; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid #cfe0ff; box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ef5350, #ff7b7b); box-shadow: 0 8px 18px rgba(229, 72, 77, .25); }
.btn.small { width: auto; padding: 8px 16px; font-size: 13px; border-radius: 999px; }
.btn.wechat { background: linear-gradient(135deg, #22c55e, #4ade80); box-shadow: 0 8px 18px rgba(34, 197, 94, .25); }
.btn.alipay { background: linear-gradient(135deg, #1677ff, #4b9bff); }

.actions { display: flex; gap: 10px; margin: 18px 16px 0; }

/* ---------- 订单卡 ---------- */
.order-card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; display: block; }
.order-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.order-no { font-size: 12px; color: var(--ink-3); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #eff4ff; color: var(--primary); }
.badge.s0 { background: #fff7e8; color: #b45309; }
.badge.s1 { background: #e9f7ef; color: #15803d; }
.badge.s2 { background: #eff4ff; color: var(--primary); }
.badge.s3 { background: #f3f4f6; color: #6b7280; }
.badge.s5 { background: #fef2f2; color: #b91c1c; }
.order-card .main { font-size: 15px; font-weight: 600; }
.order-card .sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.order-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

/* ---------- 状态标签栏 ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 0; }
.tabs a { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 13px; box-shadow: var(--shadow); }
.tabs a.active { background: var(--primary); color: #fff; }

/* ---------- 详情 ---------- */
.detail-list { background: var(--card); border-radius: var(--radius); padding: 6px 16px; box-shadow: var(--shadow); }
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--ink-3); flex: 0 0 auto; }
.detail-row .v { text-align: right; word-break: break-all; }

.timeline { margin-top: 16px; background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.timeline h3 { font-size: 15px; margin: 0 0 12px; }
.timeline ul { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-left: 22px; padding-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #cfe0ff; }
.timeline li.active::before { background: var(--primary); box-shadow: 0 0 0 3px #e7f0ff; }
.timeline li span { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* ---------- 底部导航 ---------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    max-width: 560px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.tabbar a { text-align: center; font-size: 13px; color: var(--ink-3); }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar a i { display: block; font-size: 18px; font-style: normal; line-height: 1.4; }

/* ---------- 提示条 ---------- */
.flash { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.flash.success { background: #e9f7ef; color: #15803d; }
.flash.error { background: #fef2f2; color: #b91c1c; }
.flash.info { background: #eff4ff; color: #1d4ed8; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--ink-3); }
.empty .icon { font-size: 40px; }

/* ---------- 收银台 ---------- */
.cashier { padding: 24px 16px; }
.cashier .box { background: #fff; border-radius: 18px; padding: 24px 18px; text-align: center; box-shadow: var(--shadow); }
.cashier .amount { font-size: 34px; font-weight: 700; color: var(--accent); margin: 8px 0 4px; }
.cashier .qr { margin: 18px auto 8px; max-width: 220px; }
.cashier .qr img { width: 100%; border-radius: 12px; }
.cashier .link { word-break: break-all; font-size: 13px; color: var(--primary); }

.bottom-space { height: 24px; }

@media (max-width: 360px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .grid-item img { width: 26px; height: 26px; }
}
