/* ============ 全局变量与基础 ============ */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --text-2: #6b7280;
  --primary: #4f6ef7;
  --primary-dark: #3b55d8;
  --accent: #ff8a5c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(31, 36, 48, 0.08);
  --shadow-hover: 0 14px 40px rgba(31, 36, 48, 0.16);
  --transition: all 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============ 导航栏 ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(31, 36, 48, 0.06);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.nav-links { display: flex; align-items: center; gap: 28px; }

.nav-links a { color: var(--text-2); font-size: 15px; font-weight: 500; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 22px;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 110, 247, 0.35); }

.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid #e5e7eb; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-accent { background: linear-gradient(135deg, var(--accent), #ff6b4a); color: #fff; }
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 138, 92, 0.4); }

/* ============ Hero 区 ============ */
.hero {
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255, 138, 92, 0.18), transparent 60%),
    radial-gradient(700px 420px at 10% 10%, rgba(79, 110, 247, 0.16), transparent 60%),
    linear-gradient(180deg, #eef1ff 0%, var(--bg) 100%);
  padding: 72px 0 56px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.hero h1 .grad {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p { margin-top: 16px; color: var(--text-2); font-size: 17px; }

/* ============ 筛选区 ============ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 24px;
  margin: 32px 0 8px;
  box-shadow: var(--shadow);
}

.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-group label { color: var(--text-2); font-size: 14px; font-weight: 500; }

select, .price-input {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: var(--transition);
  cursor: pointer;
}

select:focus, .price-input:focus { border-color: var(--primary); }

.price-range { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.price-input { width: 100px; cursor: text; }

.result-count { margin-left: auto; color: var(--text-2); font-size: 14px; }
.result-count b { color: var(--primary); }

/* ============ 楼房介绍 ============ */
/* 楼房实拍轮播 */
.building-carousel {
  position: relative;
  margin-top: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #e8edf9 0%, #f6f7fb 100%);   /* 与页面协调的浅色底 */
  transition: height 0.4s ease;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

/* 等比例缩放:完整显示照片,不裁剪 */
.carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: linear-gradient(135deg, #e8edf9 0%, #f6f7fb 100%);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
  z-index: 5;
}

.carousel-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 5;
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(31, 36, 48, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.carousel-dots .dot.active {
  background: var(--primary);
  width: 22px;
  border-radius: 999px;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.about-text {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.9;
}

.tel-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

/* ============ 百度地图 ============ */
.map-section { padding-top: 32px; }
.map-head { margin-bottom: 14px; }
.map-head h2 { font-size: 19px; font-weight: 700; }
.map-head p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

.baidu-map {
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #e8edf9;   /* 地图加载完成前的占位底色 */
}

/* ============ 房源卡片网格 ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
  padding: 28px 0 72px;
}

.house-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.house-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

.card-cover {
  position: relative;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  overflow: hidden;
}

/* 户型图:铺满封面 */
.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 图片位占位(未放图时显示) */
.img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.06);
  border-radius: inherit;
}

.img-placeholder .ph-icon { font-size: 46px; }
.img-placeholder .ph-text {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 2px;
  background: rgba(255, 255, 255, 0.22);
  padding: 4px 14px;
  border-radius: 999px;
}

.card-cover .price-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-radius: 10px;
  padding: 6px 14px;
  font-weight: 800;
  color: var(--text);
  font-size: 15px;
}

.card-cover .price-tag small { font-weight: 600; color: var(--text-2); font-size: 12px; }

.card-tags {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 6px;
}

.card-tags span {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.card-body { padding: 20px 22px 22px; }

.card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 47px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 13.5px;
}

.card-meta span { display: inline-flex; align-items: center; gap: 4px; }

.card-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f0f1f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landlord {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
}

.landlord .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef1ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.star { color: #f5a623; font-weight: 600; }

/* ============ 空状态 ============ */
.empty {
  text-align: center;
  padding: 80px 0;
  color: var(--text-2);
}

.empty .big { font-size: 56px; display: block; margin-bottom: 12px; }

/* ============ 页脚 ============ */
.footer {
  background: #171b26;
  color: #9aa1b0;
  padding: 48px 0 32px;
  font-size: 14px;
}

.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }

.footer .brand { color: #fff; font-size: 18px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.footer .brand .dot { background: linear-gradient(135deg, var(--primary), var(--accent)); }

.footer-title { color: #fff; font-weight: 700; margin-bottom: 10px; font-size: 15px; }

.footer-contact p { margin: 4px 0; }
.footer-contact a { color: #fff; transition: var(--transition); }
.footer-contact a:hover { color: var(--accent); }

.footer-qr { text-align: center; }
.footer-qr img {
  width: 110px;
  height: 110px;
  background: #fff;
  padding: 8px;
  border-radius: 12px;
  display: block;
  margin: 0 auto 8px;
}
.footer-qr p { font-size: 12px; line-height: 1.6; color: #9aa1b0; }

.copyright { margin-top: 32px; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 20px; }

/* ============ 详情页 ============ */
.breadcrumb { padding: 28px 0 4px; color: var(--text-2); font-size: 14px; }
.breadcrumb a:hover { color: var(--primary); }

.detail-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 12px 0 24px; }
.detail-head h1 { font-size: clamp(24px, 3.5vw, 34px); font-weight: 800; line-height: 1.3; }
.detail-head .sub { color: var(--text-2); margin-top: 6px; font-size: 15px; }

.detail-price { font-size: 32px; font-weight: 800; color: var(--accent); }
.detail-price small { font-size: 15px; font-weight: 500; color: var(--text-2); }

.detail-cover {
  height: 420px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 110px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
}

.detail-cover .cover-img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  padding-bottom: 72px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}

.card h2 { font-size: 19px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

.overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.overview .item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.overview .item .num { font-size: 22px; font-weight: 800; color: var(--primary); }
.overview .item .name { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.facility-list { display: flex; flex-wrap: wrap; gap: 10px; }
.facility-list span {
  background: #eef1ff;
  color: var(--primary-dark);
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
}

.desc-text { color: var(--text-2); font-size: 15px; line-height: 1.9; }

/* 侧边栏卡片 */
.side-card { position: sticky; top: 84px; }

.landlord-box { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.landlord-box .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eef1ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.landlord-box .name { font-weight: 700; font-size: 16px; }
.landlord-box .meta { color: var(--text-2); font-size: 13px; }

.info-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #ececf1; font-size: 14.5px; }
.info-line:last-child { border-bottom: none; }
.info-line .k { color: var(--text-2); }
.info-line .v { font-weight: 600; }

.side-card .btn { width: 100%; margin-top: 8px; }

.map-placeholder {
  margin-top: 16px;
  height: 150px;
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at 30% 40%, rgba(79, 110, 247, 0.12), transparent 40%),
    linear-gradient(135deg, #eef1ff, #f8f9ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 13.5px;
  gap: 6px;
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .nav-links { display: none; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .result-count { margin-left: 0; }
  .detail-cover { height: 260px; font-size: 80px; }
  .carousel-track img { max-height: 60vh; }
  .baidu-map { height: 300px; }
}
