:root {
  --ink: #15192b;
  --ink-2: #242a45;
  --paper: #f3eedf;
  --cream: #fffaf0;
  --acid: #c9f45b;
  --orange: #ff714b;
  --blue: #75d5e8;
  --muted: #7d806f;
  --line: #292d40;
  --shadow: 5px 5px 0 var(--line);
  --radius: 3px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--paper); font-family: var(--sans); }
body.auth-pending { min-height: 100vh; overflow-x: hidden; overflow-y: auto; background: var(--ink); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 99; padding: 10px 14px; background: var(--acid); color: var(--ink); font-weight: 800; }
.skip-link:focus { top: 12px; }
.hidden { display: none !important; }

.login-gate { min-height: 100vh; padding: clamp(18px, 4vw, 56px); color: var(--cream); background:
  radial-gradient(circle at 18% 22%, rgba(117,213,232,.18), transparent 31%),
  radial-gradient(circle at 80% 82%, rgba(255,113,75,.16), transparent 29%),
  var(--ink); }
.login-gate::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .33; background:
  repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,255,255,.025) 5px 6px),
  linear-gradient(90deg, transparent 49.8%, rgba(201,244,91,.08) 50%, transparent 50.2%); }
.login-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(360px,.8fr); min-height: calc(100vh - clamp(36px, 8vw, 112px)); border: 3px solid var(--cream); box-shadow: 12px 12px 0 var(--orange); }
.login-world { position: relative; overflow: hidden; min-height: 580px; padding: 22px; color: var(--ink); background: #d9d1bd; border-right: 3px solid var(--cream); }
.login-world::after { content: ""; position: absolute; inset: 50px 0 0; opacity: .46; background-image:
  linear-gradient(45deg, rgba(21,25,43,.08) 25%, transparent 25%, transparent 75%, rgba(21,25,43,.08) 75%),
  linear-gradient(45deg, rgba(21,25,43,.08) 25%, transparent 25%, transparent 75%, rgba(21,25,43,.08) 75%);
  background-position: 0 0, 12px 12px; background-size: 24px 24px; }
.login-world-head { position: relative; z-index: 2; display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 3px solid var(--line); font: 800 10px var(--mono); letter-spacing: .1em; }
.login-live { display: flex; align-items: center; gap: 7px; }.login-live i { width: 8px; height: 8px; background: var(--acid); border: 1px solid var(--line); animation: blink 1.4s steps(2) infinite; }
.login-pixel-office { position: relative; z-index: 1; min-height: 460px; }
.login-window { position: absolute; left: 50%; top: 56px; display: grid; grid-template-columns: repeat(3,44px); gap: 8px; padding: 12px; transform: translateX(-50%); background: var(--ink-2); border: 3px solid var(--line); box-shadow: 6px 6px 0 rgba(21,25,43,.35); }
.login-window i { height: 42px; background: linear-gradient(145deg,#9ddfea,#4a91a8); border: 2px solid var(--line); box-shadow: inset 8px 8px 0 rgba(255,255,255,.17); }
.login-desk { position: absolute; width: 130px; height: 76px; background: var(--cream); border: 3px solid var(--line); box-shadow: 6px 6px 0 rgba(21,25,43,.3); }
.login-desk::after { content: ""; position: absolute; left: 50%; top: -31px; width: 50px; height: 34px; transform: translateX(-50%); background: var(--ink); border: 3px solid #74798f; box-shadow: inset 0 0 0 4px var(--blue); }
.login-desk span { position: absolute; left: 17px; bottom: 12px; width: 22px; height: 28px; background: var(--orange); border: 2px solid var(--line); }
.login-desk span::before { content: ""; position: absolute; left: 3px; top: -15px; width: 12px; height: 12px; background: #e8b486; border: 2px solid var(--line); }
.login-desk b { position: absolute; right: 12px; bottom: 13px; width: 34px; height: 8px; background: var(--acid); border: 2px solid var(--line); }
.desk-a { left: 7%; top: 200px; }.desk-b { right: 7%; top: 200px; }.desk-c { left: 14%; top: 340px; }.desk-d { right: 14%; top: 340px; }
.login-command { position: absolute; z-index: 3; left: 50%; top: 222px; width: 150px; min-height: 112px; padding: 16px 12px; transform: translateX(-50%); text-align: center; background: #fff0b8; border: 3px solid var(--line); box-shadow: 7px 7px 0 var(--orange); }
.login-command em { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 auto 9px; color: var(--cream); background: var(--ink); border: 2px solid var(--line); font: 900 11px var(--mono); }
.login-command strong,.login-command small { display: block; }.login-command strong { font-size: 13px; }.login-command small { margin-top: 5px; color: #67695f; font-size: 10px; }
.login-roster { position: absolute; z-index: 4; left: 22px; right: 22px; bottom: 20px; display: grid; grid-template-columns: repeat(6,1fr); gap: 6px; }
.login-roster span { padding: 8px 4px; text-align: center; background: rgba(255,250,240,.84); border: 2px solid var(--line); font: 800 9px var(--mono); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 5vw, 72px); background: var(--ink); }
.login-brand { display: flex; align-items: center; align-self: flex-start; gap: 12px; margin-bottom: clamp(48px,8vh,90px); color: inherit; text-decoration: none; }
.login-brand strong { display: block; font-size: 22px; letter-spacing: .12em; }.login-brand small { display: block; margin-top: 3px; color: #aeb3c7; font: 10px var(--mono); letter-spacing: .12em; }
.auth-kicker { margin-bottom: 14px; color: var(--acid); font: 800 10px var(--mono); letter-spacing: .14em; }
.login-card h1 { margin: 0; color: var(--cream); font-size: clamp(40px,5vw,68px); line-height: .98; }
.login-copy { max-width: 43ch; margin: 22px 0 30px; color: #bcc1d0; font-size: 14px; line-height: 1.75; }
.login-form label { color: var(--cream); font-size: 12px; letter-spacing: .04em; }
.login-input-row { display: grid; grid-template-columns: 1fr auto; }
.login-input-row input { min-width: 0; height: 54px; margin: 7px 0 0; color: var(--ink); background: var(--cream); border: 3px solid var(--cream); border-right: 0; font: 700 16px var(--mono); }
.login-input-row button { min-width: 70px; margin-top: 7px; color: var(--cream); background: var(--ink-2); border: 3px solid var(--cream); cursor: pointer; font-size: 12px; font-weight: 800; }
.login-help { margin: 9px 0 16px; color: #8f95aa; font-size: 10px; }
.login-submit { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 54px; padding: 0 16px; color: var(--ink); background: var(--acid); border: 3px solid var(--cream); box-shadow: 6px 6px 0 var(--orange); cursor: pointer; font-weight: 900; }
.login-submit:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 var(--orange); }.login-submit:active { transform: translate(3px,3px); box-shadow: 2px 2px 0 var(--orange); }.login-submit:disabled { opacity: .68; cursor: progress; }
.login-submit b { font: 900 20px var(--mono); }.login-error { min-height: 21px; margin: 12px 0 0; color: #ff9d83; font-size: 12px; font-weight: 800; }.login-error.success { color: var(--acid); }
.login-trust { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; padding-top: 15px; color: #82899e; border-top: 1px solid #39405a; font: 700 9px var(--mono); letter-spacing: .06em; }
.login-trust span:first-child { display: flex; align-items: center; gap: 7px; }.login-trust i { width: 7px; height: 7px; background: var(--blue); }
.logout-button { color: #ffb49f; }

.shell { min-height: 100vh; background-image: linear-gradient(rgba(21,25,43,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(21,25,43,.045) 1px, transparent 1px); background-size: 24px 24px; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; color: var(--cream); background: var(--ink); border-bottom: 4px solid var(--orange); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 22px; letter-spacing: .12em; }
.brand small { display: block; margin-top: 3px; color: #aeb3c7; font: 10px var(--mono); letter-spacing: .12em; }
.brand-mark { width: 36px; height: 36px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 6px; border: 2px solid var(--cream); box-shadow: 3px 3px 0 var(--orange); }
.brand-mark i { display: block; background: var(--acid); height: 8px; }
.brand-mark i:nth-child(2) { height: 18px; background: var(--orange); }
.brand-mark i:nth-child(3) { height: 12px; background: var(--blue); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.system-pill { display: flex; align-items: center; gap: 8px; margin-right: 8px; color: #bec3d5; font: 11px var(--mono); text-transform: uppercase; }
.signal { width: 9px; height: 9px; background: #f2c94c; box-shadow: 0 0 0 3px rgba(242,201,76,.16); }
.system-pill.online .signal { background: var(--acid); box-shadow: 0 0 0 3px rgba(201,244,91,.16); }
.system-pill.error .signal { background: var(--orange); }
.icon-button, .primary-button, .ghost-button, .new-task-rail, .setup-banner button, .token-row button { border: 2px solid currentColor; border-radius: var(--radius); cursor: pointer; font-weight: 800; }
.icon-button { padding: 9px 12px; color: var(--cream); background: transparent; }
.primary-button { padding: 10px 15px; color: var(--ink); background: var(--acid); box-shadow: 3px 3px 0 var(--orange); }
.primary-button:hover, .new-task-rail:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--orange); }
.primary-button:active, .new-task-rail:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--orange); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 350px; min-height: calc(100vh - 78px); }
.office-panel { min-width: 0; padding: 30px; border-right: 3px solid var(--line); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; color: #666b63; font: 700 10px var(--mono); letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 0; font-size: clamp(25px, 3.2vw, 46px); line-height: 1.08; letter-spacing: -.035em; }
.clock { padding: 8px 10px; border: 2px solid var(--line); background: var(--cream); box-shadow: 3px 3px 0 var(--blue); font: 700 14px var(--mono); }

.setup-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 13px; color: var(--cream); background: var(--ink-2); border: 2px solid var(--orange); box-shadow: 4px 4px 0 var(--orange); }
.setup-banner p { margin: 3px 0 0; color: #c9cada; font-size: 13px; }
.setup-banner code { color: var(--acid); }
.setup-banner button { margin-left: auto; white-space: nowrap; padding: 8px 10px; background: var(--acid); }
.setup-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; color: var(--ink); background: var(--orange); border: 2px solid var(--cream); font: 900 20px var(--mono); }

.office-frame { position: relative; overflow: hidden; border: 3px solid var(--line); background: #d9d1bd; box-shadow: var(--shadow); }
.office-frame::after { content: ""; position: absolute; inset: 42px 0 30px; pointer-events: none; background-image: linear-gradient(45deg, rgba(21,25,43,.04) 25%, transparent 25%, transparent 75%, rgba(21,25,43,.04) 75%), linear-gradient(45deg, rgba(21,25,43,.04) 25%, transparent 25%, transparent 75%, rgba(21,25,43,.04) 75%); background-position: 0 0, 8px 8px; background-size: 16px 16px; }
.office-meta, .floor-legend { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 10px 13px; background: var(--ink); color: #c6cad9; font: 700 10px var(--mono); letter-spacing: .08em; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; background: var(--acid); animation: blink 1.5s steps(2) infinite; }
.office-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(125px,1fr)); gap: 18px; min-height: 470px; padding: 32px 25px 36px; }
.desk { --dept-color: var(--blue); position: relative; min-height: 170px; padding: 16px 12px 10px; border: 2px solid var(--line); background: rgba(255,250,240,.78); box-shadow: 4px 4px 0 rgba(21,25,43,.4); }
.desk.pm { grid-row: span 2; align-self: center; background: #fff0b8; }
.desk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.desk-name { font-size: 13px; font-weight: 900; }
.desk-code { color: #686b65; font: 9px var(--mono); }
.desk-status { width: 9px; height: 9px; background: #adb0a7; border: 1px solid var(--line); }
.desk.busy { background: var(--cream); box-shadow: 4px 4px 0 var(--dept-color); }
.desk.busy .desk-status { background: var(--acid); animation: blink .8s steps(2) infinite; }
.desk.review .desk-status { background: var(--orange); }
.desk-room { position: relative; height: 93px; margin-top: 10px; border-top: 2px dashed rgba(21,25,43,.2); }
.monitor { position: absolute; left: 50%; top: 14px; width: 44px; height: 31px; transform: translateX(-50%); background: var(--ink); border: 3px solid #6d7182; box-shadow: inset 0 0 0 3px #2fbaac; }
.monitor::after { content: ""; position: absolute; left: 17px; bottom: -11px; width: 6px; height: 9px; background: var(--line); box-shadow: -6px 9px 0 #6f6b5e, 0 9px 0 #6f6b5e, 6px 9px 0 #6f6b5e; }
.avatar { position: absolute; left: 50%; bottom: 0; width: 30px; height: 34px; transform: translateX(-50%); background: var(--dept-color); border: 2px solid var(--line); box-shadow: inset 0 -9px 0 rgba(21,25,43,.24); }
.avatar::before { content: ""; position: absolute; left: 5px; top: -17px; width: 16px; height: 16px; background: #f2bb8e; border: 2px solid var(--line); box-shadow: inset 0 4px 0 #46352f; }
.avatar::after { content: "· ·"; position: absolute; left: 6px; top: -16px; font: 900 7px var(--mono); color: var(--line); white-space: pre; }
.desk.busy .avatar { animation: work .6s steps(2) infinite; }
.speech { position: absolute; z-index: 4; left: 7px; right: 7px; bottom: 7px; padding: 5px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--cream); background: var(--ink); border-left: 4px solid var(--dept-color); font: 9px var(--mono); }
.floor-legend { justify-content: flex-start; gap: 18px; background: #252a3e; }
.floor-legend span { display: flex; align-items: center; gap: 5px; }
.floor-legend i { width: 8px; height: 8px; border: 1px solid #767b91; }
.legend-idle { background: #adb0a7; }.legend-busy { background: var(--acid); }.legend-review { background: var(--orange); }

.activity-strip { margin-top: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.section-title h2 { margin: 0; font-size: 18px; }.section-title span { color: #73776e; font: 10px var(--mono); }
.activity-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.activity-item { min-width: 0; padding: 10px; border: 2px solid var(--line); background: var(--cream); }
.activity-item time { color: #73776e; font: 9px var(--mono); }.activity-item p { overflow: hidden; margin: 5px 0 0; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.empty-line { margin: 10px 0; color: var(--muted); font-size: 13px; }

.task-panel { position: relative; display: flex; flex-direction: column; min-height: calc(100vh - 78px); padding: 26px 20px 20px; background: var(--cream); }
.task-header { display: flex; align-items: center; justify-content: space-between; }.task-header h2 { margin: 0; font-size: 25px; }
.count-badge { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; color: var(--cream); background: var(--ink); border: 2px solid var(--line); box-shadow: 3px 3px 0 var(--orange); font: 800 13px var(--mono); }
.filter-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin: 20px 0 15px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.filter-tabs button { padding: 7px 3px; border: 0; background: transparent; color: #71746d; cursor: pointer; font-size: 12px; font-weight: 800; }
.filter-tabs button.active { color: var(--ink); background: var(--acid); box-shadow: 2px 2px 0 var(--line); }
.task-list { flex: 1; overflow-y: auto; max-height: calc(100vh - 295px); padding: 2px 5px 10px 1px; }
.task-card { width: 100%; margin-bottom: 11px; padding: 12px; text-align: left; border: 2px solid var(--line); background: #fff; box-shadow: 3px 3px 0 #b8b3a7; cursor: pointer; }
.task-card:hover { transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--blue); }
.task-card-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.task-card h3 { margin: 0 0 7px; font-size: 14px; line-height: 1.35; }.task-card p { overflow: hidden; margin: 0; color: #74766e; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.status { padding: 3px 5px; white-space: nowrap; border: 1px solid var(--line); background: #e6e3da; font: 700 9px var(--mono); }
.status.busy { background: var(--acid); }.status.review { color: #fff; background: var(--orange); }.status.done { background: var(--blue); }.status.rejected { color: #fff; background: #8d5063; }
.dept-tag { color: #656960; font: 700 9px var(--mono); }.priority-urgent { color: #d7423e; }
.empty-state { margin-top: 40px; color: #8c8d86; text-align: center; font-size: 13px; line-height: 1.8; }
.new-task-rail { width: 100%; margin-top: 12px; padding: 12px; background: var(--acid); box-shadow: 3px 3px 0 var(--orange); }.new-task-rail span { margin-right: 7px; font: 900 17px var(--mono); }

.modal { width: min(620px, calc(100% - 28px)); padding: 0; border: 3px solid var(--line); border-radius: 0; background: var(--cream); box-shadow: 9px 9px 0 var(--orange); }
/* 唔用 backdrop-filter：dialog 喺 top layer 加 backdrop-filter 會令 Chromium
   將中文輸入法（例如 Google 廣東話輸入）嘅候選字視窗擺錯位或者遮住。
   純色半透明背景視覺上分別好細，但輸入法就正常。 */
.modal::backdrop { background: rgba(11,14,27,.82); }
.modal form { padding: 22px; }.modal-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 3px solid var(--line); }.modal-head h2 { margin: 0; }
.close-button { width: 34px; height: 34px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; font: 900 22px/1 var(--mono); }
label { display: block; margin-bottom: 15px; font-size: 12px; font-weight: 800; }
input, textarea, select { width: 100%; margin-top: 7px; padding: 11px; border: 2px solid var(--line); border-radius: 0; color: var(--ink); background: #fff; }
textarea { resize: vertical; line-height: 1.6; }.form-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }.ghost-button { padding: 10px 15px; background: transparent; }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }.token-row button { margin-top: 7px; padding: 0 12px; background: var(--blue); }
.settings-summary { display: flex; gap: 8px; margin: 12px 0; }.summary-chip { padding: 6px 8px; background: #e8e3d5; border: 1px solid var(--line); font: 10px var(--mono); }
.provider-list { max-height: 330px; overflow-y: auto; border-top: 2px solid var(--line); }
.provider-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 3px; border-bottom: 1px solid #c7c2b5; }.provider-row strong { display: block; font-size: 13px; }.provider-row small { display: block; overflow: hidden; max-width: 420px; margin-top: 4px; color: #74776e; font: 9px var(--mono); text-overflow: ellipsis; }
.provider-row button { align-self: center; padding: 6px 8px; border: 1px solid var(--line); background: var(--acid); cursor: pointer; font: 700 10px var(--mono); }.provider-row button:disabled { color: #999; background: #ddd; cursor: not-allowed; }
.settings-note { margin: 15px 0 0; color: #73766e; font-size: 11px; line-height: 1.6; }
.task-reference-hint { margin: -2px 0 14px; padding: 8px 10px; border-left: 4px solid var(--blue); background: #e8f7f8; color: #555b5a; font-size: 11px; }
.references-modal { width: min(760px, calc(100% - 28px)); max-height: 92vh; overflow-y: auto; }
.reference-shell { padding: 22px; }.references-modal form { padding: 0; }
.reference-intro { margin: -8px 0 18px; color: #696d66; font-size: 12px; line-height: 1.6; }
.vision-notice { min-height: 34px; margin: -2px 0 10px; padding: 8px 10px; color: #565b55; background: #e7e3d6; border: 1px dashed var(--line); font-size: 11px; }
.vision-notice.ready { background: #e6f8d0; border-style: solid; }.vision-notice.warning { background: #fff0c9; border-color: #a96c23; }
.reference-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 12px 0 9px; border-top: 3px solid var(--line); border-bottom: 2px solid var(--line); }
.reference-toolbar h3 { margin: 0; font-size: 16px; }.reference-toolbar select { width: auto; min-width: 140px; margin: 0; padding: 7px; }
.reference-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.reference-card { position: relative; overflow: hidden; min-height: 132px; padding: 11px; border: 2px solid var(--line); background: #fff; box-shadow: 3px 3px 0 #b7b2a6; }
.reference-card.inactive { opacity: .58; filter: grayscale(.65); }.reference-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.reference-card h4 { margin: 0 0 3px; font-size: 13px; }.reference-card small { color: #72766e; font: 9px var(--mono); }
.reference-preview { overflow: hidden; height: 54px; margin: 9px 0; color: #64675f; font-size: 10px; line-height: 1.5; }
.reference-preview.image { height: 78px; background: #ddd8ca; border: 1px solid var(--line); }.reference-preview img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.reference-actions { display: flex; gap: 6px; }.reference-actions button { padding: 5px 7px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font: 700 9px var(--mono); }.reference-actions .delete-reference { color: #fff; background: #8d5063; }
.reference-kind { padding: 3px 5px; color: #fff; background: var(--ink); font: 8px var(--mono); }

.agency-modal { width: min(980px, calc(100% - 28px)); max-height: 92vh; overflow-y: auto; box-shadow: 9px 9px 0 var(--blue); }
.agency-shell { padding: 22px; }
.agency-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.agency-section-head h3 { margin: 0; font-size: 18px; }.agency-section-head span { color: #686d66; font: 10px var(--mono); }
.role-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.role-card { position: relative; min-height: 174px; padding: 12px; border: 2px solid var(--line); background: #fff; box-shadow: 4px 4px 0 var(--role-color); }
.role-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--role-color); }
.role-card-top,.role-meta { display: flex; justify-content: space-between; gap: 8px; color: #656a63; font: 8px var(--mono); }
.role-card h4 { margin: 14px 0 2px; font-size: 14px; }.role-card small { color: #7a7d76; font: 9px var(--mono); }
.role-card p { min-height: 44px; margin: 11px 0; color: #555a54; font-size: 11px; line-height: 1.5; }
.role-meta { padding-top: 8px; border-top: 1px dashed #b7b3a9; }.role-meta span:last-child { overflow: hidden; max-width: 55%; text-overflow: ellipsis; white-space: nowrap; }
.workflow-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.workflow-card { padding: 13px; border: 2px solid var(--line); background: #eee9dc; }.workflow-card.recommended { background: #f6ffd9; box-shadow: 4px 4px 0 var(--acid); }
.workflow-title { display: flex; justify-content: space-between; color: #696d66; font: 9px var(--mono); }.workflow-title b { padding: 2px 5px; color: var(--ink); background: var(--acid); border: 1px solid var(--line); }
.workflow-card h4 { margin: 8px 0 5px; font-size: 15px; }.workflow-card > p { margin: 0 0 10px; color: #666a64; font-size: 11px; line-height: 1.5; }
.workflow-phases { display: grid; gap: 5px; }.workflow-phases div { display: grid; grid-template-columns: 22px 1fr; gap: 7px; align-items: center; font-size: 10px; }
.workflow-phases i { display: grid; place-items: center; width: 22px; height: 22px; color: #fff; background: var(--ink); font: normal 8px var(--mono); }
.pm-reasoning { padding: 10px 12px; border-left: 5px solid var(--orange); background: #fff0d1; font-size: 11px; line-height: 1.6; }.pm-reasoning strong { display: block; margin-bottom: 3px; }

.detail-drawer { position: fixed; z-index: 20; inset: 0; display: none; }.detail-drawer.open { display: block; }.drawer-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(11,14,27,.68); cursor: default; }.drawer-panel { position: absolute; right: 0; top: 0; overflow-y: auto; width: min(690px, 94vw); height: 100%; padding: 24px; background: var(--paper); border-left: 4px solid var(--orange); box-shadow: -8px 0 0 rgba(21,25,43,.3); animation: slide-in .2s ease-out; }
.drawer-head { display: flex; justify-content: space-between; padding-bottom: 14px; border-bottom: 3px solid var(--line); }.drawer-head h2 { margin: 0; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }.detail-brief { padding: 14px; border: 2px solid var(--line); background: var(--cream); white-space: pre-wrap; line-height: 1.6; }
.step-line { display: flex; gap: 8px; align-items: center; padding: 7px 0; font-size: 12px; border-bottom: 1px dashed #b4b0a4; }.step-number { display: grid; place-items: center; width: 22px; height: 22px; background: var(--ink); color: #fff; font: 9px var(--mono); }
.output-card { margin-top: 18px; border: 2px solid var(--line); background: var(--cream); box-shadow: 4px 4px 0 var(--blue); }.output-head { display: flex; justify-content: space-between; padding: 9px 11px; color: #fff; background: var(--ink); font: 10px var(--mono); }.output-body { max-height: 50vh; overflow: auto; padding: 15px; white-space: pre-wrap; word-break: break-word; font: 12px/1.7 var(--mono); }
.qa-box { margin-top: 12px; padding: 12px; border: 2px solid var(--line); background: #fff0b8; }.qa-score { font: 900 26px var(--mono); }.qa-box ul { margin-bottom: 0; padding-left: 20px; font-size: 12px; }
.review-box { margin-top: 18px; padding-top: 15px; border-top: 3px solid var(--line); }.review-box textarea { min-height: 90px; }.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }.review-actions button { padding: 8px 10px; border: 2px solid var(--line); cursor: pointer; font-size: 11px; font-weight: 800; }.approve { background: var(--acid); }.revise { background: #ffd66b; }.reject { color: #fff; background: #8d5063; }.publish { background: var(--blue); }
.error-box { padding: 12px; border: 2px solid #b43b3b; background: #ffe1dc; color: #7e2525; font-size: 12px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: -100px; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 11px 15px; color: #fff; background: var(--ink); border: 2px solid var(--cream); box-shadow: 4px 4px 0 var(--orange); font-size: 12px; transition: bottom .2s ease; }.toast.show { bottom: 24px; }

@keyframes blink { 50% { opacity: .35; } }
@keyframes work { 50% { transform: translateX(-50%) translateY(-2px); } }
@keyframes slide-in { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
@media (max-width: 1040px) { .workspace { grid-template-columns: 1fr 310px; }.office-grid { grid-template-columns: repeat(3,minmax(120px,1fr)); }.desk.pm { grid-row: auto; }.activity-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .login-grid { grid-template-columns: 1fr; }.login-world { display: none; }.login-card { min-height: calc(100vh - 36px); }.login-brand { margin-bottom: 64px; } }
@media (max-width: 760px) { .topbar { height: auto; min-height: 72px; padding: 12px 15px; }.brand small,.system-pill { display: none; }.icon-button { padding: 8px; }.logout-button { display: none; }.workspace { display: block; }.office-panel { padding: 20px 14px 30px; border-right: 0; }.task-panel { min-height: auto; border-top: 4px solid var(--line); }.task-list { max-height: none; }.office-grid { grid-template-columns: repeat(2,minmax(120px,1fr)); min-height: auto; padding: 20px 14px 25px; gap: 12px; }.activity-list { grid-template-columns: 1fr; }.panel-heading { align-items: flex-start; }.clock { display: none; }.form-row { grid-template-columns: 1fr; }.drawer-panel { padding: 17px; }.setup-banner { align-items: flex-start; flex-wrap: wrap; }.setup-banner button { margin-left: 48px; }.reference-list,.role-grid,.workflow-grid { grid-template-columns: 1fr; }.reference-shell,.agency-shell { padding: 16px; } }
@media (max-width: 560px) { .login-gate { padding: 0; }.login-grid { min-height: 100vh; border: 0; box-shadow: none; }.login-card { min-height: 100vh; padding: 28px 20px; }.login-brand { margin-bottom: 54px; }.login-card h1 { font-size: 45px; }.login-trust { align-items: flex-start; flex-direction: column; } }
@media (max-width: 410px) { .topbar .primary-button { font-size: 0; }.topbar .primary-button::after { content: "+"; font-size: 18px; }.office-grid { grid-template-columns: 1fr; }.desk { min-height: 155px; } }

/* 圖像成果同重生工具 v1.4.4 */
.output-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 10px; padding: 12px; }
.output-image { position: relative; margin: 0; border: 2px solid var(--line); background: #fff; box-shadow: 3px 3px 0 var(--blue); }
.output-image img { display: block; width: 100%; height: auto; }
.img-download { position: absolute; right: 6px; bottom: 6px; padding: 4px 8px; color: #fff; background: var(--ink); border: 2px solid var(--cream); font: 800 10px var(--mono); text-decoration: none; }
.image-tools { margin-top: 18px; padding: 12px; border: 2px dashed var(--line); background: #f3ecff; }
.image-tools .eyebrow { margin-bottom: 8px; }
.image-tools textarea { width: 100%; min-height: 70px; box-sizing: border-box; }
.image-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.image-actions .regen { padding: 8px 12px; border: 2px solid var(--line); background: #c084fc; color: var(--ink); cursor: pointer; font-weight: 800; font-size: 11px; }
.image-actions .regen.ghost { background: var(--cream); }
.image-actions .regen:disabled { opacity: .55; cursor: progress; }

/* Low-key password-only entrance v1.4.6 */
body.auth-pending { overflow: hidden; background: #111214; }
.login-gate {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 24px;
  color: #ececea;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.025), transparent 32%),
    #111214;
}
.login-gate::before {
  position: fixed;
  inset: 0;
  opacity: .22;
  background: repeating-linear-gradient(90deg, transparent 0 63px, rgba(255,255,255,.018) 63px 64px);
}
.login-grid {
  display: block;
  width: min(100%, 420px);
  min-height: 0;
  border: 0;
  box-shadow: none;
}
.login-world,
.login-brand,
.auth-kicker,
.login-card h1,
.login-copy,
.login-form > label,
.login-help,
.login-trust { display: none; }
.login-card {
  display: block;
  min-height: 0;
  padding: 0;
  background: transparent;
}
.login-form { width: 100%; }
.login-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-bottom: 1px solid #4b4d50;
  transition: border-color .18s ease;
}
.login-input-row:focus-within { border-color: #d9d9d6; }
.login-input-row input {
  width: 100%;
  min-width: 0;
  height: 56px;
  margin: 0;
  padding: 0 2px;
  color: #f1f1ee;
  background: transparent;
  border: 0;
  outline: 0;
  font: 500 16px/1 var(--mono);
  letter-spacing: .08em;
}
.login-input-row input::placeholder { color: #74767a; letter-spacing: .04em; }
.login-input-row button {
  min-width: 52px;
  height: 56px;
  margin: 0;
  padding: 0 4px;
  color: #85878b;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: 600 10px/1 var(--mono);
}
.login-input-row button:hover,
.login-input-row button:focus-visible { color: #f1f1ee; outline: 0; }
.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 0;
  justify-content: center;
  color: #8f9195;
  background: transparent;
  border: 0;
  box-shadow: none;
  font: 600 10px/1 var(--mono);
  letter-spacing: .12em;
}
.login-submit b { display: none; }
.login-submit:hover {
  color: #f1f1ee;
  background: transparent;
  transform: none;
  box-shadow: none;
}
.login-submit:active { transform: none; box-shadow: none; }
.login-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #ba7777;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
}
.login-error.success { color: #858b82; }
@media (max-width: 560px) {
  .login-gate { padding: 22px; }
  .login-grid,
  .login-card { min-height: 0; padding: 0; }
}
