/* ============================================
   全局基础布局 (Header / Sidebar / Main)
   Base Layout CSS - 统一管理顶部导航和侧边栏样式
   不包含业务页面样式，页面样式在 modules/ 目录下各自管理
   ============================================ */

/* ============================================
   配色方案
   - 背景色：#f0f3f7（微蓝灰）
   - 侧边栏：#2C5F7C（深海蓝）
   - 文字色：#1e293b（深灰蓝）
   ============================================ */

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    background: var(--ftip-bg-page, #f0f3f7); 
    color: var(--ftip-text-primary, #1e293b);
    line-height: 1.6;
    min-height: 100vh; 
}

/* ========== 顶部导航 ========== */
.header {
    background: var(--ftip-bg-header, #0B4FBF);
    color: white;
    padding: 0 25px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-default);
}
.header h1 { color: var(--color-primary); }
.header-left { display: flex; align-items: center; gap: 15px; }
.header-logo { height: 40px; width: auto; border-radius: 8px; }
.header h1 { font-size: 20px; font-weight: 600; line-height: 1.3; color: white; }
.header h1 .en { font-size: 16px; opacity: 1; display: block; font-weight: 500; letter-spacing: 1px; color: #FFFFFF; }
.header-center { flex: 1; display: flex; justify-content: center; align-items: center; }
.header-slogan { font-size: 20px; font-weight: 600; color: #FFFFFF; letter-spacing: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.header-right { display: flex; align-items: center; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-lang { font-size: 13px; font-weight: 600; color: white; padding: 6px 12px; background: rgba(255,255,255,0.15); border-radius: 4px; border: 1px solid rgba(255,255,255,0.3); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.header-lang:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }
.header-avatar { font-size: 22px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.15); border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); }
.header-role { font-size: 14px; font-weight: 600; color: white; padding: 6px 12px; background: rgba(255,255,255,0.15); border-radius: 4px; border: 1px solid rgba(255,255,255,0.3); }
.header-username { font-size: 14px; font-weight: 500; color: white; margin-right: 4px; }
.header-user-badge { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.25); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.header-user-badge:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }
.header-user-badge .header-avatar { margin-right: 2px; }
.header-action { font-size: 13px; color: rgba(255,255,255,0.9); padding: 6px 12px; cursor: pointer; border-radius: 4px; border: 1px solid rgba(255,255,255,0.2); transition: all 0.2s; white-space: nowrap; }
.header-action:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); color: white; }
.user-info { display: flex; align-items: center; gap: 10px; cursor: pointer; color: white; padding: 8px 14px; border: 1px solid rgba(255,255,255,0.3); border-radius: 20px; transition: all 0.3s; }
.user-info:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 18px; border: 2px solid rgba(255,255,255,0.4); color: white; }

/* ========== 侧边栏 ========== */
.sidebar {
    width: 240px;
    background: var(--ftip-bg-sidebar, #2C5F7C);
    height: calc(100vh - 60px);
    position: fixed;
    left: 0;
    top: 60px;
    overflow-y: auto;
    z-index: 2001;
    border-right: 2px solid color-mix(in srgb, var(--ftip-bg-sidebar, #2C5F7C) 82%, #000);
    padding: 0;
    font-family: '思源黑体', 'Source Han Sans', '微软雅黑', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
}
.sidebar-menu { display: flex; flex-direction: column; padding: 0; }
.sidebar-search { flex-shrink: 0; }

/* 侧边栏搜索框 */
.sidebar-search {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-search-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}
.sidebar-search-input::placeholder {
    color: rgba(255,255,255,0.4);
}
.sidebar-search-input:focus {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
}

/* 折叠指示器 */
.group-toggle {
    margin-left: auto;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    transition: transform 0.2s;
}

/* 菜单分组 */
.menu-group {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ========== 总栏目样式 ========== */
.menu-group-title {
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.group-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.group-title-content {
    display: flex;
    flex-direction: column;
    gap: 0px;
    line-height: 1.2;
}
.group-title-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: #ffffff;
}
.group-title-en {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.2px;
    color: rgba(255,255,255,0.45);
    line-height: 1.2;
}

/* ========== 各分组配色（统一深色风格） ========== */
.group-overview .menu-group-title,
.group-acquisition .menu-group-title,
.group-leads .menu-group-title,
.group-followup .menu-group-title,
.group-marketing .menu-group-title,
.group-commerce .menu-group-title,
.group-ai .menu-group-title,
.group-auto-collect .menu-group-title,
.group-knowledge .menu-group-title,
.group-admin .menu-group-title {
    background: rgba(255,255,255,0.05);
    color: var(--ftip-text-on-dark, #ffffff);
    border-left: 3px solid transparent;
}
.group-overview .menu-group-title:hover,
.group-acquisition .menu-group-title:hover,
.group-leads .menu-group-title:hover,
.group-followup .menu-group-title:hover,
.group-marketing .menu-group-title:hover,
.group-commerce .menu-group-title:hover,
.group-ai .menu-group-title:hover,
.group-auto-collect .menu-group-title:hover,
.group-knowledge .menu-group-title:hover,
.group-admin .menu-group-title:hover {
    background: rgba(255,255,255,0.1);
}

/* 各分组左侧标识色条 */
.group-overview .menu-group-title { border-left-color: #60a5fa; }
.group-acquisition .menu-group-title { border-left-color: #4ade80; }
.group-leads .menu-group-title { border-left-color: #f472b6; }
.group-followup .menu-group-title { border-left-color: #fb923c; }
.group-marketing .menu-group-title { border-left-color: #ec4899; }
.group-commerce .menu-group-title { border-left-color: #f59e0b; }

/* 模板中心内部功能分区标题 */
.menu-subsection-title {
    padding: 8px 16px 4px 42px;
    color: #93a4b8;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0;
    pointer-events: none;
}
.group-ai .menu-group-title { border-left-color: #2dd4bf; }
.group-auto-collect .menu-group-title { border-left-color: #38bdf8; }
.group-knowledge .menu-group-title { border-left-color: #818cf8; }
.group-admin .menu-group-title { border-left-color: #9ca3af; }

/* 英文副标题统一浅色 */
.group-overview .group-title-en,
.group-acquisition .group-title-en,
.group-leads .group-title-en,
.group-followup .group-title-en,
.group-marketing .group-title-en,
.group-commerce .group-title-en,
.group-ai .group-title-en,
.group-auto-collect .group-title-en,
.group-knowledge .group-title-en,
.group-admin .group-title-en {
    color: rgba(255,255,255,0.6);
}

/* ========== 子栏目样式 ========== */
.menu-group-items {
    padding: 0;
}

.menu-item.sub-item {
    padding: 6px 14px 6px 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    min-height: 32px;
}
.sub-zh {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    color: rgba(255,255,255,0.75);
}

/* ========== 各分组子栏目配色（统一风格） ========== */
.group-overview .menu-item.sub-item,
.group-acquisition .menu-item.sub-item,
.group-leads .menu-item.sub-item,
.group-followup .menu-item.sub-item,
.group-marketing .menu-item.sub-item,
.group-commerce .menu-item.sub-item,
.group-ai .menu-item.sub-item,
.group-auto-collect .menu-item.sub-item,
.group-knowledge .menu-item.sub-item,
.group-admin .menu-item.sub-item {
    background: transparent;
    color: rgba(255,255,255,0.85);
    border-left: 3px solid transparent;
}

/* hover 状态统一 */
.group-overview .menu-item.sub-item:hover,
.group-acquisition .menu-item.sub-item:hover,
.group-leads .menu-item.sub-item:hover,
.group-followup .menu-item.sub-item:hover,
.group-marketing .menu-item.sub-item:hover,
.group-commerce .menu-item.sub-item:hover,
.group-ai .menu-item.sub-item:hover,
.group-auto-collect .menu-item.sub-item:hover,
.group-knowledge .menu-item.sub-item:hover,
.group-admin .menu-item.sub-item:hover {
    background: rgba(255,255,255,0.08);
}
.group-overview .menu-item.sub-item:hover .sub-zh,
.group-acquisition .menu-item.sub-item:hover .sub-zh,
.group-leads .menu-item.sub-item:hover .sub-zh,
.group-followup .menu-item.sub-item:hover .sub-zh,
.group-marketing .menu-item.sub-item:hover .sub-zh,
.group-commerce .menu-item.sub-item:hover .sub-zh,
.group-ai .menu-item.sub-item:hover .sub-zh,
.group-auto-collect .menu-item.sub-item:hover .sub-zh,
.group-knowledge .menu-item.sub-item:hover .sub-zh,
.group-admin .menu-item.sub-item:hover .sub-zh {
    color: #ffffff;
}

/* active 状态 */
.group-overview .menu-item.sub-item.active,
.group-acquisition .menu-item.sub-item.active,
.group-leads .menu-item.sub-item.active,
.group-followup .menu-item.sub-item.active,
.group-marketing .menu-item.sub-item.active,
.group-commerce .menu-item.sub-item.active,
.group-ai .menu-item.sub-item.active,
.group-auto-collect .menu-item.sub-item.active,
.group-knowledge .menu-item.sub-item.active,
.group-admin .menu-item.sub-item.active {
    background: rgba(37, 99, 235, 0.15);
    border-left-color: var(--ftip-accent, #c9a227);
}
.group-overview .menu-item.sub-item.active .sub-zh,
.group-acquisition .menu-item.sub-item.active .sub-zh,
.group-leads .menu-item.sub-item.active .sub-zh,
.group-followup .menu-item.sub-item.active .sub-zh,
.group-marketing .menu-item.sub-item.active .sub-zh,
.group-commerce .menu-item.sub-item.active .sub-zh,
.group-ai .menu-item.sub-item.active .sub-zh,
.group-auto-collect .menu-item.sub-item.active .sub-zh,
.group-knowledge .menu-item.sub-item.active .sub-zh,
.group-admin .menu-item.sub-item.active .sub-zh {
    color: #ffffff;
    font-weight: 500;
}

/* ========== 待上线样式 ========== */
.menu-item.sub-item.disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
.menu-item.sub-item.disabled .sub-zh,
.menu-item.sub-item.disabled .sub-en {
    color: rgba(255,255,255,0.5);
}

/* ========== 阶段4：海茂本部专属标识 ========== */
/* 依据：docs/3-权限分离标准.md — 显式视觉标记 HQ-only 功能防误触 */
.menu-tag-hq {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
}

/* ========== 兼容样式 ========== */
.menu-item .coming-soon-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 6px;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: 400;
}
.menu-item .icon { font-size: 16px; flex-shrink: 0; text-align: center; }
.menu-item .badge { background: #f56c6c; color: white; padding: 2px 6px; border-radius: 10px; font-size: 10px; margin-left: auto; position: absolute; right: 10px; }

/* ========== L2修复: 主内容区统一内边距（避免模块容器双层留白） ========== */
.main { 
    margin-left: 240px; 
    padding: 16px 20px; 
    height: calc(100vh - 60px); 
    margin-top: 60px; 
    background: #F8FAFF;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ========== 移动端菜单切换按钮 ========== */
.mobile-menu-btn { display: none; }
.mobile-overlay { display: none; position: fixed; top: 60px; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 1000; }
.mobile-overlay.active { display: block; }

/* ========== 页面容器 - 充满屏幕布局 ========== */
.page-container { 
    width: 100%; 
    height: 100%;
    padding: 0; 
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* ========== Page Container 通用布局 ========== */
.page-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ========== 两列网格 ========== */
@media (max-width: 1024px) {
    .two-column-grid { grid-template-columns: 1fr; }
}

/* ============================================
   响应式适配 - Header / Sidebar / Main
   ============================================ */

/* 平板 (768px - 1024px) */
@media (max-width: 1024px) {
    /* ===== 侧边栏 ===== */
    .sidebar { width: 60px; }
    .sidebar-menu { padding: 0; }
    .menu-group { border-bottom: none; }
    .menu-group-title { 
        padding: 12px 8px; 
        flex-direction: column;
        gap: 4px;
        justify-content: center;
    }
    .group-icon { font-size: 24px; }
    .group-title-content { display: none; }
    .menu-group-items { 
        display: none; 
        position: absolute;
        left: 60px;
        width: 180px;
        z-index: 1002;
        box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    }
    .menu-group:hover .menu-group-items,
    .menu-group:focus-within .menu-group-items {
        display: block;
    }
    .main { margin-left: 60px; }
}

/* 手机 (<768px) */
@media (max-width: 768px) {
    /* ===== 侧边栏 ===== */
    .sidebar { 
        width: 0; 
        overflow: hidden; 
        transition: width 0.3s;
        background: var(--ftip-bg-sidebar, #2C5F7C);
    }
    .sidebar.mobile-open { 
        width: 200px; 
        overflow-y: auto; 
        z-index: 2001;
    }
    .sidebar.mobile-open .menu-group { border-bottom: 1px solid rgba(255,255,255,0.1); }
    .sidebar.mobile-open .menu-group-title { 
        padding: 10px 12px;
        flex-direction: row;
        gap: 10px;
    }
    .sidebar.mobile-open .group-icon { font-size: 18px; }
    .sidebar.mobile-open .group-title-content { display: flex; }
    .sidebar.mobile-open .group-title-text { font-size: 13px; }
    .sidebar.mobile-open .group-title-en { font-size: 10px; }
    .sidebar.mobile-open .menu-group-items { display: block; }
    .sidebar.mobile-open .menu-item.sub-item {
        padding: 8px 12px;
        flex-direction: column;
        min-height: 40px;
    }
    .sidebar.mobile-open .sub-zh { font-size: 12px; }
    .sidebar.mobile-open .sub-en { font-size: 9px; }

    /* ===== 主内容区 ===== */
    .main { margin-left: 0; padding: 12px; min-height: calc(100vh - 60px); }

    /* ===== 顶部导航 ===== */
    .header { padding: 0 10px; height: 56px; }
    .header-left { gap: 8px; }
    .header-logo { height: 36px; width: auto; object-fit: contain; }
    .header h1 { font-size: 13px !important; line-height: 1.2 !important; }
    .header h1 .en { font-size: 10px !important; display: block !important; }
    .header-center { display: none; }
    .header-right { margin-left: auto; }
    .header-actions { gap: 6px; }
    .header-avatar { font-size: 18px; width: 30px; height: 30px; }
    .header-role { font-size: 12px; padding: 4px 8px; }
    .header-action { font-size: 11px; padding: 4px 8px; }

    /* ===== 移动端菜单按钮 ===== */
    .mobile-menu-btn { display: flex !important; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,0.2); cursor: pointer; font-size: 20px; border: none; }
}

/* 极小屏幕 (<480px) */
@media (max-width: 480px) {
    /* ===== 顶部导航 ===== */
    .header { padding: 0 8px; height: 52px; }
    .header-logo { height: 30px !important; }
    .header h1 { font-size: 11px !important; }
    .header h1 .en { font-size: 9px !important; }
    .header-center { display: none; }
    .header-right { margin-left: auto; }
    .header-actions { gap: 4px; }
    .header-avatar { font-size: 16px; width: 26px; height: 26px; }
    .header-role { font-size: 10px; padding: 3px 6px; }
    .header-action { font-size: 10px; padding: 3px 6px; }
    
    /* ===== 侧边栏 ===== */
    .sidebar.mobile-open { width: 180px; }
}

/* ========== 打印样式 ========== */
@media print {
    .sidebar,
    .header,
    .mobile-menu-toggle {
        display: none !important;
    }
    .main { margin-left: 0 !important; margin-top: 0 !important; }
}

/* ========== P0 统一客户选择器 CustomerPicker 样式 ========== */
/* 依据：docs/客户与线索库-行业国家筛选与选人UI升级方案.md §3 */

/* ---- 容器 ---- */
.ftip-customer-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.ftip-picker-filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.ftip-picker-view-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}
.ftip-picker-view-tabs {
    display: flex;
    gap: 4px;
}
.ftip-picker-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    transition: all .15s;
}
.ftip-picker-view-tab:hover { background: #f3f4f6; }
.ftip-picker-view-tab.active {
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}
.ftip-picker-view-icon { font-size: 14px; }
.ftip-picker-view-label { font-size: 12px; }
.ftip-picker-panel-toggle {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 12px;
}
.ftip-picker-panel-toggle.collapsed { background: #f9fafb; }
.ftip-picker-view-area { flex: 1; min-height: 200px; }
.ftip-picker-placeholder {
    padding: 40px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    background: #f9fafb;
    border-radius: 6px;
}

/* ---- IndustryFilter 行业级联选择器 ---- */
.ftip-industry-filter { position: relative; flex: 1; min-width: 240px; }
.ftip-industry-trigger {
    min-height: 34px;
    padding: 6px 32px 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    position: relative;
}
.ftip-industry-trigger:hover { border-color: #9ca3af; }
.ftip-industry-placeholder { color: #9ca3af; font-size: 13px; }
.ftip-industry-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 4px;
    font-size: 12px;
    gap: 4px;
}
.ftip-industry-tag-more { background: #f3f4f6; color: #6b7280; }
.ftip-industry-tag-close { cursor: pointer; opacity: .6; font-weight: 700; }
.ftip-industry-tag-close:hover { opacity: 1; }
.ftip-industry-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: transform .2s;
    pointer-events: none;
}
.ftip-industry-arrow.open { transform: translateY(-50%) rotate(180deg); }
.ftip-industry-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ftip-industry-popover-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
}
.ftip-industry-search {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}
.ftip-industry-search:focus { outline: none; border-color: #6366f1; }
.ftip-industry-count-summary { color: #6b7280; font-size: 12px; }
.ftip-industry-clear-btn {
    padding: 4px 10px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.ftip-industry-tree { overflow-y: auto; max-height: 340px; padding: 6px 0; }
.ftip-industry-node-wrap { border-bottom: 1px solid #f9fafb; }
.ftip-industry-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background .1s;
}
.ftip-industry-node:hover { background: #f9fafb; }
.ftip-industry-node-l1 { font-weight: 600; }
.ftip-industry-node-l2 { padding-left: 32px; font-size: 13px; }
.ftip-industry-node-l3 { padding-left: 56px; font-size: 12px; color: #6b7280; }
.ftip-industry-expand {
    width: 16px;
    cursor: pointer;
    text-align: center;
    color: #9ca3af;
    user-select: none;
}
.ftip-industry-checkbox {
    display: inline-flex;
    width: 16px;
    height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
    position: relative;
    cursor: pointer;
}
.ftip-industry-checkbox input { display: none; }
.ftip-industry-checkbox.checked {
    background: #4f46e5;
    border-color: #4f46e5;
}
.ftip-industry-checkbox.checked::after {
    content: '✓';
    color: #fff;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
}
.ftip-industry-checkbox.indeterminate {
    background: #4f46e5;
    border-color: #4f46e5;
}
.ftip-industry-checkbox.indeterminate::after {
    content: '–';
    color: #fff;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.ftip-industry-node-label { flex: 1; display: flex; gap: 6px; align-items: center; }
.ftip-industry-code { color: #6b7280; font-family: ui-monospace, monospace; font-size: 12px; }
.ftip-industry-name { color: #1f2937; }
.ftip-industry-lock { font-size: 12px; }
.ftip-industry-count {
    color: #6b7280;
    font-size: 11px;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 28px;
    text-align: center;
}
.ftip-industry-children { background: #fafbfc; }
.ftip-industry-children-l3 { background: #f9fafb; }
.ftip-industry-empty, .ftip-industry-loading {
    padding: 30px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* ---- CountryFilter 国家筛选器 ---- */
.ftip-country-filter { position: relative; flex: 1; min-width: 240px; }
.ftip-country-trigger {
    min-height: 34px;
    padding: 6px 32px 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    position: relative;
}
.ftip-country-trigger:hover { border-color: #9ca3af; }
.ftip-country-placeholder { color: #9ca3af; font-size: 13px; }
.ftip-country-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 4px;
    font-size: 12px;
    gap: 4px;
}
.ftip-country-tag-excluded { background: #fee2e2; color: #dc2626; }
.ftip-country-tag-more { background: #f3f4f6; color: #6b7280; }
.ftip-country-tag-close { cursor: pointer; opacity: .6; font-weight: 700; }
.ftip-country-tag-close:hover { opacity: 1; }
.ftip-country-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    transition: transform .2s;
    pointer-events: none;
}
.ftip-country-arrow.open { transform: translateY(-50%) rotate(180deg); }
.ftip-country-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.1);
    max-height: 420px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ftip-country-popover-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #f3f4f6;
}
.ftip-country-search {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}
.ftip-country-search:focus { outline: none; border-color: #6366f1; }
.ftip-country-count-summary { color: #6b7280; font-size: 12px; }
.ftip-country-clear-btn {
    padding: 4px 10px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.ftip-country-groups { overflow-y: auto; max-height: 340px; padding: 6px 0; }
.ftip-country-group { border-bottom: 1px solid #f9fafb; }
.ftip-country-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    cursor: pointer;
    background: #fafbfc;
    transition: background .1s;
}
.ftip-country-group-header:hover { background: #f3f4f6; }
.ftip-country-expand { width: 16px; color: #9ca3af; text-align: center; }
.ftip-country-checkbox {
    display: inline-flex;
    width: 16px;
    height: 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
    position: relative;
    cursor: pointer;
}
.ftip-country-checkbox input { display: none; }
.ftip-country-checkbox.checked {
    background: #059669;
    border-color: #059669;
}
.ftip-country-checkbox.checked::after {
    content: '✓';
    color: #fff;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
}
.ftip-country-checkbox.indeterminate {
    background: #059669;
    border-color: #059669;
}
.ftip-country-checkbox.indeterminate::after {
    content: '–';
    color: #fff;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.ftip-country-group-name { flex: 1; font-weight: 600; font-size: 13px; color: #1f2937; }
.ftip-country-group-count { color: #6b7280; font-size: 11px; }
.ftip-country-group-items { padding: 4px 0 4px 32px; }
.ftip-country-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background .1s;
}
.ftip-country-item:hover { background: #f9fafb; }
.ftip-country-item-name { flex: 1; font-size: 13px; }
.ftip-country-item-count {
    color: #6b7280;
    font-size: 11px;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 28px;
    text-align: center;
}
.ftip-country-exclude-btn {
    cursor: pointer;
    opacity: .4;
    font-size: 12px;
    padding: 2px 4px;
}
.ftip-country-exclude-btn:hover { opacity: .8; }
.ftip-country-exclude-btn.active { opacity: 1; }
.ftip-country-empty { padding: 30px; text-align: center; color: #9ca3af; font-size: 13px; }

/* ---- StatsBar 统计条 ---- */
.ftip-customer-stats {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    flex-wrap: wrap;
}
.ftip-stats-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 0 12px;
}
.ftip-stats-divider { width: 1px; height: 24px; background: #e5e7eb; }
.ftip-stats-label { color: #6b7280; font-size: 12px; }
.ftip-stats-value { font-size: 16px; font-weight: 700; color: #1f2937; }
.ftip-stats-rate {
    font-size: 11px;
    color: #6b7280;
    padding: 1px 6px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.ftip-stats-rate.rate-good { color: #059669; border-color: #a7f3d0; background: #ecfdf5; }
.ftip-stats-rate.rate-warn { color: #d97706; border-color: #fde68a; background: #fffbeb; }
.ftip-stats-total .ftip-stats-value { color: #4f46e5; }
.ftip-stats-selected .ftip-stats-value { color: #059669; }
.ftip-stats-highlight .ftip-stats-value { color: #dc2626; }
.ftip-stats-over-limit { color: #dc2626 !important; }
.ftip-stats-warning {
    margin-left: 12px;
    padding: 4px 10px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #fde68a;
}
.ftip-stats-actions { margin-left: auto; display: flex; gap: 6px; }
.ftip-stats-btn {
    padding: 6px 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all .15s;
}
.ftip-stats-btn:hover { background: #f3f4f6; }
.ftip-stats-btn:disabled { opacity: .5; cursor: not-allowed; }
.ftip-stats-btn-select { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.ftip-stats-btn-select:hover { background: #4338ca; }
.ftip-stats-btn-select:disabled { background: #e5e7eb; color: #9ca3af; border-color: #e5e7eb; }
.ftip-stats-btn-clear { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.ftip-stats-btn-clear:hover { background: #fecaca; }

/* ---- SelectionPanel 已选快照面板 ---- */
.ftip-selection-panel {
    position: fixed;
    right: 20px;
    top: 120px;
    bottom: 20px;
    width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: -10px 0 25px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    z-index: 90;
}
.ftip-panel-slide-enter-active, .ftip-panel-slide-leave-active { transition: transform .25s, opacity .25s; }
.ftip-panel-slide-enter-from, .ftip-panel-slide-leave-to { transform: translateX(100%); opacity: 0; }
.ftip-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.ftip-selection-title { font-weight: 600; font-size: 14px; color: #1f2937; }
.ftip-selection-close {
    border: none;
    background: transparent;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}
.ftip-selection-close:hover { color: #1f2937; }
.ftip-selection-summary {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
    color: #6b7280;
}
.ftip-summary-item { padding: 2px 8px; background: #fff; border-radius: 4px; border: 1px solid #e5e7eb; }
.ftip-selection-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.ftip-selection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    font-size: 12px;
    transition: background .1s;
}
.ftip-selection-item:hover { background: #f9fafb; }
.ftip-selection-id {
    font-family: ui-monospace, monospace;
    color: #374151;
}
.ftip-selection-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}
.ftip-selection-remove:hover { color: #dc2626; }
.ftip-selection-more {
    padding: 8px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
}
.ftip-selection-actions {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}
.ftip-selection-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all .15s;
}
.ftip-selection-btn:hover { background: #f3f4f6; }
.ftip-selection-btn-clear { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.ftip-selection-btn-next { background: #059669; color: #fff; border-color: #059669; }
.ftip-selection-btn-next:hover { background: #047857; }

/* ============================================
   P2-2 GroupCardView 分组卡片视图样式
   ============================================ */
.ftip-group-card-view { padding: 12px 0; }
.ftip-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.ftip-customer-picker.ftip-picker-compact {
    display: inline-flex;
    flex: 1 1 520px;
    min-width: 360px;
    padding: 0;
    border: 0;
    background: transparent;
}
.ftip-customer-picker.ftip-picker-compact .ftip-picker-filter-bar {
    flex-wrap: nowrap;
    width: 100%;
}
.ftip-group-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, border-color .15s;
}
.ftip-group-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(79,70,229,.08);
    transform: translateY(-1px);
}
.ftip-group-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #fafafa, #f4f5f7);
    border-bottom: 1px solid #f3f4f6;
}
.ftip-group-card-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ftip-group-card-code {
    display: inline-flex;
    padding: 2px 7px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 4px;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.ftip-group-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.ftip-group-card-count {
    font-size: 13px;
    font-weight: 600;
    color: #059669;
    flex-shrink: 0;
}
.ftip-group-card-toggle {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all .1s;
    flex-shrink: 0;
}
.ftip-group-card-toggle:hover { border-color: #4f46e5; color: #4f46e5; }
.ftip-group-card-toggle.expanded { background: #4f46e5; color: #fff; border-color: #4f46e5; }

.ftip-group-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease;
    padding: 0 4px;
}
.ftip-group-card-body.expanded { max-height: 600px; padding: 4px 0 8px; overflow-y: auto; }

.ftip-group-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 38px;
    cursor: pointer;
    transition: background .1s;
    font-size: 13px;
}
.ftip-group-sub-item:hover { background: #f8fafc; }
.ftip-group-sub-code {
    display: inline-flex;
    padding: 1px 6px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    flex-shrink: 0;
}
.ftip-group-sub-name { flex: 1; color: #374151; min-width: 0; }
.ftip-group-sub-count { font-size: 12px; color: #059669; font-weight: 500; flex-shrink: 0; }

/* ============================================
   P2-3 MatrixView 矩阵视图样式
   ============================================ */
.ftip-matrix-view { padding: 12px 0; }
.ftip-matrix-wrap {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}
.ftip-matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    min-width: 100%;
}
.ftip-matrix-table th, .ftip-matrix-table td {
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    padding: 6px 10px;
    text-align: center;
    white-space: nowrap;
}
.ftip-matrix-table tr:last-child td { border-bottom: none; }
.ftip-matrix-table th:last-child,
.ftip-matrix-table td:last-child { border-right: none; }

.ftip-matrix-corner, .ftip-matrix-row-total-header {
    position: sticky;
    top: 0;
    background: #f4f5f7;
    font-weight: 600;
    color: #374151;
    z-index: 3;
}
.ftip-matrix-row-header {
    position: sticky;
    left: 0;
    background: #f8fafc;
    font-weight: 600;
    color: #4f46e5;
    font-family: Consolas, Monaco, monospace;
    text-align: left !important;
    z-index: 2;
    min-width: 64px;
}
.ftip-matrix-col-header {
    position: sticky;
    top: 0;
    background: #f4f5f7;
    font-weight: 600;
    color: #374151;
    z-index: 1;
    min-width: 60px;
}
.ftip-matrix-corner { left: 0; z-index: 4; min-width: 110px; }

.ftip-matrix-cell {
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: transform .08s, box-shadow .1s;
}
.ftip-matrix-cell:hover { transform: scale(1.05); box-shadow: 0 0 0 1px #4f46e5 inset; z-index: 2; position: relative; }
.ftip-matrix-cell.heat-0 { background: #fafafa; color: #9ca3af; font-weight: 400; }
.ftip-matrix-cell.heat-1 { background: #dbeafe; color: #1e40af; }
.ftip-matrix-cell.heat-2 { background: #93c5fd; color: #1e3a8a; }
.ftip-matrix-cell.heat-3 { background: #60a5fa; color: #fff; }
.ftip-matrix-cell.heat-4 { background: #2563eb; color: #fff; font-weight: 700; }

.ftip-matrix-row-total {
    font-weight: 700;
    color: #047857;
    background: #ecfdf5;
    min-width: 64px;
}
.ftip-matrix-col-total {
    font-weight: 700;
    color: #047857;
    background: #ecfdf5;
}
.ftip-matrix-grand-total {
    font-weight: 800;
    color: #fff;
    background: #4f46e5;
}
.ftip-matrix-total-row th {
    position: sticky;
    bottom: 0;
    z-index: 1;
}

.ftip-matrix-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    font-size: 12px;
    color: #6b7280;
}
.ftip-matrix-legend-title { font-weight: 600; color: #374151; }
.ftip-matrix-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.ftip-matrix-legend-color {
    display: inline-block;
    width: 16px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid #e5e7eb;
}
.ftip-matrix-legend-color.heat-0 { background: #fafafa; }
.ftip-matrix-legend-color.heat-1 { background: #dbeafe; }
.ftip-matrix-legend-color.heat-2 { background: #93c5fd; }
.ftip-matrix-legend-color.heat-3 { background: #60a5fa; }
.ftip-matrix-legend-color.heat-4 { background: #2563eb; }


/* ============== P4 WhatsApp Center: 无联系方式行置灰 ============== */
.whatsapp-table tbody tr.wa-row-disabled { opacity: 0.52; filter: grayscale(20%); background: repeating-linear-gradient(45deg, #fefefe 0 8px, #fafafa 8px 16px) !important; }
.whatsapp-table tbody tr.wa-row-disabled td { color: #94a3b8 !important; }
.whatsapp-table tbody tr.wa-row-disabled .wa-table-checkbox { cursor: not-allowed; accent-color: #cbd5e1; }
.whatsapp-table .wa-contact-empty.wa-no-contact { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:10px; background:#fef2f2; color:#b91c1c; font-size:11px; border:1px solid #fecaca; }
