/* ===== 基础样式重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f7fa;
    line-height: 1.5;
}

/* ===== 应用容器 ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 220px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.logo-icon {
    font-size: 24px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

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

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
}

/* ===== 顶部栏 ===== */
.top-header {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a2e;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar {
    font-size: 24px;
}

.user-name {
    font-weight: 500;
    color: #333;
}

/* ===== 内容区域 ===== */
.content-wrapper {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page {
    animation: fadeIn 0.3s ease;
}

.page.hidden {
    display: none;
}

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

/* ===== 统计卡片 ===== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.inquiry-icon { background: #fff2f0; }
.customer-icon { background: #f0f5ff; }
.valid-icon { background: #f6ffed; }
.today-icon { background: #fffbe6; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

/* ===== 仪表板分区 ===== */
.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 20px;
}

.section-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.section-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.section-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-link {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}

.section-link:hover {
    text-decoration: underline;
}

/* ===== 表格样式 ===== */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

/* ID 列不展示（询盘 / 客户列表） */
.data-table th.col-id,
.data-table td.col-id {
    display: none;
}

/* 列表固定列宽：单元格单行展示，超出以省略号截断 */
.data-table.fixed-layout {
    table-layout: fixed;
}
.data-table.fixed-layout th,
.data-table.fixed-layout td {
    padding: 12px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.data-table.fixed-layout th {
    white-space: normal;   /* 表头允许换行 */
    text-overflow: clip;
}
.data-table.fixed-layout td.action-cell {
    overflow: visible;     /* 操作按钮不被裁剪 */
    text-overflow: clip;
}
.data-table.fixed-layout .action-cell .btn-log,
.data-table.fixed-layout .action-cell .btn-edit,
.data-table.fixed-layout .action-cell .btn-delete {
    padding: 4px 7px;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== 表单卡片 ===== */
.form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.form-header {
    padding: 24px 32px;
    color: #fff;
}

.inquiry-header {
    background: linear-gradient(135deg, #F04124 0%, #F04E23 100%);
}

.customer-header {
    background: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
}

.form-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-header p {
    font-size: 14px;
    opacity: 0.9;
}

.form-body {
    padding: 32px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

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

.form-group.col-2 .input-group {
    display: flex;
    gap: 12px;
}

.form-group.col-2 .input-group select {
    flex: 1;
}

.form-group.full-width {
    flex: 1 1 100%;
}

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

.required {
    color: #F04124;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #bfbfbf;
}

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

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 20px;
    padding: 10px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #F04124;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-cancel {
    background: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-cancel:hover {
    background: #f5f5f5;
    border-color: #c0c0c0;
}

.btn-submit-inquiry {
    background: linear-gradient(135deg, #F04124 0%, #F04E23 100%);
    color: #fff;
}

.btn-submit-inquiry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(240, 65, 36, 0.4);
}

.btn-submit-customer {
    background: linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%);
    color: #fff;
}

.btn-submit-customer:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-delete {
    background: #fff;
    color: #F04124;
    border: 1px solid #ffccc7;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-delete:hover {
    background: #fff2f0;
}

.btn-edit {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: #1890ff;
    color: #fff;
}

.action-cell {
    white-space: nowrap;
    min-width: 120px;
}

.btn-logout {
    background: #fff;
    color: #999;
    border: 1px solid #e8e8e8;
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-logout:hover {
    color: #F04124;
    border-color: #ffccc7;
    background: #fff2f0;
}

.btn-export {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: #fff;
    padding: 8px 18px;
    font-size: 13px;
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}

/* ===== 角色标签 ===== */
.header-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.header-badge.role-admin {
    background: #fff2f0;
    color: #F04124;
    border: 1px solid #ffccc7;
}

.header-badge.role-ops {
    background: #f0f5ff;
    color: #2f54eb;
    border: 1px solid #d6e4ff;
}

.header-badge.role-sales {
    background: #f9f0ff;
    color: #722ed1;
    border: 1px solid #efdbff;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
}

/* ===== 状态标签 ===== */
.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-valid {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-invalid {
    background: #fff2f0;
    color: #f5222d;
    border: 1px solid #ffccc7;
}

.status-pending {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

/* ===== Toast 通知 ===== */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
}

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

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #888;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state-text {
    font-size: 14px;
}

/* ===== 筛选栏 ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-item select,
.filter-item input[type="date"],
.filter-item input[type="text"] {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    background: #fff;
    min-width: 100px;
}

.filter-item input[type="text"] {
    min-width: 240px;
}

.filter-item select:focus,
.filter-item input[type="date"]:focus,
.filter-item input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.1);
}

.filter-actions {
    flex-direction: row;
    gap: 8px;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
    height: 36px;
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-danger {
    background: #fff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.btn-danger:hover {
    background: #e74c3c;
    color: #fff;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .stats-cards {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-group.col-2 .input-group {
        flex-direction: column;
    }
    .form-body {
        padding: 20px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* ===== 遮罩层（移动端） ===== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

.overlay.show {
    display: block;
}

/* ===== 登录页面 ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 480px;
    max-width: 90vw;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 32px;
    text-align: center;
}

.login-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.login-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.85;
}

.login-body {
    padding: 24px;
}

.login-section {
    margin-bottom: 24px;
}

.login-section:last-child {
    margin-bottom: 0;
}

.login-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.account-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.account-card {
    padding: 14px 16px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-card:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.account-card .account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.account-card .account-avatar.avatar-admin {
    background: #fff2f0;
}

.account-card .account-avatar.avatar-ops {
    background: #f0f5ff;
}

.account-card .account-avatar.avatar-sales {
    background: #f9f0ff;
}

.account-card .account-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.account-card .account-role-tag {
    font-size: 11px;
    color: #888;
    display: block;
    margin-top: 2px;
}

/* ===== 导航项角色隐藏 ===== */
.nav-item.nav-hidden {
    display: none !important;
}

/* ===== 元素角色隐藏 ===== */
[data-role].role-hidden {
    display: none !important;
}

/* ===== 注册表单 ===== */
.register-header-color {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%) !important;
}

.register-form .form-group {
    margin-bottom: 16px;
}

.register-form .radio-group {
    padding: 4px 0;
}

.login-actions {
    text-align: center;
    padding-top: 8px;
}

/* 登录表单中的提交按钮 - 与注册按钮等宽 */
#loginForm .form-actions {
    justify-content: stretch;
}

#loginForm .btn-submit-customer {
    width: 100%;
}

.btn-register {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: #fff;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}

/* ===== 已注册用户列表 ===== */
.registered-users {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.registered-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.registered-user-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.registered-user-item .user-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.registered-user-item .user-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.registered-user-item .user-item-avatar.avatar-ops {
    background: #f0f5ff;
}

.registered-user-item .user-item-avatar.avatar-sales {
    background: #f9f0ff;
}

.registered-user-item .user-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.registered-user-item .user-item-role {
    font-size: 12px;
    color: #888;
    display: block;
    margin-top: 2px;
}

.registered-user-item .user-item-arrow {
    color: #ccc;
    font-size: 18px;
}

/* ===== 密码弹窗 ===== */
#passwordModal {
    animation: fadeIn 0.2s ease;
}

.error-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

/* ===== 空提示 ===== */
.empty-hint {
    text-align: center;
    padding: 20px;
    color: #bbb;
    font-size: 13px;
}

/* ===== 用户管理 ===== */
.role-select {
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    min-width: 130px;
}
.role-select:focus {
    border-color: #2f54eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(47, 84, 235, 0.15);
}
.role-display {
    font-size: 13px;
    color: #F04124;
    font-weight: 500;
}
.section-hint {
    font-size: 13px;
    color: #999;
}

.section-toolbar {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    flex-wrap: wrap;
}

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

.toolbar-hint {
    font-size: 12px;
    color: #bbb;
}

.source-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.source-name-input {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    width: 180px;
}

.source-name-input:focus {
    outline: none;
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.1);
}

/* 客户来源表格紧凑样式 */
#sourceManagementTable td {
    padding: 10px 16px;
    vertical-align: middle;
}

#sourceManagementTable td:first-child {
    color: #999;
    font-size: 13px;
    text-align: center;
}

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

.source-actions .btn-sm {
    height: 32px;
    padding: 4px 12px;
    font-size: 12px;
}

/* ===== 修改密码按钮 ===== */
.btn-change-pwd {
    padding: 6px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-change-pwd:hover {
    border-color: #2f54eb;
    color: #2f54eb;
    background: #f0f5ff;
}

/* ===== 模态框弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal-card {
    background: #fff;
    border-radius: 12px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 {
    margin: 0;
    font-size: 17px;
}
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}
.modal-body {
    padding: 24px;
}
.modal-body .form-group {
    margin-bottom: 16px;
}
.modal-body .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
}
.modal-body .form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.modal-body .form-group input:focus {
    border-color: #2f54eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(47, 84, 235, 0.15);
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}
.modal-actions .btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.modal-actions .btn-cancel {
    background: #fff;
    border: 1px solid #d9d9d9;
    color: #666;
}
.modal-actions .btn-cancel:hover {
    border-color: #2f54eb;
    color: #2f54eb;
}
.modal-actions .btn-primary {
    background: #2f54eb;
    border: none;
    color: #fff;
}
.modal-actions .btn-primary:hover {
    background: #1d39c4;
}

/* ===== 客户附件 ===== */
.attach-zone {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    border: 1px dashed #c3b8f0;
    border-radius: 10px;
    background: #faf8ff;
    cursor: pointer;
    transition: all 0.2s ease;
}
.attach-zone:hover {
    border-color: #7C3AED;
    background: #f4f0ff;
}
.attach-zone .attach-choose-btn {
    background: #fff;
    border: 1px solid #7C3AED;
    color: #7C3AED;
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 500;
}
.attach-zone .attach-choose-btn:hover {
    background: #7C3AED;
    color: #fff;
}
.attach-tip {
    font-size: 12px;
    color: #999;
}
.attach-empty {
    padding: 8px 2px;
    font-size: 13px;
    color: #aaa;
}
.attach-group-title {
    margin: 12px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
}
.attach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.attach-item:hover {
    background: #f3f0ff;
    border-color: #e2d9ff;
}
.attach-pending {
    background: #fffbe6;
    border-color: #ffe58f;
}
.attach-pending:hover {
    background: #fff7d6;
}
.attach-icon {
    font-size: 18px;
    line-height: 1;
}
.attach-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #1890ff;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attach-name:hover {
    text-decoration: underline;
}
.attach-meta {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
}
.attach-del {
    flex-shrink: 0;
    background: #fff;
    color: #F04124;
    border: 1px solid #ffccc7;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}
.attach-del:hover {
    background: #fff2f0;
    border-color: #F04124;
}
.attach-count {
    display: inline-block;
    background: #f4f0ff;
    color: #7C3AED;
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 13px;
    white-space: nowrap;
}

/* ===== 客户批量操作栏（销售主管 / 管理员） ===== */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #f7f9ff;
    border-bottom: 1px solid var(--border-color);
}

.batch-selected {
    font-size: 13px;
    color: var(--text-secondary);
}

.batch-selected b {
    color: var(--primary);
    font-size: 15px;
    margin: 0 2px;
}

/* 勾选列 */
.data-table .col-check {
    width: 40px;
    text-align: center;
    padding-left: 12px;
    padding-right: 0;
}

.data-table .col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
}

/* 判定字段标签 */
.judge-tag {
    display: inline-block;
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 13px;
    white-space: nowrap;
    font-weight: 500;
}

.judge-tag.judge-yes {
    background: #e8f7ee;
    color: #1a9c53;
}

.judge-tag.judge-no {
    background: #fdf0e6;
    color: #d4761a;
}

/* 日志按钮（只读查看） */
.btn-log {
    background: #f4f0ff;
    color: #7C3AED;
    border: 1px solid #d9cdfd;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-log:hover {
    background: #7C3AED;
    color: #fff;
}

/* 最后修改摘要列 */
.data-table .last-change-cell {
    max-width: 250px;
}

.last-change {
    display: inline-block;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    color: #5b6472;
    font-size: 13px;
    cursor: help;
}

.last-change-empty {
    color: #b8bec9;
}

/* ===== 客户修改日志弹窗（只读，不可编辑） ===== */
.log-modal-body {
    padding: 14px 24px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.log-tip {
    font-size: 12px;
    color: var(--text-secondary);
    background: #f7f9ff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.log-table th,
.log-table td {
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    word-break: break-all;
}

.log-table th {
    background: #fafbff;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.log-table .log-old {
    color: #8a919e;
}

.log-table .log-new {
    color: #1a9c53;
}

.log-field {
    display: inline-block;
    background: #f4f0ff;
    color: #7C3AED;
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 12px;
    white-space: nowrap;
}

.log-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 28px 0;
    font-size: 13px;
}

/* 文件选择框视觉隐藏（保留可点击性，避免 display:none 的兼容问题） */
.attach-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
