/*
 * 頁首與頁尾的樣式。
 *
 * 元件、JS 與 ViewModel 在 2026-09-07 就搬進套件了（commit 訊息寫的是
 * self-contained site header），但樣式沒跟著搬——當時的抽取盤點把 CSS 這欄
 * 記成 resources/css/app.css（14 行的 Tailwind 進入點），沒看到
 * public/assets/css/ 底下的 12,442 行。主站一直好好的，海外那個乾淨的新 repo
 * 拿到骨架卻沒有樣式，才把缺口露出來。
 *
 * 全部包 :where()：套件 CSS 最後載入，特異性歸零才不會蓋掉使用端刻意的覆寫。
 */


/*
 * 外殼的基礎版面與排版。
 *
 * 主站把這幾條放在自己的 public/assets/css/custom.css（一條沒有 class 的 body
 * 規則），海外沒有那支，所以文字色變純黑、行高 24px、背景透明、body 也不是
 * flex 直向——底下那條 :where(body > .page-footer-full){flex-shrink:0} 因此形同虛設。
 *
 * 值取自主站實測（首頁／列表／表格三種頁型量到的都一樣）：
 * color rgb(17,24,39)、line-height 1.75、白底、flex column、滿版高。
 *
 * 包 :where() 特異性 0，主站 custom.css 的同名規則照樣勝出，主站零變化。
 */
:where(body) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  color: #111827;
  line-height: 1.75;
  background: #fff;
}

:where(body > .page-footer-full) {
  flex-shrink: 0;
}

:where(.site-mobile-navigation) {
  border-top: 0.0625rem solid rgba(0, 0, 0, .06);
}

/*
 * 側欄底部的版權列。主站的 custom.css 有 #sb-footer 的 padding 與上框線，
 * 而 <p> 的 13px／灰色是主站別處的規則給的（查不到單一來源，但三種頁型量到
 * 的 computed 值一致）。海外什麼都沒有，所以那行用 16px/28px 渲染，
 * 在 240px 寬的側欄裡會從「房地王有限公司」中間斷字。
 *
 * 值取自主站實測：padding 1.25rem 1.5rem、上框線 rgba(0,0,0,.06)、
 * p 為 0.8125rem / 1.6 / #9ca3af。
 */
:where(#sb-footer) {
  flex-shrink: 0;
  padding: 1.25rem 1.5rem;
  border-top: 0.0625rem solid rgba(0, 0, 0, .06);
}

:where(#sb-footer p) {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #9ca3af;
}

/* district-sidebar 與 detail-anchor-sidebar 元件共用的結構樣式；內容與頁型是否啟用由使用端決定。
   #anchor-sidebar／#anchor-sb-body 這一半在工單 0005 補上——主站 custom.css 本來就是
   兩組 ID 同一條規則，先前只搬走 #desktop-sidebar 那一半，海外拿到的側欄因此沒有版面。 */
:where(#desktop-sidebar, #anchor-sidebar) {
  display: none;
  position: fixed;
  top: 5rem;
  left: 0;
  bottom: 0;
  width: 15rem;
  background: #fff;
  border-right: 0.0625rem solid #e5e7eb;
  z-index: 400;
  overflow: hidden;
  flex-direction: column;
}

:where(#sb-nav-body, #anchor-sb-body) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 114, 128, 0.45) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem;
}

:where(#sb-nav-body, #anchor-sb-body)::-webkit-scrollbar {
  display: block;
  width: 0.375rem;
}

:where(#sb-nav-body, #anchor-sb-body)::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.45);
}

:where(.sb-section-title) {
  padding: 1.375rem 0.75rem 0.5rem;
  color: #6b7280;
  font-size: var(--ht-text-sm, 0.875rem);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

:where(.sb-nav-label) {
  padding: 1.375rem 0.75rem 0.5rem;
  color: #6b7280;
  font-size: var(--ht-text-sm, 0.875rem);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* 特異性例外：這條原本靠 0,1,0 與使用端 `.sb-link` 同分並較晚出現，
 * 才能將返回連結由 #374151 改成 #9ca3af；包 :where() 後會輸給 `.sb-link`。 */
.sb-link-back {
  color: #9ca3af;
}

/* 特異性例外：使用端 `.sb-link` 同分時，套件 CSS 載在後面才能保留 CTA 品牌色；包 :where() 會輸。 */
.sb-link-cta {
  color: var(--brand-600, #ff5722);
  font-weight: 600;
}

:where(.sb-district-line) {
  display: flex;
  align-items: stretch;
}

:where(.sb-link.sb-da) {
  flex: 1;
  align-content: center;
  flex-wrap: wrap;
  gap: 0;
  border-radius: 0.5rem 0 0 0.5rem;
}

:where(.sb-name-part:not(:last-child)) {
  margin-right: 0.5rem;
}

:where(.main-sidebar-heading) {
  display: block;
  width: 100%;
  padding: 0.75rem;
  color: #374151;
  font-size: var(--ht-text-base, 1rem);
  font-weight: 600;
  line-height: 1.35;
}

:where(.sb-da-toggle) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  color: #6b7280;
  background: none;
  border: none;
  border-radius: 0 0.5rem 0.5rem 0;
  cursor: pointer;
  transition: background .12s, color .12s;
}

:where(.sb-da-toggle:hover) {
  color: var(--brand-600, #ff5722);
  background: var(--brand-50, #fef3ee);
}

:where(.sb-panel) {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease-out;
}

:where(.sb-panel.is-open) {
  max-height: none;
  overflow: visible;
}

:where(.sb-chevron) {
  flex-shrink: 0;
  color: #9ca3af;
  transition: transform .22s ease;
}

:where(.sb-chevron.rotated) {
  transform: rotate(180deg);
}

@media (min-width: 80rem) {
  :where(#sb-nav-body, #anchor-sb-body) {
    padding-top: 2rem;
  }

  :where(#desktop-sidebar .sb-section-title:first-child, #anchor-sidebar .sb-nav-label:first-child) {
    padding-top: 0;
  }

  :where(#desktop-sidebar, #anchor-sidebar) {
    display: flex !important;
  }

  :where(body.has-fixed-sidebar) {
    padding-left: 15rem;
    padding-top: 5rem;
  }

  :where(body.has-fixed-sidebar #site-header) {
    position: fixed !important;
    top: 0;
    right: 0;
    left: 0;
  }

  :where(body.has-fixed-sidebar .page-footer-full) {
    margin-left: -15rem;
  }

  :where(body.has-fixed-sidebar .page-footer-full .footer-inner) {
    padding-left: calc(15rem + 1.5rem);
  }
}

:where(#nav-bar) {
  height: 4rem;
}

:where(#nav-logo) {
  height: 3rem;
}

@media (min-width: 64rem) {
  :where(#nav-bar) {
    height: 5rem;
  }

  :where(#nav-logo) {
    height: 3.5rem;
  }
}

:where(#pnav-container) {
  flex: 1;
  display: none;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 64rem) {
  :where(#pnav-container) {
    display: flex;
  }
}

:where(.pnav-item) {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  position: relative;
}

:where(.pnav-link) {
  display: flex;
  align-items: center;
  gap: 0.1875rem;
  padding: 0 0.6875rem;
  min-height: 2.75rem;
  font-size: var(--ht-text-sm);
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
  font-family: inherit;
}

:where(.dm-group > button) {
  min-height: 2.75rem;
}

:where(.header-member-trigger) {
  font-size: var(--ht-text-sm) !important;
  border-radius: 0.5rem;
  line-height: 1.5;
}

:where(.header-member-trigger) {
  font-weight: 500;
  cursor: pointer;
}

:where(.pnav-link:hover),
:where(.pnav-item:hover>.pnav-link) {
  color: var(--brand-600, #ff5722);
}

:where(#hamburger-btn),
:where(#member-btn) {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
}

:where(.pnav-chevron) {
  display: inline-block;
  font-size: 0.6875rem;
  line-height: 1;
  flex-shrink: 0;
  color: #6b7280;
  transition: transform .2s;
}

:where(.pnav-item:hover .pnav-chevron) {
  transform: rotate(180deg);
  color: var(--brand-600, #ff5722);
}

:where(.pnav-chevron.rotated) {
  transform: rotate(180deg);
}

:where(.pnav-dd) {
  display: none;
  position: fixed;
  top: var(--dd-top, 5rem);
  left: var(--dd-left, 0rem);
  background: #fff;
  border: 0.0625rem solid #e5e7eb;
  border-radius: 0.625rem;
  box-shadow: 0 0.75rem 2.25rem rgba(0, 0, 0, .13);
  min-width: 9.375rem;
  padding: 0.375rem 0;
  z-index: 9999;
}

:where(.pnav-item:hover .pnav-dd) {
  display: block;
}

:where(.pnav-dd a) {
  display: block;
  padding: 0.5625rem 1.125rem;
  font-size: var(--ht-text-sm);
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
  transition: background .1s, color .1s;
}

:where(.pnav-dd a:hover) {
  background: var(--brand-50, #fef3ee);
  color: var(--brand-600, #ff5722);
}

:where(#pnav-more .pnav-dd) {
  right: var(--dd-right-px, 0rem) !important;
  left: auto !important;
  padding: 0.75rem 0.375rem;
}

:where(#pnav-more) {
  margin-left: 0;
}

:where(.dm-group) {
  position: relative;
}

:where(.dm-group .dm-dd) {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 0.0625rem solid #e5e7eb;
  border-radius: 0.625rem;
  box-shadow: 0 0.75rem 2.25rem rgba(0, 0, 0, .13);
  min-width: 10rem;
  padding: 0.375rem 0;
  z-index: 9999;
}

:where(.dm-group:hover .dm-dd) {
  display: block;
}

:where(.dm-header) {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem 0.375rem;
  font-size: var(--ht-text-sm);
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: .04em;
  border-bottom: 0.0625rem solid #f3f4f6;
  margin-bottom: 0.25rem;
}

:where(.dm-header-icon) {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
}

:where(.footer-links) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.625rem;
}

:where(.footer-links a) {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0;
  font-size: var(--ht-text-sm);
  color: #6b7280;
  text-decoration: none;
}

:where(.footer-company) {
  margin: 0;
  font-size: var(--ht-text-2xs-plus);
  color: #9ca3af;
  line-height: 1.8;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
}

:where(.footer-company span) {
  white-space: nowrap;
}

:where(.footer-company a) {
  color: inherit;
  text-decoration: none;
}

@media (max-width:63.9375rem) {
  :where(.page-footer-full .footer-links) {
    display: none !important;
  }

  :where(.page-footer-full .footer-inner) {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  :where(.page-footer-full .footer-company) {
    font-size: var(--ht-text-2xs-plus);
    line-height: 1.7;
    text-align: left;
    gap: 0rem 0.75rem;
  }

  :where(.page-footer-full .footer-company span) {
    display: inline-block;
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  :where(.page-footer-full .footer-company span:nth-child(2)) {
    white-space: normal;
  }
}

:where(.site-header) {
  z-index: 500;
}

:where(.pnav-more) {
  display: none;
}

:where(.pnav-more-trigger) {
  color: var(--brand-600, #ff5722);
  font-weight: 600;
}

:where(.pnav-more-dd) {
  padding: 0.75rem 0.375rem;
  min-width: 12.5rem;
}

:where(.panel-head) {
  height: 4rem;
  border-bottom: 0.0625rem solid rgba(0, 0, 0, .06);
}

:where(.mob-footer-links) {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

:where(.mob-footer-copy) {
  margin-top: 1.125rem;
}

:where(.member-menu-link .pnav-chevron) {
  width: 0.75rem;
  height: 0.75rem;
  transform: rotate(-90deg);
}

@media (max-width: 79.9375rem) {

  :where(#site-header) {
    transition: transform .25s ease;
    will-change: transform;
  }

  :where(#site-header.mob-header-hidden) {
    transform: translateY(-100%);
  }
}

@media (max-width: 39.9375rem) {
  :where(html.ht-modal-open body.ht-modal-open #site-header) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }
}

:where(.bs-footer-clear) {
  flex: 1;
  padding: 11px 0;
  font-size: var(--ht-text-base);
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s,color .12s;
}

:where(.bs-footer-clear:hover) {
  background: #e5e7eb;
}

:where(.bs-footer-apply) {
  flex: 2;
  padding: 11px 0;
  font-size: var(--ht-text-base);
  font-weight: 600;
  color: #fff;
  background: var(--page-brand-color, var(--brand-600, #ff5722));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .12s;
}

:where(.bs-footer-apply:hover) {
  opacity: .88;
}

/*
 * 列表頁骨架（<x-ht::list-page-frame>）。
 *
 * 主站三種列表頁原本在 Blade 上寫 Tailwind 工具類：
 *   shell  max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 pb-8 lg:pt-10 lg:pb-12
 *   row    xl:flex lg:gap-10 xl:items-start
 *   main   flex-1 min-w-0
 * 套件 Blade 放在 vendor/，使用端的 Tailwind 掃不到，所以改由這裡出貨同樣的計算值。
 *
 * 包 :where() 特異性 0：使用端頁型 CSS 對 .list-page-shell 等的覆寫（例如 < 80rem 的
 * padding-top: 0）照樣勝出，跟原本工具類在 @layer utilities 裡輸給未分層規則的結果相同。
 */
:where(.list-page-shell) {
  max-width: 80rem;
  margin-inline: auto;
  padding: 1.5rem 1rem 2rem;
}

:where(.list-page-main) {
  flex: 1 1 0%;
  min-width: 0;
}

:where(.list-page-main .list-grid) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
  min-width: 0;
}

:where(.list-page-main .list-grid > *) {
  min-width: 0;
}

@media (min-width: 40rem) {
  :where(.list-page-shell) {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 64rem) {
  :where(.list-page-shell) {
    padding: 2.5rem 2rem 3rem;
  }

  :where(.list-page-row) {
    gap: 2.5rem;
  }
}

@media (min-width: 64rem) and (max-width: 79.9375rem) {
  :where(.list-page-main .list-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 80rem) {
  :where(.list-page-row) {
    display: flex;
    align-items: flex-start;
  }
}

@media (max-width: 79.9375rem) {
  :where(body.has-floating-list-topbar #site-header) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
  }

  :where(body.has-floating-list-topbar) {
    padding-top: var(--mob-header-h, 4rem);
  }

  :where(body.has-floating-list-topbar .list-page-shell) {
    padding-top: 0;
  }
}

@media (min-width: 64rem) and (max-width: 79.9375rem) {
  :where(body.has-floating-list-topbar) {
    padding-top: 5rem;
  }
}
