/* ============ 找會計師 H5（手機直立） ============ */
:root {
  --brand: #0b5cd5;
  --brand-dk: #084ab0;
  --brand-soft: #eaf1ff;
  --ink: #14181f;
  --ink-2: #4a5566;
  --ink-3: #7a869a;
  --line: #e6eaf1;
  --bg: #f4f6fa;
  --white: #fff;
  --ok: #0f9d58;
  --warn: #e08600;
  --gold: #f5a623;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 30, 60, .06);
  --shadow-lg: 0 8px 28px rgba(20, 30, 60, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef2f9 0%, #e7ecf5 100%);
  line-height: 1.65;
  font-size: 15px;
  min-height: 100vh;
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 25px; letter-spacing: -.2px; }
h2 { font-size: 19px; margin-top: 0; }
h3 { font-size: 15.5px; }
p { margin: 0 0 .9em; }
ul, ol { margin: 0 0 1em; padding-left: 1.15em; }
li { margin-bottom: .35em; }

/* ---- H5 直立容器 ---- */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 520px) {
  body { padding: 22px 0 40px; background: linear-gradient(160deg, #dfe6f2, #cfd9ea); }
  .app { border-radius: 18px; overflow: hidden; min-height: calc(100vh - 62px); }
}

/* ---- 頂部 ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 9px; color: inherit; }
.topbar-inner:hover { text-decoration: none; }
.logo {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #3f86f5);
  color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; letter-spacing: -.5px;
}
.logo i { font-style: normal; opacity: .75; }
.topbar-title b { display: block; font-size: 15.5px; line-height: 1.25; }
.topbar-title em { display: block; font-style: normal; font-size: 11px; color: var(--ink-3); }
.topbar-cta {
  background: var(--brand-soft); color: var(--brand-dk); font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}

/* ---- 內容 ---- */
.page { padding: 16px 16px calc(96px + var(--safe-b)); flex: 1 1 auto; }
.sec { margin: 22px 0; }
.sec > h2 { border-left: 4px solid var(--brand); padding-left: 9px; }
.lead { font-size: 15.5px; color: var(--ink-2); }
.note { font-size: 12.5px; color: var(--ink-3); }
.updated { font-size: 12px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 10px; }
.empty { padding: 28px 12px; text-align: center; color: var(--ink-3); }
.seeall { text-align: right; margin: 8px 0 0; font-size: 14px; }

.kicker { font-size: 12.5px; color: var(--brand); font-weight: 700; letter-spacing: .4px; margin-bottom: 6px; }
.hero-sub { color: var(--ink-2); }
.hero-cta { display: flex; gap: 10px; margin: 14px 0 18px; }
.hero-facts {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 0; padding: 12px 6px; background: var(--brand-soft); border-radius: var(--radius);
}
.hero-facts li { text-align: center; margin: 0; }
.hero-facts b { display: block; font-size: 18px; color: var(--brand-dk); }
.hero-facts span { font-size: 11.5px; color: var(--ink-2); }

/* ---- 摘要塊（AI 友善） ---- */
.tldr {
  background: #f7faff; border: 1px solid #d9e5fb; border-radius: var(--radius);
  padding: 12px 14px; margin: 14px 0 18px;
}
.tldr-h { font-size: 14px; color: var(--brand-dk); margin: 0 0 6px; }
.tldr ul { margin: 0; padding-left: 1.1em; font-size: 14px; color: var(--ink-2); }

/* ---- 麵包屑 ---- */
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.crumb a { color: var(--ink-3); }
.crumb i { font-style: normal; margin: 0 5px; opacity: .6; }

/* ---- 按鈕 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-size: 14.5px; font-weight: 600; padding: 10px 14px; background: #f1f3f7; color: var(--ink);
  text-align: center; transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(11, 92, 213, .25); }
.btn-outline { background: #fff; border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: #f1f3f7; color: var(--ink-2); }
.btn-lg { padding: 13px 18px; font-size: 15.5px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.hero-cta .btn { flex: 1; }

/* ---- 步驟 ---- */
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps h3 { margin: 0 0 2px; font-size: 15px; }
.steps p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.steps-sm p { margin: 0; font-size: 14px; }
.step-n {
  flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}

/* ---- 卡片 / 格線 ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow); color: inherit;
}
.tile:hover { text-decoration: none; border-color: #c3d4f5; }
.tile h3 { margin: 0 0 6px; font-size: 15px; }
.tile p { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-3); }
.tile-price { font-size: 13px; font-weight: 700; color: var(--brand-dk); }
.tile-region h3 i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }

/* ---- 會計師卡片 ---- */
.list { display: flex; flex-direction: column; gap: 10px; }
.cpa-card {
  display: flex; gap: 11px; align-items: flex-start; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); color: inherit;
}
.cpa-card:hover { text-decoration: none; border-color: #c3d4f5; }
.avatar {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #eaf1ff, #d8e6ff); color: var(--brand-dk); font-weight: 700; font-size: 16px;
}
/* AI 生成的專業形象照 + 證照標籤 */
.av { flex: 0 0 auto; display: block; }
.av img { display: block; width: 78px; height: 78px; border-radius: 14px; object-fit: cover; background: #eef1f6; border: 1px solid var(--line); }
.av-lg img { width: 124px; height: 124px; border-radius: 20px; box-shadow: var(--shadow); }
.certs { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 5px; width: 78px; }
.av-lg + .certs { width: auto; flex-direction: row; justify-content: center; gap: 6px; margin: 8px 0 0; }
.cert { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; padding: 2px 7px; border-radius: 5px; }
.cert-cpa { background: #0b5cd5; color: #fff; }
.cert-acca { background: #b3223f; color: #fff; }
.cert-country { font-size: 10.5px; color: var(--ink-3); }
.cpa-svc-label { margin: 6px 0 3px; font-size: 11px; color: var(--ink-3); letter-spacing: .3px; }
.profile-svc-label { margin-top: 12px; }
.profile-tags { justify-content: center; }
.svc-tag { font-style: normal; font-size: 12px; background: var(--brand-soft); color: var(--brand-dk); padding: 3px 9px; border-radius: 7px; }
.svc-tag:hover { text-decoration: none; background: #d9e5fb; }
.avatar-lg { flex: 0 0 62px; width: 62px; height: 62px; font-size: 22px; border-radius: 16px; }
.cpa-main { flex: 1 1 auto; min-width: 0; }
.cpa-main h3 { margin: 0 0 3px; font-size: 16px; }
.cpa-firm { margin: 0 0 5px; font-size: 12.5px; color: var(--ink-3); }
.cpa-meta { margin: 0 0 6px; font-size: 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cpa-tags { margin: 0 0 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.cpa-tags em { font-style: normal; font-size: 11.5px; background: var(--brand-soft); color: var(--brand-dk); padding: 2px 7px; border-radius: 6px; }
.cpa-line { margin: 0 0 5px; font-size: 13px; color: var(--ink-2); }
.cpa-price { margin: 0; font-size: 13px; font-weight: 700; color: var(--brand-dk); }
.chev { color: var(--ink-3); font-size: 20px; align-self: center; }
.badge { background: #eef4ff; color: var(--brand-dk); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; }
.badge-id { display: inline-block; margin: 0 0 10px; }
.stars { color: var(--gold); font-size: 12.5px; white-space: nowrap; }
.stars i { color: #dfe3ea; font-style: normal; }
.stars b { color: var(--ink-2); font-weight: 600; font-size: 11.5px; }

/* ---- 表格 ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 4px 0 0; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.tbl thead th { background: #f4f7fc; font-size: 13px; }
.tbl tbody th { background: #fafbfe; font-weight: 600; width: 34%; }

/* ---- 篩選 ---- */
.filter { display: grid; gap: 8px; margin: 12px 0; }
.filter input[type="search"], .filter select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  background: #fff; color: var(--ink);
}
.chips-row { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
.chip {
  flex: 0 0 auto; font-size: 13px; padding: 6px 11px; border-radius: 999px;
  background: #f2f4f8; color: var(--ink-2); border: 1px solid transparent;
}
.chip.on { background: var(--brand); color: #fff; }
.result-count { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 10px; }

/* ---- 方案 ---- */
.plans { display: grid; gap: 12px; }
.plan {
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 15px; background: #fff; position: relative;
  box-shadow: var(--shadow);
}
.plan-hot { border-color: var(--brand); box-shadow: 0 6px 22px rgba(11, 92, 213, .14); }
.ribbon {
  position: absolute; top: -9px; right: 12px; background: var(--brand); color: #fff;
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 600;
}
.plan h3 { margin: 0 0 3px; font-size: 17px; }
.plan-tag { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-3); }
.plan-price { margin: 0 0 6px; }
.plan-price b { font-size: 28px; color: var(--brand-dk); letter-spacing: -.5px; }
.plan-price em { font-style: normal; font-size: 12.5px; color: var(--ink-3); margin-left: 5px; }
.plan-sum { font-size: 13.5px; color: var(--ink-2); }
.plan .ul-check { margin-bottom: 12px; }

.ul-check { list-style: none; padding: 0; }
.ul-check li { position: relative; padding-left: 20px; font-size: 14px; color: var(--ink-2); margin-bottom: 5px; }
.ul-check li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-size: 13px; font-weight: 700;
}

/* ---- FAQ ---- */
.qa { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; background: #fff; }
.qa summary { cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; float: right; color: var(--brand); font-weight: 700; }
.qa[open] summary::after { content: "–"; }
.qa-a { margin-top: 8px; font-size: 14px; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 8px; }

/* ---- 個人頁 ---- */
.profile-head { text-align: center; padding: 6px 0 4px; }
.profile-head .avatar-lg { margin: 0 auto 10px; }
.profile-head h1 { margin-bottom: 4px; }
.profile-firm { font-size: 13.5px; color: var(--ink-3); margin-bottom: 6px; }
.profile-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.profile-cta { display: grid; gap: 10px; margin: 18px 0; }

/* ---- 付款 ---- */
.pay-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.pay-sum { font-size: 14px; color: var(--ink-2); }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px;
  font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; }
.pay-total { font-size: 15px; margin: 6px 0 12px; }
.pay-total b { font-size: 22px; color: var(--brand-dk); }
.pay-note { font-size: 12.5px; color: var(--ink-3); }
.pay-result { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 14px; }
.pay-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
  word-break: break-all; background: #f6f8fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px;
}
.txid-box { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.txid-box h3 { font-size: 15px; }
.pay-note.ok { color: var(--ok); font-weight: 600; }
.qr-wrap { text-align: center; margin: 10px 0; }
.qr-wrap img { width: 190px; height: 190px; border-radius: 12px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: #eef2f8; color: var(--ink-2); }
.status-pill.pending { background: #fff6e5; color: #a86a00; }
.status-pill.paid { background: #e6f6ee; color: #0b7a45; }
.status-pill.failed { background: #fdeaea; color: #a52626; }
.copy-btn { margin-left: 6px; }

/* ---- CTA ---- */
.cta-bar {
  margin: 22px 0 8px; padding: 18px 15px; border-radius: 16px; text-align: center;
  background: linear-gradient(135deg, #0b5cd5, #3d7ff0); color: #fff;
}
.cta-bar p { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.cta-bar .btn-primary { background: #fff; color: var(--brand-dk); box-shadow: none; }
.cta-bar .btn-ghost { background: rgba(255, 255, 255, .18); color: #fff; }
.cta-bar .btn { justify-content: center; }

/* ---- 底部導覽 ---- */
.tabbar {
  position: sticky; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 8px 0 7px; color: var(--ink-3); font-size: 11.5px;
}
.tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--brand); font-weight: 700; }
.tab.is-active svg { stroke-width: 2; }
.tab:hover { text-decoration: none; }

/* ---- AI 客服 ---- */
.fab {
  position: fixed; right: 16px; bottom: calc(72px + var(--safe-b)); z-index: 60;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: linear-gradient(135deg, #0b5cd5, #3f86f5); color: #fff; border: 0;
  border-radius: 999px; padding: 10px 14px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(11, 92, 213, .34);
}
.fab svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fab i { font-style: normal; }

.chat {
  position: fixed; z-index: 70; right: 0; left: 0; bottom: 0; margin: 0 auto;
  width: 100%; max-width: 430px; height: 86vh; background: #fff; border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 34px rgba(15, 25, 50, .22); display: flex; flex-direction: column;
  animation: slideUp .22s ease;
}
.chat[hidden] { display: none !important; }
@keyframes slideUp { from { transform: translateY(16px); opacity: .4; } to { transform: none; opacity: 1; } }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-who { display: flex; align-items: center; gap: 9px; }
.chat-who b { display: block; font-size: 14.5px; }
.chat-who em { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.dot-ai { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(15, 157, 88, .16); }
.dot-human { background: var(--warn); box-shadow: 0 0 0 3px rgba(224, 134, 0, .16); }
.chat-actions { display: flex; align-items: center; gap: 8px; }
.link-btn { background: none; border: 0; color: var(--brand); font-size: 13px; font-weight: 600; cursor: pointer; }
.icon-btn { background: #f1f3f7; border: 0; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color: var(--ink-2); }
.chat-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; background: #f7f9fc; -webkit-overflow-scrolling: touch; }
.msg { display: flex; margin-bottom: 12px; gap: 8px; }
.msg-ai .bubble { background: #fff; border: 1px solid var(--line); }
.msg-user { flex-direction: row-reverse; }
.msg-user .bubble { background: var(--brand); color: #fff; border: 0; }
.msg-agent .bubble { background: #fff8ea; border: 1px solid #f2dfb4; }
.bubble { max-width: 82%; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow); }
.msg small { display: block; font-size: 11px; opacity: .6; margin-top: 4px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; background: var(--ink-3); border-radius: 50%; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid var(--line); }
.chips button { flex: 0 0 auto; background: var(--brand-soft); color: var(--brand-dk); border: 0; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1 1 auto; padding: 11px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: 14.5px; font-family: inherit; }
.chat-input button { background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 0 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chat-input button:disabled { opacity: .5; }
.chat-foot { margin: 0; padding: 0 14px 10px; font-size: 11px; color: var(--ink-3); background: #fff; text-align: center; }
.chat-static { max-height: 300px; overflow-y: auto; padding: 10px; background: #f7f9fc; border-radius: 10px; margin-bottom: 10px; }

/* ---- 客服小卡（付款頁引導） ---- */
.pay-sec .tbl { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
