/* 雲夥伴 2.0 — 介面樣式（參考 Paperclip 的中性灰階設計） */
:root {
  --bg: #ffffff;
  --fg: #1c1c1c;
  --muted: #f5f5f5;
  --muted-fg: #737373;
  --subtle-fg: #a3a3a3;
  --border: #ebebeb;
  --border-strong: #d9d9d9;
  --sidebar: #fafafa;
  --hover: #f0f0f0;
  --active: #e9e9e9;
  --primary: #1c1c1c;
  --primary-fg: #ffffff;
  --ring: #a3a3a3;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --orange: #ea580c;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --violet: #7c3aed;
  --gray: #a3a3a3;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --font: "Inter", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  /* 深藍色系（海軍藍） */
  --bg: #0f1a2e;
  --fg: #e4eaf5;
  --muted: #17243d;
  --muted-fg: #97a6c2;
  --subtle-fg: #61719a;
  --border: #22314f;
  --border-strong: #2f4166;
  --sidebar: #0b1526;
  --hover: #1a2846;
  --active: #213253;
  --primary: #e4eaf5;
  --primary-fg: #0f1a2e;
  --ring: #4b6bb0;
  --red: #f87171;
  --red-soft: #3a1c2a;
  --orange: #fb923c;
  --amber: #fbbf24;
  --amber-soft: #352a17;
  --green: #34d399;
  --green-soft: #12332f;
  --blue: #60a5fa;
  --blue-soft: #172c52;
  --violet: #a78bfa;
  --gray: #7d8db0;
  --shadow: none;
  --shadow-lg: 0 10px 40px rgba(2, 8, 23, 0.65), 0 2px 6px rgba(2, 8, 23, 0.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.lg { width: 20px; height: 20px; }

/* ── 版面 ── */
#app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.sidebar-scroll { flex: 1; overflow: auto; padding: 8px 12px 12px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted-fg); min-width: 0; overflow: hidden; white-space: nowrap; }
.crumbs a:hover { color: var(--fg); }
.crumbs .cur { color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.body { flex: 1; display: flex; min-height: 0; }
.ctx-sidebar { width: 228px; flex: none; border-right: 1px solid var(--border); padding: 16px 12px; overflow: auto; }
.content { flex: 1; overflow: auto; min-width: 0; }
.page { max-width: 1080px; margin: 0 auto; padding: 28px 32px 80px; }
.page.wide { max-width: 1400px; }
.page.full { max-width: none; }
.props-panel { width: 300px; flex: none; border-left: 1px solid var(--border); overflow: auto; padding: 16px 18px; }

/* ── 側欄 ── */
.co-switch { display: flex; align-items: center; gap: 8px; padding: 10px 8px; margin: 4px 0 6px; border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.co-switch:hover { background: var(--hover); }
.co-logo { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.co-switch .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--fg); cursor: pointer; margin: 1px 0; white-space: nowrap; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--active); font-weight: 500; }
.nav-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fg); color: var(--bg); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.nav-item .live { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.nav-section { font-size: 11px; color: var(--muted-fg); padding: 16px 8px 4px; letter-spacing: 0.04em; }
.nav-sub { color: var(--muted-fg); font-size: 13px; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.ctx-section { font-size: 11px; color: var(--muted-fg); padding: 12px 8px 4px; }
.ctx-section:first-child { padding-top: 0; }
.ctx-sidebar .nav-item { font-size: 13.5px; }

/* ── 通用元件 ── */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); background: var(--bg); border-radius: var(--radius); cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 13px; box-shadow: var(--shadow); }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.primary:hover { opacity: 0.9; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 26px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted-fg); }
.subtle { color: var(--subtle-fg); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.b { font-weight: 600; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sep { height: 1px; background: var(--border); margin: 16px 0; }
.card { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 0; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
h1.title { font-size: 24px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2.section { font-size: 18px; margin: 28px 0 12px; font-weight: 700; }
h3.section { font-size: 12px; margin: 26px 0 10px; font-weight: 600; color: var(--muted-fg); letter-spacing: 0.06em; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; border: 1px solid var(--border-strong); color: var(--muted-fg); white-space: nowrap; font-weight: 500; }
.badge.green { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); background: var(--green-soft); }
.badge.amber { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); background: var(--amber-soft); }
.badge.red { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: var(--red-soft); }
.badge.blue { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, transparent); background: var(--blue-soft); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--muted); font-size: 12px; border: 1px solid var(--border); white-space: nowrap; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 4px; color: var(--muted-fg); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted-fg); }
.empty .i { width: 28px; height: 28px; margin-bottom: 8px; opacity: 0.6; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }

/* 表單 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted-fg); }
.input, .select, .textarea { width: 100%; border: 1px solid var(--border-strong); background: var(--bg); border-radius: var(--radius); padding: 7px 10px; outline: none; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent); }
.textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 280px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; padding-right: 28px; cursor: pointer; }
.select.bare { border-color: transparent; background-color: transparent; padding: 3px 24px 3px 6px; box-shadow: none; }
.select.bare:hover { background-color: var(--hover); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 34px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: 0.15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(14px); background: var(--primary-fg); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .t { font-weight: 500; }
.setting-row .d { font-size: 12.5px; color: var(--muted-fg); margin-top: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }

/* 頭像 */
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex: none; position: relative; }
.av.sm { width: 20px; height: 20px; font-size: 10px; }
.av.xs { width: 18px; height: 18px; font-size: 9.5px; }
.av.lg { width: 64px; height: 64px; font-size: 26px; border-radius: 18px; }
.av.xl { width: 120px; height: 120px; font-size: 52px; border-radius: 30px; }
.av > svg { width: 100%; height: 100%; display: block; border-radius: inherit; }
.av.bot { overflow: visible; }
.av.bot > svg { overflow: hidden; }
.av-edit { cursor: pointer; position: relative; }
.av-edit::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 2px var(--accent, #6d8bff); opacity: 0; transition: opacity .15s; }
.av-edit:hover::after, .av-edit:focus-visible::after { opacity: 1; }
.av-pen { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border-strong); display: grid; place-items: center; color: var(--fg); }
.av-pen svg { width: 12px; height: 12px; }
/* 頭像編輯器 */
.av-ed .dialog-body { padding-top: 6px; }
.av-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; }
.av-prev { display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.av-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--border); }
.av-row:first-of-type { border-top: 0; }
.av-l { font-size: 13px; color: var(--muted-fg); padding-top: 6px; }
.av-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.av-c { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); cursor: pointer; padding: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted-fg); background: var(--bg); }
.av-c.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
.av-c.custom { position: relative; overflow: hidden; }
.av-c.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.av-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.av-o { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 70px; padding: 6px 2px 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; color: var(--muted-fg); }
.av-o .av { width: 48px; height: 48px; }
.av-o.on { border-color: var(--fg); color: var(--fg); background: var(--muted); }
.av-o:hover { border-color: var(--border-strong); }
@media (max-width: 640px) { .av-grid { grid-template-columns: 1fr; } .av-row { grid-template-columns: 1fr; gap: 4px; } }
.av.board { background: var(--muted); color: var(--muted-fg); border: 1px solid var(--border-strong); }
.av .st { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg); }
.av.lg .st { width: 14px; height: 14px; border-width: 3px; }
.st-running { background: var(--green); animation: pulse 1.4s infinite; }
.st-idle, .st-active { background: var(--gray); }
.st-paused { background: var(--amber); }
.st-error { background: var(--red); }
.st-pending_approval { background: var(--blue); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* 任務狀態圖示 */
.sicon { width: 14px; height: 14px; border-radius: 50%; border: 1.6px solid var(--gray); flex: none; display: inline-grid; place-items: center; position: relative; }
.sicon.backlog { border-style: dashed; }
.sicon.todo { border-color: var(--muted-fg); }
.sicon.in_progress { border-color: var(--amber); background: conic-gradient(var(--amber) 0 50%, transparent 0); background-clip: content-box; padding: 2px; }
.sicon.in_review { border-color: var(--violet); background: conic-gradient(var(--violet) 0 75%, transparent 0); background-clip: content-box; padding: 2px; }
.sicon.blocked { border-color: var(--red); }
.sicon.paused { border-color: var(--amber); }
.sicon.paused::before, .sicon.paused::after { content: ""; position: absolute; width: 1.8px; height: 6px; background: var(--amber); top: 50%; transform: translateY(-50%); }
.sicon.paused::before { left: 3.3px; }
.sicon.paused::after { right: 3.3px; }
.sicon.blocked::after { content: ""; width: 7px; height: 1.6px; background: var(--red); }
.sicon.done { border-color: var(--green); background: var(--green); }
.sicon.done::after { content: ""; width: 3px; height: 6px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: translateY(-1px) rotate(45deg); }
.sicon.cancelled { border-color: var(--gray); background: var(--gray); }
.sicon.cancelled::after { content: ""; width: 6px; height: 1.6px; background: #fff; transform: rotate(45deg); }
.prio { display: inline-flex; color: var(--muted-fg); }
.prio.critical { color: var(--red); }
.prio.high { color: var(--orange); }
.prio.medium { color: var(--amber); }

/* 列表 */
.list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border); cursor: pointer; min-height: 42px; }
.li:last-child { border-bottom: 0; }
.li:hover { background: var(--hover); }
.li .ident { font-family: var(--mono); font-size: 12px; color: var(--muted-fg); min-width: 58px; }
.li .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .meta { color: var(--muted-fg); font-size: 12px; white-space: nowrap; }
.li.unread .t { font-weight: 600; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--muted); border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 600; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted-fg); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* 分頁籤 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 8px 12px; color: var(--muted-fg); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg); border-color: var(--fg); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--muted-fg); display: inline-flex; align-items: center; gap: 5px; }
.seg button.on { background: var(--active); color: var(--fg); }

/* 儀表板 */
.stat { padding: 18px; }
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-weight: 500; margin-top: 2px; }
.stat .d { font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
.chart { padding: 16px 18px; }
.chart .h { font-weight: 600; font-size: 13.5px; }
.chart svg { width: 100%; height: 110px; display: block; margin-top: 12px; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted-fg); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.run-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 170px; cursor: pointer; }
.run-card:hover { border-color: var(--border-strong); }
.run-card .box { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13px; }
.bar { height: 6px; background: var(--muted); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--fg); border-radius: 99px; }
.bar.warn > i { background: var(--amber); }
.bar.hot > i { background: var(--red); }
.bar.green > i { background: var(--green); }

/* 看板 */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.board-col { background: var(--sidebar); border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-height: 300px; }
.board-col.drop { border-color: var(--ring); background: var(--hover); }
.board-col h4 { margin: 2px 4px 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kcard { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--border-strong); }
.kcard .t { font-size: 13px; font-weight: 500; margin: 4px 0 8px; }

/* 任務詳細 */
.issue-title { font-size: 22px; font-weight: 700; border: 0; outline: none; width: 100%; padding: 2px 0; background: transparent; letter-spacing: -0.01em; }
.issue-desc { border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; margin: 0 -8px; cursor: text; min-height: 40px; }
.issue-desc:hover { border-color: var(--border); }
.prop { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; }
.prop > .k { color: var(--muted-fg); }
.thread { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.msg { display: flex; gap: 10px; }
.msg .bubble { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.msg.system .bubble { background: var(--muted); border-style: dashed; }
.msg .who { font-size: 12.5px; color: var(--muted-fg); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg .who b { color: var(--fg); font-weight: 600; }
.composer { border: 1px solid var(--border-strong); border-radius: 10px; margin-top: 16px; overflow: hidden; }
.composer textarea { border: 0; width: 100%; min-height: 80px; padding: 12px 14px; outline: none; resize: vertical; background: transparent; }
.composer .bar2 { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--sidebar); }
.timeline-item { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted-fg); align-items: center; padding-left: 6px; }

/* Markdown */
.md { line-height: 1.65; word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin: 1em 0 0.4em; line-height: 1.3; }
.md h1 { font-size: 1.4em; }
.md h2 { font-size: 1.2em; }
.md h3 { font-size: 1.05em; }
.md p { margin: 0.5em 0; }
.md ul, .md ol { padding-left: 1.4em; margin: 0.4em 0; }
.md code { background: var(--muted); border: 1px solid var(--border); padding: 0 4px; border-radius: 4px; }
.md pre { background: var(--muted); border: 1px solid var(--border); padding: 10px 12px; border-radius: 8px; overflow: auto; }
.md pre code { background: none; border: 0; padding: 0; }
.md blockquote { margin: 0.5em 0; padding: 0 12px; border-left: 3px solid var(--border-strong); color: var(--muted-fg); }
.md a { color: var(--blue); text-decoration: underline; }
.md table { border-collapse: collapse; margin: 0.5em 0; }
.md th, .md td { border: 1px solid var(--border); padding: 4px 8px; }
.md hr { border: 0; border-top: 1px solid var(--border); }

/* 執行日誌 */
.log { font-family: var(--mono); font-size: 12px; line-height: 1.6; background: var(--sidebar); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; max-height: 70vh; overflow: auto; }
.log .ln { display: grid; grid-template-columns: 70px 74px 1fr; gap: 10px; padding: 2px 0; }
.log .ln .k { color: var(--subtle-fg); }
.log .ln .x { white-space: pre-wrap; word-break: break-word; }
.log .ln.error .x, .log .ln.stderr .x { color: var(--red); }
.log .ln.system .x { color: var(--muted-fg); }
.log .ln.tool .x { color: var(--violet); }
.log .ln.assistant .x { color: var(--fg); }
.log details summary { cursor: pointer; color: var(--muted-fg); }

/* 組織圖 */
.org { overflow: auto; padding: 24px 8px 40px; }
.org ul { display: flex; justify-content: center; padding: 24px 0 0; margin: 0; position: relative; list-style: none; }
.org li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 24px 10px 0; }
.org li::before, .org li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 24px; border-top: 1.5px solid var(--border-strong); }
.org li::after { right: auto; left: 50%; border-left: 1.5px solid var(--border-strong); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 1.5px solid var(--border-strong); border-radius: 0 6px 0 0; }
.org li:first-child::after { border-radius: 6px 0 0 0; }
.org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 24px; border-left: 1.5px solid var(--border-strong); }
.org > ul { padding-top: 0; }
.org > ul > li { padding-top: 0; }
.org > ul > li::before, .org > ul > li::after { display: none; }
.org-node { border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 12px 14px; width: 190px; text-align: center; cursor: pointer; box-shadow: var(--shadow); }
.org-node:hover { border-color: var(--border-strong); }

/* 對話框／彈出層 */
#overlay { position: fixed; inset: 0; z-index: 50; display: none; }
#overlay.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.dialog { position: absolute; left: 50%; top: 8vh; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); max-height: 84vh; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.dialog.wide { width: min(860px, calc(100vw - 32px)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.dialog-head h2 { margin: 0; font-size: 16px; }
.dialog-body { padding: 16px 20px; }
.dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--bg); }
.palette { top: 12vh; width: min(620px, calc(100vw - 32px)); }
.palette input { border: 0; border-bottom: 1px solid var(--border); width: 100%; padding: 14px 18px; font-size: 15px; outline: none; background: transparent; }
.palette .res { max-height: 56vh; overflow: auto; padding: 6px; }
.palette .grp { font-size: 11px; color: var(--muted-fg); padding: 8px 10px 4px; }
.palette .opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.palette .opt.sel, .palette .opt:hover { background: var(--hover); }
.menu { position: absolute; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; min-width: 200px; z-index: 80; }
.menu .opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.menu .opt:hover { background: var(--hover); }
.menu .sep { margin: 4px 0; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: 0.2s; pointer-events: none; z-index: 80; font-size: 13px; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.callout { border: 1px solid var(--border); background: var(--sidebar); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.callout.warn { border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-soft); }
.callout.err { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.onboard { max-width: 560px; margin: 10vh auto; padding: 0 20px; }
#app > .onboard, #app > .standalone { grid-column: 1 / -1; width: 100%; box-sizing: border-box; }
.picker { display: grid; gap: 10px; }
.pick { border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.pick:hover { background: var(--hover); }
.pick.on { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.menu-btn { display: none; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: 0.2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .ctx-sidebar, .props-panel { display: none; }
  .page { padding: 20px 16px 60px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2, .two { grid-template-columns: 1fr; }
}

/* ═════════ 辦公室模式 ═════════ */
.content.full { overflow: hidden; }
.office { position: relative; width: 100%; height: 100%; background: radial-gradient(ellipse at 50% 30%, #2b3a67 0%, #141b33 70%); overflow: hidden; user-select: none; }
:root[data-theme="light"] .office { background: radial-gradient(ellipse at 50% 30%, #dbe7ff 0%, #a9bfe8 75%); }
#office-svg { width: 100%; height: 100%; display: block; cursor: grab; }
#office-svg.dragging { cursor: grabbing; }
.office .monitor { cursor: zoom-in; }
.office .monitor:hover .hover-ring { stroke-width: 10; }
.office .monitor.glow { filter: drop-shadow(0 0 10px rgba(56, 189, 248, .75)); }
.office .person { cursor: pointer; }
.scr-fo { width: 320px; height: 200px; box-sizing: border-box; padding: 10px 12px; font: 13px/1.35 var(--mono); color: #d1fae5; overflow: hidden; }
.scr-fo pre { margin: 0; white-space: pre-wrap; word-break: break-all; font: inherit; }
.scr-fo .scr-head { color: #7dd3fc; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font); }
.caret { animation: blink 1s steps(1) infinite; color: #4ade80; }
.blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.scr-saver { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: linear-gradient(135deg, hsl(var(--h) 60% 22%), hsl(calc(var(--h) + 60) 60% 14%)); margin: -10px -12px; padding: 10px 12px; width: 320px; height: 200px; box-sizing: border-box; font-family: var(--font); text-align: center; }
.scr-saver .logo { font-size: 44px; animation: float 3s ease-in-out infinite; }
.scr-saver .t { color: #e2e8f0; font-weight: 700; font-size: 17px; }
.scr-saver .s { color: #94a3b8; font-size: 12px; line-height: 1.3; }
@keyframes float { 50% { transform: translateY(-8px); } }
.office .anim-typing .arm.l { animation: typeL .35s ease-in-out infinite; transform-box: fill-box; transform-origin: top; }
.office .anim-typing .arm.r { animation: typeR .35s ease-in-out infinite .17s; transform-box: fill-box; transform-origin: top; }
@keyframes typeL { 50% { transform: translateY(-3px); } }
@keyframes typeR { 50% { transform: translateY(-3px); } }
.office .anim-think .head { animation: think 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom; }
@keyframes think { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.office .anim-idle .body { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-1.5px); } }
.office .bubble .bub.browser, .office .bubble .bub.image, .office .bubble .bub.text, .office .bubble .bub.code, .office .bubble .bub.think { filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.twinkle { animation: blink 2.4s steps(1) infinite; }
.wb { font: 11px/1.45 var(--font); color: #0f172a; padding: 6px 8px; }
.wb .h { font-weight: 800; color: #2563eb; margin-bottom: 2px; }
.office-hud { position: absolute; left: 14px; top: 14px; display: flex; gap: 10px; flex-wrap: wrap; pointer-events: none; }
.hud-card { background: rgba(15, 23, 42, .78); color: #e2e8f0; border: 1px solid rgba(148, 163, 184, .25); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.hud-card b { color: #fff; }
.office-ctrl { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; }
.office-style { background: rgba(15, 23, 42, .78); border-color: rgba(148, 163, 184, .3); backdrop-filter: blur(6px); margin-right: 4px; }
.office-style button { color: #cbd5e1; }
.office-style button.on { background: rgba(255, 255, 255, .16); color: #fff; }
#office-root.style-pixel { background: #241a2b; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 12px 12px; }
#office-root.style-flat { background: #e7e3db; }
:root[data-theme="dark"] #office-root.style-flat { background: #20232b; }
.office.style-pixel .anim-typing .arm.l { animation: pxType .5s steps(1) infinite; transform-box: view-box; }
.office.style-pixel .anim-typing .arm.r { animation: pxType .5s steps(1) infinite .25s; transform-box: view-box; }
@keyframes pxType { 50% { transform: translateY(-1px); } }
.office.style-pixel .anim-think .head { animation: none; }
.office.style-pixel .dots rect { animation: blink 1.2s steps(1) infinite; }
.office.style-pixel .dots rect:nth-child(2) { animation-delay: .3s; }
.office.style-pixel .dots rect:nth-child(3) { animation-delay: .6s; }
.office.style-pixel .anim-idle .body { animation: pxBreathe 2.4s steps(1) infinite; transform-box: view-box; }
@keyframes pxBreathe { 50% { transform: translateY(1px); } }
.office.style-pixel .zz { animation: pxFloat 2s steps(2) infinite; transform-box: view-box; }
@keyframes pxFloat { 50% { transform: translateY(-2px); } }
.office.style-pixel .bubble .bub { filter: none !important; }
.office.style-pixel .wb { font-family: ui-monospace, "Courier New", monospace; font-size: 10.5px; }
.office.style-flat .anim-typing .arm.l, .office.style-flat .anim-typing .arm.r { transform-box: view-box; }
@keyframes flType { 50% { transform: translateY(-2px); } }
.office.style-flat .anim-think .head { animation: flThink 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes flThink { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
.office.style-flat .fl-card.glow { filter: drop-shadow(0 0 14px rgba(99, 102, 241, .45)); }
.office.style-flat .monitor.glow { filter: none; }
.office.style-flat .monitor:hover .hover-ring { stroke-width: 3; }
.office.style-flat .bubble .bub { filter: none !important; }
.office.style-flat .wb { font-size: 12px; line-height: 1.55; }
.office .pulse { animation: blink 1.2s ease-in-out infinite; }
.office-roster { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; background: rgba(15, 23, 42, .78); border: 1px solid rgba(148, 163, 184, .25); border-radius: 16px; padding: 6px 8px; backdrop-filter: blur(6px); max-width: calc(100% - 28px); overflow-x: auto; }
.roster-item { display: flex; align-items: center; gap: 4px; border: 0; background: transparent; color: #fff; padding: 4px 6px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.roster-item:hover { background: rgba(255,255,255,.1); }
.roster-item.on { background: rgba(34, 197, 94, .18); }

/* 放大的螢幕 */
#screen-zoom { position: fixed; inset: 0; z-index: 70; display: none; }
#screen-zoom.open { display: block; }
.zbackdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .7); backdrop-filter: blur(3px); }
.zwrap { position: absolute; inset: 4vh 3vw; display: grid; grid-template-columns: 1fr 280px; gap: 16px; animation: zin .18s ease-out; }
@keyframes zin { from { transform: scale(.94); opacity: 0; } }
.zmonitor { background: #0b0f1a; border: 10px solid #1f2937; border-radius: 16px; display: flex; flex-direction: column; min-height: 0; box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 0 0 1px #374151; }
.zbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #111827; color: #e5e7eb; font-size: 13px; border-bottom: 1px solid #1f2937; }
.zbar .muted { color: #9ca3af; }
.zdots i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; background: #ef4444; }
.zdots i:nth-child(2) { background: #f59e0b; }
.zdots i:nth-child(3) { background: #22c55e; }
.zlive { color: #f87171; font-weight: 700; animation: blink 1.2s steps(1) infinite; }
.zscreen { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.zbrowser { height: 100%; display: flex; flex-direction: column; }
.zurl { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #1f2937; color: #d1d5db; font-size: 12px; }
.zframe { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.zframe img { max-width: 100%; max-height: 100%; display: block; aspect-ratio: 1280 / 800; object-fit: contain; }
.zframe { aspect-ratio: auto; }
.zcursor { position: absolute; width: 22px; height: 22px; margin: -3px 0 0 -3px; display: none; pointer-events: none; transition: left .25s ease, top .25s ease; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 2l7 19 2.6-7.4L20 11z' fill='%23facc15' stroke='%23000' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.zcursor.show { display: block; }
.zripple { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 3px solid #facc15; pointer-events: none; animation: ripple .7s ease-out forwards; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.zempty { color: #9ca3af; font-size: 16px; }
.zeditor { height: 100%; display: flex; flex-direction: column; background: #0f172a; }
.ztab { padding: 8px 14px; background: #1e293b; color: #7dd3fc; font-size: 13px; font-weight: 600; border-bottom: 1px solid #334155; }
.zeditor pre { flex: 1; margin: 0; padding: 16px 18px; color: #d1fae5; font: 14px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; overflow: auto; }
.zimage { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; background: radial-gradient(circle, #312e81 0%, #0b0f1a 75%); }
.zimg { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.zimg img { max-height: 100%; max-width: 100%; border-radius: 12px; box-shadow: 0 10px 40px rgba(124, 58, 237, .45); }
.zsteps { display: flex; gap: 8px; }
.zstep { padding: 4px 12px; border-radius: 99px; background: #1e293b; color: #64748b; font-size: 12.5px; }
.zstep.on { background: #7c3aed; color: #fff; }
.zprompt { color: #c4b5fd; font-size: 13px; max-width: 720px; text-align: center; }
.zidle { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #e5e7eb; padding: 30px; overflow: auto; text-align: center; }
.zidle-emoji { font-size: 64px; animation: float 3s ease-in-out infinite; }
.zlast { max-width: 640px; background: #111827; border: 1px solid #1f2937; border-radius: 12px; padding: 12px 16px; text-align: left; }
.zlast .muted { color: #9ca3af; }
.zside { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.zkv { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.zkv > span { color: var(--muted-fg); font-size: 11.5px; }
.zthought { background: var(--blue-soft); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.zacts { font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; color: var(--muted-fg); }
@media (max-width: 900px) { .zwrap { grid-template-columns: 1fr; inset: 2vh 2vw; overflow: auto; } .zmonitor { min-height: 55vh; } }

/* 說明頁 */
.help .md h3 { font-size: 15px; margin-top: 1.6em; }
.help .md table { width: 100%; font-size: 13.5px; }
.help .md th { background: var(--sidebar); text-align: left; }
.help .md td, .help .md th { padding: 6px 10px; vertical-align: top; }
.help .md li { margin: 3px 0; }

/* @ 提及員工快選 */
.mention-pop { position: fixed; z-index: 300; width: 300px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; font-size: 13px; }
.mention-h { padding: 6px 8px 4px; font-size: 11.5px; color: var(--muted-fg); }
.mention-li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.mention-li.on, .mention-li:hover { background: var(--hover); }
.mention-li .nm { font-weight: 500; white-space: nowrap; }
.mention-li .no { font-family: var(--mono); font-size: 11.5px; color: var(--muted-fg); }
.mention-li .rl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-fg); font-size: 12px; text-align: right; }
.msg .bubble .mention { color: var(--blue); font-weight: 500; }

/* 任務樹 */
.tree-tg { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: none; border: 0; background: none; padding: 0; border-radius: 4px; color: var(--muted-fg); cursor: pointer; margin-right: -4px; }
button.tree-tg:hover { background: var(--active); color: var(--fg); }
.li.sub { position: relative; background: var(--sidebar); }
.li.sub:hover { background: var(--hover); }
.li.sub .tree-ln { position: absolute; top: 0; height: 50%; width: 12px; border-left: 1.5px solid var(--border-strong); border-bottom: 1.5px solid var(--border-strong); border-bottom-left-radius: 5px; pointer-events: none; }

/* 附加圖片 */
[data-attach].drop { outline: 2px dashed var(--blue); outline-offset: 4px; border-radius: 10px; }
.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0 2px; }
.composer .attach-strip { padding: 4px 12px 8px; }
.attach-strip .att { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--muted); }
.attach-strip .att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.att-x svg { width: 12px; height: 12px; }
.att-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 100%; font-size: 10.5px; color: var(--muted-fg); padding: 4px; text-align: center; word-break: break-all; }
.att-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-thumbs img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.att-thumbs .att-file { width: 120px; height: 60px; border: 1px solid var(--border); border-radius: 8px; }
.zsrc { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted-fg); }
.zsrc img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* 多選與批次操作 */
.selbox { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--border-strong); border-radius: 4px; background: var(--bg); cursor: pointer; display: inline-block; visibility: hidden; position: relative; }
.selbox:hover { border-color: var(--fg); }
[data-sel]:hover .selbox, body.sel-mode .selbox, [data-sel].sel .selbox { visibility: visible; }
@media (hover: none) { .selbox { visibility: visible; } }
[data-sel].sel { background: var(--blue-soft) !important; }
[data-sel].sel .selbox { background: var(--blue); border-color: var(--blue); }
[data-sel].sel .selbox::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.kcard .selbox { position: absolute; top: 8px; right: 8px; }
.kcard { position: relative; }
#selbar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70; width: max-content; display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 14px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); flex-wrap: wrap; animation: barIn 0.16s ease-out; }
#selbar .n { font-size: 13px; white-space: nowrap; }
#selbar .vsep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 2px; }
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
:root[data-theme="dark"] .btn.danger-solid { background: #dc2626; border-color: #dc2626; }
.menu-title { padding: 6px 10px 4px; font-size: 11.5px; color: var(--muted-fg); }
.menu .opt.disabled { opacity: 0.45; cursor: default; }
.menu .opt.disabled:hover { background: none; }
.menu .opt .grow { flex: 1; }

/* 教育訓練對話 */
.chat { border: 1px solid var(--border); border-radius: 12px 12px 0 0; border-bottom: 0; padding: 18px 18px 8px; height: calc(100vh - 430px); min-height: 320px; overflow: auto; background: var(--sidebar); display: flex; flex-direction: column; gap: 14px; }
.chat-composer { border-radius: 0 0 12px 12px; margin-top: 0; }
.chat-empty { margin: auto; text-align: center; color: var(--muted-fg); display: flex; flex-direction: column; align-items: center; padding: 30px 10px; }
.cmsg { display: flex; gap: 10px; max-width: 88%; }
.cmsg.me { align-self: flex-end; flex-direction: column; align-items: flex-end; }
.cmsg.them { align-self: flex-start; }
.cmsg .cbody { padding: 9px 13px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); overflow-wrap: anywhere; }
.cmsg .cbody > :first-child { margin-top: 0; }
.cmsg .cbody > :last-child { margin-bottom: 0; }
.cmsg.me .cbody { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); border-bottom-right-radius: 4px; }
.cmsg.me .cbody a, .cmsg.me .cbody code { color: inherit; }
.cmsg.them .cbody { border-bottom-left-radius: 4px; }
.cmsg .cbody.err { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.cmsg .cmeta { font-size: 11.5px; color: var(--subtle-fg); margin-top: 3px; padding: 0 4px; }
.cmsg .cmeta a { color: var(--muted-fg); }
.cmsg .cmeta a:hover { text-decoration: underline; }
.cmsg.me .cmeta a { visibility: hidden; }
.cmsg.me:hover .cmeta a { visibility: visible; }
.cmsg.hl .cbody { box-shadow: 0 0 0 2px var(--amber); }
.sugs { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sug { border: 1px dashed color-mix(in srgb, var(--amber) 60%, transparent); background: var(--amber-soft); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.sug.saved, .sug.saved_company { border-style: solid; border-color: color-mix(in srgb, var(--green) 45%, transparent); background: var(--green-soft); }
.sug.dismissed { opacity: 0.55; background: transparent; border-color: var(--border); }
.typing { display: inline-flex; gap: 3px; vertical-align: middle; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-fg); animation: dotblink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotblink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* 記憶清單 */
.li.mem { align-items: flex-start; padding-top: 11px; padding-bottom: 11px; }
.li.mem .selbox, .li.mem .switch { margin-top: 2px; }
.mem-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.mem-src { height: 20px; font-size: 11.5px; }
a.mem-src:hover { border-color: var(--border-strong); color: var(--fg); }
.switch.sm { width: 28px; height: 16px; }
.switch.sm span::after { width: 12px; height: 12px; }
.switch.sm input:checked + span::after { transform: translateX(12px); }

body.sel-mode #toast { bottom: 84px; }

/* 上網查資料的螢幕 */
.zweb { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.zweb .zbrowser { flex: 1 1 auto; height: auto; min-height: 0; display: flex; flex-direction: column; }
.zweb .zurl .ellipsis { min-width: 0; }
.zweb .ztype { flex: 0 0 auto; height: 45%; min-height: 0; border-top: 1px solid #1f2937; display: flex; flex-direction: column; }
.zweb .ztype.small { height: 32%; }
.zweb .ztype:only-child, .zweb .zbrowser[style*="flex:0 0 auto"] + .ztype { height: auto; flex: 1 1 0; min-height: 0; }
.zweb .ztype pre { flex: 1; min-height: 0; overflow: auto; margin: 0; }
.spin { width: 12px; height: 12px; border: 2px solid #475569; border-top-color: #93c5fd; border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 任務討論：員工正在輸入 */
.livemsg .bubble { border-style: dashed; }
.livemsg .lb-st { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); }
.livemsg .lb-stop { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: var(--red); text-decoration: none; }
.livemsg .lb-stop:hover { text-decoration: underline; }
.livemsg .lb-search { font-size: 12.5px; color: var(--muted-fg); display: flex; flex-direction: column; gap: 2px; }
.livemsg .lb-search:empty { display: none; }
.livemsg .lb-search a { color: var(--blue); }
.livemsg .lb-search + .lb-work, .livemsg .lb-search:not(:empty) ~ .lb-report { margin-top: 6px; }
.livemsg .lb-work { white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; color: var(--muted-fg); max-height: 160px; overflow: hidden; }
.livemsg .lb-report { white-space: pre-wrap; line-height: 1.65; }
.livemsg .lb-report:not(:empty) { margin-top: 8px; }
.livemsg .typing-now::after { content: "▍"; color: var(--green); animation: dotblink 1s infinite; margin-left: 1px; }

.cmsg .ctext { white-space: pre-wrap; }
.cmsg .ctext.typing-now::after { content: "▍"; color: var(--green); animation: dotblink 1s infinite; margin-left: 1px; }
.cmsg .cstop { display: inline-block; margin-top: 4px; color: var(--muted-fg); }

.zweblist { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px; background: #0f172a; color: #cbd5e1; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.zweblist .znote { color: #fbbf24; font-size: 13px; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.zweblist .q { color: #93c5fd; }
.zweblist .pg a { color: #e2e8f0; }
.zweblist .pg a:hover { text-decoration: underline; }

/* 能力卡片 */
.caps-title { font-weight: 600; margin: 18px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.caps { display: flex; flex-direction: column; gap: 10px; }
.capcard { padding: 0; overflow: hidden; }
.capcard .caphead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.capcard .caphead .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.capcard .capicon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--muted); color: var(--muted-fg); flex: none; }
.capcard.on .capicon { background: var(--blue-soft); color: var(--blue); }
.capcard .capbody { display: none; padding: 4px 14px 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.capcard.on .capbody { display: block; }
.cap.off { text-decoration: line-through; opacity: .7; }
.capcard.locked .caphead { cursor: default; }
.capcard.locked .switch { opacity: .45; }
.cap { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--muted); color: var(--muted-fg); white-space: nowrap; }
.caps-inline { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }

/* 使用者 */
.admin-banner { display: flex; align-items: center; gap: 6px; padding: 7px 20px; background: var(--blue-soft); color: var(--fg); font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--blue) 30%, transparent); }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: 8px; cursor: pointer; min-width: 0; text-align: left; }
.user-btn:hover { background: var(--hover); }
.standalone { display: flex; flex-direction: column; height: 100vh; }
.standalone .body { flex: 1; display: flex; min-height: 0; }
.menu .opt.disabled:has(.grow:only-child) { opacity: 1; }

/* 遠端瀏覽器 */
.rbrowser { position: absolute; left: 50%; top: 2vh; transform: translateX(-50%); width: min(1320px, 96vw, calc(94vh * 1.6 - 0px)); max-height: 96vh; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.rb-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--muted); }
.rb-bar .input { height: 32px; }
.rb-bar .btn.icon { font-size: 18px; line-height: 1; }
.rb-stage { position: relative; background: #0f172a; outline: none; aspect-ratio: 1280 / 800; max-height: calc(96vh - 100px); margin: 0 auto; width: 100%; }
.rb-stage img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: default; user-select: none; }
.rb-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; }
.rb-stage textarea { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none; pointer-events: none; }
.rb-foot { padding: 8px 12px; border-top: 1px solid var(--border); }

/* 組織圖（拖曳） */
.orgc-wrap { position: relative; overflow: auto; padding: 0 8px 24px; }
.orgc { position: relative; }
.orgc-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.orgc-lines path { fill: none; stroke: var(--border-strong); stroke-width: 1.6; }
.orgc-lines path.preview { stroke: var(--blue); stroke-width: 2.2; stroke-dasharray: 6 5; animation: orgDash .6s linear infinite; }
@keyframes orgDash { to { stroke-dashoffset: -22; } }
.orgc-cards { position: absolute; }
.orgc-node { position: absolute; box-sizing: border-box; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 10px; text-align: center; cursor: pointer; user-select: none; touch-action: none; transition: box-shadow .15s, border-color .15s; }
.orgc-node:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.orgc-node.can-drag { cursor: grab; }
.orgc-node.dragging { cursor: grabbing; z-index: 10; box-shadow: 0 14px 34px rgba(0,0,0,.22); opacity: .95; }
.orgc-node.drop-ok { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 30%, transparent); }
.orgc-node.drop-no { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 25%, transparent); cursor: not-allowed; }
.orgc-top { display: none; position: sticky; top: 0; z-index: 20; height: 0; overflow: visible; margin: 0 auto; max-width: 520px; } .orgc-top > span { display: block; text-align: center; padding: 10px; border: 2px dashed var(--border-strong); border-radius: 12px; color: var(--muted-fg); font-size: 13px; }
.orgc-wrap.is-dragging .orgc-top { display: block; }
.orgc-top.on > span { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--bg)); }
.orgc-top > span { background: var(--bg); }

/* 會議控制列 */
.mt-order { display: flex; flex-direction: column; gap: 4px; }
.mt-ord { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border: 1px solid var(--border); border-radius: 8px; }
.mt-ord.on { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); background: color-mix(in srgb, var(--green) 7%, transparent); }
.mt-ord .grow { flex: 1; }
.msg.board .bubble { background: color-mix(in srgb, var(--blue) 6%, transparent); }

/* 會議頁：左邊發言紀錄、右邊狀態 */
.page.mt-page { max-width: 1320px; padding-top: 16px; padding-bottom: 16px; }
.mt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; height: calc(100dvh - 52px - 32px); min-height: 480px; }
.mt-main { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); overflow: hidden; }
.mt-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex: none; }
.mt-head .grow { flex: 1; }
.mt-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; overscroll-behavior: contain; }
.mt-say { flex: none; border-top: 1px solid var(--border); padding: 10px 14px 12px; background: var(--muted); }
.mt-say .textarea { resize: vertical; max-height: 200px; }
.mt-side { min-height: 0; overflow-y: auto; padding-right: 4px; }
.mt-side .mt-ord .btn.icon { width: 24px; height: 24px; }
@media (max-width: 960px) {
  .mt-layout { grid-template-columns: 1fr; height: auto; }
  .mt-side { order: -1; overflow: visible; }
  .mt-main { height: 75dvh; }
}

.rawjson { margin-top: 8px; }
.rawjson summary { cursor: pointer; }
.rawjson pre { max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: 11.5px; background: var(--muted); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; }

/* language */
html[lang=en] .brand-sub{display:none}
.langbtn{font-size:11px;font-weight:700;letter-spacing:.02em}

/* ── 行事曆 ── */
.cal-page { display: flex; flex-direction: column; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.cal-label { font-size: 20px; margin: 0 0 0 6px; }
.cal-filters { gap: 6px; }
.cal-sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--muted-fg); font-size: 12.5px; cursor: pointer; }
.chip-btn:hover { background: var(--hover); }
.chip-btn.on { background: var(--active); color: var(--fg); border-color: var(--fg); }
.chip-btn .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cal-week { overflow: hidden; padding: 0; }
.cal-wh { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-dh { padding: 8px 10px; display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--muted-fg); border-left: 1px solid var(--border); }
.cal-dh b { font-size: 18px; color: var(--fg); font-weight: 600; }
.cal-dh.today b { background: var(--red); color: #fff; border-radius: 999px; min-width: 28px; height: 28px; display: inline-grid; place-items: center; font-size: 15px; }
.cal-scroll { height: calc(100vh - 250px); min-height: 420px; overflow-y: auto; position: relative; }
.cal-grid { display: grid; grid-template-columns: 56px 1fr; position: relative; }
.cal-times { position: relative; }
.cal-hr { position: absolute; left: 0; right: 0; height: 0; }
.cal-hr span { position: absolute; right: 8px; top: -7px; font-size: 11px; color: var(--subtle-fg); font-variant-numeric: tabular-nums; }
.cal-hr:first-child span { display: none; }
.cal-cols { display: grid; grid-template-columns: repeat(7, 1fr); position: relative; background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 56px); }
.cal-col { position: relative; border-left: 1px solid var(--border); }
.cal-col.today { background: color-mix(in srgb, var(--red) 3%, transparent); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 5; pointer-events: none; }
.cal-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.cal-evs { position: absolute; top: 0; bottom: 0; left: 14px; right: 4px; }
.cal-tick { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: .75; cursor: pointer; z-index: 1; }
.cal-tick:hover { transform: scale(1.6); opacity: 1; }
.cal-ev { position: absolute; box-sizing: border-box; border-radius: 6px; padding: 4px 7px; font-size: 12px; line-height: 1.4; overflow: hidden; cursor: pointer; z-index: 2; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 13%, var(--bg)); color: var(--fg); min-width: 0; }
.cal-ev:hover { z-index: 4; box-shadow: var(--shadow-lg); }
.cal-ev .t { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; }
.cal-ev .t .i { flex: none; color: var(--c); width: 13px; height: 13px; }
.cal-ev .t .ellipsis { min-width: 0; flex: 1; font-weight: 500; }
.cal-ev .tm { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted-fg); }
.cal-ev .s { color: var(--muted-fg); font-size: 11.5px; margin-top: 1px; }
.cal-ev .st { flex: none; font-weight: 700; color: var(--c); }
.cal-ev.future { background: var(--bg); border: 1.5px dashed var(--c); border-left: 3px solid var(--c); }
.cal-ev.meeting { background: color-mix(in srgb, var(--violet) 13%, var(--bg)); border-left-color: var(--violet); }
.cal-ev.meeting .t .i { color: var(--violet); }
.cal-ev.bad { border-left-color: var(--red); }
.cal-ev.bad .st { color: var(--red); }
.cal-ev.cluster { background: var(--muted); border-left: 3px solid var(--border-strong); }
.cal-ev.cluster .dots { display: inline-flex; flex: none; }
.cal-ev.cluster .dots i { width: 9px; height: 9px; border-radius: 50%; margin-right: -3px; border: 1.5px solid var(--bg); }
.cal-ev.cluster .ellipsis { margin-left: 4px; font-weight: 400; color: var(--muted-fg); }
.cal-ev.cluster b { color: var(--fg); }
.cal-ev.live { animation: calPulse 1.6s ease-in-out infinite; }
@keyframes calPulse { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); } }
.cal-ev.drag { cursor: grab; touch-action: none; }
.cal-ev.dragging { cursor: grabbing; opacity: .9; box-shadow: var(--shadow-lg); z-index: 10; }
.cal-month { padding: 0; overflow: hidden; }
.cal-mhead { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.cal-mh { padding: 8px 10px; font-size: 12px; color: var(--muted-fg); }
.cal-mgrid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(118px, 1fr); }
.cal-mc { border-left: 1px solid var(--border); border-top: 1px solid var(--border); padding: 6px 6px 8px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cal-mc:nth-child(7n + 1) { border-left: 0; }
.cal-mc.other { background: var(--sidebar); }
.cal-mc.other .cal-md { color: var(--subtle-fg); }
.cal-md { font-size: 12.5px; font-weight: 600; color: var(--fg); text-decoration: none; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 999px; margin-bottom: 2px; }
.cal-md:hover { background: var(--hover); }
.cal-mc.today .cal-md { background: var(--red); color: #fff; }
.cal-mi { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 1px 4px; border-radius: 4px; cursor: pointer; min-width: 0; }
.cal-mi:hover { background: var(--hover); }
.cal-mi .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c); }
.cal-mi.future .dot { background: transparent; border: 1.5px solid var(--c); box-sizing: border-box; }
.cal-mi.meeting .dot { background: var(--violet); border-color: var(--violet); }
.cal-more, .cal-mrun { color: var(--muted-fg); text-decoration: none; padding: 1px 4px; display: flex; align-items: center; gap: 4px; }
.cal-more:hover, a.cal-mrun:hover { color: var(--fg); }
@media (max-width: 760px) {
  .cal-wh, .cal-grid { min-width: 760px; }
  .cal-week { overflow-x: auto; }
  .cal-mgrid { grid-auto-rows: minmax(84px, 1fr); }
  .cal-mi span { display: none; }
}

/* 篩選列 */
.fbar { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--sidebar); }
.fbar .fsel { width: auto; height: 30px; font-size: 13px; padding: 0 28px 0 10px; }
.fbar .fdate { width: 140px; height: 30px; font-size: 13px; }
.fbar .fsearch { width: 200px; height: 30px; font-size: 13px; }
.apr-card .selbox { margin-right: 2px; }

/* 卡片檢視 */
.vcard { display: flex; flex-direction: column; gap: 10px; min-height: 150px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.vcard:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .25); }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; }
.clamp3 { -webkit-line-clamp: 3; }
@media (max-width: 1100px) { .cards-view.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards-view.g3 { grid-template-columns: 1fr; } .hide-sm { display: none !important; } }

/* Markdown 欄位的編輯方式切換 */
.md-bar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.md-seg button { height: 26px; font-size: 12px; padding: 0 10px; gap: 4px; }
.md-rich { border-radius: 8px; }
.md-rich .toastui-editor-defaultUI { border-color: var(--border-strong); border-radius: 8px; font-family: inherit; }
.md-rich .toastui-editor-contents, .md-rich .ProseMirror { font-family: inherit; font-size: 14px; }

/* —— 註冊表單、驗證信箱 —— */
.su-sec { font-size: 12px; font-weight: 600; color: var(--muted-fg); letter-spacing: .04em; margin: 6px 0 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.su-sec:first-of-type { border-top: 0; padding-top: 0; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.req { color: var(--red); margin-left: 2px; }
.su-check { display: flex; align-items: flex-start; margin: 8px 0 4px; line-height: 1.5; font-size: 13px; }
.su-check input { margin-top: 3px; flex: none; }
.su-check a { text-decoration: underline; margin: 0 2px; }
.su-ts { margin-top: 12px; min-height: 65px; }
.su-mail { display: flex; justify-content: center; margin-bottom: 10px; }
.su-code { text-align: center; font-size: 26px; letter-spacing: 12px; font-family: var(--mono, ui-monospace, monospace); height: 54px; }
@media (max-width: 640px) { .three { grid-template-columns: 1fr 1fr; } .onboard.su-wide { margin-top: 4vh; } }
.su-mail span { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; background: var(--muted); align-items: center; justify-content: center; }
.su-mail span .i { width: 22px; height: 22px; }
.setting-row > .seg { flex: none; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* —— 新手導覽 —— */
#tour { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
#tour.away { display: none; }
#tour .tour-b { position: fixed; pointer-events: auto; background: transparent; }
#tour.center .tour-b, #tour.waiting .tour-b { background: rgba(15, 18, 25, .5); transition: background .3s; }
#tour .tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 18, 25, .5); transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease; pointer-events: none; }
#tour .tour-spot::after { content: ''; position: absolute; inset: -4px; border-radius: 13px; border: 2px solid var(--primary, #2563eb); animation: tour-pulse 1.6s ease-out infinite; }
#tour.center .tour-spot, #tour.waiting .tour-spot { box-shadow: none; }
#tour.center .tour-spot::after, #tour.waiting .tour-spot::after { display: none; }
@keyframes tour-pulse { 0% { opacity: .9; transform: scale(1); } 70% { opacity: 0; transform: scale(1.08); } 100% { opacity: 0; } }
#tour .tour-hand { position: fixed; font-size: 26px; pointer-events: none; animation: tour-hand 1.1s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); transition: left .35s ease, top .35s ease; }
@keyframes tour-hand { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
#tour .tour-pop { position: fixed; pointer-events: auto; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 14px 16px 12px; transition: left .35s ease, top .35s ease; }
#tour .tour-pop.in { animation: tour-in .35s ease; }
@keyframes tour-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
#tour .tour-arrow { position: absolute; width: 14px; height: 14px; background: var(--bg); border: 1px solid var(--border); transform: rotate(45deg); }
#tour .tour-pop[data-side="top"] .tour-arrow { border-right: 0; border-bottom: 0; }
#tour .tour-pop[data-side="bottom"] .tour-arrow { border-left: 0; border-top: 0; }
#tour .tour-pop[data-side="left"] .tour-arrow { border-right: 0; border-top: 0; }
#tour .tour-step { font-size: 11px; font-weight: 600; color: var(--primary, #2563eb); letter-spacing: .05em; margin-bottom: 2px; }
#tour .tour-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
#tour .tour-text { font-size: 13.5px; line-height: 1.65; color: var(--muted-fg); }
#tour .tour-btns { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { #tour *, #tour .tour-pop.in { animation: none !important; transition: none !important; } }
#tour.free .tour-b { display: none; }
.tour-btn { margin-left: 4px; }

/* —— 連接器（MCP）—— */
.mcp-tile { flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.mcp-tile.lg { width: 40px; height: 40px; font-size: 15px; border-radius: 10px; }
.mcp-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px; }
.mcp-row .btn { flex: none; }
.mcp-custom { border-style: dashed; }
.mcp-cat h3.section { margin: 18px 0 8px; }
.mcp-search { position: relative; display: flex; align-items: center; }
.mcp-search > .i { position: absolute; left: 10px; color: var(--muted-fg); }
.mcp-search .input { padding-left: 32px; }
.mcp-list { display: grid; gap: 12px; }
.mcp-tools summary { cursor: pointer; margin-top: 12px; }
.mcp-toollist { border: 1px solid var(--border); border-radius: 10px; max-height: 420px; overflow: auto; }
.mcp-tool { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.mcp-tool:last-child { border-bottom: 0; }
.mcp-tool .switch { margin-top: 2px; flex: none; }
.mcp-tool .badge { flex: none; }
.mcp-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.mcp-pickrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.mcp-pickrow .mcp-tile { width: 28px; height: 28px; font-size: 12px; border-radius: 7px; }
.btn.busy { opacity: .5; pointer-events: none; }
@media (max-width: 640px) { .mcp-row { flex-wrap: wrap; } .mcp-row .btn { margin-left: 48px; } }

/* —— 技能 —— */
.sk-card .mcp-tile { width: 32px; height: 32px; }
.sk-card .badge .i { width: 11px; height: 11px; margin-right: 2px; }
.sk-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.sk-side { border-left: 1px solid var(--border); padding-left: 22px; position: sticky; top: 0; }
.sk-sec { margin-bottom: 20px; }
.sk-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted-fg); margin-bottom: 6px; }
.sk-side .col { gap: 6px; }
.gh-picks { border: 1px solid var(--border); border-radius: 10px; max-height: 340px; overflow: auto; }
.gh-pick { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.gh-pick:last-child { border-bottom: 0; }
@media (max-width: 900px) { .sk-detail { grid-template-columns: 1fr; } .sk-side { border-left: 0; padding-left: 0; position: static; } }
.mcp-tile { position: relative; overflow: hidden; }
.mcp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; background: #fff; box-sizing: border-box; }
.mcp-tile.has-logo { box-shadow: inset 0 0 0 1px var(--border); }
.mcp-tile.lg img { padding: 7px; }
.sk-dragging [data-drop-folder] { outline: 1px dashed var(--border); outline-offset: -2px; }
[data-drop-folder].drop-on { background: color-mix(in srgb, var(--primary, #2563eb) 14%, transparent) !important; outline: 2px solid var(--primary, #2563eb) !important; }
.sk-card[draggable="true"] { cursor: grab; }
.cat-color { width: 36px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: none; flex: none; cursor: pointer; }
.act-day { font-size: 12px; font-weight: 600; color: var(--muted-fg); padding: 10px 14px 4px; background: var(--bg); position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--border); }
/* 行事曆：預定任務 */
.cal-ev.task { border-radius: 6px; }
.cal-ev.task.future { border-style: solid; border-width: 1.5px; border-left-width: 3px; background: color-mix(in srgb, var(--c) 8%, var(--bg)); }
.cal-ev.task .t .i { color: var(--c); }
.cal-mi.task .dot { border-radius: 2px; }
.cal-mi.drag { cursor: grab; touch-action: none; }
.cal-mi.dragging { cursor: grabbing; position: relative; z-index: 20; background: var(--bg); box-shadow: var(--shadow-lg); border-radius: 6px; }
.cal-mc.drop-on { background: color-mix(in srgb, var(--primary, #2563eb) 10%, var(--bg)); outline: 2px solid var(--primary, #2563eb); outline-offset: -2px; }

/* —— 登入／註冊 —— */
#app > .auth { grid-column: 1 / -1; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(380px, 42%) 1fr; width: 100%; background: var(--bg); }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 32px 44px; color: #e8edf7; background: radial-gradient(1200px 600px at -10% -10%, #2b4fd6 0%, transparent 55%), radial-gradient(900px 500px at 120% 110%, #0ea5a4 0%, transparent 50%), linear-gradient(160deg, #0b1324 0%, #121c38 60%, #0b1324 100%); }
.auth-side::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; }
.auth-brand span { font-weight: 500; opacity: .6; font-size: 14px; }
.auth-brand .i, .auth-mbrand .i { width: 22px; height: 22px; }
.auth-hero { margin: auto 0; padding: 40px 0; max-width: 460px; }
.auth-hero h2 { font-size: 30px; line-height: 1.3; margin: 0 0 12px; color: #fff; letter-spacing: -.01em; }
.auth-hero p { margin: 0 0 26px; color: #b9c3d8; font-size: 15px; line-height: 1.7; }
.auth-bots { display: grid; gap: 10px; margin-bottom: 26px; }
.auth-bot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(4px); animation: auth-in .6s ease both; animation-delay: var(--d); }
.auth-bot b { color: #fff; font-size: 14px; margin-right: 6px; }
.auth-role { font-size: 12px; color: #93a0bb; }
.auth-st { display: block; font-size: 12.5px; color: #c9d3e6; margin-top: 1px; }
.auth-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; overflow: hidden; }
.auth-av svg { width: 100%; height: 100%; }
.auth-dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.auth-dots i { width: 4px; height: 4px; border-radius: 50%; background: #6ee7b7; animation: auth-dot 1.2s infinite; }
.auth-dots i:nth-child(2) { animation-delay: .2s; } .auth-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes auth-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes auth-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: #c9d3e6; font-size: 14px; }
.auth-points li { display: flex; align-items: center; gap: 8px; }
.auth-points .i { color: #6ee7b7; }
.auth-foot { display: flex; gap: 16px; font-size: 12px; }
.auth-foot a { color: #8b97b2; text-decoration: none; }
.auth-foot a:hover { color: #fff; }
.auth-main { display: flex; flex-direction: column; min-width: 0; padding: 20px 24px; overflow-y: auto; }
.auth-top { display: flex; align-items: center; min-height: 34px; }
.auth-mbrand { display: none; align-items: center; gap: 6px; font-weight: 700; color: var(--fg); text-decoration: none; }
.auth-box { width: 100%; max-width: 400px; margin: auto; padding: 24px 0 40px; }
.auth-box.wide { max-width: 620px; }
.auth-card { display: block; }
.auth-title { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-sub { color: var(--muted-fg); font-size: 14px; margin: 0 0 22px; line-height: 1.6; }
.auth .field label { font-size: 13px; font-weight: 500; }
.auth .input, .auth .select { height: 42px; font-size: 14.5px; border-radius: 10px; }
.auth .su-code { height: 56px; }
.auth-btn { width: 100%; justify-content: center; height: 44px; font-size: 15px; border-radius: 10px; margin-top: 8px; }
.auth-link { color: var(--muted-fg); text-decoration: none; }
.auth-link:hover { color: var(--fg); text-decoration: underline; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted-fg); }
.auth-alt a { color: var(--fg); font-weight: 600; margin-left: 4px; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted-fg); width: 30px; height: 30px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pw-eye:hover { background: var(--muted); color: var(--fg); }
.auth .su-sec { margin-top: 10px; }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mbrand { display: inline-flex; }
  .auth-main { padding: 16px; }
  .auth-box { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .auth-bot, .auth-dots i { animation: none; } }

/* 指標拖曳（取代原生拖放） */
body.pdragging, body.pdragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.pd-ghost { position: fixed !important; z-index: 9999; margin: 0 !important; pointer-events: none; opacity: .94; box-shadow: 0 14px 34px rgba(0,0,0,.22); background: var(--bg); border-radius: 10px; transition: none; }
.pd-src { opacity: .4; }
a, img { -webkit-user-drag: none; }
.board-col.drop-on { border-color: var(--ring); background: var(--hover); }
.kcard { touch-action: manipulation; }

/* 側欄釘選的員工 */
.nav-pin { position: relative; padding-left: 22px !important; }
.nav-pin .pin-x { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; border-radius: 5px; border: 0; padding: 0; background: transparent; color: var(--muted-fg); display: none; place-items: center; cursor: pointer; }
.nav-pin .pin-x .i { width: 12px; height: 12px; }
.nav-pin .pin-x:hover { background: var(--border); color: var(--fg); }
.nav-pin:hover .pin-x { display: grid; }
body.pdragging .nav-pin .pin-x { display: none; }
.nav-pin.pd-src { opacity: 1; background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.pd-chip { position: fixed; z-index: 9999; pointer-events: none; display: inline-flex; align-items: center; gap: 6px; max-width: 320px; padding: 6px 11px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 12.5px; font-weight: 500; white-space: nowrap; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.pd-chip span { overflow: hidden; text-overflow: ellipsis; }
.pd-chip .subtle { color: color-mix(in srgb, var(--bg) 65%, transparent); font-weight: 400; }
.sk-card.pd-src { opacity: .45; outline: 2px dashed var(--border-strong, var(--border)); outline-offset: -2px; }

/* 雲夥伴 logo */
.logo-mk { width: 30px; height: 21px; flex: none; display: inline-block; }
.logo-mk.lg { width: 36px; height: 25px; }
.auth-brand .logo-mk { width: 34px; height: 23px; color: #fff; }
.auth-mbrand .logo-mk { width: 28px; height: 19px; }

/* 後台浮水印 */
#wm { position: fixed; z-index: 6; pointer-events: none; color: var(--fg); user-select: none; }
#wm[hidden] { display: none; }
#wm .logo-mk { width: 100%; height: auto; display: block; }
@media print { #wm { display: none; } }

/* 站長管理：服務條款編輯器 */
.leg-ed { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.leg-ed textarea { min-height: 560px; height: 62vh; font: 13px/1.7 var(--mono, ui-monospace, Menlo, Consolas, monospace); resize: vertical; white-space: pre-wrap; }
.leg-prev { height: 62vh; min-height: 560px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 18px 22px; background: var(--bg); font-size: 14px; line-height: 1.8; }
.legal-body h1 { font-size: 22px; margin: 0 0 12px; }
.legal-body h2 { font-size: 16px; margin: 22px 0 6px; }
.legal-body h3 { font-size: 14.5px; margin: 16px 0 4px; }
.legal-body ul, .legal-body ol { padding-left: 22px; }
.legal-body table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0; }
.legal-body th, .legal-body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.legal-body th { width: 28%; font-weight: 600; }
.legal-body a { color: var(--blue); }
@media (max-width: 900px) { .leg-ed { grid-template-columns: 1fr; } .leg-ed textarea, .leg-prev { height: 46vh; min-height: 320px; } }
.wm-range { width: 100%; }

/* 技能試跑 */
.skt { margin-top: 18px; }
.skt-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.skt-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); flex: none; }
.skt-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 10px; }
.skt-who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); }
.skt-who .select { min-width: 200px; }
.skt-input { width: 100%; resize: vertical; min-height: 72px; }
.skt-inputs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.skt-inputs:empty { display: none; }
.skt-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 12px; background: var(--bg); }
.skt-chip a { color: var(--fg); text-decoration: none; }
.skt-chip a:hover { text-decoration: underline; }
.skt-chip button { border: 0; background: none; padding: 2px; border-radius: 99px; color: var(--muted-fg); cursor: pointer; display: grid; place-items: center; }
.skt-chip button:hover { background: var(--hover); color: var(--fg); }
.skt-chip .i { width: 11px; height: 11px; }
.skt-res { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.skt-res-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.skt-task { background: var(--muted, var(--hover)); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; white-space: pre-wrap; }
.skt-cols { display: grid; grid-template-columns: 1fr; gap: 12px; }
.skt-cols.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .skt-cols.two { grid-template-columns: 1fr; } }
.skt-col { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; background: var(--bg); }
.skt-col.with { border-color: color-mix(in srgb, var(--blue) 45%, var(--border)); }
.skt-col-h { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.skt-col.with .skt-col-h { color: var(--blue); }
.skt-col.without .skt-col-h { color: var(--muted-fg); }
.skt-out { font-size: 13.5px; line-height: 1.75; max-height: 560px; overflow: auto; overflow-wrap: anywhere; }
.skt-out > :first-child { margin-top: 0; }
.skt-meta { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.skt-live { display: inline-flex; gap: 3px; margin-left: 4px; }
.skt-live i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .3; animation: sktDot 1.2s infinite; }
.skt-live i:nth-child(2) { animation-delay: .2s; }
.skt-live i:nth-child(3) { animation-delay: .4s; }
@keyframes sktDot { 50% { opacity: 1; } }
.skt-hist { margin-top: 14px; }
.skt-hist summary { cursor: pointer; }
.skt-hist .li.on { background: var(--hover); }

/* ═════════ 站長後台（/admin） ═════════ */
#app > .adm { grid-column: 1 / -1; }
.adm { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; height: 100dvh; min-width: 0; }
.adm-side { background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.adm-brand .logo-mk { width: 34px; height: 23px; }
.adm-nav { flex: 1; overflow: auto; padding: 4px 8px; }
.adm-group { font-size: 11.5px; color: var(--muted-fg); padding: 14px 10px 4px; font-weight: 500; }
.adm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-left: auto; }
.adm-foot { border-top: 1px solid var(--border); padding: 8px; }
.adm-me { display: flex; align-items: center; gap: 6px; padding: 8px 6px 2px; }
.adm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.adm-top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px; border-bottom: 1px solid var(--border); flex: none; }
.adm-top .crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.adm-menu { display: none; }
.adm-body { flex: 1; overflow: auto; }
.adm-body .page { padding-top: 26px; }
.adm-alerts { display: grid; gap: 8px; margin-bottom: 18px; }
.adm-alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 40%, var(--border)); background: color-mix(in srgb, var(--c) 8%, var(--bg)); color: var(--fg); text-decoration: none; font-size: 13.5px; }
.adm-alert > .i:first-child { color: var(--c); }
.adm-alert:hover { background: color-mix(in srgb, var(--c) 14%, var(--bg)); }
.adm-ok { color: var(--green); margin-bottom: 18px; display: flex; align-items: center; gap: 6px; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-stat { padding: 14px 16px; display: block; color: inherit; text-decoration: none; }
a.adm-stat:hover { border-color: var(--border-strong, var(--border)); }
.adm-num { font-size: 24px; font-weight: 650; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.adm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.adm-card-h { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13.5px; }
.adm-bars { width: 100%; height: auto; display: block; }
.adm-axis { stroke: var(--border); stroke-width: 1; }
.adm-tick { font-size: 10.5px; fill: var(--muted-fg); }
.adm-barfill { fill: var(--blue); }
.adm-bar:hover .adm-barfill { fill: color-mix(in srgb, var(--blue) 70%, var(--fg)); }
.adm-bar:hover rect { fill: color-mix(in srgb, var(--blue) 6%, transparent); }
@media (max-width: 960px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .adm.nav-open .adm-side { transform: none; }
  .adm.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 49; }
  .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .adm-num { font-size: 21px; }
  .adm-menu { display: inline-grid; }
  .adm-two { grid-template-columns: 1fr; }
  .adm-top { padding: 0 12px; }
}

/* 雙重驗證 */
.otp-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); margin-bottom: 14px; }
.otp-input { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; height: 52px; }
.tf-qr { width: 196px; margin: 0 auto; padding: 8px; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.tf-qr svg { width: 100%; height: auto; display: block; }
.tf-secret { font-size: 13px; letter-spacing: .05em; user-select: all; word-break: break-all; }
.tf-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 12px 16px; background: var(--muted, var(--hover)); border-radius: 10px; font-size: 14px; }

/* 點數代管 */
.pts-chip { display: flex; align-items: center; gap: 6px; margin: 0 10px 6px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--fg); font-size: 12px; text-decoration: none; }
.pts-chip:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--border)); }
.pts-chip > svg { color: var(--blue); flex: none; }
.pts-chip .xs { white-space: nowrap; }
.pts-chip.amber { border-color: color-mix(in srgb, var(--amber) 55%, var(--border)); background: color-mix(in srgb, var(--amber) 8%, var(--bg)); }
.pts-chip.amber > svg { color: var(--amber); }
.pts-chip.red { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); background: color-mix(in srgb, var(--red) 8%, var(--bg)); }
.pts-chip.red > svg { color: var(--red); }
.sidebar.collapsed .pts-chip span, .sidebar.collapsed .pts-chip .xs { display: none; }
.pts-banner.amber { background: color-mix(in srgb, var(--amber) 14%, var(--bg)); border-bottom-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.pts-banner.red { background: color-mix(in srgb, var(--red) 12%, var(--bg)); border-bottom-color: color-mix(in srgb, var(--red) 35%, transparent); }
.pts-hint { color: var(--muted-fg); }
.pts-hint svg { color: var(--blue); vertical-align: -2px; }
.tier-pick.off { opacity: .55; cursor: not-allowed; }
.picker .tier-pick { flex: 1 1 180px; }
.bill-num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.bill-plans th, .bill-plans td { text-align: center; }
.bill-plans th:first-child, .bill-plans td:first-child { text-align: left; }
.bill-plans .cur { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.adm-switch { margin-bottom: 4px; }
.adm-switch.on { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); background: color-mix(in srgb, var(--green) 5%, var(--bg)); }
.adm-plans th { min-width: 130px; vertical-align: top; }
.adm-plans td { vertical-align: top; }
/* 站長後台：落地頁方案預覽 */
.land-prev { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.land-pv { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.land-pv.pick { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.land-pv ul { margin: 6px 0 10px; padding-left: 16px; font-size: 12px; color: var(--muted-fg); line-height: 1.7; flex: 1; }
.land-price { font-size: 20px; font-weight: 700; margin-top: 6px; }
.land-price small { font-size: 12px; font-weight: 500; color: var(--muted-fg); margin-left: 2px; }
.land-card .two { margin-bottom: 0; }

/* 收款 */
.kv { display: flex; gap: 10px; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.kv .k { width: 96px; flex: none; color: var(--muted-fg); }
.kv .v { min-width: 0; overflow-wrap: anywhere; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover, rgba(127,127,127,.06)); }
.pay-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pay-opt { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.pay-opt input { display: none; }
.pay-opt:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.pay-opt .b { font-size: 14px; }
.pay-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pay-pack { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.pay-pack .n { font-size: 20px; font-weight: 700; }
.pay-info { font-size: 14px; line-height: 1.8; }
.pay-info .mono { font-size: 16px; font-weight: 600; letter-spacing: .5px; }

.picker.tpl-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.picker.tpl-grid .pick { padding: 10px 12px; }
