/* ===========================================================
   中文圓體：jf open 粉圓體（justfont 開源，SIL OFL 授權，可免費商用）
   這個檔只收了網站用到的字，所以從 4.7 MB 變成約 200 KB。
   產生方式：python tools/產生字型.py
   font-display: swap 的意思是——字型還沒載完時先用電腦內建字型顯示，
   使用者不會看到一片空白，載完才換過去。
   =========================================================== */
@font-face {
  font-family: "Huninn";
  src: url("fonts/huninn-subset.woff2?v=781ac3ea") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ===========================================================
   日日暖暖中途貓窩 官方網站 — 共用樣式
   -----------------------------------------------------------
   顏色一律用下面 :root 的變數，不要在個別地方寫死色碼，
   以後負責視覺的夥伴要調整配色只要改這一段就好。
   =========================================================== */

:root {
  /* 主色調取自貓窩 LOGO：藍色圓章 + 橘色放射線 + 白底
     整體走「藍白」：底色是極淡的藍白，藍色負責結構（按鈕、選單、步驟），
     橘色只留給強調處（統計數字、價格），讓畫面不會太冷。 */
  --bg:        #F6F9FD;   /* 頁面底色：極淡的藍白 */
  --surface:   #FFFFFF;   /* 卡片底色：純白 */
  --brand:     #3459C3;   /* 主色：LOGO 的藍，按鈕與重點 */
  --brand-dk:  #2A47A0;   /* 主色加深：滑過按鈕時、連結文字 */
  --brand-lt:  #E8EFFB;   /* 藍色極淡：選單滑過時的底色 */
  --band-bg:   #E9F0FA;   /* 淡藍：大區塊的底色 */
  --accent:    #EF8C53;   /* 強調色：LOGO 的橘 */
  --accent-dk: #D4703A;   /* 強調色加深 */
  --ink:       #26314A;   /* 主要文字：深藍灰，比純黑柔和 */
  --ink-soft:  #5F6B82;   /* 次要文字 */
  --line:      #DFE6F2;   /* 分隔線 */

  /* 狀態標籤顏色 */
  --ok:        #2E7247;   /* 待領養（顏色夠深，小字才看得清楚） */
  --ok-bg:     #E7F4EC;
  --wait:      #8A6410;   /* 洽談中 */
  --wait-bg:   #FBF2DC;
  --done:      #665775;   /* 已找到家 */
  --done-bg:   #F0ECF5;
  --todo:      #C0392B;   /* 待貓窩確認（雛形用，上線前移除） */
  --todo-bg:   #FDECEA;

  --radius:    16px;
  --shadow:    0 2px 12px rgba(38, 49, 74, .08);
  --wrap:      1080px;    /* 內容最大寬度 */
}

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Huninn", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a   { color: var(--brand-dk); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;   /* 手機左右留白 */
}

h1, h2, h3 { line-height: 1.4; letter-spacing: .01em; }
h1 { font-size: 1.9rem; margin: 0 0 .5em; }
h2 { font-size: 1.45rem; margin: 2.4em 0 .8em; }
h3 { font-size: 1.1rem; margin: 1.6em 0 .4em; }

/* ---------- 雛形提示橫幅（正式上線前整段刪掉） ---------- */
.proto-bar {
  background: #26314A;
  color: #DCE5F5;
  font-size: .82rem;
  text-align: center;
  padding: 7px 16px;
  line-height: 1.5;
}

/* ---------- 頁首與導覽 ---------- */
.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.head-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
/* 頁首的 LOGO 圖（images/logo-72.png，已經去背成圓形） */
.logo-mark {
  width: 44px; height: 44px;
  flex-shrink: 0;
}

/* 首頁主視覺裡的大 LOGO */
.hero-logo {
  width: 132px; height: 132px;
  margin: 0 0 18px;
}
@media (max-width: 560px) {
  .hero-logo { width: 104px; height: 104px; }
}
.logo-sub {
  display: block;
  font-size: .68rem;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: .08em;
}

.nav { margin-left: auto; }
.nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 4px;
}
.nav a {
  display: block;
  padding: 8px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .9rem;
  white-space: nowrap;
}
.nav a:hover { background: var(--brand-lt); color: var(--brand-dk); }
.nav a[aria-current="page"] {
  background: var(--brand-lt);
  color: var(--brand-dk);
  font-weight: 700;
}

/* 手機漢堡鈕：桌機隱藏 */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--brand-lt);
  border: 0;
  border-radius: 10px;
  width: 42px; height: 38px;
  font-size: 1.2rem;
  color: var(--brand-dk);
  cursor: pointer;
}

@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 8px 14px 16px;
    margin: 0;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav a { padding: 11px 12px; border-radius: 10px; }
}

/* ---------- 首頁主視覺 ---------- */
.hero {
  background: var(--band-bg);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 60px;
}
.hero h1 { font-size: 2.1rem; max-width: 20em; }
.hero p {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 34em;
  margin: 0 0 1.8em;
}

/* ---------- 按鈕 ---------- */
.btn, .btn-ghost {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: .97rem;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn { background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-dk); }
.btn-ghost { color: var(--brand-dk); border-color: var(--brand); background: transparent; }
.btn-ghost:hover { background: var(--brand-lt); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 數字統計 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 36px 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
}
.stat b {
  display: block;
  font-size: 2rem;
  color: var(--accent-dk);
  line-height: 1.2;
}
.stat span { font-size: .9rem; color: var(--ink-soft); }

/* ---------- 貓咪卡片 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  margin: 28px 0;
}
#game-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 440px));
  gap: 24px;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(38, 49, 74, .14);
}

.cat-photo {
  aspect-ratio: 1 / 1;   /* 正方形：首圖整張都看得到，不會切掉上下 */
  background: var(--band-bg);
  display: grid; place-items: center;
  color: #B6C5E0;
  font-size: 2.6rem;
  overflow: hidden;
}
.cat-photo img { width: 100%; height: 100%; object-fit: cover; }

.cat-body { padding: 16px 18px 20px; flex: 1; }
.cat-body h3 { margin: 0 0 4px; font-size: 1.18rem; }
.cat-meta {
  font-size: .86rem;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.cat-desc { font-size: .92rem; margin: 0; }
.cat-health {
  font-size: .84rem;
  color: var(--ink-soft);
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.chk-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  margin-left: 2px;
  border: 1.5px solid var(--ok);
  border-radius: 3px;
  background: #EAF5EE;
  color: var(--ok);
  font-size: .85em;
  font-weight: 700;
  line-height: 1;
  vertical-align: -1px;
}

/* 狀態標籤 */
.tag {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tag-ok   { background: var(--ok-bg);   color: var(--ok); }
.tag-wait { background: var(--wait-bg); color: var(--wait); }
.tag-done { background: var(--done-bg); color: var(--done); }
.tag-ask  { background: var(--todo-bg); color: var(--todo); }
/* 毛色分類標籤（等家的貓咪用這個，不顯示狀態） */
.tag-color { background: var(--brand-lt); color: var(--brand-dk); }

/* 篩選鈕 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 4px; }
.filters button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: .88rem;
  cursor: pointer;
  font-family: inherit;
}
.filters button:hover { border-color: var(--brand); color: var(--brand-dk); }
.filters button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

/* ---------- 一般內容區塊 ---------- */
/* 注意：只設上下，不要寫成 padding: 10px 0 40px，
   那會把 .wrap 的左右留白蓋掉，手機上文字會貼到螢幕邊緣。*/
.section { padding-top: 10px; padding-bottom: 40px; }
.band {
  background: var(--band-bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 44px 0;
  margin-top: 48px;
}
.band h2 { margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 18px 0;
}
.card h3:first-child { margin-top: 0; }

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.lead { font-size: 1.06rem; color: var(--ink-soft); max-width: 36em; }

/* 流程步驟 */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 24px 0; }
.steps li {
  counter-increment: s;
  position: relative;
  padding: 0 0 26px 26px;
  border-left: 2px solid var(--line);
  margin-left: 18px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(s);
  position: absolute;
  left: -19px; top: -4px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  display: grid; place-items: center;
}
.steps b { display: block; font-size: 1.05rem; padding-top: 2px; }

/* ---------- 待確認標記（雛形專用，上線前請全部處理掉） ---------- */
.todo {
  background: var(--todo-bg);
  border-left: 4px solid var(--todo);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  font-size: .93rem;
}
.todo::before {
  content: "⚠️ 這段要貓窩確認後替換";
  display: block;
  font-weight: 700;
  color: var(--todo);
  font-size: .8rem;
  margin-bottom: 6px;
  letter-spacing: .03em;
}
.todo p:last-child { margin-bottom: 0; }

/* ---------- 頁尾 ---------- */
.site-foot {
  background: var(--ink);
  color: #D6DEEE;
  margin-top: 60px;
  padding: 44px 0 28px;
  font-size: .9rem;
}
.site-foot a { color: #FFBE8C; }   /* 深藍底上留一點橘，呼應 LOGO */
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 28px;
}
.site-foot h4 { margin: 0 0 10px; font-size: .95rem; color: #fff; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 6px; }
.foot-note {
  border-top: 1px solid rgba(255, 255, 255, .14);
  margin-top: 30px; padding-top: 18px;
  font-size: .8rem;
  color: #9AA6BC;
}

/* 跳到主要內容（給使用鍵盤與讀螢幕軟體的人） */
.skip {
  position: absolute; left: -9999px;
  background: var(--brand); color: #fff;
  padding: 10px 18px; z-index: 100;
}
.skip:focus { left: 10px; top: 10px; }

/* ===========================================================
   最新消息 / 公益商品 / 養貓小知識
   如果決定不要某一區，把對應的樣式連同頁面一起刪掉就好。
   =========================================================== */

/* ---------- 小標籤（分類） ---------- */
.chip {
  display: inline-block;
  background: var(--brand-lt);
  color: var(--brand-dk);
  font-size: .76rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* ---------- 消息列表 ---------- */
/* ---------- 最新消息 ---------- */
.news-list { margin: 24px 0; }

.news-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 18px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.news-item.is-featured {
  border: 2px solid var(--accent);
  box-shadow: 0 6px 22px rgba(239, 140, 83, .14);
}
.news-item h3 {
  margin: 4px 0 10px;
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--ink);
}
.news-item .news-body {
  margin: 0 0 10px;
  line-height: 1.7;
  color: var(--ink);
  font-size: .95rem;
}

.news-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.news-head time {
  font-size: .85rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.news-head .chip { margin-bottom: 0; }
.chip-accent {
  background: var(--accent);
  color: #fff !important;
}

/* 活動資訊方塊（時間、地點等） */
.news-event-box {
  background: var(--brand-lt);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0 14px;
  font-size: .92rem;
}
.news-event-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.6;
}
.news-event-row + .news-event-row {
  margin-top: 5px;
}
.news-event-icon {
  flex-shrink: 0;
}

/* 連結按鈕 */
.news-action {
  margin: 14px 0 2px;
}
.news-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.news-link-btn:hover {
  background: var(--brand-dk);
  transform: translateY(-1px);
}
.news-item.is-featured .news-link-btn {
  background: var(--accent);
}
.news-item.is-featured .news-link-btn:hover {
  background: var(--accent-dk);
}

/* 示範資料：斜條紋底，一眼看出是「假」的（上線前這些都要刪） */
.news-item.is-demo {
  background: repeating-linear-gradient(
    45deg, var(--surface) 0 10px, var(--todo-bg) 10px 20px);
}

/* ---------- 公益商品（shop.html） ---------- */
.price {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent-dk);
  margin: 0 0 8px;
}

.shop-feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 24px;
  margin: 18px 0 36px;
}
.shop-feature-img {
  border-radius: 12px;
  overflow: hidden;
  background: var(--band-bg);
  box-shadow: 0 4px 16px rgba(38, 49, 74, .1);
}
.shop-feature-img img {
  width: 100%;
  height: auto;
  display: block;
}
.shop-feature-body h2 {
  margin: 8px 0 12px;
  font-size: 1.38rem;
  line-height: 1.35;
}
.shop-highlights {
  background: var(--brand-lt);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: .92rem;
}
.shop-hl-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.55;
}
.shop-hl-item + .shop-hl-item {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(52, 89, 195, .22);
}

.shop-scene-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 20px 0 36px;
}
.shop-scene-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 360px 1fr;
  align-items: center;
  box-shadow: var(--shadow);
}
.shop-scene-img {
  background: var(--band-bg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.shop-scene-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shop-scene-body {
  padding: 24px 28px;
}
.shop-scene-body h3 {
  margin: 8px 0 10px;
  font-size: 1.2rem;
}
.shop-scene-body p {
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.75;
  font-size: .95rem;
}
.shop-scene-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .shop-feature {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }
  .shop-scene-card {
    grid-template-columns: 1fr;
  }
  .shop-scene-body {
    padding: 18px 20px 22px;
  }
}

/* ---------- 知識文章 ---------- */
.draft-note {
  margin: 10px 0 0;
  font-size: .78rem;
  font-weight: 700;
  color: var(--todo);
}

.article { max-width: 36em; }
.article p { margin: 0 0 1.1em; }

/* ---------- YouTube 影片（點一下才載入） ---------- */
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--band-bg);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  margin: 12px 0 20px;
  max-width: 560px;
}
/* 封面壓一層深色，播放鈕才看得清楚 */
.video-embed::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(38, 49, 74, .32);
  transition: background .15s ease;
}
.video-embed:hover::after { background: rgba(38, 49, 74, .45); }
.video-embed[data-loaded]::after { display: none; }

.video-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 66px; height: 66px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  padding-left: 5px;          /* 三角形視覺置中 */
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(38, 49, 74, .35);
}
.video-embed:hover .video-play { background: var(--brand-dk); }

.video-note {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 8px 14px;
  font-size: .78rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(38, 49, 74, .75));
  text-align: center;
}

/* Shorts（直式影片）：播放框改成直式，寬度也要限制，不然在電腦上會超高 */
.video-embed.is-short {
  aspect-ratio: 9 / 16;
  max-width: 300px;
}

/* 封面圖（貓咪自己的照片，或 YouTube 縮圖） */
.video-cover {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.video-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ===========================================================
   領養流程（adopt.html）
   版面照若瑩的設計稿做成網頁元素，手機會自動換行，
   文字可以選取、搜尋得到，之後改字也不用重做圖。
   設計稿原檔在「設計稿/領養流程_設計稿.jpg」。
   =========================================================== */

/* 標題區：黃色圓角底 */
.flow-head {
  background: #FDF0D5;
  border-radius: 22px;
  padding: 22px 26px 18px;
  margin: 8px 0 28px;
  text-align: center;
}
.flow-head h1 { margin: 0 0 6px; font-size: 1.8rem; }
.flow-head p  { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* 五個步驟：直接用設計稿的五張橫幅，寬度自動縮放 */
.flow { list-style: none; margin: 0; padding: 0; }
.flow li { margin: 0 0 14px; }
.flow img {
  display: block;
  width: 100%;
  height: auto;
}

.flow-foot {
  text-align: center;
  color: var(--brand-dk);
  font-weight: 700;
  margin: 26px 0 8px;
}

/* 手機：標題小一點 */
@media (max-width: 640px) {
  .flow-head h1 { font-size: 1.5rem; }
}

/* ===========================================================
   單隻貓介紹頁：依毛色換背景
   對應表在 data/cats.js 的「_毛色主題」。
   目前先用漸層色當底；插畫做好之後，在每個主題加上 background-image，
   漸層會自動變成插畫還沒載入時的底色。
   =========================================================== */

/* 內容放在半透明白卡片裡，背景再花、再暗都讀得清楚 */
.cat-sheet {
  background: rgba(255, 255, 255, .92);
  border-radius: 24px;
  padding: 22px 26px 28px;
  box-shadow: 0 6px 28px rgba(38, 49, 74, .12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@media (max-width: 620px) {
  .cat-sheet { padding: 16px 16px 22px; border-radius: 20px; }
}

body[class*="theme-"] {
  background-attachment: fixed;
  background-size: cover;
  background-position: center top;
}

/* 卡片上方留一段空間，讓背景插畫的主場景露出來。
   手機上卡片幾乎佔滿寬度，左右只剩兩條細邊，
   所以插畫的重點要畫在「上方」，這一段就是給它的舞台。 */
body[class*="theme-"] .cat-sheet {
  margin-top: clamp(96px, 22vw, 180px);
}

.theme-night  { background: linear-gradient(180deg, #1F2B4D 0%, #2F3D6B 60%, #3D4A7A 100%); }
/* 七種毛色主題。底色取自該主題手機版插畫的最下緣，
   圖片捲完之後接上底色，看不出接縫。
   --hero-gap 是手機上卡片往下推多少，讓插畫的主場景完整露出來。 */
.theme-night {  
  background: #44517E;                  /* 夜晚（黑貓） */
  --art-m: url("../images/bg/night-m.jpg?v=4a218857");
  --art-d: url("../images/bg/night-d.jpg?v=53bcf0ac");
  --hero-gap: 52vw;
}
.theme-snow {   
  background: #EEF5FF;                  /* 雪地（白貓） */
  --art-m: url("../images/bg/snow-m.jpg?v=b484380e");
  --art-d: url("../images/bg/snow-d.jpg?v=0a1cf138");
  --hero-gap: 50vw;
}
.theme-piano {  
  background: #EEEFF3;                  /* 鋼琴（賓士貓） */
  --art-m: url("../images/bg/piano-m.jpg?v=b575b5a7");
  --art-d: url("../images/bg/piano-d.jpg?v=947298c8");
  --hero-gap: 50vw;
}
.theme-garden { 
  background: #FEEDE5;                  /* 花園（三花貓） */
  --art-m: url("../images/bg/garden-m.jpg?v=6b6fd32b");
  --art-d: url("../images/bg/garden-d.jpg?v=0f2ed8db");
  --hero-gap: 54vw;
}
.theme-autumn { 
  background: #F7E8D8;                  /* 秋天（玳瑁貓） */
  --art-m: url("../images/bg/autumn-m.jpg?v=b372d14e");
  --art-d: url("../images/bg/autumn-d.jpg?v=108cd832");
  --hero-gap: 52vw;
}
.theme-sunset { 
  background: #FED0A4;                  /* 夕陽（橘貓） */
  --art-m: url("../images/bg/sunset-m.jpg?v=e5b102ca");
  --art-d: url("../images/bg/sunset-d.jpg?v=1c3e777a");
  --hero-gap: 46vw;
}
.theme-forest { 
  background: #D6E0DB;                  /* 晨霧森林（灰虎斑貓） */
  --art-m: url("../images/bg/forest-m.jpg?v=554f9bcd");
  --art-d: url("../images/bg/forest-d.jpg?v=0df9cdaa");
  --hero-gap: 54vw;
}

/* 夜晚主題底色很暗：卡片外的少數元素（例如找不到貓時的訊息）改成淺色字 */
.theme-night main > .wrap > h1,
.theme-night main > .wrap > .lead { color: #F2F4FA; }

/* ===========================================================
   單隻貓頁的照片拼貼（波浪相框）
   張數不同排法不同，原則：不擁擠、活潑、微微歪斜。
   每個相框用 --r 指定歪斜角度，滑鼠移上去會擺正放大一點。
   =========================================================== */
.pf {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 4px auto 12px;
}
.pf-1 { aspect-ratio: 1 / .94; }
.pf-2 { aspect-ratio: 1 / 1.05; }
.pf-3 { aspect-ratio: 1 / .96; }

.pf-item {
  position: absolute;
  margin: 0;
  padding: 0;
  background: url("../images/frame-scallop.svg?v=68725538") center / 100% 100% no-repeat;
  filter: drop-shadow(0 5px 10px rgba(74, 29, 12, .16));
  transform: rotate(var(--r, 0deg));
  transition: transform .25s ease;
}
/* 相框的奶油色留邊用照片的 margin 來做，不用外框的 padding。
   原因：CSS 的 padding 百分比是照「整個拼貼區」的寬度算，不是照相框自己，
   結果小相框的邊框跟大相框一樣厚，照片被擠得很小（手機上只剩 88px）。
   照片的 margin 百分比則是照相框的寬度算，大小相框的邊框比例就一致了。 */
.pf-item img,
.pf-empty {
  display: block;
  width: 84%;
  margin: 8%;
  height: auto;
  aspect-ratio: 1 / 1;      /* 照片本身就是正方形，外框跟著它長 */
  object-fit: cover;
  border-radius: 3px;
}
.pf-empty {
  display: grid;
  place-items: center;
  background: #FDF0E4;
  font-size: clamp(2.4rem, 9vw, 4.2rem);
}
@media (hover: hover) {
  .pf-item:hover { transform: rotate(0deg) scale(1.04); z-index: 6; }
}
/* 手機沒有滑鼠，改成「點一下」觸發同樣的效果（class 由 site.js 加上） */
.pf-item.is-active { transform: rotate(0deg) scale(1.08); z-index: 6; }
.pf-item { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* 1 張：一張大的，微微歪 */
.pf-1 .a { width: 82%; left: 9%; top: 4%; --r: -3deg; }

/* 2 張：左上、右下交疊（照概念圖） */
.pf-2 .a { width: 63%; left: 1%;  top: 1%;     --r: -5deg; z-index: 1; }
.pf-2 .b { width: 63%; right: 1%; bottom: 1%;  --r: 4deg;  z-index: 2; }

/* 3 張：左邊大的，右邊上下兩張小的 */
.pf-3 .a { width: 60%; left: 0;   top: 14%;    --r: -4deg; z-index: 2; }
.pf-3 .b { width: 45%; right: 2%; top: 0;      --r: 6deg;  z-index: 1; }
.pf-3 .c { width: 45%; right: 5%; bottom: 0;   --r: -3deg; z-index: 3; }

/* 4～5 張：多的排在下面一列 */
.pf-row {
  display: flex;
  justify-content: center;
  gap: 8%;
  max-width: 460px;
  margin: 2px auto 14px;
}
.pf-row .pf-item { position: relative; width: 40%; }
.pf-row .r0 { --r: -4deg; }
.pf-row .r1 { --r: 5deg; }

/* 小愛心點綴，放在照片沒蓋到的空白角落 */
.pf-heart {
  position: absolute;
  aspect-ratio: 1;
  background: url("../images/deco-heart.svg?v=1591f9bb") center / contain no-repeat;
  z-index: 5;
  pointer-events: none;
}
.pf-1 .h1 { width: 12%; top: 0;   right: 3%;  transform: rotate(12deg); }
.pf-1 .h2 { width: 8%;  top: 13%; right: 0;   transform: rotate(-10deg); }
.pf-2 .h1 { width: 12%; top: 9%;  right: 13%; transform: rotate(10deg); }
.pf-2 .h2 { width: 9%;  top: 22%; right: 4%;  transform: rotate(-12deg); }
.pf-3 .h1 { width: 11%; top: 1%;  left: 8%;   transform: rotate(-10deg); }
.pf-3 .h2 { width: 8%;  top: 4%;  left: 24%;  transform: rotate(14deg); }

/* 一打開頁面，照片一張接一張「蹦」進來，最後停在微微歪斜的位置 */
@keyframes pf-pop {
  0%   { opacity: 0; transform: rotate(calc(var(--r, 0deg) + 14deg)) scale(.6); }
  65%  { opacity: 1; transform: rotate(calc(var(--r, 0deg) - 4deg)) scale(1.05); }
  100% { opacity: 1; transform: rotate(var(--r, 0deg)) scale(1); }
}
/* backwards：動畫只負責「開場」，結束後就把控制權還給 hover 和點一下的效果。
   如果用 both／forwards，動畫最後一格會一直卡著，滑過去就不會動了。 */
.pf-item { animation: pf-pop .6s cubic-bezier(.3, 1.3, .5, 1) backwards; }
.pf-item:nth-of-type(2) { animation-delay: .12s; }
.pf-item:nth-of-type(3) { animation-delay: .24s; }
.pf-row .pf-item:nth-of-type(1) { animation-delay: .36s; }
.pf-row .pf-item:nth-of-type(2) { animation-delay: .48s; }

/* 愛心輕輕跳動 */
@keyframes pf-beat {
  0%, 100% { scale: 1; }
  50%      { scale: 1.15; }
}
.pf-heart { animation: pf-beat 2.4s ease-in-out infinite; }
.pf-heart.h2 { animation-delay: .6s; }

@media (prefers-reduced-motion: reduce) {
  .pf-item { transition: none; animation: none; }
  .pf-heart { animation: none; }
}

/* ===========================================================
   有插畫的主題（在主題裡設定 --art-m／--art-d 就會啟用）

   頁面會往下捲很長（之後還會加影片），所以手機和電腦分開處理：

   手機：插畫當成頁首的大圖，「跟著頁面捲走」。
         主場景在最上面完整露出，往下捲兩側接著圖片下半部的小裝飾，
         再往下就是跟插畫下緣同色的底色。
         （手機上卡片幾乎佔滿寬度，如果背景固定不動，主場景會一直被卡片蓋住）

   電腦：插畫「固定不動」，內容在上面捲。
         不管捲到多下面，左右兩側的裝飾都一直看得到。
   =========================================================== */
@media (max-width: 760px) {
  body[class*="theme-"] main {
    background: var(--art-m, none) center top / 100% auto no-repeat;
  }
  body[class*="theme-"] .cat-sheet {
    margin-top: var(--hero-gap, clamp(96px, 22vw, 180px));
  }
}
@media (min-width: 761px) {
  body[class*="theme-"]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--art-d, none) center / cover no-repeat;
  }
  /* 電腦上卡片窄一點，兩側的插畫才露得出來 */
  body[class*="theme-"] .cat-sheet {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===========================================================
   「等家的貓咪」頁首橫幅
   插畫會跟著選的毛色換（圖片網址由 site.js 設定成 --hero-m／--hero-d）。
   標題疊在插畫上，所以插畫的那一側要留白：
   手機版左半邊留白、電腦版中間留白。
   =========================================================== */
.cats-hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

/* 手機：插畫整條完整顯示在上面，文字排在它下面。
   插畫的留白在左半邊，但手機螢幕窄，文字疊上去還是會卡到貓咪，
   所以乾脆上下排，兩邊都看得清楚。 */
.cats-hero::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 5 / 2;              /* 跟手機版插畫同比例（插畫要畫成 5:2，
                                       用 cover 填滿，寧可裁邊也不要拉變形） */
  background: var(--hero-m) center / cover no-repeat;
}
.cats-hero-text { width: 100%; padding-top: 14px; padding-bottom: 18px; }
.cats-hero h1 { margin: 0 0 .3em; }
.cats-hero .lead { margin: 0; }

/* 換毛色時淡淡地滑進來，讓人注意到場景換了 */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.cats-hero.is-in { animation: hero-in .45s ease both; }

/* 電腦：插畫當背景鋪滿，標題疊在中間的留白區 */
@media (min-width: 761px) {
  .cats-hero {
    background: var(--hero-d) center / cover no-repeat, var(--bg);
    display: flex;
    align-items: center;
    min-height: 290px;
  }
  .cats-hero::before { content: none; }
  .cats-hero-text { text-align: center; padding: 24px 0; }
  .cats-hero .lead { margin-left: auto; margin-right: auto; }

  /* 標題的顏色跟著主題換，不加任何底板。
     量過每張橫幅中間那塊，底色幾乎是平的（最暗和最亮只差個位數），
     所以不需要墊卡片或打光，只要把字調成跟底色相反的深淺就夠：
     淺色的插畫用深藍字、夜晚的深藍底用白字，對比都在 8:1 以上
     （無障礙標準是 4.5:1）。
     陰影放得很淡，只是防止字剛好壓到星星或貓耳朵時邊緣糊掉。 */
  /* 標題放在一張半透明的白卡片上。
     不透明的卡片會像貼上去的方塊，所以這裡只有 62% 白，
     插畫的顏色和線條會透出來，卡片是「浮在插畫上」而不是蓋住它。
     再加上背後模糊（毛玻璃），邊界就更不像一刀切下去的。
     沒有邊框、沒有實線陰影，只靠深淺差讓它浮起來。

     顏色由 site.js 跟著主題換：七張淺色插畫用白色的條配深藍字，
     夜晚是深藍底，改用深色的條配白字——同樣一條色帶，
     在深色插畫上用白色會很刺眼，用深色反而幾乎看不出來。
     這樣兩邊都能壓到 38% 左右（原本白條要 62% 才夠），
     而文字對比還有 9.8:1 以上（無障礙標準 4.5:1）。 */
  .cats-hero-text h1,
  .cats-hero-text .lead { color: var(--hero-ink, var(--ink)); }
  .cats-hero-card {
    max-width: 46em;
    margin: 0 auto;
    padding: 22px 72px 24px;
    border-radius: 999px;            /* 膠囊形：圓角等於高度的一半 */
    background: var(--hero-band, rgba(255, 255, 255, .38));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cats-hero.is-in { animation: none; }
}

/* ===========================================================
   底紋：貓掌、愛心、小魚、閃光，很淡地鋪在卡片區後面
   讓頁面下半部不要太空，但不能跟貓咪照片搶注意力，
   所以透明度壓得很低（.5 的不透明度 ＋ 本來就很淡的藍灰色）。
   =========================================================== */
.paw-bg {
  position: relative;
}
/* 底紋用「遮罩」而不是直接貼圖：
   同一張 SVG 就能換成任何顏色，不必為每個毛色各做一張圖。

   注意：底紋是一層真的 div（.paw-layer），不是 ::before。
   偽元素換顏色時瀏覽器不一定會重繪（實測 Chrome 就不會），
   用真的元素才穩。 */
.paw-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paw-art) 0 0 / 190px auto repeat;
  opacity: .55;
  pointer-events: none;
  transition: opacity .3s ease;
}
@media (max-width: 620px) {
  .paw-layer { background-size: 150px auto; }
}

/* ===========================================================
   認養自介表的題目清單（領養流程頁）
   題目有 18 題，單欄會拉得很長，電腦版分兩欄看得比較快。
   =========================================================== */
.qa-list {
  margin: 14px 0 0;
  padding-left: 1.4em;
  line-height: 1.9;
}
.qa-list li { margin-bottom: 2px; }
@media (min-width: 761px) {
  .qa-list { columns: 2; column-gap: 40px; }
  .qa-list li { break-inside: avoid; }
}
/* 卡片裡的補充說明（婉拒條件這類） */
.note {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--band-bg);
  font-size: .95rem;
  line-height: 1.8;
}

/* ===========================================================
   找到家的貓：一隻貓一則故事
   故事是從官方 FB／IG 的貼文整理的，每一則都附原文連結。
   手機上下排、電腦左右排（照片固定寬度，文字吃剩下的空間）。
   =========================================================== */
.story-list { display: grid; gap: 22px; margin-top: 26px; }

.story {
  /* 從縮圖點進來時會跳到這一則，留點空間免得被上面固定的選單蓋住 */
  scroll-margin-top: 90px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(31, 43, 77, .06);
}
.story-photo {
  border-radius: 14px;
  overflow: hidden;
  background: var(--band-bg);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
}
.story-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 第二張以後的照片：小一點，不裁切（合照常常是橫的） */
.story-media { display: grid; gap: 12px; align-content: start; }
.story-extra { margin: 0; }
.story-extra img {
  width: 100%; display: block;
  border-radius: 12px;
}
.story-extra figcaption {
  margin-top: 6px;
  font-size: .85rem;
  color: var(--ink-soft);
}
.story-body h3 { margin: 2px 0 8px; }
.story-body p { margin: 0 0 10px; }
.story-date { font-size: .9rem; color: var(--ink-soft); }
.story-src { margin: 0; font-size: .92rem; }

@media (min-width: 681px) {
  .story { grid-template-columns: 220px 1fr; align-items: start; gap: 24px; padding: 22px; }
}

/* ===========================================================
   找到家的貓：一排小縮圖（放在「等家的貓咪」頁尾）
   只有照片和名字，點了連到完整的故事。
   手機上可以橫向滑動，不會把頁面撐長。
   =========================================================== */
.home-strip {
  display: flex;
  gap: 14px;
  margin: 16px 0 18px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  position: relative;
  /* 電腦上用滑鼠拖著跑，游標要看得出來可以拖 */
  cursor: grab;
  /* 手機滑到每一張會自動對齊，不會停在半張貓臉 */
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.home-strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
/* 拖的時候不要選到文字 */
.home-strip.is-dragging * { user-select: none; }

/* 右邊還有東西的時候，蓋一塊漸層當提示 */
.home-strip-wrap { position: relative; }
.home-strip-wrap.has-more::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 10px;
  width: 56px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(246, 249, 253, 0), var(--bg));
}
.home-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 96px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
}
.home-photo {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--band-bg);
  font-size: 2rem;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(31, 43, 77, .12);
  transition: transform .2s ease;
}
.home-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-chip:hover .home-photo,
.home-chip:focus-visible .home-photo { transform: scale(1.06) rotate(-2deg); }
.home-name {
  display: block;
  margin-top: 8px;
  font-size: .92rem;
}

@media (max-width: 620px) {
  .home-chip, .home-photo { width: 84px; }
  .home-photo { height: 84px; }
}


/* ---------- 手機版的貓咪列表 ----------
   35 隻排成單欄的話整頁要捲 25 個畫面，所以手機改成兩欄，
   而且一次只先放 12 隻（程式在 assets/site.js 的 initCatList）。*/
@media (max-width: 760px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .cat-body { padding: 10px 11px 13px; }
  .cat-body h3 { font-size: 1.02rem; margin-bottom: 2px; }
  .cat-meta { font-size: .76rem; margin: 0 0 6px; }
  .cat-desc {
    font-size: .82rem;
    line-height: 1.45;
    /* 個性長短不一，卡片會參差不齊，統一壓成兩行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cat-body .tag { font-size: .72rem; padding: 2px 8px; }
}

.more-row {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
}
.more-row:empty { display: none; }
.more-row button { cursor: pointer; }

/* ===========================================================
   養貓小知識：精選大卡片、篇章卡片、圖解手冊翻頁閱讀器
   =========================================================== */
.tip-labels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.tip-labels .chip { margin-bottom: 0; }
.tip-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 999px;
}
.tip-type {
  font-size: .8rem;
  color: var(--ink-soft);
  font-weight: 700;
}
.tip-h1 { margin: 4px 0 6px; }
.tip-sub {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dk);
}

/* 精選大卡片（橫式雙欄，手機變上下） */
.tip-feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 24px 0 28px;
}
.tip-feature-cover {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--band-bg);
  overflow: hidden;
}
.tip-feature-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.tip-feature-cover:hover img {
  transform: scale(1.02);
}
.tip-feature-body {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tip-feature-body h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
}
.tip-feature-body p {
  margin: 0 0 16px;
}

/* 一般篇章卡片（16:9 封面） */
.tip-card .tip-cover {
  aspect-ratio: 16 / 9;
}

.tip-coming {
  margin: 8px 0 32px;
  padding: 16px 20px;
  background: var(--band-bg);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: .94rem;
  text-align: center;
}

/* 圖解手冊翻頁閱讀器 (.hb) */
.hb {
  margin: 22px 0 32px;
}
.hb-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1E2638;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(38, 49, 74, .16);
  border: 1px solid var(--line);
}
.hb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity .15s ease;
}
.hb-img.is-loading { opacity: .65; }

.hb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .22);
  display: grid;
  place-items: center;
  transition: background .15s ease, transform .15s ease;
}
.hb-nav:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-50%) scale(1.06);
}
.hb-nav:disabled {
  opacity: .3;
  cursor: default;
}
.hb-stage .hb-prev { left: 14px; }
.hb-stage .hb-next { right: 14px; }

.hb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hb-pager {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hb-step {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--band-bg);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}
.hb-step:hover:not(:disabled) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.hb-step:disabled {
  opacity: .35;
  cursor: default;
}
.hb-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 4.2em;
  text-align: center;
}
.hb-hint {
  font-size: .84rem;
  color: var(--ink-soft);
  margin-left: 4px;
}
.hb-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hb-tool {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  color: var(--brand-dk);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}
.hb-tool:hover {
  background: var(--brand-lt);
}

/* 當頁文字重點卡（補足手機上圖片字小、也給搜尋引擎與無障礙閱讀） */
.hb-note {
  margin-top: 14px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
}
.hb-title {
  margin: 0 0 6px;
  font-size: 1.12rem;
  color: var(--brand-dk);
}
.hb-text {
  margin: 0;
  font-size: .96rem;
  line-height: 1.7;
}

/* 下方橫向縮圖目錄列 */
.hb-toc-title {
  margin: 24px 0 10px;
  font-size: 1.05rem;
}
.hb-thumbs {
  list-style: none;
  margin: 0;
  padding: 4px 2px 12px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.hb-thumbs li {
  flex: 0 0 168px;
  scroll-snap-align: start;
}
.hb-thumbs button {
  width: 100%;
  padding: 6px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.hb-thumbs button:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.hb-thumbs button[aria-current="true"] {
  border-color: var(--accent-dk);
  background: #FFF8F3;
  box-shadow: 0 3px 10px rgba(212, 112, 58, .18);
}
.hb-thumbs img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin-bottom: 6px;
}
.hb-thumbs span {
  display: block;
  font-size: .8rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hb-thumbs b {
  display: inline-block;
  min-width: 1.5em;
  color: var(--brand-dk);
}

.tip-cta {
  background: var(--band-bg);
}

@media (max-width: 760px) {
  .tip-feature {
    grid-template-columns: 1fr;
  }
  .tip-feature-body {
    padding: 18px 18px 22px;
  }
  .tip-feature-body h2 {
    font-size: 1.3rem;
  }
  .hb-nav {
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
  }
  .hb-stage .hb-prev { left: 8px; }
  .hb-stage .hb-next { right: 8px; }
  .hb-hint { display: none; }
  .hb-thumbs li { flex: 0 0 140px; }
}

/* 橫向全畫面與 90 度自動轉向模式 */
body.hb-lock {
  overflow: hidden;
  touch-action: none;
}
.hb-fs-enter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(15, 20, 32, .75);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .15s ease, transform .15s ease;
}
.hb-fs-enter:hover {
  background: rgba(15, 20, 32, .92);
  transform: scale(1.04);
}
.hb-fs-exit,
.hb-fs-count {
  display: none;
}
.hb-tool-primary {
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.hb-tool-primary:hover {
  background: var(--brand-dk);
}

/* 進入全畫面狀態 */
.hb-stage.is-fs {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
  background: #0F1420;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
/* 手機直向時，自動順時針旋轉 90 度鋪滿全螢幕 */
.hb-stage.is-fs.is-rotated {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: 100vh;
  width: 100dvh;
  height: 100vw;
  transform: translate(-50%, -50%) rotate(90deg);
}
.hb-stage.is-fs .hb-fs-enter {
  display: none;
}
.hb-stage.is-fs .hb-fs-exit {
  display: inline-block;
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 3;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(15, 20, 32, .75);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.hb-stage.is-fs .hb-fs-count {
  display: inline-block;
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(15, 20, 32, .72);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.hb-stage.is-fs .hb-nav {
  width: 48px;
  height: 48px;
  font-size: 1.7rem;
  background: rgba(255, 255, 255, .82);
  z-index: 3;
}
.hb-stage.is-fs .hb-prev { left: 16px; }
.hb-stage.is-fs .hb-next { right: 16px; }

/* 點一下畫面中央可暫時隱藏按鈕，看清楚邊角細節 */
.hb-stage.is-fs.ui-hidden .hb-nav,
.hb-stage.is-fs.ui-hidden .hb-fs-exit,
.hb-stage.is-fs.ui-hidden .hb-fs-count {
  opacity: 0;
  pointer-events: none;
}
