/* 帥爸 AI 教育實驗室
   版面參考親切型的個人知識網站：開頭打招呼、「我可以怎麼幫你」卡片、熱門影片、文章、訂閱。
   配色取自 theme-kit 的「童趣色塊」：米白底、深藏青字與按鈕，亮黃與粉紫只當色塊、不當字；
   平面、不加陰影，層次靠粗字重。只有淺色，沒有深色模式。 */
:root {
  --paper: #fbf8ef;
  --paper-2: #e9ecfb;
  --surface: #ffffff;
  --ink: #23306e;
  --muted: #62688c;
  --line: #ece6d6;
  --primary: #23306e;
  --primary-2: #2f3d85;
  --primary-soft: #e9ecfb;
  --yellow: #ffd43b;
  --yellow-soft: #fff4c7;
  --pink: #f6a8ee;
  --on-primary: #ffffff;
  --radius: 20px;
  --max: 1120px;
  --sans: "Noto Sans TC", system-ui, -apple-system, sans-serif;
  --heading: "Noto Serif TC", "Songti TC", serif;  /* 標題用明體（用戶 2026-10-29 選定），內文用黑體 */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--heading); font-weight: 900; line-height: 1.3; margin: 0; letter-spacing: .01em; text-wrap: balance; }
p { margin: 0; }

.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* 雛形提示條 */
.proto-note {
  background: var(--yellow-soft);
  color: var(--ink);
  text-align: center;
  font-size: 13px;
  padding: 6px 16px;
}

/* 頂欄 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { font-family: var(--sans); font-weight: 700; font-size: 19px; text-decoration: none; white-space: nowrap; }
.brand b { color: var(--primary); }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { border-color: var(--primary); color: var(--primary); }
.btn.small { padding: 8px 16px; font-size: 14px; }

.eyebrow { font-size: 14px; color: var(--muted); letter-spacing: .08em; margin-bottom: 14px; }

/* 開場 */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.hero-photo { position: relative; aspect-ratio: 1; max-width: 420px; justify-self: center; width: 100%; }
.hero-photo .blob {
  position: absolute; inset: 6% 0 0 6%;
  background: var(--yellow);
  border-radius: 50% 50% 50% 12%;
}
.hero-photo .ring {
  position: absolute; inset: 0 6% 6% 0; border-radius: 50%;
  border: 2px dashed var(--primary); opacity: .35;
}
.hero-photo img {
  position: absolute; inset: 4% 4% 4% 10%;
  width: 86%; height: 92%;
  object-fit: cover; object-position: 50% 8%;
  border-radius: 0 0 50% 50% / 0 0 46% 46%;
}
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); margin-bottom: 22px; }
.hero h1 .mark { position: relative; white-space: nowrap; }
.hero h1 .mark svg { position: absolute; left: -2%; bottom: -.18em; width: 104%; height: .4em; color: var(--yellow); }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 34em; margin-bottom: 30px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* 特色區（最新實驗） */
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 36px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 36px; align-items: center;
}
.feature h2 { font-size: 28px; margin-bottom: 12px; }
.feature p { color: var(--muted); margin-bottom: 20px; }
.tag { display: inline-block; font-size: 13px; padding: 2px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; margin-bottom: 14px; }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.embed iframe, .embed button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed button { padding: 0; cursor: pointer; background: #000; }
.embed button img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 68px; height: 68px; border-radius: 50%; background: var(--primary); color: #fff;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgb(0 0 0 / .3);
}

.trust { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; padding: 26px 0 0; color: var(--muted); font-size: 14px; }
.trust b { color: var(--ink); font-size: 18px; margin-right: 4px; }

/* 區塊 */
.block { padding: 88px 0; }
.block.alt { background: var(--paper-2); }
.block-head { margin-bottom: 40px; max-width: 40em; }
.block-head h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 12px; }
.block-head p { color: var(--muted); }
.circled { position: relative; display: inline-block; padding: 0 .1em; }
.circled svg { position: absolute; inset: -18% -12%; width: 124%; height: 136%; color: var(--primary); opacity: .55; pointer-events: none; }

/* 我可以怎麼幫你：錯落兩欄 */
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.help-intro h2 { font-size: clamp(34px, 4.6vw, 52px); }
.help-intro p { color: var(--muted); margin-top: 16px; max-width: 22em; }
.help .col { display: grid; gap: 28px; }
.help .col.offset { padding-top: 24px; }
.help-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; text-decoration: none; display: block;
  transition: transform .2s ease, box-shadow .2s ease;
}
.help-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgb(0 0 0 / .07); }
.help-card svg { width: 54px; height: 54px; margin-bottom: 18px; }
.help-card h3 { font-size: 24px; margin-bottom: 10px; }
.help-card p { color: var(--muted); margin-bottom: 16px; }
.go { font-size: 15px; font-weight: 600; color: var(--primary); }

/* AI 工具：依年齡分四欄 */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stage { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; }
.stage:nth-child(1) { border-top: 8px solid var(--yellow); }
.stage:nth-child(2) { border-top: 8px solid var(--pink); }
.stage:nth-child(3) { border-top: 8px solid var(--primary); }
.stage:nth-child(4) { border-top: 8px solid var(--muted); }
.stage-age { font-size: 13px; font-weight: 700; color: var(--muted); }
.stage h3 { font-size: 21px; margin: 4px 0 14px; }
.stage ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.stage li { display: grid; gap: 2px; font-size: 15px; line-height: 1.5; }
.stage li a, .stage li b { font-weight: 700; color: var(--ink); }
.stage li a { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.stage li span { color: var(--muted); font-size: 14px; }
.stage-more { margin-top: 24px; color: var(--muted); font-size: 15px; }
.stage-more a { color: var(--primary); font-weight: 600; }
@media (max-width: 1000px) { .stages { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .stages { grid-template-columns: 1fr; } }

/* 文章卡片 */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
#other-posts { grid-template-columns: repeat(2, 1fr); }
.post .tag { align-self: flex-start; }
.post[hidden], .filter[hidden] { display: none; }
.post {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; text-decoration: none; display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.post:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgb(0 0 0 / .07); }
.post .meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.post h3 { font-size: 22px; }
.post p { color: var(--muted); font-size: 16px; }
.post .go { margin-top: auto; padding-top: 6px; }
.post.lead-post { grid-column: 1 / -1; background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.post.lead-post p, .post.lead-post .meta, .post.lead-post .go { color: color-mix(in srgb, var(--on-primary) 82%, transparent); }
.post.lead-post .tag { background: color-mix(in srgb, var(--on-primary) 18%, transparent); color: var(--on-primary); }
.post.lead-post h3 { font-size: 28px; }
.more { margin-top: 32px; text-align: center; }
.forum {
  margin-top: 32px; display: flex; align-items: center; gap: 24px; text-decoration: none;
  background: var(--surface); border: 1.5px dashed var(--primary); border-radius: var(--radius); padding: 24px 28px;
}
.forum svg { width: 56px; height: 56px; flex: none; }
.forum div { flex: 1; }
.forum h3 { font-size: 22px; margin-bottom: 4px; }
.forum p { color: var(--muted); font-size: 16px; }
.forum .btn { flex: none; }
@media (max-width: 600px) { .forum { flex-direction: column; align-items: flex-start; } }

/* 影片 */
.videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.vcard { text-decoration: none; display: block; }
.vcard .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--paper-2); margin-bottom: 12px; }
.vcard .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.vcard:hover .thumb img { transform: scale(1.04); }
.vcard .dur { position: absolute; right: 8px; bottom: 8px; background: rgb(0 0 0 / .75); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.vcard h3 { font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.55; }
.vcard .who { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 關於 */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about img { border-radius: 24px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.about h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 18px; }
.about p { color: var(--muted); margin-bottom: 14px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.tools span { font-size: 14px; font-weight: 700; padding: 4px 14px; border-radius: 999px; background: var(--yellow); color: var(--ink); }
.about ul { padding: 0; margin: 20px 0 0; list-style: none; display: grid; gap: 10px; }
.about li { padding-left: 28px; position: relative; }
.about li::before { content: ""; position: absolute; left: 0; top: .7em; width: 14px; height: 3px; border-radius: 2px; background: var(--yellow); }

/* 訂閱 */
.subscribe {
  background: var(--primary); color: var(--on-primary); border-radius: 28px;
  padding: 56px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center;
}
.subscribe h2 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 12px; }
.subscribe p { color: color-mix(in srgb, var(--on-primary) 80%, transparent); }
.subscribe form { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe input {
  flex: 1 1 220px; padding: 13px 18px; border-radius: 999px; border: 0;
  font: inherit; font-size: 16px; background: var(--surface); color: var(--ink);
}
.subscribe .btn { background: var(--yellow); color: #1e2a2f; }
.subscribe small { display: block; flex-basis: 100%; margin-top: 10px; font-size: 13px; color: color-mix(in srgb, var(--on-primary) 70%, transparent); }

/* 頁尾 */
.footer { padding: 56px 0 40px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer .wrap { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer h4 { font-size: 14px; color: var(--ink); margin: 0 0 10px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer .sign { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.footer .sign img { width: 26px; height: 26px; }

/* 文章頁 */
.article { padding: 64px 0 88px; }
.article .wrap { max-width: 720px; }
.article .back { font-size: 15px; color: var(--primary); text-decoration: none; }
.article h1 { font-size: clamp(30px, 4.4vw, 44px); margin: 18px 0 14px; }
.article .meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.article .body { font-size: 18px; line-height: 2; }
.article .body p { margin: 0 0 1.3em; }
.article .body h2 { font-size: 26px; margin: 2em 0 .7em; }
.article .body blockquote {
  margin: 1.6em 0; padding: 18px 24px; border-left: 4px solid var(--yellow);
  background: var(--surface); border-radius: 0 12px 12px 0; font-family: var(--heading); font-size: 20px;
}
.article .body ol, .article .body ul { padding-left: 1.4em; margin: 0 0 1.3em; }
.article .body li { margin-bottom: .5em; }
.article .endnote { margin-top: 48px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.article .endnote h3 { font-size: 20px; margin-bottom: 8px; }
.article .endnote p { color: var(--muted); margin-bottom: 16px; }

/* 手機 */
@media (max-width: 860px) {
  .nav { display: none; }
  .topbar .btn { margin-left: auto; }
  .hero { padding: 40px 0; }
  .hero .wrap, .feature, .about, .subscribe, .help { grid-template-columns: 1fr; }
  .hero-photo { max-width: 300px; }
  .help .col.offset { margin-top: 0; }
  .posts, .videos, #other-posts { grid-template-columns: 1fr; }
  .post.lead-post { grid-column: auto; }
  .feature, .subscribe { padding: 28px 22px; }
  .block { padding: 64px 0; }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
}

.proto-note a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.next-head { font-size: 24px; margin: 56px 0 20px; }

/* 童趣色塊：粗字重、細框、卡片微歪、粉紫訂閱區 */
h1, h2, h3 { font-weight: 900; }
.help-card,
.post,
.feature { border-width: 1.5px; }
.help-card:hover,
.post:hover { box-shadow: none; transform: translateY(-3px) rotate(0deg); }
.help .col > .help-card:nth-child(odd) { rotate: -1deg; }
.help .col > .help-card:nth-child(even) { rotate: .8deg; }
.hero-photo .ring { border: 0; background: var(--pink); opacity: 1; inset: auto 2% 4% auto; width: 26%; height: 26%; border-radius: 32%; rotate: 14deg; }
.play { box-shadow: none; }
.subscribe { background: var(--pink); color: var(--ink); }
.subscribe p,
.subscribe small { color: var(--ink); }
.subscribe .btn { background: var(--ink); color: #fff; }
.subscribe input { border: 1.5px solid var(--ink); }
.block.alt { background: var(--paper-2); }
.topbar { background: var(--paper); backdrop-filter: none; }

/* 短影音（內容來自 videos.js，清單是空的時候整段隱藏） */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filter {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 6px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
}
.filter.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.reel {
  display: grid; grid-auto-flow: column; grid-auto-columns: 230px; gap: 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px;
}
.clip { margin: 0; scroll-snap-align: start; }
.clip[hidden] { display: none; }
.clip video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: #000; border-radius: var(--radius); }
.clip figcaption { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.clip-tag { color: var(--muted); font-size: 13px; font-weight: 600; }
.clip strong { font-size: 15px; line-height: 1.5; }
@media (max-width: 860px) { .reel { grid-auto-columns: 62%; } }
