/* 悶了麼 Boringdie — 設計系統
 *
 * 方向：乾淨、明亮、編輯感。紙白底、深墨字、一個克制嘅暖金做重點。
 * 唔做深色介面。中文正文用襯線體，介面用無襯線體。
 */

:root {
  --paper: #fbfaf7;
  --paper-soft: #f4f1ea;
  --paper-card: #ffffff;

  --ink: #1b1a17;
  --ink-soft: #55514a;
  --ink-mute: #8d877b;

  --line: #e4dfd3;
  --line-soft: #efebe1;

  --accent: #1f4d3d;
  --accent-soft: #2c6b55;
  --gold: #a3822f;
  --alert: #9b3c2f;

  --serif: "Noto Serif TC", "Songti TC", "Source Han Serif TC", serif;
  --sans: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", sans-serif;

  --gutter: clamp(20px, 5vw, 48px);
  --maxw: 1240px;
  --radius: 4px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 680px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- 頁頭 ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 40;
}
.site-head__bar {
  display: flex; align-items: center; gap: 28px;
  height: 66px;
}
.brand {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--ink-mute); font-family: var(--sans); font-size: 10px;
  letter-spacing: 0.26em; text-transform: uppercase; margin-inline-start: 8px; }

.nav { display: flex; gap: 22px; margin-inline-start: auto; align-items: center; }
.nav a {
  text-decoration: none; font-size: 14px; color: var(--ink-soft);
  padding: 6px 0; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

@media (max-width: 720px) {
  .site-head__bar { height: auto; padding-block: 12px; flex-wrap: wrap; gap: 12px; }
  .nav { margin-inline-start: 0; width: 100%; gap: 16px; overflow-x: auto; padding-bottom: 4px; }
  .nav a { white-space: nowrap; font-size: 13px; }
}

/* ---------- 按鈕 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 11px 22px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  text-decoration: none; cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--accent { background: var(--accent); border-color: var(--accent); }
.btn--sm { padding: 7px 14px; font-size: 13px; }

/* ---------- 首頁 ---------- */

.hero { padding-block: clamp(48px, 9vw, 104px) clamp(36px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.8rem, 9vw, 5.6rem); line-height: .98; letter-spacing: -0.04em;
  margin: 0 0 20px;
}
.hero p { font-family: var(--serif); font-size: clamp(1rem, 2.2vw, 1.22rem);
  color: var(--ink-soft); max-width: 42ch; margin: 0 0 28px; }
.hero__meta { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 36px;
  font-size: 13px; color: var(--ink-mute); }
.hero__meta b { display: block; font-family: var(--serif); font-size: 26px;
  color: var(--ink); font-weight: 700; }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-mute); margin-bottom: 10px;
}

section.band { padding-block: clamp(40px, 7vw, 80px); border-bottom: 1px solid var(--line); }
section.band h2 { font-family: var(--serif); font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  letter-spacing: -0.02em; margin: 0 0 6px; }
section.band > .wrap > p { color: var(--ink-soft); margin: 0 0 28px; max-width: 54ch; }

/* ---------- 書卡 ---------- */

.grid { display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

.card {
  background: var(--paper-card); padding: 22px 22px 20px;
  text-decoration: none; display: flex; flex-direction: column; gap: 9px;
  min-height: 176px; transition: background .15s;
}
.card:hover { background: var(--paper-soft); }
.card__genre { font-size: 11px; letter-spacing: .1em; color: var(--gold); text-transform: uppercase; }
.card__title { font-family: var(--serif); font-size: 19px; font-weight: 700;
  line-height: 1.35; letter-spacing: -0.01em; margin: 0; }
.card__premise { font-size: 13.5px; color: var(--ink-soft); line-height: 1.68;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--ink-mute);
  display: flex; justify-content: space-between; gap: 10px; }

/* ---------- 分類 ---------- */

.genre-group { margin-bottom: 34px; }
.genre-group h3 { font-family: var(--serif); font-size: 15px; margin: 0 0 12px;
  color: var(--ink-mute); font-weight: 600; letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; padding: 7px 14px; border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none; background: var(--paper-card);
  color: var(--ink-soft); transition: .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 小說詳情 ---------- */

.work-head { padding-block: clamp(36px, 6vw, 68px) 28px; }
.work-head h1 { font-family: var(--serif); font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.06; letter-spacing: -0.035em; margin: 8px 0 14px; }
.work-head .by { color: var(--ink-soft); font-size: 14.5px; }
.work-head .premise { font-family: var(--serif); font-size: 17px; line-height: 1.85;
  color: var(--ink-soft); max-width: 58ch; margin-top: 18px; }

.chapter-list { border-top: 1px solid var(--line); margin-top: 8px; }
.chapter-list a {
  display: flex; align-items: baseline; gap: 14px; padding: 15px 4px;
  border-bottom: 1px solid var(--line-soft); text-decoration: none;
}
.chapter-list a:hover { background: var(--paper-soft); }
.chapter-list .no { font-size: 12px; color: var(--ink-mute); min-width: 52px;
  font-variant-numeric: tabular-nums; }
.chapter-list .ttl { font-family: var(--serif); font-size: 16.5px; flex: 1; }
.chapter-list .tag { font-size: 11px; color: var(--ink-mute); white-space: nowrap; }
.chapter-list .tag--lock { color: var(--gold); }

/* ---------- 閱讀頁 ---------- */

.reader { padding-block: clamp(30px, 5vw, 60px) 80px; }
.reader__crumb { font-size: 13px; color: var(--ink-mute); margin-bottom: 16px; }
.reader__crumb a { text-decoration: none; }
.reader__crumb a:hover { text-decoration: underline; }
.reader h1 { font-family: var(--serif); font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  line-height: 1.22; letter-spacing: -0.028em; margin: 0 0 10px; }
.reader__meta { font-size: 13px; color: var(--ink-mute); margin-bottom: 34px;
  padding-bottom: 20px; border-bottom: 1px solid var(--line); }

.prose { font-family: var(--serif); font-size: 19px; line-height: 1.95;
  color: #26241f; letter-spacing: .01em; }
.prose p { margin: 0 0 1.5em; }

.reader__nav { display: flex; justify-content: space-between; gap: 12px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }

/* ---------- 付費牆 ---------- */

.gate {
  margin-top: 30px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-card); padding: clamp(26px, 5vw, 44px); text-align: center;
}
.gate__teaser {
  font-family: var(--serif); font-size: 18px; line-height: 1.9; color: var(--ink-soft);
  text-align: start; margin-bottom: 28px; position: relative; padding-bottom: 42px;
}
.gate__teaser::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 88px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--paper-card));
}
.gate h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 10px; }
.gate p { color: var(--ink-soft); font-size: 14.5px; margin: 0 auto 22px; max-width: 40ch; }
.gate__price { font-family: var(--serif); font-size: 34px; font-weight: 700; margin-bottom: 4px; }
.gate__price small { font-size: 14px; font-weight: 400; color: var(--ink-mute); font-family: var(--sans); }
.gate__perks { list-style: none; padding: 0; margin: 22px auto 26px; max-width: 30ch;
  text-align: start; font-size: 14px; color: var(--ink-soft); }
.gate__perks li { padding: 5px 0 5px 22px; position: relative; }
.gate__perks li::before { content: "·"; position: absolute; left: 6px; color: var(--accent);
  font-weight: 700; font-size: 20px; line-height: 1.1; }

/* ---------- 表單 ---------- */

.panel { background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(26px, 5vw, 40px); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; }
.field input {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.msg { font-size: 14px; padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.msg--err { background: #fdf1ef; color: var(--alert); border: 1px solid #f0d5d0; }
.msg--ok { background: #eef5f1; color: var(--accent); border: 1px solid #d4e6dd; }

.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tabs button {
  font: inherit; font-size: 14.5px; background: none; border: none; cursor: pointer;
  padding: 10px 16px; color: var(--ink-mute); border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }

/* ---------- 狀態 ---------- */

.empty, .loading { padding: 60px 0; text-align: center; color: var(--ink-mute); font-size: 15px; }
.spinner {
  width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--ink);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* ---------- 頁腳 ---------- */

.site-foot { padding-block: 44px 60px; color: var(--ink-mute); font-size: 13px; }
.site-foot__row { display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
  border-top: 1px solid var(--line); padding-top: 26px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .spacer { margin-inline-start: auto; }

[hidden] { display: none !important; }

/* ---------- 首頁收款區 ---------- */

.support {
  background: linear-gradient(180deg, #f7f3ea 0%, #f2ece0 100%);
  border-block: 1px solid var(--line);
  padding-block: clamp(48px, 8vw, 92px);
}
.support__inner { max-width: 620px; margin: 0 auto; text-align: center; }
.support h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.7rem, 4.2vw, 2.5rem); line-height: 1.32;
  letter-spacing: -0.028em; margin: 0 0 18px;
}
.support__lede {
  font-family: var(--serif); font-size: 16.5px; line-height: 1.9;
  color: var(--ink-soft); margin: 0 auto 34px; max-width: 46ch;
}
.support__closing {
  font-family: var(--serif); font-size: 16px; line-height: 1.85;
  color: var(--ink-soft); margin: 30px auto 0; max-width: 34ch;
}

.price-card {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 6px; padding: clamp(28px, 5vw, 42px);
  box-shadow: 0 1px 2px rgba(27,26,23,.04), 0 12px 32px -18px rgba(27,26,23,.22);
}
.price-card__amount {
  font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 3.6rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1;
}
.price-card__amount span {
  font-family: var(--sans); font-size: 15px; font-weight: 400;
  color: var(--ink-mute); letter-spacing: 0; margin-inline-start: 4px;
}
.price-card__note { font-size: 13px; color: var(--ink-mute); margin-top: 10px; }
.price-card__perks {
  list-style: none; padding: 0; margin: 26px auto 28px; max-width: 30ch;
  text-align: start; font-size: 14.5px; color: var(--ink-soft);
}
.price-card__perks li { padding: 7px 0 7px 24px; position: relative; line-height: 1.6; }
.price-card__perks li::before {
  content: ""; position: absolute; left: 4px; top: 15px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.price-card__cta { width: 100%; padding-block: 14px; font-size: 15px; }
.price-card__msg { margin: 14px 0 0; font-size: 13px; }
