/* AI 代辦所 —— 色彩與字體設定集中在 :root，改這裡全站同步 */
:root {
  --bg: #F7F2EA;
  --surface: #FFFDF9;
  --ink: #1E2621;
  --muted: #4A5249;
  --line: #E4DBCD;
  --green: #1F6B45;
  --green-dark: #14502F;
  --green-soft: #E3EFE6;
  --seal: #B23A2B;
  --chat: #EDE6DA;
  --bubble: #BFE3C8;

  --sans: "Noto Sans TC", "Noto Sans CJK TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
h1, h2, h3 { line-height: 1.35; margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 900; letter-spacing: .02em; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; color: #fff; }
.icon { flex-shrink: 0; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font: 700 17px/1 var(--sans); text-decoration: none; cursor: pointer; border: 0;
  transition: background-color .15s ease;
}
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 16px; }
.btn-lg { min-height: 60px; padding: 0 32px; font-size: 19px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-outline:hover { background: var(--surface); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--green-soft); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.text-link { font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- 頁首 ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 242, 234, .94); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.seal {
  width: 40px; height: 40px; border-radius: 6px; background: var(--seal); color: #FFFDF9;
  display: grid; place-items: center; font: 900 22px/1 var(--serif);
}
.brand-name { font: 900 23px/1 var(--serif); letter-spacing: .04em; }
.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav > a:not(.btn) { color: var(--ink); text-decoration: none; font-size: 16px; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav > a:not(.btn):hover, .site-nav > a[aria-current="page"] { border-bottom-color: var(--green); }
.menu-toggle { display: none; width: 48px; height: 48px; border: 0; background: transparent; color: var(--ink); cursor: pointer; border-radius: 10px; }
.menu-toggle .i-close { display: none; }
.menu-toggle[aria-expanded="true"] .i-open { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: inline; }

@media (max-width: 960px) {
  .menu-toggle { display: grid; place-items: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px;
  }
  .site-nav.open { display: flex; }
  .site-nav > a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
  .site-nav > a[aria-current="page"] { color: var(--green); font-weight: 700; }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- 區塊 ---------- */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-tight { padding-top: 48px; padding-bottom: clamp(64px, 9vw, 104px); }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 44px; }
.section-head-row { flex-direction: row; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- 主視覺 ---------- */
.hero { padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 96px); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(40px, 6vw, 80px); align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 26px; }
.pill { align-self: flex-start; padding: 6px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--muted); }
.hero h1 { font-size: clamp(38px, 5.6vw, 66px); line-height: 1.25; }
.hero-lead { font-size: clamp(18px, 1.8vw, 21px); color: var(--muted); max-width: 34em; }
.trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 16px; color: var(--muted); }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust .icon { color: var(--green); }

.phone { width: 340px; height: 640px; background: var(--ink); border-radius: 44px; padding: 12px; }
.phone-screen { height: 100%; background: var(--chat); border-radius: 34px; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 24px 18px 14px; background: var(--surface); border-bottom: 1px solid var(--line); line-height: 1.4; }
.chat-head strong { display: block; font-size: 15px; }
.chat-head small { font-size: 12px; color: var(--muted); }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; }
.chat-body { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 18px 14px; font-size: 14px; line-height: 1.6; }
.chat-time { align-self: center; font-size: 12px; color: var(--muted); }
.bubble { max-width: 82%; padding: 10px 14px; }
.bubble.me { align-self: flex-end; background: var(--bubble); border-radius: 16px 16px 4px 16px; }
.bubble.bot { align-self: flex-start; background: var(--surface); border-radius: 16px 16px 16px 4px; }
.chips { display: flex; gap: 8px; }
.chips span { padding: 6px 16px; background: var(--surface); border: 1.5px solid var(--green); color: var(--green); border-radius: 999px; font-weight: 700; }
.chat-foot { padding: 12px 16px 20px; background: var(--surface); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .phone { margin: 0 auto; }
}
@media (max-width: 640px) {
  .phone { width: 100%; max-width: 340px; height: auto; }
  .phone-screen { min-height: 540px; }
  .hero .btn-row .btn { width: 100%; }
}

/* ---------- 困擾卡片 ---------- */
.pain-card {
  display: flex; flex-direction: column; gap: 16px; min-height: 220px; padding: 28px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; transition: border-color .15s ease;
}
.pain-card:hover { border-color: var(--green); color: var(--ink); }
.icon-box { width: 52px; height: 52px; border-radius: 14px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.pain-text { font-size: 20px; font-weight: 700; line-height: 1.5; }
.pain-fix { margin-top: auto; display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--green); }
@media (max-width: 640px) {
  .pain-card { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 18px; gap: 12px 14px; }
  .pain-card .icon-box { width: 44px; height: 44px; }
  .pain-text { flex: 1; font-size: 17px; }
  .pain-fix { width: 100%; margin: 0; padding-left: 58px; font-size: 15px; }
}

/* ---------- 比較表 ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.compare { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 16px; line-height: 1.6; }
.compare th, .compare td { padding: 20px 22px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare thead th { font-weight: 700; color: var(--muted); }
.compare tbody th { font-weight: 700; width: 160px; }
.compare .us { background: var(--green-soft); font-weight: 700; }
.compare thead .us { background: var(--green); color: #fff; font-family: var(--serif); font-size: 19px; }

/* ---------- 案例 ---------- */
.case-card { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: border-color .15s ease; }
.case-card:hover { border-color: var(--green); }
.case-link { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.case-link:hover { color: var(--ink); }
.case-media { aspect-ratio: 16 / 10; background: var(--line); display: grid; place-items: center; color: var(--muted); font-size: 15px; }
.case-media img { width: 100%; height: 100%; object-fit: cover; }
.case-media-lg { border-radius: 20px; overflow: hidden; margin-bottom: 40px; }
.case-body { display: flex; flex-direction: column; gap: 12px; padding: 26px; flex: 1; }
.case-body h3 { font-size: 22px; }
.case-body .muted { font-size: 16px; }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; line-height: 1.4; }
.tag { padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.tag-live { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.case-result { margin-top: auto; padding: 14px 16px; background: var(--surface); border-radius: 12px; font-size: 16px; line-height: 1.6; }
.case-result strong { color: var(--green); margin-right: 8px; }
.case-result-lg { font-size: 20px; font-weight: 700; }
.case-detail { max-width: calc(820px + var(--gutter) * 2); padding-bottom: 80px; }
.case-detail section { margin-bottom: 36px; }
.case-detail h2 { font-size: 26px; margin-bottom: 10px; }
.case-next { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 18px; font-weight: 700; padding-top: 24px; border-top: 1px solid var(--line); }
.crumbs { font-size: 15px; color: var(--muted); margin-bottom: 14px; }

/* ---------- 流程 ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.step { display: flex; flex-direction: column; gap: 10px; padding-top: 22px; border-top: 3px solid var(--line); }
.step:first-child { border-top-color: var(--green); }
.step-no { font: 900 46px/1 var(--serif); color: var(--ink); }
.step:first-child .step-no { color: var(--green); }
.step p { color: var(--muted); }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- 價格 ---------- */
.price-card { display: flex; flex-direction: column; gap: 14px; padding: 34px; background: var(--bg); border: 1px solid var(--line); border-radius: 20px; }
.section:not(.section-alt) .price-card, .section-tight .price-card { background: var(--surface); }
.price-card-main { border: 2px solid var(--green); }
.price-card h3 { font-size: 23px; }
.price { margin-top: auto; padding-top: 8px; font: 900 32px/1.3 var(--serif); }
.price small { font: 700 17px var(--sans); color: var(--muted); }
.note { margin-top: 24px; color: var(--muted); }

/* ---------- 關於我 ---------- */
.about-row { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: clamp(40px, 6vw, 80px); align-items: center; }
.section-tight.about-row { align-items: start; }
.about-photo { width: 100%; aspect-ratio: 20 / 23; object-fit: cover; object-position: 54% 50%; border-radius: 24px; }
.about-text { display: flex; flex-direction: column; gap: 20px; }
.about-text h2 { font-size: clamp(30px, 4vw, 44px); }
.about-text p { color: var(--muted); font-size: 18px; }
blockquote { margin: 0; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font: 700 21px/1.6 var(--serif); color: var(--ink); }
@media (max-width: 860px) {
  .about-row { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
}

/* ---------- 文章型內容 ---------- */
.prose { max-width: 720px; display: flex; flex-direction: column; gap: 16px; margin-top: 56px; }
.about-text.prose { margin-top: 0; max-width: none; }
.prose h2 { font-size: 26px; margin-top: 12px; }
.prose p { color: var(--muted); }
.plain { margin: 0; padding-left: 1.2em; color: var(--muted); }

/* ---------- 常見問題 ---------- */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq-item { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.section-tight .faq-item { background: var(--surface); }
.faq-item summary { list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; font-size: 19px; font-weight: 700; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; position: absolute; right: 24px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item p { padding: 0 24px 22px; color: var(--muted); }

/* ---------- 頁面標題 ---------- */
.page-head { padding: clamp(48px, 7vw, 80px) 0 8px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 14px; }
.page-head .lead { max-width: 40em; }
.page-head .btn-row { margin-top: 28px; }

/* ---------- 服務頁 ---------- */
.jump { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 28px; padding-bottom: 12px; }
.jump a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 15px; }
.jump a:hover { border-color: var(--green); color: var(--green); }
.service-list { display: grid; gap: 24px; padding-top: 24px; padding-bottom: 80px; }
.service { padding: clamp(24px, 4vw, 40px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; gap: 18px; }
.service-head { display: flex; gap: 18px; align-items: flex-start; }
.service-pain { color: var(--muted); font-size: 16px; }
.service h2 { font-size: clamp(26px, 3vw, 32px); }
.service-intro { max-width: 46em; font-size: 18px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .icon { color: var(--green); margin-top: 6px; }
.service-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 6px; }

/* ---------- 聯絡 ---------- */
.contact-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 48px; align-items: start; }
.contact-line { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; text-align: center; }
.contact-line img { background: #fff; border-radius: 12px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.contact-form h2 { font-size: 24px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 16px; }
.contact-form input, .contact-form textarea { font: 400 17px/1.6 var(--sans); padding: 12px 14px; border: 1.5px solid #CFC4B3; border-radius: 10px; background: #fff; color: var(--ink); }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
.contact-form .btn { align-self: flex-start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- 行動呼籲 ---------- */
.cta-band { background: var(--green); color: #fff; padding: clamp(56px, 8vw, 88px) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cta-text { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.cta-text h2 { font-size: clamp(30px, 4.4vw, 48px); }
.cta-text p { font-size: 19px; color: var(--green-soft); }
.cta-text .btn { margin-top: 8px; }
.qr { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr img { background: #fff; border-radius: 16px; padding: 8px; }
.qr figcaption { font-size: 15px; color: var(--green-soft); }
@media (max-width: 760px) {
  .cta-inner { flex-direction: column; align-items: stretch; }
  .qr { display: none; }
  .cta-text .btn { width: 100%; }
}

/* ---------- 頁尾 ---------- */
.site-footer { background: var(--ink); color: #CFC8BC; padding: 40px 0; font-size: 15px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.brand-footer .seal { width: 32px; height: 32px; font-size: 18px; }
.brand-footer .brand-name { font-size: 19px; color: #FFFDF9; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { color: #CFC8BC; text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.copyright { width: 100%; font-size: 14px; color: #A9A294; }
.footer-mail { width: 100%; }
.footer-mail a { color: #FFFDF9; }
.cta-mail { font-size: 16px !important; }
.cta-mail a { color: #fff; font-weight: 700; word-break: break-all; }
.contact-mail a { font-weight: 700; word-break: break-all; }

/* ---------- 手機底部固定 LINE 按鈕 ---------- */
.mobile-bar { display: none; }
@media (max-width: 760px) {
  .mobile-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 253, 249, .97); border-top: 1px solid var(--line);
  }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 手機版微調 ---------- */
h1, h2 { text-wrap: balance; }
@media (max-width: 640px) {
  .hero h1 { font-size: 33px; }
  .section-head h2, .about-text h2, .cta-text h2 { font-size: 27px; }
  .page-head h1 { font-size: 32px; }
  .section-head { margin-bottom: 28px; }
}
@media (max-width: 700px) {
  .table-scroll { overflow: visible; border: 0; background: transparent; }
  .compare { min-width: 0; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .compare tbody { display: grid; gap: 12px; }
  .compare tbody tr { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
  .compare tbody th, .compare tbody td { width: auto; border: 0; padding: 10px 18px; }
  .compare tbody th { order: -2; padding-top: 16px; font-size: 18px; }
  .compare tbody td.us { order: -1; margin: 0 12px 6px; border-radius: 10px; padding: 12px 14px; }
  .compare tbody td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
  .compare tbody td.us::before { color: var(--green); }
  .compare tbody td:not(.us) { font-size: 15px; padding-top: 6px; padding-bottom: 6px; }
  .compare tbody tr { padding-bottom: 10px; }
}
@media (max-width: 760px) {
  .mobile-bar { transition: transform .25s ease; }
  .mobile-bar.is-hidden { transform: translateY(110%); }
}
@media (prefers-reduced-motion: reduce) { .mobile-bar { transition: none; } }
