/* 2026-10-10-two-weeks-side-quests 文章專屬樣式（元件前綴 .sq-）。
   載入方式：文章 raw-html 區塊內 <link rel="stylesheet" href="/blog/img/2026-10-10-two-weeks-side-quests/article.css">。
   站台 CSP 的 style-src 只放行 'self' 與 Google Fonts，不能用內聯 <style> 或 style="" 屬性，所以樣式全在此檔，
   動態數值（滑桿位置、橫條寬度）由 article.js 用 CSSOM（el.style.setProperty）寫入，CSSOM 不受該限制。
   顏色全部取站台 :root 變數（--bg／--card／--ink／--ink-2／--muted／--line），站台日後若加深色模式會自動跟著換；
   只有強調色（暖棕、墨綠）沿用站台既有的 #9A4B12／#3a5a40。 */

.sq {
  --sq-accent: #9A4B12;
  --sq-accent-2: #C8722B;
  --sq-green: #3a5a40;
  margin: 2.4em 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .02em;
}
.sq *, .sq *::before, .sq *::after { box-sizing: border-box; }
.sq :where(p, ul, ol) { margin: 0; padding: 0; list-style: none; }
.article .sq img { margin: 0; border-radius: 0; }
.sq button { font: inherit; letter-spacing: inherit; color: inherit; }
.sq-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.sq-title { margin: 0 0 .6em; font-size: 16px; font-weight: 500; letter-spacing: .06em; line-height: 1.5; }
.sq-hint { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.sq-cap { margin: 12px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ───────── 1. before-after 對照滑桿 ───────── */
.sq-ba__tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sq-ba__tab {
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 15px; cursor: pointer; transition: background .2s, color .2s;
}
.sq-ba__tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sq-ba__tab:focus-visible, .sq-ba__handle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .sq-ba__tab:hover { color: var(--ink); } .sq-ba__tab[aria-selected="true"]:hover { color: var(--bg); } }
.sq-ba__stage {
  --sq-x: 50%;
  position: relative; width: 100%; max-width: 440px; margin: 0 auto;
  aspect-ratio: 4 / 5; overflow: hidden; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
}
.sq-ba__layer { position: absolute; left: 0; right: 0; top: 46px; bottom: 8px; display: flex; justify-content: center; align-items: flex-end; background: var(--bg); }
.sq-ba__layer img { height: 100%; width: auto; max-width: none; flex: none; pointer-events: none; -webkit-user-drag: none; }
.sq-ba__layer--before { clip-path: inset(0 calc(100% - var(--sq-x)) 0 0); }
.sq-ba__tags { position: absolute; left: 0; right: 0; top: 0; height: 46px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; pointer-events: none; }
.sq-ba__tag { font-size: 14px; font-weight: 500; letter-spacing: .06em; line-height: 1.3; }
.sq-ba__tag small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: .04em; }
.sq-ba__tag--r { text-align: right; color: var(--sq-accent); }
.sq-ba__tag--r small { color: var(--sq-accent); opacity: .8; }
.sq-ba__handle {
  position: absolute; top: 0; bottom: 0; left: var(--sq-x); width: 44px; margin-left: -22px;
  display: flex; align-items: center; justify-content: center; cursor: ew-resize; touch-action: pan-y;
}
.sq-ba__handle::before { content: ""; position: absolute; top: 46px; bottom: 8px; left: 50%; width: 2px; margin-left: -1px; background: var(--ink); opacity: .75; }
.sq-ba__knob {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}
.sq-ba__knob::before, .sq-ba__knob::after { content: ""; position: absolute; top: 50%; margin-top: -6px; border: 6px solid transparent; }
.sq-ba__knob::before { left: 7px; border-right-color: var(--bg); border-left-width: 0; }
.sq-ba__knob::after { right: 7px; border-left-color: var(--bg); border-right-width: 0; }
.sq-ba__caption { margin: 12px 2px 0; font-size: 14px; color: var(--ink-2); line-height: 1.8; min-height: 3.6em; }
.sq-ba__caption b { font-weight: 500; color: var(--ink); }

/* 成品總覽圖 */
.sq-sheet { margin: 2.4em 0; }
.sq-sheet img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.sq-sheet img + img { margin-top: 12px; }
.sq-sheet figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.article .sq-sheet img { border-radius: 12px; margin: 0; }
.article .sq-sheet img + img { margin-top: 12px; }

/* ───────── 2. 三個入口、一個後端 ───────── */
.sq-arch { padding: 14px 8px 12px; }
.sq-arch__svg { display: block; width: 100%; height: auto; overflow: visible; }
.sq-arch__svg text { font-family: var(--serif); fill: var(--ink); letter-spacing: .02em; }
.sq-arch__svg .t-sub { fill: var(--muted); }
.sq-arch__svg .t-sec { fill: var(--muted); letter-spacing: .12em; }
.sq-arch__svg .box { fill: var(--bg); stroke: var(--line); stroke-width: 1.2; }
.sq-arch__svg .mini { fill: var(--card); stroke: var(--line); stroke-width: 1; }
.sq-arch__svg .link { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: .7; }
.sq-arch__svg .link.is-on { stroke: var(--ink-2); opacity: 1; stroke-width: 1.8; }
.sq-arch__svg .mk-muted { fill: var(--muted); }
.sq-arch__svg .mk-on { fill: var(--ink-2); }
.sq-arch__svg .mk-fb { fill: var(--sq-green); }
.sq-arch__svg .fb-line { fill: none; stroke: var(--sq-green); stroke-width: 1.6; stroke-dasharray: 5 4; }
.sq-arch__svg .fb-box { fill: var(--bg); stroke: var(--sq-green); stroke-width: 1.2; stroke-dasharray: 5 4; }
.sq-arch__svg .fb-solid { stroke-dasharray: none; }
.sq-arch__svg .fb-pill { fill: var(--card); stroke: var(--sq-green); stroke-width: 1; }
.sq-arch__svg .t-fb { fill: var(--sq-green); }
.sq-arch__svg .entry { cursor: pointer; outline: none; }
.sq-arch__svg .entry rect.box { transition: fill .25s, stroke .25s; }
.sq-arch__svg .entry.is-on rect.box { fill: var(--ink); stroke: var(--ink); }
.sq-arch__svg .entry.is-on text { fill: var(--bg); }
.sq-arch__svg .entry.is-on .t-sub { fill: var(--bg); opacity: .8; }
.sq-arch__svg .entry:focus-visible rect.box { stroke: var(--sq-accent); stroke-width: 3; }
.sq-arch__svg .badge { fill: var(--card); stroke: var(--ink); stroke-width: 1.2; }
.sq-arch__svg .badge-t { font-size: 12px; font-weight: 600; text-anchor: middle; }
.sq-arch__svg .entry.is-on .badge { fill: var(--sq-accent); stroke: var(--sq-accent); }
.sq-arch__svg .entry.is-on .badge-t { fill: #fff; }
.sq-arch__svg .backend.is-lit rect.box { stroke: var(--sq-accent); stroke-width: 2; }
.sq-arch__svg .lane { transition: opacity .3s; }
.sq-arch__svg .lane.is-dim { opacity: .4; }
.sq-arch__svg .step rect.box { transition: fill .2s, stroke .2s; }
.sq-arch__svg .step.is-lit rect.box {
  fill: color-mix(in srgb, var(--sq-accent) 14%, var(--bg)); stroke: var(--sq-accent); stroke-width: 1.8;
}
.sq-arch__svg .chip { fill: var(--sq-accent); }
.sq-arch__svg .dot-halo { fill: var(--sq-accent-2); opacity: .28; }
.sq-arch__svg .dot { fill: var(--sq-accent); stroke: #fff; stroke-width: 1.5; }
.sq-arch__svg .dot-g { fill: var(--sq-accent-2); }
.sq-arch__svg .route { fill: none; stroke: none; }
.sq-arch__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 6px 0; }
.sq-arch__pause {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-size: 14px; cursor: pointer;
}
.sq-arch__pause:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .sq-arch__pause:hover { background: var(--bg); } }
.sq-arch .sq-cap { margin: 0; flex: 1 1 220px; }
@media (prefers-reduced-motion: reduce) {
  .sq-arch__svg .entry rect.box, .sq-arch__svg .lane, .sq-arch__svg .step rect.box, .sq-ba__tab { transition: none; }
}

/* ───────── 3. 費用對照 ───────── */
.sq-cost__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sq-cost__col { padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); min-width: 0; }
.sq-cost__col--after { border-color: var(--sq-green); }
.sq-cost__label { margin: 0 0 4px; font-size: 14px; color: var(--muted); line-height: 1.5; letter-spacing: .04em; }
.sq-cost__col--after .sq-cost__label { color: var(--sq-green); }
.sq-cost__big { margin: 0; line-height: 1.15; white-space: nowrap; }
.sq-cost__num { font-family: var(--display); font-size: clamp(28px, 7vw, 40px); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.sq-cost__unit { font-size: 14px; color: var(--muted); margin-left: .3em; }
.sq-cost__rows { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.sq-cost__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 4px 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.sq-cost__row span:last-child { text-align: right; flex: none; max-width: 48%; color: var(--ink); }
.sq-cost__bars { margin-top: 16px; display: grid; gap: 12px; }
.sq-cost__bar-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 4px; }
.sq-cost__track { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.sq-cost__fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--muted); }
.sq-cost__fill--after { background: var(--sq-green); }
.sq-cost__save { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.7; }
.sq-cost__save b { font-weight: 600; color: var(--sq-green); }
.sq-cost__note { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
@media (max-width: 560px) {
  .sq-cost__cols { grid-template-columns: 1fr; }
  .sq-cost__row span:last-child { max-width: 55%; }
}

/* ───────── 4. 耳掛包捲動影片 ───────── */
.sq-film { margin: 2.4em 0; text-align: center; }
.sq-film__frame { position: relative; display: block; width: 100%; max-width: 360px; margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--bg); aspect-ratio: 2 / 3; }
.sq-film__frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.sq-film__btn {
  position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(17, 17, 17, .62); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sq-film__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sq-film.is-still .sq-film__btn { right: 50%; bottom: 50%; margin: 0 -33px -33px 0; width: 66px; height: 66px; font-size: 24px; }
.sq-film figcaption { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.sq-film .cta { margin: 1.2em 0 0; text-align: center; }
.sq-film__go {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.6em;
  border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 15px; letter-spacing: .06em;
  text-decoration: none; border: 1px solid var(--ink);
}
.sq-film__go:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) { .sq-film__go:hover { background: transparent; color: var(--ink); } }
@media (max-width: 420px) {
  .sq { padding: 12px; } .sq-arch { padding: 12px 4px 10px; }
  .sq-ba__tabs { gap: 6px; } .sq-ba__tab { padding: 0 12px; font-size: 14px; }
}
