/* ============================================================
   墨言·今聲｜Authors Resurrected — 圖書館設計系統 v2
   Apple 風格：白底、淺灰分區、苹方無襯線、大標題負字距、
   圓角卡片、大留白。artwork 即書封，文字即設計。
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --accent: #a8592f;            /* 陶土橙——少量點綴 */
  --border: rgba(0, 0, 0, .08);
  --border-strong: rgba(0, 0, 0, .14);
  --ink: #1d1d1f;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .08);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "PingFang TC", "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --headline: clamp(44px, 6.5vw, 68px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}
::selection { background: rgba(168, 89, 47, .18); }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
img { display: block; }

.shell { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ---------- 頂欄 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.brand-latin { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: .04em; }
.site-nav { display: flex; gap: 34px; }
.site-nav a { font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; transition: color .2s ease; }
.site-nav a:hover { color: var(--text); }
.nav-cta {
  font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 9px 20px; border-radius: 999px;
  background: var(--ink); color: #fff;
  transition: opacity .2s ease, transform .2s ease;
}
.nav-cta:hover { opacity: .85; transform: translateY(-1px); }

/* ---------- 主視覺 ---------- */
.hero { text-align: center; padding: 132px 0 116px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--text-2); letter-spacing: .06em; margin: 0; }
.hero h1 {
  margin: 22px 0 20px;
  font-size: var(--headline);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.08;
}
.hero-sub {
  margin: 0 auto; max-width: 640px;
  font-size: 21px; font-weight: 400; color: var(--text-2); line-height: 1.5;
}
.hero-actions { display: flex; justify-content: center; align-items: center; gap: 26px; margin-top: 42px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 30px; border-radius: 999px;
  font-size: 16px; font-weight: 500; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { opacity: .85; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(0, 0, 0, .04); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { opacity: .88; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); }
.btn[data-soon] { opacity: .6; pointer-events: none; }
.text-link { font-size: 16px; font-weight: 400; color: var(--accent); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- 繼續閱讀 ---------- */
.continue-wrap { padding-bottom: 10px; }
.continue-card {
  display: flex; align-items: center; gap: 20px;
  max-width: 720px; margin: 0 auto;
  padding: 16px 24px; border-radius: 20px;
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .07);
  text-decoration: none;
  transition: transform .3s ease, box-shadow .3s ease;
}
.continue-card:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(0, 0, 0, .12); }
.continue-cover {
  flex: 0 0 56px; height: 56px; border-radius: 12px; overflow: hidden;
  background: var(--bg-2);
}
.continue-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.continue-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.continue-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--accent); }
.continue-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-sub { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-bar { height: 3px; border-radius: 99px; background: var(--bg-2); margin-top: 6px; overflow: hidden; }
.continue-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.continue-arrow { font-size: 20px; font-weight: 600; color: var(--text-2); }
.hidden { display: none !important; }

/* ---------- 書架 ---------- */
.shelf-section { background: var(--bg-2); padding: 110px 0 120px; }
.section-head { text-align: center; margin-bottom: 60px; }
.section-head h2 { margin: 0; font-size: clamp(36px, 4.5vw, 48px); font-weight: 700; letter-spacing: -0.015em; }
.section-head p { margin: 14px 0 0; font-size: 19px; color: var(--text-2); }

.shelf {
  display: flex; gap: 26px;
  overflow-x: auto; padding: 14px 40px 30px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}
.shelf.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.shelf::-webkit-scrollbar { display: none; }

.book-card {
  flex: 0 0 252px; position: relative; text-decoration: none;
  scroll-snap-align: center;
}
.book-card .art {
  display: block;
  aspect-ratio: 1 / 1; width: 100%;
  border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-2);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease;
}
.book-card .art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.book-card:hover .art { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.book-name { display: block; margin-top: 16px; font-size: 17px; font-weight: 600; text-align: center; color: var(--text); }
.book-author { display: block; margin-top: 3px; font-size: 13.5px; color: var(--text-2); text-align: center; }
.book-status {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(29, 29, 31, .78);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff;
}
.book-status.done { background: rgba(168, 89, 47, .92); }
.book-card .art { box-shadow: var(--shadow); }

.shelf-edge {
  display: flex; align-items: center;
  font-size: 15px; color: var(--text-3);
}

/* ---------- 訂閱方案 ---------- */
.pricing-section { padding: 120px 0; }
.price-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  max-width: 1000px; margin: 0 auto;
}
.price-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 26px;
  padding: 42px 36px 36px;
}
.price-card h3 { margin: 0; font-size: 18px; font-weight: 700; }
.price { margin: 16px 0 4px; font-size: 52px; font-weight: 700; letter-spacing: -0.02em; }
.price span { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.price-alt { margin: 0 0 8px; font-size: 13.5px; color: var(--text-3); }
.price-card ul { list-style: none; margin: 20px 0 30px; padding: 0; }
.price-card li { position: relative; padding: 7px 0 7px 26px; font-size: 14.5px; color: var(--text-2); }
.price-card li::before {
  content: ""; position: absolute; left: 4px; top: 17px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.price-card .btn { margin-top: auto; }
.price-card--hot { background: var(--ink); }
.price-card--hot h3 { color: #fff; }
.price-card--hot .price { color: #fff; }
.price-card--hot .price span { color: rgba(255, 255, 255, .55); }
.price-card--hot .price-alt { color: rgba(255, 255, 255, .55); }
.price-card--hot li { color: rgba(255, 255, 255, .72); }
.price-card--hot li::before { background: #d98e5f; }
.hot-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  padding: 6px 18px; border-radius: 999px;
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 20px rgba(168, 89, 47, .4);
  white-space: nowrap;
}

/* ---------- 播客 ---------- */
.podcast { background: #000; padding: 120px 0; }
.podcast-inner { display: grid; grid-template-columns: 240px 1fr; gap: 64px; align-items: center; }
.podcast-art { width: 240px; height: 240px; border-radius: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.podcast-info .eyebrow { color: #a1a1a6; text-align: left; }
.podcast-title { margin: 14px 0 14px; font-size: clamp(36px, 4.5vw, 48px); font-weight: 700; color: #fff; letter-spacing: -0.015em; }
.podcast-sub { margin: 0 0 32px; max-width: 480px; font-size: 18px; color: #a1a1a6; line-height: 1.6; }
.podcast-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- 關於 / 頁腳 ---------- */
.about-section { padding: 120px 0 40px; }
.about { max-width: 660px; text-align: center; margin: 0 auto; }
.about h2 { margin: 0 0 22px; font-size: clamp(32px, 4vw, 42px); font-weight: 700; letter-spacing: -0.015em; }
.about p { margin: 0; font-size: 17px; color: var(--text-2); line-height: 1.9; }
.about-note { margin-top: 30px !important; font-size: 13px !important; color: var(--text-3) !important; letter-spacing: .05em; }

.site-footer { background: var(--bg-2); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 34px 32px 48px;
  font-size: 12.5px; color: var(--text-3);
}
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { text-decoration: none; color: var(--text-3); transition: color .2s ease; }
.footer-nav a:hover { color: var(--text); }

/* ---------- 書頁（書的 index） ---------- */
.book-hero { padding: 96px 0 60px; }
.book-hero-inner { display: grid; grid-template-columns: 300px 1fr; gap: 64px; align-items: center; }
.book-hero .art { display: block; width: 300px; height: 300px; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); }
.book-hero .art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.book-hero h1 { margin: 14px 0 8px; font-size: clamp(40px, 5vw, 56px); font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; }
.book-latin { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: .05em; }
.book-intro { margin: 22px 0 0; max-width: 600px; font-size: 16.5px; color: var(--text-2); line-height: 1.9; }
.book-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 30px; }
.chip {
  font-size: 12.5px; font-weight: 600;
  padding: 7px 15px; border-radius: 999px;
  background: var(--bg-2); color: var(--text-2);
}
.chip.done { background: rgba(168, 89, 47, .1); color: var(--accent); }
.book-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.toc-section { padding: 40px 0 120px; }
.toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.toc-head h2 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.015em; }
.toc-note { font-size: 14.5px; color: var(--text-3); }
.toc-list {
  background: #fff; border: 1px solid var(--border);
  border-radius: 24px; overflow: hidden;
}
.toc-row {
  display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 18px;
  padding: 20px 28px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background .18s ease;
}
.toc-row:last-child { border-bottom: none; }
.toc-row:hover { background: var(--bg-2); }
.toc-num { font-size: 19px; font-weight: 700; color: var(--accent); }
.toc-main { min-width: 0; }
.toc-title { font-size: 16.5px; font-weight: 600; color: var(--text); }
.toc-meta { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.toc-side { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.toc-state.done { color: var(--accent); }
.toc-arrow { font-size: 17px; color: var(--text-3); }

/* ---------- 翻譯中書頁 ---------- */
.soon-hero { text-align: center; padding: 130px 0 60px; }
.soon-hero .art { display: block; width: 260px; height: 260px; border-radius: 26px; overflow: hidden; margin: 0 auto 36px; box-shadow: var(--shadow-lg); }
.soon-hero .art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.soon-hero h1 { margin: 16px 0 8px; font-size: clamp(38px, 5vw, 52px); font-weight: 700; letter-spacing: -0.015em; }
.soon-hero .book-latin { color: var(--text-3); }
.soon-note { max-width: 520px; margin: 26px auto 0; font-size: 16.5px; color: var(--text-2); line-height: 1.9; }
.soon-actions { margin-top: 34px; display: flex; justify-content: center; gap: 14px; }

/* ---------- 入場動畫 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .65s ease, transform .65s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 50ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .book-hero-inner { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .book-hero .art { margin: 0 auto; }
  .book-chips, .book-actions { justify-content: center; }
  .book-intro { margin-left: auto; margin-right: auto; }
  .price-grid { grid-template-columns: 1fr; max-width: 480px; }
  .podcast-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 44px; }
  .podcast-info .eyebrow { text-align: center; }
  .podcast-sub { margin-left: auto; margin-right: auto; }
  .podcast-links { justify-content: center; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero { padding: 96px 0 84px; }
  .hero-sub { font-size: 18px; }
  .shelf { gap: 18px; padding: 12px 24px 26px; }
  .book-card { flex-basis: 156px; }
  .book-name { font-size: 14.5px; }
  .book-author { font-size: 12px; }
  .toc-row { grid-template-columns: 52px 1fr auto; padding: 16px 18px; gap: 12px; }
  .toc-num { font-size: 16px; }
  .toc-title { font-size: 15px; }
  .toc-meta { display: none; }
  .footer-inner { flex-direction: column; text-align: center; gap: 12px; }
}

/* ---------- 動效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
