/* it24hr — 辦公桌、螢幕、視窗、看板、卡片、結算卡 */
:root {
  --wood: #6b4a2e; --wood-2: #8a6240; --bezel: #1b1d22; --bezel-edge: #3a3d45;
  --ink: #1f2328; --paper: #f6f1e7; --muted: #646a77;   /* 紙色上對比 4.8:1 */
  --priority: #d1242f; --accent: #2563eb; --ok: #15803d; --warn: #b45309;
  --font: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, "Noto Sans Mono CJK TC", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: #2b2117; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body { line-height: 1.5; }
.muted { color: var(--muted); }
.btn { border: 1px solid #c9c2b5; background: #fff; border-radius: 8px; padding: 8px 14px; }
a.btn { display: inline-block; color: inherit; text-decoration: none; }   /* 長得像按鈕的連結（例：存圖）不帶瀏覽器預設的底線 */
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: #fff; border-color: var(--priority); color: var(--priority); }

/* ── 辦公桌 ── */
.desk { height: 100vh; height: 100dvh; display: grid; grid-template-rows: 1fr 150px; background: linear-gradient(180deg, var(--wood-2), var(--wood)); }
.desk[data-mode="legacy"] .screens-bg { background: url(assets/bg/legacy_wall.svg) center bottom / cover no-repeat; image-rendering: pixelated; }
.desk[data-mode="legacy"] .surface { background: url(assets/bg/legacy_wood.svg) center / 100% 100% no-repeat; image-rendering: pixelated; }
.desk[data-mode="hybrid"] .screens-bg { background: url(assets/bg/hybrid_wall.png) center bottom / cover no-repeat; image-rendering: pixelated; }
.desk[data-mode="hybrid"] .surface { background: url(assets/bg/hybrid_wood.png) center / 100% 100% no-repeat; image-rendering: pixelated; }
/* speedrun 是一整張插圖（牆＋桌面），鋪滿整張桌子、貼上緣，螢幕站在桌面上；牆上的鐘整個藏在外接螢幕後面 */
.desk[data-mode="speedrun"] { background: #e8dcc6 url(assets/bg/speedrun_desk.webp) center top / cover no-repeat; }
.screens-bg { position: relative; }
.wall-clock { position: absolute; display: none; image-rendering: pixelated; pointer-events: none; }
.desk[data-mode="legacy"] .wall-clock, .desk[data-mode="hybrid"] .wall-clock { display: block; }   /* 兩張牆面的鐘框位置一樣 */
.desk.in-meeting .wall-clock { display: none; }
.screens { position: relative; margin: 14px 18px 0; height: calc(100% - 14px); }
.screen { position: absolute; bottom: 0; border: 10px solid var(--bezel); border-bottom-width: 22px; border-radius: 12px 12px 4px 4px; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.screen.laptop { left: 0; width: 36%; height: 70%; }
.screen.monitor { right: 0; width: 63%; height: 96%; }
.bezel-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); color: #9aa0ad; font-size: 11px; letter-spacing: .1em; }
.desktop, .laptop-screen { position: absolute; inset: 0; overflow: hidden; }
/* 視窗層橫跨兩個螢幕，壓在螢幕上、工作列和頂欄（z 5）之下；本身不吃點擊，只有視窗吃 */
.win-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: none !important; }
.win-layer > .win { pointer-events: auto; }
.desktop, .laptop-screen, .win-layer {
  --os-bg: #e9eef5; --os-fg: #1f2328; --os-bar: #d9e0ea; --os-win: #ffffff; --os-win-bar: #eef2f7; --os-border: #c5ccd8; --os-muted: #4b5563; --os-shadow: rgba(0,0,0,.25);
  --chat-bg: #e6f19a; --chat-them: #ffffff;   /* LIME：萊姆黃底、對方白泡泡 */
  background: radial-gradient(1200px 600px at 70% 30%, #f3f6fb, var(--os-bg)); color: var(--os-fg); }
.laptop-shortcuts { top: 34px; left: 8px; }
.desktop[data-theme="dark"], .laptop-screen[data-theme="dark"], .win-layer[data-theme="dark"] { --os-bg: #14171d; --os-fg: #e6e8ee; --os-bar: #1e222a; --os-win: #1b1f26; --os-win-bar: #242932; --os-border: #343a46; --os-muted: #9aa3b2; --os-shadow: rgba(0,0,0,.6);
  --chat-bg: #283012; --chat-them: #363c46;   /* 深色：暗的萊姆綠底、深灰泡泡 */
  background: radial-gradient(1200px 600px at 70% 30%, #1d222c, var(--os-bg)); }
.desk.on-break .screens-bg, .desk.on-break .screens-bg *, .desk.on-break .surface > :not(.coffee), .desk.on-break .surface > :not(.coffee) * { pointer-events: none; }   /* 暫停時不能做事，只能按暫停鈕回來 */
.desk.on-break .win-body, .desk.on-break .win-body * { pointer-events: auto; cursor: default; }   /* 開著的視窗還能捲動閱讀，操作由 desk.js 的 guardPausedWindows 攔下 */
.desk.on-break .win-body :is(input, select, textarea) { pointer-events: none; }   /* 欄位按下去就取得焦點，等 click 才攔就來不及了 */
.desktop.paused::after { content: '暫停中'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; letter-spacing: .3em; color: var(--os-fg); background: color-mix(in srgb, var(--os-bg) 55%, transparent); pointer-events: none; z-index: 32; }   /* 蓋過視窗層、工作列和通知（≤30），但在舉手、手動測試預覽這些彈出畫面（≥34）底下 */
.os-top { position: absolute; top: 0; left: 0; right: 0; height: 26px; display: flex; align-items: center; gap: 12px; padding: 0 10px; background: var(--os-bar); font-size: 13px; z-index: 5; }
.os-clock { font-family: var(--mono); font-weight: 600; }
.os-day { color: var(--os-muted); }
.os-right { margin-left: auto; }
.os-theme, .os-sound { border: 0; background: transparent; color: var(--os-fg); font-size: 15px; }
/* 桌面捷徑：常用程式排在桌面左上；工作列只放開著的視窗 */
.shortcuts { position: absolute; top: 36px; bottom: 40px; left: 10px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 8px; }   /* 螢幕矮，一直行放不下就排到下一行，不被工作列蓋住 */
.shortcut { width: 68px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--os-fg); font-size: 12px; }
.shortcut:hover { background: color-mix(in srgb, var(--os-fg) 10%, transparent); border-color: color-mix(in srgb, var(--os-fg) 25%, transparent); }
.shortcut .ico { line-height: 1; }
.shortcut .ico .icon { width: 28px; height: 28px; stroke-width: 1.75; }
/* Lucide 圖示：跟文字同色、大小看放在哪裡 */
.icon { width: 1em; height: 1em; vertical-align: -0.15em; display: inline-block; flex: none; }
.ico-sm { width: 16px; height: 16px; margin-right: 6px; }
.ico-xs { width: 12px; height: 12px; margin-right: 2px; }
.os-theme .icon, .os-sound .icon { width: 16px; height: 16px; }
.coffee .icon { width: 18px; height: 18px; }
.visitor-face .icon { width: 44px; height: 44px; color: #2d3b4e; }
.paper .icon { width: 32px; height: 32px; color: #6b7280; stroke-width: 1.5; }
.paper.self .icon { color: #8a6d00; }
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--os-bar); border-top: 1px solid var(--os-border); z-index: 5; }
.task-win { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--os-border); background: var(--os-win); color: var(--os-fg); border-radius: 6px; padding: 3px 10px; font-size: 13px; }
.task-win .icon, .win-title .icon { width: 14px; height: 14px; }
.win-title .icon { margin-right: 6px; vertical-align: -2px; }
.task-win.is-min { opacity: .6; }
.task-win.is-active { border-color: var(--os-fg); }
.task-windows { display: flex; flex: 1; min-width: 0; gap: 6px; overflow-x: auto; scrollbar-width: none; }   /* 分頁都縮到最窄還放不下就左右滑 */
.task-win { flex: 1 1 0; min-width: 44px; max-width: max-content; }   /* 塞不下時長的分頁平分寬度，短的維持原樣 */
.task-win .icon { flex: none; }
.task-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ── 視窗 ── */
.win { position: absolute; display: flex; flex-direction: column; background: var(--os-win); color: var(--os-fg); border: 1px solid var(--os-border); border-radius: 8px; box-shadow: 0 8px 24px var(--os-shadow); overflow: hidden; min-width: 240px; min-height: 120px; }
.win.active { box-shadow: 0 12px 32px var(--os-shadow), 0 0 0 1px var(--accent); }
.win.minimized { display: none; }
.win-bar { display: flex; align-items: center; height: 30px; padding: 0 8px 0 12px; background: var(--os-win-bar); border-bottom: 1px solid var(--os-border); cursor: grab; user-select: none; touch-action: none; }
.win-title { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-btns button { border: 0; background: transparent; color: var(--os-fg); width: 26px; height: 24px; border-radius: 4px; }
.win-btns button:hover { background: var(--os-border); }
.win-body { flex: 1; overflow: auto; padding: 12px; container-type: inline-size; }
.win-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--os-border) 50%, var(--os-border) 60%, transparent 60%, transparent 75%, var(--os-border) 75%, var(--os-border) 85%, transparent 85%); }
.win-note .win-body { background: #fff5a6; color: #4a3a00; }
.note-text { margin: 0; font-size: 15px; line-height: 1.5; }
.win-terminal .win-body { background: #0d1117; color: #c9d1d9; }
.terminal-text { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.terminal-text .t-cmd { color: #e6edf3; }
.terminal-text .t-out { color: #8b949e; }
.terminal-text .t-err { color: #ff7b72; font-weight: 700; }
.terminal-text .t-note { color: #7ee787; }

/* ── 看板 ── */
.board { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 8px; height: 100%; }
.col { background: color-mix(in srgb, var(--os-bg) 60%, var(--os-win)); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }
.col h3 { margin: 0 0 4px; font-size: 12px; color: var(--os-muted); font-weight: 600; letter-spacing: .05em; }
.kcard { text-align: left; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--os-border); background: var(--os-win); color: var(--os-fg); border-radius: 6px; padding: 8px; }
.kcard.readonly { opacity: .55; }
.tag { display: inline-block; align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #fff; background: var(--priority); border-radius: 3px; padding: 1px 6px; }
.tag.big { font-size: 12px; padding: 2px 8px; }
.ktitle { font-size: 13px; font-weight: 600; }
.kmeta { font-size: 11px; color: var(--os-muted); }

/* ── 卡片 ── */
.card { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 18px; flex: 1; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--os-bar); }
.status.s-to_qc { background: #dcfce7; color: var(--ok); }
.status.s-returned, .status.s-rejected_to_sa { background: #fee2e2; color: var(--priority); }
.card-meta { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px 10px; margin: 0; padding: 8px 10px; background: var(--os-bar); border-radius: 6px; font-size: 13px; }
.card-meta dt { color: var(--os-muted); } .card-meta dd { margin: 0; }
.body-text { white-space: pre-wrap; font-family: inherit; margin: 0; line-height: 1.6; }
.attachments { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.file { font-size: 12px; padding: 3px 8px; border: 1px dashed var(--os-border); border-radius: 6px; }
.card-activity h4, .ops h4 { margin: 0 0 6px; font-size: 12px; color: var(--os-muted); letter-spacing: .05em; }
.act { display: flex; gap: 10px; font-size: 13px; padding: 3px 0; border-top: 1px dotted var(--os-border); }
.act .at { font-family: var(--mono); color: var(--os-muted); min-width: 44px; }
.act.cmt.reject, .act.cmt.nag { color: var(--priority); }
.ops-row { display: flex; flex-wrap: wrap; gap: 6px; }
.op { border: 1px solid var(--os-border); background: var(--os-win); color: var(--os-fg); border-radius: 6px; padding: 5px 10px; font-size: 13px; }
.op.done { border-color: var(--ok); color: var(--ok); }
.op.has-menu { background: var(--os-bar); }
.has-menu::after { content: ' ▸'; }
.has-menu[aria-expanded="true"]::after { content: ' ▾'; }
.op-group { display: inline-flex; gap: 6px; align-items: center; margin-right: 8px; }
.op-sub { display: inline-flex; gap: 6px; padding: 4px 6px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--os-bar); }
.op-sub[hidden], .hint[hidden], .leave[hidden] { display: none; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--os-border); }
.readonly-note { margin: 0; }
/* ── 小關卡 ── */
.quiz { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.quiz-intro { margin: 0; padding: 10px 12px; background: var(--os-bar); border-radius: 6px; line-height: 1.6; }
.points { margin: 0; padding-left: 20px; columns: 2; column-gap: 24px; font-size: 13px; line-height: 1.6; }
.points li { break-inside: avoid; }
.item { border: 1px solid var(--os-border); border-radius: 8px; padding: 8px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.item legend { font-weight: 600; padding: 0 6px; white-space: pre-wrap; }
.item legend.code { font-family: var(--mono); font-weight: 500; font-size: 13px; }
.opt { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.5; }
.opt input { margin-top: 4px; }
.small { font-size: 12px; margin: 0; }
.order-seq { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.order-step { display: flex; align-items: center; gap: 4px; border-radius: 6px; }
.order-step.dragging { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: 0 2px 8px var(--os-shadow); }
.order-grip { display: inline-grid; place-items: center; width: 24px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--os-muted); cursor: grab; touch-action: none; }
.order-grip:active { cursor: grabbing; }
.order-grip .icon { width: 16px; height: 16px; }
.order-no { min-width: 1.6em; color: var(--os-muted); font-variant-numeric: tabular-nums; }
.order-text { padding: 2px 6px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; line-height: 1.6; text-align: left; cursor: pointer; }
.order-text:hover { background: color-mix(in srgb, var(--priority) 10%, transparent); text-decoration: line-through; }   /* 點了會退回去 */
.order-step.given .order-text { color: var(--os-muted); cursor: default; }   /* 前面的文件帶進來的，不能退回 */
.order-step.given .order-text:hover { background: none; text-decoration: none; }
.order-step.given .order-text::after { content: '　← 前面的文件'; font-size: 12px; }
.order-pool { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--os-muted); }
.btn.block { display: block; width: 100%; text-align: left; margin-bottom: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.quiz-foot { display: flex; justify-content: flex-end; gap: 8px; }
.quiz-result .score { font-size: 28px; font-weight: 700; margin: 0; }
.quiz-result .wrong { padding: 6px 0; border-top: 1px dotted var(--os-border); }
.quiz-result .wrong b { color: var(--priority); }
.win-code .win-body { background: #1e1e1e; color: #d4d4d4; --os-bar: #2a2d2e; --os-border: #3c3c3c; --os-muted: #9aa0a6; --os-win: #252526; --os-fg: #d4d4d4; }
.win-code .win-bar { background: #323233; color: #ccc; border-color: #3c3c3c; }
.win-code .item legend.code { color: #9cdcfe; }
/* 需求討論：原話切段，點一下像用螢光筆圈起來 */
.transcript { line-height: 1.9; font-size: 15px; }
.seg { display: inline; border: 0; background: transparent; color: var(--os-fg); font: inherit; padding: 2px 3px; border-radius: 4px; cursor: pointer; text-align: left; }
.seg:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.reply-line { margin: 0 0 6px; }
.discuss-log { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.docs.line .doc-pane.chat { background: var(--chat-bg); border-radius: 10px; padding: 10px; }   /* LIME 的萊姆黃 */
.docs.line .discuss-log .them { background: var(--chat-them); }
/* 同事傳來的照片（photos.js）：泡泡裡一張小圖，點了放大 */
.discuss-log .them.chat-photo { padding: 4px; cursor: zoom-in; width: min(220px, 70%); }
.discuss-log .them.chat-photo.big { width: min(480px, 100%); cursor: zoom-out; }
.photo-svg { display: block; width: 100%; height: auto; border-radius: 6px; }
/* 主動傳訊：對話底下的輸入列（點了展開能講的話）、對方輸入中 */
.chat-compose { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--os-border); }
.talk-picker { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow: auto; }
.talk-picker[hidden] { display: none; }
.btn.talk-option { text-align: left; white-space: normal; }
.chat-input { text-align: left; padding: 8px 14px; border: 1px solid var(--os-border); border-radius: 18px; background: var(--chat-them); color: var(--os-muted); font: inherit; font-size: 14px; cursor: text; }
.chat-input:disabled { cursor: default; opacity: .6; }
.chat-typing { align-self: flex-start; font-size: 12px; color: var(--os-muted); }
.docs.line .discuss-log .sticker { background: transparent; padding: 0; }
.docs.line .chat-who { align-self: flex-start; margin: 4px 0 -4px 4px; font-size: 12px; color: var(--os-muted); }   /* 群組裡是誰說的 */.sticker-art { display: block; width: 96px; height: 96px; }
.docs.line .doc-pane h3 { margin: 0 0 8px; }
.docs.line .chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }   /* 對方有座位時旁邊多一顆「走過去」 */
.docs.line .chat-head h3 { margin-bottom: 8px; }
.docs.line .discuss-log { overflow: auto; flex: 1; margin: 0; }
.docs.line .discuss-log p { white-space: pre-wrap; }
.chat-actions { align-self: flex-end; display: flex; gap: 6px; }
.discuss-log p { margin: 0; padding: 8px 12px; border-radius: 10px; max-width: 85%; font-size: 14px; line-height: 1.5; }
.discuss-log .me { align-self: flex-end; background: var(--accent); color: #fff; }
/* 回比較早的訊息：像 LINE 的回覆，泡泡上方引用被回的那則（誰說的＋原文前兩行），底下一條分隔線 */
.discuss-log .me .chat-quote { display: block; margin: 0 0 6px; padding: 0 0 6px 8px; border-left: 3px solid rgba(255,255,255,.7); border-bottom: 1px solid rgba(255,255,255,.35); font-size: 12px; line-height: 1.4; white-space: normal; opacity: .9; }
.discuss-log .me .chat-quote b { display: block; font-weight: 600; }
.discuss-log .me .chat-quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.discuss-log .them { align-self: flex-start; background: var(--os-bar); }
.seg.circled { background: #fff3a0; color: #4a3a00; box-shadow: inset 0 -2px 0 #e6b800; }
.opt.given { color: var(--os-muted); }
.opt.given span::after { content: '　← 前面的文件'; font-size: 12px; }
.item legend .blank { border-bottom: 1.5px solid currentColor; color: var(--os-muted); padding: 0 2px; letter-spacing: .05em; }
.item legend .blank.filled { color: var(--accent); font-weight: 600; letter-spacing: 0; }
.fn { margin: 0 0 10px; border-left: 3px solid #3c3c3c; padding-left: 10px; }
.fn pre { margin: 0; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.fn-head { color: #dcdcaa; }
.fn.pulled .fn-code, .fn-does { color: #6a9955; }
.fn.fill { border-left-color: #f59e0b; }
.fn-field { display: flex; align-items: center; gap: 8px; margin: 4px 0 4px 16px; font-size: 13px; }
.fn-field select { font-family: var(--mono); font-size: 13px; background: #1e1e1e; color: #d4d4d4; border: 1px solid #3c3c3c; border-radius: 4px; padding: 3px 6px; min-height: 32px; }
.no-source { color: #f59e0b; }
.win-code .opt span { font-family: var(--mono); font-size: 13px; }

/* ── 桌面（實體的那層） ── */
.surface { position: relative; display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.device { width: 78px; height: 110px; border-radius: 12px; background: #111; border: 3px solid #333; color: #ddd; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 6px; font-size: 12px; cursor: pointer; }
.device.tablet { width: 120px; height: 92px; }
.device.private { cursor: default; }
.battery { font-family: var(--mono); font-size: 13px; color: #8fd18f; }
.battery.low { color: #ff6b6b; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.private-time { font-family: var(--mono); font-size: 13px; }
/* 新訊息：私人手機震動、螢幕右下角的通知氣泡 */
.device.private.buzz { animation: buzz .45s ease-in-out 3; }
@keyframes buzz { 0%, 100% { transform: none; } 25% { transform: translateX(-3px) rotate(-2deg); } 75% { transform: translateX(3px) rotate(2deg); } }
.notif { position: absolute; right: 12px; bottom: 44px; z-index: 30; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 320px; padding: 10px 14px; border: 1px solid var(--os-border); border-radius: 10px; background: var(--os-win); color: var(--os-fg); box-shadow: 0 8px 24px var(--os-shadow); text-align: left; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .25s; cursor: pointer; }
.notif.show { opacity: 1; transform: none; }
/* 人在同事座位時的通知：掛在螢幕外、浮在工作台（z-index 60）上面，顏色變數拿不到螢幕裡的，自己帶淺色那套 */
.notif.away { position: fixed; bottom: auto; z-index: 70; --os-win: #ffffff; --os-fg: #1f2328; --os-border: #c5ccd8; --os-muted: #4b5563; --os-shadow: rgba(0,0,0,.25); }
.notif b { font-size: 12px; color: var(--os-muted); }
.notif span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
/* 文件／信箱／LINE 與開卡 */
.docs { display: grid; grid-template-columns: 200px 1fr; gap: 10px; height: 100%; }
.doc-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; border-right: 1px solid var(--os-border); padding-right: 8px; }
.doc-item { text-align: left; border: 0; background: transparent; color: var(--os-fg); padding: 8px; border-radius: 6px; font-size: 13px; min-height: 36px; }
.doc-item.active { background: var(--os-bar); }
.doc-pane { overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.doc-pane h3 { margin: 0; font-size: 15px; }
.doc-from { margin: 0; color: var(--os-muted); font-size: 12px; }
.doc-text { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.6; }
.doc-actions { display: flex; gap: 8px; margin-top: auto; }
.act-link { border: 0; background: transparent; color: var(--os-fg); font: inherit; padding: 0; cursor: pointer; text-align: left; text-decoration: underline dotted var(--os-muted); text-underline-offset: 3px; }
.act-link:hover { color: var(--accent); }
.doc-replied { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--accent); color: #fff; align-self: flex-end; font-size: 13px; }
/* 窄視窗（開會時的筆電、手機）：信箱、文件的清單疊在上面、內容在下面，兩邊各自捲（標題長，左右擠不下）。
   LIME 照 LINE 電腦版維持左右兩欄，聯絡人欄變窄，對話用到整個視窗高度 */
@container (max-width: 520px) {
  .docs { grid-template-columns: 1fr; grid-template-rows: minmax(0, 32%) minmax(0, 1fr); }
  .doc-list { border-right: 0; border-bottom: 1px solid var(--os-border); padding: 0 0 6px; }
  .docs.line { grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 8px; }
  .docs.line .doc-list { border-bottom: 0; border-right: 1px solid var(--os-border); padding: 0 6px 0 0; }
  .docs.line .doc-item { padding: 6px; font-size: 12px; word-break: keep-all; overflow-wrap: anywhere; }   /* 名字斷在部門和人名中間的空白 */
}
.newcard { display: flex; flex-direction: column; gap: 10px; }
.nc-row { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; font-size: 13px; }
.nc-row select, .nc-row input { font-size: 13px; padding: 6px 8px; border: 1px solid var(--os-border); border-radius: 6px; background: var(--os-win); color: var(--os-fg); min-height: 36px; }
.priority-locked { color: var(--priority); font-weight: 700; opacity: .7; }
.nc-body { border: 1px solid var(--os-border); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.nc-body legend { font-size: 12px; color: var(--os-muted); padding: 0 4px; }
.nc-sentence, .nc-attach { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.5; min-height: 32px; }
.nc-sentence input, .nc-attach input { margin-top: 4px; }
/* 桌面實體層：紙堆、訪客、充電座 */
.papers { display: flex; gap: 8px; }
.paper { width: 72px; height: 72px; border: 0; background: #fff; box-shadow: 2px 3px 6px rgba(0,0,0,.4); font-size: 26px; transform: rotate(2deg); cursor: pointer; }
.paper.self { background: #fff5a6; transform: rotate(-3deg); }
.paper-label { display: block; font: 700 14px/1 var(--mono); color: #8a6d00; }
.paper-view { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.paper-view .sheet { width: min(420px, 90vw); background: #fff; color: #1f2328; padding: 24px; box-shadow: 0 12px 40px rgba(0,0,0,.5); transform: rotate(-1deg); font-size: 15px; line-height: 1.6; }
.paper-view.self .sheet { background: #fff5a6; color: #4a3a00; }
.paper-view .sheet p { white-space: pre-line; }
.paper-view .sheet h3 { margin: 0 0 10px; font-size: 16px; }
.paper-view .sheet p { margin: 0; white-space: pre-wrap; }
.paper-view .sheet .hand { display: block; max-width: 100%; height: auto; opacity: .85; }   /* 手寫圖：paper-ink.js */
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.visitor { position: absolute; left: 24px; bottom: calc(100% + 8px); display: flex; align-items: center; gap: 12px; background: #fff; color: #1f2328; padding: 12px 16px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 30; max-width: 480px; }
.visitor[hidden] { display: none; }
.visitor::after { content: ''; position: absolute; left: 28px; top: 100%; border: 10px solid transparent; border-top-color: #fff; }
.visitor.arrive { animation: visitor-in .4s ease-out; }
@keyframes visitor-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.visitor-face { font-size: 32px; }
.visitor-text { margin: 0; font-size: 14px; line-height: 1.5; }
/* 內網 502 中：外接螢幕頂欄變紅 */
.desk.down .screen.monitor .os-top { background: #b91c1c; color: #fff; }
.desk.down .screen.monitor .os-top .os-day::after { content: '　⚠ 內網 502'; font-weight: 700; }
/* 手動測試模式：整張桌子壓暗，手機、平板、螢幕亮起來可以點 */
.desk.testing::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 34; pointer-events: none; }
.desk.testing .device[data-device], .desk.testing .screen { position: relative; z-index: 36; outline: 3px dashed var(--accent); outline-offset: 4px; cursor: pointer; }
.desk.testing .screen { position: absolute; }
.desk.testing .device.private { opacity: .4; }
.test-bar { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; background: #1f2328; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; max-width: 90vw; }
.test-count { color: #c9d1d9; font-size: 13px; }
.devtools { position: absolute; left: 0; right: 0; bottom: 34px; height: 120px; background: #1e1e1e; color: #d4d4d4; border-top: 2px solid #3c3c3c; z-index: 40; font-family: var(--mono); }
.devtools-bar { padding: 6px 12px; font-size: 12px; background: #2d2d2d; border-bottom: 1px solid #3c3c3c; }
.devtools-row { display: flex; gap: 10px; padding: 14px 12px; }
.devtools .btn { background: #2d2d2d; color: #d4d4d4; border-color: #3c3c3c; }
.crash { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 70; background: #1a0000; color: #ff8a80; border: 2px solid #ff5252; padding: 18px 20px; width: min(560px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.crash pre { margin: 0 0 12px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
/* 排插：靠桌邊、兩個插座，插頭拉出去是一條線 */
.strip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #f2efe8; border: 2px solid #c9c2b5; border-radius: 6px; box-shadow: 0 3px 6px rgba(0,0,0,.3); align-self: flex-end; margin-bottom: 6px; }
.strip-label { font-size: 10px; color: #8a8378; letter-spacing: .15em; }
.plug { width: 30px; height: 30px; border: 2px solid #777; border-radius: 6px; background: #2b2b2b; cursor: grab; touch-action: none; position: relative; }
.plug::before, .plug::after { content: ''; position: absolute; top: 7px; width: 4px; height: 12px; background: #d9d9d9; border-radius: 1px; }
.plug::before { left: 8px; } .plug::after { right: 8px; }
.plug.dragging { cursor: grabbing; filter: brightness(1.3); }
.cables { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 3; }
.cables .cable { fill: none; stroke: #1a1a1a; stroke-width: 4; stroke-linecap: round; }
.cables .cable.loose { stroke: #555; stroke-dasharray: 6 4; }
.device { user-select: none; }
.device.plugged { border-color: #8fd18f; }
.device.plugged .battery::after { content: ' ⚡'; }
/* 手繪外框（ink-frame.js）：墊在按鈕文字後面、不吃點擊；底色和線都用同一個手繪形狀畫，色讀 --ink-fill／--ink */
.inked { position: relative; isolation: isolate; background: transparent !important; border-color: transparent !important; }
.inked > .ink-frame { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ink-frame .ink-fill { fill: var(--ink-fill, #fff); stroke: none; }
.ink-frame .ink-line { fill: var(--ink, #2b2f36); fill-opacity: .92; stroke: none; }
.btn.parts-box.inked { --ink-fill: #fff; }
.coffee.inked { --ink-fill: #d9c6a8; }
.coffee.inked.on { --ink-fill: #fff; }
.leave.inked { --ink-fill: #2d3b2d; --ink: #142014; }
.badge-cols.inked, .mode-badge.inked, .mode-card.inked, .report.inked, .grad-card.inked, .summary-card.inked { --ink-fill: var(--paper); }
.btn.inked { --ink-fill: #fff; }   /* --ink-fill 會繼承：按鈕自己設白底，不吃外層卡片的紙色 */
.btn.mode-back.inked { --ink-fill: var(--paper); }
.mode-actions .btn.inked:disabled { --ink-fill: #ece6da; --ink: #b9b0a0; }
.btn.primary.inked { --ink-fill: var(--accent); }
.btn.ghost.inked { --ink-fill: transparent; }
.draw-played .btn.active.inked { --ink-fill: #eef4ff; }
.mode-tabs .btn.index-tab:nth-child(1) { --ink-fill: #f4ec6b; }
.mode-tabs .btn.index-tab:nth-child(2) { --ink-fill: #ecebdc; }
.mode-tabs .btn.index-tab:nth-child(3) { --ink-fill: #7cc6f2; }
.mode-tabs .btn.index-tab:nth-child(4) { --ink-fill: #f7a8c9; }
.hb-panel.inked, .home-box.inked, .box-panel.inked { --ink-fill: var(--paper); }
.hb-panel.inked { box-sizing: border-box; padding: 4px; }   /* 內容的捲軸縮在框線內，不蓋到線 */
.box-panel .btn.inked { padding: 5px 12px; }   /* 小字鈕套框後多留白，框線才不會貼字 */
.hb-jump.inked, .atlas-tab.inked { --ink-fill: transparent; }
.atlas-tab.on.inked { --ink-fill: rgba(37, 99, 235, .12); --ink: var(--accent); }
.journal-tab.inked { --ink-fill: #ece6da; margin-bottom: 6px; }
.journal-tab.inked[aria-selected="true"] { --ink-fill: #fff; margin-bottom: 6px; }
/* 識別證的表單：輸入框、下拉選單包一層 .ink-field 畫框（input／select 裡面放不進 SVG）；性別三選一整組一個框，選中的那格縮在框線內 */
.ink-field { display: block; }
.ink-field.inked { --ink-fill: #fff; }
.badge .ink-field input, .badge .ink-field select { display: block; width: 100%; box-sizing: border-box; border: 0; background: transparent; }
.seg.inked { --ink-fill: #fff; gap: 2px; padding: 4px; overflow: visible; }
.seg.inked span { background: transparent; border-right: 0; border-radius: 4px; }
.seg.inked input:checked + span { background: var(--accent); }
/* 深色底上的手繪鈕：線換淺色；hover 換底色要改 --ink-fill（.inked 把 background 鎖成透明） */
.raise .btn.inked { --ink-fill: #f6f1e7; }
.raise .btn.inked:hover { --ink-fill: #ffd166; }
.raise .btn.ghost.inked { --ink-fill: transparent; --ink: #e9e4d6; }
.raise .btn.ghost.inked:hover { --ink-fill: rgba(255, 255, 255, .12); }
.hm-chip.inked, .hm-tab.inked { --ink-fill: transparent; --ink: #f3e9dc; }
.hm-chip.on.inked, .hm-tab.on.inked { --ink-fill: #f3e9dc; }
.coffee { margin-left: auto; border: 0; background: #d9c6a8; border-radius: 20px; padding: 10px 16px; }
.coffee.on { background: #fff; }
.leave { border: 0; background: #2d3b2d; color: #fff; border-radius: 8px; padding: 10px 18px; }
.leave.sleep { display: inline-flex; align-items: center; gap: 6px; }   /* 茶几上的「洗澡睡覺」跟公司的「下班」同一個位置 */
.leave.sleep .icon { width: 16px; height: 16px; }
.leave.sleep[hidden] { display: none; }
/* 提示便條：紅圖釘釘在左上角，新提示出現時整張抖一下 */
.hint { position: absolute; right: 24px; bottom: 100%; margin-bottom: -8px; max-width: 360px; background: #fff5a6; color: #4a3a00; padding: 14px 16px 14px 18px; border-radius: 4px; box-shadow: 2px 4px 10px rgba(0,0,0,.4); transform: rotate(1.5deg); font-size: 15px; font-weight: 600; line-height: 1.55; z-index: 20; }
.hint-fold { display: none; }
.hint-pass { display: block; margin: 6px 0 0 auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.hint.soft { background: #e8f0ff; color: #1f2d4d; font-weight: 500; }
.hint::before { content: ''; position: absolute; left: -6px; top: -10px; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a80, #d32f2f 60%, #8e1a1a); box-shadow: 1px 2px 4px rgba(0,0,0,.45); z-index: 2; }
.hint::after { content: ''; position: absolute; left: 2px; top: 6px; width: 2px; height: 14px; background: linear-gradient(#9e9e9e, #424242); transform: rotate(-20deg); transform-origin: top; z-index: 1; }
.hint.pop { animation: hint-pop .5s ease-out; }
@keyframes hint-pop { 0% { transform: rotate(1.5deg) scale(.92); } 40% { transform: rotate(-2deg) scale(1.05); } 70% { transform: rotate(3deg) scale(1); } 100% { transform: rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .hint.pop { animation: none; } }
.toast { position: absolute; left: 24px; top: -70px; background: #1f2328; color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: .25s; display: flex; gap: 8px; }
.toast.show { opacity: 1; transform: none; }

/* ── 識別證、結算卡、bad end ── */
.badge-screen, .report-screen, .bad-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: var(--paper); }
.badge-screen { position: relative; overflow: hidden; }
.bg-carousel { position: absolute; inset: 0; z-index: 0; }
.bg-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; image-rendering: pixelated; }
.bg-slide.on { opacity: 1; }
.bg-legacy { background: url(assets/bg/legacy_wood.svg) center bottom / 100% 32% no-repeat, url(assets/bg/legacy_wall.svg) center top / cover no-repeat; background-color: #d9d3c3; }
.bg-hybrid { background: url(assets/bg/hybrid_wood.png) center bottom / 100% 32% no-repeat, url(assets/bg/hybrid_wall.png) center top / cover no-repeat; background-color: #cdd4dc; }
.bg-speedrun { background: url(assets/bg/speedrun_desk.webp) center / cover no-repeat; }
.bg-night { background: url(assets/bg/coffee_table_night.webp) center / cover no-repeat; }
.bg-caption { position: absolute; left: 18px; bottom: 14px; margin: 0; font-size: 12px; letter-spacing: .12em; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); z-index: 1; }
/* 識別證頁：一本攤開的小本子——同一張紙色卡片，左頁識別證、右頁標題＋核心一句話＋手冊圖鑑，中間一條虛線摺痕；手機變成上下開的小卡，摺痕橫的、標題頁在上 */
.badge-cols { position: relative; z-index: 1; display: grid; width: min(92vw, 320px); background: var(--paper); color: var(--ink); border-radius: 14px; box-shadow: 0 20px 40px rgba(0,0,0,.5); overflow: hidden; }
.badge-cols .badge, .badge-cols .badge-side { width: auto; background: none; box-shadow: none; border-radius: 0; padding: 22px; }
.badge-cols .badge { border-top: 2px dashed #bfb6a4; }
.badge-side { order: -1; display: flex; flex-direction: column; gap: 16px; }
.badge-side .title { background: var(--accent); border: 6px solid #2b2f36; border-radius: 3px; padding: 18px 18px 18px; text-align: left; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }   /* 一台小螢幕：按鈕同一個藍、靠左排、上面一個 :(，就是那個當機畫面 */
.badge-side .title .bsod-face { margin: 0 0 10px; font-family: 'Segoe UI', system-ui, sans-serif; font-size: clamp(15px, 1.6vw, 20px); line-height: 1; letter-spacing: 0; text-shadow: none; }   /* 跟副標一樣大：起聯想就好，主角是遊戲名稱 */
.badge-side .title p.sub { margin-top: 10px; letter-spacing: .2em; }
.tagline { margin: 0; font-size: 14px; line-height: 1.7; }
/* 一列最多兩顆（手機三顆擠到字換行）；單數的最後一顆自己一整列 */
.side-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px; }   /* 四顆鈕一樣高（籌備中那顆字比較長） */
.side-links small { display: block; font-size: 11px; }   /* 還沒做好的那顆：「籌備中」另起一行 */
.whats-new { position: relative; width: 100%; min-height: 44px; margin-top: 14px; padding: 8px 10px 6px; border: 1px dashed #cdbfa6; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; line-height: 1.4; cursor: pointer; }
.whats-new::before { content: 'New'; position: absolute; top: -9px; left: 10px; padding: 0 6px; background: var(--paper); color: var(--accent); font-size: 12px; font-weight: 700; line-height: 16px; }
.whats-new b { color: var(--accent); font-family: var(--mono); font-weight: 600; }
@media (min-width: 720px) {
  .badge-cols { width: min(92vw, 660px); grid-template-columns: 1fr 1fr; align-items: stretch; }
  .badge-cols .badge { border-top: 0; }
  .badge-side { order: 0; justify-content: center; border-left: 2px dashed #bfb6a4; }
}
.title { text-align: center; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.75); }
.title h1 { margin: 0; font-size: clamp(40px, 7vw, 72px); font-family: var(--mono); letter-spacing: .04em; line-height: 1; }
.title .n24 { color: #ffd166; font-size: 1.18em; }
.title p { margin: 8px 0 0; font-size: clamp(15px, 1.6vw, 20px); letter-spacing: .3em; }
@media (prefers-reduced-motion: reduce) { .bg-slide { transition: none; } }
.badge { width: 320px; box-sizing: border-box; background: var(--paper); color: var(--ink); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.badge-photo { position: relative; width: 96px; margin: 0 auto 6px; }
.badge-photo canvas, .report-avatar { display: block; width: 96px; height: 112px; image-rendering: pixelated; border-radius: 6px; border: 1px solid #c9c2b5; background: #cfd6e0; }
.report-avatar { width: 72px; height: 84px; margin: 0 0 6px; }
.reroll { position: absolute; right: -4px; bottom: -4px; font-size: 11px; padding: 4px 10px; border: 1px solid #c9c2b5; background: #fff; border-radius: 12px; }
.reroll.inked { --ink-fill: #fff; }
.badge label, .badge .field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.seg { display: flex; border: 1px solid #c9c2b5; border-radius: 6px; overflow: hidden; }
.seg label { flex: 1; flex-direction: row; margin: 0; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span { display: block; width: 100%; text-align: center; padding: 8px 0; font-size: 14px; cursor: pointer; background: #fff; color: var(--ink); border-right: 1px solid #c9c2b5; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }   /* 往外畫，選中那格的藍底上也看得到 */
.badge input, .badge select { font: inherit; padding: 8px; border: 1px solid #c9c2b5; border-radius: 6px; }
.badge .muted { margin: 0; font-size: 12px; }
.credit { margin: 4px 0 0; font-size: 12px; color: var(--muted); text-align: center; } .credit a { color: var(--accent); }
.save-open { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 8px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.mode-badge .save-open { margin: 2px 0 0 -8px; }
/* 存檔備份面板：savebox.js 是各遊戲共用的，樣式寫在行內，所以這裡要 !important；字放 ::after，按下去圖示換成 ⏳、✅ 時才不會被蓋掉 */
div:has(> button[aria-label="匯出存檔"]) { grid-template-columns: repeat(2, 96px) !important; }
div:has(> button[aria-label="匯出存檔"]) > button { width: 96px !important; height: 76px !important; }
div:has(> button[aria-label="匯出存檔"]) > button::after { content: attr(aria-label); display: block; margin-top: 4px; font-size: 13px; line-height: 1.2; }
.side-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; }
.foot-link { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 8px; font-size: 13px; }
/* 結算卡：背景是拿掉電腦的桌面（bg-<mode>）；手機單欄、PC 兩欄約 60vw */
.report-screen { grid-template-rows: auto auto; align-content: center; gap: 14px; background-color: #d9d3c3; }
.report { width: min(92vw, 380px); background: var(--paper); color: var(--ink); border-radius: 12px; padding: 26px; display: grid; gap: 22px; box-shadow: 0 20px 40px rgba(0,0,0,.45); }
.report p { margin: 0; }
.report-who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.report-who div { display: flex; flex-direction: column; gap: 2px; }
.report-who b { font-size: 18px; } .report-who span { font-size: 13px; color: var(--muted); }
.report-tally { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.report-tally .big { font-size: 18px; font-weight: 700; }
.report-tally .small { font-size: 13px; color: var(--muted); }
.report-tally .card { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }   /* 分數照卡分組：卡名 */
.report-tally .work { padding-left: 12px; }
.tally-group { border-top: 1px dotted #d8d1c4; padding-top: 6px; }
.tally-group summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.tally-group p { margin: 6px 0 0 12px; }
.report-right .estimates-title { margin-top: 26px; }
.report-estimates { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.report-estimates th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid #d8d1c4; padding: 4px 6px; }
.report-estimates td { padding: 5px 6px; border-bottom: 1px solid #ece6da; vertical-align: top; }
.report-estimates tr:has(+ .real) td { border-bottom: 0; padding-bottom: 0; }
.report-estimates .real td { font-size: 12px; color: var(--muted); padding-top: 2px; }
.report-estimates .real p { margin: 0 0 2px; }
.report-estimates .boss-says { display: flex; gap: 8px; margin-top: 4px; font-size: 15px; color: var(--ink); }
.report-estimates .boss-says span { font-weight: 700; }
.report-estimates .boss-says b { font-weight: 600; color: var(--muted); }
.quiz .hours-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.quiz .hours-row input { width: 6em; font: inherit; padding: 4px 8px; }
.report-right { border-top: 1px solid #e3ddd0; padding-top: 18px; }
.report-you { font-size: 13px; letter-spacing: .25em; color: var(--muted); }
.stamp { display: inline-block; margin: 10px 0 26px 6px; padding: 2px 18px 4px; font-family: var(--mono); font-size: 42px; font-weight: 700; line-height: 1.2; letter-spacing: .06em;
  color: #b3261e; border: 4px double #b3261e; border-radius: 8px; transform: rotate(-4deg); }
.verdict-line, .peer span { font-size: 18px; font-weight: 700; line-height: 1.5; }
.evidence { margin: 10px 0 18px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.peers-title { margin: 0 0 8px; font-size: 13px; font-weight: 400; letter-spacing: .25em; color: var(--muted); }
.peers { display: flex; flex-direction: column; gap: 12px; }
.peer { display: flex; flex-direction: column; gap: 2px; }
.peer b { font-size: 13px; font-weight: 600; color: var(--muted); }
/* 習慣與成就：一行一筆（名稱＋一句），字比同事評語小 */
.traits { gap: 6px; margin-bottom: 22px; }
.traits .peer { flex-direction: row; align-items: baseline; gap: 10px; }
.traits .peer b { flex: none; min-width: 4.5em; }
.traits .peer span { font-size: 15px; font-weight: 600; line-height: 1.4; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
/* 分享結算卡：不能用系統分享時跳出大圖，按存圖或長按／右鍵另存 */
.share-viewer { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.72); }
.share-viewer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: 100%; }
.share-viewer img { max-height: calc(100vh - 150px); max-width: min(92vw, 540px); border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.share-tip { margin: 0; color: #fff; font-size: 14px; text-align: center; }
.share-actions { display: flex; gap: 10px; }
@media (max-width: 899px) { .stamp { font-size: 30px; padding: 2px 12px 4px; } }
@media (min-width: 900px) {
  .report { width: 60vw; max-width: 1100px; grid-template-columns: 1fr 1.3fr; gap: 32px; padding: 32px 36px; }
  .report-right { border-top: 0; border-left: 1px solid #e3ddd0; padding: 0 0 0 32px; }
}
.bad-screen { background: #1a0a0a; } .bad-screen h1 { letter-spacing: .3em; }
/* 結業早會、三天總結算：跟結算卡同一套外框（拿掉電腦的桌面、紙色卡片、白字陰影的標題） */
.grad-card, .summary-card { width: min(100%, 640px); background: var(--paper); color: var(--ink); border-radius: 12px; padding: 26px 30px; box-shadow: 0 20px 40px rgba(0,0,0,.45); }
.grad-card { cursor: pointer; min-height: 300px; }
.grad-title, .summary-title { margin: 0 0 16px; font-size: 20px; letter-spacing: .08em; }
.grad-line { margin: 0 0 12px; font-size: 17px; line-height: 1.6; animation: grad-in .35s cubic-bezier(.2, 0, 0, 1); }
.grad-line b { margin-right: 8px; } .grad-aside { margin-right: 4px; color: var(--muted); }
@keyframes grad-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .grad-line { animation: none; } }
.grad-end { display: grid; justify-items: center; gap: 14px; }
.grad-end h1 { margin: 0; color: #fff; letter-spacing: .3em; font-size: clamp(28px, 4vw, 40px); text-shadow: 0 2px 10px rgba(0,0,0,.75); }
.summary-who { margin: 0 0 18px; }
.summary-days { display: grid; gap: 18px; }
.summary-day { border-top: 1px solid #e3ddd0; padding-top: 14px; }
.summary-day-name { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.summary-day .stamp { margin: 10px 0 14px 6px; font-size: 30px; padding: 2px 12px 4px; }
.summary-line { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.5; }
.summary-peer, .summary-trait, .summary-est { margin: 12px 0 0; } .summary-peer span, .summary-trait span, .summary-est span { font-size: 14px; line-height: 1.5; }
.summary-est .summary-boss { font-weight: 400; color: var(--muted); }
.summary-trait b { color: #b3261e; }   /* 成就的稱號用印章紅，跟同事的名字分得開 */
.summary-chain { margin: 22px 0 0; text-align: center; font-weight: 700; }
@media (min-width: 900px) {
  .summary-card { width: 60vw; max-width: 1100px; padding: 32px 36px; }
  .summary-days { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
  .summary-day { border-top: 0; border-left: 1px solid #e3ddd0; padding: 0 0 0 24px; } .summary-day:first-child { border-left: 0; padding-left: 0; }
}
/* bad end 的結算卡：卡片上面一條暗紅底的 BAD END 和原因 */
.report-bad { text-align: center; background: rgba(26, 10, 10, .88); color: #ffd9d9; padding: 14px 28px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.report-bad h1 { margin: 0; letter-spacing: .3em; font-size: clamp(28px, 4vw, 40px); }
.report-bad .reason { margin: 6px 0 0; }

/* ── 成品畫面（screen.js）：手動測試的預覽、結算卡縮圖 ── */
.preview { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.55); }
.preview .frame { position: relative; background: #111; border: 10px solid #222; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden; }
.preview .frame.pc { border-radius: 8px; border-width: 12px 12px 28px; }
.preview .frame.phone { border-radius: 28px; border-width: 14px 8px; }
.preview .frame.tablet { border-radius: 18px; border-width: 12px; }
.preview .frame-body { background: #fff; overflow: auto; height: 100%; }
.preview .frame-dead { display: grid; place-items: center; height: 100%; color: #666; font-size: 14px; background: #000; }
.preview .preview-bar { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; color: #fff; font-size: 14px; }
.mock { font-family: var(--font); color: var(--mock-fg, #1f2328); background: var(--mock-bg, #fff); min-height: 100%; font-size: 13px; }
.mock-top { padding: 10px 14px; background: var(--mock-accent, #2563eb); color: #fff; font-weight: 700; }
.mock .mock-btn.primary { background: var(--mock-accent, #2563eb); border-color: var(--mock-accent, #2563eb); }
.mock .mock-input.bad { border-color: #b91c1c; }
.mock-demo { margin: 4px 0 4px 82px; font-size: 12px; }
.mock-demo-inline { color: #b91c1c; }
.mock-demo-tooltip span { display: inline-block; background: #1f2328; color: #fff; padding: 3px 8px; border-radius: 4px; position: relative; }
.mock-demo-tooltip span::before { content: ''; position: absolute; left: 12px; top: -5px; border: 5px solid transparent; border-top: 0; border-bottom-color: #1f2328; }
.mock-demo-toast span { display: inline-block; background: #1f2328; color: #fff; padding: 6px 12px; border-radius: 20px; opacity: .85; }
.mock-demo-dialog, .mock-demo-alert { margin-left: 0; padding: 10px; background: rgba(0,0,0,.35); border-radius: 6px; }
.mock-demo-box { width: 260px; margin: 0 auto; background: #fff; color: #1f2328; border-radius: 8px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.mock-demo-alert .mock-demo-box { border-radius: 2px; border: 1px solid #999; font-family: Arial, sans-serif; }
.mock-demo-box p { margin: 0 0 8px; } .mock-demo-btns { display: flex; gap: 6px; justify-content: flex-end; }
/* 前端設計的色票與提示方式縮圖 */
.swatch { display: inline-flex; align-items: center; gap: 6px; width: 64px; height: 30px; padding: 0 8px; border: 1px solid #c5ccd8; border-radius: 6px; font-weight: 700; font-size: 14px; flex: none; }
.swatch-btn { display: inline-block; width: 16px; height: 10px; border-radius: 3px; margin-left: auto; }
.thumb { position: relative; display: inline-block; width: 64px; height: 44px; background: #fff; border: 1px solid #c5ccd8; border-radius: 4px; overflow: hidden; flex: none; }
.thumb i { position: absolute; display: block; }
.thumb .tp-line { left: 6px; top: 6px; width: 40px; height: 3px; background: #d1d5db; } .thumb .tp-line.short { top: 12px; width: 24px; }
.thumb .tp-field { left: 6px; top: 20px; width: 34px; height: 8px; border: 1px solid #9ca3af; border-radius: 2px; }
.thumb .tp-dim { inset: 0; background: rgba(0,0,0,.35); }
.thumb .tp-dialog { left: 14px; top: 10px; width: 36px; height: 22px; background: #fff; border-radius: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.thumb .tp-dialog b { position: absolute; left: 5px; top: 5px; width: 24px; height: 3px; background: #6b7280; }
.thumb .tp-dialog u { position: absolute; bottom: 4px; width: 10px; height: 5px; border-radius: 2px; background: #2563eb; } .thumb .tp-dialog u:first-of-type { right: 16px; background: #d1d5db; } .thumb .tp-dialog u:last-of-type { right: 4px; }
.thumb .tp-toast { right: 4px; bottom: 4px; width: 30px; height: 8px; background: #1f2328; border-radius: 4px; }
.thumb .tp-tip { left: 10px; top: 29px; width: 26px; height: 8px; background: #1f2328; border-radius: 2px; }
.thumb .tp-tip::before { content: ''; position: absolute; left: 6px; top: -4px; border: 4px solid transparent; border-top: 0; border-bottom-color: #1f2328; }
.thumb .tp-err { left: 6px; top: 32px; width: 28px; height: 3px; background: #dc2626; }
.thumb .tp-alert { left: 10px; top: 8px; width: 44px; height: 26px; background: #fff; border: 1px solid #9ca3af; }
.thumb .tp-alert b { position: absolute; left: 4px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; color: #fff; font-size: 8px; line-height: 10px; text-align: center; font-style: normal; }
.thumb .tp-alert u { position: absolute; right: 4px; bottom: 3px; width: 12px; height: 6px; background: #e5e7eb; border: 1px solid #9ca3af; }
.devtools.tall { height: 250px; }
.lh-scores { display: flex; gap: 28px; padding: 12px 16px 6px; }
.lh-score { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.lh-ring { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 4px solid; }
.lh-ring.good { color: #0cce6b; border-color: #0cce6b; background: rgba(12,206,107,.12); }
.lh-ring.meh { color: #ffa400; border-color: #ffa400; background: rgba(255,164,0,.12); }
.lh-ring.bad { color: #ff4e42; border-color: #ff4e42; background: rgba(255,78,66,.12); }
.lh-notes { margin: 0; padding: 0 16px 0 32px; font-size: 12px; line-height: 1.6; max-height: 96px; overflow: auto; }
.devtools.tall .btn { position: absolute; right: 12px; top: 6px; }
.mock-2008 .mock-top, .mock-plain .mock-top { background: #d4d0c8; color: #000; font-family: "MS PGothic", "PMingLiU", serif; border-bottom: 2px solid #808080; }
.mock-plain { background: #fff; font-family: "PMingLiU", "MingLiU", serif; }
.mock-plain .mock-table { border: 1px solid #000; } .mock-plain th { background: #c0c0c0; } .mock-plain td, .mock-plain th { border: 1px solid #808080; }
.mock-login { margin: 10px 14px 0; padding: 8px 10px; border: 1px dashed #b45309; color: #b45309; border-radius: 6px; }
.mock-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #e5e7eb; }
.mock-input, .mock-select { font: inherit; padding: 5px 8px; border: 1px solid #c5ccd8; border-radius: 6px; min-width: 120px; }
.mock-btn { font: inherit; padding: 5px 10px; border: 1px solid #c5ccd8; border-radius: 6px; background: #fff; }
.mock-btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.mock-btn.small { padding: 2px 7px; font-size: 12px; } .mock-btn.danger { color: #b91c1c; border-color: #f3c0c0; }
.mock-table { width: 100%; border-collapse: collapse; margin: 0; }
.mock-table th, .mock-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #eef0f3; white-space: nowrap; }
.mock-table th { color: #4b5563; font-weight: 600; background: #f8fafc; }
.mock-table tr.scrapped td { color: #9ca3af; text-decoration: line-through; }
.mock-empty { padding: 14px; color: #6b7280; text-align: center; }
.mock-error { margin: 6px 10px; padding: 6px 10px; border-radius: 6px; background: #fde8e8; color: #b3261e; font: 600 12px var(--mono); }   /* 成品畫面上的錯誤（例如 jQuery 升壞了） */
.mock-csv { margin: 0; padding: 8px 10px; background: #f3f4f6; border-radius: 6px; font: 12px var(--mono); white-space: pre; overflow-x: auto; }   /* ERP 讀到的 CSV 前幾列 */
.mock-chat-q { margin: 0; font-size: 12px; color: #6b7280; }
.mock-chat-a { margin: 0 0 6px; padding: 6px 10px; background: #eef2ff; border-radius: 10px; font-size: 12px; }
.mock-404 { font-size: 64px; font-weight: 700; text-align: center; padding-top: 40px; color: #9ca3af; }
.mock-tiles { display: flex; gap: 10px; padding: 12px 14px 0; }
.mock-tile { flex: 1; padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px; display: flex; flex-direction: column; } .mock-tile b { font-size: 22px; }
.mock-cards { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.mock-card { padding: 10px; border: 1px solid #e5e7eb; border-radius: 8px; display: flex; flex-direction: column; gap: 4px; } .mock-card span { color: #6b7280; font-size: 12px; }
.mock-actions { display: inline-flex; gap: 6px; }
.mock-pager { padding: 8px 14px; color: #6b7280; }
.mock-form { margin: 14px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }
.mock-form h4 { margin: 0 0 4px; } .mock-field { display: flex; align-items: center; gap: 10px; } .mock-field span { width: 72px; color: #4b5563; }
.report-shot { margin-top: 14px; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid #e3ddd0; border-radius: 8px; background: #fff; position: relative; }
.report-shot .mock { position: absolute; left: 0; top: 0; width: 960px; transform-origin: 0 0; pointer-events: none; }
.report-shot-label { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ── 到同事座位（正式上班）：換座位的氛圍。自己的螢幕和視窗藏起來（回座位原樣都在），牆和桌面沿用這個時代的底圖；
   同事的螢幕站在桌面上、跟自己的螢幕同一個位置（speedrun 插圖上的鐘照樣藏在它後面），他的擺設是場景的一部分，擺在螢幕左邊的桌面上 ── */
.desk.at-seat .screens { visibility: hidden; }
/* 人在同事那邊只帶得到公務手機（變成一顆功能按鈕）：自己桌上的裝置、排插和線、便條都留在自己座位 */
.desk.at-seat .surface > .device, .desk.at-seat .surface .strip, .desk.at-seat .surface .cables, .desk.at-seat .surface .papers { display: none; }
/* 站在自己桌邊等的人，人在同事座位時看不到（等太久會照樣留紙條走，回座位看到紙條） */
.desk.at-seat .surface .visitor { display: none; }
/* 人在同事座位時自己的螢幕藏起來了，暫停的字和遮罩改蓋在座位畫面上（樣子跟電腦上那層一樣） */
.desk.on-break .seat-room::after { content: '暫停中'; position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; font-size: 28px; letter-spacing: .3em; color: #2b2f36; background: rgba(217, 210, 195, .6); pointer-events: none; }
/* --edge：桌子後緣離畫面頂端多遠。照 speedrun 插圖（cover、對齊上緣，桌面從第 661／1080 列開始），三個時代對齊這條線 */
.seat-room { --edge: min(.612 * max(56.25vw, 100dvh), 100% - 60px); position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 24px; box-sizing: border-box; color: #2b2f36; }
/* legacy、hybrid 的桌緣往上加：從桌緣到座位畫面底部補一段同時代的木頭桌面（材質最上面兩列就是桌緣線），桌面那排藏掉自己的桌緣線接在後面 */
.seat-desktop { position: absolute; left: 0; right: 0; top: var(--edge); bottom: 0; pointer-events: none; image-rendering: pixelated; }
.seat-room[data-mode="legacy"] .seat-desktop { background: url(assets/bg/legacy_wood.svg) center / 100% 100% no-repeat; }
.seat-room[data-mode="hybrid"] .seat-desktop { background: url(assets/bg/hybrid_wood.png) center / 100% 100% no-repeat; }
.desk.at-seat[data-mode="legacy"] .surface, .desk.at-seat[data-mode="hybrid"] .surface { background-size: 100% calc(100% + 20px); background-position: center bottom; }
/* 牆面左上那一欄：寬度留到螢幕左邊為止 */
.seat-title, .seat-say, .seat-hand { max-width: calc(37% - 24px); }
.seat-title { margin: 0; padding: 4px 12px; border-radius: 6px; background: rgba(246, 241, 231, .9); font-size: 18px; }   /* 座位名稱貼在牆上，任何牆色都讀得到 */
/* 尺寸和位置照自己的外接螢幕（.screens 的邊界＋.screen.monitor 的 63%／96%），下框貼著桌面 */
.seat-monitor { position: absolute; right: 18px; bottom: 0; width: calc((100% - 36px) * .63); aspect-ratio: 16 / 10; max-height: calc((100% - 14px) * .96); box-sizing: border-box;   /* 直式平板也是一台正常比例的螢幕，不拉成直條 */ overflow: hidden; padding: 12px; border: 10px solid var(--bezel); border-bottom-width: 22px; border-radius: 12px 12px 4px 4px; background: #1e293b; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.seat-room[data-wallpaper="sportscar"] .seat-monitor { background: linear-gradient(160deg, #0f172a 0 52%, #b91c1c 52% 60%, #0f172a 60% 64%, #b91c1c 64% 67%, #0f172a 67%); }   /* 跑車桌布：兩道紅色斜線 */
.seat-room[data-wallpaper="family"] .seat-monitor { background: radial-gradient(circle at 30% 62%, #f2c9a0 0 7%, transparent 7.5%), radial-gradient(circle at 46% 58%, #e8b48a 0 8%, transparent 8.5%), radial-gradient(circle at 62% 64%, #f2c9a0 0 6%, transparent 6.5%), linear-gradient(180deg, #9fd3f0 0 55%, #8cc87a 55%); }   /* 全家福桌布：藍天草地上三顆頭 */
.seat-room[data-wallpaper="landscape"] .seat-monitor { background: linear-gradient(180deg, transparent 0 70%, #6a9fbf 70%, #4b7f9e 100%), radial-gradient(ellipse 26% 24% at 28% 72%, #4f7d58 0 98%, transparent 100%), radial-gradient(ellipse 34% 30% at 70% 74%, #3f6b4c 0 98%, transparent 100%), linear-gradient(180deg, #f3c98f 0 15%, #bcd6e4 50%); }   /* 山水桌布：黃昏的天、兩座山、山前的湖 */
.seat-shortcuts { display: flex; flex-flow: column wrap; align-content: flex-start; gap: 12px; height: 100%; }
.seat-shortcut { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; font-size: 12px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
/* 在這個座位能做的事（開工作台、看她的手機或信箱）：放在他螢幕的正中央，走過來第一眼就看到 */
.seat-actions { position: absolute; right: calc(18px + (100% - 36px) * .315); bottom: calc(min((100vw - 36px) * .39375, (100% - 14px) * .96) / 2); z-index: 1;   /* 螢幕高＝min(寬÷1.6, 原本的高)，取一半 */ transform: translate(50%, 50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.seat-actions .btn { padding: 14px 28px; font-size: 20px; font-weight: 700; white-space: nowrap; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
/* 他桌上的擺設：螢幕左邊那片桌面，底部貼著桌面、往螢幕靠，最後一件貼著螢幕（紙類可以貼在螢幕側邊）；是背景的一部分，沒有功能，不吃點擊 */
.seat-props { position: absolute; left: 24px; bottom: 0; width: calc(37% - 4px); display: flex; align-items: flex-end; justify-content: flex-end; gap: 24px; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.seat-props li, .seat-scenery li { position: relative; flex: 0 1 168px; min-width: 0; display: flex; align-items: flex-end; font-size: 13px; }
.seat-props .prop-img, .seat-scenery .prop-img { display: block; width: 100%; height: auto; max-height: 168px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 6px 5px rgba(0,0,0,.35)); }
/* 像素圖（legacy、hybrid）照原圖格數放大六倍，每件比例一致；寬度不夠時一起等比縮 */
.seat-room[data-mode="legacy"] li, .seat-room[data-mode="hybrid"] li { flex: 0 1 calc(var(--w, 28) * 6px); }
.seat-room .prop-img.legacy, .seat-room .prop-img.hybrid { max-height: none; image-rendering: pixelated; }
/* 靠牆站在桌子後面的東西（淑芬的印表機櫃）：螢幕左邊，下半截被桌子擋住 */
.seat-scenery { position: absolute; left: 24px; bottom: calc(100% - var(--edge)); display: flex; align-items: flex-end; margin: 0; padding: 0; list-style: none; pointer-events: none; }
/* 櫃子的下緣切在桌子後緣（--edge），看起來才是站在桌子後面；speedrun 再往上 3px，收在插圖桌緣那條深色邊線上（童童目測） */
.seat-room[data-mode="speedrun"] .seat-scenery { bottom: calc(100% - var(--edge) + 3px); }
.seat-scenery li { flex: none; width: 230px; }   /* 容器寬度跟著內容走，所以直接給寬度 */
.seat-room[data-mode="legacy"] .seat-scenery li, .seat-room[data-mode="hybrid"] .seat-scenery li { width: calc(var(--w, 36) * 6px); }
.seat-scenery .prop-img { max-height: 300px; }
/* 放在東西上的按鈕：貼在那件東西的頂上 */
.seat-room .on-thing { position: absolute; left: 50%; top: 0; z-index: 2; transform: translate(-50%, -60%); pointer-events: auto; padding: 10px 22px; font-size: 18px; font-weight: 700; white-space: nowrap; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.btn.seat-phone { display: inline-flex; align-items: center; gap: 6px; }
/* 在同事座位，公務手機跟暫停、回座位排成一組靠右 */
.desk.at-seat .surface .seat-phone { margin-left: auto; }
.desk.at-seat .surface .seat-phone + .coffee { margin-left: 0; }
/* 同事在旁邊講的話、手上帶著的記憶體：沒內容就不佔位置 */
.seat-say, .seat-hand { margin: 0; }
.seat-say { padding: 8px 14px; border-radius: 14px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); font-size: 15px; }
.seat-hand { font-size: 13px; color: #4b4436; }
.seat-say:empty, .seat-hand:empty { display: none; }
/* 自己座位的舊料箱：人在同事座位時收起來 */
.btn.parts-box { display: inline-flex; align-items: center; gap: 6px; }
.desk.at-seat .parts-box, .desk.at-home .parts-box { display: none; }   /* 舊料箱留在公司自己的座位上 */
.box-panel { position: absolute; left: 24px; bottom: 12px; z-index: 20; width: min(360px, calc(100% - 32px)); max-height: calc(100% - 24px); overflow: auto; padding: 12px 14px; border-radius: 12px; background: #f6f1e7; color: #2b2f36; box-shadow: 0 10px 30px rgba(0,0,0,.35); box-sizing: border-box; }
.box-head { display: flex; align-items: center; justify-content: space-between; }
.box-head h3 { margin: 0; font-size: 16px; }
.box-note { margin: 6px 0 10px; font-size: 13px; color: #6b6457; }
.box-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.box-list li { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid #cdbfa6; border-radius: 8px; background: #fff; }
.box-list li.in-hand { border-color: #2563eb; background: #eef4ff; }
/* 記憶體畫成真的樣子（desk.js 的 stickSvg）：SO-DIMM 短一截、缺口位置照世代，貼紙不寫外形，要看這裡 */
.box-stick { display: block; line-height: 0; }
.box-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.box-actions:empty { display: none; }
.box-label { font-family: var(--mono); font-size: 14px; }
/* 公務手機：只看 LIME 和信箱，浮在桌面右下 */
.phone-panel { position: absolute; right: 24px; bottom: 12px; z-index: 20; display: flex; flex-direction: column; width: min(440px, calc(100% - 32px)); height: calc(100% - 24px); overflow: hidden; border: 10px solid #1f2328; border-radius: 22px; background: #f6f1e7; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  --os-fg: #1f2328; --os-border: #c5ccd8; --os-muted: #4b5563; --os-bar: #e2d9c6; --chat-bg: #e6f19a; --chat-them: #ffffff; }   /* 手機在電腦外面，吃不到電腦的配色：LIME 用淺色那套 */
.phone-tabs { display: flex; gap: 6px; padding: 8px; background: #1f2328; }
.phone-tabs .btn:last-child { margin-left: auto; }
/* 公務手機的電話分頁（手機螢幕＝軟體樣子）：號碼一顆一顆、通話中最後幾句、語音選單的數字鍵、掛斷 */
.call-screen { display: grid; gap: 10px; align-content: start; padding: 12px; color: #1f2328; }
.call-screen h3 { margin: 0; font-size: 16px; }
.call-status { margin: 0; font-size: 13px; color: var(--muted); }
.call-log { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: #fff; font-size: 14px; line-height: 1.5; }
.call-log p { margin: 0; }
.call-keys { display: flex; flex-wrap: wrap; gap: 8px; }
/* 語音選單的撥號鍵盤：三欄十二鍵，數字大、英文字母小 */
.call-keys.dialpad { display: grid; grid-template-columns: repeat(3, 60px); gap: 10px 18px; justify-content: center; }
.call-typed { grid-column: 1 / -1; margin: 0; min-height: 28px; text-align: center; font-size: 22px; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.btn.call-key { width: 60px; height: 60px; border-radius: 50%; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.btn.call-key b { font-size: 22px; font-weight: 500; }
.btn.call-key small { min-height: 11px; font-size: 9px; letter-spacing: 1px; color: var(--muted); }
.btn.call-dial { display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
.btn.call-hang { justify-self: center; background: #dc2626; border-color: #dc2626; color: #fff; }
/* 接通了：桌上的公務手機亮起來，要自己拿起來接 */
.work-phone.ringing { animation: phone-ring .5s ease-in-out infinite alternate; }
.work-phone.ringing.inked { --ink-fill: #fde68a; }
@keyframes phone-ring { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.phone-body { flex: 1; min-height: 0; overflow: auto; }
/* 公務手機沒電：黑屏一句話 */
.phone-panel.dead .phone-body { background: #111; color: #9ca3af; display: grid; align-content: center; justify-items: center; gap: 6px; }
.phone-dead { margin: 0; font-size: 18px; color: #e5e7eb; }
.phone-dead-hint { margin: 0; font-size: 13px; }
.phone-body > .docs { height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); padding: 8px; box-sizing: border-box; }   /* 手機的信箱：信件一排在上、內容在下 */
.phone-body .doc-list { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--os-border); padding: 0 0 6px; }
/* 手機的 LIME 跟電腦一樣左右兩欄：左邊聯絡人、右邊對話 */
.phone-body > .docs.line { grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 8px; }
.phone-body .docs.line .doc-list { flex-direction: column; flex-wrap: nowrap; border-bottom: 0; border-right: 1px solid var(--os-border); padding: 0 6px 0 0; }
.phone-body .docs.line .doc-item { padding: 6px; word-break: keep-all; overflow-wrap: anywhere; }
/* 桌邊訪客講完等你回話：回話鈕排在下一行 */
.visitor:has(.visitor-replies) { flex-wrap: wrap; }
.visitor-replies { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* 老闆娘的手機（她座位、或她站在桌邊時）：手機螢幕＝軟體樣子，照 iPhone 的 Wi-Fi 設定畫。放右下，不擋桌面捷徑和左下的訪客 */
.wife-phone { position: absolute; right: 24px; bottom: 12px; z-index: 21; display: flex; flex-direction: column; width: min(340px, calc(100% - 32px)); height: calc(100% - 24px); max-height: 560px; overflow: hidden; border: 10px solid #d8c2b0; border-radius: 26px; background: #f2f2f7; color: #1c1c1e; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 15px; }
.wp-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: #d8c2b0; }
.wp-bar-btns { display: flex; gap: 6px; }
.btn.wife-phone-desk { display: inline-flex; align-items: center; gap: 6px; }   /* 她站在桌邊時先放在你桌上的手機 */
.wp-screen { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px; }
.wp-title { margin: 6px 0 12px; font-size: 24px; }
.wp-list { overflow: hidden; border-radius: 10px; background: #fff; }
.wp-row, .wp-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #e5e5ea; }
.wp-row:last-child, .wp-item:last-child { border-bottom: 0; }
.wp-item { padding: 12px 14px; }
.wp-join { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wp-status { font-size: 12px; color: #d70015; }
.wp-status.ok { color: #6d6d72; }
.wp-status:empty { display: none; }
.wp-info, .wp-back, .wp-link { border: 0; background: none; color: #007aff; font: inherit; cursor: pointer; }
.wp-link { display: block; width: 100%; padding: 12px 14px; text-align: left; }
.wp-info { padding: 0 14px; line-height: 0; }
.wp-info .icon { width: 22px; height: 22px; }
.wp-back { padding: 0; }
.wp-mac { font-family: var(--mono); color: #6d6d72; }
.wp-note { margin: 6px 14px; font-size: 12px; color: #6d6d72; }
.wp-switch { appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 14px; background: #e5e5ea; cursor: pointer; transition: background .15s; }
.wp-switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.wp-switch:checked { background: #34c759; }
.wp-switch:checked::before { transform: translateX(18px); }
.wp-msg { margin: 0; padding: 8px 14px; border-top: 1px solid #d1d1d6; background: #fff; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.wp-msg:empty { display: none; }
/* 窄螢幕：她站在桌邊時的對話框在左下，手機往上讓出位置，最下面那行訊息才不會被蓋住 */
@media (max-width: 900px) { .wife-phone.beside { bottom: 100px; height: calc(100% - 112px); } }
/* 美玲的 OutLuck（她座位、蓋在她的螢幕上）：信箱軟體的樣子，淺色 */
.outluck { position: absolute; left: 24px; right: 24px; top: 56px; bottom: 12px; z-index: 21; max-width: 860px; display: flex; flex-direction: column; gap: 8px; padding: 0 0 10px; overflow: hidden; border: 1px solid #b7c4d6; border-radius: 8px; background: #fff; color: #1f2328; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 13px; }
.ol-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #2f5d9b; color: #fff; }
.ol-quota, .ol-folders, .ol-tools, .ol-picker, .ol-msg { margin: 0 12px; }
.ol-quota { display: grid; gap: 4px; }
.ol-meter { position: relative; height: 10px; border-radius: 5px; background: #e5e9f0; overflow: hidden; }
.ol-fill { position: absolute; inset: 0 auto 0 0; background: #3b82f6; }
.ol-meter.warn .ol-fill { background: #f59e0b; }
.ol-meter.over .ol-fill { background: #dc2626; }
.ol-safe { position: absolute; top: 0; bottom: 0; width: 2px; background: #1f2328; opacity: .55; }   /* 安全線 80% */
.ol-folders, .ol-tools, .ol-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ol-picker:empty { display: none; }
.ol-picker { padding: 8px; border-radius: 6px; background: #fff7e0; }
.ol-archive-to { margin-left: auto; color: #4b5563; }
.ol-list { flex: 1; min-height: 0; overflow: auto; margin: 0 12px; border: 1px solid #e5e9f0; border-radius: 6px; }
.ol-table { width: 100%; border-collapse: collapse; }
.ol-table th, .ol-table td { padding: 6px 8px; border-bottom: 1px solid #eef1f5; text-align: left; vertical-align: middle; }
.ol-table th { position: sticky; top: 0; background: #f5f7fa; font-weight: 500; color: #4b5563; }
.ol-table .ol-num { text-align: right; white-space: nowrap; }
.ol-table .ol-date, .ol-table .ol-from { white-space: nowrap; }
.ol-check { width: 28px; }
.ol-sort { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ol-empty { color: #6b7280; text-align: center; }
.ol-msg { min-height: 1.4em; color: #374151; white-space: pre-line; }
/* 郵件管理頁（自己電腦，只能看） */
.mailadmin { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; color: var(--os-fg); font-size: 13px; }
.mailadmin-title { margin: 8px 0 0; font-size: 14px; }
/* 自己電腦上的無線基地台管理頁 */
.ap { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 10px 12px; box-sizing: border-box; color: var(--os-fg); font-size: 13px; }
.ap-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-body { flex: 1; min-height: 0; overflow: auto; }
.ap .mono { font-family: var(--mono); }
.ap-table { width: 100%; border-collapse: collapse; }
.ap-table th, .ap-table td { padding: 5px 6px; border-bottom: 1px solid var(--os-border); text-align: left; white-space: nowrap; }
.ap-table th { color: var(--os-muted); font-weight: 500; }
.ap-table tr.blocked td { color: var(--priority); }
.ap-table tr.blocked td:last-child { color: inherit; }
.ap-note { margin: 0 0 8px; color: var(--os-muted); }
.ap-list { margin: 0; padding: 0; list-style: none; }
.ap-list li { padding: 5px 0; border-bottom: 1px solid var(--os-border); }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--os-border); }
.ap-msg { margin: 0; min-height: 1.5em; color: var(--os-muted); }
@media (max-width: 700px) {
  .seat-room { padding: 10px 12px; }
  .seat-title, .seat-say, .seat-hand { max-width: 100%; }
  .seat-actions .btn { padding: 12px 20px; font-size: 17px; }
  /* 桌面那排放不下一列：AI 額度自己一列，公務手機、暫停、回座位排在下一列（回座位在最右，跟下班鈕同位置） */
  .desk.at-seat .surface .ai-quota { order: -2; margin-left: auto; }
  .desk.at-seat .surface::before { content: ''; order: -1; flex-basis: 100%; height: 0; }
  .seat-room .on-thing { padding: 8px 14px; font-size: 15px; }
  .phone-panel { right: 8px; left: 8px; width: auto; }
  .wife-phone { left: 8px; right: 8px; width: auto; }
  .outluck { left: 8px; right: 8px; top: 8px; }
  .ol-table .ol-from, .ol-table .ol-date { display: none; }   /* 手機寬度：寄件人、日期收起來，主旨和大小留著 */
  .ol-archive-to { margin-left: 0; flex-basis: 100%; }
  /* 基地台連線紀錄：一筆兩行，時間＋MAC 一行、結果一行，按鈕靠右 */
  .ap-table thead { display: none; }
  .ap-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--os-border); }
  .ap-table th, .ap-table td { padding: 1px 0; border-bottom: 0; }
  .ap-table td:nth-child(3) { grid-column: 1 / 3; }
  .ap-table td:nth-child(4) { grid-column: 3; grid-row: 1 / 3; }
  .box-panel { left: 8px; right: 8px; width: auto; }
}

/* ── 3D 工作台（bench-loader.js）：蓋住整張辦公桌；載入中畫面第一幀畫好才淡出 ── */
.bench-panel { position: fixed; inset: 12px; z-index: 60; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid #2b2f36; border-radius: 10px; background: #f6f1e7; color: #2b2f36; }
.bench-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; border: 2px solid #2b2f36; border-radius: 8px; background: #e9e1d2; touch-action: none; }
.bench-stage canvas { display: block; }
.bench-loading { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #e9e1d2; color: #6b6457; font-size: 15px; transition: opacity .2s ease-in; }
.bench-loading.done { opacity: 0; pointer-events: none; }
.bench-spinner { width: 28px; height: 28px; border: 3px solid #cdbfa6; border-top-color: #2563eb; border-radius: 50%; animation: bench-spin .8s linear infinite; }
@keyframes bench-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bench-spinner { animation: none; } }
.bench-bar { display: flex; align-items: center; gap: 10px; }
.bench-msg { flex: 1; min-height: 1.5em; margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-line; }

/* ── 會議模式：外接螢幕收起，筆電跟桌上一樣大、移到正中間；會議室鋪滿背景（被筆電擋到沒關係），
   彈幕疊在筆電上面、只飛在筆電上緣以上那一條（擋住背景沒關係，不要擋住彈幕） ── */
.desk.in-meeting .screen.monitor { display: none; }
.desk.in-meeting .screen.laptop { left: 32%; }
.desk.in-meeting .screens-bg { background: linear-gradient(180deg, #3a342d, #2a2622) !important; }
.meeting-room { position: absolute; inset: 0; overflow: hidden; }
.projector-title { margin: 0; font-size: inherit; }
.projector { position: absolute; left: 50%; top: 8%; transform: translateX(-50%); width: 56%; aspect-ratio: 16 / 9; background: #e9e4d6; color: #1f2328; display: grid; place-items: start center; padding-top: 3%; font-size: clamp(16px, 2vw, 26px); font-weight: 700; box-shadow: 0 0 60px rgba(255,240,200,.25); }
.people { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-evenly; align-items: flex-end; height: 26%; }
.people span { width: 11%; height: 80%; background: #15120f; border-radius: 40% 40% 8% 8% / 50% 50% 8% 8%; }
.people span:nth-child(2) { height: 95%; } .people span:nth-child(4) { height: 70%; }
.danmaku { position: absolute; left: 0; right: 0; top: 0; height: 30%; overflow: hidden; pointer-events: none; z-index: 2; }
/* 彈幕描黑邊（像影片網站的彈幕），飄過白色投影幕也看得清楚 */
.dm { --dm-edge: #1b1712; position: absolute; left: 100%; white-space: nowrap; font-size: clamp(15px, 1.6vw, 22px); font-weight: 600; color: #f4efe4;
  text-shadow: 2px 0 var(--dm-edge), -2px 0 var(--dm-edge), 0 2px var(--dm-edge), 0 -2px var(--dm-edge),
    1.5px 1.5px var(--dm-edge), -1.5px 1.5px var(--dm-edge), 1.5px -1.5px var(--dm-edge), -1.5px -1.5px var(--dm-edge);
  animation: fly var(--dm-fly, 9s) linear forwards; pointer-events: none; background: transparent; border: 0; font-family: inherit; }
.dm.key { color: #ffd166; font-weight: 700; pointer-events: auto; cursor: pointer; padding: 4px 10px; border: 1px dashed rgba(255,209,102,.6); border-radius: 6px; animation: fly var(--dm-fly, 9s) linear forwards, pop .7s ease-out; transform-origin: left center; }
@keyframes pop { 0% { scale: 1.12; } 100% { scale: 1; } }
.dm.key:hover { background: rgba(255,209,102,.15); }
.dm.held { animation-play-state: paused; background: rgba(255,209,102,.25); border-style: solid; }
.danmaku.frozen .dm { animation-play-state: paused; }
/* 彈幕裡的術語：按鈕預設會清掉 text-shadow，要接回彈幕的黑邊才看得清楚；彈幕本身不吃點擊，術語要點得到 */
.dm .term { text-shadow: inherit; pointer-events: auto; }
/* 會議結束、還在飛的彈幕飛完才收，這段時間不能再舉手 */
.meeting-room.ending .dm.key { pointer-events: none; }
@keyframes fly { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 100%)); } }
@media (prefers-reduced-motion: reduce) { .dm { animation-duration: 14s; } }
/* 舉手：全場停下來等你說——整頁壓暗、選項站在畫面正中間 */
.desk.raising::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; pointer-events: none; }
.raise-alt { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; margin-top: 18px; }
.raise-alt .raise-label { margin: 0 4px 0 0; letter-spacing: .1em; }
.raise .btn.ghost { background: transparent; color: #e9e4d6; border-color: rgba(233,228,214,.5); min-width: 0; font-size: 14px; padding: 8px 14px; }
.raise .btn.ghost:hover { background: rgba(255,255,255,.12); border-color: #e9e4d6; }
.raise { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(0,0,0,.45); z-index: 45; }
.raise[hidden] { display: none; }
.raise-q { margin: 0 0 6px; color: #ffd166; font-size: clamp(18px, 2vw, 28px); font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.raise-label { color: #ffe9a6; font-size: 14px; letter-spacing: .3em; margin-bottom: 6px; }
.meeting-room:has(.raise:not([hidden])) .projector-title { opacity: .15; }
.meeting-room:has(.raise:not([hidden])) .dm.held { opacity: 0; }
.raise .btn { font-size: clamp(15px, 1.4vw, 19px); padding: 12px 26px; background: #f6f1e7; color: #1f2328; border-color: #f6f1e7; min-width: 240px; }
.raise .btn:hover { background: #ffd166; border-color: #ffd166; }
.danmaku.frozen .dm.held { z-index: 3; }
.tbc { background: #1a1f2b; }

/* ── 茶几（下班回家）：背景是家裡客廳，外接螢幕收起來，筆電放大擺在茶几中間，桌上是下班買的東西 ── */
.desk.at-home { background: #2a1d14 url(assets/bg/coffee_table_night.webp) center bottom / cover no-repeat; }
.desk.at-home .screens-bg, .desk.at-home .surface { background: transparent !important; }
.desk.at-home .screen.monitor, .desk.at-home .wall-clock, .desk.at-home .device:not(.private), .desk.at-home .strip,
.desk.at-home .cables, .desk.at-home .papers, .desk.at-home .visitor { display: none; }
.desk.at-home .screen.laptop { left: 22%; width: 56%; height: 84%; }
.home-bar { display: flex; align-items: center; gap: 6px; margin-left: 10px; }
.home-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; min-height: 20px; border: 1px solid var(--os-border); border-radius: 10px; background: var(--os-win); color: var(--os-fg); font-size: 12px; }
.home-btn .icon { width: 13px; height: 13px; }
.home-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.home-btn.vpn-on { color: #15803d; border-color: #15803d; }
.home-btn:disabled { opacity: .75; }
.home-label { font-size: 12px; color: var(--os-muted); }
.home-files { position: absolute; left: 96px; top: 36px; display: grid; gap: 6px; }
.home-file { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #dc2626; border-radius: 6px; background: var(--os-win); font-size: 12px; }
.home-file .icon { width: 16px; height: 16px; color: #dc2626; }
.home-del { border: 0; background: transparent; color: #dc2626; font-size: 12px; text-decoration: underline; }
/* 茶几桌面：左邊是下班買的食物、右邊是休閒道具；最右邊留給暫停、AI 額度、洗澡睡覺那排鈕（約 400px） */
.home-table { position: absolute; left: 12%; right: 420px; bottom: 8px; display: flex; align-items: flex-end; gap: 16px; pointer-events: none; }
/* 下班休閒：點了開始玩、再點停 */
.home-fun { display: flex; align-items: flex-end; gap: 8px; margin-left: auto; pointer-events: auto; }
.fun-btn { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: #f3e9dc; font-size: 12px; cursor: pointer; }
/* 照原比例縮：疊在上面的螢幕光、翻頁才對得到圖上的位置 */
.fun-btn .prop-img { display: block; width: 92px; height: auto; filter: drop-shadow(0 6px 5px rgba(0,0,0,.5)); }
.fun-btn .prop-ph { display: grid; place-items: center; width: 92px; height: 70px; color: #e9dcc6; }
.fun-label { padding: 0 8px; border-radius: 8px; background: rgba(20,14,10,.74); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fun-btn:hover .fun-stage, .fun-btn:focus-visible .fun-stage { translate: 0 -3px; }
.home-food { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap-reverse; align-items: flex-end; gap: 6px; }
.food-pile { position: relative; display: inline-flex; align-items: flex-end; }
.food-pile .prop-img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 6px 5px rgba(0,0,0,.5)); }
.food-pile .prop-img + .prop-img { margin-left: -46px; }
.food-n { position: absolute; right: -4px; top: 0; padding: 0 6px; border-radius: 9px; background: #1f2328; color: #fff; font-size: 12px; }
.home-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(8,6,4,.62); }
.home-box { display: grid; justify-items: center; gap: 12px; min-width: 260px; padding: 22px 26px; border-radius: 18px; background: #f6f1e7; color: #1f2328; }
.home-row { display: flex; gap: 10px; }
.home-dnd { display: flex; align-items: center; gap: 6px; }
/* 來電：私人手機旁邊的小面板，不擋畫面（接不接是玩家的決策） */
.home-ring { position: absolute; left: 1%; bottom: 150px; z-index: 30; display: grid; justify-items: center; gap: 6px; padding: 12px 16px; border-radius: 16px; background: #14110e; color: #f3e9dc; box-shadow: 0 10px 28px rgba(0,0,0,.5); animation: ring-in .25s cubic-bezier(.2,0,0,1); }
.home-ring p { margin: 0; }
.home-ring .ringing .icon { width: 32px; height: 32px; color: #4ade80; animation: ring .45s ease-in-out infinite alternate; }
@keyframes ring { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes ring-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 休閒播放中（.playing）：桌上的平板、遊戲機自己的螢幕在播，漫畫在翻頁。下班喘口氣，動作慢、sine 進出、無限循環；
   三層：主要（每種不同）、次要（道具浮動）、背景（螢幕的光打在桌上，呼吸） */
.fun-stage { position: relative; display: block; }
.fun-glow, .fun-screen, .fun-page { position: absolute; pointer-events: none; opacity: 0; }
.fun-glow { inset: 30% -20% -10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(150,190,255,.45), transparent); }
.fun-screen { border-radius: 3px; mix-blend-mode: screen; }
.fun-tablet .fun-screen { left: 12%; top: 8%; width: 76%; height: 62%; background: linear-gradient(120deg, #3b82f6, #f59e0b, #ec4899, #3b82f6); background-size: 300% 100%; }
.fun-console .fun-screen { left: 31%; top: 14%; width: 38%; height: 58%; background: #fff7c2; }
.fun-page { left: 50%; top: 4%; width: 44%; height: 42%; background: linear-gradient(90deg, #e9dcc6, #fbf3e4); border-radius: 0 3px 3px 0; transform-origin: left center; }
.fun-btn.playing .fun-label { background: rgba(37,99,235,.85); }
.fun-btn.playing .fun-glow { animation: fun-breathe 4s ease-in-out infinite alternate; }
.fun-btn.playing .fun-stage { animation: fun-float 5s ease-in-out infinite alternate; }
/* 追劇：螢幕的光慢慢換場景 */
.fun-tablet.playing .fun-screen { opacity: .3; animation: fun-scene 9s ease-in-out infinite alternate; }
/* 打電動：機子左右晃、螢幕一閃一閃 */
.fun-console.playing .fun-stage { animation: fun-tilt 1.8s ease-in-out infinite alternate; }
.fun-console.playing .fun-screen { animation: fun-flash .9s ease-in-out infinite; }
/* 看漫畫：右頁一頁一頁翻過去；漫畫沒有螢幕，桌上的光換成檯燈的暖光 */
.fun-manga .fun-glow { background: radial-gradient(closest-side, rgba(255,190,110,.4), transparent); }
.fun-manga.playing .fun-page { animation: fun-flip 3.2s cubic-bezier(.4,0,.2,1) infinite; }
@keyframes fun-breathe { from { opacity: .5; transform: scale(.95); } to { opacity: 1; transform: scale(1.05); } }
@keyframes fun-float { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes fun-scene { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes fun-tilt { from { transform: rotate(-3deg) translateY(0); } to { transform: rotate(3deg) translateY(-3px); } }
@keyframes fun-flash { 0%, 100% { opacity: 0; } 50% { opacity: .35; } }
@keyframes fun-flip { 0%, 15% { transform: perspective(500px) rotateY(0); opacity: 1; } 70% { transform: perspective(500px) rotateY(-170deg); opacity: .9; } 85%, 100% { transform: perspective(500px) rotateY(-180deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .home-ring, .home-ring .ringing .icon, .fun-btn.playing .fun-glow, .fun-btn.playing .fun-stage, .fun-btn.playing .fun-screen, .fun-btn.playing .fun-page { animation: none; }
  .fun-btn.playing .fun-glow { opacity: .7; }   /* 不動，但看得出在播 */
}

/* 下班選單：順路買是店家的背景圖、外送是 APP 樣的清單；份數不限 */
.home-menu { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 12px; padding: 18px 20px; overflow: auto; background: #1d1712; color: #f3e9dc; }
.hm-head h2 { margin: 0; font-size: 22px; }
.hm-head p { margin: 2px 0 0; color: #cdbba3; }
.hm-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.hm-laptop { display: flex; align-items: center; gap: 8px; }
.hm-fun { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hm-chip { min-height: 36px; padding: 4px 14px; border: 1px solid rgba(243,233,220,.4); border-radius: 18px; background: transparent; color: inherit; }
.hm-chip.on { background: #f3e9dc; color: #1d1712; }
.hm-laptop input { width: 20px; height: 20px; }
.hm-tabs { display: flex; gap: 8px; }
.hm-tab { min-height: 40px; padding: 6px 16px; border: 1px solid rgba(243,233,220,.4); border-radius: 20px; background: transparent; color: inherit; }
.hm-tab.on { background: #f3e9dc; color: #1d1712; }
.hm-panel { position: relative; min-height: 280px; display: grid; place-items: center; }
.hm-stage { position: relative; border-radius: 12px; background: #3a2a22 center / cover no-repeat; image-rendering: pixelated; }
.menu-lateNight .hm-stage { background-color: #22303a; }
/* 招牌字：程式寫在留白的招牌上（招牌在畫面 32% 高的地方） */
.hm-sign { position: absolute; top: 32.4%; transform: translate(-50%, -50%); font-size: 3.4em; font-weight: 800; letter-spacing: .12em; color: #3b2414; text-shadow: 0 1px 0 rgba(255,255,255,.35); white-space: nowrap; }
.hm-spot { position: absolute; transform: translate(-50%, -100%); display: grid; justify-items: center; gap: 2px; }
.hm-spot .prop-img { width: 9em; height: 9em; filter: drop-shadow(0 .5em .4em rgba(0,0,0,.55)); }
.hm-spot .hm-name { padding: 0 8px; border-radius: 8px; background: rgba(20,14,10,.78); font-size: 13px; }
.hm-spot .hm-count { padding: 2px 4px; border-radius: 18px; background: rgba(20,14,10,.78); gap: 4px; }
.hm-spot .hm-btn { min-width: 32px; min-height: 32px; font-size: 16px; }
/* 窄螢幕五間店擠在一起：份數放上面一列、－＋並排在下面，每間的寬度從約 96px 收到約 54px 才不會互相蓋到 */
@media (max-width: 480px) {
  .hm-spot .hm-count { display: grid; grid-template-columns: 24px 24px; gap: 2px; justify-items: center; }
  .hm-spot .hm-count b { grid-column: 1 / -1; grid-row: 1; font-size: 13px; }   /* 店面整片照 em 縮，份數要固定字級才看得到 */
  .hm-spot .hm-btn { min-width: 24px; min-height: 24px; width: 24px; height: 24px; padding: 0; font-size: 14px; }
}
.prop-img { width: 96px; height: 96px; object-fit: contain; }
.prop-ph { display: grid; place-items: center; color: #d9c2a0; }
.prop-ph .icon { width: 40px; height: 40px; }
.hm-name { text-align: center; }
.hm-count { display: inline-flex; align-items: center; gap: 8px; }
.hm-count b { min-width: 1.5em; text-align: center; font-variant-numeric: tabular-nums; }
.hm-btn { min-width: 40px; min-height: 40px; border: 1px solid currentColor; border-radius: 20px; background: transparent; color: inherit; font-size: 18px; }
.hm-app { width: 100%; max-width: 560px; margin: 0 auto; display: grid; gap: 4px; align-content: start; padding: 12px; border-radius: 18px; background: #fffaf2; color: #1f2328; }
.hm-app-title { margin: 0 0 6px; font-weight: 700; }
.hm-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid #eadfcd; }
.hm-row .prop-img { width: 64px; height: 64px; }
.hm-row .hm-name { text-align: left; }
.hm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hm-cart { flex: 1; margin: 0; }
.hm-err { margin: 0; color: #ff9b8f; }
.hm-go { min-width: 120px; min-height: 44px; }

/* ── 手機 ── */
@media (max-width: 720px) {
  .side-foot { gap: 4px; }
  /* 手機上視窗很矮，原因選單收成一行、左右滑，才不會蓋住裝置畫面 */
  .spot-reasons { padding: 4px; }
  .spot-reasons-title { display: none; }
  .spot-reasons .review-menu { flex-wrap: nowrap; overflow-x: auto; }
  .spot-reasons .review-menu .btn { flex: 0 0 auto; white-space: nowrap; }
  .side-foot .save-open, .foot-link { min-height: 44px; padding: 4px; }
  /* 雙螢幕上下排：外接螢幕在上、筆電在下，公務手機和平板放筆電右邊；桌面那排放不下就換行，不撐寬頁面 */
  .desk { grid-template-rows: 1fr auto; }
  .screen.monitor { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 56%; }
  .screen.laptop { left: 0; right: 96px; width: auto; height: calc(44% - 12px); }
  .desk.in-meeting .screen.laptop { left: 0; }   /* 開會時筆電維持原位原大小 */
  .desk .surface .device[data-device] { position: absolute; }   /* 定位在桌面那排上方；不設 z-index，測試模式的高亮照常 */
  .desk .surface .device.work-phone { position: static; }   /* 公務手機留在桌面那排，跟私人手機放一起 */
  .device.tablet { right: 24px; bottom: calc(100% + 8px); }
  .device.phone { right: 36px; bottom: calc(100% + 86px); }
  .surface { flex-wrap: wrap; align-content: center; gap: 8px; min-height: 120px; padding: 8px 10px; }
  .hint { left: 10px; right: 108px; max-width: none; min-height: 84px; padding-right: 76px; box-sizing: border-box; }   /* 不蓋到筆電右邊的手機和平板 */
  .hint-fold { display: block; position: absolute; top: 0; right: 0; width: 76px; height: 40px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
  .hint-pass { position: absolute; top: 40px; right: 0; width: 76px; height: 40px; margin: 0; }
  .hint.folded .hint-pass { display: none; }
  .hint.folded { height: 40px; min-height: 0; margin-bottom: -24px; padding-block: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-sizing: border-box; }
  .os-theme, .os-sound, .shortcut, .task-win, .win-btns button, .coffee, .leave { min-height: 44px; min-width: 44px; }
  .win { border-radius: 0; min-width: 0; }   /* 位置大小由 windows.js 對齊到所在的螢幕 */
  .win-resize { display: none; }
  .order-grip { width: 36px; height: 40px; }   /* 手指拖得到 */
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; height: auto; min-height: 100%; }   /* 列跟著卡片長高，放不下就整個看板捲 */
  .taskbar { height: 44px; }   /* 跟分頁一樣高，視窗才不會被分頁蓋住 */
  .devtools { bottom: 44px; }
  .shortcuts { bottom: 50px; }
  .os-day { white-space: nowrap; }
  .desk.down .screen.monitor .os-top .os-day { font-size: 0; }   /* 頂欄放不下兩段，502 時只留這句 */
  .desk.down .screen.monitor .os-top .os-day::after { content: '⚠ 內網 502'; font-size: 13px; }
  .notif { max-width: calc(100% - 24px); }
  .papers { gap: 4px; }
  .paper { width: 44px; height: 44px; }   /* 兩張便條要跟暫停鈕排在同一排，排不下螢幕會被擠矮 */
  .coffee { padding: 10px; }
  .paper .icon { width: 24px; height: 24px; }
  .paper-label { font-size: 11px; }
  .notif span { max-width: 100%; }
  .reply-form .quiz-intro { display: none; }   /* 視窗矮，選項和送出優先 */
  .reply-form .quiz-foot { position: sticky; bottom: 0; padding-top: 6px; background: var(--os-win); }
  .card-meta { grid-template-columns: auto 1fr; }
  .device { width: 60px; height: 84px; } .device.tablet { width: 84px; height: 70px; }
  .note { width: 60px; height: 60px; font-size: 20px; }
}

/* ── AI 同事（hybrid 之後）── */
.ai-quota { border-radius: 20px; padding: 8px 14px; background: #1f2a36; color: #9fd3ff; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.ai-quota.empty { color: #ff9b8f; }
.op-cell { display: inline-flex; }
.model-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 8px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--os-bar); }
.op-cell > .op:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.op-ai { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 5px 8px; font-family: var(--mono); font-size: 12px; color: #2563eb; }
.op-ai:disabled { opacity: .5; }
.terminal-text .t-ai { color: #f2cc60; font-weight: 700; }
.terminal-text .ai-wait { display: inline; }
.terminal-text .tbtn { font: inherit; font-size: 12px; margin: 0 4px 0 0; padding: 0 8px; border: 1px solid #8b949e; background: transparent; color: #e6edf3; border-radius: 3px; cursor: pointer; }
.terminal-text .tbtn:hover { background: #30363d; }
.terminal-text .t-bar { position: sticky; top: 0; display: flex; align-items: center; gap: 12px; padding: 2px 0 6px; background: #0d1117; }
.terminal-text .t-mode { margin-left: auto; color: #a371f7; font-size: 12px; }   /* accept edits 紫、auto 黃，跟本尊一樣 */
.terminal-text .t-mode.auto { color: #e3b341; }
/* 問 Claire（能問問題的關卡）：回答不加粗（Novel、Pedia 一長串）；面板在終端機最底下，按鈕可以換行 */
.terminal-text .t-claire { color: #f2cc60; }
.terminal-text .claire-ask { display: block; white-space: normal; margin-top: 8px; padding-top: 6px; border-top: 1px dashed #30363d; }
.terminal-text .claire-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin: 4px 0; }
.terminal-text .claire-label { color: #8b949e; margin-right: 4px; }
.terminal-text .claire-row .tbtn { padding: 2px 8px; text-align: left; }
.terminal-text .tbtn.on { background: #1f6feb; border-color: #1f6feb; }
.terminal-text .tbtn:disabled { opacity: .45; cursor: not-allowed; }
.body-text .ai-claim { display: block; color: #c62828; font-weight: 700; font-size: 1.15em; margin-top: 6px; }
.ai-banner { background: #e8f1ff; color: #1d3f7a; border-left: 4px solid #2563eb; padding: 8px 12px; border-radius: 4px; font-weight: 600; }
.fn-claim { margin: 4px 0; }
.fn-code.claim { color: #c62828; }
.fn-code.note { color: #2e7d32; }
.claim-ops { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px 16px; }
.ai-banner.muted-banner { background: #f2f4f7; color: #4b5563; border-left-color: #9ca3af; font-weight: 500; }
/* 退回＝請 AI 改：勾要改的題目，展開那題的補充說明 */
.revise-spot { display: grid; gap: 4px; }
.revise-pick { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.revise-say { display: grid; gap: 2px; padding: 4px 0 0 24px; }
.revise-say[hidden] { display: none; }
/* AI 筆記：它用自己的口吻記下的話，一條一列，可以刪 */
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.note-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--os-border); border-radius: 6px; background: var(--os-win); }

/* ── 第二天改寫：跑一趟、終端機小遊戲、資料登打 ── */
.trip-screen { position: fixed; inset: 0; z-index: 9999; background: #000; color: #e5e7eb; display: grid; place-items: center; font-size: 22px; letter-spacing: 1px; transition: opacity .5s; }
.trip-screen.out { opacity: 0; }
/* Novel 多寫的廢話：答案卡小遊戲上面一段本文，每行右邊一顆 ×（一行一行刪） */
.ai-filler { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--os-bar); }
.ai-filler h4 { margin: 0 0 6px; font-size: 13px; }
.ai-filler p { margin: 0; }
.filler-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.filler-lines li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; }
.filler-lines li > span { flex: 1; }
.filler-del { flex: none; width: 22px; height: 22px; padding: 0; border: 1px solid var(--os-border); border-radius: 4px; background: transparent; color: var(--os-fg); font-size: 14px; line-height: 1; cursor: pointer; }
.filler-del:hover { background: var(--os-win-bar); }
.term-game { background: #0d1117; color: #e6edf3; padding: 10px 12px; border-radius: 6px; min-height: 160px; max-height: 260px; overflow: auto; }
.term-cmds { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.term-cmds .tbtn { font-family: var(--mono); font-size: 12px; padding: 4px 8px; border: 1px solid #8b949e; background: #161b22; color: #e6edf3; border-radius: 4px; cursor: pointer; }
.photo-tray { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.photo { width: 84px; height: 72px; border: 1px solid #c9ccd1; border-radius: 4px; background: linear-gradient(#f4efe6, #e6dcc9); display: grid; justify-items: center; align-content: center; gap: 2px; cursor: grab; user-select: none; font-size: 10px; }
.photo.held { outline: 3px solid #2563eb; }
.photo.used { opacity: .35; }
.photo-ico { width: 26px; height: 26px; color: #4b5563; }
.photo-tag { background: #fff; border: 1px solid #9ca3af; padding: 0 3px; font-family: var(--mono); font-size: 9px; }
.photo-name { color: #6b7280; }
.entry-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.entry-table th, .entry-table td { border: 1px solid var(--os-border, #d1d5db); padding: 3px 5px; }
.entry-input { width: 100%; box-sizing: border-box; font: inherit; }
.photo-drop { color: #9ca3af; text-align: center; cursor: pointer; min-width: 96px; }
.photo-drop.filled { color: #111827; font-family: var(--mono); background: #eef6ee; }

/* ── 選一種玩法：跟識別證頁同一套（桌面輪播、白字標題、紙色卡片）；手機單欄、PC 兩欄 ── */
.mode-screen { position: relative; min-height: 100vh; display: grid; justify-items: center; align-content: center; gap: 22px; padding: 24px 16px 48px; box-sizing: border-box; }
.mode-screen .bg-carousel { position: fixed; }
.mode-head, .mode-cols { position: relative; z-index: 1; width: min(880px, 100%); }
.mode-head { display: grid; gap: 8px; }
.btn.mode-back { justify-self: start; padding: 5px 12px; font-size: 13px; background: var(--paper); color: var(--ink); border-radius: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
/* 簡易版識別證：跟首頁同一張紙色卡片；四顆鈕是員工手冊的索引標籤，從識別證右邊探出來 */
.mode-pass { display: flex; justify-content: center; align-items: center; }
.mode-badge { position: relative; z-index: 1; flex: 0 1 380px; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--paper); color: var(--ink); border-radius: 14px; box-shadow: 0 20px 40px rgba(0,0,0,.45); }
.mode-badge canvas { flex: none; width: 72px; height: 84px; image-rendering: pixelated; border: 1px solid #c9c2b5; border-radius: 6px; background: #cfd6e0; }
.mode-badge-who { min-width: 0; }
.mode-badge h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: .1em; line-height: 1.2; }
.mode-badge p { margin: 6px 0 0; font-size: 14px; color: #3d434b; }
.mode-tabs { display: grid; gap: 4px; margin-left: -8px; }
.mode-tabs .btn.index-tab { display: block; width: 100%; min-height: 34px; padding: 6px 14px 6px 20px; border: 0; border-radius: 0 10px 10px 0; color: #1f2328; font-size: 14px; font-weight: 600; text-align: left; white-space: nowrap; box-shadow: 0 3px 8px rgba(0,0,0,.35); transition: transform .12s ease-out; }
.mode-tabs .btn.index-tab:nth-child(1) { background: #f4ec6b; }
.mode-tabs .btn.index-tab:nth-child(2) { background: #ecebdc; color: #5b6069; opacity: 1; cursor: default; }   /* 還沒開的那張 */
.mode-tabs .btn.index-tab:nth-child(3) { background: #7cc6f2; }
.mode-tabs .btn.index-tab:nth-child(4) { background: #f7a8c9; }
.mode-tabs .btn.index-tab:not(:disabled):hover { transform: translateX(4px); }
.index-tab small { margin-left: 6px; font-size: 11px; font-weight: 400; }
@media (max-width: 480px) {
  .mode-badge { gap: 10px; padding: 12px; }
  .mode-badge canvas { width: 54px; height: 63px; }
  .mode-badge p { font-size: 13px; }
  .mode-tabs .btn.index-tab { padding: 6px 8px 6px 16px; font-size: 13px; }
  .index-tab small { display: block; margin-left: 0; }
}
.mode-cols { display: grid; gap: 22px; }
.mode-col { display: grid; gap: 12px; align-content: start; }
.mode-group { justify-self: start; margin: 0; padding: 4px 8px 4px 14px; border-radius: 14px; background: rgba(31, 35, 40, .74); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .3em; }
.mode-card { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 18px 20px; display: grid; gap: 10px; box-shadow: 0 20px 40px rgba(0,0,0,.45); }
.mode-card h4 { margin: 0; font-size: 22px; }
.mode-card h4.mono { font-family: var(--mono); letter-spacing: .04em; }
.mode-desc { margin: 0; line-height: 1.7; color: #3d434b; }
.mode-days { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #c9c2b5; border-radius: 8px; overflow: hidden; }
.mode-days li { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; border-top: 1px solid #e6dfd2; font-size: 14px; }
.mode-days li:first-child { border-top: 0; }
.mode-days .mono { font-family: var(--mono); }
.mode-days .mode-state { margin-left: auto; font-size: 12px; color: var(--muted); }
.mode-days li.done { color: var(--muted); }
.mode-days .mode-replay { padding: 5px 12px; font-size: 12px; }
.mode-days .mode-done { padding: 2px 8px; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }   /* 按了看那天的結算卡 */
.mode-days li.next { background: color-mix(in srgb, var(--accent) 9%, #fff); }
.mode-days li.next .mode-state { color: var(--accent); font-weight: 600; }
.mode-progress { margin: 0; font-size: 13px; color: var(--muted); }
.mode-actions { display: flex; gap: 8px; }
.mode-actions .btn { flex: 1 1 auto; padding: 11px 14px; font-size: 16px; white-space: nowrap; }
.mode-actions .btn.primary { flex-grow: 2; font-weight: 700; }
.mode-actions .btn:disabled { opacity: 1; color: var(--muted); background: #ece6da; border-color: #d8d0c1; }
.btn.mode-clear { justify-self: end; padding: 0; border: 0; background: none; font-size: 12px; color: var(--muted); text-decoration: underline; }
@media (min-width: 900px) { .mode-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ── 新人手冊（術語辭典）：術語畫虛線底線，點了浮出紙色小卡（掛在最外層，不吃電腦的深淺色）；手冊在視窗裡跟著電腦的顏色 ── */
.term { font: inherit; color: inherit; background: none; border: 0; border-bottom: 1.5px dotted currentColor; padding: 0; margin: 0; line-height: inherit; cursor: help; border-radius: 0; }
.term:hover, .term.open { background: rgba(37, 99, 235, .14); }
.term-pop { position: fixed; z-index: 1000; max-width: min(320px, calc(100vw - 16px)); background: var(--paper); color: var(--ink); border: 1px solid #d8cfbd; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.28); padding: 10px 12px; font-family: var(--font); font-size: 14px; line-height: 1.6; white-space: normal; }
.term-pop-title { margin: 0 0 4px; font-weight: 700; }
.term-pop-text { margin: 0; }
.term-pop-more { margin-top: 6px; background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; }
.handbook { line-height: 1.6; }
.hb-intro { margin: 0 0 8px; font-size: 13px; color: var(--os-muted, var(--muted)); }
/* 章節頁籤固定在捲動範圍最上面，捲到哪都能跳章節；底色跟著所在的地方（電腦視窗／紙），內容才不會從後面透出來 */
.hb-nav { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; background: var(--os-win, var(--paper)); border-bottom: 1px solid var(--os-border, #d8cfbd); }
.hb-jump { border: 1px solid var(--os-border, #d8cfbd); background: transparent; color: inherit; border-radius: 999px; padding: 7px 16px; font-size: 14px; }
.hb-group { scroll-margin-top: 64px; }   /* 跳過去時章節標題不被固定的頁籤擋住 */
.hb-group h3 { margin: 16px 0 6px; padding-bottom: 4px; font-size: 15px; border-bottom: 1px solid var(--os-border, #d8cfbd); }
.hb-list { margin: 0; display: grid; gap: 10px; }
.hb-item { padding: 4px 6px; border-radius: 6px; }
.hb-item dt { font-weight: 700; }
.hb-item dd { margin: 2px 0 0; }
.hb-more summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.hb-more p { margin: 4px 0 0; font-size: 13px; color: var(--os-muted, var(--muted)); white-space: pre-line; }
.hb-item.hb-focus { background: rgba(37, 99, 235, .12); }
.hb-overlay { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.45); }
.hb-panel { width: min(720px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.hb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #d8cfbd; }
.hb-head h2 { margin: 0; font-size: 18px; }
/* 正式上班的抽劇本畫面（office-draw.js）：抽到的那張在上、三顆鈕（上班一整列，重抽、退出並排）、玩過的關在下 */
.hb-panel.office-draw { width: min(520px, 100%); overflow-y: auto; }
.draw-count { font-size: 14px; color: var(--muted); white-space: nowrap; }
.draw-card { padding: 16px; }
.draw-label { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.draw-name { margin: 0 0 8px; font-size: 22px; }
.draw-brief { margin: 0 0 10px; line-height: 1.7; }
.btn.draw-last { padding: 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.draw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 16px; }
.draw-actions .draw-go { grid-column: 1 / -1; }
.draw-played { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; border-top: 1px dashed #d8cfbd; }
.draw-played:empty { display: none; }
.draw-played .draw-label { flex: 1 0 100%; }
.draw-played .btn { padding: 6px 14px; }   /* 手繪框的線吃掉約 3px，小字要多留一點才不會貼線 */
.draw-played .btn.active { border-color: var(--accent, #2563eb); background: #eef4ff; }
/* 工作日誌：五個分頁（CLAIRE.md、成就、三個時代），一列一個成就或一關 */
.journal-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; border-bottom: 1px solid #d8cfbd; }
.journal-tab { padding: 8px 12px; border: 1px solid #d8cfbd; border-bottom: 0; border-radius: 6px 6px 0 0; background: #ece6da; color: var(--ink); font-size: 14px; cursor: pointer; }
.journal-tab[aria-selected="true"] { background: var(--paper); font-weight: 700; margin-bottom: -1px; }
.journal-body { overflow: auto; padding: 12px 16px 16px; }
.journal-page h3 { margin: 0; font-size: 16px; }
.journal-notes { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }
.journal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #d8cfbd; }
.journal-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.journal-where { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.journal-row.unplayed b { font-size: 20px; color: var(--muted); }
.hb-panel .handbook { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 20px; }
.win-handbook .win-body { padding-top: 0; }
.hb-panel .handbook > :first-child, .win-handbook .handbook > :first-child { margin-top: 12px; }   /* 上緣留白放在內容上，固定的章節頁籤才貼得到頂 */
.hb-panel .changelog { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 20px; }
.cl-command { margin: 0 0 12px; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.cl-day { position: relative; padding-left: 20px; }
.cl-day::before { content: ''; position: absolute; left: 4px; top: 4px; bottom: -14px; width: 2px; background: #d8cfbd; }   /* commit 線，接到下一天 */
.cl-day:last-child::before { bottom: 12px; }
.cl-day + .cl-day { margin-top: 14px; }
.cl-day h3 { margin: 0 0 4px; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--muted); }
.cl-row { position: relative; display: flex; gap: 10px; margin: 0; padding: 3px 0; font-size: 14px; line-height: 1.5; }
.cl-row::before { content: ''; position: absolute; left: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--paper); }   /* 一個 commit 一個點 */
.cl-hash { flex: none; color: var(--accent); font-family: var(--mono); font-size: 13px; line-height: 21px; }
/* CSIE 課程頁（csie.html）：上面一條標頭，下面是課程目錄或整頁的小教室 */
.csie-body { height: auto; background: var(--paper); }
.csie-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--paper); border-bottom: 1px solid #d8cfbd; }
.csie-head h1 { flex: 1; margin: 0; font-size: 17px; }
.csie-logo { font-weight: 800; font-size: 18px; color: inherit; text-decoration: none; }
.csie-play { text-decoration: none; }
.csie-main { max-width: 1100px; margin: 0 auto; padding: 18px 20px 48px; }
.csie-intro { margin: 0 0 16px; color: var(--muted); }
.csie-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.csie-course { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border: 1px solid #d8cfbd; border-radius: 10px; background: #fffaf0; color: inherit; text-decoration: none; }
.csie-course strong { font-size: 17px; } .csie-course span { line-height: 1.6; } .csie-course small { color: var(--accent); font-weight: 700; }
a.csie-course:hover { border-color: var(--accent); }
.csie-course.soon { opacity: .55; } .csie-course.soon small { color: var(--muted); }
.csie-back { color: var(--accent); text-decoration: none; font-weight: 700; }
.csie-course-title { margin: 6px 0 12px; font-size: 22px; }
/* 資料結構小教室（classroom-view.js）：左目錄右講義，目錄跟著頁面固定在旁邊；手機目錄改成上面一排橫捲 */
.cr-main { display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.cr-nav { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); overflow-y: auto; padding: 10px 8px 16px 0; border-right: 1px solid #d8cfbd; display: flex; flex-direction: column; gap: 4px; }
.cr-group { margin: 10px 4px 2px; font-size: 12px; letter-spacing: .15em; color: var(--muted); }
.cr-item { display: grid; text-align: left; border: 0; background: transparent; color: inherit; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.cr-item span { font-weight: 700; } .cr-item small { font-size: 12px; color: var(--muted); }
.cr-item.on { background: var(--accent); color: #fff; } .cr-item.on small { color: #e8eefc; }
.cr-item.soon { opacity: .55; }
.cr-body { padding: 4px 0 26px 22px; }
.cr-title { margin: 0 0 6px; font-size: 22px; }
.cr-hook { font-size: 18px; font-weight: 700; }   /* 生活比喻是一句話的 Hook */
.cr-soon { color: var(--muted); }
.cr-sec { margin-top: 18px; } .cr-sec h4 { margin: 0 0 8px; font-size: 15px; letter-spacing: .08em; color: var(--accent); }
.cr-sec p, .cr-sec li { line-height: 1.7; } .cr-sec ol, .cr-sec ul { margin: 0; padding-left: 1.4em; }
.cr-frames { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.cr-frame { margin: 0; display: grid; justify-items: center; gap: 4px; flex: none; }
.cr-frame figcaption { font-size: 13px; }
.cr-num { font-family: var(--mono); font-weight: 700; fill: #1f2328; }
.cr-sec .stamp { margin: 4px 0 6px 6px; font-size: 26px; padding: 2px 12px 4px; }
.cr-stamp-line { margin: 0; color: var(--muted); }
.cr-sandbox { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.cr-side { display: grid; gap: 10px; } .cr-ops { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-note { margin: 0; font-size: 14px; }
.cr-hanoi { margin-top: 22px; padding-top: 16px; border-top: 1px dashed #d8cfbd; display: grid; gap: 10px; justify-items: start; }
.cr-sub { margin: 0; font-weight: 700; }
.cr-hanoi-svg { max-width: 100%; height: auto; cursor: pointer; }
.cr-big-o { border-collapse: collapse; } .cr-big-o td { padding: 4px 18px 4px 0; border-bottom: 1px solid #e3ddd0; }
/* 附錄 Big-O：總表每頁一段（頁名可點、翻過去），「怎麼算」每個例子一塊 */
.cr-overview th { text-align: left; padding: 14px 0 4px; } .cr-overview tr:first-child th { padding-top: 0; }
.cr-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; } .cr-link:hover { text-decoration: underline; }
.cr-howto { display: grid; gap: 6px; margin-bottom: 14px; } .cr-howto p { margin: 0; }
.cr-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.cr-traps { display: grid; gap: 10px; }   /* 常見誤解：誤解一行、正解一行 */
.cr-trap { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #d9d2c4; border-radius: 8px; background: rgba(255, 255, 255, .55); }
.cr-sec p.cr-trap-line, .se-page p.cr-trap-line { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; margin: 0; }
.cr-trap-icon { width: 20px; height: 20px; margin-top: 3px; }
.cr-trap-line.wrong .cr-trap-icon { color: #c0392b; }
.cr-trap-line.right .cr-trap-icon { color: #2e7d4f; }
.cr-trap-line.wrong { color: var(--muted); }   /* 粗體會被當成重點，所以粗的是正解 */
.cr-trap-line.right { font-weight: 700; }
.cr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cr-tabs, .cr-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cr-tab { border: 1px solid #d8cfbd; background: transparent; color: inherit; border-radius: 6px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.cr-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cr-pre { margin: 0; padding: 12px 14px; background: #1f2328; color: #e6e8ee; border-radius: 8px; font-family: var(--mono); font-size: 13px; line-height: 1.55; overflow-x: auto; }
.cr-out { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.stamp-link { cursor: pointer; } .stamp-link:hover, .stamp-link:focus-visible { filter: brightness(1.15); outline: 2px dashed #b3261e; outline-offset: 4px; }
@media (max-width: 699px) {
  .cr-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .cr-nav { top: 52px; z-index: 1; max-height: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid #d8cfbd; padding: 8px 0; background: var(--paper); }
  .cr-group { display: none; } .cr-item { flex: none; }
  .cr-body { padding: 12px 0 22px; }
  .csie-head { padding: 8px 16px; } .csie-main { padding: 14px 16px 40px; }
  .cr-page .cr-ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* 手機一列最多兩顆鈕 */
}
/* 認識軟體工程（se.js）：一篇長文，章節捲動閱讀，12 站點一站看一站，小範本開浮動視窗 */
.se-page { max-width: 880px; line-height: 1.75; }
.se-page svg { max-width: 100%; height: auto; }
.se-hero h2 { margin: 10px 0 8px; font-size: 30px; line-height: 1.35; word-break: keep-all; } .se-hero p { margin: 8px 0; } .se-hero svg { display: block; margin: 12px auto; }
.se-outro { margin: 32px 0 20px; padding: 14px 16px; border-left: 4px solid var(--warn); }
.se-outro p { margin: 0; }
.se-hook { margin: 8px 0; border: 1px solid #d8cfbd; border-radius: 10px; background: #fffdf8; }
.se-hook summary { padding: 12px 14px; font-weight: 700; line-height: 1.5; cursor: pointer; }
.se-hook summary:hover { color: var(--accent); }
.se-hero .se-hook p { margin: 0; padding: 0 14px 12px; }
.se-nav { position: sticky; top: 56px; z-index: 1; display: flex; gap: 6px; margin: 14px 0 0; padding: 8px 0; overflow-x: auto; background: var(--paper); }
.se-nav a { flex: none; padding: 4px 12px; border: 1px solid #d8cfbd; border-radius: 999px; color: inherit; font-size: 14px; text-decoration: none; }
.se-nav a:hover { border-color: var(--accent); color: var(--accent); }
.se-sec { margin-top: 30px; scroll-margin-top: 110px; } .se-sec > h2 { margin: 0 0 10px; font-size: 22px; }
.se-sub { margin: 22px 0 8px; font-size: 18px; }
.se-table { overflow-x: auto; margin: 10px 0; }
.se-table table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 15px; }
.se-table th, .se-table td { padding: 6px 10px; border: 1px solid #d8cfbd; text-align: left; vertical-align: top; } .se-table th { background: #efe7d6; white-space: nowrap; }
.se-field { margin: 12px 0; } .se-field p { margin: 2px 0 0; }
.se-label { margin: 0; font-size: 14px; letter-spacing: .06em; color: var(--accent); }
.se-game { margin-top: 16px; padding: 8px 12px; border-left: 3px solid #c9bda6; background: rgba(255, 255, 255, .5); } .se-game .se-label { color: var(--muted); }
.se-manifesto { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--accent); } .se-manifesto p { margin: 0; }
.se-note { margin: 0 0 4px; padding: 12px 14px; border: 2px solid var(--warn); border-radius: 8px; background: #fff7e6; }
.se-updated { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.se-flow { margin: 14px 0 6px; } .se-flow svg { display: block; width: 100%; margin: 0 auto; }
.se-stop { cursor: pointer; outline: none; } .se-stop:hover rect, .se-stop:hover path:first-child { filter: brightness(.96); }
.se-stop:focus-visible text { font-weight: 800; text-decoration: underline; }
.se-station { padding: 14px 16px; border: 1px solid #d8cfbd; border-radius: 10px; background: #fffdf8; scroll-margin-top: 110px; }
.se-station-title { margin: 0 0 6px; font-size: 19px; }
.se-station-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.se-closing { margin: 14px 0 0; font-weight: 700; }
.se-tpl { margin: 0 2px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.se-model { margin-top: 16px; padding: 4px 16px 14px; border: 1px solid #d8cfbd; border-radius: 10px; background: #fffdf8; } .se-model .se-sub { margin-top: 10px; }
.se-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.se-choice { min-height: 48px; padding: 8px 12px; border: 1px solid #c9c2b5; border-radius: 8px; background: #fff; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.se-choice:hover { border-color: var(--accent); } .se-choice.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.se-answer:not(:empty) { padding: 4px 16px 10px; border: 1px solid #d8cfbd; border-radius: 10px; background: #fffdf8; }
.se-sources { margin-top: 30px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; } .se-sources summary { cursor: pointer; }
.se-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 12px; background: #fffdf8; color: inherit; box-shadow: 0 16px 48px rgba(0, 0, 0, .35); }
.se-dialog::backdrop { background: rgba(31, 35, 40, .5); }
.se-sheet { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.se-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #d8cfbd; } .se-sheet-head h3 { margin: 0; font-size: 16px; }
.se-sheet-body { padding: 12px 14px 16px; overflow: auto; line-height: 1.7; } .se-sheet-body p { margin: 8px 0 0; } .se-sheet-body svg { display: block; margin: 0 auto; }
.se-sheet-body .cr-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
@media (max-width: 699px) {
  .se-hero h2 { font-size: 24px; } .se-nav { top: 50px; }
  .se-station, .se-model { padding-left: 12px; padding-right: 12px; }
  .se-table table { font-size: 14px; }
}
.atlas-claim { margin: 0 0 6px; font-weight: 600; }
.atlas-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.atlas-tab { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; text-align: left; border: 1px solid var(--os-border, #d8cfbd); background: transparent; color: inherit; border-radius: 8px; padding: 6px 12px 6px 10px; font-size: 14px; cursor: pointer; }
.atlas-tab .atlas-ico { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--accent); }   /* 每個領域一個 Lucide 小圖示 */
.atlas-tab span, .atlas-tab small { grid-column: 2; }
.atlas-tab small { font-size: 11px; color: var(--os-muted, var(--muted)); }
.atlas-tab.on { background: rgba(37, 99, 235, .12); border-color: var(--accent); }
.atlas-page[hidden] { display: none; }
.atlas-art { display: block; width: 100%; height: auto; margin-bottom: 8px; border-radius: 8px; }
.atlas-notes { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--os-border, #d8cfbd); font-size: 13px; color: var(--os-muted, var(--muted)); }
.atlas-notes p { margin: 0 0 6px; }
.btn.ghost.hb-open { color: var(--muted); border-color: #d8d0c1; }
.badge-side .hb-open { width: 100%; }

/* ── 檢閱程式碼：三機找碴（spot）與讀 diff 標行（diff） ── */
.spot-devices { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding: 4px 0; }
.spot-frame { flex: 0 0 auto; border: 2px solid var(--line, #c9c2b6); border-radius: 10px; padding: 6px; background: var(--paper, #fff); }
.spot-frame.spot-pc { width: 236px; } .spot-frame.spot-tablet { width: 174px; } .spot-frame.spot-phone { width: 120px; }   /* 三台加起來要塞得進 640 寬的小關卡視窗，手機那台才不會被切掉 */
.spot-frame.spot-lit { box-shadow: 0 0 0 3px #f2b84b; }
.spot-frame .mock { font-size: 11px; overflow: hidden; position: relative; }   /* 整頁畫出來，不在小框裡捲；左右超出的照樣切掉（平板表單要左右捲那個錯） */
.spot-frame .mock-phone .mock-campaign-submit { padding-bottom: 32px; }   /* 手機的橫幅蓋住送出鈕下半截：露出上半截才看得出是按鈕被蓋住，也點得到 */
.spot-name { text-align: center; font-size: 12px; color: var(--muted, #777); margin-top: 4px; }
.mock-region { position: relative; cursor: pointer; border: 1px dashed transparent; border-radius: 6px; padding: 4px; margin: 4px 0; }
.mock-region:hover { border-color: #c9c2b6; }
.mock-region.spot-hit { box-shadow: 0 0 0 3px #d9534f; border-radius: 8px; }
.mock-region.spot-pending { box-shadow: 0 0 0 3px #f2b84b; }   /* 標了但還沒選原因 */
.mock-region.spot-active { outline: 2px solid #2563eb; outline-offset: 3px; }   /* 底下選單現在對應的這一塊 */
.spot-reasons { position: sticky; bottom: 0; z-index: 3; margin-top: 8px; padding: 8px; border: 1px solid var(--os-border); border-radius: 8px; background: var(--os-win); box-shadow: 0 -4px 12px rgba(0,0,0,.18); }
.spot-reasons[hidden] { display: none; }
.spot-reasons-title { margin: 0 0 4px; font-size: 13px; }
.spot-reasons .review-menu { margin-top: 0; padding: 0; background: none; }
.review-menu { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; background: rgba(255,255,255,.95); padding: 4px; border-radius: 6px; position: relative; z-index: 2; }
.review-hint { background: #fff6dc; border-left: 3px solid #f2b84b; padding: 6px 10px; margin: 8px 0; }
.review-foot { justify-content: flex-end; gap: 8px; }
.mock-campaign-banner { background: #ff2d75; color: #fff; text-align: center; padding: 8px; font-weight: 700; }
.mock-campaign-banner.mock-sticky-bottom { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; z-index: 1; }
.mock-campaign-products { display: flex; gap: 6px; }
.mock-product { flex: 1; text-align: center; font-size: 10px; }
.mock-img { height: 40px; background: #e8e1d4; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #8a7f6e; }
.mock-img-broken { height: 40px; border: 1px solid #c9c2b6; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #999; font-size: 9px; background: repeating-linear-gradient(45deg, #f7f3ec, #f7f3ec 6px, #ece6da 6px, #ece6da 12px); }
.mock-campaign-countdown { text-align: center; font-size: 22px; color: #ff2d75; }
.mock-campaign-form { display: flex; flex-direction: column; gap: 4px; }
.mock-campaign-form.mock-overflow { width: 160%; }
.mock-field { display: flex; gap: 6px; align-items: center; font-size: 10px; } .mock-field .mock-input { flex: 1; min-width: 0; }
.mock-campaign-submit { text-align: center; padding-bottom: 8px; }
.diff-box { font-family: ui-monospace, Consolas, monospace; font-size: 12px; border: 1px solid var(--line, #c9c2b6); border-radius: 8px; overflow: hidden; background: #fff; color: #1f2328; }   /* diff 自帶淺色底：深色模式下加減行的底色是淺的，字要跟著深 */
.diff-file { background: #ece6da; color: #1f2328; padding: 4px 8px; font-weight: 700; }
.diff-line { display: flex; gap: 8px; padding: 2px 8px; cursor: pointer; align-items: flex-start; flex-wrap: wrap; }
.diff-line:hover { background: rgba(0,0,0,.04); }
.diff-add { background: #e6ffed; } .diff-del { background: #ffeef0; } .diff-ctx { background: transparent; }
.diff-line.diff-hit { outline: 2px solid #d9534f; outline-offset: -2px; }
.diff-line.diff-lit { box-shadow: inset 4px 0 0 #f2b84b; }
.diff-no { width: 3em; color: #999; text-align: right; flex: 0 0 auto; } .diff-sign { width: 1em; flex: 0 0 auto; }
.diff-line .fn-code { white-space: pre; flex: 1 1 auto; background: transparent; padding: 0; }
.diff-line .review-menu { flex-basis: 100%; }

/* ── 同事座位，直式畫面（手機、直式平板）：上下放。同事的螢幕腳貼齊桌緣，擺設放在螢幕下面的桌面上；
   有靠牆的櫃子時，螢幕讓出左邊給櫃子（櫃子比螢幕矮，放在螢幕後面會整個被擋住）。--px 是像素圖放大倍數、--spx 是櫃子的 ── */
@media (orientation: portrait) {
  .seat-room { --side: 24px; --mon: 1; --px: 6; --spx: 6; }
  .seat-room:has(.seat-fixture) { --mon: .68; }
  .seat-monitor { left: auto; right: var(--side); bottom: calc(100% - var(--edge)); width: calc((100vw - 2 * var(--side)) * var(--mon)); max-height: none; }
  .seat-actions { right: calc(var(--side) + (100vw - 2 * var(--side)) * var(--mon) / 2); bottom: calc(100% - var(--edge) + (100vw - 2 * var(--side)) * var(--mon) * .3125); }
  .seat-props { left: var(--side); right: var(--side); width: auto; bottom: 16px; justify-content: center; gap: 16px; }
  .seat-props li { flex: 0 1 calc(28px * var(--px)); }
  .seat-props .prop-img { max-height: calc(28px * var(--px)); }
  .seat-room[data-mode="legacy"] li, .seat-room[data-mode="hybrid"] li { flex: 0 1 calc(var(--w, 28) * 1px * var(--px)); }
  .seat-scenery, .seat-room[data-mode] .seat-scenery { left: var(--side); }
  .seat-scenery li { width: calc(36px * var(--spx)); }
  .seat-room[data-mode="legacy"] .seat-scenery li, .seat-room[data-mode="hybrid"] .seat-scenery li { width: calc(var(--w, 36) * 1px * var(--spx)); }
}
@media (orientation: portrait) and (max-width: 700px) {
  .seat-room { --side: 12px; --px: 4; --spx: 3; }
}
