* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { background: #f5f5f5; }

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.page-header h1 {
    font-size: 18px;
    color: #333;
}
.back-link {
    color: #1890ff;
    text-decoration: none;
    font-size: 14px;
}

/* 搜索区域 */
.search-section {
    padding: 15px;
    background: #fff;
    margin-bottom: 10px;
}
.search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 统一输入框样式 */
.search-input {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.page-input {
    max-width: 80px;
}

/* 状态下拉框 */
.status-select {
    width: 140px;
    flex-shrink: 0;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

/* 扫码按钮 */
.scan-btn {
    padding: 12px 20px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    flex-shrink: 0;
    cursor: pointer;
}

/* 查询按钮 */
.btn-primary {
    background: #52c41a;
    color: #fff;
    flex-shrink: 0;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* 统计条 */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    margin: 0 10px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}
.stats-bar strong { color: #1890ff; }
.page-info { color: #999; }

/* 加载 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f5f5f5;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { margin-top: 15px; color: #999; }
.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}
.loading-more .spinner { width: 24px; height: 24px; border-width: 3px; }
.loading-more p { margin-top: 8px; color: #999; font-size: 12px; }

/* 扫码弹窗 */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #fff; border-radius: 12px; width: 90%; max-width: 400px; overflow: hidden; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #eee; font-size: 16px; font-weight: 500; }
.close-btn { font-size: 24px; color: #999; cursor: pointer; }
.scan-result-input { width: calc(100% - 30px); margin: 10px 15px; padding: 12px; font-size: 16px; border: 1px solid #ddd; border-radius: 8px; background: #f5f5f5; }
#reader { width: calc(100% - 30px); height: 300px; margin: 0 15px; background: #000; border-radius: 12px; overflow: hidden; }
#reader video { width: 100%; height: 100%; object-fit: cover; }
.scan-status { text-align: center; padding: 12px; color: #8e8e93; font-size: 14px; }

/* 订单卡片 */
.order-card {
    background: #fff;
    border-radius: 8px;
    margin: 0 10px 15px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.order-card:hover {
    border-color: #1890ff;
}
.order-card.order-selected {
    border-color: #52c41a;
    background-color: #f6ffed;
}

/* 订单头部 */
.order-header { padding: 15px; }
.order-serial {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #1890ff;
    margin-bottom: 10px;
}
.serial-num { font-size: 24px; font-weight: bold; color: #1890ff; }
.serial-text { font-size: 14px; color: #999; }

/* 订单信息网格 */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px 15px;
}
.info-item {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
}
.info-label { color: #666; flex-shrink: 0; min-width: 70px; }
.info-value { color: #333; word-break: break-all; }
.express-num { font-weight: 500; color: #1890ff; }

/* 状态标签 */
.status-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.status-0 { background: #fff7e6; color: #fa8c16; }
.status-1 { background: #e6f7ff; color: #1890ff; }
.status-2 { background: #f6ffed; color: #52c41a; }
.status-4 { background: #f9f0ff; color: #722ed1; }
.status-5 { background: #fff1f0; color: #eb2f96; }
.status-6 { background: #f5f5f5; color: #8c8c8c; }

/* 商品区域 .goods-section { padding: 15px; border-top: 8px solid #f5f5f5; }*/
.goods-section { padding: 15px; }
.goods-title {
    font-weight: 500;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #333;
}
.goods-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.goods-item {
    display: flex;
    padding: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background: #fafafa;
}
.goods-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    background: #f5f5f5;
}
.goods-detail {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.goods-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    word-break: break-word;
}
.goods-info { font-size: 12px; color: #999; line-height: 1.4; }
.goods-spec {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.goods-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}
.goods-meta .goods-info {
    white-space: nowrap;
    flex-shrink: 0;
}
.no-goods { text-align: center; padding: 20px; color: #999; font-size: 14px; }

/* 订单拍照图片 */
.order-photos {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.photos-label {
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
}
.photos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.order-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}
.page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}
.page-btn:disabled { color: #ccc; cursor: not-allowed; }
.page-btn:not(:disabled):hover { border-color: #1890ff; color: #1890ff; }
.page-current { font-size: 14px; color: #666; }
.btn-create-package {
    padding: 8px 16px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}
.btn-create-package:disabled { background: #ccc; cursor: not-allowed; }

/* 订单选择框 */
.order-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.order-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 创建包裹表单弹窗 */
.form-modal {
    padding-bottom: 15px;
}
.form-group {
    padding: 10px 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}
.form-group .required { color: #ff4d4f; }
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.form-group textarea { resize: vertical; }
.form-row {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
}
.form-row .form-group {
    flex: 1;
    padding: 0;
}
.selected-orders-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    max-height: 100px;
    overflow-y: auto;
}
.selected-order-tag {
    padding: 4px 8px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 12px;
}
.submit-btn {
    width: calc(100% - 30px);
    margin: 10px 15px 0;
    padding: 12px;
    background: #52c41a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}
.submit-btn:disabled { background: #ccc; }

/* 桌面端分页固定底部 */
@media (min-width: 768px) {
    .pagination {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }
}

/* 无订单 */
.no-order { text-align: center; padding: 50px; color: #999; }

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    z-index: 2000;
}
.toast.error { background: rgba(255,77,79,0.9); }
.toast.success { background: rgba(82,196,26,0.9); }

/* ========== 桌面端响应式布局 ========== */
@media (min-width: 768px) {
    body { padding: 20px 0; }

    .search-section {
        max-width: 1260px;
        margin: 0 auto 15px;
        padding: 8px;
    }

    .search-row {
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }
    .search-input {
        flex: 1;
        min-width: 0;
    }
    .page-input {
        max-width: 80px;
    }
    .btn-primary {
        flex-shrink: 0;
    }

    .stats-bar { max-width: 1260px; margin: 0 auto 15px; }

    .order-list {
        max-width: 1260px;
        margin: 0 auto;
    }
    .order-card {
        margin: 0 0 15px 0;
    }

    .order-info-grid { grid-template-columns: repeat(4, 1fr); }

    .goods-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .goods-item {
        flex-direction: row;
    }

    .pagination { max-width: 1260px; margin: 0 auto; }

    body { padding-bottom: 80px; }
}