/* ═══════════════════════════════════════════════════════════════════════
   文件套印中心 v2 · 共用皮膚「私人銀行夜金」 (/rex/forms/skin.css)
   用法：任何頁 <link rel="stylesheet" href="/rex/forms/skin.css">（放在頁內 <style> 之後）
         ＋ <meta name="rex-theme" content="native">（必須在開機碼 <script id="rex-theme-boot"> 之前）。
   深色＝html[data-rex-theme="dark"]（原生，非濾鏡）。頁面上不放明暗切換鈕，由右上角膠囊決定。
   Tailwind CDN 的 <style> 會在 <head> 最後才注入，所以重新上色一律用 `body ` 前綴拉高權重。
   鐵律：本檔不碰 .mk／.mk-ro／.mk.empty／.mk.sel 與 .pg-wrap 內任何東西（PDF 預覽維持原版白紙）；
         不碰 #rex-topbar（功能膠囊）與 demo-mask 的 #dm-fab／#dm-panel。
   token 一律 --fx-* 前綴（避免與 report／docs／travel 頁自己的 --card --line --ink 衝突）。
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. token（淺色）：品牌深藍 #0a2334＋金 #E8A020，象牙紙卡片 ── */
:root{
  --fx-navy:#0a2334; --fx-navy2:#0d2a3a; --fx-navy3:#12384f; --fx-navy-deep:#061726;
  --fx-gold:#E8A020; --fx-gold-hi:#ffd700; --fx-gold-soft:#ffe28a; --fx-gold-ink:#8a5a06; --fx-on-gold:#3a2c00;
  --fx-paper:#f6f1e6; --fx-card:#fffdf8; --fx-card2:#f8f3e7; --fx-card3:#efe8d8;
  --fx-line:#e6dcc6; --fx-line2:#efe7d4; --fx-inb:#d4ccba; --fx-field:#ffffff;
  --fx-text:#1b2733; --fx-muted:#566373; --fx-soft:#6f7b88; --fx-hd:#0a2334;
  --fx-acc-ink:#0a2334; --fx-acc-bg:#f3e9cf; --fx-acc-line:#e2c172;
  --fx-ok:#1d7a5c; --fx-ok-bg:#e1f5ee; --fx-err:#b3261e; --fx-err-bg:#fde8e6; --fx-warn-bg:#fdf1d3; --fx-warn-ink:#7a4a05;
  --fx-sky:#0b5d86; --fx-sky-bg:#e3f1f8;
  --fx-dis-bg:#ece5d4; --fx-dis-ink:#7d7666; --fx-dis-line:#d9cfb8;
  --fx-serif:'Noto Serif TC','Source Han Serif TC','PMingLiU',serif;
  --fx-sans:'Noto Sans TC','PingFang TC','Microsoft JhengHei',ui-sans-serif,system-ui,sans-serif;
  --fx-shadow:0 18px 40px -30px rgba(10,35,52,.55);
  --fx-shadow-sm:0 8px 22px -18px rgba(10,35,52,.6);
  --fx-nav-h:60px;
  /* 理賠頁（rex/stamp）內建變數 → 對應到新 token（.pg-wrap 內另行還原原值，見第 7 節） */
  --stamp-acc:var(--fx-navy); --stamp-acc-light:var(--fx-acc-bg); --stamp-bg:var(--fx-card2); --stamp-card:var(--fx-card);
  --stamp-border:var(--fx-line); --stamp-muted:var(--fx-muted);
  --stamp-ok:var(--fx-ok); --stamp-ok-bg:var(--fx-ok-bg); --stamp-err:var(--fx-err); --stamp-err-bg:var(--fx-err-bg);
}

/* ── 2. token（深色）：近黑藍底＋金，覆寫同名 token 即可整頁換色 ── */
html[data-rex-theme="dark"]{
  --fx-paper:#06121b; --fx-card:#0c2030; --fx-card2:#0a1b29; --fx-card3:#112b3f;
  --fx-line:rgba(232,160,32,.24); --fx-line2:rgba(255,255,255,.09); --fx-inb:rgba(255,255,255,.2); --fx-field:#071826;
  --fx-text:#e4eaf0; --fx-muted:#a9b7c5; --fx-soft:#91a3b4; --fx-hd:#f3e7c6;
  --fx-acc-ink:#f0c36a; --fx-acc-bg:rgba(232,160,32,.14); --fx-acc-line:rgba(232,160,32,.45);
  --fx-gold-ink:#f0b94a;
  --fx-ok:#5fd3a6; --fx-ok-bg:rgba(29,158,117,.18); --fx-err:#fca5a5; --fx-err-bg:rgba(239,68,68,.16); --fx-warn-bg:rgba(250,204,21,.12); --fx-warn-ink:#fcd34d;
  --fx-sky:#7dd3fc; --fx-sky-bg:rgba(56,189,248,.14);
  --fx-dis-bg:rgba(255,255,255,.06); --fx-dis-ink:rgba(243,231,198,.5); --fx-dis-line:rgba(232,160,32,.32);
  --fx-shadow:0 18px 40px -26px rgba(0,0,0,.85);
  --fx-shadow-sm:0 8px 22px -18px rgba(0,0,0,.8);
  color-scheme:dark;
}

/* ── 3. 基礎：底色、字型、連結、選取、捲軸 ── */
html body{background:var(--fx-paper)!important;color:var(--fx-text);font-family:var(--fx-sans);line-height:1.65;-webkit-font-smoothing:antialiased}
html,body{max-width:100%}
body.embed-mode{background:var(--fx-paper)!important}
body ::selection{background:rgba(232,160,32,.35)}
body a{color:inherit}
body h1,body h2,body h3{color:var(--fx-hd)}
html{scrollbar-color:rgba(232,160,32,.45) transparent}
.fx-serif{font-family:var(--fx-serif);letter-spacing:.04em}
.fx-kick{display:inline-flex;align-items:center;gap:12px;color:var(--fx-gold-ink);font-weight:800;font-size:12.5px;letter-spacing:.3em}
.fx-kick::before,.fx-kick::after{content:"";width:30px;height:1px;background:var(--fx-gold)}
.fx-kick.l::after{display:none}
@media (prefers-reduced-motion:reduce){body *{transition:none!important;animation:none!important}}

/* ── 4. 頁首 #topnav：直接美化各頁原本的頁首 HTML（含行內寫死色），深藍滿版帶＋細金線；
      目前頁用 .fx-cur 或 [aria-current=page]（舊頁行內 color:#4f46e5 也視為目前頁）。
      右側 ≥108px 讓功能膠囊；手機改單行橫滑，整條導覽停在膠囊左邊 ── */
html body #topnav{
  position:relative;box-sizing:border-box;max-width:1180px!important;margin:0 auto!important;
  padding:10px clamp(24px,calc(108px - (100vw - 1180px) / 2),108px) 10px 20px!important;min-height:var(--fx-nav-h);
  display:flex!important;align-items:center;justify-content:flex-start!important;flex-wrap:wrap;gap:4px 4px;
  font-size:14px;line-height:1.6;color:#aebdca;background:transparent!important;
  /* 滿版深藍帶＋底部金線：border-image 外擴繪製，不產生橫向捲動 */
  border-width:0!important;
  border-image:linear-gradient(180deg,#0c2b3e 0%,#0a2334 calc(100% - 1px),rgba(232,160,32,.7) calc(100% - 1px)) fill 0 / 0 / 0 100vmax;
}
html body #topnav a{color:#cbd7e1!important;text-decoration:none!important;white-space:nowrap;display:inline-flex;align-items:center;min-height:38px;padding:0 10px;border-radius:999px;font-weight:500!important;font-size:inherit!important;transition:background .15s,color .15s}
html body #topnav a:hover{background:rgba(232,160,32,.14);color:var(--fx-gold-hi)!important}
html body #topnav a:focus-visible{outline:2px solid var(--fx-gold);outline-offset:2px}
html body #topnav a.fx-cur,html body #topnav a[aria-current="page"],html body #topnav a[style*="4f46e5" i]{color:var(--fx-on-gold)!important;background:linear-gradient(135deg,#ffd75a,var(--fx-gold));font-weight:800!important}
html body #topnav .fx-sep,html body #topnav span[style*="cbd5e1" i]{color:rgba(232,160,32,.55)!important;margin:0 2px!important}
html body #topnav>span:not(.fx-sep):not(.fx-brand):not([style]){display:flex;flex-wrap:wrap;align-items:center;gap:4px}
.fx-brand{display:inline-flex;align-items:center;gap:8px;flex:0 0 auto;color:#fff;font-family:var(--fx-serif);font-weight:700;letter-spacing:.16em;font-size:15px;margin-right:8px;padding-right:12px;border-right:1px solid rgba(232,160,32,.4);text-decoration:none;white-space:nowrap}
.fx-brand svg{width:26px;height:26px;flex:0 0 26px}
html body #topnav [style*="color:#64748b" i]{color:#cbd7e1!important}

/* ── 5. 卡片／區塊：card-soft、bg-white 卡、說明框、橫幅 ── */
body .card-soft{border-radius:16px;border:1px solid var(--fx-line)!important;background:var(--fx-card);box-shadow:var(--fx-shadow)}
body .blk-sep{border-top-color:var(--fx-line2)}
.fx-card{background:var(--fx-card);border:1px solid var(--fx-line);border-radius:16px;box-shadow:var(--fx-shadow);position:relative}
body .shadow-sm,body .shadow,body .shadow-md{box-shadow:var(--fx-shadow-sm)}
body .rounded-xl.border,body .rounded-2xl.border{border-color:var(--fx-line)}
html body #appHeader h1{font-family:var(--fx-serif);color:var(--fx-hd);letter-spacing:.04em;font-size:24px;font-weight:700}
html body #appHeader p{color:var(--fx-muted);font-size:13.5px}
html body #appHeader>div:first-child:not(:only-child){background:linear-gradient(145deg,var(--fx-navy2),var(--fx-navy-deep))!important;color:var(--fx-gold)!important;border:1px solid rgba(232,160,32,.55);border-radius:12px;width:44px;height:44px;flex:0 0 44px;box-shadow:0 10px 22px -14px rgba(10,35,52,.8)}
.fx-intro{display:flex;align-items:flex-start;gap:12px;padding:14px 18px;margin-bottom:16px;border-radius:14px;background:var(--fx-acc-bg);border:1px solid var(--fx-acc-line);color:var(--fx-text);font-size:13px;line-height:1.7}
.fx-intro .fx-i{flex:0 0 22px;width:22px;height:22px;border-radius:50%;background:var(--fx-navy);color:var(--fx-gold-soft);border:1px solid var(--fx-gold);font-family:var(--fx-serif);font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;margin-top:1px}
html[data-rex-theme="dark"] .fx-intro .fx-i{background:var(--fx-gold);color:var(--fx-on-gold)}
.fx-intro b{color:var(--fx-hd)}
.fx-promo{display:flex;align-items:center;gap:14px;padding:14px 18px;margin-bottom:16px;border-radius:14px;text-decoration:none;color:#f3e7c6;background:linear-gradient(135deg,var(--fx-navy2),var(--fx-navy-deep));border:1px solid rgba(232,160,32,.5);box-shadow:0 14px 30px -20px rgba(10,35,52,.9);transition:transform .15s,box-shadow .15s}
.fx-promo:hover{transform:translateY(-2px);box-shadow:0 18px 34px -18px rgba(10,35,52,1)}
.fx-promo .fx-promo-ic{flex:0 0 44px;width:44px;height:44px;border-radius:50%;border:1px solid rgba(232,160,32,.6);background:rgba(232,160,32,.1);display:grid;place-items:center;font-size:20px}
.fx-promo b{display:block;font-size:14px;color:#fff}
.fx-promo .fx-promo-d{display:block;font-size:12px;color:#a9bccd;margin-top:2px}
.fx-promo .fx-promo-go{flex:0 0 auto;font-size:13px;font-weight:800;color:var(--fx-on-gold);background:linear-gradient(135deg,#ffd75a,var(--fx-gold));padding:9px 16px;border-radius:999px;min-height:40px;display:inline-flex;align-items:center}
html body footer,html body #footerNote{color:var(--fx-soft)}
html body #footerNote.bg-white{background:var(--fx-card);border-color:var(--fx-line)}
body footer a{color:var(--fx-soft)}

/* ── 6. 按鈕：mini-btn、cta-main（含 :disabled）、vtab、深色實心鈕、各色文字連結鈕 ── */
body .mini-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-size:13px;font-weight:700;min-height:40px;height:auto;padding:0 14px;border-radius:999px;border:1px solid var(--fx-acc-line);background:var(--fx-card);color:var(--fx-acc-ink);cursor:pointer;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s,transform .15s}
body .mini-btn:hover{background:var(--fx-acc-bg);border-color:var(--fx-gold);transform:translateY(-1px)}
body .cta-main{background:linear-gradient(135deg,#ffd75a,var(--fx-gold))!important;color:var(--fx-on-gold)!important;border:1px solid var(--fx-gold);border-radius:999px;padding:15px 22px;min-height:52px;font-weight:800;letter-spacing:.04em;box-shadow:0 10px 24px -12px rgba(232,160,32,.85);transition:transform .15s,box-shadow .15s}
body .cta-main:not(:disabled):hover{background:linear-gradient(135deg,#ffe28a,#f0a82a)!important;transform:translateY(-2px);box-shadow:0 14px 28px -12px rgba(232,160,32,.95)}
body .cta-main:disabled,body .cta-main[disabled]{background:var(--fx-dis-bg)!important;color:var(--fx-dis-ink)!important;border:1px dashed var(--fx-dis-line);box-shadow:none;opacity:1!important;cursor:not-allowed}
body button.bg-gray-900,body .bg-gray-900.text-white,body button.bg-indigo-600,body a.bg-indigo-600{background:var(--fx-navy);color:#f3e7c6;border:1px solid rgba(232,160,32,.45)}
body .hover\:bg-gray-700:hover,body .hover\:bg-indigo-700:hover{background-color:var(--fx-navy3)}
body button:disabled{cursor:not-allowed}
body #viewTabs{border-bottom:1px solid var(--fx-line);gap:4px}
body .vtab{min-height:44px;font-family:var(--fx-sans);font-weight:700;color:var(--fx-muted);border-bottom:3px solid transparent;border-radius:10px 10px 0 0;padding:9px 16px}
body .vtab:hover{color:var(--fx-acc-ink);background:var(--fx-acc-bg)}
body .vtab.on{color:var(--fx-hd);border-bottom-color:var(--fx-gold);background:linear-gradient(180deg,transparent,var(--fx-acc-bg))}
body button.text-indigo-600,body a.text-indigo-600,body button.text-emerald-600,body a.text-emerald-600{font-weight:700}

/* ── 7. 表單欄位：input／select／textarea（含 app.js 動態長出來的）、acc-hd／acc-bd、co-card、completion-status；
      .pg-wrap 只還原原版變數值，內部一律不碰 ── */
body input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),body select,body textarea{font-family:inherit;color:var(--fx-text);background-color:var(--fx-field);border-color:var(--fx-inb);border-radius:10px}
body input::placeholder,body textarea::placeholder{color:var(--fx-soft);opacity:1}
body input:not([type=checkbox]):not([type=radio]):focus,body select:focus,body textarea:focus{outline:none;border-color:var(--fx-gold)!important;box-shadow:0 0 0 3px rgba(232,160,32,.22)!important;background-color:var(--fx-field)}
body .bg-gray-50.border,body input.bg-gray-50,body select.bg-gray-50,body textarea.bg-gray-50{background-color:var(--fx-field)}
body label{color:inherit}
body input[type=file]{color:var(--fx-muted)}
body .accent-indigo-600,body input[type=checkbox],body input[type=radio]{accent-color:var(--fx-gold)}
body .acc-hd{background:var(--fx-card2);border:1px solid var(--fx-line2);border-left:3px solid var(--fx-gold);border-radius:10px;padding:10px 14px;min-height:44px}
body .acc-hd:hover{background:var(--fx-acc-bg)}
body .acc-hd .chev{color:var(--fx-gold-ink)}
body .acc-hd .text-indigo-700,body .acc-hd>span{color:var(--fx-hd)}
body .acc-hd .text-gray-400,body .acc-hd .text-\[11px\]{color:var(--fx-soft)}
body .addr-mod{background:var(--fx-card2);border-color:var(--fx-line2)}
body .addr-mod input{background:var(--fx-field)}
body .co-sub{background:var(--fx-card2)}
body .co-sub:focus{background:var(--fx-field)}
body #coGrid>label.co-card{border:1px solid var(--fx-line);border-radius:12px;min-height:46px;background-color:var(--fx-card);color:var(--fx-text)}
body #coGrid>label.co-card.bg-gray-50{background-color:var(--fx-card2);color:var(--fx-soft)}
body #coGrid>label.co-card:hover{border-color:var(--fx-gold);box-shadow:0 6px 16px -10px rgba(232,160,32,.7)}
body #coGrid>label.co-card.co-on{background:var(--fx-acc-bg);border-color:var(--fx-gold);box-shadow:0 8px 20px -12px rgba(232,160,32,.8)}
body #coGrid>.col-span-2{color:var(--fx-gold-ink);letter-spacing:.08em}
body .pill-ok{background:var(--fx-ok-bg);color:var(--fx-ok);border:1px solid rgba(29,122,92,.25)}
body .co-logo{background:#fff;padding:1px}
body .completion-status{background:var(--fx-card2);border:1px solid var(--fx-line2);border-radius:12px}
body .cs-item{background:var(--fx-card3);color:var(--fx-soft)}
body .cs-item.done{background:var(--fx-ok-bg);color:var(--fx-ok);box-shadow:0 0 0 1px rgba(29,122,92,.35)}
body .cs-note{color:var(--fx-muted)}
body .cta-wrap{background:var(--fx-card);box-shadow:0 -12px 18px -8px var(--fx-card)}
body .pal-sticky{background:var(--fx-card);border-bottom:1px solid var(--fx-line);box-shadow:0 8px 14px -12px rgba(0,0,0,.4)}
body .armed{outline-color:var(--fx-gold)}
body #view-docs iframe{background:var(--fx-card);border:1px solid var(--fx-line);box-shadow:var(--fx-shadow)}
body #batchHint{color:var(--fx-muted)!important}
body .ci-sec,body .ci-grp{color:var(--fx-text)}
body #pdfEmpty{color:var(--fx-soft)}
/* PDF 預覽：.pg-wrap 內還原原版變數與白紙底，深淺都一樣（標記 .mk 系列樣式完全由原頁決定） */
body .pg-wrap{--stamp-acc:#4f46e5;--stamp-acc-light:#e0e7ff;--stamp-bg:#f8fafc;--stamp-card:#fff;--stamp-border:#e2e8f0;--stamp-muted:#64748b;--stamp-ok:#166534;--stamp-ok-bg:#dcfce7;--stamp-err:#dc2626;--stamp-err-bg:#fee2e2;background:#fff;color-scheme:light}

/* ── 8. Tailwind 色彩重新上色：先淺色（token 化，深色自動跟著換），再補深色專屬 ── */
body .bg-white{background-color:var(--fx-card)}
body .bg-gray-50,body .bg-gray-100,body .bg-slate-50,body .bg-slate-100{background-color:var(--fx-card2)}
body .bg-gray-200,body .bg-slate-200{background-color:var(--fx-card3)}
body .bg-gray-900,body .bg-slate-900,body .bg-slate-800{background-color:var(--fx-navy)}
body .hover\:bg-gray-50:hover,body .hover\:bg-gray-100:hover,body .hover\:bg-slate-50:hover,body .hover\:bg-slate-100:hover{background-color:var(--fx-card3)}
body .bg-indigo-50,body .bg-indigo-50\/40,body .bg-indigo-100,body .bg-blue-50{background-color:var(--fx-acc-bg)}
body .hover\:bg-indigo-50:hover,body .hover\:bg-indigo-100:hover,body .hover\:bg-blue-50:hover{background-color:var(--fx-acc-bg)}
body .bg-indigo-600,body .bg-blue-600{background-color:var(--fx-navy)}
body .bg-amber-50,body .bg-amber-100,body .bg-yellow-50{background-color:var(--fx-warn-bg)}
body .hover\:bg-amber-100:hover,body .hover\:bg-amber-50:hover{background-color:var(--fx-warn-bg);filter:brightness(.97)}
body .bg-emerald-50,body .bg-emerald-100,body .bg-green-50{background-color:var(--fx-ok-bg)}
body .bg-sky-50,body .bg-sky-100{background-color:var(--fx-sky-bg)}
body .bg-red-50,body .bg-red-100{background-color:var(--fx-err-bg)}
body .hover\:bg-red-50:hover{background-color:var(--fx-err-bg)}
body .text-gray-900,body .text-gray-800,body .text-slate-900,body .text-slate-800{color:var(--fx-hd)}
body .text-gray-700,body .text-gray-600,body .text-slate-700,body .text-slate-600{color:var(--fx-text)}
body .text-gray-500,body .text-slate-500{color:var(--fx-muted)}
body .text-gray-400,body .text-gray-300,body .text-slate-400{color:var(--fx-soft)}
body .text-gray-200,body .text-slate-200,body .text-slate-300{color:var(--fx-line)}
body .hover\:text-gray-900:hover,body .hover\:text-gray-800:hover,body .hover\:text-gray-700:hover,body .hover\:text-gray-600:hover{color:var(--fx-hd)}
body .text-indigo-400,body .text-indigo-500,body .text-indigo-600,body .text-indigo-700,body .text-indigo-800,body .text-blue-500,body .text-blue-600,body .text-blue-700{color:var(--fx-acc-ink)}
body .text-indigo-600,body .text-indigo-700{font-weight:700}
body .text-emerald-500,body .text-emerald-600,body .text-emerald-700,body .text-emerald-800,body .text-emerald-900,body .text-green-600,body .text-green-700{color:var(--fx-ok)}
body .text-sky-500,body .text-sky-600,body .text-sky-700,body .text-sky-800,body .text-sky-900{color:var(--fx-sky)}
body .text-amber-600,body .text-amber-700,body .text-amber-800,body .text-amber-900{color:var(--fx-warn-ink)}
body .text-red-500,body .text-red-600,body .text-red-700,body .hover\:text-red-500:hover{color:var(--fx-err)}
body .border,body .border-t,body .border-b,body .border-l,body .border-r,body .border-2{border-color:var(--fx-line)}
body .border-gray-100,body .border-gray-200,body .border-gray-300,body .border-slate-100,body .border-slate-200,body .border-slate-300{border-color:var(--fx-line)}
body .border-indigo-100,body .border-indigo-200,body .border-indigo-300,body .border-blue-200{border-color:var(--fx-acc-line)}
body .border-amber-200,body .border-amber-300{border-color:#e0b24f}
body .border-red-200,body .border-red-300,body .border-red-400{border-color:rgba(179,38,30,.45)}
body .border-emerald-200,body .border-emerald-300{border-color:rgba(29,122,92,.5)}
body .border-sky-200,body .border-sky-300{border-color:rgba(11,93,134,.4)}
body .hover\:border-indigo-400:hover,body .focus\:border-indigo-400:focus{border-color:var(--fx-gold)}
body .divide-gray-100>*+*,body .divide-gray-200>*+*{border-color:var(--fx-line2)}
body .ring-indigo-200,body .ring-indigo-300{--tw-ring-color:var(--fx-acc-line)}
/* 深色專屬：深色下需要更亮或更透的色 */
html[data-rex-theme="dark"] body .bg-gray-900,html[data-rex-theme="dark"] body .bg-slate-900{background-color:#06121b}
html[data-rex-theme="dark"] body .bg-indigo-600,html[data-rex-theme="dark"] body .bg-blue-600,html[data-rex-theme="dark"] body button.bg-indigo-600{background-color:var(--fx-navy3);color:#f3e7c6;border-color:rgba(232,160,32,.55)}
html[data-rex-theme="dark"] body .border,html[data-rex-theme="dark"] body .border-t,html[data-rex-theme="dark"] body .border-b{border-color:var(--fx-line2)}
html[data-rex-theme="dark"] body .text-gray-200,html[data-rex-theme="dark"] body .text-slate-200{color:rgba(255,255,255,.22)}
html[data-rex-theme="dark"] body .border-amber-200,html[data-rex-theme="dark"] body .border-amber-300{border-color:rgba(250,204,21,.5)}
html[data-rex-theme="dark"] body .border-red-200,html[data-rex-theme="dark"] body .border-red-300,html[data-rex-theme="dark"] body .border-red-400{border-color:rgba(252,165,165,.45)}
html[data-rex-theme="dark"] body .border-emerald-200,html[data-rex-theme="dark"] body .border-emerald-300{border-color:rgba(95,211,166,.45)}
html[data-rex-theme="dark"] body .border-sky-200,html[data-rex-theme="dark"] body .border-sky-300{border-color:rgba(125,211,252,.4)}
html[data-rex-theme="dark"] body .border-gray-100,html[data-rex-theme="dark"] body .border-gray-200,html[data-rex-theme="dark"] body .border-gray-300{border-color:rgba(255,255,255,.14)}
html[data-rex-theme="dark"] body .border-indigo-100,html[data-rex-theme="dark"] body .border-indigo-200,html[data-rex-theme="dark"] body .border-indigo-300{border-color:var(--fx-acc-line)}
html[data-rex-theme="dark"] body .bg-gray-100.border{background-color:var(--fx-card2)!important;border-color:var(--fx-line)!important}
html[data-rex-theme="dark"] body .acc-hd{background:var(--fx-card2)}
html[data-rex-theme="dark"] body #coGrid>label.co-card{background-color:var(--fx-card2)}
html[data-rex-theme="dark"] body #coGrid>label.co-card.bg-white{background-color:var(--fx-card);color:var(--fx-text)}
html[data-rex-theme="dark"] body #coGrid>label.co-card.co-on{background:var(--fx-acc-bg)}
html[data-rex-theme="dark"] body #pdfPages{background:transparent}

/* ── 9. 行內寫死色修補（深色）：app.js／舊頁用 style="" 寫死的淺底與深字；一律排除 .pg-wrap 內與功能膠囊 ── */
html[data-rex-theme="dark"] body :is([style*="background:#fff" i],[style*="background: #fff" i],[style*="background-color:#fff" i],[style*="background-color: #fff" i],
  [style*="background: rgb(255, 255, 255)"],[style*="background-color: rgb(255, 255, 255)"],
  [style*="background:#fffbeb" i],[style*="background: rgb(255, 251, 235)"],[style*="background:#fef3c7" i],[style*="background: rgb(254, 243, 199)"],
  [style*="background:#fefce8" i],[style*="background:#fff7ed" i])
  :not(.pg-wrap):not(.pg-wrap *):not(#rex-topbar *):not(.rex-pop *){background:var(--fx-card)!important;color:var(--fx-text)!important;border-color:var(--fx-acc-line)!important}
html[data-rex-theme="dark"] body :is([style*="background:#F1F5F9" i],[style*="background: #F1F5F9" i],[style*="background: rgb(241, 245, 249)"],
  [style*="background:#F8FAFC" i],[style*="background: #F8FAFC" i],[style*="background: rgb(248, 250, 252)"],[style*="background:#f9fafb" i],[style*="background:#f3f4f6" i],
  [style*="background:#eef2ff" i],[style*="background: rgb(238, 242, 255)"],[style*="background:#e0e7ff" i],[style*="background:#f5f3ff" i],
  [style*="background:#EFF6FF" i],[style*="background: #EFF6FF" i],[style*="background: rgb(239, 246, 255)"],[style*="background:#dbeafe" i],
  [style*="background:#f0fdf4" i],[style*="background:#ecfdf5" i],[style*="background:#fef2f2" i],[style*="background:#fee2e2" i],[style*="background:#e2e8f0" i])
  :not(.pg-wrap):not(.pg-wrap *):not(#rex-topbar *):not(.rex-pop *){background:var(--fx-card2)!important;color:var(--fx-text)!important}
html[data-rex-theme="dark"] body :is([style*="color:#475569" i],[style*="color: rgb(71, 85, 105)"],[style*="color:#1e293b" i],[style*="color: rgb(30, 41, 59)"],
  [style*="color:#334155" i],[style*="color:#0f172a" i],[style*="color:#111827" i],[style*="color:#374151" i],[style*="color:#0a2334" i],[style*="color:#001840" i])
  :not(.pg-wrap *):not(#rex-topbar *):not(.rex-pop *){color:var(--fx-text)!important}
html[data-rex-theme="dark"] body :is([style*="color:#64748b" i],[style*="color: rgb(100, 116, 139)"],[style*="color:#94a3b8" i],[style*="color: rgb(148, 163, 184)"],[style*="color:#6b7280" i],[style*="color:#9ca3af" i])
  :not(.pg-wrap *):not(#rex-topbar *):not(.rex-pop *){color:var(--fx-muted)!important}
html[data-rex-theme="dark"] body :is([style*="color:#4f46e5" i],[style*="color:#4338ca" i],[style*="color:#2563eb" i],[style*="color:#1d4ed8" i])
  :not(.pg-wrap *):not(#rex-topbar *):not(.rex-pop *):not(#topnav *){color:var(--fx-acc-ink)!important}
html[data-rex-theme="dark"] body :is([style*="border:1px solid #e2e8f0" i],[style*="border:1px solid #cbd5e1" i],[style*="border-color:#e2e8f0" i])
  :not(.pg-wrap *):not(#rex-topbar *):not(.rex-pop *){border-color:var(--fx-line2)!important}

/* ── 10. 入口頁專用（.fx-*，只有 /rex/forms/ 用；hub.js 產生的元素也在這裡上色） ── */
.fx-hero{position:relative;overflow:hidden;isolation:isolate;color:#fff;background:linear-gradient(165deg,#0a2334 0%,#061726 62%,#040f1c 100%);border-bottom:1px solid rgba(232,160,32,.4)}
.fx-hero-bg{position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(700px 420px at 8% 0%,rgba(232,160,32,.18),transparent 65%),radial-gradient(620px 500px at 96% 100%,rgba(232,160,32,.12),transparent 62%),
    repeating-linear-gradient(0deg,rgba(232,160,32,.05) 0 1px,transparent 1px 56px),repeating-linear-gradient(90deg,rgba(232,160,32,.05) 0 1px,transparent 1px 56px)}
.fx-hero-bg::after{content:"";position:absolute;inset:0;background:repeating-radial-gradient(circle at 82% 38%,transparent 0 56px,rgba(255,215,0,.07) 57px 58px);-webkit-mask-image:radial-gradient(circle at 82% 38%,#000,transparent 68%);mask-image:radial-gradient(circle at 82% 38%,#000,transparent 68%)}
.fx-hero-in{max-width:1180px;margin:0 auto;padding:20px 20px 46px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:40px;align-items:center}
.fx-hero .fx-kick{color:var(--fx-gold)}
.fx-hero h1{font-family:var(--fx-serif);font-size:clamp(26px,3.1vw,38px);font-weight:700;line-height:1.25;letter-spacing:.03em;color:#fff;margin:10px 0 0}
.fx-hero h1 .hl{background:linear-gradient(120deg,#ffe28a,var(--fx-gold));-webkit-background-clip:text;background-clip:text;color:transparent}
.fx-hero .fx-lead{max-width:560px;margin-top:12px;font-size:clamp(13.5px,1.3vw,15px);line-height:1.7;color:#b9c7d4;padding-left:14px;border-left:1px solid rgba(232,160,32,.6)}
.fx-stats{list-style:none;margin:0;padding:0;display:grid;border-top:1px solid rgba(232,160,32,.28)}
.fx-stats li{display:flex;gap:14px;align-items:center;padding:10px 0;border-bottom:1px solid rgba(232,160,32,.18)}
.fx-stats .fx-ti{flex:0 0 40px;width:40px;height:40px;border-radius:50%;border:1px solid rgba(232,160,32,.6);background:rgba(232,160,32,.08);display:grid;place-items:center}
.fx-stats .fx-ti svg{width:20px;height:20px;stroke:var(--fx-gold);fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.fx-stats b{display:block;font-size:14.5px;color:#fff;font-weight:700}
.fx-stats span.fx-td{display:block;font-size:12.5px;color:#a9bccd;line-height:1.5}

/* 搜尋台：壓在主視覺下緣 */
.fx-find{max-width:1180px;margin:-30px auto 0;padding:0 20px;position:relative;z-index:3}
.fx-find-box{background:var(--fx-card);border:1px solid var(--fx-line);border-top:3px solid var(--fx-gold);border-radius:18px;box-shadow:0 30px 60px -34px rgba(0,0,0,.7);padding:14px 18px 12px}
html[data-rex-theme="dark"] .fx-find-box{box-shadow:0 30px 60px -30px rgba(0,0,0,.9)}
.fx-search{display:flex;align-items:center;gap:10px;background:var(--fx-field);border:1.5px solid var(--fx-inb);border-radius:14px;padding:0 6px 0 14px;min-height:54px;transition:border-color .15s,box-shadow .15s}
.fx-search:focus-within{border-color:var(--fx-gold);box-shadow:0 0 0 3px rgba(232,160,32,.22)}
.fx-search svg{width:20px;height:20px;flex:0 0 20px;stroke:var(--fx-gold-ink);fill:none;stroke-width:1.8;stroke-linecap:round}
html body .fx-search input{flex:1;min-width:0;border:0!important;box-shadow:none!important;background:transparent!important;font-size:16px;min-height:50px;padding:0 4px;color:var(--fx-text);outline:none}
.fx-kbd{font-family:inherit;font-size:12px;color:var(--fx-soft);border:1px solid var(--fx-line);border-radius:6px;padding:1px 7px;background:var(--fx-card2)}
.fx-clear{min-height:44px;min-width:44px;border:0;background:transparent;color:var(--fx-muted);font-size:13px;font-weight:700;cursor:pointer;border-radius:10px;padding:0 12px;font-family:inherit}
.fx-clear:hover{color:var(--fx-hd);background:var(--fx-acc-bg)}
.fx-clear[hidden],.fx-results[hidden],#fxPinnedWrap[hidden],#fxNoCard[hidden]{display:none}
.fx-filters{display:flex;flex-wrap:wrap;align-items:center;gap:8px 8px;margin-top:10px}
.fx-chips,.fx-tags{display:flex;flex-wrap:wrap;gap:8px}
.fx-vr{width:1px;align-self:stretch;margin:6px 4px;background:var(--fx-line)}
.fx-chip{font-family:inherit;font-size:13.5px;font-weight:700;min-height:44px;padding:0 16px;border-radius:999px;border:1px solid var(--fx-line);background:var(--fx-card);color:var(--fx-muted);cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,color .15s}
.fx-chip:hover{border-color:var(--fx-gold);color:var(--fx-hd)}
.fx-chip.on{background:linear-gradient(135deg,var(--fx-navy2),var(--fx-navy));color:var(--fx-gold-soft);border-color:var(--fx-gold)}
html[data-rex-theme="dark"] .fx-chip.on{background:linear-gradient(135deg,#ffd75a,var(--fx-gold));color:var(--fx-on-gold);border-color:var(--fx-gold)}
.fx-tags .fx-chip{min-height:38px;font-size:12.5px;padding:0 13px;font-weight:600}
.fx-more{display:none;align-items:center;gap:6px;min-height:44px;padding:0 14px;border-radius:999px;border:1px dashed var(--fx-acc-line);color:var(--fx-gold-ink);font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap;user-select:none}
.fx-more .fx-more-on{display:none}
.fx-tog{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}
.fx-find-box:has(#fxMoreTags:checked) .fx-more .fx-more-on{display:inline}
.fx-find-box:has(#fxMoreTags:checked) .fx-more .fx-more-off{display:none}

/* 保險公司圓章：hub.js 在 #fxCos 長出 .fx-chip[data-k=co]，文字是簡稱（去「人壽」，產物保留），做成深藍金邊雙圈章 */
.fx-cos-hd{display:flex;align-items:baseline;gap:10px;margin:12px 0 6px;font-size:12.5px;font-weight:800;color:var(--fx-hd);letter-spacing:.08em}
.fx-cos-hd span{font-weight:500;color:var(--fx-muted);letter-spacing:0}
.fx-cos{display:flex;flex-wrap:wrap;gap:8px;padding:4px 2px;max-height:none;overflow:hidden}
#fxCos .fx-chip{flex:0 0 auto;width:60px;height:60px;min-height:0;padding:0 14px;border-radius:50%;display:flex;align-items:center;justify-content:center;text-align:center;
  font-family:var(--fx-serif);font-size:13px;font-weight:700;line-height:1.12;letter-spacing:.02em;white-space:normal;word-break:break-all;
  background:radial-gradient(circle at 50% 35%,var(--fx-navy3),var(--fx-navy) 70%);color:var(--fx-gold-soft);border:1px solid var(--fx-gold);
  box-shadow:inset 0 0 0 3px var(--fx-navy),inset 0 0 0 4px rgba(232,160,32,.75),0 6px 14px -10px rgba(10,35,52,.9);transition:transform .15s,box-shadow .15s}
#fxCos .fx-chip:hover{transform:translateY(-2px);color:#fff}
#fxCos .fx-chip[data-v$="產物"]{color:#ffd9a0}
#fxCos .fx-chip[data-v=""]{background:var(--fx-card);color:var(--fx-gold-ink);box-shadow:inset 0 0 0 3px var(--fx-card),inset 0 0 0 4px var(--fx-acc-line)}
#fxCos .fx-chip.on{background:linear-gradient(135deg,#ffd75a,var(--fx-gold));color:var(--fx-on-gold);border-color:#c98a12;
  box-shadow:inset 0 0 0 3px #ffd75a,inset 0 0 0 4px rgba(58,44,0,.45),0 0 0 3px rgba(232,160,32,.35)}
.fx-cos-more{display:none;align-items:center;justify-content:center;min-height:40px;margin-top:6px;padding:0 14px;border-radius:999px;font-size:12.5px;font-weight:700;color:var(--fx-gold-ink);border:1px dashed var(--fx-acc-line);cursor:pointer;user-select:none}
.fx-cos-more .fx-more-on{display:none}
@media (min-width:641px) and (max-width:980px){
  .fx-find-box:not(:has(#fxMoreCos:checked)) .fx-cos{max-height:136px}
  .fx-cos-more{display:inline-flex}
  .fx-find-box:has(#fxMoreCos:checked) .fx-cos-more .fx-more-on{display:inline}
  .fx-find-box:has(#fxMoreCos:checked) .fx-cos-more .fx-more-off{display:none}
}

/* 搜尋結果：單欄密排清單（縮圖 66×94＋表單名＋工具籤＋公司＋開啟 →） */
.fx-results{max-width:1180px;margin:14px auto 0;padding:0 20px}
.fx-res-hd{font-size:13.5px;color:var(--fx-muted);margin:0 2px 8px;letter-spacing:.02em}
.fx-res-hd b{font-family:var(--fx-serif);font-size:22px;color:var(--fx-hd);margin-right:4px}
.fx-res-list{display:flex;flex-direction:column;background:var(--fx-card);border:1px solid var(--fx-line);border-radius:16px;overflow:hidden;box-shadow:var(--fx-shadow)}
.fx-hit{display:flex;gap:16px;align-items:center;padding:10px 18px;text-decoration:none;color:inherit;min-height:114px;border-top:1px solid var(--fx-line2);transition:background .15s}
.fx-hit:first-child{border-top:0}
.fx-hit:hover,.fx-hit:focus-visible{background:var(--fx-acc-bg);outline:none}
.fx-th{flex:0 0 66px;width:66px;height:94px;object-fit:cover;object-position:top;border-radius:4px;border:1px solid var(--fx-line);background:#fff;box-shadow:0 6px 14px -8px rgba(0,0,0,.5)}
html[data-rex-theme="dark"] .fx-th{border-color:rgba(255,255,255,.18)}
.fx-th-none{display:block;position:relative;overflow:hidden;background:#fffdf8;
  background-image:linear-gradient(225deg,#e8dcc0 0 12px,transparent 12px),repeating-linear-gradient(0deg,transparent 0 9px,rgba(10,35,52,.1) 9px 10px);background-size:100% 100%,70% 60%;background-position:0 0,50% 80%;background-repeat:no-repeat}
.fx-th-none::after{content:"PDF";position:absolute;left:50%;top:26px;transform:translateX(-50%);font-size:11px;font-weight:900;letter-spacing:.1em;color:#fff;background:var(--fx-gold);border-radius:3px;padding:1px 6px;line-height:1.5}
.fx-hit-b{flex:1;min-width:0;display:block}
.fx-hit-n{display:block;font-size:15px;font-weight:700;color:var(--fx-hd);line-height:1.45}
.fx-hit-m{display:flex;flex-wrap:wrap;gap:6px 8px;margin-top:6px;align-items:center}
.fx-tag{display:inline-block;font-size:11.5px;font-weight:700;padding:2px 10px;border-radius:999px;background:var(--fx-acc-bg);color:var(--fx-gold-ink);border:1px solid var(--fx-acc-line)}
.fx-hit-co{font-size:12.5px;color:var(--fx-muted)}
.fx-hit-go{flex:0 0 auto;display:inline-flex;align-items:center;min-height:36px;padding:0 14px;border-radius:999px;font-size:13px;font-weight:800;color:var(--fx-acc-ink);border:1px solid var(--fx-acc-line);background:var(--fx-card)}
.fx-hit:hover .fx-hit-go{background:linear-gradient(135deg,#ffd75a,var(--fx-gold));color:var(--fx-on-gold);border-color:var(--fx-gold)}
.fx-empty{padding:28px 18px;text-align:center;color:var(--fx-muted);background:var(--fx-card);border:1px dashed var(--fx-acc-line);border-radius:14px;font-size:14px}

/* 常用列 */
.fx-pinned-wrap{margin-bottom:6px}
.fx-pinned{display:flex;flex-wrap:wrap;gap:10px}
.fx-pinned-i{display:inline-flex;align-items:center;gap:10px;min-height:48px;padding:0 18px 0 8px;border-radius:999px;background:var(--fx-card);border:1px solid var(--fx-line);text-decoration:none;color:var(--fx-hd);font-weight:700;font-size:14px;transition:.15s}
.fx-pinned-i:hover{border-color:var(--fx-gold);transform:translateY(-1px)}
.fx-pinned-k{font-size:11px;font-weight:800;letter-spacing:.1em;padding:3px 10px;border-radius:999px;background:var(--fx-acc-bg);color:var(--fx-gold-ink);border:1px solid var(--fx-acc-line)}
.fx-pinned-i.is-pin .fx-pinned-k{background:linear-gradient(135deg,#ffd75a,var(--fx-gold));color:var(--fx-on-gold);border-color:var(--fx-gold)}

/* 區塊標題 */
.fx-main{max-width:1180px;margin:0 auto;padding:14px 20px 24px}
.fx-sec{margin-top:30px}
.fx-sec-hd{display:flex;align-items:center;gap:14px;margin-bottom:6px}
.fx-sec-hd h2{font-family:var(--fx-serif);font-size:clamp(20px,2.4vw,24px);font-weight:700;color:var(--fx-hd);letter-spacing:.06em;white-space:nowrap}
.fx-sec-hd .fx-rule{flex:1;height:1px;background:linear-gradient(90deg,var(--fx-gold),transparent)}
.fx-sec-hint{font-size:13px;color:var(--fx-muted);margin-bottom:14px}

/* 工具卡 */
.fx-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
.fx-grid>.c3{grid-column:span 3}.fx-grid>.c4{grid-column:span 4}.fx-grid>.c6{grid-column:span 6}
.fx-tool{position:relative;display:flex;flex-direction:column;background:var(--fx-card);border:1px solid var(--fx-line);border-radius:18px;box-shadow:var(--fx-shadow);overflow:hidden;transition:transform .2s,box-shadow .2s,border-color .2s}
.fx-tool::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;z-index:3;background:linear-gradient(90deg,transparent,var(--fx-gold),var(--fx-gold-soft),var(--fx-gold),transparent);opacity:0;transition:opacity .2s}
.fx-tool:hover{transform:translateY(-3px);border-color:var(--fx-gold);box-shadow:0 26px 44px -26px rgba(10,35,52,.75)}
.fx-tool:hover::before{opacity:1}
.fx-tool-a{position:relative;z-index:1;display:flex;flex-direction:column;flex:1;padding:20px 20px 16px;text-decoration:none;color:inherit}
.fx-tool-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px;padding-right:48px}
.fx-tool-for{font-size:11.5px;font-weight:700;color:var(--fx-soft);letter-spacing:.04em}
.fx-badge{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;font-size:24px;flex:0 0 auto;background:linear-gradient(145deg,var(--fx-navy2),var(--fx-navy-deep));border:1px solid rgba(232,160,32,.65);box-shadow:inset 0 0 0 4px rgba(232,160,32,.08),0 12px 22px -14px rgba(10,35,52,.9)}
.fx-tool h3{font-family:var(--fx-serif);font-size:18px;font-weight:700;color:var(--fx-hd);line-height:1.35;letter-spacing:.02em;margin-top:12px}
.fx-tool p.fx-d{font-size:13px;color:var(--fx-muted);line-height:1.7;margin-top:8px}
.fx-note{font-size:11.5px;font-weight:600;color:var(--fx-gold-ink);margin-top:10px}
.fx-tool .fx-tool-cta{position:relative;z-index:2;margin-top:auto;padding-top:14px;display:flex;align-items:center;justify-content:space-between;font-weight:800;font-size:14px;color:var(--fx-acc-ink);border-top:1px dashed var(--fx-line)}
.fx-tool .fx-tool-cta::after{content:"";width:34px;height:34px;border-radius:50%;background:var(--fx-acc-bg) no-repeat center/14px;border:1px solid var(--fx-acc-line);flex:0 0 34px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a86d0a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E");transition:.2s}
.fx-tool:hover .fx-tool-cta::after{background-color:var(--fx-gold);border-color:var(--fx-gold)}
.fx-tool.fx-featured{background:linear-gradient(150deg,var(--fx-navy2),var(--fx-navy-deep));border-color:rgba(232,160,32,.6)}
.fx-tool.fx-featured h3,.fx-tool.fx-featured .fx-tool-cta{color:#fff}
.fx-tool.fx-featured p.fx-d{color:#b9c7d4}
.fx-tool.fx-featured .fx-tool-for{color:#a9bccd}
.fx-tool.fx-featured .fx-note{color:var(--fx-gold-soft)}
.fx-tool.fx-featured .fx-tool-cta{border-top-color:rgba(232,160,32,.3)}
.fx-tool.fx-featured .fx-tool-cta::after{background-color:rgba(232,160,32,.16)}
.fx-tool.fx-featured .fx-badge{background:rgba(232,160,32,.12)}
/* 精選卡（理賠）：右側疊三張真縮圖；內文讓位、紙張在下層不吃點擊，CTA 在上層 */
.fx-tool.fx-featured .fx-d,.fx-tool.fx-featured h3,.fx-tool.fx-featured .fx-note{max-width:calc(100% - 190px)}
.fx-papers{position:absolute;right:22px;top:58px;width:170px;height:170px;z-index:0;pointer-events:none}
.fx-papers img{position:absolute;width:98px;height:139px;object-fit:cover;object-position:top;border-radius:4px;background:#fff;border:1px solid rgba(232,160,32,.5);box-shadow:-10px 14px 26px -12px rgba(0,0,0,.75)}
.fx-papers img:nth-child(1){right:58px;top:10px;transform:rotate(-8deg);opacity:.55}
.fx-papers img:nth-child(2){right:30px;top:4px;transform:rotate(-2deg);opacity:.8}
.fx-papers img:nth-child(3){right:0;top:12px;transform:rotate(6deg)}
.fx-pin{position:absolute;top:12px;right:12px;z-index:4;width:44px;height:44px;border-radius:50%;border:1px solid var(--fx-line);background:var(--fx-card);color:var(--fx-soft);font-size:18px;line-height:1;cursor:pointer;display:grid;place-items:center;transition:.15s;font-family:inherit}
.fx-pin:hover{border-color:var(--fx-gold);color:var(--fx-gold-ink);background:var(--fx-acc-bg)}
.fx-pin.on span{display:none}
.fx-pin.on::before{content:"★"}
.fx-pin.on,.fx-featured .fx-pin.on{background:linear-gradient(135deg,#ffd75a,var(--fx-gold));border-color:var(--fx-gold);color:var(--fx-on-gold)}
.fx-featured .fx-pin:not(.on){background:rgba(255,255,255,.06);border-color:rgba(232,160,32,.5);color:var(--fx-gold-soft)}
.fx-off,.fx-sec.fx-off{display:none!important}
.fx-nocard{max-width:1180px;margin:18px auto 0;padding:26px 20px;text-align:center;color:var(--fx-muted);background:var(--fx-card);border:1px dashed var(--fx-acc-line);border-radius:16px}

/* 共用資料帶：頭像一律圓形（無客戶＝淡金底「？」，有客戶＝深藍金字首字） */
html body #sharedBar{border-radius:16px;padding:14px 20px;background:var(--fx-card);border:1px solid var(--fx-line);border-left:4px solid var(--fx-gold);box-shadow:var(--fx-shadow)}
html body #sharedBar.has-client{background:var(--fx-acc-bg);border-color:var(--fx-acc-line);border-left-color:var(--fx-gold)}
html body .avatar{display:flex;align-items:center;justify-content:center;flex:0 0 46px;width:46px;height:46px;border-radius:999px;overflow:hidden;
  font-family:var(--fx-serif);font-size:18px;font-weight:700;line-height:1;
  background:linear-gradient(145deg,var(--fx-navy2),var(--fx-navy-deep));color:var(--fx-gold-soft);border:1px solid var(--fx-gold);box-shadow:inset 0 0 0 3px rgba(232,160,32,.12)}
html body #sharedBar:not(.has-client) .avatar{background:var(--fx-acc-bg);color:var(--fx-gold-ink);border:1px solid var(--fx-acc-line);box-shadow:inset 0 0 0 3px var(--fx-card)}
html body #curLine{color:var(--fx-hd)!important;font-size:14.5px}
html body #curLine b{color:var(--fx-hd)}
html body #curMeta{color:var(--fx-muted)!important}
.fx-foot-note{margin-top:26px;padding:18px 22px;border:1px solid var(--fx-line);border-left:4px solid var(--fx-gold);border-radius:14px;background:var(--fx-card);font-size:12.5px;line-height:1.85;color:var(--fx-muted)}
.fx-foot-note b{color:var(--fx-hd)}

/* 搜尋／篩選中（#fxResults 顯示）：收起 hero 副標與信任列，讓結果緊接搜尋台 */
body:has(#fxResults:not([hidden])) .fx-hero .fx-lead,body:has(#fxResults:not([hidden])) .fx-stats{display:none}
body:has(#fxResults:not([hidden])) .fx-hero-in{padding-bottom:44px}
body:has(#fxResults:not([hidden])) .fx-cos-hd,body:has(#fxResults:not([hidden])) .fx-cos-more{display:none}
body:has(#fxResults:not([hidden])) .fx-cos{flex-wrap:nowrap;overflow-x:auto;max-height:none!important;margin-top:8px;padding-bottom:8px;scrollbar-width:thin}

@media (max-width:1024px){
  .fx-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .fx-grid>.c3,.fx-grid>.c4,.fx-grid>.c6{grid-column:span 1}
  .fx-grid>.fx-featured{grid-column:span 2}
  .fx-hero-in{grid-template-columns:1fr;gap:20px}
  .fx-stats{display:none}
}
@media (max-width:640px){
  .fx-hero-in{padding:14px 16px 42px;gap:0}
  .fx-hero .fx-kick{display:none}
  .fx-hero h1{font-size:25px;margin-top:0;line-height:1.3}
  .fx-hero .fx-lead{margin-top:8px;font-size:13.5px;line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .fx-find{padding:0 12px;margin-top:-30px}
  .fx-find-box{padding:10px 12px 8px;border-radius:16px}
  .fx-kbd{display:none}
  .fx-filters{flex-wrap:nowrap;margin-top:8px}
  .fx-filters .fx-vr{display:none}
  .fx-chips{flex-wrap:nowrap}
  .fx-chip{padding:0 13px}
  .fx-more{display:inline-flex}
  .fx-filters .fx-tags{display:none}
  .fx-find-box:has(#fxMoreTags:checked) .fx-filters{flex-wrap:wrap}
  .fx-find-box:has(#fxMoreTags:checked) .fx-filters .fx-tags{display:flex;flex:1 1 100%;flex-wrap:wrap}
  .fx-tags .fx-chip{min-height:44px}
  .fx-cos-hd{display:none}
  .fx-cos{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:12px;margin:6px -12px 0;padding:5px 12px 7px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .fx-cos::-webkit-scrollbar{display:none}
  #fxCos .fx-chip{width:56px;height:56px;padding:0 13px;font-size:12.5px;scroll-snap-align:start}
  .fx-results,.fx-main{padding-left:16px;padding-right:16px}
  .fx-results{margin-top:12px}
  .fx-hit{gap:12px;padding:10px 12px;min-height:110px}
  .fx-hit-n{font-size:14.5px}
  .fx-hit-go{padding:0 10px;font-size:12px;min-height:32px}
  .fx-grid{grid-template-columns:1fr;gap:14px}
  .fx-grid>.c3,.fx-grid>.c4,.fx-grid>.c6,.fx-grid>.fx-featured{grid-column:auto}
  .fx-tool-a{padding:18px 16px 14px}
  .fx-papers{display:none}
  .fx-tool.fx-featured .fx-d,.fx-tool.fx-featured h3,.fx-tool.fx-featured .fx-note{max-width:none}
  .fx-sec-hd h2{white-space:normal}
  html body #sharedBar{padding:12px 14px;gap:10px}
  html body #sharedBar>.min-w-0{flex:1 1 calc(100% - 60px)}
  html body #sharedBar>.flex.items-center.gap-2{flex:1 1 100%;flex-wrap:wrap}
  html body #sharedBar .mini-btn{min-height:44px;padding:0 12px}
  .fx-promo{flex-wrap:wrap}
}

/* ── 11. 手機 ≤640 共通規則：頁首單行橫滑（停在膠囊左邊）、觸控 ≥44、輸入框 ≥16px ── */
@media (max-width:640px){
  html body #topnav{flex-wrap:nowrap!important;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch;
    margin:0 104px 0 0!important;max-width:none!important;padding:8px 10px 8px 12px!important;min-height:60px;font-size:13.5px;gap:2px;line-height:1.4}
  html body #topnav::-webkit-scrollbar{display:none}
  html body #topnav>*{flex:0 0 auto}
  html body #topnav>span:not(.fx-sep):not(.fx-brand):not([style]){flex-wrap:nowrap}
  html body #topnav a{min-height:44px;padding:0 10px}
  .fx-brand{font-size:13.5px;letter-spacing:.1em;padding-right:0;border-right:0;margin-right:4px;gap:6px}
  html body #topnav .fx-sep,html body #topnav span[style*="cbd5e1" i]{display:none}
  .fx-brand svg{width:22px;height:22px;flex-basis:22px}
  body input:not([type=checkbox]):not([type=radio]):not([type=file]),body select,body textarea{font-size:16px!important}
  body .mini-btn{min-height:44px}
  body .vtab{flex:1 1 auto;padding:9px 10px;font-size:13.5px}
  body #coGrid>label.co-card{min-height:48px}
  body .cta-main{min-height:54px}
  html body #appHeader h1{font-size:20px}
}

/* 手機導覽右緣：只露出半截（被裁 ≥12px）的連結先淡出，捲進來才完整顯示，避免半截字擠在膠囊旁（不支援的瀏覽器照常顯示） */
@supports (animation-timeline:view()){
  @media (max-width:640px){
    html body #topnav a{animation:fx-nav-edge linear both;animation-timeline:view(inline);animation-range:entry calc(100% - 12px) entry 100%}
  }
}
@keyframes fx-nav-edge{from{opacity:0}to{opacity:1}}

/* ── 12. 列印：隱藏頁首與裝飾，白底黑字 ── */
@media print{
  html body{background:#fff!important;color:#000!important}
  html body #topnav,.fx-hero,.fx-find,.fx-promo,.fx-pin,.fx-papers,#rex-topbar,.no-print{display:none!important}
  body .card-soft,.fx-card,.fx-tool,.fx-res-list,html body #sharedBar{box-shadow:none!important;background:#fff!important;border-color:#bbb!important;color:#000!important}
  body .bg-white,body .bg-gray-50,body .bg-gray-100{background:#fff!important}
  body h1,body h2,body h3,.fx-tool h3,.fx-hit-n{color:#000!important}
}

/* ── 13. 分頁套用回饋（Stage 2 代理回報後由 Opus 統一收進來） ── */
/* body 自己帶 Tailwind .text-gray-800：body .x 只打得到子孫，深色時 body 本身字色會留在深灰 */
html body.text-gray-800,html body.text-gray-700,html body.text-gray-900{color:var(--fx-text)}
/* app.js secHd() 區段細線（行內 #F1F5F9）深色時變亮白線 */
html[data-rex-theme="dark"] #coGrid>.col-span-2>span[style*="height:1px"]{background:var(--fx-line)!important}
/* 色塊圖例小說明（例：黃底＝需填欄位） */
.fx-hint{display:flex;align-items:center;gap:8px;margin:-6px 0 14px;font-size:12.5px;color:var(--fx-muted)}
.fx-hint i{width:12px;height:12px;border-radius:3px;background:#FEF3C7;border:1px solid #E0A21B;flex:0 0 12px}
html[data-rex-theme="dark"] .fx-hint i{background:rgba(250,204,21,.2);border-color:rgba(250,204,21,.6)}
#ciClear{white-space:nowrap;flex:0 0 auto}
/* 有 demo-mask「個資遮罩」浮鈕（膠囊正下方）的頁：sticky 側欄讓到 76px */
html body .sticky-panel{top:76px;max-height:calc(100vh - 92px)}
html[data-rex-theme="dark"] body .btn.bg-gray-100,html[data-rex-theme="dark"] body button.bg-gray-100{border:1px solid var(--fx-line)}
/* 手機單行導覽：目前頁移到最前面，不用橫滑就看得到 */
@media (max-width:640px){
  html body #topnav a.fx-cur,html body #topnav a[aria-current="page"],html body #topnav a[style*="4f46e5" i]{order:-1}
  html body #topnav>.fx-brand{order:-2}
}
/* 提示框（取代 bg-emerald-50/50、bg-sky-50/50 這類帶透明度、skin 選不到的 Tailwind 類別） */
html body .fxp-note{border:1px solid var(--fx-line);border-radius:12px;background:var(--fx-card2)!important;color:var(--fx-text)}
html body .fxp-note.ok{border-color:rgba(29,122,92,.45);background:var(--fx-ok-bg)!important}
html body .fxp-note.sky{border-color:rgba(11,93,134,.35);background:var(--fx-sky-bg)!important}
html[data-rex-theme="dark"] body .fxp-note.ok{border-color:rgba(95,211,166,.4)}
html[data-rex-theme="dark"] body .fxp-note.sky{border-color:rgba(125,211,252,.35)}
.fxp-sep{border-top:1px dashed var(--fx-line)}
/* stamp 頁共用：.fk-need 黃底＝這份表會用到的欄位 */
html body .fk-need input:not([type=checkbox]),html body .fk-need select{background:var(--fx-warn-bg)!important;border-color:var(--fx-gold)!important}
html body .fk-need>span{color:var(--fx-warn-ink)!important;font-weight:700}
/* 頁數單選（僅申請書首頁／完整表單）深色偏暗 */
html body label:has(>input[name=scope]){color:var(--fx-text)!important;opacity:1!important}
/* 有 stamp/app.js 的頁：手機欄位單欄＋44px（各頁仍可在頁內補自己的容器 id） */
@media (max-width:640px){
  html body [id$="Fields"].grid{grid-template-columns:1fr!important}
  html body [id$="Fields"] input:not([type=checkbox]):not([type=radio]),html body [id$="Fields"] select{min-height:44px;font-size:16px}
}
/* 主色按鈕一組（淺：深藍底白字；深：金底深字）給自有 CSS 的頁接 --acc／--brand 用 */
:root{--fx-btn-bg:var(--fx-navy);--fx-btn-ink:#fff}
html[data-rex-theme="dark"]{--fx-btn-bg:var(--fx-gold);--fx-btn-ink:var(--fx-on-gold)}
/* 深色：JS 行內寫死的淺藍底／藍字／淺邊框（report、travel 動態列）——一律排除 PDF 預覽 */
html[data-rex-theme="dark"] body [style*="#eff4ff" i]:not(.pg-wrap *),html[data-rex-theme="dark"] body [style*="#f0f7ff" i]:not(.pg-wrap *),html[data-rex-theme="dark"] body [style*="#eef2f7" i]:not(.pg-wrap *){background:var(--fx-card2)!important}
html[data-rex-theme="dark"] body [style*="color:#2563eb" i]:not(.pg-wrap *){color:var(--fx-gold-hi)!important}
html[data-rex-theme="dark"] body [style*="#bfdbfe" i]:not(.pg-wrap *),html[data-rex-theme="dark"] body [style*="#e2e8f0" i]:not(.pg-wrap *),html[data-rex-theme="dark"] body [style*="#f1f5f9" i]:not(.pg-wrap *){border-color:var(--fx-line)!important}
/* 手機：demo-mask「個資遮罩」鈕原本釘在膠囊正下方（top:56），捲動時會蓋到欄位右側的「清空」等按鈕 →
   縮成圖示並排到膠囊左邊（同一列、不懸在內容上）；功能與設定鈕都保留，只改位置與大小（不改 demo-mask.js，全站其他頁不受影響） */
@media (max-width:640px){
  html:not(.rex-in-line) body #dm-fab{top:10px;right:90px;gap:4px;height:38px}
  html:not(.rex-in-line) body #dm-toggle{width:38px;height:38px;padding:0!important;overflow:hidden;font-size:0!important;border-radius:999px!important;line-height:38px;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.25)}
  html:not(.rex-in-line) body #dm-toggle::before{content:"🔓";font-size:16px}
  html:not(.rex-in-line) body #dm-toggle.on::before{content:"🔒"}
  html:not(.rex-in-line) body #dm-gear{width:26px!important;height:26px!important}
  html:not(.rex-in-line) body #dm-panel{top:56px}
  html:not(.rex-in-line) body:has(#dm-fab) #topnav{margin-right:166px!important}
}
/* ?embed=1 內嵌模式：與原頁一致，藏掉頁首／首屏，只留工具本體 */
body.embed-mode #topnav,body.embed-mode .fx-hero,body.embed-mode .fx-hero-bg{display:none!important}
