@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;600;700&display=swap');

.skip-to-main {
  position: absolute; left: 16px; top: -100px;
  background: var(--primary, #f97316); color: #fff;
  padding: 8px 16px; border-radius: 4px;
  font-size: .9rem; font-weight: 600; z-index: 9999;
  text-decoration: none; transition: top .1s;
}
.skip-to-main:focus { top: 8px; }

:root {
  --primary: #f97316;
  --primary-dark: #ea6c0a;
  --primary-deep: #c2410c;
  --trust: #0d9488;
  --trust-bg: #f0fdfa;
  --accent: #f97316;
  --text: #1c1917;
  --text-soft: #44403c;
  --muted: #78716c;
  --border: #e7e5e4;
  --bg: #fafaf9;
  --bg-soft: #fffaf5;
  --white: #ffffff;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(28,25,23,.06), 0 2px 10px rgba(28,25,23,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.14), 0 18px 48px rgba(28,25,23,.12);
  --shadow-soft: 0 24px 60px rgba(28,25,23,.1);
}

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

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn-primary:focus-visible, .btn-danger:focus-visible, .btn-success:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--primary);
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  letter-spacing: .01em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* ── NAV ── */
.nav {
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid rgba(231,229,228,.85);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 64px;
}
.nav-brand {
  font-weight: 800; font-size: 1.1rem; color: var(--text);
  display: flex; align-items: baseline; gap: 6px; line-height: 1;
  flex-wrap: wrap;
}
.nav-brand .brand-cn {
  font-size: 1.2rem; color: var(--primary); letter-spacing: -.5px;
}
.nav-brand .brand-en {
  font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: .5px;
}
.nav-brand .brand-tagline {
  flex-basis: 100%; font-size: .62rem; font-weight: 400;
  color: var(--muted); letter-spacing: .4px; margin-top: -2px;
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a, .nav-links button {
  padding: 8px 14px; border-radius: 10px; font-size: .9rem;
  border: none; cursor: pointer; background: none; color: var(--text);
  transition: background .18s, color .18s, transform .18s;
}
.nav-links a:hover, .nav-links button:hover { background: #fff7ed; color: var(--primary); transform: translateY(-1px); }
.nav-links .btn-primary { background: var(--primary); color: #fff; }
.nav-links .btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 999px;
  font-weight: 600; cursor: pointer; border: none;
  transition: background .2s, transform .15s, box-shadow .2s, border-color .2s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%); color: #fff; box-shadow: 0 12px 28px rgba(249,115,22,.28); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark) 0%, #9a3412 100%); box-shadow: 0 6px 20px rgba(249,115,22,.4), 0 16px 36px rgba(249,115,22,.25); transform: translateY(-2px); }
.btn-accent { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(249,115,22,.3); }
.btn-accent:hover { background: var(--primary-dark); }
.btn-trust { background: var(--trust); color: #fff; }
.btn-trust:hover { background: #0f766e; }
.btn-outline {
  background: #fff; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: #fff7ed; box-shadow: 0 10px 20px rgba(249,115,22,.08); }
.btn-outline-dark {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,.6);
}
.btn-outline-dark:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 6px 14px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-full { width: 100%; justify-content: center; }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .83rem; font-weight: 600; color: var(--muted); }
.form-control {
  padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 14px; background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}
.field-error { font-size: .78rem; color: var(--danger); margin-top: 3px; display: none; }
.field-error.visible { display: block; }
.required-star { color: var(--danger); margin-left: 2px; font-weight: 700; }
.optional-label { color: var(--muted); font-size: .8rem; font-weight: 400; margin-left: 4px; }
select.form-control { cursor: pointer; }

/* ── CARDS ── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}

/* ── LISTING CARD ── */
.listing-card {
  display: flex; flex-direction: column;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
  cursor: pointer; border: 1px solid rgba(231,229,228,.9);
  background: linear-gradient(180deg, #fff 0%, #fffdfb 100%);
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #f97316;
}
.listing-card-photo-wrap { position: relative; overflow: hidden; }
.listing-card-photo {
  aspect-ratio: 4/3; object-fit: cover; width: 100%;
  background: #f5f0eb; display: block;
  transition: transform .35s ease;
}
.listing-card:hover .listing-card-photo { transform: scale(1.04); }
.listing-card-photo-placeholder {
  aspect-ratio: 4/3; display: flex; align-items: center;
  justify-content: center; background: #f5f0eb;
  color: var(--muted); font-size: 2.5rem;
}
.photo-badge-verified {
  position: absolute; top: 10px; right: 10px;
  background: rgba(13,148,136,.88); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 3px;
  backdrop-filter: blur(3px);
}
.listing-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.listing-card-title {
  font-weight: 700; font-size: .95rem; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-card-meta { font-size: .8rem; color: var(--text-soft); }
.listing-card-price {
  font-size: 1.08rem; font-weight: 800; color: var(--primary-deep); margin-top: auto; padding-top: 10px;
}
.listing-card-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.listing-card-landlord {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-top: 1px solid #f1eeeb;
  margin-top: 4px;
  background: rgba(255,247,237,.45);
}
.landlord-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #fb923c);
  color: #fff; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.landlord-name { font-size: .8rem; color: var(--muted); flex: 1; }

/* ── BADGE ── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
}
.badge-blue { background: #fff7ed; color: #c2410c; }
.badge-green { background: #f0fdf4; color: #15803d; }
.badge-yellow { background: #fefce8; color: #a16207; }
.badge-gray { background: #f5f0eb; color: #57534e; }
.badge-trust { background: var(--trust-bg); color: var(--trust); }
.badge-trust-sm {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 7px; border-radius: 20px; font-size: .72rem; font-weight: 700;
  background: var(--trust-bg); color: var(--trust);
}

/* ── GRID ── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

/* ── HERO ── */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(circle at top left, rgba(255,255,255,.14) 0%, transparent 28%), linear-gradient(145deg, #7c2d12 0%, #b45309 32%, #c2410c 68%, #f97316 100%);
  color: #fff; padding: 88px 16px 72px;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(251,191,36,.15) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(255,255,255,.08) 0%, transparent 45%);
  pointer-events: none;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: 5px 14px; font-size: .82rem;
  margin-bottom: 20px; letter-spacing: .3px;
}
.hero h1 {
  font-family: 'Noto Serif TC', 'PingFang TC', serif;
  font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 900;
  margin-bottom: 14px; letter-spacing: -1.5px; line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.hero h1 em { font-style: normal; color: #fcd34d; }
.hero p {
  font-size: clamp(.95rem, 2vw, 1.15rem); opacity: .9;
  max-width: 520px; margin: 0 auto 36px; line-height: 1.7;
}
.hero .search-box-subtle {
  font-size: .82rem;
  color: #a8a29e;
  margin-bottom: 8px;
}

/* ── SEARCH BOX ── */
.search-box {
  background: rgba(255,255,255,.96); border-radius: 24px; padding: 22px;
  max-width: 720px; margin: 0 auto;
  box-shadow: 0 28px 60px rgba(28,25,23,.22);
  display: grid; gap: 12px;
  border: 1px solid rgba(255,255,255,.7);
}
.search-box-elevated { transform: translateY(6px); }
.search-box-title {
  font-size: .8rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px;
}
.search-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .search-row { grid-template-columns: 1fr 1fr; } }
.hero-search-btn { margin-top: 4px; min-height: 50px; }

/* ── TRUST BAR ── */
.trust-bar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 16px 16px;
}
.trust-bar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; gap: 10px; align-items: center; justify-content: center;
  flex-wrap: wrap;
}
.trust-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; color: var(--text-soft); padding: 7px 14px;
  border-radius: 999px; background: linear-gradient(180deg, #fff 0%, #fffaf5 100%); border: 1px solid #f3e2d3;
  box-shadow: 0 8px 20px rgba(28,25,23,.04);
}
.trust-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }

/* ── SECTION ── */
.section { max-width: 1100px; margin: 0 auto; padding: 40px 16px; }
.section-featured { padding-top: 54px; }
.section-title {
  font-family: 'Noto Serif TC', 'PingFang TC', serif;
  font-size: 1.6rem; font-weight: 900; margin-bottom: 8px; letter-spacing: -.5px;
}
.section-sub { font-size: .95rem; color: var(--muted); margin-bottom: 28px; }

/* ── LUCIDE ICONS ── */
[data-lucide] { display: inline-flex; }
.brand-pillar-icon { color: var(--primary); }
.brand-pillar-icon svg { width: 24px; height: 24px; stroke-width: 1.75; }
.how-step-icon { color: var(--primary); line-height: 1; }
.how-step-icon svg { width: 32px; height: 32px; stroke-width: 1.5; }
.why-card-icon { color: var(--primary); }
.why-card-icon svg { width: 26px; height: 26px; stroke-width: 1.75; }
.hero-kicker svg { width: 14px; height: 14px; vertical-align: -1px; opacity: .9; }
.icon-mrt { display: inline-flex; align-items: center; gap: 3px; }
.icon-mrt svg { width: 13px; height: 13px; vertical-align: -1px; }

/* ── BRAND STORY ── */
.brand-story {
  background: #fff7ed;
  border-top: 1px solid #fed7aa;
  border-bottom: 1px solid #fed7aa;
  padding: 64px 16px;
}
.brand-story-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center;
}
@media (max-width: 768px) { .brand-story-inner { grid-template-columns: 1fr; gap: 32px; } }
.brand-story-text .eyebrow {
  font-size: .75rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 12px;
}
.brand-story-text h2 {
  font-family: 'Noto Serif TC', 'PingFang TC', serif;
  font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 900; line-height: 1.3;
  margin-bottom: 20px; letter-spacing: -.5px;
}
.brand-story-text h2 em { font-style: normal; color: var(--primary); }
.brand-story-text p {
  color: #57534e; line-height: 1.8; margin-bottom: 12px; font-size: .97rem;
}
.brand-story-text p strong { color: var(--text); }
.brand-story-pillars { display: flex; flex-direction: column; gap: 16px; }
.brand-pillar {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff; border-radius: var(--radius);
  padding: 18px 20px; border: 1px solid #fed7aa;
  box-shadow: 0 1px 6px rgba(249,115,22,.06);
}
.brand-pillar-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}
.brand-pillar-text strong { display: block; font-weight: 700; margin-bottom: 3px; }
.brand-pillar-text span { font-size: .83rem; color: var(--muted); line-height: 1.5; }

/* ── HOW IT WORKS ── */
.how-it-works {
  background: var(--bg); padding: 64px 16px;
  border-bottom: 1px solid var(--border);
}
.how-it-works-inner { max-width: 1100px; margin: 0 auto; }
.how-tabs {
  display: flex; gap: 8px; margin-bottom: 40px;
  background: var(--white); border: 1px solid var(--border);
  padding: 4px; border-radius: 12px; max-width: 320px;
}
.how-tab {
  flex: 1; padding: 8px 16px; border-radius: 9px;
  border: none; cursor: pointer; font-weight: 600; font-size: .88rem;
  background: none; color: var(--muted); transition: all .15s;
}
.how-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(249,115,22,.3); }
.how-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
@media (max-width: 640px) { .how-steps { grid-template-columns: 1fr; } }
.how-step {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--white); border-radius: var(--radius);
  padding: 24px; border: 1px solid var(--border);
  position: relative;
}
.how-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.how-step-icon { font-size: 1.8rem; }
.how-step h3 { font-weight: 700; font-size: 1rem; }
.how-step p { font-size: .85rem; color: var(--muted); line-height: 1.6; }
.how-step-connector {
  position: absolute; right: -16px; top: 50%;
  transform: translateY(-50%); color: var(--muted);
  font-size: 1.2rem; z-index: 1;
}
@media (max-width: 640px) { .how-step-connector { display: none; } }

/* ── WHY SECTION ── */
.why-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.why-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.why-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: #fff7ed; display: flex; align-items: center;
  justify-content: center; font-size: 1.4rem; margin-bottom: 14px;
}
.why-card h3 { font-weight: 700; margin-bottom: 6px; font-size: .97rem; }
.why-card p { font-size: .83rem; color: var(--muted); line-height: 1.6; }

/* ── LANDLORD CTA ── */
.landlord-cta {
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  padding: 64px 16px; text-align: center; color: #fff;
}
.landlord-cta h2 {
  font-family: 'Noto Serif TC', 'PingFang TC', serif;
  font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 900; margin-bottom: 12px;
}
.landlord-cta h2 em { font-style: normal; color: #fcd34d; }
.landlord-cta p { color: #a8a29e; max-width: 500px; margin: 0 auto 28px; font-size: .97rem; line-height: 1.7; }
.landlord-cta-badges {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 28px;
}
.cta-badge {
  padding: 5px 14px; border-radius: 20px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  font-size: .8rem; color: #d6d3d1;
}

/* ── FILTERS BAR ── */
.filter-bar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 16px; overflow: hidden;
}
.filter-bar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; gap: 10px; flex-wrap: nowrap; overflow-x: auto; align-items: flex-end;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(to right, black calc(100% - 40px), transparent 100%);
}
.filter-bar-inner::-webkit-scrollbar { display: none; }
.filter-bar .form-group { flex: 1; min-width: 120px; }
.filter-bar label { font-size: .78rem; }

/* ── LISTING DETAIL ── */
.listing-photos {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 360px;
  gap: 8px; border-radius: var(--radius); overflow: hidden;
}
.listing-photos img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.listing-photos-side { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; }
@media (max-width: 900px) {
  .listing-photos { grid-template-rows: 280px; }
}
@media (max-width: 640px) {
  .listing-photos { grid-template-columns: 1fr; grid-template-rows: 240px; }
  .listing-photos-side { display: none; }
}
.listing-detail-grid {
  display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start;
}
@media (max-width: 768px) { .listing-detail-grid { grid-template-columns: 1fr; } }
.amenity-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.amenity-tag {
  padding: 4px 12px; border-radius: 20px;
  background: #fff7ed; color: #c2410c; font-size: .85rem;
}

/* ── INQUIRY CARD ── */
.inquiry-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}
.inquiry-info { flex: 1; }
.inquiry-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; min-width: 200px; }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-accepted { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-cancelled { background: #f3f4f6; color: #374151; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 420px;
  padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.22);
}
.modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 20px; }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── STATS ROW ── */
.stats-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  padding: 16px 20px; flex: 1; min-width: 120px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.stat-card .value { font-size: 1.6rem; font-weight: 900; color: var(--primary); }
.stat-card .label { font-size: .82rem; color: var(--muted); margin-top: 2px; }

/* ── ALERT ── */
.alert {
  padding: 10px 16px; border-radius: var(--radius);
  font-size: .9rem; margin-bottom: 12px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

/* ── SPINNER ── */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-dark {
  display: inline-block; width: 20px; height: 20px;
  border: 2.5px solid rgba(0,0,0,.1);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 56px 16px; color: var(--muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ── FOOTER ── */
.site-footer {
  background: #1c1917; color: #a8a29e;
  padding: 48px 16px 24px;
}
.site-footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 640px) { .site-footer-inner { grid-template-columns: 1fr; gap: 28px; } }
.footer-brand-cn { font-size: 1.3rem; font-weight: 900; color: #fff; }
.footer-brand-en { font-size: .8rem; font-weight: 500; color: #a8a29e; letter-spacing: .5px; }
.footer-tagline { font-size: .85rem; line-height: 1.7; margin-top: 10px; }
.footer-col h4 { color: #fff; font-size: .88rem; font-weight: 700; margin-bottom: 14px; }
.footer-col a {
  display: block; font-size: .83rem; color: #a8a29e;
  padding: 4px 0; transition: color .15s;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid #292524; padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; font-size: .78rem;
}
.footer-trust { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-trust span { display: flex; align-items: center; gap: 5px; }
.footer-trust .ft-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }

/* ── UTILS ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-4 { gap: 16px; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--muted); font-size: .88rem; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.align-items-center { align-items: center; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.hidden { display: none !important; }

/* ── RESPONSIVE 2-COL GRID ── */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── MOBILE NAV ── */
.nav-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; padding: 4px 8px; color: var(--text); line-height: 1;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .nav-menu-btn { display: block; }
  .nav-links {
    display: none;
    position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
    background: var(--white);
    flex-direction: column;
    padding: 8px 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links > a, .nav-links > button { padding: 12px 8px; min-height: 44px; width: 100%; text-align: left; }
  .nav-links .flex { flex-direction: column; gap: 4px; width: 100%; }
  .nav-links .flex a, .nav-links .flex button { width: 100%; text-align: left; }
  .nav-links .btn-primary { display: block; text-align: center; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: 16px 16px 0 0;
    padding: 24px 16px 32px;
    max-width: 100%; max-height: 92vh;
    overflow-y: auto;
  }

  .grid-2col { grid-template-columns: 1fr; }
  .inquiry-card { flex-direction: column; }
  .inquiry-actions { flex-direction: row; width: 100%; flex-wrap: wrap; min-width: unset; }
  .inquiry-actions .btn { flex: 1; justify-content: center; }
  .inquiry-card .dchat-panel { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
  #panel-inquiries { padding-bottom: 80px; }
  .listing-grid { padding-bottom: 80px; }
  .tabs { -webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%); mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%); }
  .filter-bar-inner { gap: 8px; }
  .filter-bar .form-group { min-width: calc(50% - 4px); }
  .section { padding: 24px 12px; }
  .search-row { grid-template-columns: 1fr 1fr; }
  .stats-row { gap: 10px; }
  .stat-card { padding: 12px 14px; min-width: 0; flex: 1 1 28%; }
  .mobile-cta-bar { display: flex; }
  body.has-mobile-cta { padding-bottom: 76px; }
}

/* ── Dashboard action buttons (import / add listing) */
.action-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .action-btns .btn { flex: 1 1 100%; text-align: center; justify-content: center; }
}

/* ── CTA Trust Block (listing detail) */
.cta-trust-block {
  margin-top: 16px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cta-trust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: #374151;
}
.cta-trust-check {
  color: #16a34a;
  font-weight: 800;
  flex-shrink: 0;
  font-size: .9rem;
}

/* ── Desktop CTA wrapper hidden on mobile (mobile-cta-bar takes over) */
@media (max-width: 768px) {
  .desktop-cta-wrapper { display: none; }
}

/* ── Mobile Sticky CTA Bar */
.mobile-cta-bar {
  display: none;
}
@media (max-width: 768px) {
  .mobile-cta-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 200;
    box-shadow: 0 -3px 16px rgba(0,0,0,.09);
  }
}
.mobile-cta-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.mobile-cta-price span {
  font-size: .78rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 2px;
}
.mobile-cta-sub {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 1px;
}

/* ── Why card CX highlight */
.why-card-featured {
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
}

/* ── U1: Mobile filter compact bar + bottom sheet ── */
.mobile-filter-compact {
  display: none;
  position: sticky; top: 64px; z-index: 60;
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 10px 16px; gap: 8px; align-items: center;
}
.mobile-filter-compact select.form-control {
  flex: 1; font-size: .9rem;
}
.mobile-filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 20px;
  background: var(--white); border: 1.5px solid var(--border);
  font-size: .88rem; font-weight: 600; color: var(--text); cursor: pointer;
  white-space: nowrap; transition: border-color .15s;
}
.mobile-filter-btn.has-active { border-color: var(--primary); color: var(--primary); }
.mobile-filter-badge {
  background: var(--primary); color: #fff;
  font-size: .7rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.filter-sheet-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
}
.filter-sheet-backdrop.open { display: block; }
.filter-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1001;
  background: var(--white); border-radius: 20px 20px 0 0;
  padding: 0 16px 32px; max-height: 88vh; overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32,1.1,.3,1);
}
.filter-sheet.open { transform: translateY(0); }
.filter-sheet-handle {
  width: 48px; height: 4px; border-radius: 2px;
  background: rgba(0,0,0,.2); margin: 12px auto 20px;
}
.filter-sheet-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 16px;
}
.filter-sheet .form-group { margin-bottom: 14px; }
.filter-sheet-footer {
  display: flex; gap: 8px; margin-top: 20px;
}
@media (max-width: 640px) {
  .filter-bar { display: none; }
  .mobile-filter-compact { display: flex; }
}
@media (min-width: 641px) {
  .filter-sheet, .filter-sheet-backdrop { display: none !important; }
}

/* ── U2: Photo lightbox ── */
/*
 * overlay: flex 置中，不加 backdrop-filter（會讓子元素 position:fixed 失準）
 * 控制元件改 position:absolute（overlay 本身全螢幕，效果與 fixed 相同）
 * image: 普通 flex item，max-width/max-height 自動縮放
 * z-index 分層：overlay(2000) > 控制元件(2) > 圖片(1)，均相對 overlay stacking context
 */
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.92);
}
.lightbox-overlay.open {
  display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
  /* size/position 由 _lbPositionImage() 以 inline style 設定 */
  border-radius: 6px;
  user-select: none;
  display: block;
}
.lightbox-close {
  position: absolute; z-index: 2; top: 16px; right: 20px;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 1.6rem; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.28); }
.lightbox-counter {
  position: absolute; z-index: 2; top: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.8); font-size: .88rem; font-weight: 600;
  background: rgba(0,0,0,.4); padding: 4px 12px; border-radius: 20px;
}
.lightbox-nav {
  position: absolute; z-index: 2; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.25); color: #fff;
  font-size: 1.6rem; width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-nav:hover { background: rgba(0,0,0,.75); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.listing-photos img, .listing-photos-single { cursor: zoom-in; }
@media (max-width: 640px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 1.3rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ── Skeleton shimmer ── */
@keyframes shimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
}

/* ── Page fade-in (listing) ── */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-fadein { animation: pageIn .25s ease both; }


.why-card {
  background: linear-gradient(180deg, #fff 0%, #fffbf7 100%);
  border: 1px solid #f5e7da;
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.why-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #fdba74;
}
.why-grid-premium { align-items: stretch; }
.why-card-featured { background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%); }
.why-card h3 { margin-top: 14px; margin-bottom: 8px; font-size: 1.02rem; }
.why-card p { color: var(--text-soft); line-height: 1.75; }
.why-card-icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary-deep); box-shadow: inset 0 0 0 1px rgba(251,146,60,.12);
}
.landlord-cta { border-radius: 32px; margin: 24px auto 56px; max-width: 1100px; box-shadow: var(--shadow-soft); }
.cta-badge { box-shadow: 0 8px 24px rgba(255,255,255,.08); }
.filter-bar { position: sticky; top: 64px; z-index: 60; background: rgba(250,250,249,.88); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(231,229,228,.8); }
.filter-bar-inner { gap: 12px; }
.mobile-filter-compact { background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(231,229,228,.85); }
.mobile-filter-btn { border-radius: 999px; box-shadow: 0 10px 24px rgba(28,25,23,.08); }
.filter-sheet { border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(28,25,23,.16); }
.listing-detail-grid { gap: 32px; }
.listing-photos, .listing-photos-single { box-shadow: var(--shadow-soft); }
.cta-trust-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid #f3e8df; display: grid; gap: 10px; }
.cta-trust-row { display:flex; align-items:center; gap:9px; font-size:.88rem; color: var(--text-soft); }
.cta-trust-check { width:22px; height:22px; border-radius:999px; background:#ecfdf5; color:#15803d; display:inline-flex; align-items:center; justify-content:center; font-weight:800; flex-shrink:0; }
/* lightbox overlay backdrop-filter 已移除：會把子元素 position:fixed 的 containing block 替換掉 */
.site-footer { background: linear-gradient(180deg, #1c1917 0%, #111827 100%); }
@media (max-width: 600px) {
  .search-box { border-radius: 22px; padding: 18px; }
  .hero-search-btn { min-height: 48px; }
  .section { padding: 24px 12px; }
  .listing-detail-grid { gap: 22px; }
  .btn-sm { min-height: 44px; }
}
.listing-grid-premium { gap: 24px; }
.detail-stat-grid .card { border: 1px solid #f3e8df; box-shadow: 0 10px 24px rgba(28,25,23,.05); }
.detail-cta-card { border: 1px solid #f5e7da; box-shadow: var(--shadow-soft); border-radius: 24px; }
.detail-primary-cta { min-height: 52px; font-size: 1rem; }
.listing-detail-grid .divider { margin: 28px 0; border-top: 1px solid #f3e8df; }
.listing-detail-grid h3 { font-size: 1.02rem; letter-spacing: -.01em; }
.listing-detail-grid p { color: var(--text-soft); }
.amenity-tag { box-shadow: 0 8px 16px rgba(28,25,23,.04); }
#lightbox-counter { letter-spacing: .04em; }
#mobile-cta-bar, .mobile-cta-bar { backdrop-filter: blur(14px); box-shadow: 0 -12px 24px rgba(28,25,23,.1); }
