/* PropCity 網站基本版面（批 0：主頁 + 連線證明）
   版面數值全部對 app layout，唔自己發明。 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "PingFang TC",
               "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

/* 內容欄：模擬手機闊度，置中 */
.app {
  max-width: var(--app-width);
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
}

/* ---------- 主頁 header（對 activity_main.xml：白底、logo 32dp 高、標題 22sp） ---------- */
.home-header {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--divider);
}
.home-header img { height: var(--logo-h); }
.home-header .wordmark {
  margin-left: 8px;
  font-size: var(--fs-header-logo);
  font-weight: 700;
}
.home-header .wordmark .blue { color: var(--brand-blue); }
.home-header .wordmark .orange { color: var(--brand-orange); }

/* ---------- 買樓／租樓 tab（橙字 + 3dp 橙底線） ---------- */
.tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 5;
}
.tabs button {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16px;
  padding: 12px 0 9px;
  color: var(--black);
  cursor: pointer;
  position: relative;
}
.tabs button[aria-selected="true"] {
  color: var(--brand-orange);
  font-weight: 700;
}
.tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 60px;
  height: 3px;
  background: var(--brand-orange);
}

/* ---------- 盤源 tab（代理盤／業主盤） ---------- */
.source-tabs {
  display: flex;
  gap: 8px;
  padding: 12px var(--card-margin-side);
  background: var(--white);
}
.source-tabs button {
  border: 1px solid var(--divider);
  background: var(--white);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  padding: 5px 14px;
  color: var(--text-secondary);
  cursor: pointer;
}
.source-tabs button[aria-selected="true"] {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  font-weight: 700;
}

/* ---------- 樓盤卡（逐格對 item_property_list.xml） ---------- */
.card {
  display: flex;
  padding: var(--card-padding);
  margin: var(--card-margin-top) var(--card-margin-side) var(--card-margin-bottom);
  background: var(--white);
  border-radius: var(--card-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.card .thumb {
  position: relative;
  flex: 0 0 auto;
  width: var(--thumb-w);
  height: var(--thumb-h);
  border-radius: var(--thumb-radius);
  overflow: hidden;
  background: #EEE;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 8px;
  border-radius: var(--badge-radius);
  background: rgba(0, 0, 0, .55);
  color: var(--white);
  font-size: var(--fs-badge);
  font-weight: 700;
}
.card .info {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--thumb-gap);
}
.card .name {
  font-size: var(--fs-card-name);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .title,
.card .area,
.card .unit-price {
  margin-top: 2px;
  font-size: var(--fs-card-meta);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .title, .card .area { color: var(--text-secondary); }
.card .unit-price { color: var(--text-tertiary); }
.card .price {
  margin-top: 2px;
  font-size: var(--fs-card-price);
  font-weight: 700;
  color: var(--brand-orange);
}
.card .badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.badge {
  padding: 3px 7px;
  border-radius: var(--badge-radius);
  font-size: var(--fs-badge);
  font-weight: 700;
  white-space: nowrap;
}
.badge.source { background: var(--badge-source-bg); color: var(--badge-source-text); }
.badge.verified { background: var(--badge-verified-bg); color: var(--badge-verified-text); }
.badge.extra {
  color: var(--text-tertiary);
  font-weight: 400;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 狀態 ---------- */
.status {
  padding: 10px 16px 2px;
  text-align: left;
  color: var(--text-secondary);
  font-size: 12px;
}
.status.error { color: #C62828; }

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ---------- 列表頁：搜尋列（對 app 內頁搜尋）---------- */
.search-mini {
  padding: 10px 12px 2px;
  background: var(--white);
}
.search-mini .search-row { display: flex; gap: 8px; }
.search-mini input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: 0 16px;
  font-size: 14px;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: inherit;
}
.search-mini input[type="search"]:focus { outline: 2px solid var(--brand-blue); background: var(--white); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--brand-orange); color: var(--text-primary); }
.btn-primary:hover { filter: brightness(.94); }

/* 卡片可點（將來接詳情頁）*/
a.card { display: flex; }

footer.build {
  padding: 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 11px;
  border-top: 1px solid var(--divider);
}
