/* ========== Customer Module Styles ========== */

/* ========================================
   粉丝信息页面 - 上下双独立分区布局
   ======================================== */

/* --- 页面容器 --- */
#page-customer-fans {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    overflow: hidden;
    padding: 0;
    margin: -7px -24px -20px;
    background: var(--bg);
}

/* ========================================
   上半区：顶部功能操作区（固定不动）
   ======================================== */
.customer-top-section {
    flex-shrink: 0;
    width: 100%;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

/* 功能按钮栏 */
.customer-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

/* 表单操作区 */
.customer-form-area {
    padding: 12px 16px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.customer-form-area.mode-single {
    height: 160px;
}
.customer-form-area.mode-batch {
    height: 160px;
}

/* 单个登记表单 */
.customer-single-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.customer-single-form .form-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
}
.customer-single-form .form-row-bottom {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding-top: 8px;
}
.customer-single-form .form-group {
    flex: 0 0 auto;
    min-width: 100px;
}
.customer-single-form label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    display: block;
}
.customer-single-form input,
.customer-single-form select,
.customer-single-form textarea {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-sizing: border-box;
    background: #fff;
    color: var(--text);
}
.customer-single-form input:focus,
.customer-single-form select:focus,
.customer-single-form textarea:focus {
    border-color: var(--primary);
    outline: none;
}
.customer-single-form .form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: auto;
}
.customer-single-form .form-group-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* 批量登记区域 */
#customerBatchRegisterMode {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.customer-batch-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.customer-batch-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
}
.customer-batch-msg {
    font-size: 12px;
    padding: 4px 0;
    margin-top: 4px;
    flex-shrink: 0;
}

/* 批量表格 - 复用 .batch-table 通用样式 */

/* ========================================
   下半区：底部查询列表区（独立滚动）
   ======================================== */
.customer-bottom-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--bg);
}

/* 查询筛选栏 */
.customer-filter-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}
.customer-filter-bar select,
.customer-filter-bar input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff;
    outline: none;
    min-width: 100px;
    color: var(--text);
}
.customer-filter-bar select:focus,
.customer-filter-bar input[type="text"]:focus {
    border-color: var(--primary);
}
.customer-filter-bar input[type="text"] {
    min-width: 160px;
}

/* 数据列表区 */
.customer-list-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 16px 16px;
}
.customer-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.customer-list-area .pagination {
    flex-shrink: 0;
    padding: 12px 0 0;
}

/* 数据表格 */
.customer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--card-bg);
    min-width: 900px;
}
.customer-table thead {
    background: #F8FAFB;
    position: sticky;
    top: 0;
    z-index: 1;
}
.customer-table th {
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.customer-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.customer-table tbody tr:hover {
    background: var(--bg-hover);
}
.customer-table .td-actions {
    white-space: nowrap;
}
.customer-table .td-actions .btn {
    margin-right: 4px;
}

/* 状态标签 */
.customer-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
}
.customer-badge-pending {
    background: #fff7ed;
    color: #c2410c;
}
.customer-badge-assigned {
    background: #dbeafe;
    color: #1e40af;
}
.customer-badge-accepted {
    background: #dcfce7;
    color: #166534;
}
.customer-badge-completed {
    background: #f3f4f6;
    color: #6b7280;
}
.customer-badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* 汇总信息 */
.customer-summary {
    text-align: center;
    padding: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   详情模态框
   ======================================== */
.customer-detail-section {
    margin-bottom: 20px;
}
.customer-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.customer-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
    font-size: 13px;
}
.customer-info-grid .info-label {
    color: var(--text-secondary);
    font-size: 12px;
}
.customer-info-grid .info-value {
    color: var(--text);
    font-weight: 500;
    word-break: break-all;
}

/* 操作日志时间线 */
.customer-log-timeline {
    position: relative;
    padding-left: 20px;
}
.customer-log-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.customer-log-item {
    position: relative;
    margin-bottom: 12px;
}
.customer-log-dot {
    position: absolute;
    left: -18px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
}
.customer-log-info {
    font-size: 13px;
}
.customer-log-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========================================
   响应式布局
   ======================================== */
@media (max-width: 768px) {
    .customer-action-bar {
        gap: 6px;
        padding: 8px 12px;
    }
    .customer-form-area {
        padding: 8px 12px;
    }
    .customer-single-form .form-group {
        min-width: 90px;
    }
    .customer-filter-bar {
        gap: 6px;
        padding: 8px 12px;
    }
    .customer-filter-bar select,
    .customer-filter-bar input[type="text"] {
        min-width: 80px;
        font-size: 12px;
    }
    .customer-table {
        font-size: 12px;
    }
    .customer-table th,
    .customer-table td {
        padding: 8px;
    }
    .customer-info-grid {
        grid-template-columns: 1fr;
    }
}
