[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #657282;
  --line: #d9e0e7;
  --paper: #ffffff;
  --mist: #f5f7f9;
  --brand: #cf1722;
  --brand-dark: #a9121d;
  --navy: #173765;
  --navy-dark: #0f294e;
  --teal: #173765;
  --gold: #b67b22;
  --green: #2e7d4f;
  --shadow: 0 18px 55px rgba(31, 45, 61, 0.14);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--mist);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(130deg, rgba(15, 41, 78, 0.86), rgba(207, 23, 34, 0.58)),
    url("https://images.unsplash.com/photo-1560518883-ce09059eeffa?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.login-panel {
  width: min(460px, 100%);
  padding: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  border-top: 6px solid var(--brand);
}

.brand-mark {
  width: 122px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-panel h1,
.topbar h1 {
  margin: 16px 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
}

.login-panel p {
  color: var(--muted);
  margin: 0 0 24px;
}

.login-form,
.control-band {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #3c4856;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  min-height: 48px;
  /* 16px 以上可避免 iOS Safari 聚焦時自動放大畫面 */
  font-size: 16px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(17, 106, 111, 0.14);
}

.login-form button,
.user-box button,
.tab-button {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
}

.login-form button {
  margin-top: 4px;
  background: var(--navy);
  color: #fff;
}

.login-form button:hover,
.user-box button:first-of-type:hover {
  background: var(--navy-dark);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--brand-dark);
  font-weight: 700;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
  position: relative;
}

/* 「功能」下拉選單 */
.user-box .menu-btn {
  background: var(--navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 80;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(23, 32, 42, 0.18);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
}
.menu-panel[hidden] { display: none; }
.menu-panel button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.menu-panel button:hover { background: #f2f5f8; }
.menu-panel button[hidden] { display: none; }
.menu-panel button i { font-size: 17px; color: var(--navy); }
.menu-panel #share-rentals i { color: #06c755; }

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0;
}

.topbar h1 {
  margin: 4px 0 0;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-box span {
  color: var(--muted);
  font-weight: 800;
}

.user-box .rentlink-btn {
  background: #06c755;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.user-box .rentlink-btn:hover { background: #05b34c; }

.user-box #refresh-button,
.user-box #health-button {
  background: var(--navy);
  color: #fff;
}

.user-box button:last-of-type {
  background: #e8edf2;
  color: var(--ink);
}

.control-band {
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(140px, 1fr));
  align-items: end;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(31, 45, 61, 0.06);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-row input {
  min-width: 0;
  flex: 1;
}

.range-row span {
  color: var(--muted);
  flex: none;
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  background: transparent;
  color: var(--muted);
  border-radius: 6px 6px 0 0;
}

.tab-button.active {
  color: #fff;
  background: var(--navy);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-strip > div {
  border-left: 4px solid var(--brand);
  background: #fff;
  padding: 14px 16px;
  border-radius: 6px;
}

.summary-strip span {
  display: block;
  font-size: 22px;
  font-weight: 900;
}

.summary-strip small {
  color: var(--muted);
}

.status-panel {
  padding: 20px;
  background: #fff8e9;
  border: 1px solid #efd098;
  border-radius: 8px;
  color: #725019;
  font-weight: 700;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ───── 591 風格物件列表（圖左資訊右的橫式卡片） ───── */
.cards-grid.as-list {
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.prop-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.prop-card:hover {
  box-shadow: 0 10px 26px rgba(31, 45, 61, 0.13);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.prop-thumb {
  position: relative;
  background: #eef2f5;
  min-height: 108px;
  overflow: hidden;
}

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

.prop-noimg {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #9aa7b4;
  font-weight: 800;
  font-size: 14px;
}

.prop-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 4px;
}

.prop-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.prop-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  min-width: 0;
}

.prop-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.ptag {
  background: #eef3f8;
  color: #3c4856;
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
}

.prop-loc {
  color: var(--muted);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prop-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.prop-price {
  color: var(--brand);
  font-size: 20px;
  font-weight: 950;
  white-space: nowrap;
  flex: none;
}

.prop-unit {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-icon {
  margin-left: auto;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #06c755;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.share-icon:hover { background: #05b34c; }

.prop-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--mist);
}

.prop-agent {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.prop-status {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 800;
  background: #e8f5ee;
  padding: 3px 9px;
  border-radius: 999px;
}

.prop-share {
  margin-top: 10px;
}

.share-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 6px;
  background: #06c755; /* LINE 綠 */
  color: #fff;
  font-weight: 900;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.share-btn::before {
  content: "🔗";
  font-size: 15px;
}

.share-btn:hover { background: #05b34c; }

/* 手機：圖片改上下比例縮小、字級微調 */
@media (max-width: 640px) {
  .prop-card {
    grid-template-columns: 112px 1fr;
  }
  .prop-thumb {
    height: 100%;
    min-height: 100px;
  }
  .prop-info {
    padding: 9px 11px;
    gap: 5px;
  }
  .prop-title {
    font-size: 15px;
  }
  .prop-price {
    font-size: 18px;
  }
  .ptag {
    font-size: 11.5px;
    padding: 2px 7px;
  }
}

/* ───── 客需純文字卡片 ───── */
.need-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}

.need-card:hover {
  box-shadow: 0 8px 22px rgba(31, 45, 61, 0.12);
  transform: translateY(-1px);
}

/* 有附圖的客需卡：左圖右文 */
.need-card.has-thumb {
  flex-direction: row;
  gap: 12px;
  align-items: stretch;
}
.need-card.has-thumb .need-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.need-thumb {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--mist, #f5f7f9);
}
.need-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.need-photo-count {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.need-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.need-type {
  flex: none;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 4px;
}

.need-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.need-budget {
  color: var(--brand);
  font-size: 20px;
  font-weight: 950;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.need-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.need-chip {
  background: #f2f5f7;
  color: #3c4856;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
}

.need-chip b {
  color: var(--muted);
  font-weight: 800;
  margin-right: 2px;
}

.need-note {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--mist);
}

.card {
  display: grid;
  grid-template-rows: 170px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(31, 45, 61, 0.08);
}

.card-media {
  position: relative;
  min-height: 170px;
  background:
    linear-gradient(135deg, rgba(23, 55, 101, 0.92), rgba(207, 23, 34, 0.74)),
    url("https://images.unsplash.com/photo-1494526585095-c41746248156?auto=format&fit=crop&w=900&q=80") center / cover;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.media-pill {
  position: absolute;
  top: 12px;
  left: 12px;
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.card h2 {
  margin: 0;
  min-height: 52px;
  font-size: 20px;
  line-height: 1.28;
  letter-spacing: 0;
}

.price {
  color: var(--brand);
  font-size: 22px;
  font-weight: 950;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-item {
  padding: 9px 10px;
  border-radius: 6px;
  background: #f2f5f7;
  min-width: 0;
}

.meta-item small {
  display: block;
  color: var(--muted);
  margin-bottom: 3px;
}

.meta-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.card-actions button {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}

.agent {
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

dialog {
  width: min(850px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 32, 42, 0.56);
}

.detail-panel header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.detail-panel h2 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.22;
}

#close-detail {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: #eef2f5;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.detail-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: min(70vh, 680px);
  overflow: auto;
  padding: 22px;
}

.detail-gallery {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  height: clamp(280px, 44vh, 480px);
}

.detail-gallery img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  scroll-snap-align: center;
  background: #eef2f5;
  cursor: zoom-in;
}

/* 全螢幕看圖（<dialog> 版：疊在詳情 modal 上層） */
.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox .lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #17202a;
  font-size: 24px;
  border: 0;
}

.video-wrap {
  position: relative;
  padding-top: 56.25%;
  margin-top: 4px;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

.detail-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.detail-field.full {
  grid-column: 1 / -1;
}

.detail-field small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 5px;
}

.detail-field div {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* 只看我的 切換 */
.mine-toggle {
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  font-weight: 700;
  color: var(--navy, #173765);
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
}
.mine-toggle input { width: 16px; height: 16px; accent-color: var(--brand, #cf1722); cursor: pointer; }

/* 開放狀態小標（店內流通/下架 才顯示） */
.status-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: 2px;
  white-space: nowrap;
}
.status-chip.internal { background: #eef3f8; color: var(--navy, #173765); border: 1px solid #cddcea; }
.status-chip.off { background: #f3f4f6; color: #8a94a0; border: 1px solid #e0e4e8; }

/* 卡片媒合提示 */
.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 800;
  color: #b26a00;
  background: #fff3e0;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.match-badge i { font-size: 14px; }

/* 營運總覽儀表板 */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.dash-card {
  background: var(--mist, #f5f7f9);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}
.dash-card .dash-num {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: var(--navy, #173765);
  line-height: 1.1;
}
.dash-card small {
  color: var(--muted, #657282);
  font-weight: 700;
  font-size: 12px;
}

/* 安置街廓行情表 */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}
.rate-table th {
  text-align: right;
  color: var(--muted, #657282);
  font-weight: 700;
  padding: 4px 6px;
  border-bottom: 1px solid var(--line, #e3e8ee);
}
.rate-table th:first-child { text-align: left; }
.rate-table td {
  padding: 6px;
  border-bottom: 1px solid #f0f3f6;
}
.rate-table td:first-child { font-weight: 700; }

/* 實登成交：查看地籍圖連結 */
.deal-map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy, #173765);
  text-decoration: none;
}
.deal-map-link:hover { text-decoration: underline; }

/* 查看物件位置按鈕 */
.loc-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--navy, #173765);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
}
.loc-btn i { font-size: 16px; }
.loc-btn:active { opacity: 0.85; }

/* 物件狀態切換 */
.status-switch { border-style: dashed; }
.status-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.st-btn {
  flex: 1;
  min-width: 90px;
  padding: 10px 8px;
  border: 1.5px solid var(--line, #e3e8ee);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted, #657282);
  cursor: pointer;
}
.st-btn.active {
  border-color: var(--navy, #173765);
  background: var(--navy, #173765);
  color: #fff;
}
.st-btn[data-status="下架"].active {
  border-color: #8a94a0;
  background: #8a94a0;
}
.st-btn:disabled { opacity: 0.5; }

/* 分享瀏覽統計 */
.views-stat {
  background: var(--mist, #f5f7f9);
  border-style: dashed;
}
.views-stat div {
  color: var(--navy, #173765);
  font-weight: 600;
}
.views-stat strong {
  color: var(--brand, #cf1722);
  font-size: 1.1em;
}

/* 媒合結果清單 */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-item {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
  font-size: 13px;
  color: var(--ink);
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.match-item:hover {
  background: #eef3f8;
  border-color: var(--navy);
}

/* 提供設備/家具 圖示清單（有=深色、沒有=淺色劃掉） */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.equip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
}

.equip i {
  font-size: 24px;
  line-height: 1;
}

.equip.on {
  color: var(--navy);
  background: #eef3f8;
  border-color: #cddcea;
}

.equip.off {
  color: #c4cad1;
  background: #fafbfc;
}

.equip.off span {
  text-decoration: line-through;
}

@media (max-width: 900px) {
  .topbar,
  .user-box {
    align-items: start;
    justify-content: start;
  }

  .topbar {
    flex-direction: column;
  }

  .control-band,
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }
}

/* ───────── 手機優先版面（640px 以下） ───────── */
@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    padding: 12px 12px 40px;
  }

  .login-shell {
    padding: 16px;
  }

  .login-panel {
    padding: 22px;
  }

  .topbar h1 {
    font-size: 26px;
  }

  /* 帳號列：姓名 + 重新整理 + 登出 一行排好按滿 */
  .user-box {
    width: 100%;
    justify-content: flex-start;
  }

  .user-box span {
    flex: 1 0 100%;
    margin-bottom: 4px;
  }

  .user-box button {
    flex: 1;
  }

  /* 篩選改 2 欄，搜尋框獨佔一整列 */
  .control-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  /* 分頁標籤吸頂，滑卡片時仍可切換買賣/租賃、物件/客需 */
  .tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 14px -12px;
    padding: 8px 12px 0;
    background: var(--mist);
    overflow-x: auto;
  }

  .tab-button {
    flex: 1 0 auto;
    min-height: 46px;
  }

  /* 摘要列縮小成一行三格 */
  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-strip > div {
    padding: 10px 12px;
  }

  .summary-strip span {
    font-size: 18px;
  }

  .summary-strip small {
    font-size: 11px;
  }

  /* 卡片單欄、加大圖片預覽 */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    grid-template-rows: 200px 1fr;
  }

  .card-media,
  .card .card-media {
    min-height: 200px;
  }

  .card h2 {
    min-height: 0;
    font-size: 19px;
  }

  /* 查看詳情按鈕加大好按 */
  .card-actions button {
    min-height: 44px;
  }

  /* 詳情視窗在手機上全螢幕，單欄好讀 */
  dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .detail-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .detail-panel header {
    padding: 16px;
  }

  .detail-panel h2 {
    font-size: 22px;
  }

  .detail-body {
    grid-template-columns: 1fr;
    max-height: none;
    flex: 1;
    padding: 16px;
  }
}
