  :root {
  /* ===== 企业级OA配色方案 ===== */
  
  /* --- 核心主色（3色） --- */
  --primary: #165DFF;
  --primary-light: #E8F3FF;
  --primary-dark: #4080FF;
  --primary-darker: #0E42D2;
  
  /* --- 业务辅助色（4色） --- */
  --success: #00B42A;
  --warning: #FF7D00;
  --danger: #F53F3F;
  --auxiliary: #0FC6C2;
  
  /* --- 文字层级色（4色） --- */
  --text: #1D2129;
  --text-secondary: #4E5969;
  --text-light: #86909C;
  --text-disabled: #C9CDD4;
  
  /* --- 背景与灰阶色（4色） --- */
  --bg: #F2F3F5;
  --card-bg: #FFFFFF;
  --bg-light: #F7F8FA;
  --bg-hover: #F0F7FF;
  
  /* --- 边框与分割色（2色） --- */
  --border: #DCDFE6;
  --border-light: #E5E6EB;
  --border-color: #DCDFE6;
  
  /* --- 状态浅底色（4色） --- */
  --success-bg: #E8FFEA;
  --warning-bg: #FFF7E8;
  --danger-bg: #FFECE8;
  --info-bg: #E8F3FF;
  
  /* --- 圆角设置 --- */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  
  /* --- 阴影 --- */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.3);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.5);
}
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }

  /* ===== 登录页 ===== */
  #loginPage {
    position: fixed; inset: 0;
    background: url('/bg.jpeg') center center / cover no-repeat;
    display: flex; align-items: center; justify-content: center; z-index: 9999;
  }
  #loginPage.hidden { display: none; }
  .login-card {
    background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
    padding: 48px 40px; width: 420px; max-width: 90vw;
  }
  .login-logo { text-align: center; margin-bottom: 32px; }
  .login-logo-icon {
    width: 72px; height: 72px; background: var(--primary-light);
    border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px;
  }
  .login-logo-icon svg { color: var(--primary); }
  .login-title { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
  .login-subtitle { font-size: 14px; color: var(--text-secondary); }
  .login-form .form-group { margin-bottom: 20px; }
  .login-form .form-label { font-size: 14px; font-weight: 500; margin-bottom: 8px; display: block; }
  .login-form .form-control {
    width: 100%; padding: 12px 16px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; transition: border-color .2s;
  }
  .login-form .form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,220,200,.1); }
  .login-form .form-control::placeholder { color: #bbb; }
  .login-btn {
    width: 100%; padding: 14px; background: var(--primary); color: #fff;
    border: none; border-radius: 8px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: background .2s; margin-top: 8px;
  }
  .login-btn:hover { background: var(--primary-dark); }
  .login-btn:active { transform: scale(.98); }
  .login-error { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; display: none; }
  .login-error.show { display: block; }
  .login-remember { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
  .login-remember input { width: 16px; height: 16px; accent-color: var(--primary); }
  .login-remember label { font-size: 13px; color: var(--text-secondary); cursor: pointer; }
  .login-demo { margin-top: 24px; padding: 16px; background: #F2F3F5; border-radius: 8px; font-size: 12px; color: var(--text-secondary); }
  .login-demo-title { font-weight: 600; margin-bottom: 8px; color: var(--text); }
  .login-demo-item { display: flex; justify-content: space-between; padding: 4px 0; }
  .login-demo-item span:first-child { color: var(--primary); }

  /* ===== 主布局 ===== */
  #appContent { display: flex; flex: 1; overflow: hidden; height: 100vh; }
  #appContent.hidden { display: none; }

  /* ===== 侧边栏 ===== */
  #sidebar {
    width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0; overflow: visible;
  }
  .sidebar-logo {
    padding: 18px 16px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
  }
  .sidebar-logo-icon { width: 50px; height: 50px; background: var(--primary-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 4px; }
  .sidebar-logo-icon svg { color: var(--primary); }
  .sidebar-logo-text { font-size: 15px; font-weight: 700; color: var(--text); }
  .sidebar-logo-sub { font-size: 11px; color: var(--text-secondary); }

  .sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
  .nav-section { margin-bottom: 16px; }
  .nav-section-title { padding: 8px 12px 4px; font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; cursor: pointer;
    font-size: 14px; color: var(--text-secondary); transition: all .15s; margin-bottom: 2px;
  }
  .nav-item:hover { background: var(--primary-light); color: var(--primary); }
  .nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
  .nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; }
  .nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; font-weight: 600; }

  .sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
  .sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; transition: background .15s; }
  .sidebar-user:hover { background: var(--bg); }
  .sidebar-user-avatar { width: 36px; height: 36px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 14px; }
  .sidebar-user-info { flex: 1; min-width: 0; }
  .sidebar-user-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-user-role { font-size: 12px; color: var(--text-secondary); }
  .sidebar-logout { padding: 6px 8px; border-radius: 6px; color: var(--text-secondary); cursor: pointer; font-size: 14px; }
  .sidebar-logout:hover { background: var(--danger-bg); color: var(--danger); }

  /* ===== 顶部栏 ===== */
  #topbar {
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 0 24px; height: var(--header-h); display: flex; align-items: center;
    justify-content: space-between; flex-shrink: 0;
  }
  .topbar-title { font-size: 18px; font-weight: 700; }
  .topbar-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
  .topbar-breadcrumb span:last-child { color: var(--text); font-weight: 600; }
  .topbar-actions { display: flex; gap: 12px; align-items: center; }
  .topbar-time { font-size: 13px; color: var(--text-secondary); }

  /* ===== 主内容区 ===== */
  #mainContent { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .content { flex: 1; overflow-y: auto; padding: 24px; }

  /* ===== 通用卡片 ===== */
  .card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 20px; }
  /* .card + .card { margin-top: 16px; } */ /* 已禁用，避免影响网格布局 */
  .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
  .card-title .icon { font-size: 18px; }

  /* ===== 按钮 ===== */
  .btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 7px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
  .btn-primary { background: var(--primary); color: #fff; }
  .btn-primary:hover { background: var(--primary-dark); }
  .btn-default { background: #fff; color: var(--text); border: 1px solid var(--border); }
  .btn-default:hover { border-color: var(--primary); color: var(--primary); }
  .btn-danger { background: var(--danger) !important; color: #FFFFFF !important; border: 1px solid var(--danger); }
  .btn-danger:hover { background: #D9363E !important; }
  .btn-success { background: var(--success); color: #fff; }
  .btn-success:hover { background: #00B42A; }
.btn-warning { background: #FF7D00 !important; color: #1D2129 !important; }
  .btn-warning:hover { background: #D48806; }
  .btn-sm { padding: 5px 12px; font-size: 12px; }
  .btn-lg { padding: 12px 24px; font-size: 15px; }
  .btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
  .btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #F2F3F5; }

  /* ===== 统计卡片 ===== */
  /* ===== 统一图标背景色 ===== */
  .icon-bg { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .icon-bg-primary { background: rgba(22, 93, 255, 0.12); color: #165DFF; }
  .icon-bg-success { background: rgba(0, 180, 42, 0.12); color: #00B42A; }
  .icon-bg-warning { background: rgba(255, 125, 0, 0.12); color: #FF7D00; }
  .icon-bg-danger { background: rgba(245, 63, 63, 0.12); color: #F53F3F; }
  .icon-bg-info { background: rgba(22, 93, 255, 0.12); color: #165DFF; }
  .icon-bg-secondary { background: rgba(201, 169, 166, 0.12); color: #FF7875; }

  /* ===== 工作台卡片统一样式 ===== */
  .dash-kpi-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .dash-kpi-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
  .dash-kpi-val { font-size: 28px; font-weight: 700; color: var(--text); }
  .dash-kpi-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }
  .dash-kpi-tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
  .dash-kpi-tag.ok { background: rgba(0, 180, 42, 0.12); color: #00B42A; }
  .dash-kpi-tag.warning { background: rgba(255, 125, 0, 0.12); color: #FF7D00; }
  .dash-kpi-tag.danger { background: rgba(245, 63, 63, 0.12); color: #F53F3F; }

  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
  .stat-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 20px; display: flex; align-items: center; gap: 16px; transition: all 0.2s; }
  .stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
  .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
  .stat-icon.blue { background: rgba(22, 93, 255, 0.12); color: var(--primary); }
  .stat-icon.green { background: rgba(0, 180, 42, 0.12); color: var(--success); }
  .stat-icon.orange { background: rgba(255, 125, 0, 0.12); color: var(--warning); }
  .stat-icon.red { background: rgba(245, 63, 63, 0.12); color: var(--danger); }
  .stat-icon.info { background: rgba(22, 93, 255, 0.12); color: var(--info); }
  .stat-icon.default { background: rgba(107, 114, 128, 0.12); color: var(--text-secondary); }
  .stat-info { flex: 1; }
  .stat-content { flex: 1; } /* 兼容旧代码 */
  .stat-value { font-size: 24px; font-weight: 700; color: var(--text); }
  .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
  .stat-change { font-size: 12px; margin-top: 4px; }
  .stat-change.up { color: var(--success); }
  .stat-change.down { color: var(--danger); }

  /* ===== 金额样式 ===== */
  .amount-positive { color: var(--success); font-weight: 600; }
  .amount-negative { color: var(--danger); font-weight: 600; }

  /* ===== 表格 ===== */
  .table-wrap { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
  thead th { background: #F2F3F5; font-weight: 600; padding: 12px 16px; text-align: left; border-bottom: 2px solid var(--border); color: var(--text-secondary); font-size: 12px; text-transform: uppercase; }
  tbody td { padding: 12px 16px; border-bottom: 1px solid #F2F3F5; vertical-align: middle; }
  tbody tr:hover { background: #F2F3F5; }
  .table-actions { display: flex; gap: 8px; }

  /* ===== 表单 ===== */
  .form-group { margin-bottom: 16px; }
  .form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
  .form-label .required { color: var(--danger); margin-left: 2px; }
  .form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px; outline: none; transition: border .15s, box-shadow .15s; background: #fff; }
  .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1); }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  select.form-control { cursor: pointer; }
  textarea.form-control { resize: vertical; min-height: 80px; }

  /* ===== 表单分区样式 ===== */
  .worker-form-sections { display: flex; flex-direction: column; gap: 16px; }
  .form-section { background: #F2F3F5; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
  .form-section-title { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--text); background: #F2F3F5; border-bottom: 1px solid #DCDFE6; }
  .form-section-title i { color: var(--primary); }
  .form-section-body { padding: 16px; }
  .form-section-body .form-group:last-child { margin-bottom: 0; }
  .form-section-body .form-row { margin-bottom: 0; }


  /* ===== 状态标签 ===== */
  .tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; }
  .tag-secondary { background: #FF7875; color: #165DFF; }
  .star-rating { display: flex; gap: 8px; }
  .star-rating .star { cursor: pointer; color: #DCDFE6; transition: all 0.15s; padding: 6px; border-radius: 8px; display: flex; }
  .star-rating .star:hover { color: var(--primary); background: rgba(22, 93, 255, 0.15); transform: scale(1.15); }
  .star-rating .star.active { color: var(--warning); }
  .star-rating .star.active i { fill: var(--warning); }
  .info-row { font-size: 14px; color: #1D2129; }
  .info-label { color: #165DFF; }
  .info-value { font-weight: 500; }
  .action-btns { display: flex; gap: 4px; }
  .action-btns .btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: transparent; border: none; cursor: pointer; transition: all 0.2s; }
  .action-btns .btn-icon:hover { background: var(--bg-hover); }
  .action-btns .btn-icon.btn-danger:hover { background: rgba(245, 63, 63, 0.15); color: var(--danger); }
  .action-btns .btn-icon.btn-success:hover { background: rgba(0, 180, 42, 0.15); color: var(--success); }
  input[type="range"] { -webkit-appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--pct, 50%), #DCDFE6 var(--pct, 50%) 100%); }
  input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
  .search-box { display: flex; align-items: center; gap: 8px; background: #F2F3F5; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; transition: all 0.2s; }
  .search-box:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1); }
  .search-box input { border: none; background: transparent; outline: none; font-size: 13px; width: 180px; }
  .search-box input::placeholder { color: #69C0FF; }
  .salary-summary { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, rgba(22, 93, 255, 0.15) 0%, var(--primary) 100%); padding: 16px 20px; border-radius: 12px; margin-top: 12px; box-shadow: 0 2px 8px rgba(245, 63, 63, 0.15); }
  .salary-summary-label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
  .salary-summary-value { font-size: 24px; font-weight: 700; color: var(--warning); text-shadow: 0 1px 2px rgba(0,0,0,.1); }
  /* 排班日历 */
  .schedule-grid { overflow-x: auto; }
  .schedule-header, .schedule-row { display: flex; border-bottom: 1px solid var(--border); }
  .schedule-row:last-child { border-bottom: none; }
  .schedule-header { background: #F2F3F5; font-weight: 600; }
  .schedule-cell { padding: 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; min-height: 70px; }
  .schedule-cell:last-child { border-right: none; }
  .schedule-cell.worker-col { width: 180px; flex-shrink: 0; background: #F2F3F5; }
  .schedule-cell.date-col { flex: 1; min-width: 100px; }
  .schedule-item { padding: 6px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.2s; text-align: center; font-weight: 500; }
  .schedule-item.morning { background: rgba(0, 180, 42, 0.15); color: var(--success); }
  .schedule-item.afternoon { background: rgba(22, 93, 255, 0.15); color: var(--info); }
  .schedule-item.confirmed { border-left: 3px solid var(--success); }
  .schedule-item.pending { border-left: 3px solid var(--warning); }
  .schedule-item:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
  .schedule-empty { padding: 6px 10px; text-align: center; color: #DCDFE6; cursor: pointer; font-size: 16px; border: 1px dashed #DCDFE6; border-radius: 6px; transition: all 0.2s; }
  .schedule-empty:hover { border-color: var(--primary); color: var(--primary); background: #F2F3F5; }
  /* 审批管理 */
  .approval-tabs { display: flex; gap: 4px; margin-left: auto; }
  .approval-tab { padding: 6px 12px; border: none; background: transparent; color: var(--text-secondary); cursor: pointer; border-radius: 6px; font-size: 13px; transition: all 0.2s; }
  .approval-tab:hover { background: var(--primary-light); }
  .approval-tab.active { background: var(--primary); color: #fff; }
  .approval-level-info { background: rgba(22, 93, 255, 0.08); padding: 12px 16px; border-radius: 8px; margin-top: 12px; font-size: 14px; }
  .approval-detail { background: #F2F3F5; border-radius: 8px; padding: 16px; }
  .detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .detail-row:last-child { border-bottom: none; }
  .detail-label { width: 100px; color: var(--text-secondary); flex-shrink: 0; }
  .detail-value { font-weight: 500; }
  .approval-flow { display: flex; flex-direction: column; gap: 12px; }
  .approval-step { display: flex; align-items: flex-start; gap: 12px; }
  .step-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .approval-step.approved .step-icon { background: rgba(0, 180, 42, 0.15); color: var(--success); }
  .approval-step.rejected .step-icon { background: rgba(245, 63, 63, 0.15); color: var(--danger); }
  .worktype-tag { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; gap: 4px; }
  .worktype-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; }
  .tag-primary { background: rgba(22, 93, 255, 0.12); color: var(--primary); }
  .tag-success { background: rgba(0, 180, 42, 0.12); color: var(--success); }
  .tag-warning { background: rgba(255, 125, 0, 0.12); color: var(--warning); }
  .tag-danger { background: rgba(245, 63, 63, 0.12); color: var(--danger); }
  .tag-default { background: #F2F3F5; color: var(--text-secondary); }

  /* ===== 弹窗 ===== */
  .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
  .modal-overlay.hidden { display: none; }
  .modal { background: #fff; border-radius: 12px; width: 90%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
  .modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
  .modal-title { font-size: 16px; font-weight: 700; }
  .modal-close { width: 32px; height: 32px; border-radius: 6px; border: none; background: transparent; cursor: pointer; font-size: 18px; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
  .modal-close:hover { background: var(--bg); }
  .modal-body { padding: 24px; overflow-y: auto; flex: 1; }
  .modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; flex-shrink: 0; }

  /* ===== Toast ===== */
  #toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
  .toast { padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px; box-shadow: var(--shadow-md); animation: slideIn .3s ease; display: flex; align-items: center; gap: 10px; }
  .toast.success { background: var(--success); }
  .toast.error { background: var(--danger); }
  .toast.warning { background: var(--warning); }
  .toast.info { background: var(--primary); }
  @keyframes slideIn { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }

  /* ===== 空状态 ===== */
  .empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
  .empty-state .icon { font-size: 64px; margin-bottom: 16px; opacity: .5; }
  .empty-state p { font-size: 15px; margin-bottom: 8px; }
  .empty-state small { font-size: 13px; }

  /* ===== 加载 ===== */
  .loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--text-secondary); }
  .spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin-right: 12px; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ===== 搜索栏 ===== */
  .search-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .search-bar .form-control { max-width: 300px; }
  .filter-group { display: flex; align-items: center; gap: 8px; }
  .filter-group label { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

  /* ===== 页面标题栏 ===== */
  .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
  .page-title { font-size: 20px; font-weight: 700; }
  .page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
  .page-actions { display: flex; gap: 12px; }

  /* ===== 图表容器 ===== */
  .chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 16px; align-items: stretch; }
  .chart-grid .card { display: flex; flex-direction: column; }
  .chart-grid .card .card-header { flex-shrink: 0; }
  .chart-grid .card .chart-container { flex: 1; min-height: 280px; position: relative; }
  .chart-container { position: relative; height: 300px; }
  .chart-container canvas { width: 100% !important; height: 100% !important; }

  /* ===== 待办列表 ===== */
  .todo-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid #F2F3F5; }
  .todo-item:last-child { border-bottom: none; }
  .todo-checkbox { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 4px; cursor: pointer; flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; }
  .todo-checkbox.done { background: var(--success); border-color: var(--success); color: #fff; }
  .todo-content { flex: 1; }
  .todo-title { font-size: 14px; color: var(--text); }
  .todo-title.done { text-decoration: line-through; color: var(--text-secondary); }
  .todo-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: flex; gap: 12px; }
  .todo-priority { padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 600; }
  .todo-priority.high { background: rgba(245, 63, 63, 0.12); color: var(--danger); }
  .todo-priority.normal { background: rgba(107, 114, 128, 0.08); color: var(--text-secondary); }
  .todo-priority.low { background: rgba(0, 180, 42, 0.12); color: var(--success); }

  /* ===== 进度条 ===== */
  .progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
  .progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
  .progress-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

  /* ===== 两列网格（响应式） ===== */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

  /* ===== 工具提示 ===== */
  .tooltip { position: relative; }
  .tooltip:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; z-index: 100; }

  /* ===== 数字动画 ===== */
  @keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  .count-up { animation: countUp .5s ease; }

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

  /* ===== Confirmation Dialog 确认对话框 ===== */
  .confirm-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 24px; }
  .confirm-icon.warning { background: rgba(255, 125, 0, 0.12); color: var(--warning); }
  .confirm-icon.danger { background: rgba(245, 63, 63, 0.12); color: var(--danger); }
  .confirm-icon.info { background: rgba(22, 93, 255, 0.12); color: var(--primary); }
  .confirm-message { text-align: center; font-size: 14px; color: var(--text); margin-bottom: 8px; }
  .confirm-sub { text-align: center; font-size: 13px; color: var(--text-secondary); }

  /* ===== Button Loading 按钮加载状态 ===== */
  .btn.loading { pointer-events: none; opacity: 0.7; position: relative; }
  .btn.loading::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
  .btn-default.loading::after { border-color: rgba(0,0,0,0.15); border-top-color: var(--text); }

  /* ===== Search Debounce 防抖搜索 ===== */
  .search-wrap { position: relative; }
  .search-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border: none; background: #ddd; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; font-size: 12px; color: #666; }
  .search-clear:hover { background: #ccc; }
  .search-clear.show { display: flex; }

  /* ===== Form Validation 表单验证 ===== */
  .form-control.error { border-color: var(--danger); }
  .form-control.success { border-color: var(--success); }
  .form-error { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }
  .form-error.show { display: block; }
  .form-group.has-error .form-error { display: block; }
  .form-group.has-error .form-control { border-color: var(--danger); }

  /* ===== Sidebar Collapse 侧边栏折叠 ===== */
  #sidebar.collapsed { width: 60px; }
  #sidebar.collapsed .sidebar-logo-text, #sidebar.collapsed .sidebar-logo-sub,
  #sidebar.collapsed .nav-section-title, #sidebar.collapsed .nav-item span,
  #sidebar.collapsed .nav-badge, #sidebar.collapsed .sidebar-user-info { display: none; }
  #sidebar.collapsed .sidebar-logo { justify-content: center; padding: 18px 8px; }
  #sidebar.collapsed .sidebar-logo-icon { width: 44px; height: 44px; }
  #sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
  #sidebar.collapsed .sidebar-footer { padding: 8px !important; }
  #sidebar.collapsed .sidebar-user { justify-content: center; padding: 8px !important; }
  #sidebar.collapsed .sidebar-user-avatar { width: 36px; height: 36px; flex-shrink: 0; }
  #sidebar.collapsed .sidebar-footer svg { width: 18px !important; height: 18px !important; }
  .sidebar-toggle { position: absolute; right: -12px; top: 24px; width: 24px; height: 24px; background: #fff; border: 1px solid var(--border); border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; z-index: 10; box-shadow: var(--shadow-md); transition: transform .2s; }
  .sidebar-toggle:hover { transform: scale(1.1); }
  #sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

  /* ===== Notification History 通知历史 ===== */
  #notificationPanel { position: fixed; top: var(--header-h); right: 0; width: 360px; max-height: calc(100vh - var(--header-h) - 40px); background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 500; display: none; flex-direction: column; overflow: hidden; }
  #notificationPanel.show { display: flex; }
  .notif-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
  .notif-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
  .notif-clear { font-size: 12px; color: var(--primary); cursor: pointer; }
  .notif-clear:hover { text-decoration: underline; }
  .notif-list { flex: 1; overflow-y: auto; max-height: 400px; }
  .notif-item { padding: 14px 20px; border-bottom: 1px solid #F2F3F5; cursor: pointer; transition: background .15s; display: flex; gap: 12px; }
  .notif-item:hover { background: #F2F3F5; }
  .notif-item:last-child { border-bottom: none; }
  .notif-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .notif-icon.success { background: rgba(0, 180, 42, 0.12); color: var(--success); }
  .notif-icon.error { background: rgba(245, 63, 63, 0.12); color: var(--danger); }
  .notif-icon.warning { background: rgba(255, 125, 0, 0.12); color: var(--warning); }
  .notif-icon.info { background: rgba(22, 93, 255, 0.12); color: var(--primary); }
  .notif-content { flex: 1; min-width: 0; }
  .notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
  .notif-time { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .notif-empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); }

  /* ===== 响应式网格（替代内联样式） ===== */
  .responsive-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .responsive-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .responsive-grid-form { display: grid; grid-template-columns: 1fr 1fr 2fr 1fr 1fr 80px; gap: 8px; align-items: center; }

  /* ===== 响应式 ===== */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  @media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
    .page-actions .btn { flex: 1; min-width: 0; font-size: 13px; padding: 8px 10px; }
    table { font-size: 12px; min-width: 600px; }
    thead th, tbody td { padding: 10px 12px; }
    .hide-mobile { display: none !important; }
    .card { padding: 16px; }
    .card-header { margin-bottom: 12px; }
    .form-row { flex-direction: column; gap: 0; }
    .form-row .form-group { margin-bottom: 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-icon { width: 40px; height: 40px; }
    .stat-value { font-size: 20px; }
    .dash-kpi-card { padding: 16px; height: auto; }
    .dash-kpi-val { font-size: 24px; }
    .topbar-title { font-size: 15px; }
    .topbar-breadcrumb { display: none; }
    .modal { width: 95%; max-height: 85vh; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
    /* 响应式网格覆盖 */
    .responsive-grid-2, .responsive-grid-4 { grid-template-columns: 1fr; }
    .responsive-grid-form { grid-template-columns: 1fr; }
  }

  @media (max-width: 480px) {
    body { font-size: 14px; }
    .page-header { padding: 12px 16px; }
    .content { padding: 16px; }
    .page-actions .btn { flex: none; width: 100%; justify-content: center; }
    .stat-grid { grid-template-columns: 1fr; }
    .stat-card { flex-direction: row; }
    .dash-kpi-row { grid-template-columns: 1fr; }
    .dash-bottom-grid { grid-template-columns: 1fr; }
    .card { padding: 12px; }
    .modal { width: 98%; max-height: 90vh; }
    .btn { padding: 8px 12px; font-size: 13px; }
    .btn-sm { padding: 5px 8px; font-size: 12px; }
    .sidebar-toggle { display: none; }
    #notificationPanel { width: calc(100vw - 24px); right: 12px; }
  }

  /* ===== 卡片悬停微动效 ===== */
  .card { transition: box-shadow 0.2s ease, transform 0.2s ease; }
  .card:hover { box-shadow: var(--shadow-md); }
  .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md) !important; }

  /* ===== 按钮涟漪效果 ===== */
  .btn { position: relative; overflow: hidden; }
  .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleAnim 0.5s ease-out;
    pointer-events: none;
  }
  @keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
  }

  /* ===== 页面切换动画增强 ===== */
  .page-transition {
    animation: pageFadeIn 0.3s ease;
  }
  @keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ===== 表格行动效增强 ===== */
  tbody tr { cursor: pointer; transition: background 0.15s ease, transform 0.15s ease; }
  tbody tr:hover { background: #F2F3F5 !important; transform: translateX(2px); }
  tbody tr:active { transform: translateX(4px); }
  tbody tr.active { background: var(--primary-light) !important; }

  /* ===== Toast 滑入动画 ===== */
  .toast { animation: slideIn 0.3s ease; }
  @keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  /* ===== 弹窗缩放动画 ===== */
  .modal { animation: modalIn 0.25s ease; }
  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  /* ===== 加载骨架屏 ===== */
  .skeleton {
    background: linear-gradient(90deg, #F2F3F5 25%, #E8EAED 50%, #F2F3F5 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
  }
  @keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  /* ===== 滚动条美化 ===== */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; transition: background 0.2s; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

  /* ===== Table Row Hover 增强 ===== */
  tbody tr { cursor: pointer; transition: all .15s; }
  tbody tr:hover { background: #F2F3F5 !important; transform: translateX(2px); }
  tbody tr:hover td:first-child { border-left: 3px solid var(--primary); padding-left: 13px; }
  tbody tr.active { background: rgba(22, 93, 255, 0.12) !important; }

  /* ===== Toast 增强 ===== */
  .toast-close { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; opacity: 0.7; font-size: 16px; padding: 0; line-height: 1; }
  .toast-close:hover { opacity: 1; }
  .toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,0.5); border-radius: 0 0 8px 8px; animation: toastProgress 3s linear forwards; }
  @keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

  /* ===== 沟通记录时间线 ===== */
  .comm-section { animation: fadeIn .3s ease; }
  .comm-timeline { max-height: 400px; overflow-y: auto; padding-right: 8px; }
  .comm-timeline::-webkit-scrollbar { width: 4px; }
  .comm-timeline::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
  .comm-item { animation: slideInLeft .3s ease; }
  .comm-timeline-dot { transition: all .2s; }
  .comm-item:hover .comm-timeline-dot { transform: scale(1.1); }
  .comm-content { transition: all .2s; }
  .comm-item:hover .comm-content { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
  .comm-type-tag { display: inline-block; }
  .comm-datetime { font-family: 'SF Mono', Monaco, monospace; }
  .comm-text { word-break: break-word; }
  .comm-followup { border-left: 3px solid #FF7D00; }
  .comm-actions { opacity: 0; transition: opacity .2s; }
  .comm-item:hover .comm-actions { opacity: 1; }

  /* ===== 按钮尺寸扩展 ===== */
  .btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 4px; line-height: 1; }

  @keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
/* 按钮文字颜色规范 */
.btn-primary { color: #FFFFFF; }
.btn-success { color: #FFFFFF; }
.btn-warning { color: #1D2129 !important; }

@media print {
  .sidebar, .header, .page-actions, .search-bar, .btn, .table-actions, .pagination { display: none !important; }
  .content { margin: 0; padding: 10mm; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  table { font-size: 12px; }
  thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

  /* 客户表格固定布局，防止列错位 */
  #customerTable { table-layout: fixed; }
  #customerTable th:nth-child(1), #customerTable td:nth-child(1) { text-align: center; } /* 复选框居中 */
  
/* 项目时间线样式 */
.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
}

.timeline-row {
  transition: all 0.2s;
}

.timeline-row:hover {
  transform: translateX(2px);
}

.stage-marker {
  z-index: 2;
  transition: all 0.2s;
}

.stage-marker:hover {
  transform: scaleY(1.2);
  background: #fff !important;
}

.today-marker {
  z-index: 10;
  box-shadow: 0 0 6px rgba(255, 77, 79, 0.6);
  animation: timeline-pulse 2s infinite;
}

@keyframes timeline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.time-axis {
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 4px;
  position: relative;
}

#projectTimelineList {
  min-height: 200px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #999;
  font-size: 14px;
}
  

/* ===== 加载状态增强 ===== */
/* 全局加载遮罩 */
.global-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px;
}
.global-loader .spinner {
  width: 40px; height: 40px; border: 3px solid var(--primary-light);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏行 */
.skeleton-row td { padding: 12px 16px; }
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%) !important; background-size: 200% 100% !important; animation: skeleton-shimmer 1.4s ease infinite; border-radius: 4px; }
@keyframes skeleton-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-text { height: 16px; margin: 8px 0; }
.skeleton-title { height: 24px; width: 60%; margin: 12px 0; }

/* 页面切换动画 */
.page-content { animation: pageFadeIn .2s ease-out; }
@keyframes pageFadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* 按钮点击反馈 */
.btn:active { transform: scale(0.97); transition: transform .1s; }

/* 表格行hover增强 */
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--bg-hover) !important; }

/* Toast动画 */
.toast { animation: toastSlideIn .3s ease-out; }
@keyframes toastSlideIn { from{transform:translateY(-100%);opacity:0} to{transform:translateY(0);opacity:1} }
.toast.hide { animation: toastFadeOut .2s ease-out forwards; }
@keyframes toastFadeOut { to{opacity:0;transform:translateY(-20px)} }
