/* 文章區樣式 — 疊在主站 styles.css 之上
   參考 Apple 新聞稿頁：白底長文、半透明頂端列、大標、17px 內文、灰色圓角磚放行動按鈕。 */
body:has(.article-wrap) { background: var(--page); }
/* 頁面自己的方框（表單、結果、說明框）原本是「白底＋灰框」；
   在白底文章頁改成 Apple 式的無框灰磚，框裡的輸入欄維持白底 */
.article-wrap {
  --surface: var(--tile);
  --surface-2: var(--page);
  --bg: var(--page);
  max-width: 760px;
  margin: 0 auto;
  padding: 0 22px 80px;
}

/* 頂端列：整條毛玻璃，左邊 logo＋品牌，右邊藍色小膠囊 */
.article-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  margin-bottom: 8px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0 0 100vmax var(--nav-bg);
  clip-path: inset(0 -100vmax);
}
.article-top::after {
  content: "";
  position: absolute;
  left: -100vmax;
  right: -100vmax;
  bottom: 0;
  height: 1px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
.article-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
}
.article-brand:hover { text-decoration: none; }
.article-top .to-calc {
  font-size: .8rem;
  font-weight: 500;
  color: #fff;
  background: var(--btn);
  padding: 5px 14px;
  border-radius: var(--pill);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s;
}
.article-top .to-calc:hover { background: var(--btn-hover); text-decoration: none; }

:where(article.post) h1 {
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.01em;
  margin: 44px 0 10px;
  text-wrap: balance;
}
.post-meta {
  font-size: .84rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
:where(article.post) h2 {
  font-size: clamp(1.35rem, 3.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.005em;
  margin: 48px 0 12px;
  text-wrap: balance;
}
:where(article.post) h3 { font-size: 1.15rem; font-weight: 600; margin: 28px 0 8px; }
article.post p, article.post li { line-height: 1.85; color: var(--ink); }
article.post ul, article.post ol { padding-left: 1.3em; }
article.post li { margin: .35rem 0; }
article.post strong { font-weight: 600; }
article.post blockquote {
  margin: 20px 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--border);
  color: var(--ink-soft);
}
article.post table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  line-height: 1.6;
  margin: 18px 0;
}
article.post th, article.post td {
  border-bottom: 1px solid var(--border);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}
article.post thead th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .82rem;
  border-bottom-color: var(--ink-faint);
}
.table-scroll { overflow-x: auto; }

/* CTA 區：灰色圓角磚 */
.post-cta {
  margin: 48px 0 12px;
  background: var(--tile);
  border-radius: var(--radius);
  padding: 28px;
}
.post-cta h2 {
  border: none; margin: 0 0 6px !important; padding: 0;
  font-size: 1.35rem !important; color: var(--ink);
}
.post-cta p { font-size: .94rem !important; color: var(--ink-soft) !important; margin: 0 0 16px; line-height: 1.7; }
.post-cta .btn-line {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; border-radius: var(--pill);
  background: #06C755; color: #fff; font-weight: 600; text-decoration: none;
  margin: 0 0 10px;
}
.post-cta .btn-calc {
  display: flex; align-items: center; justify-content: center;
  height: 50px; border-radius: var(--pill);
  background: var(--btn); color: #fff; font-weight: 600; text-decoration: none;
  transition: background .2s;
}
.post-cta .btn-calc:hover { background: var(--btn-hover); text-decoration: none; }
.post-disclaimer {
  font-size: .78rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* 重點摘要：文章開頭的答案先講區塊 */
.post-summary {
  margin: 0 0 28px;
  padding: 18px 22px;
  background: var(--tile);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
}
.post-summary-title { font-weight: 700; margin: 0 0 6px; color: var(--ink); }
article.post .post-summary ul { margin: 0; }
article.post .post-summary li { line-height: 1.75; }

/* 文章列表頁：細線分隔的清單 */
.article-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 0; }
.article-list li { margin: 0; border-top: 1px solid var(--border); }
.article-list li:last-child { border-bottom: 1px solid var(--border); }
.article-list a {
  display: block;
  padding: 20px 28px 20px 0;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
.article-list a::after {
  content: "›";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--ink-faint);
  transition: color .2s, transform .2s;
}
.article-list a:hover .t { color: var(--brand); }
.article-list a:hover::after { color: var(--brand); transform: translate(2px, -50%); }
.article-list .t { font-weight: 600; font-size: 1.1rem; line-height: 1.45; margin-bottom: 4px; transition: color .2s; }
.article-list .d { font-size: .9rem; color: var(--ink-soft); line-height: 1.65; }

/* ── 相關文章內鏈區 ─────────────────────── */
.related {
  margin: 44px 0 8px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--tile);
}
.article-wrap :is(.ln-box, .lk-box, .of-card, .py-step, .feat .card, .steps, .qbox, .report,
  .dt-form, .dt-out, .gt-form, .gt-out, .rp-form, .rp-report, .tool-form, .tool-result) {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: var(--radius) !important;
}
/* 主站的 form 預設內距是給首頁面板用的；文章頁沒有 class 的外層 form 不要再加一層內距 */
.article-wrap form:not([class]) { padding: 0; }
.article-wrap :is(.tool-form, .dt-form, .gt-form, .rp-form, .qbox) button:not([type="button"]),
.article-wrap :is(.tool-form, .dt-form, .gt-form, .rp-form) button {
  border-radius: var(--pill);
  min-height: 48px;
}
.related h2 {
  border: none;
  margin: 0 0 10px !important;
  padding: 0;
  font-size: 1.1rem !important;
  color: var(--ink);
}
.related h2 + ul + h2 { margin-top: 20px !important; }
.related-list { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 0; }
.related-list li { margin: 0 !important; }
.related-list a {
  display: block;
  font-size: .94rem;
  line-height: 1.55;
  color: var(--brand);
  text-decoration: none;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.related-list li:last-child a { border-bottom: 0; }
.related-list a:hover { text-decoration: underline; }
.related-tools a { font-weight: 600; }
.related-more { margin: 14px 0 0; font-size: .9rem; }
@media print { .related { display: none; } .article-top { position: static; } }

@media (max-width: 520px) {
  .article-wrap { padding: 0 18px 64px; }
  :where(article.post) h1 { margin-top: 30px; }
  .post-cta, .related { padding: 22px 20px; }
  .post-summary { padding: 16px 18px; }
}
