/* ─────────────────────────────────────────────
   土增稅神器 — 線上版樣式
   視覺參考 Apple 官網：#f5f5f7 灰底＋白色圓角磚、黑字大標、藍色膠囊按鈕、半透明毛玻璃導覽列。
   所有頁面共用這組 token（文章、工具頁的內嵌樣式也是用這些變數），深淺色各一組。
   ───────────────────────────────────────────── */

:root {
  --brand: #0071e3;          /* 連結、強調色 */
  --brand-soft: #eaf3fe;     /* 淡藍底 */
  --brand-ink: #0066cc;      /* 淡藍底上的字 */
  --btn: #0071e3;            /* 主要按鈕底色（深色模式也維持這個藍，白字才清楚） */
  --btn-hover: #0077ed;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --fill: #e8e8ed;           /* 次要按鈕、切換鈕軌道 */
  --fill-hover: #dcdce1;
  --thumb: #ffffff;          /* 切換鈕選中的那一格 */
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --border: #d2d2d7;
  --border-strong: #c7c7cc;
  --nav-bg: rgba(250, 250, 252, .8);
  --page: #ffffff;           /* 文章、工具頁的白底 */
  --tile: #f5f5f7;           /* 文章頁上的灰色圓角磚 */

  --success: #248a3d;
  --warn: #bf4800;
  --error: #e30000;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --pill: 980px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .08);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .2);

  --nav-h: 52px;
  --font-sans: "SF Pro TC", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei UI", "Microsoft JhengHei", system-ui, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand: #2997ff; --brand-soft: #0b2440; --brand-ink: #6cb4ff;
  --bg: #000000; --surface: #1d1d1f; --surface-2: #2a2a2d;
  --fill: rgba(118, 118, 128, .28); --fill-hover: rgba(118, 118, 128, .4); --thumb: #636366;
  --ink: #f5f5f7; --ink-soft: #a1a1a6; --ink-faint: #86868b;
  --border: #424245; --border-strong: #5a5a5f;
  --nav-bg: rgba(22, 22, 23, .8);
  --page: #000000; --tile: #1d1d1f;
  --success: #30d158; --warn: #ff9f0a; --error: #ff453a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --brand: #2997ff; --brand-soft: #0b2440; --brand-ink: #6cb4ff;
    --bg: #000000; --surface: #1d1d1f; --surface-2: #2a2a2d;
    --fill: rgba(118, 118, 128, .28); --fill-hover: rgba(118, 118, 128, .4); --thumb: #636366;
    --ink: #f5f5f7; --ink-soft: #a1a1a6; --ink-faint: #86868b;
    --border: #424245; --border-strong: #5a5a5f;
    --nav-bg: rgba(22, 22, 23, .8);
    --page: #000000; --tile: #1d1d1f;
    --success: #30d158; --warn: #ff9f0a; --error: #ff453a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* hidden 一律藏起來：元件的 display:grid/flex 不能蓋過它（2026-10 地址欄曾因此在正式站露出） */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); text-decoration: none; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--btn); }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ── 導覽列（毛玻璃） ────────────────── */
.site-header {
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  position: sticky;
  top: 0;
  z-index: 30;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--nav-h);
}
.brand {
  flex: 1 0 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  min-width: max-content;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; color: var(--ink); flex-shrink: 0; }
.brand-text {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.site-nav {
  display: flex;
  gap: 26px;
}
.site-nav a {
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-size: .8rem;
  letter-spacing: .01em;
  transition: color .2s;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.header-actions { flex: 1 0 0; display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.icon-btn {
  background: transparent;
  border: 0;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  padding: 6px 10px;
  min-height: 32px;
  border-radius: var(--pill);
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--fill); color: var(--ink); }
#btn-member { color: var(--brand); font-weight: 500; }
.icon-btn .icon-sun { display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon { display: none; }
:root[data-theme="dark"] .icon-btn .icon-sun { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-btn .icon-moon { display: none; }
  :root:not([data-theme]) .icon-btn .icon-sun { display: inline; }
}
@media (max-width: 820px) {
  .site-nav { display: none; }
}

/* ── 開場大標（Hero） ─────────────────── */
.page-head {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 0 18px;
}
.hero-eyebrow {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow svg { width: 30px; height: 30px; }
.page-head h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 3.5rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
}
.page-head .hero-sub,
.page-head > p:not(.hero-eyebrow) {
  max-width: 34em;
  margin: 16px auto 0;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: balance;
}
.page-head p strong { color: var(--ink); font-weight: 600; }
.hero-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 26px;
}
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--pill);
  background: var(--btn);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s;
}
.btn-pill:hover { background: var(--btn-hover); text-decoration: none; }
.link-more {
  font-size: 1.0625rem;
  color: var(--brand);
}
.link-more::after { content: " ›"; }
.link-more:hover { text-decoration: underline; }
@media (max-width: 520px) {
  .page-head { padding: 36px 0 8px; }
  .hero-eyebrow { font-size: 1.1rem; }
  .hero-eyebrow svg { width: 26px; height: 26px; }
}

/* ── 主要版面 ──────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding-top: 0;
  padding-bottom: 40px;
  align-items: start;
}
.main-grid .history-panel { grid-column: 1 / -1; }
.main-grid .panel { scroll-margin-top: calc(var(--nav-h) + 76px); }

/* ── 圓角白磚（Panel） ─────────────── */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 28px 32px 6px;
}
.panel-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.005em;
}
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

form {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
#calc-form { padding: 18px 32px 32px; gap: 22px; }

/* ── 欄位 ──────────────────────────── */
.field-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-group legend {
  grid-column: 1 / -1;
  padding: 0;
  margin: 0 0 4px 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field label .unit {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-faint);
  font-size: .76rem;
  margin-left: 4px;
}
.field input[type="number"],
.field input[type="text"],
.field input[type="date"],
.field input[type="tel"],
.field input[type="password"],
.field select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--ink);
  font-size: 1.0625rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  -moz-appearance: textfield;
}
.field input:hover, .field select:hover { border-color: var(--ink-faint); }
.field input::placeholder { color: var(--ink-faint); }
.field input::-webkit-outer-spin-button,
.field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--btn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--btn) 22%, transparent);
}
/* 使用者動過、格式不對才標紅（:user-invalid），空白欄位一打開不會整片紅 */
.field input:user-invalid:not(:focus) {
  border-color: var(--error);
}

/* 下拉選單：拿掉系統外觀，換成細箭頭 */
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  padding-right: 40px !important;
}

/* ── 切換鈕（Segmented control） ────── */
.segmented {
  display: inline-flex;
  background: var(--fill);
  border-radius: var(--radius-sm);
  padding: 3px;
  height: 52px;
  width: 100%;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 500;
  font-size: .94rem;
  color: var(--ink);
  user-select: none;
  transition: background .2s, box-shadow .2s;
}
.segmented input:checked + label {
  background: var(--thumb);
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04);
}
.segmented input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ── 進階選項 ──────────────────────── */
details.advanced {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
details.advanced[open] { padding-bottom: 6px; }
details.advanced summary {
  font-size: .94rem;
  font-weight: 500;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
}
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 8px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s;
}
details.advanced[open] summary::after { transform: translateY(1px) rotate(-135deg); }
details.advanced .field { margin-top: 14px; }

/* ── 按鈕 ───────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
}
.btn-primary {
  background: var(--btn);
  color: #fff;
  border: 0;
  padding: 0 28px;
  height: 50px;
  border-radius: var(--pill);
  font-size: 1.0625rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: .02em;
  transition: background .2s, transform .1s;
  width: 100%;
}
.btn-primary:hover { background: var(--btn-hover); }
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { background: var(--fill); color: var(--ink-faint); cursor: not-allowed; transform: none; }

/* 次要按鈕：灰色膠囊（Apple Store 的「比較」那種） */
.btn-ghost {
  background: var(--fill);
  color: var(--ink);
  border: 0;
  padding: 8px 16px;
  border-radius: var(--pill);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, color .2s;
}
.btn-ghost:hover { background: var(--fill-hover); text-decoration: none; }
.btn-ghost:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
  background: var(--fill);
  opacity: .55;
}
.btn-secondary {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
  padding: 0 20px;
  min-height: 52px;
  border-radius: var(--pill);
  font-size: .94rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-secondary:hover { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn-secondary:disabled { opacity: .5; cursor: not-allowed; }

.form-error {
  background: color-mix(in srgb, var(--error) 9%, var(--surface));
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
}

/* ── 試算結果 ──────────────────────── */
.result-empty {
  padding: 40px 32px 52px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 1rem;
}

#result-body {
  padding: 20px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.result-headline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .result-headline { grid-template-columns: 1fr; }
}
.big-card {
  border-radius: var(--radius);
  padding: 22px 24px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.big-card--self {
  background: var(--brand-soft);
}
.big-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.big-card--self .big-label { color: var(--brand-ink); }
.big-value {
  font-size: clamp(2rem, 4.4vw, 2.6rem);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
  line-height: 1.15;
  word-break: break-all;
}
.big-note {
  font-size: .78rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* 規格表式的明細：細線分隔，不畫框 */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0 28px;
}
@media (max-width: 560px) {
  .meta-grid { grid-template-columns: 1fr 1fr; gap: 0 18px; }
}
.meta-grid > div {
  border-top: 1px solid var(--border);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-grid span {
  font-size: .76rem;
  color: var(--ink-soft);
}
.meta-grid strong {
  font-size: 1.0625rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  word-break: break-all;
}

.breakdown summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--brand);
  padding: 6px 0;
  font-size: .94rem;
  list-style: none;
}
.breakdown summary::-webkit-details-marker { display: none; }
.breakdown summary::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-left: 8px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s;
}
.breakdown[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.breakdown table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: .88rem;
}
.breakdown th, .breakdown td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.breakdown th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .76rem;
}
.breakdown td:last-child, .breakdown th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown tr.highlight td {
  background: var(--brand-soft);
  font-weight: 700;
}
.breakdown .small { color: var(--ink-soft); line-height: 1.6; }

.warnings {
  background: color-mix(in srgb, var(--warn) 9%, var(--surface));
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--ink);
  font-size: .86rem;
}
.warnings ul { margin: 0; padding-left: 18px; }

/* ── 歷史紀錄（設定頁那種細線清單） ─── */
.history-list {
  list-style: none;
  margin: 0;
  padding: 10px 32px 4px;
  display: flex;
  flex-direction: column;
}
.history-list li.item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: .94rem;
}
.history-list li.item:last-child { border-bottom: 0; }
.history-list li.item .hist-meta {
  font-size: .76rem;
  color: var(--ink-soft);
  margin-top: 2px;
}
.history-list li.item .hist-amount {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-list li.item button {
  background: var(--fill);
  border: 0;
  color: var(--ink);
  padding: 5px 12px;
  border-radius: var(--pill);
  cursor: pointer;
  font-size: .76rem;
  font-family: inherit;
}
.history-list li.item button:hover {
  background: var(--fill-hover);
  color: var(--error);
}
.history-list li.history-empty {
  color: var(--ink-faint);
  font-size: .94rem;
  padding: 18px 0;
  text-align: center;
}
.history-panel .small {
  padding: 0 32px 24px;
  color: var(--ink-faint);
  font-size: .76rem;
}

/* ── 說明（常見問題式的展開列） ──────── */
.info-section {
  display: flex;
  flex-direction: column;
  padding-bottom: 48px;
}
.info-block {
  background: transparent;
  border-top: 1px solid var(--border);
  padding: 4px 0;
}
.info-block:last-child { border-bottom: 1px solid var(--border); }
.info-block summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  padding: 18px 36px 18px 0;
  list-style: none;
  position: relative;
}
.info-block summary::-webkit-details-marker { display: none; }
.info-block summary::before,
.info-block summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 14px;
  height: 1.6px;
  background: var(--ink-soft);
  transition: transform .25s;
}
.info-block summary::after { transform: rotate(90deg); }
.info-block[open] summary::after { transform: rotate(0deg); }
.info-block ol {
  margin: 0 0 8px 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.8;
}
.info-block ol li { margin-bottom: 6px; }
.info-block em { font-style: normal; color: var(--brand-ink); }
.info-block .small {
  color: var(--ink-soft);
  font-size: .8rem;
  margin: 8px 0 18px;
}
.legal-text {
  white-space: pre-line;
  font-size: .86rem;
  color: var(--ink-soft);
  line-height: 1.8;
  margin: 0 0 18px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ── 頁尾 ──────────────────────────── */
.site-footer {
  margin-top: auto;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 22px 0 28px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink-soft);
  font-size: .76rem;
  flex-wrap: wrap;
  gap: 10px 24px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 0; }
.footer-links a {
  color: color-mix(in srgb, var(--ink) 75%, transparent);
  padding: 0 10px;
  border-left: 1px solid var(--border);
}
.footer-links a:first-child { border-left: 0; padding-left: 0; }
.footer-links a:hover { color: var(--ink); }

/* ── 對話框 ─────────────────────────── */
.about-dialog {
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  max-width: 500px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
}
.about-dialog::backdrop {
  background: rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.about-dialog article {
  padding: 30px 32px 28px;
}
.about-dialog form { padding: 0; gap: 0; }
.about-dialog h2 { margin: 0 0 12px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.005em; }
.about-dialog p { color: var(--ink-soft); font-size: .94rem; line-height: 1.7; }
.about-dialog .field label { font-size: .82rem; }
/* 沒有指定樣式的對話框按鈕（例如「關閉」）＝主要藍色膠囊 */
:where(.about-dialog) button:not([class]) {
  margin-top: 14px;
  background: var(--btn);
  color: #fff;
  border: 0;
  padding: 10px 24px;
  border-radius: var(--pill);
  cursor: pointer;
  font-size: .94rem;
  font-weight: 500;
  font-family: inherit;
}
:where(.about-dialog) button:not([class]):hover { background: var(--btn-hover); }
.about-dialog .btn-ghost { padding: 10px 20px; font-size: .9rem; }
.about-dialog .btn-primary[style*="height:40px"] { height: 44px !important; }

.small { font-size: .78rem; }

/* ── 分頁切換（置中的膠囊切換鈕，捲動時黏在導覽列下方） ── */
.tabs {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 560px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: color-mix(in srgb, var(--fill) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--pill);
  padding: 4px;
  position: sticky;
  top: calc(var(--nav-h) + 10px);
  z-index: 20;
  margin-bottom: 6px;
}
.tabs .tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--pill);
  cursor: pointer;
  transition: background .2s, box-shadow .2s, color .2s;
  white-space: nowrap;
}
.tabs .tab:hover { color: var(--ink); }
.tabs .tab:not(.active):hover { background: color-mix(in srgb, var(--thumb) 45%, transparent); }
.tabs .tab.active {
  background: var(--thumb);
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04);
}
.tabs .tab svg { flex-shrink: 0; opacity: .75; }

.tab-panel { grid-column: 1 / -1; scroll-margin-top: calc(var(--nav-h) + 70px); }
.tab-manual-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── PDF 匯入 ───────────────────────── */
.pdf-body {
  padding: 18px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pdf-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 20px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  text-align: center;
}
.pdf-drop:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.pdf-drop.drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.pdf-drop strong { font-size: 1.0625rem; font-weight: 600; color: var(--ink); }
.pdf-drop .small { color: var(--ink-soft); max-width: 380px; }

.pdf-status {
  background: var(--brand-soft);
  color: var(--brand-ink);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}
.pdf-beta {
  background: var(--surface-2);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
}
.pdf-beta strong {
  display: block;
  font-size: .94rem;
  margin-bottom: 4px;
  color: var(--warn);
}
.pdf-beta .small {
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 520px) {
  .tabs { padding: 3px; top: calc(var(--nav-h) + 8px); }
  .tabs .tab { padding: 8px 4px; font-size: .82rem; gap: 4px; }
  .tabs .tab svg { width: 15px; height: 15px; }
  .pdf-drop { padding: 30px 14px; }
}

/* ── 地號查詢 ───────────────────────── */
.main-grid .lookup-panel { grid-column: 1 / -1; }
.lookup-body {
  padding: 18px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lookup-body .field-group { gap: 14px; }
.lookup-body select,
.lookup-body input[type="text"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--ink);
  font-size: 1.0625rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.lookup-body select:hover,
.lookup-body input[type="text"]:hover { border-color: var(--ink-faint); }
.lookup-body select:focus,
.lookup-body input:focus {
  outline: none;
  border-color: var(--btn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--btn) 22%, transparent);
}
.section-combo {
  display: flex;
  gap: 8px;
}
.section-combo input { flex: 1; }
.section-combo button { white-space: nowrap; }

.section-hint {
  color: var(--ink-faint);
  font-size: .76rem;
  font-weight: 400;
  margin-left: 4px;
}
.lookup-body select:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.lookup-actions {
  display: flex;
  align-items: center;
  gap: 14px 20px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 4px;
}
.btn-lookup { width: auto; padding: 0 32px; height: 50px; }
.lookup-hint {
  font-size: .8rem;
  color: var(--ink-soft);
  flex: 1 1 260px;
  line-height: 1.6;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  border-radius: var(--pill);
  font-size: .78rem;
  font-weight: 600;
}

.pick-dialog { max-width: 620px; width: calc(100vw - 32px); }
.pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.pick-head h2 { margin: 0; }
.pick-head .icon-btn { width: 32px; height: 32px; padding: 0; justify-content: center; background: var(--fill); }
.pick-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin: 12px 0 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.pick-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  font-size: .9rem;
}
.pick-count {
  font-size: .84rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pick-list li.row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.pick-list li.row.checked {
  border-color: var(--btn);
  box-shadow: 0 0 0 1px var(--btn);
}
.pick-list .row-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  cursor: pointer;
}
.pick-list input[type="checkbox"],
.pick-all-label input[type="checkbox"] {
  margin-top: 3px;
  width: 18px; height: 18px;
  accent-color: var(--btn);
  cursor: pointer;
}
.pick-list .row-body { flex: 1; min-width: 0; }
.pick-list .row-title {
  font-weight: 600;
  font-size: .94rem;
  color: var(--ink);
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.pick-list .row-title .secondary {
  font-size: .76rem;
  font-weight: 400;
  color: var(--ink-soft);
}
.pick-list .pick-meta {
  font-size: .8rem;
  color: var(--ink-soft);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.pick-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}
.pick-submit {
  width: auto;
  padding: 0 24px;
  height: 44px;
}

/* ── 綜合計算結果 ─────────────────── */
.combined-dialog { max-width: 660px; width: calc(100vw - 32px); }
.combined-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
@media (max-width: 560px) {
  .combined-summary { grid-template-columns: 1fr; }
}
#combined-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.combined-row {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .84rem;
}
.combined-row-head {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.combined-row-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.combined-row-grid strong {
  color: var(--ink);
  font-weight: 600;
}

/* ── 會員中心 ─────────────────────── */
.profile-dialog { max-width: 520px; }
.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.profile-head h2 { margin: 0; }
.profile-head .icon-btn { width: 32px; height: 32px; padding: 0; justify-content: center; background: var(--fill); }
.profile-card {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 6px 18px;
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: .94rem;
}
.profile-row:last-child { border-bottom: 0; }
.profile-row span { color: var(--ink-soft); font-size: .84rem; }
.profile-row strong {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
  max-width: 60%;
}
.points-row strong {
  font-size: 1.4rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.profile-action-grid .btn-ghost {
  padding: 11px 14px;
  font-size: .88rem;
}
.btn-danger {
  background: transparent;
  color: var(--error);
  border: 0;
  padding: 10px 14px;
  border-radius: var(--pill);
  font-size: .86rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: color-mix(in srgb, var(--error) 10%, transparent); }

.topup-apps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 16px 0;
}
.topup-apps .btn-primary {
  width: auto;
  padding: 0 22px;
  height: 44px;
  text-decoration: none;
  font-size: .94rem;
}
.topup-apps .btn-primary:hover { text-decoration: none; }

.req { color: var(--error); }

/* ── 歡迎視窗 ─────────────────────── */
.onboard-dialog { max-width: 440px; }
.onboard-dialog article { text-align: center; padding-top: 36px; }
.onboard-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--ink);
}
.onboard-logo svg { width: 64px; height: 64px; }
.onboard-apps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0 10px;
}
.onboard-apps .btn-primary,
.onboard-apps .btn-ghost {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  line-height: 1.3 !important;
  border-radius: var(--pill) !important;
  font-size: .94rem;
}
.onboard-apps .btn-primary:hover, .onboard-apps .btn-ghost:hover { text-decoration: none; }
@media (max-width: 440px) {
  .onboard-apps { grid-template-columns: 1fr; }
}
.app-store-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #000;
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  transition: transform .1s, background .15s;
}
.app-store-btn:hover {
  background: #222;
  text-decoration: none;
}
.app-store-btn:active { transform: scale(.97); }
.app-store-btn div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.app-store-btn small {
  font-size: .6rem;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.app-store-btn strong {
  font-size: 1rem;
  font-weight: 700;
}
.onboard-footer {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.onboard-footer .btn-ghost { background: transparent; color: var(--brand); font-size: .94rem; }
.onboard-footer .btn-ghost:hover { background: transparent; text-decoration: underline; }

/* ── 列印 ───────────────────────────── */
@media print {
  .site-header, .site-footer, .input-panel, .history-panel, .info-section, .panel-actions, .form-actions, .lookup-panel, .page-head, .tabs, .seo-content, #about-dialog, #login-dialog, #pick-dialog, #register-dialog, #forgot-dialog, #profile-dialog, #edit-dialog, #changepw-dialog, #topup-dialog {
    display: none !important;
  }
  body { background: #fff; }
  .panel { box-shadow: none; border: 1px solid #ccc; }
  .main-grid { grid-template-columns: 1fr; }
  .big-value { color: #000 !important; }
}

/* ── 手機 ───────────────────────────── */
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .panel { border-radius: var(--radius); }
  .panel-head { padding: 22px 20px 4px; }
  .panel-head h2 { font-size: 1.3rem; }
  #calc-form, .lookup-body, .pdf-body { padding: 16px 20px 24px; }
  #calc-form { gap: 18px; }
  .field-group { grid-template-columns: 1fr; gap: 14px; }
  #result-body { padding: 16px 20px 24px; }
  .result-empty { padding: 30px 20px 40px; }
  .history-list { padding: 6px 20px 4px; }
  .history-panel .small { padding: 0 20px 20px; }
  .header-actions .icon-btn { padding: 6px 8px; }
  .big-card { padding: 18px 20px; }
  .about-dialog article { padding: 26px 22px 22px; }
  .btn-lookup { width: 100%; }
}

/* ── 試算後：差額＋搶先體驗名單 ─────────── */
#result-hooks {
  display: grid;
  gap: 14px;
  margin: 4px 0 0;
}
.hook-diff {
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 20px 22px;
}
.hook-diff-label {
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.hook-diff-amount {
  font-size: clamp(1.7rem, 3.6vw, 2.1rem);
  font-weight: 700;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  margin: 2px 0;
}
.hook-note {
  font-size: .8rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 4px 0 0;
}
.hook-cta {
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 22px;
}
.hook-cta-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}
.hook-cta form {
  display: grid;
  gap: 14px;
  padding: 12px 0 0;
  background: transparent;
  box-shadow: none;
}
.hook-cta .field input,
.hook-cta .field select {
  background-color: var(--surface);
}
.hook-cta .btn-primary { width: 100%; }
.hook-legal {
  font-size: .74rem;
  color: var(--ink-faint);
  line-height: 1.6;
  margin: 0;
}
.btn-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  margin-top: 14px;
  border-radius: var(--pill);
  background: #06C755;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: filter .2s;
}
.btn-line:hover { filter: brightness(1.06); text-decoration: none; }
.hook-or {
  font-size: .8rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 12px 0 0;
}
.hook-success {
  padding: 8px 2px 2px;
  color: var(--success);
}
.hook-success .hook-note { color: var(--ink-soft); }
@media print {
  #result-hooks { display: none; }
}

/* ── SEO 內容區（整條白底，閱讀寬度） ─────────────── */
.seo-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 22px 72px;
  line-height: 1.85;
  background: var(--surface);
  box-shadow: 0 0 0 100vmax var(--surface);
  clip-path: inset(0 -100vmax);
}
.seo-content h2 {
  text-wrap: balance;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.005em;
  margin: 52px 0 12px;
  color: var(--ink);
}
.seo-content h2:first-of-type { margin-top: 0; }
.seo-content h3 { font-size: 1.1rem; font-weight: 600; margin: 24px 0 6px; color: var(--ink); }
.seo-content p, .seo-content li { color: var(--ink); font-size: 1.0625rem; }
.seo-content ul, .seo-content ol { padding-left: 1.3em; }
.seo-content li { margin: .45rem 0; }
.seo-content a { color: var(--brand); }
.table-scroll { overflow-x: auto; }
.seo-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 14px 0; line-height: 1.6; }
.seo-table th, .seo-table td { border-bottom: 1px solid var(--border); padding: 11px 10px; text-align: left; vertical-align: top; }
.seo-table thead th { color: var(--ink-soft); font-weight: 600; font-size: .8rem; border-bottom-color: var(--ink-faint); }
.seo-links { list-style: none; padding-left: 0 !important; }
.seo-links li { margin: .6rem 0; font-weight: 500; }
.seo-faq h3 { font-weight: 600; }
.seo-content .small { font-size: .78rem; color: var(--ink-soft); margin-top: 32px; line-height: 1.7; }

/* ── 其他稅務試算：工具磚 ── */
.tool-strip-wrap { max-width: 1040px; margin: 0 auto; padding: 8px 22px 64px; }
.tool-strip-title {
  text-wrap: balance;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
  margin: 8px 0 30px;
}
.tool-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 880px) { .tool-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tool-strip { grid-template-columns: 1fr; gap: 12px; } }
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 24px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: box-shadow .3s, transform .3s;
}
.tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.tool-card .tc-ico {
  display: inline-flex;
  width: 30px; height: 30px;
  color: var(--brand);
  margin-bottom: 10px;
  font-size: 1.5rem;
  line-height: 1;
}
.tool-card .tc-ico svg { width: 30px; height: 30px; }
.tool-card strong { font-size: 1.0625rem; color: var(--ink); font-weight: 700; }
.tool-card span:not(.tc-ico) { font-size: .86rem; color: var(--ink-soft); line-height: 1.6; }
.tool-card::after {
  content: "›";
  position: absolute;
  right: 20px;
  top: 22px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-faint);
  transition: color .2s, transform .2s;
}
.tool-card:hover::after { color: var(--brand); transform: translateX(2px); }
@media print { .tool-strip-wrap { display: none; } }

/* 主打工具卡：賣房稅務總報告（橘色小標，像 Apple 的「新功能」） */
.tool-card-hero::before {
  content: "整合試算";
  order: -1;
  font-size: .76rem;
  font-weight: 600;
  color: var(--warn);
  margin-bottom: -4px;
}
.tool-card-hero { grid-column: span 1; }

/* ── 表單欄位字級下限 ─────────────────────────────
   iOS Safari 在 input 字級 < 16px 時，使用者一點擊就會自動放大整個頁面，
   版面跟著跑掉，在付款與名單表單上直接殺掉轉換。
   設為全域預設，避免個別頁面再度遺漏；頁面內嵌樣式仍可覆蓋（但不得低於 16px）。 */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  font-size: 16px;
}
.field input[type="number"], .field input[type="text"], .field input[type="date"],
.field input[type="tel"], .field input[type="password"], .field select,
.lookup-body select, .lookup-body input[type="text"] { font-size: 1.0625rem; }

/* 地號查詢：用門牌點選（路 → 段 → 號／巷 → 樓） */
.lookup-mode { display: inline-flex; gap: 2px; padding: 2px; margin: 4px 0 14px; border-radius: var(--pill); background: var(--fill); }
.lookup-mode button { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .94rem; font-weight: 600;
  padding: 8px 18px; border-radius: var(--pill); cursor: pointer; }
.lookup-mode button[aria-checked="true"] { background: var(--thumb); box-shadow: var(--shadow-sm); }
.door-picker { margin-bottom: 8px; }
.door-crumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-soft); min-height: 32px; }
.door-back { border: 0; background: var(--fill); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 600;
  padding: 6px 14px; border-radius: var(--pill); cursor: pointer; }
.door-back:hover { background: var(--fill-hover); }
.door-ask { margin: 8px 0 10px; font-weight: 600; font-size: 1.02rem; }
.door-ask.warn { color: var(--warn); font-size: .95rem; }
.door-filter { width: 100%; margin-bottom: 10px; }
.door-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px;
  max-height: 340px; overflow-y: auto; padding: 2px; }
.door-options.loading { opacity: .45; pointer-events: none; }
.door-opt { border: 0; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font: inherit;
  font-size: .94rem; font-weight: 600; padding: 10px 8px; cursor: pointer; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.door-opt:hover { filter: brightness(.96); }
.door-empty { grid-column: 1 / -1; color: var(--ink-soft); margin: 4px 0; }
.door-picked { background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px; }
.door-picked-where { margin: 0; font-size: 1.15rem; font-weight: 700; }
.door-picked-sub { margin: 2px 0 12px; color: var(--ink-soft); font-size: .86rem; }
.door-steps { list-style: none; margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); }
.door-steps .step { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: .92rem; color: var(--ink-faint); }
.door-steps .step.run, .door-steps .step.ok, .door-steps .step.warn, .door-steps .step.fail { color: var(--ink); }
.step-icon { flex: 0 0 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; border: 1.5px solid var(--border-strong); color: var(--ink-faint); }
.step.ok .step-icon { background: var(--success); border-color: var(--success); color: #fff; }
.step.warn .step-icon { background: var(--warn); border-color: var(--warn); color: #fff; }
.step.fail .step-icon { background: var(--error); border-color: var(--error); color: #fff; }
.step.run .step-icon { border-color: var(--brand); border-top-color: transparent; animation: step-spin .8s linear infinite; }
.step-text { display: flex; flex-direction: column; }
.step-label { font-weight: 600; }
.step.ok .step-label { color: var(--ink); }
.step-note { font-size: .8rem; color: var(--ink-soft); }
@keyframes step-spin { to { transform: rotate(360deg); } }
.addr-result { margin-top: 12px; font-size: .94rem; line-height: 1.7; }

/* 文章、工具頁頂端的品牌字前面放 logo（用 mask，深淺色都跟著字色走） */
.article-brand::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("logo-mark.svg") center / contain no-repeat;
  mask: url("logo-mark.svg") center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ── 下載 App（地號查詢要付費，現階段先引導下載 App；負責人 2026-10-19） ── */
.app-band { max-width: 1040px; margin: 0 auto; padding: 8px 22px 64px; text-align: center; }
.app-band-title { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 700; letter-spacing: -.01em; line-height: 1.2;
  margin: 8px 0 12px; text-wrap: balance; }
.app-band-sub { max-width: 36em; margin: 0 auto; color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.6; text-wrap: balance; }
.app-band-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 24px 0 14px; }
.app-band-note { color: var(--ink-soft); font-size: .86rem; margin: 0; }
.btn-store { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: var(--pill); background: var(--ink); color: var(--surface); font-weight: 600; font-size: 1rem;
  text-decoration: none; transition: opacity .2s; }
.btn-store:hover { opacity: .85; text-decoration: none; }
.topup-apps .btn-store { min-height: 44px; font-size: .94rem; }
@media print { .app-band { display: none; } }

/* ── 地址 → 這一戶的土地增值稅 ── */
.field-group.addr-row { grid-template-columns: 1fr; }
.unit-result { background: var(--surface-2); border-radius: var(--radius); padding: 18px 20px; margin-top: 6px; }
.unit-title { font-weight: 700; font-size: 1.1rem; margin: 0 0 2px; }
.unit-title span { margin-left: 8px; font-size: .76rem; font-weight: 600; color: var(--ink-soft); }
.unit-where { margin: 0 0 12px; color: var(--ink-soft); font-size: .9rem; }
.unit-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.unit-totals div { background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; }
.unit-totals span { display: block; font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.unit-totals strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.unit-lines { list-style: none; padding: 0; margin: 0 0 10px; font-size: .86rem; line-height: 1.6; }
.unit-lines li { padding: 6px 0; border-top: 1px solid var(--border); }
.unit-lines li.bad { color: var(--warn); }
.unit-note { margin: 4px 0 0; font-size: .78rem; color: var(--ink-soft); }
.unit-warn { margin: 6px 0 0; font-size: .82rem; color: var(--warn); }
@media (max-width: 520px) { .unit-totals { grid-template-columns: 1fr; } }

/* 首頁：熱門稅務文章（SEO：首頁連到重點文章） */
.popular-reads { margin-top: 48px; }
.popular-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.popular-list a { display: block; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  text-decoration: none; font-weight: 600; font-size: .95rem; line-height: 1.5; box-shadow: var(--shadow-sm); }
.popular-list a:hover { color: var(--brand); }
.popular-more { margin: 14px 0 0; }

/* 點選門牌：網站免費次數、到 LINE 的鈕 */
.door-free { margin: -4px 0 10px; font-size: .84rem; color: var(--ink-soft); }
.door-line-btn { display: inline-block; margin-top: 8px; padding: 8px 18px; border-radius: var(--pill); background: #06c755;
  color: #fff !important; font-weight: 700; text-decoration: none; }

/* 算一戶：附上的謄本資料 */
.unit-deeds { background: var(--surface-2); border-radius: var(--radius); padding: 18px 20px; margin-top: 12px; }
.unit-deed { border-top: 1px solid var(--border); padding: 10px 0; }
.unit-deed summary { cursor: pointer; font-weight: 700; font-size: .95rem; }
.deed-h { margin: 12px 0 4px; font-weight: 700; font-size: .86rem; color: var(--ink-soft); }
.deed-party { margin: 10px 0 2px; font-weight: 600; font-size: .86rem; }
.deed-tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.deed-tbl th { text-align: left; font-weight: 500; color: var(--ink-soft); width: 34%; padding: 5px 8px 5px 0; vertical-align: top; }
.deed-tbl td { padding: 5px 0; border-bottom: 1px solid var(--border); word-break: break-word; }

/* 點選門牌：巷弄／號碼分區、查之前的費用說明 */
.door-group { grid-column: 1 / -1; margin: 8px 0 0; font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.door-charge { margin: 0 0 12px; font-size: .9rem; line-height: 1.6; }

/* 在地圖上點你家 */
.door-map-link { margin: 14px 0 0; }
.door-map-btn { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 0; }
.door-map { margin-top: 14px; }
.door-map-tip { margin: 0 0 8px; font-size: .9rem; }
.door-map-canvas { height: 360px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.door-map-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.door-map-result { background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 8px; }
.door-map-result .btn-primary { margin-right: 8px; }

/* 謄本照地政事務所第二類謄本的樣子（負責人 2026-10-20） */
.unit-deed summary span { display: block; font-weight: 500; font-size: .84rem; color: var(--ink-soft); margin-top: 2px; }
.deed-paper { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 18px 20px 14px; margin: 10px 0 6px; font-family: "PMingLiU", "MingLiU", "Noto Serif TC", "Songti TC", serif;
  font-size: .88rem; line-height: 1.65; }
.deed-paper p { margin: 0; }
.deed-title { text-align: center; font-size: 1.12rem; font-weight: 700; letter-spacing: .08em; }
.deed-where { text-align: center; font-size: .95rem; margin-top: 2px !important; }
.deed-meta { text-align: center; font-size: .78rem; color: var(--ink-soft); margin-top: 6px !important; }
.deed-meta span { margin-left: 1em; }
.deed-stamp { text-align: center; font-size: .78rem; color: #b42318; margin-top: 2px !important; }
.deed-banner { text-align: center; font-weight: 700; margin: 14px 0 6px !important; }
.deed-order { font-weight: 700; margin: 10px 0 2px !important; border-top: 1px dashed var(--border); padding-top: 8px; }
.deed-banner + .deed-order { border-top: 0; padding-top: 0; }
.deed-empty { color: var(--ink-soft); }
.deed-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.deed-grid .dr { display: flex; min-width: 0; }
.deed-grid .dr.w { grid-column: 1 / -1; }
.deed-grid .dk { flex: none; color: var(--ink); }
.deed-grid .dv { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .deed-paper { padding: 14px 12px 10px; font-size: .84rem; }
  .deed-grid { grid-template-columns: 1fr; }
  .deed-banner .x { display: none; }
  .deed-title { font-size: .9rem; letter-spacing: 0; }
  .deed-grid .dr { display: block; }
}

/* 地圖套疊地籍圖 */
.door-map-wrap { position: relative; }
.door-map-zoom { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 500; margin: 0;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: .82rem; padding: 5px 12px; border-radius: 999px; pointer-events: none; }

/* 網站付費（LINE Pay，2026-10-22） */
.door-pay { margin-top: 12px; }
.door-pay-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; background: #06c755; }
.door-pay-btn:hover { text-decoration: none; filter: brightness(1.05); }
