/* ============================================================
   ETMC v9 — 清爽專業 SaaS(亮色藍)
   規範:playbook 04(語意七角色 token/@media 集中最底部)
   換皮=只改 :root 的值,不改變數名、不改結構
   ============================================================ */

/* ---------- 1. reset + tokens + base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* 色彩七角色(playbook 04 標準名) */
  --primary: #2563eb;        /* 主色:按鈕 / active / 強調 */
  --primary-dark: #1d4ed8;   /* 主色深(hover) */
  --bg: #f7f9fc;             /* 頁面底色 */
  --surface: #ffffff;        /* 卡片 / 面板 */
  --surface-2: #eff4ff;      /* 次要面板(選中態 / 區塊底) */
  --ink: #16202e;            /* 主文字 */
  --sub: #5b6b7e;            /* 次文字 */
  --line: #e5e9f0;           /* 分隔線 / 邊框 */
  /* 深色區塊(行銷 CTA) */
  --invert-bg: #1e40af;
  --invert-ink: #ffffff;
  --invert-sub: #c7d7fb;
  /* 本案擴充(仍語意命名) */
  --sub-2: #8b98a9;          /* 更弱的說明文字 */
  --line-2: #d3dae4;         /* 輸入框邊框 */
  /* 語意狀態色(A2:綠=成功 紅=失敗 黃=警告 藍=處理中;與 --primary 區隔) */
  --ok: #16a34a;   --ok-bg: #f0faf3;   --ok-line: #bbe6c9;
  --fail: #dc2626; --fail-bg: #fdf2f2; --fail-line: #f3c4c4;
  --warn: #d97706; --warn-bg: #fdf8ee; --warn-line: #f0dcb6;
  --busy: #0ea5e9; --busy-bg: #f0f9ff; --busy-line: #bae0f5;
  --sched: #64748b; --sched-bg: #f4f6f9; --sched-line: #d8dfe8;
  /* 節奏 token */
  --radius: 10px;
  --radius-lg: 16px;
  --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow: 0 1px 2px rgba(22,32,46,.05), 0 8px 24px -12px rgba(22,32,46,.12);
  --shadow-lg: 0 2px 4px rgba(22,32,46,.04), 0 20px 48px -16px rgba(37,99,235,.18);
  --sans: 'Inter', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 14.5px; line-height: 1.65;
  font-variant-numeric: tabular-nums; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1440px; margin: 0; padding: 0 36px; }  /* 內容貼側欄滿版展開 */
.wrap.narrow { max-width: 900px; }

/* ---------- 2. 面板外殼(partials/sidebar.php + footer.php) ---------- */
.shell { display: flex; align-items: stretch; min-height: 100vh; }
.side {
  width: 228px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 18px 12px 16px; border-right: 1px solid var(--line); background: var(--surface);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px;
  padding: 4px 10px 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.logo i { width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), #4f8bff);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.logo i svg { width: 13px; height: 13px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 11px;
  border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--sub); }
.side-nav a svg { width: 17px; height: 17px; flex: none; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a.on { background: var(--surface-2); color: var(--primary); font-weight: 600; }
/* 即將推出:弱化區(不與正式功能等重) */
.side-cap { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--sub-2);
  padding: 2px 11px 6px; }
.side-nav a.soon-item { color: var(--sub-2); font-size: 12.5px; padding: 6px 11px; }
.side-nav a.soon-item svg { width: 15px; height: 15px; opacity: .65; }
.side-nav a.soon-item:hover { color: var(--sub); background: var(--bg); }
.side-sep { height: 1px; background: var(--line); margin: 9px 6px; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; }
.side-op { font-size: 12px; color: var(--sub-2); line-height: 1.6; }
.side-op b { color: var(--sub); font-weight: 600; display: block; }
.side-logout { font-size: 12.5px; color: var(--sub); }
.side-logout:hover { color: var(--ink); }
/* 登出改為 POST 表單(需 CSRF),故是 button 不是 a——重置瀏覽器預設按鈕樣式 */
button.side-logout, button.tb-logout {
  background: none; border: none; padding: 0;
  font-family: inherit; cursor: pointer; }
.side-ref { font-size: 11px; color: var(--sub-2); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main > .wrap { width: 100%; }
.topbar { display: none; }
.tabbar { display: none; }

/* ---------- 3. 通用元件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 18px;
  border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  background: var(--primary); color: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent);
  transition: background .15s var(--ease); }
.btn:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); color: var(--sub); border-color: var(--line-2); box-shadow: none; }
.btn-ghost:hover { color: var(--ink); background: var(--bg); }
.btn-danger { background: var(--surface); color: var(--fail); border-color: var(--fail-line); box-shadow: none; }
.btn-danger:hover { background: var(--fail-bg); }
.btn-sm { padding: 5px 13px; font-size: 12.5px; }
.btn-lg { padding: 12px 30px; font-size: 15px; border-radius: 11px; }

/* 統一元件 1:狀態徽章 */
.stb { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 2px 11px; border: 1px solid; white-space: nowrap; }
.stb i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.stb.ok    { color: var(--ok);    border-color: var(--ok-line);    background: var(--ok-bg); }
.stb.fail  { color: var(--fail);  border-color: var(--fail-line);  background: var(--fail-bg); }
.stb.warn  { color: var(--warn);  border-color: var(--warn-line);  background: var(--warn-bg); }
.stb.busy  { color: var(--busy);  border-color: var(--busy-line);  background: var(--busy-bg); }
.stb.busy i { animation: pulse 1.1s ease-in-out infinite; }
.stb.sched { color: var(--sched); border-color: var(--sched-line); background: var(--sched-bg); }
@keyframes pulse { 50% { opacity: .3; } }

/* 統一元件 2:目的地標籤(介面文案稱「帳號」) */
.dest { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; white-space: nowrap; color: var(--sub); }
.dest svg { width: 14px; height: 14px; flex: none; }
/* display 不可省(同 .tgl,見 pitfalls 006):span 預設 inline,寬高不生效。
   之前都在 flex 容器內(flex item 會被 blockify)所以剛好正常,放進一般文字流就塌了。 */
.adot { display: inline-block; vertical-align: middle;
  width: 6px; height: 6px; border-radius: 50%; flex: none; }
.adot.ok { background: var(--ok); } .adot.warn { background: var(--warn); } .adot.bad { background: var(--fail); }

/* 統一元件 3:錯誤卡(人話+建議動作+可否重試+追蹤編號) */
.errcard { border: 1px solid var(--fail-line); border-left: 3px solid var(--fail);
  border-radius: var(--radius); background: var(--fail-bg); padding: 13px 16px;
  display: flex; flex-direction: column; gap: 9px; }
.errcard-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.errcard-type { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--fail); text-transform: uppercase; }
.errcard-trk { font-size: 11px; color: var(--sub-2); }
.errcard-msg { font-size: 13.5px; }
.errcard-act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.errcard-retry { font-size: 12px; color: var(--sub); }
.errcard details { font-size: 12px; color: var(--sub-2); }
.errcard summary { cursor: pointer; font-size: 11.5px; }

/* 統一元件 4:平台聚合徽章(圖示+數量+最差狀態燈;點擊=門) */
.agg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.agg:hover { border-color: var(--line-2); background: var(--surface); }
.agg svg { width: 15px; height: 15px; flex: none; }
.agg .adot { margin-left: 1px; }

/* 面板卡 */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: var(--sp-5); }
.phead { display: flex; align-items: center; gap: var(--sp-3); padding: 14px 20px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.phead h2 { font-size: 15.5px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 8px; }
.phead small { font-size: 12px; color: var(--sub-2); }
.pbody { padding: 18px 20px; }

/* 頁首 */
.page-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; padding: 32px 0 18px; }
.page-head h1 { font-size: 23px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.page-head .sub { font-size: 12.5px; color: var(--sub-2); margin-top: 4px; }

/* ? 說明提示(版面不放教學句,說明收進這裡;文案用人話) */
.help { position: relative; display: inline-flex; align-items: center; }
.help > button { width: 18px; height: 18px; border-radius: 50%; border: 1.2px solid var(--line-2);
  background: transparent; color: var(--sub-2); font: inherit; font-size: 10.5px; font-weight: 600;
  cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0;
  transition: all .15s var(--ease); }
.help > button:hover, .help.open > button { color: var(--primary); border-color: var(--primary); background: var(--surface-2); }
.help-pop { display: none; position: absolute; top: calc(100% + 9px); left: 50%;
  transform: translateX(-50%); z-index: 80; width: min(300px, 82vw);
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.7;
  padding: 11px 14px; border-radius: var(--radius); box-shadow: 0 12px 32px -8px rgba(22,32,46,.4);
  text-align: left; white-space: normal; }
.help-pop::before { content: ""; position: absolute; top: -4px; left: 50%;
  transform: translateX(-50%) rotate(45deg); width: 9px; height: 9px; background: var(--ink); border-radius: 2px; }
.help.open .help-pop { display: block; animation: helpin .14s var(--ease); }
@keyframes helpin { from { opacity: 0; transform: translateX(-50%) translateY(-3px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 表單 */
label.f { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
label.f small { font-weight: 400; color: var(--sub-2); }
select, input[type=text], input[type=time], input[type=email], input[type=password],
input[type=number], input[type=search], input[type=url], input[type=datetime-local], textarea {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 13px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.field { margin-bottom: var(--sp-4); }
.cnt { float: right; font-size: 12px; color: var(--sub-2); font-weight: 400; }
.hint { font-size: 12px; color: var(--sub-2); margin-top: 6px; }
.hint a, .dnote a { color: var(--primary); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* toggle */
/* display 不可省:label 預設 inline,寬高不生效——在 flex 容器外(如表格儲存格)會塌掉 */
.tgl { display: inline-block; vertical-align: middle;
  position: relative; width: 36px; height: 20px; flex: none; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tgl i { position: absolute; inset: 0; background: var(--line-2); border-radius: 999px; transition: background .15s; }
.tgl i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.tgl input:checked + i { background: var(--primary); }
.tgl input:checked + i::after { left: 18px; }
.tgl input:disabled + i { opacity: .5; cursor: not-allowed; }

/* 篩選 pill */
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { font: inherit; font-size: 13px; font-weight: 500; padding: 5px 14px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--sub); cursor: pointer; }
.pills button:hover { color: var(--ink); }
.pills button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
/* 框架版的 pills 用 <a> 而非 <button>——帶 href 才能把篩選狀態留在網址上(可分享、可重整) */
.pills a { font-size: 13px; font-weight: 500; padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--sub);
  display: inline-flex; align-items: center; }
.pills a:hover { color: var(--ink); border-color: var(--line-2); }
.pills a.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 頁內分頁 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--sub);
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 9px 15px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabpage { display: none; }
.tabpage.on { display: block; }

/* ---------- 4. 頁面模組 ---------- */

/* 總覽 */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: var(--sp-5); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow); display: block;
  transition: border-color .15s var(--ease), transform .15s var(--ease); }
a.stat:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stat .n { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat .n.g { color: var(--ok); } .stat .n.r { color: var(--fail); } .stat .n.s { color: var(--sched); }
.stat .d { font-size: 12.5px; color: var(--sub); }
.alert { display: flex; align-items: center; gap: var(--sp-3); padding: 13px 16px;
  border-radius: 12px; border: 1px solid; margin-bottom: 10px; font-size: 13.5px; }
.alert svg { width: 19px; height: 19px; flex: none; }
.alert.fail { background: var(--fail-bg); border-color: var(--fail-line); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.alert .go { margin-left: auto; font-weight: 600; white-space: nowrap; }
.alert.fail .go { color: var(--fail); }
.alert.warn .go { color: var(--warn); }
.nextrow { display: flex; align-items: center; gap: var(--sp-3); padding: 11px 0;
  border-top: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.nextrow:first-child { border-top: none; }
.nextrow b { font-weight: 600; min-width: 120px; display: inline-flex; align-items: center; gap: 7px; }
.nextrow b svg { width: 16px; height: 16px; flex: none; }
.nextrow .tm { margin-left: auto; color: var(--sub); white-space: nowrap; }

/* 頻道管理 */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  grid-auto-rows: 1fr;  /* 所有排等高:換行也不會出現兩種卡高 */
  gap: 18px; padding-bottom: 50px; }
.ch { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 13px;
  transition: transform .2s var(--ease); }
.ch:hover { transform: translateY(-2px); }
.ch-top { display: flex; align-items: center; gap: 10px; }
.ch-top h2 { font-size: 16px; font-weight: 700; flex: 1; }
.ch-meta { font-size: 11.5px; color: var(--sub-2); }
.ch-aggs { display: flex; flex-wrap: wrap; gap: 7px; }
.ch-sum { display: flex; align-items: center; gap: var(--sp-2); font-size: 12.5px; color: var(--sub);
  border-top: 1px dashed var(--line); padding-top: 11px;
  margin-top: auto;  /* 摘要+按鈕貼齊卡片底部,內容多寡不影響按鈕位置 */ }
.ch-sum .faildot { display: inline-flex; align-items: center; gap: 5px; color: var(--fail); font-weight: 600; }
.ch-sum .faildot i { width: 7px; height: 7px; border-radius: 50%; background: var(--fail); }
.ch-act { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.ch-act .btn { padding: 7px 14px; font-size: 12.5px; }
.ch.new { border-style: dashed; align-items: center; justify-content: center; text-align: center;
  gap: var(--sp-2); color: var(--sub); min-height: 200px; }
.ch.new:hover { border-color: var(--primary); color: var(--primary); }
.ch.new .plus { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; }
.ch.new small { font-size: 11.5px; color: var(--sub-2); }

/* 頻道設定 / 建立 */
.crumb { font-size: 13px; color: var(--sub-2); padding-top: 24px; }
.crumb a { color: var(--sub); }
.crumb a:hover { color: var(--primary); }
/* 平台圖示的預設尺寸 —— 定在元件本身,新容器不必各自處理。
   SVG 沒有內建尺寸,放進 flex 容器會被拉伸到整個版面(踩過兩次)。
   容器需要不同尺寸時用更高特異度覆寫,如 .pcell svg。 */
.pic { width: 18px; height: 18px; flex: none; }

.bindrow { display: flex; align-items: center; gap: var(--sp-3); padding: 11px 0;
  border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
.bindrow:first-child { border-top: none; }
.bindrow .why { color: var(--fail); font-size: 12.5px; }
.bindrow .why.w { color: var(--warn); }
.bindrow .sp { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bindrow .tgl-lab { display: flex; align-items: center; gap: var(--sp-2); font-size: 12px; color: var(--sub); }
.bindrow .unbind { font-size: 12.5px; color: var(--sub-2); cursor: pointer;
  background: none; border: none; padding: 0; font-family: inherit; }
.bindrow .unbind:hover { color: var(--fail); }
.quota-line { font-size: 12.5px; color: var(--sub); margin-top: var(--sp-3); }
.sched-prev { background: var(--surface-2); border: 1px dashed #c7d7fb; border-radius: var(--radius);
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--primary); margin: 10px 0 8px; }
/* 24 小時制時間選擇(Choices 雙下拉) */
.time-picker { display: flex; align-items: center; gap: 8px; max-width: 230px; }
.time-picker > span { font-weight: 700; color: var(--sub); }
.time-picker .choices { flex: 1; }
.danger { border-color: var(--fail-line); }
.danger .phead h2 { color: var(--fail); }
.req { color: var(--fail); font-size: 11px; font-weight: 700; margin-left: 4px; }
.done-card { background: var(--surface); border: 1px solid var(--ok-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 36px 30px; text-align: center; display: none; }
.done-card .big { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-bg); color: var(--ok);
  font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.done-card h2 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.done-card p { font-size: 13.5px; color: var(--sub); margin-bottom: var(--sp-5); }
.done-card .later { display: block; margin-top: 14px; font-size: 13px; color: var(--sub-2); }
/* 連接精靈(SweetAlert2 內容) */
.wiz-step { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--primary); margin-bottom: 10px; }
.plat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.plat-card { display: flex; align-items: center; gap: 10px; padding: 14px;
  border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer;
  font-weight: 600; font-size: 14px; background: var(--surface); }
.plat-card:hover { border-color: var(--primary); background: var(--surface-2); }
.plat-card svg { width: 22px; height: 22px; }
.wiz-opt { display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line-2); border-radius: var(--radius); margin-bottom: 8px; font-size: 13.5px; }
.wiz-opt.dis { opacity: .55; background: var(--bg); }
.wiz-opt input { width: 16px; height: 16px; accent-color: var(--primary); }
.wiz-opt svg { width: 18px; height: 18px; flex: none; }
.wiz-opt .tagd { margin-left: auto; font-size: 11.5px; color: var(--sub-2); }

/* 發布 */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: var(--sp-5); overflow: hidden; }
.step-head { display: flex; align-items: center; gap: var(--sp-3); padding: 15px 20px;
  border-bottom: 1px solid var(--line); }
.step-no { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--primary);
  font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.step-head h2 { font-size: 15.5px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 8px; }
.step-head small { font-size: 12px; color: var(--sub-2); }
.step-body { padding: 18px 20px; }
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.type { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 12px;
  border: 1.5px solid var(--line-2); border-radius: 14px; cursor: pointer; background: var(--surface);
  font-weight: 600; font-size: 14px; color: var(--sub); }
.type svg { width: 26px; height: 26px; stroke: currentColor; }
.type small { font-size: 11px; font-weight: 400; color: var(--sub-2); }
.type.on { border-color: var(--primary); background: var(--surface-2); color: var(--primary); }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 30px 20px;
  text-align: center; color: var(--sub); background: var(--bg); }
.drop b { color: var(--ink); }
.drop small { display: block; color: var(--sub-2); font-size: 12px; margin-top: 6px; }
.upfile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: var(--sp-3);
  padding: 11px 14px; background: var(--ok-bg); border: 1px solid var(--ok-line);
  border-radius: var(--radius); font-size: 13px; }
.upfile b { font-weight: 600; }
.upfile .meta { color: var(--sub); font-size: 12.5px; }
.upfile .btn { margin-left: auto; }
.dcap { font-size: 13px; color: var(--sub); margin: var(--sp-4) 0 10px; }
.drow { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px;
  flex-wrap: wrap; font-size: 13px; }
.drow .agg-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.drow .agg-line svg { width: 15px; height: 15px; }
.drow .why { color: var(--sub-2); font-size: 12.5px; }
.drow.exc { background: var(--bg); }
.drow.exc.bad .why { color: var(--fail); }
.drow.exc.warn2 .why { color: var(--warn); }
/* 不會發的目的地:降權但**仍然顯示**——不能默默消失,用戶要知道為什麼 */
.drow.off { opacity: .6; }
.drow.off .why { color: var(--warn); }

/* 內容類型選擇 */
.type-row { display: flex; gap: 10px; flex-wrap: wrap; }
.type-row .type { flex: 1; min-width: 110px; }

/* 貼底確認列:發布前的最後一眼——發到幾個、幾個不發、什麼時候發 */
.confirm-bar { position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 -4px 20px -8px rgba(22,32,46,.18);
  padding: 14px 18px; margin-top: var(--sp-4); }
.confirm-bar .cb-main { flex: 1; }
.confirm-bar .cb-main b { font-size: 15px; }
.drow details { font-size: 12.5px; color: var(--sub); }
.drow summary { cursor: pointer; color: var(--primary); font-size: 12px; }
.drow .mk { width: 16px; text-align: center; font-weight: 700; }
.drow .mk.ok { color: var(--ok); } .drow .mk.warn { color: var(--warn); } .drow .mk.bad { color: var(--fail); }
.dnote { font-size: 12px; color: var(--sub-2); margin-top: 8px; }
.aiflag { display: flex; gap: 10px; align-items: flex-start; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; font-size: 13px; }
.aiflag input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--primary); }
.aiflag small { display: block; color: var(--sub-2); font-size: 12px; }
details.adv summary.adv-sum { list-style: none; cursor: pointer; display: flex; align-items: center;
  gap: var(--sp-2); padding: 13px 20px; font-size: 13px; font-weight: 500; color: var(--primary); }
details.adv summary.adv-sum::-webkit-details-marker { display: none; }
details.adv summary .tri { transition: transform .2s var(--ease); }
details.adv[open] summary .tri { transform: rotate(90deg); }
details.adv summary .awarn { margin-left: auto; color: var(--warn); font-weight: 600; font-size: 12.5px; }
.adv .tabs { padding: 0 20px; }
.tabpane { display: none; padding: 18px 20px; }
.tabpane.on { display: block; }
.warnbar { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius);
  padding: 11px 14px; font-size: 13px; color: var(--warn); margin-bottom: 14px; }
.adv-tools { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 16px; }
/* 貼底確認列(取代原發布前摘要步驟) */
.pubbar { position: sticky; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line); margin-top: auto; }
.pubbar-in { max-width: 900px; margin: 0; padding: 12px 36px;
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.pubbar .sum { font-size: 13.5px; color: var(--sub); }
.pubbar .sum b { color: var(--ink); font-weight: 700; }
.pubbar .sum .skip { color: var(--warn); font-weight: 600; margin-left: 4px; }
.pubbar .btn-lg { margin-left: auto; }
/* 微調降級為內容區底部的一行連結 */
details.adv { border-top: 1px solid var(--line); }

/* 內容中心 */
.filter-bar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: 18px; }
.view-tgl { margin-left: auto; display: flex; border: 1px solid var(--line-2);
  border-radius: 9px; overflow: hidden; }
.view-tgl button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 14px;
  border: none; background: var(--surface); color: var(--sub); cursor: pointer; }
.view-tgl button.on { background: var(--primary); color: #fff; }
.grp { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); margin-bottom: var(--sp-4); padding: 16px 18px; }
.grp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.grp-head .tp { font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--surface-2); border-radius: 6px; padding: 1px 8px; }
.grp-head h3 { font-size: 14.5px; font-weight: 700; flex: 1; }
.grp-head .agg-sum { font-size: 12.5px; font-weight: 600; }
.grp-head .agg-sum .g { color: var(--ok); } .grp-head .agg-sum .r { color: var(--fail); }
.grp-head .agg-sum .b { color: var(--busy); } .grp-head .agg-sum .s { color: var(--sched); }
.grp .ch-lab { font-size: 11.5px; color: var(--sub-2); }
.trow { display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.trow .agg-line { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.trow .agg-line svg { width: 14px; height: 14px; }
.trow .tm { color: var(--sub-2); font-size: 12.5px; }
.trow .sp { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.trow .lk { color: var(--primary); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.trow .lk.dim { color: var(--sub-2); }
/* 需要 CSRF 的動作是 <button> 不是 <a> —— 重置瀏覽器預設按鈕外觀。
   統一寫在 .lk 本體,任何容器都適用(避免每個新頁面各自處理)。 */
button.lk, button.lk-danger {
  background: none; border: none; padding: 0; font-family: inherit; }
.trow details { width: 100%; font-size: 12.5px; color: var(--sub); }
.trow summary { cursor: pointer; color: var(--primary); font-size: 12px; }
.retime { display: none; width: 100%; background: var(--bg); border: 1px dashed var(--line-2);
  border-radius: var(--radius); padding: 12px; margin-top: 8px; }
.retime.show { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.retime input { width: auto; }
.cal { display: none; }
.cal.show { display: block; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 700; }
.cal-head small { font-size: 12px; color: var(--sub-2); font-weight: 400; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .dow { font-size: 11px; color: var(--sub-2); text-align: center; padding: 4px 0; }
.cal-cell { min-height: 74px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 7px; font-size: 11.5px; }
.cal-cell.dim { opacity: .4; }
.cal-cell.today { border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent); }
.cal-cell .d { font-weight: 700; font-size: 12px; margin-bottom: 3px; }
.cal-chip { display: flex; align-items: center; gap: 5px; border-radius: 6px; padding: 1px 6px;
  margin-bottom: 3px; font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.cal-chip i { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.cal-chip.ok { background: var(--ok-bg); color: var(--ok); } .cal-chip.ok i { background: var(--ok); }
.cal-chip.fail { background: var(--fail-bg); color: var(--fail); } .cal-chip.fail i { background: var(--fail); }
.cal-chip.sched { background: var(--sched-bg); color: var(--sched); } .cal-chip.sched i { background: var(--sched); }
.cal-chip.busy { background: var(--busy-bg); color: var(--busy); } .cal-chip.busy i { background: var(--busy); }
.empty { padding: 40px; text-align: center; color: var(--sub-2); font-size: 13.5px; }

/* 數據分析 */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .n { font-size: 24px; font-weight: 800; }
.kpi .d { font-size: 12px; color: var(--sub); }
.kpi .delta { font-size: 11.5px; color: var(--ok); font-weight: 600; }
.kpi .delta.flat { color: var(--sub); }
.chart-box { height: 240px; padding: 6px 6px 0; }
/* 圖表下方:各頻道每篇平均 */
.chart-foot { display: flex; gap: var(--sp-5); flex-wrap: wrap; padding: 4px 20px 16px; }
.cavg { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--sub); }
.cavg i { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.cavg b { font-size: 14px; font-weight: 700; color: var(--ink); }
.cavg small { color: var(--sub-2); font-size: 11px; }
.post-head .pch { font-size: 11px; color: var(--primary); background: var(--surface-2);
  border-radius: 6px; padding: 1px 8px; }
.post { border-top: 1px solid var(--line); padding: 13px 0; }
.post:first-child { border-top: none; }
.post-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.post-head .pchev { color: var(--sub-2); font-size: 11px; transition: transform .2s var(--ease); flex: none; }
.post.open .pchev { transform: rotate(90deg); }
.post-head h3 { font-size: 14px; font-weight: 700; flex: 1; }
.post-head .tot { font-size: 13px; color: var(--sub); }
.post-head .tot b { color: var(--ink); }
.post-head .when { font-size: 12px; color: var(--sub-2); }
.pd-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--sub);
  padding: 5px 0 0 4px; flex-wrap: wrap; }
.pd-row .nums { margin-left: auto; display: flex; gap: 14px; white-space: nowrap; }
.snap { display: none; margin-top: 10px; background: var(--bg); border: 1px dashed var(--line-2);
  border-radius: var(--radius); padding: 12px 14px; }
.snap.show { display: block; }
.snap-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.snap-sum { color: var(--sub-2); font-size: 11.5px; }
.snap-sum b { color: var(--ink); font-size: 13px; }
.snap-chart { height: 150px; }
.snap .cap { font-size: 11.5px; color: var(--sub-2); margin-top: 8px; }
.arch { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  color: var(--sched); border: 1px solid var(--sched-line); background: var(--sched-bg);
  border-radius: 999px; padding: 1px 10px; }

/* 通知設置 */
.chrow { display: flex; align-items: center; gap: var(--sp-3); padding: 12px 0;
  border-top: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.chrow:first-child { border-top: none; }
.chrow .ic { width: 34px; height: 34px; border-radius: var(--radius); background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex: none; }
.chrow .ic svg { width: 17px; height: 17px; }
.chrow b { font-weight: 600; }
.chrow .d { font-size: 12px; color: var(--sub-2); }
.chrow .sp { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tg-card { background: var(--bg); border: 1px dashed var(--line-2); border-radius: 12px;
  padding: 14px 16px; margin-top: 8px; font-size: 13px; color: var(--sub); }
.evrow { display: flex; align-items: flex-start; gap: var(--sp-3); padding: 11px 0;
  border-top: 1px solid var(--line); }
.evrow:first-child { border-top: none; }
.evrow .txt { flex: 1; }
.evrow b { font-size: 13.5px; font-weight: 600; }
.evrow .hi { font-size: 10.5px; font-weight: 700; color: var(--fail); border: 1px solid var(--fail-line);
  background: var(--fail-bg); border-radius: 999px; padding: 0 8px; margin-left: 6px; }
.evrow .d { font-size: 12px; color: var(--sub-2); }

/* 組織 */
.now { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.now .badge { font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--primary);
  border: 1px solid #dbe7ff; border-radius: 999px; padding: 4px 16px; }
.now small { color: var(--sub-2); font-size: 12px; }
/* 目前方案與用量:迷你卡(單色系——量表不是狀態,不用語意色) */
.ugrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ucard { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ucard .k { font-size: 12px; color: var(--sub); }
.ucard .k small { color: var(--sub-2); font-size: 11px; }
.ucard .v { font-size: 19px; font-weight: 800; margin: 2px 0 9px; line-height: 1.2; color: var(--ink); }
.ucard .v small { font-size: 12px; font-weight: 500; color: var(--sub-2); }
.ucard .track { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ucard .track i { display: block; height: 100%; border-radius: 3px;
  background: color-mix(in srgb, var(--primary) 55%, #ffffff); }   /* 一般:淺主色 */
.ucard.full .track i { background: var(--primary); }               /* 已滿:同色加深,不換色 */
.ucard.full .v { color: var(--primary); }
.ucard.full .k::after { content: "已達上限"; margin-left: 6px; font-size: 10.5px; font-weight: 600;
  color: var(--primary); background: var(--surface-2); border-radius: 999px; padding: 1px 7px; }

.ub { margin-bottom: 14px; }
.ub .lab { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.ub .lab b { font-weight: 600; }
.ub .lab b.warn { color: var(--warn); }
.ub .track { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden;
  border: 1px solid var(--line); }
.ub .track i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.ub .track i.warn { background: var(--warn); }
.promo { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line); flex-wrap: wrap; align-items: center; }
.promo input { flex: 1; min-width: 220px; }
.promo-msg { display: none; font-size: 12.5px; color: var(--ok); font-weight: 600; width: 100%; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp th, .cmp td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: center; }
.cmp th:first-child, .cmp td:first-child { text-align: left; color: var(--sub); font-weight: 400; }
.cmp thead th { font-weight: 700; }
.cmp .cur { background: var(--surface-2); }
.cmp thead .cur { color: var(--primary); }
.curtag { display: inline-block; font-size: 10px; font-weight: 700; color: var(--primary);
  border: 1px solid #dbe7ff; border-radius: 999px; padding: 0 8px; margin-left: 6px; }
.cmp-scroll { overflow-x: auto; }
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: var(--sp-4); }
.bill-cell { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; }
.bill-cell .k { font-size: 11px; color: var(--sub-2); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 4px; }
.bill-cell .v { font-size: 14px; font-weight: 600; }
.inv { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv td { padding: 9px 4px; border-bottom: 1px dashed var(--line); }
.inv td:last-child { text-align: right; }
.inv tr:last-child td { border-bottom: none; }
.auth { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: var(--sp-3); }
.auth.bad { border-color: var(--fail-line); background: #fffafa; }
.auth-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth-head svg { width: 19px; height: 19px; }
.auth-head b { font-size: 14px; }
.auth-head .stb { margin-left: auto; }
.auth-meta { font-size: 12px; color: var(--sub-2); margin: 6px 0 8px; }
.auth-warnline { font-size: 12.5px; margin-bottom: 8px; }
.auth-warnline.f { color: var(--fail); } .auth-warnline.w { color: var(--warn); }
.auth-binds { display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--sub-2); margin-bottom: 10px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 10px; font-size: 12px; color: var(--sub); }
.auth-act { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.lk-danger { font-size: 12.5px; color: var(--sub-2); cursor: pointer; }
.lk-danger:hover { color: var(--fail); }
a.chip:hover { border-color: var(--primary); color: var(--primary); }
.mem { display: flex; align-items: center; gap: var(--sp-3); padding: 11px 0;
  border-top: 1px solid var(--line); font-size: 13.5px; flex-wrap: wrap; }
.mem:first-child { border-top: none; }
.mem .av { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2);
  color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex: none; }
.mem .role { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 10px; }
.mem .role.owner { color: var(--primary); background: var(--surface-2); border: 1px solid #dbe7ff; }
.mem .role.member { color: var(--sub); background: var(--bg); border: 1px solid var(--line); }
.mem .sp { margin-left: auto; font-size: 12.5px; color: var(--sub-2); }
.invite { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.invite input { flex: 1; min-width: 200px; }

/* 我 */
.avrow { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: 18px; }
.avrow .av { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2);
  color: var(--primary); font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; }
.sso-row { display: flex; align-items: center; gap: var(--sp-3); font-size: 13.5px; flex-wrap: wrap; }
.sso-row svg { width: 20px; height: 20px; }
.sso-row .stb { margin-left: auto; }

/* ---------- 管理後台 ---------- */
.logo small { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--sub-2);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; margin-left: 2px; }
/* 後台指標卡:數字 + 對比,不畫無分母的進度條 */
.mgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: var(--sp-5); }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow); }
.mcard .k { font-size: 12px; color: var(--sub); }
.mcard .k small { font-size: 11px; color: var(--sub-2); }
.mcard .v { font-size: 24px; font-weight: 800; line-height: 1.25; margin: 3px 0 4px; }
.mcard .v small { font-size: 13px; font-weight: 600; color: var(--sub-2); }
.mcard .cmp { font-size: 11.5px; color: var(--sub-2); white-space: nowrap; }
.mcard .cmp.up { color: var(--ok); font-weight: 600; }
.mcard .cmp.down { color: var(--fail); font-weight: 600; }
a.mcard { display: block; transition: border-color .15s var(--ease), transform .15s var(--ease); }
a.mcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.alert-panel .phead h2 { color: var(--ink); }
.alert-panel .alert { max-width: 100%; }
.alert-panel .alert span:nth-child(2) { flex: 1; }
.pcell { display: inline-flex; align-items: center; gap: 8px; }
.pcell svg { width: 17px; height: 17px; flex: none; }
/* 平台圖示容器:內容由 js/app.js 的 ICONS 填入,先佔位免得版面跳動 */
.pico { display: inline-flex; width: 17px; height: 17px; flex: none; }
.pico svg { width: 17px; height: 17px; }
.tbl th.num, .tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--sub);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg); }
.tbl .sub2 { font-size: 11.5px; color: var(--sub-2); font-weight: 400; }
.tbl .warn-cell { color: var(--warn); font-weight: 700; }
.tbl .act { white-space: nowrap; text-align: right; }
.tbl .act .lk { color: var(--primary); font-size: 12.5px; font-weight: 600; cursor: pointer; margin-left: 12px; }
.tbl .act .lk.dim { color: var(--sub-2); }
.tbl .act .lk.dim:hover { color: var(--fail); }
/* 分頁列(全站表格共用) */
.pager { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: 14px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--sub); }
.pager .total { margin-right: auto; }
.pager .total b { color: var(--ink); font-weight: 700; }
.pager .pages { display: flex; align-items: center; gap: 5px; }
.pager .pages button { min-width: 30px; height: 30px; padding: 0 8px; font: inherit; font-size: 13px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--sub);
  border-radius: 8px; cursor: pointer; }
.pager .pages button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager .pages button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pager .pages button:disabled { opacity: .4; cursor: not-allowed; }
.pager .jump { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pager .jump input { width: 52px; padding: 5px 8px; text-align: center; font-size: 13px; }
.pager .jump select { width: auto; min-width: 72px; padding: 5px 10px; font-size: 13px; }
/* 框架版的頁碼用 <a>(可直接開新分頁、可複製連結) */
.pager .pages a { min-width: 30px; height: 30px; padding: 0 8px; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface); color: var(--sub); }
.pager .pages a:hover { border-color: var(--primary); color: var(--primary); }
.pager .pages a.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pager .pages a.disabled { opacity: .4; pointer-events: none; }
.pager .per { display: flex; align-items: center; gap: 6px; }
.pager .per select { width: auto; min-width: 72px; padding: 5px 10px; font-size: 13px; }
.pager .per .choices { min-width: 78px; }
.pager .per .choices__inner { padding: 5px 10px !important; font-size: 13px; }

.tbl b.lk-name { cursor: pointer; }
.tbl b.lk-name:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.ud { text-align: left; font-size: 13.5px; }
.ud-r { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0;
  border-bottom: 1px dashed var(--line); }
.ud-r:last-child { border-bottom: none; }
.ud-r span { color: var(--sub-2); }
.ud-act { display: flex; gap: 16px; padding-top: 14px; margin-top: 4px;
  border-top: 1px solid var(--line); }
.ud-act .lk { color: var(--primary); font-size: 13px; font-weight: 600; cursor: pointer; }
.ud-act .lk.dim { color: var(--sub-2); margin-left: auto; }
.ud-act .lk.dim:hover { color: var(--fail); }
.cnt-badge { font-size: 10.5px; font-weight: 600; color: var(--sub-2); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 5px; }
.param-tbl input.pin { width: 76px; padding: 6px 10px; font-size: 13.5px; text-align: center; }
.param-tbl input.pin.dirty { border-color: var(--primary); background: var(--surface-2);
  color: var(--primary); font-weight: 700; }
.param-tbl .grp-row td { background: var(--bg); font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--sub-2); padding: 7px 16px; }

/* 登入頁:提醒「登入」與「社群授權」是兩件事 */
.login-note { font-size: 11.5px; color: var(--sub-2); line-height: 1.75; margin-top: 14px;
  padding-top: 14px; border-top: 1px dashed var(--line); }

/* 後台 · 系統參數 */
.set-tbl .setcell { white-space: nowrap; }
.set-tbl .unit { font-size: 11.5px; color: var(--sub-2); margin-left: 6px; }
.set-tbl .tgl.dirty i { background: var(--primary); }

/* 後台 · 通知模板 */
.tpl .phead { flex-wrap: wrap; }
.tpl-ch { display: flex; gap: 14px; margin-left: auto; }
.ch-box { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sub); cursor: pointer; }
.ch-box.locked { color: var(--sub-2); cursor: default; }
.ch-box input { width: 15px; height: 15px; accent-color: var(--primary); }
.tpl textarea { width: 100%; font: inherit; font-size: 13px; line-height: 1.75;
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 13px;
  outline: none; resize: vertical; background: var(--surface); color: var(--ink); }
.tpl textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.tpl-vars code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  background: var(--surface-2); color: var(--primary); border-radius: 5px; padding: 2px 7px; }
.tpl-act { display: flex; gap: var(--sp-2); justify-content: flex-end;
  border-top: 1px solid var(--line); padding-top: 14px; }
/* 同一時機的多個渠道各自一個表單,彼此用虛線分隔 */
.tpl-one + .tpl-one { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.tpl-ch-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

/* 平台編號:公開識別,要能一眼看到並複製 */
.usercode-box { display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; }
.usercode-box code { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px; font-weight: 600; letter-spacing: .06em; color: var(--ink); }

/* 授權列(組織 › 帳號與授權) */
.authrow { display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 16px 18px; border-bottom: 1px solid var(--line); }
.authrow:last-child { border-bottom: none; }
.auth-dests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 開發用模擬登入的帳號列(僅 local) */
.dev-user { width: 100%; display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px 18px; border: none; border-bottom: 1px solid var(--line);
  background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.dev-user:hover:not(:disabled) { background: var(--surface-2); }
.dev-user:disabled { opacity: .5; cursor: not-allowed; }
.dev-user-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dev-user-main b { font-size: 14px; }

/* 後台 · 金流設置 */
.env-badge { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 5px 11px;
  border-radius: 999px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.gw { display: flex; align-items: flex-start; gap: var(--sp-3); padding: 14px 0;
  border-bottom: 1px solid var(--line); }
.gw:last-child { border-bottom: none; }
.gw-pick { flex: none; padding-top: 2px; }
.gw-pick input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.gw-main { flex: 1; }
.gw-main b { font-size: 14px; }
.gw-note { font-size: 11.5px; color: var(--sub-2); margin-left: 8px; }
.gw.on .gw-note { color: var(--ok); font-weight: 600; }
.gw-fields { font-size: 12px; color: var(--sub-2); margin-top: 4px; }
.gw-side { flex: none; text-align: right; display: flex; flex-direction: column; gap: 4px; }
.gw-side .sub2 { font-size: 11.5px; color: var(--sub-2); }
.gw-side .lk { color: var(--primary); font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: none; border: none; font-family: inherit; padding: 0; }

/* 後台 · 系統監控 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.mcard .cmp b.over { color: var(--warn); font-weight: 700; }
.orphan { font-size: 13.5px; color: var(--sub); margin-bottom: 4px; }
.orphan b { font-size: 26px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; margin-right: 4px; }

/* 後台 · 平台管理 */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: var(--sp-4); }
.prov { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden; }
.prov.off { opacity: .72; }
.prov.off .prov-head { background: var(--bg); }
.prov-head { display: flex; align-items: center; gap: var(--sp-3); padding: 14px 16px;
  border-bottom: 1px solid var(--line); }
.prov-head .pcell { flex: 1; }
.prov-body { padding: 14px 16px 16px; }
.prov-row { display: flex; gap: 12px; font-size: 12.5px; padding: 6px 0;
  border-bottom: 1px dashed var(--line); }
.prov-row span { color: var(--sub-2); flex: none; width: 76px; }
.prov-row b { font-weight: 500; color: var(--ink); }
.prov-row.wrap b { color: var(--sub); line-height: 1.65; }
.prov-quota { margin-top: 14px; }
.pq-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub-2); margin-bottom: 6px; }
.pq-top b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pq-bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.pq-bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.pq-bar i.hot { background: var(--warn); }
.prov-foot { display: flex; align-items: center; gap: var(--sp-3); margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.prov-foot .mono-code { flex: 1; font-size: 11.5px; color: var(--sub-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.prov-foot .lk { flex: none; color: var(--primary); font-size: 12.5px; font-weight: 600;
  cursor: pointer; background: none; border: none; font-family: inherit; }
.mono-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--surface-2); color: var(--primary); border-radius: 6px; padding: 2px 8px; }

/* 規劃中 */
.vision { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 26px; margin-bottom: var(--sp-5); scroll-margin-top: 20px; }
.vision .tag { display: inline-flex; font-size: 11px; font-weight: 700; color: var(--primary);
  background: var(--surface-2); border: 1px solid #dbe7ff; border-radius: 999px;
  padding: 1px 12px; margin-bottom: 10px; }
.vision h2 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.vision p { font-size: 13.5px; color: var(--sub); margin-bottom: 10px; }
.vision ul { margin: 0 0 12px 18px; font-size: 13px; color: var(--sub); }
.vision li { margin-bottom: 4px; }
.vision .why { font-size: 12px; color: var(--sub-2); border-top: 1px dashed var(--line); padding-top: 10px; }

/* 登入 / 入門(無側欄頁) */
.topnav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topnav-in { max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; }
.topnav .logo { padding: 0; border: none; margin: 0; }
.topnav .back { font-size: 12px; color: var(--sub-2); }
.stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.stage.top { align-items: flex-start; padding-top: 48px; padding-bottom: 80px; }
.login-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow); padding: 36px 32px; text-align: center; }
.login-box h1 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.login-box .sub { font-size: 13px; color: var(--sub); margin-bottom: 26px; }
.sso { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px; margin-bottom: var(--sp-3); border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background .15s var(--ease); }
.sso:hover { background: var(--bg); }
.sso svg { width: 19px; height: 19px; flex: none; }
.terms { font-size: 11.5px; color: var(--sub-2); margin-top: 18px; line-height: 1.7; }
.terms a { color: var(--sub); text-decoration: underline; }
.demo-note { margin-top: 22px; padding-top: var(--sp-4); border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--sub-2); }
.demo-note a { color: var(--primary); font-weight: 600; }
.obx { width: 100%; max-width: 600px; }
.prog { margin-bottom: 22px; }
.prog .lbl { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--sub-2);
  text-transform: uppercase; margin-bottom: 8px; }
.prog .bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--primary); border-radius: 2px;
  transition: width .3s var(--ease); }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 28px 28px 24px; }
.qcard h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.qcard .qh { font-size: 13px; color: var(--sub); margin-bottom: var(--sp-5); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; gap: var(--sp-3); padding: 13px 16px; background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font: inherit; color: inherit;
  width: 100%; text-align: left; transition: border-color .15s var(--ease); }
.opt:hover { border-color: var(--line-2); }
.opt.sel { border-color: var(--primary); background: var(--surface-2); }
.opt .dot { width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 50%;
  flex: none; position: relative; }
.opt.multi .dot { border-radius: 5px; }
.opt.sel .dot { border-color: var(--primary); }
.opt.sel .dot::after { content: ""; position: absolute; inset: 3px; background: var(--primary);
  border-radius: 50%; }
.opt.multi.sel .dot::after { border-radius: 2px; }
.opt b { font-weight: 500; }
.qfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; }
.backlink { font-size: 13px; color: var(--sub-2); cursor: pointer; background: none; border: none; font: inherit; }
.backlink:hover { color: var(--sub); }
.backlink[disabled] { visibility: hidden; }

/* ---------- 5. 行銷首頁 ---------- */
.mkt-nav { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.mkt-nav .in { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 28px; }
.mkt-nav .links { display: flex; gap: 22px; font-size: 14px; color: var(--sub); }
.mkt-nav .links a:hover { color: var(--ink); }
.mkt-nav .cta { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
.mkt-nav .back { font-size: 12.5px; color: var(--sub-2); }
/* .logo 基底是側欄用(帶下墊距+底線),行銷列要歸零,否則 logo 在 64px 列裡上浮
   (v9 原版漏了這條,topnav/topbar 都有對應覆寫) */
.mkt-nav .logo { padding: 0; border: none; margin: 0; }
.mkt-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.hero { position: relative; padding: 84px 0 60px; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: 13px; font-weight: 600;
  color: var(--primary); background: var(--surface-2); border: 1px solid #dbe7ff;
  border-radius: 999px; padding: 5px 14px; margin-bottom: var(--sp-5); }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); font-weight: 900; line-height: 1.22; }
.hero h1 .b { color: var(--primary); }
.hero .sub { font-size: 17px; color: var(--sub); margin: 18px 0 30px; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero-cta small { color: var(--sub-2); font-size: 13px; width: 100%; }
.hero-vis { position: relative; min-height: 420px; }
#matrix3d { width: 100%; height: 460px; display: block; }
.vis-cap { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  font-size: 12px; color: var(--sub-2); white-space: nowrap; }
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.strip .in { max-width: 1120px; margin: 0 auto; padding: 26px 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); text-align: center; }
.strip .n { font-weight: 800; font-size: 26px; }
.strip .n em { color: var(--primary); font-style: normal; }
.strip .d { font-size: 13px; color: var(--sub); }
.mkt-sec { padding: 88px 0 0; }
.sec-head { max-width: 640px; margin-bottom: 44px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--primary);
  text-transform: uppercase; margin-bottom: 10px; }
.mkt-sec h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; line-height: 1.35; }
.sec-head p { color: var(--sub); margin-top: var(--sp-3); font-size: 15.5px; }
.mkt-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.mkt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 24px; box-shadow: var(--shadow); }
.mkt-card .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-4); }
.mkt-card .ic svg { width: 21px; height: 21px; stroke: var(--primary); }
.mkt-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.mkt-card p { font-size: 14px; color: var(--sub); }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 44px; box-shadow: var(--shadow); }
.flow-demo { display: flex; flex-direction: column; gap: var(--sp-3); }
.fd-row { display: flex; align-items: center; gap: var(--sp-3); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.fd-row .tag { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--surface-2);
  border-radius: 6px; padding: 2px 9px; flex: none; }
.fd-row .tm { margin-left: auto; font-size: 12.5px; color: var(--sub-2); white-space: nowrap; }
.fd-row.dashed { border-style: dashed; color: var(--sub-2); }
.flow-txt h2 { margin-bottom: 14px; }
.flow-txt p { color: var(--sub); margin-bottom: var(--sp-3); }
.flow-txt .pt { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; margin-bottom: 10px; }
.flow-txt .pt svg { width: 18px; height: 18px; stroke: var(--ok); flex: none; margin-top: 3px; }
.honest { background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 36px 40px; box-shadow: var(--shadow); }
.hn-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4);
  flex-wrap: wrap; margin-bottom: 18px; }
.hn-head h3 { font-size: 16.5px; font-weight: 700; }
.hn-sum { font-size: 14px; font-weight: 600; }
.hn-sum .g { color: var(--ok); } .hn-sum .r { color: var(--fail); }
.hn-row { display: flex; align-items: center; gap: var(--sp-3); padding: 11px 0;
  border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.hn-row .plat { display: inline-flex; align-items: center; gap: var(--sp-2);
  min-width: 220px; font-weight: 500; }
.hn-row .plat svg { width: 16px; height: 16px; flex: none; }
.hn-row .tm { margin-left: auto; font-size: 12.5px; color: var(--sub-2); }
.hn-note { margin-top: var(--sp-4); font-size: 13px; color: var(--sub); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.mkt-cta { margin: 96px 0 0; padding: 0 0 96px; }
.cta-box { background: linear-gradient(135deg, var(--invert-bg), var(--primary) 55%, #4f8bff);
  border-radius: 24px; padding: 56px 48px; text-align: center; color: var(--invert-ink);
  box-shadow: var(--shadow-lg); }
.cta-box h2 { color: var(--invert-ink); }
.cta-box p { color: var(--invert-sub); margin: var(--sp-3) auto 28px; max-width: 520px; }
.btn-white { background: #fff; color: var(--primary); box-shadow: 0 4px 18px -4px rgba(0,0,0,.25); }
.btn-white:hover { background: var(--surface-2); }
.mkt-foot { border-top: 1px solid var(--line); padding: 28px 0 44px;
  font-size: 13px; color: var(--sub-2); }
.mkt-foot .in { max-width: 1120px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.foot-legal { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-legal a:hover { color: var(--ink); }

/* ---------- 5b. 法務頁(隱私政策 / 使用條款 / 資料刪除說明) ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 34px 24px 56px; }
.legal-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 26px; }
.legal-tabs a { font-size: 13px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--sub); }
.legal-tabs a:hover { border-color: var(--line-2); color: var(--ink); }
.legal-tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.legal h1 { font-size: 30px; letter-spacing: -.01em; }
.legal-meta { font-size: 12.5px; color: var(--sub-2); margin-top: 6px; }
.legal-lead { font-size: 14.5px; color: var(--sub); line-height: 1.85; margin-top: 20px;
  padding: 16px 18px; background: var(--surface-2); border-radius: 12px; }
.legal section { margin-top: 34px; }
.legal h2 { font-size: 17px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.legal p { line-height: 1.9; margin-bottom: 12px; font-size: 14px; }
.legal ul { margin: 0 0 12px 20px; }
.legal li { line-height: 1.9; margin-bottom: 7px; font-size: 14px; }
.legal p a, .legal li a, .legal td a { color: var(--primary);
  text-decoration: underline; text-underline-offset: 3px; }
.legal code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.legal-tbl { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 13.5px; }
.legal-tbl th { text-align: left; font-size: 12px; color: var(--sub-2); font-weight: 600;
  padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.legal-tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line);
  line-height: 1.75; vertical-align: top; }
.legal-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.85; margin: 12px 0; }
.legal-note-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.legal-warn { background: var(--fail-bg); border: 1px solid var(--fail-line); border-radius: 12px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.85; }
/* 待填欄位:上線前必須全部清掉(送審方會看到) */
.fill { background: var(--warn-bg); border: 1px dashed var(--warn-line); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px; color: var(--warn); }
.legal-end { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--sub-2); }
.legal-end-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.legal-end-links a:hover { color: var(--ink); }

/* ---------- 6. 套件皮(SweetAlert2 / Choices.js) ---------- */
.ui-pop { font-family: var(--sans) !important; border-radius: var(--radius-lg) !important;
  padding: 22px 22px 20px !important; box-shadow: 0 24px 64px -16px rgba(22,32,46,.35) !important;
  width: auto !important; max-width: 460px !important; }
.ui-pop .swal2-title { font-size: 17px !important; font-weight: 700 !important;
  color: var(--ink) !important; padding: 0 0 6px !important; }
.ui-pop .swal2-html-container { font-size: 13.5px !important; color: var(--sub) !important;
  line-height: 1.7 !important; margin: 0 !important; text-align: left !important; }
.ui-pop .swal2-actions { gap: 10px !important; margin-top: 18px !important; width: 100% !important;
  justify-content: flex-end !important; }
.ui-pop .swal2-input { font: inherit !important; font-size: 14px !important;
  border: 1px solid var(--line-2) !important; border-radius: var(--radius) !important;
  box-shadow: none !important; margin: 14px 0 0 !important; }
/* 彈窗內的原生 select 套成與站內元件同一副皮(Choices 在彈窗內會被容器裁切,故不接管) */
.ui-pop .swal2-select { font: inherit !important; font-size: 14px !important; color: var(--ink) !important;
  width: 100% !important; margin: 14px 0 0 !important; padding: 10px 36px 10px 13px !important;
  border: 1px solid var(--line-2) !important; border-radius: var(--radius) !important;
  background: var(--surface) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b7e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 15px !important;
  -webkit-appearance: none; appearance: none; cursor: pointer; }
.ui-pop .swal2-select:focus { outline: none !important; border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.14) !important; }
.ui-pop .swal2-validation-message { background: var(--fail-bg) !important;
  color: var(--fail) !important; font-size: 12.5px !important; }
/* 套件預設 focus 是黑色粗框,換成主色細環 */
.ui-pop button:focus-visible { outline: none !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.28) !important; }
.ui-pop button:focus:not(:focus-visible) { box-shadow: none !important; }
div:where(.swal2-container).swal2-backdrop-show { background: rgba(22,32,46,.4) !important; }

.choices { margin-bottom: 0; }
.choices__inner { background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius); min-height: auto;
  padding: 10px 12px !important;  /* 與 input(10px 內距)同高 45px */
  font-size: 14px; }
.choices__list--single { padding: 0 20px 0 0; color: var(--ink); }
.choices.is-focused .choices__inner, .choices.is-open .choices__inner {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.choices.is-open .choices__inner { border-radius: var(--radius); }
.choices__list--dropdown, .choices__list[aria-expanded] { border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px -10px rgba(22,32,46,.22);
  margin-top: 6px; z-index: 70; overflow: hidden; padding: 6px; background: var(--surface); }
.choices__list--dropdown .choices__item, .choices__list[aria-expanded] .choices__item {
  font-size: 13.5px; padding: 8px 12px; color: var(--sub); border-radius: 8px; }
/* 往上翻(is-flipped)時,蓋回套件預設的方角與 -1px 貼合 */
.choices.is-flipped .choices__list--dropdown,
.choices.is-flipped .choices__list[aria-expanded] {
  border-radius: 12px; margin-top: 0; margin-bottom: 6px; }
/* 長清單捲軸修圓(時/分下拉等) */
.choices__list--dropdown .choices__list { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.choices__list--dropdown .choices__list::-webkit-scrollbar { width: 8px; }
.choices__list--dropdown .choices__list::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 99px; border: 2px solid var(--surface); }
.choices__list--dropdown .choices__list::-webkit-scrollbar-track { background: transparent; margin: 4px 0; }
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: var(--surface-2); color: var(--primary); }
.choices[data-type*=select-one]::after { border-color: var(--sub) transparent transparent; right: 12px; }
.choices[data-type*=select-one].is-open::after {
  border-color: transparent transparent var(--sub); margin-top: -6px; }
.filter-bar .choices { min-width: 170px; }

/* ============================================================
   @media 全部集中最底部(playbook 04 鐵律:必須在 base 之後)
   斷點:900(側欄收合/漢堡)/640(細部)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .stb.busy i { animation: none; }
  .help.open .help-pop { animation: none; }
}

@media (max-width: 900px) {
  /* 外殼:側欄 → 頂欄 + 底部 Tab */
  .side { display: none; }
  .shell { display: block; }
  .topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center;
    justify-content: space-between; height: 52px; padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); }
  .topbar .logo { padding: 0; border: none; margin: 0; font-size: 16px; }
  .topbar .tb-logout { font-size: 12.5px; color: var(--sub); }
  body { padding-bottom: 74px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border-top: 1px solid var(--line); backdrop-filter: blur(10px);
    padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 0 7px; font-size: 10.5px; font-weight: 500; color: var(--sub-2); }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a.on { color: var(--primary); }
  .wrap { width: 100%; max-width: 100%; padding: 0 18px; }
  .page-head { padding: 22px 0 14px; }
  .grid2 { grid-template-columns: 1fr; }
  .help-pop { left: auto; right: -12px; transform: none; }
  .help-pop::before { left: auto; right: 14px; transform: rotate(45deg); }
  /* 頁面模組 */
  .ch-grid { grid-template-columns: 1fr; }
  .stat-row { gap: 8px; }
  .stat { padding: 12px; } .stat .n { font-size: 20px; }
  .nextrow .tm { margin-left: 0; width: 100%; }
  .bindrow .sp { margin-left: 0; width: 100%; justify-content: space-between; }
  .plat-grid { grid-template-columns: 1fr; }
  .pubbar-in { padding: 10px 18px; gap: 10px; }
  .pubbar .sum { font-size: 12.5px; width: 100%; }
  .pubbar .btn-lg { margin-left: 0; width: 100%; padding: 11px; }
  .view-tgl { margin-left: 0; }
  .trow .sp { margin-left: 0; width: 100%; }
  .cal-cell { min-height: 58px; }
  .kpis { grid-template-columns: 1fr; }
  .pd-row .nums { margin-left: 0; width: 100%; }
  .cmp-row { flex-wrap: wrap; }
  .cmp-row .bar { order: 3; width: 100%; flex: none; }
  .cmp-row .val { margin-left: auto; }
  .chrow .sp { margin-left: 0; width: 100%; justify-content: flex-end; }
  .bill-grid { grid-template-columns: 1fr; }
  .ugrid { grid-template-columns: 1fr 1fr; }
  .mgrid { grid-template-columns: 1fr 1fr; }
  .auth-head .stb { margin-left: 0; }
  .mem .sp { margin-left: 0; width: 100%; }
  /* 行銷 */
  .mkt-nav .links { display: none; }
  .hero { padding: 52px 0 30px; }
  .hero-in { grid-template-columns: 1fr; gap: var(--sp-2); }
  .hero-vis { min-height: 320px; }
  #matrix3d { height: 320px; }
  .strip .in { grid-template-columns: 1fr; gap: 14px; }
  .mkt-cards { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; padding: 28px 22px; }
  .honest { padding: 24px 18px; }
  .hn-row .tm { margin-left: 0; width: 100%; }
  .cta-box { padding: 40px 22px; }
}

@media (max-width: 640px) {
  .types { gap: 8px; }
  .type { padding: 12px 8px; font-size: 13px; }
  .obx .qcard { padding: 22px 18px; }
}

/* 數據分析 · 貼文成效(逐目的地) */
.post-metric { border-bottom: 1px solid var(--line); }
.post-metric:last-child { border-bottom: none; }
.metric-rows { padding: 0 18px 14px; }
.metric-row { display: flex; align-items: center; gap: var(--sp-3);
  padding: 8px 0; border-top: 1px dashed var(--line); font-size: 13.5px; }
.metric-row .mv { min-width: 78px; text-align: right; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.metric-row .mv small { font-weight: 400; color: var(--sub-2); font-size: 11px; margin-left: 4px; }
.post-metric .post-sum { margin-left: auto; font-size: 12.5px; color: var(--sub); }
