/* style.css：後台共用樣式（中性灰白，主要按鈕用莓果紅棕）
   可以改的：最上面 :root 裡的顏色與圓角。改了影響：整個後台的外觀。 */

:root {
  --bg: #F5F5F4;
  --surface: #FFFFFF;
  --border: #E5E5E3;
  --border-strong: #DADAD7;
  --line: #EFEFED;
  --text: #1C1C1B;
  --text-2: #3A3A38;
  --muted: #62625F;
  --accent: #A65C5A;
  --accent-dark: #7A3F3E;
  --accent-soft: #F6ECEB;
  --good: #23683F;  --good-bg: #E6F2EA;
  --info: #2856A3;  --info-bg: #E8EEF8;
  --warn: #8A5A00;  --warn-bg: #FBF1DC;
  --gray: #4A4A48;  --gray-bg: #EEEEEC;
  --danger: #B42318; --danger-text: #8A3B30;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Noto Sans TC', -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { padding: 48px; text-align: center; color: var(--muted); }

/* ---------- 版面：左側選單 + 內容 ---------- */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav {
  flex: 1 1 248px; max-width: 100%; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 14px 20px; }
.nav-logo { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.nav-brand b { display: block; font-size: 15px; }
/* 左上「編輯」：名稱、副標、選單順序（nav-edit.js） */
.nav-names { min-width: 0; flex: 1 1 auto; }
.nav-logo.img { background: var(--surface); overflow: hidden; }
.nav-logo.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-logo-edit { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav-logo-edit button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 11px; color: var(--accent); }
.nav-logo-edit .nav-logo { cursor: pointer; outline: 1px dashed var(--accent); outline-offset: 2px; }
.nav-edit-btn { flex: 0 0 auto; }
.nav-names .input { width: 100%; min-height: 32px; padding: 0 8px; font-size: 14px; margin-bottom: 4px; }
.nav-sort { display: flex; flex-direction: column; gap: inherit; }
.nav.editing .nav-sort .nav-item { cursor: default; padding-left: 4px; gap: 8px; }
.nav.editing .nav-sort .nav-item .drag-handle { min-height: 32px; }
.nav.editing .nav-item[aria-current="page"] { background: none; }
.nav.editing .nav-sort { outline: 1px dashed var(--border); outline-offset: 2px; border-radius: 8px; }
.nav-edit-tip { font-size: 12px; color: var(--muted); padding: 0 14px 8px; }
.nav-brand span { font-size: 12px; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 15px; }
.nav-item:hover { background: #EFEFED; color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 500; }
.nav-item svg { flex: 0 0 18px; }
.nav-item { white-space: nowrap; }
.nav-item .soon { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--muted); }
/* 選單上的數字（menu-counts.js，2026/11/24；照官網後台：橘底白字圓形，靠右） */
/* 數字圓點（全站一樣，ui.js 的 countBadge；2026/11/24 使用者要求）：橘底白字圓形，0 不顯示；按鈕底色照原本（選到的紅底也一樣是橘色圓點） */
.count-badge { min-width: 22px; height: 18px; line-height: 18px; padding: 0 6px; box-sizing: border-box; border-radius: 9px; background: #F3A64A; color: #fff; font-size: 12px; font-weight: 600; display: inline-block; text-align: center; vertical-align: middle; margin-left: 6px; font-variant-numeric: tabular-nums; } /* 和官網後台 .tag-count 同一個尺寸：高 18、最小寬 22、左右 6、圓角 9（橢圓，三位數也放得下） */
.count-badge:empty { display: none; }
.ptab .count-badge { margin-left: 0; } /* 分頁本身已經有間距 */
.nav-item .nav-n { margin-left: auto; }
/* 問題警示按鈕（health-alert.js）：正常＝白底莓果紅棕字；故障＝紅底白字；只有提醒＝黃底深字 */
.nav-alert { margin-top: auto; padding: 12px 2px 8px; }
.alert-btn { width: 100%; min-height: 48px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--accent); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; padding: 8px 12px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.alert-btn.is-checking { color: var(--muted); font-weight: 500; }
.alert-btn.is-error { background: #D32F2F; border-color: #D32F2F; color: #fff; font-size: 17px; box-shadow: 0 4px 12px rgba(211,47,47,.3); }
.alert-btn.is-warn { background: #F5C451; border-color: #E8B23A; color: #4A3500; font-size: 16px; }
.alert-btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.alerts-modal { max-width: 640px; max-height: 86vh; overflow-y: auto; }
.al-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.al-head .h2 { margin: 0; }
.al-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.al-item { border: 1px solid var(--border); border-left: 5px solid #D32F2F; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.al-item.is-warn { border-left-color: #F5C451; }
.al-meta { display: flex; align-items: center; gap: 8px; }
.al-pill { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: #D32F2F; color: #fff; }
.al-item.is-warn .al-pill { background: #F5C451; color: #4A3500; }
.al-title { font-size: 15px; color: var(--text); }
.modal .al-detail { font-size: 14px; color: var(--text-2); line-height: 1.6; margin: 0; }
.al-act { display: flex; gap: 8px; flex-wrap: wrap; }
.al-ok { padding: 28px 12px; text-align: center; font-size: 16px; font-weight: 700; color: var(--good); background: var(--good-bg); border-radius: 10px; }
.nav-user { padding: 16px 14px 4px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.nav-user b { display: block; color: var(--text-2); font-weight: 500; word-break: break-all; }
.nav .nav-toggle { display: none; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 36px 64px; display: flex; flex-direction: column; gap: 20px; }
.main > * { min-width: 0; max-width: 100%; }

@media (max-width: 820px) {
  .nav { flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px; gap: 0; }
  .nav.open { gap: 4px; }
  .nav-brand { padding: 4px 4px 4px; }
  .nav .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav-links { display: none; flex-direction: column; gap: 4px; }
  .nav.open .nav-links { display: flex; }
  .nav-user { display: none; }
  .nav.open .nav-user { display: block; }
  .nav-alert { margin-top: 0; padding: 8px 0 0; } /* 手機：放在選單列下面，一直看得到 */
  .main { padding: 20px 16px 48px; }
  /* 手機（2026/11/16 使用者選 A）：選單列（LOGO、編輯、☰、問題警示）固定在畫面最上面，隨時找得到其他頁面；
     展開選單太長時在選單裡面捲。頁面標題那一塊改成跟著內容捲走（手機上固定會吃掉半個畫面）。 */
  .nav { position: sticky; top: 0; z-index: 60; max-height: 100vh; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
  .nav .alert-btn { min-height: 40px; padding: 6px 12px; }
  /* 頁首跟著捲走的規則在下面「固定標題列」那一段（要寫在 .sticky-head 基本樣式後面才有效；2026/11/25 發現這裡被後面蓋掉、一直沒生效） */
  /* 手機不能左右滑動（2026/11/16 使用者要求）：整頁寬度鎖在畫面寬；太寬的表格在自己的框裡左右捲 */
  html, body { overflow-x: clip; max-width: 100%; } /* clip 不會讓「固定」失效（hidden 會） */
  .shell { max-width: 100vw; align-content: flex-start; } /* 內容很短時（例：「此功能僅限電腦版操作」）多出來的高度不要分給最上面的選單列，選單列才不會變很高（2026/11/25） */
}
@media (min-width: 821px) {
  .nav-links { display: flex; flex-direction: column; gap: 4px; }
  /* 左側選單固定在畫面上，頁面往下捲也一直看得到 */
  .nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; flex: 0 0 248px; }
}

/* ---------- 標題列 ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.page-head .titles { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
/* 同一排相鄰的按鈕一律保持間距 10px，不可以相連（使用者 2026/11/14 要求）；放不下自動換行，上下也留 10px */
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sticky-head .head-actions, .sticky-head .row-btns { gap: 10px; } /* 同寬同高由 js/btn-equal.js 自動對齊 */h1 { margin: 0; font-size: 26px; font-weight: 700; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
.sub { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 14px; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover { background: var(--bg); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; font-size: 15px; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--bg); }

/* ---------- 卡片、表格 ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 20px 24px 8px; } /* 放不下時右邊的選單、按鈕換到下一行（2026/11/18 手機版「Cloudflare 方案」被切掉） */
.card-head h2 { flex: 1 1 12em; min-width: 0; }
.card-head > * { max-width: 100%; }
.card-head select { max-width: 100%; }
.table-wrap { overflow-x: auto; position: relative; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-size: 14px; color: var(--muted); }
.stat .value { font-size: 32px; font-weight: 700; line-height: 1.2; }
.stat .note { font-size: 13px; color: var(--muted); }

/* ---------- 狀態標籤 ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.live { color: var(--good); background: var(--good-bg); }
.pill.scheduled { color: var(--info); background: var(--info-bg); }
.pill.review { color: var(--warn); background: var(--warn-bg); }
.pill.draft, .pill.paused, .pill.ended { color: var(--gray); background: var(--gray-bg); }
.pill.dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 2px; }

/* ---------- 分頁籤（篩選） ---------- */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #EBEBE9; border-radius: 10px; }
.segmented button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; font-size: 14px; color: var(--text-2); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); flex: 0 1 280px; }
.search input { border: 0; outline: none; flex: 1 1 auto; min-width: 0; background: transparent; font-size: 14px; }
.select { min-height: 44px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.input { min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 15px; width: 100%; }

/* ---------- 開關 ---------- */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 40px; height: 24px; margin: 0; cursor: pointer; }
.switch .track { width: 40px; height: 24px; border-radius: 999px; background: #CFCFCC; position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 19px; }
.switch input:disabled + .track { opacity: .45; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 彈窗列表 ---------- */
.thumb { width: 56px; height: 42px; border-radius: 6px; flex: 0 0 56px; background: #EFEFED center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.p-name { display: flex; align-items: center; gap: 14px; }
.p-name a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.p-name a:hover { color: var(--accent-dark); text-decoration: underline; }
.p-meta { font-size: 13px; color: var(--muted); }
.drag { cursor: grab; color: #8A8A86; width: 28px; }
tr.dragging { opacity: .4; }
tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.menu-wrap { position: relative; display: inline-block; }
.menu { position: fixed; z-index: 95; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; min-width: 160px; }
.menu button { display: block; width: 100%; text-align: left; min-height: 40px; padding: 0 12px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-size: 14px; }
.menu button:hover { background: var(--bg); }
.menu button.danger { color: var(--danger); }

/* ---------- 圖片庫 ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 140px; border: 2px dashed #CFCFCC; border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; padding: 16px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone b { font-size: 15px; font-weight: 500; }
.dropzone span { font-size: 13px; color: var(--muted); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.img-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.img-card .pic { height: 160px; background: #EFEFED center/contain no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.img-card .pic video { max-width: 100%; max-height: 100%; }
.img-card .info { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.img-card .fname { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-card .meta { font-size: 13px; color: var(--muted); }
.img-card .use { font-size: 13px; color: var(--good); }
.img-card .use.none { color: var(--muted); }
.img-card .actions { display: flex; gap: 8px; margin-top: 6px; }
.upload-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* ---------- 修改紀錄 ---------- */
.log { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-start; }
.log:last-child { border-bottom: 0; }
.log .when { flex: 0 0 120px; display: flex; flex-direction: column; gap: 2px; }
.log .when b { font-size: 14px; font-weight: 500; }
.log .when span { font-size: 13px; color: var(--muted); }
.log .what { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.diff { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; padding: 8px 12px; border-radius: 8px; background: #F7F7F6; word-break: break-all; }
.diff .f { color: var(--muted); }
.diff .b { text-decoration: line-through; color: var(--danger-text); }
.diff .a { color: var(--good); font-weight: 500; }

/* ---------- 提示訊息、確認視窗 ---------- */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1C1C1B; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; }
.toast.error { background: var(--danger); }
.modal-back { position: fixed; inset: 0; background: rgba(28,28,27,.45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 24px; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.2); }
/* 內容比畫面高的彈出視窗（例：任務批量修改）：視窗裡面自己捲，最下面的按鈕一定滑得到（2026/11/16） */
.modal { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal > * { flex-shrink: 0; }
.modal p { margin: 0; color: var(--text-2); line-height: 1.6; }
.modal .row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.notice .tag { font-size: 13px; font-weight: 700; white-space: nowrap; }
.notice.warn { background: var(--warn-bg); } .notice.warn .tag { color: var(--warn); }
.notice.soft { background: #F5F5F4; }
.notice.accent { background: var(--accent-soft); } .notice.accent .tag { color: var(--accent-dark); }
.grid-2 { display: flex; flex-wrap: wrap; gap: 16px; }
.grid-2 > * { flex: 1 1 320px; min-width: 0; }

/* ---------- 編輯頁 ---------- */
.ed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ed-top .back { color: var(--text-2); text-decoration: none; font-size: 14px; white-space: nowrap; }
.ed-name { flex: 1 1 260px; min-width: 0; }
.ed-name input { width: 100%; min-height: 44px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; font-size: 20px; font-weight: 700; background: transparent; }
.ed-name input:hover, .ed-name input:focus { border-color: var(--border-strong); background: var(--surface); }
#ed-status { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.save-state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.save-state.is-dirty { color: var(--accent-dark); font-weight: 700; } /* 有修改尚未儲存（save-guard.js；2026/11/19） */
.save-btn { flex: 0 0 auto; }
.save-btn:disabled { background: var(--gray-bg); color: var(--muted); border-color: var(--border); cursor: default; }
.ed-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.ed-tabs button { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 15px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ed-tabs button:hover { color: var(--text); }
.ed-tabs button[aria-selected="true"] { color: var(--text); font-weight: 500; border-bottom-color: var(--accent); }
.ed-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.ed-panel { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ed-panel > div[data-scope] { display: flex; flex-direction: column; gap: 16px; }
.ed-preview { flex: 1 1 420px; min-width: 0; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 1000px) { .ed-preview { position: static; } }
.ed-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.ed-sec h3 { margin: 0; font-size: 16px; font-weight: 700; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; justify-content: space-between; }
.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: start; }
.row-1 { display: grid; grid-template-columns: 1fr; gap: 12px; } /* 每個欄位各自一排（瀏覽任務 → 完成任務獎勵） */
.field label, .field > span, .field legend { font-size: 13px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field textarea.input { padding: 10px 12px; min-height: 0; line-height: 1.6; resize: vertical; }
.field select.input { padding: 0 10px; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit .input { flex: 1 1 auto; min-width: 0; }
.with-unit .unit { font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg-field { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.seg-field legend { padding: 0; margin-bottom: 4px; } /* 和一般欄位（.field gap 4px）一樣，並排時框才會對齊（2026/11/27） */
.seg-opt span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 7px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.seg-opt input:checked + span { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.toggle-row b { display: block; font-size: 14px; font-weight: 500; }
.toggle-row small { display: block; font-size: 12px; color: var(--muted); }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 44px; height: 36px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 2px; background: var(--surface); cursor: pointer; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.warn-text { margin: 0; font-size: 13px; color: var(--danger-text); font-weight: 500; }
.sub-card { border: 1px solid var(--line); background: #FAFAF9; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.sub-head { display: flex; align-items: center; gap: 10px; }
.sub-head b { flex: 1 1 auto; font-size: 14px; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 13px; cursor: pointer; padding: 6px 4px; }
.link-btn.danger { color: var(--danger); }
.btn.dashed { border-style: dashed; background: transparent; align-self: flex-start; }
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.layout-card .lc-in { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; color: var(--text-2); height: 100%; }
.layout-card .lc-in b { font-size: 14px; color: var(--text); }
.layout-card .lc-in small { font-size: 12px; color: var(--muted); }
.layout-card input:checked + .lc-in { border: 2px solid var(--accent); padding: 11px; color: var(--accent); background: var(--accent-soft); }
.layout-card input:focus-visible + .lc-in { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch .sw-in { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 14px; }
.swatch input:checked + .sw-in { border: 2px solid var(--accent); padding: 0 11px; }
.swatch input:focus-visible + .sw-in { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-dots { display: inline-flex; }
.sw-dots i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); margin-right: -4px; }
details.more summary { cursor: pointer; font-size: 14px; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.blk { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.blk.open { border: 1.5px solid var(--accent); }
.blk-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; }
.blk-toggle { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.blk-type { flex: 0 0 auto; font-size: 13px; color: var(--muted); min-width: 64px; }
.blk-sum { flex: 1 1 auto; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-tools { display: flex; gap: 4px; }
.icon-btn.sm { width: 32px; height: 32px; font-size: 14px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.blk-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.add-blocks { border: 1px dashed #BDBDBA; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.add-blocks b { font-size: 14px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--bg); }
.img-pick { display: flex; align-items: center; gap: 12px; }
.img-pick img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: #EFEFED; }
.img-pick .p-meta { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-row { flex-direction: row; align-items: center; }
.prod-row img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.prod-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.prod-info b { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-add { display: flex; gap: 8px; }
.inline-add .input { flex: 1 1 auto; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; min-height: 36px; cursor: pointer; }
.variant-bar { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.variant-bar button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 14px; }
.variant-bar button[aria-pressed="true"] { background: var(--surface); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
code { background: #EFEFED; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* 預覽 */
.pv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-head h2 { flex: 1 1 auto; }
.pv-head .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pv-stage { background: #E9E9E7; border-radius: var(--radius); padding: 16px; display: flex; justify-content: center; overflow: hidden; }
.pv-frame { position: relative; overflow: hidden; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.pv-frame.mobile { border-radius: 28px; outline: 8px solid #1C1C1B; }
.pv-frame.desktop { border-radius: 8px; }
.pv-frame iframe { border: 0; transform-origin: 0 0; position: absolute; top: 0; left: 0; background: #fff; }

/* 圖片挑選視窗 */
.modal.picker { max-width: 760px; max-height: 86vh; }
.picker-head { display: flex; align-items: center; gap: 10px; }
.picker-head h2 { flex: 1 1 auto; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; overflow-y: auto; }
.pick-item { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.pick-item:hover { border-color: var(--accent); }
.pick-item img, .pick-vid { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #EFEFED; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.pick-vid.small { width: 64px; height: 48px; aspect-ratio: auto; }
.pick-name { font-size: 12px; line-height: 1.4; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; } /* 檔名最多兩行（2026/11/15） */

/* 圖片裁切框 */
.crop { display: flex; flex-direction: column; gap: 10px; }
.crop-box { width: 100%; max-width: 300px; border-radius: 8px; background: #EFEFED; cursor: grab; touch-action: none; user-select: none; outline-offset: 3px; box-shadow: inset 0 0 0 1px var(--border); }
.crop-box.dragging { cursor: grabbing; }
.crop-box img { display: block; width: 100%; pointer-events: none; }
.crop-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- 固定標題列：每頁上方的標題、按鈕、篩選、分頁籤，捲動時固定在畫面最上方 ---------- */
.sticky-head { position: sticky; top: 0; z-index: 30; background: var(--bg); margin: -28px -36px 0; padding: 20px 36px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 820px) { .sticky-head { position: static; margin: -20px -16px 0; padding: 12px 16px 10px; gap: 10px; } } /* 手機：頁首跟著內容捲走（2026/11/16 使用者選 A；2026/11/25 才真的生效），最上面的選單列照樣固定 */
.main > .sticky-head { max-width: none; }
#ed-head { padding-bottom: 0; }
#ed-head .ed-tabs { border-bottom: 0; }
/* ---------- 在我的網站預覽（site-preview.js） ---------- */
.sp-modal { max-width: 520px; }
.sp-modal [data-scope="sp"] { display: flex; flex-direction: column; gap: 14px; }
.sp-pages { margin-top: -6px; }
.sp-result { display: flex; flex-direction: column; gap: 8px; }
.sp-label { font-size: 14px; font-weight: 500; }
.sp-url { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font-size: 13px; word-break: break-all; user-select: all; }
/* ---------- 關閉後縮小成按鈕：位置格子（look-launcher.js） ---------- */
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 320px; padding: 8px; background: #EBEBE9; border-radius: 12px; }
.lp-cell { min-height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--text-2); cursor: pointer; }
.lp-cell.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.lp-cell.lp-center { background: transparent; border: 1px dashed #CFCFCC; cursor: default; }
/* ---------- 遊戲與獎品、優惠碼與序號池（pages/games.js、game-edit.js、codes.js） ---------- */
.titles .back { display: inline-block; color: var(--text-2); text-decoration: none; font-size: 14px; margin-bottom: 4px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tbl td.wrap-cell { white-space: normal; min-width: 160px; }
.seg-row { display: grid; grid-template-columns: 28px 24px 1.2fr 1fr 1.2fr auto; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.seg-no { font-weight: 700; color: var(--muted); padding-bottom: 12px; text-align: center; }
.seg-acts { display: flex; gap: 4px; padding-bottom: 2px; }
@media (max-width: 640px) { .seg-row { grid-template-columns: 28px 24px 1fr 1fr; } .seg-row > .field:nth-of-type(3) { grid-column: 3 / 5; } .seg-acts { grid-column: 3 / 5; } }
.prize-img { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prize-img img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: #F0EFEE; padding: 1px 6px; border-radius: 5px; }
.notice[hidden] { display: none; }
/* 列表最後一欄的刪除按鈕（games.js、codes.js） */
.tbl td.act-cell { text-align: right; width: 1%; }
.btn.danger-outline { color: var(--danger-text); border-color: #E7C3C0; background: var(--surface); }
.btn.danger-outline:hover { background: #FBEDEC; }
/* 莓果紅棕外框按鈕：和旁邊白底黑字的標籤、選項分得出來（例：今日運勢「✎ 選分類」「▲ 收合」；2026/11/28） */
.btn.accent-outline { color: var(--accent); border-color: var(--accent); background: #FBF0EE; font-weight: 500; }
.btn.accent-outline:hover { background: #F6E2DF; }
.ft-fold { display: flex; justify-content: flex-end; margin-top: 8px; } /* 今日運勢分類清單的「▲ 收合」靠右（2026/11/29 使用者要求） */
/* ---------- 圖表與數據報表（charts.js、pages/stats.js） ---------- */
.chart-legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.chart-legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-box { position: relative; overflow: hidden; }
.chart-box svg { display: block; max-width: 100%; }
.chart-tip { position: absolute; top: 4px; width: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 16px rgba(0,0,0,.1); pointer-events: none; display: flex; flex-direction: column; gap: 3px; }
.stats-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.stats-filters .field { min-width: 0; }
.stats-filters select.input { max-width: 280px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.break-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ab-best { color: var(--good); font-weight: 700; }
.meter { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; }
.meter-bar { height: 8px; border-radius: 999px; background: #EBEBE9; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 999px; }
[hidden] { display: none !important; }
#st-body { display: flex; flex-direction: column; gap: 16px; }
/* 數據報表的日期「從～到」：一直橫排顯示，切換期間不會跑版 */
.date-range { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.date-range .input { width: 150px; min-height: 44px; padding: 0 10px; }
.date-range span { color: var(--muted); }
.stats-filters { align-items: flex-end; }
@media (max-width: 520px) { .date-range { width: 100%; } .date-range .input { flex: 1 1 0; width: auto; min-width: 0; } }
.stats-filters .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
/* 期間按鈕（今天／昨天／7 天／14 天…；2026/11/16）：每顆同寬同高，選中變粗體也不會讓旁邊的日期框移動；
   --n＝按鈕數；--w＝每顆最窄（要比最長的字變粗體後還寬，預設 72px）；手機寬度放不下一排時用 --n-m 欄（分兩排、每排一樣寬） */
.segmented.seg-eq { display: grid; grid-template-columns: repeat(var(--n), minmax(var(--w, 72px), 1fr)); }
.segmented.seg-eq button { padding: 0 6px; white-space: nowrap; }
@media (max-width: 520px) { .segmented.seg-eq { width: 100%; grid-template-columns: repeat(var(--n-m, var(--n)), minmax(0, 1fr)); } }
.pill.rejected { color: var(--danger-text); background: #FBEDEC; }
/* 送審提醒（editor/review.js） */
.review-bar { align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.review-bar > span:nth-child(2) { flex: 1 1 240px; }
.review-bar.rejected { background: #FBEDEC; } .review-bar.rejected .tag { color: var(--danger-text); }
/* ---------- 範本庫（pages/templates.js） ---------- */
.sec-title { font-size: 16px; margin: 4px 0 12px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tpl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tpl-thumb { position: relative; width: 100%; aspect-ratio: 390 / 560; overflow: hidden; background: #E9E9E7; }
.tpl-thumb iframe { position: absolute; top: 0; left: 0; width: 390px; height: 560px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tpl-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.tpl-body .row-btns { margin-top: auto; padding-top: 6px; }
/* ---------- 人員與權限（pages/users.js） ---------- */
.small-select { min-height: 36px; padding: 0 30px 0 10px; width: auto; }
.role-list { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.notice .btn { margin-left: auto; }
/* ---------- 全站設定（pages/settings.js） ---------- */
.set-forms { display: flex; flex-direction: column; gap: 20px; }
.set-sec { display: flex; flex-direction: column; gap: 14px; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.set-row > div { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.steps { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
/* ---------- 拖曳排序（drag-sort.js） ---------- */
.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 28px; min-height: 36px; flex: 0 0 28px; color: var(--muted); cursor: grab; touch-action: none; border-radius: 6px; user-select: none; }
.drag-handle:hover { background: var(--bg); color: var(--text-2); }
.drag-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.is-sorting > * { transition: transform .15s ease; }
.is-sorting > .is-dragging { transition: none; position: relative; z-index: 5; box-shadow: 0 10px 24px rgba(0,0,0,.16); background: var(--surface); cursor: grabbing; }
.is-sorting, .is-sorting * { user-select: none; }

.blk-list, .sort-list, .seg-list { display: flex; flex-direction: column; gap: 10px; }
.seg-list { gap: 0; }
.seg-row { background: var(--surface); }
.seg-row .drag-handle { align-self: end; margin-bottom: 4px; }

/* 緊急關閉中（emergency-banner.js）：列表開關變淡灰色，表示目前沒有作用 */
.emg-off .switch .track { filter: grayscale(1); opacity: .45; }
.emg-banner { align-items: center; }
@media (max-width: 820px) { .emg-banner { flex-wrap: wrap; gap: 6px 10px; } .emg-banner > span:not(.tag) { flex: 1 1 100%; order: 3; } .emg-banner .btn { margin-left: auto; } }

/* 遊戲編輯頁：畫面文字裡的小標題（例：還沒到時間的畫面） */
.sub-h { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: #555; }

/* 遊戲編輯頁：獎品色塊（底色加深、不加邊框，和白色欄位明顯區分）；縮小後只留名稱、機率那一排，並出現 ⠿ 拖曳把手 */
.prize-list { display: flex; flex-direction: column; gap: 12px; }
.prize-card { background: #E9E7E4; border: 0; }
.prize-card .drag-handle { display: none; }
.prize-card.is-folded .drag-handle { display: inline-flex; min-height: 28px; }
.prize-card.is-folded .prize-more { display: none; }
.prize-more { display: flex; flex-direction: column; gap: 10px; }
.prize-card .drag-handle:hover { background: rgba(0,0,0,.06); }

/* 瀏覽任務頁（pages/tasks.js、task-edit.js） */
.h2 { margin: 0; font-size: 17px; font-weight: 700; }
#sl-card, #tc-card { display: flex; flex-direction: column; gap: 12px; }
#sl-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.code-row code { font-size: 14px; user-select: all; }
.tbl td.handle-cell { width: 28px; padding-right: 0; }
.sec-head.pad { padding: 16px 24px 4px; }
#t-warn { flex-direction: column; gap: 2px; }
.task-pv { background: var(--bg); border-radius: var(--radius); padding: 20px; }
.pv-h { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500; }
/* 任務預覽的網址：超過一行用「…」，不撐開版面（pages/task-edit.js） */
.tpv-url { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.tpv-card { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.tpv-ic { font-size: 26px; }
.tpv-ic.has-img img { display: block; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.thumb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 12px; }
.task-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid #e6e1df; background: #f6f3f2; }
.auto-desc { display: block; padding: 10px 12px; border-radius: 10px; background: #f6f3f2; color: #3F2A26; white-space: pre-wrap; overflow-wrap: anywhere; }
.tpv-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: #6E534D; }
.tpv-body b { font-size: 15px; color: #3F2A26; }
.tpv-body em { font-style: normal; color: #A65C5A; font-weight: 700; }
.tpv-btn { flex: 0 0 auto; background: #A65C5A; color: #fff; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; }
.tpv-bar { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; width: 240px; background: #fff; border-radius: 12px; padding: 10px 12px 12px; font-size: 13px; color: #3F2A26; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.tpv-bar b { font-size: 12px; color: #A65C5A; }
.tpv-bar i { position: absolute; left: 0; bottom: 0; height: 3px; background: #A65C5A; }
.tpv-claim { display: inline-block; margin-top: 4px; background: #A65C5A; color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; text-align: center; }
.tpv-bar small { font-size: 12px; color: #6E534D; }
.row-acts { display: flex; gap: 12px; flex-wrap: wrap; }

/* 列表右邊的操作按鈕（row-actions.js：複製圖示＋「⋯」選單），全站統一 */
.row-actions { display: inline-flex; gap: 6px; align-items: center; }
.tbl td.act-cell { text-align: right; }
.tpl-body .row-actions { margin-left: auto; }

/* ---------- 勾選、全選、批量刪除、垃圾桶（bulk-list.js） ---------- */
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.bulk-gap { flex: 1 1 auto; }
.bulk-err { margin: 0; padding: 10px 24px; background: #FBEDEC; color: var(--danger-text); font-size: 14px; font-weight: 500; line-height: 1.6; white-space: pre-line; border-bottom: 1px solid #F0D2CF; }
.bulk-err[hidden] { display: none; }
.tbl th.check-cell, .tbl td.check-cell { width: 20px; padding-right: 4px; }
.row-check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.tbl tr.is-checked td { background: var(--accent-soft); }
.modal p { white-space: pre-line; }
.trash-modal { max-width: 760px; max-height: 88vh; overflow: auto; }
.trash-modal .bulk-bar, .trash-modal .bulk-err { padding-left: 0; padding-right: 0; border-bottom: 0; }
.trash-modal .bulk-err { padding: 10px 12px; border-radius: 8px; }
.trash-modal .trash-info { white-space: pre-line; }
.trash-modal .tbl th:first-child, .trash-modal .tbl td:first-child { padding-left: 8px; }
.trash-modal .trash-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
@media (max-width: 640px) { .bulk-bar { padding: 10px 16px; } .bulk-err { padding: 10px 16px; } }
.menu button.is-disabled { color: var(--muted); opacity: .55; cursor: not-allowed; }
.menu button.is-disabled:hover { background: transparent; }
.menu .menu-why { max-width: 260px; padding: 6px 12px 8px; font-size: 12px; line-height: 1.5; color: var(--danger-text); white-space: pre-line; }

/* ---------- 瀏覽任務頁的分頁卡片（pages/tasks.js） ---------- */
.tab-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tab-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.tab-card:hover { border-color: #D9C4C2; }
.tab-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab-card[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 4px 14px rgba(166,92,90,.14); }
.tab-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.tab-card-head b { font-size: 16px; }
.tab-card[aria-selected="true"] .tab-card-head b { color: var(--accent-dark); }
.tab-card .sub { margin: 0; line-height: 1.6; }
[role="tabpanel"][hidden] { display: none; }
@media (max-width: 900px) { .tab-cards { grid-template-columns: 1fr; gap: 10px; } }
/* 表格裡太長的網址：用「…」截斷，表格不會撐寬、不用左右滑（pages/tasks.js） */
.tbl td.url-cell { width: 26%; max-width: 0; }
.cell-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 瀏覽任務列表：畫面變窄時欄位文字自動換行、間距縮小、次要欄位收起來，表格永遠不用左右滑 */
/* tbl-fit：名稱、可領次數這類長文字欄（wrap-cell）任何寬度都可以換行，整個表格不用左右捲（2026/11/27 使用者要求）；短欄維持一行 */
.tbl td.wrap-cell { white-space: normal; min-width: 96px; } /* 全部表格：長文字格可以換行（table-fit.js 自動加） */
@media (max-width: 1280px) { .tbl-fit td { white-space: normal; } .tbl-fit td.act-cell, .tbl-fit td.col-sm { white-space: nowrap; } .tbl-fit th, .tbl-fit td { padding-left: 8px; padding-right: 8px; } .tbl-fit .row-actions { gap: 4px; } }
@media (max-width: 1100px) { .tbl-fit .col-sm { display: none; } .tbl-fit th { white-space: normal; } }
@media (max-width: 760px) { .tbl-fit .col-md { display: none; } .tbl-fit td.url-cell { width: 22%; } }
@media (max-width: 560px) { .tbl-fit .col-xs { display: none; } .tbl-fit th:first-child, .tbl-fit td:first-child { padding-left: 12px; } .tbl-fit th:last-child, .tbl-fit td:last-child { padding-right: 12px; } }
/* 超級輪盤預覽的狀態切換（pages/tasks.js） */
.sp-ctl { display: flex; flex-direction: column; gap: 8px; }
.sp-ctl .segmented { flex-wrap: wrap; }
.sp-range { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 14px; color: var(--text-2); } /* 文字上排、滑桿下排，互不影響 */
.sp-range[hidden] { display: none; }
.sp-range input { width: 100%; margin: 0; accent-color: var(--accent); }
.sp-ctl .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sp-range { white-space: nowrap; }
/* 完成任務獎勵的畫面文字：欄位名稱用粗體，對應右邊預覽的狀態（pages/tasks.js） */
.ms-texts { display: flex; flex-direction: column; gap: 14px; }
/* 導覽式欄位標示（editor/field-nav.js）：欄位一直保留內距，標色時版面不移動；顏色＝淡莓果粉底＋莓果紅棕色條（使用者選 1A） */
.nav-scope .field { padding: 8px 12px; margin: 0 -12px; border-radius: 10px; transition: background-color .25s, box-shadow .25s; }
.nav-scope .nav-on { background: #FBF0EE; box-shadow: inset 4px 0 0 #A65C5A; }
.ms-texts .field > label { font-weight: 700; color: var(--text); }

/* 遊戲與獎品的兩排分頁（prize-tabs.js；使用者 2026/11/01 選 18B） */
/* 2026/11/24 改成和官網後台訂單分頁一樣（使用者要求）：每個分頁一個獨立大框（高 44、最小寬 110、間距 10、圓角 8），選到的紅底白字；手機一排左右滑 */
.prize-tabs { display: flex; flex-direction: column; gap: 10px; }
.ptab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ptab-label { width: 64px; flex-shrink: 0; font-size: 13px; color: var(--text-2); }
.ptab { min-height: 44px; min-width: 110px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap; }
.ptab:hover { border-color: #CFCDCA; background: #FAFAF9; }
.ptab[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.ptab[aria-current="page"]:hover { background: var(--accent-dark); }
.ptab-n:empty { display: none; }
@media (max-width: 820px) { .ptab-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; } .ptab { flex: none; min-width: 0; padding: 0 14px; } .ptab-label { width: auto; flex: none; } }

/* 舊版瀏覽任務頁上方「切換到新版」說明條（tasks-legacy.js） */
.cutover-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; border-color: #E6CFCD; background: #FBF5F4; }
.cutover-bar .sub { margin: 4px 0 0; }

/* 活動編輯頁：勾選任務包（activity-edit.js） */
.bundle-picks { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.bundle-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.bundle-pick.on { border-color: var(--accent); background: #FBF0EE; }
.bundle-pick.is-off { cursor: default; color: var(--text-3, #8A8A87); background: #F7F7F6; }
.bundle-pick .sub { margin: 0; }

/* 總覽頁：SHOPLINE 購物金連線（dashboard.js） */
.shopline-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.shopline-card .sub { margin: 4px 0 0; }

/* 購買任務：分級獎勵（purchase-edit.js） */
.levels { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.level-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; background: #FCFBFA; }
.level-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.level-head .btn { margin-left: auto; }
.level-head .sub { margin: 0; }

/* ---------- 🎬✨剪輯（加文字）：pages/video-cut.js ---------- */
.cut-cols { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cut-cols { grid-template-columns: minmax(0, 1fr); } }
.cut-left { position: sticky; top: 140px; display: flex; flex-direction: column; gap: 10px; align-items: center; min-width: 0; }
@media (max-width: 1100px) { .cut-left { position: static; } }
.cut-stage { position: relative; background: #1C1C1B; border-radius: 12px; overflow: hidden; max-width: 100%; }
.cut-stage video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.cut-stage #ct-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cut-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.cut-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.cut-tip { width: 100%; text-align: center; font-size: 12px; }
.cut-left > .sub { margin: 0; font-size: 12px; }
.cut-left > * { flex: none; }
.cut-tl { width: 100%; max-height: 340px; overflow-y: auto; flex: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px 6px; user-select: none; touch-action: none; }
.cut-tl-in { position: relative; }
.cut-tl-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.cut-tl-tools .chip { min-height: 28px; font-size: 12px; }
.cut-tl-tools .sub { font-size: 12px; }
.cut-tl-head { position: relative; height: 22px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cut-tl-head span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.cut-tl-head span:first-child { transform: none; } .cut-tl-head span:last-child { transform: translateX(-100%); }
.cut-tl-row { position: absolute; left: 0; right: 0; height: 28px; background: var(--bg); border-radius: 6px; cursor: col-resize; }
.cut-tl-row em { position: absolute; right: 4px; top: 6px; font-style: normal; font-size: 11px; color: #B5B3AF; pointer-events: none; }
.cut-tl-head { cursor: col-resize; }
.cut-tl-bar.is-drag { opacity: .85; box-shadow: 0 4px 12px rgba(0,0,0,.2); z-index: 2; }
.cut-tl-bar { position: absolute; height: 22px; background: #E9D3D0; border: 1px solid #D7A4A0; border-radius: 6px; cursor: grab; display: flex; align-items: center; overflow: hidden; }
.cut-tl-bar.is-sel { background: var(--accent); border-color: var(--accent-dark); color: #fff; }
.cut-tl-bar span { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; pointer-events: none; }
.cut-tl-bar i { width: 8px; align-self: stretch; cursor: ew-resize; background: rgba(0,0,0,.12); flex: none; }
.cut-tl-head-line { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--danger); pointer-events: none; transform: translateX(-1px); z-index: 3; }
.cut-tl-head-line b { position: absolute; top: 0; left: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); pointer-events: auto; cursor: grab; }
.cut-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.cut-h .h2 { margin: 0; }
.cut-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.cut-item { text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.cut-item b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-item small { color: var(--muted); }
.cut-item.is-sel { border: 2px solid var(--accent); padding: 7px 9px; background: var(--accent-soft); }
.cut-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cut-times .btn { margin-top: 4px; }
.cut-tpl-group { margin-top: 6px; }
.cut-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 4px; }
.cut-tpl { padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.cut-tpl canvas { width: 100%; aspect-ratio: 8 / 5; border-radius: 7px; display: block; }
.cut-tpl span { font-size: 12px; line-height: 1.3; color: var(--text-2); }
.cut-tpl.is-sel { border: 2px solid var(--accent); padding: 2px; }
.cut-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.cut-color { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; font-size: 11px; background: var(--surface); }
.cut-color.is-sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.cut-draft-video { width: 220px; max-width: 100%; max-height: 420px; border-radius: 10px; background: #000; display: block; }

.cut-ed-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.cut-ed-head .h2 { margin: 0; width: 100%; }
.cut-ed-size { margin-right: auto; }
.cut-ed-head .btn.small { min-height: 30px; padding: 0 8px; }
.cut-ed-size { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.cut-ed-size input { width: 64px; }
.cut-ed-size b { min-width: 38px; font-size: 12px; color: var(--text); }

/* 勾選同時編輯 */
.cut-row { display: flex; align-items: center; gap: 8px; }
.cut-row .cut-item { flex: 1; min-width: 0; }
.cut-chk, .cut-chkall input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex: none; }
.cut-chkall { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-left: auto; cursor: pointer; }
.cut-multi { margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; }

/* 設計區塊收合 */
.cut-fold-bar { display: flex; justify-content: flex-end; gap: 6px; margin: 4px 0 6px; }
.cut-sec { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.cut-sec > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; user-select: none; }
.cut-sec > summary::-webkit-details-marker, .cut-sub > summary::-webkit-details-marker { display: none; }
.cut-sec > summary::before, .cut-sub > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; display: inline-block; }
.cut-sec[open] > summary::before, .cut-sub[open] > summary::before { transform: rotate(90deg); }
.cut-sec > summary span { margin-left: auto; font-size: 13px; color: var(--accent-dark); }
.cut-sec-body { padding: 0 12px 12px; }
.cut-sub { margin-top: 6px; }
.cut-sub > summary { cursor: pointer; list-style: none; font-size: 13px; color: var(--muted); padding: 4px 0; }
.cut-sub > summary em { font-style: normal; color: var(--accent-dark); }

/* 手動剪輯：影片軌、音軌 */
.cut-clip-tools { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-right: 8px; }
.cut-clip-tools .btn.small { min-height: 30px; padding: 0 9px; }
.cut-speed { padding: 2px; }
.cut-speed button { min-height: 26px; padding: 0 8px; font-size: 12px; }
.cut-speed button:disabled { opacity: .45; cursor: default; }
.cut-vrow { position: absolute; left: 0; right: 0; background: #ECEAE7; border-radius: 6px; cursor: col-resize; }
.cut-vrow em, .cut-arow em { position: absolute; right: 4px; top: 3px; font-style: normal; font-size: 11px; color: #9A9792; pointer-events: none; z-index: 1; }
.cut-clip { position: absolute; top: 3px; bottom: 3px; background: #6E534D; color: #fff; border: 1px solid #4E3229; border-radius: 6px; display: flex; align-items: center; overflow: hidden; cursor: grab; box-sizing: border-box; }
.cut-clip.is-sel { background: var(--accent); border: 2px solid #FFE14D; }
.cut-clip.is-drag { opacity: .85; z-index: 3; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.cut-clip span { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; pointer-events: none; }
.cut-clip i { width: 9px; align-self: stretch; cursor: ew-resize; background: rgba(255,255,255,.25); flex: none; }
.cut-arow { position: absolute; left: 0; right: 0; background: #F1EFEC; border-radius: 6px; cursor: col-resize; }
.cut-arow svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cut-wave { fill: rgba(166,92,90,.28); }
.cut-env { fill: none; stroke: #2E1F1B; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cut-ap { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); z-index: 2; }
.cut-ap.is-end { background: #2F6FD6; cursor: ns-resize; }
.cut-ap.is-ab { background: #fff; border-color: #2E1F1B; cursor: ew-resize; }
.cut-ap.is-mid { background: #3BB54A; cursor: ns-resize; }
.cut-atip { position: absolute; left: 50%; top: -2px; transform: translate(-50%, -100%); background: #2E1F1B; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; z-index: 4; pointer-events: none; }
.cut-tl-bar.is-orphan { opacity: .45; border-style: dashed; }
.cut-orphan { color: var(--danger); font-weight: 600; }

.cut-follow { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); margin-left: 4px; white-space: nowrap; }
.cut-follow input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.cut-follow input[type=number] { width: 64px; min-height: 30px; padding: 2px 6px; }

/* 預覽左邊一欄 */
.cut-top { display: flex; gap: 16px; align-items: center; justify-content: center; width: 100%; }
.cut-side { display: flex; flex-direction: column; gap: 8px; width: 150px; flex: none; }
.cut-view { flex-direction: column; flex-wrap: nowrap; }
.cut-view button { width: 100%; text-align: center; line-height: 1.25; padding: 6px 8px; }
.cut-view button small { display: block; font-size: 11px; color: var(--muted); }
.cut-time { font-size: 15px; font-weight: 600; text-align: center; }
.cut-side .cut-tip { text-align: center; font-size: 12px; }
.cut-side .btn.small { width: 100%; }
@media (max-width: 700px) { .cut-top { flex-direction: column; } .cut-side { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; } .cut-view { flex-direction: row; } .cut-side .btn.small { width: auto; } }

/* 插入圖片 */
.cut-clip.is-img { background: #C7A0A4; border-color: #A65C5A; }
.cut-imgdlg { max-width: 640px; width: calc(100vw - 32px); }
.cut-imglib { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; }
.cut-imgpick { padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #F2ECEA; cursor: pointer; aspect-ratio: 1; }
.cut-imgpick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cut-imgpick:hover, .cut-imgpick:focus-visible { outline: 2px solid var(--accent); }

/* ---------- 彈窗列表：⚙ 彈窗總規則、出現順序時間軸（js/popup-seq.js、js/popup-rules.js） ---------- */
.seq-card { display: flex; flex-direction: column; gap: 12px; }
.seq-card > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-height: 32px; }
.seq-card > summary::-webkit-details-marker { display: none; }
.seq-card > summary::before { content: '▸'; color: var(--accent); font-size: 14px; }
.seq-card[open] > summary::before { content: '▾'; }
.seq-card[open] > summary { margin-bottom: 8px; }
.seq-card > :not(summary) + * { margin-top: 12px; }
.seq-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seq-acts .grow { flex: 1 1 auto; }
.rules-form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.rules-form .h3 { margin: 6px 0 0; font-size: 15px; }
.tl { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #FAFAF9; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tl-row { display: grid; grid-template-columns: minmax(90px, 180px) 1fr; align-items: center; gap: 10px; min-height: 26px; }
.tl-name { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name b { display: inline-block; min-width: 18px; color: var(--muted); font-weight: 500; }
.tl-track { position: relative; height: 22px; border-left: 1px solid var(--border); }
.tl-bar { position: absolute; top: 2px; height: 18px; border-radius: 4px; background: var(--accent); min-width: 4px; cursor: default; }
.tl-bar.unknown { background: var(--accent-soft); border: 1.5px dashed var(--accent); }
.tl-bar.over { background: repeating-linear-gradient(45deg, var(--danger) 0 6px, #D9534F 6px 12px); border: 0; }
.tl-bar.passive { width: 12px; height: 12px; top: 5px; margin-left: -6px; border-radius: 2px; transform: rotate(45deg); background: #8A8A87; }
.tl-stay { position: absolute; top: 10px; right: 0; height: 2px; background: repeating-linear-gradient(90deg, #8A8A87 0 4px, transparent 4px 8px); }
.tl-lab { position: absolute; left: calc(100% + 6px); top: 0; font-size: 12px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.tl-bar.passive .tl-lab { transform: rotate(-45deg); left: 14px; top: -4px; }
.tl-bar.over .tl-lab { color: var(--danger-text); font-weight: 700; }
.tl-axis .tl-track { border-left: 0; border-top: 1px solid var(--border); height: 18px; }
.tl-tick { position: absolute; top: 2px; font-size: 11px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.tl-tick:first-child { transform: none; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 10px; border-radius: 3px; background: var(--accent); }
.lg.unknown { background: var(--accent-soft); border: 1.5px dashed var(--accent); }
.lg.passive { width: 9px; height: 9px; border-radius: 1px; transform: rotate(45deg); background: #8A8A87; }
.lg.over { background: repeating-linear-gradient(45deg, var(--danger) 0 4px, #D9534F 4px 8px); }
.seq-cell { display: flex; flex-direction: column; gap: 4px; }
.seq-cell label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.seq-cell label > span:first-child { flex: none; width: 6.5em; white-space: nowrap; } /* 標籤固定寬（最長「前一個結束後」放得下），每一列的輸入框才會上下對齊（2026/11/27） */
.seq-cell .input { width: 76px; min-height: 32px; padding: 4px 8px; }
.modal.seq-pv { max-width: 760px; max-height: 92vh; overflow: auto; }
.seq-pv-head { justify-content: space-between !important; align-items: center; }
.seq-pv-head h2 { margin: 0; font-size: 17px; }
@media (max-width: 600px) { .tl-row { grid-template-columns: 72px 1fr; } .tl-tick:nth-child(even) { display: none; } .tl { padding: 8px; } }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* 🎙 AI 配音（video-voice.js、pages/voices.js；使用者 2026/11/04 指定） */
.cut-vo-eng { width: 100%; margin-bottom: 10px; }
.cut-vo-eng button { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.3; padding: 6px 8px; }
.cut-vo-eng small { font-size: 11px; color: var(--muted); }
.cut-vo-eng button[aria-selected="true"] small { color: inherit; opacity: .85; }
.cut-vo-pick { display: flex; gap: 8px; align-items: center; }
.cut-vo-pick select { flex: 1; min-width: 0; }
#ct-voice .chips { margin-top: 6px; }
#ct-voice .chip { min-height: 28px; font-size: 12px; }
.cut-vo-vols { display: grid; gap: 6px; margin: 4px 0 10px; }
.cut-vo-vols label { display: grid; grid-template-columns: 84px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; }
.cut-vo-vols b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.cut-vo-sum { margin: 0 0 8px; font-size: 14px; }
.cut-vo-sum .is-stale, .cut-vo-b.is-stale { color: var(--accent-dark); }
.cut-vo-busy { margin: 0 0 8px; color: var(--accent-dark); font-weight: 500; }
.cut-vo-err { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #FBEDEC; color: var(--danger-text); font-size: 13px; line-height: 1.6; }
.cut-vo-warns { margin: 10px 0 4px; padding: 8px 10px 8px 26px; border-radius: 8px; background: #FBEDEC; color: var(--danger); font-size: 13px; line-height: 1.7; }
.cut-vo-warns .link-btn { padding: 0; color: var(--danger); text-decoration: underline; }
#ct-voice .hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.cut-vo-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.cut-vo-st { color: var(--muted); }
.cut-vo-st.is-ok { color: #2F6B3A; }
.cut-vo-st.is-stale { color: var(--accent-dark); font-weight: 500; }
.cut-vo-mute { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; cursor: pointer; }
.cut-vo-warn { flex-basis: 100%; margin: 0; color: var(--danger); font-weight: 600; }
.cut-vo-b.is-warn { color: var(--danger); font-weight: 600; }
.cut-vo-b.is-todo { color: var(--muted); }
.cut-tl-vo { position: absolute; height: 3px; border-radius: 2px; background: #4F8A5B; pointer-events: none; z-index: 1; }
.cut-tl-vo.is-long { background: var(--danger); }
.vm-list { display: grid; gap: 8px; }
.vm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.vm-row small { color: var(--muted); }
.vm-row .vm-name { max-width: 220px; }
.vm-acts { margin-left: auto; display: flex; gap: 6px; }
.cut-vo-err-t { color: var(--danger-text); }
.vm-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .vm-ways { grid-template-columns: 1fr; } }
.vm-way { padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.vm-way .h3 { margin: 0 0 4px; }
.vm-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: vmblink 1s infinite; }
@keyframes vmblink { 50% { opacity: .3; } }
.vm-meter { width: 120px; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.vm-meter i { display: block; height: 100%; width: 0; background: #4F8A5B; transition: width .08s; }
.vm-script { margin-top: 10px; font-size: 14px; line-height: 1.8; }
.vm-script summary { cursor: pointer; color: var(--accent-dark); }
.vm-script p { margin: 6px 0; }
.vm-files { display: grid; gap: 6px; }
.vm-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.vm-file audio { height: 32px; max-width: 260px; }
.vm-tips { margin: 12px 0; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); font-size: 13px; }
.vm-tips ul { margin: 4px 0 0; padding-left: 20px; }
.vm-consent { display: flex; align-items: center; gap: 6px; margin: 8px 0 10px; font-size: 14px; }
.cut-vo-acc { width: 100%; } .cut-vo-acc button { flex: 1; }
.al-skipped { margin: 4px 0 12px; }
.al-skipped summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 6px 0; }
.al-item.is-skipped { border-left-color: #B9B7B3; opacity: .85; }
.al-item.is-skipped .al-pill { background: #E4E2DF; color: #4A4A48; }
/* 🗑 垃圾桶選單的雲端空間警示、登出（2026/11/09） */
.nav-user b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
.nav-user-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.nav-logout { flex: none; text-decoration: none; }
.nav-warn { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; color: var(--danger); }
.nav-warn b { font-size: 15px; }
.nav-warn small { font-size: 11px; font-weight: 600; white-space: nowrap; }
.nav-item[aria-current="page"] .nav-warn { color: var(--danger); }
/* 🗑 垃圾桶頁＋☁️ 雲端空間（pages/trash.js；2026/11/09） */
.st-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.st-top .h2 { margin: 0; }
.st-big { font-size: 14px; color: var(--muted); }
.st-big b { font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.st-big.is-red b { color: var(--danger); }
.st-bar { height: 10px; border-radius: 6px; background: #ECEAE7; overflow: hidden; display: flex; }
.st-bar i { display: block; height: 100%; }
.st-bar.is-total { height: 16px; border-radius: 8px; margin: 10px 0 6px; }
.st-trash { background: repeating-linear-gradient(45deg, #9E5A57 0 4px, #EBC9C6 4px 8px); }
.st-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.st-leg span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }
.st-leg .is-trash::before { background: repeating-linear-gradient(45deg, #9E5A57 0 2px, #EBC9C6 2px 4px); }
.st-warn { margin: 12px 0 4px; padding: 10px 14px; border-radius: 10px; background: #FBEDEC; color: var(--danger); font-weight: 600; font-size: 14px; line-height: 1.6; }
.st-rows { display: grid; gap: 12px; margin-top: 14px; }
.st-row { display: grid; grid-template-columns: 170px 1fr 210px; gap: 14px; align-items: center; font-size: 14px; }
.st-row b small, .st-row span small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.st-row > span { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .st-row { grid-template-columns: 1fr; gap: 4px; } .st-row > span { text-align: left; } }
.st-top10 .r, .tr-tbl .r { text-align: right; }
.tr-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; font-size: 14px; }
.tr-bar label { display: inline-flex; align-items: center; gap: 6px; }
.tr-bar select.input { width: auto; min-height: 36px; padding: 4px 8px; }
.tr-auto { margin-left: auto; }
.tr-all { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-right: 6px; }
.tr-tbl tr.is-checked td { background: var(--accent-soft); }
.vid-card .toggle-row > span:first-child { display: flex; align-items: center; gap: 8px; }
.vid-del { min-height: 26px; padding: 0 10px; font-size: 12px; }

/* 垃圾桶預覽（trash-preview.js） */
.tp-name { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: #D5C2C1; text-underline-offset: 3px; }
.tp-name:hover { color: var(--accent); text-decoration-color: var(--accent); }
.tp-modal { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.tp-body { overflow: auto; min-height: 120px; display: flex; flex-direction: column; gap: 10px; }
.tp-tabs { flex-wrap: wrap; }
.tp-video { width: 100%; max-height: 62vh; background: #1C1C1B; border-radius: 10px; }
.tp-img { text-align: center; background: repeating-conic-gradient(#F1EFEC 0 25%, #FFF 0 50%) 0 0 / 16px 16px; border-radius: 10px; padding: 8px; }
.tp-img img { max-width: 100%; max-height: 62vh; object-fit: contain; }
.tp-quote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 6px; }
.tp-facts { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.tp-facts dt { color: var(--muted); }
.tp-facts dd { margin: 0; white-space: pre-line; word-break: break-all; }
.tp-popup .pv-head h2 { display: none; }
.tp-acts { margin-top: 12px; }
/* AI 幫我排：主商品、範例（video-ai.js；2026/11/09） */
.ai-req-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-ex { margin-top: 8px; }
.ai-ex-modal { width: min(640px, calc(100vw - 32px)); }
.ai-ex-modal textarea { line-height: 1.7; }
.ax-acts { flex-wrap: wrap; }
/* 任務包「批量修改」（task-bulk-edit.js；2026/11/09） */
.tbe-modal { width: min(560px, calc(100vw - 32px)); }
.tbe-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tbe-on { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.tbe-body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.tbe-body.is-off { opacity: .45; }
.tbe-body .input { width: 84px; min-height: 34px; padding: 4px 8px; }
.tbe-body select.input { width: auto; }
.tbe-body small { color: var(--muted); }

/* ---------- 任務中心編輯頁「在我的網站預覽」（task-site-preview.js） ---------- */
.tsp-modal { max-width: 520px; }
.tsp-list { margin: 8px 0 14px; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--text-2); }
.tsp-real { display: block; color: var(--accent); }
.tsp-out .field { margin-bottom: 8px; }
.tsp-out .row { margin-bottom: 8px; }

/* ---------- 「提醒我」行事曆示意圖（cal-mock.js；模擬 iPhone 畫面，固定深色鎖定畫面＋淺色行事曆） ---------- */
.cal-mock { margin: 4px 0 14px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--bg, #F7F7F5); }
.cal-mock-note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.cal-mock-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cm-phone { flex: 1 1 200px; max-width: 260px; margin: 0; border-radius: 22px; padding: 14px 10px 10px; font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif; display: flex; flex-direction: column; min-height: 230px; }
.cm-phone figcaption { margin-top: auto; padding-top: 10px; font-size: 12px; line-height: 1.5; text-align: center; }
.cm-phone figcaption small { opacity: .75; }
.cm-lock { background: linear-gradient(160deg, #4B4F63, #2A2C38); color: #fff; }
.cm-clock { text-align: center; font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: -1px; }
.cm-date { text-align: center; font-size: 12px; opacity: .85; margin-bottom: 12px; }
.cm-noti { background: rgba(255,255,255,.82); color: #1C1C1E; border-radius: 14px; padding: 8px 10px; font-size: 13px; }
.cm-app { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6B6B70; margin-bottom: 3px; }
.cm-ico { width: 16px; height: 16px; border-radius: 4px; background: #fff; color: #E5352F; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.cm-now { margin-left: auto; }
.cm-t { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-when { display: block; font-size: 12px; color: #3A3A3C; }
.cm-event { background: #fff; color: #1C1C1E; box-shadow: 0 0 0 1px var(--border); }
.cm-lock figcaption { color: #fff; }
.cm-bar { display: flex; justify-content: space-between; font-size: 12px; color: #E5352F; margin-bottom: 8px; }
.cm-ev-t { font-size: 16px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.cm-ev-when { font-size: 12px; color: #6B6B70; margin: 4px 0 8px; line-height: 1.5; }
.cm-ev-row { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 0; border-top: 1px solid #E5E5EA; border-bottom: 1px solid #E5E5EA; }
.cm-ev-row span:last-child { color: #6B6B70; }
.cm-ev-notes { font-size: 12px; line-height: 1.5; padding-top: 6px; word-break: break-word; }
.cm-ev-notes small { display: block; color: #6B6B70; }
.cm-ev-notes span { display: block; white-space: pre-wrap; }
.cm-ev-notes a { color: #0A64D8; }
.cm-event figcaption { color: var(--muted); }

/* ---------- 任務表格「活動期間」欄（task-table.js） ---------- */
.per-cell { font-size: 13px; line-height: 1.5; white-space: nowrap; }
.per-cell b { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 700; }
.per-wait { color: var(--muted); }
.per-end { color: #B42318; }
.per-out { margin-top: 4px; color: #B45309; font-size: 12px; white-space: normal; min-width: 150px; }
.tbe-per { flex: 1 1 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 12px; margin-bottom: 8px; }
.tbe-per > label:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1 1 200px; min-width: 0; max-width: 260px; white-space: nowrap; }
.tbe-body .tbe-per .input { width: 100%; min-width: 0; }
.tbe-per .tbe-none { min-height: 34px; display: inline-flex; align-items: center; gap: 4px; }
.tbe-none { white-space: nowrap; font-size: 14px; }
@media (max-width: 480px) { .tbe-row { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* ---------- 購買任務「可以用的代碼」（purchase-codes.js） ---------- */
.code-ref { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--text-2); }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 4px; margin-top: 6px; }
.code-lv { min-width: 72px; font-weight: 700; color: var(--text); }
.code-chip { border: 1px solid #D9B8B6; background: #FBF3F2; color: #A65C5A; border-radius: 6px; padding: 3px 7px; font: 600 12px/1.3 ui-monospace, Menlo, monospace; cursor: pointer; }
.code-chip:hover { background: #A65C5A; color: #fff; }
.code-val { margin-right: 10px; }
.code-warn { margin-top: 8px; line-height: 1.6; }
.code-sub { margin-top: 10px; font-weight: 700; color: var(--text); }
.code-row .code-lv { min-width: 0; margin-right: 6px; }

/* ---------- 卡片拖移排序（grid-sort.js；影片庫、圖片庫） ---------- */
.img-card .info { cursor: grab; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.gs-sorting, .gs-sorting * { cursor: grabbing !important; }
.gs-origin { opacity: .35; outline: 2px dashed #A65C5A; outline-offset: 2px; }
.gs-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; margin: 0; opacity: .92; box-shadow: 0 12px 32px rgba(0,0,0,.22); transform-origin: center; }

/* ---------- 💰 購物金紀錄（pages/credits.js） ---------- */
.cr-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.cr-filters .input { width: auto; min-height: 38px; }
.cr-search { display: flex; gap: 6px; flex: 1 1 260px; min-width: 0; }
.cr-search .input { flex: 1 1 auto; min-width: 0; }
.cr-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.cr-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.cr-card span { font-size: 13px; color: var(--muted); }
.cr-card b { font-size: 22px; color: var(--text); }
.cr-card small { font-size: 12px; color: var(--muted); }
.cr-card.cr-main { border-color: #A65C5A; background: #FBF3F2; }
.cr-card.cr-main b { color: #A65C5A; }
.cr-tbl td, .cr-tbl th { white-space: nowrap; }
.cr-tbl td:nth-child(2) { white-space: normal; min-width: 180px; }
.cr-tbl .r { text-align: right; }
.cr-link { color: var(--text); font-weight: 600; }
.cr-link.sub-link { font-weight: 400; color: var(--text-2); }
.cr-soon { font-size: 12px; color: #B45309; }
.cr-src { white-space: nowrap; color: var(--muted); }
.cr-pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; background: #EEF6F0; color: #2E6B44; }
.cr-pill.soon { background: #FDF0E1; color: #B45309; }
.cr-pill.off { background: #EFEFED; color: #62625F; }
.cr-pill.bad { background: #FDECEC; color: #B42318; }
.cr-pill.draft { background: #EFEFED; color: #62625F; }
.cr-neg { color: #B42318; }
.cr-id { margin-left: 10px; font-size: 12px; color: var(--muted); }
.cr-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0; font-size: 14px; }
section.card.flush + section.card.flush { margin-top: 16px; }
.cr-switch { margin: 4px 0 14px; }
.cr-switch button { font-size: 15px; padding: 8px 16px; }
.cr-mini { margin: 10px 18px 12px; }
.cr-mini .cr-card b { font-size: 18px; }

/* ---------- 格式文字＋固定工具列（rich-text.js） ---------- */
.rich-bar { position: sticky; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.rich-bar.is-off .rb-tools { opacity: .45; }
.rb-who { flex: 1 1 100%; font-size: 12px; color: var(--muted); }
.rich-bar:not(.is-off) .rb-who { color: #A65C5A; font-weight: 600; }
.rb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rb-sel { width: auto; min-height: 34px; padding: 2px 8px; font-size: 13px; max-width: 190px; }
.rb-grp { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: visible; position: relative; }
.rich-bar button { min-width: 34px; min-height: 34px; border: 0; background: var(--surface); font: inherit; font-size: 14px; cursor: pointer; color: var(--text); padding: 0 8px; border-radius: 8px; }
.rich-bar > .rb-tools > button { border: 1px solid var(--border); font-size: 13px; }
.rich-bar button:hover { background: #FBF3F2; }
.rb-a { font-weight: 700; }
.rb-bar { display: block; height: 3px; margin: -2px 2px 0; border-radius: 2px; }
.rb-h { font-weight: 700; background: #FFF3A3; padding: 0 3px; border-radius: 3px; }
.rb-pop { position: absolute; top: 40px; left: 0; z-index: 40; width: 196px; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.rb-pop[hidden] { display: none; }
.rich-bar .rb-sw { min-width: 0; min-height: 0; width: 26px; height: 26px; padding: 0; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.rich-bar .rb-none { font-size: 12px; color: var(--muted); }
.rb-custom { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.rb-custom input { width: 40px; height: 26px; padding: 0; border: 0; background: none; }
.rich-input { height: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; padding: 9px 12px; cursor: text; }
.rich-input:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rich-input:focus { outline: 2px solid #A65C5A; outline-offset: 1px; }
.rich-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 0; } /* 和一般欄位標題一樣只靠 .field 的 gap，框才會和旁邊對齊（2026/11/27） */
.img-card .pic img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.pk-ups { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; font-size: 13px; }
.pk-ups:empty { display: none; }
.pk-up { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--bg); border-radius: 8px; }
.pk-up-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-up-st { flex: 0 0 auto; color: var(--muted); }
.pk-up-st.bad { color: #B42318; }
.pick-item { position: relative; }
.pick-item.is-picked { outline: 3px solid #A65C5A; outline-offset: -3px; }
.pk-n { position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; border-radius: 11px; background: #A65C5A; color: #fff; font-size: 12px; font-weight: 700; display: none; align-items: center; justify-content: center; }
.is-picked .pk-n { display: inline-flex; }
.pk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.sticky-head .rich-bar { position: static; margin: 8px 0 0; box-shadow: none; padding: 6px 8px; }
.sticky-head .rb-who { flex: 0 0 auto; margin-right: 6px; }
/* 表情符號面板（rich-emoji.js） */
.rb-pop.rb-emoji { width: 340px; right: 0; left: auto; flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.rb-emoji-q { width: 100%; min-height: 34px; font-size: 13px; }
.rb-emoji-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.rich-bar .rb-emoji-tabs button { min-width: 30px; min-height: 30px; padding: 0; font-size: 16px; }
.rich-bar .rb-emoji-tabs button.on { background: #FBF3F2; box-shadow: inset 0 -2px 0 #A65C5A; }
.rb-emoji-name { font-size: 12px; color: var(--muted); }
.rb-emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; max-height: 220px; overflow-y: auto; }
.rich-bar .rb-emo { min-width: 34px; min-height: 34px; padding: 0; font-size: 20px; line-height: 1; }
/* rich-contrast.js：有淺色字時輸入框換深底 */
.rich-input.rt-dark { background: #3A3536; color: #EDE8E8; border-color: #3A3536; }
.rich-input.rt-dark:focus { border-color: #A65C5A; }
/* 自訂顏色旁的 HEX 色號格 */
.rich-bar .rb-pop .rb-hex { width: 92px; height: 28px; min-height: 0; padding: 2px 8px; font: 13px/1 ui-monospace, Menlo, monospace; text-transform: uppercase; vertical-align: middle; }
/* 固定按鈕列：顏色欄、自訂按鈕、順序（dock-custom.js） */
.dk-color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dk-sw { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); padding: 0; cursor: pointer; }
.dk-sw:hover { transform: scale(1.1); }
.dk-color-row input[type=color] { width: 36px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.dk-color-row .dk-hex { width: 96px; height: 30px; padding: 2px 8px; font: 13px/1 ui-monospace, Menlo, monospace; text-transform: uppercase; }
.dk-sec { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.dk-custom { padding: 12px 14px; margin: 10px 0; }
.dk-custom-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dk-prod-add { display: flex; gap: 6px; }
.dk-prod-add .input { flex: 1; }
.dk-prods { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dk-prod { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.dk-prod img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.dk-prod span { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-order { display: flex; flex-direction: column; gap: 6px; }
.dk-ord { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.dk-ord.off { opacity: .55; }
/* rich-state.js：工具列顯示目前套用中的設定 */
.rich-bar button.rb-state-on { background: #FBF3F2; color: #A65C5A; box-shadow: inset 0 0 0 1px #D7A4A0; }
.rich-bar select.rb-sel option[value="__cur"] { display: none; }
/* 影片庫卡片：下載、重新轉檔（video-tools.js） */
.vid-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
/* 頁首右上一排按鈕（彈窗列表：範本庫＋新增彈窗）：中間留間距、大小一致 */
.head-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.head-actions .btn { font-size: 15px; font-weight: 500; }
/* 總覽儀表板（dashboard.js；2026/11/13） */
.db-notices { display: flex; flex-direction: column; gap: 8px; }
.db-top { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.db-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.db-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; min-width: 0; height: 260px; overflow: hidden; }
.db-card.db-short { height: auto; min-height: 185px; }
.db-card h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.db-drag { color: #C9C4BF; cursor: grab; font-size: 13px; }
.db-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.db-body.is-loading { opacity: .5; }
#dd-body.is-loading { opacity: .5; transition: opacity .15s; }
#dd-filters { margin-top: 4px; }
#dd-body { display: flex; flex-direction: column; gap: 16px; }
#db-range { flex-wrap: wrap; justify-content: flex-end; }
.db-big { display: flex; gap: 18px; flex-wrap: wrap; }
.db-big b { display: block; font-size: 24px; line-height: 1.15; }
.db-big small { color: var(--muted); font-size: 12px; }
.db-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.db-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px dashed var(--line); }
.db-list li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-list li span:last-child { white-space: nowrap; }
.db-list .db-empty { color: var(--muted); }
.db-more { margin-top: auto; align-self: flex-start; }
.db-bar { height: 6px; border-radius: 6px; background: #ECEAE7; overflow: hidden; flex: 1; min-width: 60px; }
.db-bar i { display: block; height: 100%; background: var(--accent); }
.db-bar.red i { background: var(--danger); }
.db-meter { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.db-line { display: grid; grid-template-columns: 90px 1fr minmax(0, auto); align-items: center; gap: 12px; font-size: 13px; }
.db-line-l { color: var(--muted); }
.db-line-r { white-space: nowrap; }
.db-card .bad, .db-line-r.bad { color: var(--danger); }
.db-card .warn { color: #B07A12; }
.db-card .ok { color: #2E6B45; }
@media (max-width: 1100px) { .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .db-top { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .db-grid { grid-template-columns: 1fr; } }
.db-card .db-more { color: var(--accent); border-color: #E7C9C6; background: #FBF3F2; font-weight: 600; }
.db-card .db-more:hover { background: #F6E6E4; color: var(--accent); }
/* 固定按鈕列：每顆按鈕一張卡片（admin-ui/js/dock-buttons.js；2026/11/14） */
.dk-cards { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 12px; }
.dk-card { border: 1.5px solid #CFCFCC; border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.dk-card.off .dk-card-head { opacity: .7; }
.dk-card.open { border-color: #B9B9B6; }
.dk-card.active { border: 2.5px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.dk-card-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; border-radius: 10px; user-select: none; }
.dk-card-head:hover { background: #FAF8F7; }
.dk-card.active .dk-card-head { background: var(--accent-soft); }
.dk-card-head:focus-visible { outline: 3px solid var(--accent-soft); }
.dk-card-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dk-card-name b { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-card-name small { font-size: 12px; color: var(--muted); }
.dk-card-arrow { color: var(--muted); transition: transform .2s; }
.dk-card.open .dk-card-arrow { transform: rotate(180deg); }
.dk-card-body { border-top: 1px solid var(--line); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.dk-circle { flex: none; border-radius: 50%; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; box-shadow: 0 3px 8px rgba(74,53,48,.25); line-height: 1; }
.dk-circle svg { width: 100%; height: 100%; }
.dk-icons { display: flex; flex-wrap: wrap; gap: 6px; }
.dk-ic { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; background: #D7A4A0; color: #fff; padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dk-ic svg { width: 100%; height: 100%; }
.dk-ic.dk-emo { background: #F2ECEA; font-size: 20px; padding: 0; }
.dk-ic.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dk-ic-more { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.dk-ic-more .input { width: 180px; }
.dk-ic-img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #F2ECEA; }
/* 固定按鈕列：LINE 卡片固定最下面（網站上最右邊），不能拖（2026/11/14） */
.dk-cards-line { margin-top: -2px; }
.dk-card-lock { width: 22px; text-align: center; font-size: 13px; opacity: .6; flex: none; }
/* 💳 費用（dash-detail.js 的 billing、dashboard.js 的 billLine；2026/11/14）：綠＝80% 以下、黃＝80～100%、紅＝超過 */
.db-bar.green i { background: #7FA88A; }
.db-bar.yellow i { background: #E0B04A; }
.bl-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.bl-card .big { font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.bl-card .bl-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; gap: 8px; }
.bl-card .bl-src { font-size: 12px; color: var(--muted); margin-top: 8px; }
.bl-card .bl-src b { color: var(--accent); font-weight: 600; }
.bl-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 14px; }
.bl-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 12px; }
.bl-form .input { width: 140px; }
.bl-copy { display: flex; gap: 6px; } .bl-copy .input { flex: 1; font-size: 12px; }
@media (max-width: 1100px) { .bl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bl-two { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .bl-cards { grid-template-columns: 1fr; } }
/* 轉盤格子顏色快選＋自訂（2026/11/15，game-edit.js） */
.seg-color { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.seg-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.seg-custom { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
.seg-custom input[type=color] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.seg-row.seg-hit { background: #FBF0EE; box-shadow: inset 4px 0 0 #A65C5A; }
.seg-look-h { margin-top: 18px; }
/* 欄位說明「?」（help-tip.js；2026/11/16） */
.tip-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.15em; height: 1.15em; margin: 0 0 0 .3em; padding: 0; border-radius: 50%; border: 1px solid #C9BFB8; background: #fff; color: var(--muted); font-family: 'Noto Sans TC', sans-serif; font-size: 1em; line-height: 1; cursor: help; vertical-align: -.15em; flex: none; box-sizing: border-box; user-select: none; } /* 圓圈和前面的標題文字一樣大（em；2026/11/16） */
.tip-btn:hover, .tip-btn[aria-expanded="true"] { border-color: #A65C5A; color: #A65C5A; background: #FBF0EE; }
.tip-btn:focus-visible { outline: 2px solid #A65C5A; outline-offset: 2px; }
.tip-pop { position: fixed; z-index: 2147483600; display: none; background: #2B2523; color: #fff; font-size: 13px; line-height: 1.6; padding: 8px 12px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: auto; white-space: pre-line; }
.tip-pop.on { display: block; }
.tip-pop a { color: #F3D5D0; }
.toggle-row > span > b { display: inline-flex; align-items: center; }
/* 滑桿數值跟著圓點（fields.js range；2026/11/16） */
.range-wrap { position: relative; padding-right: 56px; }
.range-wrap input[type=range] { width: 100%; display: block; }
.range-wrap .range-val { position: absolute; top: 50%; transform: translateY(-50%); left: calc(var(--p, 0) * (100% - 56px - 18px) + 18px + 6px); font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; line-height: 1.4; }
/* 卡片固定版面（2026/11/16 使用者指定，全站卡片照這樣）：檔名、資訊固定兩行高度，使用狀態同一高度，按鈕貼卡片最下方 */
.img-card .info { flex: 1 1 auto; }
.img-card .fname { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; min-height: 2.9em; }
.img-card .meta { line-height: 1.45; min-height: 2.9em; }
.img-card .use { line-height: 1.45; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.img-card .actions { margin-top: auto; padding-top: 10px; }
.img-card .actions .btn, .img-card .actions .locked-del { flex: 1 1 0; }
.locked-del { display: inline-flex; cursor: not-allowed; }
.locked-del .btn { width: 100%; pointer-events: none; opacity: .55; }
.vid-card .vid-tools { margin-top: auto; padding-top: 6px; } /* 影片卡片：按鈕貼最下方（2026/11/16） */
/* 影片卡片的下載／重轉／移動：縮小排成一排、三顆同寬（2026/11/25 使用者指定：平常不常用、太佔空間） */
.vid-card .vid-tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; } /* 幾顆就平分（檢視權限只有「下載」時佔滿） */
.vid-card .vid-tools .btn { min-width: 0; height: 30px; min-height: 30px; padding: 0 2px; font-size: 13px; white-space: nowrap; justify-content: center; gap: 2px; }
.break-grid > .card { margin: 0 !important; } /* 三個分布表格上緣對齊、同高（2026/11/16；其他規則的「卡片之間 16px」會把第 2、3 個往下推） */
/* 左側選單編輯：改名稱、隱藏／顯示（nav-edit.js；2026/11/16） */
.nav-item .nav-label { flex: 1 1 auto; min-width: 0; cursor: text; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; }
.editing .nav-item .nav-label:hover { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.nav-item .nav-rename { flex: 1 1 auto; min-width: 0; height: 30px; padding: 2px 8px; font-size: 14px; }
.nav-vis { flex: none; margin-left: auto; border: 1px solid var(--border); background: #fff; border-radius: 999px; font: inherit; font-size: 12px; padding: 2px 10px; cursor: pointer; color: var(--muted); }
.nav-vis:hover { color: #A65C5A; border-color: #A65C5A; }
.nav-item.is-hidden > :not(.nav-vis) { opacity: .4; }
.nav-item.is-hidden .nav-vis { opacity: 1; color: #A65C5A; border-color: #A65C5A; }
/* 滑桿欄位上下多留一點空間（2026/11/16） */
.field:has(> .range-wrap) { margin-bottom: 6px; }
.range-wrap { margin-top: 8px; }
.field > label:has(> .tip-btn), .field > legend:has(> .tip-btn), .field > .rich-label:has(> .tip-btn) { display: flex; align-items: center; } .field > label > .tip-btn, .field > legend > .tip-btn, .field > .rich-label > .tip-btn { vertical-align: 0; } /* 「?」和標題文字置中對齊 */
/* 🎵 ✨剪輯：插入音樂（video-cut-music.js，2026/11/24） */
.cut-mrow { position: absolute; left: 0; right: 0; background: #F1EFEC; border-radius: 6px; cursor: col-resize; }
.cut-mrow em { position: absolute; right: 4px; top: 3px; font-style: normal; font-size: 11px; color: #9A9792; pointer-events: none; z-index: 1; }
.cut-mbar { position: absolute; left: 0; right: 0; top: 3px; bottom: 3px; border: 1px solid #A65C5A; border-radius: 6px; display: flex; align-items: center; overflow: hidden; cursor: pointer; box-sizing: border-box; }
.cut-mbar span { flex: 1; min-width: 0; font-size: 12px; color: #3F2A26; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; pointer-events: none; }
.cut-mbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cut-mseam { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.cut-mu-song { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.cut-mu-song b { font-weight: 500; overflow-wrap: anywhere; }
.cut-mu-song small { color: var(--muted); font-size: 12px; }
.cut-mu-btns { display: flex; gap: 10px; margin-bottom: 12px; }
.cut-mu-btns .btn { flex: 1; white-space: nowrap; }
#ct-music .hint.keep { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
#ct-music .hint.keep.bad { color: #B3261E; }
#ct-music.is-flash { box-shadow: 0 0 0 3px var(--accent-soft, #FBF0EE), 0 0 0 5px var(--accent, #A65C5A); transition: box-shadow .2s; }
.cut-mudlg { max-width: 560px; }
/* 🎨 ✨剪輯：亮度與顏色（video-cut-grade.js，2026/11/24）：預覽右邊；不夠寬時移到右欄（加 .card） */
.cut-grade { width: 250px; flex: none; box-sizing: border-box; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 10px; }
.cut-grade.card { width: auto; height: auto; overflow: visible; padding: 20px; }
.cg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cg-head .h2 { margin: 0; font-size: 16px; }
.cg-st { font-size: 12px; color: var(--muted); }
.cg-st.ok { color: #2E7D32; }
.cg-st.fail { color: #B3261E; }
.cg-where { margin: 6px 0 8px; font-size: 12px; color: var(--muted); }
.cg-row { padding: 6px 0; border-top: 1px solid var(--border); }
.cg-lab { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cg-lab label { font-weight: 500; }
.cg-val { flex: 1; font-weight: 500; color: var(--accent); font-size: 13px; }
.cg-auto { border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 8px; font-size: 12px; padding: 2px 8px; min-height: 26px; cursor: pointer; white-space: nowrap; }
.cg-auto.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cg-auto:disabled { cursor: default; }
.cg-row input[type="range"] { width: 100%; margin: 4px 0 0; accent-color: var(--accent); }
.cg-ends { display: flex; justify-content: space-between; font-size: 11px; color: #9A9792; }
.cg-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; } /* 同一組按鈕同寬同高、間距 10px（全站規則） */
.cg-btns .btn { width: 100%; white-space: nowrap; }
.cut-grade .cg-note { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cut-grade .hint.keep { display: block; font-size: 12px; color: var(--muted); }

/* 列表的期間欄（period-cell.js，2026/11/24）：上下排列、日期和「開始／結束」各一欄對齊 */
.period-cell { display: inline-grid; grid-template-columns: auto auto; column-gap: 8px; row-gap: 2px; align-items: baseline; font-variant-numeric: tabular-nums; white-space: nowrap; }
.period-cell .pc-t { justify-self: end; } /* 靠右：日期長短不同（11/1、11/12）時，時間也上下對齊 */
.period-cell .pc-w { color: var(--muted); font-size: 13px; }
.period-cell .pc-none { color: var(--muted); }
/* 「設定步驟」這類可以展開的說明：做成外框按鈕，前面放 emoji，一看就知道可以點開（2026/11/27 使用者要求） */
details.steps-toggle > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--accent); border-radius: 8px; background: #fff; color: var(--accent); font-weight: 600; list-style: none; }
details.steps-toggle > summary::-webkit-details-marker { display: none; }
details.steps-toggle > summary::after { content: '▾'; font-size: 12px; transition: transform .15s; }
details.steps-toggle[open] > summary::after { transform: rotate(180deg); }
details.steps-toggle > summary:hover { background: #FBF0EE; }
details.steps-toggle[open] > summary { margin-bottom: 8px; }
/* 測試連線：按鈕旁一直顯示的狀態（conn-test.js；2026/11/27） */
.conn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-row > .conn-row { flex: 0 0 auto; flex-direction: row; margin-left: auto; } /* 狀態和按鈕同一排、靠右（2026/11/27 使用者要求） */
.conn-state { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.conn-state[data-st="ok"] { color: var(--good); background: var(--good-bg); }
.conn-state[data-st="fail"] { color: var(--danger); background: #FDECEA; }
.conn-state[data-st="none"], .conn-state[data-st="busy"] { color: var(--muted, #6B6B69); background: #EFEFED; }
.conn-msg { margin-top: 4px; }
.conn-msg .fail { color: var(--danger); }
.tbl td.wrap-cell .pill { white-space: normal; text-align: left; } /* 長名稱的標籤（例：任務包給哪個活動用）也可以換行（2026/11/27） */
.tbl-fit th { white-space: normal; }
.period-cell .pc-t { white-space: nowrap; } /* 期間：日期和時間不拆開（2026/11/27 審查） */
/* 沒有權限的按鈕、開關、選單項目：變灰，滑上去看原因（perm.js；2026/11/28） */
.no-perm, .no-perm * { cursor: not-allowed !important; }
.no-perm { opacity: .45; filter: grayscale(1); }
.nav a.no-perm { opacity: .4; }
/* 登入頁、第一次登入要改密碼／設定兩步驟驗證（pages/login.js、pages/account.js；2026/11/28） */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--bg, #F5F5F4); }
.auth-card { width: 100%; max-width: 420px; padding: 32px 28px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-btn { width: 100%; min-height: 44px; }
.auth-err { color: var(--danger); font-size: 14px; margin: 0; min-height: 1em; }
.auth-ok { color: var(--good); background: var(--good-bg); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.auth-warn { color: var(--warn); background: var(--warn-bg); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.auth-link { margin: 0; text-align: center; font-size: 14px; }
.acc-qr { width: 200px; height: 200px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.acc-qr svg { width: 100%; height: 100%; display: block; }
.acc-key { font-family: ui-monospace, Menlo, monospace; letter-spacing: 1px; user-select: all; }
.nav-item.nav-locked { opacity: .4; }
.nav-me { color: inherit; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-me:hover b { text-decoration: underline; }
/* 人員權限勾選（pages/users-edit.js；2026/11/28） */
.perm-group { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.perm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.perm-row { display: flex; align-items: flex-start; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.perm-row:last-child { border-bottom: 0; }
.perm-name { flex: 0 0 300px; max-width: 100%; font-size: 14px; }
.perm-acts { flex: 1 1 300px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.perm-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.perm-chk.is-lock { opacity: .45; cursor: not-allowed; }
.ip-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.ip-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 全站設定 → 開店平台與安裝（settings-platform.js；2026/11/30 多店家） */
#st-platform .plat-key { display: block; margin: 6px 0 8px; font-size: 13px; color: var(--muted); }
#st-platform .plat-key.bad { color: #B3261E; text-decoration: line-through; }
#st-platform .plat-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre; overflow: auto; }
#st-platform .plat-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
