/* 生活理財懶人包：文章共用樣式（配色與 AI/ 工具頁一致） */
:root {
    --bg: #f4f6fb;
    --paper: #ffffff;
    --text: #1f2a37;
    --muted: #5f6b7a;
    --primary: #4f46e5;
    --primary-soft: rgba(79, 70, 229, 0.08);
    --accent: #0d9488;
    --accent-soft: rgba(13, 148, 136, 0.09);
    --warn: #b45309;
    --warn-soft: #fff7e6;
    --line: #e5e9f0;
    --soft: #f1f5f9;
    --shadow: 0 10px 30px rgba(30, 41, 59, 0.06);
    --font-zh: 'Noto Sans TC', system-ui, sans-serif;
    --font-en: 'Outfit', 'Noto Sans TC', sans-serif;
}
html[data-theme="dark"] {
    --bg: #131826;
    --paper: #1b2234;
    --text: #e6ebf5;
    --muted: #9aa7bd;
    --primary: #8b93fa;
    --primary-soft: rgba(139, 147, 250, 0.12);
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
    --line: #2a3349;
    --soft: #20283b;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-zh); background: var(--bg); color: var(--text); line-height: 1.85; font-size: 17px; }
a { color: var(--primary); }
img { max-width: 100%; }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .brand { font-family: var(--font-en); font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.topbar nav a { flex: none; text-decoration: none; color: var(--muted); font-size: 0.88rem; font-weight: 700; padding: 6px 10px; border-radius: 999px; }
.topbar nav a:hover { background: var(--soft); color: var(--text); }
.theme-toggle { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 0.95rem; }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; }
.crumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--primary); }

article { background: var(--paper); border-radius: 24px; box-shadow: var(--shadow); padding: 34px 34px 40px; }
.hero-img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 16px; margin-bottom: 22px; object-fit: cover; background: var(--soft); }
h1 { font-size: clamp(1.6rem, 4.6vw, 2.1rem); line-height: 1.35; margin: 0 0 10px; font-weight: 900; }
.meta { font-size: 0.84rem; color: var(--muted); margin-bottom: 22px; }
.lead { font-size: 1.05rem; color: var(--text); }

h2 { font-size: 1.35rem; line-height: 1.4; margin: 42px 0 12px; padding-left: 12px; border-left: 5px solid var(--primary); scroll-margin-top: 70px; }
h3 { font-size: 1.1rem; margin: 26px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 1.4em; margin: 0 0 16px; }
li { margin-bottom: 6px; }
strong { color: var(--text); }
.num { font-family: var(--font-en); font-weight: 700; }

.tldr { background: var(--primary-soft); border-radius: 18px; padding: 18px 22px; margin: 22px 0; }
.tldr b.t { display: block; color: var(--primary); margin-bottom: 6px; }
.tldr ul { margin: 0; }

.toc { border: 1px solid var(--line); border-radius: 16px; padding: 14px 20px; margin: 22px 0; font-size: 0.95rem; }
.toc b { display: block; margin-bottom: 4px; }
.toc ol { margin: 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.tbl { overflow-x: auto; margin: 14px 0 20px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--soft); font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.r, th.r { text-align: right; font-family: var(--font-en); font-weight: 600; white-space: nowrap; }
tr.hl td { background: var(--primary-soft); font-weight: 700; }

.note { background: var(--warn-soft); border-radius: 14px; padding: 14px 18px; margin: 18px 0; font-size: 0.95rem; }
.note b:first-child { color: var(--warn); }
.formula { background: var(--soft); border-radius: 14px; padding: 14px 18px; margin: 14px 0 18px; font-family: var(--font-en); font-weight: 600; text-align: center; }

.cta { display: flex; align-items: center; gap: 16px; margin: 28px 0; padding: 18px 20px; border-radius: 18px; background: var(--accent-soft); border: 2px solid var(--accent); text-decoration: none; color: var(--text); transition: transform .15s; }
.cta:hover { transform: translateY(-2px); }
.cta .e { font-size: 2.2rem; flex: none; }
.cta .t { flex: 1; min-width: 0; }
.cta .t b { display: block; font-size: 1.05rem; }
.cta .t span { font-size: 0.88rem; color: var(--muted); }
.cta .go { flex: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem; padding: 9px 14px; border-radius: 12px; white-space: nowrap; }
html[data-theme="dark"] .cta .go { color: #0b1220; }

.faq details { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.faq details p { color: var(--muted); }

.related { margin-top: 30px; }
.related h2 { margin-top: 0; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rel-grid a { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); text-decoration: none; color: var(--text); font-weight: 700; font-size: 0.92rem; line-height: 1.5; border: 1px solid transparent; }
.rel-grid a:hover { border-color: var(--primary); }
.rel-grid a span { font-size: 1.4rem; flex: none; }

.disclaimer { font-size: 0.82rem; color: var(--muted); margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--line); }
footer { text-align: center; font-size: 0.85rem; color: var(--muted); padding: 10px 16px 40px; }
footer a { color: var(--muted); }

/* 懶人包首頁 */
.guide-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.guide-card { display: flex; flex-direction: column; background: var(--paper); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .15s; }
.guide-card:hover { transform: translateY(-3px); }
.guide-card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; display: block; background: var(--soft); }
.guide-card .b { padding: 14px 18px 18px; }
.guide-card h2 { border: none; padding: 0; margin: 0 0 6px; font-size: 1.1rem; }
.guide-card p { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.7; }

@media (max-width: 560px) {
    body { font-size: 16px; }
    article { padding: 22px 18px 28px; border-radius: 18px; }
    .cta { flex-wrap: wrap; }
    .cta .go { width: 100%; text-align: center; }
    .topbar nav a.hide-sm { display: none; }
}
@media print {
    .topbar, .cta, .related, footer, .theme-toggle { display: none !important; }
    article { box-shadow: none; }
}
