/* ============================================================
   宣城房产交易网 · 设计系统（腾讯云风格）
   tokens → 基础重置 → 排版 → 按钮 → 表单 → 卡片/标签 → 表格
   ============================================================ */

:root {
  /* 主色阶：以宣房网品牌绿 #049C44（取自定稿 logo）为中心 */
  --brand-1: #E6F7EC;
  --brand-2: #C4EBD3;
  --brand-3: #9CDDB6;
  --brand-5: #38B475;
  --brand-6: #0CA95B;
  --brand-7: #049C44;
  --brand-8: #037F38;
  --brand-9: #025F2C;
  --navy-900: #002D18;
  --navy-800: #063A28;

  /* 辅助色 */
  --cyan-500: #04A4EC;
  --success: #2BA471;
  --success-bg: #E3F9E9;
  --warning: #E37318;
  --warning-bg: #FFF1E9;
  --danger: #D54941;
  --danger-bg: #FFEEEE;

  /* 主色别名（历史代码引用） */
  --primary: var(--brand-7);

  /* 中性色 */
  --text-1: #0E1A2B;
  --text-2: #4B5565;
  --text-3: #8A94A6;
  --text-4: #B4BCC9;
  --line: #E7EAF0;
  --line-strong: #D5DAE3;
  --bg: #F5F7FA;
  --bg-soft: #FAFBFD;
  --white: #FFFFFF;

  /* 字体 */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-num: "DIN Alternate", "Inter", "SF Pro Display", var(--font-sans);

  /* 圆角 / 阴影 */
  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-xl: 12px;
  --shadow-1: 0 1px 2px rgba(14, 26, 43, 0.04), 0 4px 12px rgba(14, 26, 43, 0.05);
  --shadow-2: 0 4px 12px rgba(14, 26, 43, 0.08), 0 16px 40px rgba(14, 26, 43, 0.10);
  --shadow-brand: 0 8px 24px rgba(4, 156, 68, 0.24);

  /* 布局 */
  --container: 1200px;
  --nav-h: 64px;
  --topbar-h: 36px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ------------------------------ 排版 ------------------------------ */

.h1 { font-size: 44px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.h2 { font-size: 30px; line-height: 1.3; font-weight: 600; letter-spacing: -0.02em; }
.h3 { font-size: 20px; line-height: 1.4; font-weight: 600; }
.h4 { font-size: 16px; line-height: 1.5; font-weight: 600; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.section-title { text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--text-3); font-size: 14px; margin-bottom: 32px; }

/* ------------------------------ 布局 ------------------------------ */

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: 20px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; } .mt-40 { margin-top: 40px; }
.hidden { display: none !important; }

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--white);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn--primary { background: var(--brand-7); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-6); box-shadow: var(--shadow-brand); }
.btn--primary:active:not(:disabled) { background: var(--brand-8); box-shadow: none; }
.btn--secondary { background: #fff; color: var(--brand-7); border-color: var(--brand-7); }
.btn--secondary:hover:not(:disabled) { background: var(--brand-1); }
.btn--ghost { background: transparent; color: var(--text-2); border-color: var(--line-strong); }
.btn--ghost:hover:not(:disabled) { color: var(--brand-7); border-color: var(--brand-7); }
.btn--text { background: transparent; color: var(--brand-7); padding: 0 8px; height: 32px; }
.btn--text:hover { background: var(--brand-1); }
.btn--danger { background: #fff; color: var(--danger); border-color: #F3C6C4; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }

/* ------------------------------ 表单 ------------------------------ */

.field { margin-bottom: 18px; }
.field__label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.field__error { font-size: 12px; color: var(--danger); margin-top: 6px; }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-7);
  box-shadow: 0 0 0 2px rgba(4, 156, 68, 0.12);
}
.input:disabled { background: var(--bg); color: var(--text-3); cursor: not-allowed; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' fill='none' stroke='%238A94A6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand-7); }

/* ------------------------------ 卡片 / 标签 ------------------------------ */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.card--hover:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: transparent; }
.card__body { padding: 20px; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  background: var(--bg);
  color: var(--text-2);
  white-space: nowrap;
}
.tag--brand { background: var(--brand-1); color: var(--brand-7); }
.tag--success { background: var(--success-bg); color: var(--success); }
.tag--warning { background: var(--warning-bg); color: var(--warning); }
.tag--danger { background: var(--danger-bg); color: var(--danger); }
.tag--dark { background: rgba(255, 255, 255, 0.12); color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-family: var(--font-num);
}

/* ------------------------------ 表格 ------------------------------ */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-soft);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: none; }

/* ------------------------------ 分页 ------------------------------ */

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; }
.pager button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-num);
}
.pager button:hover:not(:disabled) { border-color: var(--brand-7); color: var(--brand-7); }
.pager button.is-active { background: var(--brand-7); border-color: var(--brand-7); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ------------------------------ 提示 / 空态 ------------------------------ */

.toast-host {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 80vw;
  padding: 10px 16px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line);
  font-size: 13px;
  animation: toast-in 0.22s ease;
}
.toast--error { border-color: #F3C6C4; }
.toast--error .toast__dot { background: var(--danger); }
.toast--success .toast__dot { background: var(--success); }
.toast__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-7); flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 64px 24px; color: var(--text-3); }
.empty__icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--brand-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--brand-7);
}

.skeleton {
  background: linear-gradient(90deg, #F0F2F6 25%, #F7F8FA 37%, #F0F2F6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ------------------------------ 弹层 ------------------------------ */

.modal-mask {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(14, 26, 43, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fade-in 0.18s ease;
}
.modal {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--shadow-2); overflow: hidden;
  animation: modal-in 0.2s ease;
}
.modal__head { padding: 20px 24px 4px; }
.modal__body { padding: 12px 24px 4px; color: var(--text-2); }
.modal__foot { padding: 20px 24px 24px; display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
