/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ========== 工具栏 ========== */
.toolbar {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-outline {
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.filter-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-color);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-input {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 250px;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ========== 订单列表 ========== */
.orders-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    min-height: 400px;
}

.orders-header {
    display: grid;
    grid-template-columns: 150px 100px 180px 1fr 100px 150px 100px;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.orders-list {
    max-height: 600px;
    overflow-y: auto;
}

.order-row {
    display: grid;
    grid-template-columns: 150px 100px 180px 1fr 100px 150px 100px;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background-color 0.2s ease;
}

.order-row:hover {
    background-color: var(--bg-light);
}

.order-row.selected {
    background-color: #eff6ff;
}

.order-col-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-col-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.order-col-id {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

.order-col-platform {
    font-size: 0.875rem;
}

.platform-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.platform-taobao {
    background-color: #ff6700;
}

.platform-tmall {
    background-color: #d41f1c;
}

.platform-jd {
    background-color: #e3393c;
}

.platform-pdd {
    background-color: #e02e24;
}

.order-col-buyer {
    font-size: 0.875rem;
}

.buyer-name {
    font-weight: 500;
    color: var(--text-color);
}

.buyer-phone {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.125rem;
}

.order-col-product {
    font-size: 0.875rem;
}

.product-name {
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-qty {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.125rem;
}

.order-col-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e02e24;
}

.order-col-time {
    font-size: 0.75rem;
    color: var(--text-light);
}

.order-col-status {
    font-size: 0.875rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-pushed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.order-col-action {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    padding: 0.375rem 0.875rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn-push {
    background-color: var(--primary-color);
    color: white;
}

.action-btn-push:hover {
    background-color: var(--secondary-color);
}

.action-btn-view {
    background-color: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.action-btn-view:hover {
    background-color: var(--border-color);
}

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

/* ========== 空状态和加载状态 ========== */
.empty-state,
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.loading-spinner {
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

#pageInfo {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    font-size: 1.75rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.warehouse-select {
    margin-bottom: 1.5rem;
}

.warehouse-select label {
    font-weight: 600;
    color: var(--text-color);
}

.push-summary {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.push-summary strong {
    color: var(--primary-color);
    font-size: 1.25rem;
}

.result-content {
    text-align: center;
    padding: 1rem 0;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-success {
    color: var(--success-color);
}

.result-message {
    font-size: 1.125rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.result-detail {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .orders-header,
    .order-row {
        grid-template-columns: 120px 90px 150px 1fr 90px 130px 90px;
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .orders-header {
        display: none;
    }

    .order-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
    }

    .order-row > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .order-row > div::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-color);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}
