:root {
  --ink: #0F1A2E; --ink-2: #4B5870; --paper: #F3F5F8; --card: #fff; --night: #0C1527;
  --coral: #DC3448; --gold: #F5B83D; --green: #34C77B; --line: rgba(15, 26, 46, .12);
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --num: "Barlow", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.85 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── 密碼鎖 ── */
.lock { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 50% 20%, #1B2A4A, var(--night) 70%); color: #fff; transition: opacity .45s var(--ease), transform .45s var(--ease); }
.lock.is-open { opacity: 0; transform: scale(1.04); pointer-events: none; }
.lock.shake .lock__card { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.lock__card { width: min(100%, 340px); text-align: center; }
.lock__brand { display: inline-flex; align-items: center; gap: .5em; text-decoration: none; font: 700 1.125rem/1 var(--num); letter-spacing: .16em; opacity: .85; }
.lock__brand span { font: 700 .7rem/1 var(--sans); letter-spacing: .1em; padding: .45em .6em; border-radius: 6px; background: var(--coral); }
.lock__title { margin-top: 28px; font: 900 2rem/1.25 var(--sans); }
.lock__sub { margin-top: 6px; color: rgba(255, 255, 255, .7); min-height: 1.85em; }
.lock__form { position: relative; margin: 26px auto 22px; width: 220px; }
.lock__form input { position: absolute; inset: 0; width: 100%; opacity: 0; font-size: 16px; cursor: text; }
.dots { display: flex; justify-content: space-between; pointer-events: none; }
.dots i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); transition: background-color .15s, transform .15s var(--ease); }
.dots i.on { background: #fff; transform: scale(1.1); }
.lock__form:focus-within .dots i:not(.on):first-of-type, .lock__form:focus-within .dots i.on + i:not(.on) { box-shadow: inset 0 0 0 2px var(--gold); }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; justify-content: center; }
.pad button { width: 72px; height: 72px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font: 600 1.75rem/1 var(--num); cursor: pointer; transition: background-color .15s; -webkit-tap-highlight-color: transparent; }
.pad button:hover { background: rgba(255, 255, 255, .18); }
.pad button:active { background: rgba(255, 255, 255, .32); }
.pad button[data-k="del"] { background: none; font-size: 1.5rem; }
.lock__help { margin-top: 26px; font-size: .875rem; color: rgba(255, 255, 255, .6); }

/* ── 教學 ── */
.guide { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 48px) 96px; }
.g-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center; }
.g-hero__mascot { width: clamp(96px, 14vw, 150px); aspect-ratio: 1; border-radius: 28px; object-fit: cover; box-shadow: 0 16px 30px -18px rgba(15, 26, 46, .6); }
.g-hero__kicker { display: inline-block; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; padding: .3em .8em; border-radius: 999px; background: #FDE7EA; color: var(--coral); }
.g-hero h1 { margin-top: .3em; font: 900 clamp(2.25rem, 5.4vw, 3.75rem)/1.15 var(--sans); letter-spacing: -.01em; }
.g-hero__lead { margin-top: .5em; color: var(--ink-2); max-width: 32em; }

.g-toc { position: sticky; top: 0; z-index: 2; margin: clamp(28px, 4vw, 48px) calc(-1 * clamp(20px, 4vw, 48px)) 0; padding: 12px clamp(20px, 4vw, 48px); background: rgba(243, 245, 248, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.g-toc ol { display: flex; gap: 8px; overflow-x: auto; counter-reset: t; scrollbar-width: none; }
.g-toc ol::-webkit-scrollbar { display: none; }
.g-toc li { counter-increment: t; flex: none; }
.g-toc a { display: inline-flex; align-items: center; gap: .5em; padding: .45em .95em .45em .5em; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; font-size: .9375rem; font-weight: 500; white-space: nowrap; }
.g-toc a::before { content: counter(t); display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--ink); color: #fff; font: 700 .8125rem/1 var(--num); }
.g-toc a:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }

.g-step { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding: clamp(48px, 7vw, 88px) 0; border-bottom: 1px solid var(--line); scroll-margin-top: 64px; }
.g-step--end { grid-template-columns: minmax(0, 1fr); border-bottom: 0; }
.g-step__n { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--coral); color: #fff; font: 700 1.375rem/1 var(--num); }
.g-step h2 { margin-top: 18px; font: 900 clamp(1.625rem, 3vw, 2.25rem)/1.3 var(--sans); }
.g-step h3 { margin-top: 1.4em; font: 700 1rem/1.5 var(--sans); color: var(--ink-2); }
.g-step__txt > p { margin-top: .8em; }
.g-step b { font-weight: 700; }
.g-list { margin-top: .6em; }
.g-list li { padding: .45em 0; border-bottom: 1px solid var(--line); }
.g-list b { margin-right: .4em; }
.g-chips { margin-top: .8em; display: flex; flex-wrap: wrap; gap: 8px; }
.g-chips li { padding: .3em .85em; border-radius: 999px; background: #E3F7EC; color: #17703F; font-size: .9375rem; font-weight: 500; }
.g-seq { margin-top: 1em; counter-reset: q; }
.g-seq li { counter-increment: q; position: relative; padding: .55em 0 .55em 2.4em; border-bottom: 1px solid var(--line); }
.g-seq li::before { content: counter(q); position: absolute; left: 0; top: .72em; width: 1.6em; height: 1.6em; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink); font: 700 .8125rem/1 var(--num); }
.g-note, .g-tip, .g-warn { margin-top: 1.1em !important; padding: .85em 1em .85em 2.8em; border-radius: 12px; position: relative; font-size: .9688rem; }
.g-note { background: #EEF2F8; }
.g-tip { background: #E3F7EC; }
.g-warn { background: #FFF1D6; }
.g-note::before, .g-tip::before, .g-warn::before { position: absolute; left: .9em; top: .85em; width: 1.3em; height: 1.3em; display: grid; place-items: center; border-radius: 50%; font: 700 .8125rem/1 var(--num); color: #fff; }
.g-note::before { content: "i"; background: var(--ink-2); }
.g-tip::before { content: "✓"; background: var(--green); }
.g-warn::before { content: "!"; background: var(--gold); color: var(--ink); }

.g-shots { display: grid; gap: 14px; }
.g-shots--2 { grid-template-columns: 1fr 1fr; }
.g-shots--3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-shots--3 .g-span2 { grid-column: span 2; }
.g-step:has(.g-shots--wide) { grid-template-columns: minmax(0, 1fr); }
.g-shots figure { min-width: 0; }
.g-zoom { display: block; width: 100%; padding: 0; border: 0; background: var(--card); border-radius: 14px; overflow: hidden; cursor: zoom-in; box-shadow: 0 1px 0 var(--line), 0 14px 30px -22px rgba(15, 26, 46, .6); transition: transform .25s var(--ease); }
.g-zoom:hover { transform: translateY(-2px); }
.g-zoom img { width: 100%; }
.g-shots figcaption { margin-top: 8px; font-size: .875rem; color: var(--ink-2); }

.g-cta { margin-top: 1.6em; display: flex; flex-wrap: wrap; gap: 12px; }
.g-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 1.5em; border-radius: 12px; text-decoration: none; font-weight: 700; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); }
.g-btn--primary { background: var(--coral); color: #fff; box-shadow: 0 10px 24px -10px rgba(220, 52, 72, .7); }
.g-btn:hover { filter: brightness(.95); }
.g-thanks { margin-top: 1.4em; color: var(--ink-2); }

/* ── 放大圖 ── */
.lb { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(8, 14, 28, .9); opacity: 0; transition: opacity .2s; cursor: zoom-out; }
.lb.on { opacity: 1; }
.lb img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.lb__x { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.75rem; line-height: 1; cursor: pointer; }

@media (max-width: 820px) {
  .g-step { grid-template-columns: minmax(0, 1fr); }
  .g-shots--3 { grid-template-columns: 1fr 1fr; }
  .g-shots--3 .g-span2 { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 420px) {
  .pad { grid-template-columns: repeat(3, 66px); gap: 12px 20px; }
  .pad button { width: 66px; height: 66px; }
  .g-hero { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } html { scroll-behavior: auto; } }
