/* ==========================================================================
   都更神探R · v2 — 全新前台
   設計原則：
   - card-based 物件展示（不是 row-based 表格）
   - 倍數用大字 + 顏色 band 醒目顯示
   - 卡片 hover/click 才出快捷鍵
   - 大螢幕：左 sidebar(260px) + main grid + right drawer(420px)
   - 13" 筆電：sidebar 240px + 2-3 欄 grid
   - iPad：sidebar 變 hamburger drawer + 2 欄 grid
   - iPhone：1 欄 grid + 全寬 detail modal
   ========================================================================== */

/* === 0. Reset + Base ====================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  /* iOS Safari 預設 text-size-adjust: auto 會在 orientation 轉橫時自動把字 inflate
   * 讓橫向「更好讀」，轉回直立 sticky 不會 reset → 用戶感覺字越來越大。
   * 鎖 100% 維持原 font-size，不影響 accessibility 大字（用戶仍可手指縮放）。*/
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body.v2 {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* === 0.5 Bootstrap Loader (首次載入全頁遮罩) =============================== */
#v2-bootstrap-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(180deg, #fbf9f3 0%, #f5f0e3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
#v2-bootstrap-loader.v2-bootstrap-loader--hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.v2-bootstrap-loader__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.v2-bootstrap-loader__logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(199, 138, 0, 0.18);
  animation: v2-loader-pulse 1.6s ease-in-out infinite;
}
@keyframes v2-loader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.92; }
}
.v2-bootstrap-loader__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e0d9c2;
  border-top-color: #c78a00;
  border-radius: 50%;
  animation: v2-loader-spin 0.85s linear infinite;
}
@keyframes v2-loader-spin {
  to { transform: rotate(360deg); }
}
.v2-bootstrap-loader__text {
  font-size: 14px;
  color: #8b7e5a;
  letter-spacing: 1px;
}

/* :disabled 狀態的按鈕 (capture 卡送出鈕) — 灰化 + 禁用游標 */
.v2-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* (pull-to-refresh 已移除 — 用 topbar 重整按鈕取代，避免滑動卡頓感) */

/* === 1. Design Tokens ===================================================== */
:root {
  /* Colors */
  --c-bg: #f8fafc;            /* slate-50 — 主背景 */
  --c-card: #ffffff;
  --c-text: #0f172a;          /* slate-900 */
  --c-text-muted: #64748b;    /* slate-500 */
  --c-text-light: #94a3b8;    /* slate-400 */
  --c-border: #e2e8f0;        /* slate-200 */
  --c-border-strong: #cbd5e1; /* slate-300 */
  --c-hover: #f1f5f9;         /* slate-100 */

  --c-accent: #0891b2;        /* cyan-600 — 品牌 */
  --c-accent-hover: #0e7490;
  --c-accent-light: #cffafe;  /* cyan-100 */

  --c-good: #16a34a;          /* green-600 — 高倍數 */
  --c-good-bg: #dcfce7;
  --c-mid: #ca8a04;           /* yellow-600 */
  --c-mid-bg: #fef9c3;
  --c-low: #94a3b8;
  --c-low-bg: #f1f5f9;

  --c-danger: #dc2626;        /* red-600 — 抗性 / 法拍 */
  --c-danger-bg: #fee2e2;
  --c-warn: #ea580c;          /* orange-600 */
  --c-warn-bg: #fed7aa;
  --c-resist-yellow: #b45309; /* amber-700 — 五樓蓋 */
  --c-resist-yellow-bg: #fef3c7;

  --c-topbar: #0f172a;        /* slate-900 — 深色 topbar */
  --c-topbar-text: #f1f5f9;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Sizes */
  --topbar-h: 52px;
  --sidebar-w: 268px;
  --drawer-w: 1080px;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --sh-2: 0 2px 8px rgba(15, 23, 42, 0.08);
  --sh-3: 0 8px 24px rgba(15, 23, 42, 0.12);

  /* Transitions */
  --t-fast: 120ms;
  --t-mid: 200ms;
}

/* === 2. Topbar ============================================================ */
.v2-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--c-topbar);
  color: var(--c-topbar-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  z-index: 100;
}
.v2-topbar__left, .v2-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.v2-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-topbar-text);
}
.v2-brand__logo { width: 28px; height: 28px; border-radius: var(--r-sm); }
.v2-brand__name { font-weight: 600; font-size: 16px; }
.v2-brand__version {
  font-size: 11px;
  font-weight: 500;
  background: var(--c-accent);
  color: white;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  letter-spacing: 0.5px;
}
.v2-text-btn {
  font-size: 13px;
  color: var(--c-text-light);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  cursor: pointer;
}
.v2-text-btn:hover { background: rgba(255,255,255,0.08); color: white; }

/* 常用連結 dropdown (hover 展開) */
.v2-useful-links { position: relative; }
.v2-useful-links__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 260px;
  background: #fffdf7;
  border: 1px solid #d6c68a;
  border-radius: var(--r-md);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  padding: 6px 0;
  z-index: 1050;
  display: none;
  flex-direction: column;
}
.v2-useful-links:hover .v2-useful-links__dropdown,
.v2-useful-links__dropdown:hover {
  display: flex;
}
.v2-useful-links__dropdown a {
  padding: 8px 14px;
  color: #5c4a0a;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.v2-useful-links__dropdown a:hover {
  background: #f4e5b5;
  color: #b0790a;
}
@media (max-width: 640px) {
  .v2-useful-links__dropdown { right: auto; left: 0; min-width: 220px; }
}
.v2-icon-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: inherit;
}
.v2-icon-btn:hover { background: rgba(255,255,255,0.08); }
.v2-user {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
}
.v2-user__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}
.v2-user__email { color: var(--c-text-light); }

/* === 3. App shell ========================================================= */
.v2-shell {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden;
}

/* === 4. Sidebar (filters) ================================================= */
.v2-sidebar {
  background: var(--c-card);
  border-right: 1px solid var(--c-border);
  overflow-y: auto;
  z-index: 50;
}
.v2-sidebar__inner {
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;        /* group 之間間距：16px (從 10 → 16 視覺更舒展) */
  font-size: 12px;
}
/* 所有 sidebar 直接子元素一律靠 sidebar__inner gap 控制間距 (拿掉個別 margin) */
.v2-sidebar__inner > * { margin-bottom: 0; margin-top: 0; }
/* 進入 explore section 內部，filter group 之間維持較大間距 */
.v2-sidebar-section--explore { display: flex; flex-direction: column; gap: 16px; }
/* sidebar 內所有 input/select/label 字體統一 12px */
.v2-sidebar input,
.v2-sidebar select,
.v2-sidebar label,
.v2-sidebar span,
.v2-sidebar .v2-filter-label {
  font-size: 12px;
}
/* 例外：action buttons 保留原本字體 (13px)，比較顯眼 */
.v2-sidebar .v2-action-row .v2-btn {
  font-size: 13px;
}
.v2-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 49;
}
.v2-sidebar-backdrop.v2-open { display: block; }

/* Tabs */
.v2-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-1);
  background: var(--c-hover);
  padding: 3px;
  border-radius: var(--r-md);
}
.v2-tab {
  padding: 5px 8px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.v2-tab:hover { color: var(--c-text); }
.v2-tab--active {
  background: var(--c-card);
  color: var(--c-text);
  box-shadow: var(--sh-1);
}
.v2-tab__icon { font-size: 14px; }

/* Filter groups — 高度緊湊：在 1000px 螢幕內塞完 */
.v2-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v2-filter-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 0;
}

/* Inputs — sidebar 高度緊湊版 */
.v2-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-card);
  color: var(--c-text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--t-fast);
}
.v2-input:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-light); }
.v2-input--num { text-align: right; }
.v2-range {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.v2-range .v2-input { flex: 1; }
.v2-range__sep { color: var(--c-text-muted); font-size: 12px; }
.v2-num-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.v2-num-row__label {
  font-size: 12px;
  color: var(--c-text-muted);
  width: 64px;
  flex-shrink: 0;
}
.v2-num-row__suffix {
  font-size: 12px;
  color: var(--c-text-light);
}
.v2-num-row .v2-input { flex: 1; min-width: 0; }

/* Compact 數字輸入 — 篇幅小一點 */
.v2-filter-group--num-compact { gap: 4px; }
.v2-num-row--compact {
  gap: 6px;
  font-size: 12px;
  align-items: center;
}
.v2-num-row--compact .v2-num-row__label {
  font-size: 11px;
  width: auto;
  flex-shrink: 0;
  color: var(--c-text-muted);
}
.v2-num-row--compact .v2-num-row__suffix {
  font-size: 11px;
}
.v2-num-row--pair {
  /* 建單價 + 地單價 並排在同一列 */
  display: flex;
  flex-wrap: nowrap;
}
.v2-num-row--pair .v2-num-row__sep {
  width: 1px;
  align-self: stretch;
  background: var(--c-border);
  margin: 2px 4px;
}
.v2-input--xs {
  padding: 3px 5px;
  font-size: 12px;
  flex: 1 1 0;
  min-width: 0;
  text-align: right;
}

/* 主動作按鈕 row：搜尋 + 重置同一列 */
.v2-action-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4px;
}
.v2-action-row .v2-btn { width: 100%; padding: 7px 10px; font-size: 13px; }

/* 最低獲利倍數：toggle + input + 倍以上 同一列 */
.v2-min-mult-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;        /* row 不換行 — toggle 跟 slider wrap 永遠同 row */
}
.v2-min-mult-row .v2-toggle--inline {
  flex: 0 0 auto;
  min-width: 0;
  font-size: 12px;
}
.v2-min-mult-row .v2-input {
  flex: 0 0 56px;
  text-align: right;
}
.v2-min-mult-row .v2-num-row__suffix {
  font-size: 11px;
  color: var(--c-text-muted);
  flex-shrink: 0;
}
/* slider wrap 跟 toggle 同 row：
   - min-width:0 讓 wrap 可以縮小，避免被 slider element 預設 min-width 撐爆把整個 wrap 推到下一行
   - wrap 內：label flex 1 在第 1 行接 toggle 後；slider flex 0 0 100% 換到 wrap 第 2 行 */
.v2-min-mult-row .v2-mobile-slider-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
  margin-top: 0;
}
.v2-min-mult-row .v2-mobile-slider-wrap .v2-mobile-slider-label {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}
.v2-min-mult-row .v2-mobile-slider-wrap .v2-mobile-slider {
  flex: 0 0 100%;
  min-width: 0;
  margin-top: 2px;
}

/* 抗性 toggle grid (3 col × 2 row，最後一格空) */
.v2-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px 6px;
}
.v2-toggle-grid .v2-toggle {
  font-size: 11px;
  padding: 0;
  white-space: nowrap;
}

/* 篩選都更案件 — 左台北 / 右新北 兩欄 */
.v2-redev-filter-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
}
.v2-redev-filter-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v2-redev-filter-col__title {
  font-size: 11px;
  font-weight: 600;
  color: #6b5a2a;
  margin-bottom: 2px;
  border-bottom: 1px solid #d8cdb6;
  padding-bottom: 2px;
}
.v2-redev-filter-col .v2-toggle {
  font-size: 11px;
  padding: 0;
  white-space: nowrap;
}

/* Floor「全部」master chip */
.v2-chip--all {
  border-color: var(--c-accent-light);
  color: var(--c-accent);
  font-weight: 600;
}

/* Disabled chip (例：尚未開放的透天厝/店面/萬華區等) */
.v2-chip--disabled {
  background: var(--c-hover);
  border-color: var(--c-border);
  color: var(--c-text-light);
  cursor: not-allowed;
  opacity: 0.55;
}
.v2-chip--disabled:hover {
  border-color: var(--c-border);
  color: var(--c-text-light);
}

/* District 城市上下排 (PC + mobile 統一)：台北上 / 新北下，中間水平分隔線 */
.v2-city-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.v2-city-grid .v2-city-col:first-child {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--c-border);
}
.v2-city-grid .v2-city-col:last-child {
  padding-top: 0;
}
.v2-city-col__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-muted);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.v2-city-all {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--c-text-light);
  cursor: pointer;
}
.v2-city-all input { width: 12px; height: 12px; accent-color: var(--c-accent); }
.v2-city-col__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.v2-city-col__chips .v2-chip {
  padding: 3px 7px;
  font-size: 12px;
}
.v2-sidebar .v2-city-col__chips .v2-chip span {
  font-size: 12px;
}

/* 窄螢幕 (≤1024px sidebar 變抽屜)：城市改成上下排 */
@media (max-width: 1024px) {
  .v2-city-grid {
    grid-template-columns: 1fr;
  }
}

/* Chip row */
.v2-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* 樓層 chips (全部+B1+1~5 = 7 個)：mobile sidebar 窄、預設 padding 會擠到「5」掉到下一行
   縮 gap + 縮 padding 讓 7 個能塞在同一行 */
#v2-floor-chips { gap: 4px; }
#v2-floor-chips .v2-chip { padding: 2px 6px; }

/* City toggle pills (only visible on narrow screens — hidden by default) */
.v2-city-toggle {
  display: none;
  gap: 4px;
  margin-bottom: 6px;
}
.v2-city-pill {
  flex: 1;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  background: var(--c-card);
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.v2-city-pill:hover { border-color: var(--c-border-strong); color: var(--c-text); }
.v2-city-pill--active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: white;
}

/* (舊的 .v2-city-grid 1fr 1fr 規則已刪除 — 跟前面 3fr 2fr 衝突 cascade)
   下面只留 city-col__chips 的內容樣式 */

/* sidebar 行政區 mobile = PC 同款 (1 col 上下排) */
.v2-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-muted);
  background: var(--c-card);
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
  line-height: 1.5;
}
.v2-chip input { display: none; }
.v2-chip:hover { border-color: var(--c-border-strong); color: var(--c-text); }
.v2-chip:has(input:checked) {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: white;
}

/* Toggle row */
.v2-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  padding: 1px 0;
  color: var(--c-text);
  line-height: 1.3;
}
.v2-toggle input { width: 14px; height: 14px; accent-color: var(--c-accent); cursor: pointer; flex-shrink: 0; }

/* Buttons */
.v2-btn {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.v2-btn--primary {
  background: var(--c-accent);
  color: white;
}
.v2-btn--primary:hover { background: var(--c-accent-hover); }
.v2-btn--ghost {
  background: transparent;
  color: var(--c-text-muted);
  border-color: var(--c-border);
}
.v2-btn--ghost:hover { background: var(--c-hover); color: var(--c-text); }
.v2-btn--block { width: 100%; }
.v2-btn--sm { padding: 5px 10px; font-size: 12px; }

/* === 5. Main content area ================================================= */
.v2-main {
  overflow-y: auto;
  background: var(--c-bg);
  padding: var(--sp-4);
}
.v2-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-4);
  padding: 0 var(--sp-1);
}
.v2-result-count {
  font-size: 14px;
  color: var(--c-text-muted);
  font-weight: 500;
}
.v2-result-count strong { color: var(--c-text); font-weight: 700; }
.v2-result-reload {
  margin-left: 6px;
  width: 28px;
  height: 28px;
  padding: 4px;
  color: var(--c-text-muted);
  vertical-align: middle;
}
.v2-result-reload:hover { color: var(--c-accent); background: var(--c-hover); }
.v2-select {
  padding: 6px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-card);
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
}

/* === 5.5 最愛 tab sidebar capture 卡 ====================================== */
/* 兩張卡 (URL / Manual)，每個 input 一行、有清楚 label、底下 hint 文字 */
.v2-cap {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px;
}
.v2-sidebar-section--watchlist .v2-cap + .v2-cap { margin-top: 10px; }
.v2-cap__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--c-border);
}
.v2-cap__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.v2-cap__label {
  font-size: 12px;
  color: var(--c-text-muted);
  width: 48px;
  flex-shrink: 0;
}
.v2-cap__field {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font-size: 12px;
}
.v2-cap__input {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  margin-bottom: 6px;
}
.v2-cap__btn {
  margin-top: 4px;
  font-size: 13px;
  padding: 7px 12px;
}
.v2-cap__hint {
  font-size: 10.5px;
  color: var(--c-text-light);
  margin-top: 6px;
  line-height: 1.4;
}

/* === 6. Card grid (台北左 / 新北右) ======================================== */
/* 設計目標：每張卡兩行內塞完，城市分欄並排，第一畫面看到最多筆物件 */
.v2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
/* 地圖模式樣式在獨立檔 frontend/static/map_mode.css，跟 style2.css 分離 */
.v2-grid-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.v2-grid-col__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.v2-grid-col__count {
  font-size: 11px;
  color: var(--c-text-light);
  font-weight: 500;
}
.v2-grid-col__cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.v2-grid-col__empty {
  font-size: 12px;
  color: var(--c-text-light);
  padding: 16px 0;
  text-align: center;
}

/* Card — 2 lines: line1 (icon+addr+price+mult+star) / line2 (stats+chips+sources) */
.v2-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  position: relative;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;   /* 給 NEW corner ribbon 用：旋轉斜貼超出邊界自然被切 */
}
/* NEW 標誌 — 左上角圓形 N (iOS 新訊息風格、粉紅不鮮紅) */
.v2-card__corner-new {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  background: #f48a9a;          /* 粉紅，比鮮紅柔和 */
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  padding: 0;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  z-index: 3;
}
.v2-card:hover {
  border-color: var(--c-accent);
  box-shadow: var(--sh-2);
}
.v2-card.v2-card--archived {
  opacity: 0.55;
  filter: grayscale(0.5);
}
/* 已讀：只地址變灰，其他不動。slate-400 比之前 slate-300 深一階較顯眼 */
.v2-card.v2-card--read .v2-card__addr,
.v2-card.v2-card--read .v2-card__district {
  color: #94a3b8 !important;
}
/* (左上角 corner ribbon 已移除 — 用戶要求乾淨外觀；城市區別仍可由區名文字表達) */

/* 高倍數 (≥3.5x) — 用淡淡的金光漸層背景表示「值得注意」，不用粗框 */
.v2-card.v2-card--hot {
  background:
    radial-gradient(circle at 92% 35%, rgba(251, 191, 36, 0.28) 0%, transparent 55%),
    linear-gradient(135deg, rgba(254, 243, 199, 0.5) 0%, rgba(255, 255, 255, 1) 60%);
  border-color: rgba(217, 119, 6, 0.35);
}
.v2-card.v2-card--hot:hover {
  background:
    radial-gradient(circle at 92% 35%, rgba(251, 191, 36, 0.4) 0%, transparent 55%),
    linear-gradient(135deg, rgba(254, 243, 199, 0.65) 0%, rgba(255, 255, 255, 1) 60%);
  border-color: rgba(217, 119, 6, 0.6);
}
.v2-card.v2-card--archived::after {
  content: '已下架';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  font-size: 18px;
  font-weight: 700;
  color: rgba(220, 38, 38, 0.85);
  border: 2px solid rgba(220, 38, 38, 0.85);
  padding: 4px 14px;
  letter-spacing: 3px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.85);
  pointer-events: none;
  z-index: 2;
}

/* Line 1: icon + 區·地址(ellipsis) | 總價+建單價 | 倍數 | ⭐ */
.v2-card__line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.v2-card__type {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}
.v2-card__addr {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
/* 物件地址套疊到任一都更圖層 → 紅字 + 射箭準心 icon */
.v2-card__addr--redev {
  color: #dc2626;
}
.v2-card__redev-target {
  display: inline-block;
  vertical-align: -1px;
  margin-left: 4px;
  color: #dc2626;
}
/* 已讀卡片：紅字 + icon 變淡 (對齊既有 v2-card--read 行為，
   既有 .v2-card--read .v2-card__addr 用 !important 蓋灰色，需用 !important 蓋回) */
.v2-card.v2-card--read .v2-card__addr--redev,
.v2-card.v2-card--read .v2-card__addr--redev .v2-card__redev-target {
  color: #f29292 !important;
}
.v2-card__district {
  font-size: 14px;
  color: var(--c-text-muted);
  font-weight: 500;
  margin-right: 2px;
}

/* 區 ↔ 地址 之間的細直線分隔 (取代音節號 ·) */
.v2-card__sep {
  display: inline-block;
  width: 1px;
  height: 12px;
  background: var(--c-border);
  margin: 0 8px;
  vertical-align: middle;
  flex-shrink: 0;
}
/* 總價 + LVR icon — line1 baseline 對齊地址 */
.v2-card__price-block {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  flex-shrink: 0;
  white-space: nowrap;
}
.v2-card__price {
  font-size: 17px;
  font-weight: 700;
  color: var(--c-accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.v2-card__price small {
  font-size: 11px;
  font-weight: 500;
  color: var(--c-text-muted);
  margin-left: 2px;
}
.v2-card__price-per {
  font-size: 11px;
  color: var(--c-text-light);
  font-variant-numeric: tabular-nums;
}
/* 倍數區塊 — 整塊（數字 + ×）做成從卡片頂端往下延伸的旗標
   tier：>=4 桃紅 / >=3 綠 / >=2 土黃 / <2 (含 null) 灰
   寬度固定，不論顯示「— x」或「3.5×」都對齊 */
.v2-card__mult {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #94a3b8; /* default tier: <2 或無倍數 灰 (slate-400) */
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  align-self: flex-start;
  margin-top: -8px;
  margin-bottom: 2px;
  padding: 10px 4px 6px;
  border-radius: 0 0 4px 4px;
  width: 52px;
  box-sizing: border-box;
  text-align: center;
}
.v2-card__mult small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  color: inherit;
  background: transparent;
  padding: 0;
  margin: 0;
  line-height: 1;
}
/* tier 顏色對齊地圖 marker 配色（≥3.5 紅 / ≥2.5 黃 / 其他預設灰）— 用戶要求保持一致 */
.v2-card__mult--mid,
.v2-card__mult--hot,
.v2-card.v2-card--hot .v2-card__mult { color: #fff !important; }
.v2-card__mult--mid  { background: #f59e0b; }   /* 2.5~3.5 橘黃 */
.v2-card__mult--hot  { background: #dc2626; }   /* >=3.5 紅 */

/* Line 2: stats inline + chips + sources */
.v2-card__line2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--c-text);
  padding-top: 4px;
  border-top: 1px solid var(--c-border);
}
.v2-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-size: 13px;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.v2-stat b {
  font-size: 11px;
  font-weight: 500;
  color: var(--c-text-light);
  letter-spacing: 0.5px;
}
/* 地坪後面的分區縮寫 (例: 住三 / 商四) */
.v2-stat__zone {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c-text-muted);
  margin-left: 1px;
}
/* 抗性 chip 統一紅色 outline (rose-50/200/800) — 5 個都用同款 */
.v2-rchip,
.v2-rchip--floors5plus,
.v2-rchip--foreclosure {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid #fecdd3;     /* rose-200 */
  background: #fff1f2;           /* rose-50 */
  color: #9f1239;                /* rose-800 */
  line-height: 1.4;
}

/* 優勢 chip (TOD / 防災型 / 商業區) — 統一藍色 outline + 反光掃過動畫 */
.v2-achip,
.v2-achip--tod,
.v2-achip--fangzai,
.v2-achip--commercial {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--r-sm);
  border: 1px solid #a5f3fc;     /* cyan-200 */
  background: #ecfeff;           /* cyan-50 */
  color: #0e7490;                /* cyan-700 */
  line-height: 1.4;
  letter-spacing: 0.2px;
}
/* 反光掃過動畫 — 一道斜光從左掃到右，每 3.5 秒一次 */
.v2-achip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(125, 211, 252, 0.45) 40%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(125, 211, 252, 0.45) 60%,
    transparent 100%
  );
  transform: skewX(-15deg);
  animation: v2-achip-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes v2-achip-shimmer {
  0% { left: -60%; }
  60%, 100% { left: 160%; }
}

.v2-card__sources {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-left: auto;   /* 推到 line2 最右邊 */
}

/* 第一次抓進 DB 的日期 badge — 在地址跟總價之間 */
.v2-card__date {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--c-hover);
  color: var(--c-text-light);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* NEW badge：稍淡的紅 (red-500) + 白字 pill + fade in/out 呼吸動畫 */
.v2-card__date--new {
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: white;
  background: #ef4444;     /* red-500 (比 600 亮一階) */
  border: none;
  border-radius: 10px;
  animation: v2-new-fade 2.6s ease-in-out infinite;
}
@keyframes v2-new-fade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* 物件 title (591 賣家標題) — 地址下方一條小字 */
/* sub-row：第二行容納 title (左) + 單價/建 (右，靠卡片右邊) */
.v2-card__sub-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: -2px;
  margin-bottom: 2px;
}
.v2-card__title-sub {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 22px;   /* 對齊地址 (icon 16px + gap 6px) */
  line-height: 1.3;
}
.v2-card__sub-row .v2-card__price-per {
  flex: 0 0 auto;
}
/* title-sub (591 賣家標題) 已讀時也不淡，維持原色 */
.v2-src-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--c-hover);
  color: var(--c-text-muted);
  line-height: 1.4;
}
.v2-src-badge--alive { background: var(--c-good-bg); color: var(--c-good); }
/* .v2-src-badge--dead 已移除 — 失效 source 在 srcBadgesHTML filter 階段就跳過不 render */

.v2-card__star {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--c-text-light);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

/* B9: watchlist tab 卡片右側 ✕ 刪除按鈕 (取代 ☆/★) */
.v2-card__delete {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--c-text-light);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
  padding: 0;
}
.v2-card__delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.v2-card__star:hover { color: var(--c-warn); background: var(--c-hover); }
.v2-card__star.v2-card__star--active { color: var(--c-warn); }
.v2-card__star.v2-card__star--active svg { fill: currentColor; }

/* Skeleton loader (compact) */
.v2-card.v2-skel { pointer-events: none; min-height: 56px; }
.v2-skel .v2-card__addr,
.v2-skel .v2-card__price,
.v2-skel .v2-stat,
.v2-skel .v2-card__mult {
  background: linear-gradient(90deg, var(--c-hover) 0%, #e5e7eb 50%, var(--c-hover) 100%);
  background-size: 200% 100%;
  animation: v2-shimmer 1.4s ease-in-out infinite;
  color: transparent;
  border-radius: var(--r-sm);
  min-width: 60px;
  display: inline-block;
}
@keyframes v2-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === 7. Empty state ======================================================= */
.v2-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--c-text-muted);
}
.v2-empty__icon { font-size: 48px; margin-bottom: var(--sp-3); }
.v2-empty__text { font-size: 16px; font-weight: 600; margin-bottom: var(--sp-1); }
.v2-empty__hint { font-size: 13px; color: var(--c-text-light); }

/* === 8. Pagination ======================================================== */
.v2-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  padding-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.v2-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--c-border);
  background: var(--c-card);
  color: var(--c-text);
}
.v2-page-btn:hover:not(:disabled) { background: var(--c-hover); border-color: var(--c-border-strong); }
.v2-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.v2-page-btn.v2-page-btn--active {
  background: var(--c-accent);
  color: white;
  border-color: var(--c-accent);
}

/* === 9. Detail drawer ===================================================== */
.v2-drawer {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  width: var(--drawer-w);
  background: var(--c-card);
  border-left: 1px solid var(--c-border);
  box-shadow: var(--sh-3);
  transform: translateX(100%);
  transition: transform var(--t-mid);
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.v2-drawer.v2-open { transform: translateX(0); }
.v2-drawer__header {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid #e3dfd2;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  background: #fafaf6;          /* 對齊 v1 .modal-header 米色底 */
  color: #2a2a3e;
  position: sticky;
  top: 0;
  z-index: 10;
}
/* 返回按鈕 — 對齊 v1 .tb-btn--ghost (透明 + 米邊 + 深字) */
.v2-drawer__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #d8d2be;
  color: #2a2a3e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.v2-drawer__back:hover { background: #f4efe0; }
.v2-drawer__back-label { font-size: 13px; }

/* 加入最愛按鈕 — 對齊 v1 .tb-btn--ghost 淺色版 */
.v2-drawer__fav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  margin-left: 6px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #d8d2be;
  color: #2a2a3e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.v2-drawer__fav:hover { background: #f4efe0; }
.v2-drawer__fav-star { font-size: 14px; color: #c8b478; transition: color var(--t-fast); }
.v2-drawer__fav-label { font-size: 13px; }
.v2-drawer__fav.v2-drawer__fav--active {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.v2-drawer__fav--active .v2-drawer__fav-star { color: #f59e0b; }

/* 三按鈕 group container (最愛 + 地圖 + 分享)：mobile 變 segmented control */
.v2-drawer__actions {
  display: inline-flex;
  align-items: stretch;
}

/* 「在地圖上查看」/「分享此頁」按鈕：icon-only 32×28 */
.v2-drawer__map,
.v2-drawer__share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  padding: 0;
  margin-left: 6px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid #d8d2be;
  color: #2a2a3e;
  cursor: pointer;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.v2-drawer__map:hover { background: #f4efe0; color: #1e88e5; }
.v2-drawer__share:hover { background: #f4efe0; color: #0891b2; }
/* PC 預設不顯示 mobile 短 label (icon-only 三按鈕) */
.v2-drawer__fav-shortlabel,
.v2-drawer__map-label,
.v2-drawer__share-label { display: none; }

/* drawer header 內 sources (591/永慶 連結) — 靠最右 + 對齊 v1 ghost button */
.v2-drawer__sources {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;            /* push 到 header 最右 */
}
.v2-drawer__sources .v2-src-badge {
  background: transparent;
  border: 1px solid #d8d2be;
  color: #2a2a3e;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}
.v2-drawer__sources .v2-src-badge:hover { background: #f4efe0; }
/* Mobile：返回按鈕加大 + accent 藍底 + iOS safe-area inset */
@media (max-width: 640px) {
  .v2-drawer__header {
    padding: 12px 14px;
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .v2-drawer__back {
    background: var(--c-accent);
    color: white;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(8, 145, 178, 0.3);
  }
  .v2-drawer__back:hover { background: var(--c-accent-hover); }
  .v2-drawer__back-label { font-size: 14px; }
  /* Mobile：三個 icon 按鈕變成一組 segmented control — wrapper 外框、內部按鈕無 margin
     用 border-left 當分隔線 */
  .v2-drawer__actions {
    margin-left: 6px;
    border: 1px solid #d8d2be;
    border-radius: 8px;
    overflow: hidden;
  }
  .v2-drawer__fav,
  .v2-drawer__map,
  .v2-drawer__share {
    width: 44px;
    height: auto;
    padding: 3px 0 2px;
    gap: 1px;
    margin-left: 0;
    border: none;
    border-left: 1px solid #d8d2be;   /* 內部分隔線 */
    border-radius: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    color: #c8b478;            /* 土黃 → SVG stroke 透過 currentColor 套用 */
  }
  .v2-drawer__actions > .v2-drawer__fav { border-left: none; }   /* 第一段不要左分隔線 */
  .v2-drawer__fav-label { display: none; }   /* PC 長 label */
  .v2-drawer__fav-shortlabel,
  .v2-drawer__map-label,
  .v2-drawer__share-label {
    display: block;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 500;
    color: #2a2a3e;            /* 字保持深色 (確保可讀) */
  }
  /* 星星跟旁邊 SVG icon 同尺寸 18×18，inline-flex 置中，
     確保三按鈕下方 label 在同一條 baseline */
  .v2-drawer__fav-star {
    font-size: 20px;
    line-height: 1;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* color 從 .v2-drawer__fav-star base 規則繼承 (#c8b478)，這裡不覆寫 */
  }
  /* active (已加入最愛): 黃底 + 實心 ★ + 棕字 (base 規則已定義，這裡明確 mobile 也套) */
  .v2-drawer__fav.v2-drawer__fav--active .v2-drawer__fav-shortlabel {
    color: #92400e;
    font-weight: 700;
  }
  .v2-drawer__title {
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.v2-drawer__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}
.v2-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  position: relative;
  /* drawer body 白底，內部 table / ai-sec 等區塊用 #fafaf6 米色才會浮出 (對齊 v1 modal-body 白 + table 米的對比) */
  background: #ffffff;
  --c-accent: #c78a00;
  --c-accent-hover: #b0790a;
  --c-accent-light: #f4edd5;
}
.v2-drawer-backdrop {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 59;
}
.v2-drawer-backdrop.v2-open { display: block; }

/* Drawer content blocks (legacy — 留著以防其他地方用) */
.v2-detail-section {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}
.v2-detail-section:last-child { border-bottom: none; }
.v2-detail-section__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-3);
}

/* === Detail v2：對齊 v1 layout，左 7 右 5 兩 row + 字體 +2 ================ */
.v2-d-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.v2-d-title {
  margin: 0;
  font-size: 15px;          /* 跟 .v2-d-h (都更換回試算/分析建議) 同款 */
  font-weight: 700;
  color: var(--c-text);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--c-border);
}

/* detail 內 優勢/抗性 chips cell — 跟首頁卡片同款 chip (.v2-achip / .v2-rchip) */
.v2-d-chips-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.v2-d-row {
  display: grid;
  grid-template-columns: 7fr 5fr;   /* 對齊 v1 Bootstrap col-md-7 + col-md-5 */
  gap: 12px;
  margin-bottom: 12px;
}
.v2-d-col { min-width: 0; }
.v2-d-h {
  font-size: 15px;
  font-weight: 700;
  color: #b0790a;                 /* v1 modal-h 黃褐字 */
  letter-spacing: 1.5px;
  margin: 0 0 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid #e3dfd2;
  border-bottom: 1px solid var(--c-border);
}

/* 物件資訊 2 個 table 並排 — 1:1 對齊 v1 .basic-info-grid (1fr 1fr gap 14) */
.v2-d-basic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.v2-d-basic-grid > * { align-self: start; }

/* 地址列：跨整個 basic-grid 寬度，放在最上面 */
.v2-d-addr-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
}
.v2-d-addr-main {
  flex: 0 1 auto;       /* 不 grow，badge/map 直接緊接後面 */
  min-width: 0;
}
/* 推測 badge — 扁平標籤式 (不可點，跟可點按鈕區分):
   - 無底色、細邊框、字體輕、cursor:default
   - 跟 .v2-btn / .v2-drawer__fav 等可點按鈕視覺差異化 */
.v2-d-addr-inferred-badge {
  display: inline-block;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 6px;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  cursor: default;
}
.v2-d-basic-grid .v2-d-tbl { height: auto; }

/* 來源連結 — 放在 detail body 最右上角 (絕對定位)；跟首頁卡片同樣 .v2-src-badge 樣式 */
.v2-d-sources-topright {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 1;
}
/* (legacy) sources-under 之前放在圖片下方，現已搬到右上角 — 留 stub 以防別處 caller */
.v2-d-sources-under {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

/* 來源連結 — 放右上、字大、清楚 (舊位置，新版已不用，留著以防其他 caller) */
.v2-d-sources-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.v2-src-badge--big {
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 6px 12px !important;
  border-radius: var(--r-md) !important;
  background: var(--c-accent) !important;
  color: white !important;
  letter-spacing: 0.3px;
  transition: all var(--t-fast);
}
.v2-src-badge--big:hover {
  background: var(--c-accent-hover) !important;
  transform: translateY(-1px);
  box-shadow: var(--sh-2);
}

/* 「請先加入最愛」警示 banner */
.v2-d-wl-warn {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #92400e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.v2-d-wl-warn .v2-btn { flex-shrink: 0; }

/* 基本資料 table — 緊湊 + 每 row 同高度，視覺整齊 */
.v2-d-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
  background: #fafaf6;          /* 對齊 v1 .renewal-table 淡米底 */
}
.v2-d-tbl tr { border-bottom: 1px solid var(--c-border); }
.v2-d-tbl tr:last-child { border-bottom: none; }
.v2-d-tbl td {
  padding: 6px 6px;
  vertical-align: top;           /* 多行內容文字向上靠 */
  line-height: 1.4;
}
.v2-d-tbl td:first-child {
  color: #6b7280;
  white-space: nowrap;
  width: 88px;
  font-weight: 500;            /* 對齊 v1 .renewal-table td:first-child medium */
}
.v2-d-tbl--params td:first-child { width: auto; }
.v2-d-tbl--params tr { border-bottom: 1px dashed var(--c-border); }

/* drawer 載入中 */
.v2-drawer__loading {
  padding: 60px 24px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 16px;
  font-weight: 500;
}
.v2-drawer__loading::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  margin-right: 10px;
  animation: v2-loading-spin 0.8s linear infinite;
  vertical-align: -3px;
}
@keyframes v2-loading-spin {
  to { transform: rotate(360deg); }
}
.v2-d-hint { color: #888; font-size: 11px; }
/* 售價 — 對齊 v1 .text-warning (黃褐粗體) */
.v2-d-price-cell { font-weight: 700; color: #c78a00; font-variant-numeric: tabular-nums; }
.v2-d-price {
  color: #c78a00;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* land-warn / addr-suspicious — 對齊 v1 紅字小字 */
.v2-d-warn {
  font-size: 11px;
  color: #c0392b;
  font-weight: 600;
  margin-top: 3px;
}
.v2-d-warn-inline {
  font-size: 11px;
  color: #c0392b;
  font-style: italic;
  margin-left: 4px;
}
/* 使用分區 cell — 多分區編輯 + 候選展開 + (特)/(遷) 警示 */
/* 使用分區 badge — 對齊 v1 .zone-badge 綠底白字 (15/700, 圓角) */
.v2-d-zone-badge {
  display: inline-block;
  background: #eaf4ea;
  color: #2e7d32;
  font-size: 15px;
  font-weight: 700;
  padding: 3px 10px;
  border: none;
  border-radius: 4px;
  margin-right: 4px;
  cursor: default;
}
/* 商業區 → 紅；其他 (住宅/工業/...) → 黃 */
/* v1 沒分商業/默認顏色 (永遠綠底) — 保留 modifier class 但改成不蓋掉主色 */
.v2-d-zone-badge--commercial,
.v2-d-zone-badge--default {
  background: #eaf4ea;
  color: #2e7d32;
  border: none;
}
/* 「原：第三種商業區」— 對齊 v1 黃褐 inline 字 */
.v2-d-zone-orig {
  display: inline-block;
  font-size: 12px;
  color: #b0790a;
  margin-left: 4px;
  font-weight: 500;
}
/* (特)/(遷)/(核)/(抄) 容積說明 — 對齊 v1 */
.v2-d-zone-special {
  font-size: 11.5px;
  color: var(--c-text-muted);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
}
.v2-d-zone-ping {
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  font-size: 12.5px;
  width: 64px;
  text-align: left;
  font-variant-numeric: tabular-nums;
  margin: 0 2px;
}
.v2-d-zone-ping:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 2px var(--c-accent-light); }
.v2-d-zone-err {
  color: var(--c-danger);
  font-size: 11.5px;
  margin-top: 4px;
}
.v2-d-zone-note {
  font-size: 11px;
  color: var(--c-text-light);
  margin-top: 3px;
}
.v2-d-zone-special {
  background: #fef3c7;
  color: #92400e;
  border-radius: var(--r-sm);
  padding: 4px 8px;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.4;
}
.v2-d-zone-error {
  color: var(--c-danger);
  font-size: 12px;
  margin-top: 3px;
}
.v2-d-zone-source {
  margin-top: 4px;
}
.v2-d-zone-srclink {
  color: var(--c-accent);
  margin-left: 3px;
  text-decoration: none;
}
.v2-d-zone-cands {
  margin-top: 4px;
  font-size: 11.5px;
}
.v2-d-zone-cands summary {
  cursor: pointer;
  color: var(--c-text-muted);
  font-size: 11.5px;
}
.v2-d-zone-cands-tbl {
  width: 100%;
  margin-top: 4px;
  font-size: 11.5px;
  border-collapse: collapse;
}
.v2-d-zone-cands-tbl td {
  padding: 3px 6px;
  border-bottom: 1px solid #f1f5f9;
}
.v2-d-zone-cands-tbl__top td {
  font-weight: 700;
  color: #b45309;
}

/* 推測地址候選 dropdown — 用 flex 撐滿，📍 不會換行 */
.v2-d-tbl td:has(.v2-d-inferred-select) {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
}
.v2-d-inferred-select {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  padding: 3px 6px;
  text-align: left;
  font-size: 13px;
  text-overflow: ellipsis;
}
.v2-d-map-link {
  display: inline-block;
  margin-left: 4px;
  font-size: 13px;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
}

/* 建坪/地坪 4 column tab 對齊 (數字靠左)：[數字 坪 單價 數字]，兩 row 同 column 寬 */
.v2-d-num-row {
  display: grid;
  grid-template-columns: 50px 24px 36px 1fr;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.v2-d-num, .v2-d-num2 {
  font-weight: 600;
  text-align: left;
  font-size: 14px;
}
.v2-d-num2 { color: var(--c-text); }
.v2-d-unit {
  color: var(--c-text-muted);
  font-size: 13px;
  text-align: left;
}
.v2-d-per-lbl {
  color: var(--c-text-muted);
  font-size: 12.5px;
  text-align: left;
}

/* 統一 input/select 字體 13px (有些 v1-port 預設 14px 留下來太大) */
.v2-d-tbl input,
.v2-d-tbl select {
  font-size: 14px;
}
.v2-rv2-edit, select.v2-rv2-edit {
  font-size: 14px;
}

/* 推測 badge — block 放下一行 */
/* 分析建議區頂部的優勢/抗性 chips */
.v2-d-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  padding: 4px 0 10px;
  margin-bottom: 8px;
  border-bottom: 1px dashed #e3dfd2;
}

/* 推測 tag (★實登 / 推測 / ≈推測) — 對齊 v1 .inferred-tag 黃褐底棕字 */
.v2-inferred-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #7c6a2f;
  background: #f0e8d0;
  border: 1.5px solid #c8b478;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1.3;
  letter-spacing: 0.3px;
}

/* 附近捷運每行一個 */
.v2-mrt-line {
  font-size: 14px;
  line-height: 1.5;
  color: var(--c-text);
}

/* 用戶可改 input — 內文靠左 (對齊 v1) */
/* 原始地址 / 推測地址 cell — 跟其他欄位一樣不粗 */
.v2-d-addr-val { font-weight: inherit; color: inherit; }

/* 對齊 v1 .inline-edit (米色底 棕邊 右對齊) */
.v2-d-input {
  border: 1px solid #d8d2be;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
  width: 80px;
  text-align: right;
  background: #fffdf6;
  font-variant-numeric: tabular-nums;
}
.v2-d-input--narrow { width: 56px; }
/* select 變體 — 內容地址 / 文字 一律靠左 */
select.v2-d-input { text-align: left; }
.v2-d-input:focus {
  outline: none;
  border-color: #c78a00;          /* v1 inline-edit:focus */
  background: #ffffff;
  box-shadow: none;
}
.v2-d-input:disabled {
  background: var(--c-hover);
  color: var(--c-text-light);
  cursor: not-allowed;
}
.v2-d-govlinks {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.v2-govlink {
  font-size: 13px;
  padding: 4px 10px;
  background: var(--c-hover);
  border-radius: var(--r-sm);
  color: var(--c-accent);
}
.v2-govlink:hover { background: var(--c-accent-light); }

.v2-d-screenshot-link {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  margin-left: 6px;
  background: var(--c-accent-light);
  color: var(--c-accent);
  border-radius: var(--r-sm);
  font-weight: 600;
}
.v2-d-screenshot-link:hover { background: var(--c-accent); color: white; }

/* 地籍圖按鈕 — 點開內部 overlay (跟 v1 toggleRoadPreview/openRoadOverlay 行為一致) */
/* 地籍圖按鈕 — 1:1 對齊 v1 .btn-show-map (.btn-scan-road 衍生，11/600 藍底版) */
.v2-d-road-show {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  margin-left: 8px;
  background: #e8f0fe;
  color: #1a56a0;
  border: 1px solid #4a86c8;
  border-radius: 4px;
  cursor: pointer;
}
.v2-d-road-show:hover { background: #d0e2fc; }
/* 路名 hint — 對齊 v1 .road-name-hint-line */
.v2-d-road-name-hint {
  font-size: 12px;
  color: #8b7c4a;
  margin-top: 4px;
}

/* 重新掃描路寬按鈕 — 1:1 對齊 v1 .btn-scan-road (米黃 11/600) */
.v2-d-road-scan {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  margin-left: 8px;
  background: #fff8e5;
  color: #b0790a;
  border: 1px solid #c78a00;
  border-radius: 4px;
  cursor: pointer;
}
.v2-d-road-scan:hover { background: #f4e5b5; }
.v2-d-road-scan--scanning {
  background: var(--c-accent-light);
  color: var(--c-accent);
  border-color: var(--c-accent);
  cursor: wait;
}
.v2-d-road-scan--fail {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
  cursor: not-allowed;
}
.v2-d-road-reason {
  font-size: 12px;
  color: #5c4a0a;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 4px 8px;
  margin-top: 4px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  line-height: 1.4;
}

/* 地籍圖 overlay (內部跳窗，點 backdrop 或 X 關閉) */
.v2-road-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
.v2-road-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 95vw;
  max-height: 92vh;
  cursor: default;
}
.v2-road-overlay-inner img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  background: #fff;
  object-fit: contain;
}
.v2-road-overlay-reason {
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  max-width: 95vw;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.v2-road-overlay-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 0;
}
.v2-road-overlay-close:hover { background: #fff; transform: scale(1.05); }

/* 參考工具 row (政府連結) — 放在抗性下方 */
/* 政府連結 — 1:1 對齊 v1 .modal-tools (字體 14、padding、letter-spacing) */
.v2-d-tools {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}
.v2-d-tools-city {
  font-size: 14px;
  font-weight: 700;
  color: #5c4a0a;
  background: #d8c88f;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.v2-d-tools a {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #b0790a;
  background: #fff8e5;
  border: 1px solid #d8b56a;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.12s;
  flex-shrink: 0;
}
.v2-d-tools a:hover { background: #f4e5b5; }

.v2-d-tools-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.v2-d-tools-city {
  color: var(--c-text-muted);
  font-weight: 600;
  margin-right: 2px;
}
.v2-d-tools-cell a {
  display: inline-block;
  background: var(--c-accent);
  color: white;
  font-weight: 600;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: var(--r-sm);
}
.v2-d-tools-cell a:hover { background: var(--c-accent-hover); }

/* 圖片：右上，固定高度 */
/* 對齊 v1 .modal-photo 米色底 / 8px radius；4:3 比例，撐滿右 col (drawer 寬已縮) */
.v2-detail-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f4efe0;
  border-radius: 8px;
  overflow: hidden;
  border: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v2-detail-image {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  display: block;
}
.v2-detail-image-empty {
  color: var(--c-text-light);
  font-size: 13px;
  padding: 30px;
}

.v2-d-formula {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--c-bg);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.7;
}
.v2-d-formula b { color: var(--c-text); }
.v2-d-alert {
  background: var(--c-hover);
  padding: 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--c-text-muted);
  text-align: center;
}

/* LVR 「實」icon — 1:1 對齊 v1 .lvr-icon (24×24 紅邊白底紅字圓圈) */
.v2-lvr-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #c0392b;
  background: #ffffff;
  color: #c0392b;
  font-size: 12px;
  font-weight: 800;
  margin-left: 6px;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: none;
}
.v2-lvr-icon:hover { background: #fbe8e8; }
/* 卡片小版 (line1 售價旁) */
.v2-lvr-icon--sm {
  width: 16px;
  height: 16px;
  border-width: 1.5px;
  font-size: 9px;
  margin-left: 3px;
}
.v2-lvr-popup {
  position: fixed;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  padding: 8px;
  z-index: 1000;
  max-width: 460px;
  max-height: 70vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
}
.v2-lvr-popup__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
}
/* 射箭準心 hover popup — 跟 LVR popup 同樣式但小 */
.v2-redev-target-popup {
  max-width: 240px;
  font-size: 12px;
  color: #1f2937;
}
.v2-redev-target-popup .v2-lvr-popup__title { color: #dc2626; }

.v2-d-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

/* === 都更試算 v1 風 — 1:1 對齊 v1 .rv2 視覺 ============================ */
.v2-rv2 {
  font-size: 15px;
  color: #2a2a3e;
  background: #ffffff;
  border: 1px solid #ede7d4;
  border-radius: 6px;
  padding: 0 0 8px;
  line-height: 1.5;
  overflow: hidden;
}

/* 土地持分 — 米黃漸層 + 黃褐底線 */
.v2-rv2-land {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: center;
  background: linear-gradient(90deg, #f4ecd0 0%, #f9f1d8 100%);
  border-bottom: 2px solid #c78a00;
  padding: 12px 14px;
  margin-bottom: 6px;
}
.v2-rv2-land--top { display: grid; grid-template-columns: 96px 1fr auto; }   /* 沿用 v1 結構 */
.v2-rv2-land__left {
  display: contents;     /* 讓 lbl/val 直接落在父 grid 的前兩格 */
}
.v2-rv2-land__lbl {
  font-size: 14px;
  font-weight: 700;
  color: #5c4a0a;
  letter-spacing: 2px;
}
.v2-rv2-land__val {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #5c4a0a;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.v2-rv2-land__unit {
  font-size: 16px;
  font-weight: 600;
  color: #8b7c4a;
  margin-left: 2px;
}
.v2-rv2-land__zone {
  text-align: center;
  min-width: 72px;
  display: block;
  justify-content: unset;
}
.v2-rv2-land__zone-body {
  font-size: 14px;       /* 跟「推測地址」table cell 同大小 */
  text-align: center;
}
/* 土地持分 row 右側「出價設定」input — 取代 zone-body */
.v2-rv2-land__bid {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  font-size: 14px;
  font-weight: 700;
  color: #5c4a0a;
  white-space: nowrap;
  letter-spacing: 1px;
}
.v2-rv2-land__bid-lbl {
  letter-spacing: 1px;
  font-weight: 700;
  color: #5c4a0a;
}
.v2-rv2-land__bid .v2-d-input {
  width: 80px;
  letter-spacing: normal;
}
/* 土地持分內的 zone chip — 1:1 對齊 v1 .rv2-land__abbr (黃褐底白字 17/800) */
.v2-rv2-land__zone-body .v2-d-zone-badge {
  display: inline-block;
  background: #c78a00;
  color: #ffffff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 4px;
  border: none;
  margin: 0;
}
.v2-rv2-land__abbr {
  display: inline-block;
  background: #c78a00;
  color: #ffffff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 4px;
}

/* 試算 body：1:1 對齊 v1 .rv2-body — grid 1fr auto (左 formula / 右 result 自適應) */
.v2-rv2--2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0;
}
.v2-rv2-land--top { grid-column: 1 / -1; }
.v2-rv2--2col .v2-rv2-left {
  display: block;
  min-width: 0;
  padding: 6px 0;
}
.v2-rv2--2col .v2-rv2-right {
  border-left: 2px solid #c78a00;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #fafaf6;
  min-width: 0;
}

/* 公式列：× | 標籤 | 值 (對齊像直式算式) */
.v2-rv2-formula { padding: 6px 0; }
.v2-rv2-r {
  display: grid;
  grid-template-columns: 24px 96px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 5px 14px;
  border: none;
}
.v2-rv2-formula > .v2-rv2-r:last-child { border-bottom: none; }
.v2-rv2-op {
  text-align: right;
  color: #c78a00;
  font-weight: 700;
  font-size: 18px;
  font-family: Georgia, serif;
  letter-spacing: 0;
  line-height: 1;
}
.v2-rv2-lbl { color: #6b7280; font-size: 14px; font-weight: 400; }   /* 對齊 v1 default normal */
.v2-rv2-lbl-unit {
  display: block;          /* (萬/坪)、(1F 預設20%) 換行到標籤下方 */
  font-size: 10.5px;
  color: var(--c-text-light);
  margin-left: 0;
  margin-top: 1px;
  font-weight: 400;
  line-height: 1;
}
.v2-rv2-val {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px 8px;
  row-gap: 2px;
  font-size: 14px;          /* 對齊 input/拉桿值的字體 — 有效容積率/分回比例不再特別大 */
  font-weight: 700;
  color: #1a1a2e;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
/* note 整行單獨佔一列 (上方換行) — 對齊 v1 視覺 */
.v2-rv2-val > .v2-rv2-note {
  flex: 0 0 100%;
  text-align: right;
}
.v2-rv2-val--bonus {
  /* 危老 / 都更 換行 — 兩 line 撐到父寬，內部 grid 對齊 */
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
}
.v2-rv2-bonus-line {
  /* tag 靠左 (auto)、內容 (slider/parking) 撐 1fr 到右側 */
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
}
/* 分回車位：危老/都更 同列橫排（不堆疊），右對齊 — 跟容積獎勵堆疊不同 */
.v2-rv2-val--parking {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
}
.v2-rv2-parking-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.v2-rv2-val--col { flex-direction: column; align-items: flex-end; gap: 2px; }
.v2-rv2-note {
  font-size: 11px;
  color: #c0392b;       /* 紅字 (對齊用戶要求) */
  font-style: italic;
  font-weight: 500;
}
.v2-rv2-warn { color: #c0392b !important; font-weight: 600; background: transparent; padding: 0; }
.v2-rv2-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #8b7c4a;
  letter-spacing: 0.5px;
  background: transparent;
  padding: 0;
}

/* 試算內所有 input/select 統一 — 跟「出價設定」.v2-d-input 同樣的米色底棕邊外框 */
.v2-rv2-edit {
  background: #fffdf6;
  border: 1px solid #d8d2be;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
  font-weight: 700;          /* 跟 .v2-rv2-val 17/700 同 weight (統一計算數字粗細) */
  color: #1a1a2e;
  font-variant-numeric: tabular-nums;
  outline: none;
  width: 80px;
  text-align: right;
  cursor: text;
}
select.v2-rv2-edit { text-align: left; padding-right: 18px; cursor: pointer; }
.v2-rv2-edit:focus {
  background: #ffffff;
  border-color: #c78a00;
  box-shadow: none;
}
.v2-rv2-edit:hover { background: #fffdf6; }
/* 容積獎勵 dropdown 對齊 v1 (.rv2-val--bonus .rv2-edit { font 14, width 60 }) */
.v2-rv2-val--bonus .v2-rv2-edit {
  font-size: 14px;
  font-weight: 700;
  width: 60px;
  padding: 1px 4px;
}
/* 樓層加成 input 縮窄 (0-80 整數，不需要 80px) */
.v2-rv2-edit--narrow { width: 50px; }

/* ── 拉桿 (range slider) — 用在容積獎勵/都更係數/樓層加成 ──
 * 視覺：細米色軌道 + 棕色 thumb，旁邊顯示當前值
 * 走 -webkit-appearance 客製化才會跨瀏覽器一致
 */
.v2-rv2-slider {
  /* 拉桿 + 數字 同一個 grid：拉桿吃 1fr（撐滿剩餘空間）、數字固定寬靠右 */
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.v2-rv2-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;          /* 撐滿 grid col 1 — bonus line 含 tag 自然會比沒 tag 的 row 短 */
  min-width: 0;
  height: 4px;
  background: #e8e2cc;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0;
}
.v2-rv2-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #c78a00;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fffdf6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.v2-rv2-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #c78a00;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fffdf6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.v2-rv2-range:focus { background: #d8d2be; }
.v2-rv2-slider-val {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;        /* 不換行確保 1.57 / 80% 在同 col */
}
/* 容積獎勵改 column 排列後，每行 slider 寬度跟其他欄位一致（不再縮窄） */


.v2-rv2-parking {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
/* 分回車位數字跟「建坪」一樣字級 (14/600) */
.v2-rv2-parking__val { font-size: 14px; font-weight: 700; color: #1a1a2e; }
.v2-rv2-parking__cnt { font-size: 11px; font-weight: 500; color: #666; }

/* 結果欄：右側上下 stack 兩塊 (危老 / 都更)，每塊 tag + 大字 + 三圓圈 */
.v2-rv2-result, .v2-rv2-result--stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: none;
  padding: 0;
  background: transparent;
}
.v2-rv2-rcol {
  background: transparent;
  border: none;
  text-align: center;
  padding: 0;
  display: block;
}
.v2-rv2-rcol-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.v2-rv2-rtag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #8b7c4a;
  letter-spacing: 2px;
  border-bottom: 2px solid #c78a00;
  padding-bottom: 1px;
  background: transparent;
  width: max-content;
  border-radius: 0;
}
.v2-rv2-rval {
  font-size: 24px;
  font-weight: 800;
  color: #5c4a0a;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 0;
  line-height: 1.1;
  text-align: center;
}
.v2-rv2-circles {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
.v2-rv2-circ {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid #c78a00;
  background: #ffffff;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  padding: 0;
  flex-shrink: 0;
}
.v2-rv2-circ--neg { border-color: #b02a2a; }
.v2-rv2-circ--neg .v2-rv2-circ__num { color: #b02a2a; }
.v2-rv2-circ__num {
  font-size: 16px;
  font-weight: 700;
  color: #5c4a0a;
  font-variant-numeric: tabular-nums;
}
.v2-rv2-circ__lbl {
  font-size: 11px;
  color: #8b7c4a;
  margin-top: 2px;
  letter-spacing: 0;
}

/* 多分區換行 */
.v2-d-zone-multi-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }

/* === 結果欄 — 1:1 對齊 v1：tag (頂) / val (中央大字) / 三圓圈 === */
.v2-rv2-result, .v2-rv2-result--stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: none;
  padding: 0;
  background: transparent;
}
.v2-rv2-rcol {
  background: transparent;
  border: none;
  text-align: center;
  padding: 0;
  display: block;
  min-width: 0;
}
.v2-rv2-rtag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #8b7c4a;
  letter-spacing: 2px;
  border-bottom: 2px solid #c78a00;
  padding-bottom: 1px;
  background: transparent;
  width: max-content;
  border-radius: 0;
}
.v2-rv2-rval {
  font-size: 24px;
  font-weight: 800;
  color: #5c4a0a;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 0;
  line-height: 1.1;
  text-align: center;
}
.v2-rv2-circles {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
.v2-rv2-circ {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid #c78a00;
  background: #ffffff;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  padding: 0;
  flex-shrink: 0;
}
.v2-rv2-circ--neg { border-color: #b02a2a; }
.v2-rv2-circ--neg .v2-rv2-circ__num { color: #b02a2a; }
.v2-rv2-circ__num {
  font-size: 16px;
  font-weight: 700;
  color: #5c4a0a;
  font-variant-numeric: tabular-nums;
}
.v2-rv2-circ__lbl {
  font-size: 11px;
  color: #8b7c4a;
  margin-top: 2px;
  letter-spacing: 0;
}

/* 響應式：drawer 窄時 (≤1024) 結果改放在 formula 下方 */
@media (max-width: 1024px) {
  .v2-rv2--2col { grid-template-columns: 1fr; }
  .v2-rv2--2col .v2-rv2-right { border-left: none; border-top: 2px solid #c78a00; }
  .v2-rv2-land { grid-template-columns: 1fr; gap: 6px; text-align: center; }
  .v2-rv2-land__zone { margin-top: 4px; }
}

/* 出價建議 — Row 2 右欄獨立區塊 */
.v2-bid-section {
  background: #f9fafb;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
/* 出價設定 input row — bid-section 頂部 (取代基本資訊「欲出價」row) */
.v2-bid-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
  font-weight: 600;
}
.v2-bid-input-lbl {
  color: var(--c-text);
  flex-shrink: 0;
}

/* 出價建議 (舊 .v2-rv2-bid 已不使用，保留 CSS 防破壞隱藏 caller) */
.v2-rv2-bid {
  background: #f9fafb;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.v2-rv2-bid__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 6px;
}

/* 路寬限縮警語 (台北市) */
.v2-rv2-warn {
  display: inline-block;
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  cursor: help;
}

/* 試算底部假設警語 */
.v2-rv2-disclaimer {
  font-size: 11.5px;
  color: var(--c-text-muted);
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 6px 10px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  line-height: 1.4;
}

/* 窄螢幕 row stack */
@media (max-width: 1024px) {
  .v2-rv2--2col { grid-template-columns: 1fr; }
  .v2-rv2--2col .v2-rv2-left { flex-direction: column; }
  .v2-rv2-land {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
  }
  .v2-rv2-land__lbl, .v2-rv2-land__abbr { margin: 0; }
  .v2-rv2-land__val { font-size: 22px; margin: 0; }
}

/* 警語通用 (原始地址 / 地坪 inline-block 紅字框) */
/* 已自動修正 — 對齊 v1 .addr-fixed-note 綠字 */
.v2-d-addr-fixed {
  font-size: 11px;
  color: #2e7d32;
  font-style: italic;
  margin-top: 3px;
  background: transparent;
  padding: 0;
  border: 0;
  margin-top: 4px;
  display: inline-block;
}
/* B4/B5/B6: 卡片事件 badge — 漲價/降價/改價/cross_source 新上架/已封存 */
.v2-event-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.v2-event-badge--up        { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.v2-event-badge--down      { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.v2-event-badge--cross     { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.v2-event-badge--archived  { background: #e5e7eb; color: #4b5563; border: 1px solid #9ca3af; }

/* B6: 已下架 overlay — 整卡灰透 + 中央白字「已下架」 */
.v2-card--archived { opacity: 0.55; }

/* 分析中 placeholder card (URL / 地址 capture 送出後) */
.v2-card--pending {
  background: #fff8e5;
  border: 1.5px dashed #c78a00;
  cursor: default;
}
.v2-card__pending-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 6px;
}
.v2-card__pending-spinner {
  width: 28px; height: 28px;
  border: 3px solid #f4ecd0;
  border-top-color: #c78a00;
  border-radius: 50%;
  animation: v2-spin 0.9s linear infinite;
  flex-shrink: 0;
}
@keyframes v2-spin { to { transform: rotate(360deg); } }
.v2-card__pending-label {
  font-weight: 700;
  color: #5c4a0a;
  font-size: 14px;
}
.v2-card__pending-target {
  font-size: 12px;
  color: #8b7c4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* sidebar capture 卡內 inline 錯誤/狀態訊息 */
.v2-cap__msg {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  padding: 0;
  border-radius: 4px;
  display: none;
}
.v2-cap__msg--info,
.v2-cap__msg--error,
.v2-cap__msg--success,
.v2-cap__msg--pending {
  display: block;
  padding: 6px 10px;
}
.v2-cap__msg--info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.v2-cap__msg--error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.v2-cap__msg--success { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.v2-cap__msg--pending { background: #fff8e5; color: #b0790a; border: 1px solid #d8b56a; }

/* district_mismatch / not_found 候選按鈕 list */
.v2-cap__cand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.v2-cap__cand-btn {
  font-size: 11px;
  padding: 4px 8px;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
}
.v2-cap__cand-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
}
.v2-card__archived-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(75, 85, 99, 0.45);
  border-radius: var(--r-md);
  z-index: 5;
  pointer-events: none;
}
.v2-card__archived-overlay span {
  background: rgba(31, 41, 55, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--r-sm);
  letter-spacing: 1px;
}

/* LVR 特殊交易警告 icon */
.v2-lvr-warn {
  position: relative;
  display: inline-block;
  color: #d97706;
  font-weight: 700;
  cursor: help;
}
.v2-lvr-tip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #1f2937;
  color: #fff;
  font-weight: 500;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  white-space: normal;
  width: max-content;
  max-width: 320px;
  z-index: 1100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
  transition: opacity 0.15s;
}
.v2-lvr-warn:hover .v2-lvr-tip {
  visibility: visible;
  opacity: 1;
}

/* 試算 scenario boxes — 字體 +2 */
.v2-scn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.v2-scn {
  background: var(--c-bg);
  padding: 14px;
  border-radius: var(--r-md);
  text-align: center;
  border: 1px solid var(--c-border);
}
.v2-scn__name {
  font-size: 14px;
  color: var(--c-text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.v2-scn__name small { font-size: 12px; color: var(--c-text-light); margin-left: 3px; font-weight: 500; }
.v2-scn__mult {
  font-size: 32px;
  font-weight: 800;
  color: var(--c-low);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
  line-height: 1;
}
.v2-scn__mult small { font-size: 15px; color: var(--c-text-muted); margin-left: 2px; }
.v2-scn__mult--good { color: var(--c-good); }
.v2-scn__mult--mid { color: var(--c-mid); }
.v2-scn__mult--na { color: var(--c-text-light); font-size: 26px; }
.v2-scn__detail {
  font-size: 14px;
  color: var(--c-text-muted);
  margin-top: 4px;
}

/* AI 分析 — 字體 +2 */
.v2-d-ai-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-text);
  max-height: 420px;
  overflow-y: auto;
}
/* v1 風格：grid 兩欄 (72px label 黃底 + 1fr body) */
.v2-ai-sec {
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0 8px;
}
.v2-ai-sec:last-child { margin-bottom: 0; }
.v2-ai-sec__title {
  font-weight: 700;
  color: #5c4a0a;
  font-size: 14px;
  padding: 1px 6px;
  background: #f4edd5;
  border-radius: 3px;
  white-space: nowrap;
  text-align: center;
  height: fit-content;
}
.v2-ai-sec__body {
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.6;
}
@media (max-width: 1024px) {
  .v2-ai-sec { grid-template-columns: 1fr; gap: 4px; }
  .v2-ai-sec__title { width: max-content; }
}

/* 分回價值 dropdown */
.v2-bid-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 14px;
  flex-wrap: wrap;
}
.v2-bid-row--muted { color: var(--c-text-light); font-size: 14px; }
.v2-bid-select {
  padding: 3px 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--c-card);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.v2-bid-select:hover { border-color: var(--c-accent); }
.v2-bid-max {
  color: var(--c-danger);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

/* LVR 表 (popup 用) */
.v2-lvr-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.v2-lvr-tbl th {
  text-align: left;
  font-weight: 600;
  color: var(--c-text-muted);
  padding: 5px 8px;
  border-bottom: 2px solid var(--c-border);
  font-size: 12px;
  background: var(--c-bg);
}
.v2-lvr-tbl td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.v2-lvr-tbl td.v2-lvr-addr {
  white-space: normal;       /* 改 wrap 換行，不用 ellipsis 省略 */
  word-break: break-all;     /* 中文門牌長字串可在任意處斷行 */
  max-width: 200px;
  line-height: 1.35;
}
/* ⚠ 警示 cell：絕不被擠出外框 — 寬度固定 + 不可壓縮 */
.v2-lvr-tbl td.v2-lvr-warn-cell {
  width: 24px;
  min-width: 24px;
  white-space: nowrap;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.v2-detail-empty { padding: 16px; text-align: center; color: var(--c-text-light); font-size: 13px; }

/* 操作 (full width) */
.v2-d-card--actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
}
.v2-d-card--actions .v2-d-card__title { display: none; }
.v2-d-sources { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.v2-d-card--actions .v2-drawer-actions { margin: 0; }

/* Mobile：drawer 變單欄、縮 padding */
@media (max-width: 1024px) {
  .v2-d-row { grid-template-columns: 1fr; gap: 10px; }
  .v2-d-basic-grid { grid-template-columns: 1fr; gap: 0; }
  .v2-detail-image-wrap { min-height: 0; }
  .v2-detail-image { max-height: 240px; }
  .v2-d-header { flex-direction: column; gap: 8px; }
  .v2-d-sources-bar { width: 100%; }
}
@media (max-width: 640px) {
  .v2-d-row { gap: 8px; margin-bottom: 8px; }
  /* popup 寬限制 + 內部 table 7 欄 nowrap 必定超寬 → 靠 overflow-x:auto 橫向滑 */
  .v2-lvr-popup {
    max-width: calc(100vw - 24px);
    left: 12px !important;
    /* 縮 padding 給內容更多橫向空間 */
    padding: 6px;
  }
  /* 縮表格 padding & 字體，盡量擠進 viewport，不行的話橫向 swipe 看完 */
  .v2-lvr-tbl { font-size: 12px; }
  .v2-lvr-tbl th { padding: 4px 5px; }
  .v2-lvr-tbl td { padding: 4px 5px; }
  .v2-lvr-tbl td.v2-lvr-addr { max-width: 120px; }
  /* mobile：拉桿 width:100% 已在 base CSS 套用，這裡不用再寫死 */
  /* mobile Safari 對沒明確 spec 的 input 預設 16px (防 auto-zoom)，會跟其他 14px 欄位不一致 → 強制 14px */
  .v2-rv2-edit { font-size: 14px !important; line-height: 1.3; }
  .v2-src-badge--big { font-size: 13px !important; padding: 5px 10px !important; }
  .v2-d-title { font-size: 16px; }
  .v2-d-tbl { font-size: 14px; }
  .v2-d-tbl td:first-child { width: 80px; font-size: 13px; }
}
.v2-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.v2-detail-row__k { color: var(--c-text-muted); }
.v2-detail-row__v { font-weight: 600; color: var(--c-text); }
.v2-detail-image {
  width: 100%;
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
}

/* Scenario boxes */
.v2-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--sp-2);
}
.v2-scenario {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  text-align: center;
}
.v2-scenario__name {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-muted);
  letter-spacing: 0.4px;
}
.v2-scenario__multi {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--c-low);
}
.v2-scenario__multi--good { color: var(--c-good); }
.v2-scenario__multi--mid { color: var(--c-mid); }

/* Action buttons in drawer */
.v2-drawer-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* === 10. Toasts =========================================================== */
.v2-toast-host {
  position: fixed;
  /* PC：螢幕正中央 (top/left 50% + transform 置中) → 訊息最顯眼 */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  z-index: 200;
  pointer-events: none;
}
/* Mobile：toast 從螢幕上緣正中央往下滑入 (避開 iOS 瀏海安全區) */
@media (max-width: 640px) {
  .v2-toast-host {
    top: max(12px, env(safe-area-inset-top));
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translateX(-50%);
    align-items: center;
  }
  /* Mobile 用獨立 keyframes：從上往下滑入 */
  .v2-toast {
    animation: v2-toast-in-top 240ms cubic-bezier(.2,.8,.2,1);
  }
}
@keyframes v2-toast-in-top {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.v2-toast {
  background: var(--c-topbar);
  color: white;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: var(--sh-3);
  pointer-events: auto;
  animation: v2-toast-in 200ms ease-out;
  max-width: 360px;
}
.v2-toast--success { background: var(--c-good); }
.v2-toast--error { background: var(--c-danger); }
@keyframes v2-toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === 11. Responsive ====================================================== */

/* 13" laptop (≤1280px): tighter sidebar + drawer 仍盡量寬 */
@media (max-width: 1280px) {
  :root {
    --sidebar-w: 240px;
    --drawer-w: min(1140px, calc(100vw - 80px));   /* 螢幕較窄時 drawer 不溢出 */
  }
  .v2-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }
}

/* iPad / tablet (≤1024px): sidebar becomes drawer overlay; main full width
   cards 兩城用 tab 切換 (省 scroll) */
@media (max-width: 1024px) {
  .v2-shell {
    grid-template-columns: 1fr;
  }
  .v2-sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--t-mid);
    box-shadow: var(--sh-3);
  }
  .v2-sidebar.v2-open { transform: translateX(0); }
  /* sidebar 最下面留充足 padding：最後一個 slider 太靠底邊會被誤判成 scroll gesture
     (iOS Safari 觸控判定區)。加 safe-area-inset 兼顧瀏海手機 home indicator */
  .v2-sidebar__inner {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .v2-only-mobile { display: inline-flex !important; }
  /* mobile city tab switcher 顯示 */
  .v2-grid-toggle { display: flex !important; }
  /* grid 變單欄；依 data-active-city 顯示對應 city col */
  .v2-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .v2-grid .v2-grid-col { display: none; }
  .v2-grid[data-active-city="台北市"] .v2-grid-col[data-city="台北市"],
  .v2-grid[data-active-city="新北市"] .v2-grid-col[data-city="新北市"],
  .v2-grid .v2-grid-col[data-city="其他"] {
    display: flex;
  }
  /* col title 隱藏 (因為 tab 已標示城市) */
  .v2-grid-col__title { display: none; }
}

/* Mobile city tab switcher — desktop hide */
.v2-grid-toggle {
  display: none;
  gap: 6px;
  margin-bottom: 12px;
  background: var(--c-card);
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}
.v2-grid-toggle__pill {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
/* 地圖模式：city switcher disabled — 灰掉、不可點 (pointer-events block)
   ! important 蓋過 base color/cursor/active hover */
.v2-grid-toggle.v2-grid-toggle--disabled {
  opacity: 0.5;
  pointer-events: none;
}
.v2-grid-toggle.v2-grid-toggle--disabled .v2-grid-toggle__pill {
  cursor: not-allowed !important;
  color: #9ca3af !important;
  background: transparent !important;
}
/* === 手機 sidebar 右邊中央關閉按鈕 ==========================================
   button 是 sidebar sibling，用 fixed + 跟著 sidebar 的 translate 動 (transition 同步)。
   sidebar 開啟時 (.v2-open) 顯示，關閉時 sidebar slide out → button 也 slide out。 */
.v2-sidebar__close { display: none; }   /* 桌面 / sidebar 關閉時 隱藏 */
@media (max-width: 1024px) {
  .v2-sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    /* sidebar 從 topbar 底開始（top: var(--topbar-h)，bottom: 0），所以中央 = 50% + topbar/2 */
    top: calc(50% + var(--topbar-h) / 2);
    left: 280px;            /* 緊貼 sidebar 右邊（sidebar 寬 280）；不 overlap，整顆凸在外 */
    transform: translateY(-50%) translateX(-320px);  /* 關閉時跟著 sidebar 滑出去 */
    transition: transform var(--t-mid);
    width: 32px;
    height: 56px;
    background: var(--c-accent);   /* 跟「重新搜尋」按鈕同青藍色 (#0891b2) */
    color: #fff;
    border: 2px solid #fff;        /* 白色外框，跟周圍對比 */
    border-left: none;             /* 左邊貼 sidebar 不需要邊 */
    border-radius: 0 18px 18px 0;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 51;
    padding: 0;
  }
  .v2-sidebar.v2-open ~ .v2-sidebar__close {
    transform: translateY(-50%) translateX(0);
  }
  .v2-sidebar__close:active { transform: translateY(-50%) scale(0.95); }
  .v2-sidebar.v2-open ~ .v2-sidebar__close:active {
    transform: translateY(-50%) translateX(0) scale(0.95);
  }

  /* slider 已含 label 跟 suffix，原 inline label「建<」「地<」/ sep / suffix「萬/坪」「倍以上」隱藏避免重複 */
  .v2-sidebar .v2-num-row__label,
  .v2-sidebar .v2-num-row__suffix,
  .v2-sidebar .v2-num-row__sep,
  .v2-sidebar .v2-range__sep {
    display: none !important;
  }
}

/* === sidebar slider (number input → range) — PC + mobile 都用 ================ */
/* 已 enhance 的 number input 隱藏（仍用來儲存 value 跟同步 filter），slider 顯示 */
.v2-sidebar input.v2-input--num[type="number"][data-slider-enhanced] {
  display: none !important;
}
.v2-mobile-slider-wrap {
  display: block;
  width: 100%;
  margin: 4px 0;
}
.v2-mobile-slider-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}
.v2-mobile-slider-label__txt { color: #666; }
.v2-mobile-slider-label__val {
  color: #c78a00;
  font-weight: 700;
  font-size: 14px;
  min-width: 38px;
}
.v2-mobile-slider-label__suffix { color: #888; font-size: 11px; }
.v2-mobile-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e5dfca;
  border-radius: 3px;
  outline: none;
}
.v2-mobile-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  background: #c78a00;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.v2-mobile-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  background: #c78a00;
  border: none; border-radius: 50%;
  cursor: pointer;
}
/* slider label/sep/suffix 在 sidebar 內隱藏（slider 已含 label + suffix 不重複） */
.v2-sidebar .v2-num-row__label,
.v2-sidebar .v2-num-row__suffix,
.v2-sidebar .v2-num-row__sep,
.v2-sidebar .v2-range__sep {
  display: none !important;
}
.v2-road-input-wrap { display: flex; gap: 6px; align-items: center; }
.v2-road-input-wrap input { flex: 1; min-width: 0; }
/* 路名 / 學區：label + input + mic 同一列不換行 */
.v2-filter-group--inline {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.v2-filter-group--inline .v2-filter-label--inline {
  flex: 0 0 auto;
  margin-bottom: 0;
  white-space: nowrap;
  /* 字體跟其他 sidebar v2-filter-label 一致 (10px uppercase) */
}
.v2-filter-group--inline > .v2-input { flex: 1 1 auto; min-width: 0; }
/* PC (>1024px) 強制 hide mic + 路名/學區 input 維持原本大小 (font 12px / padding 4 8) */
@media (min-width: 1025px) {
  .v2-road-mic { display: none !important; }
  .v2-sidebar .v2-filter-group--inline > .v2-input--inline {
    font-size: 12px !important;
    padding: 4px 8px !important;
    height: auto !important;
    line-height: 1.5 !important;
  }
}
/* mobile：路名/學區 input 比 PC 小一點 (但比之前 11px 再加 1px = 12px)；
   mic 高度跟 input 對齊。 */
@media (max-width: 1024px) {
  .v2-sidebar .v2-filter-group--inline > .v2-input--inline {
    font-size: 12px !important;
    padding: 3px 7px !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.3 !important;
    -webkit-appearance: none;
    box-sizing: border-box;
  }
  .v2-sidebar .v2-filter-group--inline .v2-road-mic {
    /* input border-box ≈ 12*1.3 + 6 padding + 2 border = 23.6px */
    height: 24px !important;
    padding: 0 7px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    min-height: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }
}
/* 學區緊貼路名 — 抵消 sidebar 預設 16px gap，剩 6px */
.v2-filter-group--inline-tight { margin-top: -10px; }
/* 建單價/地單價 行緊貼總價 group */
.v2-filter-group--num-tight { margin-top: -8px; }
/* 行政區 hr 拉滿 sidebar 全寬：用兩側對稱負 margin (-12px) + 同尺寸 padding，
   讓 title/col 的 outer box 兩邊各延伸 12px，border-bottom 自然 cover sidebar 全寬。
   (之前用 width: calc(100%+24px) 在 grid item 上行為不一致；負 margin 是 well-tested
   做法，CSS spec 明定 width:auto + 負 margin 會撐大 item) */
#v2-district-chips .v2-city-col__title {
  margin-left: -12px !important;
  margin-right: -12px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box;
}
#v2-district-chips .v2-city-grid .v2-city-col:first-child {
  margin-left: -12px !important;
  margin-right: -12px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box;
}
/* 語音輸入按鈕：桌面隱藏，只在手機顯示 (語音輸入是手機場景) */
.v2-road-mic { display: none; }
@media (max-width: 1024px) {
  .v2-road-mic { display: inline-flex; align-items: center; justify-content: center; }
}
.v2-road-mic {
  flex: 0 0 auto;
  background: #fffdf6;
  border: 1px solid #c8b97a;
  border-radius: 4px;
  padding: 6px 9px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.v2-road-mic:hover { background: #fbe8e8; }
.v2-road-mic.v2-road-mic--active {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
  animation: v2-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes v2-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(192,57,43,0); }
}

/* 語音狀態 banner — 顯示在頁面上方 */
.v2-voice-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99998;
  background: #fff;
  border: 1px solid #d4cba0;
  border-radius: 6px;
  padding: 10px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 600;
  color: #333;
  max-width: calc(100vw - 40px);
  display: none;
  text-align: center;
}
.v2-voice-banner--listening {
  background: #fff8e5;
  border-color: #c78a00;
  color: #b0790a;
}
.v2-voice-banner--success {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #15803d;
}
.v2-voice-banner--error {
  background: #fef2f2;
  border-color: #c0392b;
  color: #b91c1c;
}

/* (slider rules 已搬到上方 PC + mobile 共用區塊) */

/* === detail page 都更圖層 (放在「其他資訊」col 第一格 .v2-ai-sec) =========
   每個 sub_type 一個 chip：「都更事業 (1件) [了解細節↗]」橫排可 wrap
   點「了解細節」彈 popup 即時抓案件詳情 (避免 DB 存 stale 內容) */
.v2-d-redev-list {
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.v2-d-redev-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: #f4edd5;
  border: 1px solid #d8cdb6;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
}
.v2-d-redev-chip-label { font-weight: 600; color: #5b4c2e; }
.v2-d-redev-chip-count { color: #94a3b8; font-size: 11px; }
.v2-d-redev-detail-btn {
  /* 沿用 .v2-d-road-show 藍底「↗」按鈕，這裡縮小 */
  padding: 1px 6px !important;
  margin-left: 4px;
  font-size: 11px !important;
}

/* 都更案件詳情 popup */
.v2-redev-popup {
  position: fixed;
  z-index: 10000;
  display: none;
  background: #fff;
  border: 1px solid #d8cdb6;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  padding: 10px 14px;
  font-size: 12px;
  color: #1f2937;
  max-width: 480px;
  min-width: 220px;
}
.v2-redev-popup__loading { color: #6b7280; padding: 4px 0; }
.v2-redev-popup__title {
  font-weight: 700;
  color: #5b4c2e;
  font-size: 13px;
  margin-bottom: 6px;
  border-bottom: 1px solid #ece7d7;
  padding-bottom: 4px;
}
.v2-redev-popup__count { font-weight: 400; color: #94a3b8; font-size: 11px; }
.v2-redev-popup__row {
  line-height: 1.6;
  word-break: break-all;
  color: #374151;
}
.v2-redev-popup__row + .v2-redev-popup__row {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #f0ebd8;
}
.v2-redev-popup__caseid {
  color: #94a3b8;
  font-size: 11px;
  margin-left: 4px;
}
.v2-redev-popup__caseid--link {
  color: #1a56a0;
  text-decoration: none;
  border-bottom: 1px dashed #c7ddf2;
}
.v2-redev-popup__caseid--link:hover {
  color: #0b3a7a;
  border-bottom-color: #1a56a0;
}
.v2-redev-popup__empty { color: #888; padding: 4px 0; }

/* === detail page 學區欄位 ============================================ */
.v2-d-school { display: flex; flex-direction: column; gap: 6px; }
/* row 不換行：「國小 / 國中」label + pill list 永遠同 row（list 內 pill 可 wrap） */
.v2-d-school-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
}
/* 「國小 / 國中」字樣對齊「附近捷運站」之類的 label 樣式 (td:first-child) */
.v2-d-school-kind {
  flex: 0 0 auto;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}
.v2-d-school-list {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.v2-d-school-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #eef5fb;
  color: #2563eb;
  border: 1px solid #c7ddf2;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}
/* 學校 chip 內的「(類型 — 鄰級)」副資訊 — 顏色淡、字體略小 */
.v2-d-school-meta {
  margin-left: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 400;
}
/* 學校 chip hover 樣式 — 全部 chip 都 hover popup (含「基本」「共同」等簡單註釋也只在 popup 顯示) */
.v2-d-school-tag--hover {
  cursor: help;
}
.v2-d-school-arrow {
  margin-left: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}
/* 學校 hover popup — 跟 v2-lvr-popup 同 pattern */
.v2-school-popup {
  position: fixed;
  z-index: 10000;
  display: none;
  background: #fff;
  border: 1px solid #c7ddf2;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  padding: 8px 12px;
  font-size: 12px;
  color: #1f2937;
  max-width: 360px;
  min-width: 140px;
}
.v2-school-popup__title {
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 3px;
}
.v2-school-popup__row {
  line-height: 1.5;
  white-space: nowrap;
}

/* 觸控裝置不沿用 :hover (避免 tap 後 hover sticky 把選中字蓋黑)；
   :hover 比 --active 特異度高 → 用 @media (hover: hover) 限定真 hover 環境才適用。
   再加一條 --active:hover 兜底，確保即便有 hover 環境，選中態也維持白字 */
@media (hover: hover) {
  .v2-grid-toggle__pill:hover { color: var(--c-text); }
}
.v2-grid-toggle__pill--active,
.v2-grid-toggle__pill--active:hover {
  background: var(--c-accent);
  color: white;
}

/* Mobile (≤640px): single column dense rows + bottom-sheet drawer */
@media (max-width: 640px) {
  :root {
    --topbar-h: 48px;
  }
  .v2-main {
    padding: var(--sp-2);
  }
  .v2-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  /* tighter padding on mobile cards */
  .v2-card {
    padding: 8px 10px;
    column-gap: var(--sp-2);
    row-gap: 4px;
  }
  .v2-card__price { font-size: 15px; }
  .v2-card__multi-num { font-size: 19px; }
  /* Drawer becomes full screen on mobile */
  .v2-drawer {
    top: 0;
    width: 100%;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--c-border);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    height: 100%;
  }
  .v2-drawer.v2-open { transform: translateY(0); }
  .v2-drawer-backdrop {
    inset: 0;
  }
  .v2-user__email { display: none; }
  .v2-brand__name { display: none; }

  /* 手機 detail page 整體放大 ~8%（≈ 每個 px 字 +1px），不用一條一條 override
     header 不縮放（保留視覺層級），只動 body 內容 */
  .v2-drawer__body {
    zoom: 1.08;
  }

  /* iOS Safari focus 自動放大：input/select/textarea font-size < 16px 觸發
     強制全部 ≥ 16px，瀏覽器就不會 zoom-on-focus */
  input, select, textarea,
  .v2-input, .v2-select, .v2-cap__input, .v2-cap__field {
    font-size: 16px !important;
  }
}

/* Hidden by default; only mobile media query unhides */
.v2-only-mobile { display: none; }

/* Smooth scrolling */
.v2-main, .v2-sidebar, .v2-drawer__body {
  scrollbar-width: thin;
  scrollbar-color: var(--c-border-strong) transparent;
}
.v2-main::-webkit-scrollbar,
.v2-sidebar::-webkit-scrollbar,
.v2-drawer__body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.v2-main::-webkit-scrollbar-thumb,
.v2-sidebar::-webkit-scrollbar-thumb,
.v2-drawer__body::-webkit-scrollbar-thumb {
  background: var(--c-border-strong);
  border-radius: 4px;
}
.v2-main::-webkit-scrollbar-thumb:hover,
.v2-sidebar::-webkit-scrollbar-thumb:hover,
.v2-drawer__body::-webkit-scrollbar-thumb:hover {
  background: var(--c-text-light);
}

/* ─────────────────────────────────────────────────────────────────
 * 地塊搜尋 (cadastral_search.js attach 的 UI 樣式)
 * 隔離 prefix `.v2-cadsearch-*`，不依賴 / 不污染既有任何 class
 * revert：把這整個 block 刪掉
 * ───────────────────────────────────────────────────────────────── */
.v2-cadsearch {
  display: inline-block;
  position: relative;
  margin-left: 12px;
  vertical-align: middle;
}
.v2-cadsearch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #c8b478;
  border-radius: 14px;
  color: #2a2a3e;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.v2-cadsearch__toggle:hover { background: #fef9e7; }
.v2-cadsearch__toggle svg { color: #c8b478; }
.v2-cadsearch__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 500;
  width: 260px;
  background: #fff;
  border: 1px solid #d4cba0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 10px 12px;
}
.v2-cadsearch__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.v2-cadsearch__label {
  flex: 0 0 32px;
  font-size: 12px;
  color: #2a2a3e;
  font-weight: 600;
}
.v2-cadsearch__input {
  flex: 1 1 auto;
  padding: 4px 8px;
  border: 1px solid #d4cba0;
  border-radius: 4px;
  font-size: 13px;
  background: #fafaf6;
  font-family: inherit;
}
.v2-cadsearch__input:focus {
  outline: none;
  border-color: #c8b478;
  background: #fff;
}
.v2-cadsearch__actions {
  margin-top: 4px;
  margin-bottom: 0;
  justify-content: flex-end;
  gap: 6px;
}
.v2-cadsearch__btn {
  padding: 4px 12px;
  border: 1px solid #d4cba0;
  background: #fafaf6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #2a2a3e;
  transition: background 0.15s;
}
.v2-cadsearch__btn:hover { background: #f0e8c8; }
.v2-cadsearch__btn--primary {
  background: #c8b478;
  border-color: #c8b478;
  color: #fff;
  font-weight: 600;
}
.v2-cadsearch__btn--primary:hover { background: #b89f5f; }
.v2-cadsearch__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.v2-cadsearch__hint {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e3dfd2;
  font-size: 10px;
  color: #8a8a8a;
  line-height: 1.3;
}
/* Mobile：panel 寬度縮一點避免出畫面 */
@media (max-width: 640px) {
  .v2-cadsearch__panel { width: 240px; }
}

/* 搜尋結果 popup — 顯示面積/公告現值/地價等資訊 */
.v2-cadsearch-popup {
  font-size: 12.5px;
  line-height: 1.5;
  color: #2a2a3e;
}
.v2-cadsearch-popup h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #1d4ed8;
  border-bottom: 1px solid #d4cba0;
  padding-bottom: 4px;
}
.v2-cadsearch-popup table {
  border-collapse: collapse;
  width: 100%;
}
.v2-cadsearch-popup td {
  padding: 3px 6px 3px 0;
  vertical-align: top;
}
.v2-cadsearch-popup td:first-child {
  color: #666;
  font-size: 11px;
  white-space: nowrap;
}
.v2-cadsearch-popup__hint {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #e3dfd2;
  font-size: 10px;
  color: #8a8a8a;
  line-height: 1.3;
}
@keyframes v2-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
