/* assets/css/style.css — 全站共用樣式，唯一一份，所有頁面共用引用 */

body {
  margin: 0;
  background: #FDFBF9;
  font-family: "Noto Sans TC", system-ui, sans-serif;
  color: #4A4038;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
a { color: #8A6410; text-decoration: none; }
a:hover { color: #6E4E0A; }

/* 全站標題下的英文小標暫時隱藏（CSS 隱藏，之後如需恢復只要刪除這一段即可）：
   1) 大標題（H1）正下方的英文 eyebrow（例如 CONTENTS／BY AGE／BY CHAPTER），連同前面的金色小圓點一併隱藏
   2) 目錄頁分類標籤（toc-tab）下方的英文小字（例如 BABY RECORDS）
   3) 首頁瀏覽分類標題旁的英文小字（例如 BY AGE／BY TOPIC／BY SITUATION） */
.row-11:has(.eyebrow-label) { display: none; }
.tab-sub-label,
.group-sub-label { display: none; }

@keyframes riseIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

::-webkit-scrollbar { height: 6px; width: 6px; }

/* 通用 tooltip：按鈕加 data-tooltip="提示文字"，hover 或鍵盤 focus 時從正上方浮出提示泡泡 */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  max-width: 220px;
  width: max-content;
  text-align: center;
  white-space: normal;
  background: #3B3111;
  color: #FFF8E7;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  padding: 7px 12px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(74,64,56,.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 40;
}
[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #3B3111;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s;
  z-index: 40;
}
[data-tooltip]:hover::after, [data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after, [data-tooltip]:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
::-webkit-scrollbar-thumb { background: #E4DCD2; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* 導覽列目前頁面標示（依 body[data-page] 由 main.js 加上 .active） */
.site-nav-link.active {
  font-weight: 500;
  color: #3B3111 !important;
  background: #F5D678;
  padding: 8px 18px;
  border-radius: 999px;
}

/* 全站 Header：導覽列＋搜尋框（2026-10-04 改寫，原本直接寫在 nav/label 的 inline style
   改成下面這幾個 class，才能在手機斷點用 @media 覆寫，寫法改了但桌機/平板視覺數值不變）*/
.site-nav-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
.site-nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  align-items: center;
}
.site-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #E4DCD2;
  padding: 10px 16px;
}
.site-search-input {
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
  width: 92px;
  background: transparent;
  color: #4A4038;
}

/* 手機漢堡選單按鈕：桌機隱藏，平板＋手機（≤900px，2026-10-04 從 680px 放寬）都會出現 */
.site-nav-toggle {
  display: none;
  margin-left: auto;
  flex: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #E4DCD2;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.site-nav-toggle-icon-close { display: none; }
#site-header.is-nav-open .site-nav-toggle-icon-open { display: none; }
#site-header.is-nav-open .site-nav-toggle-icon-close { display: block; }

/* 平板＋手機（≤900px，2026-10-04 使用者要求「平板主選單也改成漢堡選單」，
   斷點從原本 Header 專屬的 680px 放寬到 900px，改沿用 .finder-grid 既有的
   900px 斷點，讓「平板」的認定在全站保持一致）：
   導覽列＋搜尋框預設收起來，點漢堡按鈕後（main.js 在 #site-header 加上 .is-nav-open）
   展開成 header 下方一整排直式選單 */
@media (max-width: 900px) {
  .site-nav-toggle { display: flex; }
  .site-nav-wrap {
    display: none;
    width: 100%;
    margin-left: 0;
  }
  #site-header.is-nav-open .site-nav-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    width: 100%;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #EFE9E2;
  }
  #site-header.is-nav-open .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  #site-header.is-nav-open .site-nav-link { padding: 10px 4px; }
  #site-header.is-nav-open .site-search { width: 100%; }
  #site-header.is-nav-open .site-search-input { width: 100%; flex: 1; }
}

/* 首頁主題手風琴章節列 */
.chapter-row-head {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: #FFFFFF;
}
.chapter-card { border-radius: 18px; background: #FFFFFF; box-shadow: 0 8px 22px rgba(74,64,56,.07); overflow: hidden; }
.chapter-no-label { font-family: 'Jost', sans-serif; font-size: 24px; font-weight: 200; letter-spacing: .04em; color: #6E5C34; flex: none; }
.chapter-title-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chapter-title-group b { font-size: 17px; font-weight: 700; line-height: 1.5; }
.chapter-sign { margin-left: auto; flex: none; width: 32px; height: 32px; border-radius: 999px; background: #FBF1D6; display: grid; place-items: center; font-size: 15px; color: #6E5C34; }
.chapter-body-list { display: flex; flex-direction: column; padding: 8px 20px 18px; }

/* 首頁章節搜尋：手風琴內每一列連到章節內容的連結 */
.chapter-link-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #4A4038; }
.chapter-link-row .row-dot { width: 7px; height: 7px; flex: none; background: #EFBB3C; }
.chapter-link-row .row-label { font-size: 14px; line-height: 1.6; }
.chapter-link-row .row-leader { flex: 1; min-width: 16px; height: 0; border-bottom: 2px dotted #DED3C2; }
.chapter-link-row .row-cta { flex: none; font-size: 13px; font-weight: 500; color: #6E5C34; }

/* 首頁分類瀏覽：主題標籤 chip */
.chip-pill { font-size: 14px; font-weight: 500; color: #4A4038; background: #FBF7F2; border: 1px solid #EFE7DC; padding: 9px 16px; border-radius: 999px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.group-title { font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.group-sub-label { font-family: 'Jost', sans-serif; font-size: 12px; font-weight: 400; letter-spacing: .2em; color: #7A6F66; }
.group-divider { flex: 1; height: 1px; background: #EFE9E2; min-width: 16px; }
.group-more-link { font-size: 13px; font-weight: 500; flex: none; }

/* 首頁主題輪播：單張卡片 */
/* 2026-10-06 修正：Swiper 預設（非 autoHeight 模式）不會把同一排的 .swiper-slide
   撐成一樣高——slide 本身雖然理論上該吃到 .swiper-wrapper 的 align-items:stretch，
   但 Swiper 官方 bundle CSS 對 .swiper-slide 另外設了 height:auto，實測下來同一排
   6 張卡片會各自照自己的文字內容高度顯示（例如「出生後 2 週～2 個月」這類較短的
   次標題卡片會比文字較多的卡片矮一截），跟卡片是不是目前可見、有沒有特效都無關。
   修法：直接在 .swiper-slide 自己身上加 align-self:stretch，強制它撐滿同一排的
   高度，.topic-card 原本就有 height:100%，會自動跟著撐滿，不用再動 .topic-card
   本身或 Swiper 的初始化參數（main.js 不用改）。只限定 .topics-swiper 這個首頁
   專屬的輪播，不影響其他頁面之後如果也用到 Swiper。 */
.topics-swiper .swiper-slide { align-self: stretch; height: auto; }
.topics-swiper { padding: 8px 2px 34px; }
.topics-swiper .swiper-pagination { position: static; margin-top: 20px; }
.topic-card { height: 100%; box-sizing: border-box; border-radius: 24px; background: #fff; box-shadow: 0 10px 30px rgba(74,64,56,.07); overflow: hidden; display: flex; flex-direction: column; }
.topic-card-head { position: relative; height: 88px; background: #FBF7F2; background-image: linear-gradient(#F1E9DE 1px,transparent 1px),linear-gradient(90deg,#F1E9DE 1px,transparent 1px); background-size: 28px 28px; display: flex; align-items: center; gap: 14px; padding: 0 24px; overflow: hidden; }
.topic-card-head .head-glow { position: absolute; left: -40px; bottom: -90px; width: 200px; height: 200px; border-radius: 999px; background: radial-gradient(circle at 50% 50%,rgba(239,187,60,.16) 0%,rgba(239,187,60,0) 70%); pointer-events: none; }
.topic-card-head .head-no { position: relative; font-family: 'Jost', sans-serif; font-size: 13px; font-weight: 400; letter-spacing: .22em; color: #6F655C; }
.topic-card-head .head-dot { position: relative; width: 5px; height: 5px; border-radius: 999px; background: #EFBB3C; flex: none; }
.topic-card-head .head-tag { position: relative; font-size: 19px; font-weight: 700; letter-spacing: .05em; line-height: 1.3; color: #4A4038; }
.topic-card-body { display: flex; flex-direction: column; gap: 12px; padding: 24px 26px 28px; flex: 1 1 auto; }
.topic-card-body b { font-size: 19px; font-weight: 700; line-height: 1.55; }
.topic-card-body small { font-size: 14px; font-weight: 400; line-height: 1.95; color: #6F655C; }
.topic-card-body a { font-size: 14px; font-weight: 500; margin-top: auto; padding-top: 2px; }

/* 依章節找頁：兒童發展篩檢連續圖，四大發展面向色塊（g=粗動作 f=細動作 l=語言及認知 s=身邊處理及社會性） */
.domain-block { display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 22px; border-radius: 18px; min-width: 0; }
.domain-block.domain-g { background: #FDF4F2; }
.domain-block.domain-f { background: #FFFAEA; }
.domain-block.domain-l { background: #EFF6FA; }
.domain-block.domain-s { background: #F1F7F1; }
.domain-block .domain-dot { width: 10px; height: 10px; flex: none; border-radius: 3px; }
.domain-block.domain-g .domain-dot { background: #C0392B; }
.domain-block.domain-f .domain-dot { background: #8A6410; }
.domain-block.domain-l .domain-dot { background: #2A80A8; }
.domain-block.domain-s .domain-dot { background: #4E7A57; }
.domain-alert-badge { margin-left: auto; font-size: 14px; font-weight: 500; color: #9B2D20; background: #FFFFFF; padding: 5px 12px; border-radius: 999px; }
.domain-empty-note { font-size: 14px; line-height: 1.8; color: #7A6F66; }
.domain-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #FFFFFF; border-radius: 12px; overflow: hidden; }
.domain-table th { text-align: left; font-size: 13px; font-weight: 500; letter-spacing: .06em; color: #6F655C; padding: 10px 14px; background: #FBF7F2; }
.domain-table th.col-age { width: 110px; white-space: nowrap; }
.domain-table th.col-fig { padding: 10px 8px; width: 150px; }
.domain-table td { border-top: 1px solid #F1EBE1; }
.domain-table td.age-cell { vertical-align: top; font-size: 14px; font-weight: 500; color: #6E5C34; padding: 12px 14px; white-space: nowrap; }
.domain-table td.fig-cell { vertical-align: top; padding: 10px 8px; }
.domain-table td.text-cell { vertical-align: top; font-size: 15px; line-height: 1.8; color: #4A4038; padding: 12px 14px; }
.domain-fig-box { display: block; width: 134px; height: 104px; border-radius: 10px; background-color: #FFFFFF; background-repeat: no-repeat; background-position: center; background-size: contain; }

/* is-hidden：取代 main.js 直接改寫 inline style.display 的做法，統一由 class 控制顯示/隱藏 */
.is-hidden { display: none !important; }

/* 依章節找頁：分頁按鈕上的章節編號 */
.tab-no-label { font-family: 'Jost', sans-serif; font-size: 15px; color: #6E5C34; }

/* 依年齡找／依情境找／依章節找 共用：上方章節分頁按鈕（點擊由 main.js 切換 .is-active） */
.page-tab {
  flex: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 14px 14px 0 0;
  background: #FFFFFF;
  color: #5C5142;
  box-shadow: 0 -2px 10px rgba(74,64,56,.05);
  transition: background .3s ease;
}
.page-tab.is-active {
  background: #FBF1D6;
  color: #3B3111;
  box-shadow: 0 -4px 16px rgba(74,64,56,.10);
}

/* 兒童發展篩檢連續圖：年齡區間圓角藥丸分頁 */
.pill-tab {
  flex: none;
  border: 1px solid #EAE3D9;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  color: #5C5449;
  background: #FFFFFF;
  padding: 11px 20px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-tab.is-active {
  border-color: #F0C147;
  font-weight: 700;
  color: #3B3111;
  background: #F0C147;
}

/* 依年齡找／依情境找／依章節找 共用：左側次項目清單按鈕（點擊由 main.js 切換 .is-active） */
.sub-item {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  background: transparent;
  transition: background .25s ease;
}
.sub-item.is-active { background: #FBF1D6; }
.sub-item .idx-dot { width: 8px; height: 8px; flex: none; background: #E0D6C6; }
.sub-item.is-active .idx-dot { background: #EFBB3C; }
.sub-item .idx-label { font-size: 15px; line-height: 1.6; color: #4A4038; font-weight: 400; }
.sub-item.is-active .idx-label { color: #3B3111; font-weight: 700; }

/* 次項目內容卡片（顯示時為 flex column，隱藏交給 .is-hidden） */
.detail-panel {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: #FFFFFF;
  box-shadow: 0 10px 26px rgba(74,64,56,.08);
  overflow: hidden;
  min-width: 0;
}

/* 手冊目錄頁：章節分頁按鈕（寬度／紙張色由 paper-N 決定，選取狀態由 .is-active 覆蓋） */
.toc-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  cursor: pointer;
  border: 0;
  text-align: left;
  font: inherit;
  padding: 16px 40px 16px 22px;
  width: 196px;
  margin-right: -24px;
  border-radius: 14px 0 0 14px;
  color: #5C5142;
  box-shadow: 0 4px 14px rgba(74,64,56,.09);
  transition: width .35s cubic-bezier(.16,1,.3,1), background .3s ease;
}
.toc-tab .tab-title-label { font-size: 17px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.toc-tab .tab-sub-label { font-family: 'Jost', sans-serif; font-size: 11px; font-weight: 400; letter-spacing: .18em; color: #5C5142; }
.toc-tab.paper-0 { background: #F5D678; }
.toc-tab.paper-1 { background: #EFDCC0; }
.toc-tab.paper-2 { background: #E7E0CE; }
.toc-tab.paper-3 { background: #F1E3D2; }
.toc-tab.is-active {
  width: 238px;
  background: #FBF1D6;
  color: #3B3111;
  box-shadow: 0 8px 22px rgba(74,64,56,.14);
}
.toc-tab.is-active .tab-sub-label { color: #6E5C34; }

/* 手冊目錄頁：單一單元列（點虛線引導頁碼） */
.toc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  color: #4A4038;
}
.toc-row .toc-row-dot { width: 8px; height: 8px; flex: none; background: #EFBB3C; }
.toc-row .toc-row-label { font-size: 15px; font-weight: 400; line-height: 1.65; }
.toc-row .toc-row-leader { flex: 1; min-width: 20px; height: 0; border-bottom: 2px dotted #DED3C2; margin: 0 2px; }
.toc-row .toc-row-page { display: flex; align-items: baseline; gap: 4px; flex: none; color: #6E5C34; }
.toc-row .toc-row-page-num { font-family: 'Jost', sans-serif; font-size: 16px; letter-spacing: .04em; }

/* 依年齡找／依情境找／依章節找 共用：左側次項目清單 + 右側內容，RWD 版位（取代原本以 JS 偵測寬度切換 grid-template-columns 的做法） */
.finder-grid {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: clamp(20px, 2.4vw, 30px);
  align-items: start;
}
@media (max-width: 900px) {
  .finder-grid { grid-template-columns: 1fr; }
}

/* 依章節找／依年齡找／依情境找 左側「次章節／相關單元」清單：2026-10-04 使用者反應平板/手機版
   （≤900px，.finder-grid 收成單欄後）這個清單高度占比太高，先畫了獨立預覽檔
   mockup-subchapter-rwd.html 比較 3 個方案，使用者選定「方案 B：橫向捲動 chip 列」。
   做法：原本清單裡連續的 .sub-item 按鈕們多包一層 <div class="sub-item-row">（三個頁面、
   共 23 處 nav 區塊都已加上這層包裝；.list-heading 小標題與 .print-group-btn 列印按鈕不受影響，
   仍是外層 <nav> 的一般區塊），平板/手機版只要把 .sub-item-row 變成橫向捲動的 flex 容器、
   .sub-item 本身改成膠囊形狀的 chip 樣式即可；桌機版完全不受影響（.sub-item-row 在桌機版沒有
   額外樣式，維持原本直向清單）。by-chapter.html 的 <nav> 本身有 inline sticky/max-height/
   overflow-y 樣式（讓桌機版清單可以內部捲動），平板/手機版這裡一併用 !important 覆寫掉，
   讓 nav 本身不再限制高度、改由 .sub-item-row 自己橫向捲動。
   2026-10-04 補修正：使用者回報手機版會破版，根因是 nav（grid item）跟 .sub-item-row（flex item）
   預設的 min-width:auto 會依照裡面一串 white-space:nowrap 的 chip 內容去計算「內容最小寬度」，
   這個最小寬度常常比手機螢幕還寬，導致 nav 被撐寬超出 .finder-grid 的欄位（撐出去的部分又被
   更外層 .page-shell 的 overflow-x:hidden 直接裁掉，看起來就像版面跑掉、內容被切掉），而不是
   單純讓 .sub-item-row 自己內部橫向捲動。修法：nav 加上 min-width:0 + width:100%（兩者都用
   !important，蓋過 inline style／.side-nav-card 的預設值），.sub-item-row 也加上
   min-width:0 + max-width:100%，讓這兩層都乖乖依照 .finder-grid 分配到的寬度縮小，
   超出的內容交給 .sub-item-row 自己的 overflow-x:auto 捲動，不會再撐爆版面。
   已用 Playwright 在 320/375/414/768/900px 寬度下實際渲染確認 body/finder-grid/nav
   三者寬度完全一致、沒有任何水平溢出。 */
@media (max-width: 900px) {
  nav[aria-label="次章節"],
  nav[aria-label="年齡單元"],
  nav[aria-label="情境單元"],
  nav[aria-label="相關主題"] {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  .sub-item-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    min-width: 0;
    max-width: 100%;
    padding: 4px 2px 10px;
    scrollbar-width: thin;
    scrollbar-color: #E0D6C6 transparent;
    -webkit-overflow-scrolling: touch;
  }
  .sub-item-row::-webkit-scrollbar { height: 6px; }
  .sub-item-row::-webkit-scrollbar-thumb { background: #E4DCD2; border-radius: 999px; }
  .sub-item-row .sub-item {
    flex: none;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #FDFBF9;
    border: 1px solid #E4DCD2;
    font-size: 13px;
    white-space: nowrap;
  }
  .sub-item-row .sub-item.is-active {
    border-color: #EAD9A8;
  }
  .sub-item-row .sub-item .idx-label {
    font-size: 13px;
  }
}

/* 生長曲線頁／發展篩檢圖 可放大圖片游標樣式（Fancybox 觸發元素） */
[data-fancybox] { cursor: zoom-in; }

/* 首頁主題輪播（Swiper）分頁點：覆蓋 Swiper 預設圓點，改為原設計的長條式樣式 */
.topics-swiper .swiper-pagination-bullet {
  height: 4px;
  width: 14px;
  border-radius: 999px;
  background: #E4DCD2;
  opacity: 1;
  margin: 0 5px;
  transition: width .4s ease, background .4s ease;
}
.topics-swiper .swiper-pagination-bullet-active {
  width: 34px;
  background: #EFBB3C;
}

/* 手冊內頁（生長曲線／二至四個月／黃金九色卡）共用版位：文章 + 右側分享列，RWD（取代原本以 JS 偵測寬度切換 mainCols/shareOrder 的做法） */
/* 2026-10-04：原本「分享／下載／列印／返回」都在同一個 .unit-aside 直欄裡，
   後來拆成 .unit-share（分享：LINE/FB/複製連結）＋ .unit-aside（下載／列印／返回）
   兩個獨立元素，平板／手機版讓 .unit-share 可以單獨用 order 排到文章最下面。
   2026-10-07 更新（重要，修正桌機/筆電版「分享」跟「下載/返回」沒有一起顯示的 bug）：
   桌機版原本是讓 .unit-share／.unit-aside 直接各自當 grid item、分別佔
   grid-row:1／grid-row:2（grid-template-rows:auto auto），原意是「疊回同一欄」，
   但因為 .unit-content／article 用 grid-row:1/3 橫跨這兩列，瀏覽器在分配兩個
   auto 列的高度時，會把橫跨列需要的「多出來的高度」幾乎全部塞進第一列（row 1），
   而不是平均分配——結果變成 .unit-share（分享）停在文章最上面，.unit-aside
   （下載/列印/返回）卻要等 row 1 的高度（幾乎等於整篇文章的高度）結束才開始，
   等於被推到文章「快結束」的地方，使用者在正常螢幕高度下完全看不到「下載/返回」，
   必須捲動到文章幾乎結束才會出現，跟「分享」沒有一起顯示。
   修法：改用一個外層包裝 `.unit-sidebar` 把 .unit-share／.unit-aside 包在一起，
   變成「只有一個」橫跨欄位的 grid item（grid-row 只剩一列），內部用
   display:flex;flex-direction:column 自然堆疊，不再讓瀏覽器自己決定兩個獨立列
   的高度分配；.unit-content／article 也改回只佔 grid-row:1（因為現在只有一列）。
   這樣 .unit-sidebar 整體當一般的 sticky 側欄使用，裡面的「分享」「下載/列印/
   返回」固定會貼在一起、一起顯示，不會被長文章的高度拉開。 */
.unit-main {
  display: grid;
  grid-template-columns: 1fr 86px;
  grid-template-rows: auto;
  gap: clamp(22px, 2.6vw, 32px);
  align-items: start;
  position: relative;
}
.unit-sidebar {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  position: sticky;
  top: 104px;
  height: max-content;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.unit-share,
.unit-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}
.unit-content,
.unit-main > article {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  position: relative;
}
/* .aside-group：.unit-aside 內部「下載＋列印」「返回」兩個子群組的包裝 div（2026-10-04 新增，
   為了平板/手機版可以把「返回」獨立出來跟「分享」「下載」並排，見下方 820px 斷點）。
   桌機版用 display:contents 讓這層包裝「消失」，裡面的內容直接疊進 .unit-aside 原本的
   直向清單，視覺跟拆分前一模一樣，不用再動桌機版任何樣式。 */
.aside-group {
  display: contents;
}
@media (max-width: 820px) {
  /* 2026-10-04 再次調整（第三版）：使用者實際測試後反應「分享／下載／回列表」並沒有真的並排——
     前一版 .unit-share／.unit-aside 用 flex:1 1 auto，但兩者各自的內容（固定 46px 圖示＋文字說明）
     加起來的最小寬度常常比手機螢幕還寬，flex-wrap 就把兩個整塊都各自換成一整排，變成「分享」
     一整排、「下載＋列印＋返回」另一整排，沒有達到並排的效果；而且使用者這次要的是「分享、下載、
     回列表」三個位置並排，不是兩塊。
     做法：
     1. .unit-aside 這個斷點下也改成 display:contents，讓裡面的 .aside-group-download／
        .aside-group-back 兩個子群組直接變成 .unit-main 這個 flex row 的子項目，
        跟 .unit-share 三者站在同一層（而不是「分享」「下載與返回整塊」兩層）。
     2. 隱藏「分享」「下載」「返回」這幾個文字說明（各按鈕本來就有 title/aria-label/data-tooltip，
        不影響無障礙／操作提示），圖示按鈕也從 46px 縮小到 40px，三組（3+2+1 共 6 顆圖示）才有
        機會塞進同一行。
     3. .unit-main 加上 justify-content:center：不管是三組都塞得下、或螢幕太窄只有「分享＋下載」
        塞得下、「回列表」自然換到下一行，那一行都會自動置中，不用另外寫斷點判斷——這也是使用者
        要求的 fallback（塞不下時回列表自己一排、並置中）。
     4. 原本每組各自的 margin-top/padding-top/border-top 分隔線拿掉（三組並排在同一行時，
        各自一條分隔線會變成好幾段不連續的線，不好看），改用 .unit-main 的 gap 統一抓間距。
     已用 Playwright 在 320/375/414px 寬度下對 6 個單元頁實際渲染確認：375px 以上三組都會
     並排在同一行；320px 這種最窄的手機則是「分享＋下載」留在同一行、「回列表」自然換到下一行
     並置中，符合使用者要求的 fallback 方向。
     2026-10-07 補充：桌機版新增的 .unit-sidebar 包裝（見上方「2026-10-07 更新」說明）在這個
     斷點下也要加 display:contents，把 .unit-share／.unit-aside 直接拉平成 .unit-main 這個
     flex row 的子項目，不然多一層包裝會讓這裡原本「三者並排」的 flex 子項目判定失效。 */
  .unit-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 28px 18px;
  }
  .unit-content,
  .unit-main > article {
    flex: 1 1 100%;
  }
  .unit-sidebar,
  .unit-aside {
    display: contents;
  }
  .unit-share,
  .aside-group {
    flex: 0 1 auto;
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }
  .unit-share { order: 1; }
  .aside-group-download { order: 2; }
  .aside-group-back { order: 3; }
  .unit-share .meta-caption,
  .aside-group .meta-caption-top {
    display: none;
  }
  .unit-share .icon-circle,
  .unit-share .circle-btn,
  .aside-group .icon-circle,
  .aside-group .circle-btn,
  .aside-group .circle-btn-gold {
    width: 40px;
    height: 40px;
  }
}

/* 依章節找／依年齡找／依情境找 左側「次章節／相關單元」清單卡片內的「列印整個章節/年齡層/情境」按鈕
   （2026-10-02：先加上按鈕本身，列印邏輯待討論後再實作，目前點擊沒有作用）*/
.print-group-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid #E4DCD2;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #6F655C;
  padding: 10px 14px;
  margin-top: 30px;
  flex: none; /* 2026-10-12 新增：nav 改成 side-nav-scroll／print-group-btn 兩塊 flex 排列後，
     明確固定這顆按鈕不要被壓縮，永遠維持原本大小、留在卡片最下面 */
  transition: border-color .25s ease, background .25s ease;
}
.print-group-btn svg { flex: none; }
.print-group-btn:hover { border-color: #8A6410; background: #FFFAEA; }

/* toc.html 線上電子手冊：單一卡片內左右兩個 QR 子區塊，中間用分隔線區分（取代原本兩張各自獨立、上下堆疊的卡片） */
.ehandbook-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.ehandbook-item {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 30px 34px;
}
.ehandbook-item + .ehandbook-item {
  border-top: 2px dashed #DED3C2;
}
@media (min-width: 701px) {
  .ehandbook-item + .ehandbook-item {
    border-top: none;
    border-left: 2px dashed #DED3C2;
  }
}

/* toc.html 線上電子手冊 QR 圖：原本用 inline style 寫死尺寸，改成 class 才能在下面的手機
   RWD 斷點裡縮小尺寸（inline style 的 specificity 比外部樣式表高，沒辦法被 @media 覆寫）*/
.ehandbook-qr {
  flex: none;
  width: 92px;
  height: 92px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(74,64,56,.1);
  display: grid;
  place-items: center;
  padding: 8px;
}
.ehandbook-qr-img {
  display: block;
  width: 76px;
  height: 76px;
}

/* ---- RWD（2026-10-04 新增）：筆電／平板本來就靠 .finder-grid（900px）、.unit-main（820px）、
   .ehandbook-item（701px）這幾個既有中斷點自動切版，不用再加；這裡只補上全站目前還沒有的
   手機窄螢幕（≤480px）微調，讓「列印整個章節/年齡層/情境」按鈕跟 toc.html 的 QR 卡片在小螢幕
   上留白/字級不會過於擁擠 ---- */
@media (max-width: 480px) {
  .print-group-btn { padding: 9px 12px; font-size: 12.5px; }
  .ehandbook-item { padding: 22px 20px; gap: 14px; }
  .ehandbook-qr { width: 72px; height: 72px; }
  .ehandbook-qr-img { width: 58px; height: 58px; }
  /* 2026-10-04 新增：使用者反應手機版「整個頁面外側留白」太寬——全站的頁首區塊
     （.page-hero-40/.page-hero-56）、內文區塊（.page-main-36/.page-main-34）、
     以及共用 Header/Footer（寫在 main.js 的 SITE_LAYOUT_HTML 裡，是 inline style，
     所以這裡要加 !important 才蓋得過），左右留白原本不分螢幕寬度一律是 32px，
     在 320~414px 的手機上左右加起來吃掉 64px，比例上明顯偏寬。這裡只在手機斷點
     （≤480px）把左右留白收到 20px，跟這個檔案裡其他元件（QR 卡片、整組列印按鈕）
     手機斷點已經在用的 20px 留白數值一致；筆電/平板（>480px）完全不受影響。 */
  .page-hero-40,
  .page-hero-56,
  .page-main-36,
  .page-main-34 {
    /* 這幾個 class 的原始定義寫在這個 @media (max-width:480px) 區塊「後面」
       （檔案更下面的地方），CSS 在相同選擇器特異度（specificity）下是看「原始碼
       順序」決定誰贏，跟是否包在 @media 裡無關，所以這裡沒加 !important 的話
       手機斷點會被後面的桌機版定義蓋掉、留白收不回來——這裡補上 !important 才能
       確保手機版一定生效。 */
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  #site-header > div,
  #site-footer > div {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff; }
  /* 強制列印時保留底色（例如 .highlight-row 的黃底、各種 pill/色塊），
     不然大部分瀏覽器預設列印時會自動把背景色拿掉，只剩白底 */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
  header, footer, [data-print-hide] { display: none !important; }
  #unit { display: block !important; padding: 0 !important; max-width: none !important; }
  #unit article,
  #unit .unit-content { gap: 0 !important; }
  #unit article > section,
  #unit .unit-content > section,
  #unit .content-card,
  #unit .detail-panel { box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; }
  #unit .finder-grid:not(.is-hidden) { display: block !important; }
  /* 「列印整個章節/年齡層/情境」按鈕專用：只有在列印時，才把這個分類卡片底下被 is-hidden
     隱藏的次項目內容顯示出來一起印；畫面上（非列印）完全不受影響 */
  .finder-grid.print-all-subpanels [data-subpanel].is-hidden { display: block !important; }
  /* 列印整組時，每個次章節/次單元各自獨立一頁（第一個不用在前面多插一個空白分頁） */
  .finder-grid.print-all-subpanels [data-subpanel]:not([data-subpanel-idx="0"]) {
    page-break-before: always;
    break-before: page;
  }
  #print-title { display: block !important; }
  table, figure, img { break-inside: avoid; page-break-inside: avoid; }
}
/* ==== Task #12: 全站共用樣式 class（由原本重複的 inline style 轉換而來，集中維護） ==== */
.row-start-16-divider-pink {
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:12px 0;
  border-top:1px solid #F5DFE5;
}
.body-text-grow {
  font-size:15px;
  line-height:1.85;
  color:#4A4038;
  flex:1 1 auto;
  min-width:0;
}
.body-text-muted-fixed {
  font-size:15px;
  line-height:1.85;
  color:#6F655C;
  flex:none;
}
.body-text {
  font-size:15px;
  line-height:1.95;
  color:#5C5449;
}
.bullet-gold-9 {
  width:8px;
  height:8px;
  flex:none;
  background:#EFBB3C;
  margin-top:9px;
}
.row-12-wrap {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.page-shell-clip {
  min-height:100vh;
  background:#FDFBF9;
  overflow-x:clip;
}
.page-hero-40 {
  position:relative;
  max-width:1280px;
  margin:0 auto;
  padding:40px 32px 0;
}
.hero-glow-700 {
  position:absolute;
  left:-220px;
  top:-200px;
  width:700px;
  height:700px;
  border-radius:999px;
  background:radial-gradient(circle at 50% 50%,rgba(239,187,60,.16) 0%,rgba(239,187,60,.05) 40%,rgba(239,187,60,0) 72%);
  filter:blur(18px);
  pointer-events:none;
  z-index:0;
}
.breadcrumb-row {
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  font-size:13px;
  color:#6F655C;
}
.text-ink {
  color:#4A4038;
}
.hero-row-28 {
  position:relative;
  display:flex;
  align-items:flex-end;
  gap:28px;
  flex-wrap:wrap;
  padding:18px 0 0;
}
.stack-14-full {
  display:flex;
  flex-direction:column;
  gap:14px;
  flex:1 1 100%;
  min-width:0;
}
.h1-hero-balance {
  margin:0;
  font-size:clamp(30px,3.6vw,46px);
  font-weight:700;
  letter-spacing:.02em;
  line-height:1.3;
  text-wrap:balance;
}
.row-11 {
  display:flex;
  align-items:center;
  gap:11px;
}
.dot-gold {
  width:8px;
  height:8px;
  border-radius:999px;
  background:#EFBB3C;
}
.text-muted-14 {
  font-size:14px;
  color:#6F655C;
}
.page-main-36 {
  max-width:1280px;
  margin:0 auto;
  padding:36px 32px 96px;
}
.meta-caption {
  font-size:12px;
  letter-spacing:.14em;
  color:#655C54;
}
.icon-circle {
  width:46px;
  height:46px;
  flex:none;
  display:grid;
  place-items:center;
  border:1px solid #EAE3D9;
  background:#FFFFFF;
  border-radius:999px;
}
.circle-btn {
  width:46px;
  height:46px;
  flex:none;
  display:grid;
  place-items:center;
  border:1px solid #E4DCD2;
  background:#FFFFFF;
  border-radius:999px;
  cursor:pointer;
  padding:0;
}
.is-hidden {
  display:none;
}
.meta-caption-top {
  font-size:12px;
  letter-spacing:.14em;
  color:#655C54;
  padding-top:12px;
}
.circle-btn-gold {
  width:46px;
  height:46px;
  flex:none;
  display:grid;
  place-items:center;
  border:0;
  border-radius:999px;
  background:#F0C147;
  cursor:pointer;
  padding:0;
}
.stack-22-shrink {
  display:flex;
  flex-direction:column;
  gap:22px;
  min-width:0;
}
.print-only-title {
  display:none;
  margin-bottom:10px;
}
.text-bold-20 {
  font-size:20px;
  font-weight:700;
}
.field-hint {
  display:block;
  font-size:12px;
  color:#655C54;
  padding-top:4px;
}
.content-card {
  border-radius:24px;
  background:#FFFFFF;
  box-shadow:0 10px 26px rgba(74,64,56,.08);
  padding:clamp(24px,3vw,40px);
  display:flex;
  flex-direction:column;
  gap:34px;
}
.stack-18 {
  display:flex;
  flex-direction:column;
  gap:18px;
}
.row-14-wrap {
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}
.h2-title {
  margin:0;
  font-size:22px;
  font-weight:700;
  letter-spacing:.02em;
}
.body-text-16 {
  margin:0;
  font-size:16px;
  line-height:1.95;
  color:#5C5449;
}
.body-text-tight {
  font-size:15px;
  line-height:1.9;
  color:#5C5449;
}
.stack-10 {
  display:flex;
  flex-direction:column;
  gap:10px;
}
.text-bold-16 {
  font-size:16px;
  font-weight:700;
}
.stack-4 {
  display:flex;
  flex-direction:column;
  gap:4px;
}
.stack-18-divider {
  display:flex;
  flex-direction:column;
  gap:18px;
  border-top:1px solid #F3EDE4;
  padding-top:30px;
}
.stack-10-divider-blue {
  display:flex;
  flex-direction:column;
  gap:10px;
  border-top:1px solid #D9E7F0;
  padding-top:18px;
}
.tag-pill {
  font-size:13px;
  color:#655C54;
  border:1px solid #EFE7DC;
  background:#FBF7F2;
  padding:5px 12px;
  border-radius:999px;
}
.topic-tag-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}
.stack-12-divider {
  display:flex;
  flex-direction:column;
  gap:12px;
  border-top:1px solid #F3EDE4;
  padding-top:30px;
}
.list-heading-nopad {
  font-size:13px;
  font-weight:500;
  letter-spacing:.06em;
  color:#6F655C;
}
.row-14-text {
  display:flex;
  align-items:center;
  gap:14px;
  font-size:16px;
  font-weight:500;
  line-height:1.7;
}
.grid-fit-260 {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:16px;
}
.link-card {
  display:flex;
  align-items:center;
  gap:16px;
  padding:22px 24px;
  border-radius:18px;
  background:#FFFFFF;
  box-shadow:0 8px 22px rgba(74,64,56,.07);
  color:#4A4038;
}
.icon-gold-20 {
  font-size:20px;
  color:#8A6410;
  flex:none;
}
.stack-8-shrink {
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}
.text-muted-13 {
  font-size:13px;
  color:#6F655C;
}
.text-bold-17 {
  font-size:17px;
  font-weight:700;
  line-height:1.55;
}
.stack-8-shrink-right {
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
  margin-left:auto;
  text-align:right;
}
.text-medium-nowrap {
  font-size:15px;
  font-weight:500;
  white-space:nowrap;
}
.note-box {
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:14px 16px;
  border-radius:12px;
  background:#FDFBF7;
}
.bullet-gold-8 {
  width:8px;
  height:8px;
  flex:none;
  background:#EFBB3C;
  margin-top:8px;
}
.body-text-ink {
  font-size:15px;
  line-height:1.85;
  color:#4A4038;
}
.highlight-row {
  display:flex;
  align-items:center;
  gap:16px;
  padding:26px 30px;
  background:#FBF1D6;
}
.stack-5-shrink {
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}
.text-brown-16 {
  font-size:16px;
  color:#6E5C34;
}
.h3-title {
  font-size:clamp(20px,2.2vw,25px);
  font-weight:700;
  line-height:1.45;
}
.panel-body {
  display:flex;
  flex-direction:column;
  gap:20px;
  padding:28px 30px 34px;
}
.body-text-wide {
  margin:0;
  font-size:15px;
  line-height:2;
  color:#5C5449;
  max-width:44em;
}
.row-20-wrap-top {
  display:flex;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
  padding-top:6px;
}
.cta-button {
  background:#F0C147;
  color:#3B3111;
  font-size:15px;
  font-weight:500;
  padding:15px 30px;
  border-radius:10px;
}
.side-nav-card {
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:20px 16px;
  border-radius:20px;
  background:#FFFFFF;
  box-shadow:0 8px 22px rgba(74,64,56,.07);
}
.list-heading {
  font-size:12px;
  font-weight:500;
  letter-spacing:.06em;
  color:#6F655C;
  padding:0 10px 8px;
}
.page-shell {
  min-height:100vh;
  background:#FDFBF9;
  overflow-x: clip ;
  overflow-y: visible ;
}
.page-hero-56 {
  position:relative;
  max-width:1280px;
  margin:0 auto;
  padding:56px 32px 0;
}
.hero-glow-720 {
  position:absolute;
  left:-220px;
  top:-180px;
  width:720px;
  height:720px;
  border-radius:999px;
  background:radial-gradient(circle at 50% 50%,rgba(239,187,60,.18) 0%,rgba(239,187,60,.06) 40%,rgba(239,187,60,0) 72%);
  filter:blur(18px);
  pointer-events:none;
}
/* 2026-10-05 新增：使用者反應 .hero-glow-720（以及同樣寫法的 .hero-glow-700）疊在下方卡片
   之上。根因是 stacking context：.page-hero-56/.page-hero-40 本身沒有設 z-index，不會形成
   獨立的堆疊環境，而 .hero-glow-720/.hero-glow-700 是 position:absolute（z-index:auto）。
   依照 CSS 繪製順序規則，「有定位但 z-index 是 auto/0」的元素一律會疊在同一層級裡「沒有定位」
   的一般區塊之上——不管誰在 HTML 原始碼裡面寫在前面。下方 <main id="unit"> 裡的卡片
   （.content-card、側欄清單卡片等）大多沒有設定 position，所以屬於「沒有定位」那一層，
   理論上會被疊在光暈下面；視覺上原本沒發現，是因為光暈的漸層＋模糊到了卡片所在的位置
   透明度已經接近 0，肉眼不容易察覺，但用不透明色塊實測確認過繪製順序確實是光暈在上面。
   修法：直接讓 #unit（6 個單元頁的 class="unit-main"、toc.html 則是沒有 class 的同一個
   id）自己形成一個獨立的堆疊環境（position:relative + z-index:1，正值），這樣整個 #unit
   （含裡面所有卡片）在繪製順序上會排在「z-index:auto 的定位元素」這一層之後，確保一定疊在
   光暈之上，不用再個別調整光暈或卡片的 z-index，7 個使用 #unit 的頁面（age-2-4m／by-age／
   by-chapter／by-scenario／growth-chart／stool-color-card／toc）全部適用。 */
#unit {
  position: relative;
  z-index: 1;
}
.hero-row-32 {
  position:relative;
  display:flex;
  align-items:flex-end;
  gap:32px;
  flex-wrap:wrap;
}
.stack-14 {
  display:flex;
  flex-direction:column;
  gap:14px;
}
.h1-hero {
  margin:0;
  font-size:clamp(34px,4vw,52px);
  font-weight:700;
  letter-spacing:.02em;
  line-height:1.3;
}
.eyebrow-label {
  font-family:'Jost',sans-serif;
  font-size:14px;
  font-weight:400;
  letter-spacing:.24em;
  color:#7A6F66;
}
.tabs-scroll-row {
  position:relative;
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:30px 0 0;
  border-bottom:1px solid #EFE7DC;
  scrollbar-width:thin;
  scrollbar-color:#E4DCD2 transparent;
}
/* 2026-10-05 新增：使用者希望手機版的章節分頁（.tabs-scroll-row，由章節/年齡/情境列表頁
   頂部的 01/02/03... 分頁組成）右側維持「還有內容可以滑」的視覺——還能往右滑的時候分頁
   直接貼齊螢幕右側（跟左側原本的留白不對稱），只有真的捲到最後一個分頁時，右側才補回跟
   左側一樣的留白。做法是經典的「貼邊輪播」寫法：用負的 margin-right 把這個容器的右邊界
   往外推到跟 .page-hero-56 的右留白互相抵銷（變成跟螢幕邊緣齊平），再用等量的 padding-right
   在「可捲動內容」裡面補回同樣寬度的尾端留白——這段留白只有捲到底時才會露出來，捲動途中
   因為它還在畫面右側之外，分頁本身就會自然貼齊螢幕邊緣、被部分裁切，視覺上提示「還可以
   往右滑」。左側沒有改動，維持原本跟頁面標題對齊的留白。只在手機斷點（≤480px）套用，
   數值跟這個斷點下 .page-hero-56 本身的留白（20px）一致；平板/桌機（>480px）不受影響。 */
@media (max-width: 480px) {
  .tabs-scroll-row {
    margin-right: -20px;
    padding-right: 20px;
  }
}
.page-main-34 {
  max-width:1280px;
  margin:0 auto;
  padding:34px 32px 96px;
}
.text-bold-17-tight {
  font-size:17px;
  font-weight:700;
  letter-spacing:.02em;
}
.body-text-13 {
  font-size:13px;
  line-height:1.9;
  color:#6F655C;
}
.caption-text {
  font-size:14px;
  line-height:1.8;
  color:#655C54;
}
.body-text-loose {
  margin:0;
  font-size:16px;
  line-height:2.05;
  color:#5C5449;
}
.row-start-14 {
  display:flex;
  align-items:flex-start;
  gap:14px;
}
.num-badge-filled {
  width:26px;
  height:26px;
  flex:none;
  border-radius:999px;
  background:#FBF1D6;
  display:grid;
  place-items:center;
  font-size:14px;
  font-weight:700;
  color:#7A5A0E;
}
.body-text-plain {
  font-size:15px;
  line-height:1.85;
}
.row-6-text {
  display:flex;
  align-items:center;
  gap:6px;
  font-size:13px;
  font-weight:500;
  color:#5C5449;
}
.text-brown-dark {
  color:#3B3111;
}
.stack-12 {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.grid-fit-190-divider {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:24px;
  border-top:1px solid #F3EDE4;
  padding-top:30px;
  align-items:start;
}
.h2-title-span {
  margin:0;
  grid-column:1/-1;
  font-size:22px;
  font-weight:700;
  letter-spacing:.02em;
}
.body-text-14 {
  margin:0;
  font-size:14px;
  line-height:1.9;
  color:#655C54;
}
.row-12 {
  display:flex;
  align-items:center;
  gap:12px;
}
.row-start-12 {
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.marquee-text {
  display:flex;
  align-items:center;
  gap:44px;
  padding-right:44px;
  font-family:'Jost',sans-serif;
  font-weight:200;
  font-size:clamp(46px,7vw,92px);
  letter-spacing:.1em;
  color:#D9C8B4;
  white-space:nowrap;
}
.dot-tan-12 {
  width:12px;
  height:12px;
  border-radius:999px;
  background:#E2CDB4;
  flex:none;
}
.stack-26 {
  display:flex;
  flex-direction:column;
  gap:26px;
}
.h2-hero {
  margin:0;
  font-size:clamp(30px,3.4vw,42px);
  font-weight:700;
  letter-spacing:.02em;
  line-height:1.35;
  color:#4A4038;
}
.body-text-85 {
  font-size:15px;
  line-height:1.85;
  color:#5C5449;
}
.num-badge-outline {
  width:26px;
  height:26px;
  flex:none;
  border-radius:999px;
  background:#FFFFFF;
  display:grid;
  place-items:center;
  font-size:15px;
  font-weight:700;
  color:#7A5A0E;
}
.body-text-plain-16 {
  font-size:16px;
  line-height:1.9;
}
.grid-fill-150 {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:16px;
}
.text-12 {
  font-size:12px;
  font-weight:400;
}
.nav-link-text {
  font-size:15px;
  font-weight:400;
  color:#6F655C;
}
.stack-5 {
  display:flex;
  flex-direction:column;
  gap:5px;
}
.meta-caption-loose {
  font-size:12px;
  letter-spacing:.1em;
  color:#6F655C;
}
.text-medium-14 {
  font-size:14px;
  font-weight:500;
  color:#4A4038;
  line-height:1.7;
}
.body-text-13-loose {
  margin:0;
  font-size:13px;
  line-height:2;
  color:#655C54;
}

/* ============================================================
   2026-10-06：全站行內樣式（inline style）收斂為 class
   目的：除了真正「每個元素都不同、無法共用」的樣式（例如逐張圖片不同的
   background-image/background-position），其餘一律改成具名 class，
   方便日後統一調整、也方便 RWD 覆寫。以下依頁面分組。
   ============================================================ */

/* ---- toc.html ---- */
.toc-main {
  max-width:1280px;
  margin:0 auto;
  padding:44px 32px 96px;
}
.toc-stack-44 {
  display:flex;
  flex-direction:column;
  gap:clamp(28px,3vw,44px);
}
.toc-row-0 {
  display:flex;
  align-items:stretch;
  gap:0;
  flex-wrap:wrap;
}
.toc-badge-col {
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:12px;
  padding:96px 0 0;
  flex:none;
  z-index:1;
}
.toc-card-raised {
  flex:1 1 420px;
  min-width:0;
  border-radius:24px;
  background:#FFFFFF;
  box-shadow:0 10px 26px rgba(74,64,56,.09);
  overflow:hidden;
  z-index:2;
  position:relative;
}

/* 目錄頁左側章節分頁：2026-10-06 新增，使用者反應平板/手機版「左邊原本是直式的」
   （.toc-badge-col 疊紙式分頁在窄螢幕時被 .toc-row-0 的 flex-wrap 擠到卡片上方，
   但 .toc-badge-col 本身仍是 flex-direction:column，4 個分頁還是直向堆疊，占掉
   一大截版面），要求改成橫式——做法比照「依章節找／依年齡找／依情境找」左側次項目
   清單在同一斷點（≤900px）已經在用的手法（.sub-item-row：直向清單→橫向可捲動
   chip 列），斷點數值沿用全站既有的 900px，筆電/桌機（>900px）完全不動，維持原本
   疊紙式直式設計。 */
@media (max-width: 900px) {
  .toc-row-0 {
    flex-direction: column;
    gap: 16px;
  }
  .toc-badge-col {
    flex-direction: row;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #E4DCD2 transparent;
  }
  .toc-badge-col::-webkit-scrollbar { height: 6px; }
  .toc-badge-col::-webkit-scrollbar-thumb { background: #E4DCD2; border-radius: 999px; }
  .toc-tab {
    flex: none;
    width: auto;
    margin-right: 0;
    padding: 12px 20px;
    border-radius: 14px;
    white-space: nowrap;
  }
  .toc-tab.is-active {
    width: auto;
  }
  .toc-card-raised {
    overflow: visible;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}
.toc-card-header {
  display:flex;
  align-items:center;
  gap:14px;
  padding:22px 30px;
  background:#FBF1D6;
  border-bottom:1px solid #F1E4C4;
}
.toc-card-title {
  font-size:20px;
  font-weight:700;
  letter-spacing:.04em;
  color:#4A4038;
}
.toc-card-count {
  margin-left:auto;
  font-size:13px;
  font-weight:500;
  color:#6E5C34;
}
.toc-card-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(330px,1fr));
  gap:6px 28px;
  padding:22px 26px 30px;
}
/* 手機版 .toc-card-grid 超出畫面修正（2026-10-08）：repeat(auto-fit,minmax(330px,1fr))
   這組寫法在容器可用寬度小於 330px（約 iPhone 14/15 等 414px 以下的手機寬度）時，
   欄位仍會被 minmax 的下限卡在 330px，造成每一列（圖示＋標題＋虛線＋頁碼）被擠出
   卡片與螢幕右側、視覺上超出畫面，跟這份文件先前記錄過的「auto-fit/minmax 塌縮
   陷阱」是同一類問題。修法沿用既有教訓：在手機斷點直接把 grid-template-columns
   覆寫成 1fr，不依賴 auto-fit 自然塌縮，讓欄位寬度確實等於卡片可用寬度；只在
   ≤480px 生效，480px 以上（含既有的 ≤900px 平板版）完全不受影響。 */
@media (max-width: 480px) {
  .toc-card-grid {
    grid-template-columns: 1fr;
  }
}
.toc-rainbow-wrap {
  position:relative;
  margin-top:84px;
}
.toc-deco-rainbow {
  position:absolute;
  right:10px;
  top:-14rem;
  width:500px;
  max-width:65%;
  height:auto;
  z-index:0;
  pointer-events:none;
}
.toc-section-card {
  position:relative;
  z-index:1;
  border-radius:24px;
  background:#FFFFFF;
  box-shadow:0 10px 26px rgba(74,64,56,.08);
  overflow:hidden;
}
.toc-item-col {
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.toc-item-title {
  font-size:16px;
  font-weight:700;
  line-height:1.4;
}
.toc-item-desc {
  margin:0;
  font-size:13px;
  font-weight:400;
  line-height:1.8;
  color:#6F655C;
}
.toc-item-link {
  align-self:flex-start;
  margin-top:2px;
  font-size:14px;
  font-weight:500;
  border-bottom:1px solid #EFBB3C;
  padding-bottom:2px;
}

/* ---- growth-chart.html ---- */
.growth-intro {
  display:flex;
  flex-direction:column;
  gap:14px;
  max-width:24em;
}
.growth-intro-title {
  font-size:17px;
  font-weight:700;
  line-height:1.7;
}
.growth-figure-wide {
  margin:0;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:420px;
}
.growth-figure {
  margin:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
/* 圖片本身用背景圖呈現（可局部裁切對焦），每張圖的 url／縮放／定位／長寬比都不同，
   這些「每個元素都不一樣」的值保留為行內 style（必要的例外），共用的外觀（邊框、
   圓角、底色、不重複）收斂到這個 class。 */
.growth-img-frame {
  display:block;
  border-radius:16px;
  border:1px solid #F1E9DE;
  background-color:#FFFDF8;
  background-repeat:no-repeat;
}

/* ---- stool-color-card.html ---- */
.stool-panel-warn {
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:24px 26px;
  border-radius:16px;
  background:#FFFAEA;
}
.stool-panel-danger {
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:24px 26px 28px;
  border-radius:18px;
  background:#FDF2F1;
}
.stool-badge-danger {
  font-size:17px;
  font-weight:700;
  color:#FFFFFF;
  background:#C0392B;
  padding:7px 18px;
  border-radius:999px;
}
.stool-panel-title-danger {
  font-size:17px;
  font-weight:700;
  color:#9B2D20;
}
.stool-figure {
  margin:0;
  display:flex;
  flex-direction:column;
  gap:9px;
}
.stool-figcaption {
  display:flex;
  align-items:baseline;
  gap:8px;
  font-size:15px;
  line-height:1.7;
  color:#5C5449;
}
.stool-num-red {
  font-size:15px;
  font-weight:700;
  color:#9B2D20;
  flex:none;
}
.stool-num-blue {
  font-size:15px;
  font-weight:700;
  color:#1B5E7E;
  flex:none;
}
.stool-panel-info {
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:24px 26px 28px;
  border-radius:18px;
  background:#EAF4F9;
}
.stool-badge-info {
  font-size:17px;
  font-weight:700;
  color:#FFFFFF;
  background:#2A80A8;
  padding:7px 18px;
  border-radius:999px;
}
.stool-panel-title-info {
  font-size:17px;
  font-weight:700;
  color:#1B5E7E;
}
.stool-note-text {
  margin:0;
  font-size:15px;
  line-height:1.9;
  color:#5C5449;
}
.stool-qa-list {
  display:flex;
  flex-direction:column;
  gap:16px;
}
.stool-qa-row {
  display:flex;
  align-items:flex-start;
  gap:16px;
}
.stool-qa-num {
  width:28px;
  height:28px;
  flex:none;
  border-radius:999px;
  background:#FBF1D6;
  display:grid;
  place-items:center;
  font-size:15px;
  font-weight:700;
  color:#7A5A0E;
}
.stool-compare-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:22px;
  align-items:start;
  padding:24px 26px 28px;
  border-radius:18px;
  background:#F7FAFC;
}
.stool-figure-compare {
  margin:0;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.stool-compare-list {
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
}
.stool-dot-blue {
  width:9px;
  height:9px;
  flex:none;
  background:#2A80A8;
  margin-top:9px;
  border-radius:2px;
}
.stool-dot-red {
  width:9px;
  height:9px;
  flex:none;
  background:#C0392B;
  margin-top:9px;
  border-radius:2px;
}
.stool-dot-brown {
  width:9px;
  height:9px;
  flex:none;
  background:#8A6410;
  margin-top:9px;
  border-radius:2px;
}
.stool-dot-green {
  width:9px;
  height:9px;
  flex:none;
  background:#4E6B57;
  margin-top:9px;
  border-radius:2px;
}
.stool-callout-warn {
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:20px 22px;
  border-radius:16px;
  background:#FFFAEA;
}
.stool-dot-gold {
  width:9px;
  height:9px;
  flex:none;
  background:#EFBB3C;
  margin-top:10px;
}
.stool-callout-text {
  margin:0;
  font-size:16px;
  line-height:2;
  color:#4A4038;
}
/* 九宮格大便卡圖片／膽道閉鎖對照圖：每張圖只有 background-image 網址不同，
   其餘外觀共用，邊框顏色（紅/藍）與比例（膽道閉鎖對照圖較大張）各自用修飾 class。 */
.stool-img-frame {
  display:block;
  border-radius:14px;
  background-color:#FFFFFF;
  background-repeat:no-repeat;
  background-size:100% 100%;
  aspect-ratio:108/94;
}
.stool-img-frame--red {
  border:1px solid #F0DCE2;
}
.stool-img-frame--blue {
  border:1px solid #D9E7F0;
}
.stool-img-frame--compare {
  aspect-ratio:326/242;
}

/* ---- age-2-4m.html ---- */
.age-row-item {
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:11px 0;
  border-top:1px solid #F1E9DE;
}
.age-row-label {
  font-size:15px;
  line-height:1.9;
  color:#4A4038;
  flex:1 1 auto;
  min-width:0;
}
.age-row-value {
  font-size:15px;
  line-height:1.9;
  color:#6F655C;
  flex:none;
}
.age-panel-card {
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:22px 24px;
  border-radius:18px;
  background:#FBF7F2;
}
.age-panel-title {
  font-size:17px;
  font-weight:700;
}
.age-panel-sub {
  font-size:15px;
  color:#655C54;
}
.age-panel-header-row {
  display:flex;
  align-items:center;
  gap:14px;
  padding-bottom:2px;
}
.age-panel-header-left {
  flex:1 1 auto;
  font-size:15px;
  font-weight:500;
  color:#655C54;
}
.age-panel-header-right {
  flex:none;
  font-size:15px;
  font-weight:500;
  color:#655C54;
}
.age-row-list {
  display:flex;
  flex-direction:column;
  gap:2px;
}
.age-chip-pink {
  font-size:13px;
  color:#655C54;
  border:1px solid #F0DCE2;
  background:#FCEFF2;
  padding:5px 12px;
  border-radius:999px;
}
.age-alert-pink {
  display:flex;
  flex-direction:column;
  gap:20px;
  padding:26px 28px;
  border-radius:18px;
  background:#FCEFF2;
}
.age-alert-section {
  display:flex;
  flex-direction:column;
  gap:8px;
  border-top:1px solid #F5DFE5;
  padding-top:16px;
}
.age-chip-blue {
  font-size:13px;
  color:#655C54;
  border:1px solid #D9E7F0;
  background:#EAF4F9;
  padding:5px 12px;
  border-radius:999px;
}
.age-alert-blue {
  display:flex;
  flex-direction:column;
  gap:20px;
  padding:26px 28px;
  border-radius:18px;
  background:#EAF4F9;
}
.age-alert-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px 26px;
}
.age-alert-item {
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:18px 20px;
  border-radius:14px;
  background:#FFFFFF;
}
.age-dot-red-sq {
  width:8px;
  height:8px;
  flex:none;
  background:#C0392B;
  margin-top:9px;
}
.age-alert-text {
  margin:0;
  font-size:15px;
  line-height:1.95;
  color:#9B2D20;
}
.age-footnote-bordered {
  margin:0;
  font-size:14px;
  line-height:1.9;
  color:#5C5449;
  border-top:1px solid #D9E7F0;
  padding-top:18px;
}
.age-footnote {
  margin:0;
  font-size:14px;
  line-height:1.9;
  color:#5C5449;
}

/* ---- 共用 Header / Footer（assets/js/main.js 的 SITE_LAYOUT_HTML，九個頁面共用一份）---- */
.site-header-bar {
  position:sticky;
  top:0;
  z-index:30;
  background:rgba(253,251,249,.92);
  backdrop-filter:blur(10px);
}
.site-header-inner {
  max-width:1280px;
  margin:0 auto;
  padding:18px 32px;
  display:flex;
  align-items:center;
  gap:28px;
  flex-wrap:wrap;
}
.site-logo-link {
  display:flex;
  align-items:center;
  gap:12px;
  color:#4A4038;
}
.site-logo-img {
  width:40px;
  height:40px;
  flex:none;
  object-fit:contain;
}
.site-logo-text {
  display:flex;
  flex-direction:column;
  line-height:1.3;
}
.site-logo-caption {
  font-size:10px;
  letter-spacing:.08em;
  color:#655C54;
  font-family:'Jost',sans-serif;
}
.site-search-icon {
  color:#655C54;
  font-size:15px;
  transform:scaleX(-1);
  display:inline-block;
}
.site-footer-bar {
  background:#FFFFFF;
  border-top:1px solid #EFE9E2;
}
.site-footer-row {
  max-width:1280px;
  margin:0 auto;
  padding:44px 32px 52px;
  display:flex;
  align-items:center;
  gap:28px;
  flex-wrap:wrap;
}
.site-footer-logo-img {
  width:36px;
  height:36px;
  flex:none;
  object-fit:contain;
}
.site-footer-logo-text {
  display:flex;
  flex-direction:column;
  line-height:1.35;
}
.site-footer-logo-title {
  font-size:15px;
  font-weight:700;
}
.site-footer-logo-caption {
  font-family:'Jost',sans-serif;
  font-size:10px;
  letter-spacing:.08em;
  color:#655C54;
}
.site-footer-spacer {
  margin-left:auto;
}
.site-back-to-top {
  width:46px;
  height:46px;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#F5D678;
  color:#3B3111;
}
/* 2026-10-06 新增：手機版「回頂端」文字提醒預設隱藏（桌機/平板只顯示圖示），
   在下面的手機斷點（見檔案尾端）才顯示出來，詳見該處註解。 */
.back-to-top-label {
  display:none;
}
.site-footer-bottom {
  max-width:1280px;
  margin:0 auto;
  padding:0 32px 40px;
  display:flex;
  flex-direction:column;
  gap:20px;
}
.site-footer-divider {
  height:1px;
  background:#EFE9E2;
}
.site-footer-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));
  gap:24px 40px;
  align-items:start;
}
.site-footer-col {
  display:flex;
  flex-direction:column;
  gap:14px;
}
.site-footer-source-row {
  display:flex;
  flex-wrap:wrap;
  gap:18px 32px;
}
.site-footer-contact-col {
  display:flex;
  flex-direction:column;
  gap:8px;
}
.site-footer-copyright {
  font-size:13px;
  color:#7A6F66;
  padding-top:8px;
  border-top:1px solid #F4EFE7;
  margin-top:4px;
}
/* 極小工具 class：單一屬性的個別覆寫（例如把某個已有共用 class 的元素 margin 歸零），
   比起再開一個新 class 或留一個單獨的行內 style 更單純。 */
.u-m0 {
  margin:0;
}

/* ---- by-chapter.html ---- */
.chapter-num-badge {
  font-family:'Jost',sans-serif;
  font-size:32px;
  font-weight:200;
  letter-spacing:.04em;
  color:#6E5C34;
  flex:none;
}
.chapter-sub-label {
  font-size:13px;
  color:#6E5C34;
}
.chapter-figure-hidden {
  margin:0;
  display:none;
  flex-direction:column;
  gap:8px;
}
.chapter-img-scroll {
  overflow:auto;
  border-radius:16px;
  background:#FFFFFF;
  border:1px solid #F1EBE1;
  padding:10px;
  max-height:min(70vh,560px);
  scrollbar-width:thin;
  scrollbar-color:#E4DCD2 transparent;
}
.chapter-figcaption {
  font-size:13px;
  line-height:1.8;
  color:#7A6F66;
}
.chapter-section-card {
  display:flex;
  flex-direction:column;
  border-radius:24px;
  background:#FFFFFF;
  box-shadow:0 10px 26px rgba(74,64,56,.08);
  overflow:hidden;
  min-width:0;
}
.chapter-section-label {
  font-size:13px;
  letter-spacing:.14em;
  color:#7A6F66;
}
.chapter-pill-tabs-row {
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:2px 0 8px;
  scrollbar-width:thin;
  scrollbar-color:#E4DCD2 transparent;
}
.chapter-devage-panel {
  display:flex;
  flex-direction:column;
  gap:22px;
  padding:28px 30px 34px;
}
/* by-chapter.html 的次章節側欄導覽原本是用 inline style 做「桌機版可固定＋內部捲動」，
   這裡把共用外觀留給 .side-nav-card，固定定位／捲動相關的部分拆成這個修飾 class，
   兩個 class 一起用（class="side-nav-card side-nav-sticky"）。
   2026-10-12 更新：使用者要求「有左選單的頁面」左側清單都要有固定高度、超過則顯示
   捲軸，原本只有 by-chapter.html 有這個行為（那時 by-age/by-scenario 的清單較短，
   刻意不加），這次把 `.side-nav-sticky` 也加到 by-age.html／by-scenario.html／
   by-topic.html 的 <nav class="side-nav-card"> 上，四個「依X找」列表頁桌機版左側
   清單現在統一是固定高度＋內部捲動；平板/手機版（≤900px）仍然維持既有的橫向捲動
   chip 列、不受這個 class 影響（nav 本身在那個斷點被 !important 蓋掉 sticky/
   max-height，詳見上面 ≤900px 那個媒體查詢區塊，這次新增 by-topic.html 的
   nav[aria-label="相關主題"] 選擇器也補進同一組覆寫清單，避免手機版跟著破版）。
   2026-10-12 再更新：使用者接著要求「左選單 最高改為 max-height: calc(70vh - 120px)」，
   並且「下方的列印按鈕，我想要一直都顯示，且上面需要有漸層的過渡，讓人知道下面還有選項」。
   這代表列印按鈕不能再跟著清單一起被捲動捲走，所以把原本「整個 nav 一起 overflow-y:auto」
   的做法拆開：nav（.side-nav-sticky）本身不再自己捲動（拿掉 overflow-y:auto），只負責用
   max-height 限制整張卡片的高度；清單本體（.list-heading＋.sub-item-row）改成多包一層
   <div class="side-nav-scroll">，捲動行為搬到這一層身上，「列印整個章節/年齡層/情境」按鈕
   則維持在 nav 的最下面、在 .side-nav-scroll 外面，不會被捲走。.side-nav-card 本身既有的
   display:flex;flex-direction:column 剛好拿來排「.side-nav-scroll（會長大/縮小）＋
   print-group-btn（固定在最下面）」這兩塊，不用額外再宣告一次。漸層提示（.side-nav-fade）
   是疊在 .side-nav-scroll 最底部的一條漸層遮罩，只有在清單「真的捲得動、而且還沒捲到底」的
   時候才會用 main.js 加上 .has-more-below 顯示出來（避免清單本來就沒幾項、不需要捲動時，
   漸層還是裝飾性地蓋在最後一項上面造成誤導）。詳見下方 .side-nav-scroll／.side-nav-fade
   規則與 main.js 的 initSideNavFade()。 */
.side-nav-sticky {
  position:sticky;
  top:96px;
  max-height:calc(70vh - 140px);
}
/* .side-nav-scroll：由章節找/年齡找/情境找/主題找四頁共用，包住「次章節/相關單元」清單
   本體（.list-heading＋.sub-item-row），真正負責捲動與高度限制的是這一層，不是 nav 本身，
   目的是讓 nav 最下面的 .print-group-btn 永遠留在卡片底部、不會被清單捲走。
   flex:1 1 auto 讓這層盡量撐滿 .side-nav-sticky 讓出的剩餘高度；min-height:0 是必要的
   flex 陷阱修正——沒有這行，flex item 預設的 min-height:auto 會讓這層照內容撐高，
   max-height 和 overflow-y:auto 就不會真的生效。position:relative 讓內部的
   .side-nav-fade 漸層遮罩可以用 position:absolute 貼齊這層的可視範圍底部。 */
.side-nav-scroll {
  position:relative;
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:6px;
  scrollbar-width:thin;
  scrollbar-color:#E4DCD2 transparent;
}
/* .side-nav-fade：貼在 .side-nav-scroll 可視範圍最底部的漸層遮罩，用來提示「下面還有更多
   選項」。因為是 position:absolute 貼著捲動容器本身（而不是裡面的內容）定位，捲動的時候
   不會跟著內容一起移動，會一直固定貼在卡片可視範圍的底邊。預設 opacity:0 不顯示，只有
   main.js 的 initSideNavFade() 偵測到「這份清單真的會捲動、而且目前沒有捲到底」時，才會
   在 .side-nav-scroll 加上 .has-more-below 讓它淡入；已經捲到底或清單根本不需要捲動時都
   會自動淡出，不會在沒有更多內容時還誤導使用者。pointer-events:none 確保遮罩不會擋住底下
   最後一顆按鈕的點擊。 */
.side-nav-fade {
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:64px; /* 2026-10-12 再調整：使用者反應漸層範圍太窄，從 36px 加高到 64px，
     讓淡出效果更明顯、更看得出「下面還有內容」。 */
  background:linear-gradient(to bottom, rgba(255,255,255,0), #FFFFFF 85%);
  pointer-events:none;
  opacity:0;
  transition:opacity .2s ease;
}
.side-nav-scroll.has-more-below .side-nav-fade {
  /* opacity:1; */
}
/* 2026-10-12 新增：這段覆寫刻意放在 .side-nav-scroll／.side-nav-fade 基礎規則「後面」，
   不是圖方便就近寫在上面 ≤900px 那個 nav[aria-label=...] 覆寫區塊裡——這份檔案先前已經
   記錄過「CSS 原始碼順序決定誰贏，跟是否包在 @media 裡無關」這個陷阱，同特異度的選擇器
   一律是原始碼位置在後面的那條規則生效，和 @media 條件成不成立無關；.side-nav-scroll／
   .side-nav-fade 的基礎規則定義在這裡，所以對應的手機/平板覆寫也必須寫在基礎規則之後，
   寫在檔案更前面的地方（即使包在同一個 @media (max-width:900px) 區塊裡）實測完全不會生效。
   平板/手機版（≤900px）本來就會把 nav 攤開變成橫向捲動 chip 列，不需要 .side-nav-scroll
   自己再限制高度或捲動，否則清單看起來會被截斷；漸層遮罩在這個版型下也沒有意義，一併隱藏。 */
@media (max-width: 900px) {
  .side-nav-scroll {
    overflow: visible;
    max-height: none;
    flex: none;
  }
  .side-nav-fade {
    display: none;
  }
}
/* 每張章節拉頁圖的寬度／長寬比都不同（每張圖的原始尺寸不一樣），用 CSS 變數讓
   行內只保留這兩個會變動的數值（--iw／--ar），其餘外觀都收斂在 class 裡。 */
.chapter-img-frame {
  display:block;
  width:min(100%,var(--iw,100%));
  height:auto;
  aspect-ratio:var(--ar,1);
}

/* ============================================================
   main 區塊左下角裝飾：babytochild.svg（2026-10-06 新增）
   套用頁面：依章節找／依年齡找／依情境找／生長曲線／二至四個月／
   黃金九色卡，共 6 頁（這 6 頁的 <main> 都共用 .unit-main，已在上面
   加了 position:relative 當這個裝飾的定位錨點）；toc.html 不要這個裝飾
   （使用者明確排除），index.html／index-draft.html 沒有 <main> 元素，
   本來就套不到。
   原始素材是灰色（#5d5d5d）＋白色兩色的「一筆畫」嬰兒成長線條插圖，
   這裡比照 book.svg 的做法，直接在 svg 檔裡把主線條顏色改成跟 book.svg
   裝飾線條一樣的品牌棕 #6E5C34，淡化、放在內容下方（z-index:0＋在每個
   頁面裡排在 <main> 的第一個子元素，後面的內容自然疊在上面）。
   進場動畫見下面 .js-draw-reveal；套用時外層 <span> 帶
   class="main-deco-babytochild js-draw-reveal" 負責定位/大小＋被
   IntersectionObserver 偵測進畫面，裡面包一層 <img> 才真的套 clip-path
   裁切動畫——兩者不能是同一個元素：IntersectionObserver 算的是「扣掉
   clip-path 裁切後」的可視範圍，如果直接把 clip-path 裁到 0 寬度的
   那個元素拿去當觀察目標，它永遠不會被偵測成「進畫面」（自己把自己
   裁空了，形成死結，實測確認過），所以拆成外層觀察、內層裁切兩層。 */
.main-deco-babytochild {
  display: block;
  position: absolute;
  left: -20.2rem;
  bottom: -3.6rem;
  width: 54%;
  height: auto;
  line-height: 0;
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}
.main-deco-babytochild img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 820px) {
  .main-deco-babytochild { width: 54%; left: -4rem; bottom: -4rem; }
  /* 這個斷點下裝飾線條放大＋往下移（bottom:-4rem），原本 96px 的內文區塊
     底部留白在平板/手機上會被裝飾蓋到，這裡把 .page-main-34 的底部留白
     加大到 130px 讓出空間；左右/頂部留白維持跟桌機版一樣的 32px/34px 不變
     （≤480px 時左右留白仍會被下面既有的 480px 斷點 !important 規則收到 20px，
     不受這裡影響）。 */
  .page-main-34 { padding: 34px 32px 130px; }
  /* 2026-10-07 新增：使用者實測平板寬度下 growth-chart.html／stool-color-card.html／
     age-2-4m.html（共用 .page-main-36）底部留白也不夠，比照上面 .page-main-34 的做法
     把底部留白加大到 120px；左右/頂部留白維持 32px/36px 不變。 */
  .page-main-36 { padding: 36px 32px 120px; }
}
/* 2026-10-07 新增：使用者實測在 821～1033px 這個區間（比平板斷點寬、比桌機版基準值
   還窄的中間地帶，例如小尺寸筆電視窗），.page-main-36 的底部留白需要比平板版（120px）
   更大（220px）才夠，且 .main-deco-babytochild 在桌機版基準值 left:-20.2rem（往左大幅
   出血）在這個寬度下位置不對，需要改成 left:11rem。範圍刻意只到 1033px，821px 以上、
   1033px 以下，不影響 ≤820px 的平板版（上面那組）也不影響 >1033px 的桌機版（沿用檔案
   前面的基準值）。 */
@media (min-width: 821px) and (max-width: 1033px) {
  .page-main-36 { padding: 36px 32px 220px; }
  .page-main-34 { padding: 34px 32px 220px; }
  .main-deco-babytochild { left: 11rem; }
}
@media (max-width: 480px) {
  .main-deco-babytochild { width: 100%; left: 0px; bottom: -4rem; opacity: .4; }
}
/* 2026-10-06 新增：手機版「回頂端」按鈕旁邊顯示文字提醒，不只是一個圖示。
   .site-back-to-top 原本 display:grid;place-items:center 是設計給「裡面只有
   一個子元素（svg 圖示）」的情境，如果裡面多一個 <span> 文字，grid 預設的
   隱性格線會把兩者各自獨立成一個 cell、垂直疊在一起，不是想要的「圖示＋文字
   並排」。這裡只在手機斷點把它改成 display:inline-flex 橫向排列，寬度/高度
   從固定 46px 圓形改成依內容自動延伸的膠囊造型；桌機/平板完全不受影響，
   維持原本純圖示的圓形按鈕。.back-to-top-label 預設 display:none（見上），
   這裡才顯示出來。 */
@media (max-width: 480px) {
  .site-back-to-top {
    width:auto;
    height:auto;
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:11px 18px 11px 14px;
    border-radius:999px;
  }
  .back-to-top-label {
    display:inline;
    font-size:13px;
    font-weight:500;
    white-space:nowrap;
  }
}

/* 通用「捲動進畫面時由左到右畫出來」進場動畫，概念跟首頁 .shortcuts-deco-book
   一致（IntersectionObserver 偵測進畫面、只觸發一次），但手法改用 clip-path
   由左到右掃出來，取代 stroke-dasharray/dashoffset——因為 book.svg 原本是
   「一條完整的 path」才能直接量 getTotalLength() 拿來做線條描繪動畫；
   babytochild.svg 是 23 段各自獨立的填色色塊（Illustrator 把線條 expand
   成色塊的匯出結果），不是單一線條 path，硬套 dasharray 會變成每一段分開
   描邊、整張圖看起來會破碎失真，所以改用視覺上等效、但實作上更泛用的
   clip-path 掃出效果；也因為這次要套在 6 個不同頁面（不是像 book.svg
   只有首頁一處），做成這個通用 class，動畫觸發邏輯寫在共用 assets/js/main.js
   的 initDrawReveal()，而不是像 book.svg 那樣寫死在單一頁面的 inline
   <script> 裡。 */
.js-draw-reveal img {
  -webkit-clip-path: inset(0 100% 0 0);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.6s cubic-bezier(.16,1,.3,1);
}
.js-draw-reveal.is-drawn img {
  -webkit-clip-path: inset(0 0 0 0);
  clip-path: inset(0 0 0 0);
}

/* ============================================================
   主選單搜尋結果頁：search.html（2026-10-06 新增）
   使用者需求是「主選單的搜尋，我想要引導到搜尋結果頁面」，討論過範圍後
   確認：只需要做「介面」，不需要真的全文搜尋/比對邏輯——所以這裡的
   清單是固定的頁面捷徑（沿用現有單元頁版型：content-card 包一個簡單列表），
   點了會真的導到對應頁面，但不會真的依照搜尋關鍵字去比對/篩選內容。
   配色沿用全站既有 token：#8A6410 金棕（icon-circle hover、sub-item 選中
   邊框同一色）、#EAD9A8 邊框、#FFFAEA hover 底色，跟其他元件視覺一致。 */
.search-result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 16px;
  background: #FBF8F2;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background .2s, border-color .2s;
}
.search-result-row:hover,
.search-result-row:focus-visible {
  background: #FFFAEA;
  border-color: #EAD9A8;
}
.search-result-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.search-result-title {
  font-size: 16px;
  font-weight: 700;
  color: #4A4038;
}
.search-result-meta {
  font-size: 13px;
  color: #8A6410;
}
.search-result-arrow {
  flex: none;
  font-size: 18px;
  color: #8A6410;
}

/* 主選單搜尋框：原本是裝飾用 <label>，現在改成 <form action="search.html" method="get">，
   輸入後按 Enter 會用瀏覽器原生表單送出導到 search.html?q=關鍵字，不用額外寫 JS 導頁邏輯；
   放大鏡原本是純裝飾 <span>，現在包進 <button type="submit"> 讓點圖示也能送出，
   這裡只是重設按鈕的瀏覽器預設樣式（去除邊框/底色/padding），視覺跟原本的 <span> 一模一樣。 */
.site-search-submit {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.domain-warn-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 0 10px;
    border-radius: 999px;
    background: #FDF2F1;
    color: #df7062;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.9;
    white-space: nowrap;
}

