/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #F0F3FA;
  color: #1A1A2E;
  min-height: 100vh;
}

/* ===== 导航栏 ===== */
.navbar {
  height: 60px;
  background: linear-gradient(135deg, #1677FF 0%, #0958D9 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 2px 12px rgba(22,119,255,0.35);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.navbar-right { display: flex; align-items: center; gap: 20px; }
.nav-time { font-size: 13px; color: rgba(255,255,255,0.8); }
.nav-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ===== 主内容区 ===== */
.layout { padding: 24px 32px; }

/* ===== 统计卡片 ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform .2s, box-shadow .2s;
  border-left: 4px solid transparent;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.1); }
.stat-total     { border-left-color: #1677FF; }
.stat-pending   { border-left-color: #FA8C16; }
.stat-contacted { border-left-color: #13C2C2; }
.stat-completed { border-left-color: #52C41A; }
.stat-today     { border-left-color: #722ED1; }

.stat-icon { font-size: 28px; }
.stat-num  { font-size: 30px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: #8A9BB5; margin-top: 2px; }

.stat-total     .stat-num { color: #1677FF; }
.stat-pending   .stat-num { color: #FA8C16; }
.stat-contacted .stat-num { color: #13C2C2; }
.stat-completed .stat-num { color: #52C41A; }
.stat-today     .stat-num { color: #722ED1; }

/* ===== 工具栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.search-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #E8EDF5;
  border-radius: 10px;
  padding: 0 14px;
  height: 40px;
  width: 240px;
  gap: 8px;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap:focus-within { border-color: #1677FF; box-shadow: 0 0 0 3px rgba(22,119,255,0.12); }
.search-icon { font-size: 14px; color: #AAB8D0; }
.search-input { border: none; outline: none; font-size: 14px; flex: 1; color: #1A1A2E; background: transparent; }
.search-input::placeholder { color: #C0CCE0; }
.search-clear { background: none; border: none; cursor: pointer; color: #AAB8D0; font-size: 13px; padding: 0; }
.search-clear:hover { color: #FF4D4F; }

.filter-tabs { display: flex; gap: 6px; }
.tab-btn {
  height: 36px;
  padding: 0 16px;
  border: 1.5px solid #E8EDF5;
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  color: #5A6A85;
  cursor: pointer;
  transition: all .2s;
}
.tab-btn:hover  { border-color: #1677FF; color: #1677FF; }
.tab-btn.active { border-color: #1677FF; background: #1677FF; color: #fff; }

.btn-refresh {
  height: 38px;
  padding: 0 18px;
  background: #fff;
  border: 1.5px solid #E8EDF5;
  border-radius: 8px;
  font-size: 13px;
  color: #5A6A85;
  cursor: pointer;
  transition: all .2s;
}
.btn-refresh:hover { border-color: #1677FF; color: #1677FF; }

/* ===== 数据表格 ===== */
.table-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr {
  background: #F7F9FF;
  border-bottom: 1.5px solid #EEF2FA;
}
.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #7A8AAA;
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid #F0F4FA;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #F7FAFF; }

.empty-row { text-align: center; padding: 60px 0 !important; color: #AAB8D0; font-size: 15px; }

/* 状态标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-0 { background: #FFF7E6; color: #FA8C16; }
.badge-1 { background: #E6FFFB; color: #13C2C2; }
.badge-2 { background: #F6FFED; color: #52C41A; }

/* 操作按钮 */
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn-contact { background: #E6F4FF; color: #1677FF; border-color: #BAD7FF; }
.btn-contact:hover { background: #1677FF; color: #fff; }
.btn-done    { background: #F6FFED; color: #52C41A; border-color: #B7EB8F; }
.btn-done:hover { background: #52C41A; color: #fff; }
.btn-remark  { background: #FFF7E6; color: #FA8C16; border-color: #FFD591; }
.btn-remark:hover { background: #FA8C16; color: #fff; }
.btn-del     { background: #FFF1F0; color: #FF4D4F; border-color: #FFA39E; }
.btn-del:hover { background: #FF4D4F; color: #fff; }
.btn-reset   { background: #F5F5F5; color: #8A8A8A; border-color: #D9D9D9; }
.btn-reset:hover { background: #8A8A8A; color: #fff; }

.remark-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8A9BB5; font-size: 13px; }

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 20px;
  gap: 8px;
  border-top: 1px solid #F0F4FA;
}
.page-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border: 1.5px solid #E8EDF5;
  background: #fff;
  border-radius: 7px;
  font-size: 13px;
  color: #5A6A85;
  cursor: pointer;
  transition: all .15s;
}
.page-btn:hover   { border-color: #1677FF; color: #1677FF; }
.page-btn.current { border-color: #1677FF; background: #1677FF; color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { font-size: 13px; color: #8A9BB5; margin: 0 4px; }

/* ===== 备注弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-mask.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: pop .25s ease;
}
@keyframes pop {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; }
.remark-textarea {
  width: 100%;
  height: 110px;
  border: 1.5px solid #E8EDF5;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.remark-textarea:focus { border-color: #1677FF; box-shadow: 0 0 0 3px rgba(22,119,255,0.1); }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-cancel  { height: 38px; padding: 0 22px; border: 1.5px solid #E8EDF5; background: #fff; border-radius: 9px; font-size: 14px; color: #5A6A85; cursor: pointer; }
.btn-confirm { height: 38px; padding: 0 22px; border: none; background: #1677FF; border-radius: 9px; font-size: 14px; color: #fff; cursor: pointer; font-weight: 600; }
.btn-cancel:hover  { border-color: #1677FF; color: #1677FF; }
.btn-confirm:hover { background: #0958D9; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #1A1A2E;
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: #52C41A; }
.toast.error   { background: #FF4D4F; }

/* ===== 加载动画 ===== */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #E8EDF5;
  border-top-color: #1677FF;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
