/* 設備管理系統專用樣式；共用外觀（導覽、按鈕、表單、表格、深色模式）在 olit.css，與 Olit Neubrex V4 相同 */
.c-ok { color: var(--success-text); } .c-bad { color: var(--danger-text); } .c-muted { color: var(--muted); }
.dot.online { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.offline { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-bg); }

/* 導覽列：使用者選單 */
.olit-nav .brand img { width: 18px; height: 18px; }
.olit-nav .dropdown-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 13px; text-decoration: none; }
.olit-nav .dropdown-toggle:hover { background: var(--hover); text-decoration: none; }
.olit-nav .dropdown-menu { border-radius: var(--r); border-color: var(--border); box-shadow: 0 8px 24px var(--shadow); padding: 6px 0; }
.olit-nav .dropdown-menu > li > a { padding: 7px 16px; }
.olit-nav .dropdown-header { color: var(--muted); }
.role-tag { font-size: 11px; color: var(--muted); }

/* 總覽卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
a.card { display: block; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 6px 18px var(--shadow); }
.card .title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.card .title .code { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.card .desc { color: var(--muted); font-size: 12px; margin-top: 4px; min-height: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .stats { display: flex; gap: 20px; margin-top: 14px; }
.card .stats b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.card .stats span { font-size: 12px; color: var(--muted); }
.card .bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: var(--hover); margin-top: 12px; }
.card .bar i { display: block; }

/* 群組頁工具列 */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.toolbar .form-control { width: auto; display: inline-block; }
.toolbar .grow { flex: 1; }
.toolbar input.form-control { min-width: 180px; }

/* 設備表：分類列、主機 / 子項目、拖曳 */
.table > tbody.sec > tr.sec-head > td { background: var(--bg); border-top: 1px solid var(--border); padding: 7px 18px;
  font-size: 12px; font-weight: 600; color: var(--muted); }
.sec-head .sec-name { color: var(--text); font-size: 13px; }
.sec-head .sec-count { margin-left: 6px; font-weight: 400; }
#dev_table > tbody.sec-zero { display: none; }
#dev_table.is-dragging > tbody.sec-zero { display: table-row-group; }
tr.host-row > td { font-weight: 500; }
tr.child-row > td:nth-child(2) { padding-left: 34px; }
.tree-indent { color: var(--faint); margin-right: 6px; }
.tree-caret { color: var(--muted); margin-left: 4px; }
tr.disabled > td { opacity: .5; }
.badge-src { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral-fg); font-weight: 500; }
.badge-src.c-ok { background: var(--ok-bg); color: var(--ok-fg); } .badge-src.c-bad { background: var(--fail-bg); color: var(--fail-fg); }
table.nowrap td, table.nowrap th { white-space: nowrap; }
.table .btn-xs { margin: 1px; }
.dot.idle { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.st { display: inline-flex; align-items: center; white-space: nowrap; }
.st .dot { margin: 0 6px; width: 9px; height: 9px; }
.dev-name { font-weight: 600; }
#dev_table > tbody > tr > td { vertical-align: middle; }

/* 展開 / 收合：每格內容包在 .cw（grid 1fr ↔ 0fr），td 的上下留白一起收掉 */
#dev_table > tbody > tr > td { transition: padding .25s ease, border-color .25s ease; }
#dev_table .cw { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .25s ease, opacity .2s ease; }
/* 只裁切垂直方向；overflow:hidden 會讓欄寬的最小值變 0，窄欄（狀態）的內容被切掉 */
#dev_table .cw > div { min-height: 0; overflow-x: visible; overflow-y: clip; }
#dev_table tr.row-hidden > td { padding-top: 0; padding-bottom: 0; border-top-color: transparent; border-top-width: 0; }
#dev_table tr.row-hidden .cw { grid-template-rows: 0fr; opacity: 0; }
#dev_table tr.row-hidden { pointer-events: none; }
.tree-caret i { display: inline-block; transition: transform .25s ease; }
tr.kids-closed .tree-caret i, tr.sec-head.closed .tree-caret i { transform: rotate(-90deg); }

/* 操作欄：控制網頁 + 「更多」 */
.acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.act-web { display: inline-flex; align-items: center; gap: 5px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .12s; }
.btn-icon:hover, .btn-icon.active { background: var(--hover); color: var(--text); border-color: var(--border); }
.btn-icon:focus { outline: none; } .btn-icon:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.btn-icon:active { transform: scale(.9); }

.row-menu { position: fixed; z-index: 1050; width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px var(--shadow); font-size: 13px;
  visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s; }
.row-menu.up { transform-origin: bottom right; transform: translateY(6px) scale(.97); }
.row-menu.show { visibility: visible; opacity: 1; transform: none; transition: opacity .16s ease, transform .16s ease; }
.rm-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 4px; }
.rm-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-head .c-muted { margin-left: auto; font-size: 12px; flex-shrink: 0; }
.rm-info { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; padding: 4px 8px 6px; font-size: 12px; }
.rm-info dt { color: var(--muted); font-weight: 400; } .rm-info dd { margin: 0; text-align: right; }
.rm-sep { height: 1px; background: var(--line); margin: 4px 0; }
.rm-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; color: var(--text); text-decoration: none;
  transition: background .12s; }
.rm-item:hover, .rm-item:focus { background: var(--hover); color: var(--text); text-decoration: none; outline: none; }
.rm-item i { color: var(--muted); }
.rm-item .badge { margin-left: auto; padding: 1px 8px; }
.rm-item.danger, .rm-item.danger i { color: var(--danger-text); }
.rm-item.danger:hover { background: var(--fail-bg); }

/* 最愛方塊 */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.fav-grid.empty { display: none; }
.fav-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: 0 1px 2px var(--shadow); animation: olit-fade-in .25s ease-out;
  transition: border-color .15s, transform .15s, box-shadow .15s; }
.fav-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 6px 18px var(--shadow); }
.fav-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fav-top .dot { margin: 0 2px; flex-shrink: 0; }
.fav-name { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-star { margin-left: auto; color: #f5b301; flex-shrink: 0; transition: transform .15s; }
a.fav-star:hover { color: #f5b301; transform: scale(1.2); }
.fav-sub { font-size: 12px; color: var(--muted); }
.fav-url { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.fav-url:hover { color: var(--text); }
.fav-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fav-mark { color: #f5b301; font-size: 12px; }

.drag-handle { cursor: grab; color: var(--faint); padding: 0 6px 0 0; }
.drag-handle:hover { color: var(--text); }
tr.dragging > td { opacity: .35; }
tr.drop-before > td { box-shadow: inset 0 2px 0 var(--info); }
tr.drop-after > td { box-shadow: inset 0 -2px 0 var(--info); }
tr.drop-into > td { background: var(--info-bg) !important; }
.sort-hint { font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .sort-hint { display: none; } }

/* 分類管理清單 */
.sec-list { list-style: none; padding: 0; margin: 0 0 12px; }
.sec-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sec-list li input { flex: 1; }

/* 登入頁 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 380px; padding: 30px 28px; }
.login-box .logo { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-box .form-control { height: 40px; }
.login-box .btn { width: 100%; height: 40px; margin-top: 6px; }
.login-box #msg { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--danger-text); }
.login-corner { position: fixed; top: 14px; right: 16px; }

/* 帳號管理 */
.group-checks { max-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 10px; }
.group-checks label { display: block; font-weight: 400; margin: 3px 0; }

/* Bootstrap 的 .table-responsive 在窄螢幕會加 #ddd 外框，深色模式下很刺眼；外框交給 .box */
.table-responsive { border: 0 !important; margin-bottom: 0; }
.table > tbody + tbody { border-top: 0; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.table-responsive::-webkit-scrollbar-track { background: transparent; }

/* 動畫：按鈕按下、下拉選單、對話框 */
.btn { transition: background .15s, border-color .15s, color .15s, transform .12s; }
.btn:active { transform: scale(.96); }
.dropdown-menu { display: block; visibility: hidden; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s; }
.open > .dropdown-menu { visibility: visible; opacity: 1; transform: none; transition: opacity .16s ease, transform .16s ease; }
.dropdown-toggle .fa-angle-down { transition: transform .2s ease; }
.open > .dropdown-toggle .fa-angle-down { transform: rotate(180deg); }
.modal.fade .modal-dialog { transform: translateY(-14px) scale(.97); transition: transform .22s cubic-bezier(.2, .8, .3, 1); }
.modal.in .modal-dialog { transform: none; }
.tab-pane, .box { animation: olit-fade-in .25s ease-out; }
@keyframes olit-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

footer.status-bar { position: fixed; left: 0; right: 0; bottom: 0; height: 28px; line-height: 28px; padding: 0 24px;
  background: var(--surface); border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); z-index: 10; display: flex; gap: 28px; }
footer.status-bar a { color: var(--muted); }
footer.status-bar i { font-style: normal; color: var(--text); }
@media (max-width: 760px) { footer.status-bar { display: none; } }

/* 字級（theme.js 設定 <html data-font>）：整頁以 zoom 縮放 */
/* --z 給 fixed 元素換算視窗高度用：zoom 底下的 vh 也會被放大 */
html { --z: 1; }
html[data-font="s"] { --z: .9; } html[data-font="l"] { --z: 1.12; } html[data-font="xl"] { --z: 1.25; }
html[data-font="s"] body, html[data-font="l"] body, html[data-font="xl"] body { zoom: var(--z); }
.font-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px 6px 16px; color: var(--text); white-space: nowrap; }
.font-opts { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.font-opts button { border: 0; background: var(--surface); color: var(--muted); padding: 3px 8px; font-size: 12px; cursor: pointer; transition: background .12s, color .12s; }
.font-opts button + button { border-left: 1px solid var(--border); }
.font-opts button:hover { background: var(--hover); color: var(--text); }
html[data-font="s"] .font-opts [data-font-set="s"], html[data-font="m"] .font-opts [data-font-set="m"],
html[data-font="l"] .font-opts [data-font-set="l"], html[data-font="xl"] .font-opts [data-font-set="xl"] { background: var(--accent); color: var(--accent-fg); }

/* ---------- 專案筆記本 ---------- */
.toast-msg { bottom: 110px; }
.notes-bubble { position: fixed; right: 24px; bottom: 44px; z-index: 1040; width: 54px; height: 54px; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-fg); font-size: 22px; cursor: pointer;
  box-shadow: 0 8px 24px var(--shadow); transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), background .15s; }
.notes-bubble:hover { transform: scale(1.07); background: var(--accent-hover); }
.notes-bubble:active { transform: scale(.94); }
.notes-bubble:focus { outline: none; } .notes-bubble:focus-visible { box-shadow: 0 0 0 4px var(--ring), 0 8px 24px var(--shadow); }
.notes-bubble.active { transform: rotate(-8deg); }
.nb-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--fail); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; border: 2px solid var(--bg); }
.notes-panel { position: fixed; right: 24px; bottom: 108px; z-index: 1041; width: 420px; max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh / var(--z) - 160px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 48px var(--shadow);
  visibility: hidden; opacity: 0; transform: translateY(12px) scale(.96); transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
.notes-panel.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .18s ease, transform .18s ease; }
.np-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.np-title-main { font-weight: 700; white-space: nowrap; }
.np-title-main .fa { color: var(--muted); margin-right: 2px; }
.np-head select { flex: 1; min-width: 0; font-weight: 600; }

/* 新增區：平常是一顆醒目的大按鈕，按下展開表單 */
.np-compose { padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg); }
.np-new { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text);
  transition: border-color .15s, background .15s, transform .12s; }
.np-new:hover { border-color: var(--accent); background: var(--hover); }
.np-new:active { transform: scale(.99); }
.np-new:focus { outline: none; } .np-new:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.np-new > .fa { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-size: 15px; }
.np-new b { display: block; font-size: 14px; }
.np-new small { display: block; color: var(--muted); font-size: 12px; }
.np-form { display: none; }
.np-compose.writing .np-new { display: none; }
.np-compose.writing .np-form { display: block; animation: olit-fade-in .18s ease-out; }
/* 狀態：同一個框裡的分段切換，無彩色；選中的那格有滑動底色 */
.np-status-pick { position: relative; display: flex; margin-bottom: 8px; padding: 3px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); }
.np-st { position: relative; z-index: 1; flex: 1; margin: 0; padding: 4px 6px; text-align: center; font-size: 12px; font-weight: 500;
  color: var(--muted); cursor: pointer; user-select: none; border-radius: 6px; transition: color .18s; white-space: nowrap; }
.np-st input { position: absolute; opacity: 0; pointer-events: none; }
.np-st:hover { color: var(--text); }
.np-st:has(input:checked) { color: var(--accent-fg); font-weight: 600; }
.np-st:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--ring); }
.np-st-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 6px; background: var(--accent);
  box-shadow: 0 1px 2px var(--shadow); transition: left .22s cubic-bezier(.4, 0, .2, 1), width .22s cubic-bezier(.4, 0, .2, 1); }
.np-status-pick.no-anim .np-st-thumb, .np-status-pick.no-anim .np-st { transition: none; }
.np-form textarea { resize: vertical; min-height: 84px; font-size: 13px; }
.np-form-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.np-pin-toggle { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; user-select: none; }
.np-pin-toggle input { margin: 0; }
.np-pin-toggle:has(input:checked) { background: var(--warn-bg); color: var(--warn-fg); border-color: transparent; }
.np-hint { margin-left: auto; font-size: 11px; color: var(--faint); white-space: nowrap; }
.np-submit { padding-left: 14px; padding-right: 14px; }
.np-scroll { flex: 1; min-height: 0; overflow: auto; }
.np-filters { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.np-filters a { padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--muted); text-decoration: none; }
.np-filters a:hover { background: var(--hover); color: var(--text); }
.np-filters a.on { background: var(--accent); color: var(--accent-fg); }
.np-filters a i { font-style: normal; opacity: .7; }
.np-pins { padding: 8px 12px; background: var(--warn-bg); border-bottom: 1px solid var(--border); }
.np-title { font-size: 12px; font-weight: 600; color: var(--warn-fg); margin-bottom: 6px; }
.np-list { padding: 10px 12px; }
.notes-empty { text-align: center; padding: 36px 10px; font-size: 13px; }
.notes-empty .fa { display: block; font-size: 28px; margin-bottom: 8px; opacity: .5; }
.note { padding: 9px 11px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  animation: olit-fade-in .2s ease-out; transition: box-shadow .3s, border-color .3s; }
.note.in-pin { border-color: transparent; box-shadow: 0 1px 2px var(--shadow); }
.note.is-done .note-body { color: var(--muted); }
.note.flash { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.note-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.note-meta { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-meta b { color: var(--text); font-weight: 600; }
.note-acts { margin-left: auto; display: flex; gap: 2px; flex-shrink: 0; opacity: .75; transition: opacity .15s; }
.note:hover .note-acts { opacity: 1; }
.note-acts .btn-icon { width: 24px; height: 22px; font-size: 12px; }
.note-acts .js-n-pin.on { color: var(--warn); }
.note-body { margin-top: 6px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.55; }
.note-edit-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.note-st { display: inline-block; flex-shrink: 0; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 0; background: var(--neutral-bg); color: var(--neutral-fg); line-height: 18px; }
select.note-st { cursor: pointer; -webkit-appearance: none; appearance: none; }
select.note-st:focus { outline: none; box-shadow: 0 0 0 2px var(--ring); }
select.note-st option { background: var(--surface); color: var(--text); }
.note-st.n-todo { background: var(--info-bg); color: var(--info-fg); }
.note-st.n-doing { background: var(--warn-bg); color: var(--warn-fg); }
.note-st.n-done { background: var(--ok-bg); color: var(--ok-fg); }
.note-st.n-hold { background: var(--fail-bg); color: var(--fail-fg); }
@media (max-width: 760px) {
  .notes-bubble { right: 16px; bottom: 16px; }
  .notes-panel { right: 16px; bottom: 80px; height: calc(100vh / var(--z) - 120px); }
}

/* 群組頁：專案置頂區 */
.project-pins { margin-bottom: 16px; border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: var(--r);
  background: var(--surface); animation: olit-fade-in .25s ease-out; }
.project-pins.empty { display: none; }
.pp-head { display: flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.pp-head .fa-thumb-tack { color: var(--warn); }
.pp-more { margin-left: auto; font-size: 12px; font-weight: 400; }
.pp-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; transition: background .12s; }
.pp-item + .pp-item { border-top: 1px solid var(--line); }
.pp-item:hover { background: var(--hover); }
.pp-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-meta { font-size: 12px; flex-shrink: 0; }

/* 帳號與身分：身分的權限矩陣 */
@media (min-width: 992px) { .modal-xl { width: 960px; } }
.matrix-bar { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.matrix-bar .right { margin-left: auto; font-size: 12px; }
.mx-card { border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 8px; transition: border-color .15s, box-shadow .15s; }
.mx-card.on { border-color: var(--border-strong); box-shadow: inset 3px 0 0 var(--ok); }
.mx-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; }
.mx-toggle { color: var(--text); text-decoration: none !important; }
.mx-toggle .fa { width: 10px; color: var(--muted); transition: transform .2s; }
.mx-card.open .mx-toggle .fa { transform: rotate(90deg); }
.mx-sum { font-size: 12px; color: var(--muted); }
.mx-sum b { color: var(--text); font-weight: 600; }
.mx-flags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.mx-flags label { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; user-select: none; transition: background .12s, border-color .12s; }
.mx-flags label:hover { background: var(--hover); }
.mx-flags label:has(input:checked) { background: var(--info-bg); border-color: transparent; color: var(--info-fg); }
.mx-flags input { margin: 0; }
.mx-body { display: none; max-height: 300px; overflow: auto; border-top: 1px solid var(--line); }
.mx-card.open .mx-body { display: block; animation: olit-fade-in .2s ease-out; }
.mx-table { margin: 0; }
.mx-table > thead > tr > th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.mx-table td:first-child, .mx-table th:first-child { padding-left: 14px; }
.mx-table tr.mx-all > td { background: var(--bg); }
.mx-table input[type=checkbox] { width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer; }
.mx-table input.by-all { opacity: .45; cursor: not-allowed; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 999px; font-weight: 400; cursor: pointer; }
.chip:has(input:checked) { background: var(--info-bg); border-color: transparent; color: var(--info-fg); }
.chip input { margin: 0; }
.proj-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 9px; border-radius: 999px; background: var(--neutral-bg);
  color: var(--neutral-fg); font-size: 12px; white-space: nowrap; }
.proj-chip b { color: var(--text); }
.ident-checks { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px; }
.ident-opt { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 6px 8px; border-radius: 6px; font-weight: 400; cursor: pointer; }
.ident-opt:hover { background: var(--hover); }
.ident-opt input { margin-top: 3px; }
.nowrap { white-space: nowrap; }

/* ---------- 筆記附件 ---------- */
.note-main.editing { margin-top: 6px; }
.na { margin-top: 8px; }
.na-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.na-img-wrap { position: relative; }
.na-img { display: block; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg);
  cursor: zoom-in; transition: border-color .15s, transform .15s; }
.na-img:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.na-img img { display: block; height: 92px; max-width: 180px; object-fit: cover; }
.na-imgs:has(.na-img-wrap:only-child) .na-img img { height: auto; max-height: 220px; max-width: 100%; object-fit: contain; }
.na-file-row { position: relative; display: flex; margin-top: 6px; }
.na-file { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); text-decoration: none !important; transition: background .12s, border-color .12s; }
.na-file:hover { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.na-ic { font-size: 18px; color: var(--muted); }
.na-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.na-size { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.na-go { color: var(--muted); }
.na-del { position: absolute; top: -6px; right: -6px; z-index: 1; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
  background: var(--fail); color: #fff; font-size: 11px; line-height: 20px; cursor: pointer; box-shadow: 0 1px 3px var(--shadow); }
.note-edit-acts .grow { flex: 1; }
.note-edit-acts { align-items: center; }
.np-attach { position: relative; margin: 0; }
.np-attach.busy::after { content: attr(data-p); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-radius: inherit; font-size: 11px; }
.np-files { display: none; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.np-files:not(:empty) { display: flex; }
.np-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 4px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); font-size: 12px; }
.np-file img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; }
.np-file > .fa { width: 28px; text-align: center; font-size: 16px; color: var(--muted); }
.np-file-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-file button { border: 0; background: none; color: var(--muted); padding: 0 4px; cursor: pointer; }
.np-file button:hover { color: var(--danger-text); }
.np-compose.drop { outline: 2px dashed var(--info); outline-offset: -4px; background: var(--info-bg); }

/* ---------- 附件檢視器（掛在 <html> 底下，不受字級 zoom 影響） ---------- */
html.lb-lock, html.lb-lock body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 200000; display: none; flex-direction: column; background: rgba(9, 9, 11, .97); color: #f4f4f5;
  font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif; font-size: 14px; }
.lb.open { display: flex; animation: olit-fade-in .18s ease-out; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(0, 0, 0, .35); flex-shrink: 0; }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-count { color: #a1a1aa; font-size: 12px; flex-shrink: 0; }
.lb-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.lb-zoom { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
.lb.is-pdf .lb-zoom { display: none; }
.lb-btn, .lb-pct { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent; color: #f4f4f5; font-size: 16px; cursor: pointer; text-decoration: none !important; }
.lb-pct { font-size: 12px; min-width: 52px; font-variant-numeric: tabular-nums; }
.lb-btn:hover, .lb-pct:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: none; user-select: none; }
.lb-img { max-width: 100%; max-height: 100%; transform-origin: center center; cursor: zoom-in; -webkit-user-drag: none; }
.lb.zoomed .lb-img { cursor: grab; }
.lb.zoomed .lb-stage:active .lb-img { cursor: grabbing; }
.lb-img.anim { transition: transform .2s ease; }
.lb.loading .lb-stage::after { content: ""; position: absolute; width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%; animation: lb-spin .8s linear infinite; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lb-pdf { display: none; width: 100%; height: 100%; border: 0; background: #fff; }
.lb.is-pdf .lb-img { display: none; }
.lb.is-pdf .lb-pdf { display: block; }
.lb-nav { position: absolute; top: 50%; width: 44px; height: 64px; margin-top: -32px; border: 0; border-radius: 10px;
  background: rgba(0, 0, 0, .35); color: #fff; font-size: 30px; cursor: pointer; transition: background .15s; }
.lb-nav:hover { background: rgba(0, 0, 0, .6); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
@media (max-width: 767px) {
  .lb-nav { display: none !important; }      /* 手機用左右滑動切換 */
  .lb-zoom .lb-btn { display: none; }        /* 手機用雙指縮放 */
}
.np-attach input[type=file] { display: none; }   /* Bootstrap 3 會把 file input 設成 block，蓋過 hidden */
.np-form-bar .np-pin-toggle, .np-form-bar .btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 760px) {
  .np-hint { display: none; }
  .np-form-bar .js-compose-cancel { margin-left: auto; }
}
