/* Annyeongz 平行宇宙 — 基礎:色票變數、body、橫幅、頂欄、搜尋列、主版面容器 */
:root{
  --bg:#f6f4ef; --card:#fff; --line:#e6e0d5; --ink:#2c2a26; --muted:#706a60;
  --accent:#d9788f; --accent-soft:#fbe9ee; --exc:#c0563f; --exc-soft:#fbe6e1;
  --chip:#f0ece3; --badgec:#5c564b; --persona:#6f685c;
  --he:#3f9d6b; --he-bg:#e4f3ea; --be:#5b7fb5; --be-bg:#e7eef7; --oe:#c79a3e; --oe-bg:#f7efda;
  --typec:#b9743f; --type-bg:#f6e6da; --purp:#8a5fc0; --purp-bg:#efe6f7;
  /* 文字專用色(-t):淺色主題的粉 / 紅 / 綠 / 藍 / 黃 / 橘 / 紫當「文字」時對比不到 WCAG AA 4.5:1,
     所以文字另用較深的一組;邊框與底色仍用原色,外觀才不會變。深色主題原色就達標,-t 直接等於原色。 */
  --accent-t:#c13657; --exc-t:#ab4d38; --he-t:#317a53; --be-t:#496ca1; --oe-t:#876827; --typec-t:#935c32; --purp-t:#7f50ba;
  --on-accent:#2c2a26;   /* 粉底上的字(目前頁碼、手機「完成」鈕、hover):白字在粉底上不到 3:1,改深字 */
  /* 文章狀態四個家族(書卡左色條、狀態 chip、面板「文章狀態」標籤共用):完結系綠、進行系藍、未完金、斷更灰(不用紅,避免跟「原文已刪」撞色)。
     --he / --be / --oe 這三組名字留作「綠 / 藍 / 金」通用色票(統計星圖的圖表顏色也讀它們),結局 chip 另用 --end-* */
  --st-done:var(--he); --st-done-bg:var(--he-bg); --st-done-t:var(--he-t);
  --st-on:var(--be); --st-on-bg:var(--be-bg); --st-on-t:var(--be-t);
  --st-wip:var(--oe); --st-wip-bg:var(--oe-bg); --st-wip-t:var(--oe-t);
  --st-hiatus:#a8a195; --st-hiatus-bg:#e9e6e0; --st-hiatus-t:#5f5a52;
  /* 結局 chip:避開狀態四家族(綠 / 藍 / 金 / 灰),HE 玫瑰紅、BE 紫、OE 青 */
  --end-he:#d4568c; --end-he-bg:#fae3ec; --end-he-t:#b8366b;
  --end-be:var(--purp); --end-be-bg:var(--purp-bg); --end-be-t:var(--purp-t);
  --end-oe:#3aa39b; --end-oe-bg:#dff2f1; --end-oe-t:#1b6b66;
  --topbar-h:58px; --toolbar-h:0px;   /* 頂欄與 sticky 工具列的實際高度由 main.js 量好寫回(書卡 scroll-margin-top 用) */
}
[data-theme="dark"]{
  --bg:#15161b; --card:#21222b; --line:#34353f; --ink:#ece9e3; --muted:#9b948a;
  --accent:#e58aa0; --accent-soft:#3a2731; --exc:#e08363; --exc-soft:#3a2622;
  --chip:#2c2d37; --badgec:#c9c3b7; --persona:#b3aa9c;
  --he:#74c89a; --he-bg:#26352d; --be:#8aaad8; --be-bg:#283340; --oe:#d8b25e; --oe-bg:#3a3322;
  --typec:#df9d6f; --type-bg:#3a2c22; --purp:#b491e0; --purp-bg:#332a44;
  --accent-t:#e58aa0; --exc-t:#e08363; --he-t:#74c89a; --be-t:#8aaad8; --oe-t:#d8b25e; --typec-t:#df9d6f; --purp-t:#b491e0;
  --on-accent:#15161b;
  --st-hiatus:#7d776d; --st-hiatus-bg:#2f3038; --st-hiatus-t:#b2ab9f;
  --end-he:#e07aa8; --end-he-bg:#3a2634; --end-he-t:#ee8fb8;
  --end-oe:#5fbfb6; --end-oe-bg:#22363a; --end-oe-t:#6fcbc2;
}
*{box-sizing:border-box}
/* 橫向溢出的最後一道防線:整頁只准直向捲。iOS Safari 只要任一元素比畫面寬,整頁就能左右滑、書卡右邊的愛心會被推出螢幕。
   寫在 html 而不是 body:html 的 overflow 會交給 viewport、html 本身仍視為 visible,sticky 頂欄 / 工具列的捲動容器還是 viewport,不會失效
   (寫在 body 且 html 也設了 overflow 的話,body 會變成捲動容器,sticky 就壞了)。根本修正在各元素:main.css 的 .grid / .card / .toolbar、responsive.css 的壓縮列與 #sort。 */
html{overflow-x:hidden}
img,video,canvas{max-width:100%}   /* 圖 / 影片 / 畫布不會比容器寬 */
/* 無障礙:鍵盤聚焦一律看得見(不用 outline:none);滑鼠點擊不顯示外框。
   iOS Safari 會把程式觸發的 focus(關閉彈窗後焦點還給書卡鈕、面板開關)當成鍵盤焦點而畫出外框,
   所以 boot.js 監聽 pointerdown / touchstart / keydown 在 body 標記 data-input,外框只在 keyboard 時顯示;
   tabindex="-1" 的容器(main、面板)只是程式焦點的落點,一律不畫外框。 */
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
body:not([data-input="keyboard"]) :focus-visible{outline:none}
[tabindex="-1"]:focus-visible,[tabindex="-1"]:focus{outline:none}
/* 「跳到主內容」:只有鍵盤 Tab 到時才出現 */
.skip{position:absolute;left:8px;top:8px;z-index:10001;padding:8px 14px;border-radius:10px;background:var(--accent);color:var(--on-accent);
      font-weight:700;text-decoration:none;transform:translateY(-200%);transition:transform .15s}
.skip:focus{transform:none}
/* 只給螢幕閱讀器的文字(aria-live 宣告用) */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* 原本是 span / div 的可點元素改成 <button> 後,把瀏覽器預設的按鈕外觀歸零(各自的樣式在後面的檔案裡照舊套上) */
.opt,.chip,.fchip,.pg,.relitem,.aname,.scard,.mode,.fh,.tg button,.card .t{
  font:inherit;line-height:inherit;color:inherit;text-align:inherit;margin:0;padding:0;border:0;background:none;appearance:none;-webkit-appearance:none}
/* 使用者要求減少動態效果:關掉所有過場與動畫(開場動畫在 intro.css 另外處理) */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:0s!important;animation-duration:0s!important;animation-iteration-count:1!important;scroll-behavior:auto!important}
}
body{margin:0;font-family:"Microsoft JhengHei","PingFang TC",system-ui,sans-serif;
     background:var(--bg);color:var(--ink);font-size:15px;line-height:1.6}
/* banner:<picture> 依寬度只載一張(桌機 6:1 寬圖、手機 2:1 方圖,見 responsive.css);aspect-ratio 先佔好高度,圖還沒到也不跳版 */
.banner{position:relative;display:block;width:100%;aspect-ratio:6/1;overflow:hidden;background:var(--card)}
.banner .bimg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
/* top bar */
.topbar{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap;
        padding:12px 22px;background:var(--card);border-bottom:1px solid var(--line);
        position:sticky;top:0;z-index:20}
.brand{font-size:17px;font-weight:700;letter-spacing:.5px;margin:0}
.theme{padding:7px 11px;border:1px solid var(--line);border-radius:999px;background:var(--bg);color:var(--ink);cursor:pointer;font-size:15px;line-height:1}
.theme.install{font-size:13px;padding:8px 12px;border-color:var(--accent);color:var(--accent-t)}   /* 安裝到桌面:只在瀏覽器觸發 beforeinstallprompt 時顯示 */
.theme.install[hidden]{display:none}
a.theme{text-decoration:none;display:inline-flex;align-items:center}   /* 📊 統計星圖(連結,外觀同主題鈕;手機用) */
@media(min-width:861px){#statsLink{display:none}}   /* 桌機:工具列已有「📊 統計星圖」(#statsTb,main.css),頂欄這顆藏起來不重複 */
.search{flex:1;max-width:420px;min-width:160px;padding:9px 14px;border:1px solid var(--line);
        border-radius:999px;font-size:14px;background:var(--bg);color:var(--ink)}
.search::placeholder{color:var(--muted)}
.wrap{display:flex;gap:20px;align-items:flex-start;max-width:none;min-width:0;margin:0 auto;padding:18px 28px}
/* 頂欄 / 搜尋框下方的「📡 最後更新:X」小字(main 的第一行;main.js 填相對時間;空的時候不佔高) */
.lastup{margin:-4px 0 10px;font-size:12px;color:var(--muted);line-height:1.5}
.lastup:empty{display:none}
.lastup .lu-t{cursor:help;border-bottom:1px dotted var(--muted)}   /* hover / 長按看精確時間(title) */
@media(max-width:560px){.lastup{font-size:13px}}
