/* 九方思想貓 個人品牌入口網站 v3
   配色與版面依「版面構想 v1」。字型只用系統內建的 Noto CJK TC（或同等繁體字型），不從網路載入。 */

@font-face {
  font-family: "JF Serif TC";
  src: local("Noto Serif CJK TC"), local("Noto Serif CJK TC Regular"), local("Noto Serif TC"), local("Source Han Serif TC"), local("Songti TC"), local("PMingLiU");
  font-weight: 400;
}
@font-face {
  font-family: "JF Serif TC";
  src: local("Noto Serif CJK TC Bold"), local("Noto Serif TC Bold"), local("Source Han Serif TC Bold"), local("Songti TC Bold"), local("Noto Serif CJK TC"), local("PMingLiU");
  font-weight: 700;
}
@font-face {
  font-family: "JF Sans TC";
  src: local("Noto Sans CJK TC"), local("Noto Sans CJK TC Regular"), local("Noto Sans TC"), local("Source Han Sans TC"), local("PingFang TC"), local("Microsoft JhengHei");
  font-weight: 400;
}
@font-face {
  font-family: "JF Sans TC";
  src: local("Noto Sans CJK TC Bold"), local("Noto Sans TC Bold"), local("Source Han Sans TC Bold"), local("PingFang TC Semibold"), local("Microsoft JhengHei Bold"), local("Noto Sans CJK TC");
  font-weight: 700;
}

:root {
  --bg: #F6F1E8;
  --bg-deep: #EFE8DB;
  --paper: #FFFBF5;
  --ink: #1C1A17;
  --ink-soft: #5E5953;
  --line-soft: rgba(28, 26, 23, 0.14);
  --cat: #EEEEEE;
  --paw: #F4A49C;
  --paw-deep: #D48B84;
  --heart: #DC7060;
  --heart-deep: #C45C4E;
  --eye: #A05044;
  --eye-bright: #BC3024;
  --heart-badge: #A83C30; /* 限制級標籤底色，白字對比約 6.3:1 */
  --cover-ink-bg: #1C1A17;
  --cover-warm-bg: #E8D9C8;
  --cover-pink-bg: #F6D6D1;
  --cover-dusk-bg: #3A2E2C;
  --star: #FFD269;
  --star-deep: #FFAD2B;
  --max: 1180px;
  --serif: "JF Serif TC", "Noto Serif CJK TC", "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "JF Sans TC", "Noto Sans CJK TC", "Noto Sans TC", "Source Han Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 8px; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 40px; }

/* 導覽 */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 22px 40px;
}
.nav-brand {
  font-family: var(--serif); font-size: 20px; letter-spacing: 0.12em;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; cursor: pointer;
}
.nav-brand img { width: 36px; height: 36px; object-fit: contain; }
.nav-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px;
  font-size: 15px; letter-spacing: 0.06em;
}
.nav-links a:not(.btn) { border-bottom: 1px solid transparent; padding-bottom: 2px; }
.nav-links a:not(.btn):hover { border-bottom-color: var(--ink); }

/* 按鈕 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border-radius: 999px;
  font-size: 15px; letter-spacing: 0.08em;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg);
  cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: 0.85; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--eye); outline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--ink); }
/* 贊助按鈕：深紅底（--heart-badge）配白字，對比約 6.3:1；文字長時可換行 */
.btn-heart {
  background: var(--heart-badge); border-color: #8F2F25; color: #fff;
  min-width: 240px; max-width: 100%; min-height: 52px; font-size: 16px;
  height: auto; padding-top: 12px; padding-bottom: 12px; line-height: 1.5;
  white-space: normal; text-align: center; overflow-wrap: anywhere;
}
.btn-small { min-height: 40px; padding: 0 20px; font-size: 14px; }

/* 主視覺 */
.hero { padding: 28px 0 56px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
.eyebrow { font-size: 14px; letter-spacing: 0.28em; color: var(--ink-soft); margin-bottom: 16px; }
.hero h1 {
  font-family: var(--serif); font-weight: 700; font-size: 76px; line-height: 1.15;
  letter-spacing: 0.08em; margin-bottom: 28px;
}
.hero-lead { font-size: 20px; line-height: 1.8; margin-bottom: 12px; }
.hero-quote { font-family: var(--serif); font-size: 18px; color: var(--ink-soft); margin: 8px 0 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-visual {
  position: relative; display: flex; justify-content: center; align-items: flex-end;
  width: 100%; height: 560px;
}
.hero-cat { width: 560px; height: 560px; max-width: 100%; object-fit: contain; object-position: center bottom; }
.deco { position: absolute; pointer-events: none; object-fit: contain; }
.deco-star { width: 72px; top: 36px; left: 18px; transform: rotate(-12deg); }
.deco-heart { width: 56px; top: 120px; right: 8px; transform: rotate(10deg); }

/* 通用區塊 */
.band { background: var(--bg-deep); }
.section { padding: 88px 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.section-kicker { font-size: 13px; letter-spacing: 0.24em; color: var(--ink-soft); margin-bottom: 8px; }
.section-title { font-family: var(--serif); font-size: 40px; letter-spacing: 0.1em; font-weight: 700; line-height: 1.3; }
.section-intro { font-size: 16px; color: var(--ink-soft); max-width: 40em; margin: -12px 0 36px; }
.section-quote {
  font-family: var(--serif); font-size: 22px; line-height: 1.8; text-align: center;
  margin: 0 auto 48px; max-width: 22em;
}
.head-stickers { display: flex; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.head-stickers img { object-fit: contain; height: auto; }
.sticker-lg { width: 132px; }
.sticker-md { width: 108px; }

/* 實績 */
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ach-card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 16px; padding: 28px 28px 24px; min-height: 220px; }
.ach-card h3 { font-family: var(--serif); font-size: 22px; letter-spacing: 0.06em; margin: 0 0 14px; line-height: 1.45; }
.ach-card ul { padding-left: 1.15em; }
.ach-card li { margin: 4px 0; }
.ach-card p { color: var(--ink-soft); }
.ach-label { display: inline-block; font-size: 12px; letter-spacing: 0.16em; color: var(--eye); margin-bottom: 10px; }

/* 書卡 */
.subhead {
  font-family: var(--serif); font-size: 22px; letter-spacing: 0.12em; margin: 8px 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.subhead::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 56px; }
.book { background: var(--paper); border-radius: 16px; border: 1px solid var(--line-soft); overflow: hidden; display: flex; flex-direction: column; }
.cover {
  height: 280px; padding: 24px 22px 20px; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; box-shadow: inset -10px 0 0 rgba(0,0,0,0.06);
}
.cover-ink { background: var(--cover-ink-bg); color: var(--bg); }
.cover-warm { background: var(--cover-warm-bg); color: var(--ink); }
.cover-pink { background: var(--cover-pink-bg); color: var(--ink); }
.cover-dusk { background: var(--cover-dusk-bg); color: var(--bg); }
.book-tag {
  align-self: flex-start; font-size: 12px; letter-spacing: 0.2em; border: 1px solid currentColor;
  padding: 3px 10px; border-radius: 999px; opacity: 0.9;
}
.cover h3 { font-family: var(--serif); font-size: 28px; line-height: 1.4; letter-spacing: 0.08em; font-weight: 700; overflow-wrap: anywhere; }
.cover-dusk h3 { font-size: 24px; }
.book-body { padding: 16px 20px 20px; }
.book-body-center { display: flex; flex-direction: column; justify-content: center; }
.book-meta { font-size: 14px; color: var(--ink-soft); white-space: pre-line; }
.book-blurb { font-family: var(--serif); font-size: 15px; color: var(--ink-soft); margin-top: 6px; }
.badge-18 {
  display: inline-block; font-size: 11px; letter-spacing: 0.12em; background: var(--heart-badge); color: #fff;
  border-radius: 4px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}
.ebook-wrap { margin-bottom: 56px; }
.ebook-card {
  display: grid; grid-template-columns: 220px 1fr; background: var(--paper);
  border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; max-width: 720px;
}
.ebook-card .cover { height: auto; min-height: 200px; }

/* 連載與授權 */
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 56px; }
.mini-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.subgroup:last-child .mini-grid { margin-bottom: 0; }
.mini-card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 14px; padding: 20px 18px 18px; }
.mini-card h3 { font-family: var(--serif); font-size: 18px; letter-spacing: 0.04em; line-height: 1.45; margin-bottom: 8px; }
.mini-card p { font-size: 14px; color: var(--ink-soft); }
.pill {
  display: inline-block; font-size: 11px; letter-spacing: 0.1em; border: 1px solid var(--paw-deep);
  color: var(--eye); border-radius: 999px; padding: 1px 8px; margin-bottom: 8px;
}

/* 程式麻瓜田 */
.work-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: start; }
.work-card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.work-shot { background: #1a2420; aspect-ratio: 16 / 10; overflow: hidden; }
.work-shot picture, .work-shot img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.work-placeholder { background: var(--bg); height: 280px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.work-placeholder picture { display: contents; }
.work-placeholder img { width: auto; height: auto; max-width: 72%; max-height: 90%; object-fit: contain; }
.work-body { padding: 22px 24px 26px; }
.work-body h3 { font-family: var(--serif); font-size: 24px; letter-spacing: 0.06em; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.work-body p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }
.work-body .card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.badge {
  display: inline-block; font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em; border-radius: 999px;
  padding: 3px 10px; background: var(--ink); color: var(--bg); font-weight: 400; line-height: 1.6; vertical-align: middle;
}

/* 贊助 */
.sponsor { text-align: center; padding: 96px 0; }
.sponsor-art { position: relative; display: flex; justify-content: center; align-items: center; height: 200px; margin-bottom: 8px; }
.sponsor-art .main { width: 180px; height: auto; object-fit: contain; position: relative; z-index: 1; }
.sponsor-art .heart-l, .sponsor-art .heart-r { width: 64px; position: absolute; object-fit: contain; }
.sponsor-art .heart-l { left: calc(50% - 170px); top: 20px; transform: rotate(-16deg); }
.sponsor-art .heart-r { right: calc(50% - 170px); bottom: 16px; transform: rotate(14deg); }
.sponsor h2 { font-family: var(--serif); font-size: 36px; letter-spacing: 0.12em; margin: 8px 0 12px; }
.sponsor-body { color: var(--ink-soft); margin-bottom: 28px; }
.sponsor h2 + .btn { margin-top: 16px; }
.sponsor h2 + .sponsor-body:not([hidden]) + .btn { margin-top: 0; }

/* 頁尾 */
.footer { background: #2A2622; color: #F6F1E8; padding: 72px 0 48px; text-align: center; }
.footer .kicker { font-size: 13px; letter-spacing: 0.24em; color: rgba(246,241,232,0.7); margin-bottom: 8px; }
.footer h2 { font-family: var(--serif); font-size: 28px; letter-spacing: 0.1em; margin-bottom: 8px; }
.footer .handle { font-size: 20px; letter-spacing: 0.04em; margin-bottom: 6px; }
.footer .handle a { border-bottom: 1px solid rgba(246,241,232,0.4); }
.footer .url { color: rgba(246,241,232,0.7); font-size: 14px; margin-bottom: 28px; overflow-wrap: anywhere; }
.footer .paw { width: 120px; height: auto; object-fit: contain; margin: 0 auto 28px; }
.footer .copy { font-size: 13px; color: rgba(246,241,232,0.55); letter-spacing: 0.04em; }
.footer-slim { padding: 40px 0 32px; }
.footer-slim .footer-home { border-bottom: 1px solid rgba(246,241,232,0.4); }
.footer-slim .footer-name { font-family: var(--serif); font-size: 18px; letter-spacing: 0.1em; margin: 12px 0 4px; }

/* 作品介紹頁 */
.work-top { padding: 48px 0 24px; }
.work-top .eyebrow a { border-bottom: 1px solid var(--line-soft); letter-spacing: 0.12em; }
.work-name { font-family: var(--serif); font-size: 52px; line-height: 1.25; letter-spacing: 0.08em; margin-bottom: 16px; }
.work-name .badge { font-size: 13px; padding: 4px 12px; letter-spacing: 0.1em; }
.tagline { font-family: var(--serif); font-size: 22px; line-height: 1.8; max-width: 30em; margin-bottom: 16px; }
.work-lead { max-width: 38em; color: var(--ink-soft); margin-bottom: 24px; }
.work-top .btn { margin-bottom: 8px; }
.note { font-size: 14px; color: var(--ink-soft); max-width: 38em; }
.work-shots { padding: 24px 0 56px; }
.hero-shots { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.hero-shots:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.shot { margin: 0; }
.shot img {
  width: 100%; height: auto; object-fit: contain; border-radius: 12px;
  border: 1px solid var(--line-soft); background: #1a2420;
}
.features .section-title { margin-bottom: 12px; font-size: 34px; }
.features .section-intro { margin: 0 0 40px; }
.feature { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; padding: 36px 0; border-top: 1px solid var(--line-soft); }
.feature-no {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--paw); color: var(--ink); font-size: 14px; margin-bottom: 12px;
}
.feature h3 { font-family: var(--serif); font-size: 24px; line-height: 1.5; letter-spacing: 0.04em; margin-bottom: 12px; }
.feature p { color: var(--ink-soft); }
.feature-shots { display: grid; gap: 16px; align-content: start; }
.feature-shots:empty { display: none; }
.feature-shots .shot-phone img { max-width: 240px; }
.feature:has(.feature-shots:empty) { grid-template-columns: minmax(0, 1fr); max-width: 44em; }

.work-footnote { padding: 8px 0 40px; }
.work-footnote .note { font-size: 13px; }

.load-error { background: #fff; color: var(--eye-bright); border: 1px solid var(--eye); border-radius: 8px; padding: 16px; margin: 24px; }

/* 平板 */
@media (max-width: 1000px) {
  .hero h1 { font-size: 60px; }
  .hero-visual, .hero-cat { height: 440px; }
  .hero-cat { width: 440px; }
  .mini-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .feature { grid-template-columns: 1fr; gap: 20px; }
}

/* 主視覺引句：電腦版與平板（≥768px）每句一行，只在句號後換行；手機維持自然換行 */
@media (min-width: 768px) {
  .hero-quote .q-line { display: block; white-space: nowrap; }
}

/* 手機 */
@media (max-width: 800px) {
  .wrap { padding: 0 20px; }
  .nav { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 20px 8px; }
  .nav-links { gap: 8px 18px; font-size: 14px; }
  .hero { padding: 12px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero h1 { font-size: 40px; letter-spacing: 0.06em; margin-bottom: 16px; }
  .hero-lead { font-size: 17px; }
  .hero-quote { font-size: 16px; margin-bottom: 24px; }
  .hero-visual { order: -1; height: 280px; margin: 0 auto 12px; }
  .hero-cat { width: 280px; height: 280px; }
  .deco-star { width: 48px; top: 8px; left: 8px; }
  .deco-heart { width: 40px; top: 28px; right: 4px; }
  .section { padding: 56px 20px; }
  .section-title { font-size: 30px; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-quote { font-size: 18px; margin-bottom: 36px; }
  .ach-grid, .book-grid, .mini-grid, .mini-grid.cols-4, .work-grid, .ebook-card { grid-template-columns: 1fr; }
  .cover { height: 240px; }
  .cover h3 { font-size: 26px; }
  .head-stickers { align-self: flex-end; }
  .sticker-lg { width: 100px; }
  .sticker-md { width: 84px; }
  .work-shot { aspect-ratio: auto; height: auto; }
  .work-shot picture, .work-shot img { height: auto; }
  .work-placeholder { height: 240px; }
  .sponsor { padding: 64px 0; }
  .sponsor h2 { font-size: 28px; letter-spacing: 0.08em; }
  .sponsor-art .heart-l { left: 0; }
  .sponsor-art .heart-r { right: 0; }
  .footer { padding: 56px 0 40px; }
  .footer-slim { padding: 32px 0 28px; }
  /* 手機版「回首頁」只留導覽列那一個，頁面內與頁尾的收起來 */
  .work-top .eyebrow { display: none; }
  .footer-home-row { display: none; }
  .work-top { padding: 28px 0 16px; }
  .work-name { font-size: 34px; }
  .tagline { font-size: 18px; }
  .hero-shots { grid-template-columns: 1fr; }
  .shot-phone img { max-width: 260px; }
  .features .section-title { font-size: 26px; }
}
