/* ════════ 加盟機關「探索」篩選條件 RWD 抽屜（King 2026-10-30）
   與 Portal 我的課程／學習紀錄（styles/portal-rwd-filter-table.css）同一套：≤1024 收合成一條＋「調整篩選」→ 右側抽屜（≤640 底部抽屜）。
   加盟機關頁未載入 my-courses.css，抽屜標題列／關閉鈕／底部按鈕的規則在此自帶，數值同 Portal 的 .myc-modal__hd／.myc-modal__x／.myc-modal__ft／.myc-btn。
   本頁有 html zoom（≥1440 .83／＜1440 .875），以下數值皆為 CSS px。 */

/* ---------- 收合列 ---------- */
.afd-open{display:none}
.afd-tail{display:contents}
.afd-card.afd-on :is(#ex-collapse-ico,#feat-collapse-ico,#pf-collapse-ico){display:none}            /* 抽屜模式：標題不再是展開／收合，改為開抽屜 */
.afd-card.afd-on .afd-head{flex-wrap:wrap !important;row-gap:14px !important;column-gap:12px;min-height:44px;margin-bottom:0 !important}
.afd-card.afd-on .afd-head>#ex-collapse,.afd-card.afd-on .afd-head>#ex-clear{flex:none}
.afd-card.afd-on .afd-tail{display:flex;align-items:center;gap:12px;flex:1 1 auto;min-width:0;max-width:100%}
.afd-card.afd-on .afd-tail>.flt-sum{flex:0 1 auto;flex-basis:auto !important;min-width:0;flex-wrap:nowrap !important;overflow-x:auto;scrollbar-width:none;margin:0 !important}
.afd-card.afd-on .afd-tail>.flt-sum.afd-ov{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);padding-right:20px}
.afd-card.afd-on .afd-tail>.flt-sum::-webkit-scrollbar{display:none}
.afd-card.afd-on .afd-tail>.flt-sum .flt-g{flex:none}
/* 「調整篩選」：Primary 外框＋字，細緻陰影；hover 淡 Primary 底 */
.afd-card.afd-on .afd-open{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;height:44px;margin:0 0 0 auto;padding:0 16px;
  border-radius:8px;border:1px solid var(--primary,#1f7a73);background:#fff;color:var(--primary,#1f7a73);font:700 17px/1 'Noto Sans TC',sans-serif;cursor:pointer;
  box-shadow:0 1px 2px rgba(16,24,40,.06),0 2px 6px rgba(31,122,115,.12);transition:background-color .15s,box-shadow .15s}
.afd-card.afd-on .afd-open:hover{background:color-mix(in srgb,var(--primary,#1f7a73) 7%,#fff);box-shadow:0 2px 4px rgba(16,24,40,.08),0 4px 10px rgba(31,122,115,.16)}
.afd-card.afd-on .afd-open:focus-visible{outline:3px solid rgba(31,122,115,.35);outline-offset:2px}
.afd-card.afd-on .afd-open .ico{font-size:20px}
.afd-open .afd-n{display:inline-block;box-sizing:border-box;min-width:20px;padding:calc((20px - 1cap)/2) 6px;border-radius:9999px;background:var(--primary,#1f7a73);color:#fff;font:700 13px/1 'Inter',sans-serif;font-variant-numeric:tabular-nums;text-align:center;text-box:trim-both cap alphabetic} /* 數字墨跡置中（King 2026-11-23） */
.afd-open .afd-n:empty{display:none}

/* ---------- 抽屜 ---------- */
html.afd-lock,html.afd-lock body{overflow:hidden}
.afd{position:fixed;inset:0;z-index:90;visibility:hidden;pointer-events:none}
.afd.show{visibility:visible;pointer-events:auto}
.afd-mask{position:absolute;inset:0;background:rgba(0,0,0,.6);opacity:0;transition:opacity .2s}
.afd.show .afd-mask{opacity:1}
.afd-panel{position:absolute;top:0;right:0;bottom:0;width:min(600px,92vw);background:#fff;display:flex;flex-direction:column;
  box-shadow:-12px 0 36px rgba(16,24,40,.18);transform:translateX(100%);transition:transform .24s cubic-bezier(.2,.8,.2,1)}
.afd.show .afd-panel{transform:none}
.afd-hd{display:flex;align-items:center;gap:12px;padding:16px 16px 12px 20px;border-bottom:1px solid rgba(0,0,0,.08)}
.afd-hd h2{flex:1;min-width:0;margin:0;font:700 23px/1.5 'Noto Sans TC',sans-serif;color:#000}
.afd-x{display:grid;place-items:center;width:32px;height:32px;margin:-2px -4px 0 0;border:0;padding:0;background:transparent;border-radius:6px;color:rgba(0,0,0,.6);cursor:pointer}
.afd-x:hover{background:rgba(0,0,0,.06);color:#000}
.afd-x:focus-visible{outline:2px solid var(--primary,#1f7a73)}
.afd-x .ico{font-size:24px}
.afd-b{flex:1;min-height:0;overflow:auto;padding:20px 24px 28px}
.afd-ft{display:flex;gap:12px;padding:16px 24px calc(16px + env(safe-area-inset-bottom));border-top:1px solid rgba(0,0,0,.08)}
.afd-btn{flex:1;display:inline-flex;align-items:center;justify-content:center;height:44px;padding:0 16px;border-radius:8px;border:1px solid transparent;cursor:pointer;
  font:700 18px/1 'Noto Sans TC',sans-serif;transition:background-color .15s ease,border-color .15s ease}
.afd-btn .ico{font-size:20px;margin-right:6px}
.afd-btn.primary{background:var(--primary,#1f7a73);color:#fff}
.afd-btn.primary:hover{filter:brightness(.92)}
.afd-btn.ghost{background:#fcfcff;border-color:#abaab4;color:rgba(0,0,0,.6)}
.afd-btn.ghost:hover{background:#f5f6fa;color:#000}
.afd-btn:focus-visible{outline:3px solid rgba(31,122,115,.35);outline-offset:2px}

/* ---------- 抽屜內排版：項目卡三張一排；欄位兩個一排、標籤在上；關鍵字整列，「搜尋」改由底部「套用篩選」 ---------- */
.afd-b :is(#ex-filters,#feat-filters,#pf-filters){display:block !important}
.afd-b .afd-tabs{display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px !important;margin-bottom:calc(32px / .875) !important}
.afd-b .afd-tabs>.ex-tab{width:auto;min-width:0}
.afd-b .afd-tabs>.ex-tab .ex-tab-ic{width:calc(36px / .875);height:calc(36px / .875);min-width:0;flex:none}
.afd-b .afd-tabs>.ex-tab .ex-tab-ic img{width:calc(20px / .875);height:calc(20px / .875)}
@media (min-width:641px){ .afd-b .afd-tabs>.ex-tab{padding:12px 14px;gap:10px;justify-content:center} }
.afd-b :is(#ex-fgrid,#ft-fgrid){grid-template-columns:repeat(2,minmax(0,1fr)) !important;column-gap:16px;row-gap:20px;margin-bottom:0}
.afd-b :is(#ex-fgrid,#ft-fgrid)>*{grid-column:auto !important;min-width:0;display:flex !important;flex-direction:column;align-items:stretch !important;gap:8px}
.afd-b :is(#ex-fgrid,#ft-fgrid)>.kw-row{grid-column:1 / -1 !important}
.afd-b :is(#ex-fgrid,#ft-fgrid)>*>*{flex:0 0 auto;min-width:0;width:auto;max-width:100%}
.afd-b :is(#ex-fgrid,#ft-fgrid) .exf-lbl{width:auto !important;min-width:0 !important;text-align:left;justify-content:flex-start}
.afd-b :is(#ex-fgrid,#ft-fgrid) .kw-row>button{display:none}
.afd-b #ex-filters [id$="-menu"] :is(.exm-opt,.exh-opt,.exa-opt,[role="option"]){font-size:calc(16px / .875) !important;padding-top:8px;padding-bottom:8px}

/* ≤640：底部抽屜（全寬、上緣圓角＋把手） */
@media (max-width:640px){
  .afd-panel{top:auto;left:0;width:100%;max-height:88dvh;border-radius:16px 16px 0 0;transform:translateY(100%)}
  .afd-hd{position:relative;padding-top:22px}
  .afd-hd::before{content:"";position:absolute;top:8px;left:50%;width:40px;height:4px;border-radius:2px;background:#d5dce5;transform:translateX(-50%)}
  .afd-b{padding:16px 20px 24px}
  .afd-card.afd-on .afd-open{padding:0 12px}
  .afd-b .afd-tabs>.ex-tab{flex-direction:column;justify-content:center;text-align:center}
}
/* 多選下拉（.exs-ctl.pms，探索：認證時數類別／報名狀態）：與 Portal、本頁「加盟機關」相同——已選標籤單行＋「+N」＋「×」；
   選單上方搜尋、下方已選數／全部清除；選單內只留勾選框＋純文字（類別色膠囊只用在欄位內的已選標籤） */
.exs-ctl.pms.pms{flex-wrap:nowrap;gap:6px}
.exs-ctl.pms>.exs-vals{flex-wrap:nowrap;overflow:hidden}
.exs-ctl.pms>.exs-vals>*{flex:none}
.exs-ctl.pms>.exf-cv{flex:none}
.pms-s.pms-s{margin:12px 12px 4px}
#ex-filters .exa-opt .exc-badge{background:none;color:inherit;font:inherit;height:auto;padding:0;margin:0;border-radius:0}
.exa-foot{flex-wrap:nowrap}
.exa-foot>span{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
[id$="-menu"] .exa-foot>button,.exa-foot>button{white-space:nowrap !important;word-break:keep-all !important;flex:none !important;min-width:max-content}
.afd-b .exa-foot{font-size:14px}
/* 多選勾選框：同 Portal——方框畫面 16px（Material 字級畫面 21.33px ÷ zoom）、與選項文字垂直置中 */
#ex-filters .exa-opt{align-items:center}
#ex-filters .exa-box{width:calc(21.33px / .875);height:calc(21.33px / .875);margin-top:0;display:inline-grid;place-items:center;flex:none}
#ex-filters .exa-box::before{font-size:calc(21.33px / .875);line-height:1}
#ex-filters .exa-opt .exc-badge{margin-top:0}
@media (min-width:1440px){
  #ex-filters .exa-box{width:calc(21.33px / .83);height:calc(21.33px / .83)}
  #ex-filters .exa-box::before{font-size:calc(21.33px / .83)}
}
/* 抽屜內項目卡「選中打勾」徽章：同 Portal——移到卡片外框右上角（半騎在框線上），不再壓到「數位課程」等文字；尺寸 24→20、白色描邊 */
.afd-b .afd-tabs{padding-top:6px;overflow:visible !important}
.afd-b .afd-tabs>.ex-tab{overflow:visible}
.afd-b .afd-tabs>.ex-tab.is-on::after{top:-8px !important;right:-8px !important;width:20px !important;height:20px !important;font-size:14px !important;box-shadow:0 0 0 2px #fff !important}

/* ---------- Phone ≤640（King 2026-11-27）：同 Portal 我的課程——已選標籤獨立整列可換行；抽屜內欄位單欄 ---------- */
@media (max-width:640px){
  .afd-card.afd-on .afd-tail{flex:1 1 100%;flex-wrap:wrap;row-gap:12px}
  .afd-card.afd-on .afd-tail>.flt-sum{order:-1;flex:1 1 100% !important;flex-wrap:wrap !important;overflow:visible;row-gap:8px}
  .afd-card.afd-on .afd-tail>.flt-sum.afd-ov{-webkit-mask-image:none;mask-image:none;padding-right:0}
  .afd-card.afd-on .afd-tail>.flt-sum .flt-g{flex:0 1 auto;max-width:100%}
  .afd-card.afd-on .afd-tail>.afd-open{flex:1 1 auto;margin-left:0}
  .afd-b :is(#ex-fgrid,#ft-fgrid){grid-template-columns:minmax(0,1fr) !important}
}

/* Phone ≤560：篩選條件抽屜內容整體縮小一級（×0.9），與首頁主內容一致（King 2026-11-27） */
@media (max-width:560px){ .afd-panel>*{zoom:.9} }

/* 主推課程專區（#pf-collapse 直接在卡片內、非 flex 標題列）：抽屜模式時標題與收合列排成一致的 flex 列（King 2026-11-27） */
.afd-card.afd-on.afd-head:has(>#pf-collapse){display:flex;flex-wrap:wrap;align-items:center;row-gap:14px;column-gap:12px}
.afd-card.afd-on.afd-head>#pf-collapse{margin-bottom:0 !important;flex:none}
.afd-b #pf-filters .kw-row>button{display:none}
/* 抽屜內欄位強制 flex 時，仍須尊重原本被隱藏的欄位（例：主打專區非英語力時的「級別／英語力類別」）（King 2026-11-27） */
.afd-b :is(#ex-fgrid,#ft-fgrid)>:is(.hidden,[hidden],[style*="display: none"],[style*="display:none"]){display:none !important}
