/* ═══════════════════════════════════════════════════════════════
   工具外殼.css — deyi.lab 全站統一工具外殼（第三波A，樣板間＝輪播貼文）
   格局照「限時動態」（德意唯一滿意的）：頂欄統一、左＝預覽畫布佔大、
   右＝設計面板固定 380px；手機時面板收合成底部抽屜。
   視覺照 DESIGN.md：米白 #FDFBF3 / 墨黑 #1a1a1a / 古銅金 #8A7556 / 思源宋。
   搭配 工具外殼.js 使用：Shell.init / ShellPanel.section / ShellMy.mount
   ═══════════════════════════════════════════════════════════════ */
:root{
  --sh-paper:#FDFBF3; --sh-ink:#1a1a1a; --sh-gold:#8A7556; --sh-gold2:#C8A86A;
  --sh-gold-soft:rgba(138,117,86,.12); --sh-line:rgba(138,117,86,.28); --sh-mut:#6b6459;
  --sh-panel-w:380px;
}
.shell-body{margin:0;font-family:"Noto Serif TC","Songti TC",serif;color:var(--sh-ink);line-height:1.7;
  background:linear-gradient(135deg,#FCFAF4 0%,#FFFFFF 48%,#F5EEE0 100%);background-attachment:fixed}

/* ── 頂欄（統一高度 54px） ─────────────────────────── */
.shell-top{position:sticky;top:0;z-index:120;display:flex;align-items:center;gap:10px;height:54px;box-sizing:border-box;
  padding:0 16px;background:rgba(253,251,243,.94);backdrop-filter:blur(6px);border-bottom:1.5px solid var(--sh-line)}
.shell-top .st-back{font-family:'Noto Sans TC',sans-serif;font-size:12px;color:var(--sh-gold);cursor:pointer;
  border:1px solid rgba(138,117,86,.45);border-radius:8px;padding:3px 10px;text-decoration:none;background:#fff;white-space:nowrap}
.shell-top .st-title{font-weight:900;font-size:17px;color:var(--sh-ink);white-space:nowrap}
.shell-top .st-title .dot{color:var(--sh-gold)}
.shell-top .st-um{font-family:'Noto Sans TC',sans-serif;font-size:11px;color:#8a857b}
.shell-top .st-slot{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden}
.shell-top .st-chip{font-family:'Noto Sans TC',sans-serif;font-size:11.5px;color:var(--sh-gold);background:rgba(200,149,68,.12);
  border:1px solid rgba(138,117,86,.35);border-radius:999px;padding:3px 11px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px}
.shell-top .st-right{margin-left:auto;display:flex;align-items:center;gap:8px}
.shell-top .st-btn{font-family:'Noto Sans TC',sans-serif;font-size:12px;color:var(--sh-gold);cursor:pointer;
  border:1px solid rgba(138,117,86,.45);border-radius:8px;padding:3px 10px;background:#fff;text-decoration:none;white-space:nowrap}
.shell-top .st-btn:hover{background:var(--sh-gold-soft)}

/* ── 主體：左預覽（佔大）＋右設計面板（固定寬） ───────── */
.shell-main{display:flex;gap:18px;align-items:flex-start;max-width:1440px;margin:0 auto;padding:14px 16px 90px}
.shell-left{flex:1;min-width:0}
.shell-panel{width:var(--sh-panel-w);flex-shrink:0;position:sticky;top:64px;max-height:calc(100vh - 78px);
  overflow-y:auto;overscroll-behavior:contain;padding:0 2px 20px;scrollbar-width:thin}
.shell-drawer-handle{display:none}

/* ── 右面板：手風琴四區 ─────────────────────────── */
.shp-sec{background:#fff;border:1.5px solid rgba(138,117,86,.22);border-radius:4px;margin-bottom:10px;overflow:hidden}
.shp-head{display:flex;align-items:center;gap:8px;padding:11px 14px;cursor:pointer;user-select:none;
  font-weight:700;font-size:14.5px;color:var(--sh-ink)}
.shp-head .ic{width:20px;text-align:center}
.shp-head .ar{margin-left:auto;color:var(--sh-gold);font-size:12px;transition:transform .18s}
.shp-sec.open .shp-head .ar{transform:rotate(90deg)}
.shp-head:hover{background:#FCF9F2}
.shp-body{display:none;padding:2px 14px 14px;border-top:1px solid rgba(138,117,86,.14)}
.shp-sec.open .shp-body{display:block}

/* ── 面板內通用控件（工具頁直接用這些 class） ───────── */
.shp-body label.f{display:block;margin:10px 0 4px;font-weight:600;font-size:13px}
.shp-body input.f,.shp-body textarea.f,.shp-body select.f{width:100%;box-sizing:border-box;padding:9px 12px;
  border:1.5px solid rgba(138,117,86,.3);border-radius:4px;font-family:inherit;font-size:14px;background:#fff;color:var(--sh-ink)}
.shp-body .hintline{font-size:12px;color:var(--sh-mut);margin-top:4px;font-family:'Noto Sans TC',sans-serif}
.shp-body .seg{display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}
.shp-body .seg .opt{border:1.5px solid rgba(138,117,86,.22);border-radius:3px;padding:6px 13px;cursor:pointer;background:#fff;font-size:13px;user-select:none;color:var(--sh-mut)}
.shp-body .seg .opt:hover{color:var(--sh-gold);border-color:rgba(138,117,86,.5)}
.shp-body .seg .opt.on{background:rgba(200,149,68,.18);color:var(--sh-gold);border-color:var(--sh-gold2);font-weight:700}
.shp-body .row{display:flex;gap:8px;align-items:center;margin:8px 0;flex-wrap:wrap;font-size:13px}
.shp-body .row label{font-weight:600;min-width:44px;font-size:13px}
.shp-body input[type=range]{flex:1;accent-color:var(--sh-gold);min-width:100px}
.shp-btn{font-family:inherit;font-size:14px;border-radius:4px;padding:9px 16px;border:1.5px solid var(--sh-gold2);
  background:var(--sh-gold2);color:#2a2620;cursor:pointer;font-weight:700}
.shp-btn.ghost{background:#fff;color:var(--sh-gold);border-color:rgba(138,117,86,.45);font-weight:400}
.shp-btn.sm{padding:5px 11px;font-size:12.5px}
.shp-btn:disabled{opacity:.5;cursor:not-allowed}
.shp-btn.ghost:hover{background:var(--sh-gold-soft)}
.shp-mut{font-size:12px;color:var(--sh-mut);font-family:'Noto Sans TC',sans-serif}

/* ── 「我的」區（外殼自帶樣式） ─────────────────────── */
.shmy-group{margin:12px 0 4px;font-weight:700;font-size:13px;color:var(--sh-gold);display:flex;align-items:center;gap:6px}
.shmy-item{display:flex;align-items:center;gap:8px;border:1px solid var(--sh-line);border-radius:4px;
  padding:7px 10px;margin-top:7px;font-size:12.5px;background:#fff;font-family:'Noto Sans TC',sans-serif}
.shmy-item .th{width:34px;height:42px;border-radius:3px;object-fit:cover;background:#efe8d8;flex-shrink:0}
.shmy-item .nm{flex:1;min-width:0}
.shmy-item .nm b{display:block;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shmy-item .nm span{font-size:11px;color:var(--sh-mut)}
.shmy-empty{font-size:12px;color:var(--sh-mut);padding:8px 2px;font-family:'Noto Sans TC',sans-serif}
.shmy-brand{background:var(--sh-gold-soft);border-radius:4px;padding:9px 11px;font-size:12.5px;margin-top:7px;font-family:'Noto Sans TC',sans-serif}

/* ── 生成鎖屏遮罩 ─────────────────────────────── */
#shell-overlay{position:fixed;inset:0;background:rgba(253,251,243,.88);backdrop-filter:blur(3px);z-index:400;
  display:none;align-items:center;justify-content:center;flex-direction:column;gap:14px}
#shell-overlay.show{display:flex}
#shell-overlay .spinner{width:44px;height:44px;border-radius:50%;border:4px solid var(--sh-gold-soft);border-top-color:var(--sh-gold);animation:shspin 1s linear infinite}
@keyframes shspin{to{transform:rotate(360deg)}}
#shell-overlay-txt{font-size:14px;color:var(--sh-ink)}

/* ── toast ── */
#shell-toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);background:rgba(26,26,26,.92);
  color:#F8F5EE;font-size:13px;padding:9px 18px;border-radius:999px;z-index:9999;opacity:0;transition:opacity .25s;pointer-events:none;font-family:'Noto Sans TC',sans-serif}

/* ── 3 步小導覽 ── */
#shell-tour{position:fixed;inset:0;z-index:500;display:none}
#shell-tour.show{display:block}
#shell-tour .tour-dim{position:absolute;inset:0;background:rgba(26,26,26,.45)}
#shell-tour .tour-hole{position:absolute;border:2px solid var(--sh-gold2);border-radius:8px;
  box-shadow:0 0 0 9999px rgba(26,26,26,.45);pointer-events:none;transition:all .25s}
#shell-tour .tour-card{position:absolute;background:#fff;border:1.5px solid var(--sh-line);border-radius:8px;
  padding:14px 16px;max-width:290px;font-family:'Noto Sans TC',sans-serif;box-shadow:0 14px 40px -12px rgba(60,44,20,.5)}
#shell-tour .tour-card b{display:block;font-size:14px;margin-bottom:5px;font-family:'Noto Serif TC',serif}
#shell-tour .tour-card p{margin:0 0 10px;font-size:12.5px;color:var(--sh-mut);line-height:1.6}
#shell-tour .tour-card .tr{display:flex;gap:8px;align-items:center}
#shell-tour .tour-card .step{font-size:11px;color:var(--sh-gold);margin-right:auto}

/* ── modal 基底（Pexels／我的圖庫 共用；靠右不遮左邊預覽） ── */
.shell-modal{position:fixed;inset:0;z-index:300;display:none;justify-content:flex-end;align-items:flex-end;padding:14px;pointer-events:none}
.shell-modal.show{display:flex}
.shell-modal .mbox{pointer-events:auto;background:#fff;border-radius:10px;width:min(430px,94vw);max-height:calc(100vh - 90px);
  overflow:auto;padding:16px;border:1.5px solid var(--sh-line);box-shadow:0 24px 80px -12px rgba(60,44,20,.55)}
.shell-modal .mbox h3{margin:0 0 10px;font-size:15px}
.shell-modal .mclose{float:right;border:none;background:none;color:var(--sh-mut);font-size:18px;cursor:pointer;padding:2px 8px}
@media(max-width:900px){.shell-modal{justify-content:center;align-items:center;background:rgba(60,52,40,.4);pointer-events:auto}}

/* ── 手機（≤900px）：右面板收合成底部抽屜 ───────────── */
@media (max-width:900px){
  .shell-main{flex-direction:column;padding-bottom:120px}
  .shell-panel{position:fixed;left:0;right:0;bottom:0;top:auto;width:100%;max-height:0;z-index:200;
    background:var(--sh-paper);border-top:1.5px solid var(--sh-line);border-radius:14px 14px 0 0;
    padding:0 12px;transition:max-height .25s ease;box-shadow:0 -12px 40px -18px rgba(60,44,20,.45)}
  .shell-panel.open{max-height:72vh;padding:8px 12px 24px}
  .shell-drawer-handle{display:flex;position:fixed;left:50%;bottom:12px;transform:translateX(-50%);z-index:210;
    align-items:center;gap:8px;background:var(--sh-gold2);color:#2a2620;font-weight:700;font-size:14px;
    border:none;border-radius:999px;padding:11px 22px;cursor:pointer;font-family:'Noto Sans TC',sans-serif;
    box-shadow:0 10px 26px -8px rgba(60,44,20,.5)}
  .shell-panel.open ~ .shell-drawer-handle{bottom:calc(72vh + 10px)}
  .shell-top .st-um{display:none}
  .shell-top .st-chip{max-width:130px;min-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}
}
