/* ========== 包裹列表页面样式 ========== */

/* 页面标题区 */
.pkg-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pkg-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.pkg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--color-primary, #226AFF);
    text-decoration: none;
    transition: opacity 0.2s;
}

.pkg-back-link:hover {
    opacity: 0.8;
}

.pkg-back-link svg {
    width: 16px;
    height: 16px;
}

/* 筛选区域 */
.filter-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    max-width: 360px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary, #226AFF);
    box-shadow: 0 0 0 3px rgba(34,106,255,0.1);
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 18px;
    background: var(--color-primary, #226AFF);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--color-primary-dark, #1a54cc);
}

.search-btn svg {
    width: 16px;
    height: 16px;
}

.clear-btn {
    height: 36px;
    padding: 0 14px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-btn:hover {
    background: #e5e7eb;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 10px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
}

.filter-select {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.goods-type-filter {
    flex: 1;
}

.type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.type-tag {
    padding: 4px 12px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.type-tag:hover {
    border-color: var(--color-primary, #226AFF);
    color: var(--color-primary, #226AFF);
}

.type-tag.active {
    background: var(--color-primary, #226AFF);
    color: #fff;
    border-color: var(--color-primary, #226AFF);
}

.filter-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #9ca3af;
}

.filter-stats strong {
    color: var(--color-primary, #226AFF);
    font-weight: 600;
}

.user-code {
    margin-left: auto;
}

/* 包裹列表区域 */
.package-list-section {
    min-height: 300px;
}

.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9ca3af;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--color-primary, #226AFF);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* 包裹表格 */
.package-table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow-x: auto;
}

.package-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.package-table thead {
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.package-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.package-table td {
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.package-row:hover {
    background: #f9fafb;
}

/* 列宽设置 */
.col-checkbox {
    width: 40px;
    text-align: center;
}

.col-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary, #226AFF);
}

.col-index {
    width: 50px;
    text-align: center;
}

.col-number {
    min-width: 140px;
}

.col-status {
    width: 80px;
}

.col-goods-type {
    width: 100px;
}

.col-weight,
.col-volume {
    width: 70px;
    text-align: right;
}

.col-size {
    width: 110px;
}

.col-group-name {
    min-width: 100px;
}

.col-time {
    width: 150px;
}

.col-image {
    width: 80px;
    text-align: center;
}

/* 操作列 */
.col-action {
    width: 80px;
    text-align: center;
}

/* 删除包裹按钮 */
.delete-package-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-package-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.delete-package-btn:active {
    background: #fecaca;
    transform: translateY(1px);
}

.no-action {
    color: #d1d5db;
}

/* 确认弹窗 */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.confirm-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.confirm-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.confirm-modal-message {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-modal-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.confirm-modal-btn.cancel-btn {
    background: #f3f4f6;
    color: #6b7280;
}

.confirm-modal-btn.cancel-btn:hover {
    background: #e5e7eb;
}

.confirm-modal-btn.confirm-btn {
    background: #dc2626;
    color: #fff;
}

.confirm-modal-btn.confirm-btn:hover {
    background: #b91c1c;
}

/* 轻提示 */
.global-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    transition: opacity 0.3s;
}

.global-toast.fade-out {
    opacity: 0;
}

/* 包裹单号样式 */
.package-number {
    color: var(--color-primary, #226AFF);
    font-weight: 600;
    cursor: pointer;
}

.package-number:hover {
    text-decoration: underline;
}

/* 状态徽章 */
.package-status-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
}

.status-10 { background: #FEF3C7; color: #92400E; }
.status-20 { background: #D1FAE5; color: #065F46; }
.status-30 { background: #DBEAFE; color: #1E40AF; }
.status-40 { background: #E0E7FF; color: #3730A3; }
.status-90 { background: #FCE7F3; color: #9D174D; }
.status-100 { background: #F3E8FF; color: #6B21A8; }
.status-200 { background: #D1FAE5; color: #047857; }
.status-500 { background: #FEE2E2; color: #991B1B; }

/* 查看图片链接 */
.view-image-link {
    color: var(--color-primary, #226AFF);
    cursor: pointer;
    text-decoration: none;
}

.view-image-link:hover {
    text-decoration: underline;
}

.no-image {
    color: #d1d5db;
}

/* 图片预览弹窗 */
.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.image-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-preview-close svg {
    width: 18px;
    height: 18px;
}

.image-preview-container {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.image-preview-prev,
.image-preview-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-preview-prev:hover,
.image-preview-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.image-preview-prev svg,
.image-preview-next svg {
    width: 24px;
    height: 24px;
}

.image-preview-prev {
    left: -60px;
}

.image-preview-next {
    right: -60px;
}

.image-preview-counter {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

/* 分页 */
.pagination-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}

.page-btn {
    padding: 8px 20px;
    font-size: 14px;
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--color-primary, #226AFF);
    color: var(--color-primary, #226AFF);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #6b7280;
}

.page-info strong {
    color: var(--color-primary, #226AFF);
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 36px;
    height: 36px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--color-primary, #226AFF);
    color: #fff;
    border-color: var(--color-primary, #226AFF);
}

.back-to-top svg {
    width: 18px;
    height: 18px;
}

/* 底部操作栏 */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.bottom-action-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.bottom-stats {
    display: flex;
    align-items: center;
    gap: 32px;
}

.bottom-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bottom-stat-label {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
}

.bottom-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary, #226AFF);
}

.submit-order-btn {
    height: 44px;
    padding: 0 32px;
    background: var(--color-primary, #226AFF);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(34, 106, 255, 0.3);
}

.submit-order-btn:hover:not(:disabled) {
    background: var(--color-primary-dark, #1a54cc);
    box-shadow: 0 6px 16px rgba(34, 106, 255, 0.4);
}

.submit-order-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
}

/* 包裹行选中状态 */
.package-row.selected {
    background: #eff6ff;
}

.package-row.selected:hover {
    background: #dbeafe;
}

/* 响应式 */
@media (max-width: 992px) {
    .bottom-action-bar {
        left: 220px;
    }
}

@media (max-width: 768px) {
    .uc-main {
        flex-direction: column;
    }

    .uc-sidebar {
        width: 100%;
        min-height: auto;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .uc-sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 8px 12px;
        gap: 4px;
    }

    .uc-nav-item {
        white-space: nowrap;
        padding: 8px 14px;
        margin-bottom: 0;
    }

    .uc-sidebar-footer {
        display: none;
    }

    .bottom-action-bar {
        left: 0;
    }

    .filter-bar {
        flex-direction: column;
    }

    .package-table-wrapper {
        margin: 0 -16px;
        border-radius: 0;
    }

    .package-table {
        font-size: 12px;
    }

    .package-table th,
    .package-table td {
        padding: 8px 6px;
    }

    .image-preview-prev {
        left: 10px;
    }

    .image-preview-next {
        right: 10px;
    }

    .image-preview-close {
        top: 10px;
        right: 10px;
    }

    .image-preview-counter {
        bottom: 10px;
    }

    .pkg-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
