/* 方案二「衡室設計」展示後台樣式
 * 桌機照 Design 畫布 Admin-Works.dc.html（選單 232／清單／編輯面板 420 三欄）。
 * 清單依「清單區實際剩下的寬度」自動收起次要欄位（container query），編輯面板開著也看得到編輯／刪除。
 * 1024–1199：編輯面板改右側抽屜；<1024：選單收進漢堡；<768：清單變卡片、編輯面板全螢幕。
 */
:root {
  --accent: #B08D57;
  --accent-hover: #C29E66;
  --a-bg: #F4F1EB;
  --a-surface: #FFFFFF;
  --a-ink: #1E1D1A;
  --a-ink-2: #3F3B35;
  --a-muted: #575249;
  --a-placeholder: #6E685E;
  --a-side: #EBE6DD;
  --a-side-hover: #E2DCD1;
  --a-side-line: #D9D2C6;
  --a-card-line: #DDD6CA;
  --a-field-line: #CFC7BA;
  --a-row-line: #EEE9E1;
  --a-th: #F7F4EF;
  --a-row-sel: #F6EFE2;
  --a-panel-line: #E6E0D6;
  --a-chip: #F1EDE6;
  --a-dash: #A79F92;
  --a-drop: #FAF8F4;
  --a-drop-over: #F0EAE0;
  --a-grid-line: #ECE6DC;
  --a-dark-line: #4A463F;
  --a-dark-text: #D6CFC3;
  --a-dark-text-2: #E4DED4;
  --a-on-dark: #F2EEE7;
  --a-on-ink: #FFFFFF;
  --a-count: #DDD6CA;
  --a-count-dark: #3A3833;
  --brass-text: #7A5C2E;
  --brass-light: #C9A774;
  --brass-line-dark: #8E6D3C;
  --brass-text-dark: #D9BC8C;
  --ok-bg: #E4EFE7;
  --ok-ink: #1F5A3D;
  --ok-dot: #2F7A52;
  --ok-line: #A9CDB5;
  --switch-on: #2F6B4F;
  --switch-off: #B5ADA0;
  --danger: #9A3A2C;
  --danger-hover: #7F2F23;
  --danger-line: #E3C9C3;
  --danger-bg: #F8EAE6;
  --draft-line: #9C9284;
  --grip-bg: rgba(255, 255, 255, .88);
  --dot-bg: rgba(30, 29, 26, .82);
  --overlay: rgba(30, 29, 26, .45);
  --overlay-strong: rgba(30, 29, 26, .55);
  --shadow-card: 0 24px 60px rgba(30, 29, 26, .08);
  --shadow-toast: 0 10px 28px rgba(30, 29, 26, .14);
  --shadow-dialog: 0 30px 70px rgba(0, 0, 0, .3);
  --shadow-drawer-right: -20px 0 50px rgba(30, 29, 26, .18);
  --shadow-drawer-left: 20px 0 50px rgba(30, 29, 26, .2);
  --shadow-bar: 0 -12px 12px -12px rgba(30, 29, 26, .2);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, .18);

  --f-serif: 'Noto Serif TC', "Microsoft JhengHei", "微軟正黑體", sans-serif;
  --f-sans: 'Noto Sans TC', "Microsoft JhengHei", "微軟正黑體", sans-serif;

  --header-h: 64px;
  --nav-w: 232px;
  --editor-w: 420px;
}

/* ---------- 基本 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--a-bg); color: var(--a-ink); font-family: var(--f-sans); font-size: 15px; line-height: 1.6; }
a { color: var(--a-ink); }
a:hover { color: var(--brass-text); }
button { font-family: inherit; }
::placeholder { color: var(--a-placeholder); opacity: 1; }
:focus-visible { outline: 2px solid var(--brass-text); outline-offset: 2px; }
.adm-header :focus-visible { outline-color: var(--brass-light); }
.ac { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 按鈕 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 0; font-family: inherit; font-size: 15px; font-weight: 500; letter-spacing: .06em; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.btn-xl { min-height: 56px; padding: 0 28px; font-size: 17px; font-weight: 700; letter-spacing: .1em; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; white-space: nowrap; }
.btn-block { width: 100%; }
.btn-dark { background: var(--a-ink); color: var(--a-on-dark); }
.btn-dark:hover { background: var(--a-count-dark); color: var(--a-on-dark); }
.btn-brass { background: var(--accent); color: var(--a-ink); }
.btn-brass:hover { background: var(--accent-hover); color: var(--a-ink); }
.btn-line { border: 1px solid var(--a-ink); background: var(--a-surface); color: var(--a-ink); }
.btn-line:hover { background: var(--a-chip); color: var(--a-ink); }
.btn-ghost { border: 1px solid var(--a-field-line); background: var(--a-surface); color: var(--a-ink); }
.btn-ghost:hover { border-color: var(--a-ink); }
.btn-danger { background: var(--danger); color: var(--a-on-ink); }
.btn-danger:hover { background: var(--danger-hover); color: var(--a-on-ink); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 1px solid var(--a-card-line); border-radius: 0; background: var(--a-surface); color: var(--a-ink); cursor: pointer; }
.icon-btn:hover { border-color: var(--a-ink); }

.demo-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1px solid var(--accent); color: var(--brass-text); font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: .12em; white-space: nowrap; }
.demo-pill--dark { border-color: var(--brass-line-dark); color: var(--brass-text-dark); }

/* ---------- 表單欄位 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.field-label { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--a-ink-2); }
.field-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--a-muted); }
.req { color: var(--brass-text); }
.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--a-field-line); border-radius: 0; background: var(--a-surface); font-family: inherit; font-size: 16px; color: var(--a-ink); }
select.input { padding: 0 34px 0 12px; font-size: 15px; -webkit-appearance: none; appearance: none; }
.textarea { height: auto; min-height: 80px; padding: 8px 14px; font-size: 15px; line-height: 1.7; resize: vertical; }
.input-suffix { display: flex; align-items: center; height: 48px; border: 1px solid var(--a-field-line); background: var(--a-surface); }
.input-suffix:focus-within { outline: 2px solid var(--brass-text); outline-offset: 2px; }
.input-suffix input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 12px; border: 0; background: transparent; font-family: inherit; font-size: 16px; color: var(--a-ink); }
.input-suffix input:focus-visible { outline: none; }
.input-suffix span { padding: 0 12px; font-size: 14px; color: var(--a-muted); }
.select-wrap { position: relative; }
.select-wrap svg { position: absolute; right: 12px; top: 16px; pointer-events: none; }
.field-error { margin: 0; font-size: 13px; line-height: 1.5; color: var(--danger); }
.input[aria-invalid="true"], .input-suffix.is-invalid { border-color: var(--danger); }

/* ---------- 登入 ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background-color: var(--a-bg); background-image: linear-gradient(var(--a-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--a-grid-line) 1px, transparent 1px); background-size: 48px 48px; }
.login-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 18px; padding: 36px 36px 24px; background: var(--a-surface); border: 1px solid var(--a-card-line); box-shadow: var(--shadow-card); }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand > div { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.login-brand .demo-pill { margin-left: auto; }
.login-name { margin: 0; font-family: var(--f-serif); font-size: 21px; font-weight: 600; letter-spacing: .14em; }
.login-sub { margin: 0; font-size: 13px; letter-spacing: .14em; color: var(--a-muted); }
.login-title { margin: 8px 0 0; font-family: var(--f-serif); font-size: 26px; font-weight: 600; line-height: 1.4; letter-spacing: .08em; }
.login-note { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--a-drop); font-size: 14px; line-height: 1.75; color: var(--a-muted); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn { margin-top: 6px; min-height: 56px; font-size: 17px; font-weight: 700; letter-spacing: .2em; }
.login-back { align-self: center; display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--a-muted); }

/* ---------- 版面：頁首＋選單＋內容＋編輯面板 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.storage-banner { margin: 0; padding: 10px 24px; border-bottom: 1px solid var(--danger-line); background: var(--danger-bg); color: var(--danger); font-size: 14px; }
.adm-header { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: var(--header-h); padding: 8px 24px; background: var(--a-ink); color: var(--a-on-dark); }
.adm-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.adm-logo { flex: 0 0 auto; }
.adm-name { margin: 0; font-family: var(--f-serif); font-size: 19px; font-weight: 600; letter-spacing: .14em; white-space: nowrap; }
.adm-divider { width: 1px; height: 20px; background: var(--a-dark-line); }
.adm-section { margin: 0; font-size: 15px; letter-spacing: .1em; color: var(--a-dark-text); white-space: nowrap; }
.adm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tool-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--a-dark-line); color: var(--a-on-dark); font-size: 15px; letter-spacing: .06em; text-decoration: none; }
.tool-link:hover { border-color: var(--brass-line-dark); color: var(--a-on-ink); }
.tool-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--a-dark-text-2); font-size: 15px; cursor: pointer; }
.tool-btn:hover { color: var(--a-on-ink); }
.adm-user { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.adm-user p { margin: 0; font-size: 15px; white-space: nowrap; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--a-ink); font-size: 15px; font-weight: 700; }
.nav-toggle { display: none; }

.adm-body { flex: 1 1 auto; display: flex; align-items: stretch; }
.adm-nav { position: sticky; top: var(--header-h); flex: 0 0 var(--nav-w); height: calc(100vh - var(--header-h)); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 24px 16px; background: var(--a-side); border-right: 1px solid var(--a-side-line); }
.nav-close { display: none; }
.nav-label { margin: 0 0 6px; padding: 0 14px; font-size: 12px; letter-spacing: .18em; color: var(--a-muted); }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; color: var(--a-ink); font-size: 16px; font-weight: 500; letter-spacing: .08em; text-decoration: none; }
.nav-link:hover { background: var(--a-side-hover); color: var(--a-ink); }
.nav-link[aria-current="page"] { background: var(--a-ink); color: var(--a-on-dark); }
.nav-link svg { flex: 0 0 auto; }
.nav-count { margin-left: auto; padding: 1px 9px; background: var(--a-count); color: var(--a-ink-2); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.nav-link[aria-current="page"] .nav-count { background: var(--a-count-dark); color: var(--a-dark-text-2); }
.nav-sep { height: 1px; margin: 10px 14px; background: var(--a-side-line); }
.nav-tools { display: none; }
.help-card { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 18px; background: var(--a-bg); border: 1px solid var(--a-side-line); }
.help-title { margin: 0; font-size: 14px; font-weight: 700; }
.help-text { margin: 0; font-size: 13px; line-height: 1.7; color: var(--a-muted); }
.nav-backdrop, .editor-backdrop { display: none; }

.adm-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding: 28px; container: adm-main / inline-size; }
.adm-main:focus { outline: none; }

/* ---------- 清單頁（作品、消息共用） ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; }
.page-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-title { margin: 0; font-family: var(--f-serif); font-size: 30px; font-weight: 600; line-height: 1.35; letter-spacing: .08em; }
.page-title:focus { outline: none; }
.page-intro { margin: 0; font-size: 15px; line-height: 1.7; color: var(--a-muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.search { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; background: var(--a-surface); border: 1px solid var(--a-field-line); }
.search:focus-within { outline: 2px solid var(--brass-text); outline-offset: 2px; }
.search svg { flex: 0 0 auto; }
.search input { flex: 1 1 auto; min-width: 0; min-height: 44px; border: 0; background: transparent; font-family: inherit; font-size: 15px; color: var(--a-ink); }
.search input:focus-visible { outline: none; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { min-height: 48px; padding: 0 16px; border: 1px solid var(--a-field-line); border-radius: 0; background: var(--a-surface); color: var(--a-ink); font-size: 15px; white-space: nowrap; cursor: pointer; }
.seg-btn:hover { border-color: var(--a-ink); }
.seg-btn[aria-pressed="true"] { border-color: var(--a-ink); background: var(--a-ink); color: var(--a-on-dark); }

.list-box { overflow-x: auto; background: var(--a-surface); border: 1px solid var(--a-card-line); }
.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { padding: 10px; text-align: left; font-size: 13px; font-weight: 500; letter-spacing: .08em; color: var(--a-muted); background: var(--a-th); border-bottom: 1px solid var(--a-card-line); white-space: nowrap; }
.list td { padding: 10px; border-bottom: 1px solid var(--a-row-line); vertical-align: middle; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tr.is-editing { background: var(--a-row-sel); }
.list td.c-meta, .list td.c-date { white-space: nowrap; }
.thumb { display: flex; align-items: center; justify-content: center; width: 56px; height: 42px; overflow: hidden; }
.thumb .art, .thumb .art-img { display: block; width: 100%; height: 100%; }
.thumb .art-img { object-fit: cover; }
.thumb-empty { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border: 1px dashed var(--a-dash); font-size: 11px; color: var(--a-muted); background: var(--a-drop); }
.t-title { margin: 0; font-family: var(--f-serif); font-size: 16px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.list--news .t-title { min-width: 9em; white-space: normal; }
.t-sub { margin: 0; font-size: 13px; color: var(--a-muted); white-space: nowrap; }
.t-sub-extra { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; }
.pill--on { background: var(--ok-bg); color: var(--ok-ink); }
.pill--on .pill-dot { background: var(--ok-dot); }
.pill--draft { padding: 2px 9px; background: var(--a-chip); border: 1px dashed var(--draft-line); color: var(--a-muted); }
.pill--draft .pill-dot { border: 1.5px solid var(--a-muted); }
.row-actions { display: flex; gap: 6px; }
.btn-row { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 9px; border: 1px solid var(--a-ink); border-radius: 0; background: var(--a-surface); color: var(--a-ink); font-size: 14px; white-space: nowrap; cursor: pointer; }
.btn-row:hover { background: var(--a-chip); }
.btn-row--danger { border-color: var(--danger-line); color: var(--danger); }
.btn-row--danger:hover { background: var(--danger-bg); }
.list-empty { margin: 0; padding: 40px 20px; text-align: center; font-size: 15px; color: var(--a-muted); }

/* 清單區變窄時（筆電開著編輯面板）依序收起次要欄位，編輯／刪除一定看得到；手機改卡片，不套用。
 * 門檻＝實測表格最小寬度＋邊框：全部欄 686、收第 1 層 591、收第 2 層 536。 */
@media (min-width: 768px) {
  @container adm-main (max-width: 690px) {
    .list .hide-1 { display: none; }
  }
  @container adm-main (max-width: 595px) {
    .list .hide-2 { display: none; }
    .list .t-sub-extra { display: inline; }
    .list .t-sub { white-space: normal; }
  }
  @container adm-main (max-width: 540px) {
    .list .hide-3 { display: none; }
    .list--news .t-title { min-width: 7em; }
  }
}

/* ---------- 編輯面板（作品、消息共用） ---------- */
.editor { position: sticky; top: var(--header-h); flex: 0 0 var(--editor-w); height: calc(100vh - var(--header-h)); min-width: 0; overflow-y: auto; display: flex; flex-direction: column; background: var(--a-surface); border-left: 1px solid var(--a-card-line); }
.ed-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 24px; background: var(--a-surface); border-bottom: 1px solid var(--a-panel-line); }
.ed-title { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-family: var(--f-serif); font-size: 21px; font-weight: 600; line-height: 1.4; letter-spacing: .06em; }
.ed-title:focus { outline: none; }
.ed-kicker { font-family: var(--f-sans); font-size: 14px; font-weight: 500; letter-spacing: .08em; color: var(--a-muted); }
.ed-name { overflow-wrap: anywhere; }
.ed-form { flex: 1 0 auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 0; }
.ed-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ed-row > .field { flex: 1 1 110px; }
.ed-row > .field.grow-2 { flex: 2 1 180px; }
.ed-row > .field.grow-1 { flex: 1 1 130px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0 0 14px; background: var(--a-chip); border: 1px solid var(--a-card-line); font-size: 14px; }
.tag-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 42px; padding: 0; border: 0; background: transparent; color: var(--a-muted); cursor: pointer; }
.tag-x:hover { color: var(--danger); }
.tag-add { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px dashed var(--a-dash); border-radius: 0; background: var(--a-surface); color: var(--a-ink-2); font-size: 14px; cursor: pointer; }
.tag-add:hover { border-color: var(--a-ink); }
.tag-input { display: inline-flex; align-items: stretch; min-height: 44px; border: 1px solid var(--a-ink); }
.tag-input input { width: 9.5em; min-width: 0; padding: 0 10px; border: 0; font-family: inherit; font-size: 14px; }
.tag-input input:focus-visible { outline: none; }
.tag-input:focus-within { outline: 2px solid var(--brass-text); outline-offset: 2px; }
.tag-ok { padding: 0 14px; border: 0; background: var(--a-ink); color: var(--a-on-ink); font-size: 14px; cursor: pointer; }

.drop { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 8px 6px 14px; border: 1.5px dashed var(--a-dash); background: var(--a-drop); transition: background-color .15s, border-color .15s; }
.drop.is-over { border-color: var(--a-ink); background: var(--a-drop-over); }
.drop > svg { flex: 0 0 auto; }
.drop-text { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.5; color: var(--a-ink); }
.drop-text strong { font-weight: 700; }
.drop-text span { font-size: 13px; color: var(--a-muted); }
.drop-touch { display: none; }
.file-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photos { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photos:empty { display: none; }
.photo { position: relative; height: 72px; overflow: hidden; cursor: grab; -webkit-user-select: none; user-select: none; }
.photos--single .photo { height: 120px; grid-column: 1 / -1; cursor: default; }
.photo.is-cover { outline: 2px solid var(--a-ink); outline-offset: -2px; }
.photo.is-dragging { opacity: .55; outline: 2px dashed var(--brass-text); outline-offset: -2px; cursor: grabbing; }
.photo-img { width: 100%; height: 100%; }
.photo-img .art, .photo-img .art-img { display: block; width: 100%; height: 100%; pointer-events: none; }
.photo-img .art-img { object-fit: cover; }
.photo-no { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; background: var(--a-surface); color: var(--a-ink); font-size: 12px; line-height: 1.5; pointer-events: none; }
.photo.is-cover .photo-no { background: var(--a-ink); color: var(--a-on-dark); }
.photo-grip { position: absolute; right: 0; bottom: 0; display: inline-flex; align-items: flex-end; justify-content: flex-end; width: 32px; height: 32px; padding: 3px; border: 0; background: transparent; cursor: grab; touch-action: none; }
.photo-grip-face { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: var(--grip-bg); }
.photo-del { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.photo-del-dot { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--dot-bg); color: var(--a-on-ink); }
.photo-del:hover .photo-del-dot { background: var(--danger); }
.usage { margin: 0; font-size: 13px; line-height: 1.5; color: var(--a-muted); }
.usage.is-high { color: var(--danger); }

.pub-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 10px 8px 16px; background: var(--a-bg); border: 1px solid var(--a-panel-line); }
.pub-text { min-width: 0; }
.pub-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.5; }
.pub-hint { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--a-muted); }
.pub-ctrl { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.pub-state { font-size: 14px; font-weight: 700; color: var(--a-muted); }
.pub-state.is-on { color: var(--ok-ink); }
.switch { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.switch-track { position: relative; display: block; width: 56px; height: 32px; border-radius: 16px; background: var(--switch-off); transition: background-color .2s; }
.switch-knob { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--a-surface); box-shadow: var(--shadow-knob); transition: left .2s; }
.switch[aria-checked="true"] .switch-track { background: var(--switch-on); }
.switch[aria-checked="true"] .switch-knob { left: 28px; }
/* 按鈕列固定在面板底部：矮螢幕不用捲到最下面才按得到 */
.ed-actions { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 -24px; padding: 12px 24px 20px; background: var(--a-surface); box-shadow: var(--shadow-bar); }
.ed-primary { flex: 2 1 200px; letter-spacing: .12em; }
.ed-secondary { flex: 1 1 110px; padding: 0 12px; font-size: 16px; font-weight: 500; letter-spacing: .08em; white-space: nowrap; }

/* ---------- 帳號設定 ---------- */
.acc-form { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 24px; background: var(--a-surface); border: 1px solid var(--a-card-line); }
.card-title { margin: 0; font-family: var(--f-serif); font-size: 20px; font-weight: 600; letter-spacing: .06em; }
.card-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--a-muted); }
.acc-form .ed-row > .field { flex: 1 1 220px; }
.acc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

/* ---------- 提示、確認視窗 ---------- */
.toast-zone { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 80; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(680px, 100%); padding: 6px 6px 6px 16px; background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-ink); box-shadow: var(--shadow-toast); animation: toast-in .22s ease; }
.toast > svg { flex: 0 0 auto; }
.toast-text { margin: 0; padding: 8px 0; font-size: 15px; font-weight: 700; line-height: 1.5; letter-spacing: .04em; }
.toast-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--ok-ink); font-size: 14px; white-space: nowrap; text-decoration: underline; }
.toast-x { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.toast--error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.confirm { width: min(440px, calc(100% - 32px)); padding: 0; border: 0; background: var(--a-surface); color: var(--a-ink); box-shadow: var(--shadow-dialog); }
.confirm::backdrop { background: var(--overlay-strong); }
.confirm-box { display: flex; flex-direction: column; gap: 12px; padding: 28px 28px 22px; }
.confirm-title { margin: 0; font-family: var(--f-serif); font-size: 22px; font-weight: 600; letter-spacing: .06em; }
.confirm-body { margin: 0; font-size: 15px; line-height: 1.8; color: var(--a-ink-2); }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.confirm-actions .btn { min-width: 112px; }

/* ---------- 寬桌機：提示框置中在清單區 ---------- */
@media (min-width: 1024px) {
  .toast-zone { left: var(--nav-w); }
}
@media (min-width: 1200px) {
  .app.has-editor ~ .toast-zone { right: var(--editor-w); }
}

/* ---------- 1199 以下：編輯面板改右側抽屜 ---------- */
@media (max-width: 1199px) {
  .editor { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(520px, 100%); height: auto; box-shadow: var(--shadow-drawer-right); animation: slide-in .25s ease; }
  .app.has-editor .editor-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: var(--overlay); }
  html.editor-open { overflow: hidden; }
  html.editor-open .toast-zone { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- 1023 以下：選單收進漢堡 ---------- */
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 44px; height: 44px; margin-left: -10px; padding: 0; border: 0; background: transparent; color: var(--a-on-dark); cursor: pointer; }
  .adm-tools { display: none; }
  .adm-nav { position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(300px, 86vw); height: auto; box-shadow: var(--shadow-drawer-left); transform: translateX(-102%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  .app.nav-open .adm-nav { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 45; background: var(--overlay); }
  .nav-close { display: inline-flex; align-items: center; justify-content: center; align-self: flex-end; flex: 0 0 auto; width: 44px; height: 44px; margin: -12px -4px 0 0; padding: 0; border: 1px solid var(--a-side-line); background: var(--a-surface); color: var(--a-ink); cursor: pointer; }
  .nav-tools { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--a-side-line); }
  .nav-user { display: flex; align-items: center; gap: 10px; padding: 4px 14px 10px; }
  .nav-user p { margin: 0; font-weight: 500; }
  .nav-tool { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border: 0; background: transparent; color: var(--a-ink); font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
  .nav-tool:hover { background: var(--a-side-hover); color: var(--a-ink); }
  .help-card { margin-top: 16px; }
  .adm-main { padding: 24px 20px; }
}

/* ---------- 觸控：照片拖曳把手加大、說明改成點按鈕 ---------- */
@media (max-width: 767px), (pointer: coarse) {
  .photo { height: 92px; }
  .photo-grip { width: 44px; height: 44px; padding: 4px; }
}
@media (hover: none), (max-width: 767px) {
  .drop-mouse { display: none; }
  .drop-touch { display: inline; }
}

/* ---------- 手機：清單變卡片、編輯面板全螢幕 ---------- */
@media (max-width: 767px) {
  .adm-header { gap: 8px; padding: 8px 12px; }
  .adm-brand { gap: 10px; }
  .adm-logo { width: 28px; height: 28px; }
  .adm-name { font-size: 17px; letter-spacing: .1em; }
  .adm-divider { height: 16px; }
  .adm-section { font-size: 14px; letter-spacing: .06em; }
  .adm-main { gap: 16px; padding: 20px 16px 32px; }
  .page-title { font-size: 26px; }
  .page-head .btn-xl { width: 100%; }
  .seg { width: 100%; }
  .seg-btn { flex: 1 1 0; padding: 0 6px; font-size: 14px; }

  .list-box { overflow: visible; background: transparent; border: 0; }
  .list { display: block; }
  .list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .list tbody { display: flex; flex-direction: column; gap: 12px; }
  .list tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; background: var(--a-surface); border: 1px solid var(--a-card-line); }
  .list tr.is-editing { background: var(--a-row-sel); }
  .list td { display: block; padding: 0; border: 0; }
  .list td.c-thumb { flex: 0 0 64px; }
  .list .thumb { width: 64px; height: 48px; }
  .list td.c-title { flex: 1 1 calc(100% - 80px); min-width: 0; }
  .list .t-title, .list--news .t-title { min-width: 0; white-space: normal; }
  .list .t-sub { white-space: normal; }
  .list td.c-meta, .list td.c-date { font-size: 14px; color: var(--a-ink-2); }
  .list td[data-mlabel]::before { content: attr(data-mlabel) " "; color: var(--a-muted); }
  .list td.c-actions { flex: 1 1 100%; padding-top: 4px; }
  .row-actions .btn-row { flex: 1 1 0; justify-content: center; }

  .editor { width: 100%; box-shadow: none; }
  .ed-head { padding: 10px 12px 10px 16px; }
  .ed-form { padding: 16px 16px 0; }
  .ed-actions { margin: 4px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 18px 16px 20px; }
  .acc-actions .btn { width: 100%; }
  .toast-zone { bottom: 12px; padding: 0 12px; }
  html.editor-open .toast-zone { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .toast { flex-wrap: wrap; }
  .login-card { padding: 28px 20px 18px; }
}

@media (max-width: 400px) {
  .adm-divider, .adm-section { display: none; }
}

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