/* ============================================================
   融合版全域樣式
   - 視覺取自 A Quiet Publication theme（暖色紙本 / 安靜編輯風）
   - 保留原專案的 header / 按鈕 / 表單 / 卡片功能性樣式
   ============================================================ */

/* ---------- Theme 配色變數（暖色紙本 + dark mode） ---------- */
:root {
  --paper: #f6f5f0;
  --ink: #191918;
  --muted: #77766f;
  --line: #d8d6cc;
  --accent: #b0472e;   /* 磚紅 */
  --btn-bg: #9c3b25;   /* 深磚紅：按鈕底色，白字清晰 */
  --soft: #e9e7de;
  --card: #ffffff;
  --icon-size-sm: 1rem;
  --icon-size-md: 1.2rem;
  --icon-size-lg: 1.5rem;
}
:root[data-theme='dark'] {
  --paper: #1b1b19;
  --ink: #eeeae0;
  --muted: #aaa79b;
  --line: #3d3c36;
  --accent: #ee8969;
  --btn-bg: #b8472e;   /* 深磚紅：按鈕底色，白字清晰 */
  --soft: #2a2a26;
  --card: #232320;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #1b1b19; --ink: #eeeae0; --muted: #aaa79b;
    --line: #3d3c36; --accent: #ee8969; --btn-bg: #b8472e; --soft: #2a2a26; --card: #232320;
  }
}

/* ---------- 字級切換（小/中/大/特）：用 % 縮 root font-size，乘在瀏覽器預設字級上（不覆蓋使用者設定） ----------
   中=預設（不設 root，維持瀏覽器預設＝現狀）；小=90%；大=110%；特=120%
   站內 84 個 font-size 有 83 個用 rem/em 會自動縮；body 由 17px 改 1.0625rem 讓它也縮。 */
:root[data-fs='sm'] { font-size: 90%; }
:root[data-fs='lg'] { font-size: 110%; }
:root[data-fs='xl'] { font-size: 120%; }

/* ---------- 基礎（來自 theme global.css） ---------- */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* font-family 聲明在 html（:root）：讓 rem 跟著使用者的「襯線字級」設定走，與 body 的字型歸類一致 */
  font-family: 'Iowan Old Style', 'Noto Serif TC', Georgia, 'Microsoft JhengHei', serif;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem; /* =17px@16px root；改 rem 讓它隨「字級切換」縮放 */
  line-height: 1.7;
}
a { color: inherit; text-underline-offset: 0.18em; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- 容器 ---------- */
.container { width: min(100% - 2rem, 48rem); margin: 0 auto; padding: 1.5rem 0; }
.wide { width: min(100% - 2rem, 72rem); margin: 0 auto; padding: 1.5rem 1rem; }
.narrow { width: min(100% - 2rem, 40rem); margin: 0 auto; }

/* ---------- 跳過連結 ---------- */
.skip-link { position: absolute; left: 1rem; top: -5rem; padding: .5rem .75rem; background: var(--ink); color: var(--paper); z-index: 10; }
.skip-link:focus { top: 1rem; }

/* 通用提示框（深淺色皆讀得下：soft 底＋accent 左框，慣例同 xs-tagline） */
.notice { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 6px; margin: 0 0 16px; }

/* ---------- 小標 / 分節（來自 theme） ---------- */
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font: 700 .75rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- 大字形標題（學 astro-fourfold：襯線大字、緊字距、低行高） ---------- */
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: .98; letter-spacing: -.05em; font-weight: 500; margin: .5rem 0 1.5rem; }
.hero-wide { display: block; width: 100%; height: clamp(140px, 22vw, 190px); object-fit: cover; object-position: center 20%; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.12); margin: 0 0 1.75rem; }
h1.hero { font-size: clamp(3rem, 9vw, 6.5rem); line-height: .95; letter-spacing: -.05em; margin: .5rem 0 1.5rem; }
article h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.05; letter-spacing: -.04em; margin: .5rem 0 1.2rem; }
.lede { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--muted); max-width: 48rem; line-height: 1.5; margin: 0 0 2rem; }
.slogan { font-size: clamp(1.35rem, 3vw, 2.1rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.35; max-width: 42rem; margin: 0 0 1.75rem; }
.hl { color: var(--accent); font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-top: 1px solid var(--line); padding-top: .9rem; margin-top: 4rem; }
.section-heading h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.8rem); letter-spacing: -.04em; }
.section-heading a { color: var(--muted); font-size: .9rem; }

/* ---------- 列表項（分類 / 文章列表，來自 theme） ---------- */
.list { border-top: 1px solid var(--line); }
.list-item { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.list-item h3 { margin: 0 0 .25rem; font-size: 1.2rem; letter-spacing: -.02em; }
.list-item p { margin: .2rem 0 0; color: var(--muted); }
.meta { color: var(--muted); font-size: .82rem; }
.cat-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.cat-list li { border-bottom: 1px solid var(--line); }
.cat-list a { display: block; padding: 1rem 0; font-size: 1.25rem; letter-spacing: -.02em; }
.cat-list a:hover { color: var(--accent); text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }
.tag { color: var(--accent); font-size: .8rem; }
@media (max-width: 40rem) { .list-item { grid-template-columns: 1fr; gap: .2rem; } .section-heading { margin-top: 2.5rem; } }
/* 首頁「最新台股盤後解盤」：比一般分類頁更密集（僅作用於首頁清單） */
.home-recent .list-item { padding: .65rem 0; }
.home-recent .list-item h3 { margin-bottom: 0; }
.home-recent .list-item .meta { font-size: .78rem; }
/* 後台用戶明細工具列 */
/* 後台用戶明細工具列（分段顯示＋搜尋） */
.user-toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 .75rem; }
.user-search-input { max-width: 22rem; }
.user-more-wrap { margin: .5rem 0; }

/* 首頁「新」徽章（新文章標記；判定由 index.astro inline script 依 Asia/Taipei） */
.badge-new {
  display: inline-block;
  margin-right: .5em;
  padding: .08em .55em;
  font-size: .7em; font-weight: 700;
  letter-spacing: .02em; line-height: 1.5;
  /* 底色用 --btn-bg（深砖红）而非 --accent：dark mode 的 accent 是浅色，白字会看不清（与「登出」按钮同作法） */
  color: #fff; background: var(--btn-bg);
  border-radius: 999px;
  vertical-align: .12em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

/* ---------- 文章排版（來自 theme prose.css） ---------- */
.prose { font-size: 1.08rem; }
.prose h2 { margin-top: 3rem; font-size: 1.8rem; letter-spacing: -.04em; }
.prose h3 { margin-top: 2rem; font-size: 1.35rem; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 1.2rem 0; }
.prose blockquote { margin-left: 0; padding: .25rem 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
/* 核心結論 callout：先用「先講結論」強調框，左色條＋淡底，突出整篇靈魂句 */
.prose .key-point {
  border-left: 4px solid var(--accent);
  background: var(--soft);
  background: color-mix(in srgb, var(--accent) 9%, var(--paper));
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
  border-radius: 0 10px 10px 0;
  font-size: 1.12rem;
  line-height: 1.85;
}
.prose .key-point strong { color: var(--accent); }
.prose img { max-width: 100%; height: auto; }
.prose pre { padding: 1rem; overflow-x: auto; border: 1px solid var(--line); background: var(--soft); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.prose :not(pre) > code { padding: .1em .3em; background: var(--soft); }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.prose thead th { background: var(--soft); font-weight: 600; }

/* ---------- 站台搜尋框（會員 + 免費共用） ---------- */
.site-search { position: relative; margin: 1.25rem 0; }
.site-search-input { width: 100%; padding: .6rem .85rem; font-size: 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.site-search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.site-search-input::placeholder { color: var(--muted); }
.site-search-results { position: absolute; z-index: 30; top: calc(100% + .4rem); left: 0; right: 0; max-height: 24rem; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: .4rem; }
.site-search-item { display: block; padding: .6rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.site-search-item:last-child { border-bottom: 0; }
.site-search-item:hover { background: var(--soft); }
.site-search-title { display: block; font-weight: 600; }
.site-search-meta { display: block; font-size: .78rem; color: var(--muted); margin: .15rem 0; }
.site-search-summary { display: block; font-size: .85rem; color: var(--muted); line-height: 1.45; }
[hidden] { display: none !important; }

/* ============================================================
   以下保留原專案功能性樣式，改用上方新變數
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem;
  background: var(--card);
}
.site-header nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.site-header nav a, .site-header nav button { font-size: 0.95rem; }
.site-header nav a.brand { font-weight: 700; font-size: 1.05rem; }
.site-header nav a.brand .brand-en { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 400; font-size: .68em; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: .55rem; white-space: nowrap; }
/* 會員/登入區塊：連結與按鈕之間留間距，避免誤按登出（:not([hidden]) 避免覆寫 JS 的 hidden 控制） */
.site-header .auth-in:not([hidden]),
.site-header .auth-out:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}
/* ---------- 會員首頁低調頁腳連結（回報問題） ---------- */
.member-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
}
.member-footer a {
  color: var(--muted);
  text-decoration: none;
}
.member-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}
/* ---------- 會員首頁許願池入口卡（參與優先） ---------- */
.member-wish-card {
  margin: 1.25rem 0 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.member-wish-card h2 {
  margin: 0 0 .35rem;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}
.member-wish-card .muted {
  margin: 0 0 1rem;
}
.member-wish-card .btn-primary {
  align-self: flex-start;
}

/* ---------- 會員首頁品牌附註（B 折疊 + E 降調，不進卡片） ---------- */
.member-brand-note { margin: 1.75rem 0 1.5rem; }
.brand-essence {
  margin: 0 0 .6rem; padding-left: .7rem; border-left: 2px solid var(--accent);
  color: var(--muted); font-size: 1rem; line-height: 1.6;
}
.brand-more { margin-left: .7rem; }
.brand-more > summary {
  cursor: pointer; list-style: none; color: var(--accent);
  font-size: .85rem; user-select: none;
}
.brand-more > summary::-webkit-details-marker { display: none; }
.brand-more > summary:hover { text-decoration: underline; }
.brand-full { margin-top: .55rem; }
.brand-full p { margin: 0 0 .55rem; color: var(--muted); font-size: .9rem; line-height: 1.62; }
.brand-full p:last-child { margin-bottom: 0; }
/* 展開後隱藏 essence，避免與第 4 段重複（支援 :has 的瀏覽器） */
.member-brand-note:has(.brand-more[open]) .brand-essence { display: none; }

button {
  background: var(--btn-bg);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
}
button:hover { opacity: 0.9; }
article { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem 1.5rem; }
ul { padding-left: 1.2rem; }
li { margin: 0.35rem 0; }
form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 320px; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: var(--muted); }
input {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem;
  color: var(--ink);
  font-size: 1rem;
}
/* 字級切換（小/中/大/特）：segmented，放主題鈕左邊；margin-left:auto 由主題鈕移來，讓字級組＋主題鈕一起貼右 */
.fs-control {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.fs-btn {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-right: 1px solid var(--line);
  padding: .25rem .5rem;
  font-size: .8rem;
  line-height: 1;
  cursor: pointer;
}
.fs-btn:last-child { border-right: 0; }
.fs-btn:hover { color: var(--ink); }
.fs-btn.is-active { background: var(--btn-bg); color: #fff; }
/* dark mode 切換鈕 */
.theme-toggle { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* 許願池 */
.wish-h2 { margin-top: 2.5rem; font-size: 1.4rem; letter-spacing: -.02em; }
.wish-form { max-width: 340px; flex-direction: row; align-items: stretch; }
.wish-form input { flex: 1; }
#wish-msg.wish-err { color: #c0392b; font-weight: 600; }
.wish-table { width: 100%; max-width: 720px; border-collapse: collapse; margin: 1rem 0 2rem; font-size: .95rem; }
.wish-table th, .wish-table td { border-bottom: 1px solid var(--line); padding: .55rem .7rem; text-align: left; }
.wish-table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.wish-cancel { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: .2rem .6rem; border-radius: 6px; }
.wish-cancel:hover { color: #c0392b; border-color: #c0392b; opacity: 1; }

/* ---------- 分類頁：分年摺疊 + 代號索引 ---------- */
.year-fold { margin: 1.5rem 0 0; }
.year-summary {
  cursor: pointer; user-select: none;
  color: var(--muted);
  font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.year-summary:hover { color: var(--accent); }
.year-fold[open] .year-summary { border-bottom-color: transparent; }
.idx-table { width: 100%; max-width: 46rem; border-collapse: collapse; margin: .9rem 0 1.5rem; font-size: .88rem; }
.idx-table th, .idx-table td { text-align: left; border-bottom: 1px solid var(--line); padding: .42rem .6rem; }
.idx-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.idx-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); white-space: nowrap; }

/* ---------- 管理後台 ---------- */
.admin-nav { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.admin-nav a { font-size: .9rem; padding: .45rem 1rem; }
.admin-h2 { margin-top: 2.5rem; letter-spacing: -.02em; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }
.link-btn:hover { opacity: .8; }
.link-btn:disabled, .link-btn[aria-disabled="true"] { opacity: .45; cursor: default; text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin: 1.5rem 0 1rem; }
.admin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.kpi-num { font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .8rem; color: var(--muted); }

/* 會員回報問題 */
.report-form { max-width: 560px; }
.report-form textarea,
.report-form select {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem;
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
}
.report-form textarea { resize: vertical; min-height: 5.5rem; }
#report-msg.report-err { color: #c0392b; font-weight: 600; }

/* 信札（會員端回報回覆清單） */
.inbox-h2 { margin-top: 2.5rem; font-size: 1.4rem; letter-spacing: -.02em; }
.inbox-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: .75rem 0; max-width: 640px; }
.inbox-meta, .report-meta { margin: 0 0 .5rem; font-size: .82rem; color: var(--muted); }
.inbox-body, .report-body { margin: 0 0 .5rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.inbox-status { font-weight: 600; margin-right: .4rem; }
.is-new { color: var(--accent); }
.is-replied { color: var(--muted); }
.inbox-reply { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--paper)); border-radius: 0 8px 8px 0; padding: .6rem .8rem; margin-top: .5rem; }
.inbox-reply p { margin: 0; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.reply-label { font-size: .8rem; color: var(--muted); }

/* 管理後台：會員回報回覆 */
.report-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: .75rem 0; max-width: 720px; }
.report-status { font-weight: 600; margin-right: .4rem; }
.reply-input { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); max-width: 720px; margin-top: .5rem; }
.reply-input textarea { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: .5rem; color: var(--ink); font-size: .95rem; font-family: inherit; resize: vertical; min-height: 4rem; }
.reply-actions { display: flex; align-items: center; gap: .5rem; }
.reply-msg { color: #c0392b; font-size: .9rem; }

/* ---------- 信箱驗證成功頁 ---------- */
.verify-wrap { text-align: center; padding: 2.5rem 0; }
.verify-title { letter-spacing: -.04em; }
.verify-card {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  box-shadow: 0 12px 36px rgba(0,0,0,.08);
}
.verify-check {
  width: 3.5rem; height: 3.5rem; margin: 0 auto 1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  color: var(--accent);
  font-size: 1.8rem; font-weight: 700;
}
.verify-text { color: var(--muted); margin: 0 0 1.5rem; }
.verify-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
/* 按鈕底色用 --btn-bg（深磚紅）而非 --accent：dark mode 的 accent 是淺色，白字會看不清（與「登出」按鈕同作法） */
.btn-primary { display: inline-block; padding: .6rem 1.2rem; background: var(--btn-bg); color: #fff; border-radius: 8px; text-decoration: none; }
.btn-primary:hover { opacity: .9; text-decoration: none; }
.btn-ghost { display: inline-block; padding: .6rem 1.2rem; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.btn-ghost:hover { text-decoration: none; color: var(--accent); border-color: var(--accent); }

/* ---------- 首頁：已登入且已驗證的小歡迎提示 ---------- */
.welcome-hint {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: .8rem 1rem; margin: 1.25rem 0; font-size: .98rem; line-height: 1.5;
}
.welcome-hint .who { font-weight: 600; color: var(--accent); }
.welcome-hint a { color: var(--accent); font-weight: 600; }

/* ---------- 首頁：站內文章統計條 ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.5rem 0 0; }
.stat {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.1rem .5rem;
}
.stat-num {
  font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 700; line-height: 1;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.02em;
}
.stat-label { font-size: .9rem; color: var(--muted); }
@media (max-width: 40rem) { .stats { grid-template-columns: repeat(2, 1fr); gap: .6rem; } .stat { padding: .85rem .35rem; } .stat-label { font-size: .8rem; } }

/* ---------- 盤後論市（board） ---------- */
.board { margin-top: .5rem; }
.board-hero-title { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -.03em; margin: .25rem 0 1rem; }
.board-cta { display: flex; flex-direction: column; gap: .5rem; margin: 1.5rem 0; }
.board-cta .btn-primary { align-self: flex-start; }
.board-snapshot-note { margin: 1rem 0 .25rem; }
.board-empty { margin: 1rem 0; }
.board-back { display: inline-block; margin-bottom: 1rem; text-decoration: none; color: var(--muted); }
.board-back:hover { color: var(--accent); }
/* ---------- /board 搜尋＋分頁工具列 ---------- */
/* 注意：全域 `form` 是 flex-column + max-width:320px、`label` 是 flex-column，且
   .site-search-input 是 width:100%——三者都會在這條工具列上作怪，故必須逐項覆蓋。 */
.board-summary { margin: .35rem 0 .6rem; }
.board-toolbar {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;
  gap: .5rem .6rem; margin: 0 0 1rem; max-width: none;
}
.board-toolbar .board-search-input { flex: 1 1 16rem; width: auto; min-width: 11rem; max-width: 22rem; }
.board-toolbar label { flex-direction: row; align-items: center; gap: .4rem; white-space: nowrap; }
.board-toolbar select {
  padding: .45rem .6rem; font-size: .95rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
.board-submit {
  padding: .45rem 1.1rem; font-size: .95rem; font-weight: 600;
  border: 1px solid var(--accent); border-radius: 8px; background: transparent;
  color: var(--accent); cursor: pointer;
}
.board-submit:hover { background: var(--accent); color: #fff; }
.board-pager { display: flex; align-items: center; gap: .9rem; margin: 1.5rem 0 .5rem; flex-wrap: wrap; }
.board-pages { display: flex; align-items: center; gap: .3rem; }
.board-page {
  min-width: 1.9rem; padding: .2rem .4rem; text-align: center; line-height: 1.5;
  border: 1px solid transparent; border-radius: 6px; text-decoration: none; color: var(--accent);
}
.board-page:hover { border-color: var(--accent); text-decoration: none; }
.board-page-current { color: var(--ink); border-color: var(--line); font-weight: 600; }
.board-page-gap { color: var(--muted); padding: 0 .1rem; }
@media (max-width: 40rem) { .board-toolbar .board-search-input { flex: 1 1 100%; max-width: none; } }
.board-thread-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.board-thread { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.board-thread a { text-decoration: none; color: var(--ink); display: block; }
.board-thread a:hover .board-thread-title { color: var(--accent); }
.board-thread-title { font-weight: 600; font-size: 1.1rem; display: inline; }
.board-thread-meta, .board-meta { margin: .3rem 0 0; }
.board-thread-summary { margin: .4rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.badge-agent {
  display: inline-block; margin-right: .4rem; padding: .05rem .45rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
  vertical-align: middle;
}
.board-post-body { margin: 1.25rem 0 2rem; }
.board-share { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 1.5rem 0 .5rem; }
.share-btn {
  display: inline-block; padding: .3rem .85rem; border-radius: 6px;
  font-size: .85rem; font-weight: 600; text-decoration: none; line-height: 1.3;
  color: var(--accent); border: 1px solid var(--accent); background: transparent;
}
.share-btn:hover { background: var(--accent); color: #fff; text-decoration: none; }
.share-btn.share-copy { cursor: pointer; font: inherit; }
.board-replies { display: flex; flex-direction: column; gap: 1.1rem; margin: 1rem 0; }
.board-reply { border-top: 1px solid var(--line); padding-top: 1rem; }
.board-reply-body { margin: .5rem 0; }
.board-hr { border: none; border-top: 1px solid var(--line); margin: 1.75rem 0; }
.board-guest { margin: 1rem 0; }
.board-form-msg { font-size: .9rem; margin-left: .75rem; }
.board-form-msg.error { color: #c0392b; font-weight: 600; }
.btn-danger-sm {
  margin-top: .5rem; padding: .2rem .6rem; font-size: .8rem;
  background: transparent; color: #c0392b; border: 1px solid #c0392b; border-radius: 6px; cursor: pointer;
}
.btn-danger-sm:hover { background: #c0392b; color: #fff; }
.section-heading-sm { font-size: 1.35rem; letter-spacing: -.02em; border-top: 1px solid var(--line); padding-top: .9rem; margin: 2.5rem 0 .5rem; }
.small { font-size: .85rem; }
/* /admin 小深區塊 */
.xiaoshen-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem;
  border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin: 1rem 0 2rem;
  background: var(--card);
}
.xs-status-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--muted); margin-right: .4rem; }
.xs-status-dot.online { background: #27ae60; }
.xs-meta { font-size: .85rem; color: var(--muted); }
.new-thread { display: flex; flex-direction: column; gap: .6rem; max-width: 560px; margin: 1.5rem 0; }
.new-thread input, .new-thread textarea { width: 100%; }

/* ---------- /admin 討論區管理 ---------- */
.admin-h3 { margin: 1.5rem 0 .4rem; font-size: 1.05rem; letter-spacing: -.01em; }
.trend-bar { height: 1.15rem; border-radius: 4px; min-width: 2px; position: relative; background: transparent; }
.trend-bar.th { background: var(--btn-bg); }
.trend-bar.rp { background: var(--accent); opacity: .5; }
.trend-bar span { position: absolute; left: .45rem; top: 50%; transform: translateY(-50%); font-size: .72rem; color: #fff; }

/* ---------- /sample 會員文章試讀 ---------- */
.sample-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem;
  margin: 2rem 0 0; background: var(--card);
}
.sample-badge {
  display: inline-block; margin-bottom: .4rem; padding: .08rem .55rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
}
.sample-title { margin: .3rem 0 .4rem; font-size: 1.35rem; }
.sample-title a { color: inherit; text-decoration: none; }
.sample-title a:hover { color: var(--accent); }
.sample-summary { color: var(--muted); margin: 0 0 1rem; line-height: 1.6; }
.sample-actions { margin: 0; display: flex; gap: .6rem; flex-wrap: wrap; }
.sample-cta {
  display: inline-block; padding: .55rem 1.1rem; border-radius: 8px;
  background: var(--btn-bg); color: #fff; font-weight: 700; text-decoration: none;
}
.sample-cta:hover { filter: brightness(1.08); }
.sample-cta-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.sample-topline { color: var(--muted); font-size: .9rem; margin: .2rem 0 1.5rem; }
.sample-topline a { color: var(--accent); }
/* 試讀：高度截斷（漸層淡出鎖尾）。截斷範圍＝下面 max-height 這一行，
   想多露 / 少露內容改這裡的數字就好；不依賴文章標題結構，文章結構怎麼改都不會壞 */
.sample-reader {
  position: relative; max-height: min(250vh, 2250px); overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
/* 預覽頁（/preview）：摘要段完整展示，不截斷、不淡出 */
.preview-body { position: static; }
.sample-lock {
  position: relative; z-index: 1; margin-top: -4rem;
  text-align: center; padding: 1.75rem 1rem 1rem;
  background: linear-gradient(to bottom, transparent, var(--paper) 35%);
}
.sample-lock-title { margin: 0 0 .25rem; font-size: 1.05rem; font-weight: 700; }
.sample-lock-desc { color: var(--muted); margin: 0 0 .9rem; }
.sample-lock-actions { margin: 0; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ---------- 首頁：今日結論卡片（快速閱讀層） ---------- */
.today-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 1.1rem 0 0;
}
.today-card .meta a { color: inherit; text-decoration: none; }
.today-card .meta a:hover { color: var(--accent); }
.today-conclusion { margin: .6rem 0 .9rem; line-height: 1.85; font-size: 1.02rem; }
.today-card-actions { margin: .2rem 0 0; }
.today-card-actions .btn-primary { font-size: .92rem; padding: .5rem 1rem; }
.today-card-prompt { text-align: center; padding: .6rem 0; }
.today-card-prompt .muted { margin: 0; }

/* ---------- 首頁：盤後論市最新話題區塊 ---------- */
.home-board { margin-top: 4rem; }
.home-board-sub { font-size: .95rem; letter-spacing: 0; color: var(--muted); font-weight: 400; margin-left: .4rem; }
.home-board-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.home-board-thread { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.home-board-thread a { text-decoration: none; color: var(--ink); display: block; }
.home-board-thread a:hover .home-board-thread-title { color: var(--accent); }
.home-board-thread-title { font-weight: 600; font-size: 1.1rem; display: inline; }
.home-board-meta { margin: .3rem 0 0; }
.home-board-empty { padding: 1rem 0; }
.home-board-cta { margin: 1.25rem 0 0; display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.home-board-cta .btn-primary { align-self: flex-start; }
@media (max-width: 40rem) { .home-board { margin-top: 2.5rem; } }

/* ---------- 全站 footer + 誰是小深連結 ---------- */
.site-footer {
  margin-top: 3rem; padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem;
  font-size: .85rem; color: var(--muted);
}
.site-footer .dot { opacity: .5; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.who-link { margin-left: .5rem; font-size: .9rem; color: var(--accent); text-decoration: none; white-space: nowrap; }
.who-link:hover { text-decoration: underline; }

/* ---------- 誰是小深？介紹頁 ---------- */
.xs-about { max-width: 660px; margin: 1rem auto 3rem; }
.xs-about-title { font-size: clamp(1.8rem, 5vw, 2.4rem); letter-spacing: -.03em; margin: .25rem 0 1.75rem; }
.xs-lede { font-size: 1.12rem; line-height: 1.9; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.xs-about p { line-height: 1.9; margin: 0 0 1.1rem; }
.xs-about strong { font-weight: 700; }
.xs-tagline {
  margin: 2rem 0 1.4rem !important; padding: 1.1rem 1.3rem;
  border-left: 3px solid var(--accent); background: var(--soft);
  font-size: 1.08rem; font-weight: 700; letter-spacing: .02em;
}
.xs-sign { text-align: right; margin-bottom: .4rem !important; color: var(--muted); }
.xs-closing { color: var(--muted); font-style: italic; }
.xs-back { margin-top: 2.5rem !important; }
.xs-back a { color: var(--accent); text-decoration: none; }
.xs-back a:hover { text-decoration: underline; }

/* ---------- 許願池公開展示區（首頁 / 免費文章頁） ---------- */
.wish-promo { margin-top: 3rem; }
.wish-promo-sub { font-size: .95rem; color: var(--muted); font-weight: 400; margin-left: .4rem; }
.wish-promo-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.2rem;
}
@media (max-width: 560px) { .wish-promo-cols { grid-template-columns: 1fr; } }
.wish-promo-col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.wish-promo-h { margin: 0 0 .6rem; font-size: 1rem; letter-spacing: -.01em; }
.wish-promo-list { list-style: none; padding: 0; margin: 0; }
.wish-promo-item { padding: .45rem 0; border-top: 1px solid var(--line); line-height: 1.5; }
.wish-promo-item:first-child { border-top: 0; }
.wish-promo-link { font-weight: 600; text-decoration: none; }
.wish-promo-link:hover { color: var(--accent); text-decoration: underline; }
.wish-position {
  display: inline-block; min-width: 2rem; padding: 0 .35rem;
  background: var(--soft); border-radius: 6px; text-align: center;
  font-family: ui-monospace, Menlo, monospace; font-size: .82rem; color: var(--accent);
}
.wish-promo-cta { display: flex; flex-direction: column; gap: .5rem; margin: 1.4rem 0 0; align-items: flex-start; }
.wish-promo-cta .btn-primary { align-self: flex-start; }
.wish-promo-summary {
  margin-left: .5rem; padding: .1rem .5rem;
  font-size: .78rem; line-height: 1.4; color: var(--accent);
  background: transparent; border: 1px solid var(--accent); border-radius: 999px;
  cursor: pointer;
}
.wish-promo-summary:hover { background: var(--soft); }
.wish-promo-summary-body {
  margin: .45rem 0 .15rem; padding: .55rem .7rem;
  background: var(--soft); border-radius: 8px;
  font-size: .92rem; line-height: 1.6; color: var(--text);
}

/* ---------- 首頁「一起扛」便條（情緒安慰按鈕） ---------- */
.comfort-btn {
  display: inline-block; margin-left: .7rem; padding: .22rem .7rem;
  font-size: .9rem; font-weight: 600; line-height: 1.4;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 999px;
  cursor: pointer; transition: all .15s ease;
  vertical-align: middle;
}
.comfort-btn:hover { background: var(--accent); color: #fff; }
.comfort-card {
  display: flex; flex-direction: column;
  margin: 0 0 1.6rem; padding: 1.1rem 1.3rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  border-left: 3px solid var(--accent);
  font-size: 1.02rem; line-height: 1.9; color: var(--ink);
  animation: comfort-in .25s ease;
}
@keyframes comfort-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* 便條主句凸顯：加大＋粗體＋accent 磚紅，成為卡片視覺焦點 */
#comfort-text { display: block; font-size: 1.15rem; font-weight: 600; color: var(--accent); line-height: 1.8; }
.comfort-card .comfort-sign { margin-top: .6rem; text-align: right; color: var(--muted); font-size: .85rem; }
/* 按鈕固定卡片底部右側（flex-column + margin-top:auto 沉底），不隨句子長短水平/垂直移動 */
.comfort-card .comfort-actions { display: flex; justify-content: flex-end; gap: .8rem; margin-top: auto; padding-top: .6rem; }
.comfort-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font-size: .9rem; text-decoration: underline; text-underline-offset: .18em;
}
.comfort-link:hover { opacity: .85; }
.comfort-link-muted { color: var(--muted); text-decoration: none; }
