/* ================================================================
   手機得到版外殼（嘉勇 2026-11-09「讓手機介面變成跟得到App的介面一樣」）
   標記在 front/_mobile_shell.php、互動在 assets/mobile-shell.js。
   只在 html.m2（?m2=1 開關）且 ≤860px 生效；桌機一律不顯示、舊頁首照舊。
   做法沿用 WG ems-new 的 bottom-tabbar.css／home-quick.css／home-tabs.css：
   - 每個區塊有底色卡片，區塊與螢幕邊距、區塊間距縮小
   - 底部列浮動、30% 底色＋毛玻璃、不貼到瀏覽器最底、可收合
   - 系統「減少透明度」時退回不透明底色
   - 觸控目標至少 44×44
   深夜模式是預設（html 沒有 data-theme="light"），標準模式另外覆寫。
   ================================================================ */
.m2-top, .m2-tabs, .m2-card, .m2-bar, .m2-sheet { display: none; }

html.m2 {
    --m2-x: 10px;                              /* 區塊與螢幕邊距 */
    --m2-gap: 10px;                            /* 區塊間距 */
    --m2-radius: 14px;
    --m2-page: #0b1222;                        /* 頁面底色（卡片要浮得出來） */
    --m2-card: #172236;
    --m2-line: rgba(255, 255, 255, .08);
    --m2-field: #223049;
    --m2-accent: #f97316;                      /* 得到式短橘線 */
    --m2-on-tint: rgba(96, 165, 250, .22);     /* 底部列目前頁淡底 */
    /* 底部膠囊 */
    --m2-cap-h: 60px;
    --m2-cap-x: 10px;
    /* 底部列（T103 照 WG／得到 App）：兩個膠囊左右各超出螢幕一點、髮線框、選中同心實色膠囊 */
    --m2-cap-bleed-l: 36px;                    /* 左側 AI 膠囊超出左緣 */
    --m2-cap-bleed-r: 28px;                    /* 主膠囊超出右緣 */
    --m2-cap-in: 5px;                          /* 選中格離外框 */
    --m2-cap-ring: 1px;                        /* 1x 螢幕 1px、2x 以上 0.5px */
    --m2-cap-solid: rgba(26, 26, 26, .30);   /* 嘉勇 11-09：毛玻璃＋底色 30% 不透明（同 WG 定案）（同 WG A 版 data-tabbar-alpha=70） */
    --m2-cap-line2: rgba(255, 255, 255, .30);   /* 嘉勇 11-10：框線透明 70% */
    --m2-cap-fg: #e8e8e8;
    --m2-cap-fg-on: #ff9447;
    --m2-cap-on-bg: #464646;
    --m2-cap-gap: 8px;
    --m2-ai: 58px;
    --m2-safe: env(safe-area-inset-bottom, 0px);
    --m2-cap-bg: rgba(20, 24, 30, .30);
    --m2-cap-filter: blur(18px) saturate(1.4) contrast(.8) brightness(.75);   /* 嘉勇 11-09 A 案：少壓暗，背後顏色透得出來 */
    --m2-cap-line: rgba(255, 255, 255, .12);
    --m2-cap-shadow: 0 4px 16px rgba(0, 0, 0, .40);   /* 嘉勇 11-10：底部膠囊加陰影 */
    --m2-top-shadow: 0 4px 14px rgba(0, 0, 0, .65);   /* 嘉勇 11-10：頂部選單加陰影 */
    --m2-block-shadow: 0 3px 12px rgba(0, 0, 0, .45);   /* 嘉勇 11-10：頁面區塊加陰影 */
    --m2-pull-h: 40px;
    --m2-space: calc(var(--m2-cap-h) + var(--m2-cap-gap) + var(--m2-safe));
    /* 快捷格圖示色（深色底：淡色圓＋亮色圖示） */
    --tone-blue-bg: rgba(96, 165, 250, .16);   --tone-blue: #93c5fd;
    --tone-teal-bg: rgba(45, 212, 191, .15);   --tone-teal: #5eead4;
    --tone-orange-bg: rgba(251, 146, 60, .16); --tone-orange: #fdba74;
    --tone-amber-bg: rgba(250, 204, 21, .15);  --tone-amber: #fde047;
    --tone-violet-bg: rgba(167, 139, 250, .17); --tone-violet: #c4b5fd;
    --tone-green-bg: rgba(74, 222, 128, .14);  --tone-green: #86efac;
    --tone-rose-bg: rgba(251, 113, 133, .16);  --tone-rose: #fda4af;
}
html.m2[data-theme="light"] {
    --m2-cap-solid: rgba(250, 250, 250, .30); --m2-cap-line2: rgba(33, 37, 41, .30); --m2-cap-fg: #212529; --m2-cap-fg-on: #b23a07; --m2-cap-on-bg: #e6e6e6;
    --m2-page: #f3f4f6;
    --m2-card: #ffffff;
    --m2-line: rgba(15, 23, 42, .07);
    --m2-field: #f1f3f5;
    --m2-accent: #ea580c;
    --m2-on-tint: rgba(37, 99, 235, .13);
    --m2-cap-bg: rgba(255, 255, 255, .30);
    --m2-cap-filter: blur(18px) saturate(1.4) contrast(.7) brightness(1.3);   /* 淺色同 A 案：少提亮 */
    --m2-cap-line: rgba(0, 0, 0, .12);
    --m2-cap-shadow: 0 4px 16px rgba(0, 0, 0, .16);
    --m2-top-shadow: 0 4px 14px rgba(0, 0, 0, .16);
    --m2-block-shadow: 0 3px 12px rgba(15, 23, 42, .09);
    --tone-blue-bg: #e8f0fe;   --tone-blue: #1d4ed8;
    --tone-teal-bg: #e0f5f1;   --tone-teal: #0f766e;
    --tone-orange-bg: #fff0e5; --tone-orange: #c2410c;
    --tone-amber-bg: #fef6db;  --tone-amber: #a16207;
    --tone-violet-bg: #efeafe; --tone-violet: #6d28d9;
    --tone-green-bg: #e6f6ec;  --tone-green: #15803d;
    --tone-rose-bg: #fde9ec;   --tone-rose: #be123c;
}
@media (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2) { html.m2 { --m2-cap-ring: .5px; } }
html.m2.m2-bar-c { --m2-space: calc(var(--m2-pull-h) + var(--m2-cap-gap) + var(--m2-safe)); }
/* 系統「減少透明度」：底部列不透明、不用毛玻璃 */
@media (prefers-reduced-transparency: reduce) {
    html.m2 { --m2-cap-bg: rgb(20, 24, 30); --m2-cap-filter: none; --m2-cap-solid: #1a1a1a; }
    html.m2[data-theme="light"] { --m2-cap-bg: rgb(255, 255, 255); --m2-cap-filter: none; --m2-cap-solid: #fafafa; }
}

@media (max-width: 860px) {
    /* ── 舊頁首收起；header 元素留著，裡面的全選單抽屜（#mobileMenu）改成全螢幕面板 ── */
    html.m2 body { background: var(--m2-page); }
    html.m2 .site-header {
        position: static; border: 0; background: none;
        -webkit-backdrop-filter: none; backdrop-filter: none;   /* 有 backdrop-filter 時 fixed 子元素會被困在 header 裡 */
    }
    html.m2 .site-header .header-inner,
    html.m2 .site-header .mobile-search { display: none !important; }
    html.m2 #mobileMenu:not([hidden]) {
        position: fixed; inset: 0; z-index: 1200; max-height: none;
        padding: 0 16px calc(24px + var(--m2-safe)); overflow-y: auto; border: 0;
        background: var(--card);
    }
    html.m2 .m2-mm-head {
        position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
        min-height: 52px; margin: 0 -16px; padding: 0 8px 0 16px; background: var(--card); border-bottom: 1px solid var(--line);
        font-weight: 800; font-size: 16px;
    }
    html.m2 .m2-mm-head button { width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 20px; cursor: pointer; }
    html.m2 .m2-mm-mine a { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--text2); padding: 4px 0; }
    html.m2 .m2-mm-mine .mm-subs { gap: 6px 16px; }

    html.m2 .site-main { padding: 0 var(--m2-x) 16px; }   /* 浮動列的留白只由 footer 負責，避免與卡片區到 footer 之間疊成約 150px 空白（HOME-8） */
    html.m2 .site-footer { margin-top: 16px; padding-bottom: calc(var(--m2-space) + 8px); }
    html.m2 { scroll-padding-bottom: calc(var(--m2-space) + 16px); }
    /* 會跟底部列打架的浮動元素往上讓 */
    /* 回饋鈕縮成 44px 圓鈕（只留圖示），不再蓋住列表右側的播放鈕 */
    /* 回報此頁：貼在右緣的半透明小標籤（旗子＋字），不再是綠色對話泡泡——原本像客服聊天（嘉勇 11-09） */
    html.m2 .fb-fab {
        bottom: calc(var(--m2-space) + 14px); right: 0; width: auto; height: 34px; min-width: 44px;
        padding: 0 10px 0 12px; gap: 5px; border-radius: 999px 0 0 999px;
        /* 底色與框線跟底部列兩個膠囊同一套：70% 不透明、髮線框、不用毛玻璃（嘉勇 11-09）；右緣框線推到螢幕外 */
        margin-right: -2px; padding-right: 12px;
        background: var(--m2-cap-solid); color: var(--m2-cap-fg); border: 0;
        -webkit-backdrop-filter: var(--m2-cap-filter); backdrop-filter: var(--m2-cap-filter);
        box-shadow: inset 0 0 0 var(--m2-cap-ring) var(--m2-cap-line2), var(--m2-cap-shadow); font-size: 12px; font-weight: 700; opacity: 1;
        transition: transform .25s ease;
    }
    html.m2 .fb-fab i { font-size: 13px; color: #f97316; }
    /* 底部列捲動藏起時，回報鈕跟著往下貼 */
    html.m2.m2-away .fb-fab { transform: translateY(calc(var(--m2-space) - 4px)); }
    html.m2 #toastHost { bottom: calc(var(--m2-space) + 16px); }
    html.m2 .ck-bar { bottom: var(--m2-space); }

    /* ── 頂部列：搜尋框＋點數膠囊＋歷史＋私訊 ── */
    html.m2 .m2-top {
        position: sticky; top: 0; z-index: 60;
        display: flex; align-items: center; gap: 6px;
        padding: 8px var(--m2-x) 6px;
        background: var(--m2-page);
        box-shadow: var(--m2-top-shadow);
    }
    html.m2 .m2-search {
        flex: 1 1 auto; min-width: 0; position: relative; display: flex; align-items: center;
        height: 38px; border-radius: 999px; background: var(--m2-card); border: 1px solid var(--m2-line);
    }
    html.m2[data-theme="light"] .m2-search { background: #fff; }
    html.m2 .m2-search .bi { position: absolute; left: 13px; color: var(--muted); font-size: 15px; pointer-events: none; }
    html.m2 .m2-search input {
        width: 100%; height: 100%; min-width: 0; padding: 0 12px 0 36px; border: 0; outline: 0;
        background: transparent; color: var(--ink); font: inherit; font-size: 15px; border-radius: 999px;
        text-overflow: ellipsis; -webkit-appearance: none; appearance: none;
    }
    html.m2 .m2-search input::placeholder { color: var(--muted); opacity: 1; }
    html.m2 .m2-search input::-webkit-search-cancel-button { display: none; }
    html.m2 .m2-search:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
    html.m2 .m2-pill {
        flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
        height: 32px; padding: 0 11px; border-radius: 999px; border: 0; cursor: pointer;
        background: linear-gradient(135deg, #fde68a, #f59e0b); color: #4a2a00;
        font: inherit; font-size: 13px; font-weight: 800; white-space: nowrap; position: relative;
    }
    html.m2 .m2-pill::after { content: ""; position: absolute; inset: -6px -2px; }   /* 可點範圍擴到 44 高 */
    html.m2 .m2-ic {
        flex: 0 0 auto; position: relative; width: 36px; height: 44px;
        display: inline-flex; align-items: center; justify-content: center;
        color: var(--ink); font-size: 21px;
    }
    html.m2 .m2-badge {
        position: absolute; top: 4px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
        border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
        box-shadow: 0 0 0 2px var(--m2-page);
    }
    html.m2 .m2-top a:focus-visible, html.m2 .m2-pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; }

    /* ── 頂部列 Dock 式縮放（嘉勇 2026-11-09）──
       1) 往下捲（與底部列同一個 m2-away 狀態）整行縮成細條，往上捲／點一下就放大回來；輸入搜尋時一律保持展開。
       2) 手指按住圖示時像 Mac Dock 放大彈跳，左右鄰居跟著微微放大。 */
    html.m2 .m2-top { transition: padding .22s ease; }
    html.m2 body { overflow-anchor: none; }   /* 頂部列縮放改變版面高度，關掉捲動錨定避免來回彈（見 mobile-shell.js away()） */
    html.m2 .m2-search { transition: height .22s ease; }
    html.m2 .m2-search input { transition: font-size .22s ease; }
    html.m2 .m2-pill, html.m2 .m2-ic, html.m2 .m2-search .bi {
        transition: transform .26s cubic-bezier(.34, 1.56, .64, 1), height .22s ease, font-size .22s ease;
        transform-origin: 50% 70%;
    }
    html.m2.m2-away .m2-top:not(:focus-within) { padding-top: 3px; padding-bottom: 3px; }
    html.m2.m2-away .m2-top:not(:focus-within) .m2-search { height: 28px; }
    html.m2.m2-away .m2-top:not(:focus-within) .m2-search input { font-size: 13px; }
    html.m2.m2-away .m2-top:not(:focus-within) .m2-pill { transform: scale(.8); }
    html.m2.m2-away .m2-top:not(:focus-within) .m2-ic { transform: scale(.78); height: 34px; }
    html.m2.m2-away .m2-top:not(:focus-within) .m2-badge { transform: scale(1.15); }
    /* 按下放大：按到的 1.3 倍、左右鄰居 1.12 倍（縮小狀態下先放大回原尺寸再彈） */
    html.m2 .m2-top .is-dock-near { transform: scale(1.12); }
    html.m2 .m2-top .is-dock-press { transform: scale(1.3); }
    html.m2 .m2-search.is-dock-press { transform: none; }
    html.m2 .m2-search.is-dock-press .bi { transform: scale(1.35); }

    /* ── 頻道 tab：橫滑、選中字大且粗＋下方短橘線、最右豎線後接 ≡ ── */
    html.m2 .m2-tabs {
        display: flex; align-items: stretch; gap: 0;
        margin: 0 0 6px; padding: 0 0 0 var(--m2-x);
        background: var(--m2-page);
    }
    html.m2 .m2-tabs-track {
        flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-end; gap: 18px;
        overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
        padding-right: 14px;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
                mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
    }
    html.m2 .m2-tabs-track::-webkit-scrollbar { display: none; }
    html.m2 .m2-tab {
        position: relative; flex: 0 0 auto; display: inline-flex; align-items: center;
        min-height: 44px; padding: 0 1px 4px; border: 0; background: none; cursor: pointer;
        color: var(--text3); font: inherit; font-size: 15px; font-weight: 500; line-height: 1.45; white-space: nowrap;
    }
    html.m2 .m2-tab.is-on { color: var(--ink); font-size: 18px; font-weight: 800; }
    html.m2 .m2-tab.is-on::after {
        content: ""; position: absolute; left: 50%; bottom: 4px; width: 16px; height: 3px; margin-left: -8px;
        border-radius: 2px; background: var(--m2-accent);
    }
    html.m2 .m2-tab[hidden] { display: none; }
    html.m2 .m2-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
    html.m2 .m2-tabs-more {
        flex: 0 0 auto; position: relative; width: 48px; min-height: 44px; border: 0; background: none; cursor: pointer;
        color: var(--ink); font-size: 21px; display: inline-flex; align-items: center; justify-content: center;
    }
    html.m2 .m2-tabs-more::before {   /* 豎線 */
        content: ""; position: absolute; left: 0; top: 50%; height: 16px; margin-top: -8px; width: 1px; background: var(--line);
    }

    /* ── 卡片共用 ── */
    html.m2 .m2-card {
        display: block; margin: 0 0 var(--m2-gap); padding: 10px 12px;
        background: var(--m2-card); border-radius: var(--m2-radius); border: 1px solid var(--m2-line);
    }
    /* 嘉勇 11-10：頁面中的區塊（卡片、首頁區塊、文章卡）加陰影 */
    html.m2 .m2-card, html.m2 .card,
    html.m2.m2-home .site-main > section:not(.m2-card), html.m2.m2-home .site-main > .hero { box-shadow: var(--m2-block-shadow); }
    html.m2 .m2-card-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
    html.m2 .m2-card-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
    html.m2 .m2-pen {   /* 筆圖示：看起來 32×32、可點 44×44 */
        position: relative; width: 32px; height: 32px; margin-right: -6px; padding: 0; border: 0; border-radius: 8px;
        background: none; color: var(--muted); font-size: 14px; cursor: pointer;
        display: inline-flex; align-items: center; justify-content: center;
    }
    html.m2 .m2-pen::after { content: ""; position: absolute; inset: -6px; }
    /* 快捷格：不放標題，筆圖示掛在卡片右上角外側（比照 WG 快捷功能區塊，嘉勇 11-09） */
    html.m2 .m2-quick { position: relative; margin-top: 14px; }
    /* 筆圖示中心壓在卡片右上角框線上（WG 7786 實測位置） */
    html.m2 .m2-quick > .m2-card-head { position: absolute; top: -16px; right: -10px; min-height: 0; z-index: 2; }
    /* 可點範圍右側不外擴：否則連同 ::after 會超出螢幕約 9px、整頁能左右拖（定案截圖 2026-11-09 發現） */
    html.m2 .m2-quick > .m2-card-head .m2-pen::after { inset: -6px 0 -6px -6px; }
    html.m2.m2-home .site-main { overflow-x: clip; }
    html.m2 .m2-quick > .m2-card-head .m2-pen { margin-right: 0; }
    html.m2 .m2-pen:focus-visible { outline: 2px solid var(--primary); }

    /* ── 快捷格：5 欄 × 2 列一頁、左右滑 ── */
    html.m2 .m2-qg-track {
        display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
        margin: 0 -4px;
    }
    html.m2 .m2-qg-track::-webkit-scrollbar { display: none; }
    html.m2 .m2-qg-page {
        flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always;
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-content: start;
        gap: 10px 2px; margin: 0; padding: 4px 0; list-style: none;
    }
    html.m2 .m2-qg-page > li[hidden] { display: none; }
    html.m2 .m2-qg-cell {
        display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 44px; padding: 2px;
        border-radius: 10px; color: var(--ink); text-align: center; text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    html.m2 .m2-qg-cell:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
    html.m2 .m2-qg-ic {
        width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
        font-size: 20px; transition: transform .1s ease;
    }
    html.m2 .m2-qg-cell:active .m2-qg-ic { transform: scale(.94); }
    html.m2 .m2-qg-tx {
        max-width: 100%; font-size: 12px; line-height: 1.35; color: var(--text2);
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
    }
    html.m2 .m2-qg-dots { display: flex; justify-content: center; gap: 2px; min-height: 8px; }
    html.m2 .m2-qg-dot { width: 24px; height: 20px; padding: 0; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
    html.m2 .m2-qg-dot::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: var(--muted); opacity: .5; transition: width .2s ease; }
    html.m2 .m2-qg-dot.is-on::before { width: 16px; background: var(--m2-accent); opacity: 1; }

    .tone-blue   { background: var(--tone-blue-bg);   color: var(--tone-blue); }
    .tone-teal   { background: var(--tone-teal-bg);   color: var(--tone-teal); }
    .tone-orange { background: var(--tone-orange-bg); color: var(--tone-orange); }
    .tone-amber  { background: var(--tone-amber-bg);  color: var(--tone-amber); }
    .tone-violet { background: var(--tone-violet-bg); color: var(--tone-violet); }
    .tone-green  { background: var(--tone-green-bg);  color: var(--tone-green); }
    .tone-rose   { background: var(--tone-rose-bg);   color: var(--tone-rose); }

    /* ── 得到式卡片列表：欄目名＞／標題／播放鈕 ── */
    html.m2 .m2-feed { padding: 2px 12px; }
    html.m2 .m2-feed-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
    html.m2 .m2-feed-row + .m2-feed-row { border-top: 1px solid var(--m2-line); }
    html.m2 .m2-feed-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none; }
    html.m2 .m2-feed-col { display: flex; align-items: center; gap: 6px; min-width: 0; }
    html.m2 .m2-feed-av { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
    html.m2 .m2-feed-name { font-size: 13px; font-weight: 700; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    html.m2 .m2-feed-gt { font-size: 11px; color: var(--muted); }
    html.m2 .m2-feed-title {
        font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink);
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    html.m2 .m2-feed-play {
        flex: 0 0 auto; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
        border-radius: 50%; color: var(--ink); font-size: 22px; position: relative;
    }
    html.m2 .m2-feed-play::before {
        content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1.5px solid var(--line);
    }
    html.m2 .m2-feed-play i { margin-left: 2px; }
    html.m2 .m2-feed-main:focus-visible, html.m2 .m2-feed-play:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }

    /* ── 首頁原有區塊：套上卡片底色、縮小間距；頭條與繼續收聽已移到上面的列表 ── */
    html.m2.m2-home .site-main > .daily-row,
    html.m2.m2-home .site-main > .continue-bar { display: none; }
    html.m2.m2-home .site-main > section:not(.m2-card),
    html.m2.m2-home .site-main > .hero {
        margin: 0 0 var(--m2-gap); padding: 12px; border-radius: var(--m2-radius);
        background: var(--m2-card); border: 1px solid var(--m2-line);
    }
    html.m2.m2-home .site-main > .hero { display: block; }
    html.m2.m2-home .site-main > .hero .hero-rank { border: 0; padding: 0; }
    html.m2.m2-home .site-main > .hero .hero-side { margin-bottom: 10px; }
    html.m2.m2-home .site-main > .hero .hero-main { margin-bottom: 10px; }
    html.m2.m2-home .ask-hero { box-shadow: none; }
    html.m2.m2-home .block-title { font-size: 16px; }

    /* ── 底部列：左側「AI」膠囊＋右側五格主膠囊（T103，照 WG／得到 App；實色、髮線框、兩端半圓、左右超出螢幕） ── */
    html.m2 .m2-bar {
        display: flex; align-items: flex-start; gap: 12px;
        position: fixed; z-index: 800;
        left: calc(-1 * var(--m2-cap-bleed-l)); right: 0; bottom: calc(var(--m2-cap-gap) + var(--m2-safe));
        height: var(--m2-cap-h); pointer-events: none;
    }
    html.m2 .m2-bar > * { pointer-events: auto; }
    html.m2 .m2-ai {
        flex: 0 0 108px; position: relative; box-sizing: border-box; height: var(--m2-cap-h);
        display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
        padding: 0 0 calc((var(--m2-cap-h) - 39px) / 2) var(--m2-cap-bleed-l);   /* 文字底線和右側五格切齊 */
        border-radius: calc(var(--m2-cap-h) / 2); background: var(--m2-cap-solid);
        box-shadow: inset 0 0 0 var(--m2-cap-ring) var(--m2-cap-line2), var(--m2-cap-shadow);
        -webkit-backdrop-filter: var(--m2-cap-filter); backdrop-filter: var(--m2-cap-filter);
        color: var(--m2-cap-fg); text-decoration: none; -webkit-tap-highlight-color: transparent;
    }
    /* Logo：不加圓底與外框，圖形高 36px、底與右側圖示底切齊（logo.png 上下左右幾乎無空白，不需裁切） */
    html.m2 .m2-ai-bump { display: block; width: 57px; height: 36px; flex-shrink: 0; margin: 0; background: none; border: 0; box-shadow: none; transform: translateX(-3px); }   /* 嘉勇 11-09：Logo 靠左 3px，文字同步置中對齊 */
    html.m2 .m2-ai-bump img { display: block; width: 57px; height: 36px; object-fit: contain; filter: drop-shadow(0 0 .5px rgba(0, 0, 0, .6)); }
    html.m2 .m2-ai-tx {
        position: static; transform: none; padding: 0; background: none; border-radius: 0;
        color: inherit; font-size: 11px; font-weight: 400; line-height: 1.2; white-space: nowrap;
        transform: translateX(-3px);   /* 與 Logo 同軸置中 */
    }
    html.m2 .m2-ai:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
    html.m2 .m2-cap {
        flex: 1 1 auto; min-width: 0; position: relative; height: var(--m2-cap-h); box-sizing: border-box;
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
        padding: 0 calc(var(--m2-cap-in) - 2px + var(--m2-cap-bleed-r)) 0 calc(var(--m2-cap-in) - 2px);   /* 五格平均分在畫面內看得到的那段 */
        margin-right: calc(-1 * var(--m2-cap-bleed-r));
        border-radius: calc(var(--m2-cap-h) / 2); border: 0;
        background: var(--m2-cap-solid); box-shadow: inset 0 0 0 var(--m2-cap-ring) var(--m2-cap-line2), var(--m2-cap-shadow);
        -webkit-backdrop-filter: var(--m2-cap-filter); backdrop-filter: var(--m2-cap-filter);
        transition: transform .22s ease, opacity .22s ease;
    }
    html.m2 .m2-bt {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        height: calc(var(--m2-cap-h) - 2 * var(--m2-cap-in)); margin: 0 2px; padding: 0; min-width: 0;
        border-radius: calc(var(--m2-cap-h) / 2 - var(--m2-cap-in));   /* 與外框同心、圓弧平行 */
        color: var(--m2-cap-fg); font-size: 11px; line-height: 1.2; font-weight: 400;
        text-decoration: none; -webkit-tap-highlight-color: transparent;
    }
    html.m2 .m2-bt i { font-size: 22px; height: 22px; line-height: 1; flex-shrink: 0; }
    html.m2 .m2-bt span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* 選中：同心實色膠囊、不加邊線，圖示（已是實心版）與文字通雲橘、不加粗。
       面板／展開狀態的格（aria-expanded="true"）打開時，原本的選中格要失去高亮：覆寫規則寫在後面 */
    html.m2 .m2-bt.is-on, html.m2 .m2-bt[aria-expanded="true"] { background: var(--m2-cap-on-bg); box-shadow: none; color: var(--m2-cap-fg-on); font-weight: 400; }
    html.m2 .m2-cap:has(.m2-bt[aria-expanded="true"]) .m2-bt.is-on:not([aria-expanded="true"]) { background: transparent; color: var(--m2-cap-fg); }
    html.m2 .m2-bt:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
    @media (max-width: 340px) { html.m2 .m2-bt, html.m2 .m2-ai-tx { font-size: 10px; } html.m2 .m2-bt { margin: 0 1px; } }
    /* 收合把手：主膠囊上緣中央一條短線（以畫面內那段置中），可點範圍 64×22（往上擴，不壓到按鈕） */
    html.m2 .m2-grip {
        position: absolute; top: -12px; left: calc(50% - var(--m2-cap-bleed-r) / 2); width: 64px; height: 22px; margin-left: -32px; padding: 0; border: 0;
        background: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    }
    html.m2 .m2-grip span { width: 34px; height: 4px; border-radius: 2px; background: var(--muted); opacity: .75; }
    html.m2 .m2-grip:focus-visible span { outline: 2px solid var(--primary); outline-offset: 2px; }
    /* 嘉勇 11-09：主膠囊上緣的收合把手看起來像多一塊色塊，WG 也沒有——拿掉（往下捲自動隱藏已足夠）；
       之前收合過的人仍有展開鈕 m2-pull 可展開 */
    html.m2 .m2-grip { display: none; }
    html.m2 .m2-pull {
        display: none; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
        width: 72px; height: var(--m2-pull-h); border-radius: 999px; cursor: pointer; border: 0;
        background: var(--m2-cap-solid); box-shadow: inset 0 0 0 var(--m2-cap-ring) var(--m2-cap-line2), var(--m2-cap-shadow);
        color: var(--m2-cap-fg); font-size: 18px;
    }
    html.m2 .m2-pull:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
    /* 收合：五格收起，只留中央「展開」膠囊與左側 AI 膠囊 */
    html.m2.m2-bar-c .m2-cap { transform: translateY(calc(100% + 20px)); opacity: 0; pointer-events: none; visibility: hidden; }
    html.m2.m2-bar-c .m2-pull { display: inline-flex; align-items: center; justify-content: center; }
    html.m2.m2-bar-c .m2-bar { height: var(--m2-pull-h); }
    html.m2.m2-bar-c .m2-ai { height: var(--m2-pull-h); flex-basis: 84px; padding: 0 0 0 var(--m2-cap-bleed-l); justify-content: center; gap: 0; }
    html.m2.m2-bar-c .m2-ai-bump { width: 36px; height: 22px; }
    html.m2.m2-bar-c .m2-ai-bump img { width: 36px; height: 22px; }
    html.m2.m2-bar-c .m2-ai-tx { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    /* 鍵盤打開時（輸入框聚焦）讓出畫面 */
    html.m2.m2-kb .m2-bar { display: none; }
    /* 往下捲自動藏起、往上捲回來（嘉勇 11-09：要跟 TOS 一樣；比照 WG body.ems-tb-away） */
    html.m2 .m2-bar { transition: transform .25s ease; }
    html.m2.m2-away .m2-bar { transform: translateY(calc(100% + var(--m2-cap-gap) + var(--m2-safe) + 24px)); }
    @media (prefers-reduced-motion: reduce) {
        html.m2 .m2-bar, html.m2 .m2-top, html.m2 .m2-search, html.m2 .m2-search input,
        html.m2 .m2-pill, html.m2 .m2-ic, html.m2 .m2-search .bi { transition: none; }
        html.m2 .m2-top .is-dock-near, html.m2 .m2-top .is-dock-press, html.m2 .m2-search.is-dock-press .bi { transform: none; }
    }

    /* ── 底部面板（編輯 tab／快捷格、按產業、點數） ── */
    html.m2 .m2-sheet:not([hidden]) {
        display: flex; align-items: flex-end; position: fixed; inset: 0; z-index: 1300;
        background: rgba(2, 6, 23, .55);
    }
    html.m2 .m2-sheet-box {
        width: 100%; max-height: 82vh; overflow-y: auto; padding: 0 16px calc(16px + var(--m2-safe));
        background: var(--m2-card); border-radius: 18px 18px 0 0; color: var(--ink);
        animation: m2Up .2s ease;
    }
    @keyframes m2Up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
    html.m2 .m2-sheet-head {
        position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
        min-height: 52px; background: var(--m2-card);
    }
    html.m2 .m2-sheet-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
    html.m2 .m2-sheet-x { width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer; }
    html.m2 .m2-sheet-hint { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
    html.m2 .m2-edit-list { list-style: none; margin: 0; padding: 0; }
    html.m2 .m2-edit-list li { display: flex; align-items: center; gap: 6px; min-height: 48px; border-bottom: 1px solid var(--m2-line); }
    html.m2 .m2-edit-list label { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; }
    html.m2 .m2-edit-list input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--m2-accent); }
    html.m2 .m2-edit-list .m2-ei { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 auto; }
    html.m2 .m2-edit-list li.is-off label { color: var(--muted); }
    html.m2 .m2-edit-list button {
        width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--text2); font-size: 17px; cursor: pointer;
    }
    html.m2 .m2-edit-list button:disabled { opacity: .25; cursor: default; }
    html.m2 .m2-sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
    html.m2 .m2-sheet-foot button {
        min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: none;
        color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    }
    html.m2 .m2-sheet-foot .m2-primary { margin-left: auto; background: var(--m2-accent); border-color: var(--m2-accent); color: #fff; }
    html.m2[data-theme="light"] .m2-sheet-foot .m2-primary { background: #c2410c; border-color: #c2410c; }   /* 白字對比 ≥4.5 */
    html.m2 .m2-ind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: 6px; }
    html.m2 .m2-ind {
        display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 12px;
        background: var(--m2-field); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none;
    }
    html.m2 .m2-ind i { color: var(--m2-accent); }
    /* 點數面板沿用頁首火焰選單的內容（複製過來） */
    html.m2 .m2-pts-body .flame-head { font-size: 15px; font-weight: 800; padding: 4px 0 10px; }
    html.m2 .m2-pts-body .flame-state { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
    html.m2 .m2-pts-body .flame-tasks-title { font-size: 13px; color: var(--muted); margin: 6px 0; }
    html.m2 .m2-pts-body .flame-task { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
    html.m2 .m2-pts-body .task-pts { margin-left: auto; color: var(--muted); font-size: 12px; }
    html.m2 .m2-pts-body .flame-freeze { display: flex; align-items: center; gap: 6px; min-height: 36px; font-size: 14px; }
    html.m2 .m2-pts-body .flame-lb {
        display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-top: 10px;
        border-radius: 999px; background: var(--m2-field); font-weight: 700;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.m2 .m2-cap, html.m2 .m2-qg-ic, html.m2 .m2-qg-dot::before { transition: none; }
    html.m2 .m2-sheet-box { animation: none; }
}
@media print {
    html.m2 .m2-top, html.m2 .m2-tabs, html.m2 .m2-bar, html.m2 .m2-quick { display: none !important; }
}
