/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* CRM 布局 */
.crm-layout {
    display: flex;
    min-height: 100vh;
}

/* 左侧导航栏 */
.sidebar {
    width: 220px;
    background: #fff;
    color: rgb(42, 126, 251);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
}

.sidebar-header h2 {
    color: rgb(42, 126, 251);
    font-size: 20px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    text-decoration: none;
}

.nav-item:hover {
    background-color: #f0f6ff;
    color: rgb(42, 126, 251);
}

.nav-item.active {
    background-color: #e6f0ff;
    color: rgb(42, 126, 251);
    border-left: 4px solid rgb(42, 126, 251);
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
}

/* 右侧内容区 */
.main-content {
    flex: 1;
    margin-left: 220px;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.content-header {
    background: #fff;
    color: #333;
    padding: 15px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.content-header h1 {
    color: #333;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.content-body {
    padding: 20px 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 汇总区域样式 */
.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.summary-header h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.summary-content {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.summary-card {
    flex: 1;
    min-width: 160px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    padding: 8px;
    border-radius: 8px;
    border-left: 4px solid rgb(42, 126, 251);
}

.summary-card:hover {
    box-shadow: 0 4px 12px rgba(42, 126, 251, 0.15);
    transform: translateY(-2px);
    transition: all 0.3s;
}

.summary-label {
    color: #333;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 18px;
    font-weight: bold;
    color: rgb(42, 126, 251);
    margin-top: 4px;
}

.summary-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.summary-input-group input[type="month"] {
    padding: 4px 6px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    flex: 1;
    min-width: 80px;
}

.btn-query {
    padding: 4px 10px !important;
    background-color: rgb(42, 126, 251) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-query:hover {
    background-color: rgb(62, 146, 251) !important;
}

/* 客户管理区域样式 */
.customer-section {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-header h2 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 4px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    background-color: #fff;
    min-width: 180px;
}

.search-box input:focus {
    outline: none;
    border-color: rgb(42, 126, 251);
}

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

.filter-sort select {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    background-color: #fff;
    cursor: pointer;
}

.filter-sort select:hover {
    border-color: #333;
}

.btn-add {
    padding: 4px 12px !important;
    font-size: 12px !important;
    background-color: rgb(42, 126, 251) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add:hover {
    background-color: rgb(62, 146, 251) !important;
    box-shadow: 0 2px 8px rgba(42, 126, 251, 0.3);
}

.customer-table-wrapper {
    flex: 1;
    overflow-y: auto;
}

/* 按钮样式 */
button {
    padding: 8px 16px;
    background-color: rgb(42, 126, 251);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

button:hover {
    background-color: rgb(62, 146, 251);
    box-shadow: 0 2px 8px rgba(42, 126, 251, 0.3);
}

/* 小按钮样式（用于新增客户和操作按钮） */
.btn-small {
    padding: 4px 10px !important;
    font-size: 12px !important;
}

/* 表格操作按钮样式 */
.customer-table td button {
    padding: 6px 12px;
    font-size: 13px;
    margin-right: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.customer-table td button:last-child {
    margin-right: 0;
}

/* 编辑按钮 */
.customer-table td button:first-child {
    background-color: #6dd230;
}

.customer-table td button:first-child:hover {
    background-color: #5bc020;
    box-shadow: 0 2px 8px rgba(109, 210, 48, 0.4);
}

/* 改色按钮 */
.customer-table td button:nth-child(2) {
    background-color: rgb(42, 126, 251);
}

.customer-table td button:nth-child(2):hover {
    background-color: rgb(62, 146, 251);
}

/* 删除按钮样式 */
.customer-table td button:last-child {
    background-color: #ff4d4f;
}

.customer-table td button:last-child:hover {
    background-color: #ff7875;
}

/* 表格样式 */
.customer-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.customer-table th {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid rgb(42, 126, 251);
    background-color: #f5f7fa;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.customer-table th:last-child {
    text-align: right;
    padding-right: 20px;
}

.customer-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
    font-size: 13px;
    color: #333;
}

.customer-table td:last-child {
    text-align: right;
    padding-right: 20px;
}

.customer-table tr:hover {
    background-color: #f0f6ff;
    transition: all 0.2s;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid rgb(42, 126, 251);
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(42, 126, 251, 0.3);
}

.modal-content-large {
    width: 90%;
    max-width: 900px;
}

.modal-content-large .form-group {
    font-size: 14px;
}

.modal-content-large .form-group label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.modal-content-large .form-group input,
.modal-content-large .form-group select,
.modal-content-large .form-group textarea {
    font-size: 14px;
    color: #333;
    border: 1px solid #d9d9d9;
}

.modal-content-large .form-group input:focus,
.modal-content-large .form-group select:focus,
.modal-content-large .form-group textarea:focus {
    border-color: rgb(42, 126, 251);
    outline: none;
    box-shadow: 0 0 0 2px rgba(42, 126, 251, 0.1);
}

.modal-content-large textarea {
    min-height: 150px;
    resize: vertical;
    font-size: 10px;
}

.close {
    color: rgb(42, 126, 251);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close:hover {
    color: #ff4d4f;
}

/* 必填星号红色 */
.required {
    color: #ff4d4f !important;
    font-weight: bold;
}

/* 复制按钮样式 */
.btn-copy {
    padding: 2px 8px !important;
    font-size: 12px !important;
    background-color: rgb(42, 126, 251) !important;
    margin-left: 5px;
    vertical-align: middle;
}

.btn-copy:hover {
    background-color: rgb(62, 146, 251) !important;
}

/* 颜色选择器样式 */
.color-options {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.color-option:hover {
    transform: scale(1.05);
    border-color: rgb(42, 126, 251);
}

.color-option.active {
    border-color: rgb(42, 126, 251);
    box-shadow: 0 0 0 2px rgba(42, 126, 251, 0.3);
    transform: scale(1.05);
}

/* 分页器样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 2px solid rgb(42, 126, 251);
    margin-top: 10px;
    flex-shrink: 0;
}

.pagination-info {
    color: rgb(42, 126, 251);
    font-size: 14px;
    font-weight: 500;
}

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

.pagination-btn {
    padding: 6px 12px;
    background-color: #fff;
    border: 1px solid rgb(42, 126, 251);
    border-radius: 4px;
    color: rgb(42, 126, 251);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: rgb(42, 126, 251);
    color: #fff;
    box-shadow: 0 2px 8px rgba(42, 126, 251, 0.3);
}

.pagination-btn.active {
    background-color: rgb(42, 126, 251);
    border-color: rgb(42, 126, 251);
    color: #fff;
}

.pagination-btn:disabled {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
    color: #d9d9d9;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
}

.pagination-numbers .pagination-btn {
    min-width: 32px;
    text-align: center;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

/* 两列表单布局 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-column {
    flex: 1;
    min-width: 0;
}

.form-column:first-child {
    border-right: 1px solid #eee;
    padding-right: 20px;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input-group input[type="date"] {
    flex: 1;
}

.checkbox-label {
    font-weight: normal;
    white-space: nowrap;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 35px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.color-input-group span {
    color: #666;
    font-size: 13px;
}

.color-edit-wrapper {
    padding: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e8e8e8;
}

.form-actions button {
    padding: 6px 16px !important;
    font-size: 13px !important;
}

.form-actions button:first-child {
    background-color: #666;
}

.form-actions button:first-child:hover {
    background-color: #555;
}

/* Toast 轻提示样式 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    padding: 12px 24px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: linear-gradient(135deg, rgb(42, 126, 251) 0%, rgb(62, 146, 251) 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
}

.toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Section 内容样式 */
.section-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 子菜单样式 */
.nav-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}

.nav-arrow.open {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    background-color: #f9f9f9;
}

.submenu.open {
    display: block;
}

.subnav-item {
    padding-left: 50px !important;
    font-size: 14px;
}

/* 渠道列表样式 */
.sources-list {
    flex: 1;
    overflow-y: auto;
}

.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e8e8e8;
    transition: background-color 0.2s;
}

.source-item:hover {
    background-color: #f0f6ff;
}

.source-name {
    font-size: 14px;
    color: #333;
}

.source-actions {
    display: flex;
    gap: 8px;
}

.source-actions button {
    padding: 4px 10px;
    font-size: 12px;
}

.source-actions button:first-child {
    background-color: rgb(42, 126, 251);
}

.source-actions button:last-child {
    background-color: #ff4d4f;
}

/* 密码表单样式 */
.password-form {
    max-width: 400px;
    padding: 20px 0;
}

.password-form .form-group {
    margin-bottom: 20px;
}

.password-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.password-form .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.password-form .form-group input:focus {
    outline: none;
    border-color: rgb(42, 126, 251);
}

/* 置顶小角标样式 */
.pinned-badge {
    display: inline-block;
    color: #ff4d4f;
    font-size: 14px;
    font-weight: bold;
    margin-right: 4px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filter-sort {
        width: 100%;
        justify-content: space-between;
    }
    
    .customer-table {
        font-size: 12px;
    }
    
    .customer-table th,
    .customer-table td {
        padding: 5px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-column {
        border-right: none !important;
        padding-right: 0 !important;
    }
    
    .modal-content-large {
        width: 95%;
    }
}
