/* 元編輯後台。站台編輯區（.ed-site）的樣子與位置跟前台 public/site.css 一致，兩邊一起改。 */
:root {
  --bg: #eff3f8; --text: #2f3d4a; --muted: #7b8794; --line: #e1e7ed;
  --primary: #337ab7; --danger: #c0392b; --bar: #364150; --bar-hover: #3f4e5e; --bar-text: #c9d5e0;
  /* Callwork 測試站（2026-11-27）：卡片上緣與徽章用這一個顏色，跟一般站台的主色分開 */
  --mirror: #d98326;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.6 "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 24px; margin: 0; font-weight: 600; }
h3 { font-size: 16px; margin: 0; font-weight: 600; }
input { font: inherit; color: inherit; background: #fff; border: 1px solid #c2cad8; border-radius: 4px; padding: 7px 10px; width: 100%; min-width: 0; }
input[type=checkbox] { width: auto; }
input[type=color] { width: 54px; height: 38px; padding: 2px; }
input:focus { outline: none; border-color: #7f9cc0; box-shadow: 0 0 0 3px rgba(51,122,183,.15); }
/* 表單裡的下拉選單（2026-11-27）：瀏覽器原生的樣子跟上面那些 input 對不起來
   （字級、外框、高度都不一樣），所以在 .field 裡的 select 比照 input 畫一次，
   箭頭自己畫（appearance:none 會把原生箭頭一起拿掉）。 */
.field select { font: inherit; color: inherit; background: #fff; border: 1px solid #c2cad8; border-radius: 4px; padding: 7px 30px 7px 10px; width: 100%; min-width: 0; height: 36px; line-height: 1.4; cursor: pointer;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%237c8a99' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 10px 6px; }
.field select:focus { outline: none; border-color: #7f9cc0; box-shadow: 0 0 0 3px rgba(51,122,183,.15); }
.field select:disabled { background-color: #f2f5f8; color: var(--muted); cursor: default; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; align-items: flex-end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid #c2cad8; background: #fff; color: var(--text); padding: 7px 16px; border-radius: 4px; cursor: pointer; font: inherit; white-space: nowrap; }
.btn:hover { background: #f4f6f9; }
.btn.primary { background: var(--primary); border-color: #2e6da4; color: #fff; }
.btn.primary:hover { background: #286090; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-text { border-color: transparent; color: var(--danger); margin-right: auto; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 12px; font-size: 14px; }
.btn.xs { padding: 2px 8px; font-size: 13px; }
.btn.lg { padding: 10px 24px; font-size: 16px; }
.btn.block { display: flex; width: 100%; margin-top: 12px; padding: 10px; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; padding: 4px 8px; }
.badge { display: inline-block; padding: 0 8px; border-radius: 3px; background: #eaf2fa; color: var(--primary); font-size: 12.5px; font-weight: 600; }

/* 後台自己的頂欄（很薄，讓下面的站台編輯區看起來跟前台一樣） */
.topbar { background: #1f2933; color: #c9d5e0; }
.topbar-row { display: flex; align-items: center; gap: 18px; min-height: 46px; }
.logo { color: #fff; font-weight: 700; font-size: 17px; }
.logo-mark { color: #60a5fa; }
.top-link { color: #c9d5e0; }
.top-link:hover { color: #fff; }
/* 左上角名稱旁邊的鉛筆＋就地改名的輸入框 */
.logo-pen { border: 0; background: none; color: inherit; opacity: .55; cursor: pointer; font: inherit; font-size: 13px; padding: 2px 4px; margin-left: -12px; }
.logo-pen:hover { opacity: 1; }
.logo-pen[hidden] { display: none; }
.logo-editbox { display: flex; align-items: center; gap: 8px; }
.logo-editbox .top-btn { padding: 3px 10px; }
.logo-edit { font: inherit; font-weight: 700; font-size: 17px; color: #fff; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.5); border-radius: 4px; padding: 2px 8px; width: min(260px, 40vw); }
.me { display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.me .btn { background: transparent; color: #c9d5e0; border-color: #4b5866; }

/* 站台列表上面那一排系統（老闆 2026-11-27：系統不能只出現在頁首；同日又說頁首連下拉選單都不用了，
   所以系統只在這一排）＋「＋ 新增系統」「⚙ 管理系統」 */
.sys-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.sys-tab { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; cursor: pointer; text-decoration: none; }
.sys-tab:hover { border-color: var(--primary); color: var(--primary); }
.sys-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.sys-tab-n { font-size: 12px; opacity: .7; }
.sys-tab.on .sys-tab-n { opacity: .85; }
/* 「＋ 新增系統」就接在最後一顆頁籤右邊（老闆 2026-11-27）；只有「⚙ 管理系統」推到最右邊 */
.sys-tab.add { border-style: dashed; color: var(--primary); border-color: var(--primary); }
.sys-tab.gear { color: var(--muted); margin-left: auto; }
/* 頁籤本身可以拖拉調順序：拖著走的時候半透明（跟卡片、導覽同一款） */
.sys-tabs { -webkit-user-select: none; user-select: none; }
.sys-tab.dragging { opacity: .5; outline: 2px dashed var(--primary); outline-offset: -2px; }
/* 站台卡片拖到系統上＝移到那個系統 */
.sys-tab.drop { background: #eaf2fa; border-color: var(--primary); border-style: dashed; box-shadow: 0 0 0 3px rgba(51,122,183,.15); }
/* 站台設定裡的「外部站台網址」那一塊 */
.ext-box { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 12px; background: #fbfcfe; }
.ext-box .hint { margin: -2px 0 2px; }
/* 卡片上的「系統：[選單]」＝換系統（老闆 2026-11-27：不要開視窗，選了馬上搬） */
.site-sys { display: flex; align-items: center; gap: 6px; }
.site-sys-sel { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; color: var(--text); background: #fff;
  border: 1px solid #c2cad8; border-radius: 4px; padding: 4px 8px; cursor: pointer; }
.site-sys-sel:disabled { opacity: .6; }
/* 系統分類的維護視窗 */
.sys-list { display: flex; flex-direction: column; gap: 8px; }
.sys-row { display: flex; align-items: center; gap: 8px; }
.sys-row .sys-fields { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.sys-row .sys-fields input { width: 100%; }
.sys-row .sys-name { font-weight: 600; }
.sys-move { display: flex; flex-direction: column; gap: 2px; }
.sys-count { white-space: nowrap; }
.btn.sys-del { border-color: transparent; color: var(--danger); }
.sys-add { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 2px; }

.page { padding-top: 28px; padding-bottom: 80px; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-title p { margin: 4px 0 0; }
/* 站台列表的標題＝現在選到的系統，後面接一行小字「站台列表」 */
.title-sub { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 10px; }
/* 卡片上的「網址」：記交付給客戶的站的網址（後台可點，前台行為不變） */
.nvcs-urlrow { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.nvcs-url { flex: 1; min-width: 0; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.nvcs-url:focus { color: var(--text); }
.nvcs-urlgo { visibility: hidden; color: var(--primary); text-decoration: none; padding: 0 2px; }
.nvcs-urlgo.on { visibility: visible; }

/* 站台列表：右上角兩顆（匯入客戶站／新增站台） */
.page-title-actions { display: flex; gap: 8px; align-items: center; }
/* 交付給客戶的站：自己一個資料庫，卡片上角標「客戶站」 */
.site-card.client { border-style: dashed; }
.site-card h3 .badge { margin-left: 8px; vertical-align: middle; font-weight: 600; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-card { position: relative; overflow: hidden; display: grid; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 20px; color: var(--text); }
.site-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.site-card-bar { position: absolute; inset: 0 0 auto 0; height: 5px; }
.site-card-top { display: flex; gap: 12px; align-items: center; }
.site-card p { margin: 2px 0 0; }
.site-card .btn { margin-top: 4px; }
/* 拖拉調換站台順序：卡片裡的字不要被拖出一片反藍（卡片本身是連結，選字沒有用處） */
.site-card { -webkit-user-select: none; user-select: none; }
/* 拖著走的時候的樣子：跟導覽那一排的 .item.dragging 同一款（半透明＋虛線框） */
.site-card.dragging { opacity: .5; outline: 2px dashed var(--primary); outline-offset: -2px; }
.site-logo { width: 44px; height: 44px; border-radius: 6px; object-fit: contain; flex: none; }
.site-logo.ph { display: grid; place-items: center; background: #eaf2fa; color: var(--primary); font-weight: 700; font-size: 20px; }
.empty-card { background: #fff; border: 1px dashed #c2cad8; border-radius: 4px; padding: 48px; text-align: center; color: var(--muted); }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field-label { font-weight: 600; font-size: 14px; color: #44515e; }
.hint { color: var(--muted); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.logo-box { width: 64px; height: 38px; border: 1px dashed #c2cad8; border-radius: 4px; display: grid; place-items: center; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; }

/* Callwork 測試站（2026-11-27 老闆：「卡片上緣的顏色要區別，兩種中間有分隔線」）：
   自己一區，上面一條分隔線＋小標；卡片上緣不吃站台主色，固定用 --mirror。 */
.site-group { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.site-group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.site-group-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.site-group-name::before { content: ''; width: 14px; height: 5px; border-radius: 3px; background: var(--mirror); }
.site-card.mirror .site-card-bar { background: var(--mirror) !important; }
.badge.mirror { background: #fdf0e0; color: #a35f12; }

/* 站台編輯：上方工具列
   老闆 2026-11-27：加了「元編輯定義」之後按鈕排不下，「前台」那顆掉到第二行 ⇒ 間距與左右內距縮一點，
   而且**只讓站名和提示文字被擠**（flex: none 的按鈕一律不縮、不換行），擠不下就縮成「…」。 */
.toolbar { display: flex; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 10px;
  /* 老闆 2026-11-27（縮間距還是會換行）⇒ 乾脆**永遠不換行**：擠不下先縮文字，再擠不下就左右捲，
     就是不准掉到第二行（頁首高度不可以變）。捲軸壓在內距裡，所以有沒有捲軸高度都一樣。 */
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.toolbar::-webkit-scrollbar { height: 6px; }
.toolbar::-webkit-scrollbar-thumb { background: #c7d0dc; border-radius: 3px; }
.toolbar > .btn, .toolbar > .page-switch { flex: none; }
.toolbar .btn.sm { padding: 4px 10px; }
.toolbar-title { font-weight: 700; font-size: 17px; flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-hint { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 站台編輯區：跟前台一樣的五層位置 ===== */
.ed-site { background: #eff3f8; padding-bottom: 60px; }
.ed-head { background: #fff; }
.ed-head-row { display: flex; align-items: center; gap: 24px; min-height: 64px; padding-top: 4px; padding-bottom: 4px; }
.ed-brand { font-weight: 700; font-size: 21px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ed-brand img { height: 36px; }
.ed-rows { flex: 1; min-width: 0; }
.nav-area, .nav-sub-area { display: flex; justify-content: flex-end; padding: 3px 0; line-height: 1.4; }
.ed-colorbar { height: 5px; background: var(--primary); }
.ed-bar { background: var(--bar); min-height: 46px; }

.lv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav-area .lv-row, .nav-sub-area .lv-row { justify-content: flex-end; }
.lv-row.vertical { flex-direction: column; align-items: stretch; gap: 0; }
.item { display: inline-flex; align-items: center; gap: 6px; position: relative; user-select: none; touch-action: none; cursor: pointer; text-decoration: none; }
.item.dragging { opacity: .5; outline: 2px dashed var(--primary); }
.item-tools { display: inline-flex; gap: 2px; margin-left: 2px; }
.tool { padding: 0 4px; border-radius: 3px; font-size: 12px; opacity: .8; }
.tool:hover { opacity: 1; background: rgba(255,255,255,.3); }

/* 第1層：頁首右側上排 */
.nav-item { font-size: .95em; padding: 3px 12px; border-radius: 3px; color: #44515e; font-weight: 600; }
.nav-item:hover { background: #eef1f5; }
.nav-item.on { background: var(--primary); color: #fff; }
/* 第2層：頁首右側下排 */
.nav-sub-item { font-size: .9em; padding: 2px 10px; color: #6b7785; border-bottom: 2px solid transparent; }
.nav-sub-item:hover { color: var(--primary); }
.nav-sub-item.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.nav-sub-item .tool:hover { background: #eef1f5; }
/* 第3層：深色列 */
.bar-a { padding: 12px 18px; color: var(--bar-text); font-weight: 600; }
.bar-a:hover { background: var(--bar-hover); color: #fff; }
.bar-a.on { background: var(--primary); color: #fff; }
.bar-a .caret { font-size: 11px; opacity: .7; }
/* 第4層往下、第5層往右（像前台的下拉選單，但點選後固定展開方便編輯） */
.ed-drop { min-height: 8px; position: relative; }
.ed-holder { display: inline-flex; align-items: flex-start; }
/* 有滑鼠的電腦：跟前台一樣滑過第3層才浮出第4、5層，蓋在內容上面（2026-11-25） */
.ed-drop.hover .ed-holder { position: absolute; top: 0; left: 0; z-index: 40; }
.ed-col { background: #fff; min-width: 220px; padding: 6px 0; box-shadow: 0 8px 24px rgba(0,0,0,.15); border-radius: 0 0 4px 4px; }
.ed-col.sub { border-radius: 4px; }
.dd-a { padding: 8px 18px; color: var(--text); justify-content: flex-start; }
.dd-a:hover { background: #f4f6f9; color: var(--primary); }
.dd-a.on { background: var(--primary); color: #fff; }
.dd-a .item-tools { margin-left: auto; padding-left: 12px; }
.dd-a .arrow { flex: 0 0 10px; margin-left: 22px; text-align: right; opacity: .6; }

/* 新增按鈕：跟該層長得一樣，只是虛線 */
.add { font: inherit; cursor: pointer; background: transparent; border: 1px dashed #b6c0ca; color: var(--primary); border-radius: 3px; }
.add.nav-item, .add.nav-sub-item { padding: 1px 10px; margin-left: 4px; }
.add.bar-a { border-color: #5b6b7d; color: #c9d5e0; padding: 6px 14px; margin: 0 6px; }
.add.dd-a { margin: 4px 10px 2px; padding: 4px 10px; justify-content: center; }
.inline-form { display: inline-flex; gap: 4px; align-items: center; padding: 3px 4px; }
.inline-form input { width: 170px; padding: 3px 8px; font-size: 14px; }
.ed-bar .inline-form { padding: 6px; }
.lv-row.vertical .inline-form { padding: 4px 10px; flex-wrap: wrap; }
.lv-row.vertical .inline-form input { width: 100%; }
.hint-row { color: var(--muted); font-size: 13px; text-align: right; width: 100%; }
.hint-row.dark { color: #8fa1b3; text-align: left; padding: 12px 6px; }

/* 導覽下方：編號 */
.code-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px 16px; margin-top: 14px; }
.code-lv { background: #eef1f5; color: #44515e; border-radius: 3px; padding: 1px 8px; font-size: 13px; }
.code-name { font-size: 16px; }
.code-tip { flex-basis: 100%; margin-top: -6px; color: #6b7785; font-size: 14px; line-height: 1.6; white-space: pre-line; }
.code-tag { font-family: ui-monospace, Consolas, monospace; font-weight: 700; background: var(--primary); color: #fff; border-radius: 3px; padding: 2px 10px; cursor: copy; }
.code-path { color: var(--muted); font-size: 13px; }
.code-path a { color: var(--muted); }
.code-path a:hover { color: var(--primary); }

/* 導覽下方的內容（入口網）：分層圖或網站連結，樣式大多在 /assets/portal.css */
.ed-content { margin-top: 14px; min-height: 240px; }

/* 對話框、通知 */
.modal-back { position: fixed; inset: 0; background: rgba(30,40,50,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 6px; width: min(540px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; overflow: auto; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 200; }
.toast { background: #2f8a3f; color: #fff; padding: 10px 18px; border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-weight: 600; transition: opacity .3s, transform .3s; }
.toast.err { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* 登入頁 */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: #fff; border-radius: 6px; border-top: 4px solid var(--primary); padding: 34px; width: min(400px, 100%); text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.login-logo { font-size: 34px; color: var(--primary); }
.login-card h1 { margin: 6px 0 4px; }
.login-error { background: #fbeeec; color: var(--danger); border-radius: 4px; padding: 8px 10px; }

@media (max-width: 760px) {
  .wrap { padding: 0 12px; }
  .ed-head-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .nav-area, .nav-sub-area, .nav-area .lv-row, .nav-sub-area .lv-row { justify-content: flex-start; }
  .ed-holder { display: flex; flex-direction: column; margin-left: 0 !important; }
  .page-title { flex-direction: column; align-items: flex-start; }
}

/* ===== 第5層：網站連結表格 ===== */
textarea { font: inherit; color: inherit; background: #fff; border: 1px solid #c2cad8; border-radius: 4px; padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.7; }
textarea:focus { outline: none; border-color: #7f9cc0; box-shadow: 0 0 0 3px rgba(51,122,183,.15); }
.lk-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lk-head h1 { font-size: 22px; margin: 0; }
.lk-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.lk-table { width: 100%; border-collapse: collapse; }
.lk-table th { text-align: left; font-size: 13px; color: #55606b; background: #f6f8fa; border-bottom: 2px solid var(--line); padding: 9px 12px; white-space: nowrap; }
.lk-table td { padding: 10px 12px; border-bottom: 1px solid #eef2f6; vertical-align: top; }
.lk-table tr:last-child td { border-bottom: 0; }
.lk-no { white-space: nowrap; width: 1%; }
.lk-handle { cursor: grab; color: #9aa5b1; padding-right: 6px; touch-action: none; user-select: none; letter-spacing: -2px; font-weight: 700; }
.lk-idx { display: inline-block; min-width: 24px; text-align: center; background: #eef1f5; border-radius: 3px; font-weight: 700; font-size: 13px; }
.lk-code { font-family: ui-monospace, Consolas, monospace; color: #55606b; white-space: nowrap; width: 1%; }
.lk-cell { cursor: text; }
.lk-cell:hover { background: #f5f9fd; }
.lk-name { font-weight: 700; min-width: 140px; }
.lk-intro { white-space: pre-wrap; min-width: 220px; }
.lk-url { color: #1f9e57; word-break: break-all; }
.lk-ph { color: #a7b0b9; font-weight: 400; }
.lk-cell input, .lk-cell textarea { font: inherit; font-weight: 400; width: 100%; min-width: 160px; padding: 6px 8px; border: 1px solid #7f9cc0; border-radius: 4px; box-sizing: border-box; }
.lk-ops { white-space: nowrap; width: 1%; text-align: right; }
.lk-ops .btn + .btn { margin-left: 4px; }
.lk-dragging td { background: #eaf2fa; opacity: .85; }
.lk-empty td { text-align: center; color: var(--muted); padding: 24px; }
.lk-foot { margin-top: 12px; }

/* 站台開放對象 */
.modal:has(.pick-grid) { width: min(820px, 100%); }
.access-detail { display: grid; gap: 8px; margin-top: 4px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick-box { border: 1px solid var(--line); border-radius: 4px; padding: 8px; display: grid; gap: 6px; align-content: start; }
.pick-head { display: flex; justify-content: space-between; align-items: center; }
.pick-box input:not([type]) { padding: 4px 8px; font-size: 14px; }
.pick-list { max-height: 220px; overflow: auto; display: grid; gap: 2px; }
.pick { display: flex; gap: 6px; align-items: center; font-size: 14px; padding: 2px 4px; border-radius: 3px; cursor: pointer; }
.pick:hover { background: #f4f6f9; }
@media (max-width: 760px) { .pick-grid { grid-template-columns: 1fr; } }

/* 元編輯自己的頂欄改藍色系，跟下面站台的深色選單列分開 */
.topbar { background: linear-gradient(90deg, #1e4f8f, #2b6cb0); color: #dbe8f7; box-shadow: 0 2px 6px rgba(30, 79, 143, .25); }
.logo-mark { color: #9cd0ff; }
.top-link { color: #dbe8f7; }
.top-link:hover, .top-link.on { color: #fff; }
.top-link.on { border-bottom: 2px solid #9cd0ff; padding-bottom: 2px; }
.me .btn { color: #fff; border-color: rgba(255, 255, 255, .45); }
.me .btn:hover { background: rgba(255, 255, 255, .12); }
.topbar .badge { background: rgba(255, 255, 255, .2); color: #fff; }

/* 頂欄顏色可在「元編輯設定」自訂（--topbar），預設藍色系 */
:root { --topbar: #2b6cb0; }
.topbar { background: linear-gradient(90deg, color-mix(in srgb, var(--topbar) 75%, #000), var(--topbar)); }
.top-btn { font: inherit; font-size: 14px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .45); border-radius: 4px; padding: 3px 12px; cursor: pointer; }
.top-btn:hover { background: rgba(255, 255, 255, .12); }
.top-btn[hidden] { display: none; }
.admin-footer { white-space: pre-wrap; text-align: center; color: #7b8794; font-size: 13px; padding: 18px 20px 28px; border-top: 1px solid #e1e7ed; background: #fff; }
.admin-footer[hidden] { display: none; }
.code-orig { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: #6b7785; border: 1px dashed #c2cad8; border-radius: 3px; padding: 1px 8px; }
.lk-del { color: var(--danger); }

/* 修改紀錄 */
.site-edited { margin-top: -2px; }
.modal:has(.log-wrap) { width: min(900px, 100%); }
.log-wrap { max-height: 60vh; overflow: auto; }
.log-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.log-table th { text-align: left; font-size: 13px; color: #55606b; background: #f6f8fa; border-bottom: 2px solid var(--line); padding: 8px 10px; position: sticky; top: 0; }
.log-table td { padding: 8px 10px; border-bottom: 1px solid #eef2f6; vertical-align: top; }
.log-time, .log-who { white-space: nowrap; }
.log-time { color: #55606b; font-variant-numeric: tabular-nums; }
.log-act { display: inline-block; padding: 0 8px; border-radius: 3px; font-size: 12.5px; font-weight: 700; background: #eef1f5; color: #44515e; white-space: nowrap; }
.log-act.create { background: #e6f4e8; color: #2f8a3f; }
.log-act.delete { background: #fbeeec; color: #c0392b; }
.log-act.update, .log-act.settings { background: #e8f0fa; color: #2b6cb0; }

/* ===== 導覽編輯（#/site/<id>/edit） ===== */
.nv-panel { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px 18px; }
.nv-crumb { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.nv-crumb .sep { margin: 0 8px; opacity: .6; }
.nv-work { display: grid; gap: 14px; min-width: 0; }
.nv-box { border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; background: #fff; }
.nv-box-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-weight: 600; margin-bottom: 10px; }
.nv-box-head strong { font-size: 16px; }
.nv-chain { border-top: 3px solid #3598dc; background: #fafcfe; }
.nv-chain-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.nv-chain-row + .nv-chain-row { border-top: 1px dashed var(--line); }
.nv-chain-lv { flex: none; width: 64px; font-weight: 700; color: #44515e; padding-top: 4px; }
.nv-chain-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nv-chain-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #c2cad8; background: #fff; color: #2f3d4a; border-radius: 3px; padding: 3px 6px 3px 10px; font-size: 14px; text-decoration: none; cursor: pointer; user-select: none; }
.nv-chain-btn:hover { border-color: var(--primary); }
.nv-chain-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.nv-chain-btn.off { color: #9aa5b1; }
.nv-chain-btn small { font-size: 11px; }
.nv-chain-btn .tool { opacity: .45; padding: 0 3px; font-size: 12px; }
.nv-chain-btn .tool:hover { opacity: 1; color: var(--danger); }
.nv-chain-btn.on .tool:hover { color: #fff; }
.nv-chain-btn.dragging { opacity: .6; }
.nv-chain-add { font: inherit; font-size: 13px; border: 1px dashed #9aa5b1; background: transparent; color: #55606b; border-radius: 3px; padding: 3px 10px; cursor: pointer; }
.nv-chain-add:hover { border-color: var(--primary); color: var(--primary); }
.nv-add { border: 1px solid #b7dfc0; background: #f5fbf6; border-radius: 4px; padding: 12px; margin-bottom: 12px; }
.nv-add[hidden] { display: none; }
.nv-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.nv-add-foot { display: flex; gap: 8px; margin-top: 10px; }
.nv-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.nv-table { width: 100%; border-collapse: collapse; }
.nv-table th { text-align: left; font-size: 13px; color: #55606b; background: #f6f8fa; border-bottom: 2px solid var(--line); padding: 9px 10px; white-space: nowrap; }
.nv-table td { padding: 9px 10px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.nv-table tr:last-child td { border-bottom: 0; }
.nv-table tr.nv-hl td { background: #fff8db; }
.nv-cell { cursor: text; }
.nv-cell:hover { background: #f5f9fd; }
.nv-label { font-weight: 700; min-width: 140px; }
.nv-tip { color: #55606b; min-width: 160px; }
.nv-url { color: #2a6db0; min-width: 140px; max-width: 240px; word-break: break-all; font-size: 13px; }
.nv-cell input { font: inherit; width: 100%; min-width: 140px; padding: 5px 8px; border: 1px solid #7f9cc0; border-radius: 4px; }
.nv-vis { font: inherit; font-size: 13px; font-weight: 700; border: 0; border-radius: 3px; padding: 2px 10px; cursor: pointer; white-space: nowrap; }
.nv-vis.on { background: #e6f4e8; color: #2f8a3f; }
.nv-vis.off { background: #eef1f5; color: #8a949e; }
.nv-next, .nv-edited { white-space: nowrap; font-size: 13px; }
.nv-edited { color: var(--muted); }
.nv-none td, .nv-empty { text-align: center; color: var(--muted); padding: 24px; }
.nv-help { margin: 8px 0 0; }
.nv-edit { display: grid; gap: 10px; }

/* 導覽編輯頁首：右上角兩個工具、深色列各層（定義＝一格下拉、管理＝五格） */
.nv-brand-sub { font-size: 14px; font-weight: 600; color: #fff; background: var(--primary); border-radius: 3px; padding: 1px 10px; }
.nv-dd-wrap { position: relative; }
.nv-dd { display: none; position: absolute; left: 0; top: 100%; min-width: 240px; background: #fff; padding: 6px 0; box-shadow: 0 8px 24px rgba(0,0,0,.15); border-radius: 0 0 4px 4px; z-index: 30; flex-direction: column; }
/* 層名那一層：點深色列才開（老闆 2026-11-27：不要滑過去就出現），所以不掛 :hover */
/* 滑到右邊的資料欄時，層名這一層要釘住不收（整條鏈：層名 → 那一層的項目 → 下一層） */
.nv-dd.open { display: flex; }
.nv-dd .dd-a { display: flex; gap: 10px; }
.nv-dd .inline-form { padding: 4px 10px; }
.nv-num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #eef1f5; color: #55606b; font-size: 12px; flex: none; }
.dd-a.on .nv-num { background: rgba(255,255,255,.25); color: #fff; }
/* 沒輪到的那幾項不要留白（老闆 2026-11-27：「鉛筆沒顯示 所以會有留白」）：
   藏起來的時候連寬度一起收掉，滑過去或選到才長出來 */
.ed-site .item .item-tools { opacity: 0; max-width: 0; margin-left: 0; overflow: hidden; }
.ed-site .item:hover .item-tools, .ed-site .item.on .item-tools, .ed-site .item.open .item-tools { max-width: 6em; margin-left: 2px; }
.ed-site .item:hover .item-tools, .ed-site .item.on .item-tools { opacity: 1; }
.ed-site .item .item-tools.always { opacity: .6; max-width: 6em; margin-left: 2px; }
.ed-site .item:hover .item-tools.always { opacity: 1; }
.nv-panel > .nv-crumb { margin-top: 2px; }
.nv-dd .dd-a .nv-num { order: -1; }

/* 工具列：「管理後台」「導覽編輯」一直都在，目前所在的那一顆反白 */
.page-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; padding: 2px; gap: 2px; background: #f6f8fa; }
.page-switch .btn { border-color: transparent; background: transparent; }
.page-switch .btn:hover { background: #fff; }
.page-switch .btn.current { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); cursor: default; }

/* 站台卡片下方三顆：導覽編輯、管理後台、前台（都另開新頁） */
.site-card-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.site-card-actions .btn { margin-top: 0; justify-content: center; text-align: center; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.site-card { cursor: grab; }
.site-card-actions .btn { cursor: pointer; }

/* ---------- 第5層：卡片上架（2026-11-25 照參考站 mis page/nav-card-shelf.php，數值照抄） ---------- */
.ed-content.nvcs-mode { background: transparent; border: 0; padding: 0; box-shadow: none; }
.nvcs-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 auto 12px; max-width: 1142px; font-size: 13px; color: #5a6b7b; }
.nvcs-crumb { font-size: 15px; color: #1f2d3d; }
.nvcs-crumb .up, .nvcs-crumb .cnt { color: #9aa5b1; }
.nvcs-seg { display: inline-flex; align-items: stretch; flex: 0 0 auto; }
.nvcs-seg button { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; margin: 0; box-sizing: border-box; font: inherit; font-size: 13px;
  font-weight: 600; line-height: 1; border: 1px solid #8a9bab; border-right-width: 0; background: #fff; color: #5a6b7b; cursor: pointer; transition: .12s; }
.nvcs-seg button:first-child { border-radius: 4px 0 0 4px; }
.nvcs-seg button:last-child { border-radius: 0 4px 4px 0; border-right-width: 1px; }
.nvcs-seg button:hover { background: #eef1f4; }
.nvcs-seg button.on { background: #5a6b7b; border-color: #5a6b7b; color: #fff; cursor: default; }
.nvcs-seg button .n { margin-left: 6px; font-size: 12px; font-weight: 400; opacity: .7; }
.nvcs-front { font-size: 13px; color: #5a6b7b; text-decoration: none; border: 1px solid #cdd8e2; border-radius: 4px; padding: 2px 8px; background: #fff; white-space: nowrap; }
.nvcs-front:hover { border-color: #1a73e8; color: #1a73e8; }
.nvcs-panel { max-width: 1142px; margin: 0 auto 30px; padding: 25px; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); box-sizing: border-box; }
.nvcs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; max-width: 1092px; margin: 0 auto; align-items: stretch; }
.nvcs-card { position: relative; background: #fff; border: 1px solid #e6e6e6; border-radius: 10px; display: flex; flex-direction: column; color: #333; min-width: 0; overflow: hidden; }
.nvcs-card, .nvcs-card * { box-sizing: border-box; }
.nvcs-card.nvcs-hide { display: none; }
.nvcs-card.off { background: #fafbfc; }
.nvcs-card.off .nvcs-f { color: #78848f; }
.nvcs-card.hl { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26, 115, 232, .18); }
.nvcs-card .off-tag { position: absolute; top: 8px; left: 8px; z-index: 3; display: none; font-size: 12px; color: #fff; background: #95a5a6; border-radius: 3px; padding: 1px 6px; }
.nvcs-card.off .off-tag { display: block; }
.nvcs-drag { position: absolute; top: 8px; right: 72px; z-index: 4; width: 26px; height: 26px; border: 1px solid #d5dde5; border-radius: 5px;
  background: rgba(255, 255, 255, .95); color: #7b8794; cursor: grab; display: flex; align-items: center; justify-content: center;
  opacity: .35; transition: .15s; touch-action: none; user-select: none; font-size: 15px; }
.nvcs-card:hover .nvcs-drag { opacity: 1; }
.nvcs-drag:active { cursor: grabbing; }
.nvcs-card.nvcs-chosen { opacity: .6; box-shadow: 0 6px 20px rgba(20, 30, 45, .18); }
body.nvcs-dragging, body.nvcs-dragging * { user-select: none !important; }
body.nvcs-dragging { cursor: grabbing; }
.nvcs-body { padding: 14px 16px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.nvcs-fd { display: block; min-width: 0; }
.nvcs-f { display: block; width: auto; max-width: none; min-width: 0; border: 0; border-radius: 5px; padding: 3px 5px; margin: -3px -5px 8px;
  background: transparent; color: #333; outline: none; box-shadow: none; cursor: text; font-family: "Noto Sans TC", "微軟正黑體", sans-serif; word-break: break-word; }
.nvcs-f:hover { background: #f3f8ff; }
.nvcs-f:focus { background: #fff; box-shadow: 0 0 0 2px #9fc4f5; }
.nvcs-f::placeholder { color: #aab4c0; font-weight: 400; font-size: 15px; opacity: 1; }
.nvcs-f.ce { min-height: 1.5em; }
.nvcs-f.ce:empty:before { content: attr(data-ph); color: #aab4c0; font-weight: 400; font-size: 15px; }
.nvcs-f.ce p, .nvcs-f.ce ul, .nvcs-f.ce ol { margin: 0; }
.nvcs-f.ce ul, .nvcs-f.ce ol { padding-left: 1.4em; }
.nvcs-f.nm { font-size: 18px; font-weight: 700; color: #2c3e50; line-height: 1.4; }
.nvcs-f.md { font-size: 14px; color: #7c8a99; line-height: 1.6; letter-spacing: .2px; }
.nvcs-f.tp { font-size: 14.5px; font-weight: 600; color: #2c3e50; line-height: 1.6; }
.nvcs-f.intro { min-height: 52px; font-size: 14px; color: #000; line-height: 1.7; }
.nvcs-f.url { width: calc(100% + 10px); font-size: 12px; color: #5a6b7b; }
.nvcs-pic { width: 100%; aspect-ratio: 16 / 9; background: #eef2f6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #b8c2cc; position: relative; flex: none; }
.nvcs-pic .im { position: absolute; inset: 0; width: 100%; height: 100%; display: none; object-fit: cover; object-position: center; border: 0; }
.nvcs-pic.has .im { display: block; }
.nvcs-pic .ic { font-size: 30px; line-height: 1; filter: grayscale(1); opacity: .45; }
.nvcs-pic.has .ic { display: none; }
.nvcs-pic .up, .nvcs-pic .rm { z-index: 2; }
.nvcs-pic .up { border: 1px solid #cdd8e2; background: rgba(255, 255, 255, .96); color: #5a6b7b; border-radius: 6px; font-size: 13px; padding: 6px 14px; cursor: pointer; transition: .12s; font-family: inherit; }
.nvcs-pic .up:hover { border-color: #1a73e8; color: #1a73e8; background: #fff; }
.nvcs-pic.has .up { position: absolute; right: 8px; bottom: 8px; padding: 4px 11px; font-size: 12px; opacity: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.nvcs-pic.has:hover .up { opacity: 1; }
.nvcs-pic .del { position: absolute; top: 8px; right: 40px; z-index: 2; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(24, 32, 44, .55);
  color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: .12s; }
.nvcs-pic .del:hover { background: #c0392b; }
.nvcs-pic .rm { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(24, 32, 44, .55); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; display: none; padding: 0; }
.nvcs-pic.has .rm { display: block; }
.nvcs-act { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; min-width: 0; }
.nvcs-act > * { min-width: 0; }
.nvcs-act .sh { height: 38px; border: 1px solid #cdd8e2; border-radius: 6px; font-size: 16px; padding: 0 6px; background: #fff; color: #1a73e8; font-weight: 700; text-align: center; text-align-last: center; }
.nvcs-act .sh.off { color: #78848f; }
.nvcs-act .btn { height: 38px; font-size: 14px; padding: 5px 10px; justify-content: center; width: 100%; }
.nvcs-card:not(.dirty) .nvcs-save { opacity: .45; pointer-events: none; }
.nvcs-ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; padding-top: 8px; min-width: 0; }
.nvcs-op { min-width: 0; height: 38px; padding: 0 8px; font-size: 14px; border: 1px solid #cdd8e2; border-radius: 6px; background: rgba(255, 255, 255, .96);
  color: #5a6b7b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-family: inherit; transition: .12s; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.nvcs-op:hover { border-color: #1a73e8; color: #1a73e8; background: #fff; }
.nvcs-op.none { color: #aab4c0; border-style: dashed; cursor: default; }
.nvcs-op.none:hover { border-color: #cdd8e2; color: #aab4c0; }
.nvcs-card.add { border: 2px dashed #cdd8e2; background: #fff; }
.nvcs-card.add .nvcs-pic { background: #f7f9fc; }
.nvcs-card.add .nvcs-pic .up { position: absolute; right: 8px; bottom: 8px; padding: 4px 11px; font-size: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
@media (max-width: 767px) {
  .nvcs-panel { padding: 15px 0; border-radius: 0; box-shadow: none; }
  .nvcs-grid { grid-template-columns: 1fr; gap: 16px; }
}
/* 子類變更／複製的視窗內容 */
.nvcs-dlgbody { min-width: 0; }
.nvcs-who { margin: 0 0 12px; padding: 9px 12px; background: #f7f9fc; border: 1px solid #eef2f6; border-radius: 6px; font-size: 13px; line-height: 1.7; color: #5a6b7b; }
.nvcs-who b { color: #1f2d3d; }
.nvcs-where { display: flex; margin: 0 0 12px; }
.nvcs-where button { flex: 1; height: 34px; font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid #8a9bab; border-right-width: 0; background: #fff; color: #5a6b7b; cursor: pointer; }
.nvcs-where button:first-child { border-radius: 4px 0 0 4px; }
.nvcs-where button:last-child { border-radius: 0 4px 4px 0; border-right-width: 1px; }
.nvcs-where button.on { background: #5a6b7b; border-color: #5a6b7b; color: #fff; cursor: default; }
.nvcs-dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.nvcs-dgrid[hidden], .nvcs-note[hidden] { display: none; }
.nvcs-df { display: block; margin: 0; min-width: 0; }
.nvcs-df.wide { grid-column: span 2; }
.nvcs-df > span { display: block; font-size: 12px; color: #8a9bab; margin: 0 0 4px; }
.nvcs-df > select { width: 100%; height: 36px; border: 1px solid #cdd8e2; border-radius: 6px; padding: 0 8px; font-size: 14px; font-family: inherit; color: #2c3e50; background: #fff; }
.nvcs-note { margin-top: 12px; padding: 9px 12px; background: #f2f7fd; border: 1px solid #d7e6fb; border-radius: 6px; font-size: 13px; line-height: 1.7; color: #44515f; }
.nvcs-note b { color: #1a73e8; }
/* 富文本浮動工具列 */
.nv-rich { position: absolute; z-index: 2000; display: flex; flex-wrap: wrap; width: max-content; align-items: center; gap: 2px; max-width: calc(100vw - 16px);
  padding: 4px 6px; background: #fff; border: 1px solid #cdd8e2; border-radius: 6px; box-shadow: 0 6px 20px rgba(20, 30, 45, .16); font-size: 13px; }
.nv-rich[hidden] { display: none; }
.nv-rich button { min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; color: #44515f; cursor: pointer; font: inherit; }
.nv-rich button:hover { background: #eef3f9; color: #1a73e8; }
.nv-rich .bold { font-weight: 700; }
.nv-rich .ital { font-style: italic; }
.nv-rich .und { text-decoration: underline; }
.nv-rich .strike { text-decoration: line-through; }
.nv-rich .sw { min-width: 18px; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); }
.nv-rich .sep { width: 1px; height: 18px; background: #e1e7ed; margin: 0 4px; }

/* ---------- 卡片的內頁編輯器（2026-11-25 照參考站 mis page/nav-detail-editor.php，數值照抄） ---------- */
.nv-rich:not(.page) .only-page { display: none; }
.nv-rich .only-page { display: inline-flex; align-items: center; }
.nvde-top { display: flex; align-items: center; gap: 12px; margin: 0 auto 16px; max-width: 1142px; flex-wrap: wrap; }
.nvde-title { font-size: 15px; color: #1f2d3d; }
.nvde-hint { color: #8a9bab; font-size: 13px; }
.nvde-hint.warn { color: #c0392b; font-weight: 600; }
.ed-wrap { display: flex; align-items: stretch; border: 1px solid #e2e8ee; border-radius: 8px; background: #fff; max-width: 1142px; margin: 0 auto 30px; }
.ed-canvas { flex: 1; padding: 22px; min-width: 0; background: #f7f9fc; border-radius: 8px; }
.nvde .ed-block { background: #fff; border: 1px solid #e8ebef; border-radius: 8px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20, 30, 45, .05); }
.nvde .ed-block[hidden] { display: none; }
.nvde .ed-block.dragging { opacity: .6; box-shadow: 0 6px 20px rgba(20, 30, 45, .18); }
.nvde .ed-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; background: #fbfcfe; border-bottom: 1px solid #eef1f5; font-size: 12.5px; color: #7c8a99; border-radius: 7px 7px 0 0; }
.nvde .ed-ctrl select { height: 28px; border: 1px solid #cdd8e2; border-radius: 5px; font-size: 12.5px; padding: 0 5px; background: #fff; color: #3c4a58; }
.nvde .ed-ctrl .sp { flex: 1; }
.nvde .ed-ctrl .drag { cursor: move; color: #aab4c0; padding: 0 4px; font-size: 15px; touch-action: none; user-select: none; }
.nvde .ed-del { border: 1px solid #f0c6c2; background: #fff; color: #c0392b; border-radius: 5px; font-size: 12.5px; padding: 3px 9px; cursor: pointer; }
.nvde .ed-del:hover { background: #c0392b; color: #fff; }
.nvde .ed-src { border: 1px solid #cdd8e2; background: #fff; color: #44515f; border-radius: 5px; font-size: 12.5px; padding: 3px 9px; cursor: pointer; }
.nvde .ed-src:hover { background: #eef4fb; border-color: #9fb3c8; color: #1a73e8; }
.nvde .ed-save { border: 1px solid #7cc09a; background: #eefaf3; color: #1e7a4d; border-radius: 5px; font-size: 12.5px; padding: 3px 9px; cursor: pointer; white-space: nowrap; }
.nvde .ed-save:hover:not(:disabled) { background: #1e7a4d; border-color: #1e7a4d; color: #fff; }
.nvde .ed-save:disabled { opacity: .55; cursor: default; }
.nvde .badge-hero { color: #5a6b7b; font-size: 12.5px; font-weight: 700; }
.nvde-lim { width: 84px; height: 28px; border: 1px solid #cdd8e2; border-radius: 5px; padding: 0 6px; font-size: 12.5px; color: #3c4a58; background: #fff; font-family: inherit; }
.nvde .pd-hero { display: flex; gap: 34px; align-items: stretch; flex-wrap: wrap; padding: 22px; }
.nvde .pd-feat { display: flex; gap: 34px; align-items: flex-start; flex-wrap: wrap; padding: 22px; }
.nvde .pd-hero .h-pic { flex: 0 0 52%; max-width: 52%; display: flex; flex-direction: column; row-gap: 16px; }
.nvde .pd-feat .f-pic { flex: 0 0 52%; max-width: 52%; }
.nvde .pd-hero .h-text { flex: 1; min-width: 240px; display: flex; flex-direction: column; }
.nvde .pd-feat .f-text { flex: 1; min-width: 240px; }
.nvde .lay-img-right { flex-direction: row-reverse; }
.nvde .lay-full { flex-direction: column; align-items: stretch; }
.nvde .lay-full .f-pic { flex-basis: 100%; max-width: 100%; width: 100%; }
.nvde .lay-full .f-text { display: contents; }
.nvde .lay-text .f-pic { display: none; }
.nvde .lay-text .f-text { flex-basis: 100%; }
.nvde .imgbox { width: 100%; aspect-ratio: 16 / 9; background: #f2f5f8; border: 1px solid #eceff3; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #b8c2cc; position: relative; transition: .12s; overflow: hidden; box-sizing: border-box; }
.nvde .imgbox:hover { background-color: #eef5ff; color: #1a73e8; }
.nvde .imgbox .ibx-img { position: absolute; inset: 0; width: 100%; height: 100%; display: none; object-fit: cover; object-position: center; border: 0; }
.nvde .imgbox.has .ibx-img { display: block; }
.nvde .imgbox.nat .ibx-img { position: static; height: auto; }
.nvde .imgbox .ibx-up { position: absolute; right: 8px; bottom: 8px; z-index: 3; border: 1px solid #cdd8e2; background: rgba(255, 255, 255, .96); color: #5a6b7b; border-radius: 6px; padding: 4px 11px; font-size: 12px; cursor: pointer; font-family: inherit; }
.nvde .imgbox .ibx-up:hover { border-color: #1a73e8; color: #1a73e8; background: #fff; }
.nvde .imgbox .ic { font-size: 28px; filter: grayscale(1); opacity: .5; }
.nvde .imgbox .tx { font-size: 13px; }
.nvde .imgbox.has .ic, .nvde .imgbox.has .tx { display: none; }
.nvde .imgbox .img-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(24, 32, 44, .55); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; display: none; }
.nvde .imgbox.has .img-x { display: block; }
.nvde .imgbox .ibx-zoom { position: absolute; top: 8px; left: 8px; z-index: 3; display: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(20, 28, 38, .62); color: #fff; font-size: 12px; line-height: 26px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); cursor: pointer; }
.nvde .imgbox.has .ibx-zoom { display: block; }
.nvde .imgbox .ibx-foot { position: absolute; right: 8px; bottom: 8px; z-index: 5; display: flex; align-items: center; gap: 8px; }
.nvde .imgbox .ibx-foot .ibx-up { position: static; }
.nvde .imgbox .ibx-on { height: 26px; border: 1px solid #cdd8e2; border-radius: 6px; background: rgba(255, 255, 255, .96); color: #5a6b7b; font-size: 12px; font-family: inherit; padding: 0 4px; cursor: pointer; }
.nvde .h-pic.off .imgbox .ibx-on { border-color: #e3b4ae; color: #c0392b; }
.nvde .h-pic.off .imgbox .ibx-img, .nvde .h-pic.off .imgbox .ic, .nvde .h-pic.off .imgbox .tx { opacity: .4; }
.imgzoom-mask { position: fixed; inset: 0; z-index: 3400; display: none; background: rgba(15, 22, 32, .88); padding: 24px; cursor: zoom-out; align-items: center; justify-content: center; }
.imgzoom-mask.on { display: flex; }
.imgzoom-mask img { max-width: 100%; max-height: 100%; display: block; border-radius: 4px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.imgzoom-mask .zx { position: fixed; top: 14px; right: 18px; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font-size: 24px; line-height: 36px; cursor: pointer; }
.imgzoom-mask .zi { position: fixed; left: 0; right: 0; bottom: 16px; text-align: center; color: rgba(255, 255, 255, .72); font-size: 12px; }
.nvde .part-order { display: none; align-items: center; gap: 6px; }
.nvde .part-order.show { display: inline-flex; }
.nvde .part-order .po-lbl { font-size: 12.5px; color: #8a9bab; }
.nvde .part-order .po-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; background: #eef4fb; border: 1px solid #cfe0f2; border-radius: 5px; font-size: 12.5px; color: #3c4a58; cursor: move; }
.nvde .rich { outline: none; border-radius: 5px; padding: 4px 6px; margin: -4px -6px 10px; cursor: text; word-break: break-word; }
.nvde .rich:hover { background: #f3f8ff; }
.nvde .rich:focus { background: #fff; box-shadow: 0 0 0 2px #9fc4f5; }
.nvde .rich:empty:before { content: attr(data-ph); color: #aab4c0; font-weight: 400; }
.nvde .rich p, .nvde .rich ul, .nvde .rich ol { margin: 0 0 10px; }
.nvde .h-name { font-size: 26px; font-weight: 700; color: #1f2d3d; line-height: 1.45; letter-spacing: .3px; }
.nvde .h-model { font-size: 14px; color: #000; font-weight: 700; line-height: 1.8; letter-spacing: .3px; }
.nvde .h-nmrow, .nvde .h-mdrow, .nvde .h-onrow { display: flex; flex-wrap: wrap; align-items: center; column-gap: 18px; padding: 4px 23px 4px 6px; margin: -4px -6px 10px; border-radius: 5px; transition: background .12s, box-shadow .12s; }
.nvde .h-nmrow > .rich, .nvde .h-mdrow > .rich, .nvde .h-onrow > .rich { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; }
.nvde .h-nmrow:hover, .nvde .h-mdrow:hover, .nvde .h-onrow:hover { background: #f3f8ff; }
.nvde .h-nmrow:focus-within, .nvde .h-mdrow:focus-within, .nvde .h-onrow:focus-within { background: #fff; box-shadow: 0 0 0 2px #9fc4f5; }
.nvde .h-nmrow > .rich:hover, .nvde .h-nmrow > .rich:focus, .nvde .h-mdrow > .rich:hover, .nvde .h-mdrow > .rich:focus,
.nvde .h-onrow > .rich:hover, .nvde .h-onrow > .rich:focus { background: transparent; box-shadow: none; }
.nvde .row-on { display: flex; align-items: center; gap: 4px; flex: none; font-size: 12px; font-weight: 600; color: #7c8a99; white-space: nowrap; cursor: pointer; user-select: none; margin: 0; }
.nvde .row-on input { margin: 0; cursor: pointer; }
.nvde .off > .rich { opacity: .45; }
.nvde .off > .row-on { color: #c0392b; }
.nvde .h-tprow { margin: 0 -6px 4px; }
.nvde .h-ttrow { margin: 6px -6px 4px; }
.nvde .h-tkrow { flex: 1 1 auto; align-items: flex-start; }
.nvde .h-sep { border-top: 1px solid #eceff3; margin: 10px 0; }
.nvde .h-topic, .nvde .h-task-topic { font-size: 20px; font-weight: 700; color: #1f2d3d; line-height: 1.7; }
.nvde .h-desc, .nvde .h-task { font-size: 15px; color: #000; line-height: 2.0; }
.nvde .f-name { font-size: 18px; font-weight: 700; color: #1f2d3d; line-height: 1.4; padding-left: 11px; border-left: 4px solid #4B77BE; }
.nvde .f-desc { font-size: 16px; color: #000; min-height: 3em; overflow-x: auto; }
.nvde .f-desc p { margin: 0 0 10px; line-height: 1.9; }
.nvde .f-desc table, .nvde .h-desc table { border-collapse: collapse; margin: 6px 0 14px; }
.nvde .f-desc td, .nvde .f-desc th, .nvde .h-desc td, .nvde .h-desc th { border: 1px solid #e3e8ed; padding: 9px 12px; }
.nvde .f-desc img, .nvde .h-desc img { max-width: 100%; height: auto; }
.nvde .rich a { color: #4B77BE; text-decoration: underline; }
.nvde .sec-bar { display: flex; align-items: stretch; flex-wrap: wrap; gap: 2px; background: #fff; border: 1px solid #e2e8ee; border-radius: 8px 8px 0 0; padding: 0 6px; margin: 6px 0 0; }
.nvde .sec-tab { display: flex; align-items: center; gap: 6px; padding: 12px 17px; font-size: 14.5px; color: #5a6b7b; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; transition: .12s; }
.nvde .sec-tab:hover { color: #4B77BE; background: #f2f6fc; }
.nvde .sec-tab.on { color: #4B77BE; font-weight: 700; border-bottom-color: #4B77BE; }
.nvde .sec-tab .edit { color: #b3bfcc; font-size: 12.5px; opacity: 0; transition: .12s; }
.nvde .sec-tab:hover .edit, .nvde .sec-tab.on .edit { opacity: 1; }
.nvde .sec-tab .edit:hover { color: #4B77BE; }
.nvde .sec-add { display: flex; align-items: center; gap: 6px; padding: 12px 15px; font-size: 14px; color: #1a73e8; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.nvde .sec-add:hover { color: #0d5bcd; background: #f3f8ff; }
.nvde .sec-hint { background: #f2f6fc; border: 1px solid #e2e8ee; border-top: none; color: #5a6b7b; font-size: 13px; padding: 9px 15px; border-radius: 0 0 8px 8px; margin-bottom: 18px; }
.nvde .sec-hint b { color: #4B77BE; }
.nvde .blk-add { border: 2px dashed #cdd8e2; border-radius: 9px; background: #fbfcfe; padding: 16px 18px 18px; }
.nvde .blk-add:hover { border-color: #1a73e8; }
.nvde .blk-add-hd { font-size: 14px; color: #5a6b7b; margin-bottom: 14px; }
.nvde .blk-add-hd b { color: #4B77BE; }
.nvde .blk-add-hd span { color: #aab4c0; font-size: 13px; }
.nvde .blk-add-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 150px)); gap: 12px; }
.nvde .ed-thumb { border: 1px solid #e2e8ee; border-radius: 9px; padding: 11px; cursor: pointer; background: #fff; transition: .12s; }
.nvde .ed-thumb:hover { border-color: #1a73e8; box-shadow: 0 3px 10px rgba(26, 115, 232, .14); }
.nvde .ed-thumb .mini { display: flex; gap: 5px; height: 40px; }
.nvde .ed-thumb .mini.col { flex-direction: column; }
.nvde .ed-thumb .mini .box { background: #dbe4ee; border-radius: 3px; }
.nvde .ed-thumb .mini .pic { flex: 0 0 46%; }
.nvde .ed-thumb .mini .txt { flex: 1; background: repeating-linear-gradient(#c3d0dd 0 3px, transparent 3px 8px); }
.nvde .ed-thumb .mini.col .pic { flex: 0 0 58%; }
.nvde .ed-thumb .cap { text-align: center; font-size: 12px; color: #6b7987; margin-top: 8px; }
.src-ta { width: 100%; min-width: min(560px, 70vw); box-sizing: border-box; font: 13px/1.6 Consolas, monospace; border: 1px solid #cdd8e2; border-radius: 6px; padding: 10px; }
@media (max-width: 760px) {
  .nvde .pd-hero, .nvde .pd-feat { gap: 18px; padding: 16px; }
  .nvde .pd-hero .h-pic, .nvde .pd-feat .f-pic { flex: 0 0 100% !important; max-width: 100% !important; }
  .nvde .pd-hero .h-text, .nvde .pd-feat .f-text { min-width: 0; }
  .nvde .blk-add-opts { grid-template-columns: 1fr 1fr; }
  .ed-canvas { padding: 12px; }
}

/* ===== 轉移到官網站台（⇄ 轉移到官網） ===== */
.modal:has(.push-out) { width: min(820px, 100%); }
.push-out:empty { display: none; }
.push-out { margin-top: 4px; }
.push-head { margin: 0 0 6px; font-weight: 700; color: #37424d; }
.push-out .log-wrap { max-height: 40vh; }
.push-warn { margin: 6px 0 0; color: #b4600f; font-size: 13px; }
.push-opt { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.push-opt input { margin-top: 3px; }
.push-opt .hint { flex: 1 0 100%; margin-left: 24px; }

/* 「›」只是記號，**不給按**（老闆 2026-11-27：「你的 > 不要讓人按」）：
   整列點下去就展開，所以箭頭不吃滑鼠、不反白、沒有手指游標。 */
.ed-site .arrow, .ed-col .arrow { pointer-events: none; }
.ed-bar .arrow.exp { color: #cfd8e3; margin-left: 6px; }
.ed-bar .item.on .arrow.exp, .ed-bar .item.open .arrow.exp { color: #fff; }

/* 兩種狀態要分得開（老闆 2026-11-27：「為何你的第二項會一直是選取著的」）：
   .on   ＝「目前正在編的那一層」——一直都在，所以改成低調的（左邊一條線＋粗體），不要藍底
   .open ＝「現在展開的那一列」——跟著點擊換，這個才是藍底 */
.nv-dd .dd-a.on { background: #eef3f8; color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.nv-dd .dd-a.on .nv-num { background: #d8e6f3; color: var(--primary); }
.ed-bar .bar-a.on { background: var(--bar-hover); color: #fff; box-shadow: inset 0 -3px 0 #fff; }
.ed-bar .item.open, .nv-dd .item.open { background: var(--primary); color: #fff; }
.nv-dd .item.open .nv-num { background: rgba(255,255,255,.25); color: #fff; }
.ed-col .item.open { background: #e6f0fa; color: var(--primary); font-weight: 600; }

/* ---------- AI 助理（右下角，2026-11-27）---------- */
.aic { position: fixed; right: 18px; bottom: 18px; z-index: 99999; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.aic-tab { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 24px; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); order: 2; }
.aic-tab:hover { filter: brightness(1.08); }
.aic-win { display: none; width: 360px; max-width: calc(100vw - 36px); height: 460px; max-height: calc(100vh - 120px); flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 36px rgba(0,0,0,.22); overflow: hidden; }
.aic.on .aic-win { display: flex; }
.aic-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f6f8fa; }
.aic-head .muted { margin-right: auto; }
.aic-body { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; }
.aic-msg { white-space: pre-wrap; word-break: break-word; padding: 7px 10px; border-radius: 8px; max-width: 92%; }
.aic-msg.user { align-self: flex-end; background: var(--primary); color: #fff; }
.aic-msg.assistant { align-self: flex-start; background: #f1f4f7; color: #1f2d3d; }
.aic-msg.tool { align-self: center; background: transparent; color: #5a6b7b; font-size: 12.5px; }
.aic-did { border: 1px dashed #c2cad8; border-radius: 10px; padding: 2px 8px; }
.aic-wait { opacity: .6; }
.aic-foot { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.aic-foot textarea { flex: 1; resize: none; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; }
.aic-note { margin: 0; padding: 0 10px 8px; font-size: 11.5px; color: #8a97a4; }
