/* FulyAI 部落格：沿用 news.fuly.ai「Newsroom」樣板的設計（白底黑字、細線分隔、單一重點色新聞紅、思源黑體）。
   深色模式預設跟著系統；讀者按切換鈕後以 <html data-theme> 為準（記在 localStorage）。先寫手機，960px 以上換網頁版。 */
:root {
  color-scheme: light;
  --p-bg: #ffffff; --p-soft: #f5f5f3; --p-fg: #141414; --p-fg2: #2e2e2e; --p-muted: #5c6066; --p-faint: #878b92;
  --p-rule: #e3e3e3; --p-accent: #c8102e; --p-link: #0b57a4;
  --p-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, sans-serif;
}
.lang-zh-cn { --p-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif; }
.lang-en { --p-font: "Noto Sans", -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --p-bg: #111214; --p-soft: #1b1c1f; --p-fg: #ececec; --p-fg2: #d4d4d4; --p-muted: #a4a8ae; --p-faint: #82878e;
  --p-rule: #2b2d31; --p-accent: #ff5a5f; --p-link: #7cb4ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --p-bg: #111214; --p-soft: #1b1c1f; --p-fg: #ececec; --p-fg2: #d4d4d4; --p-muted: #a4a8ae; --p-faint: #82878e;
    --p-rule: #2b2d31; --p-accent: #ff5a5f; --p-link: #7cb4ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--p-bg); color: var(--p-fg); font: 17px/1.85 var(--p-font); letter-spacing: .02em; -webkit-font-smoothing: antialiased; }
/* 內容很短時頁尾也貼在視窗底部 */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.lang-en { letter-spacing: 0; line-height: 1.75; }
a { color: var(--p-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
/* hidden 屬性一定要藏起來（不然會被 .b-btn 之類的 display 蓋過） */
[hidden] { display: none !important; }

/* 刊頭列 */
.b-top { position: sticky; top: 0; z-index: 30; background: var(--p-bg); border-bottom: 1px solid var(--p-rule); }
.b-top-in { max-width: 1200px; margin: 0 auto; padding: 0 18px; height: 54px; display: flex; align-items: center; gap: 16px; }
.b-logo { font-size: 20px; font-weight: 900; color: var(--p-fg); letter-spacing: .04em; white-space: nowrap; }
.b-logo:hover { text-decoration: none; color: var(--p-fg); }
.b-logo::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; background: var(--p-accent); vertical-align: 2px; }
.b-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 語系選單 */
.b-lang { position: relative; font-size: 14px; font-weight: 700; }
.b-lang summary { list-style: none; cursor: pointer; height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  border: 1px solid var(--p-rule); border-radius: 999px; color: var(--p-muted); white-space: nowrap; }
.b-lang summary::-webkit-details-marker { display: none; }
.b-lang summary::before { content: "文A"; font-size: 12px; letter-spacing: 0; }
.b-lang summary:hover, .b-lang[open] summary { color: var(--p-fg); border-color: var(--p-fg); }
.b-lang ul { position: absolute; right: 0; top: 40px; margin: 0; padding: 6px 0; list-style: none; min-width: 140px;
  background: var(--p-bg); border: 1px solid var(--p-rule); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.b-lang li a { display: block; padding: 6px 16px; color: var(--p-fg2); }
.b-lang li a:hover { background: var(--p-soft); text-decoration: none; }
.b-lang li a[aria-current] { color: var(--p-accent); }

.b-theme { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--p-rule); border-radius: 50%;
  background: transparent; color: var(--p-muted); font: inherit; font-size: 16px; cursor: pointer; }
.b-theme:hover { color: var(--p-fg); border-color: var(--p-fg); }
.b-theme::before { content: "☾"; }
:root[data-theme="dark"] .b-theme::before { content: "☀"; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .b-theme::before { content: "☀"; } }

@media (max-width: 420px) {
  .b-top-in { gap: 8px; padding: 0 12px; }
  .b-logo { font-size: 16px; letter-spacing: 0; }
  .b-lang summary { padding: 0 9px; font-size: 13px; }
  .b-theme { width: 32px; height: 32px; }
}

.b-main { flex: 1 0 auto; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 18px 48px; }

/* 首頁 */
.b-mast { text-align: center; padding: 34px 0 18px; border-bottom: 1px solid var(--p-rule); }
.b-mast h1 { font-size: 36px; font-weight: 900; line-height: 1.25; margin: 0 0 6px; letter-spacing: .06em; }
.b-mast p { margin: 0; font-size: 15px; color: var(--p-muted); }
.b-lead { padding: 24px 0 22px; border-bottom: 1px solid var(--p-rule); }
.b-lead .b-thumb { display: block; margin: 0 -18px 16px; }
.b-lead .b-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.b-lead h2 { font-size: 28px; font-weight: 900; line-height: 1.4; margin: 0 0 10px; }
.b-lead h2 a, .b-card h3 a { color: var(--p-fg); }
.b-lead h2 a:hover, .b-card h3 a:hover { color: var(--p-accent); text-decoration: none; }
.b-empty { text-align: center; color: var(--p-faint); padding: 60px 0; }

/* 文章列 */
.b-card { padding: 20px 0; border-bottom: 1px solid var(--p-rule); }
.b-card.has-img { display: grid; grid-template-columns: minmax(0, 1fr) 104px; column-gap: 14px; align-items: start; }
.b-card.has-img .b-thumb { order: 2; }
.b-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--p-soft); }
.b-card h3 { font-size: 20px; font-weight: 700; line-height: 1.5; margin: 0 0 6px; }
.b-sum { margin: 0 0 8px; font-size: 15px; line-height: 1.75; color: var(--p-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.b-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; font-size: 13px; color: var(--p-faint); }
.b-badge { display: inline-block; padding: 0 8px; border-radius: 3px; background: var(--p-accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; letter-spacing: .04em; }
/* 列表上完整顯示預覽（含格式與圖片） */
.b-card-preview { margin: 0 0 10px; font-size: 15px; line-height: 1.8; color: var(--p-fg2); overflow-wrap: anywhere; }
.b-card-preview > :first-child { margin-top: 0; }
.b-card-preview p, .b-card-preview ul, .b-card-preview ol, .b-card-preview blockquote { margin: 0 0 .8em; }
.b-card-preview ul, .b-card-preview ol { padding-left: 1.3em; }
.b-card-preview h2, .b-card-preview h3 { font-size: 16px; font-weight: 700; margin: 12px 0 6px; color: var(--p-fg); }
.b-card-preview img { display: block; margin: 10px 0; border-radius: 4px; }
.b-card-preview blockquote { padding-left: 12px; border-left: 3px solid var(--p-accent); color: var(--p-muted); }
.b-card-preview a { text-decoration: underline; text-underline-offset: 3px; }
.b-lead .b-card-preview { font-size: 16px; }
.b-pager { display: flex; justify-content: space-between; padding: 24px 0 0; font-weight: 700; }

/* 文章頁 */
.b-head { padding: 34px 0 20px; border-bottom: 1px solid var(--p-rule); }
.b-head h1 { font-size: 32px; font-weight: 900; line-height: 1.4; margin: 0 0 14px; }
.b-body { padding-top: 8px; font-size: 18px; line-height: 1.9; color: var(--p-fg2); overflow-wrap: anywhere; }
.lang-en .b-body { line-height: 1.75; }
.b-body h2 { font-size: 24px; font-weight: 900; line-height: 1.45; margin: 40px 0 12px; color: var(--p-fg); }
.b-body h3 { font-size: 20px; font-weight: 700; line-height: 1.5; margin: 32px 0 10px; color: var(--p-fg); }
.b-body p { margin: 0 0 1.2em; }
.b-body img { display: block; margin: 24px auto; border-radius: 4px; }
.b-body figure { margin: 24px 0; }
.b-body figcaption { font-size: 14px; color: var(--p-faint); text-align: center; }
.b-body a { text-decoration: underline; text-underline-offset: 3px; }
.b-body blockquote { margin: 24px 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--p-accent); color: var(--p-muted); }
.b-body ul, .b-body ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.b-body li { margin: .3em 0; }
.b-body hr { border: 0; border-top: 1px solid var(--p-rule); margin: 36px 0; }
.b-body code { font: .9em/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--p-soft); padding: .1em .35em; border-radius: 3px; }
.b-body pre { background: var(--p-soft); padding: 14px 16px; border-radius: 6px; overflow-x: auto; }
.b-body pre code { background: none; padding: 0; }
.b-body table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.b-body th, .b-body td { border: 1px solid var(--p-rule); padding: 8px 10px; text-align: left; }

/* 會員／付費內容 */
.b-gate { margin: 28px 0; }
.b-gate-box { padding: 28px 22px; border: 1px solid var(--p-rule); border-top: 3px solid var(--p-accent); background: var(--p-soft); text-align: center; border-radius: 4px; }
.b-gate-msg { margin: 0 0 18px; font-size: 17px; font-weight: 700; color: var(--p-fg); }
.b-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; }
.b-gate.loading .b-gate-actions { visibility: hidden; }
.b-btn { display: inline-flex; align-items: center; height: 42px; padding: 0 22px; border-radius: 999px; font-size: 15px; font-weight: 700; border: 1px solid var(--p-accent); color: var(--p-accent); }
.b-btn:hover { text-decoration: none; background: var(--p-accent); color: #fff; }
.b-sub { background: var(--p-accent); color: #fff; }

.b-more { margin-top: 48px; }
.b-sec-title { font-size: 15px; font-weight: 900; letter-spacing: .08em; margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--p-fg); }
.b-all { margin: 18px 0 0; font-weight: 700; }

.b-foot { border-top: 1px solid var(--p-rule); background: var(--p-soft); }
.b-foot-in { max-width: 1200px; margin: 0 auto; padding: 24px 18px 32px; }
.b-404 { text-align: center; padding-top: 80px; }

/* 桌機 */
@media (min-width: 960px) {
  .b-main { max-width: 1040px; }
  .b-article { max-width: 720px; margin: 0 auto; }
  .b-more { max-width: 720px; margin-left: auto; margin-right: auto; }
  .b-mast { padding: 48px 0 24px; }
  .b-mast h1 { font-size: 46px; }
  .b-lead.has-img { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: center; padding: 32px 0; }
  .b-lead .b-thumb { margin: 0; }
  .b-lead .b-thumb img { border-radius: 4px; }
  .b-lead h2 { font-size: 32px; }
  .b-home .b-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .b-card.has-img { grid-template-columns: minmax(0, 1fr) 128px; column-gap: 18px; }
  .b-head h1 { font-size: 38px; }
}
