/* 控制台公開封面：靛藍色語彙，淺色與深色都跟著系統。CSP 不允許 inline style，所有樣式都在這個檔案。 */
:root {
  --bg: #f5f6fa;
  --surface: #fdfdff;
  --soft: #e9ecf4;
  --text: #1d2433;
  --muted: #566078;
  --line: #dadfeb;
  --accent: #34476b;
  --accent-ink: #f5f6fa;
  --c2: #7389b3;
  --c3: #d1a566;
  --done: #2f7a5c;
  --wait: #9a6b24;
  --shadow: 0 24px 64px #1a22381a;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151d;
    --surface: #1b2030;
    --soft: #1a1f2c;
    --text: #e6eaf3;
    --muted: #a6afc2;
    --line: #323a4f;
    --accent: #aebdea;
    --accent-ink: #12151d;
    --c2: #7f93c4;
    --c3: #d9b97c;
    --done: #8fd0b0;
    --wait: #e0b878;
    --shadow: 0 24px 64px #0007;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.7; overflow-x: hidden; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--c2); outline-offset: 3px; border-radius: 8px; }

/* 開啟畫面：旋轉 logo 加文字，純 CSS 淡出，不需要 JavaScript */
.boot { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); color: var(--accent); animation: bootOut 0.55s ease 1.15s forwards; }
.boot-logo { width: 72px; height: 72px; stroke-width: 12; animation: spin 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
.boot-logo .dot, .logo .dot { fill: currentColor; stroke: none; }
.boot p { font-size: 15px; letter-spacing: 0.08em; color: var(--muted); animation: breathe 2.2s ease-in-out infinite; }
@keyframes bootOut { to { opacity: 0; visibility: hidden; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: 0.45; } }

/* 頂欄 */
.top { position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.4) blur(14px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid transparent; transition: border-color 0.3s; }
.top.stuck { border-bottom-color: var(--line); }
.top-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.logo { width: 32px; height: 32px; stroke-width: 14; color: var(--accent); }
.top-nav { display: flex; gap: 4px; margin-left: auto; }
.top-nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; transition: background 0.2s, color 0.2s; }
.top-nav a:hover { background: var(--soft); color: var(--text); }

/* 按鈕 */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s; }
.pill svg { width: 18px; height: 18px; }
.pill-sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.pill-xs { min-height: 36px; padding: 0 16px; font-size: 13px; }
.pill-solid { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 30%, transparent); }
.pill-soft { background: var(--soft); color: var(--text); }
.pill-ghost { border-color: var(--line); background: var(--surface); color: var(--text); }
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: translateY(0) scale(0.98); }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; color: var(--accent); opacity: 0.8; }

/* 手寫標題：辰宇落雁 Thin 子集字體（只含標題用到的字，見 scripts/brand/handwriting.md），載入前用系統楷體 */
@font-face { font-family: 'ChenYuluoyan Cover'; src: url('/welcome/handwriting.woff2') format('woff2'); font-display: swap; }
.hand { font-family: 'ChenYuluoyan Cover', 'BiauKai', 'DFKai-SB', 'Kaiti TC', 'STKaiti', serif; font-weight: 400; }

/* 首屏 */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 48px; padding-block: 56px 72px; }
.hero h1 { margin-top: 14px; font-size: clamp(38px, 5.6vw, 64px); line-height: 1.25; letter-spacing: 0.01em; }
.hero h1 em { position: relative; display: inline-block; font-style: normal; color: var(--accent); }
.swoosh { position: absolute; left: 0; right: 0; bottom: -8px; width: 100%; height: 14px; stroke: var(--c3); stroke-width: 3.2; }
.swoosh path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease) 1.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.lead { margin-top: 22px; max-width: 34em; font-size: 17px; color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.hero-copy > * { animation: rise 0.8s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: 1.2s; }
.hero-copy > :nth-child(1) { animation-delay: 1.1s; }
.hero-copy > :nth-child(3) { animation-delay: 1.3s; }
.hero-copy > :nth-child(4) { animation-delay: 1.4s; }
.hero-copy > :nth-child(5) { animation-delay: 1.5s; }
.hero-visual { animation: rise 0.9s var(--ease) 1.3s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* 示意視窗 */
.hero-visual { position: relative; display: grid; justify-items: center; }
.halo { position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.55; animation: drift 9s ease-in-out infinite alternate; }
.halo-a { width: 240px; height: 240px; top: 2%; left: 4%; background: color-mix(in srgb, var(--c2) 55%, transparent); }
.halo-b { width: 200px; height: 200px; right: 2%; bottom: 6%; background: color-mix(in srgb, var(--c3) 50%, transparent); animation-delay: -4s; }
@keyframes drift { to { transform: translate(14px, -10px) scale(1.06); } }
.win { position: relative; width: min(380px, 100%); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px 18px 14px; animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.win-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.win-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.win-bar span { margin-left: 8px; font-weight: 600; color: var(--text); }
.rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 14px; background: var(--bg); font-size: 14px; }
.row-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { flex: none; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.chip-done { color: var(--done); }
.chip-wait { color: var(--wait); }
.chip-draft { color: var(--muted); }
.chip.pop { animation: pop 0.5s var(--ease); }
@keyframes pop { 40% { transform: scale(1.18); } }
.win-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.meter { flex: 1; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.meter i { display: block; width: 33%; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.9s var(--ease); }
.meter i.w66 { width: 66%; }
.win-note { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

/* 區塊與卡片 */
.section { padding-block-start: 72px; }
.section-head { margin-bottom: 32px; text-align: center; }
.section-head h2 { margin-top: 6px; font-size: clamp(24px, 3vw, 32px); line-height: 1.3; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { font-size: 19px; }
.card p { margin-top: 6px; font-size: 15px; color: var(--muted); }
.badge { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--soft); color: var(--accent); }
.badge svg { width: 22px; height: 22px; }
.facts { display: grid; gap: 12px; width: min(640px, 100%); margin: 0 auto; padding: 0; list-style: none; }
.facts li { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.facts svg { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--accent); }

.closing { margin-top: 96px; padding: 56px 24px; border-radius: 40px; text-align: center; background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--c2) 30%, transparent), transparent 55%), radial-gradient(circle at 90% 100%, color-mix(in srgb, var(--c3) 26%, transparent), transparent 50%), var(--soft); }
.closing h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.3; }
.closing p { margin: 10px 0 26px; color: var(--muted); }
.foot { margin-top: 72px; padding-block: 32px 48px; border-top: 1px solid var(--line); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px; }
.foot p { font-size: 13px; color: var(--muted); }

/* 彈窗：桌機置中，手機為底部抽屜 */
body.modal-open { overflow: hidden; }
.modal { width: min(460px, calc(100% - 32px)); max-height: min(86dvh, 720px); padding: 0; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: hidden; animation: dialogIn 0.5s var(--ease) both; }
.modal::backdrop { background: color-mix(in srgb, var(--text) 38%, transparent); backdrop-filter: blur(4px); animation: fadeIn 0.3s ease both; }
.modal[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px 24px; }
.modal-head h2 { font-size: 18px; }
.modal-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.2s; }
.modal-close:hover { background: var(--soft); }
.modal-close svg { width: 20px; height: 20px; }
.modal-body { overflow-y: auto; padding: 4px 28px 20px; text-align: center; }
.orb-wrap { display: grid; place-items: center; height: 96px; }
.orb { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--soft); color: var(--accent); animation: orbPop 0.8s var(--ease) 0.15s both; }
.orb::before, .orb::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--accent); animation: ring 2.4s ease-out infinite; }
.orb::after { animation-delay: 1.2s; }
.orb svg { width: 28px; height: 28px; stroke-width: 1.5; }
.modal-lead { margin-bottom: 8px; font-size: 20px; font-weight: 700; animation: rise 0.7s var(--ease) 0.2s both; }
.modal-text, .modal-note { font-size: 14px; line-height: 1.9; color: var(--muted); text-wrap: balance; animation: rise 0.7s var(--ease) 0.3s both; }
.modal-text span { display: inline-block; }
.modal-hint { margin: 16px 0 8px; font-size: 14px; font-weight: 600; animation: rise 0.7s var(--ease) 0.4s both; }
.modal-points { display: grid; gap: 8px; width: min(100%, 22em); margin: 0 auto; padding: 0; list-style: none; text-align: left; font-size: 14px; }
.modal-points li { display: flex; align-items: flex-start; gap: 8px; animation: slideIn 0.6s var(--ease) 0.3s both; }
.modal-points li:nth-child(2) { animation-delay: 0.4s; }
.modal-points li:nth-child(3) { animation-delay: 0.5s; }
.modal-points li:nth-child(4) { animation-delay: 0.6s; }
.modal-points svg { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.modal-note { margin-top: 16px; font-size: 13px; }
.modal-foot { display: flex; gap: 10px; justify-content: center; padding: 14px 24px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.modal-foot .pill { flex: 1; max-width: 200px; padding: 0 16px; font-size: 15px; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes orbPop { from { opacity: 0; transform: scale(0.4); } }
@keyframes ring { from { opacity: 0.6; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 32px 48px; text-align: center; }
  .lead { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .top-nav { display: none; }
  .top-inner { justify-content: space-between; }
}
/* 手機：卡片橫排、緊湊，避免捲很久才看完 */
@media (max-width: 680px) {
  .modal { width: 100%; max-width: none; margin: auto 0 0; border-radius: 24px 24px 0 0; max-height: 92dvh; animation: sheetIn 0.5s var(--ease) both; }
  .brand span { font-size: 15px; }
  .section { padding-block-start: 48px; }
  .section-head { margin-bottom: 20px; }
  .card { flex-direction: row; align-items: flex-start; gap: 12px; padding: 16px; border-radius: 22px; }
  .card h3 { font-size: 17px; }
  .card p { margin-top: 2px; font-size: 14px; line-height: 1.6; }
  .badge { width: 40px; height: 40px; border-radius: 12px; }
  .facts li { padding: 13px 16px; border-radius: 18px; font-size: 14px; }
  .closing { margin-top: 56px; padding: 40px 20px; border-radius: 30px; }
  .foot { margin-top: 48px; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
  .foot-links { gap: 8px; }
  .foot-links .pill { padding: 0 13px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boot { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .swoosh path { stroke-dashoffset: 0; }
}
