/* 宿主頁（品牌說明中心）：讓 widget 有地方住。乾淨、不搶戲；記憶點是「螢光筆」：
   widget 的來源 chip 與被點到的段落標題用借 post-lab U10 的螢光筆底塊。顏色只用 base.css 變數或 color-mix 推。
   字：襯線只留給 h1，其餘標題一律無襯線（使用者打槍過「雜誌刊頭」感）。 */
:root {
  --a-text: color-mix(in oklab, var(--accent) 58%, var(--ink));
  --hl: color-mix(in oklab, var(--accent) 34%, transparent);
}
:root[data-mode='dark'] {
  --hl: color-mix(in oklab, var(--accent) 42%, transparent);
  --ink-3: color-mix(in oklab, var(--ink) 60%, var(--bg)); /* 深色底小字提亮，對比 ≥ 4.5 */
  --a-text: color-mix(in oklab, var(--accent) 80%, var(--ink));
}

.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }

/* ── 頁首 ── */
.top { border-bottom: 1px solid var(--line); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; padding-top: env(safe-area-inset-top); }
.top__brand { font-size: 17px; color: var(--ink); }
.top__nav { display: flex; gap: 6px; }
.top__link { padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; transition: background-color .2s var(--ease), color .2s var(--ease); }
@media (hover: hover) and (pointer: fine) { .top__link:hover { background: var(--well); color: var(--ink); } }

/* ── 首屏：左大標、右提問框 ── */
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-areas: 'title sub' 'title ask' 'title pop'; column-gap: 72px; align-items: end; padding: 84px 0 76px; }
.hero__title { grid-area: title; align-self: end; margin: 0; font: 400 clamp(42px, 5.6vw, 76px)/1.02 var(--font-display); letter-spacing: -.02em; max-width: 12ch; text-wrap: balance; }
/* 借 post-lab U17 標題配對：無襯線粗體大標＋一個斜體襯線重音字（皮的 copy.hero.titleAccent 有值才用） */
.hero__title.is-mixed { font: 800 clamp(40px, 5vw, 70px)/1.04 var(--font-sans); letter-spacing: -.02em; }
.hero__accent { font: italic 400 1.1em/1 var(--font-display); letter-spacing: -.01em; padding-right: .04em; }
.hero__sub { grid-area: sub; margin: 0 0 22px; font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
.ask {
  grid-area: ask; display: flex; gap: 6px; padding: 6px; border-radius: calc(var(--radius) + 6px);
  background: var(--surface); border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 16px 36px -22px rgb(0 0 0 / .3);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ask:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft), 0 16px 36px -22px rgb(0 0 0 / .3); }
.ask__input { flex: 1; min-width: 0; border: 0; background: none; padding: 0 12px; font-size: 16px; color: var(--ink); outline: none; }
.ask__input::placeholder { color: var(--ink-3); }
.ask__btn { flex: none; height: 46px; padding: 0 20px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; transition: transform .35s var(--spring); }
.ask__btn:active { transform: scale(.96); }
.ask__input:focus-visible { outline: none; }
.popular { grid-area: pop; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; font-size: 14.5px; }
.popular__label { color: var(--ink-3); margin-right: 4px; }
.popular__list { display: contents; }
/* 熱門問題＝首屏主要動作：40px 高的膠囊，點了開 widget 問那題 */
.popular__item {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px;
  cursor: pointer; color: var(--ink); background: var(--accent-soft); font-weight: 500; text-align: left; line-height: 1.3;
  transition: background-color .2s var(--ease), transform .35s var(--spring);
}
@media (hover: hover) and (pointer: fine) { .popular__item:hover { background: color-mix(in oklab, var(--accent) 24%, var(--surface)); } }
.popular__item:active { transform: scale(.97); }

/* ── 區段標題 ── */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 22px; }
.sec-head__title { margin: 0; font: 700 clamp(24px, 2.4vw, 30px)/1.2 var(--font-sans); letter-spacing: -.015em; }
.sec-head__sub { margin: 0; color: var(--ink-3); font-size: 15px; }

/* ── 主題：四塊可點的磚（點了開 widget 問那題） ── */
.topics { padding: 8px 0 88px; }
.topics__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.topic {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; min-width: 0;
  padding: 20px 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink); cursor: pointer; font: inherit;
  transition: border-color .25s var(--ease), transform .4s var(--spring);
}
.topic__count { font: 500 12px/1 var(--font-mono); color: var(--ink-3); }
.topic__title { font: 600 17px/1.35 var(--font-sans); margin-top: 14px; }
.topic__desc { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; flex: 1; }
.topic__go { display: block; margin-top: 10px; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--a-text); }
/* 箭頭黏在最後一個字後面，換行時一起走 */
.topic__arrow { display: inline-block; margin-left: .3em; white-space: nowrap; transition: transform .35s var(--spring); }
@media (hover: hover) and (pointer: fine) {
  .topic:hover { border-color: var(--accent-line); }
  .topic:hover .topic__arrow { transform: translateX(4px); }
}
.topic:active { transform: scale(.985); }

/* ── 常見問題：左側黏住標題，右側問答；widget 的「來源」連到這裡 ── */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 72px; padding: 0 0 96px; }
.faq__aside { position: sticky; top: 96px; align-self: start; }
.faq__aside .sec-head__sub { margin-top: 12px; max-width: 30ch; }
.faq__cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ink); background: none; color: var(--ink); font-weight: 600; font-size: 14.5px;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .35s var(--spring);
}
@media (hover: hover) and (pointer: fine) { .faq__cta:hover { background: var(--ink); color: var(--bg); } }
.faq__cta:active { transform: scale(.97); }
.faq__list { border-top: 1px solid var(--line); }
.qa { padding: 22px 0 24px; border-bottom: 1px solid var(--line); scroll-margin: 96px 0 140px; outline: none; }
.qa__q { margin: 0; font: 600 17px/1.35 var(--font-sans); }
.qa__a { margin: 10px 0 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.65; max-width: 62ch; }
/* 借 post-lab U10 螢光筆：widget 點來源 → 段落標題被一筆刷過，停一下再往右收掉 */
.hl-target {
  border-radius: .2em; padding: .02em .2em; margin-inline: -.2em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background-image: linear-gradient(var(--hl), var(--hl)); background-repeat: no-repeat;
  background-position: 0 0; background-size: 0% 100%;
  transition: background-size .75s var(--ease);
}
.hl-target.is-on { background-size: 100% 100%; }
.hl-target.is-out { background-position: 100% 0; background-size: 0% 100%; transition-duration: .6s; }

/* ── 頁尾 ── */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; padding: 28px 0 120px; border-top: 1px solid var(--line); }
.foot p { margin: 0; }
.foot__contact { color: var(--ink-2); font-size: 15px; max-width: 60ch; }
.foot__note { color: var(--ink-3); font-size: 13px; }

/* ── 回作品集＋換皮切換器：頁首正下方靠右一列，跟著頁面捲走（不再浮在內容上；右下角留給 widget 啟動鈕） ── */
.dock {
  position: absolute; z-index: 90; top: calc(68px + env(safe-area-inset-top) + 12px); bottom: auto; left: auto;
  right: max(24px, calc((100% - 1160px) / 2));
  display: flex; align-items: center; gap: 8px;
}
.dock .back-pill, .dock .skin-switcher { position: static; flex: none; }
[data-clean] .dock { display: none; }

/* ── 窄螢幕 ── */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'title' 'sub' 'ask' 'pop'; padding: 56px 0 56px; }
  .hero__title { margin-bottom: 20px; max-width: 14ch; }
  .topics__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .faq__aside { position: static; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .top__row { height: 60px; }
  .top__nav { display: none; }
  .hero { padding: 76px 0 44px; } /* 上面留一列給 dock */
  .hero__title { font-size: clamp(38px, 11vw, 48px); }
  .hero__title.is-mixed { font-size: clamp(36px, 10.5vw, 46px); }
  .dock { top: calc(60px + env(safe-area-inset-top) + 12px); right: 16px; }
  .hero__sub { font-size: 16px; }
  .ask__btn { padding: 0 16px; }
  .topics { padding-bottom: 56px; }
  .topics__grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .topic { padding: 16px 16px 18px; }
  .topic__title { margin-top: 8px; }
  .faq { padding-bottom: 64px; }
  .qa__a { font-size: 15px; }
  .foot { padding-bottom: 96px; }
}

/* 中文大標：只在標點換行（keep-all），字級縮到一行放得下九個字 */
:lang(zh-Hant) .hero__title { font-size: clamp(34px, 4.3vw, 60px); line-height: 1.2; letter-spacing: 0; word-break: keep-all; max-width: none; }
:lang(zh-Hant) .sec-head__title, :lang(zh-Hant) .topic__title, :lang(zh-Hant) .qa__q { letter-spacing: 0; }
/* 中文標題標點擠壓（全形標點不留半格空） */
:lang(zh-Hant) :is(h1, h2, h3, .topic__title, .popular__item) { font-feature-settings: 'palt'; }
