/* 台灣匯率 網站 — 淺色 / 深色模式皆依系統設定 */

:root {
  --bg: #f4f7f1;
  --surface: #ffffff;
  --surface-2: #eaf1e4;
  --text: #1d2618;
  --muted: #5b6655;
  --line: #d7e2cf;
  --accent: #4a7c30;
  --accent-strong: #36601f;
  --accent-soft: #e3efd9;
  --up: #c0392b;
  --board-1: #10200a;
  --board-2: #2f5a1e;
  --board-text: #effae6;
  --board-muted: #c3d9b4;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(30, 60, 15, 0.12);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d130a;
    --surface: #161f12;
    --surface-2: #1d2918;
    --text: #e8f1e1;
    --muted: #a9b8a0;
    --line: #2b3a24;
    --accent: #8cc152;
    --accent-strong: #a6d673;
    --accent-soft: #223318;
    --up: #ff8a7a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }

.wrap { width: min(1120px, 100%); margin: 0 auto; padding-inline: 20px; }

/* ---------- 導覽列 ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(16, 32, 10, 0.85);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  color: var(--board-text);
}

.nav .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 21px; font-weight: 700; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }

.nav-links { margin-left: auto; display: flex; gap: 22px; font-size: 15px; }
.nav-links a { color: var(--board-muted); text-decoration: none; }
.nav-links a:hover { color: #fff; }

@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- 首頁主視覺 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  color: var(--board-text);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(140, 193, 82, 0.35), transparent 55%),
    radial-gradient(ellipse at 90% 90%, rgba(74, 124, 48, 0.55), transparent 60%),
    linear-gradient(160deg, var(--board-1), var(--board-2));
}

/* 背景: 淡淡的匯率看板數字 */
.ticker {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 2.2;
  color: rgba(239, 250, 230, 0.07);
  white-space: nowrap;
}

.ticker div { animation: drift 60s linear infinite; }
.ticker div:nth-child(even) { animation-direction: reverse; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker div { animation: none; }
  html { scroll-behavior: auto; }
}

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding-block: 72px 80px;
}

.hero h1 { margin: 0; font-size: clamp(52px, 8vw, 92px); line-height: 1.1; letter-spacing: 0.04em; }
.hero .tagline { margin: 14px 0 0; font-size: clamp(20px, 2.6vw, 26px); color: #dff0d2; }
.hero .lead { margin: 22px 0 0; max-width: 34em; color: var(--board-muted); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-store { background: #fff; color: #10200a; }
.btn-store svg { width: 20px; height: 20px; }

.platforms { margin-top: 18px; font-size: 14px; color: var(--board-muted); }

.phone {
  justify-self: center;
  width: min(330px, 80vw);
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(145deg, #24361b, #080d05);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.phone img { border-radius: 37px; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-block: 56px 64px; }
  .hero .lead { margin-inline: auto; }
  .actions { justify-content: center; }
}

/* ---------- 區塊 ---------- */

section { padding-block: 84px; }
section + section { border-top: 1px solid var(--line); }

.section-head { max-width: 46em; margin-bottom: 40px; }
.section-head h2 { margin: 0; font-size: clamp(30px, 4.2vw, 42px); line-height: 1.25; }
.section-head p { margin: 14px 0 0; color: var(--muted); }

.eyebrow { display: inline-block; margin-bottom: 10px; font-size: 14px; font-weight: 600; letter-spacing: 0.12em; color: var(--accent); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card .icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
}

.card h3 { margin: 0 0 8px; font-size: 22px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }

.tag {
  display: inline-block;
  vertical-align: middle;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

/* 匯率怎麼看: 示意看板 (窄螢幕可左右捲動) */

.table-scroll { overflow-x: auto; border-radius: var(--radius); }

.board {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 16px;
}

.board th, .board td { padding: 12px 14px; text-align: right; }
.board th:first-child, .board td:first-child { text-align: left; }
.board thead th { background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; }
.board tbody tr:nth-child(odd) { background: var(--surface-2); }
.board td { font-family: var(--mono); }
.board td:first-child { font-family: var(--sans); }
.board .none { color: var(--muted); }

@media (max-width: 520px) {
  .board { font-size: 14px; }
  .board th, .board td { padding: 10px 8px; }
}

.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 24px; }
.explain div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.explain b { display: block; margin-bottom: 4px; }
.explain span { color: var(--muted); font-size: 16px; }

/* 截圖 */

.gallery {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 4px 22px;
  scroll-snap-type: x proximity;
}

.gallery figure { flex: 0 0 auto; margin: 0; scroll-snap-align: start; }

.gallery img {
  height: 520px;
  width: auto;
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.gallery figcaption { margin-top: 10px; text-align: center; font-size: 14px; color: var(--muted); }

@media (max-width: 600px) { .gallery img { height: 440px; } }

/* 銀行 */

.banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.banks li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.banks li small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }

.note { margin-top: 22px; font-size: 15px; color: var(--muted); }

/* 常見問題 */

.faq { display: grid; gap: 14px; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }

summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

summary::-webkit-details-marker { display: none; }
summary::after { content: "＋"; margin-left: auto; color: var(--accent); font-weight: 400; }
details[open] summary::after { content: "－"; }
details p, details ul { margin: 0 0 20px; color: var(--muted); }
details ul { padding-left: 1.2em; }

/* 行動呼籲 */

.cta { text-align: center; color: var(--board-text); background: linear-gradient(160deg, var(--board-1), var(--board-2)); border-top: none !important; }
.cta h2 { margin: 0; font-size: clamp(32px, 5vw, 48px); }
.cta p { color: var(--board-muted); margin: 12px 0 0; }
.cta .actions { justify-content: center; }

/* 頁尾 */

footer { padding-block: 40px 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--muted); }
footer .fine { flex-basis: 100%; font-size: 13px; }

/* 圖片放大 */

.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(5, 10, 3, 0.9); cursor: zoom-out; }
.lightbox img { max-height: calc(100vh - 48px); max-width: 100%; border-radius: 18px; }

/* 隱私權政策 */

.doc { max-width: 46em; padding-block: 56px 72px; }
.doc h1 { margin: 0 0 6px; font-size: clamp(32px, 5vw, 44px); }
.doc .updated { margin: 0 0 32px; color: var(--muted); font-size: 15px; }
.doc h2 { margin: 36px 0 8px; font-size: 21px; }
.doc ul { padding-left: 1.2em; }

[hidden] { display: none !important; }
