/* 孤島求生 · 服務條款／隱私權政策：顏色和 App 的琥珀色主題一樣。 */
:root {
  --primary: #b45309;
  --on-primary: #ffffff;
  --primary-container: #fde7c2;
  --on-primary-container: #451a03;
  --tertiary-container: #ffedd5;
  --bg: #fff8ec;
  --on-bg: #1c1917;
  --muted: #57534e;
  --surface: #ffffff;
  --surface-high: #fdf3e1;
  --surface-highest: #f8ead0;
  --outline: #b8a27c;
  --outline-variant: #eadfc8;
  --hero-ink: #fff8ec;
  --shadow: 0 1px 2px rgba(69, 26, 3, .06), 0 6px 20px rgba(69, 26, 3, .07);
  --radius: 24px;
  --radius-s: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #fbbf24;
    --on-primary: #1c1917;
    --primary-container: #5c3a0a;
    --on-primary-container: #fde7c2;
    --tertiary-container: #4a2a12;
    --bg: #1a140e;
    --on-bg: #f7ebdc;
    --muted: #d8c6af;
    --surface: #281f16;
    --surface-high: #31261b;
    --surface-highest: #3b2e21;
    --outline: #9c8569;
    --outline-variant: #4a3b2c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #fbbf24;
  --on-primary: #1c1917;
  --primary-container: #5c3a0a;
  --on-primary-container: #fde7c2;
  --tertiary-container: #4a2a12;
  --bg: #1a140e;
  --on-bg: #f7ebdc;
  --muted: #d8c6af;
  --surface: #281f16;
  --surface-high: #31261b;
  --surface-highest: #3b2e21;
  --outline: #9c8569;
  --outline-variant: #4a3b2c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--on-bg);
  font: 16px/1.8 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img.px { image-rendering: pixelated; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---- 封面 ---- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--hero-ink);
  background: #2b1d10 url("assets/island-banner.jpg") center 38% / cover no-repeat;
  image-rendering: pixelated;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(34, 22, 10, .92) 0%, rgba(34, 22, 10, .78) 45%, rgba(34, 22, 10, .25) 100%);
}
.hero .wrap { position: relative; padding-top: 22px; padding-bottom: 56px; }
.topbar { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 800; letter-spacing: .5px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.brand small { display: block; font-weight: 600; font-size: 12px; opacity: .8; letter-spacing: 1px; }
.grow { flex: 1; }
.pill-link { color: var(--hero-ink); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; background: rgba(255, 248, 236, .14); border: 1px solid rgba(255, 248, 236, .25); }
.pill-link:hover { background: rgba(255, 248, 236, .24); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 248, 236, .25);
  background: rgba(255, 248, 236, .14); color: var(--hero-ink); cursor: pointer; font-size: 18px; line-height: 1;
}
.icon-btn:focus-visible, .pill-link:focus-visible, .toc a:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.hero-body { display: flex; align-items: flex-end; gap: 24px; margin-top: 56px; }
.hero-text { flex: 1; max-width: 680px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; letter-spacing: 3px; color: #fbbf24; }
.eyebrow img { width: 22px; height: 22px; }
.hero h1 { margin: 8px 0 10px; font-size: clamp(36px, 6vw, 56px); line-height: 1.15; font-weight: 900; letter-spacing: 2px; }
.lead { margin: 0; font-size: 18px; line-height: 1.7; color: #f3e3cc; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.meta span { background: rgba(255, 248, 236, .14); border: 1px solid rgba(255, 248, 236, .22); border-radius: 999px; padding: 4px 14px; font-size: 14px; font-weight: 600; }
.islander { width: 120px; height: auto; flex: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .45)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .islander { animation: none; } html { scroll-behavior: auto; } }

/* ---- 重點 ---- */
.summary { position: relative; margin-top: -32px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--outline-variant); border-radius: 20px; padding: 18px 18px 16px; box-shadow: var(--shadow); }
.tile img { width: 36px; height: 36px; }
.tile h3 { margin: 8px 0 2px; font-size: 16px; line-height: 1.4; }
.tile p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ---- 內文 ---- */
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 28px; margin: 36px auto 56px; align-items: start; }
.toc { position: sticky; top: 20px; background: var(--surface); border: 1px solid var(--outline-variant); border-radius: 20px; padding: 14px 10px; box-shadow: var(--shadow); max-height: calc(100vh - 40px); overflow: auto; }
.toc summary { list-style: none; font-weight: 800; font-size: 15px; padding: 2px 10px 8px; cursor: default; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; border-radius: 10px; color: var(--on-bg); text-decoration: none; font-size: 14px; line-height: 1.5; }
.toc a .n { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; min-width: 20px; }
.toc a:hover { background: var(--surface-high); }
.toc a.on { background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; }
.toc a.on .n { color: inherit; }

.doc { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sec { background: var(--surface); border: 1px solid var(--outline-variant); border-radius: var(--radius); padding: 26px 30px 24px; box-shadow: var(--shadow); }
.sec h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 22px; line-height: 1.4; }
.sec h2 .num { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-highest); }
.sec h2 .num img { width: 30px; height: 30px; }
.sec h2 small { display: block; font-size: 12px; font-weight: 800; color: var(--primary); letter-spacing: 2px; }
.sec h3 { margin: 20px 0 6px; font-size: 17px; }
.sec p { margin: 8px 0; }
.sec ul, .sec ol { margin: 8px 0; padding-left: 1.4em; }
.sec li { margin: 4px 0; }
.sec li::marker { color: var(--primary); }
.path { display: inline-block; max-width: 100%; background: var(--surface-high); border: 1px solid var(--outline-variant); border-radius: 8px; padding: 0 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
@media (max-width: 480px) { .path { white-space: normal; } }
.note { display: flex; gap: 12px; align-items: flex-start; background: var(--tertiary-container); border-radius: var(--radius-s); padding: 12px 16px; margin: 14px 0 6px; }
.note img { width: 26px; height: 26px; flex: none; margin-top: 2px; }
.note p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 12px 0 4px; border: 1px solid var(--outline-variant); border-radius: var(--radius-s); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--outline-variant); }
th { background: var(--surface-high); font-size: 14px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; min-width: 150px; }
.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin: 10px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.box { background: var(--surface-high); border-radius: var(--radius-s); padding: 14px 18px; }
.box h3 { margin-top: 0; }
.mail { font-weight: 800; }

/* ---- 頁尾 ---- */
footer { border-top: 1px solid var(--outline-variant); background: var(--surface-high); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 22px; padding-bottom: 30px; font-size: 14px; color: var(--muted); }
footer .brand { color: var(--on-bg); font-size: 15px; }
footer .brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); font-size: 20px; cursor: pointer; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---- 手機 ---- */
@media (max-width: 920px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .layout { grid-template-columns: 1fr; gap: 18px; margin-top: 24px; }
  .toc { position: static; max-height: none; }
  .toc summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding-bottom: 2px; }
  .toc summary::after { content: "▾"; color: var(--primary); }
  .toc[open] summary { padding-bottom: 8px; }
  .toc[open] summary::after { content: "▴"; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero .wrap { padding-bottom: 48px; }
  .brand span { display: none; }
  .pill-link { padding: 7px 12px; font-size: 13px; }
  .hero-body { margin-top: 36px; }
  .islander { width: 76px; position: absolute; right: 12px; bottom: 44px; opacity: .9; }
  .lead { font-size: 16px; padding-right: 64px; }
  .summary { grid-template-columns: 1fr; gap: 10px; }
  .tile { display: grid; grid-template-columns: 36px 1fr; gap: 0 12px; align-items: center; padding: 14px 16px; }
  .tile img { grid-row: span 2; }
  .tile h3 { margin: 0; }
  .sec { padding: 20px 18px; border-radius: 20px; }
  .sec h2 { font-size: 19px; }
  .cols { grid-template-columns: 1fr; }
  .table-wrap { border: 0; overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tr { border: 1px solid var(--outline-variant); border-radius: var(--radius-s); margin-bottom: 10px; overflow: hidden; }
  td { border-bottom: 0; padding: 4px 14px; }
  td:first-child { min-width: 0; background: var(--surface-high); padding: 10px 14px; }
  td:not(:first-child)::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--primary); margin-top: 6px; }
  td:last-child { padding-bottom: 12px; }
}

/* ---- 列印 ---- */
@media print {
  .hero { background: none; color: #000; }
  .hero::before, .sky, .islander, .topbar .icon-btn, .pill-link, .toc, .to-top, .summary { display: none !important; }
  .hero .wrap { padding: 0; }
  .lead, .meta span { color: #000; border-color: #999; }
  .layout { display: block; margin: 12px 0; }
  .sec { box-shadow: none; border: 0; padding: 8px 0; break-inside: auto; }
  body { background: #fff; color: #000; font-size: 12pt; }
}

/* =====================================================================================
   隱私權政策：夜晚的島（深海藍＋月光黃）。服務條款維持白天的琥珀色。
   ===================================================================================== */
body.privacy {
  --primary: #0f6a8c;
  --on-primary: #ffffff;
  --primary-container: #d4eef8;
  --on-primary-container: #05293a;
  --tertiary-container: #e6f0fb;
  --bg: #f1f6fb;
  --on-bg: #0f1c26;
  --muted: #4a5b68;
  --surface: #ffffff;
  --surface-high: #e9f2f9;
  --surface-highest: #dbe9f4;
  --outline: #8eaec2;
  --outline-variant: #d5e3ee;
  --hero-ink: #eef4ff;
  --shadow: 0 1px 2px rgba(7, 35, 107, .06), 0 6px 20px rgba(7, 35, 107, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.privacy {
    --primary: #7dd3fc;
    --on-primary: #062033;
    --primary-container: #0c4a6e;
    --on-primary-container: #e0f2fe;
    --tertiary-container: #10304a;
    --bg: #0a1322;
    --on-bg: #e7eff8;
    --muted: #b5c6d6;
    --surface: #101c2e;
    --surface-high: #16243a;
    --surface-highest: #1c2d46;
    --outline: #4b6a85;
    --outline-variant: #213450;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] body.privacy {
  --primary: #7dd3fc;
  --on-primary: #062033;
  --primary-container: #0c4a6e;
  --on-primary-container: #e0f2fe;
  --tertiary-container: #10304a;
  --bg: #0a1322;
  --on-bg: #e7eff8;
  --muted: #b5c6d6;
  --surface: #101c2e;
  --surface-high: #16243a;
  --surface-highest: #1c2d46;
  --outline: #4b6a85;
  --outline-variant: #213450;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
}
.privacy .hero { background: #07236b url("assets/island-night.jpg") right -40px center / auto 112% no-repeat; }
.privacy .hero::before { background: linear-gradient(100deg, rgba(4, 16, 52, .96) 0%, rgba(5, 24, 74, .82) 42%, rgba(7, 35, 107, .1) 78%, rgba(7, 35, 107, 0) 100%); }
.privacy .eyebrow { color: #fde68a; }
.privacy .lead { color: #cfe0ff; }
.privacy .meta span, .privacy .pill-link, .privacy .icon-btn { background: rgba(238, 244, 255, .1); border-color: rgba(238, 244, 255, .24); }
.privacy .islander { filter: drop-shadow(0 0 18px rgba(253, 230, 138, .35)) drop-shadow(0 8px 12px rgba(0, 0, 0, .5)); }
.privacy .note { border-left: 4px solid var(--primary); }
.sky { position: absolute; inset: 0 42% 0 0; pointer-events: none; overflow: hidden; }
/* 像素月亮：一個方塊加上缺角 */
.moon {
  position: absolute; left: 76%; top: 96px; width: 36px; height: 36px; background: #fde68a;
  box-shadow: 0 0 0 6px rgba(253, 230, 138, .14), 0 0 40px 12px rgba(253, 230, 138, .22);
  clip-path: polygon(0 25%, 25% 25%, 25% 0, 75% 0, 75% 25%, 100% 25%, 100% 75%, 75% 75%, 75% 100%, 25% 100%, 25% 75%, 0 75%);
}
.moon::after { content: ""; position: absolute; left: 14px; top: -4px; width: 30px; height: 30px; background: #0a2a78; clip-path: inherit; }
/* 像素星星：3px 的方塊用陰影複製 */
.stars { position: absolute; left: 0; top: 0; width: 3px; height: 3px; background: transparent; color: #f4f7ff;
  box-shadow: 40px 30px, 120px 90px, 210px 40px, 300px 130px, 380px 60px, 470px 20px, 560px 110px, 640px 50px, 90px 170px, 250px 210px, 430px 180px, 610px 200px, 720px 30px, 800px 140px, 30px 250px, 520px 260px, 690px 120px, 160px 30px, 350px 250px, 760px 220px; animation: twinkle 3.2s ease-in-out infinite; }
.stars.s2 { left: 15px; top: 12px; width: 2px; height: 2px; opacity: .7;
  box-shadow: 70px 60px, 180px 120px, 270px 15px, 340px 100px, 450px 90px, 540px 40px, 600px 150px, 700px 80px, 140px 230px, 410px 230px, 580px 240px, 20px 120px, 780px 60px, 230px 150px; animation-delay: 1.6s; }
@keyframes twinkle { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .stars { animation: none; } }
@media (max-width: 600px) {
  .privacy .hero { background-position: 30% center; background-size: auto 100%; }
  .privacy .hero::before { background: linear-gradient(180deg, rgba(4, 16, 52, .55) 0%, rgba(4, 16, 52, .9) 55%, rgba(4, 16, 52, .96) 100%); }
  .sky { right: 0; }
  .moon { left: auto; right: 24px; top: 84px; transform: scale(.8); }
}

/* 聯絡我們：只列出信箱，一行一個 */
.contact-mails { font-size: 0; margin: 6px 0 0; }
.contact-mails a { display: inline-block; margin: 4px 0; font-size: 18px; }
.contact-mails a + a::before { content: none; }
.contact-mails a { display: block; width: fit-content; }
