/* ===== 全局样式 ===== */
:root {
  --primary: #2D7D46;
  --primary-light: #3A9956;
  --primary-dark: #1E5C32;
  --accent: #E8A838;
  --accent-light: #F0C060;
  --bg: #F5F6FA;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1B2A3C;
  --text: #2C3E50;
  --text-light: #7F8C9B;
  --text-sidebar: #E0E6ED;
  --border: #E2E8F0;
  --danger: #E74C3C;
  --danger-light: #FF6B6B;
  --success: #27AE60;
  --warning: #F39C12;
  --info: #3498DB;
  --tag-fertilizer: #8B6914;
  --tag-feed: #2D7D46;
  --tag-animal-health: #3498DB;
  --tag-aqua-health: #1ABC9C;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.25s ease;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ===== 登录页 ===== */
#loginView {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #1B2A3C 0%, #2D7D46 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff; border-radius: var(--radius-lg); padding: 48px 40px;
  width: 420px; max-width: 90vw; box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .icon { font-size: 48px; display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 28px; color: var(--primary); font-weight: 700; }
.login-logo p { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.login-form .field { margin-bottom: 20px; }
.login-form label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; font-weight: 500; }
.login-form input {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 15px; transition: var(--transition);
  outline: none;
}
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,125,70,0.15); }
.login-btn {
  width: 100%; padding: 14px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); font-size: 16px; font-weight: 600;
  transition: var(--transition);
}
.login-btn:hover { background: var(--primary-light); }
.login-hint { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-light); }

/* ===== 主布局 ===== */
#appView { display: none; height: 100vh; }
.app-layout { display: flex; height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 180px; background: var(--bg-sidebar); color: var(--text-sidebar);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 100; transition: var(--transition);
}
.sidebar-brand {
  padding: 18px 16px 14px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .icon { font-size: 22px; }
.sidebar-brand h2 { font-size: 17px; font-weight: 700; color: #fff; }
.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  color: var(--text-sidebar); font-size: 14px; cursor: pointer;
  transition: var(--transition); border-radius: 0; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item.active { background: rgba(45,125,70,0.25); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; background: var(--accent); border-radius: 2px;
}
.nav-item .icon { font-size: 17px; width: 22px; text-align: center; opacity: 0.7; }
.nav-item.active .icon { opacity: 1; }
.nav-section { padding: 16px 16px 8px; font-size: 11px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 1px; }
.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 8px; font-size: 12px;
}
.sidebar-footer .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 600;
}

/* 顶栏 */
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-search {
  padding: 8px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 13px; width: 240px; outline: none; transition: var(--transition);
}
.topbar-search:focus { border-color: var(--primary); width: 300px; }
.topbar-badge {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: var(--bg); cursor: pointer; position: relative;
  transition: var(--transition);
}
.topbar-badge:hover { background: var(--border); }
.topbar-badge .dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}

/* 主内容区 */
.main-content { flex: 1; margin-left: 180px; padding: 24px; min-width: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

/* ===== 通用组件 ===== */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: var(--transition);
  overflow-x: auto;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; }
.card-actions { display: flex; gap: 8px; }

.btn {
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px;
  font-weight: 500; border: 1.5px solid transparent; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-outline { border-color: var(--border); color: var(--text); background: #fff; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.tag {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
}
.tag-fertilizer { background: rgba(139,105,20,0.12); color: var(--tag-fertilizer); }
.tag-feed { background: rgba(45,125,70,0.12); color: var(--tag-feed); }
.tag-animal-health { background: rgba(52,152,219,0.12); color: var(--tag-animal-health); }
.tag-aqua-health { background: rgba(26,188,156,0.12); color: var(--tag-aqua-health); }

.table { width: 100%; border-collapse: collapse; min-width: max-content; }
#customerTable { table-layout: fixed; }
.table th, .table td {
  padding: 12px 16px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle; white-space: nowrap;
}
.table th { font-weight: 600; color: var(--text-light); background: var(--bg); white-space: nowrap; }
.table tr:hover td { background: rgba(45,125,70,0.04); }
.table td.wrap, .table th.wrap { white-space: normal; }
.table td.ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* ===== 仪表板 ===== */
.dashboard-full { margin-bottom: 24px; }

/* KPI 卡片行 */
.dash-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.dash-kpi-compact { margin-top: 16px; }

.dash-kpi-card {
  border-radius: var(--radius-lg); padding: 18px 20px; cursor: pointer;
  transition: all 0.25s ease; position: relative; overflow: hidden;
  border: 1px solid transparent;
}
.dash-kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.dash-kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.dash-kpi-blue { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.dash-kpi-blue::before { background: #2563eb; }
.dash-kpi-blue:hover { border-color: #93c5fd; }
.dash-kpi-green { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
.dash-kpi-green::before { background: #16a34a; }
.dash-kpi-green:hover { border-color: #86efac; }
.dash-kpi-orange { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); }
.dash-kpi-orange::before { background: #ea580c; }
.dash-kpi-orange:hover { border-color: #fdba74; }
.dash-kpi-purple { background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%); }
.dash-kpi-purple::before { background: #9333ea; }
.dash-kpi-purple:hover { border-color: #d8b4fe; }

.dash-kpi-top { display: flex; align-items: center; gap: 14px; }
.dash-kpi-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; flex-shrink: 0; background: rgba(255,255,255,0.7);
}
.dash-kpi-info { flex: 1; min-width: 0; }
.dash-kpi-label { font-size: 13px; color: var(--text-light); margin-bottom: 2px; }
.dash-kpi-value { font-size: 30px; font-weight: 800; line-height: 1.1; }
.dash-kpi-bottom { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.dash-kpi-trend { font-size: 12px; color: var(--text-light); }
.dash-kpi-bars { display: flex; gap: 3px; align-items: flex-end; height: 20px; }
.dash-kpi-bar { width: 6px; border-radius: 2px; opacity: 0.6; }

/* 快捷操作栏 */
.dash-quick-actions {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.dash-qa-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg-card);
  font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; transition: all 0.2s;
}
.dash-qa-btn span { font-size: 16px; }
.dash-qa-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(45,125,70,0.04); }

/* 通用区块行 */
.dash-section-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* 仪表盘徽标 */
.dash-badge {
  font-size: 12px; padding: 2px 10px; border-radius: 10px; font-weight: 600;
  background: rgba(45,125,70,0.08); color: var(--primary);
}
.dash-badge.dash-badge-danger { background: rgba(220,38,38,0.1); color: var(--danger); }

/* 待办列表 */
.dash-todo-list { max-height: 320px; overflow-y: auto; }
.dash-card-todo, .dash-card-alert { min-height: 200px; }

/* 超期预警列表 */
.dash-alert-list { max-height: 320px; overflow-y: auto; }

/* 漏斗图容器 */
.dash-funnel-container { padding: 12px 0; }
.dash-funnel-item {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}
.dash-funnel-label { width: 80px; font-size: 12px; font-weight: 600; text-align: right; flex-shrink: 0; }
.dash-funnel-bar-wrap { flex: 1; height: 28px; background: var(--bg); border-radius: 6px; overflow: hidden; position: relative; }
.dash-funnel-bar { height: 100%; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; transition: width 0.6s ease; }
.dash-funnel-bar-text { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.dash-funnel-amount { font-size: 11px; color: var(--text-light); width: 80px; flex-shrink: 0; }

/* 客户分布 */
.dash-dist-layout { padding: 8px 0; }
.dash-level-bars { margin-top: 12px; }
.dash-level-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dash-level-tag { width: 24px; font-size: 12px; font-weight: 700; text-align: center; flex-shrink: 0; }
.dash-level-track { flex: 1; height: 16px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.dash-level-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.dash-level-count { font-size: 12px; font-weight: 600; width: 30px; text-align: right; flex-shrink: 0; }

/* 紧凑指标卡 */
.dash-metric-mini {
  border-radius: var(--radius-lg); padding: 16px 18px; border: 1px solid var(--border);
  transition: all 0.2s; position: relative; overflow: hidden;
}
.dash-metric-mini::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.dash-metric-green { background: #f0fdf4; }
.dash-metric-green::before { background: #16a34a; }
.dash-metric-orange { background: #fff7ed; }
.dash-metric-orange::before { background: #ea580c; }
.dash-metric-blue { background: #eff6ff; }
.dash-metric-blue::before { background: #2563eb; }
.dash-metric-purple { background: #faf5ff; }
.dash-metric-purple::before { background: #9333ea; }
.dash-metric-mini-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.dash-metric-mini-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.dash-metric-mini-trend { font-size: 11px; color: var(--text-light); margin-top: 6px; }

/* 排行榜 */
.dash-ranking-list { padding: 8px 0; }
.dash-rank-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); transition: var(--transition);
}
.dash-rank-item:last-child { border-bottom: none; }
.dash-rank-item:hover { background: rgba(45,125,70,0.03); }
.dash-rank-medal {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.dash-rank-medal-1 { background: #fef3c7; color: #d97706; }
.dash-rank-medal-2 { background: #f1f5f9; color: #64748b; }
.dash-rank-medal-3 { background: #fed7aa; color: #c2410c; }
.dash-rank-medal-other { background: var(--bg); color: var(--text-light); }
.dash-rank-info { flex: 1; min-width: 0; }
.dash-rank-name { font-size: 14px; font-weight: 600; }
.dash-rank-detail { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.dash-rank-bar-wrap { width: 100px; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.dash-rank-bar { height: 100%; border-radius: 3px; background: var(--primary); transition: width 0.6s ease; }
.dash-rank-amount { font-size: 14px; font-weight: 700; color: var(--accent); width: 80px; text-align: right; flex-shrink: 0; }

/* 最近动态列表 */
.dash-recent-list { max-height: 320px; overflow-y: auto; }
.dash-recent-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); transition: var(--transition); cursor: pointer;
}
.dash-recent-item:last-child { border-bottom: none; }
.dash-recent-item:hover { background: rgba(45,125,70,0.04); }
.dash-recent-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; flex-shrink: 0; background: rgba(45,125,70,0.1); color: var(--primary);
}
.dash-recent-info { flex: 1; min-width: 0; }
.dash-recent-title { font-size: 13px; }
.dash-recent-title b { font-weight: 600; }
.dash-recent-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.dash-recent-time { font-size: 12px; color: var(--text-light); flex-shrink: 0; }

/* ===== 线索发现 ===== */
.lead-discovery-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.filter-panel { }
.filter-group { margin-bottom: 16px; }
.filter-group label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 6px; font-weight: 600; }
.filter-group select, .filter-group input {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 13px; outline: none; background: #fff;
}
.filter-group select:focus, .filter-group input:focus { border-color: var(--primary); }
.search-bar {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.search-bar input {
  flex: 1; padding: 10px 16px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 14px; outline: none;
}
.search-bar input:focus { border-color: var(--primary); }
.industry-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.industry-tab {
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px;
  cursor: pointer; border: 1.5px solid var(--border); background: #fff;
  transition: var(--transition);
}
.industry-tab:hover { border-color: var(--primary); color: var(--primary); }
.industry-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.lead-results { }
.lead-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px 20px;
  border: 1px solid var(--border); margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
  transition: var(--transition); cursor: pointer;
}
.lead-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.lead-info { flex: 1; }
.lead-info .name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.lead-info .detail { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; align-items: center; }
.lead-tags { display: flex; gap: 6px; margin-top: 8px; }
.lead-actions { display: flex; gap: 8px; }

/* ===== 客户管理 ===== */
.customer-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 16px; gap: 12px; }
.customer-list-panel .customer-toolbar { border-bottom: 1px solid var(--border); }
.customer-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.customer-filters select {
  padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: #fff; outline: none;
}
.customer-detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ===== 客户分栏布局 ===== */
.customer-split-layout { display: flex; gap: 16px; height: calc(100vh - 80px); min-height: 600px; overflow: hidden; }
.customer-list-panel { flex: 0 0 380px; display: flex; flex-direction: column; min-width: 320px; max-width: 45%; background: var(--card-bg); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.customer-detail-panel { flex: 1; background: var(--card-bg); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; position: relative; }
.customer-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-light); }
.customer-list-card { flex: 1; overflow: auto; border-radius: 0; border: none; border-top: 1px solid var(--border); }
.customer-list-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.customer-list-table th:nth-child(1) { width: 36px; }
.customer-list-table th:nth-child(3) { width: 76px; }
.customer-list-table th:nth-child(4) { width: 86px; }
.customer-list-table th { position: sticky; top: 0; background: #f9fafb; z-index: 10; padding: 10px 12px; font-weight: 600; color: var(--text-light); text-align: left; border-bottom: 1px solid var(--border); }
.customer-list-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-row { cursor: pointer; transition: background .15s; }
.customer-row:hover { background: var(--primary-light); }
.customer-row-selected { background: rgba(45,125,70,0.1) !important; border-left: 3px solid var(--primary); }
.customer-row-avatar { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; flex-shrink: 0; }
.customer-search-box { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 4px 6px 4px 12px; background: #fff; }
.customer-search-box input { border: none; outline: none; flex: 1; font-size: 13px; min-width: 0; background: transparent; }
.customer-search-box input::placeholder { color: #9ca3af; }
.customer-list-stats { font-size: 12px; color: var(--text-light); }

.customer-detail-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.customer-detail-header-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.customer-detail-avatar { width: 56px; height: 56px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
.customer-detail-title-wrap { min-width: 0; }
.customer-detail-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.customer-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.customer-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.customer-detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 24px; }
.summary-card { background: #f9fafb; border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--border); }
.summary-card .summary-label { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.summary-card .summary-value { font-size: 15px; font-weight: 600; color: var(--text); }
.summary-card .summary-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.contact-card { background: #f9fafb; border-radius: var(--radius); padding: 14px; border: 1px solid var(--border); }

@media (max-width: 1200px) {
  .customer-list-panel { flex: 0 0 340px; }
  .customer-detail-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .customer-split-layout { position: relative; }
  .customer-list-panel { width: 100%; max-width: none; flex: none; height: 100%; }
  .customer-detail-panel { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: translateX(100%); transition: transform .25s; z-index: 20; }
  .customer-detail-active .customer-detail-panel { transform: translateX(0); }
  .customer-detail-layout { grid-template-columns: 1fr; }
  .customer-detail-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .customer-detail-header { flex-direction: column; align-items: flex-start; }
  .customer-detail-summary { grid-template-columns: 1fr; padding: 16px; }
  .customer-detail-actions { width: 100%; }
  .customer-detail-actions .btn { flex: 1; justify-content: center; }
}
.customer-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.customer-avatar {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: var(--primary); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 24px; font-weight: 700;
}
.customer-name { font-size: 20px; font-weight: 700; }
.customer-meta { font-size: 13px; color: var(--text-light); display: flex; gap: 12px; }
.tab-nav { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.tab-item {
  padding: 10px 20px; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent;
  color: var(--text-light); transition: var(--transition); margin-bottom: -2px;
}
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.followup-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.followup-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 4px;
}
.followup-content { flex: 1; }
.followup-content .time { font-size: 12px; color: var(--text-light); }
.followup-content .text { font-size: 14px; margin-top: 2px; }
.followup-content .author { font-size: 12px; color: var(--primary); margin-top: 4px; }

/* ===== 客户详情全页布局 ===== */
.cust-detail-body { flex: 1; overflow-y: auto; display: flex; gap: 0; }
.cust-detail-sidebar { width: 300px; min-width: 300px; border-right: 1px solid var(--border); padding: 20px; overflow-y: auto; background: #fafbfc; }
.cust-detail-main { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cust-detail-topbar { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: #fff; }
.cust-detail-topbar .back-btn { font-size: 20px; cursor: pointer; color: var(--text-light); transition: var(--transition); padding: 4px 8px; border-radius: var(--radius); }
.cust-detail-topbar .back-btn:hover { color: var(--text); background: var(--bg-hover); }
.cust-detail-topbar .avatar { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.cust-detail-topbar .name-wrap { flex: 1; min-width: 0; }
.cust-detail-topbar .name-wrap .name { font-size: 17px; font-weight: 700; }
.cust-detail-topbar .name-wrap .meta { font-size: 12px; color: var(--text-light); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.cust-detail-topbar .actions { display: flex; gap: 8px; }
.cust-sidebar-card { background: #fff; border-radius: var(--radius); padding: 16px; border: 1px solid var(--border); margin-bottom: 16px; }
.cust-sidebar-card .card-label { font-size: 12px; font-weight: 600; color: var(--text-light); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.cust-info-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f3f4f6; }
.cust-info-row:last-child { border-bottom: none; }
.cust-info-row .label { color: var(--text-light); white-space: nowrap; }
.cust-info-row .value { font-weight: 500; text-align: right; word-break: break-all; }
.cust-sidebar-contact { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.cust-sidebar-contact:last-child { border-bottom: none; }
.cust-sidebar-contact .ct-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary)15; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.cust-sidebar-contact .ct-info { flex: 1; min-width: 0; }
.cust-sidebar-contact .ct-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.cust-sidebar-contact .ct-phone { font-size: 12px; color: var(--text-light); }
.cust-sidebar-contact .ct-call { width: 30px; height: 30px; border-radius: 50%; background: var(--success)15; color: var(--success); border: none; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.cust-sidebar-contact .ct-call:hover { background: var(--success); color: #fff; }

/* ===== 分页组件 ===== */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.pagination-info { font-size: 13px; color: var(--text-light); }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.page-btn { min-width: 32px; height: 32px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius); cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: var(--transition); padding: 0 8px; }
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-size-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; cursor: pointer; }

/* ===== 商机管理（看板） ===== */
.pipeline-view { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; min-width: 100%; }
.pipeline-col {
  min-width: 200px; max-width: 220px; flex: 1; display: flex; flex-direction: column;
}
.pipeline-col-header {
  padding: 10px 12px; border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center;
}
.pipeline-col-body {
  flex: 1; padding: 8px; background: var(--bg); border-radius: 0 0 var(--radius) var(--radius);
  min-height: 100px;
}
.pipeline-card {
  background: #fff; border-radius: var(--radius); padding: 12px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: var(--transition); border: 1px solid var(--border);
}
.pipeline-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pipeline-card .title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pipeline-card .company { font-size: 12px; color: var(--text-light); }
.pipeline-card .amount { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 4px; }
.pipeline-card .owner { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.pipeline-count { background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 10px; font-size: 11px; }

.stage-colors {
  --线索: #95A5A6;
  --首次触达: #3498DB;
  --需求确认: #9B59B6;
  --寄送样品: #F39C12;
  --客户试用: #E67E22;
  --试验反馈: #1ABC9C;
  --报价: #2ECC71;
  --商务谈判: #27AE60;
  --成交: var(--primary);
  --复购扩量: var(--accent);
}

/* ===== 报表 ===== */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-container { position: relative; height: 280px; }
.report-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.report-kpi {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); text-align: center;
}
.report-kpi .label { font-size: 12px; color: var(--text-light); }
.report-kpi .value { font-size: 22px; font-weight: 700; margin-top: 4px; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 24px;
  width: 600px; max-width: 90vw; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal.modal-xl {
  width: 96vw; max-width: 1400px; max-height: 94vh; padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.modal.modal-lg {
  width: 900px; max-width: 92vw; max-height: 88vh;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-close {
  float: right; cursor: pointer; font-size: 20px; color: var(--text-light);
  transition: var(--transition);
}
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-field { margin-bottom: 16px; }
.modal-field label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; font-weight: 500; }
.modal-field input, .modal-field textarea, .modal-field select {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 14px; outline: none;
}
.modal-field textarea { min-height: 80px; resize: vertical; }

/* ===== 通知提示 ===== */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 300;
  padding: 12px 20px; border-radius: var(--radius); font-size: 14px;
  box-shadow: var(--shadow-lg); transform: translateX(120%); transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }
.toast-success { background: var(--success); color: #fff; }
.toast-info { background: var(--info); color: #fff; }

/* ===== 隐藏的页面 ===== */
.page { display: none; }
.page.active { display: flex; flex-direction: column; flex: 1; overflow-y: auto; min-height: 0; }

/* ===== 后台管理 - 用户管理 ===== */
.user-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.user-status.active { background: rgba(39,174,96,0.12); color: var(--success); }
.user-status.disabled { background: rgba(231,76,60,0.12); color: var(--danger); }
.user-avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }

/* ===== 角色权限 ===== */
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.role-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 2px solid var(--border); transition: var(--transition); cursor: pointer; }
.role-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.role-card.selected { border-color: var(--primary); background: rgba(45,125,70,0.04); }
.role-card .role-icon { font-size: 28px; margin-bottom: 8px; }
.role-card .role-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.role-card .role-desc { font-size: 12px; color: var(--text-light); }
.role-card .role-count { font-size: 12px; color: var(--primary); margin-top: 8px; }

.perm-matrix { width: 100%; border-collapse: collapse; }
.perm-matrix th, .perm-matrix td { padding: 10px 16px; text-align: center; font-size: 13px; border-bottom: 1px solid var(--border); }
.perm-matrix th { background: var(--bg); color: var(--text-light); font-weight: 600; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.perm-matrix tr:hover td { background: rgba(45,125,70,0.04); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 22px; transition: var(--transition); }
.switch .slider::before { position: absolute; content: ''; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: var(--transition); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ===== 字段配置 ===== */
.field-config-list { }
.field-config-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: #fff; transition: var(--transition); }
.field-config-item:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }
.field-config-item .field-name { font-weight: 600; font-size: 14px; min-width: 120px; }
.field-config-item .field-type { font-size: 12px; color: var(--text-light); background: var(--bg); padding: 3px 10px; border-radius: 12px; }
.field-config-item .field-flags { display: flex; gap: 8px; margin-left: auto; }
.field-flag { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.field-flag.required { background: rgba(231,76,60,0.1); color: var(--danger); }
.field-flag.list { background: rgba(52,152,219,0.1); color: var(--info); }
.field-flag.system { background: rgba(149,165,166,0.15); color: var(--text-light); }

/* ===== 商机阶段配置 ===== */
.stage-config-list { }
.stage-config-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: #fff; transition: var(--transition); }
.stage-config-item:hover { box-shadow: var(--shadow-sm); }
.stage-config-item .drag-handle { cursor: move; color: var(--text-light); font-size: 18px; }
.stage-config-item .stage-color-dot { width: 12px; height: 12px; border-radius: 50%; }
.stage-config-item .stage-name { font-weight: 600; font-size: 14px; min-width: 100px; }
.stage-config-item .stage-reminder { font-size: 12px; color: var(--text-light); flex: 1; }

/* ===== 设置子页面Tab ===== */
.settings-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.settings-tab { padding: 10px 20px; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text-light); transition: var(--transition); margin-bottom: -2px; }
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== 客户分类标签 ===== */
.tag-level-a { background: rgba(231,76,60,0.12); color: #E74C3C; }
.tag-level-b { background: rgba(243,156,18,0.12); color: #F39C12; }
.tag-level-c { background: rgba(52,152,219,0.12); color: #3498DB; }
.tag-level-d { background: rgba(149,165,166,0.15); color: #7F8C9B; }
.tag-type { background: rgba(45,125,70,0.1); color: var(--primary); font-size: 11px; }

/* ===== 客户详情 - 电话外呼栏 ===== */
.call-bar {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  background: linear-gradient(135deg, rgba(45,125,70,0.08), rgba(232,168,56,0.06));
  border-radius: var(--radius-lg); margin-bottom: 20px; border: 1px solid var(--border);
}
.call-bar .call-phone {
  font-size: 20px; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.call-bar .call-phone .phone-icon { font-size: 22px; }
.call-btn {
  padding: 10px 24px; border-radius: var(--radius); font-size: 14px;
  font-weight: 600; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: var(--transition);
}
.call-btn-primary { background: var(--primary); color: #fff; }
.call-btn-primary:hover { background: var(--primary-light); transform: scale(1.02); }
.call-btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.call-btn-outline:hover { background: rgba(45,125,70,0.06); }
.call-bar .call-contact-info { font-size: 13px; color: var(--text-light); }

/* ===== 外呼中心 ===== */
.call-center-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
.call-dialer {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid var(--border); text-align: center;
}
.call-dialer .dialer-display {
  font-size: 24px; font-weight: 700; padding: 16px; background: var(--bg);
  border-radius: var(--radius); margin-bottom: 16px; min-height: 60px;
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.call-dialer .dial-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.dial-key {
  padding: 14px; font-size: 20px; font-weight: 600; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; background: #fff; transition: var(--transition);
}
.dial-key:hover { background: var(--bg); border-color: var(--primary); }
.dial-key .sub { font-size: 10px; color: var(--text-light); font-weight: 400; }
.call-task-list { }
.call-task-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; transition: var(--transition);
}
.call-task-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.call-task-item .task-info { flex: 1; }
.call-task-item .task-info .name { font-size: 14px; font-weight: 600; }
.call-task-item .task-info .meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.call-status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.call-status-pending { background: rgba(149,165,166,0.15); color: #7F8C9B; }
.call-status-calling { background: rgba(52,152,219,0.12); color: #3498DB; }
.call-status-connected { background: rgba(39,174,96,0.12); color: #27AE60; }
.call-status-missed { background: rgba(231,76,60,0.12); color: #E74C3C; }
.call-duration { font-size: 12px; color: var(--text-light); font-family: monospace; }

/* ===== 物流协同 ===== */
.logistics-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.logistics-stat {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); text-align: center;
}
.logistics-stat .label { font-size: 12px; color: var(--text-light); }
.logistics-stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.ship-status { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.ship-pending { background: rgba(243,156,18,0.12); color: #F39C12; }
.ship-shipped { background: rgba(52,152,219,0.12); color: #3498DB; }
.ship-delivered { background: rgba(39,174,96,0.12); color: #27AE60; }

/* ===== 财务协同 ===== */
.finance-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.finance-stat {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border); text-align: center;
}
.finance-stat .label { font-size: 12px; color: var(--text-light); }
.finance-stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.pay-status { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.pay-unpaid { background: rgba(231,76,60,0.12); color: #E74C3C; }
.pay-partial { background: rgba(243,156,18,0.12); color: #F39C12; }
.pay-paid { background: rgba(39,174,96,0.12); color: #27AE60; }
.invoice-status { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.invoice-pending { background: rgba(149,165,166,0.15); color: #7F8C9B; }
invoice-issued { background: rgba(52,152,219,0.12); color: #3498DB; }

/* ===== AI 智能分析 ===== */
.ai-page { max-width: 1200px; }
.ai-hero {
  background: linear-gradient(135deg, #1B2A3C 0%, #2D7D46 100%);
  border-radius: var(--radius-lg); padding: 28px 32px; color: #fff;
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.ai-hero::after {
  content: '🧠'; position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  font-size: 72px; opacity: 0.12;
}
.ai-hero h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.ai-hero p { font-size: 14px; opacity: 0.85; line-height: 1.6; max-width: 600px; }
.ai-hero .ai-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  background: rgba(255,255,255,0.15); border-radius: 20px; font-size: 12px; margin-top: 12px;
}
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.ai-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: var(--transition);
}
.ai-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.ai-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ai-card-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.ai-card-title { font-size: 15px; font-weight: 700; }
.ai-card-sub { font-size: 12px; color: var(--text-light); }
.ai-insight {
  padding: 10px 14px; background: rgba(45,125,70,0.06); border-radius: var(--radius);
  font-size: 13px; line-height: 1.6; margin-bottom: 8px; border-left: 3px solid var(--primary);
}
.ai-insight.warning { background: rgba(243,156,18,0.08); border-left-color: var(--warning); }
.ai-insight.danger { background: rgba(231,76,60,0.06); border-left-color: var(--danger); }
.ai-insight.info { background: rgba(52,152,219,0.06); border-left-color: var(--info); }
.ai-insight .tag { margin-right: 6px; }
.ai-recommend-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.ai-recommend-item:last-child { border-bottom: none; }
.ai-recommend-rank {
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ai-chat-box {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.ai-chat-messages { max-height: 280px; overflow-y: auto; margin-bottom: 16px; }
.ai-chat-msg {
  margin-bottom: 12px; display: flex; gap: 10px;
}
.ai-chat-msg .avatar {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.ai-chat-msg.user .avatar { background: var(--primary); color: #fff; }
.ai-chat-msg.ai .avatar { background: var(--bg); }
.ai-chat-msg .bubble {
  padding: 10px 14px; border-radius: var(--radius); font-size: 13px; line-height: 1.6; max-width: 80%;
}
.ai-chat-msg.user .bubble { background: var(--primary); color: #fff; }
.ai-chat-msg.ai .bubble { background: var(--bg); }
.ai-chat-input { display: flex; gap: 8px; }
.ai-chat-input input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; outline: none;
}
.ai-chat-input input:focus { border-color: var(--primary); }
.ai-quick-asks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ai-quick-ask {
  padding: 6px 12px; background: rgba(45,125,70,0.08); border: 1px solid rgba(45,125,70,0.2);
  border-radius: 20px; font-size: 12px; color: var(--primary); cursor: pointer; transition: var(--transition);
}
.ai-quick-ask:hover { background: var(--primary); color: #fff; }
.ai-evolution { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.ai-evo-item { text-align: center; padding: 16px 12px; background: var(--bg); border-radius: var(--radius); }
.ai-evo-item .evo-icon { font-size: 28px; margin-bottom: 8px; }
.ai-evo-item .evo-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.ai-evo-item .evo-desc { font-size: 11px; color: var(--text-light); line-height: 1.5; }

.evo-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.evo-metric { background: var(--bg); border-radius: var(--radius); padding: 16px 20px; text-align: center; }
.evo-metric .em-num { font-size: 28px; font-weight: 700; line-height: 1.2; }
.evo-metric .em-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.evo-metric .em-trend { font-size: 11px; margin-top: 4px; }
.evo-log-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.evo-log-entry { border-bottom: 1px solid var(--border); }
.evo-log-entry:last-child { border-bottom: none; }
.evo-log-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background 0.15s; }
.evo-log-header:hover { background: rgba(45,125,70,0.04); }
.evo-log-date { font-size: 12px; color: var(--text-light); white-space: nowrap; min-width: 90px; }
.evo-log-type { font-size: 11px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.evo-log-title { font-size: 13px; flex: 1; font-weight: 500; }
.evo-log-impact { font-size: 12px; font-weight: 600; white-space: nowrap; }
.evo-log-detail { display: none; padding: 0 16px 16px 118px; font-size: 13px; color: var(--text-light); line-height: 1.8; }
.evo-log-entry.expanded .evo-log-detail { display: block; }
.evo-log-entry.expanded .evo-log-header { background: rgba(45,125,70,0.06); }
.evo-next-plan { background: linear-gradient(135deg, rgba(45,125,70,0.06), rgba(232,168,56,0.06)); border-radius: var(--radius); padding: 16px 20px; margin-top: 16px; }
.evo-next-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 13px; }
.evo-next-item .en-status { font-size: 11px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.incoming-call-popup { position: fixed; top: 80px; right: 24px; width: 360px; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); z-index: 9999; border: 1px solid var(--border); animation: slideIn 0.3s ease; }
@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.call-popup-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--primary); border-radius: 12px 12px 0 0; color: #fff; }
.call-popup-body { padding: 16px; }
.call-popup-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.call-popup-row:last-child { border-bottom: none; }
.call-popup-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.call-pulse { width: 12px; height: 12px; border-radius: 50%; background: #27AE60; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(39,174,96,0.4); } 70% { box-shadow: 0 0 0 10px rgba(39,174,96,0); } 100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); } }

/* ===== 手机模拟器 ===== */
.mobile-preview-wrap { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
.mobile-info { flex: 1; min-width: 300px; }
.mobile-info h3 { font-size: 18px; margin-bottom: 8px; }
.mobile-info p { font-size: 14px; color: var(--text-light); line-height: 1.8; margin-bottom: 12px; }
.mobile-feature-list { list-style: none; padding: 0; }
.mobile-feature-list li { padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.mobile-feature-list li:last-child { border-bottom: none; }
.mobile-feature-list .feat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.phone-frame {
  width: 375px; height: 720px; background: #1a1a1a; border-radius: 40px; padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; flex-shrink: 0;
}
.phone-screen { width: 100%; height: 100%; background: var(--bg); border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone-statusbar { height: 36px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.phone-statusbar .status-right { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.phone-navbar { height: 44px; background: #fff; display: flex; align-items: center; justify-content: center; position: relative; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.phone-navbar .nav-title { font-size: 15px; font-weight: 600; }
.phone-navbar .nav-capsule { position: absolute; right: 12px; width: 60px; height: 28px; border: 1px solid var(--border); border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.phone-navbar .nav-capsule::before { content: ''; width: 14px; height: 14px; border: 1.5px solid #666; border-radius: 50%; }
.phone-navbar .nav-capsule::after { content: ''; width: 1.5px; height: 12px; background: #ccc; }
.phone-body { flex: 1; overflow-y: auto; background: var(--bg); }
.phone-tabbar { height: 56px; background: #fff; border-top: 1px solid var(--border); display: flex; flex-shrink: 0; }
.phone-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: var(--text-light); cursor: pointer; transition: color 0.2s; }
.phone-tab .tab-icon { font-size: 20px; }
.phone-tab.active { color: var(--primary); }
/* 小程序页面内容 */
.mini-page { display: none; padding: 12px; }
.mini-page.active { display: block; }
.mini-greeting { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.mini-subgreeting { font-size: 12px; color: var(--text-light); margin-bottom: 12px; }
.mini-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-stat-card { background: #fff; border-radius: 10px; padding: 10px 8px; text-align: center; }
.mini-stat-card .num { font-size: 20px; font-weight: 700; }
.mini-stat-card .label { font-size: 10px; color: var(--text-light); margin-top: 2px; }
.mini-section-title { font-size: 14px; font-weight: 600; margin: 12px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.mini-section-title .more { font-size: 11px; color: var(--primary); font-weight: 400; }
.mini-reminder { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: flex-start; gap: 8px; }
.mini-reminder .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.mini-reminder .content { flex: 1; }
.mini-reminder .title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.mini-reminder .desc { font-size: 11px; color: var(--text-light); }
.mini-quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.mini-quick-btn { background: #fff; border-radius: 10px; padding: 12px 4px; text-align: center; cursor: pointer; }
.mini-quick-btn .icon { font-size: 24px; margin-bottom: 4px; }
.mini-quick-btn .text { font-size: 10px; color: var(--text-light); }
.mini-search { background: #fff; border-radius: 20px; padding: 8px 14px; display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.mini-search input { border: none; outline: none; flex: 1; font-size: 13px; background: transparent; }
.mini-filter-row { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.mini-filter-chip { padding: 4px 12px; border-radius: 14px; font-size: 11px; white-space: nowrap; background: #fff; color: var(--text-light); cursor: pointer; }
.mini-filter-chip.active { background: var(--primary); color: #fff; }
.mini-cust-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.mini-cust-card .top-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-cust-card .name { font-size: 13px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-cust-card .tags { display: flex; gap: 4px; margin-bottom: 6px; }
.mini-cust-card .tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.mini-cust-card .bottom-row { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-light); }
.mini-cust-card .call-btn { width: 28px; height: 28px; border-radius: 50%; background: rgba(39,174,96,0.1); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }
.mini-stage-bar { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.mini-stage-chip { padding: 4px 8px; border-radius: 6px; font-size: 10px; white-space: nowrap; }
.mini-opportunity-card { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; border-left: 3px solid; }
.mini-opportunity-card .opp-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.mini-opportunity-card .opp-info { font-size: 11px; color: var(--text-light); display: flex; gap: 8px; }
.mini-profile-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 12px; padding: 16px; color: #fff; margin-bottom: 12px; }

/* ===== 统一页面统计栏 ===== */
.page-stats-bar { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 160px; background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 16px 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card .stat-icon {
  position: absolute; top: 12px; right: 16px; font-size: 28px; opacity: 0.15;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat-card .stat-change { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }
.stat-card .stat-change.neutral { color: var(--text-light); }
.stat-card.blue .stat-value { color: var(--info); }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.orange .stat-value { color: var(--warning); }
.stat-card.red .stat-value { color: var(--danger); }
.stat-card.purple .stat-value { color: #8b5cf6; }

/* ===== 统一页面工具栏 ===== */
.page-toolbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
  flex-wrap: wrap; gap: 12px;
}
.page-toolbar .toolbar-info { font-size: 14px; color: var(--text-light); }
.page-toolbar .toolbar-info strong { color: var(--text); font-size: 16px; margin: 0 2px; }
.page-toolbar .toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== 统一筛选下拉 ===== */
.filter-select {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card); color: var(--text); cursor: pointer;
  transition: var(--transition); outline: none;
}
.filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,125,70,0.1); }
.filter-input {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card); color: var(--text); outline: none;
  transition: var(--transition);
}
.filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,125,70,0.1); }

/* ===== 统一Tab切换 ===== */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.tab-item {
  padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text-light);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition);
}
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== 增强表格 ===== */
.table.enhanced thead th {
  background: var(--bg); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-light); font-weight: 600;
  padding: 10px 14px; border-bottom: 2px solid var(--border);
}
.table.enhanced tbody tr { transition: var(--transition); }
.table.enhanced tbody tr:hover { background: rgba(45,125,70,0.03); }

/* 表格横向滚动美化 */
.table-scroll-wrapper { border-radius: var(--radius); }
.table-scroll-wrapper::-webkit-scrollbar { height: 12px; }
.table-scroll-wrapper::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 6px; border: 1px solid #e0e0e0; }
.table-scroll-wrapper::-webkit-scrollbar-thumb { background: #b8c0c8; border-radius: 6px; border: 2px solid #f0f0f0; }
.table-scroll-wrapper::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.table-scroll-wrapper::-webkit-scrollbar-corner { background: transparent; }
/* Firefox */
.table-scroll-wrapper { scrollbar-width: thin; scrollbar-color: #b8c0c8 #f0f0f0; }

/* 客户管理：让内部滚动容器自己控制横向滚动 */
#page-customers.active { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
#customerListView { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.page-customers .card, #page-customers .card { overflow: hidden; padding: 0; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.page-customers .table-scroll-wrapper, #page-customers .table-scroll-wrapper { padding: 16px 16px 10px; flex: 1; overflow: auto; min-height: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.page-customers .pagination { padding: 10px 16px 12px; border-top: 1px solid var(--border); }

/* 合同管理页面布局 */
#page-contracts.active { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.contract-top-panel { transition: max-height .28s ease, opacity .2s ease, margin .28s ease; overflow: hidden; max-height: 320px; opacity: 1; }
.contract-top-panel.collapsed { max-height: 0; opacity: 0; margin-bottom: 0 !important; }
.contract-top-panel.collapsed .contract-stats-row,
.contract-top-panel.collapsed .page-toolbar { display: none; }
.contract-top-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); padding: 8px 14px; margin-bottom: 10px; }
.contract-top-summary .contract-sum-text { font-size: 13px; color: var(--text-light); }
.contract-top-summary .contract-sum-text b { color: var(--text); margin-right: 12px; }
.contract-stats-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 10px; }
.contract-stats-row .stat-card { min-width: 0; padding: 12px 14px; }
.contract-stats-row .stat-label { font-size: 12px; margin-bottom: 2px; }
.contract-stats-row .stat-value { font-size: 20px; line-height: 1.2; }
.contract-stats-row .stat-change { font-size: 11px; margin-top: 2px; }
.contract-time-btns { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.contract-time-btns .btn-sm { padding: 4px 10px; border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--radius); cursor: pointer; font-size: 13px; color: var(--text-light); }
.contract-time-btns .btn-sm.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.contract-date-range { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.contract-date-range input[type="date"] {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--text); background: var(--bg-card); outline: none;
  transition: var(--transition); cursor: pointer;
}
.contract-date-range input[type="date"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,125,70,0.1); }
.contract-date-sep { font-size: 13px; color: var(--text-light); }
.contract-toggle-btn { background: var(--bg-main); border: 1px solid var(--border); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-light); transition: all .2s; }
.contract-toggle-btn:hover { background: rgba(45,125,70,0.08); border-color: var(--primary); color: var(--primary); }
/* 按产品筛选卡片 */
.product-filter-card { padding: 0 !important; overflow: hidden; }
.product-filter-head { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.product-filter-head .stat-label { font-size: 12px; margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-filter-head .stat-change { font-size: 11px; margin-top: 0; }
.product-select-wrap { position: relative; width: 100%; }
.product-select-wrap select {
  width: 100%; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 7px 28px 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text); font-size: 13px; cursor: pointer; outline: none;
  transition: var(--transition); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-select-wrap select:hover { border-color: var(--primary); }
.product-select-wrap select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,125,70,0.1); }
.product-select-arrow {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--text-light); pointer-events: none; transition: var(--transition);
}
.product-select-wrap select:focus + .product-select-arrow { border-top-color: var(--primary); }
/* 合同合计栏 */
.contract-summary-bar { display: flex; align-items: center; gap: 16px; padding: 5px 12px; background: var(--bg-main); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.contract-summary-bar .contract-sum-item { color: var(--text-light); }
.contract-summary-bar .contract-sum-item.amount-red { color: #dc2626; font-weight: 600; }
.contract-summary-bar .contract-sum-item.amount-green { color: #16a34a; font-weight: 600; }
/* 合同表格表头筛选 */
#contractTable th { position: relative; }
#contractTable .th-checkbox { text-align: center; padding: 0; vertical-align: middle; width: 24px; min-width: 24px; }
#contractTable .th-checkbox input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }
#contractTable .th-text { vertical-align: middle; }
#contractTable .th-filter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 4px; border: none; background: transparent;
  color: var(--text-light); cursor: pointer; border-radius: 4px; vertical-align: middle;
  transition: all .2s; padding: 0;
}
#contractTable .th-filter-btn:hover, #contractTable .th-filter-btn.active { background: rgba(45,125,70,0.1); color: var(--primary); }
#contractTable th.filter-active .th-text { color: var(--primary); font-weight: 700; }
#contractTable th.filter-active .th-filter-btn { color: var(--primary); background: rgba(45,125,70,0.1); }
/* 合同表格行高更紧凑 */
#contractTable tbody td { padding: 8px 12px; }
#contractTable thead th { padding: 8px 12px; }
#contractTableBody td:first-child { text-align: center; padding: 0; }
#contractTableBody .contract-row-checkbox { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }
#contractTableBody tr.selected td { background: rgba(45,125,70,0.08); }
/* 列筛选下拉面板 */
.contract-col-filter-dropdown {
  position: fixed; z-index: 10000; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 180px; max-width: 280px;
  display: flex; flex-direction: column; max-height: 360px; overflow: hidden;
}
.contract-col-filter-dropdown .filter-dlg-head {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.contract-col-filter-dropdown .filter-dlg-head button {
  border: none; background: transparent; color: var(--text-light); cursor: pointer; font-size: 12px;
}
.contract-col-filter-dropdown .filter-dlg-head button:hover { color: var(--primary); }
.contract-col-filter-dropdown .filter-dlg-search {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.contract-col-filter-dropdown .filter-dlg-search input {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; outline: none;
}
.contract-col-filter-dropdown .filter-dlg-search input:focus { border-color: var(--primary); }
.contract-col-filter-dropdown .filter-dlg-list {
  flex: 1; overflow-y: auto; padding: 6px 0; font-size: 13px;
}
.contract-col-filter-dropdown .filter-dlg-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contract-col-filter-dropdown .filter-dlg-item:hover { background: rgba(45,125,70,0.06); }
.contract-col-filter-dropdown .filter-dlg-item input { width: 14px; height: 14px; accent-color: var(--primary); flex-shrink: 0; }
.contract-col-filter-dropdown .filter-dlg-item span { overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.contract-col-filter-dropdown .filter-dlg-empty { padding: 16px 12px; text-align: center; color: var(--text-light); font-size: 13px; }
.contract-col-filter-dropdown .filter-dlg-foot {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); justify-content: flex-end;
}
/* 合同页工具栏与表格间距加大 */
#page-contracts .page-toolbar { margin-bottom: 8px; }
#contractTableBody tr.contract-row { cursor: pointer; transition: background .12s; }
#contractTableBody tr.contract-row:hover { background: rgba(45,125,70,0.04); }

/* 合同详情弹窗 */
.contract-detail-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.contract-detail-dialog { background: #fff; border-radius: 16px; width: 1100px; max-width: 96vw; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.contract-dlg-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--border); background: #f8fafc; border-radius: 16px 16px 0 0; }
.contract-dlg-header h3 { margin: 0; font-size: 20px; font-weight: 700; color: #1f2937; }
.contract-dlg-subtitle { margin-top: 6px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #4b5563; }
.contract-dlg-subtitle code { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; color: #64748b; }
.contract-dlg-tag { padding: 2px 8px; border-radius: 10px; font-weight: 600; font-size: 12px; }
.contract-dlg-close { background: #fff; border: 1px solid var(--border); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 16px; transition: all .2s; }
.contract-dlg-close:hover { background: #f1f5f9; color: #1f2937; border-color: #cbd5e1; }
.contract-dlg-body { padding: 22px 24px 24px; overflow-y: auto; flex: 1; }
.contract-dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contract-dlg-section { background: #f8fafc; border-radius: 12px; padding: 0; border: 1px solid #e2e8f0; overflow: hidden; }
.contract-dlg-section h4 { font-size: 14px; color: var(--primary); margin: 0; padding: 11px 16px; background: rgba(45,125,70,0.08); border-bottom: 1px solid #e2e8f0; font-weight: 700; }
.contract-dlg-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.contract-dlg-table th { background: #f1f5f9; padding: 10px 14px; text-align: left; font-weight: 700; color: #374151; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.contract-dlg-table td { padding: 10px 14px; border-top: 1px solid #f1f5f9; color: #1f2937; }
.contract-dlg-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.contract-dlg-table tr.sum td { background: #f1f5f9; font-weight: 700; color: #1f2937; border-top: 1px solid #e2e8f0; }
.contract-dlg-kv { display: grid; grid-template-columns: 84px 1fr; gap: 10px 14px; padding: 14px 16px; font-size: 14px; }
.contract-dlg-kv .k { color: #64748b; }
.contract-dlg-kv .v { color: #1f2937; word-break: break-all; }
.contract-dlg-empty { padding: 28px 16px; text-align: center; color: #94a3b8; font-size: 14px; }
.contract-dlg-remark { margin-top: 18px; padding: 14px 16px; background: #fffbeb; border-left: 4px solid #f59e0b; border-radius: 8px; font-size: 14px; color: #78350f; line-height: 1.6; }
@media (max-width: 1200px) {
  .contract-stats-row { grid-template-columns: repeat(4, 1fr); }
  .contract-dlg-grid { grid-template-columns: 1fr; }
  .contract-summary-bar { gap: 16px; font-size: 12px; }
}
@media (max-width: 992px) {
  .contract-summary-bar { flex-wrap: wrap; gap: 8px 16px; }
}

/* 列设置面板 */
.col-settings-wrap { position: relative; }
.col-settings-panel {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 12px; min-width: 180px; max-height: 360px; overflow-y: auto;
}
.col-settings-panel label {
  display: flex; align-items: center; gap: 8px; padding: 5px 0;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.col-settings-panel input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
/* 隐藏列 */
.cust-col-hidden { display: none !important; }

/* 搜索框内嵌图标 */
.search-input-wrap { position: relative; display: inline-flex; align-items: center; }
.search-input-wrap .search-icon {
  position: absolute; left: 8px; color: var(--text-light); pointer-events: none; z-index: 1;
}
.search-input-wrap .search-with-icon { padding-left: 28px; }

/* 更多筛选面板 */
.more-filter-wrap { position: relative; display: inline-block; }
.more-filters-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 12px; min-width: 200px; display: flex; flex-direction: column; gap: 10px;
}
.more-filters-panel .more-filter-item {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-light);
}
.more-filters-panel .more-filter-item select { width: 100%; }

/* 更多操作面板 */
.more-action-wrap { position: relative; display: inline-block; }
.more-actions-panel {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 4px; min-width: 140px; display: flex; flex-direction: column;
}
.more-actions-panel .more-action-item {
  border: none; background: transparent; text-align: left; padding: 8px 12px;
  font-size: 13px; cursor: pointer; border-radius: var(--radius); color: var(--text);
}
.more-actions-panel .more-action-item:hover { background: var(--bg-hover); }

/* 表头内联筛选 */
.th-filter-cell { padding: 0 !important; }
.th-filter-wrap { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 6px; }
.th-filter-select {
  -webkit-appearance: none; appearance: none;
  border: none; background: transparent; font-size: 11px; color: var(--text-light);
  cursor: pointer; padding: 0 14px 0 0; margin: 0; line-height: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
  background-size: 8px auto; min-width: 18px; width: 18px; height: 18px;
  outline: none; transition: var(--transition);
}
.th-filter-select:hover { color: var(--primary); transform: scale(1.1); }
.th-filter-select option { font-size: 13px; color: var(--text-main); background: #fff; }
.th-filter-select:invalid { color: #999; }
.table.resizable th.th-resizable { position: relative; border-right: 3px solid #d0d5dd; }
.table.resizable th.th-resizable::after {
  content: ''; position: absolute; right: -5px; top: 0; bottom: 0;
  width: 10px; cursor: ew-resize; z-index: 1;
}
.table.resizable th.th-resizable:hover { border-right-color: var(--primary); }
.table.resizable th.th-resizable.resizing { border-right-color: var(--primary); background: rgba(45,125,70,0.04); }

/* 内联等级下拉框 */
.inline-level-select {
  -webkit-appearance: auto; appearance: auto;
  cursor: pointer; outline: none;
  transition: var(--transition);
}
.inline-level-select:hover { transform: scale(1.05); }

/* ===== 状态标签增强 ===== */
.status-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
}
.status-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-tag.success { background: rgba(39,174,96,0.1); color: var(--success); }
.status-tag.success::before { background: var(--success); }
.status-tag.warning { background: rgba(243,156,18,0.1); color: var(--warning); }
.status-tag.warning::before { background: var(--warning); }
.status-tag.danger { background: rgba(231,76,60,0.1); color: var(--danger); }
.status-tag.danger::before { background: var(--danger); }
.status-tag.info { background: rgba(52,152,219,0.1); color: var(--info); }
.status-tag.info::before { background: var(--info); }
.status-tag.neutral { background: rgba(127,140,155,0.1); color: var(--text-light); }
.status-tag.neutral::before { background: var(--text-light); }
.status-tag.primary { background: rgba(45,125,70,0.1); color: var(--primary); }
.status-tag.primary::before { background: var(--primary); }
.status-tag.purple { background: rgba(139,92,246,0.1); color: #8b5cf6; }
.status-tag.purple::before { background: #8b5cf6; }

/* ===== 进度条 ===== */
.progress-bar { width: 100%; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.progress-bar .fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.progress-bar .fill.green { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.progress-bar .fill.blue { background: linear-gradient(90deg, #3498db, #5dade2); }
.progress-bar .fill.orange { background: linear-gradient(90deg, #f39c12, #f5b041); }
.progress-bar .fill.red { background: linear-gradient(90deg, #e74c3c, #ec7063); }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-light); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state .title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-state .desc { font-size: 13px; }
.empty-state-cell { padding: 0 !important; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state .empty-text { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-state .empty-hint { font-size: 13px; }

/* ===== 商机看板增强 ===== */
.pipeline-columns { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; min-height: 400px; }
.pipeline-column {
  flex: 0 0 260px; background: var(--bg); border-radius: var(--radius-lg);
  padding: 12px; display: flex; flex-direction: column;
}
.pipeline-column-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 2px solid;
}
.pipeline-column-header .col-name { font-size: 13px; font-weight: 600; }
.pipeline-column-header .col-count {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.6);
}
.pipeline-column-header .col-amount { font-size: 11px; color: var(--text-light); }
.pipeline-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 12px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm); border-left: 3px solid; cursor: pointer; transition: var(--transition);
}
.pipeline-card:hover { box-shadow: var(--shadow-md); transform: translateX(2px); }
.pipeline-card .pc-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pipeline-card .pc-amount { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.pipeline-card .pc-meta { font-size: 11px; color: var(--text-light); display: flex; justify-content: space-between; }
.pipeline-card .pc-badge {
  font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600;
}

/* ===== 快捷操作按钮 ===== */
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.quick-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: var(--radius); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: var(--transition); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
}
.quick-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(45,125,70,0.04); }
.quick-btn .icon { font-size: 16px; }

/* ===== 线索卡片增强 ===== */
.lead-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px 20px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: var(--transition); display: flex; align-items: center; gap: 16px;
}
.lead-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.lead-card .lead-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
}
.lead-card .lead-info { flex: 1; min-width: 0; }
.lead-card .lead-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.lead-card .lead-meta { font-size: 12px; color: var(--text-light); display: flex; gap: 12px; flex-wrap: wrap; }
.lead-card .lead-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== 详情弹窗增强 ===== */
.detail-modal-header {
  display: flex; align-items: center; gap: 12px; padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-modal-header .avatar {
  width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.detail-modal-header .info h3 { font-size: 18px; font-weight: 700; }
.detail-modal-header .info .sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* ===== 时间线 ===== */
.timeline { padding: 16px 0; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 20px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 15px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-item .tl-dot {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; flex-shrink: 0; z-index: 1;
}
.timeline-item .tl-content { flex: 1; padding-top: 2px; }
.timeline-item .tl-title { font-size: 14px; font-weight: 600; }
.timeline-item .tl-desc { font-size: 13px; color: var(--text-light); margin-top: 4px; line-height: 1.6; }
.timeline-item .tl-time { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===== 响应式补充 ===== */
@media (max-width: 768px) {
  .page-stats-bar { flex-direction: column; }
  .stat-card { min-width: 100%; }
  .pipeline-column { flex: 0 0 240px; }
}
.mini-profile-header .avatar { width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 8px; }
.mini-profile-header .name { font-size: 16px; font-weight: 600; }
.mini-profile-header .role { font-size: 12px; opacity: 0.8; }
.mini-perf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-perf-card { background: #fff; border-radius: 10px; padding: 12px; text-align: center; }
.mini-perf-card .num { font-size: 18px; font-weight: 700; }
.mini-perf-card .label { font-size: 10px; color: var(--text-light); }
.mini-menu-list { background: #fff; border-radius: 10px; overflow: hidden; }
.mini-menu-item { padding: 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mini-menu-item:last-child { border-bottom: none; }
.mini-menu-item .icon { font-size: 18px; }
.mini-menu-item .arrow { margin-left: auto; color: var(--text-light); font-size: 12px; }

/* ===== 产品中心 ===== */
.product-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.product-search { flex: 1; min-width: 240px; padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.product-search:focus { outline: none; border-color: var(--primary); }
.product-series-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.product-series-tab { padding: 8px 16px; border-radius: 20px; font-size: 13px; cursor: pointer; border: 1px solid var(--border); background: #fff; transition: all .2s; white-space: nowrap; }
.product-series-tab:hover { border-color: var(--primary); color: var(--primary); }
.product-series-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.product-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.series-card { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); cursor: pointer; transition: all .2s; position: relative; overflow: hidden; }
.series-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(45,125,70,0.12); transform: translateY(-2px); }
.series-card .series-icon { font-size: 36px; margin-bottom: 10px; }
.series-card .series-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.series-card .series-desc { font-size: 12px; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }
.series-card .series-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.series-card .series-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg); color: var(--text-light); }
.series-card .series-badge { position: absolute; top: 16px; right: 16px; background: var(--bg); padding: 2px 10px; border-radius: 12px; font-size: 12px; color: var(--text-light); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.product-card { background: #fff; border-radius: var(--radius); padding: 18px; border: 1px solid var(--border); cursor: pointer; transition: all .2s; }
.product-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(45,125,70,0.1); }
.product-card .pc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.product-card .pc-name { font-size: 15px; font-weight: 700; }
.product-card .pc-model { font-size: 12px; color: var(--primary); background: rgba(45,125,70,0.08); padding: 2px 8px; border-radius: 10px; }
.product-card .pc-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.product-card .pc-spec { font-size: 12px; }
.product-card .pc-spec .lbl { color: var(--text-light); }
.product-card .pc-spec .val { font-weight: 600; }
.product-card .pc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.product-card .pc-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg); color: var(--text-light); }
.product-card .pc-compare { position: absolute; top: 12px; right: 12px; }

.product-compare-bar { position: sticky; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); padding: 12px 20px; display: flex; align-items: center; gap: 12px; box-shadow: 0 -2px 8px rgba(0,0,0,0.06); z-index: 50; }
.product-compare-bar .compare-items { display: flex; gap: 8px; flex: 1; }
.product-compare-bar .compare-chip { display: flex; align-items: center; gap: 6px; background: var(--bg); padding: 6px 12px; border-radius: 16px; font-size: 13px; }
.product-compare-bar .compare-chip .remove { cursor: pointer; color: var(--danger); font-weight: 700; }

.scenario-lookup { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.scenario-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.scenario-tab { padding: 8px 16px; border-radius: var(--radius); cursor: pointer; font-size: 13px; border: 1px solid var(--border); }
.scenario-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 12px; }
.scenario-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--bg); align-items: center; }
.scenario-item .si-need { font-size: 13px; font-weight: 600; min-width: 140px; }
.scenario-item .si-products { display: flex; gap: 6px; flex-wrap: wrap; }
.scenario-item .si-product { font-size: 12px; padding: 3px 10px; border-radius: 10px; background: rgba(45,125,70,0.1); color: var(--primary); cursor: pointer; }
.scenario-item .si-product:hover { background: var(--primary); color: #fff; }

.product-file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.product-file-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; transition: all .2s; }
.product-file-item:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(45,125,70,0.08); }
.product-file-item .pf-icon { font-size: 28px; }
.product-file-item .pf-info { flex: 1; min-width: 0; }
.product-file-item .pf-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-file-item .pf-meta { font-size: 11px; color: var(--text-light); }
.product-file-item .pf-actions { display: flex; gap: 6px; }

.compare-modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare-modal-table th { background: var(--bg); padding: 10px 12px; text-align: left; font-weight: 600; position: sticky; top: 0; }
.compare-modal-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.compare-modal-table tr:hover td { background: rgba(45,125,70,0.03); }
.compare-modal-table .spec-row td:first-child { font-weight: 600; color: var(--text-light); white-space: nowrap; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-brand h2, .nav-item span, .nav-section, .sidebar-footer span { display: none; }
  .nav-item { padding: 12px; justify-content: center; }
  .main-content { margin-left: 60px; }
  .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-section-row { grid-template-columns: 1fr; }
  .lead-discovery-layout { grid-template-columns: 1fr; }
  .pipeline-view { flex-wrap: wrap; }
  .pipeline-col { min-width: 180px; }
}
