/* 房产客户管理系统 - 主样式 */

/* 基础字体 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

/* 输入框与选择框 */
.input-field {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #1e293b;
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: border-color 150ms, box-shadow 150ms;
  outline: none;
}
.input-field:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.input-field::placeholder {
  color: #94a3b8;
}

/* 表单标签 */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.375rem;
}

/* 主按钮 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background-color: #1e40af;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms;
}
.btn-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(30,64,175,0.25);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 次要按钮 */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms;
}
.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

/* 侧边栏链接 */
.sidebar-link {
  transition: all 150ms;
}
.sidebar-link.active {
  background-color: #eff6ff;
  color: #1e40af;
}
.sidebar-link.active svg {
  color: #1e40af;
}

/* 数据表格 */
.data-table {
  border-collapse: collapse;
}
.data-table thead th {
  white-space: nowrap;
  font-size: 0.8125rem;
  text-transform: none;
  letter-spacing: 0;
}
.data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 150ms;
}
.data-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}
.data-table tbody tr:hover {
  background-color: #f1f5f9;
}
.data-table td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
  color: #334155;
  font-size: 0.875rem;
}
.data-table td:first-child {
  color: #94a3b8;
  font-size: 0.8125rem;
}

/* 星级 */
.star {
  color: #e2e8f0;
  font-size: 0.875rem;
}
.star.filled {
  color: #f59e0b;
}

/* 状态标签 */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-intent {
  background-color: #eff6ff;
  color: #1e40af;
}
.badge-result-interested {
  background-color: #ecfdf5;
  color: #059669;
}
.badge-result-considering {
  background-color: #fffbeb;
  color: #d97706;
}
.badge-result-notnow {
  background-color: #f8fafc;
  color: #64748b;
}
.badge-result-closed {
  background-color: #ecfdf5;
  color: #047857;
  font-weight: 600;
}
.badge-result-lost {
  background-color: #fef2f2;
  color: #dc2626;
}

/* 房源标签 */
.property-tag {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  font-size: 0.6875rem;
  background-color: #f1f5f9;
  color: #475569;
  border-radius: 3px;
  margin: 1px 2px;
  white-space: nowrap;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5vh;
  background-color: rgba(15,23,42,0.4);
  animation: fadeIn 200ms ease-out;
}
.modal-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: slideDown 200ms ease-out;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.modal-body {
  padding: 1.25rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 排序图标 */
.sort-icon {
  display: inline-block;
  width: 14px;
  font-size: 10px;
  color: #94a3b8;
}
.sort-icon.asc::after {
  content: "▲";
  color: #1e40af;
}
.sort-icon.desc::after {
  content: "▼";
  color: #1e40af;
}

/* 分页按钮 */
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  font-size: 0.8125rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: all 150ms;
}
.page-btn:hover:not(:disabled):not(.active) {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.page-btn.active {
  background: #1e40af;
  color: #fff;
  border-color: #1e40af;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 导入模式按钮 */
.import-mode-btn {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.import-mode-btn.active {
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
}

/* 统计卡片 */
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  transition: box-shadow 150ms;
}
.stat-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* 统计条形图 */
.bar-chart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.bar-chart-label {
  width: 80px;
  font-size: 0.8125rem;
  color: #475569;
  text-align: right;
  flex-shrink: 0;
}
.bar-chart-bar {
  flex: 1;
  height: 24px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.bar-chart-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 500ms ease-out;
  min-width: 2px;
}
.bar-chart-count {
  width: 40px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1e293b;
  flex-shrink: 0;
}

/* Toast 动画 */
.toast-enter {
  animation: toastIn 300ms ease-out;
}
.toast-exit {
  animation: toastOut 200ms ease-in forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* 操作按钮组 */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 150ms;
  background: transparent;
}
.action-btn:hover {
  background: #f1f5f9;
}
.action-btn.edit { color: #3b82f6; }
.action-btn.edit:hover { background: #eff6ff; }
.action-btn.delete { color: #ef4444; }
.action-btn.delete:hover { background: #fef2f2; }

/* 移动端表格优化 */
@media (max-width: 1024px) {
  .data-table {
    font-size: 0.8125rem;
  }
  .data-table td,
  .data-table th {
    padding: 0.5rem;
  }
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 包子动图弹跳动画 */
@keyframes baoziBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.baozi-bounce {
  animation: baoziBounce 1.5s ease-in-out infinite;
}
