/* ============================================================
   把天聊死，不如把愛聊活 —— 版型
   原則：行動裝置優先、任何內容都不得撐破容器
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* 內文欄寬；文章內的圖片寬度上限也綁這個值 */
  --content-width: 44rem;
  /* 卡片牆與 HERO 可以比內文寬 */
  --wide-width: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* 亮色：偏暖的紙感，不用純白，避免長文刺眼 */
  --bg: #faf7f3;
  --surface: #ffffff;
  --text: #22262b;
  --muted: #6b7178;
  --line: #e7e0d6;
  --accent: #a63f52;         /* 深玫瑰：對應「愛」，不甜膩 */
  --accent-ink: #82303f;
  --game: #2f6b6f;           /* 深青：對應「賽局」的冷靜面 */
  --tint: #f3ece7;
  --tint-2: #eef2f1;

  --shadow-sm: 0 1px 2px rgb(35 38 43 / 0.04), 0 2px 8px rgb(35 38 43 / 0.05);
  --shadow-md: 0 2px 6px rgb(35 38 43 / 0.06), 0 12px 28px rgb(35 38 43 / 0.10);

  --radius: 14px;
  --font: "Noto Sans TC", "PingFang TC", "Hiragino Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* 暗色模式：提高整體明度，避免糊成一片 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1e22;
    --surface: #24282e;
    --text: #e9e6e2;
    --muted: #a6aab0;
    --line: #383d44;
    --accent: #e79aa8;
    --accent-ink: #f0b5c0;
    --game: #7cc4c6;
    --tint: #2c3037;
    --tint-2: #293234;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.30);
    --shadow-md: 0 2px 6px rgb(0 0 0 / 0.30), 0 12px 28px rgb(0 0 0 / 0.36);
  }
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;          /* 最後一道保險，任何區塊都不該撐出橫向捲動 */
  scroll-behavior: smooth;
  /* 錨點跳轉時避開 sticky 頁首 */
  scroll-padding-top: 4.5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  word-break: break-word;
}

img, svg, video, canvas, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}
.wrap-wide {
  width: 100%;
  max-width: var(--wide-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: var(--gutter); top: 0.5rem; z-index: 20;
  background: var(--surface); padding: 0.5rem 0.75rem; border-radius: var(--radius);
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap-wide {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1rem;
  align-items: center; justify-content: space-between;
  padding-block: 0.75rem;
}
.site-title {
  font-weight: 700; font-size: 1rem; color: var(--text);
  text-decoration: none; min-width: 0; letter-spacing: 0.01em;
  white-space: nowrap;
}

/* 導覽項目多，窄螢幕改成單行橫向捲動，頁首不會長成三行 */
.site-nav {
  display: flex; gap: 0.35rem 1.1rem;
  min-width: 0; flex: 1 1 auto; justify-content: flex-end;
  overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  font-size: 0.875rem; text-decoration: none; color: var(--muted);
  white-space: nowrap; padding-block: 0.15rem;
}
.site-nav a:hover { color: var(--accent); }

@media (max-width: 40rem) {
  .site-header .wrap-wide { padding-block: 0.6rem; }
  .site-title { font-size: 0.9rem; }
  .site-nav { justify-content: flex-start; flex-basis: 100%; }
}

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

.actions {
  display: flex; flex-wrap: wrap; gap: 0.6rem 0.75rem;
  margin: 1.4rem 0 0;
}
.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-size: 0.95rem; font-weight: 600; line-height: 1.4;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  max-width: 100%;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); }
.btn-ghost {
  border-color: var(--line); color: var(--text); background: var(--surface);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .btn-primary { color: #23181c; }
}

/* ---------- HERO ----------
   文字面板與照片分開，文字永遠不壓在圖上：
   長中文標題在窄螢幕也不會被圖片邊界切到。 */

.hero {
  padding-block: clamp(2rem, 6vw, 3.75rem) clamp(1.5rem, 5vw, 3rem);
  background:
    radial-gradient(120% 90% at 12% 0%, var(--tint) 0%, transparent 60%),
    radial-gradient(100% 80% at 100% 10%, var(--tint-2) 0%, transparent 55%);
}
.hero-inner {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 52rem) {
  .hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.hero-text { min-width: 0; }
/* 沒有 HERO 照片、或照片走整幅橫幅版位時：不要留出空的第二欄，
   桌機才不會右邊空一大片、文字也不會被擠成窄長條 */
.hero-noimg .hero-inner,
.hero-hasbanner .hero-inner { grid-template-columns: 1fr; }
.hero-noimg .hero-inner { max-width: 54rem; }
.hero-hasbanner .hero-inner { max-width: 60rem; }

/* 整幅橫幅：本身已含文案的宣傳圖用這個版位，等比例縮放不裁切 */
.hero-banner { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.hero-banner .hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-banner .hero-media img { width: 100%; height: auto; }

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em;
  color: var(--game); text-transform: none;
}
.hero-text h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 6.4vw, 3rem);
  line-height: 1.28;
  letter-spacing: 0.005em;
  text-wrap: balance;
}
/* 標題分段：換行只發生在段與段之間，詞不會被切開 */
.hl-seg { display: inline-block; }

.hero-lead {
  margin: 0 0 1.1rem;
  font-size: clamp(1rem, 3.4vw, 1.16rem);
  line-height: 1.85;
  color: var(--text);
  max-width: 34em;
}
.book-line {
  margin: 0;
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent);
  font-size: 0.95rem; font-weight: 600; line-height: 1.6;
}
.book-sub {
  display: block;
  font-weight: 400; font-size: 0.85rem; color: var(--muted);
  margin-top: 0.15rem;
}
.intro-meta {
  margin: 1.1rem 0 0;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.1rem 0.5rem;
  font-size: 0.8rem; color: var(--muted);
}
.intro-meta .sep { opacity: 0.45; }

/* side 版位放的是商品照（立體書封），本身已經帶陰影和白底，
   不要再套卡片外框，否則會多出一個白盒子。橫幅版位另外在下面加回來。 */
.hero-media { margin: 0; }
/* 等比例縮放，不裁切、不變形 */
.hero-media img {
  width: 100%; height: auto;
  max-height: 34rem;
  object-fit: contain;
  margin-inline: auto;
}

/* ---------- 區塊通用 ---------- */

.sec { padding-block: clamp(2.25rem, 6.5vw, 4rem); }
.sec + .sec { border-top: 1px solid var(--line); }

.sec-head { margin: 0 0 clamp(1.25rem, 3.5vw, 2rem); }
.sec-head h2 {
  margin: 0;
  font-size: clamp(1.3rem, 4.8vw, 1.75rem);
  line-height: 1.4;
  text-wrap: balance;
}
.sec-sub {
  margin: 0.35rem 0 0;
  color: var(--game); font-weight: 600; font-size: 0.95rem;
}
.sec-intro {
  margin: 0.6rem 0 0;
  color: var(--muted); font-size: 0.95rem; line-height: 1.8;
  max-width: 42em;
}
.sub-head {
  margin: clamp(2rem, 5vw, 2.75rem) 0 1.1rem;
  font-size: 1.05rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- 一句反常識主張 ---------- */

.sec-thesis { background: var(--tint); }
.claim {
  margin: 0 0 1.75rem;
  font-size: clamp(1.15rem, 4.4vw, 1.55rem);
  line-height: 1.65; font-weight: 700;
  color: var(--accent-ink);
  text-wrap: balance;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
}
@media (prefers-color-scheme: dark) {
  .claim { color: var(--accent-ink); }
}

/* ---------- 你會看懂什麼 ---------- */

.learn-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: clamp(0.9rem, 2.5vw, 1.35rem);
}
.learn-item {
  position: relative;
  min-width: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.learn-no {
  display: block;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent); opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.learn-item h3 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.02rem; line-height: 1.5;
}
.learn-item p {
  margin: 0;
  font-size: 0.9rem; line-height: 1.75; color: var(--muted);
}

/* ---------- 嵌入（測驗、影片）---------- */

.embed {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
/* 測驗是完整的互動頁，需要比較高的可視高度 */
.embed-quiz { height: clamp(30rem, 76vh, 46rem); }
.embed-quiz iframe { height: 100%; }

.embed-video { aspect-ratio: 16 / 9; }
.embed-video iframe { height: 100%; }

.embed-fallback {
  margin: 0.75rem 0 0;
  font-size: 0.85rem; color: var(--muted);
}

.sec-quiz { background: var(--tint-2); }

/* 尚未加購 OOOPEN Lab 內嵌功能時的替代卡片 */
.quiz-card {
  padding: clamp(1.75rem, 5vw, 2.5rem) clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.quiz-mark { margin: 0 0 0.5rem; font-size: 2.25rem; line-height: 1; }
.quiz-cta-lead {
  margin: 0;
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  font-weight: 700; line-height: 1.6;
  text-wrap: balance;
}
.quiz-card .actions { justify-content: center; margin-top: 1.25rem; }
.quiz-note { margin: 1rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* ---------- 訪談 ---------- */

.video-list, .pod-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: clamp(1.1rem, 3vw, 1.75rem);
}
.video-item { min-width: 0; }
.video-show {
  margin: 0.7rem 0 0.1rem;
  font-size: 0.8rem; font-weight: 600; color: var(--game);
}
.video-title {
  margin: 0 0 0.35rem;
  font-size: 1rem; line-height: 1.55;
}
.video-note {
  margin: 0; font-size: 0.86rem; line-height: 1.7; color: var(--muted);
}

.pod-item {
  min-width: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.pod-link { text-decoration: none; color: inherit; }
.pod-show {
  margin: 0 0 0.2rem;
  font-size: 0.82rem; font-weight: 600; color: var(--game);
}
.pod-host {
  display: block;
  font-weight: 400; font-size: 0.78rem; color: var(--muted);
}
.pod-title {
  margin: 0 0 0.5rem;
  font-size: 1rem; line-height: 1.55;
}
.pod-link:hover .pod-title { text-decoration: underline; }
.pod-note {
  margin: 0 0 0.9rem;
  font-size: 0.86rem; line-height: 1.75; color: var(--muted);
}
.pod-go { margin: auto 0 0; font-size: 0.86rem; }
.pod-go a { text-decoration: none; font-weight: 600; }

/* ---------- 推薦語 ---------- */

.sec-praise { background: var(--tint); }
.praise-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
.praise-item {
  min-width: 0;
  padding: 1.3rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.praise-item blockquote {
  margin: 0 0 0.9rem;
  font-size: 0.94rem; line-height: 1.85;
  position: relative;
  padding-top: 1.35rem;
}
.praise-item blockquote::before {
  content: "\201C";
  position: absolute; top: -0.35rem; left: -0.1rem;
  font-size: 2.6rem; line-height: 1;
  color: var(--accent); opacity: 0.28;
}
.praise-by {
  margin: auto 0 0;
  font-size: 0.88rem; font-weight: 600;
}
.praise-by a { text-decoration: none; }
.praise-by a:hover { text-decoration: underline; }
.praise-role {
  display: block;
  font-weight: 400; font-size: 0.8rem; color: var(--muted); line-height: 1.6;
}

/* ---------- 購書 ---------- */

.buy-card {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  text-align: center;
}
/* 宣傳橫幅撐滿卡片、與卡片圓角切齊；等比例縮放不裁切 */
.buy-image {
  margin: calc(-1 * clamp(1.5rem, 4vw, 2.25rem)) calc(-1 * clamp(1.5rem, 4vw, 2.25rem)) clamp(1.25rem, 3vw, 1.75rem);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--tint);
}
.buy-image img { width: 100%; height: auto; }

.buy-card h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.25rem, 4.6vw, 1.6rem);
}
.buy-intro {
  margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.8;
  text-wrap: balance;
}
.buy-card .actions { justify-content: center; }

/* ---------- 加值資源 ---------- */

.res-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: clamp(0.9rem, 2.5vw, 1.25rem);
}
.res-item { min-width: 0; }
.res-item a {
  display: block; height: 100%;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.res-item a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.res-label {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--tint);
  padding: 0.15rem 0.55rem; border-radius: 999px;
  margin-bottom: 0.5rem;
}
.res-title {
  display: block;
  font-size: 0.98rem; font-weight: 600; line-height: 1.55;
}
.res-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem; color: var(--muted);
}

/* ---------- 延伸閱讀 ---------- */

.read-list {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}
.read-item {
  min-width: 0;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--game);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
}
.read-cond {
  margin: 0 0 0.35rem;
  font-size: 0.82rem; line-height: 1.7; color: var(--muted);
}
.read-item h3 { margin: 0 0 0.35rem; font-size: 1.02rem; line-height: 1.5; }
.read-item h3 a { text-decoration: none; }
.read-item h3 a:hover { text-decoration: underline; }
.read-note { margin: 0; font-size: 0.86rem; line-height: 1.75; color: var(--muted); }
.read-extra { margin: 0.5rem 0 0; font-size: 0.85rem; }
.read-extra a { text-decoration: none; font-weight: 600; }

/* ---------- 作者 ---------- */

.sec-author { background: var(--tint-2); }
.author-card {
  display: grid;
  gap: clamp(1rem, 3vw, 1.75rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 40rem) {
  .author-card { grid-template-columns: 11rem minmax(0, 1fr); }
}
.author-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tint);
  box-shadow: var(--shadow-sm);
  max-width: 11rem;
}
.author-photo img { width: 100%; height: auto; }
.author-body { min-width: 0; }
.author-body h2 { margin: 0 0 0.5rem; font-size: clamp(1.25rem, 4.4vw, 1.55rem); }
.author-body p { margin: 0 0 0.9rem; font-size: 0.95rem; line-height: 1.85; }
.author-name { font-weight: 700; }
.author-role {
  font-weight: 400; color: var(--muted); font-size: 0.88rem;
  margin-left: 0.5rem;
}
.author-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0; font-size: 0.9rem; }
.author-links a { text-decoration: none; font-weight: 600; }

/* ---------- 文章卡片牆 ---------- */

.listing-title {
  font-size: 1.05rem; margin: 0 0 1.25rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}
.listing-title .count { color: var(--muted); font-weight: 400; }

/* 等寬並排；窄螢幕自動落成單欄 */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
  /* stretch：同一列的卡片等高。配合下面的行數裁切，整面牆就完全一致 */
  align-items: stretch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card-cover {
  margin: 0;
  background: var(--tint);
  aspect-ratio: 3 / 2;           /* 每張封面等高，牆面才齊 */
  overflow: hidden;
}
.card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;             /* 等比裁切，不變形 */
}
/* 沒有封面圖時的替代底色，仍維持一致高度 */
.card-cover.is-empty {
  background: linear-gradient(135deg, var(--tint), var(--surface));
  display: grid; place-items: center;
}
.card-cover.is-empty span { font-size: 2rem; opacity: 0.35; }

/* 純文字卡片：上緣補一條主色，牆面才不會只剩一片方框 */
.card-textonly { border-top: 3px solid var(--accent); }
.card-textonly .card-body { padding-top: clamp(1.1rem, 3vw, 1.4rem); }

.card-body {
  padding: clamp(1rem, 3vw, 1.3rem);
  display: flex; flex-direction: column; gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.card-link { text-decoration: none; color: inherit; min-width: 0; }
/* 標題固定佔兩行、摘要固定佔三行 —— 內容長短不再影響卡片高度 */
.card-title {
  margin: 0 0 0.35rem;
  font-size: 1.12rem; line-height: 1.45;
  color: var(--accent-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.12rem * 1.45 * 2);
}
.card-link:hover .card-title { text-decoration: underline; }
.card-summary {
  margin: 0; color: var(--muted);
  font-size: 0.92rem; line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.92rem * 1.7 * 3);
}
.card-meta {
  margin: auto 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.15rem 0.5rem;
  color: var(--muted); font-size: 0.78rem; line-height: 1.6;
}
.card-meta .sep { opacity: 0.45; }
.card.empty { padding: 1.5rem; color: var(--muted); font-size: 0.95rem; }

.counter { font-variant-numeric: tabular-nums; }

@media (max-width: 26rem) {
  .card-meta .sep, .post-meta .sep { display: none; }
  .card-meta, .post-meta { gap: 0.1rem 0.75rem; }
}

/* ---------- 文章頁 ---------- */

.post { padding-block: clamp(1.75rem, 6vw, 3rem); }
.post-head h1 {
  font-size: clamp(1.5rem, 5.6vw, 2.15rem);
  line-height: 1.35; margin: 0 0 0.7rem;
  text-wrap: balance;
}
.post-meta {
  margin: 0;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.15rem 0.5rem;
  color: var(--muted); font-size: 0.83rem; line-height: 1.6;
}
.post-meta .sep { opacity: 0.45; }

/* 文章內的主圖：等比例縮放，寬度不超過內文欄寬（需求 4） */
.post-cover {
  margin: clamp(1.5rem, 4vw, 2rem) 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tint);
  box-shadow: var(--shadow-sm);
}
.post-cover img { width: 100%; height: auto; }

.prose { margin-top: clamp(1.5rem, 4vw, 2rem); }
.prose h2 {
  font-size: clamp(1.2rem, 4.6vw, 1.45rem);
  line-height: 1.4; margin: 2.2rem 0 0.75rem;
}
.prose h3 { font-size: clamp(1.05rem, 4vw, 1.2rem); margin: 1.8rem 0 0.6rem; }
.prose p { margin: 0 0 1.15rem; }
.prose p:last-child { margin-bottom: 0; }

/* 內文圖片：直式照片不要吃掉整個畫面，限高並置中 */
.prose img {
  max-width: 100%;
  max-height: 30rem;
  width: auto;
  margin: 1.5rem auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
  margin: 1.5rem 0; padding: 0.9rem 1.15rem;
  border-left: 3px solid var(--accent);
  background: var(--tint);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.25rem 0; }

/* 程式碼與表格：自己內部捲動，絕不撐破頁面 */
.prose pre {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1rem;
  font-size: 0.85rem; line-height: 1.6;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em; background: var(--tint);
  padding: 0.1em 0.35em; border-radius: 4px;
  overflow-wrap: break-word;
}
.prose pre code { background: none; padding: 0; }

.prose table {
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  max-width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; }
.prose th { background: var(--tint); }

.back {
  margin-top: 2.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line); font-size: 0.92rem;
}
.back a { text-decoration: none; }

/* ---------- 頁尾 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 1.75rem 2.5rem;
}
.foot-meta, .credit {
  margin: 0 0 0.4rem;
  color: var(--muted); font-size: 0.8rem; line-height: 1.7;
}
.foot-views { margin-bottom: 0; }
