/* 全站色彩與共用變數（首頁、地圖頁、機會頁、地點頁、404、隱私權頁都載入這支）。
   夜間模式：預設跟隨系統設定；使用者按 header 的切換鈕後，html 會帶 data-theme="dark" 或 "light"（記在 localStorage）。
   新增顏色時請在這裡加變數，日間與夜間兩組都要給值，不要在各頁寫死色碼。 */
:root{
  color-scheme:light;
  --paper:#f3efe6;--paper2:#ebe5d8;--card:#fffcf7;--card2:#faf7f0;--raise:#fffdf8;--chip:#f0ebe1;
  --ink:#1a1916;--ink2:#3c3a35;--mut:#6b675e;--line:#ddd6c6;--line2:#c9c0ae;
  --on-ink:#fff;--ink-hover:#000;
  --red:#b92a14;--red-soft:#c62f17;--red-hover:#9c2310;--red-bg:#fdece8;--red-line:#eab3a8;
  --amber:#8f4c00;--amber-bg:#fff3df;--amber-line:#edc58a;--soon-bg:#fffaf1;
  --link:#0d457c;
  --panel:rgba(235,229,216,.85);--glass:rgba(243,239,230,.96);--glass2:rgba(243,239,230,.75);--glass-card:rgba(255,252,247,.72);
  --map-bg:#e7e2d6;--map-filter:none;
  --glow:rgba(185,42,20,.07);--glow2:rgba(185,42,20,.045);--glow3:rgba(143,76,0,.04);
  --ring:rgba(185,42,20,.035);--ring2:rgba(185,42,20,.03);--ring3:rgba(28,27,25,.025);
  --shadow:0 1px 2px rgba(28,27,25,.04),0 8px 24px rgba(28,27,25,.05);
  --shadow-hover:0 4px 8px rgba(28,27,25,.05),0 14px 28px rgba(28,27,25,.07);
  --font:"Noto Sans TC",-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang TC","Microsoft JhengHei","Heiti TC","Noto Sans CJK TC",sans-serif;
  --ease:cubic-bezier(.22,.61,.36,1);
}
/* 夜間色票：暖灰黑底，保留紙質感的米色文字；紅、琥珀調亮以維持對比（文字對比皆 ≥ 4.5:1）。
   兩段內容相同：一段給系統深色且未手動選日間，一段給手動選夜間。 */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --paper:#15130f;--paper2:#1b1814;--card:#211e19;--card2:#1b1915;--raise:#2a2620;--chip:#2e2a23;
    --ink:#f2ede3;--ink2:#d9d2c5;--mut:#a69e90;--line:#37322b;--line2:#4b453b;
    --on-ink:#15130f;--ink-hover:#fff;
    --red:#c63a22;--red-soft:#f2826b;--red-hover:#a92e19;--red-bg:#2f1a15;--red-line:#6a3226;
    --amber:#f2b763;--amber-bg:#2f2414;--amber-line:#6d5227;--soon-bg:#231d14;
    --link:#8fbcf2;
    --panel:rgba(33,30,25,.85);--glass:rgba(21,19,15,.96);--glass2:rgba(21,19,15,.78);--glass-card:rgba(33,30,25,.72);
    --map-bg:#26231e;--map-filter:invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7);
    --glow:rgba(214,74,48,.12);--glow2:rgba(214,74,48,.07);--glow3:rgba(242,183,99,.05);
    --ring:rgba(214,74,48,.08);--ring2:rgba(214,74,48,.06);--ring3:rgba(242,237,227,.04);
    --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);
    --shadow-hover:0 4px 8px rgba(0,0,0,.3),0 14px 28px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --paper:#15130f;--paper2:#1b1814;--card:#211e19;--card2:#1b1915;--raise:#2a2620;--chip:#2e2a23;
  --ink:#f2ede3;--ink2:#d9d2c5;--mut:#a69e90;--line:#37322b;--line2:#4b453b;
  --on-ink:#15130f;--ink-hover:#fff;
  --red:#c63a22;--red-soft:#f2826b;--red-hover:#a92e19;--red-bg:#2f1a15;--red-line:#6a3226;
  --amber:#f2b763;--amber-bg:#2f2414;--amber-line:#6d5227;--soon-bg:#231d14;
  --link:#8fbcf2;
  --panel:rgba(33,30,25,.85);--glass:rgba(21,19,15,.96);--glass2:rgba(21,19,15,.78);--glass-card:rgba(33,30,25,.72);
  --map-bg:#26231e;--map-filter:invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.7);
  --glow:rgba(214,74,48,.12);--glow2:rgba(214,74,48,.07);--glow3:rgba(242,183,99,.05);
  --ring:rgba(214,74,48,.08);--ring2:rgba(214,74,48,.06);--ring3:rgba(242,237,227,.04);
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25);
  --shadow-hover:0 4px 8px rgba(0,0,0,.3),0 14px 28px rgba(0,0,0,.35);
}

/* 切換鈕：沒有 JS 時保持隱藏（theme.js 會移除 hidden） */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border-radius:6px;
  border:1px solid var(--line2);background:var(--card);color:var(--ink2);cursor:pointer;font:inherit;line-height:1}
.theme-toggle:hover,.theme-toggle:focus-visible{border-color:var(--ink);color:var(--ink);background:var(--raise)}
.theme-toggle[hidden]{display:none}
.theme-toggle svg{width:18px;height:18px;display:block}
.theme-toggle .i-sun{display:none}
.theme-toggle[aria-pressed="true"] .i-sun{display:block}
.theme-toggle[aria-pressed="true"] .i-moon{display:none}
