/* ===== 設計 token：沿用 Sage Green European 色票 ===== */
:root {
  --bg: #FFFDF7;
  --bg-2: #FFF4D1;
  --text: #2E2E2E;
  --text-2: #5E5E5E;
  --accent: #F5B400;
  --accent-dark: #C8323C;
  --accent-light: #FFE38A;
  --rose: #D9D6CF;
  --trim: #4A4A4A;
  --stone: #C5C2B8;
  --line-c: #E8E4DA;
  --charcoal: #333333;
  --white: #FBFAF6;
  --outline: #3F3F3F;
  --line-green: #06C755;
  --radius: 14px;
  --gutter: 16px;
  --font: "Noto Sans TC", "Inter", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  overflow-x: hidden; padding-bottom: 72px;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.22; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(20px, 6.4vw, 44px); }
@media (min-width: 900px) { h1 { font-size: clamp(30px, 3vw, 40px); } }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 20px; }
.nw { white-space: nowrap; }
h1 em { font-style: normal; color: var(--accent-dark); box-shadow: inset 0 -.32em 0 var(--accent-light); }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--accent-dark); margin-bottom: 8px; }
.lead, .body-lg { font-size: 17px; color: var(--text-2); max-width: 36em; }
.caption { font-size: 13px; color: var(--text-2); }
.sub-h { margin-top: 48px; }

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 700 16px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, background .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-line { background: var(--line-green); color: #fff; }
.btn-line:hover { background: #05b04b; }
.btn-primary { background: var(--accent-dark); color: var(--white); }
.btn-primary:hover { background: #A82832; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--outline); }
.btn-ghost:hover { background: var(--bg-2); }
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }

/* ===== 頂部 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 247, .95); backdrop-filter: blur(6px);
  border-bottom: 4px solid var(--accent);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; white-space: nowrap; }
.brand b { color: var(--accent-dark); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-dark); color: var(--white); font-weight: 700; border: 2px solid var(--outline);
}
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; color: var(--text-2); }
.nav a:hover, .nav a.active { color: var(--text); background: var(--bg-2); }
.menu-btn { display: none; }

@media (max-width: 899px) {
  .topbar-inner > .btn-line { margin-left: auto; }
  .menu-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer;
  }
  .menu-btn span { height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line-c); padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 8px; font-size: 17px; border-bottom: 1px solid var(--line-c); border-radius: 0; }
}
@media (max-width: 380px) {
  .topbar-inner { gap: 8px; }
  .brand > span:last-child { font-size: 15px; }
  .topbar-inner > .btn-line { padding: 0 12px; }
}

/* ===== Hero ===== */
.hero { padding: 32px 0 56px; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 64px 0 88px; }
  .hero-grid { grid-template-columns: 42fr 58fr; gap: 48px; }
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 20px; }
.hero-services { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-services a {
  text-decoration: none; font-size: 14px; padding: 8px 14px; border-radius: 999px;
  background: var(--accent-light); color: var(--text); font-weight: 500;
}
.hero-services a:hover { background: var(--accent); }

.hero-visual { position: relative; }
.hero-photo {
  margin: 0; position: relative; border: 2px solid var(--outline); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-2);
}
.hero-photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-photo figcaption {
  position: absolute; left: 12px; bottom: 12px; background: var(--charcoal); color: var(--white);
  padding: 8px 14px; border-radius: 10px; display: flex; flex-direction: column; line-height: 1.35;
}
.hero-photo figcaption small { font-size: 12px; font-weight: 400; margin-left: 4px; }
.hero-photo figcaption > span { font-size: 12px; color: var(--accent-light); }
@media (max-width: 899px) {
  /* 手機：照片優先放上面，3 秒內看見照片＋LINE */
  .hero-visual { order: -1; }
}
.street { width: 100%; height: auto; border-radius: var(--radius); border: 2px solid var(--outline); }
.about-side { display: grid; gap: 20px; align-self: start; }

/* ===== 一般區塊 ===== */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-2); }
@media (min-width: 900px) { .section { padding: 96px 0; } }

.about-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.2fr 1fr; gap: 64px; } }
.timeline { list-style: none; padding: 0; margin: 24px 0 0; border-left: 2px solid var(--accent); }
.timeline li { position: relative; padding: 0 0 16px 20px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent-dark);
}
.timeline b { display: block; font-size: 14px; color: var(--accent-dark); }
.why { background: var(--white); border: 2px solid var(--outline); border-radius: var(--radius); padding: 28px; align-self: start; }
.why-list { list-style: none; padding: 0; margin: 0; counter-reset: w; }
.why-list li { counter-increment: w; display: grid; grid-template-columns: 40px 1fr; padding: 14px 0; border-top: 1px solid var(--line-c); }
.why-list li::before {
  content: counter(w, decimal-leading-zero); grid-row: span 2; font: 700 18px/1.3 "Inter", sans-serif; color: var(--accent-dark);
}
.why-list span { color: var(--text-2); font-size: 15px; }

/* 服務 */
.svc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.svc-tabs button {
  font: 500 15px var(--font); min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  background: var(--bg); color: var(--text); border: 2px solid var(--outline);
}
.svc-tabs button[aria-selected="true"] { background: var(--accent-dark); color: var(--white); border-color: var(--accent-dark); }
.svc-panel {
  display: grid; gap: 24px; background: var(--bg); border: 2px solid var(--outline);
  border-radius: var(--radius); padding: 24px;
}
@media (min-width: 768px) { .svc-panel { grid-template-columns: 1fr 1.3fr; padding: 36px; } }
.svc-panel .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.svc-panel .steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--white); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-c); }
.svc-panel .steps i { font: 700 13px "Inter", sans-serif; font-style: normal; color: var(--text); background: var(--accent); border-radius: 50%; min-width: 26px; height: 26px; display: grid; place-items: center; }
.svc-panel .fit { font-size: 14px; color: var(--text-2); }

/* 物件 */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; }
.filters label { display: flex; flex-direction: column; font-size: 13px; color: var(--text-2); gap: 4px; }
select, input, textarea {
  font: 16px var(--font); color: var(--text); background: var(--white);
  border: 1.5px solid var(--outline); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%;
}
.filters select { min-width: 150px; }
@media (max-width: 599px) {
  .filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .filters select { min-width: 0; }
}
.result-count { font-size: 14px; color: var(--text-2); margin: 16px 0; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--white); border: 2px solid var(--outline); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; font: inherit; color: inherit;
  transition: transform .15s;
}
.card:hover { transform: translateY(-3px); }
.card-img { aspect-ratio: 16 / 10; background: var(--bg-2); border-bottom: 2px solid var(--outline); }
.card-img svg, .card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-tag { font-size: 12px; font-weight: 700; color: var(--accent-dark); }
.card h3 { font-size: 18px; margin: 0; }
.card-meta { font-size: 14px; color: var(--text-2); }
.card-price { margin-top: auto; font: 700 22px "Inter", var(--font); }
.card-price small { font-size: 14px; font-weight: 500; }
.empty { padding: 40px; text-align: center; color: var(--text-2); border: 2px dashed var(--stone); border-radius: var(--radius); }

/* 詳情 dialog */
.detail {
  width: min(720px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 2px solid var(--outline);
  border-radius: var(--radius); background: var(--bg); color: var(--text); overflow: auto;
}
.detail::backdrop { background: rgba(52, 56, 48, .55); }
.detail-close {
  position: sticky; top: 8px; float: right; margin: 8px 8px -48px 0; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--outline); background: var(--white);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.d-img { aspect-ratio: 16 / 9; border-bottom: 2px solid var(--outline); background: var(--bg-2); }
.d-img svg { width: 100%; height: 100%; }
.d-content { padding: 20px 24px 28px; }
.d-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; padding: 0; }
.d-specs div { background: var(--white); border: 1px solid var(--line-c); border-radius: 10px; padding: 10px 12px; }
.d-specs dt { font-size: 12px; color: var(--text-2); }
.d-specs dd { margin: 0; font-weight: 700; }
.d-points { padding-left: 20px; color: var(--text-2); }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* 商圈 */
.areas-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .areas-grid { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } }
.map-box { background: var(--bg); border: 2px solid var(--outline); border-radius: var(--radius); padding: 16px; }
.map { width: 100%; height: auto; }
.map .zone { cursor: pointer; transition: fill .15s; }
.map .zone:hover, .map .zone.on { fill: var(--accent); }
.map text { font: 700 13px var(--font); fill: var(--text); pointer-events: none; }
.area-list { display: grid; gap: 10px; margin-top: 20px; }
.area-item { background: var(--bg); border: 2px solid transparent; border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.area-item.on { border-color: var(--accent-dark); background: var(--white); }
.area-item h3 { font-size: 17px; margin: 0 0 4px; display: flex; justify-content: space-between; gap: 8px; }
.area-item h3 small { font-size: 12px; font-weight: 500; color: var(--accent-dark); }
.area-item p { margin: 0; font-size: 14px; color: var(--text-2); }
.area-item .communities { display: none; margin-top: 10px; flex-wrap: wrap; gap: 6px; }
.area-item.on .communities { display: flex; }
.communities span { font-size: 13px; background: var(--accent-light); padding: 4px 10px; border-radius: 999px; }

/* 實績 */
.deals { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 24px; }
.deal { background: var(--white); border-radius: var(--radius); border: 2px solid var(--outline); padding: 20px; }
.deal .tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-light); display: inline-block; }
.deal .tag.sell { background: #F6D5D7; }
.deal h3 { font-size: 17px; margin: 10px 0 6px; }
.deal p { font-size: 14px; color: var(--text-2); margin: 0; }
.deal .num { font: 700 15px "Inter", var(--font); color: var(--text); margin-top: 10px; }
.quotes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.quote { margin: 0; background: var(--bg-2); border-radius: var(--radius); padding: 24px; position: relative; }
.quote::before { content: "“"; font: 700 56px/1 Georgia, serif; color: var(--accent); position: absolute; top: 8px; left: 16px; }
.quote p { margin: 24px 0 12px; }
.quote cite { font-style: normal; font-size: 14px; color: var(--text-2); }

/* 工具 */
.tools-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .tools-grid { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } .tools-grid > div:last-child { order: -1; } }
.card-flat { background: var(--bg); border: 2px solid var(--outline); border-radius: var(--radius); padding: 24px; }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc-form label, .lead-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
.calc-out { margin: 20px 0 12px; padding: 16px; background: var(--white); border-radius: 12px; border: 1px solid var(--line-c); }
.calc-out .big { font: 700 30px "Inter", var(--font); color: var(--accent-dark); }
.calc-out .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); border-top: 1px solid var(--line-c); padding-top: 6px; margin-top: 6px; }
.calc-actions { margin-bottom: 8px; }
.tool-links { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.tool-links a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none;
  background: var(--bg); border: 2px solid var(--outline); border-radius: 12px; padding: 14px 18px;
}
.tool-links a:hover { background: var(--white); }
.tool-links b { display: block; }
.tool-links small { color: var(--text-2); font-size: 13px; }
.tool-links .ext { font-size: 18px; color: var(--accent-dark); }

/* 聯絡 */
.contact-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; gap: 56px; } }
.contact-btns { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.contact-meta { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; font-size: 15px; }
.contact-meta dt { color: var(--text-2); }
.contact-meta dd { margin: 0; }
.lead-form { display: grid; gap: 14px; }
.lead-form h3 { margin: 0; }
.lead-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lead-form legend { font-size: 14px; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--outline); cursor: pointer; color: var(--text); }
.chip input:checked + span { background: var(--accent-dark); color: var(--white); border-color: var(--accent-dark); }
.chip input:focus-visible + span { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
.lead-form .consent { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.consent input { width: 18px; height: 18px; min-height: 0; }
.form-msg { margin: 0; font-size: 14px; min-height: 1.4em; }
.form-msg.err { color: #9A4A3E; }
.form-msg.ok { color: var(--accent-dark); }

.footer { background: var(--charcoal); color: var(--bg-2); padding: 28px 0; border-top: 8px solid var(--accent); box-shadow: inset 0 6px 0 var(--accent-dark); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer p { margin: 0; }
.footer .caption { color: var(--stone); }

/* 手機底部聯絡列 */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(251, 250, 246, .97); border-top: 1px solid var(--line-c);
}
.dock a { display: grid; place-items: center; min-height: 46px; border-radius: 12px; font-weight: 700; text-decoration: none; }
.dock-line { background: var(--line-green); color: #fff; }
.dock-tel { background: var(--charcoal); color: var(--white); }
.dock-form { border: 2px solid var(--outline); }
@media (min-width: 900px) { .dock { display: none; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* 手機：完整照片，名牌移到照片下方避免遮住人物 */
@media (max-width: 599px) {
  .hero-photo figcaption { position: static; border-radius: 0; }
}

/* 591 同步物件 */
.card-img img, .d-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.list-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 28px; text-align: center; }
.list-more p { margin: 0; }

/* 成交實績：數字、榮譽 */
.deal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 16px; }
.deal-stats div { background: var(--accent-light); border: 2px solid var(--outline); border-radius: var(--radius); padding: 14px 10px; text-align: center; }
.deal-stats b { display: block; font: 700 clamp(24px, 6vw, 34px)/1.15 "Inter", var(--font); color: var(--accent-dark); }
.deal-stats span { font-size: 13px; color: var(--text-2); }
.honors { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.honors li { display: flex; flex-direction: column; background: var(--white); border-left: 4px solid var(--accent-dark); border-radius: 10px; padding: 10px 14px; box-shadow: 0 0 0 1px var(--line-c); }
.honors b { font-size: 15px; }
.honors span { font-size: 12px; color: var(--text-2); }
.deal h3 { margin-bottom: 4px; }
@media (max-width: 380px) { .deal-stats span { font-size: 11px; } }

/* 成交卡片海報 */
.deal.has-img { padding: 0 0 16px; overflow: hidden; }
.deal.has-img > :not(.deal-img) { margin-left: 16px; margin-right: 16px; }
.deal-img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; border-bottom: 2px solid var(--outline); margin-bottom: 12px; }
