:root {
  --brand: #0e67ab;
  --brand-light: #e8f3fb;
  --brand-dark: #0a4f85;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f6f8;
  color: #1a1a1a;
}

.app { max-width: 1100px; margin: 0 auto; background: #f5f6f8; min-height: 100vh; position: relative; }

/* Header */
.hdr {
  background: var(--brand);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hdr-logo { display: flex; align-items: center; gap: 8px; }
.hdr-logo i { font-size: 22px; color: #fff; }
.hdr-logo span { font-size: 16px; font-weight: 500; color: #fff; }
.hdr-lang {
  background: rgba(255,255,255,0.18);
  border: 0.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.hdr-lang i { font-size: 17px; color: #fff; }

/* Back button */
.det-back-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
  padding: 0;
}
.det-back {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #666; cursor: pointer;
  padding: 12px 16px;
  flex: 1;
  transition: color 0.15s;
}
.det-back:hover { color: var(--brand); }
.det-back i { font-size: 16px; }

.share-quick-btn {
  background: transparent;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  color: #666;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  border-left: 0.5px solid rgba(0,0,0,0.1);
}
.share-quick-btn:hover {
  color: var(--brand);
}

/* Gallery */
.gallery { background: #1a2b3c; }
.gallery-main {
  height: 500px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}
.gallery-main .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,20,35,0.65) 0%, transparent 55%);
  pointer-events: none;
}
.gallery-ribbon {
  position: absolute; top: 14px; left: 14px;
  background: var(--brand); color: #fff;
  font-size: 11px; padding: 3px 10px; border-radius: 6px;
}

.gallery-counter {
  position: absolute; bottom: 10px; right: 12px;
  background: rgba(0,0,0,0.45); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 5px;
}
.gallery-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 1rem;
}
.published-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(14,103,171,0.85); color: #fff;
  font-size: 10px; padding: 2px 8px; border-radius: 5px; margin-bottom: 6px;
}
.pub-dot { width: 5px; height: 5px; border-radius: 50%; background: #4ade80; }
.gallery-title { font-size: 22px; font-weight: 500; color: #fff; line-height: 1.3; }
.gallery-code { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }

.thumbs {
  display: flex;
  gap: 3px;
  padding: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.thumbs::-webkit-scrollbar {
  height: 6px;
}
.thumbs::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}
.thumbs::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
}
.thumb {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  transition: border-color 0.15s;
  background-size: cover;
  background-position: center;
}
.thumb.active { border-color: var(--brand); }
.thumb .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.thumb-ov {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.3); transition: opacity 0.15s;
}
.thumb.active .thumb-ov, .thumb:hover .thumb-ov { opacity: 0; }

/* Body */
.det-body { padding: 1.25rem 1rem 0; }

.price-row {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 0.5rem; padding-bottom: 0.5rem;
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
}
.price-main { font-size: 28px; font-weight: 500; color:red; }
.price-compare { font-size: 15px; color: #999; text-decoration: line-through; }
.price-save {
  font-size: 11px; background: var(--brand-light);
  color: var(--brand-dark); padding: 3px 8px; border-radius: 5px;
}

.sec-label {
  font-size: 11px; font-weight: 500; color: #999;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px;
}

.categ-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.cpill {
  font-size: 12px; background: var(--brand-light); color: var(--brand-dark);
  padding: 4px 12px; border-radius: 20px;
  display: flex; align-items: center; gap: 4px;
}
.cpill i { font-size: 12px; }
.codepill {
  font-size: 12px; background: #f0f0f0; color: #555;
  padding: 4px 12px; border-radius: 20px; font-family: monospace;
}

.attrs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 8px; margin-bottom: 1.25rem;
}
.attr-card {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-md); padding: 10px 12px;
}
.attr-name { font-size: 11px; color: #999; margin-bottom: 3px; }
.attr-val {
  font-size: 13px; font-weight: 500; color: #1a1a1a;
  display: flex; align-items: center; gap: 5px;
}
.attr-val i { font-size: 14px; color: var(--brand); }

.desc-card {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.desc-text {
  font-size: 14px; color: #555; line-height: 1.75;
}
.desc-text.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more {
  font-size: 13px; color: var(--brand);
  cursor: pointer; margin-top: 8px; display: inline-block;
}

/* 房源规格表 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
}
.spec-table tr {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.014);
  transition: background 0.12s;
}
.spec-table tr:last-child {
  border-bottom: none;
}
.spec-table tr:hover {
  background: rgba(14,103,171,0.03);
}
.spec-td-label {
  padding: 16px 12px 16px 16px;
  font-size: 13px;
  color: #090909;
  font-weight: 400;
  width: 42%;
  vertical-align: middle;
  letter-spacing: 0.01em;
}
.spec-td-val {
  padding: 16px 16px 16px 12px;
  font-size: 13px;
  color: #1a1a1a;
  font-weight: 500;
  text-align: right;
  vertical-align: middle;
}
.spec-td-val.highlight {
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
}
.spec-td-val.deposit {
  color: red;
  font-weight: 600;
}
.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
}
.spec-amenities {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.amenity-chip {
  font-size: 11px;
  color: #ffffff;
  background: #0e67aba5;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}
.spec-section-hdr {
  background: #f8f9fb;
  padding: 8px 4px;
  font-size: 10px;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 0.5px solid rgba(0,0,0,0.07);
  border-top: 0.5px solid rgba(0,0,0,0.07);
  pointer-events: none;
}
.spec-section-hdr td {
  padding: 10px 10px;
}

.cta-block {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 2rem;
}
.cta-primary {
  width: 100%; background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius-md);
  padding: 13px 0; font-size: 15px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px; margin-bottom: 10px;
  transition: background 0.15s;
}
.cta-primary:hover { background: var(--brand-dark); }
.cta-primary i { font-size: 18px; }
.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cta-sec {
  background: #0e67ab; color: var(--brand-light);
  border: 1px solid var(--brand); border-radius: var(--radius-md);
  padding: 10px 0; font-size: 13px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 6px;
  transition: background 0.15s;
}
.cta-sec:hover { background: var(--brand-light); color: var(--brand-dark);}
.cta-sec i { font-size: 16px; }

.share-row {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 14px;
}
.share-label { font-size: 12px; color: #999; }
.share-btn {
  background: #f5f5f5;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #666; transition: border-color 0.15s, color 0.15s;
}
.share-btn:hover { border-color: var(--brand); color: var(--brand); }
.share-btn i { font-size: 16px; }

.toast {
  display: none;
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: #1a2b3c; color: #fff;
  font-size: 13px; padding: 8px 16px;
  border-radius: var(--radius-md);
  white-space: nowrap; z-index: 999;
}
.toast.show { display: block; }

/* 模态框样式 */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  /* align-items: flex-end; */
  justify-content: center;
  padding: 0;
  animation: slideUp 0.3s ease-out;
}
.modal-overlay.show { display: flex; }

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 90%;
  max-width: 350px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  margin: auto;
}

.modal-overlay.show .modal-content {
  animation: slideUp 0.3s ease-out;
}

.modal-center .modal-content {
  border-radius: 16px;
  max-height: 80vh;
  margin: auto;
  max-width: 320px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.modal-close:hover { color: #333; }

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.share-modal-btn {
  background: #f5f5f5;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.share-modal-btn:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
}
.share-modal-btn i { font-size: 18px; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.lang-option:hover { background: #f5f5f5; }

.lang-radio {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand);
}

.lang-flag {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  border-radius: 2px;
}

.lang-text {
  font-size: 14px;
  color: #1a1a1a;
  font-weight: 500;
  flex: 1;
}

.lang-option input:checked + .lang-flag + .lang-text {
  color: var(--brand);
}



/* ══════════════════════════════════════
   LIGHTBOX — 全屏图片预览
   参考 khmer24 风格：大图居中，箭头两侧，
   缩略图底部，页码左上角
══════════════════════════════════════ */

#imageModal {
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  flex-direction: column;
}

/* 页数 — 左上角固定 */
.lb-counter {
  position: fixed;
  top: 16px;
  left: 20px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  z-index: 1010;
  pointer-events: none;
}

/* 关闭按钮 — 右上角固定 */
.lb-close {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 1010;
  background: rgba(255,255,255,0.12);
  border: 0.5px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.15s;
}
.lb-close:hover { background: rgba(255,255,255,0.25); }

/* 主体：箭头 + 图片横向排列 */
.lb-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 56px 0 12px;
}

/* 左右箭头 */
.lb-arrow {
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border: 0.5px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  transition: background 0.15s;
  z-index: 1010;
}
.lb-arrow:hover { background: rgba(255,255,255,0.25); }

/* 大图区域 */
.lb-img-wrap {
  flex: 1;
  max-width: 80vw;
  max-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lb-img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* 缩略图栏 — 底部固定 */
.lb-thumbs {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px 16px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
  max-width: 100vw;
  justify-content: center;
}
.lb-thumbs::-webkit-scrollbar { height: 4px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

.lb-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  background-size: cover;
  background-position: center;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
}
.lb-thumb.active {
  border-color: #fff;
  opacity: 1;
}
.lb-thumb:hover { opacity: 0.9; }
