/* ============================================================
   房管家 · Web 版全局样式 v2（移动端优先 · 设计系统）
   主色 #185FA5 / 价格红 #E64340 / 背景 #F4F6FA
   设计原则：留白 · 极简线条 · 轻量配色 · 卡片呼吸感
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 色彩 */
  --primary: #185FA5;
  --primary-deep: #10487E;
  --primary-soft: #E8F2FC;
  --grad-main: linear-gradient(135deg, #1A6BC4 0%, #2F8FE0 100%);
  --grad-deep: linear-gradient(135deg, #10487E 0%, #185FA5 100%);
  --danger: #E64340;
  --success: #0A8F5D;
  --warning: #D48806;
  --text: #1A1F26;
  --text-2: #4E5661;
  --muted: #98A0AB;
  --line: #EEF1F5;
  --bg: #F4F6FA;
  --card: #FFFFFF;

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  /* 阴影 */
  --sh-sm: 0 1px 3px rgba(16, 72, 126, .04);
  --sh-md: 0 6px 20px rgba(16, 72, 126, .07);
  --sh-lg: 0 16px 40px rgba(16, 72, 126, .12);

  /* 安全区（iOS 底部横条） */
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 移动端画布：居中 + 充足留白 ---------- */
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 16px 120px;
}

/* 卡片入场动画 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 顶部导航（毛玻璃） ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
}
.navbar .title { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.navbar .back, .navbar .action {
  font-size: 14px; color: var(--primary); cursor: pointer;
  background: none; border: none; padding: 4px 8px;
  font-weight: 500;
}
.navbar .action:active { opacity: .6; }

/* ---------- 卡片（呼吸感） ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--sh-sm);
  border: 1px solid rgba(255, 255, 255, .8);
  animation: fadeUp .35s ease both;
}
.card .card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

/* 区块标题 */
.section-title { font-size: 16px; font-weight: 600; margin: 18px 2px 12px; display: flex; align-items: center; }
.section-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: var(--grad-main); margin-right: 8px;
}
.section-title .more { font-size: 12px; font-weight: 400; }

/* ---------- 楼盘卡片 ---------- */
.building-card { display: flex; align-items: center; }
.building-card .info { flex: 1; min-width: 0; }
.building-card .name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.building-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.building-card .price { color: var(--danger); font-weight: 600; font-size: 16px; }
.building-card .price .unit { font-size: 12px; font-weight: 400; }
.building-card .arrow { color: #c0c6cf; font-size: 18px; margin-left: 8px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 3px 8px;
  margin-right: 6px;
  font-weight: 500;
}
.tag-red { color: var(--danger); background: #FDECEB; }
.tag-green { color: var(--success); background: #E6F7F0; }
.tag-sold { color: #fff; background: var(--danger); }

/* ---------- 按钮 ---------- */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  padding: 13px 0;
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, opacity .15s, box-shadow .15s;
  font-weight: 500;
  letter-spacing: 1px;
}
.btn:active { transform: scale(.97); opacity: .9; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--grad-main); color: #fff;
  box-shadow: 0 6px 16px rgba(31, 107, 196, .28);
}
.btn-danger { background: linear-gradient(135deg, #F05A52, #E64340); color: #fff; box-shadow: 0 6px 16px rgba(230, 67, 64, .25); }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid rgba(24, 95, 165, .35); }
.btn-lg { padding: 15px 0; font-size: 17px; border-radius: 14px; }
.btn-sm { display: inline-block; width: auto; padding: 8px 18px; font-size: 13px; border-radius: 10px; letter-spacing: 0; }

/* 底部固定操作栏（详情页） */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--safe-b));
  display: flex;
  gap: 12px;
  z-index: 90;
}
.bottom-bar .btn { flex: 1; }

/* ---------- 悬浮式底部导航 ---------- */
.tabbar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 444px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(16, 72, 126, .16);
  display: flex;
  border: 1px solid rgba(255, 255, 255, .7);
  z-index: 90;
  padding-bottom: var(--safe-b);
}
.tabbar a {
  flex: 1;
  text-align: center;
  padding: 9px 0 11px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  transition: color .2s;
}
.tabbar a .ico { display: block; font-size: 21px; margin-bottom: 3px; line-height: 1.2; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar a.active::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 6px; width: 18px; height: 3px; border-radius: 2px;
  background: var(--grad-main);
}

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 18px; }
.form-item label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  background: #FBFCFE;
  color: var(--text);
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24, 95, 165, .1);
}
.input-row { display: flex; gap: 10px; }
.input-row input { flex: 1; }
.input-row .btn { width: 118px; flex: none; padding: 12px 0; font-size: 14px; }

/* ---------- 通用工具 ---------- */
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); font-size: 12px; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.price { color: var(--danger); font-weight: 600; }
.price .unit { font-size: 12px; font-weight: 400; }

/* ---------- 空状态（精致） ---------- */
.empty { text-align: center; padding: 64px 0 48px; color: var(--muted); animation: fadeUp .4s ease both; }
.empty .icon {
  width: 76px; height: 76px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 0 auto 14px;
}
.empty .tip { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.empty .sub { font-size: 12px; }

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sh-sm);
  animation: fadeUp .3s ease both;
}
.skeleton .sk-cover { width: 108px; height: 82px; border-radius: 12px; }
.skeleton .sk-line { height: 12px; border-radius: 6px; margin-bottom: 10px; }
.skeleton .sk-line.short { width: 55%; }
.sk {
  background: linear-gradient(90deg, #EEF1F5 25%, #F7F9FB 50%, #EEF1F5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 遮罩 loading / toast ---------- */
.mask {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15, 30, 50, .45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.mask.hidden { display: none; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(26, 31, 38, .85);
  color: #fff;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; z-index: 1000;
  max-width: 78%; text-align: center;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  line-height: 1.6;
}

/* ---------- 密码展示 ---------- */
.code-box { text-align: center; padding: 30px 0 20px; }
.code-box .code {
  font-size: 46px; font-weight: 700;
  letter-spacing: 10px; color: var(--primary);
  font-family: 'Courier New', monospace;
}
.code-box .tip { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* ---------- 登录页品牌区 ---------- */
.brand { text-align: center; padding: 44px 0 30px; }
.brand .logo {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--grad-main);
  color: #fff; font-size: 36px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 10px 24px rgba(24, 95, 165, .32);
}
.brand h1 { font-size: 20px; font-weight: 600; }
.brand p { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* 分割线 */
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 20px 0; position: relative; }
.divider::before, .divider::after {
  content: ''; position: absolute; top: 50%; width: 34%; height: 1px; background: #E6E9EF;
}
.divider::before { left: 0; } .divider::after { right: 0; }

/* ---------- 首页专用组件 ---------- */
/* 品牌 hero */
.hero {
  position: relative;
  background: var(--grad-deep);
  border-radius: var(--r-lg);
  padding: 22px 20px 58px;
  margin: 8px 0 0;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(16, 72, 126, .28);
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.hero::before {
  content: ''; position: absolute; right: 24px; bottom: -60px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .05);
}
.hero .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hero .brand-logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.hero .brand-name { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.hero .brand-slogan { font-size: 13px; opacity: .82; margin-bottom: 18px; }
/* hero 内嵌搜索 */
.hero .search-box {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .97);
  border-radius: 14px;
  padding: 0 6px 0 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
.hero .search-box .ico { font-size: 16px; margin-right: 8px; opacity: .6; }
.hero .search-box input {
  flex: 1; border: none; outline: none; font-size: 15px;
  padding: 13px 0; background: transparent; color: var(--text);
}
.hero .search-box .go {
  flex: none; border: none; cursor: pointer;
  background: var(--grad-main); color: #fff;
  font-size: 14px; font-weight: 600;
  border-radius: 10px; padding: 9px 18px;
}

/* 区县胶囊 */
.district-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 16px 2px 6px; margin-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.district-scroll::-webkit-scrollbar { display: none; }
.district-item {
  flex: none; font-size: 13px; color: var(--text-2);
  background: #fff; border-radius: 20px; padding: 8px 16px;
  box-shadow: var(--sh-sm);
  transition: all .2s;
  border: 1px solid transparent;
}
.district-item.active {
  background: var(--grad-main); color: #fff; font-weight: 600;
  box-shadow: 0 6px 14px rgba(31, 107, 196, .3);
}

/* 房源卡片 */
.house-card { display: flex; gap: 14px; align-items: stretch; }
.house-card .cover {
  width: 112px; height: 84px; border-radius: 12px;
  background: linear-gradient(135deg, #E8EDF4, #F3F6FA);
  flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #B6BCC6; font-size: 14px; position: relative;
}
.house-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.house-card .cover .cover-tag {
  position: absolute; left: 6px; top: 6px;
  background: rgba(26, 31, 38, .62); color: #fff;
  font-size: 10px; padding: 2px 7px; border-radius: 8px;
  backdrop-filter: blur(4px);
}
.house-card .cover .cover-tag.sold {
  background: rgba(229, 77, 66, .92);
  font-weight: 600;
}
.house-card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.house-card .title { font-size: 15px; font-weight: 600; margin-bottom: 5px; line-height: 1.35; }
.house-card .meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.house-card .bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.house-card .spec { color: var(--muted); font-size: 12px; }
.house-card .price { font-size: 17px; }

/* 触底加载提示 */
.load-more { text-align: center; padding: 16px 0 8px; color: var(--muted); font-size: 12px; }
.load-more .dot { display: inline-block; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
