:root{
  --bg:#FDF7F0;
  /* A1：後台覆蓋層級單一來源（數字越大越上層）。全螢幕編輯器是 3000，任何要蓋在編輯器上的選單、選取器、對話框都要用這些變數，不要再寫死數字。 */
  --bb-layer-editor:3000;
  --bb-layer-editor-menu:3300;
  --bb-layer-modal:3500;
  --bb-layer-dialog:3600;
  --bb-layer-viewer:6000;
  --bb-layer-cropper:6100;
  --bb-layer-popover:9999;
  --paper:#fffaf4;
  --card:#ffffff;
  --surface:#fffdf9;
  --surface-raised:#ffffff;
  --surface-muted:#f8f0e7;
  --line:#e8d9c6;
  --line-strong:#d8c1a8;
  --ink:#2F2F2F;
  --muted:#716358;
  --brand:#98623D;
  --brand-deep:#6B4226;
  --brand-soft:#F6EAD7;
  /* Admin chrome aliases; content colors remain owned by the site renderer. */
  --accent:var(--brand);
  --border:var(--line);
  --text:var(--ink);
  --text-muted:var(--muted);
  --control-border:#8B7767;
  --control-disabled-bg:#EEE7DF;
  --control-font:"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
  --control-height:44px;
  --control-radius:12px;
  --focus-ring:rgba(152,98,61,.26);
  --good:#2f7a4d;
  --bad:#b1483f;
  --danger:#b44b43;
  --sidebar-bg:#FDF7F0;
  --sidebar-ink:var(--ink);
  --sidebar-muted:var(--muted);
  --radius:16px;
  --shadow-soft:0 8px 30px rgba(90,63,36,.07);
  --shadow-lift:0 12px 36px rgba(90,63,36,.12);
}

*{box-sizing:border-box}
[hidden]{display:none !important}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font:15px/1.6 "Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3{
  font-family:"Noto Serif TC","Noto Sans TC",serif;
  letter-spacing:.02em;
}

.subtle{margin:0;color:var(--muted);font-size:13.5px}

/* ===================== 登入畫面 ===================== */

.login-screen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(1100px 500px at 80% -10%, #f1e2cf 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #efe0cd 0%, transparent 55%),
    var(--bg);
}

.login-screen__panel{
  width:100%;
  max-width:400px;
  background:rgba(255,255,255,.92);
  border:1px solid var(--line);
  border-radius:24px;
  padding:40px 36px 32px;
  box-shadow:var(--shadow-lift);
  backdrop-filter:blur(8px);
  animation:loginIn .5s cubic-bezier(.22,1,.36,1) both;
}

@keyframes loginIn{
  from{opacity:0;transform:translateY(16px) scale(.985)}
  to{opacity:1;transform:none}
}

.login-screen__logo{
  display:block;
  height:104px;
  width:104px;
  object-fit:contain;
  padding:0;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  margin:0 auto 20px;
}

.login-screen__panel h1{
  margin:0 0 28px;
  font-size:24px;
  text-align:center;
}

.login-screen__submit{
  width:100%;
  margin-top:6px;
  padding:13px;
  font-weight:700;
  letter-spacing:.12em;
}

.status--login{margin-top:16px;text-align:center;font-size:13.5px}

/* ===================== App 殼層 ===================== */

.app{
  display:grid;
  grid-template-columns:248px minmax(0,1fr);
  min-height:100vh;
}

/* ---------- 側邊欄 ---------- */

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--sidebar-bg);
  color:var(--sidebar-ink);
  padding:22px 16px 18px;
}

.sidebar__brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:4px 8px 20px;
  border-bottom:1px solid rgba(60,43,26,.14);
}

.sidebar__logo{
  width:56px;
  height:56px;
  border-radius:0;
  background:transparent;
  padding:0;
  object-fit:contain;
}

.sidebar__brand-name{
  font-weight:700;
  font-size:15.5px;
  letter-spacing:.04em;
}

.sidebar__brand-sub{
  font-size:12px;
  color:var(--sidebar-muted);
  letter-spacing:.06em;
}

.sidebar__nav{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:4px;
  padding-top:16px;
  overflow-y:auto;
}

.sidebar__nav-group{
  margin:14px 10px 6px;
  font-size:11.5px;
  letter-spacing:.18em;
  color:var(--sidebar-muted);
}

.sidebar__nav-group:first-child{margin-top:0}

.sidebar__item{
  display:flex;
  align-items:center;
  gap:11px;
  width:100%;
  text-align:left;
  background:transparent;
  border:none;
  border-radius:12px;
  padding:11px 12px;
  color:var(--sidebar-ink);
  font-size:14.5px;
  cursor:pointer;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}

.sidebar__item:hover{
  background:rgba(152,98,61,.10);
  transform:translateX(2px);
}

.sidebar__item.is-active{
  background:var(--brand);
  color:#fff;
  font-weight:700;
  box-shadow:0 6px 16px rgba(0,0,0,.25);
}

.sidebar__icon{
  display:inline-flex;
  width:20px;
  justify-content:center;
  font-size:15px;
  opacity:.85;
}

.sidebar__footer{
  border-top:1px solid rgba(60,43,26,.14);
  padding-top:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.badge{
  font-size:12.5px;
  color:var(--sidebar-muted);
  padding:0 4px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.sidebar__footer-actions{
  display:flex;
  gap:8px;
}

.sidebar__footer-actions button{flex:1}

.sidebar__mobile-toggle{display:none}

.sidebar__subnav{
  display:none;
  flex-direction:column;
  gap:2px;
  padding-left:8px;
  margin-bottom:4px;
}
.sidebar__subnav.is-open{ display:flex; }
.sidebar__subitem{
  display:block;
  width:100%;
  text-align:left;
  background:transparent;
  border:none;
  border-radius:8px;
  padding:7px 10px 7px 20px;
  color:var(--sidebar-muted);
  font-size:13px;
  cursor:pointer;
  transition:background .15s,color .15s;
}
.sidebar__subitem:hover{
  background:rgba(152,98,61,.08);
  color:var(--sidebar-ink);
}
.sidebar__subitem.is-active{
  color:var(--sidebar-ink);
  font-weight:600;
}

/* ---------- 主內容 ---------- */

.main{
  min-width:0;
  padding:30px 36px 60px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin-bottom:24px;
}

.topbar h2{
  margin:0 0 4px;
  font-size:25px;
}

/* ===================== 面板切換動畫 ===================== */

.panel{display:none}
.panel.is-active{
  display:block;
  animation:panelIn .32s cubic-bezier(.22,1,.36,1) both;
}

/* 注意：keyframe 不可含 transform —— animation-fill-mode:both 會在動畫結束後
   留下 matrix(1,0,0,1,0,0) 身分矩陣，使 .panel / .editor-form 成為 fixed 的
   containing block，導致 WP 全螢幕編輯器被侷限在面板內。故只動 opacity。 */
@keyframes panelIn{
  from{opacity:0}
  to{opacity:1}
}

.panel__toolbar{
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:18px;
}

.panel__header{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:16px;
}

.panel__header h3{margin:0 0 6px;font-size:18px}

/* ===================== 卡片與統計 ===================== */

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:20px;
  padding:24px;
  box-shadow:var(--shadow-soft);
}

.card--narrow{max-width:560px}

.stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:20px;
}

.stat{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow-soft);
  transition:transform .2s ease,box-shadow .2s ease;
}

.stat:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-lift);
}

.stat .k{font-size:12.5px;color:var(--muted);letter-spacing:.06em}
.stat .v{font-size:30px;font-weight:700;margin-top:6px;font-family:"Noto Serif TC",serif}
.stat .v--small{font-size:16px;line-height:1.45}

.result-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:16px;
}

.result-box{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
}

.result-box pre{
  white-space:pre-wrap;
  word-break:break-word;
  margin:8px 0 0;
  color:var(--muted);
  font-size:13px;
}

/* ===================== 表單 ===================== */

.field{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-bottom:14px;
}

.field label{
  font-size:13px;
  color:var(--muted);
  letter-spacing:.03em;
}

input:not([type]),
input[type="search"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="text"],
input[type="file"],
textarea,
select,
button{
  font:inherit;
  font-family:var(--control-font);
}

/* 品牌色與區塊覆寫都使用同一個可觸控色票，避免 390px 上出現難以操作的小方格。 */
.brand-color-control,
.hexpick{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.hexpick{margin-top:4px;}
.brand-color-picker,
.block-color-picker{
  width:48px;
  min-width:44px;
  height:44px;
  min-height:44px;
  padding:2px;
  border:1px solid var(--control-border);
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  flex:0 0 auto;
}
.brand-color-control input[type="text"]{width:min(100%, 132px) !important;}
.hexpick input[type="text"]{flex:1 1 180px;}

/* checkbox/radio/range/file/hidden 維持原生控制；色票另以 .brand-color-picker/.block-color-picker 統一 44px 操作面積。 */
input:not([type]),
input[type="search"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="text"],
textarea,
select{
  width:100%;
  min-width:0;
  max-width:100%;
  min-height:var(--control-height);
  border:1px solid var(--control-border);
  background:var(--surface);
  color:var(--ink);
  border-radius:var(--control-radius);
  padding:11px 14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72);
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}

input:where(:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"])):focus,
textarea:focus,
select:focus{
  outline:2px solid var(--brand);
  outline-offset:2px;
  border-color:var(--brand);
  box-shadow:0 0 0 3px var(--focus-ring);
}

input[type="checkbox"],input[type="radio"],input[type="range"]{accent-color:var(--brand)}
input[type="checkbox"]:focus-visible,input[type="radio"]:focus-visible,
input[type="range"]:focus-visible,input[type="color"]:focus-visible,
input[type="file"]:focus-visible{
  outline:2px solid var(--brand);outline-offset:3px;
}
.switch input:focus-visible + .switch__track{outline:2px solid var(--brand);outline-offset:3px}
input:disabled,textarea:disabled,select:disabled{cursor:not-allowed}
input:where(:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"])):disabled,
textarea:disabled,select:disabled{
  background:var(--control-disabled-bg);color:var(--muted);border-color:var(--line-strong);opacity:1;
}
input[type="checkbox"]:disabled,input[type="radio"]:disabled,
input[type="range"]:disabled,input[type="color"]:disabled{opacity:.5}
input[aria-invalid="true"],textarea[aria-invalid="true"],select[aria-invalid="true"],
input.field--error,textarea.field--error,select.field--error{
  border-color:var(--bad);border-style:dashed;box-shadow:0 0 0 2px rgba(177,72,63,.16);
}
input[aria-invalid="true"]:focus,textarea[aria-invalid="true"]:focus,select[aria-invalid="true"]:focus,
input.field--error:focus,textarea.field--error:focus,select.field--error:focus{outline-color:var(--bad)}

textarea{min-height:104px;resize:vertical}

.code-input{
  min-height:200px;
  font:13px/1.6 "SFMono-Regular",Consolas,Monaco,monospace;
}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

button{
  min-height:var(--control-height);
  border:none;
  border-radius:var(--control-radius);
  padding:11px 18px;
  background:linear-gradient(135deg,var(--brand),#8a5634);
  color:#fff;
  cursor:pointer;
  font-weight:650;
  letter-spacing:.015em;
  box-shadow:0 1px 0 rgba(255,255,255,.16) inset,0 3px 10px rgba(107,66,38,.13);
  transition:background .18s ease,transform .12s ease,box-shadow .18s ease;
}

button:hover{background:var(--brand-deep);box-shadow:0 7px 18px rgba(107,66,38,.22)}
button:active{transform:scale(.97)}

button.secondary{
  background:var(--surface);
  color:var(--brand-deep);
  border:1px solid var(--line-strong);
  box-shadow:0 1px 0 rgba(255,255,255,.95) inset;
}
button.secondary:hover{background:var(--brand-soft);box-shadow:0 4px 12px rgba(107,66,38,.08)}

button.ghost{
  background:rgba(152,98,61,.10);
  color:var(--sidebar-ink);
  border:1px solid rgba(60,43,26,.22);
}
button.ghost:hover{background:rgba(152,98,61,.16);box-shadow:none}

button.danger{background:var(--danger)}
button.danger:hover{background:#9a3c35}

button.small{min-height:36px;padding:8px 10px;font-size:13px;border-radius:10px}

button:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

@media (hover:none){
  button.small{min-height:44px}
}

.sr-only{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

/* 表單分節 */

.form-section{
  padding:20px 0 8px;
  border-bottom:1px solid var(--line);
}

.form-section:first-of-type{padding-top:4px}
.form-section:last-of-type{border-bottom:none}

.form-section__title{
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
  color:var(--brand-deep);
  margin-bottom:16px;
  display:flex;
  align-items:center;
  gap:10px;
}

.form-section__title::after{
  content:"";
  flex:1;
  height:1px;
  background:linear-gradient(90deg,var(--line),transparent);
}

/* Private homepage candidate: presentation is opt-in and does not touch live CMS rows. */
.candidate-display-options{
  display:grid;
  gap:8px;
  margin:14px 0 10px;
  padding:14px 16px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--paper);
}
.candidate-display-options legend{padding:0 5px;color:var(--brand-deep);font-size:13px;font-weight:700;letter-spacing:.02em}
.candidate-display-options .subtle{margin:0 0 2px;line-height:1.6}
.candidate-display-options label{display:flex;align-items:center;gap:8px;min-height:32px;color:var(--text);font-size:14px;cursor:pointer}
.candidate-display-options input{inline-size:18px;block-size:18px;flex:0 0 auto}

.field-group{display:grid;gap:14px}
.field-group.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
.field-group.three-col{grid-template-columns:repeat(3,minmax(0,1fr))}

.toggle-field{justify-content:flex-start}

/* 開關 Switch */

.switch{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  cursor:pointer;
  user-select:none;
}

.switch input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.switch__track{
  position:relative;
  width:46px;
  height:26px;
  border-radius:999px;
  background:#ddd0c0;
  transition:background .2s ease;
  flex:none;
}

.switch__track::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.2);
  transition:transform .22s cubic-bezier(.22,1,.36,1);
}

.switch input:checked + .switch__track{background:var(--good)}
.switch input:checked + .switch__track::after{transform:translateX(20px)}

.switch__text{font-size:14px;color:var(--ink)}

/* ===================== 狀態列 ===================== */

.status{
  margin-top:14px;
  border-radius:14px;
  padding:12px 14px;
  background:var(--paper);
  border:1px solid var(--line);
  color:var(--muted);
  font-size:13.5px;
  transition:background .25s ease,border-color .25s ease;
}
.status.good{border-color:#cfe5d7;color:var(--good);background:#f6fcf8}
.status.bad{border-color:#f0c8c3;color:var(--bad);background:#fff8f7}
.status--inline{flex:1;margin-top:0;min-width:220px}

/* ===================== 工作區（列表＋編輯器） ===================== */

.workspace{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
  align-items:start;
}

/* 預設：全寬顯示頁面清單，編輯區隱藏（WP 邏輯：先看清單，點進去才編輯） */
.workspace__editor{
  display:none;
}
/* 全頁編輯模式：隱藏清單，編輯區佔滿全寬 */
.workspace--editing .workspace__list{
  display:none;
}
.workspace--editing .workspace__editor{
  display:block;
  max-width:900px;
}
/* 並排模式（範本／表單）：清單在左、編輯器在右，同時可見 */
.workspace--split{
  grid-template-columns:minmax(240px,320px) minmax(0,1fr);
}
.workspace--split .workspace__editor{
  display:block;
}
@media (max-width: 900px){
  .workspace--split{ grid-template-columns:minmax(0,1fr); }
}

.workspace__list-title{
  font-size:13px;
  letter-spacing:.1em;
  color:var(--muted);
  margin-bottom:10px;
  padding-left:4px;
}

.entity-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:calc(100vh - 230px);
  overflow:auto;
  padding:2px 4px 8px 2px;
}
.settings-list{
  max-height:none !important;
  overflow:visible !important;
  padding-right:0;
}

/* Round8：管理工具統一「列表 → 獨立詳情」。 */
.collection-workspace{grid-template-columns:minmax(0,1fr);}
.collection-workspace:not(.is-detail-view)>.workspace__editor{display:none;}
.collection-workspace.is-detail-view{display:block;}
.collection-workspace.is-detail-view>.workspace__list{display:none;}
.collection-workspace.is-detail-view>.workspace__editor{display:block;width:100%;max-width:980px;margin:0 auto;}
.appearance-layout__header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin:0 0 12px;padding:0 0 14px;border-bottom:1px solid var(--line);}
.appearance-layout__header h3{margin:0 0 4px;font-size:20px;}
.appearance-layout__header .subtle{max-width:680px;}
.appearance-context-card{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:14px;
  margin:0 0 10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
}
.appearance-context-card--accent{background:linear-gradient(135deg,#fff8ee,var(--brand-soft));border-color:#dfc19e;}
.appearance-context-card__eyebrow{display:block;margin-bottom:3px;color:var(--brand);font-size:11px;font-weight:750;letter-spacing:.12em;}
.appearance-context-card strong{display:block;color:var(--brand-deep);font-size:14px;}
.appearance-context-card p{margin:4px 0 0;color:var(--muted);font-size:12.5px;line-height:1.65;}
.appearance-context-card__state{flex:0 0 auto;display:inline-flex;align-items:center;min-height:30px;padding:4px 9px;border-radius:999px;background:#efe5d8;color:var(--brand-deep);font-size:11.5px;font-weight:650;}
.appearance-context-card button{flex:0 0 auto;}
.collection-notice{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 12px;padding:13px 14px;border:1px solid #e8cda9;border-radius:14px;background:#fff8ec;color:var(--brand-deep);}
.collection-notice__body{min-width:0;}
.collection-notice__body strong{display:block;margin-bottom:3px;}
.collection-notice__body p{margin:0;color:var(--text-muted);font-size:13px;line-height:1.6;}
.collection-notice button{flex:0 0 auto;}
.collection-detail-pane{position:relative;}
.collection-detail-pane[hidden]{display:none!important;}
.collection-workspace:not(.is-detail-view)>.collection-detail-pane{display:none!important;}
.collection-backbar{display:flex;align-items:center;gap:10px;margin:0 0 14px;padding:10px 12px;background:#fffaf5;border:1px solid #ead9c4;border-radius:12px;}
.collection-backbar strong{font-family:"Noto Serif TC","Source Han Serif TC",serif;color:#5a3d29;}
.collection-list--detail>[data-ann-id]:not(.is-active),
.collection-list--detail>[data-tsm-id]:not(.is-active){display:none!important;}
.collection-list--detail>.collection-backbar{display:flex!important;}
.collection-list--detail>[data-ann-id].is-active,
.collection-list--detail>[data-tsm-id].is-active{display:block!important;}
.collection-list--detail{display:block;}

/* 公告／見證同樣採「清單 → 全頁詳情 → 返回清單」；不使用左右分隔欄。 */
[data-inline-collection-workspace].is-detail-view>.panel__header{display:none;}
[data-inline-collection-workspace].is-detail-view>.card{max-width:980px;margin:0 auto;padding:0;background:transparent;border:0;box-shadow:none;}
[data-inline-collection-workspace].is-detail-view [data-inline-collection-create],
[data-inline-collection-workspace].is-detail-view [data-inline-collection-status]{display:none!important;}
[data-inline-collection-workspace].is-detail-view .entity-list{max-height:none;overflow:visible;margin-bottom:0!important;padding:0;}
[data-inline-collection-workspace].is-detail-view .entity-item{padding:20px!important;}
[data-inline-collection-workspace].is-detail-view .collection-backbar{position:sticky;top:10px;z-index:3;box-shadow:0 4px 15px rgba(65,43,27,.08);}

/* 所有管理工具共用「清單 → 整頁詳情」；媒體與範本也不再和清單並排。 */
.template-detail-view > .panel__toolbar,
.template-detail-view > #templatesList,
.template-detail-view > #patternsList,
.template-detail-view > .panel__toolbar + #templatesList,
.template-detail-view > .panel__toolbar + #patternsList { display:none; }
.template-detail-view > #templateEditor { display:block; }
.media-grid--detail { display:block !important; }
.media-grid--detail > .media-item { display:none; }
.media-grid--detail > [data-media-backbar] { display:flex; }
.media-grid--detail > .media-item--detail { display:block; max-width:980px; margin:0 auto; }
.media-detail-view > .media-bar,
.media-detail-view > .media-batchbar { display:none; }

/* 媒體／公告／見證：清單項目進入詳情後，整個模組切換為單欄整頁編輯。 */
.collection-detail-mode > .panel__header,
.collection-detail-mode > .media-bar,
.collection-detail-mode > .media-batchbar,
.collection-detail-mode #addAnnouncementBtn,
.collection-detail-mode #addTestimonialBtn { display:none; }
.collection-detail-mode > .card { border:0; box-shadow:none; padding:0; background:transparent; }
.collection-detail-mode > .card > #announcementList,
.collection-detail-mode > .card > #testimonialsList { max-width:980px; margin:0 auto!important; }
.collection-detail-mode > .card > #announcementStatus,
.collection-detail-mode > .card > #testimonialsStatus { max-width:980px; margin:8px auto 0; }
.collection-detail-mode #mediaGrid { max-width:980px; margin:0 auto; }

/* Announcement manager: list → separate full-page form; no inline fields in rows. */
#announcementPanel [hidden]{display:none!important}
#announcementPanel h2,#announcementPanel h3{margin:0}
#announcementPanel .panel__header{align-items:center;justify-content:space-between;gap:20px}
.ann-list-tools{display:flex;align-items:flex-end;gap:16px;margin-bottom:16px}
.ann-list-tools label{flex:1;max-width:520px;display:grid;gap:6px}
.ann-list-row{display:flex!important;align-items:center;justify-content:space-between;gap:20px}
.ann-list-row>span:first-child{min-width:0}
.ann-list-row strong{display:block;font-size:16px;font-weight:650}
.ann-excerpt{display:block;margin-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);max-width:60ch}
.ann-list-meta{flex:none;display:grid;gap:8px;font-size:13px;color:var(--muted);text-align:right}
.ann-list-meta>span{color:var(--accent);font-weight:650}
#announcementDetail{max-width:1100px;margin:0 auto}
.ann-editor-topbar{display:flex;align-items:center;gap:18px;position:sticky;top:0;z-index:20;background:var(--bg,#FDF7F0);border-bottom:1px solid var(--line);padding:16px 0;margin-bottom:18px;flex-wrap:wrap}
.ann-editor-topbar>div{flex:1;min-width:180px}
.ann-editor-topbar h2{font-size:23px}
.ann-notice{padding:14px 18px;border-left:3px solid var(--accent);background:#f6eee3;line-height:1.7;color:#5a402d;border-radius:0 8px 8px 0}
.ann-fields{border:0;padding:0;margin:0;min-width:0}
.ann-section{margin:18px 0;padding:24px;box-shadow:none!important;transform:none!important}
.ann-section>h3,.ann-preview-heading{margin-bottom:18px!important}
.ann-section>label{display:block;margin:18px 0 7px;font-weight:600}
.ann-section input:not([type="checkbox"]),.ann-section textarea,.ann-section select{width:100%;min-height:44px}
.ann-section textarea{line-height:1.7;resize:vertical}
.ann-field-row{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:18px}
.ann-field-row label{display:block;margin-bottom:7px;font-weight:600}
.ann-check{display:flex!important;gap:10px;align-items:center;font-weight:400!important}
.ann-check input{width:18px;height:18px}
.ann-preview-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
/* Selected preview controls must outrank button.secondary:hover as a pair:
   keeping white text while its background reverts to brand-soft is unreadable. */
button.secondary.editor-preview-toggle[aria-pressed="true"],
button.secondary.editor-preview-toggle[aria-pressed="true"]:hover,
button.secondary.editor-preview-toggle[aria-pressed="true"]:focus-visible,
button.secondary.editor-preview-toggle[aria-pressed="true"]:active{
  background:#3d2b1a;color:#fff;border-color:#3d2b1a;
}
button.secondary.editor-preview-toggle:focus-visible{
  outline:2px solid #3d2b1a;outline-offset:3px;
}
.ann-preview-wrap{background:#eee8e1;border:1px solid var(--line);border-radius:10px;padding:18px;overflow:auto;display:flex;justify-content:center}
.ann-preview-wrap iframe{width:100%;height:160px;border:0;background:#fff;pointer-events:none}
.ann-preview-wrap.is-mobile iframe{width:390px;max-width:100%}
.ann-usage-list{padding-left:22px;line-height:1.7}
.ann-usage-list li{margin:12px 0}
.ann-usage-list span{display:block;font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.appearance-scope-note{background:#fff7e9;color:#503723;border-bottom:1px solid #e6d8c4;padding:12px 20px;font-size:14px;line-height:1.6}
@media(max-width:700px){
  .ann-field-row{grid-template-columns:1fr;gap:16px}
  .ann-list-tools{align-items:stretch;flex-direction:column}
  .ann-list-row{align-items:flex-start;flex-direction:column;gap:12px}
  .ann-list-meta{text-align:left;display:flex;gap:16px}
  .ann-excerpt{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .ann-section{padding:18px}
  .ann-editor-topbar>button[type="submit"]{width:100%}
}

@media (max-width: 800px){
  .appearance-context-card{flex-direction:column;}
  .appearance-context-card button{width:100%;}
}

.entity-item{
  width:100%;
  text-align:left;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  color:var(--ink);
  box-shadow:none;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}

.entity-item:hover{
  background:#fff;
  border-color:var(--line-strong);
  transform:translateY(-1px);
  box-shadow:var(--shadow-soft);
}

.entity-item.is-active{
  border-color:var(--brand);
  box-shadow:0 0 0 2px rgba(168,116,74,.18);
}

.entity-item__title{font-weight:700;margin-bottom:3px}
.entity-item__meta{font-size:12.5px;color:var(--muted)}
.entity-item__chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}

.chip{
  display:inline-flex;
  align-items:center;
  padding:3px 9px;
  border-radius:999px;
  background:var(--brand-soft);
  color:var(--brand-deep);
  font-size:11.5px;
  letter-spacing:.02em;
}

.chip--muted{background:#f1ece5;color:var(--muted)}

.editor-form{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:20px;
  padding:24px 26px;
  box-shadow:var(--shadow-soft);
  animation:panelIn .28s cubic-bezier(.22,1,.36,1) both;
}

.editor-form__footer{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  padding-top:18px;
}

.empty-state{
  border:1.5px dashed var(--line-strong);
  border-radius:20px;
  background:rgba(255,255,255,.6);
  padding:40px 28px;
  color:var(--muted);
  text-align:center;
}

/* 作品勾選器 */

.portfolio-chooser{
  max-height:340px;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--paper);
  padding:6px 12px;
  margin-bottom:14px;
}

.portfolio-chooser__item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px 6px;
  border-bottom:1px solid #efe4d7;
  border-radius:8px;
  cursor:pointer;
  transition:background .15s ease;
}

.portfolio-chooser__item:hover{background:rgba(168,116,74,.05)}
.portfolio-chooser__item:last-child{border-bottom:none}

.portfolio-chooser__item input{
  margin-top:4px;
  width:16px;
  height:16px;
  accent-color:var(--brand);
}

.portfolio-chooser__title{font-weight:700;font-size:14px}
.portfolio-chooser__meta{color:var(--muted);font-size:12.5px}

/* 上傳預覽 */

.upload-preview{
  margin-top:12px;
}

.upload-preview img{
  display:block;
  max-width:100%;
  max-height:220px;
  border-radius:12px;
  margin-bottom:12px;
  border:1px solid var(--line);
}

.help{margin-top:8px;font-size:13px;color:var(--muted)}

/* ===================== 新增頁面類型列 ===================== */

.page-type-bar{
  background:var(--brand-soft);
  border:1.5px solid var(--line-strong);
  border-radius:16px;
  padding:16px 18px 4px;
  margin-bottom:14px;
  animation:panelIn .25s cubic-bezier(.22,1,.36,1) both;
}

.page-type-bar__label{
  font-size:12.5px;
  font-weight:700;
  letter-spacing:.02em;
  color:var(--brand-deep);
  margin-bottom:10px;
}

/* ===================== 外觀範本組件的區塊區 ===================== */

.appearance-blocks{
  margin-top:6px;
  padding-top:14px;
  border-top:1px dashed var(--line-strong);
}

.appearance-blocks__label{
  font-size:12.5px;
  font-weight:700;
  letter-spacing:.12em;
  color:var(--brand-deep);
  margin-bottom:12px;
}

/* ===================== 頁面類型選擇器 ===================== */

.type-chooser{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:20px;
  padding:28px;
  box-shadow:var(--shadow-soft);
  animation:panelIn .28s cubic-bezier(.22,1,.36,1) both;
}

.type-chooser__title{
  font-family:"Noto Serif TC",serif;
  font-size:17px;
  font-weight:700;
  margin-bottom:18px;
}

.type-chooser__grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.type-chooser__option{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
  text-align:left;
  background:var(--paper);
  border:1.5px solid var(--line);
  border-radius:16px;
  padding:20px 18px;
  color:var(--ink);
  font-weight:400;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease;
}

.type-chooser__option:hover{
  background:#fff;
  border-color:var(--brand);
  transform:translateY(-2px);
  box-shadow:var(--shadow-lift);
}

.type-chooser__option strong{
  font-size:15.5px;
}

.type-chooser__option span:last-child{
  font-size:12.5px;
  color:var(--muted);
  line-height:1.55;
}

.type-chooser__icon{
  font-size:20px;
  color:var(--brand-deep);
}

/* ===================== 頁面群組與層級 ===================== */

.entity-group{
  margin:14px 4px 8px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
  color:var(--brand-deep);
}

.entity-group:first-child{margin-top:2px}

.entity-item--child{
  margin-left:18px;
  width:calc(100% - 18px);
  background:var(--paper);
}

.entity-item--readonly{
  cursor:default;
}

.entity-item--readonly:hover{
  transform:none;
  box-shadow:none;
  border-color:var(--line);
  background:var(--card);
}

.entity-item__row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}

.entity-item__actions{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;flex-shrink:0}

/* 分類編輯器 */
.category-editor-row{
  border-top:none;
  border-radius:0 0 10px 10px;
  margin-top:-8px;
  padding-top:0;
  background:var(--sidebar-bg);
  border:1.5px solid var(--accent);
  border-top:none;
}
.cat-editor{padding:16px 18px 14px}
.cat-editor__header{font-weight:700;font-size:13.5px;margin-bottom:10px;color:var(--text)}
.cat-editor__hint{font-weight:400;font-size:12px;color:var(--muted);margin-left:6px}
.cat-editor__groups{display:flex;flex-direction:column;gap:14px;margin-bottom:14px}
.cat-editor__group-label{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}
.cat-editor__checkboxes{display:flex;flex-wrap:wrap;gap:8px}
.cat-editor__checkbox-item{
  display:flex;align-items:center;gap:6px;
  padding:5px 11px;border-radius:20px;
  border:1.5px solid var(--line);
  font-size:13px;cursor:pointer;
  transition:border-color .15s,background .15s;
}
.cat-editor__checkbox-item:hover{border-color:var(--accent)}
.cat-editor__checkbox-item.is-checked{
  border-color:var(--accent);
  background:rgba(168,116,74,.08);
  color:var(--accent);
}
.cat-editor__checkbox-item input{width:14px;height:14px;accent-color:var(--accent)}
.cat-editor__actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

.entity-list--rows{
  max-height:none;
  overflow:visible;
}

/* ── WP 式橫向列表列（文章／頁面）：善用橫向空間、降低列高、hover 才顯示快速操作 ── */
.entity-list--rows .entity-item{padding:9px 14px;border-radius:12px}
.entity-list--rows .entity-item__row{align-items:center;gap:16px}
.entity-item__main{min-width:0;flex:1 1 240px}
.entity-list--rows .entity-item__title{margin-bottom:1px;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entity-list--rows .entity-item__meta{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entity-item__cols{display:flex;align-items:center;gap:22px;flex:0 1 auto;margin-left:auto}
.entity-item__col{display:flex;flex-direction:column;gap:5px;font-size:12px;color:var(--muted)}
.entity-item__col--tags{flex-direction:row;flex-wrap:wrap;gap:6px;max-width:320px;align-items:center}
.entity-item__col--date{white-space:nowrap;text-align:right;line-height:1.5}
.entity-list--rows .entity-item__quickactions{margin-top:3px;display:flex;gap:12px;font-size:12px;opacity:1;transition:none;pointer-events:auto}
.entity-list--rows .entity-item:hover .entity-item__quickactions,
.entity-list--rows .entity-item.is-active .entity-item__quickactions{opacity:1;pointer-events:auto}
.entity-list--rows .entity-item__quickactions a{text-decoration:none}
.entity-list--rows .entity-item__quickactions a:hover{text-decoration:underline}
.entity-list--rows .entity-item__quickactions .linklike{font-size:12px;padding:0;background:none;border:0;color:var(--brand-deep);cursor:pointer;text-decoration:none}
.entity-list--rows .entity-item__quickactions .linklike:hover{text-decoration:underline}
@media (hover:none){.entity-list--rows .entity-item__quickactions{opacity:1;pointer-events:auto}}
@media (max-width:860px){
  .entity-list--rows .entity-item__row{flex-wrap:wrap}
  .entity-item__cols{margin-left:0;gap:14px;width:100%;justify-content:flex-start}
  .entity-item__col--date{text-align:left}
}

/* ===================== 連結型按鈕 ===================== */

.button-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:12px;
  padding:11px 18px;
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  font-weight:500;
  transition:background .18s ease,transform .12s ease,box-shadow .18s ease;
}

.button-link:hover{background:var(--brand-deep);box-shadow:0 6px 16px rgba(127,87,55,.25)}
.button-link:active{transform:scale(.97)}

.button-link.secondary{
  background:#fff;
  color:var(--brand-deep);
  border:1px solid var(--line);
}
.button-link.secondary:hover{background:var(--brand-soft);box-shadow:none}
.button-link.small{padding:8px 12px;font-size:13px;border-radius:10px;flex:none}

/* ===================== 外觀面板 ===================== */

.appearance-grid{
  display:flex;
  flex-direction:column;
  gap:18px;
  max-width:860px;
}

.appearance-card .panel__header{align-items:center}

.code-input--short{min-height:140px}

/* ===================== 內容區塊編輯器 ===================== */

.form-section__title-note{
  font-weight:400;
  letter-spacing:.03em;
  color:var(--muted);
  font-size:12px;
}

.blocks-editor{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-bottom:14px;
}

.block-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  transition:border-color .18s ease,box-shadow .18s ease;
}

.block-card:hover{
  border-color:var(--line-strong);
  box-shadow:var(--shadow-soft);
}

.block-card__head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  background:#fff;
  border-bottom:1px solid var(--line);
}

.block-card__icon{
  display:inline-flex;
  width:26px;
  height:26px;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:var(--brand-soft);
  color:var(--brand-deep);
  font-size:13px;
  flex:none;
}

.block-card__label{font-weight:700;font-size:13.5px}

.block-card__order{
  font-size:11.5px;
  color:var(--muted);
  letter-spacing:.06em;
}

.block-card__tools{
  margin-left:auto;
  display:flex;
  gap:6px;
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
}

.block-card:hover .block-card__tools,
.block-card:focus-within .block-card__tools,
.block-card.is-active .block-card__tools{
  opacity:1;
  pointer-events:auto;
}

.icon-btn{
  width:30px;
  height:30px;
  padding:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  border:1px solid transparent;
  font-size:14px;
  line-height:1;
}

.icon-btn:hover{
  background:var(--brand-soft);
  color:var(--brand-deep);
  box-shadow:none;
}

.icon-btn--danger:hover{
  background:#fdeeec;
  color:var(--danger);
}

.icon-btn:disabled{opacity:.3}

.block-card__body{
  padding:16px 16px 4px;
}

.block-card__body .field--full{grid-column:1 / -1}
.block-card__nofields{grid-column:1 / -1;padding-bottom:12px}

.blocks-add{position:relative;margin-bottom:12px}

.block-palette__group-label{
  grid-column:1/-1;
  font-size:12px;
  letter-spacing:.12em;
  color:var(--muted);
  font-weight:600;
  margin:6px 2px 0;
}
.block-palette__group-label:first-child{margin-top:0}
.block-palette{
  margin-top:12px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow:var(--shadow-lift);
  animation:panelIn .22s cubic-bezier(.22,1,.36,1) both;
}
.block-palette__search{
  width:100%;
  margin-bottom:12px;
}
.block-palette__options{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.block-palette__option{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  text-align:left;
  background:var(--paper);
  border:1.5px solid var(--line);
  border-radius:13px;
  padding:13px 14px;
  color:var(--ink);
  font-weight:400;
  transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease;
}

.block-palette__option:hover{
  background:#fff;
  border-color:var(--brand);
  transform:translateY(-1px);
  box-shadow:var(--shadow-soft);
}

.block-palette__option strong{font-size:13.5px}

.block-palette__option span:last-child{
  font-size:11.5px;
  color:var(--muted);
  line-height:1.5;
}

.block-palette__icon{
  font-size:15px;
  color:var(--brand-deep);
}

.blocks-json{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:10px;
}

.blocks-json #blocksJsonArea{width:100%}
.blocks-json textarea{margin-bottom:10px}

.seo-hint{margin-bottom:14px}

/* ===================== 設定載入錯誤 ===================== */

.boot-error{
  max-width:520px;
  margin:80px auto;
  background:#fff8f7;
  border:1px solid #f0c8c3;
  border-radius:18px;
  padding:28px;
  color:var(--bad);
  line-height:1.7;
}

/* ===================== 響應式 ===================== */

@media (max-width: 1100px){
  .field-group.three-col{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width: 920px){
  .app{grid-template-columns:1fr}
  .sidebar{
    position:sticky;
    top:0;
    z-index:100;
    height:auto;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:8px;
    padding:10px 12px;
    border-bottom:1px solid rgba(60,43,26,.14);
    box-shadow:0 5px 18px rgba(90,63,36,.08);
  }
  .sidebar__brand{padding:0;border:0;min-width:0}
  .sidebar__logo{width:46px;height:46px}
  .sidebar__mobile-toggle{
    display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;
    padding:9px 12px;border:1px solid var(--line-strong);border-radius:12px;background:var(--paper);
    color:var(--brand-deep);font:700 13px/1 var(--control-font);cursor:pointer;
  }
  .sidebar__mobile-toggle:hover{background:#fff}
  .sidebar__mobile-toggle:focus-visible{outline:3px solid rgba(152,98,61,.25);outline-offset:2px}
  .sidebar__nav{
    display:none;
    grid-column:1/-1;
    flex:none;
    flex-direction:column;
    gap:4px;
    max-height:min(65dvh,540px);
    overflow-y:auto;
    padding:10px 0 2px;
  }
  .sidebar.is-nav-open .sidebar__nav{display:flex}
  .sidebar__nav-group{display:block;margin:12px 10px 4px}
  .sidebar__item{width:100%;min-height:44px;padding:10px 12px}
  .sidebar__footer{
    display:none;
    grid-column:1/-1;
    padding-top:10px;
  }
  .sidebar.is-nav-open .sidebar__footer{
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
  }
  /* 行動版品牌列會固定在視窗頂端；全頁詳情的返回列若仍貼 10px，
     會被品牌列吃掉而無法實際點擊。保留可見的 WP 式返回操作，但把
     它安全放在折疊後的品牌列之下（含瀏海安全區）。 */
  [data-inline-collection-workspace].is-detail-view .collection-backbar{
    top:calc(78px + env(safe-area-inset-top, 0px));
  }
  .main{padding:22px 18px 48px}
  .workspace{grid-template-columns:1fr}
  .entity-list{max-height:320px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .result-grid{grid-template-columns:1fr}
  .field-group.two-col,
  .field-group.three-col{grid-template-columns:1fr}
  .type-chooser__grid{grid-template-columns:1fr}
  .block-palette__options{grid-template-columns:1fr}
  .entity-item__row{flex-direction:column}
  .collection-notice{align-items:flex-start;flex-direction:column}
  .collection-notice button{min-height:44px;width:100%}
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important;
    transition-duration:.01ms !important;
  }
}

/* ---------- 媒體資料庫 ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 4px 0;
}
.media-item {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.media-item__thumb {
  aspect-ratio: 4/3;
  background: #f0e8de;
  overflow: hidden;
}
.media-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-item__info {
  padding: 10px 12px 6px;
  flex: 1;
}
.media-item__name {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.media-item__meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 3px;
}
.media-item__alt {
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-item__actions {
  padding: 8px 10px;
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--line);
}
.media-item{
  border-color:#eadfd4;
  border-radius:16px;
  box-shadow:0 8px 20px rgba(91,58,35,.06);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.media-item:hover{
  transform:translateY(-3px);
  border-color:#c9a27e;
  box-shadow:0 14px 30px rgba(91,58,35,.12);
}
.media-item__thumb{background:linear-gradient(135deg,#f8efe5,#efe0d1);}
.media-item__thumb img{object-fit:contain;padding:10px;mix-blend-mode:normal;}
.media-item__info{padding:12px 14px 8px;}
.media-item__name{font-family:"Noto Serif TC","Source Han Serif TC",serif;font-weight:700;color:#5a3d29;}
.media-item__meta{color:#957d6b;}
.media-item__actions{padding:10px 12px;background:#fffaf5;}
.media-item__thumb{
  width:100%;
  min-height:0;
  padding:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  cursor:zoom-in;
}
.media-item__thumb:hover{background:linear-gradient(135deg,#f8efe5,#efe0d1);box-shadow:none;transform:none;}
.media-item__thumb:focus-visible{outline:3px solid var(--brand);outline-offset:-5px;}
.media-item__thumb img{pointer-events:none;}

.media-detail{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);gap:28px;padding:8px 0;align-items:start;}
.media-item--detail{border:0;overflow:visible;background:transparent;box-shadow:none;}
.media-item--detail:hover{transform:none;box-shadow:none;border-color:transparent;}
.media-detail__preview{position:sticky;top:18px;padding:18px;border:1px solid var(--line);border-radius:20px;background:var(--surface-raised);box-shadow:var(--shadow-soft);}
.media-detail__image-button{display:flex;align-items:center;justify-content:center;width:100%;min-height:280px;padding:18px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(135deg,#fbf4ec,#f0e0ce);box-shadow:none;cursor:zoom-in;}
.media-detail__image-button:hover{background:linear-gradient(135deg,#f6e9db,#ead6c0);box-shadow:none;transform:none;}
.media-detail__image-button img{display:block;max-width:100%;max-height:min(62vh,680px);object-fit:contain;border-radius:10px;box-shadow:0 12px 28px rgba(70,44,25,.14);}
.media-detail__preview>p{margin:13px 2px 12px;color:var(--muted);font-size:13px;line-height:1.7;}
.media-detail__settings{min-width:0;padding:10px 2px;}
.media-detail__eyebrow,.media-viewer__eyebrow{display:block;color:var(--brand);font-size:11px;font-weight:750;letter-spacing:.13em;}
.media-detail__settings h2{margin:4px 0 14px;color:var(--brand-deep);font-size:clamp(22px,2.4vw,32px);overflow-wrap:anywhere;}
.media-meta-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 18px;}
.media-meta-chip{display:inline-flex;align-items:center;min-height:30px;padding:4px 9px;border:1px solid #e2cfb8;border-radius:999px;background:#fffaf4;color:#674831;font-size:12px;line-height:1.35;}
.media-detail__section{margin:18px 0;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface);}
.media-detail__section h3{margin:0 0 4px;font-size:17px;color:var(--brand-deep);}
.media-detail__section .field{margin:14px 0 10px;}
.media-detail__actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center;}
.media-detail__status{margin:10px 0 0;color:var(--good);font-size:12.5px;font-weight:600;}
.media-detail__status--warning{color:var(--bad);}
.media-detail__danger{margin-top:20px;padding-top:18px;border-top:1px solid var(--line);}
.media-detail__danger .subtle{margin:8px 0 0;font-size:12.5px;}

.media-viewer{position:fixed;inset:0;z-index:var(--bb-layer-viewer, 6000);display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(40,28,18,.82);}
.media-viewer__dialog{display:flex;flex-direction:column;width:min(920px,100%);max-height:90dvh;overflow:auto;border:1px solid rgba(255,255,255,.32);border-radius:20px;background:var(--surface-raised);box-shadow:0 20px 80px rgba(0,0,0,.45);}
.media-viewer__header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;border-bottom:1px solid var(--line);}
.media-viewer__header strong{display:block;color:var(--brand-deep);font-size:14px;overflow-wrap:anywhere;}
.media-viewer__canvas{display:flex;align-items:center;justify-content:center;min-height:260px;padding:20px;background:linear-gradient(135deg,#f9f0e5,#ede0d1);}
.media-viewer__canvas img{display:block;max-width:100%;max-height:60vh;border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.18);}
.media-viewer__meta{padding:16px 18px;color:var(--muted);font-size:13px;line-height:1.7;}
.media-viewer__alt{margin:10px 0;color:var(--brand-deep);}
.media-viewer__alt--missing{color:var(--bad);font-weight:650;}
.media-viewer__actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;}
.media-viewer__copied{color:var(--good);font-size:12px;font-weight:650;}

/* 放在桌機基礎樣式之後，避免同權重的雙欄宣告覆蓋手機單欄。 */
@media (max-width:800px){
  .media-detail{grid-template-columns:minmax(0,1fr);gap:18px;}
  .media-detail__preview{position:static;min-width:0;}
  .media-detail__image-button{min-height:220px;}
  .media-viewer{padding:12px;}
  .media-viewer__header{align-items:flex-start;flex-direction:column;}
  .media-viewer__header button{width:100%;}
  .media-viewer__canvas{padding:14px;min-height:180px;}
}

/* ---------- post tabs ---------- */
.post-tabs {
  display: flex;
  gap: 4px;
}
.post-tab {
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.post-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ---------- block drag-and-drop ---------- */
.block-drag-handle {
  cursor: grab;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.block-drag-handle:active { cursor: grabbing; }
[data-block-index].drag-over { border-top: 2px solid var(--brand); }
[data-block-index] { transition: opacity .15s; }

/* ---------- rich text editor ---------- */
.rt-wrap { display: flex; flex-direction: column; position: relative; }
.rt-toolbar {
  display: flex; flex-wrap: wrap; gap: 2px; align-items: center;
  padding: 5px 8px; background: var(--brand-soft);
  border: 1.5px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.rt-btn {
  background: #fff; border: 1px solid var(--line);
  border-radius: 4px; padding: 3px 8px; font-size: 13px; line-height: 1.4;
  cursor: pointer; color: var(--ink); transition: background .1s, color .1s;
  flex-shrink: 0;
}
.rt-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.rt-btn.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.rt-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 3px; flex-shrink: 0; }
.rt-format-select {
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px;
  font-size: 12px; background: #fff; color: var(--ink); cursor: pointer;
}
.rt-editor {
  min-height: 120px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 0 0 8px 8px;
  font-size: 14px; line-height: 1.8; outline: none; background: #fff; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.rt-editor:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(107,87,73,.08); }
.rt-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rt-editor h1 { font-size: 1.55em; font-weight: 700; margin: .4em 0; }
.rt-editor h2 { font-size: 1.3em; font-weight: 700; margin: .4em 0; }
.rt-editor h3 { font-size: 1.15em; font-weight: 700; margin: .4em 0; }
.rt-editor h4 { font-size: 1.05em; font-weight: 700; margin: .4em 0; }
.rt-editor h5 { font-size: .98em; font-weight: 700; margin: .4em 0; }
.rt-editor h6 { font-size: .9em; font-weight: 700; margin: .4em 0; color: var(--muted); }
.rt-editor ul { list-style: disc; padding-left: 1.5em; margin: .3em 0; }
.rt-editor ol { list-style: decimal; padding-left: 1.5em; margin: .3em 0; }
.rt-editor a { color: var(--brand); text-decoration: underline; cursor: pointer; }
.rt-editor blockquote {
  border-left: 3px solid var(--brand); padding-left: 1em;
  color: var(--muted); margin: .5em 0; font-style: italic;
}
.rt-editor b, .rt-editor strong { font-weight: 700; }
.rt-editor i, .rt-editor em { font-style: italic; }
.rt-editor u { text-decoration: underline; }
.rt-editor s { text-decoration: line-through; }

/* WP 式唯一情境工具列：點區塊或文字才出現，永遠不複製到巢狀畫布。 */
.wp-contextual-toolbar {
  position: fixed; z-index: var(--bb-layer-editor-menu, 3300); display:flex; align-items:center; gap:8px;
  max-width:calc(100vw - 16px); padding:5px; overflow-x:auto;
  color:#3D2B1A; background:#FFFDF9; border:1px solid #EDD3A8;
  border-radius:10px; box-shadow:0 8px 24px rgba(61,43,26,.22);
}
.wp-contextual-toolbar[hidden] { display:none !important; }
.wp-contextual-toolbar__block { display:flex; align-items:center; gap:8px; min-width:max-content; }
.wp-contextual-toolbar .wp-selection-path {
  display:flex; align-items:center; gap:4px; max-width:min(36vw,280px); overflow:auto;
}
.wp-contextual-toolbar .wp-selection-path button {
  min-height:32px; padding:6px 8px; border:0; border-radius:5px; box-shadow:none;
  color:#6B4226; background:transparent; white-space:nowrap;
}
.wp-contextual-toolbar .wp-selection-path button:hover,
.wp-contextual-toolbar .wp-selection-path button:focus-visible { background:#F6EAD7; }
.wp-contextual-toolbar .wp-selection-path [aria-current] { font-weight:700; text-decoration:underline; text-underline-offset:3px; }
.wp-contextual-toolbar .wp-block-tools {
  position:static; display:flex; flex:none; gap:2px; opacity:1; pointer-events:auto;
  max-width:none; padding:0; border:0; background:transparent; box-shadow:none; flex-wrap:nowrap;
}
.wp-contextual-toolbar .wp-block-tools .icon-btn,
.wp-contextual-toolbar .wp-format-toolbar button {
  width:36px; min-width:36px; height:36px; min-height:36px; padding:4px; flex:none;
}
.wp-contextual-toolbar .wp-format-toolbar {
  display:flex; flex:none; width:max-content; margin:0; border:0; box-shadow:none; background:transparent;
}
.wp-contextual-toolbar .wp-format-toolbar button:hover,
.wp-contextual-toolbar .wp-format-toolbar button:focus-visible { background:#F6EAD7; color:#3D2B1A; }

/* link dialog */
.rt-link-dialog {
  display: none; position: absolute; left: 0; top: 100%; z-index: 200;
  background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.13); min-width: 320px;
  margin-top: 2px;
}
.rt-link-dialog.is-visible { display: block; }
.rt-link-dialog__row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.rt-link-dialog__row:last-child { margin-bottom: 0; }
.rt-link-dialog label { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 56px; }
.rt-link-newtab-label { font-size: 12.5px; color: var(--text); display: flex; align-items: center; gap: 6px; min-width: unset; }
.rt-link-dialog input[type="text"] { flex: 1; font-size: 13px; }
.rt-link-dialog__actions { gap: 8px; margin-top: 4px; }
.rt-link-confirm { font-size: 13px; }

/* ── AI SEO 健康檢查面板 ─────────────────────────────────── */
.seo-health-panel {
  margin-top: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.seo-health-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.seo-health-score {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  min-width: 48px;
  text-align: center;
}
.seo-health-summary__label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}
.seo-health-summary__text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.seo-health-list {
  padding: 12px 0;
}
.seo-health-empty {
  padding: 20px 18px;
  font-size: 13px;
  color: #38a169;
  text-align: center;
}
.seo-health-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  transition: opacity .2s;
}
.seo-health-item:last-child { border-bottom: none; }
.seo-health-item--done { opacity: 0.38; pointer-events: none; }
.seo-health-item__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.seo-health-badge {
  font-size: 11px;
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 600;
}
.seo-health-location {
  font-size: 12px;
  color: var(--muted);
}
.seo-health-original {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.seo-health-replacement {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 3px;
}
.seo-health-replacement strong { color: var(--brand); }
.seo-health-reason {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.seo-health-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seo-health-actions .secondary.small {
  font-size: 12px;
  padding: 4px 10px;
}

/* ===== 媒體庫：勾選 + 缺 Alt 標示 ===== */
.media-item { position: relative; }
.media-item__check {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(255,255,255,.9); border-radius: 4px;
  width: 22px; height: 22px; display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
/* 只有進入「批次選取」模式才顯示勾選框 */
.media-grid--selecting .media-item__check { display: flex; }
.media-grid--list .media-item__check { display: flex; position: static; }
.media-item__alt--missing { color: #c0392b; font-weight: 500; }
.media-item__alt-src { color: var(--text-muted); font-size: 11px; }
.media-item__alt-input { width: 100%; margin-top: 4px; font-size: 12px; }

/* ===== 區塊內的圖片選取 ===== */
.block-media-pick { display: flex; flex-direction: column; gap: 8px; }
.block-media-pick__preview {
  width: 100%; max-width: 280px; aspect-ratio: 16/10; border-radius: var(--radius, 8px);
  overflow: hidden; background: var(--brand-soft, #f7ede1); border: 1px solid var(--border, #e5ddd2);
  display: flex; align-items: center; justify-content: center;
}
.block-media-pick__preview img { width: 100%; height: 100%; object-fit: cover; }
.block-media-pick__preview.is-empty { color: var(--text-muted); font-size: 13px; }
.block-media-pick__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 項目編輯器內的圖片欄位（圖庫等） */
.items-col-img { display: flex; flex-direction: column; gap: 6px; }
.items-col-img__preview {
  width: 100%; max-width: 200px; aspect-ratio: 4/3; border-radius: var(--radius, 8px);
  overflow: hidden; background: var(--brand-soft, #f7ede1); border: 1px solid var(--border, #e5ddd2);
  display: flex; align-items: center; justify-content: center;
}
.items-col-img__preview img { width: 100%; height: 100%; object-fit: cover; }
.items-col-img.is-empty .items-col-img__preview { color: var(--text-muted); font-size: 12px; }
.items-col-img__ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* 頁面/文章「封面圖（精選圖）」選取器 — 之前沒有樣式，圖會撐超大 */
.page-media-pick { display: flex; flex-direction: column; gap: 8px; }
/* Original-image inspection, not a simulated public cover crop. */
.page-media-pick__preview {
  width: 100%; max-width: 360px; border-radius: var(--radius, 8px);
  overflow: hidden; background: var(--brand-soft, #f7ede1); border: 1px solid var(--border, #e5ddd2);
  display: flex; align-items: center; justify-content: center;
}
.page-media-pick__preview img { width: 100%; height: auto; object-fit: contain; display: block; }
.page-media-pick__preview.is-empty { min-height:80px; padding:12px 16px; overflow-wrap:anywhere; text-align:center; color: var(--text-muted); font-size: 13px; }

/* ===== 媒體選取器 Modal ===== */
.media-picker-modal { position: fixed; inset: 0; z-index: var(--bb-layer-modal, 3500); display: flex; align-items: center; justify-content: center; }
.media-picker-modal[hidden] { display: none; }
.media-picker-modal__backdrop { position: absolute; inset: 0; background: rgba(40,28,18,.45); }
.media-picker-modal__panel {
  position: relative; background: #fff; width: min(900px, 92vw); height: min(80vh, 700px);
  border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.media-picker-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border, #eee); }
.media-picker-modal__head .icon-btn { width:44px; height:44px; }
.media-picker-modal__tabs { display: flex; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--border, #eee); }
.media-picker-tab { min-height:44px; background: none; border: none; padding: 10px 16px; cursor: pointer; color: #594232; border-bottom: 2px solid transparent; font-size: 14px; }
.media-picker-tab.is-active { color: var(--brand, #98623D); border-bottom-color: var(--brand, #98623D); font-weight: 500; }
.media-picker-tab:focus-visible { outline: 3px solid #3D2B1A; outline-offset: -3px; }
.media-picker-modal__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.media-picker-modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border, #eee); }
.media-grid--picker { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.media-pick-item { position: relative; aspect-ratio: 1; min-width:44px; min-height:44px; padding:0; border-radius: 8px; overflow: hidden; cursor: pointer; border: 3px solid transparent; background:#fff; }
.media-pick-item img { width: 100%; height: 100%; object-fit: cover; }
.media-pick-item.is-selected { border-color: var(--brand, #98623D); }
.media-pick-item:focus-visible { outline: 3px solid #3D2B1A; outline-offset: 2px; }
.media-pick-item__warn { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); border-radius: 4px; padding: 0 3px; font-size: 12px; }
.media-picker-upload { text-align: center; padding: 40px 20px; border: 2px dashed var(--border, #ddd); border-radius: 12px; }
.media-picker-upload p { margin-bottom: 14px; color: var(--text-muted); }
.form-server-notice { padding:12px 14px; border:1px solid #d9c4a5; border-radius:10px; background:#fff8ed; color:#513d2d; line-height:1.7; }
.form-server-notice strong { display:block; color:#6b4427; }
.form-server-notice p { margin:4px 0 0; font-size:13px; }

/* ===== 面板內分頁籤（網站設定 / 外觀）===== */
.subtabs {
  display: flex; flex-wrap: wrap; gap: 12px 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line); margin-bottom: 20px;
}
button.subtabs__btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  min-height:44px; margin-bottom: 0; padding: 10px 16px; font-size: 14px; cursor: pointer;
  color: var(--muted); font-family: inherit; white-space: nowrap;
}
button.subtabs__btn:hover { background:var(--brand-soft); color:var(--ink); box-shadow:none; }
button.subtabs__btn.is-active,
button.subtabs__btn.is-active:hover,
button.subtabs__btn.is-active:focus,
button.subtabs__btn.is-active:focus-visible,
button.subtabs__btn.is-active:active {
  background:var(--brand-deep); color:#fff; border-bottom-color:var(--brand-deep); font-weight:600; box-shadow:none;
}
[data-stab][hidden] { display: none !important; }

/* ===== 媒體庫：列表檢視 + 檢視切換 ===== */
.media-view-toggle .is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.media-grid--list { display: block; }
.media-grid--list .media-item {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px;
  padding: 8px 12px; border-bottom: 1px solid var(--line); border-radius: 0;
}
.media-grid--list .media-item__thumb { width: 64px; height: 64px; }
.media-grid--list .media-item__check { position: static; }
.media-grid--list .media-item__actions { display: flex; gap: 6px; }

/* ===== 媒體庫批次操作列 ===== */
.media-batchbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--brand-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 14px; margin-bottom: 14px;
}
.media-batchbar__check { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.media-batchbar__spacer { flex: 1; }
.media-batchbar #mediaSelectedCount { font-size: 13px; }

/* ===== 媒體庫工具列（精簡兩行） ===== */
.media-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.media-bar__spacer { flex: 1; }
.media-view-toggle { display: inline-flex; gap: 2px; flex: 0 0 auto; }
/* 媒體列內的控制項固定寬度，避免 select 預設 100% 撐爆整行 */
.media-bar > * { flex: 0 0 auto; }
.media-bar #mediaDateFilter { width: auto; min-width: 130px; }
.media-bar #mediaSearch { width: 220px; }

/* ===== 區塊編輯器：大綱 + 即時預覽 ===== */
.blocks-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.blocks-bar .is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.blocks-layout { display: block; }
.blocks-layout--preview { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,440px); gap: 18px; align-items: start; }
.blocks-main { min-width: 0; }
.block-outline {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; margin-bottom: 14px; max-height: 280px; overflow-y: auto;
}
.block-outline__empty { color: var(--muted); font-size: 13px; padding: 8px; }
.block-outline__item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: 13px;
}
.block-outline__item:hover { background: var(--brand-soft); }
.block-outline__icon { width: 20px; text-align: center; color: var(--brand); }
.block-outline__label { font-weight: 600; flex: 0 0 auto; }
.block-outline__snippet { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blocks-preview {
  position: sticky; top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
}
.blocks-preview__label { font-size: 12px; letter-spacing: .1em; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }
.blocks-preview__frame { width: 100%; height: 520px; border: none; display: block; background: #fff; }
.block-card--flash { box-shadow: 0 0 0 3px var(--brand); transition: box-shadow .2s; }
@media (max-width: 1100px) {
  .blocks-layout--preview { grid-template-columns: 1fr; }
  .blocks-preview { position: static; }
}

/* ===== WP 式編輯器：主欄 + 右側設定欄 ===== */
.editor-form--split {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 22px;
  align-items: start;
}
.editor-form--split .editor-form__main { min-width: 0; }
.editor-form--split .editor-form__aside { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.editor-form--split .editor-form__aside .form-section { margin: 0; }
.editor-form--split .editor-form__footer { grid-column: 1 / -1; }
.editor-title-input {
  width: 100%; font-size: 26px; font-weight: 700; font-family: "Noto Serif TC", serif;
  border: none; border-bottom: 2px solid var(--line); border-radius: 0;
  padding: 6px 2px 10px; margin-bottom: 18px; background: transparent;
}
.editor-title-input:focus { outline: none; border-bottom-color: var(--brand); box-shadow: none; }
@media (max-width: 1100px) {
  .editor-form--split { grid-template-columns: 1fr; }
}

/* ===== 區塊共用樣式（對齊/背景）摺疊 ===== */
.block-card__style { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.block-card__style > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.block-card__style > summary::before { content: "⚙ "; }

/* 版型範本選項（區塊面板） */
.block-palette__option--pattern { border-color: var(--brand); background: var(--brand-soft); }

/* ===== 導覽選單編輯器 ===== */
.nav-menu-section { min-width: 0; }
.nav-menu-section h3 { margin: 0 0 12px; }
.nav-menu-help { max-width: 78ch; color: var(--muted); font-size: 14px; }
.nav-menu-help p { margin: 0 0 12px; }
.nav-menu-guide summary { min-height:44px; display:flex; align-items:center; cursor:pointer; color:var(--text); font-weight:600; }
.nav-menu-guide summary::before { content:"＋"; margin-right:8px; }
.nav-menu-guide[open] summary::before { content:"−"; }
.nav-menu-guide summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:8px; }
.nav-menu-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.nav-menu-controls[inert] { opacity: .65; }
.nav-menu-item { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(140px, 1.4fr) auto; align-items: end; gap: 12px; padding: 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.nav-menu-item--child { margin-left: 28px; border-left: 3px solid var(--line-strong); }
.nav-menu-item__position { grid-column: 1 / -1; color: var(--brand-deep); font-size: 13px; font-weight: 600; }
.nav-menu-field { min-width: 0; }
.nav-menu-field label { display: block; margin-bottom: 6px; color: var(--ink); font-size: 13px; }
.nav-menu-input { width: 100%; min-width: 0; }
.nav-menu-item__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-menu-section :is(input, button) { min-height: 44px; font-family: var(--control-font); border-radius: 12px; }
.nav-menu-section .icon-btn { width: auto; min-width: 44px; height: 44px; padding: 8px; background: var(--brand-soft); border: 1px solid var(--line-strong); color: var(--brand-deep); }
.nav-menu-section .icon-btn--danger { color: var(--danger); }
.nav-menu-section .icon-btn:hover { background: var(--line); }
.nav-menu-mode-note { margin: 16px 0; padding: 12px 16px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep); font-size: 13px; line-height: 1.6; }
.nav-menu-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
/* 自訂對話框的按鈕列共用：一律 flex＋間距，不論用哪個 class（老闆 1021px 看到「確認導覽選單操作」兩顆按鈕黏在一起） */
.wp-exit-dialog .nav-menu-actions, .wp-exit-dialog .wp-exit-actions, .wp-exit-dialog [class$="__actions"] { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.wp-exit-dialog .nav-menu-actions > button, .wp-exit-dialog .wp-exit-actions > button { min-height: 44px; }
.nav-menu-feedback { display: grid; justify-items: start; gap: 12px; margin-top: 16px; overflow-wrap: anywhere; }
.nav-menu-feedback .status { margin: 0; }
@media (max-width: 1100px) {
  .nav-menu-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .nav-menu-item__tools { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .nav-menu-item { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .nav-menu-item--child { margin-left: 12px; }
  .nav-menu-section :is(input, button) { font-size: 16px; }
  .nav-menu-actions > button { width: 100%; }
}

/* ===== 範本編輯器 ===== */
.tpl-editor { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--paper); }
.tpl-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; }
.tpl-row + .tpl-row { border-top: 1px solid var(--line); }
.tpl-row--off { opacity: .5; }
.tpl-row__grip { color: var(--muted); }
.tpl-row__chk { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tpl-row__tools { display: flex; gap: 2px; }

/* 必填欄位未完成標示 */
.field--error{border-color:var(--bad,#b1483f)!important;box-shadow:0 0 0 3px rgba(177,72,63,.12)!important}

/* 卡片圖示選擇器 */
.icon-palette { margin-top: 8px; }
.icon-palette__hint { display: block; font-size: 12px; color: #8B6555; margin-bottom: 6px; }
.icon-palette__grid { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-palette__chip {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e0cdb5; border-radius: 10px; background: #FBF4E8; color: #98623D; cursor: pointer;
  transition: background .15s, transform .1s;
}
.icon-palette__chip:hover { background: #F6EAD7; transform: translateY(-1px); }
.icon-palette__chip:active { transform: translateY(0); }
.icon-palette__chip svg { width: 20px; height: 20px; flex: 0 0 auto; display: block; }

/* 發布狀態：徽章與排程欄位 */
.publish-box { background:#FBF4E8; border:1px solid #efe0cb; border-radius:12px; padding:14px; }
.publish-box__row { display:flex; align-items:center; justify-content:space-between; }
.status-pill { display:inline-block; font-size:12px; font-weight:600; padding:3px 12px; border-radius:999px; line-height:1.6; }
.status-pill--draft { background:#ece3d6; color:#6B4226; }
.status-pill--scheduled { background:#FBE6C8; color:#744A12; }
.status-pill--live { background:#CDE9C6; color:#2E5D2A; }
.chip--status.chip--scheduled { background:#FBE6C8; color:#744A12; }
.chip--status.chip--live { background:#CDE9C6; color:#2E5D2A; }

/* ===================== WP 全螢幕所見即所得編輯器 ===================== */
.wp-editor {
  position: fixed; inset: 0; z-index: var(--bb-layer-editor, 3000);
  display: flex; flex-direction: column;
  background: #F3ECE1;
  font-family: 'Noto Sans TC', sans-serif;
}
.wp-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px; background: #fff;
  border-bottom: 1px solid #e6d8c4; box-shadow: 0 1px 4px rgba(120,80,40,.06);
  position: relative; z-index: 5;
}
.wp-topbar__hint { color: #9a8064; font-size: 13px; flex: 1; }
.wp-topbar__actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; margin-left:auto; }
.wp-save-status { flex: 1 1 100%; order: 5; font-size: 12px; line-height: 1.5; min-height: 18px; color: #594232; overflow-wrap: anywhere; }
/* A6：狀態列固定佔一行高度；出現「有尚未儲存的修改」時不再把工具列與畫布往下推 */
.wp-save-status:empty::before { content: "\00a0"; }
.wp-autosave-restore { flex:1 1 100%; order:6; display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px 10px; border:1px solid #c9a96e; border-radius:10px; background:#fff8e8; color:#513d2d; font-size:12px; line-height:1.55; }
.wp-autosave-restore button { min-height:36px; }
.wp-title {
  flex: 1; min-width: 120px; font-family: 'Noto Serif TC', serif; font-size: 17px; font-weight: 700;
  color: #3D2B1A; border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; background: #FBF4E8;
}
.wp-title:focus { outline: none; border-color: #98623D; background: #fff; }
.block-palette__hint { font-size: 12px; color: #9a8064; padding: 2px 4px 8px; }
.wp-topbar__add { position: relative; }
.wp-topbar__add .block-palette {
  /* 「＋新增區塊」鈕在頂欄靠左，面板改由左緣往右展開，避免 340px 面板往左溢出被裁掉 */
  position: absolute; top: calc(100% + 8px); left: 0; width: 340px; max-width: calc(100vw - 32px); max-height: 60vh; overflow: auto;
  background: #fff; border: 1px solid #e6d8c4; border-radius: 12px; padding: 10px;
  box-shadow: 0 12px 40px rgba(120,80,40,.18); z-index: 10;
}
.wp-body { flex: 1; display: flex; min-height: 0; }
.wp-canvas { flex: 1; overflow: auto; padding: 40px 24px 120px; background: #fff; }
.wp-canvas { font-family: var(--font-body, var(--control-font)); font-size: var(--base-font-size, 16px); line-height: var(--line-height, 1.7); color: var(--text, #2F2F2F); }
.wp-canvas h1, .wp-canvas h2, .wp-canvas h3, .wp-canvas h4 { font-family: var(--font-heading, "Noto Serif TC", serif); }
.wp-canvas > * { max-width: var(--max-w, 1320px); margin-left: auto; margin-right: auto; }
.wp-canvas__empty { text-align: center; color: #9a8064; padding: 80px 20px; }

.wp-canvas-block {
  position: relative; margin: 6px auto; padding: 14px 16px;
  border: 1.5px solid transparent; border-radius: 10px; cursor: pointer; background: transparent;
  transition: border-color .12s, background .12s;
}
.wp-canvas-block:hover { border-color: #e0cdb5; background: transparent; }
/* 選取＝一條細框即可（WP 式）：不填色塊、不加標籤；未選取無框（除非使用者自訂框線）。單選、多選同樣呈現，多選時每個被選到的兄弟都上細框，一眼看得出。 */
.wp-canvas-block.is-selected,
.wp-canvas-block.is-selected:hover,
.wp-canvas-block--multi,
.wp-canvas-block--multi.is-selected,
.wp-canvas-block--multi.is-selected:hover { border-color: #98623D; background: transparent; box-shadow: none; }
.wp-block-tag {
  position: absolute; top: -11px; left: 12px; font-size: 11px; font-weight: 600;
  color: #fff; background: #98623D; padding: 1px 8px; border-radius: 6px;
  opacity: 0; transition: opacity .12s; pointer-events: none;
}
.wp-canvas-block:hover .wp-block-tag { opacity: 1; }
.wp-block-tools {
  position: absolute; top: -14px; right: 10px; display: flex; gap: 2px;
  background: #fff; border: 1px solid #e6d8c4; border-radius: 8px; padding: 2px;
  box-shadow: 0 4px 12px rgba(120,80,40,.14); opacity: 0; pointer-events: none; transition: opacity .12s;
}
.wp-canvas-block:hover .wp-block-tools,
.wp-canvas-block.is-selected .wp-block-tools,
.wp-canvas-block:focus-within .wp-block-tools { opacity: 1; pointer-events: auto; }
.wp-canvas-block.is-selected .wp-block-tag,
.wp-canvas-block:focus-within .wp-block-tag { opacity: 1; }
/* 區塊之間的插入點：桌機只在真正靠近兩塊的間隙時出現；不再每一處常駐。
   鍵盤 focus 以及觸控的目前選取區塊仍可使用，另外頂欄「新增區塊」永遠可用。 */
.wp-insert-boundary {
  position: relative; z-index: 4; display: flex; align-items: center; justify-content: center;
  height: 20px; margin: -4px auto; max-width: var(--max-w, 1320px);
}
.wp-insert-here {
  width: 32px !important; height: 32px !important; min-width: 32px !important; max-width: 32px;
  padding: 0 !important; margin: 0 !important; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #98623D; border-radius: 50%; flex: none;
  background: #98623D; color: #fff; font-size: 19px; line-height: 1; cursor: pointer;
  opacity: 0; pointer-events: none; transform: scale(.76);
  transition: opacity .12s ease, transform .12s ease; box-shadow: 0 3px 9px rgba(90,63,36,.16);
}
.wp-insert-boundary:hover .wp-insert-here,
.wp-insert-boundary:focus-within .wp-insert-here,
.wp-insert-boundary.is-keyboard-target .wp-insert-here,
.wp-insert-here:focus,
.wp-insert-here:focus-visible {
  opacity: 1; pointer-events: auto; transform: scale(1);
}
.wp-insert-here:focus-visible { outline: 3px solid rgba(152,98,61,.30); outline-offset: 3px; }
@media (hover: none) {
  .wp-canvas-block.is-current + .wp-insert-boundary .wp-insert-here { opacity: 1; pointer-events: auto; transform: scale(1); }
}

/* 畫布內就地編輯文字 */
/* WP 群組內嵌編輯：外層與格線由前台 renderer 產生；此處只加編輯選取框，不能改掉預覽排版。 */
.wp-group-editor { position: relative; min-width: 0; }
.wp-group-editor--fallback { display: flex; flex-direction: column; gap: 12px; padding: 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; }
.wp-group-child { position: relative; min-width: 0; margin: 0 !important; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 0; }
.wp-group-child:hover { border-color: #e0cdb5; }
.wp-group-child.is-selected, .wp-group-child.is-selected:hover { border-color: #98623D; box-shadow: none; }
/* A1：圖片類區塊還沒有圖片時的可點空狀態（只在編輯畫布，不進前台） */
.wp-media-empty { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px 14px; min-height:160px; padding:22px; border:2px dashed #cbb08a; border-radius:12px; background:repeating-linear-gradient(45deg,#fbf4ea,#fbf4ea 10px,#f6ecdd 10px,#f6ecdd 20px); color:#6B4226; font-size:14px; text-align:center; }
.wp-media-empty--strip { min-height:0; padding:10px 14px; margin-bottom:10px; background:#fbf4ea; }
.wp-media-empty__icon { font-size:28px; line-height:1; }
.wp-media-empty--strip .wp-media-empty__icon { font-size:18px; }
.wp-media-empty__actions { display:inline-flex; gap:8px; flex-wrap:wrap; }
.wp-canvas-block.drag-over .wp-media-empty { border-color:#98623D; background:#f3e5d2; }
.wp-group-empty { color: #9a8064; font-size: 13px; padding: 14px; text-align: center; border: 1px dashed #d8c4a8; border-radius: 10px; }
/* 文章專用動態區塊在範本畫布上的示意（前台才換成實際資料） */
.wp-dynph { color: #8a6f52; font-size: 13px; padding: 12px 14px; text-align: center; border: 1px dashed #c9a978; border-radius: 10px; background: #fbf3e6; }
/* 拖曳到群組上時：整個群組高亮，提示「放開就進群組」 */
.wp-group-dropzone { outline: 2px dashed #98623D; outline-offset: 2px; background: rgba(152,98,61,.06) !important; }
/* 前台 site.css 的群組色彩規則，scoped 到畫布。只在前台 renderer 已加上的語意 class 生效；
   一般深色群組不用 !important 蓋過使用者的 _textcolor，後段的 explicit custom color 會優先。 */
.wp-canvas .blk--dark { color: #ECE4D6; }
.wp-canvas .blk--dark h1, .wp-canvas .blk--dark h2, .wp-canvas .blk--dark h3, .wp-canvas .blk--dark h4,
.wp-canvas .blk--dark .cms-page h2, .wp-canvas .blk--dark .post-body h2 { color: #F3ECDF; }
.wp-canvas .blk--dark p, .wp-canvas .blk--dark .rt, .wp-canvas .blk--dark li,
.wp-canvas .blk--dark figcaption { color: #C9BDAB; }
.wp-canvas .blk--dark strong { color: #F3ECDF; }
.wp-canvas .blk--dark blockquote { color: #ECE4D6; }
.wp-canvas .blk--dark blockquote cite { color: #9E9384; }
.wp-canvas .blk--dark .callout { color: #B9AD9B; border-color: rgba(236,228,214,.16); }
.wp-canvas .blk--dark .wp-group-child:hover { border-color: #EDD3A8; }
.wp-canvas .blk--bgimage { color: #fff; }
.wp-canvas .blk--bgimage h1, .wp-canvas .blk--bgimage h2, .wp-canvas .blk--bgimage h3,
.wp-canvas .blk--bgimage h4, .wp-canvas .blk--bgimage p, .wp-canvas .blk--bgimage .rt { color: #fff !important; }
/* 使用者在區塊設定選擇的文字色是明確意圖，必須覆蓋深色與背景圖的預設可讀性顏色。 */
.wp-canvas .blk--has-textcolor,
.wp-canvas .blk--has-textcolor h1, .wp-canvas .blk--has-textcolor h2, .wp-canvas .blk--has-textcolor h3,
.wp-canvas .blk--has-textcolor h4, .wp-canvas .blk--has-textcolor h5, .wp-canvas .blk--has-textcolor h6,
.wp-canvas .blk--has-textcolor p, .wp-canvas .blk--has-textcolor .rt, .wp-canvas .blk--has-textcolor li,
.wp-canvas .blk--has-textcolor strong, .wp-canvas .blk--has-textcolor blockquote,
.wp-canvas .blk--has-textcolor cite { color: var(--blk-textcolor) !important; }
.wp-canvas .blk--has-textcolor a:not(.btn) { color: var(--blk-textcolor); }
.wp-list-item--child { margin-left: 18px; width: calc(100% - 18px); font-size: 12.5px; opacity: .92; border-left: 1px solid #e6d3b6; }
.wp-list-item--child .wp-list-item__label { color: #6b573f; }
.wp-child-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #FBF4E8; border: 1px solid #ecdcc2; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; font-size: 12.5px; color: #7a6450; }
.wp-child-hint .linklike { background: none; border: 0; color: #98623D; font-weight: 700; cursor: pointer; font-size: 12.5px; padding: 0; text-decoration: underline; }
.wp-edit { outline: none; border-radius: 4px; }
.wp-edit:focus { box-shadow: 0 0 0 2px rgba(152,98,61,.25); }
/* C-12 第 3 項：items 是同一份頁面 JSON 的虛擬子區塊；畫布中可直接改字、清單中可拖曳排序。 */
.wp-virtual-items { position:relative; min-width:0; }
.wp-virtual-items--empty { color:#9a8064; font-size:13px; padding:18px; text-align:center; border:1px dashed #d8c4a8; border-radius:10px; display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; }
.wp-virtual-items--stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:12px; }
.wp-virtual-items--stats .stat { min-width:0; }
.wp-virtual-items--cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; }
.wp-virtual-items--cards .card { min-width:0; }
.wp-virtual-item { position:relative; outline:1px solid transparent; outline-offset:3px; transition:outline-color .12s, background .12s; }
.wp-virtual-item:hover { outline-color:#e0cdb5; }
.wp-virtual-item.is-current, .wp-virtual-item:focus-within { outline:2px solid #98623D; }
.wp-virtual-item.is-dragging { opacity:.45; }
.wp-virtual-item__edit { outline:none; min-width:1ch; }
.wp-virtual-item__edit:focus { box-shadow:0 0 0 2px rgba(152,98,61,.25); border-radius:4px; }
.wp-virtual-item__edit.is-empty::before { content:attr(data-placeholder); color:#b9a589; pointer-events:none; }
.wp-virtual-item__description { display:block; margin-top:5px; color:#6E5F50; font-size:.88em; }
.wp-virtual-item__icon { display:inline-flex; margin-right:7px; }
.wp-virtual-items__heading { margin:0 0 12px; }
.wp-virtual-items--list { margin:0; padding-left:1.3em; }
.wp-virtual-items--list > .wp-virtual-item { padding:4px 6px; }
.wp-virtual-items--icon-list { list-style:none; padding-left:0; }
.wp-virtual-items--icon-list > .wp-virtual-item { display:flex; align-items:flex-start; gap:2px; }
.wp-list-item--virtual { background:rgba(251,244,232,.72); }
.wp-list-item--virtual .wp-list-more { opacity:0; margin-left:auto; border:0; background:transparent; color:currentColor; cursor:pointer; }
.wp-list-item--virtual:hover .wp-list-more, .wp-list-item--virtual.is-current .wp-list-more, .wp-list-item--virtual:focus-within .wp-list-more { opacity:1; }
.wp-settings__direct-edit { margin:0 0 14px; padding:9px 10px; border:1px solid #E7D7BF; border-radius:8px; background:#FBF4E8; color:#6E5F50; font-size:12.5px; line-height:1.65; }
.wp-virtual-delete-dialog { position:fixed; z-index:var(--bb-layer-dialog, 3600); inset:0; display:grid; place-items:center; padding:20px; }
.wp-virtual-delete-dialog__backdrop { position:absolute; inset:0; background:rgba(45,31,20,.48); backdrop-filter:blur(2px); }
.wp-virtual-delete-dialog__card { position:relative; z-index:1; width:min(100%,420px); padding:22px; border:1px solid #e0cdb5; border-radius:12px; background:#fff; box-shadow:0 18px 60px rgba(45,31,20,.25); }
.wp-virtual-delete-dialog__card h2 { margin:0 0 8px; font-size:20px; }
.wp-virtual-delete-dialog__card p { margin:0; color:#6E5F50; line-height:1.65; }
.wp-virtual-delete-dialog__actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.wp-virtual-delete-dialog .danger { background:#B1483F; color:#fff; border-color:#B1483F; }
/* A5：快捷鍵總表（沿用頁內對話框外框） */
.wp-shortcuts-dialog__card { width:min(100%,600px); max-height:calc(100dvh - 40px); overflow:auto; }
.wp-shortcuts-dialog__card h3 { margin:16px 0 6px; font-size:14px; color:#6B4226; }
.wp-shortcuts-table { width:100%; border-collapse:collapse; font-size:13px; }
.wp-shortcuts-table th { width:42%; text-align:left; font-weight:400; padding:5px 8px 5px 0; vertical-align:top; }
.wp-shortcuts-table td { padding:5px 0; color:#3D2B1A; vertical-align:top; }
.wp-shortcuts-table tr + tr th, .wp-shortcuts-table tr + tr td { border-top:1px solid #f0e4d2; }
.wp-shortcuts-table kbd { display:inline-block; padding:1px 7px; border:1px solid #d9c09e; border-bottom-width:2px; border-radius:6px; background:#fff; font:inherit; font-size:12px; color:#3D2B1A; white-space:nowrap; }
@media (max-width:600px) { .wp-virtual-items--cards { grid-template-columns:1fr; } .wp-virtual-delete-dialog__actions > button { min-height:44px; } }
/* ↓ 畫布文字區塊：直接鏡射前台 site.css 現行版型（編輯所見＝預覽），scoped 於 .wp-canvas 不影響後台其他 UI */
.wp-canvas .wp-h { font-family: 'Noto Serif TC', serif; font-weight: 500; letter-spacing: -.01em; line-height: 1.28; color: #6B4226; margin: 0; }
.wp-canvas h2.wp-h { font-size: clamp(1.45rem, 3vw, 2.05rem); }
.wp-canvas h3.wp-h { font-size: 1.3rem; }
.wp-canvas h4.wp-h { font-size: 1.12rem; }
.wp-canvas h5.wp-h, .wp-canvas h6.wp-h { font-size: 1rem; }
.wp-canvas .wp-p { font-family: 'Noto Sans TC',sans-serif; color: #241A12; line-height: 1.7; font-size: 1rem; font-weight: 400; margin: 0; }
.wp-canvas .wp-quote { font-family: 'Noto Serif TC', serif; font-style: italic; font-weight: 400; font-size: clamp(1.3rem, 2.8vw, 1.75rem); line-height: 1.5; color: #241A12; border: 0; padding: 0; margin: 2.4em 0; max-width: 24ch; }
.wp-canvas .wp-quote::before { content: ""; display: block; width: 38px; height: 2px; background: #6B4226; margin-bottom: 22px; }
.wp-canvas .wp-quote cite { display: block; font-size: .82rem; letter-spacing: .04em; margin-top: 10px; color: #6E5F50; font-style: normal; }
.wp-canvas .wp-callout { background: transparent; border: 0; border-top: 1px solid rgba(60,43,26,.15); border-bottom: 1px solid rgba(60,43,26,.15); border-radius: 0; padding: 22px 0; color: #6E5F50; display: flex; gap: 10px; }
.wp-canvas .wp-hero { text-align: center; background: #F6EAD7; border-radius: 4px; padding: clamp(52px,7vw,88px) 28px; }
.wp-canvas .wp-hero__title { font-family: 'Noto Serif TC', serif; font-weight: 500; letter-spacing: -.015em; line-height: 1.18; font-size: clamp(1.9rem,4.4vw,3rem); color: #6B4226; }
.wp-canvas .wp-hero__sub { color: #6E5F50; margin-top: 8px; }
.wp-canvas .wp-hero__btn, .wp-canvas .wp-cta .wp-hero__btn { display: inline-block; margin-top: 16px; background: #a8744a; color: #fff; padding: 12px 28px; border-radius: 8px; font-size: 1rem; font-weight: 500; }
.wp-canvas .wp-cta { text-align: center; background: #F6EAD7; border-radius: 4px; padding: clamp(40px,6vw,72px) 24px; }
.wp-canvas .wp-cta__h { font-family: 'Noto Serif TC', serif; font-weight: 500; font-size: clamp(1.5rem,3vw,2rem); color: #6B4226; }
.wp-canvas .wp-cta__b { color: #6E5F50; margin-top: 8px; }
.wp-canvas__raw { background: #f6f1e8; padding: 12px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; }

/* 側欄收合（區塊清單 / 設定側欄）→ 讓中間畫布更寬；狀態記在 localStorage */
.wp-list, .wp-settings { position: relative; }
.wp-collapse-btn { position: absolute; top: 6px; z-index: 6; width: 22px; height: 22px; border-radius: 6px; border: 1px solid #e0cdb5; background: #fff; color: #98623D; font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 1px 3px rgba(120,80,40,.12); }
.wp-collapse-btn:hover { background: #FBF4E8; }
.wp-collapse-btn[data-wp-collapse="list"] { right: 4px; }
.wp-collapse-btn--right { left: 4px; }
.wp-list.is-collapsed, .wp-settings.is-collapsed { flex: 0 0 26px !important; width: 26px !important; min-width: 26px !important; overflow: visible; padding-left: 2px !important; padding-right: 2px !important; }
.wp-list.is-collapsed > *:not(.wp-collapse-btn), .wp-settings.is-collapsed > *:not(.wp-collapse-btn) { display: none !important; }
.wp-list.is-collapsed .wp-collapse-btn[data-wp-collapse="list"] { right: 2px; }
.wp-settings.is-collapsed .wp-collapse-btn--right { left: 2px; }

.wp-settings {
  width: 340px; flex-shrink: 0; overflow: auto; padding: 20px 18px 80px;
  background: #fff; border-left: 1px solid #e6d8c4;
}
.wp-settings__title { font-weight: 700; color: #3D2B1A; margin-bottom: 14px; font-size: 15px; }
.wp-settings__empty { color: #9a8064; font-size: 14px; line-height: 1.8; padding: 30px 6px; text-align: center; }
@media (max-width: 820px) {
  .wp-body { flex-direction: column; }
  .wp-settings { width: auto; border-left: none; border-top: 1px solid #e6d8c4; max-height: 45vh; }
}

/* WP 編輯器：左側區塊清單 + 復原/重做 */
.wp-history { display: flex; gap: 2px; }
.wp-history .icon-btn { font-size: 18px; line-height: 1; }
.wp-history .icon-btn:disabled { opacity: .35; cursor: default; }
.wp-list__title { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #9a8064; text-transform: uppercase; padding: 4px 10px 10px; }
.wp-left-tabs { display:grid; grid-template-columns:1fr 1fr; gap:4px; padding:0 28px 10px 8px; border-bottom:1px solid #e6d8c4; }
.wp-left-tab { min-height:38px; border:1px solid transparent; border-radius:7px; background:transparent; color:#6B4226; box-shadow:none; font-size:12px; font-weight:700; cursor:pointer; }
.wp-left-tab:hover { background:#F6EAD7; }
.wp-left-tab.is-active { background:#fff; border-color:#d9c09e; color:#3D2B1A; box-shadow:0 1px 2px rgba(90,63,36,.07); }
.wp-left-panel { min-width:0; }
.wp-inserter { padding:0 8px 28px; }
.wp-inserter__hint { margin:0 2px 10px; color:#6E5F50; font-size:12px; line-height:1.55; }
/* A2：插入面板釘住鈕 */
.wp-inserter__title { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.wp-inserter__pin { min-height:26px; padding:2px 8px; border:1px solid #d9c09e; border-radius:999px; background:#fff; color:#6B4226; font-size:11px; font-weight:700; letter-spacing:0; text-transform:none; cursor:pointer; box-shadow:none; }
.wp-inserter__pin:hover { background:#F6EAD7; }
.wp-inserter__pin.is-on { background:#98623D; border-color:#98623D; color:#fff; }
/* A2：佔位提示——空欄位不論是否剛被清空（可能殘留 <br>），都顯示提示 */
.wp-edit.is-empty::before { content: attr(data-placeholder); color: #b9a589; pointer-events:none; }
.wp-inserter .block-palette { margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; animation:none; }
.wp-inserter .block-palette__options { grid-template-columns:1fr; gap:6px; }
.wp-inserter .block-palette__option { min-height:48px; flex-direction:row; align-items:center; gap:8px; padding:9px 10px; background:#fff; }
.wp-inserter .block-palette__option strong { flex:1; font-size:13px; }
.wp-inserter .block-palette__option span:last-child { display:none; }
.wp-inserter .block-palette__icon { width:24px; text-align:center; }
.wp-list__empty { color: #b9a589; font-size: 13px; padding: 10px; }
.wp-list-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 10px; border: none; background: transparent; border-radius: 8px;
  cursor: pointer; color: #5a4634; font-size: 13px; transition: background .12s; min-width: 0;
}
.wp-list-item:hover { background: #F3E6D2; }
.wp-list-item.is-selected { background: #98623D; color: #fff; }
.wp-list-item.is-selected .wp-list-item__label { color: inherit; }
.wp-list-item__icon { width: 18px; text-align: center; flex-shrink: 0; }
.wp-list-item__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 0 auto; max-width: 48%; }
/* A6：清單列摘要（前 12 字），同型區塊才分得出哪一個 */
.wp-list-item__snippet { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8a7458; font-size: 12px; }
.wp-list-item.is-selected .wp-list-item__snippet { color: rgba(255,255,255,.82); }
.wp-list-group-toggle { width: 36px; height: 36px; flex: 0 0 36px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: currentColor; cursor: pointer; line-height: 1; }
.wp-list-group-toggle:hover { background: rgba(152,98,61,.12); }
/* 清單列的操作鈕（上/下/複製/刪）：平常隱藏，滑過或選取時出現，仿 WP List View */
.wp-list-item__ops { display: flex; gap: 1px; flex-shrink: 0; margin-left: auto; opacity: 0; transition: opacity .12s; }
.wp-list-item:hover .wp-list-item__ops, .wp-list-item.is-selected .wp-list-item__ops, .wp-list-item:focus-within .wp-list-item__ops { opacity: 1; }
.wp-list-item__ops .icon-btn { width:36px; height:36px; padding: 2px 4px; font-size: 12px; line-height: 1; background: rgba(255,255,255,.6); border: 1px solid #e0cdb0; border-radius: 7px; cursor: pointer; color: #6b573f; }
.wp-list-item__ops .icon-btn:hover { background: #fff; }
.wp-list-item__ops .icon-btn--danger { color: #b1483f; border-color: #e7bfb8; }
.wp-list-item.is-selected .wp-list-item__ops .icon-btn { background: rgba(255,255,255,.85); }
.wp-selection-status {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px;
  border: 1px solid #d8c4a8; border-radius: 999px; background: #fffaf4;
  color: #6b573f; font-size: 12px; white-space: nowrap;
}
.wp-list-item:focus-visible { outline: 2px solid #98623D; outline-offset: 2px; }
.wp-list-group-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* ===================== 連結漂浮選單 ===================== */
.link-field { position: relative; }
.link-picker-pop {
  position: fixed; z-index: var(--bb-layer-popover, 9999);
  background: #fff; border: 1.5px solid #cbb08a; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(120,80,40,.18); padding: 6px;
  display: flex; flex-direction: column;
}
.link-picker-search-wrap { padding: 2px 2px 6px; }
.link-picker-search {
  width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1.5px solid #e0cdb5; border-radius: 8px; font-size: 13px; outline: none;
}
.link-picker-search:focus { border-color: #98623D; }
.link-picker-list { overflow-y: auto; }
.link-picker-sec {
  font-size: 11px; letter-spacing: .08em; color: #a8865f; font-weight: 700;
  padding: 8px 8px 4px; position: sticky; top: 0; background: #fff;
}
.link-picker-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
}
.link-picker-item:hover { background: #f6efe5; }
.link-picker-item__t { font-size: 13.5px; color: #3a2c22; font-weight: 500; }
.link-picker-item__u { font-size: 11.5px; color: #a08a72; }
.link-picker-empty { padding: 6px 10px; font-size: 12px; color: #b0a08c; }

/* ===================== 結構化項目編輯器 ===================== */
.items-editor { display: flex; flex-direction: column; gap: 10px; }
.items-rows { display: flex; flex-direction: column; gap: 10px; }
.items-row { border: 1.5px solid #e6d8c4; border-radius: 10px; padding: 10px 12px; background: #fdfaf5; }
.items-row__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.items-row__num { font-size: 12px; font-weight: 700; color: #a8865f; }
.items-row__ops { display: flex; gap: 4px; }
.items-row__ops button { width: 36px; height: 36px; border: 1px solid #e0cdb5; background: #fff; border-radius: 7px; cursor: pointer; font-size: 13px; color: #7a5c42; display: flex; align-items: center; justify-content: center; padding: 0; }
.items-row__ops button:hover { background: #f3ebdf; }
.items-row__del:hover { background: #fce8e6 !important; color: #c0392b; border-color: #e8b4ae !important; }
.items-row__cols { display: flex; flex-direction: column; gap: 8px; }
.items-col-field { display: flex; flex-direction: column; gap: 3px; }
.items-col-field label { font-size: 11.5px; color: #9a836a; }
.items-col { width: 100%; box-sizing: border-box; padding: 7px 9px; border: 1.5px solid #e0cdb5; border-radius: 7px; font-size: 13px; outline: none; font-family: inherit; }
.items-col:focus { border-color: #98623D; }
.items-add { align-self: flex-start; }

/* 區塊清單可拖曳排序 */
.wp-list-item { cursor: grab; }
.wp-list-item:active { cursor: grabbing; }
.wp-list-item__drag { opacity: .35; font-size: 13px; line-height: 1; margin-right: 2px; letter-spacing: -2px; }
.wp-list-item.drag-over { outline: 2px dashed #a8744a; outline-offset: -2px; }

/* 右側設定面板：區塊／頁面分頁 */
.wp-settings__tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1.5px solid #e6d8c4; }
button.wp-tab { flex: 1; min-height:44px; background:var(--bg); border:1px solid var(--line-strong); padding:9px 8px; font-size:13.5px; font-weight:600; color:var(--ink); cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-1.5px; box-shadow:none; }
button.wp-tab:hover { background:var(--brand-soft); color:var(--ink); box-shadow:none; }
button.wp-tab.is-active,
button.wp-tab.is-active:hover,
button.wp-tab.is-active:focus-visible,
button.wp-tab.is-active:active { background:var(--brand); color:#fff; border-color:var(--brand); border-bottom-color:var(--brand-deep); box-shadow:none; }
.wp-settings__stat { font-size: 12px; color: #8a6f5a; margin-bottom: 12px; }

/* ===================== 後台手機版（P15d-C6） ===================== */
@media (max-width: 640px){
  .main{padding:16px 12px 40px}
  .panel__header{flex-direction:column;gap:10px}
  .panel__header > div{display:flex;flex-wrap:wrap;gap:8px}
  .panel__header button, .panel__header .button-link{font-size:13px;padding:8px 12px}
  .stats{grid-template-columns:1fr}
  /* WP 編輯器 */
  .wp-topbar{flex-wrap:wrap;gap:8px;padding:8px 10px}
  .wp-topbar__hint{display:none}
  .wp-title{flex-basis:100%;order:-1}
  .wp-topbar button{font-size:13px;padding:7px 10px}
  .wp-topbar__add .block-palette{position:fixed;left:8px;right:8px;top:auto;bottom:10px;width:auto;max-height:55vh}
  .wp-left-tabs{padding-right:28px}
  .wp-canvas{padding:18px 10px 90px}
  .wp-settings{max-height:52vh;padding:14px 12px 40px}
  /* 媒體庫工具列與彈窗 */
  .media-bar{flex-wrap:wrap}
  .media-bar input[type="search"]{min-width:0;flex:1}
  .media-modal__panel, .modal__panel{width:94vw !important;max-width:94vw !important}
  /* 內容日曆：允許橫向捲動 */
  #postCalendarCard{overflow-x:auto}
  /* 表格類列表允許橫向捲動 */
  .panel table{display:block;overflow-x:auto}
}

/* ===== 2026-09-01 full review: persistent actions + WP editor RWD ===== */
.entity-list--rows .entity-item__quickactions,
.entity-item__quickactions { opacity: 1 !important; pointer-events: auto !important; }
.wp-editor, .wp-editor * { min-width: 0; }
.wp-editor { width: 100vw; max-width: 100vw; overflow: hidden; }
.wp-topbar { flex-wrap: wrap; }
.wp-canvas { max-width: 100%; min-width: 0; }
.wp-canvas-block__body { max-width: 100%; overflow-x: auto; }
@media (max-width: 1100px) and (min-width: 641px){
  .wp-list { width: 208px !important; }
  .wp-settings { width: 280px !important; }
  .wp-canvas { padding-left: 16px; padding-right: 16px; }
  /* 1021px remains a three-column editor: reserve enough width for the two
     Chinese-labelled workspace tabs instead of breaking every character. */
  .wp-left-tabs { grid-template-columns:repeat(2,minmax(76px,1fr)); }
  .wp-left-tab { white-space:nowrap; }
}
@media (max-width: 640px){
  .wp-editor { overflow-y: auto; }
  .wp-topbar { gap: 7px; padding: 8px 10px !important; }
  .wp-topbar__add { order: 2; }
  .wp-history { order: 3; }
  .wp-title, .wp-topbar__hint { order: 1; flex: 1 1 100% !important; }
  .wp-topbar [data-wp-preview], .wp-topbar [data-wp-save] { order: 4; }
  .wp-list-group-toggle, .wp-list-item__ops .icon-btn, .items-row__ops button { width:44px; height:44px; flex-basis:44px; }
  .wp-list-item { min-height:44px; }
  .wp-body { flex-direction: column; min-height: 0; }
  /* 手機仍保留可展開的區塊清單；不能為了畫面乾淨而拿掉鍵盤／群組入口。 */
  .wp-list { display: block !important; width: 100% !important; max-height: min(28dvh, 220px); flex: 0 0 auto; border-bottom: 1px solid #e6d8c4; }
  .wp-list.is-collapsed { width: 100% !important; min-width: 0 !important; max-height: 30px; flex-basis: 30px !important; }
  .wp-canvas { flex: 1 1 auto; width: 100%; padding: 18px 10px 90px !important; overflow-x: hidden; }
  .wp-settings { width: 100% !important; max-height: 48vh; flex: 0 0 auto; border-left: 0; border-top: 1px solid #e6d8c4; padding: 14px 12px 40px !important; }
  .wp-canvas-block { padding: 12px 10px; }
  .wp-block-tools { right: 4px; max-width: calc(100% - 8px); flex-wrap: wrap; }
  /* 觸控沒有 hover：選取區塊後將工具列納入版面，保留 44px 操作目標。 */
  .wp-canvas-block.is-selected .wp-block-tools,
  .wp-canvas-block:focus-within .wp-block-tools {
    position: static;
    width: 100%;
    max-width: none;
    min-height: 52px;
    margin: 12px 0 2px;
    padding: 4px;
    gap: 4px;
  }
  .wp-canvas-block.is-selected .wp-block-tools .icon-btn,
  .wp-canvas-block:focus-within .wp-block-tools .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* /resources 的頁面級白底也要在編輯畫布同步，避免畫布與預覽各用一套 Hero 顏色。 */
.wp-canvas[data-wp-page-key="resources"] .hero {
  background: #fff !important;
  border: 1px solid var(--cream-dark) !important;
  border-left: 0 !important;
  border-radius: 14px !important;
  padding: clamp(44px, 7vw, 76px) clamp(20px, 5vw, 48px) !important;
  text-align: center !important;
}
.wp-canvas[data-wp-page-key="resources"] .hero p { margin-inline: auto; }

/* WP 全域樣式面板：預設值由 website_settings 驅動，畫布與正式頁共用同一組 CSS 變數。 */
.wp-global-defaults { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #e0cdb5; }
.wp-global-defaults h4 { margin: 0 0 4px; color: #6b4226; font-size: 13px; }
.wp-global-defaults p { margin: 0 0 10px; font-size: 11.5px; color: #8a6f5a; line-height: 1.6; }
.wp-global-defaults .field { margin-bottom: 9px; }
.wp-global-defaults .field label { display:block; margin-bottom:3px; font-size:11.5px; color:#6e5f50; }
.wp-global-defaults .form-control { font-size:12px; padding:6px 8px; }
.wp-global-defaults__status { min-height: 1.4em; margin-top: 7px; font-size: 11.5px; }

/* ===== v3 brand + WP parity ===== */
.login-screen__logo,
.sidebar__logo {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  object-fit: contain;
}
.login-screen__logo { width: 104px; height: 104px; }
.sidebar__logo { width: 56px; height: 56px; }
.login-screen__panel h1,
.panel__header h1, .panel__header h2, .panel__header h3,
.card h1, .card h2, .card h3,
.wp-settings__title, .wp-global-defaults h4 {
  font-family: "Noto Serif TC", "Source Han Serif TC", serif;
  font-weight: 700;
}
.wp-format-toolbar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e6d8c4;
  border-radius: 8px;
  background: #fbf4e8;
  flex: 0 1 auto;
}
.wp-format-toolbar button {
  min-width: 28px;
  height: 28px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #5a4634;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.wp-format-toolbar button:hover { background: #fff; border-color: #d8c4a8; color: #98623D; }
.wp-format-toolbar span { width: 1px; height: 18px; margin: 0 2px; background: #d8c4a8; }
.wp-list-item__label {
  min-width: 0;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  writing-mode: horizontal-tb;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.35;
}
.wp-canvas { background: #FDF7F0; }
.wp-canvas .wp-canvas-block { background: transparent; }
.wp-canvas .post-body .stats,
.wp-canvas .cms-page .stats{
  gap:0 !important;
  align-items:stretch;
  min-width:0;
}
.wp-canvas .post-body .stats .stat,
.wp-canvas .cms-page .stats .stat{
  min-width:0 !important;
  overflow-wrap:anywhere;
  word-break:break-word;
  padding:6px 18px !important;
}
.wp-canvas .post-body .stat__num,
.wp-canvas .cms-page .stat__num{
  font-size:clamp(1.45rem,3vw,2.25rem) !important;
  line-height:1.18 !important;
  white-space:normal !important;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.wp-canvas .post-body .stat__label,
.wp-canvas .cms-page .stat__label{
  line-height:1.5 !important;
  margin-top:8px !important;
  overflow-wrap:anywhere;
}
.maintenance-switch--off .switch__track { background: #d26a5d; }
.maintenance-switch--off .switch__text { color: #a43f35; }
.maintenance-switch--on .switch__track { background: #4b9b62; }
.maintenance-switch--on .switch__text { color: #2f7444; }
@media (max-width: 1100px) {
  .wp-format-toolbar { order: 5; flex-basis: 100%; }
}
[hidden]{display:none !important}
html.bb-auth-pending #loginCard{visibility:hidden}

/* Round5 F1：入口同款 CIS 細線、柔和背景與短進場；不引入外部 runtime。 */
.main{position:relative;isolation:isolate}
.main::before{content:"";position:absolute;z-index:-1;top:0;right:4%;width:280px;height:220px;background:radial-gradient(ellipse,#ead7c4 0,rgba(234,215,196,0) 70%);opacity:.28;pointer-events:none}
.card,.appearance-card,.settings-card{transition:box-shadow .2s ease,border-color .2s ease,transform .2s ease}
.card:hover,.appearance-card:hover{border-color:#d8b995;box-shadow:0 14px 32px rgba(90,63,36,.1)}
.button-link,.panel__toolbar button,.panel__header button{transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease}
.button-link:hover,.panel__toolbar button:hover,.panel__header button:hover{transform:translateY(-1px)}
.button-link:focus-visible,.panel__toolbar button:focus-visible,.panel__header button:focus-visible{outline:3px solid rgba(152,98,61,.25);outline-offset:2px}
/* 編輯器是 fixed 全高工作區；祖先 transform 會建立 containing block，導致畫布被裁成短框。只對一般 panel 做淡入，不動 transform。 */
@media (prefers-reduced-motion:no-preference){.panel.is-active{animation:bb-admin-fade .24s ease both}}
@keyframes bb-admin-fade{from{opacity:.72}to{opacity:1}}
/* 回歸護欄：WP 編輯器維持視窗全高、三欄各自滾動，不被展示層卡片規則改寫。 */
.wp-editor{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;transform:none!important;animation:none!important;overflow:hidden!important}
@supports (height: 100dvh){.wp-editor{height:100dvh!important}}
.wp-body{flex:1 1 auto!important;min-height:0!important;min-width:0!important;overflow:hidden!important}
.wp-list,.wp-canvas,.wp-settings{min-height:0!important;min-width:0!important}
.wp-list{overflow-y:auto!important;overflow-x:hidden!important}
.wp-canvas{overflow-y:auto!important;overflow-x:hidden!important}
.wp-settings{overflow-y:auto!important;overflow-x:hidden!important}

/* Admin controls and responsive workspace; no content-color overrides. */
button:focus-visible,
.button-link:focus-visible,
.panel__toolbar button:focus-visible,
.panel__header button:focus-visible {
  outline:2px solid var(--brand);
  outline-offset:3px;
}
button:disabled:hover,
.panel__toolbar button:disabled:hover,
.panel__header button:disabled:hover {
  transform:none;
  box-shadow:none;
  cursor:not-allowed;
}
.field--error :is(input,textarea,select) {
  border-color:var(--bad);
  border-style:dashed;
}
.field--error :is(input,textarea,select):focus { outline-color:var(--bad); }

@media (max-width: 640px) {
  .main, .panel, .workspace__list, .workspace__editor { min-width:0; max-width:100%; }
  .topbar, .panel__toolbar, .collection-backbar, .media-batchbar {
    flex-wrap:wrap;
    gap:10px;
  }
  .topbar > *, .panel__header > *, .panel__toolbar > * { min-width:0; max-width:100%; }
  .panel__toolbar { justify-content:flex-start; }
  button.subtabs__btn { max-width:100%; white-space:normal; }
  .panel__toolbar > button, .panel__toolbar > .button-link {
    flex:1 1 auto;
    min-height:44px;
    white-space:normal;
  }
  .panel > .card, .workspace__list > .card { padding:16px; }
  .status--inline { min-width:0; flex-basis:100%; overflow-wrap:anywhere; }
  .entity-list { max-height:none; }
  .entity-item__row, .entity-list--rows .entity-item__row { align-items:stretch; }
  /* A desktop flex-basis of 240px becomes an unwanted row height in a column. */
  .entity-item__main { flex:1 1 auto; width:100%; }
  .entity-item__cols, .entity-item__actions, .entity-item__quickactions {
    flex-wrap:wrap;
    min-width:0;
    max-width:100%;
    gap:10px;
  }
  .entity-list--rows .entity-item__title,
  .entity-list--rows .entity-item__meta {
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .media-bar > select, .media-bar #mediaDateFilter, .media-bar #mediaSearch {
    flex:1 1 150px;
    width:100%;
    min-width:0 !important; /* #mediaSearch has an inline 200px minimum. */
    max-width:100%;
  }
  .media-bar > button { min-height:44px; white-space:normal; max-width:100%; }
  .media-bar__spacer, .media-batchbar__spacer { display:none; }
  .media-grid { grid-template-columns:repeat(auto-fill,minmax(min(100%,160px),1fr)); }
  .media-grid--picker { grid-template-columns:repeat(auto-fill,minmax(min(100%,120px),1fr)); }
  .media-picker-modal__head, .media-picker-modal__foot { flex-wrap:wrap; gap:10px; padding:12px; }
  .media-picker-modal__body { padding:12px; }

  .wp-topbar {
    flex-shrink:0;
    gap:8px !important; /* The editor also emits inline topbar geometry. */
    max-height:40vh;
    max-height:40dvh;
    overflow-y:auto;
  }
  .wp-topbar > *, .wp-settings__tabs > * { min-width:0; max-width:100%; }
  .wp-topbar button { min-height:44px; white-space:normal; }
  .wp-title { min-height:44px; }
  .wp-format-toolbar { flex-wrap:wrap; }
  .wp-format-toolbar button { height:auto; }
  /* One scrollable mobile document prevents the canvas being squeezed between two tall asides. */
  .wp-body { display:block !important; overflow-y:auto !important; }
  .wp-list {
    width:100% !important;
    max-height:180px;
    max-height:min(24dvh,180px);
    padding:12px 8px 16px !important;
  }
  .wp-canvas {
    width:100%;
    min-height:240px !important;
    overflow:visible !important;
    padding:18px 10px 32px !important;
  }
  .wp-settings {
    width:100% !important;
    max-height:none;
    overflow:visible !important;
    padding:14px 12px calc(32px + env(safe-area-inset-bottom,0px)) !important;
  }
  .wp-list.is-collapsed, .wp-settings.is-collapsed {
    width:100% !important;
    min-width:0 !important;
    height:44px;
    max-height:44px;
    padding:0 !important;
  }
  .wp-collapse-btn { min-width:44px; width:44px; height:44px; top:0; }
  .wp-settings__tabs { padding-top:32px; }
  .wp-list-item__label { overflow-wrap:anywhere; }
  .appearance-scope-note { flex-shrink:0; max-height:16vh; overflow:auto; padding:10px 12px; }
}
/* WP interaction candidate: editor chrome is not page content or brand layout. */
/* A panel fade creates a stacking context; the mobile sidebar must not cover the editor. */
/* The editor is fixed, but it still lives inside the normal page form.  A
   fade on that ancestor composites the whole editor below it and lets the
   admin sidebar show through for the first animation frame.  Entering WP
   editing must therefore disable the fade on both possible ancestors. */
body.wp-edit-mode .panel.is-active,
body.wp-edit-mode .editor-form { animation:none; opacity:1; }
body.wp-edit-mode .main { isolation:auto; z-index:101; }
.wp-editor--single-tools .wp-canvas-block__body.cms-page { padding:0; margin:0; width:auto; max-width:none; }
.wp-editor--single-tools .wp-topbar { flex:0 0 auto; width:100%; box-sizing:border-box; flex-wrap:wrap; align-content:flex-start; overflow:visible; padding-top:12px; padding-bottom:12px; }
.wp-editor--single-tools .wp-topbar > * { flex-shrink:1; }
.wp-editor--single-tools .wp-topbar__actions { flex:0 0 auto; min-width:max-content; }
@media (max-width:1100px) and (min-width:641px) {
  .wp-editor--single-tools .wp-title { flex:1 1 220px !important; min-width:0 !important; }
}
@media (max-width:640px) {
  .wp-editor--single-tools .wp-topbar { max-height:none; overflow:visible; }
  .wp-editor--single-tools .wp-topbar__actions { order:4; width:100%; margin-left:0; }
  .wp-editor--single-tools .wp-topbar__actions button { flex:1 1 0; }
}
.wp-editor--single-tools .wp-canvas-block { padding:0; margin-block:6px; border-color:transparent; border-radius:0; }
.wp-editor--single-tools .wp-canvas-block.is-current,
.wp-editor--single-tools .wp-canvas-block--multi { outline:1px solid #98623D; outline-offset:3px; }
.wp-editor--single-tools .wp-canvas-block > .wp-block-tag { display:none; }
.wp-editor--single-tools .wp-canvas-block > .wp-block-tools { display:none; }
/* 防呆：即使舊快取殘留畫布工具列，也不讓它們再次遮住巢狀內容。 */
.wp-editor--single-tools .wp-canvas .wp-block-tools { display:none !important; }
.wp-editor--single-tools .wp-list-item {
  height:44px; min-height:44px; width:100%; margin:0; padding:0 6px 0 calc(4px + var(--block-depth,0) * 12px);
  display:flex; gap:4px; font-size:13px; box-sizing:border-box; border:0; border-radius:4px;
}
.wp-editor--single-tools .wp-list-group-toggle,
.wp-editor--single-tools .wp-list-group-spacer { width:24px; min-width:24px; height:32px; min-height:32px; padding:0; flex:0 0 24px; box-shadow:none; border:0; }
.wp-editor--single-tools .wp-list-group-toggle { background:transparent; color:inherit; }
.wp-editor--single-tools .wp-list-more { flex:0 0 32px; width:32px; min-width:32px; height:36px; min-height:36px; padding:0; box-shadow:none; border:0; background:transparent; color:inherit; }
.wp-editor--single-tools .wp-list-item__label { min-width:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* A6：有摘要時標籤只佔自己的寬度、摘要吃剩下的空間（接在上一條之後才蓋得過） */
.wp-editor--single-tools .wp-list-item__label { flex:0 1 auto; max-width:48%; }
.wp-editor--single-tools .wp-list-item__snippet { flex:1 1 auto; min-width:0; margin-left:2px; }
.wp-context-menu { position:fixed; z-index:var(--bb-layer-editor-menu, 3300); width:224px; max-height:calc(100dvh - 16px); overflow:auto; background:#FFFDF9; color:#3D2B1A; border:1px solid #EDD3A8; border-radius:8px; padding:8px; box-shadow:0 8px 24px #3D2B1A26; }
.wp-context-menu button { display:block; width:100%; min-height:36px; border:0; border-radius:4px; box-shadow:none; background:transparent; color:inherit; text-align:left; padding:8px 12px; font-size:14px; }
.wp-context-menu button:hover,.wp-context-menu button:focus-visible { background:#F6EAD7; outline:2px solid #98623D; outline-offset:-2px; }
.wp-context-menu button:disabled { opacity:.45; cursor:not-allowed; }
.wp-exit-dialog { width:min(520px,calc(100vw - 32px)); border:1px solid #EDD3A8; border-radius:12px; padding:24px; background:#FDF7F0; color:#3D2B1A; }
.wp-exit-dialog::backdrop { background:#3D2B1A66; }
.wp-exit-dialog h2 { font-size:22px; margin:0 0 12px; }
.wp-exit-dialog p { line-height:1.7; }
.wp-exit-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:20px; }
.wp-exit-actions button { min-height:44px; }
@media(max-width:767px) {
  .wp-contextual-toolbar { gap:5px; max-width:calc(100vw - 12px); padding:4px; }
  .wp-contextual-toolbar .wp-selection-path { max-width:42vw; }
  .wp-contextual-toolbar .wp-block-tools .icon-btn,
  .wp-contextual-toolbar .wp-format-toolbar button { width:44px; min-width:44px; height:44px; min-height:44px; }
  .wp-editor--single-tools .wp-canvas-block { padding:0; }
}

/* Phase 2: responsive workspace is editor chrome, never saved page content. */
.wp-workspace-switch {
  display:inline-flex; align-items:center; gap:2px; padding:3px;
  border:1px solid #e6d8c4; border-radius:8px; background:#FDF7F0;
}
.wp-workspace-switch__label { padding:0 6px; color:#6E5F50; font-size:12px; white-space:nowrap; }
.wp-workspace-switch__button {
  min-height:30px; border:0; border-radius:5px; padding:5px 8px; background:transparent;
  box-shadow:none; color:#6B4226; font-size:12px; font-weight:650; cursor:pointer;
}
.wp-workspace-switch__button:hover { background:#F6EAD7; }
.wp-workspace-switch__button.is-active { background:#98623D; color:#fff; }
.wp-workspace-panelbar { display:none; flex:none; gap:6px; padding:8px; border-bottom:1px solid #EDD3A8; background:#fff; overflow-x:auto; }
.wp-workspace-panelbar button { flex:1 0 auto; min-height:40px; border:1px solid #e0cdb5; border-radius:7px; background:#fff; color:#5A4634; box-shadow:none; padding:8px 12px; font-weight:700; }
.wp-workspace-panelbar button.is-active { border-color:#98623D; background:#F6EAD7; color:#6B4226; }
.wp-drag-hint { margin:0 8px 8px; color:#6E5F50; font-size:12px; line-height:1.5; }
.wp-editor--single-tools .wp-list-item__drag {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 28px;
  width:28px; min-width:28px; height:32px; min-height:32px; padding:0;
  border:0; border-radius:4px; background:transparent; box-shadow:none; color:inherit;
  cursor:grab; opacity:.62; letter-spacing:-2px; line-height:1;
}
.wp-editor--single-tools .wp-list-item__drag:active { cursor:grabbing; }
.wp-editor--single-tools .wp-list-item__drag:hover,
.wp-editor--single-tools .wp-list-item__drag:focus-visible { background:rgba(152,98,61,.12); opacity:1; outline:2px solid currentColor; outline-offset:-2px; }
.wp-editor--single-tools [data-block-index].drag-over { outline:0; }
.wp-editor--single-tools [data-block-index].drag-over--before { box-shadow:inset 0 3px 0 #98623D; }
.wp-editor--single-tools [data-block-index].drag-over--after { box-shadow:inset 0 -3px 0 #98623D; }

/* Tablet and phone modes show one task at a time: list, canvas, or settings. */
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-workspace-panelbar,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-workspace-panelbar { display:flex; }
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-body,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-body { display:block !important; overflow:auto !important; }
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-list,
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-canvas,
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-settings,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-list,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-canvas,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-settings { display:none !important; width:auto !important; min-height:0 !important; max-height:none !important; }
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-body[data-wp-workspace-panel="list"] .wp-list,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-body[data-wp-workspace-panel="list"] .wp-list,
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-body[data-wp-workspace-panel="canvas"] .wp-canvas,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-body[data-wp-workspace-panel="canvas"] .wp-canvas,
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-body[data-wp-workspace-panel="settings"] .wp-settings,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-body[data-wp-workspace-panel="settings"] .wp-settings { display:block !important; }
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-list,
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-settings { max-width:760px !important; margin:0 auto; border-left:0; border-right:0; }
.wp-editor--single-tools[data-wp-workspace-view="tablet"] .wp-canvas { max-width:900px; margin:0 auto; padding:30px 20px 96px !important; }
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-list,
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-settings { max-width:430px !important; margin:0 auto; border-left:0; border-right:0; }
.wp-editor--single-tools[data-wp-workspace-view="mobile"] .wp-canvas { max-width:430px; margin:0 auto; padding:20px 12px 72px !important; }

/* Artwork candidates are a focused, guarded wizard instead of a page-settings sidebar section. */
.home-candidate-dialog { width:min(680px,calc(100vw - 32px)); max-height:min(86dvh,900px); overflow:auto; border:1px solid #E4CCAD; border-radius:14px; padding:0; background:#FFFDF9; color:#3D2B1A; box-shadow:0 24px 72px rgba(61,43,26,.24); }
.home-candidate-dialog::backdrop { background:rgba(61,43,26,.46); }
.home-candidate-dialog__head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:24px 24px 16px; border-bottom:1px solid #EEDDC8; }
.home-candidate-dialog__head h2 { margin:0; font-family:'Noto Serif TC',serif; font-size:24px; color:#3D2B1A; }
.home-candidate-dialog__head p { margin:8px 0 0; color:#6E5F50; line-height:1.65; }
.home-candidate-dialog__body { padding:20px 24px 28px; }
.home-candidate-dialog__body .candidate-display-options { margin:18px 0; padding:14px 16px; border:1px solid #E6D8C4; border-radius:10px; }
.home-candidate-dialog__body .candidate-display-options label { display:block; margin:9px 0; }
.home-candidate-dialog__actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
@media(max-width:767px) {
  .wp-workspace-switch { order:3; width:100%; overflow-x:auto; }
  .wp-workspace-switch__label { position:sticky; left:0; background:#FDF7F0; }
  .wp-workspace-switch__button { min-height:38px; }
  .wp-workspace-panelbar { padding:8px 10px; }
  .wp-workspace-panelbar button { min-height:44px; }
  .home-candidate-dialog { width:calc(100vw - 20px); max-height:90dvh; }
  .home-candidate-dialog__head, .home-candidate-dialog__body { padding-left:16px; padding-right:16px; }
}
/* Catalog controls reuse the existing BB tokens and do not style public art. */
.catalog-config-preview{padding:20px;border:1px dashed var(--line,#EDD3A8);border-radius:12px;line-height:1.7;}
.catalog-config-preview p{margin:8px 0 0;}
.catalog-category-choice{display:flex;align-items:center;gap:10px;min-height:44px;}
.catalog-category-choice input{flex:none;}
.catalog-setting-guide{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;margin-top:5px;color:var(--text,#2F2F2F);font-size:12px;line-height:1.65;}
.catalog-setting-guide .setting-changed{color:var(--brown-dark,#6B4226);font-weight:700;}
.catalog-setting-guide .setting-reset{min-height:24px;min-width:32px;padding:2px 0;border:0;border-radius:0;box-shadow:none;background:none;color:var(--brown-dark,#6B4226);text-decoration:underline;font:inherit;cursor:pointer;}
.catalog-setting-guide{overflow-wrap:anywhere;min-width:0;}
.editor-advanced{margin-block:24px;padding-block:16px;border-top:1px solid var(--line,#EDD3A8);min-width:0;}
.editor-advanced summary{font-weight:700;cursor:pointer;min-height:44px;}
.editor-advanced .field{display:flex;flex-direction:column;gap:6px;margin-block:18px;}
.editor-advanced input,.editor-advanced select,.editor-advanced textarea{max-width:100%;min-width:0;box-sizing:border-box;}
.editor-advanced textarea{min-height:180px;font:14px/1.6 ui-monospace,monospace;}
.editor-advanced fieldset{min-width:0;padding:12px;}
.css-history{margin-top:16px;}.css-history li{margin-block:8px;overflow-wrap:anywhere;}
.wp-editor-options{position:relative;}.wp-editor-options>summary{cursor:pointer;list-style:none;font-size:24px;min-width:44px;min-height:44px;text-align:center;}
.wp-editor-options>div{position:absolute;right:0;z-index:30;width:min(270px,80vw);padding:12px;background:white;border:1px solid var(--line,#EDD3A8);border-radius:8px;box-shadow:0 6px 24px #0002;display:grid;gap:8px;}
.wp-code-editor{min-width:0;}.wp-code-editor textarea{box-sizing:border-box;width:100%;min-height:60vh;resize:vertical;font:14px/1.6 ui-monospace,monospace;white-space:pre;tab-size:2;}
.wp-code-editor > button{margin:8px 8px 12px 0;padding:10px 16px;min-height:44px;}
.wp-code-editor > p{margin-block:8px;}
.wp-editor-options > summary{display:grid;place-items:center;min-width:40px;min-height:40px;cursor:pointer;border:1px solid #e0cdb5;border-radius:8px;}
.wp-editor:has([data-page-json]) .wp-list,.wp-editor:has([data-page-json]) .wp-settings{display:none!important;}
.wp-editor.wp-editor--single-tools[data-wp-workspace-view][data-editor-mode="code"] .wp-workspace-panelbar,
.wp-editor.wp-editor--single-tools[data-wp-workspace-view][data-editor-mode="code"] .wp-body .wp-list,
.wp-editor.wp-editor--single-tools[data-wp-workspace-view][data-editor-mode="code"] .wp-body .wp-settings{display:none!important;}
.wp-editor.wp-editor--single-tools[data-wp-workspace-view][data-editor-mode="code"] .wp-body .wp-canvas{display:block!important;width:100%!important;max-width:none;}
.settings-overview-data{margin-block:20px;padding:16px;border:1px solid var(--cream-dark,#EDD3A8);border-radius:var(--radius,8px);}
.settings-overview-data>summary{cursor:pointer;font-weight:600;line-height:1.6;}
#customizationMap>select{display:block;max-width:100%;margin:8px 0 16px;}
#customizationMap>button{margin:0 8px 8px 0;}

/* C-12 post-close: the editor canvas is narrower than the public page. Keep
   the Posts-query preview legible by deriving its columns from its own
   available width. `max(220px,30%)` guarantees at least 220px per card and
   caps this editor-only preview at three columns; public portfolio grids still
   use the untouched site.css rules and their saved column settings. */
.wp-editor--single-tools .wp-canvas .portfolio-posts__grid{
  grid-template-columns:repeat(auto-fill,minmax(max(220px,30%),1fr));
}

.customization-table-wrap{max-width:100%;overflow:auto;margin-top:20px;}
.customization-table{width:100%;min-width:1000px;border-collapse:collapse;font-size:14px;line-height:1.7;}
.customization-table caption{text-align:left;font-weight:700;padding:12px 0;}
.customization-table th,.customization-table td{padding:12px 16px;border-bottom:1px solid var(--cream-dark,#EDD3A8);text-align:left;vertical-align:top;}
#customizationMap ul{padding-left:24px;}
#customizationMap li{margin-block:16px;line-height:1.8;}

/* C-12 navigation: one tree and one inspector, max two levels. */
.nav-tree-layout { display:grid; grid-template-columns:minmax(220px,1fr) minmax(240px,1fr); gap:24px; align-items:start; }
.nav-tree-layout section { min-width:0; }
.nav-tree-row { border:1px solid var(--line); border-radius:12px; margin:8px 0; background:var(--paper); overflow:hidden; }
.nav-tree-row--child { margin-left:28px; border-left:2px solid var(--accent); }
.nav-tree-select { display:flex; gap:8px; align-items:center; width:100%; text-align:left; white-space:normal; overflow-wrap:anywhere; background:transparent; color:var(--text); border:0; padding:12px; cursor:grab; }
.nav-tree-select[aria-pressed="true"] { background:var(--brand-soft); box-shadow:inset 3px 0 var(--accent); }
.nav-tree-select .subtle { margin-left:auto; flex-shrink:0; }
.nav-tree-nest { font-size:12px; color:var(--muted); padding:8px 12px; border-top:1px dashed var(--line); }
.nav-tree-details { display:grid; gap:16px; padding:20px; border:1px solid var(--line); border-radius:12px; background:var(--paper); position:sticky; top:16px; }
.nav-tree-details h4 { margin:0; }
.nav-tree-details select { width:100%; min-height:44px; }
.nav-tree-details input[type="checkbox"] { min-height:0; width:18px; height:18px; vertical-align:middle; }
.nav-tree-layout button:focus-visible { outline:2px solid var(--accent); outline-offset:-3px; }
@media(max-width:800px) { .nav-tree-layout { grid-template-columns:1fr; } .nav-tree-details { position:static; } }
/* 修訂紀錄：放在編輯器「頁面／文章」分頁最上面，預設收合 */
.wp-revisions > summary { cursor:pointer; }
.wp-revisions > summary::before { content:"▸"; margin-right:6px; }
.wp-revisions[open] > summary::before { content:"▾"; }
.wp-revisions .entity-item__row button { flex:none; white-space:nowrap; }
.wp-revisions .status:empty { display:none; }

/* 修訂比對 */
.revision-diff { position:fixed; inset:0; z-index:5000; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(47,47,47,.5); }
.revision-diff__panel { width:100%; max-width:720px; max-height:80vh; overflow:auto; padding:22px; color:#2F2F2F; background:#fff; border-radius:14px; }
.revision-diff__head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.revision-diff__head h3 { margin:0; font-size:18px; }
.revision-diff__head button { flex:0 0 auto; white-space:nowrap; }
.revision-diff__count { margin:0 0 14px; color:#7A5645; font-size:14px; }
.revision-diff__same { color:#3f7d47; }
.revision-diff__row { margin:0 0 12px; padding:12px 14px; background:#FDF7F0; border-radius:10px; }
.revision-diff__row h4 { margin:0 0 8px; font-size:15px; color:#6B4226; }
.revision-diff__row--added h4 { color:#2f6b38; }
.revision-diff__row--removed h4 { color:#a83b2e; }
.revision-diff__summary { margin:0; color:#7A5645; font-size:14px; }
.revision-diff__field { margin-top:10px; }
.revision-diff__field-name { font-size:13px; font-weight:700; color:#6B4226; margin-bottom:4px; }
.revision-diff__line { display:grid; grid-template-columns:40px 1fr; gap:8px; align-items:baseline; font-size:14px; line-height:1.6; }
.revision-diff__line span { color:#7A5645; font-size:12px; }
.revision-diff__line p { margin:0; overflow-wrap:anywhere; }
.revision-diff__mark { background:#EDD3A8; color:inherit; border-radius:3px; padding:0 2px; }
