/* ==========================================================================
   Every666 — 全站樣式表
   結構：1.設計變數 2.基礎 3.版面工具 4.頁首 5.頁尾 6.首頁 7.教學頁 8.法律頁
   要改顏色、字級、間距，改「1.設計變數」就好，不用動下面的規則。
   ========================================================================== */

/* ---------- 1. 設計變數 ---------- */
:root {
  /* 品牌色：取自 Every666 潑墨標誌 */
  --brand-red:    #e8453c;
  --brand-blue:   #3fa9e0;
  --brand-yellow: #f2ce5c;

  /* 底色系 */
  --bg:           #0a1821;   /* 頁面主底 */
  --bg-raised:    #102431;   /* 卡片、區塊 */
  --bg-sunken:    #071219;   /* 頁尾、深區塊 */
  --line:         #1e3646;   /* 分隔線、框線 */

  /* 文字 */
  --text:         #e9f0f4;
  --text-muted:   #93a8b6;
  --text-faint:   #6a8494;

  /* 語意 */
  --accent:       var(--brand-blue);
  --accent-soft:  rgba(63, 169, 224, .14);

  /* 字體 */
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* 間距與圓角 */
  --gap:      1.5rem;
  --radius:   14px;
  --radius-lg: 22px;

  /* 容器寬度 */
  --wrap:      1140px;
  --wrap-text: 760px;   /* 純文字閱讀寬度 */

  --header-h: 68px;

  --shadow:    0 4px 24px rgba(0, 0, 0, .28);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
}

/* ---------- 2. 基礎 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  line-height: 1.3;
  margin: 0 0 .6em;
  font-weight: 700;
  letter-spacing: .01em;
}
h1 { font-size: clamp(1.9rem, 1.35rem + 2.4vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.15rem); }
h3 { font-size: clamp(1.12rem, 1rem + .5vw, 1.4rem); }
p  { margin: 0 0 1.15em; }

/* 跳至主要內容（鍵盤 / 螢幕閱讀器） */
.skip-link {
  position: absolute; left: -9999px;
  z-index: 200; padding: .7rem 1.1rem;
  background: var(--brand-yellow); color: #0a1821;
  font-weight: 700; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; top: 0; }

/* ---------- 3. 版面工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, .6rem + 2.2vw, 2rem);
}
.wrap--text { max-width: var(--wrap-text); }

.section { padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4rem); }
.section--sunken { background: var(--bg-sunken); }

.section-head { text-align: center; margin-bottom: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); }
.section-head p { color: var(--text-muted); max-width: 56ch; margin-inline: auto; }

/* 小標籤 */
.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: .9rem;
}

/* 按鈕 */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.5rem;
  border-radius: 999px;
  font-weight: 700; font-size: .97rem;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary {
  color: #08151d;
  background: linear-gradient(100deg, var(--brand-yellow), #f6dd8c);
  box-shadow: 0 6px 20px rgba(242, 206, 92, .26);
}
.btn--primary:hover { box-shadow: 0 10px 28px rgba(242, 206, 92, .36); }
.btn--ghost {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.btn--ghost:hover { border-color: var(--brand-blue); background: var(--accent-soft); }

/* ---------- 4. 頁首 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(10, 24, 33, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand span { font-size: 1.06rem; letter-spacing: .02em; }

.nav ul { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: .5rem .9rem;
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  border-radius: 8px;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand-yellow); }

/* 手機選單按鈕 */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle[aria-expanded="true"] .icon-open  { display: none; }

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav[data-open="true"] { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem; }
  .nav a { padding: .85rem 1rem; font-size: 1rem; }
}

/* ---------- 5. 頁尾 ---------- */
.site-footer {
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 1.8rem + 3vw, 4rem) 2rem;
  font-size: .95rem;
}
.footer-grid {
  display: grid; gap: 2.2rem;
  grid-template-columns: 1.4fr 1fr 1fr;
  margin-bottom: 2.4rem;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; } }

.footer-grid h2 {
  font-size: .82rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 1rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--text); }
.footer-tagline { color: var(--text-muted); margin: .8rem 0 0; max-width: 34ch; }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem;
  justify-content: space-between;
  color: var(--text-faint); font-size: .88rem;
}

/* ---------- 6. 首頁 ---------- */
.hero {
  position: relative;
  padding-block: clamp(4.5rem, 2.5rem + 9vw, 9rem);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
/* 品牌漸層光暈：紅→藍，呼應標誌 */
.hero::before {
  content: "";
  position: absolute; inset: -40% -10% auto -10%; height: 150%;
  background:
    radial-gradient(46% 42% at 22% 32%, rgba(232, 69, 60, .30), transparent 68%),
    radial-gradient(46% 42% at 76% 24%, rgba(63, 169, 224, .30), transparent 68%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 20ch; }
.hero .lede {
  font-size: clamp(1.05rem, .98rem + .45vw, 1.28rem);
  color: var(--text-muted);
  max-width: 54ch;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* 服務卡片 */
.card-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.9rem 1.7rem;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(63, 169, 224, .5);
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .55rem; }
.card p { color: var(--text-muted); margin: 0; font-size: .96rem; }

.card-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  margin-bottom: 1.15rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--brand-blue);
}
.card-icon svg { width: 23px; height: 23px; }

/* 理念區塊 */
.mission { text-align: center; }
.mission img { width: 84px; height: 84px; border-radius: 18px; margin: 0 auto 1.6rem; }
.mission blockquote {
  margin: 0 auto;
  max-width: 60ch;
  font-size: clamp(1.02rem, .96rem + .4vw, 1.22rem);
  color: var(--text-muted);
  line-height: 2;
}
.mission blockquote p:last-child { margin-bottom: 0; }

/* ---------- 7. 教學頁 ---------- */
.page-head {
  position: relative;
  padding-block: clamp(2.6rem, 1.8rem + 4vw, 4.5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(58% 100% at 12% 0%, rgba(63, 169, 224, .16), transparent 70%),
    var(--bg-sunken);
}
.page-head h1 { margin-bottom: .4rem; }
.page-head p { color: var(--text-muted); max-width: 58ch; margin: 0; }

.breadcrumb { font-size: .88rem; color: var(--text-faint); margin-bottom: 1rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .45rem; color: var(--line); }
.breadcrumb a { color: var(--text-muted); }

/* 下載區 */
.download {
  display: grid; gap: 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.9rem;
}
.download-item { text-align: center; }
.download-item h3 { font-size: 1.02rem; margin-bottom: 1rem; }
.download-item .qr {
  width: 148px; margin: 0 auto 1rem;
  background: #fff; padding: 9px; border-radius: 12px;
}
.store-badge { display: inline-block; }
.store-badge:hover { opacity: .85; }
.store-badge img { height: 44px; width: auto; margin-inline: auto; }

.note {
  display: flex; gap: .85rem;
  background: rgba(242, 206, 92, .09);
  border: 1px solid rgba(242, 206, 92, .3);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  color: var(--text-muted);
  font-size: .96rem;
}
.note svg { width: 20px; height: 20px; flex: none; color: var(--brand-yellow); margin-top: .25rem; }
.note p:last-child { margin-bottom: 0; }

/* 章節目錄（教學頁側欄） */
.guide-layout { display: grid; gap: clamp(2rem, 1rem + 3vw, 3.5rem); grid-template-columns: 218px 1fr; }
@media (max-width: 900px) { .guide-layout { grid-template-columns: 1fr; } }

.toc { position: sticky; top: calc(var(--header-h) + 1.5rem); align-self: start; }
@media (max-width: 900px) { .toc { position: static; } }
.toc h2 {
  font-size: .8rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: .9rem;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.toc a {
  display: block; padding: .5rem .8rem;
  color: var(--text-muted); font-size: .94rem;
  border-left: 2px solid var(--line);
  border-radius: 0 8px 8px 0;
}
.toc a:hover { color: var(--text); background: rgba(255, 255, 255, .04); text-decoration: none; }
.toc a.is-active { color: var(--brand-yellow); border-left-color: var(--brand-yellow); background: rgba(242, 206, 92, .07); }

/* 步驟 */
.step { margin-bottom: clamp(2.5rem, 1.8rem + 3vw, 4rem); }
.step:last-child { margin-bottom: 0; }
.step-title { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.2rem; }
.step-num {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(63, 169, 224, .4);
  color: var(--brand-blue);
  font-size: .92rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step-title h3 { margin: 0; }

/* 可點擊放大的教學圖 */
.shot {
  display: block; width: 100%; padding: 0; border: 0;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: transform .18s ease, box-shadow .18s ease;
}
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.shot img { width: 100%; }

/* 燈箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  background: rgba(4, 12, 17, .93);
  backdrop-filter: blur(4px);
}
.lightbox[data-open="true"] { display: flex; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: #fff; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .2); }
.lightbox-close svg { width: 20px; height: 20px; }

/* ---------- 8. 法律頁 ---------- */
.legal { font-size: 1rem; }
.legal h2 {
  font-size: clamp(1.15rem, 1.05rem + .45vw, 1.4rem);
  margin-top: 2.6rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
  color: var(--brand-yellow);
}
.legal h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.legal p { color: var(--text-muted); }
.legal .intro { color: var(--text); }
.legal ol, .legal ul { color: var(--text-muted); padding-left: 1.4rem; margin: 0 0 1.15em; }
.legal li { margin-bottom: .75em; }
.legal li::marker { color: var(--brand-blue); }
.legal ul.plain { list-style: none; padding-left: .4rem; }
.legal ul.plain li { padding-left: 1.2rem; position: relative; }
.legal ul.plain li::before {
  content: "";
  position: absolute; left: 0; top: .72em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-blue);
}

/* ---------- 動態效果偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
