/* ============================================================
  crane-quote 全局样式 - 精致彩色风 v2
  ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #4f46e5;
  --primary-light: #eef2ff;
  --primary-dark:  #4338ca;
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #0891b2;
  --gray-50:       #f9fafb;
  --gray-100:      #f3f4f6;
  --gray-200:      #e5e7eb;
  --gray-300:      #d1d5db;
  --gray-400:      #9ca3af;
  --gray-500:      #6b7280;
  --gray-600:      #4b5563;
  --gray-700:      #374151;
  --gray-800:      #1f2937;
  --gray-900:      #111827;
  --white:         #ffffff;
  --sidebar-w:     252px;
  --header-h:      62px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.08);
  --shadow-sm:     0 2px 8px rgba(0,0,0,.07);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    .22s cubic-bezier(.4,0,.2,1);
}

html, body { height: 100%; font-family: 'PingFang SC','Microsoft YaHei',-apple-system,BlinkMacSystemFont,sans-serif; font-size: 14px; color: var(--gray-800); background: #f1f5f9; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; color: var(--primary-dark); }

/* ---- 布局 ---- */
.app-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition);
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.sidebar-logo {
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-weight: 700; font-size: 16px; color: #fff;
  white-space: nowrap; overflow: hidden;
}
.sidebar-logo svg { flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.sidebar-logo span { text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  color: rgba(255,255,255,.65); cursor: pointer;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap; overflow: hidden;
  font-size: 14px;
  border-left: 3px solid transparent;
  margin: 1px 8px;
  border-radius: 8px;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; border-left-color: #a5b4fc; }
.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-item span { overflow: hidden; white-space: nowrap; }

.nav-group-title {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.3);
  padding: 18px 22px 6px; text-transform: uppercase; letter-spacing: .1em;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,.4);
}
.user-info { overflow: hidden; flex: 1; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,.9); }
.user-role { font-size: 11px; color: rgba(255,255,255,.4); }
.logout-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.logout-btn:hover { background: rgba(239,68,68,.2); color: #fca5a5; }

.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.main-header {
  height: var(--header-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.page-title { font-size: 18px; font-weight: 700; color: var(--gray-800); letter-spacing: -.01em; }

/* ---- 常用导航 ---- */
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.bookmark-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--gray-800);
  border: 1px solid transparent;
}
.bookmark-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  border-color: var(--primary);
  color: var(--primary);
}
.bookmark-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.bookmark-info { overflow: hidden; }
.bookmark-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bookmark-desc { font-size: 11px; color: var(--gray-500); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bookmark-section { margin-bottom: 32px; }
.bookmark-section h3 {
  font-size: 15px; font-weight: 700; color: var(--gray-700);
  margin-bottom: 14px; padding-left: 4px; display: flex; align-items: center; gap: 8px;
}
.bookmark-section h3::before {
  content: ''; width: 4px; height: 16px; background: var(--primary); border-radius: 2px;
}

/* ---- 卡片 ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.04);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--white);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.card-body { padding: 24px; }

/* ---- 统计卡片 ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,.05);
  padding: 22px;
  display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.stat-icon.blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.stat-icon.green  { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #16a34a; }
.stat-icon.yellow { background: linear-gradient(135deg, #fef9c3, #fef08a); color: #d97706; }
.stat-icon.red    { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.stat-icon.cyan   { background: linear-gradient(135deg, #ecfeff, #cffafe); color: #0891b2; }
.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.stat-icon.orange { background: linear-gradient(135deg, #ffedd5, #fed7aa); color: #ea580c; }
.stat-icon.gray  { background: linear-gradient(135deg, var(--gray-100), var(--gray-200)); color: var(--gray-400); }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; color: var(--gray-900); letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 5px; font-weight: 500; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  outline: none;
  letter-spacing: .01em;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary   { background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; border-color: #4f46e5; }
.btn-primary:hover { background: linear-gradient(135deg, #4338ca, #4f46e5); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.btn-success   { background: linear-gradient(135deg, #059669, #10b981); color: #fff; border-color: #059669; }
.btn-success:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(5,150,105,.3); }
.btn-danger    { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; border-color: #dc2626; }
.btn-danger:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,.3); }
.btn-warning   { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; border-color: #d97706; }
.btn-outline   { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); box-shadow: none; }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); transform: translateY(-1px); }
.btn-ghost     { background: transparent; color: var(--gray-500); border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-sm  { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn-xs  { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.form-control:disabled { background: var(--gray-50); color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 96px; }
select.form-control { cursor: pointer; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
table { width: 100%; border-collapse: collapse; }
table img { max-width: 48px; max-height: 48px; object-fit: cover; border-radius: 4px; cursor: pointer; }
table .no-img { color: #bbb; font-size: 12px; }
thead th {
  background: var(--gray-50); padding: 12px 16px;
  font-size: 11px; font-weight: 700; color: var(--gray-500);
  text-align: left; border-bottom: 1px solid var(--gray-200);
  white-space: nowrap; letter-spacing: .04em; text-transform: uppercase;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; font-size: 14px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ---- 徽标 ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
.badge-purple  { background: #ede9fe; color: #5b21b6; }
.badge-cyan    { background: #cffafe; color: #155e75; }
.badge-orange  { background: #ffedd5; color: #c2410c; }

/* ---- 模态框 ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5); backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s cubic-bezier(.4,0,.2,1);
}
.modal-lg  { max-width: 820px; }
.modal-xl  { max-width: 1020px; }
.modal-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  color: var(--gray-400); display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 24px 26px; }
.modal-footer {
  padding: 18px 26px 22px;
  border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: 10px;
}
@keyframes modalIn { from { opacity:0; transform:scale(.94) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }

/* ---- 搜索/筛选栏 ---- */
.filter-bar {
  display: flex; align-items: center; gap: 6px; overflow: hidden;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--white);
}
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box input { padding-left: 32px; width: 100%; border-radius: 7px; }
.search-box .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-label { font-size: 13px; color: var(--gray-500); white-space: nowrap; font-weight: 500; }
.filter-select {
  padding: 6px 8px; min-width: 90px; max-width: 110px; border-radius: 7px;
  font-size: 12px; cursor: pointer; white-space: nowrap;
}

/* ---- 分页 ---- */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 18px 24px; }
.page-btn {
  min-width: 34px; height: 34px; border-radius: 8px;
  border: 1.5px solid var(--gray-200); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; color: var(--gray-600);
  transition: all var(--transition);
  font-weight: 500;
}
.page-btn:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--gray-800); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---- 进度条 ---- */
.progress { height: 6px; background: var(--gray-100); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #818cf8); transition: width .4s; box-shadow: 0 1px 3px rgba(99,102,241,.4); }
.progress-bar.success { background: linear-gradient(90deg, #059669, #10b981); box-shadow: 0 1px 3px rgba(5,150,105,.4); }
.progress-bar.warning { background: linear-gradient(90deg, #d97706, #f59e0b); }

/* ---- 分页样式 ---- */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 16px 0;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
}

.page-btn:hover:not(.disabled):not(.active) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.page-btn.active {
  background: #818cf8;
  border-color: #818cf8;
  color: #fff;
  font-weight: 600;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-ellipsis {
  padding: 0 4px;
  color: #94a3b8;
}

.page-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 13px;
}

.page-input {
  width: 50px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
}

.page-input:focus {
  outline: none;
  border-color: #818cf8;
}

@media (max-width: 768px) {
  .pagination {
    gap: 4px;
  }
  .page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    font-size: 12px;
  }
  .page-jump {
    margin-left: 8px;
    padding-left: 8px;
  }
}

/* ---- 提示框 ---- */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-sm);
  background: var(--gray-800); color: #fff;
  font-size: 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .28s cubic-bezier(.4,0,.2,1);
  min-width: 220px; font-weight: 500;
}
.toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.toast.error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast.warning { background: linear-gradient(135deg, #d97706, #f59e0b); }
@keyframes toastIn { from { opacity:0; transform:translateX(24px) scale(.95); } to { opacity:1; transform:translateX(0) scale(1); } }

/* ---- 空状态 ---- */
.empty-state { text-align: center; padding: 64px 20px; color: var(--gray-400); }
.empty-state svg { margin-bottom: 14px; opacity: .3; }
.empty-state p { font-size: 15px; font-weight: 500; }

/* ---- 图片缩略图 ---- */
.img-thumb {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--gray-200);
  transition: transform .15s, box-shadow .15s;
}
.img-thumb:hover { transform: scale(1.1); box-shadow: var(--shadow); }

/* ---- 图表容器 ---- */
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-wrap { height: 280px; }

/* ---- 付款类型色彩 ---- */
.pay-deposit  { color: #0891b2; }
.pay-mid      { color: #d97706; }
.pay-factory  { color: #4f46e5; }
.pay-balance  { color: #059669; }
.pay-extra    { color: #7c3aed; }
.pay-freight  { color: var(--gray-500); }

/* ---- 登录页 ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#1e1b4b 0%,#312e81 50%,#4f46e5 100%); }
.login-card { background: rgba(255,255,255,.95); border-radius: var(--radius-lg); padding: 48px 44px; width: 100%; max-width: 440px; box-shadow: 0 25px 60px rgba(0,0,0,.3); backdrop-filter: blur(20px); }
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo h1 { font-size: 22px; font-weight: 800; color: #4f46e5; margin-top: 10px; letter-spacing: -.02em; }
.login-logo p  { font-size: 13px; color: var(--gray-400); margin-top: 5px; }

/* ---- 响应式 ---- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
}

/* ===== 移动端完整适配 ===== */
/* 汉堡菜单按钮 */
.sidebar-toggle {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 200;
  width: 40px; height: 40px; border-radius: 10px;
  background: #312e81; border: none; cursor: pointer;
  color: #fff; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: #1e1b4b; }

/* 侧边栏遮罩 */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

@media (max-width: 768px) {
  /* 显示汉堡 */
  .sidebar-toggle { display: flex; }

  /* 侧边栏默认隐藏在左侧 */
  .sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 150;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-logo span, .nav-item span, .sidebar-footer .user-info,
  .sidebar-footer .logout-btn, .nav-group-title { display: flex !important; }
  .nav-item span, .sidebar-logo span { display: inline !important; }
  .nav-group-title { display: block !important; }
  .sidebar-footer .user-info { display: block !important; }

  /* 遮罩层 */
  .sidebar-backdrop.open { display: block; }

  /* 主区域不缩进 */
  .main-wrapper { margin-left: 0 !important; }

  /* 顶部留出汉堡按钮空间 */
  .main-header { padding: 0 16px 0 64px; }
  .page-title { font-size: 15px; }

  /* 内容区 */
  .main-content { padding: 16px 12px; }

  /* 统计卡片 */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 40px; height: 40px; border-radius: 10px; }

  /* 图表 */
  .chart-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 220px; }

  /* 筛选栏 */
  .filter-bar { padding: 8px 10px; gap: 6px; }
  .search-box input { width: 100%; }
  .filter-select { min-width: 0; flex: 1; }

  /* 表格：横向滚动 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 700px; }
  tbody td, thead th { padding: 10px 10px; font-size: 12px; }

  /* 模态框：全屏 */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal, .modal-lg, .modal-xl {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }
  .modal-body { padding: 16px; }
  .modal-header { padding: 16px 16px 12px; }
  .modal-footer { padding: 12px 16px 24px; }

  /* 表单行在移动端改为纵向 */
  .form-row { flex-direction: column; gap: 0; }
  .form-row .form-group { flex: none; }

  /* 卡片头部 */
  .card-header { padding: 14px 16px 12px; flex-wrap: wrap; gap: 8px; }
  .card-header .flex { flex-wrap: wrap; }

  /* 浮动按钮 */
  .float-add-btn { bottom: 20px; right: 20px; width: 50px; height: 50px; }

  /* 分页 */
  .pagination { padding: 12px 16px; justify-content: center; gap: 4px; }
  .page-btn { min-width: 30px; height: 30px; font-size: 12px; }

  /* 弹窗内统计 */
  .modal-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .modal-stat-box { padding: 10px; }
  .modal-stat-box .val { font-size: 16px; }

  /* 确认框 */
  .confirm-box { max-width: 320px; padding: 20px; }

  /* Toast靠顶 */
  .toast-container { top: 14px; right: 12px; left: 12px; }
  .toast { min-width: 0; font-size: 13px; }
}

/* ---- 其他工具类 ---- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-3 { margin-bottom: 12px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-gray { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 18px 0; }

/* 图片预览遮罩 */
.img-preview-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.85);
  backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
.img-preview-overlay.hidden { display: none; }
.img-preview-overlay img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.img-preview-close {
  position: absolute; top: 24px; right: 24px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none;
  color: #fff; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.img-preview-close:hover { background: rgba(255,255,255,.25); }

/* 附件卡片 */
.attach-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 10px;
  background: var(--gray-50); border: 1.5px solid var(--gray-200);
  margin-bottom: 8px; transition: all var(--transition);
}
.attach-card:hover { background: var(--gray-100); border-color: var(--primary); }
.attach-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: #dbeafe; color: #2563eb;
}

/* WhatsApp按钮 */
.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; border: none;
  border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all var(--transition); cursor: pointer;
}
.btn-whatsapp:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,211,102,.3); }

/* 合同明细类型标签 */
.comm-type-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.comm-type-self    { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
.comm-type-company { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #155e75; }
.comm-type-coop   { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #5b21b6; }

/* 浮动添加按钮 */
.float-add-btn {
  position: fixed; bottom: 32px; right: 32px;
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(79,70,229,.4);
  transition: all var(--transition); z-index: 50;
}
.float-add-btn:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 32px rgba(79,70,229,.5); }

/* ============================================================
   精致UI增强 v3 - 更彻底美化
   ============================================================ */

/* 文字链接增强为按钮样式 */
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gray-50);
  color: var(--primary);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.link-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,.25);
}
.link-btn.success {
  background: #ecfdf5;
  color: var(--success);
  border-color: #a7f3d0;
}
.link-btn.success:hover {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.link-btn.danger {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}
.link-btn.danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.link-btn.info {
  background: #ecfeff;
  color: var(--info);
  border-color: #a5f3fc;
}
.link-btn.info:hover {
  background: var(--info);
  color: #fff;
  border-color: var(--info);
}
.link-btn.warning {
  background: #fffbeb;
  color: var(--warning);
  border-color: #fde68a;
}
.link-btn.warning:hover {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

/* 操作按钮组 */
.action-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 表格行悬停高亮 */
tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}
tbody tr:hover td {
  background: #f0f5ff !important;
}
tbody tr:hover td:first-child {
  border-left: 3px solid var(--primary);
  padding-left: 13px;
}

/* 客户卡片式详情 */
.detail-modal-card {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1.5px solid var(--gray-200);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.detail-modal-card .card-avatar {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5, #818cf8);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(79,70,229,.3);
}
.detail-modal-card .card-avatar.orange {
  background: linear-gradient(135deg, #ea580c, #fb923c);
  box-shadow: 0 4px 16px rgba(234,88,12,.3);
}
.detail-modal-card h3 {
  font-size: 18px; font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.detail-modal-card .subtitle {
  font-size: 13px;
  color: var(--gray-500);
}
.detail-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.detail-field:last-child { border-bottom: none; }
.detail-field .field-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gray-500);
}
.detail-field .field-icon svg { width: 16px; height: 16px; }
.detail-field .field-content { flex: 1; }
.detail-field .field-label { font-size: 11px; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.detail-field .field-value { font-size: 14px; color: var(--gray-800); font-weight: 500; margin-top: 2px; }
.detail-field .field-value a { color: var(--primary); }
.detail-field .field-value a:hover { text-decoration: underline; }

/* 跟进记录增强 */
.followup-timeline {
  position: relative;
  padding-left: 24px;
}
.followup-timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--gray-200));
}
.followup-item {
  position: relative;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.followup-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(79,70,229,.12);
  transform: translateX(4px);
}
.followup-item::before {
  content: '';
  position: absolute;
  left: -20px; top: 18px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.followup-item .followup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.followup-item .followup-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}
.followup-item .followup-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 3px 10px;
  border-radius: 20px;
}
.followup-item .followup-channel {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.followup-item .followup-channel.phone { background: #dbeafe; color: #1e40af; }
.followup-item .followup-channel.whatsapp { background: #dcfce7; color: #15803d; }
.followup-item .followup-channel.email { background: #fef9c3; color: #854d0e; }
.followup-item .followup-channel.wechat { background: #ecfeff; color: #155e75; }
.followup-item .followup-channel.other { background: var(--gray-100); color: var(--gray-500); }
.followup-item .followup-creator { display:inline-block;padding:1px 8px;border-radius:20px;font-size:11px;font-weight:500;background:#ede9fe;color:#6d28d9;margin-left:4px; }
.followup-item .followup-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-700);
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}
.followup-item .followup-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  justify-content: flex-end;
}

/* 跟进添加表单增强 */
.followup-form-card {
  background: linear-gradient(135deg, #eef2ff, #f0fdfa);
  border: 1.5px solid #c7d2fe;
  border-radius: 14px;
  padding: 18px;
  margin-top: 16px;
}
.followup-form-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.followup-form-card h4 svg { width: 18px; height: 18px; }

/* 表格单元格内按钮紧凑布局 */
td .action-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* 确认对话框增强 */
.confirm-dialog {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-dialog.hidden { display: none; }
.confirm-box {
  background: var(--white);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,.2);
  animation: confirmIn .25s cubic-bezier(.4,0,.2,1);
}
.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.confirm-icon.warning { background: #fef3c7; color: #d97706; }
.confirm-icon.danger { background: #fee2e2; color: #dc2626; }
.confirm-icon.info { background: #dbeafe; color: #2563eb; }
.confirm-box h3 { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 8px; color: var(--gray-800); }
.confirm-box p { font-size: 14px; color: var(--gray-500); text-align: center; margin-bottom: 22px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { min-width: 100px; justify-content: center; }
@keyframes confirmIn { from { opacity:0; transform:scale(.9); } to { opacity:1; transform:scale(1); } }

/* 筛选标签胶囊 */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}
.filter-pill:hover { background: var(--gray-200); }
.filter-pill.active {
  background: var(--primary);
  color: #fff;
}

/* 统计卡片增强 */
.stat-card .stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 6px;
}
.stat-card .stat-trend.up { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }

/* 弹窗内部统计 */
.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.modal-stat-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.modal-stat-box .val { font-size: 20px; font-weight: 800; color: var(--gray-800); }
.modal-stat-box .lab { font-size: 11px; color: var(--gray-500); margin-top: 4px; font-weight: 600; }
.modal-stat-box.primary { background: #eef2ff; border-color: #c7d2fe; }
.modal-stat-box.primary .val { color: var(--primary); }
.modal-stat-box.success { background: #ecfdf5; border-color: #a7f3d0; }
.modal-stat-box.success .val { color: var(--success); }

/* 表格加载动画 */
.loading-row td { animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.5; } }

/* 空状态增强 */
.empty-state-new {
  text-align: center;
  padding: 60px 20px;
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: 16px;
  margin: 20px 0;
}
.empty-state-new svg { width: 64px; height: 64px; color: var(--gray-300); margin-bottom: 16px; }
.empty-state-new h4 { font-size: 16px; font-weight: 700; color: var(--gray-500); margin-bottom: 6px; }
.empty-state-new p { font-size: 13px; color: var(--gray-400); margin-bottom: 16px; }

/* 标签页 */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active {
  color: var(--primary);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}
