:root {
  --bg: #fffaf3;
  --surface: #ffffff;
  --text: #1f1a17;
  --muted: #6b625b;
  --line: #ece3d8;
  --accent: #c2410c;
  --accent-soft: #fde8d7;
  --code-bg: #f5efe7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f;
    --surface: #211b16;
    --text: #f2ebe3;
    --muted: #a99e93;
    --line: #3a3029;
    --accent: #fb923c;
    --accent-soft: #3a2415;
    --code-bg: #2a221c;
  }
}
:root[data-theme="dark"] {
  --bg: #17130f; --surface: #211b16; --text: #f2ebe3; --muted: #a99e93;
  --line: #3a3029; --accent: #fb923c; --accent-soft: #3a2415; --code-bg: #2a221c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
}
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: "Noto Serif TC", serif; font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 4px var(--accent-soft); }
/* 黑色狼頭在深色模式會消失，所以固定白色圓底 */
.logo { width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav a:hover, nav a[aria-current="page"] { color: var(--accent); }

/* hero */
.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), transparent 85%); }
.hero h1 { font-family: "Noto Serif TC", serif; font-size: clamp(30px, 6vw, 48px); line-height: 1.3; margin: 8px 0 16px; }
.product-hero h1 { font-size: clamp(26px, 5vw, 38px); }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .08em; margin: 0; }
.lede { font-size: 18px; color: var(--muted); max-width: 640px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-block; padding: 10px 22px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 500; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.buy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.badge, .tag { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }

/* sections */
.page-head { padding: 48px 16px 8px; }
.page-head h1 { font-family: "Noto Serif TC", serif; font-size: clamp(26px, 5vw, 36px); margin: 6px 0; }
.section-title { font-family: "Noto Serif TC", serif; font-size: 24px; margin: 48px 0 16px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding-top: 40px; padding-bottom: 8px; }
.section-title + .pillars { padding-top: 0; }
.pillars h3 { margin: 0 0 4px; font-size: 18px; }
.pillars p { margin: 0; color: var(--muted); font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; padding-top: 16px; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 10px 0 6px; font-size: 18px; line-height: 1.5; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.card .more { color: var(--accent); font-size: 14px; font-weight: 500; }
.upcoming { color: var(--muted); padding-left: 4.2em; }
.upcoming li { margin: 6px 0; }
.upcoming li::marker { content: "第 " counter(list-item) " 篇　"; }

/* prose */
.prose { max-width: 760px; padding-top: 40px; padding-bottom: 40px; }
.prose h1 { font-family: "Noto Serif TC", serif; font-size: clamp(26px, 5vw, 36px); line-height: 1.4; margin: 6px 0 24px; }
.prose h2 { font-family: "Noto Serif TC", serif; font-size: 24px; margin: 48px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 19px; margin: 32px 0 8px; }
.prose h4 { font-size: 17px; margin: 24px 0 6px; }
.prose hr { display: none; }
.prose blockquote { margin: 20px 0; padding: 12px 18px; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; }
.prose blockquote p { margin: 4px 0; }
.prose code { background: var(--code-bg); padding: 1px 6px; border-radius: 5px; font-size: .9em; font-family: Consolas, "Cascadia Mono", monospace; overflow-wrap: anywhere; }
.prose pre { background: var(--code-bg); padding: 14px 16px; border-radius: 10px; overflow-x: auto; line-height: 1.6; }
.prose pre code { padding: 0; background: none; overflow-wrap: normal; }
.prose pre code.language-text { white-space: pre-wrap; }
.prose a { overflow-wrap: anywhere; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface); }
.prose img { max-width: 100%; }
.faq p strong:first-child { color: var(--accent); }
.back { margin-top: 48px; }

/* 互動元件 */
.small { font-size: 13px; }
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 20; transition: width .1s; }
.theme-btn, .menu-btn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; line-height: 1; }
.menu-btn { display: none; }
nav { align-items: center; }
@media (max-width: 720px) {
  .menu-btn { display: inline-block; }
  .site-header nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 10px; padding: 8px 0 4px; }
  .menu-open .site-header nav { display: flex; }
}
.to-top { position: fixed; right: 16px; bottom: 16px; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 15; }
.to-top.show { opacity: .9; pointer-events: auto; }
.has-sticky-buy .to-top { bottom: 76px; }
.prose pre { position: relative; }
.copy { position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--accent); border-color: var(--accent); }

/* 文章目錄 */
.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 40px; justify-content: center; }
.article-layout .prose { padding-left: 0; padding-right: 0; }
.toc { position: sticky; top: 84px; align-self: start; padding-top: 48px; font-size: 14px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc-title { font-weight: 700; margin: 0 0 8px; }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin: 6px 0; line-height: 1.5; }
.toc-list a { color: var(--muted); text-decoration: none; }
.toc-list a.on, .toc-list a:hover { color: var(--accent); }
.toc-mobile { display: none; margin: 0 0 24px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.toc-mobile summary { cursor: pointer; font-weight: 700; }
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
.back { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.promo { margin: 48px 0 0; padding: 24px; border: 1px solid var(--accent); border-radius: 14px; background: var(--accent-soft); }
.promo h3 { margin: 6px 0; }

.search { display: block; width: 100%; max-width: 480px; margin-top: 20px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.picker button { text-align: left; padding: 16px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s; }
.picker button::after { content: " →"; color: var(--accent); }
.picker button:hover { border-color: var(--accent); }

/* 價格與購買 */
.price { margin: 8px 0; }
.price strong { font-size: 22px; color: var(--accent); }
.price.big strong { font-size: 34px; }
.price s { color: var(--muted); }
.price .per { color: var(--muted); font-size: 14px; }
.countdown { margin: 0 0 12px; font-size: 14px; }
.product-top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
@media (max-width: 820px) { .product-top { grid-template-columns: 1fr; } }
.buy-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.buy-btn { width: 100%; text-align: center; font-size: 17px; padding: 12px 22px; border: none; cursor: pointer; font-family: inherit; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.buy-facts { margin: 14px 0 0; padding-left: 1.2em; color: var(--muted); font-size: 14px; }
/* 掃碼付款（街口／悠遊付／LINE Pay，2026-11-14） */
.pay-qr { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 14px; }
.pay-qr summary { cursor: pointer; font-weight: 600; }
.pay-qr-steps { margin: 10px 0; padding-left: 1.3em; }
.pay-qr-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 200px)); gap: 8px; margin: 12px 0; }
.pay-qr-codes figure { margin: 0; text-align: center; }
.pay-qr-codes img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; border: 1px solid var(--line); box-sizing: border-box; }
.pay-qr-codes figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pay-qr-hint { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; line-height: 1.6; }
.pay-qr .btn { margin-bottom: 8px; }
.buy-again { margin-top: 48px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.buy-again .buy-btn { width: auto; }
.buy-again p { flex-basis: 100%; margin: 0; }
.sticky-buy { display: none; }
@media (max-width: 820px) {
  .sticky-buy { display: block; position: fixed; left: 16px; right: 16px; bottom: 12px; z-index: 14; text-align: center; padding: 12px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
  .has-sticky-buy .site-footer { padding-bottom: 80px; }
}
.product-updates { margin: 0 0 32px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--accent); background: var(--surface); }
.product-updates h2 { margin-top: 0; }
.product-updates p.small { margin-bottom: 0; }
.fit-check { margin: 8px 0 24px; padding: 18px 20px; border-radius: 14px; border: 1px dashed var(--accent); }
.fit-check h3 { margin: 0 0 10px; font-size: 17px; }
.fit-check label { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; font-size: 15px; cursor: pointer; }
.fit-check input { margin-top: 6px; accent-color: var(--accent); }
.fit-result { margin: 10px 0 0; font-weight: 700; color: var(--accent); }
.fit-result.muted { font-weight: 400; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; }
.faq summary::before { content: "＋ "; color: var(--accent); }
.faq details[open] summary::before { content: "－ "; }
.faq details p { margin: 0 0 12px; }

/* 方案 */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; padding-top: 16px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; }
.plan h3 { margin: 4px 0; }
.plan .btn { margin-top: auto; text-align: center; border: none; font: inherit; }
.plan .btn.ghost { border: 1px solid var(--accent); }
.plan.featured { border-color: var(--accent); }
.plan-kind { margin: 0; font-size: 13px; color: var(--accent); font-weight: 700; }
.billing { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 8px 0 0; align-self: flex-start; }
.billing button, .pack { border: none; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.billing button { padding: 4px 14px; border-radius: 999px; font-size: 14px; }
.billing button.on { background: var(--accent); color: #fff; }
.packs { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.pack { padding: 14px 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 18px; font-weight: 700; }
.pack small { display: block; font-size: 12px; color: var(--accent); font-weight: 500; }
.pack.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pack-result { font-weight: 500; }

/* 部落格（2026-11-04） */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
a.chip:hover, button.chip:hover, .chip.on { border-color: var(--accent); color: var(--accent); }
.tag-filter { margin-top: 16px; }
.card .meta, .feature .meta, .post-meta { color: var(--muted); font-size: 13px; }
.post-meta { margin: -12px 0 10px; }
.card.post { display: flex; flex-direction: column; }
.card.post p { flex: 1; }
.feature { display: block; margin-top: 24px; padding: 28px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); color: var(--text); text-decoration: none; transition: border-color .15s; }
.feature:hover { border-color: var(--accent); }
.feature h2 { font-family: "Noto Serif TC", serif; font-size: clamp(22px, 4vw, 30px); line-height: 1.4; margin: 8px 0; }
.feature p { color: var(--muted); margin: 0 0 12px; max-width: 680px; }
.feature .more { color: var(--accent); font-weight: 500; }
.prose .related-title { font-size: 20px; }
.prose .cards { padding-top: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0; font-size: 14px; }
.site-footer p { margin: 4px 0; }

/* 留言版（contact.html，2026-11-06） */
.custom-callout { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 14px; padding: 20px 22px; margin: 20px 0; }
.custom-callout h2 { margin-top: 0; color: var(--accent); }
.custom-callout.home { margin: 8px 0 0; }
.custom-callout.home p { max-width: 720px; }

/* 贊助小框（教學文、部落格結尾，2026-11-12）：比 promo 低調，虛線框 */
.support-box { border: 1px dashed var(--line); border-radius: 14px; padding: 16px 20px; margin: 24px 0; }
.support-box p { margin: 6px 0; }
/* Portaly 商店 QR 推廣框（2026-11-14）：QR 一律白底，深色模式也掃得到 */
.store-box { display: flex; gap: 20px; align-items: center; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; padding: 18px 20px; margin: 24px 0; }
.store-box h2 { margin: 4px 0 8px; font-size: 1.2rem; }
.store-box p { margin: 6px 0; }
.store-qr { flex: none; background: #fff; border-radius: 12px; padding: 8px; line-height: 0; }
.store-qr img { width: 160px; height: 160px; display: block; }
@media (max-width: 600px) { .store-box { flex-direction: column; align-items: flex-start; } .store-qr img { width: 140px; height: 140px; } }
.contact-form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin: 16px 0; }
.contact-form label { display: grid; gap: 6px; font-weight: 500; font-size: 15px; }
.contact-form input, .contact-form select, .contact-form textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; box-sizing: border-box; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form .req { color: var(--accent); }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .small { font-size: 13px; margin: 0; }
.contact-form button { justify-self: start; border: 0; cursor: pointer; font: inherit; }
.form-msg { margin: 0; min-height: 1.5em; }
.form-msg.ok { color: #15803d; font-weight: 500; }
.form-msg.err { color: #b91c1c; font-weight: 500; }
@media (max-width: 720px) { .contact-form .row2 { grid-template-columns: 1fr; } }

/* 語言選單（2026-11-11 多國語言版） */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 15px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--accent); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; min-width: 140px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.lang-list a { padding: 6px 10px; border-radius: 8px; }
.lang-list a:hover, .lang-list a[aria-current] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 720px) { .lang-list { position: static; box-shadow: none; margin-top: 6px; } }
.mt-note { margin-top: 32px; }

/* Email 名單（2026-11-15） */
.sub-box { border: 1px solid var(--line); background: var(--accent-soft); border-radius: 14px; padding: 16px 18px; margin: 0 0 20px; }
.sub-box.big { margin: 28px 0; padding: 22px; }
.sub-box p { margin: 0 0 8px; }
.sub-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; position: relative; }
.sub-form input[type="email"] { flex: 1 1 220px; min-width: 0; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; }
.sub-form input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sub-form .btn { border: none; cursor: pointer; font: inherit; }
.sub-form .btn.ghost { border: 1px solid var(--accent); }
.sub-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sub-msg { min-height: 1.4em; }
.sub-msg.ok { color: #15803d; font-weight: 500; }
.sub-msg.err { color: #b91c1c; font-weight: 500; }
