/* 東方小助教｜全站浮動小工具
 * 由 build_assistant.py 產生，不要直接改這個檔，改 src/ 之後重跑。
 * 視覺沿用佳慧老師的原始設計，只做了「上站必要」的收斂。 */

/* 變數只掛在元件的兩個根上，不放 :root——避免污染全站 */
.xf-launcher, .xf-panel{
  --xf-gold:#F2B705; --xf-gold-soft:#FBE7A8;
  --xf-navy:#1F2A44;  --xf-navy-soft:#3B4A6B;
  --xf-cream:#FFF8E7; --xf-ink:#2B2118; --xf-ink-soft:#6B6055;
  --xf-leaf:#4CAF50;  --xf-leaf-soft:#E4F3E4; --xf-white:#FFFFFF;
  --xf-size:104px;    --xf-bottom:24px;
  /* 原本靠 html,body 那條規則帶下來的，剝掉之後要自己補，
     否則底下一堆 font-family:inherit 會繼承到主題的字體 */
  font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Microsoft JhengHei","Noto Sans TC",sans-serif;
  box-sizing:border-box;
}
.xf-launcher *, .xf-panel *{ box-sizing:border-box; }

/* ---------- 浮動按鈕 ---------- */
  .xf-launcher{
    position:fixed;
    right:24px;
    bottom:24px;
    width:104px;
    height:104px;
    border:none;
    border-radius:50%;
    background:var(--xf-gold);
    cursor:pointer;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 10px 26px rgba(29,59,100,0.24), 0 3px 8px rgba(29,59,100,0.16);
    animation:xf-bob 3.2s ease-in-out infinite;
    z-index:9998;
  }
  .xf-launcher::before{
    content:"";
    position:absolute;
    inset:-8px;
    border-radius:50%;
    border:3px solid var(--xf-gold);
    opacity:0.55;
    animation:xf-ring 2.6s ease-out infinite;
  }
  .xf-launcher img{
    width:92%;
    height:92%;
    object-fit:contain;
    pointer-events:none;
  }
  .xf-launcher .xf-dot{
    position:absolute;
    top:4px;
    right:4px;
    width:20px;
    height:20px;
    border-radius:50%;
    background:#E74C3C;
    border:3px solid var(--xf-white);
  }
  .xf-launcher:hover{filter:brightness(1.04);}
  .xf-launcher.xf-open{animation:none;}
  .xf-launcher.xf-open::before{display:none;}

  @keyframes xf-bob{
    0%,100%{transform:translateY(0);}
    50%{transform:translateY(-6px);}
  }
  @keyframes xf-ring{
    0%{transform:scale(1);opacity:0.5;}
    100%{transform:scale(1.35);opacity:0;}
  }

  /* ---------- 聊天面板 ---------- */
  .xf-panel{
    position:fixed;
    right:24px;
    bottom:150px;
    width:336px;
    max-width:calc(100vw - 32px);
    height:560px;
    max-height:calc(100vh - 150px);
    background:var(--xf-cream);
    border-radius:22px 22px 18px 18px;
    box-shadow:0 20px 46px rgba(29,59,100,0.28);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    transform:scale(0.92) translateY(14px);
    opacity:0;
    pointer-events:none;
    transition:transform .22s cubic-bezier(.34,1.4,.64,1), opacity .18s ease;
    z-index:9999;
  }
  .xf-panel.xf-visible{
    transform:scale(1) translateY(0);
    opacity:1;
    pointer-events:auto;
  }

  .xf-header{
    background:var(--xf-navy);
    color:var(--xf-white);
    padding:14px 16px;
    display:flex;
    align-items:center;
    gap:10px;
    flex-shrink:0;
  }
  .xf-header .xf-avatar{
    width:60px;
    height:60px;
    border-radius:50%;
    background:var(--xf-gold);
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    overflow:hidden;
  }
  .xf-header .xf-avatar img{width:82%;height:82%;object-fit:contain;}
  .xf-header .xf-title{flex:1;min-width:0;}
  .xf-header .xf-name{font-size:15px;font-weight:600;}
  .xf-header .xf-tagline{font-size:11.5px;color:#C9D2E6;margin-top:2px;}
  .xf-header .xf-close{
    background:none;border:none;color:#C9D2E6;
    font-size:20px;line-height:1;cursor:pointer;
    padding:4px;
    border-radius:6px;
  }
  .xf-header .xf-close:hover{background:rgba(255,255,255,0.12);color:var(--xf-white);}
  .xf-header .xf-back{
    background:none;border:none;color:#C9D2E6;font-size:19px;cursor:pointer;
    padding:4px 6px;border-radius:6px;flex-shrink:0;display:none;
  }
  .xf-header .xf-back:hover{background:rgba(255,255,255,0.12);color:var(--xf-white);}

  /* ---------- 兩個視圖：介紹頁／對話頁 ---------- */
  .xf-view{display:none;flex:1;min-height:0;flex-direction:column;}
  .xf-view.xf-view-active{display:flex;}

  .xf-intro{
    flex:1;
    min-height:0;
    overflow-y:auto;
    padding:20px 18px 18px;
    display:flex;
    flex-direction:column;
    gap:14px;
  }
  .xf-intro::-webkit-scrollbar{width:6px;}
  .xf-intro::-webkit-scrollbar-thumb{background:#E3D6AE;border-radius:6px;}

  .xf-hero{text-align:center;}
  .xf-hero .xf-hero-avatar{
    width:76px;height:76px;margin:0 auto 8px;border-radius:50%;
    background:var(--xf-gold);display:flex;align-items:center;justify-content:center;
  }
  .xf-hero .xf-hero-avatar img{width:88%;height:88%;object-fit:contain;}
  .xf-hero .xf-hero-avatar--wide{
    width:auto;height:auto;background:none;border-radius:0;margin-bottom:2px;
  }
  .xf-hero .xf-hero-avatar--wide img{width:auto;height:130px;max-width:100%;object-fit:contain;}
  .xf-hero h2{margin:0;font-size:17.5px;color:var(--xf-navy);}
  .xf-hero .xf-hero-sub{margin-top:4px;font-size:13px;color:var(--xf-ink-soft);}

  .xf-intro p{margin:0;font-size:13px;line-height:1.75;color:var(--xf-ink);}
  .xf-intro h3{margin:0 0 6px;font-size:13.5px;color:var(--xf-navy);}

  .xf-flow{
    font-size:12.5px;line-height:1.8;color:var(--xf-ink);
    background:var(--xf-white);border-radius:12px;padding:11px 13px;
    box-shadow:0 1px 2px rgba(29,59,100,0.07);
  }

  .xf-pillrow{display:flex;flex-wrap:wrap;gap:6px;}
  .xf-pill{
    font-size:12px;padding:5px 11px;border-radius:999px;
    background:var(--xf-leaf-soft);color:#2E6B31;border:1px solid #CFE8CF;
  }

  .xf-divider{height:1px;background:#EEE1C0;}

  .xf-escalate{background:var(--xf-navy);color:var(--xf-white);border-radius:14px;padding:13px 14px;}
  .xf-escalate-top{display:flex;align-items:center;gap:8px;}
  .xf-escalate-icon{width:46px;height:46px;object-fit:contain;flex-shrink:0;}
  .xf-escalate h3{color:var(--xf-gold-soft);margin:0;}
  .xf-escalate p{color:#DCE3F0;margin-top:8px;}
  .xf-escalate .xf-escalate-line{
    margin-top:9px;font-size:12.5px;color:var(--xf-gold-soft);font-weight:600;line-height:1.6;
  }

  .xf-brandline{text-align:center;padding-top:2px;}
  .xf-brandline .xf-brand-name{font-size:14.5px;font-weight:700;color:var(--xf-navy);}
  .xf-brandline .xf-brand-tag{font-size:11.5px;color:var(--xf-ink-soft);margin-top:2px;}

  .xf-cta{
    margin-top:2px;
    border:none;
    background:var(--xf-gold);
    color:var(--xf-navy);
    font-size:14px;
    font-weight:700;
    padding:13px 16px;
    border-radius:999px;
    cursor:pointer;
    box-shadow:0 6px 14px rgba(242,183,5,0.35);
  }
  .xf-cta:hover{filter:brightness(1.03);}
  .xf-cta:active{transform:scale(0.98);}

  .xf-body{
    flex:1;
    overflow-y:auto;
    padding:16px 14px;
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  .xf-body::-webkit-scrollbar{width:6px;}
  .xf-body::-webkit-scrollbar-thumb{background:#E3D6AE;border-radius:6px;}

  .xf-msg{
    display:flex;
    gap:8px;
    max-width:88%;
  }
  .xf-msg.xf-from-bot{align-self:flex-start;}
  .xf-msg.xf-from-user{align-self:flex-end;flex-direction:row-reverse;}
  .xf-msg .xf-bubble-avatar{
    width:48px;height:48px;border-radius:50%;
    background:var(--xf-gold);flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    margin-top:2px;
    overflow:hidden;
  }
  .xf-msg .xf-bubble-avatar img{width:82%;height:82%;object-fit:contain;}
  .xf-bubble{
    font-size:13.5px;
    line-height:1.6;
    padding:9px 12px;
    border-radius:14px;
    white-space:pre-wrap;
    word-break:break-word;
  }
  .xf-from-bot .xf-bubble{
    background:var(--xf-white);
    color:var(--xf-ink);
    border-bottom-left-radius:4px;
    box-shadow:0 1px 2px rgba(29,59,100,0.08);
  }
  .xf-from-user .xf-bubble{
    background:var(--xf-navy);
    color:var(--xf-white);
    border-bottom-right-radius:4px;
  }

  .xf-chips{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin:2px 0 4px 56px;
  }
  .xf-chip{
    border:1.5px solid var(--xf-gold);
    background:var(--xf-white);
    color:var(--xf-navy);
    font-size:12.5px;
    padding:6px 12px;
    border-radius:999px;
    cursor:pointer;
    transition:background .15s ease, transform .1s ease;
  }
  .xf-chip:hover{background:var(--xf-gold-soft);}
  .xf-chip:active{transform:scale(0.96);}

  .xf-quickrow{
    display:flex;
    gap:6px;
    padding:8px 12px 0;
    flex-shrink:0;
    overflow-x:auto;
  }
  .xf-quick-btn{
    flex:0 0 auto;
    font-size:12px;
    padding:6px 11px;
    border-radius:999px;
    border:1.5px solid var(--xf-navy-soft);
    background:var(--xf-white);
    color:var(--xf-navy);
    cursor:pointer;
    white-space:nowrap;
  }
  .xf-quick-btn:hover{background:var(--xf-cream);}
  .xf-quick-btn:active{transform:scale(0.96);}
  .xf-quick-btn--teacher{border-color:var(--xf-leaf);color:#2E6B31;}
  .xf-quick-btn--teacher:hover{background:var(--xf-leaf-soft);}

  .xf-footnote{
    font-size:11px;
    color:var(--xf-ink-soft);
    text-align:center;
    padding:6px 0 2px;
  }

  .xf-inputbar{
    flex-shrink:0;
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px 12px;
    background:var(--xf-white);
    border-top:1px solid #EEE3C8;
  }
  .xf-inputbar input{
    flex:1;
    border:1.5px solid #E7DCC0;
    border-radius:999px;
    padding:9px 14px;
    font-size:13.5px;
    outline:none;
    font-family:inherit;
    color: var(--xf-ink);
    background: var(--xf-cream);
  }
  .xf-inputbar input:focus{border-color:var(--xf-gold);}
  .xf-send{
    width:36px;height:36px;
    border-radius:50%;
    border:none;
    background:var(--xf-leaf);
    color:var(--xf-white);
    display:flex;align-items:center;justify-content:center;
    cursor:pointer;
    flex-shrink:0;
  }
  .xf-send:hover{filter:brightness(1.06);}
  .xf-send svg{width:16px;height:16px;}

  @media (max-width:420px){
    .xf-panel{
      right:12px;
      left:12px;
      width:auto;
      bottom:126px;
    }
    .xf-launcher{right:16px;bottom:16px;width:92px;height:92px;}
  }


/* ── 上站用的收斂（預覽版沒有這些） ───────────────────────── */

/* 尺寸與位置改吃變數，好在有閱讀器的頁面整組縮小 */
.xf-launcher{ width:var(--xf-size); height:var(--xf-size); bottom:var(--xf-bottom); }
.xf-panel{
  bottom: calc(var(--xf-bottom) + var(--xf-size) + 22px);
  /* 100dvh 而不是 100vh：手機瀏覽器的工具列會把 vh 算進去，面板底部會被裁掉 */
  max-height: calc(100dvh - var(--xf-bottom) - var(--xf-size) - 40px);
}
@media (max-width:420px){
  .xf-launcher, .xf-panel{ --xf-size:92px; --xf-bottom:16px; }
}

/* 面板內容捲到底時不要把背後的講義一起捲走 */
.xf-steps, .xf-intro, .xf-body{ overscroll-behavior: contain; }

/* 有線上閱讀器的頁面：鈕縮小，並把分頁器右緣讓出來。
   ⚠️ .xuebar-nav 這條是覆蓋 xuebar-reader.php 的樣式，寫在這裡是刻意的：
   載入順序在後、又多一層 body.xb-has-reader 的特異性，所以閱讀器本身一個字都不用改
   （符合網站維運筆記第 7 條「新增優於覆寫」）。改分頁器版面時要一起看這裡。 */
body.xb-has-reader .xf-launcher{ --xf-size:64px; --xf-bottom:16px; }
body.xb-has-reader .xuebar-nav{ padding-right:88px; }   /* 64+16+8 */
@media (max-width:480px){
  body.xb-has-reader .xf-launcher{ --xf-size:56px; --xf-bottom:12px; }
  body.xb-has-reader .xuebar-nav{ padding-right:76px; }
}

/* 讀講義時關掉脈衝光環：全站永久跑的 infinite 動畫會干擾閱讀也吃電 */
body.xb-has-reader .xf-launcher::before{ animation:none; opacity:0.35; }

/* 閱讀器列印時本來就會顯示「不提供列印」，不能在那張稿上留一顆浮動鈕 */
@media print{ .xf-launcher, .xf-panel{ display:none !important; } }

@media (prefers-reduced-motion: reduce){
  .xf-launcher, .xf-launcher::before{ animation:none !important; }
  .xf-panel{ transition:none !important; }
}

/* 紅點看過就不再出現 */
.xf-launcher.xf-seen .xf-dot{ display:none; }

/* ── 放大模式（2026-10-06）：長解題在 336px 小窗字太小。桌機變成右側 760px 寬、
      幾乎全高的大窗，字放大；手機直接全螢幕。按右上角同一顆鈕縮回。 ── */
.xf-header .xf-zoom{
  background:none; border:none; color:#C9D2E6; cursor:pointer;
  width:30px; height:30px; padding:5px; border-radius:6px; margin-right:2px;
  display:flex; align-items:center; justify-content:center;
}
.xf-header .xf-zoom:hover{ background:rgba(255,255,255,0.12); color:#fff; }
.xf-header .xf-zoom svg{ width:18px; height:18px; display:block; }
.xf-zoom .xf-zoom-out, .xf-panel.xf-big .xf-zoom .xf-zoom-in{ display:none; }
.xf-panel.xf-big .xf-zoom .xf-zoom-out{ display:block; }
.xf-panel.xf-big{
  width:min(760px, calc(100vw - 48px)); max-width:none;
  top:24px; bottom:24px; height:auto; max-height:none;
  z-index:10000;   /* 蓋過浮動鈕，免得鈕壓在輸入列上 */
}
.xf-panel.xf-big .xf-bubble{ font-size:16.5px; line-height:1.8; padding:12px 16px; }
.xf-panel.xf-big #xfAiView .xf-body{ padding:20px 22px; }
.xf-panel.xf-big .xf-inputbar textarea{ font-size:16px; }
@media (max-width:480px){
  .xf-panel.xf-big{
    top:0; left:0; right:0; bottom:0; width:100%;
    height:100dvh; border-radius:0;
  }
  .xf-panel.xf-big .xf-bubble{ font-size:16px; }
  .xf-panel.xf-big #xfAiView .xf-body{ padding:14px 12px; }
}

/* ── AI 對話版（2026-10）：沿用佳慧原稿的 .xf-body／.xf-msg／.xf-bubble／.xf-inputbar ── */
#xfAiView .xf-body{ padding:14px 12px; position:relative; }   /* position 讓訊息的 offsetTop 以對話框為準 */
#xfAiView .xf-msg{ max-width:94%; }
#xfAiView .xf-msg .xf-bubble-avatar{ width:34px; height:34px; }
#xfAiView .xf-from-user .xf-bubble{ max-width:100%; }
.xf-bubble a{ color:var(--xf-navy); text-decoration:underline; word-break:break-all; }
.xf-from-user .xf-bubble a{ color:var(--xf-gold-soft); }
.xf-bubble .xf-soft{ color:var(--xf-ink-soft); font-size:12px; }
.xf-welcome{ margin:8px 0 10px; display:flex; flex-direction:column; gap:6px; }
.xf-wl{ background:var(--xf-cream); border-radius:10px; padding:7px 10px; line-height:1.5; }
.xf-wl b{ display:block; color:var(--xf-navy); font-size:13.5px; }
.xf-wl span{ display:block; color:var(--xf-ink-soft); font-size:12.5px; }
.xf-more{ margin-top:8px; }
.xf-more summary{ cursor:pointer; color:var(--xf-navy); font-weight:600; }
.xf-contact{ display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.xf-contact a{ display:block; text-align:center; padding:8px 12px; border-radius:999px; background:var(--xf-cream); color:var(--xf-navy); text-decoration:none; font-weight:600; }
.xf-msg.xf-wait .xf-bubble{ color:var(--xf-ink-soft); }
.xf-cta.xf-cta--inline{ display:inline-block; margin-top:8px; padding:8px 22px; font-size:13.5px; text-decoration:none; }
.xf-chatctx{
  flex-shrink:0; font-size:11.5px; color:var(--xf-navy-soft); background:var(--xf-gold-soft);
  padding:5px 12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.xf-chatctx[hidden]{ display:none; }
#xfAiView .xf-quickrow{ padding:8px 12px 2px; background:var(--xf-cream); }
.xf-inputbar textarea{
  flex:1; min-width:0; border:1.5px solid #E7DCC0; border-radius:16px; padding:8px 12px;
  font-size:14px; line-height:1.5; outline:none; font-family:inherit; color:var(--xf-ink);
  background:var(--xf-cream); resize:none; min-height:38px; max-height:120px; overflow-y:auto;
}
.xf-inputbar textarea:focus{ border-color:var(--xf-gold); }
.xf-inputbar textarea:disabled, .xf-send:disabled{ opacity:.5; cursor:not-allowed; }
.xf-chatmeta{
  flex-shrink:0; display:flex; justify-content:space-between; align-items:center; gap:8px;
  font-size:11px; color:var(--xf-ink-soft); padding:0 14px 8px; background:var(--xf-white);
}
.xf-linkbtn{
  border:none; background:none; padding:0; color:var(--xf-ink-soft); font:inherit;
  text-decoration:underline; cursor:pointer;
}
/* iOS 的輸入框字小於 16px 時，一點下去整頁會放大 */
@media (max-width:480px){ .xf-inputbar textarea{ font-size:16px; } }

/* ── 傳圖（2026-10-06）：📷 按鈕、送出前的縮圖預覽、拖拉提示、對話裡的縮圖 ── */
.xf-inputbar{ gap:6px; }
/* 2.7.6：📷 圓鈕改成跟「截圖」同款的「傳圖片」（圖示在上、小字在下）——老師：看到相機以為是截圖 */
.xf-panel .xf-camera{
  flex-shrink:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  min-width:44px; height:38px; padding:0 4px; margin:0; border-radius:10px; border:1.5px solid #E7DCC0; background:var(--xf-cream);
  color:var(--xf-navy); font-family:inherit; font-size:10.5px; font-weight:600; line-height:1.1; letter-spacing:0; text-transform:none; box-shadow:none; cursor:pointer;
}
.xf-panel .xf-camera svg{ width:17px; height:17px; flex-shrink:0; }
@media (max-width:480px){ .xf-panel .xf-camera{ height:44px; min-width:46px; font-size:11px; } }
.xf-panel .xf-camera:hover{ border-color:var(--xf-gold); background:var(--xf-cream); color:var(--xf-navy); }
.xf-panel .xf-camera:disabled{ opacity:.5; cursor:not-allowed; }
/* 2.7.4：「附上畫面」鈕（圖示在上、小字在下），拍照中變灰 */
.xf-panel .xf-shot{ flex-shrink:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  min-width:44px; height:38px; padding:0 4px; margin:0; border-radius:10px; border:1.5px solid #E7DCC0; background:var(--xf-cream);
  color:var(--xf-navy); font-family:inherit; font-size:10.5px; font-weight:600; line-height:1.1; letter-spacing:0; text-transform:none; box-shadow:none; cursor:pointer; }
.xf-panel .xf-shot[hidden]{ display:none; }
.xf-panel .xf-shot svg{ width:17px; height:17px; flex-shrink:0; }
.xf-panel .xf-shot:hover{ border-color:var(--xf-gold); background:var(--xf-cream); color:var(--xf-navy); }
.xf-panel .xf-shot:disabled{ opacity:.5; cursor:not-allowed; }
.xf-panel .xf-shot.xf-shot-busy{ opacity:.6; cursor:progress; }
@media (max-width:480px){ .xf-panel .xf-shot{ height:44px; min-width:46px; font-size:11px; } }
/* file input 不用 display:none：部分舊版 iOS Safari 對 display:none 的 input 呼叫 click() 不開選單 */
.xf-file{ position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; pointer-events:none; }
.xf-attach{
  flex-shrink:0; display:flex; align-items:center; gap:10px; padding:8px 12px 0;
  background:var(--xf-white); border-top:1px solid #EEE3C8; font-size:12px; color:var(--xf-ink-soft);
}
.xf-attach[hidden]{ display:none; }
.xf-attach-thumb{ position:relative; flex-shrink:0; }
.xf-attach-thumb img{
  display:block; width:56px; height:56px; object-fit:contain; background:#fff; border-radius:8px; border:1px solid #E7DCC0;
}
.xf-attach-x{
  position:absolute; top:-8px; right:-8px; width:24px; height:24px; border-radius:50%;
  border:none; background:var(--xf-ink); color:#fff; font-size:15px; line-height:24px;
  padding:0; cursor:pointer; text-align:center;
}
.xf-attach + .xf-inputbar{ border-top:none; }
.xf-bubble .xf-msgimg{
  display:block; max-width:100%; max-height:180px; border-radius:8px; margin:0 0 6px;
  background:#fff;
}
.xf-panel.xf-dragover::after{
  content:'放開就能傳這張圖'; position:absolute; inset:8px; border:2.5px dashed var(--xf-gold);
  border-radius:18px; background:rgba(255,250,238,.92); color:var(--xf-navy);
  display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:600;
  pointer-events:none; z-index:5;
}
/* 手機：按鈕放大到 44px（Apple 建議的最小觸控尺寸），縮圖 × 也放大 */
@media (max-width:480px){
  .xf-panel .xf-camera{ min-width:46px; height:44px; }
  .xf-attach-x{ width:28px; height:28px; line-height:28px; font-size:17px; }
}

/* ── Astra 主題的 button 有 padding:15px 30px（2026-11-03 測試站與正式站實測）：
      送出鈕寬 36px 被撐成 60px 的綠色橢圓，箭頭被擠成 0 寬看不見。按鈕一律自己定 padding。 ── */
.xf-panel .xf-send{ padding:0; min-width:36px; min-height:36px; }
.xf-panel .xf-send svg{ display:block; flex-shrink:0; }
.xf-panel .xf-send:hover, .xf-panel .xf-send:focus{ background:var(--xf-leaf); color:var(--xf-white); border:none; }
/* 標題列有「‹」返回鈕時（引導式）副標會折成兩行：一行放不下就用 … */
.xf-header .xf-tagline{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ── 兩個大分頁（2026-11-05，2.4.3）：一行大標＋一行小字；選中那頁白底、咖啡色底線，沒選的灰底 ── */
.xf-panel .xf-tabs{ display:flex; flex:none; background:#ECE7DF; border-bottom:1px solid #DDD5C8; }
.xf-panel .xf-tab{
  position:relative; flex:1 1 0; min-width:0; margin:0; border:0; border-radius:0;
  border-bottom:3px solid transparent; background:#ECE7DF; color:#6B6458;
  padding:8px 6px 6px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:1px;
  font:inherit; line-height:1.25; text-align:center; box-shadow:none;
}
.xf-panel .xf-tab b{ font-size:15px; font-weight:700; white-space:nowrap; }
.xf-panel .xf-tab small{ font-size:11.5px; font-weight:400; opacity:.9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.xf-panel .xf-tab + .xf-tab{ border-left:1px solid #DDD5C8; }
.xf-panel .xf-tab:hover, .xf-panel .xf-tab:focus{ background:#E4DED4; color:#1D3B64; border-color:transparent; border-bottom-color:transparent; }
.xf-panel .xf-tab.xf-tab-on, .xf-panel .xf-tab.xf-tab-on:hover, .xf-panel .xf-tab.xf-tab-on:focus{ background:#FFFFFF; color:#1D3B64; border-bottom-color:#A8705C; }
.xf-panel .xf-tab:disabled{ cursor:not-allowed; opacity:.6; }
.xf-panel .xf-tab:focus-visible{ outline:2px solid #A8705C; outline-offset:-3px; }
.xf-panel .xf-quickrow[hidden]{ display:none; }
@media (max-width:480px){
  .xf-panel .xf-tab{ padding:7px 4px 5px; }
  .xf-panel .xf-tab b{ font-size:14.5px; }
  .xf-panel .xf-tab small{ font-size:11px; }
}
.xf-panel.xf-big .xf-tab b{ font-size:16px; }
.xf-panel.xf-big .xf-tab small{ font-size:12.5px; }
/* AI 關閉時「網站、客服問題」分頁的畫面 */
.xf-panel .xf-sitelinks{ display:flex; flex-wrap:wrap; gap:8px; margin:0; padding-left:54px; }
.xf-panel .xf-sitelinks a{ display:inline-block; padding:7px 13px; border:1.5px solid var(--xf-navy-soft); border-radius:999px; color:var(--xf-navy); background:var(--xf-white); font-size:13.5px; text-decoration:none; }
.xf-panel .xf-sitelinks a:hover{ background:var(--xf-cream); }
.xf-panel .xf-sitebox{ margin:0; padding-left:54px; }
.xf-panel .xf-site-p{ font-size:13.5px; color:var(--xf-ink-soft); line-height:1.7; margin:0; }
.xf-panel .xf-site-p a{ color:var(--xf-navy); font-weight:700; margin:0 2px; }

/* ── 引導式找卡點（AI 關閉時的保底流程）：2026-10 改 AI 版時這一段的樣式沒有帶過來，
      測試站（AI 關）看到頭像撐滿整個寬度、摘要擠成一段、底部按鈕被切掉。2026-11-03 補回。 ── */
#xfStepView .xf-steps, #xfSiteView .xf-steps{
  flex:1; min-height:0; overflow-y:auto; padding:16px 14px 12px;
  display:flex; flex-direction:column; gap:12px; background:var(--xf-cream);
}
.xf-q{ display:flex; align-items:flex-start; gap:10px; }
.xf-q > img{ width:44px; height:44px; flex-shrink:0; object-fit:contain; border-radius:50%; background:var(--xf-white); margin:0; }
.xf-qtext{
  flex:1; min-width:0; background:var(--xf-white); border-radius:4px 14px 14px 14px;
  padding:10px 12px; font-size:14px; line-height:1.65; color:var(--xf-ink);
  box-shadow:0 1px 2px rgba(29,59,100,.06);
}
.xf-qtext b{ color:var(--xf-navy); }
.xf-ctx{
  font-size:12.5px; line-height:1.55; color:var(--xf-navy-soft); background:var(--xf-gold-soft);
  border-radius:10px; padding:8px 11px;
}
.xf-opts{ display:flex; flex-direction:column; gap:8px; }
.xf-panel .xf-opt{
  display:flex; flex-direction:column; align-items:flex-start; gap:2px; width:100%; margin:0;
  text-align:left; background:var(--xf-white); border:1.5px solid #E7DCC0; border-radius:12px;
  padding:10px 13px; font-family:inherit; font-size:14px; font-weight:600; line-height:1.4;
  color:var(--xf-navy); cursor:pointer;
}
.xf-opt small{ font-size:12px; font-weight:400; color:var(--xf-ink-soft); }
.xf-panel .xf-opt:hover, .xf-panel .xf-opt:focus{ background:var(--xf-white); border-color:var(--xf-gold); color:var(--xf-navy); }
.xf-panel .xf-opt.xf-on, .xf-panel .xf-opt.xf-on:hover, .xf-panel .xf-opt.xf-on:focus{ background:var(--xf-leaf-soft); border-color:var(--xf-leaf); color:var(--xf-navy); }
.xf-actions{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.xf-actions .xf-cta{ margin:0; padding:10px 18px; line-height:1.3; }
.xf-panel .xf-cta:hover, .xf-panel .xf-cta:focus{ background:var(--xf-gold); color:var(--xf-navy); border:none; }
.xf-panel .xf-ghost{
  margin:0; background:var(--xf-white); border:1.5px solid var(--xf-navy-soft); color:var(--xf-navy);
  border-radius:999px; padding:9px 16px; font-family:inherit; font-size:14px; font-weight:700; line-height:1.3; cursor:pointer;
}
.xf-panel .xf-ghost:hover, .xf-panel .xf-ghost:focus{ background:var(--xf-cream); border-color:var(--xf-navy); color:var(--xf-navy); }
.xf-ta{
  display:block; width:100%; min-height:96px; margin:0; border:1.5px solid #E7DCC0; border-radius:12px;
  padding:10px 12px; font-family:inherit; font-size:14px; line-height:1.6; color:var(--xf-ink);
  background:var(--xf-white); resize:vertical; outline:none;
}
.xf-ta:focus{ border-color:var(--xf-gold); }
.xf-sum{
  white-space:pre-wrap; word-break:break-word; background:var(--xf-white);
  border:1.5px dashed var(--xf-gold); border-radius:12px; padding:12px 14px;
  font-size:13.5px; line-height:1.75; color:var(--xf-ink);
}
.xf-note{ font-size:12px; line-height:1.6; color:var(--xf-ink-soft); }
#xfStepView .xf-dots{ flex-shrink:0; display:flex; justify-content:center; gap:6px; padding:8px 0 2px; background:var(--xf-white); }
.xf-dot2{ width:7px; height:7px; border-radius:4px; background:#E7DCC0; }
.xf-dot2.xf-on{ width:18px; background:var(--xf-gold); }
@media (max-width:480px){ .xf-ta{ font-size:16px; } }

/* ---------- 2.5.0（2026-11-06 老師回饋） ---------- */
/* 標語換成新品牌標語：兩句各自一行（窄的時候每句自己截斷，不會從句子中間折行） */
.xf-header .xf-tagline{ white-space:normal; overflow:hidden; font-size:11.5px; line-height:1.35; max-height:2.7em; }
.xf-header .xf-tagline span{ display:inline-block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:top; }
/* 線上客服：三顆等寬按鈕（手機也排整齊） */
.xf-panel .xf-sitegrid{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin:2px 0 12px; }
.xf-panel .xf-sitegrid a{ display:flex; align-items:center; justify-content:center; text-align:center; min-height:46px; padding:6px 6px;
  border:1.5px solid var(--xf-navy-soft); border-radius:12px; background:var(--xf-white); color:var(--xf-navy);
  font-size:13.5px; font-weight:700; line-height:1.3; text-decoration:none; word-break:keep-all; overflow-wrap:anywhere; }
.xf-panel .xf-sitegrid a:hover, .xf-panel .xf-sitegrid a:focus{ background:var(--xf-cream); color:var(--xf-navy); border-color:var(--xf-navy); }
@media (max-width:380px){ .xf-panel .xf-sitegrid a{ font-size:13px; } }
.xf-panel.xf-big .xf-sitegrid a{ font-size:15px; min-height:52px; }
/* 2.7.0（2026-11-11 健檢施工 B5）：訪客常見問答的四顆按鈕（兩欄），直接改本檔，build_assistant.py 尚未同步 */
.xf-panel .xf-sitegrid.xf-gfaq{ grid-template-columns:repeat(2, minmax(0, 1fr)); margin:10px 0 2px; }
.xf-panel .xf-gfaq button{ display:flex; align-items:center; justify-content:center; text-align:center; min-height:44px; padding:6px 8px; font:inherit; font-size:13.5px; line-height:1.35; color:var(--xf-navy); background:#fff; border:1px solid #d9d2c3; border-radius:10px; cursor:pointer; }
.xf-panel .xf-gfaq button:hover, .xf-panel .xf-gfaq button:focus{ background:var(--xf-cream); border-color:var(--xf-navy); }
.xf-panel .xf-cta.xf-cta--inline + .xf-cta.xf-cta--inline{ margin-left:8px; }

/* ── 2.7.3（老師 11-19「開著很佔畫面」）：右上角 × 改成明顯的「— 收起」鈕，至少 40×40（手機點得到）。
      收起只拿掉 .xf-visible，對話與打到一半的字都留著；再點右下角小助教就原樣打開。
      全站主題會改 button 的 padding／min-height／hover 顏色，所以帶 #xfPanel 提高權重。 ── */
#xfPanel .xf-header .xf-close.xf-min{
  display:inline-flex; align-items:center; justify-content:center; gap:6px; flex-shrink:0;
  min-width:44px; min-height:40px; height:40px; padding:0 12px; margin:0;
  background:rgba(255,255,255,0.10); border:1px solid rgba(255,255,255,0.45); border-radius:999px;
  color:#fff; font:600 14px/1 -apple-system,BlinkMacSystemFont,"PingFang TC","Microsoft JhengHei","Noto Sans TC",sans-serif;
  letter-spacing:.05em; cursor:pointer; box-shadow:none; text-transform:none;
}
#xfPanel .xf-header .xf-close.xf-min:hover,
#xfPanel .xf-header .xf-close.xf-min:focus{ background:rgba(255,255,255,0.22); color:#fff; border-color:rgba(255,255,255,0.7); }
#xfPanel .xf-header .xf-close.xf-min:focus-visible{ outline:2px solid #f2b705; outline-offset:2px; }
#xfPanel .xf-min .xf-min-bar{ display:block; width:12px; height:2px; border-radius:2px; background:currentColor; }
@media (max-width:380px){
  #xfPanel .xf-header .xf-close.xf-min{ padding:0 10px; gap:4px; font-size:13px; }
}
/* 2.7.4（老師 11-19 更正）：框開著時小助教泡泡藏起來（泡泡跟框不同時出現）；收起（— 收起、點框外面、Esc）後回來。
   2.7.5：改用 .xf-away（assistant.js 打開時加、縮回泡泡的動畫結束才拿掉），淡出淡入。 */
#xfLauncher{ transition:opacity .14s ease, visibility .14s; }
.xf-launcher.xf-away{ visibility:hidden; opacity:0; }
/* 2.7.5（老師 11-20）：框從泡泡長出來——框的右下角對齊小助教泡泡的右下角（assistant.js anchor() 寫 --xf-ar／--xf-ab），放大模式不套用。
   開／收動畫由 assistant.js 用 Web Animations 做（從泡泡放大、圓形長成長方形；收時反向縮回泡泡），原本的 CSS 位移淡入關掉，免得兩套疊在一起。 */
#xfPanel.xf-anch:not(.xf-big){ right:var(--xf-ar) !important; bottom:var(--xf-ab) !important; max-height:calc(100dvh - var(--xf-ab) - 16px) !important; max-width:calc(100vw - var(--xf-ar) - 12px); }
#xfPanel{ transition:none; }
/* 2.7.4：多了「附上畫面」鈕，手機輸入框變窄，提示字不換行（超出用…） */
#xfChatInput::placeholder{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* 2.7.8（老師 11-21）：「表情」鈕（emoji.js 建在輸入框左邊）跟「截圖」同款（圖示在上、小字在下）；面板放在輸入列正上方、不蓋對話 */
.xf-panel .xf-emo{ flex-shrink:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  min-width:44px; height:38px; padding:0 4px; margin:0; border-radius:10px; border:1.5px solid #E7DCC0; background:var(--xf-cream);
  color:var(--xf-navy); font-family:inherit; font-size:10.5px; font-weight:600; line-height:1.1; letter-spacing:0; text-transform:none; box-shadow:none; cursor:pointer; }
.xf-panel .xf-emo .xbemo-svg{ width:17px; height:17px; }
.xf-panel .xf-emo:hover, .xf-panel .xf-emo:focus{ border-color:var(--xf-gold); background:var(--xf-cream); color:var(--xf-navy); }
.xf-panel .xf-emo.on, .xf-panel .xf-emo.on:hover, .xf-panel .xf-emo.on:focus{ border-color:var(--xf-navy); background:var(--xf-navy); color:#fff; }
.xf-panel .xf-emo:disabled{ opacity:.5; cursor:not-allowed; }
@media (max-width:480px){ .xf-panel .xf-emo{ height:44px; min-width:46px; font-size:11px; } }
.xf-panel .xbemo{ flex-shrink:0; margin:6px 10px 0; }

/* 2.7.9（老師 11-21：「輸入的時候會很難打字，可能要獨立一排給他？」）：輸入列改兩排——
   上排＝工具鈕（傳圖片、截圖、表情）小的橫排、靠左；下排＝輸入框吃滿剩下的寬度＋送出。
   DOM 順序不變（markup.php、emoji.js 都沒動），用 order＋一個 100% 寬的換行塊排開。表情面板照舊插在整個輸入列上方，不蓋輸入框。 */
#xfChatForm.xf-inputbar{ flex-wrap:wrap; row-gap:0; column-gap:6px; align-items:flex-end; }
#xfChatForm.xf-inputbar::after{ content:""; order:1; flex:0 0 100%; height:0; }
.xf-panel #xfChatForm .xf-camera, .xf-panel #xfChatForm .xf-shot, .xf-panel #xfChatForm .xf-emo{
  order:0; flex-direction:row; gap:4px; min-width:0; height:32px; padding:0 10px; margin:0 0 6px;
  border-radius:9px; font-size:12px; line-height:1; }
.xf-panel #xfChatForm .xf-camera svg, .xf-panel #xfChatForm .xf-shot svg, .xf-panel #xfChatForm .xf-emo .xbemo-svg{ width:15px; height:15px; }
#xfChatForm.xf-inputbar textarea{ order:2; flex:1 1 0; min-width:0; }
#xfChatForm.xf-inputbar .xf-send{ order:3; }
@media (max-width:480px){
  .xf-panel #xfChatForm .xf-camera, .xf-panel #xfChatForm .xf-shot, .xf-panel #xfChatForm .xf-emo{ height:36px; min-width:0; padding:0 11px; font-size:12.5px; }
}
/* 2.7.9：測試站另有 mu-plugin xuebar-assistant-kbd 在同一排加「±α 符號」鈕（.xbmk-btn.xbak-btn，它自己的樣式是 44px 直排）。
   兩個 id 的權重蓋過它的 #xfPanel .xf-inputbar .xbmk-btn.xbak-btn，跟其他工具鈕一樣小的橫排、排在上排；那支外掛不用改。 */
#xfPanel #xfChatForm .xbmk-btn.xbak-btn{ order:0; flex-direction:row; gap:4px; min-width:0; min-height:0; height:32px; padding:0 10px; margin:0 0 6px;
  align-self:auto; border-radius:9px; font-size:12px; line-height:1; }
#xfPanel #xfChatForm .xbak-btn .xbmk-bt{ font-size:12px; }
@media (max-width:480px){ #xfPanel #xfChatForm .xbmk-btn.xbak-btn{ height:36px; padding:0 11px; font-size:12.5px; } #xfPanel #xfChatForm .xbak-btn .xbmk-bt{ font-size:12.5px; } }

/* 2.8.0（老師 11-21）：對話貼圖（xuebar-stickers）。鈕跟「表情」同一套（xf-emo）；面板跟表情一樣放在輸入列正上方，格子區自己捲動、不把對話擠掉。
   對話裡的貼圖約 120px、不包泡泡。 */
.xf-panel .xbstk{ flex-shrink:0; margin:6px 10px 0; }
.xf-panel .xbstk .xbstk-grid{ max-height:min(330px,42vh); }   /* 2.8.1：一排 3 張，格子大了，多給一點高度 */
.xf-panel #xfChatForm .xf-stk .xbstk-svg{ width:15px; height:15px; }
.xf-panel .xf-msg.xf-stkm{ background:transparent; }
.xf-panel .xf-msg.xf-stkm .xbstk-msg{ margin:2px 0; }
/* 多了貼圖鈕，上排五顆（傳圖片、截圖、表情、貼圖、±α 符號）：左右內距收窄、間距 5px，1280（框內 312px）與 390 都排得進一排 */
#xfPanel #xfChatForm{ column-gap:5px; }
#xfPanel #xfChatForm .xf-camera, #xfPanel #xfChatForm .xf-shot, #xfPanel #xfChatForm .xf-emo, #xfPanel #xfChatForm .xbmk-btn.xbak-btn{ padding:0 5px; }
@media (max-width:480px){ #xfPanel #xfChatForm .xf-camera, #xfPanel #xfChatForm .xf-shot, #xfPanel #xfChatForm .xf-emo, #xfPanel #xfChatForm .xbmk-btn.xbak-btn{ padding:0 6px; } }
