:root {
  --green: #1f6b4a;
  --green-dark: #154d35;
  --green-soft: #e8f2ec;
  --ink: #1c2420;
  --muted: #5d6b64;
  --line: #dde5e0;
  --bg: #fbfcfa;
  --card: #ffffff;
  --accent: #b9772a;
  --radius: 10px;
  --wrap: 1120px;
  font-size: 17px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.75;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.3; margin: .4em 0 .5em; text-wrap: balance; }
h2 { font-size: 1.3rem; line-height: 1.4; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 800px; }
main { min-height: 60vh; padding-bottom: 56px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.lead { color: var(--muted); font-size: 1.05rem; }
.empty { color: var(--muted); padding: 40px 0; }
.meta { color: var(--muted); font-size: .9rem; display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 20px; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--green); color: #fff;
  text-decoration: none; font-size: .95rem; margin: 2px 4px 2px 0;
}
.btn:hover { background: var(--green-dark); color: #fff; }

/* 頁首 */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, #6fbf8f, var(--green) 70%); }
.brand strong { display: block; font-size: 1.1rem; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .08em; }
.nav-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font: inherit; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav > ul { display: flex; align-items: center; gap: 2px; }
.nav > ul > li { position: relative; }
.nav a, .nav button {
  display: block; padding: 10px 12px; border: 0; background: none; font: inherit; font-size: .95rem; color: var(--ink);
  text-decoration: none; cursor: pointer; border-radius: 8px; white-space: nowrap;
}
.nav a:hover, .nav button:hover, .nav button[aria-expanded="true"] { background: var(--green-soft); color: var(--green-dark); }
.has-sub > button::after { content: "▾"; margin-left: 4px; font-size: .75em; color: var(--muted); }
.has-sub > ul {
  display: none; position: absolute; left: 0; top: 100%; min-width: 200px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px; box-shadow: 0 10px 30px rgba(20, 50, 35, .12);
}
.has-sub > button[aria-expanded="true"] + ul { display: block; }
.nav-search { border: 1px solid var(--line); }
.nav .soon { font-size: .85em; opacity: .85; }
h1 .soon { display: inline-block; vertical-align: middle; margin-left: .4em; padding: 2px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-dark); font-size: .5em; font-weight: 600; letter-spacing: .02em; }

/* 麵包屑 */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }

/* 首頁 */
.hero { position: relative; background: var(--green-soft); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
/* 左右箭頭與圓點：疊在輪播圖上 */
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--green-dark); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); cursor: pointer; transition: background .15s; }
.hero-arrow:hover { background: #fff; }
.hero-arrow.prev { left: 16px; }
.hero-arrow.next { right: 16px; }
.hero-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 2; display: flex; justify-content: center; }
.hero-dots button { width: 28px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hero-dots button::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); transition: background .15s, transform .15s; }
.hero-dots button[aria-current="true"]::before { background: #fff; transform: scale(1.25); }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 16 / 9; max-height: 520px; overflow: hidden; background: #26302b; }
.slide a { display: block; width: 100%; height: 100%; }
/* 墊底：同一張圖放大、模糊、壓暗，填滿左右（或上下）的空白 */
.slide-bg { position: absolute; inset: -32px; width: calc(100% + 64px); height: calc(100% + 64px); max-width: none; object-fit: cover; filter: blur(28px) brightness(.82); }
/* 主圖：完整顯示，不裁切 */
.slide-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.notice { --notice-accent: #8a551c; background: #fdf7ec; border: 1px solid #ecdcc2; border-radius: var(--radius); padding: 18px 20px; margin: 24px 0; box-shadow: 0 2px 10px rgba(120, 86, 30, .06); }
.notice-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.notice-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--notice-accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice-head strong { color: var(--notice-accent); font-size: 1rem; letter-spacing: .02em; }
.notice-lead { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.55; color: var(--ink); text-decoration: none; padding: 4px 0; }
.notice-lead:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 4px; }
.notice-list { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid #ecdcc2; display: grid; gap: 2px; }
.notice-list li { position: relative; }
.notice-list li::before { content: ""; position: absolute; left: 3px; top: 17px; width: 5px; height: 5px; border-radius: 50%; background: var(--notice-accent); opacity: .5; }
.notice-list a { display: block; padding: 9px 0 9px 18px; color: var(--ink); text-decoration: none; line-height: 1.6; }
.notice-list a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.shortcuts { list-style: none; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.shortcuts a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); text-align: center; }
.shortcuts img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shortcuts span { display: block; padding: 8px 6px; font-size: .92rem; font-weight: 600; }
.shortcuts a:hover { border-color: var(--green); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 0 12px; border-bottom: 2px solid var(--green); }
.section-head h2 { margin: 0 0 6px; }
.section-head a { font-size: .9rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.feature { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.feature img { display: block; width: 100%; max-height: 360px; object-fit: cover; object-position: top; }
.feature span { display: block; padding: 10px 14px; font-weight: 600; }
.quote { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }

/* 卡片列表 */
.cards { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

/* 書架：月報以封面為主，像一排立著的書 */
.shelf { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 32px 24px; }
.book a { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); }
.book-cover { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 3px 7px 7px 3px; overflow: hidden; background: var(--green-soft); box-shadow: 0 12px 20px -10px rgba(21, 77, 53, .4), 0 2px 5px rgba(0, 0, 0, .08); transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s cubic-bezier(.2, .7, .2, 1); }
.book-cover::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(0, 0, 0, .04) 60%, rgba(255, 255, 255, .12)); z-index: 1; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.book-cover-empty { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--green-soft), #d6e6dc); }
.book a:hover .book-cover, .book a:focus-visible .book-cover { transform: translateY(-5px); box-shadow: 0 18px 26px -10px rgba(21, 77, 53, .46), 0 4px 8px rgba(0, 0, 0, .1); }
.book-meta { display: flex; flex-direction: column; gap: 4px; }
.book-meta strong { font-size: 1rem; line-height: 1.4; }
.book-desc { font-size: .85rem; color: var(--muted); line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .book-cover { transition: none; } .book a:hover .book-cover, .book a:focus-visible .book-cover { transform: none; } }
.card a { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.card a:hover { border-color: var(--green); transform: translateY(-2px); }
.thumb { aspect-ratio: 16 / 9; background: var(--green-soft); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty { background: linear-gradient(135deg, var(--green-soft), #f6f1e6); }
.card-body { padding: 12px 14px 14px; }
.card time { color: var(--muted); font-size: .8rem; }
.card h3 { margin: 2px 0 6px; font-size: 1.02rem; line-height: 1.45; }
.card p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.subcats { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.subcats a { display: inline-flex; gap: 8px; align-items: baseline; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; }
.subcats small, .tags small { color: var(--muted); }

/* 分頁 */
.pager ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pager a, .pager span { display: block; min-width: 40px; text-align: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #fff; }
.pager span[aria-current] { background: var(--green); color: #fff; border-color: var(--green); }
.pager .gap { padding: 6px 2px; color: var(--muted); }

/* 文章 */
.prose { font-size: 1.05rem; overflow-wrap: anywhere; }
.prose p { margin: 0 0 1.1em; }
.prose img { display: block; margin: 14px auto; border-radius: 6px; }
.prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .5em; }
.prose blockquote { margin: 1em 0; padding: 4px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--green-soft); }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 18px 0; background: #000; border-radius: var(--radius); overflow: hidden; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pdf iframe { width: 100%; height: min(80vh, 960px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table-wrap { overflow-x: auto; margin: 1em 0; }
.prose table { border-collapse: collapse; min-width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.tags a { display: inline-flex; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--green-soft); text-decoration: none; font-size: .88rem; }
.tags.big a { font-size: 1rem; padding: 6px 16px; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; border-top: 1px solid var(--line); padding-top: 20px; }
.prevnext a { text-decoration: none; }
.prevnext a[rel="next"] { text-align: right; }
.prevnext small { display: block; color: var(--muted); }

/* 回報系統、搜尋 */
.reports { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.reports li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px 14px; }
.reports p { margin: 6px 0; color: var(--muted); }
.search label { display: block; font-weight: 600; margin-bottom: 6px; }
.search input { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius); }
.search input:focus { border-color: var(--green); outline: none; }
.results { list-style: none; padding: 0; }
.results li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.results a { text-decoration: none; font-weight: 600; }
.results small { display: block; color: var(--muted); }

/* 頁尾 */
.site-footer { background: var(--green-dark); color: #dfeee6; padding: 28px 0; font-size: .9rem; }
.site-footer h2 { font-size: 1rem; margin: 0 0 8px; color: #fff; }
.site-footer ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: #dfeee6; }
.site-footer p { margin: 0; opacity: .8; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; max-height: calc(100vh - 64px); overflow: auto; }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; align-items: stretch; }
  .nav a, .nav button { width: 100%; text-align: left; white-space: normal; }
  .has-sub > ul { position: static; box-shadow: none; border: 0; padding-left: 14px; }
  .two-col { grid-template-columns: 1fr; }
  .hero-arrow { width: 40px; height: 40px; }
  .hero-arrow.prev { left: 8px; }
  .hero-arrow.next { right: 8px; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext a[rel="next"] { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card a { transition: none; }
}
