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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #222;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e2e2;
}

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

.logo {
  font-weight: 700;
  font-size: 20px;
}

.nav a {
  margin-left: 16px;
  font-size: 14px;
}

.inline-form {
  display: inline;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #4455ff, #6f9bff);
  color: #fff;
  padding: 64px 0;
}

.hero-inner {
  display: flex;
  align-items: center;
}

.hero-text h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.hero-text p {
  margin-bottom: 16px;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-bar input,
.search-bar select,
.search-bar button {
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
}

.search-bar input,
.search-bar select {
  min-width: 140px;
}

.search-bar button {
  background: #111827;
  color: #fff;
  cursor: pointer;
}

/* Section */
.section {
  padding: 32px 0;
}

.section h2,
.section h1 {
  margin-bottom: 16px;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.room-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

.room-img {
  width: 100%;
  padding-top: 62%;
  background-size: cover;
  background-position: center;
}

.room-body {
  padding: 10px 12px 12px;
}

.room-body h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.room-location {
  font-size: 13px;
  color: #6b7280;
}

.room-rent {
  margin-top: 4px;
  font-size: 14px;
}

.price {
  font-weight: 700;
  font-size: 18px;
  color: #ef4444;
}

/* Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-bar input,
.filter-bar select,
.filter-bar button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  background: #fff;
}

.filter-bar button {
  background: #111827;
  color: #fff;
  border-color: #111827;
  cursor: pointer;
}

/* Property page */
.property-page {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
}

.property-cover {
  width: 100%;
  padding-top: 55%;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  margin-bottom: 16px;
}

.property-rent {
  margin-top: 8px;
  font-size: 18px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 16px;
}

.tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

.equip-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.equip-list li {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 12px;
}

.property-side .side-box {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

/* Forms & table */
.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.form label {
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form input,
.form textarea,
.form select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}

.form button,
.btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: inline-block;
  margin-top: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 13px;
}

.table th,
.table td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  text-align: left;
}

.error {
  color: #dc2626;
  margin-bottom: 8px;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 16px 0;
  margin-top: 32px;
  font-size: 13px;
  color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 40px 0;
  }
  .property-page {
    grid-template-columns: 1fr;
  }
}

/* ===== 首頁輪播 Banner：一頁兩張、固定高度 ===== */
.hero-slider {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 16px;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  background: #000;
}

/* 軌道本身就固定高度 */
.hero-slider-inner {
  display: flex;
  transition: transform 0.5s ease;
  height: 360px;                  /* ★ 輪播總高度：想更高就改這裡 */
}

.hero-slide-page {
  min-width: 100%;
  display: flex;
  height: 100%;
}

/* 左右兩張各 50%，高度吃整個輪播 */
.hero-slide-img,
.hero-slide-empty {
  width: 50%;
  height: 100%;                   /* ★ 高度直接填滿，不用 aspect-ratio 了 */
  object-fit: cover;
  object-position: center center;
  display: block;
}

.hero-slide-empty {
  background: transparent;
}

/* 左右箭頭保持不變 */
.hero-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slider-prev { left: 18px; }
hero-slider-next { right: 18px; }

.hero-slider-arrow:hover {
  background: #fbbf24;
  color: #111827;
}

/* 小點維持原本就好 */
.hero-slider-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.hero-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-slider-dot.active {
  width: 20px;
  background: #fbbf24;
}

/* ===== 租寓風格首頁 Banner ===== */

.hero-swiper {
  width: 100%;
  max-width: 1200px;
  height: 420px;                  /* ★ Banner 高度，想高一點就改這裡 */
  margin: 0 auto 24px;
  position: relative;
  overflow: hidden;
  border-radius: 0px;
  background: #000;
}

.hero-swiper-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s ease;
}

.hero-swiper-slide {
  flex: 0 0 100%;
  height: 100%;
}

/* 關鍵：跟租寓一樣的 img 設定 */
.hero-swiper-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;              /* ★ 填滿、維持比例，多的地方裁掉 */
}

/* 左右箭頭 */
.hero-swiper-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  font-size: 22px;
  cursor: pointer;
}

.hero-swiper-prev { left: 12px; }
.hero-swiper-next { right: 12px; }

.hero-swiper-arrow:hover {
  background: #fbbf24;
}

/* 下方 dots */
.hero-swiper-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.hero-swiper-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}

.hero-swiper-dot.active {
  width: 22px;
  background: #fbbf24;
}


/* ========================= */
/* Banner swiper 專用樣式     */
/* ========================= */

.hero-swiper {
  width: 100%;
  max-width: 1200px;
  height: 420px;
  position: relative;
  margin: 0 auto 24px;
  overflow: hidden;
  border-radius: 0;
  background: #000;
}

.hero-swiper-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.hero-swiper-slide {
  flex: 0 0 100%;
  height: 100%;
}

.hero-swiper-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 箭頭 */
.hero-swiper-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  border: none;
}

.hero-swiper-prev { left: 12px; }
.hero-swiper-next { right: 12px; }

.hero-swiper-arrow:hover {
  background: #fbbf24;
  color: #111827;
}

/* 小點 */
.hero-swiper-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.hero-swiper-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.hero-swiper-dot.active {
  width: 22px;
  background: #fbbf24;
}

/* ---- 找房頁面（/rooms） ---- */

.search-page-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

.search-page-header {
  margin-bottom: 12px;
}

.search-page-title {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
}

/* 表單整體 */
.search-form {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 20px 24px 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* 第一列：基本條件 */
.search-row-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 2.2fr auto;
  gap: 12px;
  align-items: end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group-wide {
  min-width: 260px;
}

.field-group-submit {
  align-self: stretch;
  display: flex;
  align-items: flex-end;
}

.field-label {
  font-size: 12px;
  color: #64748b;
}

.field-input {
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  font-size: 14px;
  outline: none;
}

.field-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}

/* 主按鈕 */
.btn-primary {
  border-radius: 999px;
  border: none;
  padding: 8px 22px;
  font-size: 14px;
  background: #fbbf24;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #f59e0b;
}

/* 更多條件開關 */
.more-toggle-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-start;
}

.more-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: #4f46e5;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.more-toggle-btn:hover {
  color: #3730a3;
}

.more-toggle-icon {
  font-size: 10px;
}

/* 更多條件 panel */
.more-filters-panel {
  margin-top: 12px;
  padding: 12px 18px 14px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.more-filters-panel.hidden {
  display: none;
}

.more-filter-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
}

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

.more-filter-label {
  width: 40px;
  font-size: 13px;
  color: #9ca3af;
  flex-shrink: 0;
  margin-top: 4px;
}

.more-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

/* 格局 / 特色 的 UI 小丸子 */
.option-pill,
.option-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.option-pill input,
.option-checkbox input {
  width: 14px;
  height: 14px;
}

/* 列表 */
.results-list {
  margin-top: 32px;
}

.no-results {
  font-size: 14px;
  color: #6b7280;
}

/* 單一房源卡片 */
.listing-card {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.listing-thumb {
  width: 160px;
  height: 120px;
  border-radius: 14px;
  overflow: hidden;
  background: #e5e7eb;
  flex-shrink: 0;
}

.listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #9ca3af;
}

.listing-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.listing-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.listing-info-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: #374151;
}

.listing-rent {
  font-weight: 600;
  color: #ef4444;
}

.listing-size {
  color: #6b7280;
}

.listing-meta {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
}

/* 行政區 pill 列（像 591） */
.district-row {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.district-label {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
  flex-shrink: 0;
}

.district-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.district-pill {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  line-height: 1.4;
}

.district-pill:hover {
  border-color: #f97316;
  color: #f97316;
}

.district-pill.is-active {
  background: #f97316;
  border-color: #f97316;
  color: #ffffff;
}

/* =========================
   Admin - Image Manager
   ========================= */
.img-tile{ position: relative; }

/* 讓按鈕不被圖片蓋住 */
.img-del,
.img-cover{
  z-index: 20;
}

.img-del{
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 24px;
  opacity: 0;
  border: 0;
  cursor: pointer;
}

.img-cover{
  position: absolute;
  bottom: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(148,163,184,.8);
  color: #0f172a;
  font-size: 11px;
  opacity: 0;
  cursor: pointer;
}

.img-tile:hover .img-del,
.img-tile:hover .img-cover{
  opacity: 1;
}

.img-tile.is-cover{
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.img-tile.is-cover::after{
  content: "封面";
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(59,130,246,.9);
  color: #fff;
  font-size: 11px;
  z-index: 20;
}

/* ===== 修正 /rooms 手機版篩選列被切掉 ===== */
@media (max-width: 768px) {
  /* 外層容器允許換行 */
  .search-row-main,
  .room-search-row,
  .filters-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px;
  }

  /* 所有 input / select 一定要能縮 */
  .search-row-main input,
  .search-row-main select,
  .room-search-row input,
  .room-search-row select {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* 縣市 / 最低 / 最高 → 各佔一整行 */
  .search-row-main > *,
  .room-search-row > * {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* 關鍵字 */
  input[name="keyword"] {
    width: 100% !important;
  }

  /* 篩選按鈕 */
  .filter-btn,
  .btn-filter {
    width: 100% !important;
  }
}




/* ===== Mobile: prevent hero carousel image from being cropped ===== */
@media (max-width: 768px) {
  .hero-swiper {
    height: auto;
    aspect-ratio: 1920 / 700; /* match your banner image ratio */
  }
  .hero-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* show full banner on mobile */
    background: #ffffff; /* avoid black bars if image has transparency */
  }
}
