/* customer_management.css v1.0.0 - 客户管理页面 */

/* ===== 筛选栏 ===== */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.filter-input {
    width: 200px;
}

/* ===== 加载器 ===== */
.loader {
    text-align: center;
    padding: 40px;
    color: #999;
}
.loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e7eaec;
    border-top-color: #1ab394;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 汇总表格 ===== */
.customer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 700px;
}
.customer-table thead th {
    background: #f5f5f5;
    border-bottom: 2px solid #e7eaec;
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}
.customer-table tbody td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #e7eaec;
}
.customer-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}
.customer-table tbody tr:hover {
    background: #f0f0f0;
}
.customer-table .hint {
    font-size: 11px;
    font-weight: 400;
    color: #999;
}
.cost-link {
    color: #1ab394;
    cursor: pointer;
    text-decoration: underline;
}
.cost-link:hover {
    color: #169c7d;
}
.btn-view {
    background-color: #1ab394;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-view:hover {
    background-color: #169c7d;
}

/* ===== 空提示 ===== */
.empty-tip {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 14px;
}

/* ===== 成本明细弹窗 ===== */
.cost-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.cost-detail-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.cost-detail-table td:first-child {
    color: #555;
    font-weight: 500;
}
.cost-value {
    text-align: right;
    font-weight: 600;
    color: #333;
}
.cost-detail-table .total-row td {
    border-top: 2px solid #e7eaec;
    font-weight: 700;
    color: #1ab394;
}

/* ===== 订单明细弹窗 ===== */
.order-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 700px;
}
.order-detail-table thead th {
    background: #f5f5f5;
    border-bottom: 2px solid #e7eaec;
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}
.order-detail-table tbody td {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid #e7eaec;
}
.order-detail-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

/* ===== 弹窗遮罩 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
.modal-overlay.open,
.modal-overlay[style*="display: flex"] {
    display: flex !important;
}
.modal-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.2s ease;
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e7eaec;
}
.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}
.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    transition: all 0.15s;
}
.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}
.modal-close svg {
    width: 16px;
    height: 16px;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e7eaec;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== 移动端适配 ===== */
@media (max-width: 1024px) {
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    .filter-group {
        width: 100%;
    }
    .filter-input {
        width: 100%;
        box-sizing: border-box;
    }
    #queryBtn {
        width: 100%;
        padding: 10px;
    }
    
    /* 汇总表格横向滚动 */
    .table_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .customer-table {
        min-width: 700px;
        font-size: 13px;
    }
    .customer-table thead th,
    .customer-table tbody td {
        padding: 6px 4px;
    }
    
    /* 弹窗全屏 */
    .modal-overlay {
        align-items: flex-end;
    }
    .modal-box {
        max-width: 100vw;
        max-height: 90vh;
        width: 100%;
        border-radius: 12px 12px 0 0;
    }
    .modal-box[style*="width:400px"] {
        width: 100%;
    }
    .modal-box[style*="width:800px"] {
        width: 100%;
    }
    .modal-header {
        padding: 14px 16px;
    }
    .modal-body {
        padding: 12px;
    }
    .order-detail-table {
        min-width: 600px;
        font-size: 12px;
    }
    .cost-detail-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}
