/* ============================================================
   酷吉一番賞 KUJI — PC 首頁 (Figma rdhkiq5… / PC首頁_1〜4)
   日式質感・暖珊瑚朱 — desktop landing, responsive
   ============================================================ */

:root {
  /* Primary */
  --p500: #F9001A;   /* 品牌主色 */
  --p300: #F4BAB6;   /* 連接線 */
  --p100: #FBE8E6;   /* icon 圓底 */
  /* Warm grey */
  --w900: #2B2118;   /* 主要文字 */
  --w700: #6E625A;   /* 次要文字 / 浮水印 */
  --w300: #E8D7C5;   /* 邊框 */
  --w100: #FDF2E4;
  --w50:  #FFF8EF;   /* 頁面底 */
  --w0:   #FFFFFF;

  --font: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', 'Hiragino Sans', sans-serif;
  --radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 2px 8px rgba(43,33,24,0.06);
  --shadow-md: 0 6px 18px rgba(43,33,24,0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--w50);
  color: var(--w900);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; }
svg { display: block; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header { background: var(--w0); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06); position: relative; z-index: 5; }
.header-inner {
  max-width: 1440px; margin: 0 auto; height: 80px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
}
.brand-logo img { height: 44px; width: auto; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-download {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 24px;
  background: var(--p500); color: #fff;
  border: none; cursor: pointer; font-family: inherit;
  border-radius: 100px; font-weight: 700; font-size: 16px; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s;
}
.btn-download svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-download:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(249,0,26,0.32); }

/* mobile hamburger nav (built by app.js) */
.nav-toggle {
  display: none; height: 44px; padding: 0 16px; flex: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--p300); background: var(--w0); color: var(--p500);
  border-radius: 100px; cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.nav-toggle:hover { background: var(--p100); }
.nav-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-header.nav-open .nav-toggle { background: var(--p500); border-color: var(--p500); color: #fff; }
/* full-width dropdown panel below the top bar */
.nav-menu {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  display: none; flex-direction: column; gap: 2px;
  background: var(--w0); border-top: 1px solid var(--w300);
  box-shadow: 0 14px 28px rgba(43,33,24,0.14);
  padding: 10px 16px 16px;
  animation: menu-down .2s var(--ease);
}
.nav-menu .nav-item { width: 100%; }
@keyframes menu-down { from { opacity: 0; transform: translateY(-8px); } }

/* mobile-only CTA buttons (below phone); hidden on desktop */
.mobile-cta { display: none; }

/* coming-soon toast */
.toast {
  position: fixed; top: 24px; left: 50%; z-index: 300;
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  background: var(--w0); color: var(--w900);
  border: 1px solid var(--w300); border-left: 4px solid var(--p500);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-50%) translateY(-16px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast-ico { flex: none; width: 28px; height: 28px; color: var(--p500); }
.toast-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.toast-text strong { font-family: 'Russo One', sans-serif; font-weight: 400; font-size: 16px; letter-spacing: 0.06em; color: var(--p500); }
.toast-text span { font-size: 14px; color: var(--w700); }

/* ---------- LINE 客服彈窗 ---------- */
.cs-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.cs-modal.show { display: flex; }
.cs-overlay { position: absolute; inset: 0; background: rgba(43,33,24,0.5); animation: cs-fade .2s var(--ease); }
.cs-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; max-height: 100%; }
.cs-card {
  width: min(360px, calc(100vw - 40px));
  background: var(--w0); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(43,33,24,0.28);
  padding: 28px 28px 24px; text-align: center;
  animation: cs-pop .25s var(--ease);
}
.cs-title { font-size: 22px; font-weight: 900; line-height: 1.3; color: var(--w900); }
.cs-sub { margin-top: 8px; font-size: 14px; color: var(--w700); }
.cs-qr { width: 200px; height: 200px; margin: 16px auto; display: block; border-radius: 8px; }
.cs-or { font-size: 14px; font-weight: 700; color: var(--w900); margin-bottom: 10px; }
.cs-id {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--w300); border-radius: 10px; padding: 8px 8px 8px 14px; background: var(--w50);
}
.cs-id-text { flex: 1; text-align: left; font-size: 16px; font-weight: 700; color: var(--w900); letter-spacing: 0.02em; }
.cs-copy {
  width: 36px; height: 36px; flex: none; border: none; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--w700); border-radius: 8px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.cs-copy svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-copy:hover { background: var(--p100); color: var(--p500); }
.cs-go {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 16px; height: 48px; border-radius: 100px;
  background: #06C755; color: #fff; font-weight: 700; font-size: 16px;
  transition: filter .2s var(--ease), transform .2s var(--ease);
}
.cs-go svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cs-go:hover { filter: brightness(1.05); transform: translateY(-1px); }
.cs-close {
  width: 44px; height: 44px; flex: none; border: none; cursor: pointer; border-radius: 100px;
  background: rgba(255,255,255,0.92); color: var(--w900);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.cs-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cs-close:hover { transform: scale(1.06); background: #fff; }
@keyframes cs-fade { from { opacity: 0; } }
@keyframes cs-pop { from { opacity: 0; transform: translateY(12px) scale(0.97); } }

/* ---------- 常見問題（籌備中）彈窗 ---------- */
.faq-card {
  width: min(360px, calc(100vw - 40px));
  background: var(--w0); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(43,33,24,0.28);
  padding: 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: cs-pop .25s var(--ease);
}
.faq-illu { width: 128px; height: 128px; object-fit: contain; }
.faq-title { font-size: 22px; font-weight: 900; line-height: 30px; color: var(--w900); }
.faq-sub { font-size: 14px; line-height: 22px; color: var(--w900); }
.faq-cs { letter-spacing: 0.08em; }
.faq-back {
  width: 160px; height: 44px; border-radius: 100px;
  border: 1px solid var(--p500); background: var(--w0); color: var(--p500);
  font-family: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.faq-back:hover { background: var(--p500); color: #fff; }

/* ============================================================
   STAGE  (red-tech frame as background, content centred)
   ============================================================ */
.stage {
  position: relative; flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 80px - 48px);
  /* vertical padding keeps content clear of the red frame's decorative band */
  padding: clamp(24px, 3.5vh, 56px) clamp(28px, 5vw, 80px);
}
.stage::before {
  content: ""; position: absolute; inset: 0;
  background: url("assets/home/bg-deco.png") center / 100% 100% no-repeat;
  z-index: 0; pointer-events: none;
}


.stage-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1000px; margin: 0 auto;
  display: grid;
  grid-template-columns: 232px minmax(290px, 1fr) 232px;
  align-items: start;
  justify-content: center;
  gap: clamp(20px, 3.5vw, 64px);
}

/* ============================================================
   LEFT — brand + nav
   ============================================================ */
.brand-title { font-size: 28px; font-weight: 900; line-height: 36px; letter-spacing: 0.115em; color: var(--w900); }
.brand-tagline { margin-top: 16px; font-size: 16px; letter-spacing: 0.115em; color: var(--w900); }
.rule { display: block; width: 64px; height: 2px; background: var(--p500); border-radius: 2px; }
.brand-block .rule { margin-top: 16px; }

.nav-card {
  margin-top: 40px; display: flex; flex-direction: column; gap: 8px;
  background: var(--w0); border: 1px solid var(--w300); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow-sm);
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; color: var(--w900);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.nav-ico { width: 24px; height: 24px; flex: none; color: var(--w900); }
.nav-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--p100); transform: translateX(3px); }

/* ============================================================
   CENTER — phone carousel
   ============================================================ */
.col-center { display: flex; justify-content: center; align-self: center; }
/* size by height so the phone shrinks to fit shorter viewports (never exceeds the frame) */
.phone { position: relative; aspect-ratio: 428 / 874; height: clamp(420px, calc(100vh - 250px), 840px); width: auto; }
.phone-shot {
  position: absolute; top: 0; left: 50%;
  height: 100%; width: auto; max-width: none;
  opacity: 0; transform: translateX(-50%) scale(0.99);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  filter: drop-shadow(0 24px 40px rgba(43,33,24,0.20));
}
.phone-shot.is-active { opacity: 1; transform: translateX(-50%) scale(1); }

/* ============================================================
   RIGHT — steps + support
   ============================================================ */
.col-right { display: flex; flex-direction: column; gap: 40px; }
.block-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.block-head > span:first-child { font-size: 16px; color: var(--w900); }

/* steps */
.steps { position: relative; display: flex; flex-direction: column; gap: 16px; }
.steps::before {
  content: ""; position: absolute; left: 34px; top: 42px; bottom: 42px;
  width: 4px; border-radius: 100px; background: var(--p300); z-index: 0;
}
.step {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  width: 224px; max-width: 100%;
  padding: 16px; border-radius: var(--radius);
  background: var(--w0); border: 1px solid var(--w300);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.step-ico {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--p100); border-radius: 100px; color: var(--p500);
}
.step-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.step-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.step-title { display: flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 700; line-height: 26px; color: var(--w900); }
.step-no {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center; border-radius: 100px;
  background: var(--p500); color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
}
.step-sub { font-size: 14px; line-height: 22px; color: var(--w700); }
.step.is-active { border-color: var(--p300); box-shadow: 0 6px 18px rgba(249,0,26,0.14); transform: translateX(-2px); }

/* support */
.store-list { display: flex; flex-direction: column; gap: 16px; width: 184px; max-width: 100%; }
.store-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: var(--radius);
  background: var(--w0); border: 1px solid var(--w300);
  box-shadow: var(--shadow-sm);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.store-ico { width: 24px; height: 24px; flex: none; object-fit: contain; }
.store-ico-svg { display: grid; place-items: center; color: var(--w900); }
.store-ico-svg svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.store-label { flex: 1; font-size: 16px; font-weight: 700; color: var(--w900); white-space: nowrap; }
.store-arr { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--w900); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.store-item:hover { border-color: var(--p300); transform: translateX(3px); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative; z-index: 5;
  min-height: 48px; padding: 12px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px clamp(20px, 4vw, 64px);
  font-size: 16px; color: var(--w900); text-align: center;
}
.site-footer span { max-width: 100%; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .stage-inner {
    grid-template-columns: minmax(0, 360px);
    justify-items: center;
    gap: 28px;
  }
  .col-left { display: flex; flex-direction: column; align-items: center; text-align: center; }
  /* 手機板：主標題往下移一點，避免 KUJIKUJI 上緣被紅框頂部裝飾蓋到 */
  .brand-block { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }

  /* 手機板：紅框背景滿版（左右上貼齊邊緣），高度只蓋到手機下方（不延伸到抽賞四部曲、不縱向拉伸變形） */
  .stage::before { top: 0; left: 0; right: 0; bottom: auto; height: calc(clamp(420px, calc(100vh - 250px), 840px) + 208px); }

  /* 手機板：top bar 固定在畫面最上方，捲動時不消失 */
  .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; box-shadow: 0 2px 10px rgba(43,33,24,0.07); }
  body { padding-top: 80px; }

  /* 手機板：左側選單收進漢堡選單 */
  .nav-toggle { display: inline-flex; }
  .col-left .nav-card, .doc-nav { display: none; }
  .site-header.nav-open .nav-menu { display: flex; }

  /* 手機板：top bar 兩顆下載鈕移除，改成疊在手機下半部 */
  .header-actions .btn-download { display: none; }
  .col-center { position: relative; width: 100%; max-width: 360px; }
  .mobile-cta {
    display: flex; flex-direction: column; gap: 8px;
    position: absolute; left: 0; right: 0; bottom: 14%; z-index: 3;
  }
  .mobile-cta .btn-download {
    width: 100%; height: 46px; justify-content: center; padding: 0 24px;
    box-shadow: 0 10px 24px rgba(43,33,24,0.22);
  }
  /* 下載App：白底紅字紅框 */
  .mobile-cta .btn-download.cta-outline { background: var(--w0); color: var(--p500); border: 1px solid var(--p500); }
  .mobile-cta .btn-download.cta-outline svg { stroke: var(--p500); }
  .mobile-cta .btn-download.cta-outline:hover { background: var(--p100); }

  /* 抽賞四部曲 / 支援平台：整欄整寬卡片 */
  .col-right { width: 100%; max-width: 360px; align-items: stretch; gap: 28px; }
  .col-right .block, .step, .store-list, .store-item { width: 100%; }
}

@media (max-width: 560px) {
  .header-inner { height: 64px; padding: 0 16px; }
  body { padding-top: 64px; }
  .brand-logo img { height: 32px; }
  .stage { padding: 24px 16px; min-height: 0; }
  .site-footer { flex-direction: column; gap: 4px; font-size: 13px; padding: 14px 18px; }
}

@media (max-width: 430px) {
  .brand-logo img { height: 28px; }
}

/* ============================================================
   INNER / DOCUMENT PAGE (隱私權政策 等)
   ============================================================ */
.nav-item.is-active { background: var(--p100); }

.doc-stage {
  position: relative; flex: 1;
  display: flex; height: calc(100vh - 80px - 48px);
  padding: 24px clamp(24px, 4vw, 72px);
}
.doc-stage::before {
  content: ""; position: absolute; inset: 14px;
  background: url("assets/home/bg-deco.png") center / 100% 100% no-repeat;
  z-index: 0; pointer-events: none;
}

.doc-layout {
  position: relative; z-index: 2;
  width: 100%; max-width: 1440px; margin: 0 auto;
  display: flex; gap: 16px; align-items: stretch; min-height: 0;
}
.doc-nav { align-self: flex-start; width: 160px; flex: none; margin-top: 0; }

.doc-card {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--w0); border: 1px solid var(--w300);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.doc-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px clamp(20px, 2.5vw, 32px); }
.doc-scroll::-webkit-scrollbar { width: 10px; }
.doc-scroll::-webkit-scrollbar-thumb { background: var(--w300); border-radius: 100px; border: 3px solid #fff; }

.doc-logo { height: 72px; width: auto; margin-bottom: 12px; }
.doc-title { font-size: 22px; font-weight: 900; line-height: 30px; color: var(--w900); margin-bottom: 8px; }
.doc-meta { font-size: 14px; line-height: 22px; color: var(--w700); }
.doc-body { margin-top: 8px; }
.doc-body p { font-size: 16px; line-height: 24px; color: var(--w900); margin: 0 0 2px; }
.doc-body h2 { font-size: 22px; font-weight: 900; line-height: 30px; color: var(--w900); margin: 24px 0 8px; }
.doc-num { margin-right: 4px; }
.doc-sub { font-size: 16px; line-height: 24px; color: var(--w900); margin: 2px 0; }
.doc-prefix { font-weight: 700; color: var(--p500); margin-right: 6px; }
.doc-list { margin: 4px 0; }
.doc-list li { position: relative; padding-left: 18px; font-size: 16px; line-height: 24px; color: var(--w900); }
.doc-list li::before { content: "・"; position: absolute; left: 2px; color: var(--p500); }
.doc-li { position: relative; padding-left: 30px; font-size: 16px; line-height: 24px; color: var(--w900); margin: 2px 0; }
.doc-li .doc-prefix { position: absolute; left: 0; margin: 0; }
.doc-effective { margin-top: 20px; padding-top: 12px; border-top: 1px dashed var(--w300); font-weight: 700; color: var(--w900); }

/* coming soon (建設中) */
.coming-soon {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px; gap: 8px;
}
.coming-soon .cs-logo { height: 88px; width: auto; margin-bottom: 16px; opacity: .92; }
.coming-soon .cs-eyebrow {
  font-family: 'Russo One', sans-serif; letter-spacing: 0.18em;
  font-size: clamp(28px, 5vw, 44px); color: var(--p500); line-height: 1.1;
}
.coming-soon .cs-title { font-size: clamp(20px, 3vw, 26px); font-weight: 900; color: var(--w900); margin-top: 4px; }
.coming-soon .cs-sub { font-size: 16px; line-height: 26px; color: var(--w700); max-width: 420px; }
.coming-soon .cs-rule { width: 64px; height: 2px; background: var(--p500); border-radius: 2px; margin: 16px 0 8px; }
.coming-soon .cs-back {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  height: 44px; padding: 0 24px; border-radius: 100px;
  background: var(--p500); color: #fff; font-weight: 700; font-size: 16px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s;
}
.coming-soon .cs-back:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(249,0,26,0.32); }

@media (max-width: 920px) {
  .doc-stage { height: auto; min-height: calc(100vh - 80px - 48px); padding: 20px 18px; }
  .doc-layout { flex-direction: column; align-items: stretch; }
  .doc-nav { width: 100%; align-self: stretch; }
  .nav-card { flex-direction: row; flex-wrap: wrap; }
  .doc-card { max-height: none; }
  .doc-scroll { overflow-y: visible; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .phone-shot { transition: opacity .2s linear; }
}
