/* ============================================================
   升途1对1·销售支持工作台 —— 全局样式
   风格：蓝白商务风，简洁无多余装饰
   适配：1920×1080 主流 PC 分辨率，兼容 Chrome / Edge
   ============================================================ */

/* ---------- 1. 变量：统一管理配色与尺寸 ---------- */
:root {
  /* 主色（品牌深蓝） */
  --brand: #0D51BC;
  --brand-dark: #0d3a9e;
  --brand-light: #e8f0fe;
  --brand-lighter: #f4f8ff;

  /* 中性色 */
  --bg: #f2f5fa;
  --surface: #ffffff;
  --border: #e3e8f0;
  --border-strong: #cdd6e4;

  /* 文字 */
  --text: #1c2536;
  --text-sub: #5b6779;
  --text-mute: #8e9aad;
  --text-invert: #ffffff;

  /* 语义色 */
  --success: #0f9d58;
  --warn: #e8a33d;
  --danger: #d93025;
  --info: #5b8def;

  /* 尺寸 */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(19, 76, 201, 0.06);
  --shadow: 0 2px 10px rgba(19, 76, 201, 0.08);
  --shadow-lg: 0 8px 28px rgba(19, 76, 201, 0.14);

  /* 布局 */
  --header-h: 60px;
  --maxw: 1680px;
}

/* ---------- 2. 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 3. 通用原子类 ---------- */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.gap16 { gap: 16px; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.mb24 { margin-bottom: 24px; }
.text-sub { color: var(--text-sub); }
.text-mute { color: var(--text-mute); }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.grow { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--text-invert); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--surface); color: var(--text-sub); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-lighter); }
.btn-danger { background: var(--danger); color: var(--text-invert); }
.btn-danger:hover { opacity: 0.88; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- 5. 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: 13px; color: var(--text-sub); font-weight: 500;
}
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(19, 76, 201, 0.1);
}
.select { cursor: pointer; }

.checkbox { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-sub); }
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--border-strong); position: relative; transition: background 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- 6. 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

/* ---------- 7. 表格 ---------- */
.table { font-size: 13px; }
.table th {
  padding: 11px 14px; text-align: left; font-weight: 600; color: var(--text-sub);
  background: var(--brand-lighter); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.table tbody tr:hover { background: var(--brand-lighter); }
.table .empty { text-align: center; color: var(--text-mute); padding: 44px 0; }

/* ---------- 8. 标签 / 徽章 ---------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; line-height: 18px; background: var(--brand-light); color: var(--brand);
}
.tag-gray { background: #eef1f6; color: var(--text-sub); }
.tag-green { background: #e6f6ed; color: var(--success); }
.tag-orange { background: #fdf3e3; color: var(--warn); }
.tag-red { background: #fdeceb; color: var(--danger); }

/* ---------- 9. 提示条 ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--brand-lighter); border: 1px solid #d6e4fb;
  color: var(--text-sub); font-size: 13px; line-height: 1.65;
}
.notice-warn { background: #fdf8ee; border-color: #f5e2c0; color: #8a6318; }
.notice-danger { background: #fdeceb; border-color: #f7cfcb; color: #a1271d; }

/* ---------- 10. 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 25, 45, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 900;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 520px; max-width: 92vw;
  max-height: 86vh; display: flex; flex-direction: column;
}
.modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 22px; color: var(--text-mute); line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ---------- 11. 消息提示 ---------- */
#toast-wrap {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 20px; border-radius: var(--radius-sm);
  background: rgba(28, 37, 54, 0.92); color: #fff; font-size: 14px;
  box-shadow: var(--shadow); max-width: 520px; line-height: 1.6;
  animation: toast-in 0.22s ease;
}
.toast-success { background: rgba(15, 157, 88, 0.95); }
.toast-error { background: rgba(217, 48, 37, 0.95); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 12. 页面水印（防截图外传）---------- */
#watermark-layer {
  position: fixed; inset: 0; z-index: 800;
  pointer-events: none; overflow: hidden;
}
#watermark-layer .wm-item {
  position: absolute; transform: rotate(-22deg);
  color: rgba(19, 76, 201, 0.09);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  user-select: none;
}

/* ---------- 13. 分页 ---------- */
.pager {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-sub);
}
.pager button {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-sub); background: var(--surface);
}
.pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 14. 加载态 ---------- */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-mute); font-size: 14px;
}
.spinner {
  width: 22px; height: 22px; margin-right: 10px;
  border: 2px solid var(--border-strong); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 15. 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c6cfdd; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #aab6c8; }
::-webkit-scrollbar-track { background: transparent; }