/* 安心租房 - 响应式样式 */
:root {
  --primary: #ff6b35;
  --primary-dark: #e55a2b;
  --primary-light: #ff8c5a;
  --bg: #f5f6f8;
  --card-bg: #fff;
  --text: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --header-height: 56px;
  --sidebar-width: 220px;
}

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

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== 头部 ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.search-bar {
  flex: 1;
  max-width: 400px;
  display: flex;
  background: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  outline: none;
}

.btn-search {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-search:hover {
  background: var(--primary-dark);
}

.nav-main {
  display: flex;
  gap: 20px;
}

.nav-main a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.nav-main a:hover,
.nav-main a.active {
  color: var(--primary);
}

.btn-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.btn-mobile-menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 16px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.mobile-menu a {
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.mobile-menu.open {
  display: flex;
}

/* ========== 主内容区 ========== */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
  width: 100%;
  display: flex;
  gap: 24px;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + 20px);
  box-shadow: var(--shadow);
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tag.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.content {
  flex: 1;
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.result-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.result-count span {
  color: var(--primary);
  font-weight: 600;
}

.sort-options {
  display: flex;
  gap: 8px;
}

.sort-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover,
.sort-btn.active {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-filter-mobile {
  display: none;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ========== 房源卡片 ========== */
.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.listing-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.card-image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #e8e8e8 0%, #f0f0f0 100%);
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 4px;
  z-index: 2;
}

/* 图片上的标题与价格 */
.card-image-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  color: #fff;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.card-image-title {
  font-size: 0.95rem;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-image-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffb347;
  flex-shrink: 0;
}

.card-body {
  padding: 14px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}
.card-tag-district {
  color: var(--primary);
  background: rgba(255, 107, 53, 0.12);
}

.card-price {
  margin-top: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.card-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* 分页 */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin: 28px 0 40px;
  padding: 16px 0;
}

.pagination-info {
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pagination-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.pagination-btn:hover:not(.disabled) {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: default;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.btn-reset {
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ========== 详情页 ========== */
.detail-breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 8px 0;
}
.detail-breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}
.detail-breadcrumb a:hover { text-decoration: underline; }
.detail-breadcrumb-sep { margin: 0 4px; color: var(--text-muted); }
.detail-breadcrumb-current { color: var(--text); }

.detail-hero {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.detail-image {
  aspect-ratio: 16/9;
  max-height: 400px;
  background: #e8e8e8;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-gallery {
  background: #e8e8e8;
}

.detail-gallery-main {
  position: relative;
  aspect-ratio: 16/9;
  max-height: 480px;
  background: #ddd;
}

.detail-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-gallery-prev,
.detail-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

.detail-gallery-prev:hover,
.detail-gallery-next:hover {
  background: rgba(0,0,0,0.65);
}

.detail-gallery-prev { left: 12px; }
.detail-gallery-next { right: 12px; }

.detail-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  justify-content: center;
  background: #f5f5f5;
}

.detail-gallery-thumb {
  width: 72px;
  height: 48px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #ddd;
  flex-shrink: 0;
  transition: border-color 0.2s;
}

.detail-gallery-thumb:hover {
  border-color: rgba(255,107,53,0.5);
}

.detail-gallery-thumb.active {
  border-color: var(--primary, #ff6b35);
}

.detail-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  padding: 8px;
}

.detail-gallery-item {
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 8px;
  background: #ddd;
}

.detail-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-main {
  padding: 24px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 320px;
}

.detail-info h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.detail-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.detail-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.detail-more-link { margin-top: 20px; font-size: 0.9rem; }
.detail-more-link a { color: var(--primary); text-decoration: none; }
.detail-more-link a:hover { text-decoration: underline; }

.detail-section p {
  color: var(--text);
  line-height: 1.7;
}

/* 房屋信息 / 房屋配套 / 房源概况 */
.detail-house-info { margin-bottom: 24px; }
.detail-house-info h2,
.detail-amenities h2,
.detail-overview h2 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.detail-house-info-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.detail-house-info-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.detail-house-info-table td:first-child { width: 110px; color: var(--text-muted); }
.detail-amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}
.detail-amenity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.detail-amenity-item.has { color: var(--text); }
.detail-overview-list { padding-left: 20px; margin: 0; }
.detail-overview-list li { margin-bottom: 8px; line-height: 1.6; color: var(--text); }
.detail-header-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }

.detail-sidebar {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: calc(var(--header-height) + 20px);
  box-shadow: var(--shadow);
}

.contact-card {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.contact-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.contact-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-role {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-phone {
  font-size: 1rem;
  font-weight: 500;
  margin-top: 8px;
  color: var(--text);
}

.contact-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-contact {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-contact:hover {
  background: var(--primary-dark);
}

/* ========== 页脚 ========== */
.footer {
  background: var(--card-bg);
  padding: 24px 16px;
  margin-top: 40px;
  text-align: center;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-seo {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.footer-nav-seo {
  margin-top: 10px;
  font-size: 0.85rem;
}
.footer-nav-seo a {
  color: var(--text-muted);
  text-decoration: none;
  margin-right: 14px;
}
.footer-nav-seo a:hover {
  color: var(--primary);
}

.footer-links {
  margin-top: 8px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 8px;
}

.footer-links a:hover {
  color: var(--primary);
}

/* ========== 响应式 - 平板 ========== */
@media (max-width: 992px) {
  .main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
  }

  .detail-main {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: static;
  }
}

/* ========== 响应式 - 手机 ========== */
@media (max-width: 768px) {
  :root {
    --header-height: 52px;
  }

  .nav-main {
    display: none;
  }

  .btn-mobile-menu {
    display: flex;
  }

  .search-bar {
    max-width: none;
  }

  .listings {
    grid-template-columns: 1fr;
  }

  .sort-options {
    display: none;
  }

  .btn-filter-mobile {
    display: block;
    margin-left: auto;
  }

  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    overflow-y: auto;
  }

  .sidebar.open {
    display: block;
  }

  .filter-section h3 {
    font-size: 0.9rem;
  }
}

/* 遮罩层 */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
}

.sidebar-overlay.open {
  display: block;
}
