/* ============================================================
   IP CRM 系统 - 全局样式
   ============================================================ */

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #0ea5e9;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-bg: #0f172a;
  --sidebar-width: 220px;
  --topbar-h: 56px;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition: all .2s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ---- 布局框架 ---- */
#app { display: flex; height: 100vh; width: 100vw; }

/* 登录页样式 */
#loginPage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
}

/* ---- 侧边栏 ---- */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 100;
  overflow: hidden;
}
.sidebar-logo {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar-logo .logo-text { color: #f1f5f9; font-size: 13px; font-weight: 600; line-height: 1.3; }
.sidebar-logo .logo-sub { color: #64748b; font-size: 10px; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section-title { color: #475569; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 8px 8px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer;
  color: #94a3b8; font-size: 13px; font-weight: 500;
  transition: var(--transition); margin-bottom: 2px;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.nav-item.active { background: rgba(59,130,246,.2); color: #60a5fa; }
.nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: #ef4444; color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 10px; font-weight: 600;
}

.sidebar-user {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,.04); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-info .user-name { color: #e2e8f0; font-size: 12px; font-weight: 600; }
.user-info .user-role { color: #64748b; font-size: 10px; }

/* ---- 主内容区 ---- */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ---- 顶部栏 ---- */
#topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 12px;
  flex-shrink: 0; position: relative; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px; min-width: 220px;
}
.topbar-search input { border: none; background: none; outline: none; font-size: 13px; color: var(--text); width: 100%; }
.topbar-search input::placeholder { color: var(--text-light); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted); transition: var(--transition); position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.notif-dot {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}

/* ---- 内容区域 ---- */
#content {
  flex: 1; overflow-y: auto; padding: 20px;
}

/* ---- 卡片 ---- */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.card-body { padding: 20px; }

/* ---- 统计卡片 ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition); cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.stat-info .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-info .stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-info .stat-change { font-size: 11px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ---- 可点击钻取（仪表板） ---- */
.stat-card.drillable { cursor: pointer; position: relative; }
.stat-card.drillable::after {
  content: '›';
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  font-size: 20px; font-weight: 700; color: var(--text-muted); opacity: 0.35;
  transition: var(--transition);
}
.stat-card.drillable:hover { border-color: var(--primary); }
.stat-card.drillable:hover::after { opacity: 1; color: var(--primary); transform: translateY(-50%) translateX(2px); }
.alert-banner.drillable { cursor: pointer; }
.alert-banner.drillable:hover { filter: brightness(0.97); text-decoration: underline; text-decoration-style: dotted; }
.funnel-stage.drillable { cursor: pointer; }
.funnel-stage.drillable:hover { filter: brightness(1.08); transform: translateX(3px); }

/* ---- 钻取弹窗内部 ---- */
.dd-summary {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 12px; color: var(--text-muted); margin-bottom: 14px;
}
.dd-section {
  font-size: 12px; font-weight: 700; color: var(--text);
  padding: 8px 0 6px; margin-top: 6px; border-bottom: 1px dashed var(--border);
}
.dd-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9;
  transition: var(--transition);
}
.dd-row:hover { background: #f8fafc; }
.dd-row:last-child { border-bottom: none; }
.dd-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.dd-line { flex: 1; min-width: 0; }
.dd-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-sub {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.dd-actions { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.dd-empty { text-align: center; color: var(--text-muted); padding: 28px 0; font-size: 13px; }

/* ---- 公告监控：汇总 chips（可点击钻取） ---- */
.mo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: #f8fafc; color: var(--text-muted); cursor: pointer;
  transition: var(--transition); white-space: nowrap; font-size: 12px;
}
.mo-chip strong { color: var(--text); font-weight: 700; }
.mo-chip:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.mo-chip:hover strong { color: var(--primary); }
.mo-chip-danger { border-color: #fecaca; background: #fef2f2; color: var(--danger); }
.mo-chip-danger strong { color: var(--danger); }
.mo-chip-danger:hover { border-color: var(--danger); background: #fee2e2; color: var(--danger); }
.mo-chip-danger:hover strong { color: var(--danger); }
.mo-status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.mo-status-ok { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.mo-status-warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #f8fafc; padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* ---- 徽章/标签 ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: var(--transition);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-ghost { background: transparent; color: var(--primary-light); padding: 4px 8px; }
.btn-ghost:hover { background: #dbeafe; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; min-width: 32px; justify-content: center; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; color: var(--text); background: var(--card);
  outline: none; transition: var(--transition);
}
.form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---- 模态框 ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px); animation: fadeIn .2s ease;
}
.modal {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 90%; max-width: 680px; max-height: 85vh;
  display: flex; flex-direction: column; animation: slideUp .25s ease;
}
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.modal-header .modal-title { font-size: 15px; font-weight: 700; flex: 1; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-shrink: 0;
}

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

/* ---- 面包屑 ---- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--primary-light); cursor: pointer; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---- 标签页 ---- */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 4px; }
.tab-item {
  padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition); white-space: nowrap;
}
.tab-item:hover { color: var(--text); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- 空状态 ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 14px; }

/* ---- 进度条 ---- */
.progress { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* ---- 头像组 ---- */
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ---- 客户等级圆点 ---- */
.level-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0;
}

/* ---- 预警闪烁 ---- */
@keyframes blink-danger {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.blink-danger { animation: blink-danger 1.5s infinite; }

/* ---- 看板 ---- */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; min-height: 300px; }
.kanban-col { min-width: 240px; flex-shrink: 0; }
.kanban-col-header {
  padding: 10px 14px; border-radius: 8px 8px 0 0;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: space-between;
}
.kanban-cards { background: #f1f5f9; border-radius: 0 0 8px 8px; min-height: 100px; padding: 8px; }
.kanban-card {
  background: var(--card); border-radius: 7px; padding: 12px; margin-bottom: 8px;
  border: 1px solid var(--border); cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow);
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---- 评分星级 ---- */
.score-bar {
  height: 4px; border-radius: 2px; overflow: hidden; background: #e2e8f0;
  display: inline-block; width: 60px; vertical-align: middle; margin-left: 6px;
}
.score-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #22c55e); }

/* ---- 警告横幅 ---- */
.alert-banner {
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  #sidebar { width: 60px; }
  .sidebar-logo .logo-text, .nav-item span:not(.nav-icon), .user-info, .nav-section-title { display: none; }
  .nav-item { justify-content: center; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ---- 图表容器 ---- */
.chart-container { position: relative; width: 100%; }

/* ---- 时间线 ---- */
.timeline { position: relative; }
.timeline-item { display: flex; gap: 14px; margin-bottom: 20px; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary-light);
  flex-shrink: 0; margin-top: 5px; border: 2px solid var(--card); box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-line::before {
  content: ''; position: absolute; left: 4px; top: 20px; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-content .tl-date { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.timeline-content .tl-title { font-size: 13px; font-weight: 600; }
.timeline-content .tl-body { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- 通知下拉 ---- */
.notif-dropdown {
  position: absolute; top: calc(var(--topbar-h)); right: 60px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); width: 340px; z-index: 200; overflow: hidden;
}
.notif-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid #f8fafc; display: flex; gap: 10px;
  cursor: pointer; transition: var(--transition);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: #eff6ff; }
.notif-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.notif-text .notif-title { font-size: 12px; font-weight: 700; }
.notif-text .notif-msg { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-text .notif-time { font-size: 10px; color: var(--text-light); margin-top: 4px; }

/* ---- 搜索高亮 ---- */
.highlight { background: #fef9c3; border-radius: 2px; padding: 0 2px; }

/* ---- 仪表板特殊样式 ---- */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.dashboard-left { display: flex; flex-direction: column; gap: 20px; }
.dashboard-right { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

.risk-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.risk-item:last-child { border-bottom: none; }

/* ---- 邮箱状态指示器 ---- */
.email-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.email-connected { background: #dcfce7; color: #15803d; }
.email-disconnected { background: #fee2e2; color: #b91c1c; }

/* ---- 权限矩阵表格 ---- */
.perm-matrix th, .perm-matrix td { text-align: center; padding: 10px; }
.perm-matrix thead th:first-child { text-align: left; }
.perm-matrix tbody td:first-child { text-align: left; font-weight: 600; }
.perm-check { color: var(--success); font-size: 16px; }
.perm-cross { color: #e2e8f0; font-size: 16px; }

/* ---- 报价单特效 ---- */
.quote-preview {
  border: 2px solid var(--border); border-radius: 8px; padding: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}
.quote-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.quote-logo { font-size: 18px; font-weight: 800; color: var(--primary); }
.quote-title { font-size: 22px; font-weight: 800; text-align: center; color: var(--text); margin: 16px 0; padding-bottom: 12px; border-bottom: 2px solid var(--border); }

/* ---- 漏斗图 ---- */
.funnel-stage {
  margin: 0 auto; border-radius: 6px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; margin-bottom: 4px; color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.funnel-stage:hover { filter: brightness(1.1); transform: scaleX(1.02); }

/* ---- 加载动画 ---- */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--primary-light); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Toast ---- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  min-width: 280px; font-size: 13px; animation: slideIn .3s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
.toast-warning { border-left: 3px solid var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- 详情页布局 ---- */
.detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; }

/* ---- 客户信息卡片 ---- */
.client-header-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius); padding: 20px; color: #fff; margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px;
}
.client-header-avatar {
  width: 56px; height: 56px; border-radius: 12px;
  background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; flex-shrink: 0;
}
.client-header-info .client-name { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.client-header-info .client-meta { font-size: 12px; opacity: .8; display: flex; gap: 12px; }

/* ═══════════════════════════════════════════
   文档库模块样式
══════════════════════════════════════════════ */

/* 统计卡片 */
.doc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 768px) { .doc-stats { grid-template-columns: repeat(2, 1fr); } }

/* 工具栏 */
.doc-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* 卡片视图 */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.doc-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37,99,235,.12);
  transform: translateY(-2px);
}
.doc-card-icon { margin-bottom: 12px; }
.doc-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 6px;
}
.doc-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}
.doc-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}
.doc-card:hover .doc-card-actions { opacity: 1; }
.doc-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* 列表视图 */
.doc-list-table th, .doc-list-table td {
  vertical-align: middle;
}
.doc-list-table .doc-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 拖拽上传区域 */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-main);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(37,99,235,.04);
}

/* 待上传队列 */
.upload-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-main);
  border-radius: 8px;
  margin-bottom: 8px;
}
.upload-queue-item .file-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-queue-item .file-size {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.upload-progress {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.upload-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s;
}

/* 预览弹窗 */
#preview-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
#preview-body iframe {
  width: 100%;
  min-height: 70vh;
  border: none;
}

/* 视图切换按钮 */
.doc-view-btn.active {
  background: var(--primary);
  color: #fff;
}

/* 上传成功标记 */
.upload-status-ok { color: #16a34a; font-size: 18px; }
.upload-status-err { color: #dc2626; font-size: 18px; }

/* 公告监控模块 */
.text-danger { color: #ef4444; font-weight: 600; }
.text-warning { color: #f59e0b; font-weight: 600; }
.text-success { color: #22c55e; font-weight: 600; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.mo-gazette-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-muted); font-size: 14px;
}
.mo-gazette-empty {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
