* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.header {
    background: #001529;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #fff;
    font-size: 14px;
}

/* 主容器 */
.main-container {
    padding: 24px 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-icon.blue { background: #e6f7ff; color: #1890ff; }
.stat-icon.green { background: #f6ffed; color: #52c41a; }
.stat-icon.gold { background: #fffbe6; color: #faad14; }
.stat-icon.red { background: #fff1f0; color: #ff4d4f; }
.stat-icon.gray { background: #f5f5f5; color: #8c8c8c; }

.stat-value {
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #8c8c8c;
    margin-top: 2px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    width: 300px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #1890ff;
}

.filter-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #1890ff;
}

/* 按钮 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    border: 1px solid #d9d9d9;
    color: #333;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #fafafa;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    font-weight: 500;
    color: #262626;
}

.table tbody tr:hover {
    background: #fafafa;
}

.table .text-center {
    text-align: center;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1.5;
}

.tag-blue { background: #e6f7ff; border: 1px solid #91d5ff; color: #1890ff; }
.tag-green { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; }
.tag-gold { background: #fffbe6; border: 1px solid #ffe58f; color: #faad14; }
.tag-red { background: #fff1f0; border: 1px solid #ffa39e; color: #ff4d4f; }
.tag-default { background: #f5f5f5; border: 1px solid #d9d9d9; color: #595959; }

/* 操作按钮 */
.action-btn {
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #8c8c8c;
    transition: color 0.3s;
}

.action-btn:hover {
    color: #1890ff;
}

.action-btn.delete:hover {
    color: #ff4d4f;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination button.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.pagination button:disabled {
    color: #d9d9d9;
    cursor: not-allowed;
}

.pagination .page-info {
    color: #8c8c8c;
    font-size: 14px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    margin: 50px auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s;
}

.modal-large {
    max-width: 700px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-large .modal-body {
    flex: 1;
    overflow-y: auto;
}

.modal-large .modal-header {
    flex-shrink: 0;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #262626;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #8c8c8c;
    line-height: 1;
}

.close:hover {
    color: #262626;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #262626;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #1890ff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

/* 客户详情 */
.customer-detail {
    display: grid;
    gap: 16px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #1890ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
}

.detail-name {
    font-size: 24px;
    font-weight: 600;
    color: #262626;
}

.detail-tags {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.detail-info {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #8c8c8c;
    width: 120px;
    flex-shrink: 0;
}

.info-value {
    color: #262626;
    flex: 1;
}

.detail-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

/* 响应式 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-filters {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 12px;
    }
}

/* 跟进记录样式 */
.followup-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.followup-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.followup-section-header h3 {
    margin: 0;
    font-size: 16px;
    color: #262626;
    display: flex;
    align-items: center;
    gap: 8px;
}

.followup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.empty-followup {
    text-align: center;
    padding: 40px 20px;
    color: #8c8c8c;
    background: #fafafa;
    border-radius: 4px;
}

.followup-item {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    padding: 12px 16px;
    transition: all 0.3s;
}

.followup-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #d9d9d9;
}

.followup-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.followup-type {
    font-weight: 500;
    color: #262626;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.followup-date {
    color: #8c8c8c;
    font-size: 13px;
}

/* 跟进记录删除按钮 */
.followup-delete-btn {
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #8c8c8c;
    transition: all 0.3s;
    font-size: 12px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.followup-delete-btn:hover {
    color: #ff4d4f;
    background: #fff1f0;
}

.followup-content {
    color: #595959;
    line-height: 1.6;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.followup-next {
    color: #1890ff;
    font-size: 13px;
    padding: 8px 0;
    border-top: 1px solid #e8e8e8;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.followup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #e8e8e8;
    margin-top: 8px;
    font-size: 12px;
    color: #8c8c8c;
}

.followup-user {
    display: flex;
    align-items: center;
    gap: 4px;
}

.followup-created {
    color: #bfbfbf;
}
