/* ==========================================================
   快递代取代拿系统 - 全局样式
   ========================================================== */

:root {
    --ep-primary: #f97316;
    --ep-primary-dark: #ea580c;
    --ep-primary-light: #fff7ed;
}

body {
    background: #f5f6f8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    min-height: 100vh;
}

/* 顶部导航 */
.navbar-ep {
    background: linear-gradient(135deg, var(--ep-primary) 0%, #fb923c 100%);
    box-shadow: 0 2px 10px rgba(249, 115, 22, .25);
}
.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, .9) !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;
}
.navbar-ep .dropdown-menu {
    border: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    border-radius: 10px;
}

/* 卡片 */
.card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.card .card-header {
    background: #fff;
    border-bottom: 1px solid #f1f3f5;
    border-radius: 14px 14px 0 0 !important;
    font-weight: 600;
}

/* 按钮主色 */
.btn-primary {
    background: var(--ep-primary);
    border-color: var(--ep-primary);
}
.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);
}
.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:focus,
.form-select:focus {
    border-color: #fdba74;
    box-shadow: 0 0 0 .2rem rgba(249, 115, 22, .15);
}
.pagination .page-link {
    color: var(--ep-primary);
}
.pagination .page-item.active .page-link {
    background: var(--ep-primary);
    border-color: var(--ep-primary);
}

/* 用户端下单表单卡片 */
.order-form-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
}
.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: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}
.field-icon + .form-control {
    padding-left: 38px;
}

/* 状态徽标 */
.badge-status { font-weight: 500; letter-spacing: .3px; }

/* 订单卡片 */
.order-card {
    transition: box-shadow .2s;
    cursor: default;
}
.order-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.1);
}

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

/* 侧边栏（管理端/配送端） */
.sidebar {
    background: #1e293b;
    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;
}
.sidebar .nav-link {
    color: rgba(255,255,255,.75);
    padding: 11px 20px;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.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-primary);
}
.sidebar .nav-link.active:hover { background: var(--ep-primary); }

/* 统计卡片 */
.stat-card {
    border-radius: 14px;
    color: #fff;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.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, #fff7ed 0%, #ffedd5 100%);
}
.login-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px;
    box-shadow: 0 8px 40px rgba(0,0,0,.1);
}
.login-box .logo {
    font-size: 2.2rem;
    color: var(--ep-primary);
    text-align: center;
}

/* 送达照片 */
.delivery-photo img {
    max-width: 100%;
    border-radius: 12px;
}

/* 页脚 */
.footer {
    color: #9ca3af;
    font-size: .85rem;
    text-align: center;
    padding: 20px 0 30px;
}

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

/* 顶部栏 */
.m-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(135deg, var(--ep-primary) 0%, #fb923c 100%);
    box-shadow: 0 2px 10px rgba(249, 115, 22, .25);
}
.m-header-inner {
    max-width: 640px;
    margin: 0 auto;
    height: 52px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.m-brand {
    color: #fff;
    font-size: 1.35rem;
    text-decoration: none;
    line-height: 1;
}
.m-title {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.m-avatar {
    color: #fff;
    font-size: 1.45rem;
    text-decoration: none;
    line-height: 1;
}
.m-avatar.dropdown-toggle::after { display: none; }
.m-user-menu {
    min-width: 180px;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
    padding: 6px;
}
.m-user-menu .dropdown-item {
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .93rem;
}
.m-user-menu .dropdown-item:active {
    background: var(--ep-primary);
}

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

/* 底部 Tab 栏 */
.m-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(0,0,0,.05);
}
.m-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 0 9px;
    color: #9ca3af;
    font-size: .7rem;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.m-tab i { font-size: 1.3rem; line-height: 1; }
.m-tab.active { color: var(--ep-primary); font-weight: 600; }

/* 底部提交栏（下单页） */
.submit-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 56px;
    z-index: 1030;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid #eee;
    padding-bottom: env(safe-area-inset-bottom);
}
.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;
}
.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;
    -webkit-tap-highlight-color: transparent;
}
.m-filter.active {
    background: var(--ep-primary);
    border-color: var(--ep-primary);
    color: #fff;
    font-weight: 600;
}

/* 手机端订单卡片 */
.m-order-card {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: 13px 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}
.m-order-card:active { background: #fafafa; }
.m-order-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}
.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-action {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px dashed #e5e7eb;
    color: var(--ep-primary);
    font-weight: 600;
    font-size: .9rem;
    text-align: center;
}
.m-order-action.go { color: #198754; }

/* 信息列表（订单详情等） */
.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: 78px;
    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: 74px; }
.m-order-form .form-label { font-size: .9rem; }
.form-control-lg, .form-select-lg {
    min-height: 48px;
    font-size: 1rem;
    border-radius: 10px;
}

/* 移动端提示 / 按钮触控尺寸 */
@media (max-width: 768px) {
    .btn { -webkit-tap-highlight-color: transparent; }
    .card { border-radius: 12px; }
    .card-header { padding: 12px 14px; }
    .alert { border-radius: 10px; }
    .pagination .page-link {
        min-width: 38px;
        text-align: center;
    }
}

/* 管理端：小屏兜底（非重点适配，仅保证可用） */
@media (max-width: 768px) {
    .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; }
}

/* ==========================================================
   移动端适配（旧版补充）
   ========================================================== */
@media (max-width: 768px) {
    .order-form-card { padding: 16px; }
    .price-tag { font-size: 1.6rem; }
}
