* { 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;
    flex-wrap: wrap;
    gap: 10px;
}
.page-header h1 {
    font-size: 18px;
    color: #333;
}
.header-actions {
    display: flex;
    gap: 15px;
}
.back-link {
    color: #1890ff;
    text-decoration: none;
    font-size: 14px;
}

/* 加载 */
.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; }

/* 包裹卡片 */
.package-list {
    padding: 10px;
}
.package-card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    transition: border-color 0.2s;
}
.package-card:hover {
    border-color: #1890ff;
}

/* 包裹头部 */
.package-header {
    padding: 15px;
}
.package-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1890ff;
}
.package-id {
    font-size: 16px;
    font-weight: bold;
    color: #1890ff;
}
.expand-icon {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
    cursor: pointer;
}
.expand-icon.expanded {
    transform: rotate(90deg);
}

.package-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 15px;
}
.info-item {
    display: flex;
    font-size: 14px;
    line-height: 1.5;
    align-items: flex-start;
}
.info-item.full-width {
    grid-column: 1 / -1;
}
.info-label {
    color: #666;
    flex-shrink: 0;
    min-width: 70px;
}
.info-value {
    color: #333;
    word-break: break-all;
}
.info-input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    min-width: 0;
}
.info-input:read-only {
    background: #f5f5f5;
    border-color: #eee;
}
.info-input[rows] {
    resize: vertical;
}

/* 编辑按钮 */
.btn-edit, .btn-save, .btn-cancel {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}
.btn-edit {
    background: #1890ff;
    color: #fff;
}
.btn-save {
    background: #52c41a;
    color: #fff;
}
.btn-cancel {
    background: #999;
    color: #fff;
}
.btn-sm {
    padding: 2px 8px;
    font-size: 11px;
}

/* 订单区域 */
.express-section {
    border-top: 1px solid #eee;
    background: #fafafa;
}
.express-header {
    padding: 15px;
}
.express-header:hover {
    background: #f0f0f0;
}
.express-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.express-label {
    font-size: 14px;
    font-weight: bold;
    color: #52c41a;
}
.express-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 15px;
}

/* 验货图片 */
.express-photos {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.photos-label {
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
}
.photos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.express-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* 商品区域 */
.goods-section {
    padding: 15px;
    background: #fff;
    border-top: 1px dashed #ddd;
}
.goods-title {
    font-weight: 500;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}
.goods-list {
    display: flex;
    flex-direction: column;
    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: 6px;
}
.goods-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.goods-label {
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
    min-width: 60px;
}
.goods-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    min-width: 0;
}
.goods-input:read-only {
    background: #f5f5f5;
    border-color: #eee;
}
.goods-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
    word-break: break-word;
}
.goods-link {
    color: #1890ff;
    text-decoration: none;
}
.goods-link:hover {
    text-decoration: underline;
}
.no-goods { text-align: center; padding: 20px; color: #999; font-size: 14px; }

/* 无包裹 */
.no-package {
    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; }

    .page-header {
        max-width: 1200px;
        margin: 0 auto 15px;
        padding: 15px 20px;
    }

    .package-list {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0;
    }
    .package-card {
        margin: 0 0 15px 0;
    }

    .package-info-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .express-info-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .goods-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 10px;
    }
}