﻿/* ============================================
   出海行 CRM - 全局样式
   ============================================ */

/* CSS 变量 - 白色主题（默认）—— 天蓝色系 */
:root {
  --bg-primary: #f5f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f4fa;
  --bg-hover: #e8eef6;
  --bg-active: #e0f2fe;
  --border-color: #e0e6ee;
  --border-light: #eceff4;
  --text-primary: #1f2329;
  --text-secondary: #5c6370;
  --text-muted: #6b7280;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-light: rgba(14, 165, 233, 0.12);
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --info: #0ea5e9;
  --bg-card: #ffffff;
  /* 天蓝色系全色阶（sky 50-900） */
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-200: #bae6fd;
  --sky-300: #7dd3fc;
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;
  --sky-600: #0284c7;
  --sky-700: #0369a1;
  --sky-800: #075985;
  --sky-900: #0c4a6e;
  --coral: #e8596b;
  --coral-light: rgba(232, 89, 107, 0.12);
  --success: #16a34a;
  --success-light: rgba(22, 163, 74, 0.08);
  --warning: #d97706;
  --warning-light: rgba(217, 119, 6, 0.08);
  --danger: #dc2626;
  --danger-light: rgba(220, 38, 38, 0.08);
  --purple: #9333ea;
  --purple-light: rgba(147, 51, 234, 0.08);
  --teal: #0ea5e9;
  --teal-light: rgba(14, 165, 233, 0.12);
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --transition: 0.2s ease;
  /* 间距系统 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  /* 字体比例尺 */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
}

/* 暗色主题（天蓝色系） */
[data-theme="dark"] {
  --bg-primary: #0f1620;
  --bg-secondary: #16202c;
  --bg-tertiary: #1e2c3c;
  --bg-hover: #253750;
  --bg-active: #0c4a6e;
  --border-color: #2a3a4e;
  --border-light: #1e2a38;
  --text-primary: #e4e8ee;
  --text-secondary: #9aa7b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-light: rgba(56, 189, 248, 0.15);
  --coral: #e8596b;
  --coral-light: rgba(232, 89, 107, 0.15);
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  --purple: #a855f7;
  --purple-light: rgba(168, 85, 247, 0.1);
  --teal: #38bdf8;
  --teal-light: rgba(56, 189, 248, 0.15);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   布局
   ============================================ */
#app {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* 主区域：宽度自适应 — flex 自动分配剩余空间 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition);
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-toggle {
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
}

.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-toggle svg { width: 20px; height: 20px; }

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

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.user-name { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* 注：.main-content 已在上面定义，此处不重复 */

/* 顶部栏 */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }

.menu-toggle { display: none; color: var(--text-secondary); padding: 4px; }
.menu-toggle svg { width: 24px; height: 24px; }

.page-title { 
  font-size: 20px; 
  font-weight: 700; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  min-width: 0;
}

.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-sm);
  width: 240px;
  outline: none;
  transition: all var(--transition);
}

.search-box input:focus { border-color: var(--accent); width: 300px; }
.search-box input::placeholder { color: var(--text-muted); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }

.btn-ghost { color: var(--text-secondary); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-icon { padding: 6px; }

/* 页面内容区 */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================
   通用组件
   ============================================ */

/* 卡片 */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title { font-size: 16px; font-weight: 600; }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: all var(--transition);
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.stat-info { display: flex; flex-direction: column; }

.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

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

.stat-icon.blue { background: var(--accent-light); color: var(--accent); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.teal { background: var(--teal-light); color: var(--teal); }

/* 表格 */
.table-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 分页控件 */
.table-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
}
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pg-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.pg-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.pg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pg-info {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
}

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

.filter-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-tertiary); }

/* 标签/徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray { background: var(--bg-hover); color: var(--text-secondary); }

/* 管道/看板 */
.pipeline-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: calc(100vh - 200px);
}

.pipeline-column {
  min-width: 280px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.pipeline-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-column-title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-column-count {
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pipeline-column-value {
  font-size: 12px;
  color: var(--text-muted);
}

.pipeline-column-body {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
}

.pipeline-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.pipeline-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }

.pipeline-card-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.pipeline-card-info { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pipeline-card-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); }

/* 进度条 */
.progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* 服务进度时间线 */
.service-stages {
  display: flex;
  align-items: center;
  margin: 20px 0;
  overflow-x: auto;
  padding: 10px 0;
}

.service-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  position: relative;
}

.service-stage-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  z-index: 2;
  position: relative;
}

.service-stage-dot.done { background: var(--success); color: #fff; }
.service-stage-dot.current { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-light); }
.service-stage-dot.pending { background: var(--bg-hover); color: var(--text-muted); }

.service-stage-line {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.service-stage-line.done { background: var(--success); }
.service-stage:last-child .service-stage-line { display: none; }

.service-stage-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

.service-stage-label.done { color: var(--success); font-weight: 500; }
.service-stage-label.current { color: var(--accent); font-weight: 600; }

/* 模态框 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 18px; font-weight: 700; }

.modal-close {
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--accent); }

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

.form-select { cursor: pointer; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease;
  min-width: 250px;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-text { font-size: 15px; }
.empty-state-hint { font-size: 13px; margin-top: 6px; }

/* 网格布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* 两栏布局 */
.content-row { display: flex; gap: 24px; align-items: flex-start; }
.content-col { flex: 1; }
.content-col-wide { flex: 2; }

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.list-item:hover { background: var(--bg-tertiary); }
.list-item:last-child { border-bottom: none; }

.list-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 500; font-size: 14px; }
.list-item-desc { font-size: 13px; color: var(--text-secondary); }
.list-item-meta { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* 优先级标识 */
.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.priority-dot.high { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low { background: var(--text-muted); }

/* 头像 */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-bg-1 { background: #4a9eff; color: #fff; }
.avatar-bg-2 { background: #22c55e; color: #fff; }
.avatar-bg-3 { background: #f59e0b; color: #fff; }
.avatar-bg-4 { background: #a855f7; color: #fff; }
.avatar-bg-5 { background: #ef4444; color: #fff; }

/* 操作按钮组 */
.action-btns { display: flex; gap: 4px; }
.action-btn {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.action-btn:hover { background: var(--accent-light); color: var(--accent); }
.action-btn.danger { color: var(--danger); background: var(--danger-light); }
.action-btn.danger:hover { background: var(--danger); color: #fff; }
.action-btn.warn { color: var(--warning); background: var(--warning-light); }
.action-btn.warn:hover { background: var(--warning); color: #fff; }
.action-btn.success { color: var(--success); background: var(--success-light); }
.action-btn.success:hover { background: var(--success); color: #fff; }

/* 切换开关样式 */
.toggle-switch input:checked + .toggle-slider { background: var(--primary, #0ea5e9) !important; }

/* === 用户菜单（顶部导航） === */
.user-menu-wrap {
  position: relative;
  margin-left: 8px;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 6px 10px 6px 6px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.user-menu-btn:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.topbar-avatar {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.topbar-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
}

.user-menu-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
}

#dropdownPosition {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

#dropdownLevel {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#dropdownLevel:empty,
#dropdownLevel:contains('—') {
  display: none;
}

.user-menu-divider {
  height: 1px;
  background: var(--border-color);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  transition: background var(--transition);
  font-family: inherit;
  text-align: left;
}

.user-menu-item:hover { background: var(--bg-hover); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: var(--danger-light); }

/* 工作台 V12 */
.workbench { padding: 0; }

.wb-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.wb-title { font-size: 20px; font-weight: 700; margin: 0 0 4px 0; }
.wb-subtitle { font-size: 13px; color: var(--text-muted); margin: 0; }

.wb-period-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 4px;
}

.btn-period {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-period.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-period:hover:not(.active) { color: var(--text-primary); background: var(--bg-hover); }

.wb-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.wb-stat-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}
.wb-stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.wb-content-row { display: flex; flex-direction: column; gap: 14px; max-width: 100%; }

/* 默认：CSS 多列瀑布流，卡片顺着列紧密自适应排列，不按行强行对齐、不留大块空白 */
.wb-panels {
  column-count: 2;
  column-gap: 12px;
  max-width: 100%;
}
.wb-panels > * {
  width: 100%;
  display: block;
  margin: 0 0 12px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}
.wb-panels > *:empty { display: none; margin: 0; }

/* 需要固定列宽比例/等分时仍使用 grid，不参与瀑布流 */
.wb-panels-wide,
.wb-panels-2-1,
.wb-panels-1-1,
.wb-panels-3 {
  display: grid;
  column-count: initial;
  column-gap: 0;
  gap: 16px;
}
.wb-panels-wide { grid-template-columns: 1fr; }
.wb-panels-2-1 { grid-template-columns: 2fr 1fr; }
.wb-panels-1-1 { grid-template-columns: 1fr 1fr; }
.wb-panels-3 { grid-template-columns: repeat(3, 1fr); }
.wb-panels-wide > *,
.wb-panels-2-1 > *,
.wb-panels-1-1 > *,
.wb-panels-3 > * { min-width: 0; margin-bottom: 0; break-inside: auto; }

.wb-panel { padding: 12px 14px; height: auto; }
.wb-panel .card-header { margin-bottom: 12px; }

/* 首页 widget 容器自然高度，不再强行填满造成空白 */
#policyWidget,
#suggestionWidget { height: auto; }
#policyWidget > div,
#suggestionWidget > div { height: auto; box-sizing: border-box; }

/* 业绩榜单 */
.pr-table { width: 100%; border-collapse: collapse; }
.pr-table th,
.pr-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.pr-table th { font-weight: 600; color: var(--text-secondary); background: var(--bg-tertiary); }
.pr-table td { color: var(--text-primary); vertical-align: middle; }
.pr-table tr:last-child td { border-bottom: none; }
.pr-rank { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.pr-rank.gold { background: #fef3c7; color: #92400e; }
.pr-rank.silver { background: #e5e7eb; color: #4b5563; }
.pr-rank.bronze { background: #fed7aa; color: #9a3412; }
.pr-rank.normal { background: var(--bg-tertiary); color: var(--text-muted); }
.pr-amount { font-weight: 600; color: var(--primary); }
.pr-deal { font-size: 12px; color: var(--text-muted); }

/* 防止 3 列布局在窄屏时过于拥挤 */
@media (max-width: 1300px) {
  .wb-panels {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

/* 响应式：窄屏单列 */
@media (max-width: 900px) {
  .wb-panels-2-1,
  .wb-panels-1-1,
  .wb-panels-3 { grid-template-columns: 1fr; }
}

.card-period {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
}

/* 排行榜 */
.lb-list { display: flex; flex-direction: column; gap: 4px; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}
.lb-row:hover { background: var(--bg-tertiary); }
.lb-row.top { background: linear-gradient(135deg, var(--bg-tertiary), rgba(255,215,0,0.08)); }

.lb-rank {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.lb-name {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  min-width: 0;
}

.lb-value {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}

/* 积分排行榜动画 */
@keyframes rankUp {
  0% { transform: translateY(8px); opacity: 0.5; }
  60% { transform: translateY(-4px); }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes rankDown {
  0% { transform: translateY(-8px); opacity: 0.5; }
  60% { transform: translateY(4px); }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes pointsPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--accent); }
  100% { transform: scale(1); }
}
.lb-row.points-up {
  animation: rankUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.lb-row.points-down {
  animation: rankDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.lb-row.points-changed .lb-points {
  animation: pointsPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.lb-row.new-entry {
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.lb-points {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  white-space: nowrap;
}
.lb-rank-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
}
.lb-rank-change.up { color: var(--success); background: var(--success-light, rgba(82,196,26,0.1)); }
.lb-rank-change.down { color: var(--danger); background: var(--danger-light, rgba(245,34,45,0.1)); }
.lb-rank-change.same { color: var(--text-muted); background: var(--bg-tertiary); }
.lb-level-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--accent-light, rgba(24,144,255,0.1));
  color: var(--accent);
  margin-left: 4px;
  font-weight: 600;
}

/* 销售管道 */
.pipeline-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pp-stage { }
.pp-stage-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.pp-stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.pp-stage-name { font-size: 13px; font-weight: 500; }
.pp-stage-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  font-weight: 600;
}
.pp-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.pp-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 时间线 */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 360px;
  overflow-y: auto;
}

.tl-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  position: relative;
}
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 24px;
  bottom: -4px;
  width: 2px;
  background: var(--border-color);
}
.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  flex-shrink: 0;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}
.tl-content { flex: 1; min-width: 0; }
.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.tl-event { font-weight: 600; font-size: 13px; }
.tl-time { font-size: 11px; color: var(--text-muted); }
.tl-detail { font-size: 12px; color: var(--text-secondary); }

/* ============================================
   响应式布局 — PC / PAD / 手机端
   ============================================ */

/* 侧边栏遮罩（PAD + 手机） */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* === PAD 竖屏 (768px ~ 1199px) === */
/* PC中屏/小屏笔记本(769~1199)：侧边栏保持常驻，仅自适应收窄，绝不切换成移动布局 */
@media (max-width: 1199px) and (min-width: 769px) {
  :root { --sidebar-width: 214px; }
  .sidebar { position: static; transform: none; box-shadow: none; }
  .sidebar-header { padding: 16px 14px; }
  .sidebar-nav { padding: 10px; }
  .nav-item { padding: 9px 12px; font-size: 13.5px; gap: 10px; }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 20px; }
  .page-title { font-size: 18px; }
  .pipeline-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    overflow: visible;
    min-height: auto;
  }
  .pipeline-column { min-width: 0; }
  .wb-panels { grid-template-columns: repeat(2, 1fr); }
  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .search-box input { width: 180px; }
  .search-box input:focus { width: 220px; }
}

/* 更窄的PC窗口(769~991)：侧边栏进一步收窄，仍是完整桌面布局，不出现底部移动导航 */
@media (max-width: 991px) and (min-width: 769px) {
  :root { --sidebar-width: 188px; }
  .sidebar-header { padding: 12px; }
  .logo { font-size: 15px; gap: 8px; }
  .logo-icon { font-size: 20px; }
  .sidebar-nav { padding: 8px; }
  .nav-item { padding: 8px 10px; font-size: 13px; gap: 8px; }
  .nav-icon { width: 18px; height: 18px; }
  .nav-more-summary { padding: 8px 10px; font-size: 13px; }
}

/* === 导航分组（通用，桌面展开/移动端折叠） === */
.nav-more-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.nav-more-summary::-webkit-details-marker { display: none; }
.nav-more-summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.2s;
}
.nav-more[open] .nav-more-summary::after { transform: rotate(180deg); }
.nav-more-count {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 8px;
  background: var(--accent-light, rgba(24,144,255,0.1));
  color: var(--accent);
  font-weight: 600;
}
.nav-more-items { padding-bottom: 4px; }

/* === 一级导航分组增强（v163 信息架构：顶部固定 + 6 组折叠） === */
.nav-group { border-top: 1px solid var(--border-light, rgba(0,0,0,.06)); margin-top: 6px; }
.nav-group:first-of-type { border-top: none; margin-top: 2px; }
.nav-group > .nav-more-summary {
  font-size: 12px; font-weight: 600; letter-spacing: .4px;
  color: var(--text-secondary); padding-top: 11px; padding-bottom: 9px;
  border-radius: var(--radius-sm);
}
.nav-group > .nav-more-summary:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-group .nav-more-items .nav-item { padding-left: 34px; font-size: 13px; gap: 10px; }
.nav-group .nav-more-items .nav-item .nav-icon { width: 17px; height: 17px; }
@media (max-width: 991px) and (min-width: 769px) {
  .nav-group .nav-more-items .nav-item { padding-left: 28px; }
}

/* === 手机端 (≤768px) === */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .menu-toggle { display: block; }
  .main-content { margin-left: 0; }
  .topbar { padding: 0 12px; height: 56px; }
  .page-content { padding: 12px; }
  .page-title { font-size: 16px; }
  .search-box input { width: 100px; font-size: 13px; padding: 6px 8px 6px 30px; }
  .search-box input:focus { width: 140px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content-row { flex-direction: column; }
  .role-switcher { padding: 10px 12px; }

  /* 业务板块：板块 Tab 换行 + 按钮自适应 */
  .bl-line-tabs .btn { flex: 1 1 100%; justify-content: center; }
  .bl-line-tabs { width: 100%; }

  /* 统计卡：按可用宽度自适应排列 */
  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

  /* 仪表盘：单列 */
  .wb-panels { grid-template-columns: 1fr; column-count: 1; }

  /* 管道：垂直单列滚动 */
  .pipeline-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    min-height: auto;
  }
  .pipeline-column { min-width: 0; flex-shrink: 1; }
  .pipeline-card { padding: 10px; }
  .pipeline-card-name { font-size: 13px; }

  /* 排行榜：紧凑 */
  .lb-row { padding: 8px 10px; }
  .lb-name { font-size: 13px; }
  .lb-value { font-size: 11px; white-space: normal; }

  /* 表格：水平滚动+紧凑 */
  table { font-size: 12px; }
  th, td { padding: 6px 8px !important; }
  .table-container { overflow-x: auto; }

  /* 按钮：紧凑 */
  .btn { font-size: 13px; padding: 6px 12px; }

  /* 触控区 ≥44px */
  .nav-item { min-height: 44px; padding: 12px 14px; }
  .action-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-sm { min-height: 34px; }
  .btn-sm { font-size: 12px; padding: 4px 8px; }

  /* 模态框：全屏 */
  .modal-overlay .modal {
    width: 95vw;
    max-height: 90vh;
    margin: 5vh auto;
  }
  .modal-body { padding: 12px; }
  .modal-footer { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }

  /* 统计卡 inline */
  .card { padding: 12px; }
  .card-header { margin-bottom: 8px; }

  /* 筛选器 */
  .filter-select { font-size: 12px; padding: 4px 8px; }
  .table-toolbar { flex-direction: column; gap: 8px; }
  .table-toolbar-left, .table-toolbar-right { width: 100%; flex-wrap: wrap; }
  .table-toolbar-right .btn { flex: 1; justify-content: center; }

  /* 管道筛选行 */
  #pipelineSalesFilter { max-width: 120px; }

  /* 业绩榜单表格 */
  .pr-table th, .pr-table td { padding: 6px 8px; font-size: 12px; }
  .pr-amount { font-size: 13px; }

  /* 政策卡片 */
  .policy-card { padding: 12px 14px; }
  .policy-card > div { flex-direction: column; }

  /* 隐藏部分次要操作 */
  .pipeline-board .btn-ghost { font-size: 10px !important; padding: 2px 6px !important; }
}

/* === 超小屏 (≤480px) === */
@media (max-width: 480px) {
  .topbar { height: 52px; padding: 0 8px; }
  .topbar-left { gap: 8px; }
  .topbar-right { gap: 6px; }
  .page-title { font-size: 14px; max-width: 90px; }
  .search-box input { width: 80px; padding: 5px 6px 5px 26px; }
  .search-box input:focus { width: 110px; }
  .search-icon { left: 8px; width: 14px; height: 14px; }
  .page-content { padding: 8px; }
  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stat-card { width: 100%; box-sizing: border-box; }
  .wb-panels { gap: 10px; }
  .card { padding: 10px; border-radius: 10px; }
  .topbar-name { display: none; }
  .topbar-avatar { margin-right: 0; }
  .btn { font-size: 12px; padding: 5px 10px; }
  .btn-sm { font-size: 11px; padding: 3px 6px; }
  .pipeline-card { padding: 8px; }
  .pipeline-card-name { font-size: 12px; }
  .pipeline-card-meta { font-size: 11px; }
}

/* === 桌面标准屏 (1200px ~ 1399px) ===
   优化宽屏布局，更多列，更宽内容区 */
@media (min-width: 1200px) {
  /* 统计卡：3~4列 */
  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  /* 面板：auto-fit 自动填满行 */
  .wb-panels { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
  /* 搜索框更宽 */
  .search-box input { width: 280px; }
  .search-box input:focus { width: 350px; }
  /* 大屏表单更宽松 */
  .page-content { padding: 28px 32px; }
  .topbar { padding: 0 28px; }
  /* 管道列宽适应 */
  .pipeline-column { min-width: 300px; }
  /* 业绩榜单大屏更宽松 */
  .pr-table td, .pr-table th { padding: 12px 16px; }
}

/* === 桌面大屏 (≥1400px) ===
   充分利用宽屏空间，4列主导布局 */
@media (min-width: 1400px) {
  .wb-stats { grid-template-columns: repeat(4, 1fr); }
  .wb-panels { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
  .page-content { padding: 32px 40px; }
  .topbar { padding: 0 32px; }
  .pipeline-column { min-width: 320px; }
  .pipeline-board { gap: 20px; }
  /* 排行榜更宽松 */
  .lb-row { padding: 12px 16px; }
  /* 表单双列默认舒展开 */
  .form-row { gap: 24px; }
}

/* === 超宽屏 (≥1800px) === */
@media (min-width: 1800px) {
  .wb-panels { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
  .page-content { padding: 36px 48px; }
}

/* ============================================
   V2 新增样式
   ============================================ */

/* 角色切换器 */
.role-switcher {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.role-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.role-select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  font-size: 13px;
}

.role-select:focus { border-color: var(--accent); }

.current-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.cu-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cu-role { font-size: 11px; color: var(--text-secondary); }

/* 提成金额标识 */
.commission-amount {
  font-weight: 700;
  color: var(--success);
}

.commission-amount.earned { color: var(--success); }
.commission-amount.pending { color: var(--text-muted); }

/* 提成阶段卡片 */
.commission-stage-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
}

.commission-stage-card.done {
  background: var(--success-light);
  border-color: var(--success);
}

.commission-stage-card.current {
  background: var(--accent-light);
  border-color: var(--accent);
}

.commission-stage-card:hover { border-color: var(--accent); }

.commission-stage-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid var(--border-color);
  transition: all var(--transition);
}

.commission-stage-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.commission-stage-check.current {
  border-color: var(--accent);
  color: var(--accent);
}

.commission-stage-info { flex: 1; }
.commission-stage-name { font-weight: 600; font-size: 14px; }
.commission-stage-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.commission-stage-amount { font-size: 16px; font-weight: 700; color: var(--success); white-space: nowrap; }
.commission-stage-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 知识库卡片 */
.knowledge-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  height: 100%;
}

.knowledge-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.knowledge-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.knowledge-card-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

/* 标签搜索 */
.tag-filter {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  margin: 2px;
}

.tag-filter:hover { border-color: var(--accent); color: var(--accent); }
.tag-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 搜索结果高亮 */
.search-highlight {
  background: var(--warning-light);
  color: var(--warning);
  padding: 0 2px;
  border-radius: 2px;
}

/* 分割标题 */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
}

.section-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.section-divider-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 信息块 */
.info-block {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.info-block-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-block-value {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

.info-block-value.analysis {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

/* 角色徽章 */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge.admin { background: var(--purple-light); color: var(--purple); }
.role-badge.ops { background: var(--warning-light); color: var(--warning); }
.role-badge.sales { background: var(--accent-light); color: var(--accent); }
.role-badge.copywriter { background: var(--success-light); color: var(--success); }
.role-badge.finance { background: var(--danger-light); color: var(--danger); }
.role-badge.hr { background: #dbeafe; color: #1d4ed8; }

/* 公海状态标识 */
.pool-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.pool-status-pool { background: var(--warning-light); color: var(--warning); }
.pool-status-assigned { background: var(--accent-light); color: var(--accent); }

/* 提成汇总条 */
.commission-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.commission-summary-item {
  text-align: center;
}

.commission-summary-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.commission-summary-value {
  font-size: 20px;
  font-weight: 700;
}

.commission-summary-value.earned { color: var(--success); }
.commission-summary-value.pending { color: var(--warning); }
.commission-summary-value.total { color: var(--text-primary); }

/* 客户权限模块 */
.perm-client-item {
  transition: background var(--transition);
}
.perm-client-item:hover { background: var(--bg-hover) !important; }
.perm-client-item.selected { background: var(--bg-active) !important; border-left: 3px solid var(--accent); }

/* ============================================
   V3 动效增强 — 丝滑过渡 & 可视化
   ============================================ */

/* --- 页面内容过渡 --- */
#pageContent {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 关键帧动画 --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%   { background-position: -300px 0; }
  100% { background-position: 300px 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* --- 按钮按压反馈 --- */
.btn:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}
.btn-icon:active {
  transform: scale(0.9);
}
.action-btn:active {
  transform: scale(0.92);
}

/* --- 卡片悬停增强 --- */
.card {
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

/* 统计卡片增强 */
.stat-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

/* 知识库卡片增强 */
.knowledge-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.knowledge-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* 管道卡片增强 */
.pipeline-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.pipeline-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* 列表项增强 */
.list-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.list-item:hover {
  background: var(--bg-tertiary);
  padding-left: 20px;
}

/* --- 导航指示器动画 --- */
.nav-item {
  position: relative;
}
.nav-item::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 22px;
  background: var(--accent);
  border-radius: 6px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item.active::after {
  transform: translateY(-50%) scaleY(1);
}
.nav-item:not(.active):hover::after {
  transform: translateY(-50%) scaleY(0.4);
}

/* --- 骨架屏 --- */
.skeleton-wrap {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.skeleton-card-sk {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}
.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 6px;
  margin-bottom: 10px;
  width: 100%;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.short  { width: 50%; }
.skeleton-line.medium { width: 75%; }
.skeleton-line.long   { width: 100%; }
.skeleton-line.lg { height: 28px; margin-bottom: 16px; }
.skeleton-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.skeleton-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  height: 84px;
}

/* --- 加载旋转器 --- */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* --- 模态框入场动画增强 --- */
.modal {
  animation: scaleIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Toast 入场动画增强 --- */
.toast {
  animation: slideRight 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 表单焦点环 --- */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* --- 表格行悬停动画 --- */
tr td {
  transition: background 0.15s ease;
}
tr:hover td {
  background: var(--bg-active);
}

/* --- 仪表盘快捷入口增强 --- */
.stats-grid [style*="background:var(--bg-tertiary)"] {
  transition: all 0.25s ease;
}
[onclick*="Router.navigate"] {
  cursor: pointer;
}

/* --- 主题切换过渡 --- */
.theme-toggle:active {
  transform: rotate(30deg) scale(0.9);
  transition: transform 0.2s ease;
}

/* --- 搜索框增强 --- */
.search-box input {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-box input:focus {
  width: 300px;
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* --- 下拉选择器增强 --- */
.filter-select:focus,
.role-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* --- 进度条填充动画 --- */
@keyframes fillProgress {
  from { width: 0 !important; }
}
.progress-bar-fill.animate-fill {
  animation: fillProgress 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* --- 提成阶段卡片增强 --- */
.commission-stage-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.commission-stage-card:hover {
  transform: translateX(4px);
  border-color: var(--accent);
}

/* --- 用户菜单过渡 --- */
.user-menu-dropdown {
  animation: scaleIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top right;
}

/* --- 初始加载覆盖层 --- */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  padding: 80px 20px;
}
.page-loading-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* --- 数字跳动辅助（JS驱动） --- */
.stat-value.animated {
  transition: none;
}

/* ============================================
   业绩管理 & 公告系统
   ============================================ */

/* 开单公告 Banner */
.announce-banner {
  animation: fadeInUp 0.5s ease both;
  cursor: default;
}
.announce-banner.deal-banner {
  position: relative;
  overflow: hidden;
}
.announce-banner.deal-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 3s ease infinite;
}

/* 每日目标提醒 */
.daily-reminder {
  animation: fadeInUp 0.5s ease 0.1s both;
}

/* ============================================
   达标庆祝弹窗（全屏覆盖）
   ============================================ */
.achievement-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
  cursor: pointer;
}

.achievement-popup {
  background: #fff;
  border-radius: 24px;
  padding: 48px 56px;
  text-align: center;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.achievement-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: pulse 1.5s ease infinite;
}

.achievement-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.achievement-name {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.achievement-detail {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.achievement-time {
  font-size: 12px;
  color:#6b7280;
}

/* 纸屑粒子 */
.achievement-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  top: -10px;
  animation: confettiFall linear both;
  opacity: 0;
}

@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(500px) rotate(720deg); }
}

/* ============================================
   奖金制度表格样式
   ============================================ */
.bonus-tier-row {
  transition: background 0.2s ease;
  padding: 4px;
  border-radius: 6px;
}
.bonus-tier-row:hover {
  background: var(--bg-tertiary);
}

/* 业绩目标进度卡片 */
.target-progress-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.target-progress-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}


/* 客户信息收集二维码按钮 */
.btn-client-form {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-light);
}
.btn-client-form:hover {
  background: var(--accent);
  color: #fff;
}

/* 客户详情折叠面板 */
.accordion-panel { border: 1px solid var(--border-color); border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden; }
.accordion-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-tertiary); cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.accordion-header:hover { background: var(--bg-hover); }
.accordion-arrow { width: 14px; height: 14px; transition: transform .2s ease; color: var(--text-muted); }
.accordion-arrow.open { transform: rotate(180deg); }
.accordion-body { padding: 12px 14px; display: none; }
.accordion-body.open { display: block; }
/* 模态框内容区域最大高度 */
.modal-body-scroll { max-height: 520px; overflow-y: auto; }

/* ============================================
   全端自适应 — 通用溢出防护
   ============================================ */
img, svg, table, .table-container, .pipeline-board,
.wb-panels, .wb-stats, .wb-content-row,
.pr-table, .modal, .form-input, .form-select, .form-textarea {
  max-width: 100%;
  box-sizing: border-box;
}

/* ============================================
   PC 中屏 (992px ~ 1199px)
   ============================================ */
@media (max-width: 1199px) and (min-width: 993px) {
  .page-content { padding: 20px; }
  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .wb-panels { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

/* ============================================
   PAD (768px ~ 992px)
   ============================================ */
@media (max-width: 992px) {
  .page-content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .page-title { font-size: 16px; }

  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
  .wb-panels { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
  .wb-panels-2-1,
  .wb-panels-1-1 { grid-template-columns: 1fr; }

  .pipeline-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow: visible;
    min-height: auto;
  }
  .pipeline-column { min-width: 0; }
  .pipeline-column-body { max-height: 400px; overflow-y: auto; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .content-row { flex-direction: column; }

  .topbar-name { max-width: 140px; }
  .search-box input { width: 140px; }
  .search-box input:focus { width: 180px; }
}

/* ============================================
   手机 (≤768px)
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .menu-toggle { display: block; }
  .main-content { margin-left: 0; max-width: 100vw; }
  .topbar { height: 56px; padding: 0 12px; }
  .topbar-left { gap: 10px; }
  .page-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
  .topbar-right { gap: 8px; }
  .role-switcher { padding: 10px 12px; }
  .page-content { padding: 12px; }

  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

  .wb-panels { grid-template-columns: 1fr; column-count: 1; gap: 10px; }
  .wb-panels-2-1,
  .wb-panels-1-1 { grid-template-columns: 1fr; }

  .pipeline-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    min-height: auto;
  }
  .pipeline-column { min-width: 0; flex-shrink: 1; }
  .pipeline-column-body { max-height: none; }
  .pipeline-card { padding: 10px; }
  .pipeline-card-name { font-size: 13px; }

  .lb-row { padding: 8px 10px; }
  .lb-name { font-size: 13px; }
  .lb-value { font-size: 11px; white-space: normal; }

  table { font-size: 12px; }
  th, td { padding: 6px 8px !important; }
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .btn { font-size: 13px; padding: 6px 12px; }
  .btn-sm { font-size: 12px; padding: 4px 8px; }

  .modal-overlay .modal {
    width: 94vw;
    max-height: 88vh;
    margin: 6vh auto;
  }
  .modal-body { padding: 12px; }
  .modal-footer { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }

  .card { padding: 12px; }
  .card-header { margin-bottom: 8px; }

  .filter-select { font-size: 12px; padding: 4px 8px; }
  .table-toolbar { flex-direction: column; gap: 8px; }
  .table-toolbar-left, .table-toolbar-right { width: 100%; flex-wrap: wrap; }
  .table-toolbar-right .btn { flex: 1; justify-content: center; }

  .pr-table th, .pr-table td { padding: 6px 8px; font-size: 12px; }
  .pr-amount { font-size: 13px; }

  .policy-card { padding: 12px 14px; }
  .policy-card > div { flex-direction: column; }

  .pipeline-board .btn-ghost { font-size: 10px !important; padding: 2px 6px !important; }
  .search-box input { width: 100px; font-size: 13px; padding: 6px 8px 6px 30px; }
  .search-box input:focus { width: 140px; }
}

/* ============================================
   超小屏 (≤480px)
   ============================================ */
@media (max-width: 480px) {
  .topbar { height: 50px; padding: 0 8px; }
  .topbar-left { gap: 6px; }
  .topbar-right { gap: 4px; }
  .menu-toggle svg { width: 20px; height: 20px; }
  .menu-toggle { padding: 2px; }
  .page-title { font-size: 14px; max-width: 80px; }
  .topbar-name { display: none; }
  .topbar-avatar { margin-right: 0; }

  .page-content { padding: 8px; }
  .wb-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stat-card { width: 100%; box-sizing: border-box; }

  .wb-panels { gap: 8px; }

  .search-box input { width: 60px; padding: 5px 6px 5px 24px; font-size: 12px; }
  .search-box input:focus { width: 100px; }
  .search-icon { left: 6px; width: 12px; height: 12px; }

  .btn { font-size: 12px; padding: 5px 10px; }
  .btn-sm { font-size: 11px; padding: 3px 6px; }

  .pipeline-card { padding: 8px; }
  .pipeline-card-name { font-size: 12px; }

  .modal-overlay .modal { width: 96vw; max-height: 85vh; margin: 7.5vh auto; border-radius: 10px; }
  .modal-body { padding: 10px; }
  .modal-footer { padding: 8px 10px; }

  .card { padding: 8px; border-radius: 8px; }
  .lb-row { padding: 6px 8px; }
}

/* ============================================
   消息通知样式
   ============================================ */

/* 顶部栏按钮 */
.topbar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* 通知徽章 */
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg-secondary);
  pointer-events: none;
}

/* 通知浮动Toast */
.notif-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  cursor: pointer;
  animation: notifToastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.notif-toast:hover {
  border-color: var(--accent);
}

@keyframes notifToastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

.notif-toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.notif-toast-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.notif-toast-close:hover {
  color: var(--text-primary);
}

/* 收件箱/发件箱消息行内未读标识 */
.msg-unread {
  font-weight: 700;
}
.msg-read {
  font-weight: 400;
}

/* ============================================
   设计系统增强（P0 断点规范化 + P1 移动端 + P2 无障碍）
   ============================================ */

/* ---------- P2: 键盘焦点可见性（WCAG 2.2） ---------- */
:focus-visible {
  outline: 2px solid var(--sky-500);
  outline-offset: 2px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--sky-500);
  outline-offset: 2px;
}

/* ---------- P2: 动效降级（prefers-reduced-motion） ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- P1: 移动端触控目标（≥44px） ---------- */
@media (max-width: 768px) {
  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-sm { min-height: 36px; }
  .action-btn { width: 36px; height: 36px; }
  select.filter-select { min-height: 40px; }
  input.form-input, textarea.form-textarea { min-height: 44px; font-size: 16px; }
  .nav-item { min-height: 44px; }
  .modal-footer .btn { min-height: 44px; }
}

/* ---------- P1: 移动端底部 Tab（工作台/线索/待办/我的） ---------- */
.bottom-tabbar {
  display: none;
}
@media (max-width: 768px) {
  .bottom-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 90;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  }
  .bottom-tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    min-height: 44px;
  }
  .bottom-tabbar a.active { color: var(--sky-600); font-weight: 500; }
  .bottom-tabbar a svg { width: 20px; height: 20px; }
  .main-content { padding-bottom: 56px; }
}

/* ---------- P1: 移动端悬浮录入按钮（FAB） ---------- */
.fab {
  display: none;
}
@media (max-width: 768px) {
  .fab {
    display: flex;
    position: fixed;
    right: 16px;
    bottom: 72px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--sky-500);
    color: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 95;
    transition: transform 0.2s ease;
  }
  .fab:active { transform: scale(0.92); }
  .fab svg { width: 22px; height: 22px; }
}

/* ---------- P0: min-width 渐进增强（移动优先补充） ---------- */
@media (min-width: 576px) {
  /* 手机 → 平板：统计卡过渡为 2 列 */
}
@media (min-width: 992px) {
  /* 平板 → 笔记本：侧栏保持 240px */
}
@media (min-width: 1200px) {
  /* 桌面宽屏：仅约束内容最大宽度，避免过长行（不影响 flex 布局） */
  .page-content > .table-container,
  .page-content > .card,
  .page-content > .stats-grid,
  .page-content > .content-row {
    max-width: 1600px;
  }
}

/* ---------- P1: 移动端线索表格 → 卡片列表 ---------- */
@media (max-width: 768px) {
  .leads-table,
  .leads-table tbody,
  .leads-table tr,
  .leads-table td {
    display: block;
    width: 100%;
  }
  .leads-table thead { display: none; }
  .leads-table tbody { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
  .leads-table tr {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
  }
  .leads-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    text-align: right;
  }
  .leads-table td:last-child { border-bottom: none; }
  .leads-table td:first-child {
    position: absolute;
    top: 10px;
    right: 10px;
    border-bottom: none;
    padding: 0;
  }
  .leads-table td[data-label]::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    flex-shrink: 0;
  }
  .leads-table tr { position: relative; padding-top: 16px; }
  .leads-table td[data-label="客户"] {
    justify-content: flex-start;
    text-align: left;
  }
  .leads-table td[data-label="客户"]::before { display: none; }
  .leads-table td[data-label=""]::before { display: none; }
}

/* ============================================
   v64 改进：移动端卡片布局、交互优化
   ============================================ */

/* 客户列表行hover效果 */
.client-row:hover {
  background: var(--bg-hover);
}

/* 移动端表格转卡片布局 */
@media (max-width: 768px) {
  /* 通用表格卡片化 */
  .table-container table,
  .table-container thead,
  .table-container tbody,
  .table-container th,
  .table-container td,
  .table-container tr {
    display: block;
  }

  .table-container thead {
    display: none;
  }

  .table-container tbody tr {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
  }

  .table-container tbody tr:active {
    background: var(--bg-hover);
  }

  .table-container td {
    border: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }

  .table-container td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    flex-shrink: 0;
    margin-right: 12px;
  }

  /* 操作按钮不转卡片 */
  .table-container td:last-child {
    justify-content: flex-end;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
    padding-top: 10px;
  }
  .table-container td:last-child::before {
    display: none;
  }

  /* 客户名单元格不转 */
  .table-container td:first-child {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
  }
  .table-container td:first-child::before {
    display: none;
  }
}

/* 全局搜索增强 */
.global-search-wrapper {
  position: relative;
}
.global-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 900;
  display: none;
}
.global-search-results.show {
  display: block;
}
.search-result-group {
  padding: 8px 0;
}
.search-result-group-title {
  padding: 4px 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.search-result-item {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-result-item:hover {
  background: var(--bg-hover);
}
.search-result-item .result-name {
  font-weight: 500;
  font-size: 14px;
}
.search-result-item .result-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* 快捷键提示 */
.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-left: 8px;
}

/* 同步状态指示器 */
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-tertiary);
}
.sync-status.syncing .sync-dot {
  background: var(--warning);
  animation: pulse 1s infinite;
}
.sync-status.synced .sync-dot {
  background: var(--success);
}
.sync-status.error .sync-dot {
  background: var(--danger);
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== V65: 个人主页 ===== */
.profile-container { max-width: 900px; margin: 0 auto; }
.profile-header-card { display: flex; align-items: center; gap: 20px; padding: 24px; background: var(--bg-card, #fff); border-radius: 12px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.profile-avatar-large { width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; flex-shrink: 0; }
.profile-header-info h2 { margin: 0 0 4px; font-size: 20px; }
.profile-position { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.profile-meta-row { display: flex; gap: 16px; flex-wrap: wrap; }
.profile-meta-item { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.profile-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-color); margin-bottom: 16px; }
.profile-tab { padding: 10px 20px; border: none; background: none; cursor: pointer; font-size: 14px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.profile-form-card { background: var(--bg-card, #fff); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.profile-section-title { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.profile-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.profile-field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.profile-field input { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; box-sizing: border-box; }
.profile-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }
.profile-form-actions { margin-top: 20px; }
.profile-info-list { display: flex; flex-direction: column; gap: 12px; }
.profile-info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.profile-info-row:last-child { border-bottom: none; }
.profile-info-row span { color: var(--text-muted); font-size: 14px; }
.profile-info-row a { color: var(--primary); text-decoration: none; }
.profile-qrcode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.profile-qrcode-card { background: var(--bg-card, #fff); border-radius: 12px; padding: 24px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.profile-qrcode-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; }
.profile-qrcode-image { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; }
.profile-qrcode-image svg { display: block; }
.profile-qrcode-name { font-size: 18px; font-weight: 600; margin-top: 12px; }
.profile-qrcode-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.profile-qrcode-upload { width: 200px; height: 200px; margin: 0 auto; border: 2px dashed var(--border-color); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; color: var(--text-muted); transition: border-color 0.2s; }
.profile-qrcode-upload:hover { border-color: var(--primary); color: var(--primary); }
.profile-colleagues-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.colleague-card { background: var(--bg-card, #fff); border-radius: 12px; padding: 20px 12px; text-align: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: transform 0.2s, box-shadow 0.2s; }
.colleague-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.colleague-avatar { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; }
.colleague-name { font-weight: 600; font-size: 14px; }
.colleague-position { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.colleague-modal .profile-info-list { text-align: left; }

/* ===== V65: 打卡签到 ===== */
.attendance-clock-card { background: linear-gradient(135deg, #0ea5e9, #0284c7); border-radius: 16px; padding: 32px; text-align: center; color: #fff; margin-bottom: 16px; }
.attendance-date { font-size: 14px; opacity: 0.9; }
.attendance-time { font-size: 48px; font-weight: 700; font-family: 'Courier New', monospace; margin: 8px 0 16px; letter-spacing: 2px; }
.attendance-status-row { display: flex; justify-content: center; gap: 24px; margin-bottom: 20px; }
.attendance-status-item { font-size: 14px; opacity: 0.95; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.status-normal { background: #4ade80; }
.status-dot.status-pending { background: #fbbf24; }
.attendance-clock-btn { padding: 14px 48px; font-size: 16px; font-weight: 600; border-radius: 12px; border: none; cursor: pointer; background: #fff; color: var(--primary); transition: transform 0.2s; }
.attendance-clock-btn:hover { transform: scale(1.05); }
.attendance-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.attendance-stat-card { background: var(--bg-card, #fff); border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.attendance-stat-card .stat-value { font-size: 28px; font-weight: 700; }
.attendance-stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.attendance-records-card, .attendance-team-card { background: var(--bg-card, #fff); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.attendance-record-list { display: flex; flex-direction: column; gap: 8px; }
.attendance-record-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-radius: 8px; background: var(--bg-secondary, #f9fafb); }
.record-date { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.record-date strong { font-size: 15px; }
.record-weekday { font-size: 12px; color: var(--text-muted); }
.record-times { display: flex; align-items: center; gap: 8px; font-family: 'Courier New', monospace; font-size: 14px; }
.record-sep { color: var(--text-muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #2563eb; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

/* ===== V65: 工资绩效 ===== */
.salary-net-amount { text-align: center; padding: 32px; background: linear-gradient(135deg, #10b981, #059669); border-radius: 16px; color: #fff; margin-bottom: 16px; }
.salary-net-label { font-size: 14px; opacity: 0.9; }
.salary-net-value { font-size: 42px; font-weight: 700; margin: 8px 0; }
.salary-net-sub { font-size: 13px; opacity: 0.85; }
.salary-section { background: var(--bg-card, #fff); border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.salary-section h4 { margin: 0 0 12px; font-size: 15px; }
.salary-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.salary-row:last-child { border-bottom: none; }
.salary-row.salary-total { border-top: 2px solid var(--border-color); border-bottom: none; margin-top: 8px; padding-top: 12px; font-size: 16px; }
.salary-row.negative strong { color: var(--danger); }
.salary-attendance-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; text-align: center; }
.salary-att-item .att-num { display: block; font-size: 24px; font-weight: 700; }
.salary-att-item .att-label { font-size: 12px; color: var(--text-muted); }
.salary-team-card { background: var(--bg-card, #fff); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }

/* ===== V65: 离职交接 ===== */
.offboard-employees-card, .offboard-requests-card, .offboard-my-card { background: var(--bg-card, #fff); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.btn-sm { padding: 4px 12px; font-size: 13px; border-radius: 6px; border: 1px solid var(--border-color); cursor: pointer; background: #fff; }
.btn-sm.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm.btn-secondary { background: var(--bg-secondary); color: var(--text-secondary); }
.btn-danger { background: var(--danger); color: #fff; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; }

/* ===== V65: 通用按钮补充 ===== */
.btn { padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: opacity 0.2s; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 10px 12px; background: var(--bg-secondary, #f9fafb); font-weight: 600; white-space: nowrap; border-bottom: 2px solid var(--border-color); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.data-table tbody tr:hover { background: var(--bg-secondary, #f9fafb); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; box-sizing: border-box; }
textarea.form-input { resize: vertical; }

/* ===== V65: 移动端适配 ===== */
@media (max-width: 768px) {
  .profile-header-card { flex-direction: column; text-align: center; }
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-qrcode-grid { grid-template-columns: 1fr; }
  .profile-colleagues-grid { grid-template-columns: repeat(3, 1fr); }
  .attendance-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .attendance-time { font-size: 36px; }
  .salary-net-value { font-size: 32px; }
  .salary-attendance-grid { grid-template-columns: repeat(3, 1fr); }
  .attendance-status-row { flex-direction: column; gap: 8px; }
}
/* ===== V68: 系统设置 ===== */
.settings-container { max-width: 1000px; margin: 0 auto; }
.settings-tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px; overflow-x: auto; flex-wrap: wrap;
}
.settings-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -2px; white-space: nowrap; transition: all 0.2s;
}
.settings-tab:hover { color: var(--accent); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.settings-content { min-height: 300px; }
.settings-section {
  background: var(--bg-secondary); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; border: 1px solid var(--border-color);
}
.settings-section-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.settings-hint { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-input-sm { padding: 6px 10px; font-size: 13px; }

/* 标签列表 */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tag-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-light); color: var(--accent);
  padding: 4px 10px; border-radius: 16px; font-size: 13px; font-weight: 500;
}
.tag-remove {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0; display: flex; align-items: center;
}
.tag-remove:hover { color: var(--danger); }
.tag-add-row { display: flex; gap: 8px; }

/* 管道阶段编辑 */
.pipeline-stages-editor { display: flex; flex-direction: column; gap: 8px; }
.pipeline-stage-row { display: flex; align-items: center; gap: 8px; }
.stage-handle { color: var(--text-muted); cursor: grab; font-size: 16px; }
.stage-color { width: 36px; height: 36px; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; padding: 2px; }

/* 业务板块编辑 */
.business-lines-editor { display: flex; flex-direction: column; gap: 8px; }
.biz-line-row { display: flex; align-items: center; gap: 8px; }

/* 权限表格 */
.perm-table th, .perm-table td { white-space: nowrap; }
.perm-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }

/* 产品提成阶段行 */
.stage-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }

/* 开关样式补充 */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 22px; transition: 0.3s;
}
.toggle-slider:before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

@media (max-width: 768px) {
  .settings-grid, .settings-grid-2 { grid-template-columns: 1fr; }
  .settings-tab { padding: 8px 12px; font-size: 13px; }
}

/* ===== V71 新增模块样式 ===== */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-cards .stat-card { background: var(--bg-secondary, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 12px; padding: 20px; text-align: center; }
.stats-cards .stat-num { font-size: 28px; font-weight: 700; color: var(--text-primary, #111827); }
.stats-cards .stat-label { font-size: 13px; color: var(--text-secondary, #6b7280); margin-top: 4px; }

.perf-summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.perf-card { background: white; border-radius: 12px; padding: 20px; text-align: center; border: 1px solid #e5e7eb; }
.perf-card-num { font-size: 32px; font-weight: 700; }
.perf-card-label { font-size: 13px; color: #6b7280; margin-top: 4px; }
.perf-card.total .perf-card-num { color: #2563eb; }
.perf-card.pass .perf-card-num { color: #16a34a; }
.perf-card.fail .perf-card-num { color: #dc2626; }
.perf-card.frozen .perf-card-num { color: #6b7280; }

.grade-rules { display: flex; flex-wrap: wrap; gap: 16px; }
.grade-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.grade-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: white; font-weight: bold; font-size: 14px; }

.timeline-item { position: relative; }
.timeline-item.done { opacity: 0.85; }
.timeline-item.current { background: #f0f9ff; border-radius: 8px; padding: 12px; margin-left: 0; padding-left: 28px; }

.cost-breakdown { padding: 8px 0; }

.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; padding-bottom: 0; }
.tab-btn { padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 14px; color: #6b7280; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab-btn:hover { color: #2563eb; }
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-primary { background: #dbeafe; color: #2563eb; }
.badge-info { background: #e0f2fe; color: #0284c7; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

.btn-success { background: #16a34a; color: white; border: 1px solid #16a34a; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: white; border: 1px solid #dc2626; }
.btn-danger:hover { background: #b91c1c; }
