:root {
    /* 租5：苔綠＋米白紙，墨色文字，奶茶棕點綴 */
    --brand: #5e6e4f;
    --brand-dark: #4a5940;
    --brand-soft: #eceee4;
    --accent: #9a6436;        /* 文字、按鈕用（對比足夠） */
    --accent-dark: #7f5229;
    --accent-light: #c08a5b;  /* 裝飾線、小圓點 */
    --accent-soft: #f3e7d9;
    --ink: #2e2c28;
    --muted: #6e6a61;
    --page-bg: #f6f2ea;
    --paper: #fffdf8;
    --line: #e4dccd;
    --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

body {
    background: var(--page-bg);
    color: var(--ink);
    font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
a.btn:hover, a.card-link:hover { text-decoration: none; }

/* ---------- 頁首 ---------- */
.app-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.app-header .navbar-brand { color: var(--ink); font-weight: 700; letter-spacing: .05em; }
.app-header .brand-mark { width: auto; height: 50px; margin: -4px 0; }
.app-header .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.app-header .brand-tagline { font-family: system-ui, sans-serif; font-size: .7rem; font-weight: 400; letter-spacing: .12em; color: var(--muted); margin-top: 2px; }
.app-header .navbar.container { padding-left: 12px; padding-right: 12px; } /* navbar 會把 container 內距歸零 */
.app-header .nav-link { color: var(--ink); }
.app-header .nav-link:hover, .app-header .nav-link.active { color: var(--brand); }
.app-header .nav-link.active { font-weight: 600; }
.nav-badge { background: var(--accent); font-size: .7rem; vertical-align: top; }

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-brand {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-color: #fff;
}
.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-dark);
    --bs-btn-hover-border-color: var(--accent-dark);
    --bs-btn-active-bg: var(--accent-dark);
    --bs-btn-active-color: #fff;
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-control:focus, .form-select:focus { border-color: #a9b59b; box-shadow: 0 0 0 .2rem rgba(94, 110, 79, .18); }

.card { border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .07); }
.card-header-brand { background: var(--brand-soft); border-bottom: 2px solid var(--brand); font-weight: 600; }
.auth-card { max-width: 460px; margin: 2.5rem auto; }
.text-brand { color: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft); }

/* ---------- 首頁 ---------- */
.hero {
    background: var(--brand);
    color: #fff;
    border-radius: 1rem;
    padding: 2.5rem 1.5rem;
}
.hero h1 { font-weight: 700; letter-spacing: .05em; }
.hero .search-box { background: #fff; border-radius: .75rem; padding: .75rem; }
.city-chip {
    display: inline-block;
    padding: .35rem .8rem;
    margin: 0 .35rem .5rem 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 2rem;
    color: var(--ink);
    font-size: .9rem;
}
.city-chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ---------- 房間卡片 ---------- */
.room-card { overflow: hidden; transition: box-shadow .15s; height: 100%; }
.room-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.room-card .cover {
    aspect-ratio: 4 / 3;
    background: #e9e3d6 center / cover no-repeat;
    position: relative;
}
.room-card .cover-empty { display: flex; align-items: center; justify-content: center; color: #a8a193; font-size: .85rem; }
.room-card .price { color: var(--accent); font-weight: 700; font-size: 1.15rem; }
.room-card .fav-form { position: absolute; top: .5rem; right: .5rem; }
.room-card .badge-reserved { position: absolute; left: .5rem; top: .5rem; }
.fav-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 0; background: rgba(255, 255, 255, .92);
    color: #c3bcae; display: flex; align-items: center; justify-content: center;
}
.fav-btn.is-on { color: #e2504c; }
.fav-btn svg { width: 20px; height: 20px; }
.tag {
    display: inline-block;
    font-size: .75rem;
    padding: .1rem .45rem;
    border-radius: .25rem;
    background: var(--brand-soft);
    color: var(--brand-dark);
    margin: 0 .25rem .25rem 0;
}

/* ---------- 房間頁 ---------- */
.gallery-main { aspect-ratio: 4 / 3; background: #e9e3d6; border-radius: .5rem; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .4rem; overflow-x: auto; padding: .4rem 0; }
.gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: .35rem; overflow: hidden; flex: 0 0 auto; background: none; }
.gallery-thumbs button.active { border-color: var(--brand); }
.gallery-thumbs img { width: 84px; height: 63px; object-fit: cover; display: block; }
.price-big { color: var(--accent); font-size: 1.8rem; font-weight: 700; }
.spec-list dt { color: var(--muted); font-weight: normal; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .4rem; }
.feature-grid span { font-size: .875rem; }
.feature-grid .off { color: #bdb6a8; text-decoration: line-through; }
.sticky-side { position: sticky; top: 1rem; }

/* ---------- 後台 ---------- */
.side-nav .nav-link { color: var(--ink); border-radius: .4rem; padding: .45rem .75rem; }
.side-nav .nav-link.active { background: var(--brand); color: #fff; }
.side-nav .nav-link:hover:not(.active) { background: var(--brand-soft); text-decoration: none; }
.stat-card .num { font-size: 1.6rem; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: .85rem; }
.status-vacant { background: #d9efe0; color: #1d6b39; }
.status-reserved { background: #fff1d6; color: #8a5a00; }
.status-occupied { background: #dde7f5; color: #2a4f86; }
.status-maintenance { background: #eee; color: #666; }
.inq-new { background: #fde6d6; color: #a2470b; }
.inq-contacted { background: #dde7f5; color: #2a4f86; }
.inq-viewing { background: #d9efe0; color: #1d6b39; }
.inq-closed { background: #eee; color: #666; }
.thumb-sm { width: 72px; height: 54px; object-fit: cover; border-radius: .3rem; background: #e9e3d6; }
.image-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .35rem .35rem 0 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .25rem .75rem; }

.app-footer { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 575.98px) {
    .hero { border-radius: 0; margin-left: -12px; margin-right: -12px; }
    .price-big { font-size: 1.5rem; }
}

.pagination { --bs-pagination-color: var(--brand); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-hover-color: var(--brand-dark); }
.nav-tabs .nav-link { color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--ink); font-weight: 600; }
details > summary { cursor: pointer; }

/* 手機版房間頁：底部固定預約按鈕 */
.mobile-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; justify-content: space-between; align-items: center;
    padding: .6rem 1rem; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
}
.mobile-cta .price { color: var(--accent); font-weight: 700; font-size: 1.2rem; }
@media (max-width: 991.98px) {
    body:has(.mobile-cta) .app-footer { padding-bottom: 4.5rem !important; }
}

/* 租約狀態 */
.lease-current { background: #d9efe0; color: #1d6b39; }
.lease-upcoming { background: #dde7f5; color: #2a4f86; }
.lease-expiring { background: #fff1d6; color: #8a5a00; }
.lease-overdue { background: #fbdcdc; color: #a12626; }
.lease-ended { background: #eee; color: #666; }

/* ---------- 租賃契約 ---------- */
.contract-doc { font-family: "BiauKai", "DFKai-SB", "標楷體", "PingFang TC", serif; font-size: 15px; line-height: 1.9; color: #111; }
.contract-doc .c-title { text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: .4em; margin: .5rem 0 1rem; }
.contract-doc .c-review { border: 1px solid #999; padding: .4rem .7rem; font-size: .9rem; }
.contract-doc .c-art { font-size: 1.05rem; font-weight: 700; margin: 1.1rem 0 .3rem; }
.contract-doc .c-list { padding-left: 1.6rem; margin-bottom: .4rem; }
.contract-doc .c-note { font-size: .85rem; color: #555; }
.contract-doc .c-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contract-doc .c-party table, .contract-doc .c-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.contract-doc .c-party th, .contract-doc .c-party td, .contract-doc .c-table th, .contract-doc .c-table td { border: 1px solid #888; padding: .25rem .45rem; vertical-align: middle; }
.contract-doc .c-party th { width: 7.5em; background: #f4f4f4; font-weight: normal; white-space: nowrap; }
.contract-doc .c-party-title { font-weight: 700; margin-bottom: .2rem; }
.contract-doc .c-sigcell { height: 92px; }
.contract-doc .c-sigbox { color: #aaa; font-size: .8rem; text-align: right; }
.contract-doc .c-sigimg { max-height: 70px; max-width: 100%; }
.contract-doc .c-sigmeta { font-size: .72rem; color: #555; }
.contract-doc .c-date { margin-top: .8rem; }
.contract-doc .c-fingerprint { font-size: .7rem; color: #777; word-break: break-all; margin-top: 1rem; border-top: 1px dashed #bbb; padding-top: .3rem; }
.contract-paper { background: #fff; padding: 2rem 2.2rem; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.sig-pad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 3 / 1; border: 2px dashed #b5ae9f; border-radius: .4rem; background: #fff; touch-action: none; cursor: crosshair; display: block; }
@media (max-width: 575.98px) {
    .contract-doc .c-parties { grid-template-columns: 1fr; }
    .contract-paper { padding: 1.2rem 1rem; }
}

/* ---------- 報修 ---------- */
.rp-new { background: #fde6d6; color: #a2470b; }
.rp-processing { background: #dde7f5; color: #2a4f86; }
.rp-scheduled { background: #e8e0f7; color: #55358f; }
.rp-done { background: #d9efe0; color: #1d6b39; }
.rp-closed, .rp-cancelled { background: #eee; color: #666; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { border-left: 3px solid var(--line); padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .35rem; width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.timeline li.by-landlord { border-left-color: var(--brand); }
.timeline li.by-landlord::before { background: var(--brand); }
.timeline li.by-tenant::before { background: var(--accent); }
.timeline .thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: .3rem; margin: .3rem .3rem 0 0; }

/* ---------- 地圖 ---------- */
.results-map { height: 560px; border-radius: .5rem; border: 1px solid #e9e3d6; }
.room-map { height: 260px; border-radius: .5rem; border: 1px solid #e9e3d6; }
.map-price { color: var(--accent); font-weight: 700; }
.border-brand { border-color: var(--brand) !important; color: var(--brand); }
.leaflet-container { font-family: inherit; z-index: 0; }
@media (max-width: 575.98px) { .results-map { height: 420px; } }
.price-pin {
    display: inline-block; transform: translate(-50%, -100%); white-space: nowrap;
    background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
    padding: 5px 8px; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.3); border: 2px solid #fff; cursor: pointer;
}
.price-pin.approx { background: #fff; color: var(--brand); border: 2px dashed var(--brand); }

/* LINE 品牌色按鈕 */
.btn-line { --bs-btn-color: #fff; --bs-btn-bg: #06c755; --bs-btn-border-color: #06c755; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #05b04b; --bs-btn-hover-border-color: #05b04b; --bs-btn-active-bg: #05a046; --bs-btn-active-color: #fff; }

/* 方案比較表：三個方案等寬 */
.plan-table { table-layout: fixed; width: 100%; }
.plan-table col.label-col { width: 34%; }
.plan-table th, .plan-table td { word-break: keep-all; overflow-wrap: anywhere; }
.plan-table td strong { white-space: normal; }
@media (max-width: 575.98px) { .plan-table col.label-col { width: 28%; } .plan-table { font-size: .78rem; } }
.share-text { font-size: .85rem; line-height: 1.6; }

/* 使用說明 */
.help-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--brand); color: #fff; font-size: .75em; font-weight: 700; vertical-align: .1em; }
.help-tip { border: 0; background: none; padding: 0 .2em; color: var(--brand); font-size: .9em; line-height: 1; cursor: help; vertical-align: baseline; }
.help-tip:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-radius: 50%; }
.popover { font-size: .82rem; max-width: 320px; }
.help-panel { --bs-offcanvas-width: 420px; }
.help-faq { border-bottom: 1px solid var(--line); padding: .45rem 0; }
.help-faq summary { cursor: pointer; font-weight: 600; }
.help-faq > div { padding: .4rem 0 .2rem; color: #444; }
.guide-step.done { color: #6c757d; text-decoration: line-through; }
.guide-check { display: inline-flex; width: 1.5em; height: 1.5em; border-radius: 50%; align-items: center; justify-content: center; border: 2px solid #d3ccbd; font-size: .8em; flex-shrink: 0; }
.guide-step.done .guide-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.bg-accent { background: var(--accent) !important; }
.help-pills .nav-link { color: var(--brand); }
.help-pills .nav-link.active { background: var(--brand); color: #fff; }


/* =================================================================
   前台（訪客、房客）文青風格：body.site-public
   後台（房東、平台管理）只套用上方配色，版面不變
   ================================================================= */
.site-public { line-height: 1.75; }
.site-public h1, .site-public h2, .site-public h3, .site-public .h1, .site-public .h2, .site-public .h3, .site-public .h4, .site-public .h5,
.site-public .navbar-brand, .site-public .price, .site-public .price-big, .site-public .serif {
    font-family: var(--serif);
}
.site-public h1, .site-public h2, .site-public h3, .site-public .h1, .site-public .h2, .site-public .h3, .site-public .h4, .site-public .h5 {
    font-weight: 600; letter-spacing: .04em;
}
.site-public .h6, .site-public h6 { letter-spacing: .06em; }
.site-public .card { background: var(--paper); border: 1px solid var(--line); box-shadow: none; border-radius: .375rem; }
.site-public .card-header-brand { background: var(--brand-soft); border-bottom: 1px solid var(--line); font-family: var(--serif); letter-spacing: .06em; }
.site-public .btn { border-radius: .25rem; letter-spacing: .06em; }
.site-public .form-control, .site-public .form-select, .site-public .input-group-text { background-color: var(--paper); border-color: var(--line); }
.site-public .app-header { background: rgba(246, 242, 234, .92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 1020; }
.site-public .app-header .navbar-brand { font-weight: 600; letter-spacing: .18em; font-size: 1.2rem; }
.site-public .app-header .nav-link { letter-spacing: .06em; }
.site-public .app-header .nav-link.active { font-weight: 500; color: var(--brand); box-shadow: inset 0 -1px 0 var(--accent-light); }
.site-public .alert { border-radius: .25rem; }
.site-public .badge.text-bg-warning { background: var(--accent-soft) !important; color: var(--accent-dark) !important; }
.site-public .tag { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 2px; }
.site-public .city-chip { background: transparent; border-color: var(--line); border-radius: 2px; letter-spacing: .06em; }
.site-public .city-chip:hover { background: var(--paper); }

/* 區塊標題：小字英文眉標＋宋體標題 */
.eyebrow { display: block; font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; color: var(--accent-light); margin-bottom: .35rem; font-family: Georgia, "Times New Roman", serif; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; }
.section-head a { font-size: .9rem; letter-spacing: .06em; white-space: nowrap; }

/* 首頁主視覺 */
.site-public .hero { background: transparent; color: var(--ink); border-radius: 0; padding: 2.5rem 0 2rem; }
.site-public .hero h1 { font-weight: 600; font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.45; letter-spacing: .1em; margin-bottom: 1rem; }
.hero-rule { width: 3rem; height: 1px; background: var(--accent-light); margin: 0 0 1.1rem; border: 0; opacity: 1; }
.hero-lead { color: var(--muted); letter-spacing: .08em; margin-bottom: 1.8rem; }
.site-public .hero .search-box { background: var(--paper); border: 1px solid var(--line); border-radius: .375rem; padding: .75rem; box-shadow: 0 10px 30px -18px rgba(46, 44, 40, .35); }
.hero-art { width: 100%; max-width: 360px; color: var(--brand); }
.hero-art .warm { color: var(--accent-light); }
.hero-points { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: 1rem; font-size: .88rem; color: var(--muted); letter-spacing: .05em; }
.hero-points span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-light); margin-right: .5rem; vertical-align: middle; }

/* 房間卡片 */
.site-public .room-card { border-radius: .375rem; }
.site-public .room-card:hover { box-shadow: 0 12px 28px -18px rgba(46, 44, 40, .45); }
.site-public .room-card .cover { background-color: #e9e3d6; }
.site-public .room-card .price, .site-public .price-big, .site-public .mobile-cta .price, .site-public .map-price { color: var(--accent); }
.site-public .mobile-cta { background: var(--paper); }
.room-card .card-body > .d-flex:first-child { flex-wrap: wrap; column-gap: .5rem; }
.room-card .price, .room-card .card-body > .d-flex:first-child > .small { white-space: nowrap; }
@media (max-width: 575.98px) { .site-public .room-card .price { font-size: 1.02rem; } }

/* 房東招募區 */
.landlord-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2.2rem 0; margin-top: 3rem; }

/* 頁尾 */
.site-footer { background: #ece6da; border-top: 1px solid var(--line); padding: 2.75rem 0 1.5rem; margin-top: 3rem; font-size: .9rem; }
.footer-brand img { display: block; width: auto; height: 64px; margin-bottom: .4rem; }
.footer-brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; letter-spacing: .2em; color: var(--ink); margin-bottom: .5rem; }
.footer-tagline { font-size: .75rem; letter-spacing: .12em; color: var(--muted); margin: -.3rem 0 .6rem; }
.footer-slogan { color: var(--muted); line-height: 1.9; letter-spacing: .04em; }
.footer-title { font-family: var(--serif); font-weight: 600; letter-spacing: .12em; color: var(--ink); margin-bottom: .6rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--brand); }
.footer-copy { border-top: 1px solid #ddd5c6; margin-top: 2rem; padding-top: 1rem; font-size: .8rem; color: var(--muted); letter-spacing: .04em; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
/* 版權列右邊：網站製作 9.do 的徽章 */
.footer-copy .made-by { display: inline-block; line-height: 0; opacity: .75; transition: opacity .2s; }
.footer-copy .made-by:hover { opacity: 1; }
.footer-copy .made-by img { display: block; height: 14px; width: auto; }

/* ---------- 租屋知識（文章） ---------- */
.guide-head { padding: 1.5rem 0 1rem; }
.guide-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: .12em; }
.guide-cats { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.75rem; }
.guide-cats a { padding: .3rem .9rem; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font-size: .9rem; letter-spacing: .06em; }
.guide-cats a:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }
.guide-cats a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.article-card { display: block; height: 100%; color: var(--ink); }
.article-card:hover { color: var(--ink); text-decoration: none; }
.article-card:hover .article-card-title { color: var(--brand); }
.article-cover { aspect-ratio: 16 / 10; border-radius: .375rem; overflow: hidden; background: var(--brand-soft) center / cover no-repeat; position: relative; margin-bottom: .8rem; }
.article-cover-text { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.1rem 1.2rem; }
.article-cover-text .cover-mark { font-family: var(--serif); font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 600; letter-spacing: .1em; line-height: 1.5; color: var(--brand-dark); }
.article-cover-text::before { content: ""; position: absolute; right: 1.2rem; top: 1.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--accent-light); }
.article-cover.c-subsidy { background-color: #e8ebdf; }
.article-cover.c-finding { background-color: #efe6d8; }
.article-cover.c-contract { background-color: #e6e3dc; }
.article-cover.c-living { background-color: #ebe7dc; }
.article-cover.c-landlord { background-color: #e3e6e0; }
.article-meta { font-size: .8rem; color: var(--muted); letter-spacing: .06em; }
.article-meta .cat { color: var(--accent); }
.article-card-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; letter-spacing: .04em; line-height: 1.55; margin: .3rem 0 .4rem; transition: color .15s; }
.article-card-summary { font-size: .9rem; color: var(--muted); }
.article-card.article-feature { display: flex; }
.article-feature .article-cover { aspect-ratio: 16 / 9; margin-bottom: 0; }
.article-feature .article-card-title { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: .5rem 0 .8rem; }
.article-feature .article-card-summary { line-height: 1.9; }

.article-wrap { max-width: 760px; margin: 0 auto; }
.article-title { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.5; letter-spacing: .06em; margin: .5rem 0 1rem; }
.article-lead { font-size: 1.05rem; color: var(--muted); line-height: 1.95; border-left: 2px solid var(--accent-light); padding-left: 1rem; margin: 1.25rem 0; }
.article-toc { background: var(--paper); border: 1px solid var(--line); border-radius: .375rem; padding: 1rem 1.25rem; margin: 1.5rem 0 2rem; font-size: .93rem; }
.article-toc .toc-title { font-family: var(--serif); font-weight: 600; letter-spacing: .12em; margin-bottom: .4rem; }
.article-toc ol { margin: 0; padding-left: 1.3rem; }
.article-toc li { margin: .2rem 0; }
.article-toc a { color: var(--ink); }
.article-toc a:hover { color: var(--brand); }
.article-body { font-size: 1.04rem; line-height: 2; letter-spacing: .02em; }
.article-body h2 { font-size: 1.45rem; margin: 2.6rem 0 1rem; padding-top: .4rem; scroll-margin-top: 5rem; }
.article-body h2::before { content: ""; display: block; width: 1.8rem; height: 1px; background: var(--accent-light); margin-bottom: .9rem; }
.article-body h3 { font-size: 1.15rem; margin: 1.8rem 0 .7rem; scroll-margin-top: 5rem; }
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { padding-left: 1.4rem; margin-bottom: 1.1rem; }
.article-body li { margin-bottom: .3rem; }
.article-body strong { color: var(--ink); background: linear-gradient(transparent 62%, var(--accent-soft) 62%); font-weight: 600; }
.article-body a { text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 3px; }
.article-body blockquote { background: var(--brand-soft); border-left: 3px solid var(--brand); padding: .9rem 1.1rem; margin: 1.4rem 0; border-radius: 0 .375rem .375rem 0; font-size: .97rem; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body hr { border: 0; text-align: center; margin: 2.2rem 0; opacity: 1; }
.article-body hr::after { content: "・ ・ ・"; color: var(--accent-light); letter-spacing: .5em; }
.article-body img { max-width: 100%; height: auto; border-radius: .375rem; }
.article-body code { color: var(--accent-dark); background: var(--accent-soft); padding: .05em .35em; border-radius: 2px; }
.table-scroll { overflow-x: auto; margin: 1.2rem 0 1.5rem; }
.article-body table { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.7; min-width: 480px; }
.article-body th { font-family: var(--serif); font-weight: 600; background: var(--brand-soft); letter-spacing: .04em; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: .55rem .75rem; vertical-align: top; }
.article-body tbody tr:nth-child(even) td { background: rgba(255, 253, 248, .7); }
.article-body details { border-bottom: 1px solid var(--line); padding: .7rem 0; }
.article-body details summary { font-weight: 600; font-family: var(--serif); letter-spacing: .03em; }
.article-body details > div { padding-top: .5rem; }
.article-note { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; line-height: 1.8; }
.article-cta { background: var(--paper); border: 1px solid var(--line); border-radius: .375rem; padding: 1.5rem; margin-top: 2rem; text-align: center; }
.article-cta h2 { font-size: 1.25rem; }
.md-preview { background: var(--paper); border: 1px solid var(--line); border-radius: .375rem; padding: 1rem 1.25rem; min-height: 520px; max-height: 75vh; overflow-y: auto; }
.md-preview h2, .md-preview h3, .md-preview th, .md-preview summary { font-family: var(--serif); }
textarea.md-editor { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88rem; line-height: 1.7; min-height: 520px; }

@media (max-width: 575.98px) {
    .site-public .hero { padding-top: 1.5rem; margin-left: 0; margin-right: 0; }
    .article-body { font-size: 1rem; }
    .section-head { flex-wrap: wrap; }
}

/* ---------- 刊登者身分與安心資訊 ---------- */
.trust-badge { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }
.trust-badge.trust-strong { background: var(--brand); color: #fff; }
.trust-list { list-style: none; padding: 0; margin: 0; }
.trust-list li { position: relative; padding-left: 1.4em; margin-bottom: .3rem; line-height: 1.6; }
.trust-list li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.trust-list li.ok::before { content: "✓"; color: var(--brand); }
.trust-list li.no::before { content: "○"; color: #b5ae9f; }
.trust-list li.no { color: var(--muted); }
.trust-line { font-size: .78rem; color: var(--brand-dark); }
.trust-line.checked::before { content: "✓ "; font-weight: 700; }
.ai-precheck { background: var(--brand-soft); border-radius: .375rem; padding: .6rem .8rem; line-height: 1.7; }
.points-badge { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }
.points-badge.done { background: var(--brand-soft); color: var(--brand-dark); }
.points-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }

/* ===== 房間比較 ===== */
.cmp-btn { display: inline-flex; align-items: center; gap: .25rem; margin-top: .5rem; padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: .78rem; line-height: 1.6; }
.cmp-btn:hover { border-color: var(--brand); color: var(--brand); }
.cmp-btn.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.price-big + .cmp-btn, .ms-auto > .cmp-btn { margin-top: 0; }

.cmp-tray { position: fixed; right: 1rem; bottom: 1rem; z-index: 1040; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
body:has(.mobile-cta) .cmp-tray { bottom: 5rem; }
@media (min-width: 992px) { body:has(.mobile-cta) .cmp-tray { bottom: 1rem; } }
.cmp-tray-toggle { border: 0; border-radius: 999px; background: var(--brand); color: #fff; padding: .55rem 1.1rem; font-weight: 600; letter-spacing: .1em; box-shadow: 0 8px 20px -10px rgba(46, 44, 40, .6); }
.cmp-tray-count { display: inline-block; min-width: 1.4em; margin-left: .2rem; padding: 0 .35em; border-radius: 999px; background: #fff; color: var(--brand); font-size: .8rem; letter-spacing: 0; }
.cmp-tray-panel { width: min(320px, calc(100vw - 2rem)); background: var(--paper); border: 1px solid var(--line); border-radius: .5rem; padding: .8rem; box-shadow: 0 16px 36px -18px rgba(46, 44, 40, .55); }
.cmp-tray-head { font-family: var(--serif); font-weight: 600; letter-spacing: .08em; margin-bottom: .5rem; }
.cmp-tray-head small { color: var(--muted); font-family: inherit; font-weight: 400; letter-spacing: 0; }
.cmp-tray-notice { font-size: .8rem; color: var(--accent-dark); background: var(--accent-soft); border-radius: .25rem; padding: .3rem .5rem; margin-bottom: .5rem; }
.cmp-tray ul { list-style: none; padding: 0; margin: 0; }
.cmp-tray li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.cmp-tray-thumb { flex: 0 0 44px; height: 34px; border-radius: .25rem; background: var(--brand-soft) center / cover no-repeat; }
.cmp-tray-name { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-tray-name small { display: block; color: var(--accent); }
.cmp-tray li button { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0 .25rem; }
.cmp-tray-hint { font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
.cmp-tray-actions { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; }

.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: .5rem; background: var(--paper); }
.cmp-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .9rem; min-width: calc(9rem + var(--cmp-cols) * 9rem); }
.cmp-table th, .cmp-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp-table td { text-align: center; }
.cmp-table .cmp-label { position: sticky; left: 0; z-index: 1; width: 9rem; background: var(--paper); text-align: left; font-weight: 500; color: var(--muted); border-right: 1px solid var(--line); }
.cmp-note { font-size: .7rem; font-weight: 400; line-height: 1.35; margin-top: .2rem; color: #9a9488; }
.cmp-head { position: relative; text-align: left; font-weight: 400; }
.cmp-cover { aspect-ratio: 4 / 3; border-radius: .375rem; background: var(--brand-soft) center / cover no-repeat; margin-bottom: .5rem; }
.cmp-cover.cover-empty { display: flex; align-items: center; justify-content: center; color: #a8a193; font-size: .8rem; }
.cmp-title { font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmp-head .price { color: var(--accent); font-weight: 700; font-family: var(--serif); white-space: nowrap; }
.cmp-remove { position: absolute; top: 1rem; right: 1.1rem; width: 1.7rem; height: 1.7rem; border: 0; border-radius: 50%; background: rgba(255, 253, 248, .92); color: var(--ink); font-size: 1.1rem; line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.cmp-group th { background: var(--brand-soft); font-family: var(--serif); font-weight: 600; letter-spacing: .12em; color: var(--brand-dark); padding: .4rem .75rem; }
.cmp-group th { position: sticky; left: 0; }
.cmp-yes { color: var(--brand); font-weight: 600; }
.cmp-no { color: #c3bcae; }
.cmp-best { background: var(--accent-soft); }
.cmp-best-tag { display: inline-block; font-size: .68rem; font-weight: 600; color: #fff; background: var(--accent); border-radius: 999px; padding: 0 .45em; vertical-align: .1em; white-space: nowrap; }
.cmp-table.only-diff tr.cmp-same { display: none; }
@media (max-width: 575.98px) {
    .cmp-table { font-size: .82rem; min-width: calc(4.6rem + var(--cmp-cols) * 8.4rem); }
    .cmp-table th, .cmp-table td { padding: .5rem .45rem; }
    .cmp-table .cmp-label { width: 4.6rem; }
    .cmp-note { display: none; }
    .cmp-notes { display: block !important; }
    .cmp-remove { top: .7rem; right: .7rem; }
}
.cmp-table.only-diff tbody.cmp-same-group { display: none; }
.cmp-tray-toggle.bump { animation: cmp-bump .35s ease-out; }
@keyframes cmp-bump { 40% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .cmp-tray-toggle.bump { animation: none; } }
.cmp-notes { display: none; font-size: .78rem; color: var(--muted); padding-left: 1.1rem; margin: .6rem 0 0; }

/* 文章分類插畫（沒有封面照片時） */
.article-art { position: absolute; top: 5%; right: 4%; width: 62%; height: 46%; color: var(--brand); }
.article-art .a { stroke: var(--accent-light); }
.article-cover.has-art .article-cover-text::before { display: none; }
@media (min-width: 992px) { .article-feature .article-art { width: 56%; height: 62%; top: 8%; } }
.article-cover.article-hero { aspect-ratio: 21 / 8; margin-bottom: 0; }
.article-cover.article-hero .article-art { top: 10%; right: 50%; transform: translateX(50%); width: 70%; height: 80%; }
.article-body figure { margin: 1.6rem 0; }
.article-body figure img { display: block; width: 100%; height: auto; border-radius: .375rem; }
.article-body figcaption { margin-top: .5rem; font-size: .85rem; color: var(--muted); text-align: center; }

/* 後台總覽：營運數據 */
.ops-delta { color: var(--muted); }
.ops-delta.up { color: #2f7d4a; }
.ops-delta.down { color: #b4442b; }
.ops-spark { display: block; width: 100%; height: 64px; }
.ops-spark rect { fill: var(--brand); opacity: .85; }
.ops-spark rect:hover { fill: var(--accent); opacity: 1; }
.ops-axis { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.ops-step { padding: 6px 0; }
.ops-step + .ops-step { border-top: 1px dashed var(--line); }
.ops-bar { height: 8px; background: var(--accent-soft); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.ops-bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; min-width: 2px; }
.ops-step.worst .ops-bar span { background: var(--accent); }
.ops-worst-tag { font-size: .75rem; color: var(--accent); margin-top: 2px; }

/* 房間表單：租金行情參考 */
.rent-ref { background: var(--accent-soft); border-radius: 6px; padding: 8px 12px; line-height: 1.7; }

/* 出租節稅試算 */
.tax-highlight { background: var(--accent-soft); border-radius: 10px; padding: 16px 20px; }
.tax-big { font-size: 1.35rem; }
.tax-big strong { color: var(--accent); font-size: 1.7rem; }
.tax-table th[data-col="social"], .tax-table td[data-col="social"] { background: rgba(94, 110, 79, .08); }
.tax-table tr.tax-net th, .tax-table tr.tax-net td { border-top: 2px solid var(--line); font-weight: 600; }

/* 關於租5 */
.about-page { max-width: 880px; }
.about-hero { padding: 2.5rem 0 1.5rem; }
.about-hero h1 { font-size: clamp(1.8rem, 4.4vw, 2.7rem); line-height: 1.45; letter-spacing: .1em; margin-bottom: 1rem; }
.about-section { padding: 2rem 0; border-top: 1px solid var(--line); }
.about-section h2 { margin-bottom: 1rem; }
.about-cycle { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; counter-reset: none; }
.about-cycle li { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: .375rem; padding: 1rem .85rem; }
.about-cycle li:not(:last-child)::after { content: "→"; position: absolute; right: -.7rem; top: 50%; transform: translateY(-50%); color: var(--accent-light); font-size: .9rem; z-index: 1; }
.about-cycle li:last-child { background: var(--brand-soft); }
.about-cycle-no { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-family: var(--serif); font-size: .85rem; margin-bottom: .5rem; }
.about-cycle strong { display: block; font-family: var(--serif); font-weight: 600; line-height: 1.5; color: var(--ink); }
.about-cycle small { display: block; color: var(--muted); margin-top: .35rem; line-height: 1.6; }
@media (max-width: 767.98px) {
    .about-cycle { grid-template-columns: 1fr; }
    .about-cycle li:not(:last-child)::after { content: "↓"; right: auto; left: 1.4rem; top: auto; bottom: -.95rem; transform: none; }
}
.about-col-title { color: var(--brand-dark); padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: .75rem; }
.about-list { padding-left: 1.1rem; margin: 0; }
.about-list li { margin-bottom: .3rem; }
.about-list li::marker { color: var(--accent-light); }
.about-levels { margin: 0 0 1rem; }
.about-levels > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px dashed var(--line); }
.about-levels dt { font-family: var(--serif); font-weight: 600; color: var(--ink); }
.about-levels dt span { display: block; font-family: inherit; font-weight: 400; font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.about-levels dd { margin: 0; }
@media (max-width: 575.98px) { .about-levels > div { grid-template-columns: 1fr; gap: .25rem; } }
.about-nots { list-style: none; padding: 0; margin: 0; }
.about-nots li { padding: .6rem 0 .6rem 1.6rem; position: relative; }
.about-nots li::before { content: "✕"; position: absolute; left: 0; top: .6rem; color: var(--accent); font-size: .85rem; }
.about-cta { padding: 2.5rem 0 1rem; border-top: 1px solid var(--line); }
.about-sign { font-family: var(--serif); color: var(--muted); letter-spacing: .2em; }

/* ---------- 動態：插畫、對話框、卡片、捲動淡入（皆尊重「減少動態效果」設定） ---------- */
/* 首頁插畫：線條依序畫出，之後盆栽輕擺、圓燈呼吸 */
.hero-figure { position: relative; width: 100%; max-width: 360px; padding-top: 3.4rem; }
.hero-art .ln { stroke-dasharray: 1 2; stroke-dashoffset: 1; opacity: 0; animation: hero-draw 1.4s cubic-bezier(.4, 0, .2, 1) var(--d, 0s) forwards; }
@keyframes hero-draw { 8% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
.hero-art .breathe { transform-box: view-box; transform-origin: 236px 70px; animation: hero-breathe 5s ease-in-out 2.6s infinite; }
@keyframes hero-breathe { 50% { transform: scale(1.1); } }
.hero-art .sway { transform-box: view-box; transform-origin: 244px 226px; animation: hero-sway 6s ease-in-out 2.4s infinite; }
@keyframes hero-sway { 25% { transform: rotate(2.5deg); } 75% { transform: rotate(-2.5deg); } }

/* 首頁對話框：輪流顯示提示 */
.hero-bubble {
    position: absolute; top: 0; left: .5rem; white-space: nowrap;
    background: var(--paper); border: 1px solid var(--line); border-radius: 1rem;
    padding: .5rem 1rem; font-size: .86rem; letter-spacing: .05em; color: var(--ink);
    box-shadow: 0 10px 24px -16px rgba(46, 44, 40, .45);
    animation: bubble-in .5s ease-out 1.6s both, bubble-bob 5s ease-in-out 2.2s infinite;
}
.hero-bubble::after {
    content: ""; position: absolute; left: 2.6rem; bottom: -6px; width: 11px; height: 11px;
    background: var(--paper); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg);
}
.hero-bubble span { display: inline-block; transition: opacity .35s, transform .35s; }
.hero-bubble span.out { opacity: 0; transform: translateY(4px); }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes bubble-bob { 50% { transform: translateY(-4px); } }

/* 房間卡片：滑過微微浮起 */
.site-public .room-card { transition: box-shadow .2s, transform .2s; }
.site-public .room-card:hover { transform: translateY(-3px); }

/* 文章插圖：滑過時各自動一下 */
.article-art .m, .article-art .sun { transform-box: fill-box; transform-origin: center; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.article-card:hover .article-art .sun { transform: scale(1.25); }
.article-card:hover .m-search { transform: translate(-10px, -4px) rotate(-10deg); }
.article-card:hover .m-stamp { transform: scale(1.18) rotate(-10deg); }
.article-card:hover .m-pen { transform: translate(-6px, 3px) rotate(-8deg); }
.article-art .m-leaf { transform-origin: bottom center; }
.article-card:hover .m-leaf { transform: rotate(-10deg); }
.article-card:hover .m-keys { animation: art-keys .5s steps(2) 2; }
@keyframes art-keys { 50% { opacity: .25; } }

/* 空狀態／找不到頁面：放大鏡在小房子前找來找去 */
.empty-state { text-align: center; }
.empty-art { display: block; width: 150px; margin: .25rem auto 1rem; color: var(--brand); }
.empty-art .a { stroke: var(--accent-light); }
.empty-art .look { transform-box: fill-box; transform-origin: center; animation: empty-look 5s ease-in-out infinite; }
@keyframes empty-look { 0%, 100% { transform: none; } 30% { transform: translateX(-48px) rotate(-8deg); } 45% { transform: translateX(-48px) translateY(-6px) rotate(-8deg); } 70% { transform: translateX(8px) rotate(5deg); } }
.empty-art .sun { transform-box: fill-box; transform-origin: center; animation: hero-breathe 5s ease-in-out infinite; }

/* 捲動到才淡入（.js-motion 由 motion.js 加上，沒有 JS 時內容照常顯示） */
.js-motion [data-reveal] > * { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; transition-delay: calc(var(--i, 0) * 80ms); }
.js-motion [data-reveal] > .is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .hero-art .ln, .hero-art .breathe, .hero-art .sway, .hero-bubble, .empty-art .look, .empty-art .sun, .article-card:hover .m-keys { animation: none; }
    .hero-art .ln { stroke-dashoffset: 0; opacity: 1; }
    .site-public .room-card, .article-art .m, .article-art .sun { transition: none; }
    .site-public .room-card:hover, .article-card:hover .m, .article-card:hover .article-art .sun { transform: none; }
}
@media print {
    .js-motion [data-reveal] > * { opacity: 1; transform: none; }
}
