/* =========================================================
   島嶼拾光｜樣式
   字級：html[data-fs] 決定 rem 基準（小 16／中 18／大 20px），全站字級以 rem 計算，
   標題、資料說明、備註、搜尋結果與表單文字都會一起放大縮小。
   斷點：桌機 ≥1100、平板 768–1099、手機 <768（900 以下導覽收進選單、三個 A 收進「字級」按鈕）
   ========================================================= */
:root {
  --bg: #FAF6F2;
  --bg-2: #F2EDE5;
  --card: #FFFFFF;
  --ink: #0B2A18;
  --green: #234B31;
  --green-2: #335347;
  --green-soft: #E4EBE3;
  --text: #26332B;
  --muted: #56635A;
  --line: #234134;
  --hair: #DCD5C9;
  --red: #B64A25;
  --paper: #F1E7D3;
  --err: #A8321B;
  --ok: #2F6B3E;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --wrap: 1480px;
  --gut: 28px;
  --radius: 4px;
}
html { font-size: 18px; -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html[data-fs="s"] { font-size: 16px; }
html[data-fs="m"] { font-size: 18px; }
html[data-fs="l"] { font-size: 20px; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 1rem; line-height: 1.7; overflow-x: hidden; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #C98B2B; outline-offset: 2px; }
.sr, .vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--green); color: #fff; padding: 8px 14px; z-index: 100; border-radius: var(--radius); }
.skip:focus { top: 8px; }
.wrap { width: min(var(--wrap), calc(100% - var(--gut) * 2)); margin-inline: auto; }
main { min-height: 60vh; outline: none; }
main:focus, main:focus-visible { outline: none; }
svg.i { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 頁首 ---------- */
.hdr { background: var(--bg); border-bottom: 2px solid var(--green-2); position: sticky; top: 0; z-index: 40; }
.hdr-in { display: flex; align-items: center; gap: 24px; height: 4.6rem; min-height: 72px; width: min(1508px, calc(100% - 56px)); margin-left: max(28px, calc((100% - 1508px) / 2 + 2px)); margin-right: auto; }
.brand { display: flex; align-items: center; gap: 18px; text-decoration: none; flex: none; }
.brand img { width: 6rem; height: auto; }
.brand-t { display: flex; flex-direction: column; line-height: 1; }
.brand-zh { font-family: var(--serif); font-weight: 700; font-size: 1.9rem; letter-spacing: .2em; color: var(--ink); }
.brand-en { font-size: .7rem; letter-spacing: .24em; font-weight: 500; color: var(--ink); margin-top: .5rem; }
.nav { flex: 1; display: flex; justify-content: center; gap: clamp(28px, 6vw, 92px); padding-left: 8px; }
.nav a { font-family: var(--serif); font-weight: 600; font-size: 1.11rem; letter-spacing: .15em; text-decoration: none; color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--red); }
.hdr-r { display: flex; align-items: center; gap: 18px; flex: none; }
.hdr-r .div { width: 1px; height: 2rem; background: var(--green-2); margin-right: 26px; }
.login { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; text-decoration: none; color: var(--ink); padding: 6px 4px; letter-spacing: .04em; margin-right: 22px; }
.login svg.i { width: 1.6rem; height: 1.6rem; stroke-width: 1.4; }
.btn-up { display: inline-flex; align-items: center; gap: 10px; background: var(--green); color: #fff; text-decoration: none; border-radius: var(--radius); height: 2.8rem; padding: 0 1.2rem; font-size: 1rem; letter-spacing: .06em; border: 0; white-space: nowrap; }
.btn-up svg.i { width: 1.45rem; height: 1.45rem; }
.btn-up:hover { background: #1A3A26; }
.hdr-m { display: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; height: 44px; border: 1px solid var(--hair); background: #fff; border-radius: var(--radius); color: var(--ink); font-size: .85rem; padding: 0 10px; }
.icon-btn svg.i { width: 1.3rem; height: 1.3rem; }
.fs-pop { position: absolute; right: 12px; top: calc(100% + 6px); background: #fff; border: 1px solid var(--hair); border-radius: 8px; box-shadow: 0 10px 30px rgba(20,40,28,.14); padding: 10px; display: flex; gap: 6px; z-index: 50; }
.menu { border-top: 1px solid var(--hair); background: var(--bg); padding: 8px var(--gut) 18px; }
.menu a { display: block; padding: 12px 0; font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid var(--hair); font-family: var(--serif); font-weight: 600; letter-spacing: .1em; color: var(--ink); }

/* ---------- 三個 A 字級工具列 ---------- */
.fsbar { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 45; background: #fff; border: 1px solid var(--hair); border-right: 0; border-radius: 10px 0 0 10px; box-shadow: -4px 6px 22px rgba(20,40,28,.12); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.fsa { position: relative; width: 44px; height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-family: var(--serif); font-weight: 700; line-height: 1; display: grid; place-items: center; }
.fsa[data-k="s"] { font-size: 15px; }
.fsa[data-k="m"] { font-size: 20px; }
.fsa[data-k="l"] { font-size: 27px; }
.fsa:hover { background: var(--green-soft); }
.fsa[aria-pressed="true"] { background: var(--green); color: #fff; }
.fsa .tip { position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; font: 500 14px/1 var(--sans); padding: 8px 10px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.fsa:hover .tip, .fsa:focus-visible .tip { opacity: 1; }
.fs-pop .fsa .tip { right: auto; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); }

/* ---------- 首頁主視覺 ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 605fr) minmax(0, 834fr); gap: 41px; padding-top: 33px; align-items: start; }
.hero-t { padding-left: 27px; padding-top: 22px; }
.kicker { display: flex; align-items: center; gap: 22px; font-family: var(--serif); font-weight: 500; font-size: 1.12rem; letter-spacing: .14em; color: var(--ink); margin: 0; }
.kicker::before { content: ""; width: 58px; height: 2px; background: var(--red); flex: none; }
.hero h1 { font-family: var(--serif); font-weight: 900; color: var(--ink); font-size: min(3.78rem, 4.6vw); line-height: 1.24; letter-spacing: .06em; margin: 1.25rem 0 0; }
.hero h1 span { display: block; }
.lead { font-size: 1.06rem; letter-spacing: .12em; margin: 1.35rem 0 0; color: var(--ink); }
.hero .sbar { margin-top: 1.7rem; margin-left: -6px; }
.hot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 30px; margin-top: 1.25rem; font-size: 1rem; letter-spacing: .06em; }
.hot span { color: var(--muted); }
.hot a { text-decoration: none; color: var(--ink); border-bottom: 1px solid transparent; }
.hot a:hover { border-bottom-color: var(--ink); }
.hero-fig { margin: 0; }
.hero-fig img { width: 100%; height: auto; aspect-ratio: 834 / 470; object-fit: cover; }
.hero-fig figcaption { text-align: right; font-size: .84rem; letter-spacing: .08em; color: #3B463F; margin-top: .55rem; padding-right: 4px; }

/* ---------- 搜尋列 ---------- */
.sbar { display: flex; align-items: stretch; border: 1.5px solid var(--green); border-radius: var(--radius); background: #fff; min-height: 3.2rem; overflow: hidden; }
.sbar .sel { position: relative; flex: none; display: flex; align-items: center; }
.sbar select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; height: 100%; padding: 0 2.6rem 0 1.4rem; font-size: 1rem; color: var(--ink); letter-spacing: .04em; cursor: pointer; }
.sbar .sel::after { content: ""; position: absolute; right: 1.25rem; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid var(--ink); border-bottom: 1.6px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.sbar .sel::before { content: ""; position: absolute; right: 0; top: 22%; bottom: 22%; width: 1.5px; background: var(--green); }
.sbar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 1.3rem; font-size: 1rem; letter-spacing: .06em; color: var(--ink); }
.sbar input::placeholder { color: #747C76; }
.sbar input:focus, .sbar select:focus { outline: none; }
.sbar:focus-within { box-shadow: 0 0 0 3px rgba(201,139,43,.45); }
.sbar button { flex: none; width: 4.15rem; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; }
.sbar button svg.i { width: 1.65rem; height: 1.65rem; stroke-width: 2; }
.sbar button:hover { background: #1A3A26; }

/* ---------- 區塊標題與卡片 ---------- */
.rule { border: 0; border-top: 1.5px solid var(--line); margin: .55rem 0 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 1.3rem 0 1rem; }
.sec-h h2 { font-family: var(--serif); font-weight: 900; font-size: 2.3rem; letter-spacing: .08em; color: var(--ink); margin: 0; line-height: 1.3; }
.more { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.05rem; letter-spacing: .06em; color: var(--ink); }
.more svg.i { width: .95em; height: .95em; stroke-width: 2; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 23px; }
.card { display: block; text-decoration: none; color: inherit; }
.thumb { position: relative; aspect-ratio: 352 / 193; overflow: hidden; background: var(--bg-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.thumb .play { position: absolute; left: 50%; top: 50%; width: 3rem; height: 3rem; transform: translate(-50%, -50%); border: 3px solid #fff; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.12); }
.thumb .play::after { content: ""; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.meta { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink); margin-top: .5rem; letter-spacing: .04em; flex-wrap: wrap; }
.meta svg.i { width: 1.3rem; height: 1.3rem; stroke-width: 1.5; }
.meta .sub { color: var(--muted); }
.meta .sub::before { content: "・"; }
.card h3 { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; letter-spacing: .06em; color: var(--ink); margin: .2rem 0 0; line-height: 1.45; }
.card:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.badge-demo { position: absolute; left: 8px; top: 8px; background: rgba(250,246,242,.92); color: var(--red); font-size: .72rem; padding: 2px 8px; border-radius: 3px; letter-spacing: .06em; border: 1px solid rgba(182,74,37,.35); }
.badge-st { display: inline-block; font-size: .78rem; padding: 1px 9px; border-radius: 99px; border: 1px solid currentColor; letter-spacing: .04em; }
.badge-st.draft { color: #8A5A10; background: #FBF1DC; }
.badge-st.pub { color: var(--ok); background: #E8F2E9; }
.badge-st.priv { color: var(--muted); background: #EFEDE8; }

/* 無圖封面：文件封面、聲波封面 */
.cover-audio { position: absolute; inset: 0; background: #264D35; display: flex; align-items: center; justify-content: center; gap: 5%; color: #fff; padding: 0 4% 0 10%; }
.cover-audio svg.mic { height: 26%; width: auto; flex: none; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.cover-audio svg.wave { flex: 1; height: 30%; }
.cover-doc { position: absolute; inset: 0; background: linear-gradient(135deg, #F4ECDC, #E8DCC4); display: flex; align-items: center; justify-content: center; }
.cover-doc .pg { width: 38%; aspect-ratio: 3/4; background: #FFFCF6; box-shadow: 0 6px 18px rgba(60,40,10,.18); position: relative; padding: 9% 8% 0; clip-path: polygon(0 0, 78% 0, 100% 16%, 100% 100%, 0 100%); }
.cover-doc .pg::before { content: ""; position: absolute; right: 0; top: 0; width: 22%; height: 16%; background: #E2D3B6; }
.cover-doc .pg i { display: block; height: 3px; background: #D4C6AC; margin-bottom: 9%; border-radius: 2px; }
.cover-doc .pg i:nth-child(1) { width: 70%; background: var(--green-2); height: 4px; }
.cover-doc .pg i:nth-child(4) { width: 60%; }
.cover-doc .fmt { position: absolute; right: 8%; bottom: 10%; background: var(--green); color: #fff; font-size: .72rem; letter-spacing: .08em; padding: 2px 8px; border-radius: 3px; }
.cover-video { position: absolute; inset: 0; background: #1E2B24; }

/* ---------- 一般頁面 ---------- */
.page { padding: 2rem 0 4rem; }
.page-h { font-family: var(--serif); font-weight: 900; font-size: 2.22rem; letter-spacing: .06em; color: var(--ink); margin: 0 0 .4rem; line-height: 1.35; }
.page-sub { color: var(--muted); margin: 0 0 1.4rem; }
.crumb { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; text-decoration: none; color: var(--green); margin-bottom: 1rem; padding: 4px 0; }
.crumb svg.i { width: 1em; height: 1em; stroke-width: 2; }
.crumb:hover { text-decoration: underline; }
.note-demo { background: #FBF1DC; border: 1px solid #E6CD98; color: #6A4A10; padding: .6rem 1rem; border-radius: var(--radius); font-size: .9rem; margin: 0 0 1.2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 2.6rem; padding: .45rem 1.2rem; border-radius: var(--radius); border: 1.5px solid var(--green); background: #fff; color: var(--green); font-size: 1rem; text-decoration: none; letter-spacing: .04em; line-height: 1.3; text-align: center; }
.btn:hover { background: var(--green-soft); }
.btn.pri { background: var(--green); color: #fff; }
.btn.pri:hover { background: #1A3A26; }
.btn.ghost { border-color: var(--hair); color: var(--text); }
.btn.danger { border-color: #D7B2A6; color: var(--err); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 探索典藏 ---------- */
.ex-top { padding-top: 1.6rem; }
.ex-top .sbar { max-width: 860px; }
.ex-sum { margin: 1rem 0 0; font-size: 1.02rem; color: var(--ink); }
.ex-sum b { font-family: var(--serif); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 1rem 0; margin-top: 1rem; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--hair); background: #fff; border-radius: 99px; padding: .3rem .95rem; font-size: .92rem; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.chip small { color: var(--muted); font-size: .8rem; }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip[aria-pressed="true"] small { color: #D5E2D7; }
.fsel { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; }
.fsel select { border: 1px solid var(--hair); background: #fff; border-radius: var(--radius); padding: .35rem .7rem; font-size: .92rem; min-height: 2.3rem; }
.clear { border: 0; background: none; color: var(--red); text-decoration: underline; text-underline-offset: 3px; font-size: .92rem; padding: 6px 4px; }
.active-f { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .9rem; }
.tag-x { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); border: 0; border-radius: 99px; padding: .2rem .8rem; font-size: .85rem; color: var(--ink); }
.tag-x svg.i { width: .9em; height: .9em; stroke-width: 2.2; }
.results { margin-top: 1.6rem; }
.empty { text-align: center; padding: 3.5rem 1rem; background: #fff; border: 1px dashed var(--hair); border-radius: 8px; margin-top: 1.6rem; }
.empty h2 { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin: 0 0 .5rem; }
.empty p { color: var(--muted); margin: 0 0 1.2rem; }
.empty .btns { justify-content: center; }
.topic-head { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center; background: #fff; border: 1px solid var(--hair); padding: 14px; border-radius: 8px; margin-top: 1.2rem; }
.topic-head img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; }
.topic-head h2 { font-family: var(--serif); margin: 0; font-size: 1.6rem; color: var(--ink); }
.topic-head p { margin: .3rem 0 0; color: var(--muted); }

/* 主題精選 */
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.tcard { display: grid; grid-template-columns: 40% 1fr; min-height: 220px; background: #fff; border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; }
.tcard img { width: 100%; height: 0; min-height: 100%; object-fit: cover; }
.tcard div { padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: .4rem; }
.tcard h2 { font-family: var(--serif); font-weight: 900; font-size: 1.6rem; color: var(--ink); margin: 0; letter-spacing: .06em; }
.tcard p { margin: 0; color: var(--muted); }
.tcard .n { margin-top: auto; color: var(--green); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.tcard:hover h2 { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- 資料詳情 ---------- */
.dt-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 1rem; border-bottom: 1.5px solid var(--line); }
.dt-h h1 { font-family: var(--serif); font-weight: 900; font-size: 2.3rem; color: var(--ink); letter-spacing: .05em; margin: .3rem 0 0; line-height: 1.35; }
.dt-type { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--green); border: 1px solid var(--green); border-radius: 99px; padding: .1rem .8rem; }
.dt-type svg.i { width: 1.1rem; height: 1.1rem; }
.dt-by { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: .95rem; color: var(--muted); margin: .5rem 0 0; }
.dt-by b { color: var(--ink); font-weight: 500; }
.dt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "media side" "story side"; gap: 2rem 36px; margin-top: 1.6rem; align-items: start; }
.dt-media { grid-area: media; min-width: 0; }
.dt-grid .attrs { grid-area: side; }
.dt-grid .story { grid-area: story; margin-top: 0; }
.viewer { background: #1F2A23; border-radius: 6px; overflow: hidden; position: relative; }
.viewer .stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 360px; aspect-ratio: 16/10; }
.viewer .stage img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.zoom-btn { position: absolute; right: 12px; bottom: 12px; background: rgba(255,255,255,.92); border: 0; border-radius: 4px; padding: .35rem .8rem; display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; color: var(--ink); }
.stage .open-lb { all: unset; cursor: zoom-in; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.stage .open-lb:focus-visible { outline: 3px solid #C98B2B; outline-offset: -3px; }
.thumbs { display: flex; gap: 10px; padding: 10px; background: #18211B; overflow-x: auto; }
.thumbs button { flex: none; width: 96px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 3px; overflow: hidden; background: none; opacity: .7; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button[aria-current="true"] { border-color: #fff; opacity: 1; }
.v-cap { color: #DDE3DC; font-size: .88rem; padding: 8px 14px; background: #18211B; display: flex; justify-content: space-between; gap: 12px; }
.player video { width: 100%; aspect-ratio: 16/9; background: #000; }
.ctrls { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #18211B; color: #fff; font-size: .88rem; }
.ctrls button { width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: #fff; color: var(--green); display: grid; place-items: center; flex: none; }
.ctrls button.sq { background: transparent; color: #fff; border-radius: 4px; }
.ctrls button svg.i { width: 1.1rem; height: 1.1rem; stroke-width: 2.2; }
.ctrls button svg.fill { fill: currentColor; stroke: none; }
.ctrls input[type=range] { flex: 1; accent-color: #E0B34E; min-width: 60px; height: 24px; }
.ctrls time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.audio-art { position: relative; aspect-ratio: 16/7; }
.audio-art .cover-audio { position: absolute; }
.pdfv .stage { background: #3A433D; aspect-ratio: auto; min-height: 0; padding: 18px; }
.pdfv .stage img { max-height: 900px; box-shadow: 0 6px 22px rgba(0,0,0,.35); background: #fff; }
.pdfv iframe { width: 100%; height: 78vh; border: 0; background: #fff; }
.filebox { background: #fff; border: 1px solid var(--hair); border-radius: 6px; padding: 1.2rem 1.3rem; display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; }
.filebox .thumb { aspect-ratio: 3/4; border-radius: 4px; }
.filebox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .95rem; }
.filebox dt { color: var(--muted); }
.filebox dd { margin: 0; word-break: break-all; }
.txt-prev { background: #FFFDF8; border: 1px solid var(--hair); border-radius: 6px; padding: 1.2rem 1.4rem; margin-top: 14px; white-space: pre-wrap; font-size: 1rem; line-height: 1.9; max-height: 520px; overflow: auto; }
.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; font-size: .92rem; color: var(--muted); }
.story { margin-top: 2rem; background: #fff; border: 1px solid var(--hair); border-left: 4px solid var(--green); border-radius: 6px; padding: 1.5rem 1.8rem; }
.story h2 { font-family: var(--serif); font-weight: 900; font-size: 1.5rem; color: var(--ink); margin: 0 0 .8rem; letter-spacing: .06em; }
.story .txt { font-size: 1.06rem; line-height: 2; white-space: pre-wrap; color: #222D26; letter-spacing: .02em; }
.story .by { font-size: .88rem; color: var(--muted); margin-top: 1rem; }
.attrs { background: #fff; border: 1px solid var(--hair); border-radius: 6px; padding: 1.2rem 1.3rem; position: sticky; top: calc(4.6rem + 20px); }
.attrs h2 { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin: 0 0 .6rem; letter-spacing: .08em; }
.attrs dl { margin: 0; }
.attrs .row { display: grid; grid-template-columns: 5.2em 1fr; gap: 10px; padding: .55rem 0; border-top: 1px solid #EEE8DE; font-size: .95rem; }
.attrs dt { color: var(--muted); }
.attrs dd { margin: 0; color: var(--ink); word-break: break-word; }
.attrs .kw { display: flex; flex-wrap: wrap; gap: 6px; }
.attrs .kw a { font-size: .85rem; background: var(--green-soft); border-radius: 99px; padding: 0 .65rem; text-decoration: none; color: var(--ink); }
.attrs .kw a:hover { background: #D3DED2; }
.own-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: #FBF1DC; border: 1px solid #E6CD98; padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .95rem; }
.related { margin-top: 3rem; }

/* 燈箱 */
.lb { position: fixed; inset: 0; z-index: 90; background: rgba(12,18,14,.94); display: flex; flex-direction: column; }
.lb[hidden] { display: none; }
.lb-top { display: flex; justify-content: space-between; align-items: center; color: #fff; padding: 12px 16px; font-size: .95rem; gap: 12px; }
.lb-top .btns button, .lb-nav { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; min-height: 2.5rem; padding: 0 .9rem; display: inline-flex; align-items: center; gap: 6px; }
.lb-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; position: relative; }
.lb-body img { max-width: 94vw; max-height: calc(100vh - 140px); object-fit: contain; cursor: zoom-in; }
.lb.zoomed .lb-body { align-items: flex-start; justify-content: flex-start; }
.lb.zoomed .lb-body img { max-width: none; max-height: none; width: 200%; cursor: zoom-out; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; padding: 0; justify-content: center; border-radius: 50%; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-cap { color: #D5DBD4; text-align: center; padding: 10px; font-size: .92rem; }

/* ---------- 表單：登入／上傳 ---------- */
.auth { max-width: 520px; margin: 0 auto; background: #fff; border: 1px solid var(--hair); border-radius: 8px; padding: 2rem 2.2rem; }
.tabs { display: flex; border-bottom: 1px solid var(--hair); margin-bottom: 1.4rem; }
.tabs button { flex: 1; border: 0; background: none; padding: .8rem; font-size: 1.05rem; color: var(--muted); border-bottom: 3px solid transparent; font-family: var(--serif); font-weight: 700; letter-spacing: .1em; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--green); }
.fld { margin-bottom: 1.15rem; }
.fld > label, .fld > .lbl, fieldset > legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-weight: 500; color: var(--ink); margin-bottom: .4rem; font-size: 1rem; }
.req { color: var(--err); font-size: .85rem; font-weight: 400; }
.opt { color: var(--muted); font-size: .85rem; font-weight: 400; }
.hint { font-size: .86rem; color: var(--muted); margin: .3rem 0 0; }
.inp, .ta, .fld select { width: 100%; border: 1px solid #C9C2B5; border-radius: var(--radius); background: #fff; padding: .6rem .8rem; font-size: 1rem; min-height: 2.75rem; color: var(--ink); }
.ta { min-height: 9rem; resize: vertical; line-height: 1.8; }
.inp:focus, .ta:focus, .fld select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(35,75,49,.18); }
[aria-invalid="true"] { border-color: var(--err) !important; background: #FFF8F6 !important; }
.ferr { color: var(--err); font-size: .88rem; margin: .35rem 0 0; display: flex; gap: 6px; align-items: flex-start; }
.ferr::before { content: "!"; flex: none; width: 1.15em; height: 1.15em; border-radius: 50%; background: var(--err); color: #fff; font-size: .75em; font-weight: 700; display: grid; place-items: center; margin-top: .25em; }
[data-errsum], .box, .fld, fieldset, .story, .results { scroll-margin-top: calc(4.6rem + 24px); }
.errsum { border: 2px solid var(--err); background: #FFF6F3; border-radius: 6px; padding: 1rem 1.2rem; margin-bottom: 1.4rem; }
.errsum h2 { font-size: 1.1rem; color: var(--err); margin: 0 0 .4rem; }
.errsum ul { margin: 0; padding-left: 1.2rem; }
.errsum a { color: var(--err); }
.oksum { border: 1.5px solid var(--ok); background: #F1F7F1; border-radius: 6px; padding: .8rem 1.1rem; margin-bottom: 1.2rem; color: var(--ok); }
.upf { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.box { background: #fff; border: 1px solid var(--hair); border-radius: 8px; padding: 1.5rem 1.7rem; margin-bottom: 1.4rem; }
.box > h2 { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-weight: 900; font-size: 1.35rem; color: var(--ink); margin: 0 0 1.1rem; letter-spacing: .06em; }
.box > h2 .no { width: 2rem; height: 2rem; border-radius: 50%; background: var(--green); color: #fff; font: 700 .95rem/2rem var(--sans); text-align: center; flex: none; }
.drop { border: 2px dashed #B9B1A2; border-radius: 8px; padding: 1.8rem 1rem; text-align: center; background: var(--bg); transition: background .15s, border-color .15s; }
.drop.over { background: var(--green-soft); border-color: var(--green); }
.drop > svg.i { display: block; width: 2.4rem; height: 2.4rem; color: var(--green); margin: 0 auto .5rem; stroke-width: 1.4; }
.drop p { margin: .2rem 0; }
.drop .types span { display: inline-flex; align-items: center; gap: 4px; }
.drop .types { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .86rem; margin-top: .6rem; }
.flist { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.flist li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--hair); border-radius: 6px; padding: .6rem .8rem; background: #fff; }
.flist li.bad { border-color: var(--err); background: #FFF8F6; }
.flist .fi { width: 3.2rem; height: 3.2rem; border-radius: 4px; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; color: var(--green); }
.flist .fi img { width: 100%; height: 100%; object-fit: cover; }
.flist .fn { font-weight: 500; color: var(--ink); word-break: break-all; line-height: 1.4; }
.flist .fm { font-size: .85rem; color: var(--muted); }
.flist .fa { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.flist .fa button { border: 1px solid var(--hair); background: #fff; border-radius: 4px; font-size: .85rem; padding: .25rem .7rem; min-height: 2.2rem; }
.prog { height: 4px; background: #E6E0D5; border-radius: 2px; overflow: hidden; margin-top: 6px; }
.prog i { display: block; height: 100%; background: var(--green); width: 0; transition: width .2s; }
.fsum { margin: .8rem 0 0; font-size: .92rem; color: var(--ink); }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.note-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 400; color: var(--green); background: var(--green-soft); border-radius: 99px; padding: 0 .7rem; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #C9C2B5; border-radius: 99px; padding: .35rem 1rem; background: #fff; cursor: pointer; font-size: .95rem; }
.seg label:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--ink); font-weight: 500; }
.seg input { accent-color: var(--green); margin: 0; }
details.more-f { border: 1px solid var(--hair); border-radius: 6px; margin-bottom: 1.2rem; background: var(--bg); }
details.more-f > summary { cursor: pointer; padding: .85rem 1rem; font-weight: 500; color: var(--ink); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
details.more-f > summary::-webkit-details-marker { display: none; }
details.more-f > summary::after { content: "展開"; font-size: .85rem; color: var(--green); border: 1px solid var(--green); border-radius: 99px; padding: 0 .7rem; font-weight: 400; flex: none; }
details.more-f[open] > summary::after { content: "收合"; }
details.more-f > .in { padding: .3rem 1rem 1rem; }
details.more-f details.more-f { background: #fff; }
fieldset { border: 0; padding: 0; margin: 0 0 1.3rem; min-width: 0; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-list label { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; border: 1px solid #C9C2B5; border-radius: 6px; padding: .6rem .9rem; background: #fff; cursor: pointer; }
.radio-list label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.radio-list input { accent-color: var(--green); margin-top: .45em; }
.radio-list b { font-weight: 500; color: var(--ink); }
.radio-list small { grid-column: 2; color: var(--muted); font-size: .86rem; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: .97rem; }
.chk input { accent-color: var(--green); width: 1.15rem; height: 1.15rem; margin-top: .3em; flex: none; }
.submit-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.side { position: sticky; top: calc(4.6rem + 20px); }
.side .box { padding: 1.2rem 1.3rem; }
.side h2 { font-size: 1.1rem !important; }
.side ol { margin: 0; padding-left: 1.2rem; font-size: .92rem; color: var(--muted); }
.side ol li { margin-bottom: .4rem; }
.side ol li.on { color: var(--ink); font-weight: 500; }
.done { text-align: center; max-width: 640px; margin: 2rem auto; background: #fff; border: 1px solid var(--hair); border-radius: 8px; padding: 2.4rem 2rem; }
.done .ok { width: 4rem; height: 4rem; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto 1rem; }
.done .ok svg.i { width: 2rem; height: 2rem; stroke-width: 2.4; }
.done h1 { font-family: var(--serif); font-weight: 900; font-size: 1.8rem; color: var(--ink); margin: 0 0 .4rem; }
.done p { color: var(--muted); margin: 0 0 1.4rem; }
.done .btns { justify-content: center; }

/* 我的投稿 */
.mine-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mlist { list-style: none; padding: 0; margin: 1.2rem 0 0; display: flex; flex-direction: column; gap: 12px; }
.mlist li { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--hair); border-radius: 8px; padding: 12px; }
.mlist .thumb { border-radius: 4px; }
.mlist h3 { font-family: var(--serif); font-size: 1.25rem; margin: .2rem 0; color: var(--ink); }
.mlist h3 a { text-decoration: none; }
.mlist h3 a:hover { text-decoration: underline; }
.mlist .m2 { font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mlist .acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #FFF6F3; border: 1px solid #E8C4B8; padding: .6rem .9rem; border-radius: 6px; font-size: .95rem; }
.user-card { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .95rem; }

/* 關於 */
.about { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 48px; align-items: start; }
.about p { font-size: 1.05rem; line-height: 2; }
.about img { width: 100%; border-radius: 6px; }
.scope { background: #fff; border: 1px solid var(--hair); border-radius: 8px; padding: 1.2rem 1.5rem; margin-top: 1.4rem; }
.scope h2 { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin: 0 0 .5rem; }
.scope ul { margin: 0; padding-left: 1.2rem; }

/* 頁尾 */
.ftr { margin-top: 4rem; border-top: 1.5px solid var(--line); background: var(--bg-2); }
.ftr-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; padding: 2rem 0 2.4rem; font-size: .9rem; color: var(--muted); }
.ftr .brand img { width: 4.2rem; }
.ftr .brand-zh { font-size: 1.35rem; }
.ftr nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.ftr nav a { text-decoration: none; color: var(--ink); }
.ftr nav a:hover { text-decoration: underline; }
.ftr .demo { flex-basis: 100%; border-top: 1px solid var(--hair); padding-top: 1rem; }

/* ---------- 響應式 ---------- */
@media (max-width: 1280px) {
  .nav { gap: 36px; }
  .login { margin-right: 4px; }
  .hdr-r .div { margin-right: 6px; }
  .brand-zh { font-size: 1.6rem; }
}
@media (max-width: 1099px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-t { padding-left: 0; padding-top: 6px; }
  .hero h1 { font-size: min(3.4rem, 8.5vw); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-grid { grid-template-columns: 1fr; grid-template-areas: "media" "side" "story"; gap: 1.4rem; }
  .attrs { position: static; }
  .upf { grid-template-columns: 1fr; }
  .side { position: static; order: -1; }
  .side .steps { display: none; }
  .about { grid-template-columns: 1fr; }
  .tgrid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --gut: 16px; }
  .hdr-in { width: calc(100% - 32px); margin-left: 16px; gap: 10px; height: auto; min-height: 64px; padding: 8px 0; }
  .nav, .hdr-r { display: none; }
  .hdr-m { display: flex; align-items: center; gap: 8px; margin-left: auto; position: relative; }
  .brand { gap: 10px; min-width: 0; }
  .brand img { width: 3.6rem; }
  .brand-zh { font-size: 1.3rem; letter-spacing: .14em; }
  .brand-en { font-size: .5rem; letter-spacing: .14em; margin-top: .35rem; }
  .fsbar { display: none; }
  .attrs, .side { top: auto; }
}
@media (max-width: 767px) {
  body { line-height: 1.75; }
  .hero { padding-top: 18px; gap: 22px; }
  .kicker { font-size: 1rem; gap: 14px; }
  .kicker::before { width: 40px; }
  .hero h1 { font-size: min(2.6rem, 10.6vw); margin-top: .8rem; }
  .lead { font-size: 1rem; letter-spacing: .06em; }
  .hero .sbar { margin-left: 0; }
  .sbar { flex-wrap: wrap; }
  .sbar .sel { flex: 1 1 100%; border-bottom: 1.5px solid var(--green); min-height: 2.9rem; }
  .sbar .sel::before { display: none; }
  .sbar select { width: 100%; min-height: 2.9rem; }
  .sbar input { flex: 1 1 0; min-height: 3rem; padding: 0 .9rem; }
  .sbar button { width: 3.4rem; min-height: 3rem; }
  .hot { gap: 6px 20px; }
  .sec-h h2, .page-h { font-size: 1.75rem; }
  .grid { grid-template-columns: 1fr; gap: 26px; }
  .card h3 { font-size: 1.3rem; }
  .dt-h h1 { font-size: 1.8rem; }
  .viewer .stage { min-height: 220px; }
  .story { padding: 1.2rem 1.1rem; }
  .filebox { grid-template-columns: 1fr; }
  .filebox .thumb { max-width: 120px; }
  .box { padding: 1.2rem 1rem; }
  .cols2 { grid-template-columns: 1fr; }
  .auth { padding: 1.4rem 1.1rem; }
  .mlist li { grid-template-columns: 96px minmax(0, 1fr); }
  .mlist .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .tcard { grid-template-columns: 38% 1fr; min-height: 150px; }
  .tcard div { padding: .9rem 1rem; gap: .25rem; }
  .tcard h2 { font-size: 1.3rem; }
  .tcard p { font-size: .92rem; line-height: 1.6; }
  .topic-head { grid-template-columns: 1fr; }
  .submit-bar .btn { flex: 1 1 100%; }
  .thumbs button { width: 72px; height: 50px; }
  .lb-nav { top: auto; bottom: 60px; transform: none; }
}
@media (max-width: 420px) {
  .brand-en { display: none; }
  .hdr-m .icon-btn .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
/* 右側字級工具列不遮住內頁按鈕 */
@media (min-width: 901px) {
  .wrap.page, .wrap.ex-top { width: min(var(--wrap), calc(100% - 128px)); }
}
