/* Fusang 官網（feature/official-website，第 13 款「扶桑日出・動畫版」）
   配色取自正式圖示：黑 #0D0E14、米白 #F7F2E9、朱紅 #E84920 */
:root {
  --ink: #0d0e14;
  --ink-deep: #07080b;
  --ink-panel: #15161e;
  --ink-raise: #1c1d27;
  --cream: #f7f2e9;
  --cream-raise: #fffdf8;
  --cream-muted: rgba(247, 242, 233, 0.78);
  --cream-faint: rgba(247, 242, 233, 0.6);
  --line: rgba(247, 242, 233, 0.12);
  --line-strong: rgba(247, 242, 233, 0.32);
  --sun: #e84920;
  --sun-text: #ff7a50;
  --sun-soft: #ffad8f;
  --sun-wash: rgba(232, 73, 32, 0.14);
  --sun-dim: #7a3423;
  --paper-ink: #0d0e14;
  --paper-ink-2: #4a4740;
  --paper-line: rgba(13, 14, 20, 0.12);
  --seal: #b23a1c;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --radius-pill: 999px;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); overflow-wrap: anywhere; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 900px; }
.center { text-align: center; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 8px 14px; background: var(--cream); color: var(--ink); border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--sun-soft); outline-offset: 3px; border-radius: 4px; }

/* ── 主視覺 ── */
.hero { position: relative; min-height: 900px; overflow: hidden; background: var(--ink); }
.hero-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; height: auto; opacity: 0.18; animation: drift linear infinite; will-change: transform; }
.cloud-a { top: 90px; width: 300px; animation-duration: 140s; animation-delay: -40s; opacity: 0.22; }
.cloud-b { top: 260px; width: 220px; animation-duration: 180s; animation-delay: -120s; opacity: 0.16; }
.cloud-c { top: 470px; width: 170px; animation-duration: 110s; animation-delay: -70s; }
.cloud-d { top: 60px; width: 260px; animation-duration: 160s; animation-delay: -90s; opacity: 0.14; }
.embers { position: absolute; inset: 0; }
.ember { position: absolute; bottom: 120px; border-radius: 50%; background: #ff7a45; opacity: 0; animation: rise linear infinite; }

.scene { position: absolute; right: 2%; bottom: 60px; width: min(620px, 52%); aspect-ratio: 900 / 1200; will-change: transform; }
.scene-sway { position: absolute; inset: 0; transform-origin: 50% 100%; animation: sway 9s ease-in-out infinite; }
.tree { position: absolute; inset: 0; width: 100%; height: 100%; animation: grow 1.8s ease-out both; }
.sun {
  position: absolute; left: var(--x); top: var(--y); aspect-ratio: 1; border-radius: 50%;
  background: var(--sun); translate: -50% -50%;
}
.sun-big { width: var(--s); animation: sunUp 2.6s cubic-bezier(0.2, 0.7, 0.2, 1) both, glow 4s ease-in-out 2.6s infinite; }
.sun-small { width: 4.2%; box-shadow: 0 0 12px 3px rgba(232, 73, 32, 0.55); opacity: 0; animation: pop 0.6s ease-out both; animation-delay: calc(2.2s + var(--d) * 0.22s); }

.sea { position: absolute; left: 0; right: 0; bottom: 0; height: 260px; pointer-events: none; }
.wave { background-image: url("/assets/img/waves.webp"); background-repeat: repeat-x; background-position-y: bottom; }
.wave-back { position: absolute; inset: 0 0 70px 0; opacity: 0.38; background-size: auto 150px; animation: waveB 60s linear infinite; }
.sea-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: var(--ink); }
.wave-front { position: absolute; inset: 0; background-size: auto 210px; animation: waveA 38s linear infinite; }

.hero-inner { position: relative; }
.nav { display: flex; align-items: center; gap: 16px; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 1px rgba(247, 242, 233, 0.2); }
.brand span { font-size: 14px; font-weight: 500; opacity: 0.8; }
.nav-links { margin-left: auto; display: flex; gap: 28px; font-size: 14.5px; }
.nav-links a { text-decoration: none; color: var(--cream-muted); }
.nav-links a:hover { color: var(--cream); }
.lang {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: rgba(13, 14, 20, 0.6);
  color: var(--cream); font: inherit; font-size: 13px; cursor: pointer;
}
.lang svg, .btn svg, .dl-small svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lang:hover { border-color: var(--cream-faint); }

.hero-copy { max-width: 680px; padding: 90px 0 300px; display: flex; flex-direction: column; gap: 22px; }
.pill { align-self: flex-start; margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: var(--radius-pill); background: var(--sun-wash); border: 1px solid rgba(232, 73, 32, 0.5); color: var(--sun-soft); font-size: 13px; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); animation: glow 4s ease-in-out infinite; }
h1 { margin: 0; font-weight: 900; font-size: clamp(36px, 3.9vw, 56px); line-height: 1.18; letter-spacing: 1px; }
h1 em { font-style: normal; color: var(--sun-text); }
@media (min-width: 1000px) { h1 span, h1 em { white-space: nowrap; } }
.myth { margin: 0; font-family: var(--serif); font-size: 17px; color: var(--cream-muted); border-left: 2px solid var(--sun); padding-left: 14px; }
.lead { margin: 0; font-size: 18px; color: rgba(247, 242, 233, 0.9); }
.fineprint { margin: 0; font-size: 13px; color: var(--cream-faint); }
.fineprint a { color: var(--sun-soft); font-weight: 600; text-decoration: none; }

/* 下載按鈕 */
.dl-row { display: flex; flex-wrap: wrap; gap: 12px; }
.center .dl-row { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px; min-height: 52px;
  border-radius: var(--radius); text-decoration: none; font-weight: 700; text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-2px); }
.btn small { display: block; font-weight: 400; font-size: 12px; line-height: 1.3; opacity: 0.9; overflow-wrap: anywhere; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn .apple { fill: currentColor; stroke: none; }
.btn-primary { background: var(--sun); color: #fff; }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(232, 73, 32, 0.45); }
.btn-ghost { border: 1px solid var(--line-strong); background: rgba(13, 14, 20, 0.6); color: var(--cream); }
.btn-ghost:hover { border-color: var(--cream-faint); }
.dl-note { margin: 10px 0 0; font-size: 13px; color: var(--cream-faint); }
.skeleton { display: inline-block; height: 52px; width: 240px; border-radius: var(--radius); background: var(--ink-raise); animation: shimmer 1.4s ease-in-out infinite; }
.skeleton + .skeleton { width: 160px; }
.state { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(13, 14, 20, 0.7); color: var(--cream-muted); }
.center .state { justify-content: center; }
.state button { min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: transparent; color: var(--cream); font: inherit; cursor: pointer; }

/* ── 代理跑馬燈 ── */
.marquee { background: var(--ink-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 18px 0; }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: marquee 30s linear infinite; font-weight: 600; font-size: 15px; color: var(--cream-muted); letter-spacing: 0.5px; }
.marquee-track span { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.marquee-track span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }

/* ── 區塊 ── */
.section { padding: 104px 0; }
.section.dark { background: var(--ink); }
.section.panel { background: var(--ink-panel); }
.section.paper { background: var(--cream); color: var(--paper-ink); }
.kicker { margin: 0 0 10px; font-family: var(--serif); color: var(--sun-text); letter-spacing: 4px; font-size: 13px; }
.section h2 { margin: 0; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.3; }
.sub { margin: 12px 0 0; color: var(--cream-muted); }

/* 實際畫面 */
.shot { margin: 40px 0 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink-panel); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line-strong), 0 0 120px rgba(232, 73, 32, 0.16); }
.shot img { width: 100%; height: auto; }
.gallery { margin-top: 56px; }
.gallery-tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 6px; border-radius: var(--radius-pill); background: var(--ink-panel); border: 1px solid var(--line); }
.gallery-tabs button { min-height: 40px; padding: 0 18px; border-radius: var(--radius-pill); border: 0; background: transparent; color: var(--cream-muted); font: inherit; font-size: 14.5px; cursor: pointer; }
.gallery-tabs button[aria-selected="true"] { background: var(--sun); color: #fff; }
.shot-gallery { margin-top: 20px; }
.shot-gallery figcaption { padding: 14px 18px; font-size: 14px; color: var(--cream-muted); text-align: left; border-top: 1px solid var(--line); }

/* 功能 */
.section-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 48px; }
.section-head > div { max-width: 640px; }
.section-head > p { margin: 0; max-width: 420px; color: var(--paper-ink-2); }
.paper h2 { color: var(--paper-ink); }
.seal { display: inline-flex; align-items: center; gap: 10px; color: var(--seal); font-weight: 700; }
.seal-mark { width: 22px; height: 22px; border-radius: 4px; background: var(--sun); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; letter-spacing: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.feature { background: var(--cream-raise); border: 1px solid var(--paper-line); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 12px; transition: transform 0.2s, box-shadow 0.2s; }
.feature:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(13, 14, 20, 0.16); }
.feature-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px rgba(232, 73, 32, 0.18); }
.feature-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--cream); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0; font-size: 19px; }
.feature p { margin: 0; font-size: 14.5px; color: var(--paper-ink-2); }

/* 運作方式 */
.steps { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; text-align: left; }
.step { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--radius-xl); background: rgba(247, 242, 233, 0.04); border: 1px solid var(--line); }
.step-sun { width: 52px; height: 52px; border-radius: 50%; background: var(--sun); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 22px; font-weight: 900; animation: glow 4s ease-in-out infinite; }
.step h3 { margin: 0; font-size: 21px; }
.step p { margin: 0; color: var(--cream-muted); font-size: 15px; }

/* 版本紀錄（太陽時間軸） */
.timeline { list-style: none; margin: 40px 0 0; padding: 0 0 0 36px; border-left: 2px solid rgba(247, 242, 233, 0.55); display: flex; flex-direction: column; gap: 28px; }
.release { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 24px; border-radius: var(--radius-lg); background: rgba(247, 242, 233, 0.04); border: 1px solid var(--line); }
.release::before { content: ""; position: absolute; left: -46px; top: 28px; width: 16px; height: 16px; border-radius: 50%; background: var(--sun-dim); box-shadow: 0 0 0 3px var(--ink); }
.release.latest::before { left: -51px; top: 24px; width: 26px; height: 26px; background: var(--sun); box-shadow: none; animation: glow 4s ease-in-out infinite; }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.release-version { font-family: var(--serif); font-size: 24px; font-weight: 900; overflow-wrap: anywhere; }
.badge { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--sun); color: #fff; font-size: 12px; font-weight: 700; }
.release-date { color: var(--cream-faint); font-size: 14px; }
.release-notes { margin: 0; color: rgba(247, 242, 233, 0.88); white-space: pre-line; overflow-wrap: anywhere; }
.release-links { display: flex; flex-wrap: wrap; gap: 10px; }
.dl-small { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); text-decoration: none; font-size: 14px; font-weight: 600; }
.dl-small:hover { border-color: var(--sun-soft); }
.dl-small small { font-weight: 400; color: var(--cream-faint); }
.show-all { margin-top: 20px; min-height: 42px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: transparent; color: var(--cream); font: inherit; cursor: pointer; }

/* 下載區（旭日） */
.download { position: relative; overflow: hidden; background: var(--ink); padding: 120px 0 430px; }
.download-sky { position: absolute; inset: 0; pointer-events: none; }
.sunrise { position: absolute; left: 50%; bottom: 0; width: 380px; height: 380px; margin-left: -190px; border-radius: 50%; background: var(--sun); animation: glow 4s ease-in-out infinite; }
.download .wave-front { top: auto; height: 240px; }
.download-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.download h2 { margin: 0; font-size: clamp(32px, 4vw, 46px); line-height: 1.25; }
.download .sub { margin: 0; font-size: 17px; }
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; width: 100%; max-width: 760px; text-align: left; }
.notes > div { background: rgba(13, 14, 20, 0.78); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; color: var(--cream-muted); }
.notes b { display: block; color: var(--cream); margin-bottom: 4px; }

.footer { background: var(--ink-deep); border-top: 1px solid var(--line); }
.footer-inner { padding: 28px 24px 40px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; font-size: 13px; color: var(--cream-faint); }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { border-radius: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--cream); }

/* ── 進場與捲動動畫 ── */
.reveal-load { animation: up 0.9s ease-out both; animation-delay: calc(0.1s + var(--i, 0) * 0.15s); }
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.js .reveal.is-in { opacity: 1; transform: none; }
.paused, .paused * { animation-play-state: paused !important; }

@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 0.85; } 100% { transform: translateY(-560px); opacity: 0; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 30px 8px rgba(232, 73, 32, 0.55); } 50% { box-shadow: 0 0 56px 18px rgba(232, 73, 32, 0.8); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes sunUp { 0% { transform: translateY(520px) scale(1.25); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes grow { from { clip-path: inset(100% 0 0 0); opacity: 0.2; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes waveA { from { background-position-x: 0; } to { background-position-x: -1546px; } }
@keyframes waveB { from { background-position-x: 0; } to { background-position-x: 1104px; } }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(110vw); } }
@keyframes sway { 0%, 100% { transform: rotate(-0.6deg); } 50% { transform: rotate(0.6deg); } }
@keyframes shimmer { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sun-small, .tree { opacity: 1; }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .lang { margin-left: auto; }
  .hero { min-height: 0; }
  .hero-copy { padding: 48px 0 280px; }
  .scene { width: 92%; right: -18%; bottom: 90px; opacity: 0.38; }
  .section { padding: 72px 0; }
  .btn { width: 100%; justify-content: center; }
  .timeline { padding-left: 28px; }
  .release { padding: 18px; }
  .release::before { left: -38px; }
  .release.latest::before { left: -43px; }
  .download { padding: 80px 0 300px; }
  .sunrise { width: 280px; height: 280px; margin-left: -140px; }
}
