/* FREEZE · DO NOT TOUCH · V21 BASELINE · CRM Theme Styles */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #f87171;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1e293b;
  --gray-900: #111827;
  --bg-gradient: linear-gradient(135deg, #f0f4ff, #faf5ff, #fefce8);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
}


*{margin:0;padding:0;box-sizing:border-box}
body.modal-open{overflow:hidden}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;background:linear-gradient(135deg,#f0f4ff,#faf5ff,#fefce8);min-height:100vh;overflow-x:hidden}
.hidden{display:none!important}

/* Welcome Page */
#welcome{max-width:1100px;margin:0 auto;padding:40px 20px}
.title-area{text-align:center;margin-bottom:32px}
.title-brand{font-size:34px;font-weight:800;background:linear-gradient(135deg,#4f46e5,#7c3aed,#2563eb);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.title-sub{font-size:20px;font-weight:600;color:#1e293b;margin-top:4px}
.title-desc{color:#64748b;margin-top:6px;font-size:14px}
.enter-btn-area{text-align:center;margin:28px 0 20px}
.enter-btn{display:inline-flex;align-items:center;gap:16px;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;font-size:18px;font-weight:600;padding:16px 40px;border-radius:16px;border:none;cursor:pointer;box-shadow:0 4px 20px rgba(79,70,229,.35);-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.enter-btn:active{transform:scale(.95);opacity:.9}
.feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:700px;margin:0 auto}
.feature-card{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 6px rgba(0,0,0,.06);cursor:pointer;transition:.1s;-webkit-tap-highlight-color:transparent}
.feature-card:active{transform:scale(.96);background:#f0f0ff}
.fc-icon{width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:16px;margin-bottom:6px}
.fc-title{font-size:13px;font-weight:600;color:#111827}
.fc-desc{font-size:11px;color:#6b7280;margin-top:2px}
.fc-badge{display:inline-block;padding:1px 6px;border-radius:4px;font-size:10px;font-weight:600;margin-top:4px}
.fc-stat{font-size:17px;font-weight:800;color:#4f46e5;margin-top:3px;line-height:1.2}.fc-stat-sub{font-size:10px;color:#9ca3af;margin-top:1px}

/* Sub-views */
.sub-view{max-width:800px;margin:0 auto;padding:16px;display:none}
.sub-view.active{display:block}
.sub-header{display:flex;align-items:center;gap:16px;margin-bottom:16px}
.sub-back{background:#fff;border:1px solid #e5e7eb;border-radius:50%;width:36px;height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:18px;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.sub-back:active{background:#f3f4f6;transform:scale(.95)}
.sub-title{font-size:18px;font-weight:700;color:#111827}
.sub-desc{font-size:12px;color:#6b7280;margin-top:2px}
/* Pipeline customer cards */
.pipe-customer{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 6px rgba(0,0,0,.06);cursor:pointer;transition:.1s}
.pipe-customer:active{transform:scale(.97);background:#f0f0ff}
.pipe-cust-name{font-size:14px;font-weight:600;color:#111827}
.pipe-cust-company{font-size:11px;color:#6b7280}
.pipe-step-bar{display:flex;gap:3px;margin:8px 0 4px}
.pipe-dot{width:14px;height:14px;border-radius:50%;flex-shrink:0}
.pipe-dot.done{background:#22c55e}
.pipe-dot.current{background:#f97316}
.pipe-dot.future{background:#e5e7eb}
.pipe-cust-stage{font-size:11px;color:#4f46e5;font-weight:600}
/* Inquiry list */
.inq-customer{background:#fff;border-radius:12px;padding:12px 14px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:8px;cursor:pointer}
.inq-customer:active{transform:scale(.97);background:#f8f8ff}
.inq-cust-header{display:flex;justify-content:space-between;align-items:center}
.inq-bg-status{font-size:11px;padding:2px 8px;border-radius:10px}
.inq-bg-done{background:#d1fae5;color:#059669}
.inq-bg-none{background:#f3f4f6;color:#9ca3af}
/* Score cards */
.score-card{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:8px;cursor:pointer}
.score-card:active{transform:scale(.97);background:#f8f8ff}
.score-big{font-size:28px;font-weight:800;color:#4f46e5}
.score-label{font-size:11px;color:#9ca3af}
/* Quote list */
.quote-item{background:#fff;border-radius:12px;padding:12px 14px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:8px}
.quote-product{font-size:13px;font-weight:600}
.quote-amount{font-size:14px;font-weight:700;color:#059669}
.quote-status{font-size:11px;padding:2px 8px;border-radius:10px}


/* CRM Shell */
#crm{max-width:1200px;margin:0 auto}
.crm-body{position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;background:#f8fafc}.nav-bar{background:#fff;border-bottom:1px solid #e5e7eb;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;flex-shrink:0}
.nav-left{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.nav-title{font-size:18px;font-weight:700;color:#1e293b}
.nav-tabs{display:flex;gap:16px;padding:0 12px 8px;background:#fff;overflow-x:auto;border-bottom:1px solid #e5e7eb;flex-shrink:0}
.tab-btn{padding:8px 14px;font-size:13px;font-weight:500;border-radius:8px;border:none;cursor:pointer;white-space:nowrap;transition:.1s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.tab-btn:active{transform:scale(0.95)}
.tab-active{background:#4f46e5;color:#fff;box-shadow:0 2px 8px rgba(79,70,229,.3)}
.tab-inactive{background:transparent;color:#6b7280}
.tab-inactive:active{background:#e0e0ff}
.main-content{padding:12px;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch}
.section-title{font-size:15px;font-weight:700;color:#1e293b;margin-bottom:10px}
.card{background:#fff;border-radius:12px;padding:14px 16px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:10px;cursor:pointer;transition:.1s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.inbox-card{display:flex;align-items:start;background:linear-gradient(135deg,#f8f9ff,#ffffff);border-radius:14px;padding:10px 0;margin-bottom:10px;cursor:pointer;border:1px solid #eef0ff;box-shadow:0 2px 8px rgba(79,70,229,.08),inset 0 1px 0 rgba(255,255,255,.8);transition:.15s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.inbox-card:active{transform:scale(.98);background:linear-gradient(135deg,#f0f1ff,#fafaff);box-shadow:0 1px 3px rgba(79,70,229,.1),inset 0 1px 0 rgba(255,255,255,.6)}
.card:active{transform:scale(.97);background:#f0f0ff}
.card-title{font-weight:600;font-size:14px;color:#111827}
.card-desc{font-size:12px;color:#6b7280;margin-top:3px}
.badge{display:inline-block;padding:2px 7px;border-radius:4px;font-size:11px;font-weight:600}
.badge-green{background:#d1fae5;color:#059669}
.badge-yellow{background:#fef9c3;color:#ca8a04}
.badge-red{background:#fee2e2;color:#dc2626}
.badge-blue{background:#dbeafe;color:#2563eb}
.badge-purple{background:#f3e8ff;color:#9333ea}
.pill{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:500}
.pill-green{background:#d1fae5;color:#059669}
.pill-yellow{background:#fef9c3;color:#ca8a04}
.pill-red{background:#fee2e2;color:#dc2626}
.pill-blue{background:#dbeafe;color:#2563eb}
.pill-gray{background:#f3f4f6;color:#6b7280}
.stat-card{text-align:center;padding:14px 8px;background:#fff;border-radius:12px;box-shadow:0 1px 6px rgba(0,0,0,.06);cursor:pointer;transition:.1s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.stat-card:active{transform:scale(.95);background:#f0f0ff}
.stat-num{font-size:28px;font-weight:700}
.stat-label{font-size:12px;color:#6b7280;margin-top:2px}
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:100;display:flex;align-items:flex-start;justify-content:center;overscroll-behavior:contain}
.modal-content{background:#fff;border-radius:0;width:100%;max-width:100%;padding:16px 16px env(safe-area-inset-bottom,16px);margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh;overflow:hidden;box-sizing:border-box}
.modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;flex-shrink:0}
.modal-title{font-size:17px;font-weight:700;color:#111827;flex:1;text-align:center}
.modal-close{width:28px;height:28px;border:none;background:#f3f4f6;border-radius:50%;font-size:16px;cursor:pointer;color:#6b7280}
.modal-body-scroll{flex:1;overflow-y:auto;padding:12px 4px 40px}.modal-row{display:flex;padding:8px 0;border-bottom:1px solid #f3f4f6;font-size:13px}
.modal-label{color:#6b7280;font-weight:500;flex-shrink:0;min-width:50px;text-align:right;margin-right:8px}
.modal-value{color:#111827;font-weight:600;flex:1;text-align:center;font-size:13px}
.modal-section{margin-top:12px}
.modal-section-title{font-size:14px;font-weight:600;color:#374151;margin-bottom:6px}
.modal-tabs{display:flex;gap:16px;margin-bottom:0;overflow-x:auto;flex-wrap:wrap;flex-shrink:0}
.modal-tab-btn{padding:8px 14px;font-size:13px;border-radius:8px;border:none;cursor:pointer;white-space:nowrap;transition:all .15s}.modal-tab-btn:active{transform:scale(0.95)}.modal-tab-inactive:hover{background:#e5e7eb;color:#374151}
.modal-tab-active{background:#4f46e5;color:#fff}
.modal-tab-inactive{background:#f3f4f6;color:#6b7280}
.timeline-item{display:flex;gap:8px;padding:6px 0;font-size:12px;border-left:2px solid #e5e7eb;padding-left:14px;margin-left:4px;position:relative}
.timeline-dot{width:7px;height:7px;border-radius:50%;background:#4f46e5;flex-shrink:0;position:absolute;left:-4.5px;top:9px}
.score-bar{display:flex;align-items:center;gap:6px;margin:4px 0}
.score-fill{height:8px;border-radius:4px;transition:width .5s}
.score-empty{height:8px;background:#f3f4f6;border-radius:4px;flex:1}
.score-tag{font-size:11px;padding:3px 8px;border-radius:6px}
.bg-green-light{background:#d1fae5;color:#059669}
.bg-yellow-light{background:#fef9c3;color:#ca8a04}
.bg-red-light{background:#fee2e2;color:#dc2626}
.email-text{font-size:12px;color:#374151;line-height:1.6;white-space:pre-wrap;font-family:monospace;background:#fff;padding:10px;border-radius:6px;border:1px solid #f3f4f6;margin:6px 0}
.filter-bar{display:flex;gap:6px;margin-bottom:10px;overflow-x:auto}
.filter-btn{padding:4px 10px;border-radius:12px;border:1px solid #e5e7eb;background:#fff;font-size:12px;cursor:pointer;white-space:nowrap;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.filter-btn:active{background:#e0e0ff}
.filter-on{background:#4f46e5;color:#fff;border-color:#4f46e5}
.search-input{width:100%;padding:10px 14px;border:1px solid #e5e7eb;border-radius:10px;font-size:14px;outline:none;background:#fff}
.search-input:focus{border-color:#4f46e5}
.footer-text{text-align:center;padding:16px;font-size:11px;color:#94a3b8}

/* Funnel & Pipeline */
.funnel-section{background:#fff;border-radius:14px;padding:14px 16px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:12px}
.funnel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:6px}
.funnel-title{font-size:14px;font-weight:700;color:#1e293b}
.funnel-legend{font-size:11px;color:#9ca3af}
.funnel-row{display:flex;align-items:center;gap:8px;margin-bottom:5px;cursor:pointer}
.funnel-icon{width:20px;text-align:center;flex-shrink:0;font-size:12px}
.funnel-label{font-size:12px;color:#374151;width:56px;flex-shrink:0;font-weight:500}
.funnel-bar-wrap{flex:1;height:22px;background:#f3f4f6;border-radius:4px;position:relative;overflow:hidden}
.funnel-bar{height:100%;border-radius:4px;transition:width .6s;position:relative}
.funnel-count{position:absolute;right:4px;top:3px;font-size:11px;font-weight:600}
.funnel-pct{font-size:11px;color:#6b7280;width:40px;text-align:right;flex-shrink:0}
.funnel-arrow{text-align:center;font-size:10px;color:#cbd5e1;margin:1px 0;line-height:1}

/* Pipeline horizontal */
.pipe-section{background:#fff;border-radius:14px;padding:14px 12px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:12px;overflow-x:auto}
.pipe-track{display:flex;align-items:flex-start;min-width:520px}
.pipe-node{flex:1;min-width:0;text-align:center;padding:0 3px}
.pipe-emoji{font-size:16px;margin-bottom:2px}
.pipe-name{font-size:10px;font-weight:600;color:#374151;margin-bottom:2px;line-height:1.2}
.pipe-count{font-size:16px;font-weight:700}
.pipe-bar-bg{height:6px;background:#f3f4f6;border-radius:3px;margin:4px 0;overflow:hidden}
.pipe-bar{height:100%;border-radius:3px;transition:width .6s}
.pipe-conv{font-size:10px;color:#6b7280}
.pipe-connector{flex-shrink:0;padding:20px 0 0;font-size:12px;color:#cbd5e1}

/* V20·0715_bust1783226325 最终焊死版 */
.settings-view{max-width:800px;margin:0 auto;padding:16px;display:none}.settings-view.active{display:block}
.setting-group{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:12px}
.setting-group-title{font-size:14px;font-weight:700;color:#111827;margin-bottom:8px}
.setting-row{display:flex;align-items:center;gap:8px;margin-bottom:6px;padding:6px 0;border-bottom:1px solid #f3f4f6}.setting-row:last-child{border:none}
.setting-input{flex:1;padding:6px 10px;border:1px solid #e5e7eb;border-radius:6px;font-size:12px;outline:none}
.setting-input:focus{border-color:#4f46e5}
.setting-color{width:28px;height:28px;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;padding:0}
.setting-drag{font-size:16px;color:#9ca3af;cursor:grab}
.setting-add{background:#f3f4f6;border:1px dashed #d1d5db;border-radius:8px;padding:8px;text-align:center;font-size:12px;color:#6b7280;cursor:pointer;margin-top:6px}
.setting-tab{display:flex;gap:16px;margin-bottom:12px;overflow-x:auto}
.setting-tab-btn{padding:6px 12px;font-size:12px;border-radius:6px;border:none;cursor:pointer;white-space:nowrap}.setting-tab-btn:active{transform:scale(0.95)}
.setting-tab-active{background:#4f46e5;color:#fff}.setting-tab-inactive{background:#f3f4f6;color:#6b7280}
.chat-toggle{position:fixed;bottom:20px;right:20px;width:52px;height:52px;border-radius:50%;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;border:none;font-size:24px;cursor:pointer;box-shadow:0 4px 20px rgba(79,70,229,.4);z-index:50}
.chat-window{position:fixed;bottom:80px;right:20px;width:320px;max-height:420px;background:#fff;border-radius:16px;box-shadow:0 8px 30px rgba(0,0,0,.15);z-index:51;display:none;flex-direction:column;overflow:hidden}
.chat-window.open{display:flex}
.chat-header{background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;padding:12px 14px;font-size:14px;font-weight:600;display:flex;justify-content:space-between;align-items:center}
.chat-msgs{flex:1;padding:10px;overflow-y:auto;font-size:12px;background:#f8fafc}.chat-msg{max-width:80%;padding:8px 10px;border-radius:12px;margin-bottom:6px;line-height:1.4}
.chat-msg-in{background:#fff;border:1px solid #e5e7eb;align-self:flex-start;border-bottom-left-radius:4px}
.chat-msg-out{background:#4f46e5;color:#fff;margin-left:auto;border-bottom-right-radius:4px}
.chat-input-area{display:flex;gap:6px;padding:8px;border-top:1px solid #e5e7eb}
.chat-input{flex:1;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px;font-size:12px;outline:none}
.edm-campaign{background:#fff;border-radius:12px;padding:14px;box-shadow:0 1px 6px rgba(0,0,0,.06);margin-bottom:8px}
.edm-title{font-size:13px;font-weight:600}.edm-meta{font-size:11px;color:#6b7280;margin-top:3px}
.edm-progress{height:4px;background:#f3f4f6;border-radius:2px;margin:6px 0;overflow:hidden}
.edm-progress-bar{height:100%;border-radius:2px}
.edm-stats{display:flex;gap:12px;margin-top:6px;flex-wrap:wrap}
.edm-stat-val{font-size:14px;font-weight:700}.edm-stat-label{font-size:10px;color:#9ca3af}
.chan-tl{display:flex;align-items:center;gap:6px;font-size:11px;padding:4px 0;color:#6b7280}
.chan-tl-text{flex:1}.chan-tl-date{color:#9ca3af;white-space:nowrap}
.chan-badge{font-size:9px;padding:1px 5px;border-radius:4px;white-space:nowrap}
.chan-mail{background:#dbeafe;color:#2563eb}.chan-whatsapp{background:#d1fae5;color:#059669}
.chan-web{background:#f3e8ff;color:#9333ea}.chan-whatsapp{background:#d1fae5;color:#059669}
.fu-input{width:100%;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px;font-size:12px;outline:none;margin-bottom:6px;resize:vertical;font-family:inherit}.fu-input:focus{border-color:#4f46e5}.fu-row{display:flex;gap:6px;margin-bottom:6px}.fu-type-btn{padding:4px 10px;font-size:11px;border-radius:6px;border:none;cursor:pointer}.fu-active{background:#4f46e5;color:#fff}.fu-item{padding:10px;background:#f8fafc;border-radius:8px;margin-bottom:6px;border-left:3px solid #4f46e5}.fu-item.whatsapp{border-left-color:#059669}.fu-item.phone{border-left-color:#ca8a04}.fu-item.meeting{border-left-color:#f59e0b}.fu-meta{display:flex;gap:8px;font-size:10px;color:#9ca3af;margin-bottom:4px}.fu-content{font-size:12px;color:#374151;line-height:1.5}.fu-next{font-size:11px;color:#059669;margin-top:4px}
.login-page{position:fixed;top:0;left:0;width:100%;height:100%;background:linear-gradient(135deg,#f0f4ff,#faf5ff,#fefce8);z-index:9999;display:flex;align-items:center;justify-content:center}
.login-container{background:transparent;padding:40px 32px;width:90%;max-width:380px;text-align:center}
.login-logo{font-size:28px;font-weight:800;background:linear-gradient(135deg,#4f46e5,#7c3aed,#2563eb);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.login-version{font-size:12px;color:#94a3b8;margin-top:2px}
.login-form{margin-top:28px;text-align:left}
.login-field{margin-bottom:16px}
.login-field label{display:block;font-size:13px;font-weight:600;color:#374151;margin-bottom:4px}
.login-field input{width:100%;padding:12px 14px;border:1.5px solid rgba(255,255,255,.5);border-radius:10px;font-size:15px;outline:none;transition:border-color .15s;background:rgba(255,255,255,.25)}
.login-field input:focus{border-color:#4f46e5}
.login-error{background:#fef2f2;color:#dc2626;font-size:13px;padding:8px 12px;border-radius:8px;margin-bottom:12px;text-align:center}
.login-btn{width:100%;padding:14px;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;font-size:16px;font-weight:600;border:none;border-radius:12px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.login-btn:active{transform:scale(.97);opacity:.9}
.user-badge{position:fixed;top:12px;right:12px;z-index:9998;display:flex;align-items:center;gap:6px;background:#fff;padding:4px 10px 4px 6px;border-radius:20px;box-shadow:0 1px 6px rgba(0,0,0,.08);font-size:11px;cursor:pointer}
.user-badge:active{background:#f3f4f6}
.user-avatar{width:24px;height:24px;border-radius:50%;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}
.email-reader-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#fff;z-index:1000;display:flex;flex-direction:column}
.email-reader-overlay.hidden{display:none}
.email-reader-content{background:#fff;border-radius:0;width:100%;max-width:100%;max-height:100vh;height:100vh;overflow:hidden;box-shadow:none;display:flex;flex-direction:column}