/* ==========================================================
   快递代取代拿系统 - 全局样式 v6.0（现代风 UI）
   ========================================================== */

:root {
    --ep-primary: #ff6a00;
    --ep-primary-dark: #e05a00;
    --ep-primary-light: #fff4e6;
    --ep-grad: linear-gradient(135deg, #ff6a00 0%, #ff9a3d 55%, #ffb25e 100%);
    --ep-radius: 16px;
    --ep-shadow: 0 4px 18px rgba(31, 41, 55, .06);
    --ep-shadow-lg: 0 10px 30px rgba(31, 41, 55, .10);
    --ep-text: #1f2937;
    --ep-text-sub: #6b7280;
    --ep-border: #f1f3f5;
    --ep-bg: #f6f7f9;
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    max-width: 100%;
    overflow-x: hidden;
    background: var(--ep-bg);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--ep-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* 顶部导航（管理端旧样式兼容） */
.navbar-ep {
    background: var(--ep-grad);
    box-shadow: 0 2px 12px rgba(255, 106, 0, .22);
}
.navbar-ep .navbar-brand { color: #fff; font-weight: 700; letter-spacing: .5px; }
.navbar-ep .navbar-brand i { font-size: 1.4rem; margin-right: 4px; }
.navbar-ep .nav-link {
    color: rgba(255,255,255,.92) !important;
    font-size: .95rem;
    padding: .5rem .9rem !important;
    border-radius: 8px;
    margin: 0 2px;
}
.navbar-ep .nav-link:hover, .navbar-ep .nav-link.active {
    background: rgba(255,255,255,.18);
    color: #fff !important;
}

/* 卡片 */
.card {
    border: 0;
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow);
    background: #fff;
}
.card .card-header {
    background: #fff;
    border-bottom: 1px solid var(--ep-border);
    border-radius: var(--ep-radius) var(--ep-radius) 0 0 !important;
    font-weight: 600;
    font-size: .95rem;
}

/* 按钮 */
.btn { border-radius: 10px; }
.btn-primary {
    background: var(--ep-primary);
    border-color: var(--ep-primary);
    box-shadow: 0 4px 12px rgba(255, 106, 0, .22);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--ep-primary-dark) !important;
    border-color: var(--ep-primary-dark) !important;
}
.btn-outline-primary { color: var(--ep-primary); border-color: var(--ep-primary); }
.btn-outline-primary:hover {
    background: var(--ep-primary);
    border-color: var(--ep-primary);
    color: #fff;
}
.btn-success { box-shadow: 0 4px 12px rgba(25,135,84,.22); }
.btn-lg { border-radius: 12px; }
.text-primary { color: var(--ep-primary) !important; }
.link-primary { color: var(--ep-primary) !important; }
.form-check-input:checked { background-color: var(--ep-primary); border-color: var(--ep-primary); }
.form-control, .form-select {
    border-radius: 10px;
    border-color: #e5e7eb;
}
.form-control:focus, .form-select:focus {
    border-color: #ffb25e;
    box-shadow: 0 0 0 .2rem rgba(255, 106, 0, .15);
}
.pagination .page-link { color: var(--ep-primary); border-radius: 8px; margin: 0 2px; }
.pagination .page-item.active .page-link { background: var(--ep-primary); border-color: var(--ep-primary); }

/* 表单卡片 */
.order-form-card {
    background: #fff;
    border-radius: var(--ep-radius);
    padding: 22px;
    box-shadow: var(--ep-shadow);
}
.price-tag { font-size: 1.9rem; font-weight: 800; color: var(--ep-primary); }
.price-tag small { font-size: .95rem; color: #999; font-weight: 400; }
.field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1.05rem;
}
.field-icon + .form-control { padding-left: 40px; }

/* 状态徽标 */
.badge-status { font-weight: 600; letter-spacing: .3px; border-radius: 8px; padding: .4em .7em; }
.badge.bg-primary { background: var(--ep-primary) !important; }
.badge.bg-info { background: #0ea5e9 !important; }

/* 管理端表格 */
.table thead th { background: #f8fafc; white-space: nowrap; font-size: .9rem; }
.table td { vertical-align: middle; }

/* 管理端表格紧凑自适应：一行为一条数据 */
.console-table { width: 100%; font-size: .78rem; }
.console-table thead th { font-size: .78rem; padding: .5rem .55rem; white-space: nowrap; }
.console-table td {
    padding: .45rem .55rem;
    white-space: nowrap;
    vertical-align: middle;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.console-table .cell-ellipsis { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1200px) { .console-table td { max-width: none; } }
.order-edit-modal .modal-header { background: #f8fafc; }
.order-edit-modal .form-label { font-size: .8rem; margin-bottom: .15rem; }

/* 侧边栏 */
.sidebar {
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    min-height: 100vh;
    position: sticky;
    top: 0;
}
.sidebar .brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(255,106,0,.25), transparent);
}
.sidebar .nav-link {
    color: rgba(255,255,255,.72);
    padding: 11px 20px;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    margin: 2px 8px;
    transition: all .2s;
}
.sidebar .nav-link i { width: 20px; text-align: center; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar .nav-link.active {
    color: #fff;
    background: var(--ep-grad);
    box-shadow: 0 4px 12px rgba(255,106,0,.3);
}
.sidebar .nav-link.active:hover { background: var(--ep-grad); }

/* 统计卡片 */
.stat-card {
    border-radius: var(--ep-radius);
    color: #fff;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--ep-shadow);
    transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .num { font-size: 1.8rem; font-weight: 800; }
.stat-card .label { opacity: .9; font-size: .9rem; }
.stat-card i { position: absolute; right: 14px; bottom: 10px; font-size: 3rem; opacity: .25; }

/* 登录页 */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #fff4e6 0%, #ffe8d1 100%);
}
.login-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: var(--ep-shadow-lg);
    animation: epPageIn .45s ease;
}
.login-box .logo { font-size: 2.4rem; color: var(--ep-primary); text-align: center; }
.login-box .form-control { min-height: 48px; }

.delivery-photo img { max-width: 100%; border-radius: 12px; }
.footer { color: #9ca3af; font-size: .85rem; text-align: center; padding: 20px 0 30px; }

/* ==========================================================
   手机端布局（用户端 / 配送端）
   ========================================================== */

/* 页面切换动画（柔和） */
@keyframes epPageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes epFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
.m-main { animation: epPageIn .35s ease; }
body.ep-leaving .m-main { animation: epFadeOut .22s ease forwards; }

/* 顶部栏 */
.m-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--ep-grad);
    box-shadow: 0 2px 12px rgba(255, 106, 0, .22);
}
.m-header-inner {
    max-width: 640px;
    margin: 0 auto;
    height: 52px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.m-title { color: #fff; font-weight: 600; font-size: 1rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-avatar { color: #fff; font-size: 1.45rem; text-decoration: none; line-height: 1; }

/* 内容区 */
.m-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 12px 90px;
    overflow-x: hidden;
    max-width: 100vw;
}

/* 底部 Tab 栏（活跃指示胶囊动画） */
.m-tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.m-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 0 10px;
    color: #9ca3af;
    font-size: .7rem;
    text-decoration: none;
    position: relative;
    transition: color .25s ease;
}
.m-tab i {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform .25s ease, color .25s ease;
}
.m-tab.active { color: var(--ep-primary); font-weight: 600; }
.m-tab.active i { transform: translateY(-1px) scale(1.08); }
.m-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--ep-grad);
    transform: translateX(-50%);
    transition: width .3s cubic-bezier(.22,.61,.36,1);
}
.m-tab.active::before { width: 42%; }

/* 底部提交栏 */
.submit-bar {
    position: fixed;
    left: 0; right: 0; bottom: 58px;
    z-index: 1030;
    background: rgba(255,255,255,.97);
    border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(8px);
}
.submit-bar-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
}
.submit-price { font-size: 1.5rem; font-weight: 800; color: var(--ep-primary); line-height: 1.15; }
.submit-btn { flex: 1; }

/* 手机端筛选条 */
.m-filter-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; -webkit-overflow-scrolling: touch; }
/* 异常订单 tab 红色强调 */
.m-filter.m-filter-abnormal.active {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* 异常订单横幅（配送端专区） */
.abnormal-banner {
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    color: #c62828;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .82rem;
    margin-bottom: 10px;
    line-height: 1.5;
}
.m-filter {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: .86rem;
    text-decoration: none;
    transition: all .2s;
}
.m-filter.active {
    background: var(--ep-primary);
    border-color: var(--ep-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(255,106,0,.25);
}

/* 手机端订单卡片 */
.m-order-card {
    display: block;
    background: #fff;
    border-radius: var(--ep-radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--ep-shadow);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.m-order-card:active { transform: scale(.985); }
.m-order-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.m-order-no { color: #9ca3af; font-size: .75rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-order-amount { color: var(--ep-primary); font-weight: 800; font-size: 1.05rem; }
.m-order-line { font-size: .9rem; color: #374151; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.m-order-line i { color: #9ca3af; font-size: .95rem; }
.m-order-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}

/* 信息列表 */
.info-list { display: flex; flex-direction: column; }
.info-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #f3f4f6; }
.info-item:last-child { border-bottom: 0; }
.info-label { width: 82px; flex-shrink: 0; color: #9ca3af; font-size: .88rem; padding-top: 1px; }
.info-value { flex: 1; font-size: .92rem; color: #1f2937; word-break: break-all; }

/* 移动端表单 */
.m-order-form { margin-bottom: 76px; }
.m-order-form .form-label { font-size: .9rem; font-weight: 500; }
.form-control-lg, .form-select-lg { min-height: 48px; font-size: 1rem; border-radius: 12px; }
textarea.form-control { border-radius: 12px; }

/* ==========================================================
   服务大厅（首页）
   ========================================================== */
.svc-hero {
    background: var(--ep-grad);
    border-radius: var(--ep-radius);
    padding: 22px 20px;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(255,106,0,.28);
    position: relative;
    overflow: hidden;
}
.svc-hero::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
}
.svc-hero h4 { font-weight: 700; }
.svc-hero p { opacity: .9; font-size: .9rem; margin: 0; }
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.svc-card {
    background: #fff;
    border-radius: var(--ep-radius);
    padding: 18px 16px;
    box-shadow: var(--ep-shadow);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.svc-card:active { transform: scale(.97); }
.svc-icon {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,.12);
}
.svc-card .svc-name { font-weight: 700; font-size: .98rem; }
.svc-card .svc-desc { color: #9ca3af; font-size: .78rem; line-height: 1.4; }
.svc-card .svc-arrow { margin-left: auto; margin-top: -4px; color: #cbd5e1; font-size: 1.1rem; }
.svc-card .svc-top { display: flex; align-items: center; width: 100%; }

/* 公告 */
.notice-card {
    background: linear-gradient(135deg, #fff8ee, #fffdf8);
    border: 1px solid #ffedcc;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: .88rem;
    color: #92600a;
    white-space: pre-line;
}
.notice-card i { color: #f59e0b; }

/* ==========================================================
   在线超市
   ========================================================== */
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.shop-card {
    background: #fff;
    border-radius: var(--ep-radius);
    overflow: hidden;
    box-shadow: var(--ep-shadow);
    display: flex; flex-direction: column;
}
.shop-img { width: 100%; height: 120px; object-fit: cover; background: #f3f4f6; }
.shop-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.shop-name { font-weight: 600; font-size: .92rem; line-height: 1.35; min-height: 2.5em; }
.shop-price { color: var(--ep-primary); font-weight: 800; font-size: 1.05rem; margin-top: auto; }
.shop-stock { color: #9ca3af; font-size: .75rem; }
.shop-buy-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.shop-num { display: flex; align-items: center; gap: 10px; }
.shop-num button {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid #e5e7eb; background: #fff; font-size: 1rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.shop-num button:active { background: #f3f4f6; }
.shop-num .num { min-width: 22px; text-align: center; font-weight: 700; }
.shop-cart-bar {
    position: fixed; left: 0; right: 0; bottom: 58px; z-index: 1030;
    background: rgba(255,255,255,.97);
    border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(8px);
}
.shop-cart-inner {
    max-width: 640px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px; padding: 9px 14px;
}
.shop-cart-icon { position: relative; font-size: 1.6rem; color: var(--ep-primary); }
.shop-cart-count {
    position: absolute; top: -6px; right: -10px;
    background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700;
    border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center;
}

/* 结算 */
.addr-card {
    background: #fff; border-radius: var(--ep-radius); padding: 14px;
    box-shadow: var(--ep-shadow); margin-bottom: 12px;
}
.pay-option {
    display: flex; align-items: center; gap: 12px;
    border: 1.5px solid #e5e7eb; border-radius: 14px;
    padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
    transition: all .2s;
}
.pay-option.active { border-color: var(--ep-primary); background: var(--ep-primary-light); }
.pay-option .po-icon { font-size: 1.5rem; }
.pay-option .po-title { font-weight: 600; font-size: .95rem; }
.pay-option .po-sub { color: #9ca3af; font-size: .8rem; }
.pay-option .po-check { margin-left: auto; color: #cbd5e1; font-size: 1.2rem; }
.pay-option.active .po-check { color: var(--ep-primary); }

/* ==========================================================
   配送端
   ========================================================== */
.pickup-big {
    background: linear-gradient(135deg, #fff4e6, #ffe8d1);
    border-radius: 12px;
    padding: 10px 14px;
    text-align: center;
    margin-bottom: 8px;
}
.pickup-big .label { color: #b45309; font-size: .78rem; }
.pickup-big .code { font-size: 1.9rem; font-weight: 800; color: #b45309; letter-spacing: 2px; }
.call-link { color: var(--ep-primary); font-weight: 700; text-decoration: none; }
.tel-btn {
    display: inline-flex; align-items: center; gap: 4px;
    color: #fff; background: #22c55e;
    border-radius: 20px; padding: 4px 12px; font-size: .82rem; text-decoration: none;
    box-shadow: 0 3px 8px rgba(34,197,94,.3);
}

/* 订单详情 - 配送进度条 */
.order-steps { display: flex; margin: 6px 0 4px; }
.os-step { flex: 1; position: relative; text-align: center; padding-top: 4px; }
.os-line { position: absolute; top: 18px; left: 0; right: 0; height: 3px; background: #e9ecef; z-index: 0; transition: background .4s; }
.os-line.done { background: var(--ep-primary); }
.os-dot {
    position: relative; z-index: 1; width: 34px; height: 34px; margin: 0 auto;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: #e9ecef; color: #999; font-size: 15px; transition: all .3s;
}
.os-dot.done { background: var(--ep-grad); color: #fff; box-shadow: 0 3px 8px rgba(255,106,0,.3); }
.os-label { margin-top: 8px; font-size: .82rem; font-weight: 600; color: #495057; }
.os-label.done { color: var(--ep-primary); }
.os-time { font-size: .72rem; color: #adb5bd; margin-top: 2px; }

/* 支付弹窗 */
.pay-modal .modal-content { border-radius: 20px; overflow: hidden; }
.pay-modal .modal-header { background: linear-gradient(135deg, #fff4e6, #ffe8d1); }
.recharge-hint {
    background: var(--ep-primary-light);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: .82rem;
    color: #b45309;
    margin-top: 8px;
}
.recharge-hint b { color: var(--ep-primary); }

/* 通用工具 */
img, video, canvas { max-width: 100%; height: auto; }
.table { max-width: 100%; }
.m-body { overflow-x: hidden; position: relative; }

@media (max-width: 768px) {
    .card { border-radius: 14px; }
    .card-header { padding: 12px 14px; }
    .alert { border-radius: 10px; }
    .btn { -webkit-tap-highlight-color: transparent; }
    .pagination .page-link { min-width: 38px; text-align: center; }
    .sidebar { min-height: auto; position: static; }
    .sidebar .nav { flex-direction: row; flex-wrap: wrap; padding: 6px; gap: 4px; }
    .sidebar .nav-link { padding: 8px 12px; border-radius: 8px; font-size: .86rem; }
    .sidebar .brand { padding: 12px 16px; }
}
