/* =============================================================
   锦云狐AI智能外呼系统 - 全新现代化设计
   视觉升级：渐变配色 + 玻璃拟态 + 流畅动画
   ============================================================= */

/* === 变量定义 === */
:root {
  /* 主色调 - 现代渐变红 */
  --red: #E53935;
  --red-dark: #C62828;
  --red-light: #FFEBEE;
  --red-glow: rgba(229, 57, 53, 0.25);
  --red-gradient: linear-gradient(135deg, #E53935 0%, #C62828 100%);
  --red-gradient-light: linear-gradient(135deg, #FF5252 0%, #E53935 100%);
  
  /* 白色系 */
  --white: #FFFFFF;
  --bg: #F8FAFC;
  --bg-page: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.85);
  
  /* 文字色 */
  --text: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  /* 边框 */
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  
  /* 阴影 - 多层次 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(229, 57, 53, 0.15);
  
  /* 圆角 */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* 布局 */
  --sidebar-w: 240px;
  --topbar-h: 64px;
  
  /* 辅助色 */
  --green: #10B981;
  --green-light: #D1FAE5;
  --yellow: #F59E0B;
  --yellow-light: #FEF3C7;
  --blue: #3B82F6;
  --blue-light: #DBEAFE;
  --orange: #F97316;
  --orange-light: #FFEDD5;
  --purple: #8B5CF6;
  --purple-light: #EDE9FE;
  --cyan: #06B6D4;
  --cyan-light: #CFFAFE;
  
  /* 玻璃拟态 */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  
  /* 动画 */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === 重置 === */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* === 滚动条 - 现代样式 === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* === 选中文字样式 === */
::selection { background: rgba(229, 57, 53, 0.2); color: var(--text); }

/* === 焦点样式 === */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* =============================================================
   整体布局
   ============================================================= */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* 背景装饰 */
.app-container::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 100%;
  background: radial-gradient(ellipse, rgba(229, 57, 53, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* =============================================================
   顶部导航栏 - 玻璃拟态
   ============================================================= */
.topbar {
  height: var(--topbar-h);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: calc(var(--sidebar-w) - 24px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--red-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
  transition: transform var(--transition-bounce), box-shadow var(--transition-base);
}

.logo:hover .logo-icon {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 6px 16px rgba(229, 57, 53, 0.4);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text .name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

.logo-text .sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #CBD5E1;
  position: relative;
}

.status-dot.online { 
  background: var(--green);
  animation: pulse-dot 2s infinite;
}
.status-dot.offline { background: #CBD5E1; }
.status-dot.error { background: var(--red); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

.topbar-center {
  flex: 1;
  max-width: 400px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0 16px;
  height: 40px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.global-search:focus-within {
  border-color: var(--red);
  background: var(--white);
  box-shadow: var(--shadow), 0 0 0 3px var(--red-glow);
}

.global-search i { color: var(--text-muted); font-size: 14px; transition: color var(--transition-fast); }
.global-search:focus-within i { color: var(--red); }

.global-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
}

.global-search input::placeholder { color: var(--text-muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all var(--transition-base);
  position: relative;
  background: var(--bg);
  border: 1px solid transparent;
}

.topbar-btn:hover {
  background: var(--white);
  color: var(--red);
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: var(--red-gradient);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(229, 57, 53, 0.3);
  animation: badge-pop 0.3s var(--transition-bounce);
}

@keyframes badge-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 28px;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg);
  border: 1px solid transparent;
}

.user-info:hover {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--red-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-muted); }

/* =============================================================
   通知面板 - 玻璃拟态
   ============================================================= */
.notif-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 24px;
  width: 360px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
  animation: slideDown 0.25s var(--transition-bounce);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-panel.show { display: block; }

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
}

.text-btn {
  font-size: 12px;
  color: var(--red);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.text-btn:hover { 
  color: var(--white);
  background: var(--red);
}

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(229, 57, 53, 0.03); }

.notif-item i { 
  font-size: 18px; 
  margin-top: 1px; 
  flex-shrink: 0; 
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-item i.success { color: var(--green); background: var(--green-light); }
.notif-item i.warning { color: var(--orange); background: var(--orange-light); }
.notif-item i.danger { color: var(--red); background: var(--red-light); }
.notif-item i.info { color: var(--blue); background: var(--blue-light); }

.notif-content { flex: 1; }
.notif-content p { font-size: 13px; color: var(--text); line-height: 1.5; }
.notif-content span { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.notif-item.unread .notif-content p { font-weight: 600; }
.notif-item.unread::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 16px;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
}

/* =============================================================
   主体区域
   ============================================================= */
.body-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* =============================================================
   侧边栏 - 现代设计
   ============================================================= */
.sidebar {
  width: var(--sidebar-w);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.main-nav { padding: 20px 12px; flex: 1; }

.nav-section { margin-bottom: 8px; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 12px 16px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-radius: 10px;
  transition: all var(--transition-base);
  position: relative;
  cursor: pointer;
  margin: 2px 0;
}

.nav-item i { 
  font-size: 16px; 
  width: 20px; 
  text-align: center; 
  flex-shrink: 0; 
  transition: transform var(--transition-base);
}

.nav-item:hover { 
  color: var(--text);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.nav-item:hover i { transform: scale(1.1); }

.nav-item.active {
  color: var(--red);
  background: var(--white);
  font-weight: 600;
  box-shadow: var(--shadow), 0 0 0 1px rgba(229, 57, 53, 0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--red-gradient);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

.nav-item.active i { color: var(--red); }

.nav-badge {
  margin-left: auto;
  background: var(--red-gradient);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(229, 57, 53, 0.3);
}

/* =============================================================
   主内容区
   ============================================================= */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  position: relative;
}

.page {
  display: none;
  padding: 24px;
  min-height: 100%;
  animation: fadeIn 0.3s ease;
}

.page.active { 
  display: block; 
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   页面头部
   ============================================================= */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.page-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =============================================================
   统计卡片 - 现代渐变风格
   ============================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(229, 57, 53, 0.2);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:nth-child(2)::before { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.stat-card:nth-child(3)::before { background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%); }
.stat-card:nth-child(4)::before { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }
.stat-card:nth-child(5)::before { background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%); }
.stat-card:nth-child(6)::before { background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-bounce);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-5deg);
}

.stat-info { flex: 1; min-width: 0; }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.stat-trend {
  font-size: 11px;
  margin-top: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
}

.stat-trend.up { color: var(--green); background: var(--green-light); }
.stat-trend.down { color: var(--red); background: var(--red-light); }
.stat-trend.neutral { color: var(--text-muted); background: var(--bg); }

/* =============================================================
   卡片容器 - 玻璃拟态
   ============================================================= */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i { 
  color: var(--white);
  font-size: 14px;
  background: var(--red-gradient);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.25);
}

.card-body { padding: 20px; }

/* =============================================================
   图表区域
   ============================================================= */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 20px;
}

.charts-row .card { 
  height: 300px; 
  display: flex; 
  flex-direction: column; 
}

.charts-row .card-body { 
  padding: 16px; 
  flex: 1; 
  position: relative; 
  overflow: hidden;
}

/* 通话拨号界面 */
.call-dial-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}
.call-dial-panel {
  width: 480px;
  max-height: 90vh;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  animation: slideUp 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.call-dial-header {
  background: linear-gradient(135deg, #D32F2F, #B71C1C);
  color: white;
  padding: 28px 24px 20px;
  text-align: center;
  position: relative;
}
.call-dial-status {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 4px;
}
.call-dial-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}
.call-dial-phone {
  font-size: 14px;
  font-family: monospace;
  opacity: 0.85;
}
.call-dial-timer {
  font-size: 36px;
  font-weight: 300;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-top: 10px;
  letter-spacing: 2px;
}
.call-dial-body {
  padding: 20px 24px;
  max-height: 50vh;
  overflow-y: auto;
}
.call-dial-wave {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: 16px;
  background: #FAFAFA;
  border-radius: 12px;
  padding: 4px 8px;
}
.call-dial-wave .bar {
  width: 4px;
  border-radius: 2px;
  background: #D32F2F;
  transition: height 0.15s ease;
}
.call-dial-transcript {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.call-dial-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}
.call-dial-msg.ai {
  background: #E3F2FD;
  color: #1565C0;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.call-dial-msg.customer {
  background: #F5F5F5;
  color: #333;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.call-dial-msg .msg-label {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
  opacity: 0.7;
}
.call-dial-footer {
  padding: 16px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid #F0F0F0;
}
.call-dial-hangup {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #D32F2F;
  color: white;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(211,47,47,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.call-dial-hangup:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(211,47,47,0.5);
}
.call-dial-mute {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #F5F5F5;
  color: #666;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.call-dial-mute:hover { background: #E0E0E0; }
.call-dial-mute.active { background: #D32F2F; color: white; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }

.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 16px;
}

.funnel-label {
  width: 100px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}

.funnel-bar-wrap {
  flex: 1;
  height: 32px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 50px;
  position: relative;
  overflow: hidden;
}

.funnel-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

.funnel-bar.l1 { background: linear-gradient(90deg, #E53935 0%, #FF5252 100%); box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3); }
.funnel-bar.l2 { background: linear-gradient(90deg, #F57C00 0%, #FF9800 100%); box-shadow: 0 4px 12px rgba(245, 124, 0, 0.3); }
.funnel-bar.l3 { background: linear-gradient(90deg, #3B82F6 0%, #1E88E5 100%); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.funnel-bar.l4 { background: linear-gradient(90deg, #8B5CF6 0%, #9C27B0 100%); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.funnel-bar.l5 { background: linear-gradient(90deg, #10B981 0%, #43A047 100%); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }

/* =============================================================
   按钮 - 现代风格
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-primary {
  background: var(--red-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(229, 57, 53, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: white;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =============================================================
   表格 - 现代风格
   ============================================================= */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
  transition: background var(--transition-fast);
}

tbody tr { transition: all var(--transition-fast); }
tbody tr:hover td { 
  background: rgba(229, 57, 53, 0.02); 
}
tbody tr:last-child td { border-bottom: none; }

/* 斑马纹 */
tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.5);
}
tbody tr:nth-child(even):hover td {
  background: rgba(229, 57, 53, 0.03);
}

/* =============================================================
   表单 - 现代风格
   ============================================================= */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2399' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* =============================================================
   标签/徽章 - 现代风格
   ============================================================= */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tag-red { background: var(--red-light); color: var(--red); }
.tag-red:hover { background: var(--red); color: white; }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-green:hover { background: var(--green); color: white; }
.tag-yellow { background: var(--yellow-light); color: var(--yellow); }
.tag-yellow:hover { background: var(--yellow); color: white; }
.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-blue:hover { background: var(--blue); color: white; }
.tag-gray { background: var(--bg); color: var(--text-secondary); }
.tag-gray:hover { background: var(--text-muted); color: white; }

/* =============================================================
   状态指示器
   ============================================================= */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.running { background: var(--green-light); color: var(--green); }
.status-badge.running .dot { background: var(--green); animation: pulse 1.5s infinite; }
.status-badge.completed { background: var(--blue-light); color: var(--blue); }
.status-badge.completed .dot { background: var(--blue); }
.status-badge.paused { background: var(--yellow-light); color: var(--yellow); }
.status-badge.paused .dot { background: var(--yellow); }
.status-badge.failed { background: var(--red-light); color: var(--red); }
.status-badge.failed .dot { background: var(--red); }
.status-badge.pending { background: var(--bg); color: var(--text-secondary); }
.status-badge.pending .dot { background: var(--text-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* =============================================================
   进度条
   ============================================================= */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--red-gradient);
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.progress-fill.green { background: linear-gradient(90deg, #10B981 0%, #34D399 100%); }
.progress-fill.blue { background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%); }

/* =============================================================
   标签页 - 现代风格
   ============================================================= */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.tab-item {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.tab-item:hover { color: var(--text); background: var(--white); }
.tab-item.active { 
  color: var(--white); 
  background: var(--red-gradient);
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

/* =============================================================
   模态框 - 玻璃拟态
   ============================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-lg { max-width: 720px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #FAFAFA 0%, #F5F5F5 100%);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--red-gradient);
  border-radius: 2px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  transition: all var(--transition-fast);
}

.modal-close:hover { 
  background: var(--red-light); 
  color: var(--red);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* =============================================================
   列表项
   ============================================================= */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
  cursor: pointer;
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg); }

.list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--red-light);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* =============================================================
   空状态 - 现代风格
   ============================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--text-muted);
  text-align: center;
  position: relative;
}

.empty-state::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--bg);
  border-radius: 50%;
  z-index: 0;
}

.empty-state i { 
  font-size: 48px; 
  margin-bottom: 16px; 
  opacity: 0.5;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--transition-base);
}

.empty-state:hover i {
  opacity: 0.7;
  transform: scale(1.1);
  color: var(--red);
}

.empty-state p { 
  font-size: 14px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.empty-state small {
  font-size: 12px;
  margin-top: 6px;
  opacity: 0.7;
}

/* =============================================================
   工具栏 - 现代风格
   ============================================================= */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 16px;
  height: 38px;
  flex: 1;
  max-width: 280px;
  transition: all var(--transition-fast);
}

.toolbar-search:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.toolbar-search i { color: var(--text-muted); font-size: 14px; }

.toolbar-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
}

.toolbar-search input::placeholder { color: var(--text-muted); }

/* =============================================================
   选择框 - 现代风格
   ============================================================= */
.select-control {
  height: 38px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all var(--transition-fast);
}

.select-control:focus { 
  outline: none; 
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

/* =============================================================
   分割线
   ============================================================= */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* =============================================================
   漏斗图
   ============================================================= */
.funnel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* =============================================================
   话术卡片 - 现代风格
   ============================================================= */
.script-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.script-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.script-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.script-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(229, 57, 53, 0.2);
  transform: translateY(-4px);
}

.script-card:hover::before {
  opacity: 1;
}

.script-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.script-card-title { 
  font-size: 15px; 
  font-weight: 700; 
  color: var(--text);
  padding-right: 10px;
}

.script-card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.script-card-meta span { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
}

.script-card-meta i { 
  width: 16px; 
  color: var(--text-muted); 
  transition: color var(--transition-fast);
}

.script-card:hover .script-card-meta i {
  color: var(--red);
}

.script-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* =============================================================
   设置页
   ============================================================= */
.settings-section {
  margin-bottom: 32px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-title i { color: var(--red); }

/* =============================================================
   客户管理全选下拉菜单
   ============================================================= */
.customer-name-header {
  position: relative;
  transition: color 0.2s ease;
}

.customer-name-header:hover {
  color: var(--red);
}

.select-dropdown {
  position: relative;
  display: inline-block;
}

.select-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  min-width: 160px;
  padding: 4px 0;
  animation: dropdownFadeIn 0.2s ease;
}

.select-dropdown:hover .select-dropdown-menu,
.select-dropdown-menu.show {
  display: block;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--red);
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  color: var(--text-muted);
}

.dropdown-item:hover i {
  color: var(--red);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* 当有选中项时高亮checkbox */
.select-dropdown input:checked + .select-dropdown-menu {
  display: block;
}

/* =============================================================
   任务详情页面 - 通话波形动画
   ============================================================= */
@keyframes wave {
  from {
    transform: scaleY(0.3);
  }
  to {
    transform: scaleY(1);
  }
}

.waveform div {
  animation: wave 0.5s ease-in-out infinite alternate;
}

.call-in-progress {
  animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 任务详情页面返回按钮 */
#page-tasks .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

#page-tasks .btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--red);
  color: var(--red);
}

#page-tasks .btn-outline:hover i {
  transform: translateX(-3px);
}

#page-tasks .btn-outline i {
  transition: transform 0.2s ease;
}

/* =============================================================
   已完成任务卡片样式
   ============================================================= */
.task-card-clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.task-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.task-card-clickable:hover .task-card-title {
  color: #D32F2F;
}

.progress-done {
  background: linear-gradient(90deg, #4CAF50 0%, #2E7D32 100%) !important;
}

/* 通话记录表格样式 */
#taskCallRecords table tbody tr:hover {
  cursor: pointer;
}

#taskCallRecords table tbody tr td {
  vertical-align: middle;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.settings-item:last-child { border-bottom: none; }

.settings-item-info { flex: 1; }
.settings-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.settings-item-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* =============================================================
   多页面设置导航卡片
   ============================================================= */
.settings-nav-card {
  background: var(--white);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.settings-nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--red-light);
}

.settings-nav-card:hover .settings-nav-icon {
  transform: scale(1.1);
}

.settings-nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-nav-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.settings-nav-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* =============================================================
   设置详情页面
   ============================================================= */
.settings-detail-page {
  animation: fadeSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-header {
  margin-bottom: 0;
}

.detail-header .card {
  animation: fadeSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 返回按钮增强 */
.detail-header .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.detail-header .btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--red);
  color: var(--red);
  transform: translateX(-4px);
}

/* =============================================================
   开关 - 现代风格
   ============================================================= */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: all var(--transition-bounce);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.toggle input:checked + .toggle-slider { 
  background: var(--red-gradient);
  box-shadow: 0 0 0 2px var(--red-glow);
}
.toggle input:checked + .toggle-slider::before { 
  transform: translateX(20px);
}

/* =============================================================
   任务管理 - 现代风格
   ============================================================= */
.task-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--red-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.task-card:hover { 
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.task-card:hover::before {
  opacity: 1;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.task-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.task-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.task-card-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 14px;
}

.task-stat { display: flex; flex-direction: column; }
.task-stat-val { font-size: 20px; font-weight: 800; color: var(--text); }
.task-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.task-actions { display: flex; gap: 8px; }

/* =============================================================
   通话管理 - 现代风格
   ============================================================= */
.call-record {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.call-record:hover {
  background: rgba(229, 57, 53, 0.02);
}

.call-record:last-child { border-bottom: none; }

.call-avatar {
  width: 44px;
  height: 44px;
  background: var(--red-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.25);
}

.call-info { flex: 1; min-width: 0; }
.call-name { font-size: 14px; font-weight: 700; color: var(--text); }
.call-phone { font-size: 13px; color: var(--text-muted); margin-top: 2px; font-family: 'SF Mono', Monaco, monospace; letter-spacing: 1px; }
.call-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* =============================================================
   漏斗 - 现代风格
   ============================================================= */
.funnel-container {
  /* replaced by funnel-trapezoid */
}

/* =============================================================
   AI 摘要展示 - 现代风格
   ============================================================= */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.summary-label { 
  font-size: 11px; 
  color: var(--text-muted); 
  text-transform: uppercase; 
  letter-spacing: 0.8px;
  font-weight: 600;
}

.summary-value { 
  font-size: 16px; 
  font-weight: 700; 
  color: var(--text); 
}

/* =============================================================
   对话气泡 - 现代风格
   ============================================================= */
.transcript-list { 
  display: flex; 
  flex-direction: column; 
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.transcript-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  animation: bubbleIn 0.3s ease;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.transcript-item.ai { align-self: flex-start; max-width: 80%; }
.transcript-item.customer { align-self: flex-end; max-width: 80%; flex-direction: row-reverse; }

.transcript-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  margin-top: 2px;
}

.transcript-item.ai .transcript-avatar { 
  background: var(--red-gradient); 
  color: white;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.25);
}
.transcript-item.customer .transcript-avatar { 
  background: var(--bg); 
  color: var(--text-secondary); 
  border: 1px solid var(--border);
}

.transcript-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.6;
  color: var(--text);
}

.transcript-item.ai .transcript-bubble {
  background: var(--bg);
  border-bottom-left-radius: 4px;
}

.transcript-item.customer .transcript-bubble {
  background: var(--red-gradient);
  border-bottom-right-radius: 4px;
  color: white;
}

/* =============================================================
   实时通话模拟 - 现代风格
   ============================================================= */
.live-call-banner {
  background: var(--red-gradient);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  display: none;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(229, 57, 53, 0.35);
}

.live-call-banner.active { display: flex; }

.live-call-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: bannerShimmer 3s infinite;
}

@keyframes bannerShimmer {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(50%); }
}

.live-call-info { flex: 1; position: relative; z-index: 1; }
.live-call-name { font-size: 16px; font-weight: 700; }
.live-call-phone { font-size: 13px; opacity: 0.85; margin-top: 4px; font-family: monospace; letter-spacing: 1px; }

.live-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  position: relative;
  z-index: 1;
}

.wave-bar {
  width: 5px;
  background: rgba(255,255,255,0.8);
  border-radius: 3px;
  animation: waveAnim 0.8s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; }
.wave-bar:nth-child(5) { animation-delay: 0.25s; }

@keyframes waveAnim {
  0%, 100% { height: 8px; opacity: 0.6; }
  50% { height: 32px; opacity: 1; }
}

.live-call-time {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

/* =============================================================
   呼出按钮 - 现代风格
   ============================================================= */
.call-out-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-bounce);
  box-shadow: 0 6px 20px rgba(229, 57, 53, 0.4);
  position: relative;
  overflow: hidden;
}

.call-out-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.call-out-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(229, 57, 53, 0.5);
}

.call-out-btn:hover::before {
  width: 100%;
  height: 100%;
}

.call-out-btn:active { 
  transform: scale(0.95); 
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

/* =============================================================
   快捷方式
   ============================================================= */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-action {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 160px;
  box-shadow: var(--shadow);
}

.quick-action:hover {
  border-color: var(--red);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-action i {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.qa-red { background: var(--red-light); color: var(--red); }
.qa-green { background: #E8F5E9; color: var(--green); }
.qa-blue { background: #E3F2FD; color: var(--blue); }
.qa-yellow { background: #FFF8E1; color: var(--yellow); }

.quick-action-text { font-size: 13px; font-weight: 700; color: var(--text); }
.quick-action-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* =============================================================
   快捷操作按钮（新样式）- 现代渐变
   ============================================================= */
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow);
  min-height: 90px;
  position: relative;
  overflow: hidden;
}

.quick-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  pointer-events: none;
}

.quick-btn i {
  font-size: 28px;
  margin-bottom: 8px;
  transition: transform var(--transition-bounce);
}

.quick-btn:hover i {
  transform: scale(1.2) rotate(-5deg);
}

.quick-btn span {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.quick-btn small {
  font-size: 11px;
  opacity: 0.85;
}

.quick-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.quick-btn:active {
  transform: scale(0.97);
}

/* =============================================================
   动画
   ============================================================= */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.fade-in-fast {
  animation: fadeInFast 0.15s ease;
}

@keyframes fadeInFast {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =============================================================
   Toast 通知 - 现代玻璃拟态
   ============================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  font-size: 13px;
  border: 1px solid var(--glass-border);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
}

.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.warning { border-left: 4px solid var(--yellow); }
.toast.info { border-left: 4px solid var(--blue); }

.toast i { 
  font-size: 18px; 
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast.success i { color: var(--green); background: var(--green-light); }
.toast.error i { color: var(--red); background: var(--red-light); }
.toast.warning i { color: var(--yellow); background: var(--yellow-light); }
.toast.info i { color: var(--blue); background: var(--blue-light); }

.toast-message { flex: 1; }
.toast-title { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.toast-desc { font-size: 12px; color: var(--text-muted); }

.toast-close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--bg);
  color: var(--text);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px) scale(0.9); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

@keyframes slideDown {
  from { height: 0; opacity: 0; }
  to { height: auto; opacity: 1; }
}

#liveCallPanel {
  display: none;
  background: var(--red-gradient);
  color: white;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

#liveCallPanel::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer-banner 3s infinite;
}

@keyframes shimmer-banner {
  from { transform: translateX(-50%); }
  to { transform: translateX(50%); }
}

/* =============================================================
   数据导入区 - 现代风格
   ============================================================= */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-muted);
  background: var(--bg);
  position: relative;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px dashed transparent;
  border-radius: var(--radius);
  transition: border-color var(--transition-base);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
}

.drop-zone:hover::before {
  border-color: rgba(229, 57, 53, 0.3);
}

.drop-zone i {
  font-size: 48px;
  margin-bottom: 16px;
  transition: transform var(--transition-bounce);
}

.drop-zone:hover i {
  transform: scale(1.1) translateY(-4px);
}

.drop-zone i { font-size: 32px; margin-bottom: 8px; display: block; }
.drop-zone p { font-size: 13px; }
.drop-zone small { font-size: 11px; }

/* =============================================================
   响应式
   ============================================================= */
@media (max-width: 1200px) {
  .charts-row { grid-template-columns: 1fr; }
  .funnel-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar-center { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .modal { margin: 16px; }
}

/* =============================================================
   用户下拉菜单 - 现代风格
   ============================================================= */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
}
.user-menu:hover { background: var(--bg); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.user-dropdown.show { display: block; }
.dropdown-item {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
}
.dropdown-item:hover { 
  background: var(--red-light);
  color: var(--red);
}
.dropdown-item:hover i { color: var(--red); }
.dropdown-item i { width: 16px; color: var(--text-muted); transition: color var(--transition-fast); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* =============================================================
   用户管理页面
   ============================================================= */
.user-list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #F0F0F0;
  gap: 12px;
}
.user-list-item:last-child { border-bottom: none; }
.user-avatar-lg {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.user-info-block { flex: 1; min-width: 0; }
.user-info-block .name { font-weight: 600; font-size: 14px; }
.user-info-block .meta { font-size: 12px; color: var(--text-muted); }
.badge-role {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.badge-role.admin { background: #FFEBEE; color: #D32F2F; }
.badge-role.user { background: #E3F2FD; color: #1565C0; }
