/* 大家來找喵網站（whereiscat.cooperlab.app）的樣式。設計 A「航空明信片」，2026-11-16 五位評審 5:0 勝出。
   顏色來自 App 的明信片皮膚（app/src/Skin.tsx）和貓橘（app/src/theme.ts）：墨水藍外框、牛皮紙、航空信封紅藍斜紋。
   規則：不用黑色、不用 emoji；法律頁（隱私、條款、客服）要安靜好讀：純色底、沒有裝飾圖樣、手機上文字欄夠寬。 */

@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("/assets/Fredoka-600.ttf") format("truetype"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("/assets/Fredoka-700.ttf") format("truetype"); }

:root {
  --ink: #2F3E5C;
  --kraft: #DDBE8F;
  --paper: #FBF3E4;
  --paper-line: #EADFCB;
  --cream: #FFFBF2;
  --red: #E5484D;
  --blue: #3E7BD6;
  --gold: #F7C95C;
  --cat: #FF9F52;
  --cat-edge: #D68045;

  /* 會隨深色模式改變的面 */
  --bg: var(--paper);
  --top: var(--kraft);          /* 頂列、頁尾的牛皮紙 */
  --card: var(--cream);         /* 明信片、信紙 */
  --text: #2F3E5C;              /* 對奶油色 10.6:1 */
  --soft: #56627C;              /* 6.0:1 */
  --link: #2A5DA8;              /* 6.3:1 */
  --rule: var(--paper-line);
  --frame: var(--ink);          /* 外框 */
  --edge: var(--ink);           /* 右下厚邊 */
  --chip: #F3E7D2;              /* 「設定 > …」路徑底色 */
  --stripe-a: var(--red);
  --stripe-b: var(--blue);
  --stripe-gap: var(--cream);
  --zh: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --round: "Fredoka", -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  --r: 14px;
  color-scheme: light;
}

/* 深色模式＝月光夜市：紙變成暗的牛皮紙和墨水色，外框提亮，斜紋降彩度 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B2034; --top: #3A3226; --card: #2A2620; --text: #EDE6D8; --soft: #BDB4A6; --link: #9CC2FF;
    --rule: #463E33; --frame: #9AA6C4; --edge: #0E1222; --chip: #3D3529;
    --stripe-a: #B8575A; --stripe-b: #5B7FB8; --stripe-gap: #2A2620; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1B2034; --top: #3A3226; --card: #2A2620; --text: #EDE6D8; --soft: #BDB4A6; --link: #9CC2FF;
  --rule: #463E33; --frame: #9AA6C4; --edge: #0E1222; --chip: #3D3529;
  --stripe-a: #B8575A; --stripe-b: #5B7FB8; --stripe-gap: #2A2620; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font: 17px/1.75 var(--zh); color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cream); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* 首頁才有的淡淡紙上塗鴉：腳印、魚骨、星星、波浪 */
.home { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150' fill='none' stroke='%23EFE5D3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='30' cy='34' r='6'/%3E%3Ccircle cx='16' cy='24' r='2.6' stroke-width='2'/%3E%3Ccircle cx='26' cy='16' r='2.6' stroke-width='2'/%3E%3Ccircle cx='38' cy='16' r='2.6' stroke-width='2'/%3E%3Ccircle cx='46' cy='25' r='2.6' stroke-width='2'/%3E%3Cpath d='M96 96h28M124 96l8-7v14zM100 96l-6-6M100 96l-6 6M110 90v12'/%3E%3Cpath d='M110 26l4 9 10 1-7.5 6.5 2.5 10-9-5.5-9 5.5 2.5-10L96 36l10-1z'/%3E%3Cpath d='M22 112q10-14 22 0t22 0'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home { background-image: none; } }
:root[data-theme="dark"] .home { background-image: none; }

/* 航空信封斜紋：只在頂列下緣和頁尾上緣各一條 */
.airmail { height: 12px; border-top: 3px solid var(--frame);
  background: repeating-linear-gradient(-45deg, var(--stripe-a) 0 9px, var(--stripe-gap) 9px 18px, var(--stripe-b) 18px 27px, var(--stripe-gap) 27px 36px); }
.airmail.flip { border-top: 0; border-bottom: 3px solid var(--frame); }

/* ---------- 頂列（牛皮紙，像遊戲裡的頂列） ---------- */
.top { background: var(--top); color: var(--text); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 12px 16px 14px; display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "lang lang" "brand brand" "nav nav"; gap: 10px 12px; align-items: center; }
.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; line-height: 1.15; min-width: 0; }
.brand img { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 2.5px solid var(--frame); box-shadow: 2px 3px 0 var(--edge); }
.brand b { display: block; font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.brand small { display: block; font: 600 13px/1.2 var(--round); color: var(--soft); }

/* 語言切換：兩格，現在的語言是金色 */
.lang { grid-area: lang; justify-self: end; display: inline-flex; border: 2.5px solid var(--frame); border-bottom-width: 5px; border-radius: 999px; overflow: hidden; background: var(--card); }
.lang a, .lang span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 11px; font: 600 14px/1 var(--round); color: var(--text); text-decoration: none; }
.lang span { background: var(--gold); color: var(--ink); }
.lang a:hover { text-decoration: underline; }
.lang > * + * { border-left: 2px solid var(--rule); }

/* 分頁＝遊戲底部的分頁：郵票格，現在這頁是金色 */
.site-nav { grid-area: nav; min-width: 0; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.tabs a { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 6px 4px; text-align: center;
  background: var(--card); color: var(--text); text-decoration: none; font-weight: 800; font-size: 15px; line-height: 1.2;
  border: 2.5px solid var(--frame); border-bottom-width: 5px; border-radius: 9px; }
.tabs a:hover { filter: brightness(1.04); }
.tabs a[aria-current="page"] { background: var(--gold); color: var(--ink); }
.tabs a:active { transform: translateY(2px); border-bottom-width: 3px; }
@media (min-width: 860px) {
  .top-in { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav lang"; padding: 14px 24px 16px; gap: 24px; }
  .tabs { grid-template-columns: repeat(4, minmax(104px, auto)); justify-content: end; }
  .tabs a { padding: 6px 16px; }
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 860px) { .wrap { padding: 0 24px; } }
.card { background: var(--card); color: var(--text); border: 3px solid var(--frame); border-radius: var(--r); box-shadow: 4px 6px 0 var(--edge); }
.tape { display: inline-block; padding: 4px 16px 5px; font-weight: 800; color: var(--ink); background: rgba(247, 201, 92, .92);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 97% 100%, 2% 96%, 0 50%); }
.kicker { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font-size: 24px; line-height: 1.3; }
.kicker::after { content: ""; flex: 1; height: 3px; background: currentColor; opacity: .18; border-radius: 2px; }
.path { white-space: nowrap; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--chip); }

/* ================= 首頁 ================= */
.hero { padding: 24px 0 8px; }
.hero-grid { display: grid; gap: 24px; }
/* 首頁大明信片：深色模式也維持紙色（logo 的墨水藍字在暗底上會看不見） */
.postcard { position: relative; padding: 20px 20px 24px; --card: #FFFBF2; --text: #2F3E5C; --soft: #56627C; --frame: #2F3E5C; }
.postcard h1 { margin: 0; display: grid; gap: 4px; }
.postcard h1 img { width: 210px; }
.name-zh { font-size: 26px; font-weight: 900; letter-spacing: .1em; line-height: 1.3; }
.sub { margin: 14px 0 0; font-size: 19px; font-weight: 800; color: #B0571F; }
.lede { margin: 8px 0 0; color: var(--soft); max-width: 34em; }
.store { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; }
/* App Store 位置：跟正式下載徽章同樣大小（約 156×52），上架後只換這一格 */
.store-slot { display: inline-flex; align-items: center; justify-content: center; width: 168px; height: 54px; padding: 0 10px;
  border: 2.5px dashed var(--frame); border-radius: 12px; font-weight: 800; font-size: 15px; line-height: 1.25; text-align: center; color: var(--text); }
.store-note { font-size: 15px; color: var(--soft); }
/* 右邊：兩張街景明信片疊在一起（後面夜市、前面港町），角落貼 App 圖示郵票 */
.shot { position: relative; justify-self: center; width: min(100%, 560px); padding: 0 0 8px; }
.shot figure { margin: 0; padding: 8px 8px 10px; }
.shot img { border: 2.5px solid var(--frame); border-radius: 8px; width: 100%; aspect-ratio: 900 / 520; object-fit: cover; }
.shot figcaption { margin-top: -16px; padding-left: 10px; position: relative; }
.shot .tape { font-size: 16px; }
.shot .back { width: 82%; transform: rotate(-3deg); }
.shot .front { width: 86%; margin: -34% 0 0 auto; position: relative; transform: rotate(2deg); }
.shot .back figcaption { position: absolute; top: -12px; left: 14px; margin: 0; padding: 0; }
@media (min-width: 860px) {
  .hero { padding: 48px 0 16px; }
  .hero-grid { grid-template-columns: 1fr 1.05fr; align-items: center; gap: 48px; }
  .postcard { padding: 36px 40px 40px; }
  .postcard h1 img { width: 300px; }
  .name-zh { font-size: 36px; }
}

.how, .parents { padding: 40px 0 8px; }
.how-card { padding: 8px 20px; }
.feat { list-style: none; margin: 0; padding: 0; display: grid; }
.feat li { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; padding: 16px 0; border-bottom: 2px dashed var(--rule); }
.feat li:last-child { border-bottom: 0; }
.feat svg { width: 48px; height: 48px; }
.feat b { display: block; font-size: 18px; line-height: 1.45; }
.feat span { display: block; color: var(--soft); font-size: 16px; line-height: 1.6; margin-top: 2px; }
@media (min-width: 860px) { .how-card { padding: 12px 36px; } .feat { grid-template-columns: 1fr 1fr; column-gap: 48px; } .feat li:nth-last-child(2):nth-child(odd) { border-bottom: 0; } }

.parent-card { padding: 22px 20px; display: grid; gap: 18px; }
.parent-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.parent-card li { position: relative; padding-left: 32px; line-height: 1.6; }
/* 蓋上去的金色勾章（跟遊戲裡蓋章的星星同一族） */
.parent-card li::before { content: ""; position: absolute; left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F3E5C' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat;
  border: 2.5px solid var(--ink); }
.parent-links { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 18px; text-align: center;
  background: var(--cat); color: var(--ink); font-weight: 900; text-decoration: none; border: 3px solid var(--ink); border-radius: 14px; box-shadow: inset 0 -5px 0 var(--cat-edge); }
.btn.soft { background: var(--cream); box-shadow: inset 0 -5px 0 #E2CFB3; }
.btn:hover { filter: brightness(1.04); text-decoration: none; }
@media (min-width: 860px) { .parent-card { grid-template-columns: 1.6fr 1fr; align-items: center; padding: 30px 36px; } .parent-links { flex-direction: column; align-items: stretch; } }

/* ================= 法律頁（安靜） ================= */
.doc-head { padding: 28px 0 4px; }
.doc-head h1 { margin: 0 0 2px; font-size: 30px; line-height: 1.25; letter-spacing: .03em; }
.doc-head .app { margin: 0 0 4px; font-weight: 700; color: var(--soft); font-size: 15px; }
.date { margin: 0; color: var(--soft); font-size: 15px; }
.doc-grid { display: grid; gap: 16px; padding-top: 16px; padding-bottom: 48px; }
@media (min-width: 1000px) {
  .doc-head { padding: 44px 0 8px; }
  .doc-head h1 { font-size: 38px; }
  .doc-grid { grid-template-columns: 250px minmax(0, 720px); gap: 40px; justify-content: center; padding-top: 24px; }
  .doc-head .wrap { max-width: 1060px; padding-left: calc(24px + 250px + 40px); }
}

/* 重點：最上面一塊就看得到「怎麼刪帳號」和「寄信給誰」 */
.quick { display: grid; gap: 10px; margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 2px solid var(--rule); }
.sheet .quick p { margin: 0; }
.quick b { display: block; }

.toc { font-size: 15px; }
.toc details { background: var(--card); border: 2.5px solid var(--frame); border-radius: 12px; }
.toc summary { cursor: pointer; padding: 10px 16px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 10px; height: 10px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg) translateY(-3px); }
.toc details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.toc ol { margin: 0; padding: 0 8px 10px; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.35; }
.toc a::before { content: counter(t, decimal-leading-zero); font: 600 13px/1.5 var(--round); color: var(--soft); min-width: 1.6em; }
.toc a:hover, .toc a:focus-visible { background: var(--rule); }
@media (min-width: 1000px) {
  .toc { position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow: auto; }
  .toc details { background: transparent; border: 0; }
  .toc summary { padding: 0 8px 6px; pointer-events: none; min-height: 0; font-size: 13px; letter-spacing: .08em; color: var(--soft); }
  .toc summary::after { display: none; }
  .toc a { min-height: 36px; }
}

/* 信紙：手機上不加框，讓文字欄用滿寬度 */
.sheet { overflow-wrap: anywhere; }
.sheet > :first-child { margin-top: 0; }
.sheet h2 { display: flex; align-items: center; gap: 12px; font-size: 21px; line-height: 1.4; margin: 36px 0 10px; padding-top: 16px; border-top: 2px solid var(--rule); scroll-margin-top: 16px; }
.sheet h2 .n { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; font: 600 15px/1 var(--round); color: var(--ink);
  background: var(--gold); border: 2.5px solid var(--ink); border-radius: 8px; box-shadow: 2px 3px 0 var(--edge); }
.sheet p { margin: 0 0 14px; }
.sheet ul { margin: 6px 0 14px; padding: 0; list-style: none; }
.sheet li { margin: 0; padding: 12px 0; border-bottom: 1.5px solid var(--rule); }
.sheet li:last-child { border-bottom: 0; }
.sheet li b { display: block; }
.sheet .contact { margin-top: 8px; padding: 16px; border: 2.5px solid var(--frame); border-radius: 12px; background: var(--bg); }
.sheet .contact p { margin: 0; }
.sheet .contact p + p { margin-top: 4px; font-size: 15px; color: var(--soft); }
@media (min-width: 700px) {
  .sheet { background: var(--card); border: 2.5px solid var(--frame); border-radius: var(--r); box-shadow: 3px 5px 0 var(--edge); padding: 40px 48px 48px; }
}

/* ================= 頁尾 ================= */
.foot { margin-top: 56px; background: var(--top); color: var(--text); }
.doc .foot { margin-top: 0; }
.foot-in { max-width: 1160px; margin: 0 auto; padding: 24px 16px 32px; display: grid; gap: 18px; }
.foot-contact { margin: 0; font-size: 15px; line-height: 1.6; }
.foot-contact a { color: var(--text); font-weight: 800; }
.foot-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.foot-links a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; background: var(--card); color: var(--text); text-decoration: none; font-weight: 800; line-height: 1.3;
  border: 2.5px solid var(--frame); border-bottom-width: 5px; border-radius: 10px; }
.foot-links svg { width: 24px; height: 24px; flex: none; }
.foot-meta { font-size: 14px; color: var(--soft); }
@media (min-width: 860px) {
  .foot-in { grid-template-columns: 1fr auto; align-items: center; padding: 28px 24px 36px; }
  .foot-links { grid-template-columns: repeat(4, auto); }
  .foot-contact, .foot-meta { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) { .shot .back, .shot .front { transform: none; } }
