/* Jayter 登入 — 星系版（2026-07 接自設計稿 mockup_c5）
   效能決策（實測定案，改前先看 templates/registration/login.html 頂部說明）：
   - 不用 backdrop-filter：卡片後是深空黑底，模糊沒東西可模糊，卻佔整頁 GPU 15%
   - 桌機卡片 zoom .68：業主定案的比例，star 取景不變、卡片讓出星空
   - 手機/PDA 走靜態背景圖（html.lite），完全不載 three.js */
:root {
    --bg: #04070d;
    --line: rgba(89, 200, 242, 0.22);
    --line-dim: rgba(89, 200, 242, 0.10);
    --cyan: #59c8f2;
    --cyan-soft: #8fb8d8;
    --amber: #ffb02e;
    --ember: #e8541d;
    --ink: #e6f1fb;
    --ink-faint: #5c7391;
    --ok: #4ade80;
    --err: #ff5d5d;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow: hidden;
    display: flex; justify-content: center; align-items: center;
}

/* 星系背景 canvas：最底層 */
#galaxy { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }

.sweep { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 1; opacity: .4;
    background: linear-gradient(90deg, transparent, rgba(89,200,242,.7), transparent);
    animation: sweep 7s linear infinite; }
@keyframes sweep { from { transform: translateY(-4px); } to { transform: translateY(100vh); } }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(0,0,0,.6)); }

.console {
    position: relative; z-index: 2;
    width: min(880px, calc(100vw - 40px));
    border: 1px solid var(--line);
    background: rgba(8, 13, 23, 0.94);
    box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 80px rgba(0,0,0,.6), inset 0 0 60px rgba(89,200,242,.03);
    animation: boot .7s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes boot { from { opacity: 0; transform: translateY(18px); clip-path: inset(46% 0 46% 0); }
    60% { clip-path: inset(0 0 0 0); } to { opacity: 1; transform: none; } }

.corner { position: absolute; width: 18px; height: 18px; border: 2px solid var(--cyan); z-index: 3; }
.corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.statusbar {
    display: flex; align-items: center; gap: 18px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line-dim);
    font-family: 'JetBrains Mono', monospace; font-size: 11.5px; letter-spacing: 1.5px;
    color: var(--ink-faint);
}
.statusbar .sys { color: var(--cyan); font-weight: 700; }
.statusbar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
    box-shadow: 0 0 8px var(--ok); animation: blink 2.2s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.statusbar .grow { flex: 1; }
.statusbar .clock { color: var(--amber); }

.body { display: grid; grid-template-columns: 1fr 1.05fr; }

/* 左：識別區 */
.idpane {
    padding: 40px 36px;
    border-right: 1px solid var(--line-dim);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative;
}
.reticle { position: relative; width: 190px; height: 190px; display: flex; justify-content: center; align-items: center; }
.reticle .ring { position: absolute; inset: 0; border-radius: 50%;
    border: 1px dashed rgba(89,200,242,.4); animation: spin 22s linear infinite; }
.reticle .ring2 { position: absolute; inset: 16px; border-radius: 50%;
    border: 1px solid var(--line-dim); border-top-color: var(--amber);
    animation: spin 9s linear infinite reverse; }
.reticle .tick { position: absolute; width: 100%; height: 100%; }
.reticle .tick::before, .reticle .tick::after { content: ''; position: absolute; background: var(--cyan); opacity: .6; }
.reticle .tick::before { top: 50%; left: -8px; width: 14px; height: 1px; box-shadow: 208px 0 0 var(--cyan); }
.reticle .tick::after { left: 50%; top: -8px; height: 14px; width: 1px; box-shadow: 0 208px 0 var(--cyan); }
@keyframes spin { to { transform: rotate(360deg); } }
.reticle img { width: 96px; filter: drop-shadow(0 8px 26px rgba(46,111,216,.6)); }

.callsign { margin-top: 26px; font-family: 'Chakra Petch', sans-serif; font-weight: 700;
    font-size: 30px; letter-spacing: 8px; color: var(--ink); }
.callsign b { color: var(--cyan); }
.subsign { margin-top: 8px; font-size: 13px; letter-spacing: 4px; color: var(--ink-faint); }

.readout { margin-top: 30px; width: 100%; font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 1px; color: var(--ink-faint); }
.readout .row { display: flex; justify-content: space-between; padding: 6px 2px;
    border-bottom: 1px dashed var(--line-dim); }
.readout .v { color: var(--cyan-soft); }
.readout .v.ok { color: var(--ok); }

/* 右：表單 */
.authpane { padding: 40px 42px; display: flex; flex-direction: column; justify-content: center; }
.authpane .head { font-family: 'Chakra Petch', sans-serif; font-size: 20px; font-weight: 700;
    letter-spacing: 3px; color: var(--ink); }
.authpane .head span { color: var(--amber); }
.authpane .sub { margin-top: 6px; margin-bottom: 30px; font-size: 13px; color: var(--ink-faint); letter-spacing: 1px; }

/* 錯誤訊息（帳密錯誤；伺服器 render 與 fetch 預檢共用） */
.login-error {
    display: flex; align-items: center; gap: 10px;
    margin: -12px 0 20px; padding: 11px 14px;
    border: 1px solid rgba(255, 93, 93, .45);
    background: rgba(64, 14, 18, .5);
    color: #ffb4b4; font-size: 13px; letter-spacing: 1px;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    animation: err-in .3s ease-out both;
}
.login-error i { color: var(--err); }
@keyframes err-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.field { margin-bottom: 20px; }
.field label { display: flex; justify-content: space-between; margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 2px; color: var(--cyan-soft); }
.field label .idx { color: var(--ink-faint); }
.box { display: flex; align-items: center;
    border: 1px solid rgba(89, 200, 242, 0.28); background: rgba(10, 20, 36, .78);
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
    transition: border-color .25s, box-shadow .25s, filter .25s; }
/* 微光：drop-shadow 會沿切角形狀發光（box-shadow 會被 clip-path 裁掉） */
.field { filter: drop-shadow(0 0 7px rgba(89, 200, 242, 0.14)); }
.box:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 24px rgba(89,200,242,.15); }
.box i { width: 46px; text-align: center; color: var(--ink-faint); font-size: 13px; }
.box input { flex: 1 1 0; width: 0; min-width: 0; padding: 13px 16px 13px 0; border: none; outline: none;
    background: transparent; color: var(--ink); font-size: 16px;
    /* 與欄位標籤/HUD 同族：拉丁字走 JetBrains Mono（中文自動回落 Noto Sans TC），
       字距同標籤的 2px —— inherit 會落到 Noto 而且 1px 比周圍擠 */
    font-family: 'JetBrains Mono', 'Noto Sans TC', monospace; letter-spacing: 2px; }
.box input::placeholder { color: #3d4f66; }
/* Chrome/Edge 自動填入會鋪白/黃底，跟深空風格打架：
   UA 的 autofill 底色蓋不掉，只能用超大 inset shadow 蓋回卡片底色（業界標準解法） */
.box input:-webkit-autofill,
.box input:-webkit-autofill:hover,
.box input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #0c1626 inset;
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--ink);
    transition: background-color 99999s ease-out;
    font-family: 'JetBrains Mono', 'Noto Sans TC', monospace;
}
/* Edge 內建密碼小眼睛：我們有自己的切換鈕，兩顆眼睛重複 */
.box input::-ms-reveal, .box input::-ms-clear { display: none; }

/* 密碼顯示切換（沿用現行版功能） */
.box .eye { border: none; background: transparent; cursor: pointer;
    width: 44px; padding: 13px 0; color: var(--ink-faint); font-size: 13px; transition: color .2s; }
.box .eye:hover { color: var(--cyan); }

/* Caps Lock 提示（沿用現行版功能） */
.capslock-hint { display: none; margin-top: 7px;
    font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 1.5px; color: var(--amber); }
.capslock-hint.on { display: block; }

.btn {
    width: 100%; margin-top: 14px; padding: 15px; border: none; cursor: pointer;
    font-family: 'Chakra Petch', 'Noto Sans TC', sans-serif; font-size: 17px; font-weight: 700;
    letter-spacing: 8px; text-indent: 8px; color: #120800;
    background: linear-gradient(95deg, var(--amber), var(--ember));
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    box-shadow: 0 12px 34px rgba(255,122,26,.3);
    transition: filter .2s, transform .2s, box-shadow .25s;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: 0 16px 42px rgba(255,122,26,.42); }
.btn:active { transform: translateY(0); }

.foot { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; }
.foot a { color: var(--ink-faint); font-size: 12.5px; letter-spacing: 2px; text-decoration: none; transition: .2s; }
.foot a:hover { color: var(--amber); }
.foot .ver { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: #33455e; letter-spacing: 1px; }

/* ---------- 登入認證動畫 ---------- */
#authfx { position: fixed; inset: 0; z-index: 20; display: none;
    justify-content: center; align-items: center;
    background: rgba(2, 4, 9, 0.78); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .35s; }
#authfx.show { display: flex; }
#authfx.in { opacity: 1; }

.af-panel { position: relative; width: min(430px, calc(100vw - 48px));
    padding: 46px 40px 38px; text-align: center;
    border: 1px solid var(--line);
    background: rgba(8, 13, 23, 0.9);
    box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 90px rgba(0,0,0,.7), inset 0 0 60px rgba(89,200,242,.04);
    animation: af-boot .45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes af-boot { from { opacity: 0; transform: translateY(14px); clip-path: inset(46% 0 46% 0); }
    65% { clip-path: inset(0); } to { opacity: 1; transform: none; } }

/* 頭像 + 掃描環 */
.af-avatar { position: relative; width: 138px; height: 138px; margin: 0 auto 8px;
    display: flex; justify-content: center; align-items: center; }
.af-avatar .core { width: 92px; height: 92px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; overflow: hidden;
    background: radial-gradient(circle at 35% 30%, #16283f, #0a1426 70%);
    border: 1px solid var(--line); position: relative; }
.af-avatar .core i { font-size: 42px; color: var(--cyan-soft); }
/* 垂直掃描光帶 */
.af-avatar .scan { position: absolute; left: 0; right: 0; height: 26px; top: -30%;
    background: linear-gradient(to bottom, transparent, rgba(89,200,242,.5), transparent);
    animation: af-scan 1.1s linear infinite; }
@keyframes af-scan { from { top: -25%; } to { top: 105%; } }
.af-ring { position: absolute; inset: 0; border-radius: 50%;
    border: 1px dashed rgba(89,200,242,.55); animation: spin 3.2s linear infinite; }
.af-ring2 { position: absolute; inset: 10px; border-radius: 50%;
    border: 1px solid var(--line-dim); border-top-color: var(--amber);
    animation: spin 1.7s linear infinite reverse; }
/* 核可後狀態 */
#authfx.granted .af-ring { border-color: rgba(74,222,128,.7); border-style: solid; animation-duration: 9s; }
#authfx.granted .af-ring2 { border-top-color: #4ade80; }
#authfx.granted .af-avatar .scan { display: none; }
#authfx.granted .af-avatar .core { border-color: rgba(74,222,128,.6);
    box-shadow: 0 0 26px rgba(74,222,128,.25); }
/* 核可後：太空人佔位退場，揭示真實大頭照（驗證成功前絕不顯示） */
#authfx.granted .af-avatar .core i { display: none; }
.af-avatar .core img { display: none; width: 100%; height: 100%; object-fit: cover; }
#authfx.granted .af-avatar .core img { display: block;
    animation: af-reveal .55s cubic-bezier(.2,.8,.3,1) both; }
@keyframes af-reveal { from { opacity: 0; transform: scale(1.35); filter: blur(6px) brightness(2); }
    to { opacity: 1; transform: none; filter: none; } }

.af-user { margin-top: 10px; font-family: 'Chakra Petch', sans-serif; font-weight: 700;
    font-size: 19px; letter-spacing: 3px; color: var(--ink); min-height: 24px; }
.af-status { margin-top: 14px; font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px; letter-spacing: 2px; color: var(--cyan-soft); min-height: 17px; }
.af-status .pct { color: var(--amber); }
/* 進度細條 */
.af-bar { margin: 14px auto 0; width: 78%; height: 3px; background: rgba(89,200,242,.12);
    overflow: hidden; }
.af-bar i { display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--cyan), var(--amber)); transition: width .12s linear; }
#authfx.granted .af-bar i { background: #4ade80; }

/* 身分已核可戳記 —— 配角一行：核可只是程序，主角是下面的歡迎回來（業主定調） */
.af-grant { margin-top: 18px; font-family: 'Chakra Petch', sans-serif; font-weight: 700;
    font-size: 13px; letter-spacing: 3px; color: #4ade80;
    text-shadow: 0 0 14px rgba(74,222,128,.4);
    opacity: 0; transform: scale(1.3); }
#authfx.granted .af-grant { animation: af-stamp .45s .1s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes af-stamp { from { opacity: 0; transform: scale(1.3); }
    to { opacity: 1; transform: scale(1); } }
.af-grant small { font-family: 'JetBrains Mono', monospace; margin-left: 8px;
    font-weight: 400; font-size: 10px; letter-spacing: 2px; color: rgba(74,222,128,.7); }
/* 歡迎回來 = 核可畫面的主角：機甲認出自己的操作員 —— 大字、暖光、打字浮現 */
.af-welcome { margin-top: 16px; min-height: 64px; opacity: 0; }
#authfx.granted .af-welcome { animation: af-fade .5s .55s both; }
.af-welcome .main { display: block; min-height: 32px; font-size: 23px; font-weight: 500;
    letter-spacing: 3px; color: var(--ink); text-shadow: 0 0 26px rgba(255,176,46,.3); }
.af-welcome .main b { color: var(--amber); font-weight: 700; }
.af-welcome .sub2 { display: block; margin-top: 9px; font-size: 13px; letter-spacing: 2px;
    color: var(--ink-faint); opacity: 0; }
#authfx.granted .af-welcome .sub2 { animation: af-fade .6s 1.55s both; }
@keyframes af-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.af-note { margin-top: 22px; font-family: 'JetBrains Mono', monospace; font-size: 10px;
    letter-spacing: 2px; color: #33455e; }
/* 核可瞬間白閃 */
.af-flash { position: fixed; inset: 0; background: rgba(190,255,220,.9); opacity: 0; pointer-events: none; }
#authfx.granted .af-flash { animation: af-flashfx .5s ease-out both; }
@keyframes af-flashfx { 0% { opacity: 0; } 12% { opacity: .55; } 100% { opacity: 0; } }

/* ---------- 驗證失敗分岔 ----------
   成敗共用同一段掃描（按下送出就開播），結果回來才分岔 ——
   否則「有沒有動畫」本身就洩漏結果，掃描就假了。 */
#authfx.denied .af-ring { border-color: rgba(255,93,93,.65); border-style: solid; animation-duration: 9s; }
#authfx.denied .af-ring2 { border-top-color: var(--err); }
#authfx.denied .af-avatar .scan { display: none; }
#authfx.denied .af-avatar .core { border-color: rgba(255,93,93,.55);
    box-shadow: 0 0 26px rgba(255,93,93,.22); }
#authfx.denied .af-avatar .core i { color: #d98a8a; }
#authfx.denied .af-bar i { background: var(--err); }
#authfx.denied .af-status { color: #e8a0a0; }
#authfx.denied .af-panel { animation: af-shake .45s ease both; }
@keyframes af-shake { 0%, 100% { transform: none; } 18% { transform: translateX(-9px); }
    38% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.af-deny { margin-top: 20px; font-family: 'Chakra Petch', sans-serif; font-weight: 700;
    font-size: 20px; letter-spacing: 4px; color: var(--err);
    text-shadow: 0 0 18px rgba(255,93,93,.4); display: none; }
.af-deny small { display: block; margin-top: 4px; font-family: 'JetBrains Mono', monospace;
    font-weight: 400; font-size: 10.5px; letter-spacing: 3px; color: rgba(255,93,93,.7); }
#authfx.denied .af-deny { display: block; animation: af-stamp .4s cubic-bezier(.2,.9,.3,1.4) both; }
#authfx.denied .af-grant, #authfx.denied .af-welcome { display: none; }
#authfx.denied .af-flash { background: rgba(255,110,110,.6); animation: af-flashfx .45s ease-out both; }

/* ---------- 艙門過場：關門（開門在 admin/base.html，材質與動態完全同構） ----------
   材質 = GPT Image 2 生成的整張艙門圖（質感類視覺別死磕 CSS 手繪，已踩過天花板）。
   上下兩片各取圖的上/下半：background 以 100vw×100vh 鋪滿視窗座標，
   下門再往上偏 50vh —— 閉合時兩半拼回整張圖，天生無縫。
   換門款：換 ../img/艙門.webp 一個檔＋bump login.html 的 ?v（候選圖在 團隊模式_第二代/Jayter登入頁_星系版/門板候選/）。 */
#blink { position: fixed; inset: 0; z-index: 60; pointer-events: none; visibility: hidden; }
#blink.close { visibility: visible; pointer-events: all; }
#blink::before, #blink::after { content: ''; position: absolute; left: 0; right: 0;
    background-color: #060b16;   /* 圖還沒到位時的保底深色，避免露出頁面 */
    background-image: url('../img/艙門.webp');
    background-size: 100vw 100vh; background-repeat: no-repeat;
    filter: drop-shadow(0 0 14px rgba(89, 200, 242, .3)); }
#blink::before { top: 0; height: 50vh; transform: translateY(-104%);
    background-position: 0 0; }
/* 下門多 1px 蓋住次像素接縫（重複的 1px 落在縫光裡看不見） */
#blink::after { bottom: 0; height: calc(50vh + 1px); transform: translateY(104%);
    background-position: 0 calc(-50vh + 1px); }
/* 關門：0→64% 快合、64→80% 最後 1.4% 慢速入座、80% 鎖定閃光、100% 收斂
   （reduced-motion 殺 animation 時，.close 的基準 transform 直接到位） */
/* 閉合後若還在等下一頁：中縫光暈慢呼吸（氣密循環中）——等待畫面要是活的。
   新頁第一幀是同一張閉合門，呼吸極微弱，切換瞬間無感。 */
#blink.close::before { transform: translateY(0);
    animation: doorCloseTop .52s both, doorGlowIdle 2.4s ease-in-out .52s infinite alternate; }
#blink.close::after { transform: translateY(0);
    animation: doorCloseBot .52s both, doorGlowIdle 2.4s ease-in-out .52s infinite alternate; }
@keyframes doorGlowIdle {
    from { filter: drop-shadow(0 0 14px rgba(89, 200, 242, .38)); }
    to   { filter: drop-shadow(0 0 22px rgba(120, 214, 255, .55)); } }
@keyframes doorCloseTop {
    0%   { transform: translateY(-104%); filter: drop-shadow(0 0 10px rgba(89, 200, 242, .22)); animation-timing-function: cubic-bezier(.62, .04, .38, 1); }
    64%  { transform: translateY(-1.4%); filter: drop-shadow(0 0 12px rgba(89, 200, 242, .3)); animation-timing-function: cubic-bezier(.25, 0, .3, 1); }
    80%  { transform: translateY(0); filter: drop-shadow(0 0 30px rgba(150, 226, 255, .85)); }
    100% { transform: translateY(0); filter: drop-shadow(0 0 14px rgba(89, 200, 242, .38)); } }
@keyframes doorCloseBot {
    0%   { transform: translateY(104%); filter: drop-shadow(0 0 10px rgba(89, 200, 242, .22)); animation-timing-function: cubic-bezier(.62, .04, .38, 1); }
    64%  { transform: translateY(1.4%); filter: drop-shadow(0 0 12px rgba(89, 200, 242, .3)); animation-timing-function: cubic-bezier(.25, 0, .3, 1); }
    80%  { transform: translateY(0); filter: drop-shadow(0 0 30px rgba(150, 226, 255, .85)); }
    100% { transform: translateY(0); filter: drop-shadow(0 0 14px rgba(89, 200, 242, .38)); } }

/* 卡片比例 0.68：業主定案。
   起因是他把瀏覽器縮到 67% 覺得比較有質感 —— 量測後確認星系取景完全沒變，
   真正的差別是卡片從佔畫面 55% 縮到 37%：卡片擋住的星系少了、留白多了。
   用 zoom 而不是 transform: scale —— zoom 會重新柵格化文字，scale 會糊。
   只在寬螢幕套用，手機維持滿版（手機另有靜態背景路線）。 */
@media (min-width: 901px) { .console { zoom: .68; } }

@media (max-width: 900px) {
    body { overflow-y: auto; }
    .console { margin: 20px 0; }
    .body { grid-template-columns: 1fr; }
    .idpane { border-right: none; border-bottom: 1px solid var(--line-dim); padding: 32px 24px; }
    .authpane { padding: 30px 24px 36px; }
    .readout { display: none; }
}
@media (max-width: 560px) {
    /* HUD 列在手機會撐爆版面（min-content 476px > 螢幕寬），整頁會被瀏覽器縮小。
       收緊間距與字距、收掉冗餘的 SYSTEM ONLINE，日期與時鐘保留。 */
    .statusbar { gap: 9px; padding: 10px 14px; font-size: 10.5px; letter-spacing: .6px; }
    /* 卡片壓縮：原本佔滿 97% 螢幕高，星系背景完全被蓋住。
       收到約 80% 高，上下各露出一截星系，手機也看得到氛圍。 */
    .reticle { width: 132px; height: 132px; }
    .idpane { padding: 22px 18px 18px; }
    .authpane { padding: 22px 18px 26px; }
    .callsign { font-size: 30px; }
    .subsign { margin-top: 6px; font-size: 11.5px; letter-spacing: 3px; }
    .field { margin-bottom: 15px; }
    .console { margin: 26px 0; }
    .statusbar .sysline { display: none; }
    .statusbar > * { min-width: 0; }
    .console { width: calc(100vw - 20px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── 靜態星系背景（手機/PDA 路線）────────────────────────────────
   一張預先烤好的圖取代整套即時 3D：零逐幀 GPU、零 shader 編譯、零 fBm 運算。
   極慢的縮放平移只動 transform，由合成器處理，不觸發重繪。 */
#liteBg { display: none; position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #04070d; }
#liteBg img { width: 100%; height: 100%; object-fit: cover; display: block;
    animation: liteDrift 120s ease-in-out infinite alternate; will-change: transform; }
@keyframes liteDrift {
    from { transform: scale(1.015) translate3d(0, 0, 0); }
    to   { transform: scale(1.05) translate3d(-1.2%, 0.8%, 0); }
}
html.lite #galaxy { display: none; }
html.lite #liteBg { display: block; }
@media (prefers-reduced-motion: reduce) { #liteBg img { animation: none; transform: scale(1.015); } }

/* ============================================================
   彩蛋系統（R6）：圖鑑 / toast / 小卡 / DOM 特效。
   規格：團隊模式_第二代/Jayter登入頁_星系版/彩蛋_HANDOFF.md。
   z-index 地圖：eggSky 1（星空上、卡片下）｜console 2｜authfx 20｜
   eggCodex 30｜eggGlitch 34｜eggAlert 35｜eggCard/eggToasts 40｜blink 60。
   reduced-motion：全域 animation:none 已把特效滅掉 —— 流星/飛船初始 opacity:0
   靠 keyframes 才現身，動畫被殺 = 保持不可見，這是刻意設計不要「修」。 */

/* 圖鑑入口：右下 BUILD 版本號 —— 唯一有明示互動感的蛋（業主核可的自舉入口） */
.foot .ver { cursor: pointer; transition: color .25s, text-shadow .25s; }
.foot .ver:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(89,200,242,.55); }

/* 天空層：流星雨 / 大流星 / 神秘飛船 */
#eggSky { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.egg-meteor { position: absolute; width: 150px; height: 2px; opacity: 0;
    background: linear-gradient(90deg, rgba(207,234,255,0), rgba(207,234,255,.9) 65%, #fff);
    border-radius: 2px; transform: rotate(28deg);
    filter: drop-shadow(0 0 6px rgba(160,220,255,.8));
    animation: eggMeteor 1.2s linear both; }
.egg-meteor.gold { background: linear-gradient(90deg, rgba(255,214,140,0), rgba(255,196,90,.95) 65%, #fff4d6);
    filter: drop-shadow(0 0 8px rgba(255,196,90,.9)); }
.egg-meteor.big { width: 300px; height: 3px; }
@keyframes eggMeteor {
    0% { transform: rotate(28deg) translateX(0); opacity: 0; }
    8% { opacity: 1; }
    100% { transform: rotate(28deg) translateX(72vw); opacity: 0; } }
.egg-ship { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 12px;
    opacity: 0; animation: eggShip 17s linear both; }
.egg-ship .flag { position: relative; font-family: 'JetBrains Mono', monospace; font-size: 10px;
    letter-spacing: 2.5px; color: var(--cyan-soft); border: 1px solid var(--line);
    padding: 3px 9px; background: rgba(8,13,23,.7);
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); }
.egg-ship .flag::after { content: ''; position: absolute; right: -13px; top: 50%;
    width: 13px; height: 1px; background: var(--line); }
.egg-ship .body { font-size: 20px; transform: rotate(24deg);
    filter: drop-shadow(0 0 8px rgba(150,220,255,.6)); }
@keyframes eggShip {
    0% { transform: translate(-14vw, 72vh); opacity: 0; }
    6% { opacity: 1; }
    94% { opacity: 1; }
    100% { transform: translate(108vw, 18vh); opacity: 0; } }

/* HUD 小卡（左下：行星梗語 / 今日星雲 / 快許願） */
#eggCard { position: fixed; left: 20px; bottom: 20px; z-index: 40; max-width: 340px;
    display: flex; align-items: center; gap: 13px; padding: 12px 18px;
    border: 1px solid var(--line); background: rgba(8,13,23,.93);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
    opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s;
    pointer-events: none; }
#eggCard.show { opacity: 1; transform: none; }
#eggCard .ic { font-size: 23px; flex: none; }
#eggCard .t { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; color: var(--ink); }
#eggCard .s { margin-top: 3px; font-size: 12px; letter-spacing: .8px; color: var(--ink-faint); }

/* toast（右下：發現進度） */
#eggToasts { position: fixed; right: 20px; bottom: 20px; z-index: 40;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.egg-toast { font-family: 'JetBrains Mono', 'Noto Sans TC', monospace; font-size: 12px;
    letter-spacing: 1.5px; color: var(--cyan-soft);
    border: 1px solid var(--line); background: rgba(8,13,23,.93); padding: 9px 14px;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
    animation: eggToastIn .3s ease-out both; }
.egg-toast.out { opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
@keyframes eggToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Konami 演習警報 */
#eggAlert { position: fixed; inset: 0; z-index: 35; pointer-events: none;
    display: flex; justify-content: center; align-items: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(120,10,10,.12), rgba(60,4,4,.42));
    animation: eggAlertPulse .7s ease-in-out infinite; }
#eggAlert .stripe { position: absolute; left: 0; right: 0; height: 22px; opacity: .75;
    background: repeating-linear-gradient(-45deg, rgba(255,176,46,.8) 0 18px, rgba(10,6,2,.9) 18px 36px); }
#eggAlert .stripe.top { top: 0; }
#eggAlert .stripe.bot { bottom: 0; }
#eggAlert .txt { font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: 34px;
    letter-spacing: 6px; color: #ff5d5d; text-shadow: 0 0 30px rgba(255,60,60,.7); text-align: center; }
#eggAlert .txt small { display: block; margin-top: 8px; font-family: 'JetBrains Mono', monospace;
    font-weight: 400; font-size: 12px; letter-spacing: 3px; color: rgba(255,120,120,.85); }
@keyframes eggAlertPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* 訊號驚魂：掃屏雜訊 1 秒 */
#eggGlitch { position: fixed; inset: 0; z-index: 34; pointer-events: none; opacity: .5;
    background: repeating-linear-gradient(0deg, rgba(89,200,242,.06) 0 2px, transparent 2px 5px);
    animation: eggGlitchShake .09s steps(2) infinite; }
#eggGlitch::before { content: ''; position: absolute; left: 0; right: 0; height: 36px;
    background: rgba(150,220,255,.12); animation: eggGlitchBand 1s linear both; }
@keyframes eggGlitchShake { 0% { transform: translateX(0); } 50% { transform: translateX(3px); } 100% { transform: translateX(-2px); } }
@keyframes eggGlitchBand { from { top: -10%; } to { top: 105%; } }
.readout .v.lost { color: var(--err) !important; }

/* 夜班模式：綠燈變琥珀 */
.statusbar.nightwatch .dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.statusbar.nightwatch .sysline { color: var(--amber); }

/* 別偷看：眼睛 tooltip（掛在 .field 上，避免被 .box 的 clip-path 裁掉） */
.field { position: relative; }
.egg-tip { position: absolute; right: 6px; top: -27px;
    font-family: 'JetBrains Mono', 'Noto Sans TC', monospace; font-size: 11px; letter-spacing: 2px;
    color: var(--amber); border: 1px solid rgba(255,176,46,.4); background: rgba(20,14,4,.92);
    padding: 3px 8px; animation: eggToastIn .2s ease-out both; }

/* 彩蛋圖鑑面板（HUD 風：切角、青線、mono，同卡片語言） */
#eggCodex { position: fixed; inset: 0; z-index: 30; display: none;
    justify-content: center; align-items: center;
    background: rgba(2, 4, 9, .82); opacity: 0; transition: opacity .3s; }
#eggCodex.show { display: flex; }
#eggCodex.in { opacity: 1; }
.cx-panel { position: relative; width: min(760px, calc(100vw - 36px)); max-height: 84vh;
    display: flex; flex-direction: column;
    border: 1px solid var(--line); background: rgba(8,13,23,.96);
    box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 90px rgba(0,0,0,.7), inset 0 0 60px rgba(89,200,242,.04);
    animation: af-boot .4s cubic-bezier(.2,.7,.3,1) both; }
.cx-head { display: flex; align-items: center; gap: 14px; padding: 16px 22px; flex: none;
    border-bottom: 1px solid var(--line-dim);
    font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: 17px;
    letter-spacing: 3px; color: var(--ink); }
.cx-head span { color: var(--amber); font-family: 'JetBrains Mono', monospace;
    font-size: 12px; font-weight: 400; letter-spacing: 2px; }
.cx-head .cnt { margin-left: auto; font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px; color: var(--cyan); letter-spacing: 2px; }
.cx-head .cx-close { border: none; background: transparent; color: var(--ink-faint);
    font-size: 16px; cursor: pointer; padding: 4px 8px; transition: color .2s; }
.cx-head .cx-close:hover { color: var(--err); }
.cx-badge { flex: none; margin: 14px 22px 0; padding: 10px 14px;
    border: 1px solid rgba(255,176,46,.5);
    background: linear-gradient(90deg, rgba(60,40,6,.55), rgba(30,20,4,.3));
    color: var(--amber); font-family: 'Chakra Petch', sans-serif; font-weight: 700;
    font-size: 14px; letter-spacing: 3px; text-shadow: 0 0 16px rgba(255,176,46,.5); }
.cx-grid { padding: 16px 22px 22px; overflow-y: auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
    scrollbar-width: thin; scrollbar-color: rgba(89,200,242,.3) transparent; }
.cx-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px;
    border: 1px solid var(--line-dim); background: rgba(10,20,36,.5);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); }
.cx-item .ic { font-size: 20px; width: 28px; text-align: center; flex: none; }
.cx-item b { display: block; font-size: 13.5px; letter-spacing: 1px; color: var(--ink); }
.cx-item small { display: block; margin-top: 3px; font-size: 11.5px; letter-spacing: .5px;
    line-height: 1.5; color: var(--ink-faint); }
.cx-item.locked .ic { filter: grayscale(1); opacity: .55; }
.cx-item.locked b { color: var(--ink-faint); }
.cx-item.locked small { font-style: italic; color: #43597a; }
.cx-item.found { border-color: rgba(89,200,242,.35); }
.cx-item.found small { color: var(--cyan-soft); font-style: normal; }
@media (max-width: 700px) { .cx-grid { grid-template-columns: 1fr; } }
/* 20/20 首次開圖鑑：禮花一次 */
.cx-confetti { position: absolute; width: 7px; height: 11px; top: -12px; opacity: .9;
    animation: cxDrop 1.6s ease-in both; }
@keyframes cxDrop { to { transform: translateY(88vh) rotate(540deg); opacity: 0; } }
