/* =====================================================================
   Muajee 介面統一 2026-10-10c（Logo、頁尾、後台設定頁、信件模板、登入閃動）
   放在每頁最後載入；要撤掉這批外觀，只要拿掉各頁的這一行 <link>。
   ===================================================================== */

/* ---------- Logo ---------- */
.logo{ display:inline-flex; align-items:center; gap:10px; text-decoration:none; flex-shrink:0; }
.logo .logo-img{ display:block; height:44px; width:auto; max-width:none; }
.logo .logo-badge{
  font-size:12px; font-weight:800; color:#222428; background:#ececea; border:1px solid #e6d8ca;
  padding:3px 10px; border-radius:999px; white-space:nowrap;
}
@media (max-width:900px){ .logo .logo-img{ height:36px; } }
@media (max-width:600px){ .logo .logo-img{ height:30px; } .logo .logo-badge{ font-size:11px; padding:2px 8px; } }

/* ---------- 頁尾 ---------- */
.site-footer .footer-logo{ display:block; height:40px; width:auto; margin-bottom:12px; }
.site-footer .footer-col a, .site-footer .footer-col h4{ overflow-wrap:anywhere; }
.admin-footer{ text-align:center; color:#7a7d83; font-size:13px; padding:28px 16px 36px; }

/* ---------- 賣家中心右上角：確認登入狀態前先不顯示，避免先閃「註冊／登入」 ---------- */
/* 只套用在賣家中心頁面（有 .dashboard-container 的頁面），管理後台不受影響 */
html:not(.muj-seller-auth-done) body:has(.dashboard-container) header.topbar .header-actions > a.btn-cart,
html:not(.muj-seller-auth-done) body:has(.dashboard-container) header.topbar .header-actions > a.btn-buy{ visibility:hidden; }

/* ---------- 後台表單（系統設定、信件模板共用） ---------- */
.st-form{ max-width:980px; }
.st-card{ background:#fff; border:1px solid #e4e4e1; border-radius:16px; padding:22px 24px; margin-bottom:18px; }
.st-card h2{ font-size:18px; font-weight:800; margin:0 0 14px; color:#222428; }
.st-hint{ font-size:13px; color:#7a7d83; margin:-6px 0 14px; line-height:1.6; }
.st-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 18px; }
.st-field{ display:flex; flex-direction:column; gap:6px; margin-bottom:12px; font-size:14px; min-width:0; }
.st-field > span{ font-weight:700; color:#222428; font-size:13.5px; }
.st-field input, .st-field textarea, .st-field select{
  width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid #cdcecb; border-radius:10px;
  font-size:14.5px; font-family:inherit; background:#fff; color:#222428;
}
.st-field input:focus, .st-field textarea:focus{ outline:none; border-color:#222428; box-shadow:0 0 0 3px rgba(34,36,40,.12); }
.st-field textarea{ resize:vertical; line-height:1.7; }
.st-check{ display:flex; gap:10px; align-items:flex-start; font-size:14px; padding:10px 0; cursor:pointer; }
.st-check input{ margin-top:4px; width:18px; height:18px; }
.st-check small{ color:#7a7d83; }
.st-actions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:6px 0 18px; }
.st-actions #saveMsg, .st-actions #pwdMsg, .st-actions #mtMsg{ font-size:14px; }
.st-btn{ background:#222428; color:#fff; border:none; border-radius:999px; padding:11px 24px; font-size:14.5px; font-weight:700; cursor:pointer; min-height:42px; font-family:inherit; }
.st-btn:hover{ background:#3a3d43; }
.st-btn.ghost{ background:#fff; color:#222428; border:1px solid #cdcecb; }
.st-btn.ghost:hover{ background:#f5f5f3; }
.st-btn:disabled{ opacity:.6; cursor:default; }
.st-link{ margin-left:auto; font-size:13.5px; color:#222428; }
@media (max-width:700px){ .st-grid{ grid-template-columns:minmax(0,1fr); } .st-card{ padding:18px 16px; } .st-link{ margin-left:0; } }

/* ---------- 信件模板 ---------- */
.mt-sender{ border-radius:12px; padding:12px 16px; margin-bottom:16px; font-size:14px; }
.mt-sender.ok{ background:#eaf6ee; color:#1f6b38; border:1px solid #bfe3cb; }
.mt-sender.bad{ background:#fdecea; color:#8a2a1d; border:1px solid #f3b8b0; }
.mt-layout{ display:grid; grid-template-columns:280px minmax(0,1fr) minmax(0,400px); gap:18px; align-items:start; }
.mt-list{ display:flex; flex-direction:column; gap:8px; }
.mt-item{ text-align:left; background:#fff; border:1px solid #e4e4e1; border-radius:12px; padding:12px 14px; cursor:pointer; font-family:inherit; display:flex; flex-direction:column; gap:4px; }
.mt-item b{ font-size:14.5px; color:#222428; }
.mt-item small{ color:#7a7d83; font-size:12.5px; line-height:1.5; }
.mt-item.active{ border-color:#222428; box-shadow:0 0 0 2px rgba(34,36,40,.15); background:#fffaf5; }
.mt-tags{ display:flex; gap:6px; flex-wrap:wrap; }
.mt-tags i{ font-style:normal; font-size:11.5px; background:#ececea; color:#222428; border-radius:999px; padding:1px 8px; }
.mt-tags i.off{ background:#fde3df; color:#b3261e; }
.mt-tags i.cus{ background:#e5f4ea; color:#1f7a3f; }
.mt-head{ display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.mt-switch{ display:flex; align-items:center; gap:8px; font-weight:700; font-size:14px; white-space:nowrap; cursor:pointer; }
.mt-switch input{ width:18px; height:18px; }
.mt-vars{ margin:-4px 0 14px; }
.mt-vars > .st-hint{ display:block; margin:0 0 8px; }
#mtVars{ display:flex; flex-wrap:wrap; gap:6px; }
.mt-chip{ border:1px dashed #cdb8a4; background:#f5f5f3; border-radius:8px; padding:5px 9px; font-size:12.5px; cursor:pointer; font-family:ui-monospace,Menlo,Consolas,monospace; color:#222428; display:flex; flex-direction:column; align-items:flex-start; }
.mt-chip small{ font-family:inherit; color:#7a7d83; font-size:11px; }
.mt-test{ display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; border-top:1px solid #ececea; padding-top:14px; margin-top:4px; }
.mt-test .st-field{ flex:1; min-width:200px; margin-bottom:0; }
.mt-preview{ position:sticky; top:16px; }
.mt-preview-head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
.mt-preview-head .st-hint{ margin:0; }
.mt-mail{ background:#fff; border:1px solid #e4e4e1; border-radius:16px; overflow:hidden; }
.mt-mail-meta{ background:#f5f5f3; padding:12px 16px; font-size:13px; display:flex; flex-direction:column; gap:4px; border-bottom:1px solid #ececea; }
.mt-mail-meta span{ color:#7a7d83; display:inline-block; width:52px; }
.mt-mail-body{ padding:20px 18px 24px; font-size:14px; line-height:1.8; color:#222428; overflow-wrap:anywhere; }
.mt-mail-logo{ height:30px; width:auto; margin-bottom:14px; display:block; }
.mt-mail-body a{ color:#222428; }
.mt-empty{ color:#7a7d83; padding:20px; text-align:center; }
@media (max-width:1200px){ .mt-layout{ grid-template-columns:240px minmax(0,1fr); } .mt-preview{ grid-column:2; position:static; } }
@media (max-width:800px){ .mt-layout{ grid-template-columns:minmax(0,1fr); } .mt-preview{ grid-column:auto; } .mt-list{ flex-direction:row; overflow-x:auto; } .mt-item{ min-width:220px; } }

/* 管理後台：搜尋框藏起來後，登出按鈕維持在右邊 */
body:has(.admin-container) header.topbar .header-actions{ margin-left:auto; }
