:root {
  --bg: #F6F5F2;
  --panel: #FFFFFF;
  --ink: #1C1B19;
  --ink-2: #55524C;
  --ink-3: #8D8980;
  --line: #E6E3DD;
  --line-2: #EFEDE8;
  --hover: #F1EFEA;
  --accent: oklch(0.58 0.17 35);
  --accent-soft: oklch(0.95 0.035 35);
  --pos: oklch(0.6 0.13 155);
  --neg: oklch(0.58 0.17 25);
  --neu: oklch(0.72 0.01 80);
  --pos-soft: oklch(0.95 0.035 155);
  --neg-soft: oklch(0.95 0.035 25);
  --mark: oklch(0.93 0.09 95);
  --r: 10px;
  --sans: 'Noto Sans TC', 'PingFang TC', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --w-todo: oklch(0.58 0.17 35);
  --w-doing: oklch(0.62 0.13 250);
  --w-replied: oklch(0.6 0.13 155);
  --w-skip: oklch(0.72 0.01 80);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-3); }
.sm { font-size: 12px; }
.fw5 { font-weight: 500; }
.grow { flex: 1; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ell2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* App shell */
.app { display: grid; grid-template-columns: 216px 1fr; height: 100vh; }
.nav { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); position: relative; flex: none; }
.brand-mark::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--accent); }
.brand b { font-size: 15px; letter-spacing: .02em; }
.brand span { font-family: var(--mono); font-size: 10px; color: var(--ink-3); display: block; letter-spacing: .08em; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-align: left; width: 100%; }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--ink); color: #fff; }
.nav-item .count { margin-left: auto; }
.nav-item.on .count { background: var(--accent); }
.nav-sec { font-size: 11px; color: var(--ink-3); padding: 18px 10px 6px; letter-spacing: .04em; }
.nav-post { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--ink-2); text-align: left; width: 100%; }
.nav-post:hover { background: var(--hover); }
.nav-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px var(--pos-soft); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.proj { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-weight: 500; white-space: nowrap; }
.topbar .fetchinfo { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.content { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.content.with-drawer .lay-columns,
.content.with-drawer .lay-timeline,
.content.with-drawer .lay-split { padding-right: 440px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #33312d; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.ibtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; color: var(--ink-2); position: relative; }
.ibtn:hover { background: var(--hover); color: var(--ink); }
.lnk { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.lnk:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-family: var(--mono); font-size: 11px; display: inline-grid; place-items: center; }
.bell-dot { position: absolute; top: 5px; right: 5px; }

/* Platform badge */
.pbadge { display: inline-grid; place-items: center; font-family: var(--mono); font-weight: 700; flex: none; letter-spacing: -0.03em; line-height: 1; }
.pbadge.bad { background: var(--line); color: var(--ink-3); border-radius: 5px; font-size: 11px; }
.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 50%; background: var(--line-2); color: var(--ink-2); font-weight: 600; flex: none; }
.avatar-p { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); }
.sent { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); }
.sent i { width: 7px; height: 7px; border-radius: 50%; }
.sent-pos i { background: var(--pos); } .sent-neg i { background: var(--neg); } .sent-neu i { background: var(--neu); }
.sent-neg { color: var(--neg); }
.sentbar { display: flex; gap: 2px; border-radius: 3px; overflow: hidden; width: 100%; }
.sentbar i { min-width: 0; }
.sentbar .pos { background: var(--pos); } .sentbar .neu { background: var(--neu); } .sentbar .neg { background: var(--neg); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
mark.mk-q { background: oklch(0.88 0.08 240); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); flex: none; }
.status.err { color: var(--neg); } .status.err i { background: var(--neg); }
.status.paused i, .status.neutral i { background: var(--neu); }
.pill-accent { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 10px; white-space: nowrap; }

/* Toggle / seg / chips */
.toggle { width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; flex: none; cursor: pointer; }
.toggle i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle.on { background: var(--ink); } .toggle.on i { transform: translateX(14px); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 2px; }
.seg button { padding: 6px 12px; border-radius: 6px; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.seg.sm button { padding: 4px 10px; font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); font-size: 12.5px; color: var(--ink-3); opacity: .7; }
.chip:not(:has(.pbadge)) { padding-left: 10px; }
.chip.on { color: var(--ink); opacity: 1; border-color: #CFCBC3; }
.chip:not(.on) .pbadge { filter: grayscale(1); opacity: .5; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.chk input { accent-color: var(--ink); }
.vsep { width: 1px; height: 20px; background: var(--line); flex: none; }

/* Filter bar */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 0; }
.search { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-3); min-width: 220px; }
.search input { border: 0; outline: 0; background: none; flex: 1; color: var(--ink); min-width: 0; }
.search.lg { height: 40px; }
.filterbar.compact .search { min-width: 160px; flex: 1; max-width: 240px; }

/* Comment card */
.cmt { display: flex; gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); position: relative; transition: border-color .15s; cursor: default; }
.cmt:hover { border-color: #D4D0C8; }
.cmt.unread::before { content: ''; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.cmt.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { 0% { background: var(--accent-soft); transform: translateY(-6px); opacity: 0; } 15% { opacity: 1; transform: none; } 100% { background: var(--panel); } }
.cmt.dense { padding: 10px 12px; gap: 10px; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 8px; }
.cmt-author-wrap { position: relative; }
.cmt-author { font-weight: 600; font-size: 13.5px; cursor: pointer; background: none; border: 0; padding: 0; color: inherit; }
.cmt-author:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmt-floor { color: var(--ink-3); font-size: 11.5px; }
.cmt-time { color: var(--ink-3); font-size: 12px; }
.ptt-tag { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 0 4px; border-radius: 3px; background: var(--line-2); color: var(--ink-2); }
.ptt-tag.push { color: #fff; background: var(--pos); } .ptt-tag.boo { color: #fff; background: var(--neg); }
.cmt-post { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink-3); max-width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.cmt-post span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmt-post:hover { color: var(--ink); }
.cmt-text { margin-top: 6px; line-height: 1.65; font-size: 14px; }
.cmt.dense .cmt-text { font-size: 13.5px; margin-top: 4px; }
.cmt-foot { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 12px; }
.cmt-foot .lnk { opacity: 0; transition: opacity .1s; }
.cmt:hover .cmt-foot .lnk { opacity: 1; }
.cmt.dense .cmt-foot { margin-top: 4px; }

.usercard { position: absolute; z-index: 30; top: 100%; left: -6px; margin-top: 6px; width: 260px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(30,25,20,.12); padding: 14px; font-weight: 400; }
.uc-top { display: flex; gap: 10px; align-items: center; }
.uc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 0; }
.uc-grid dt { font-size: 11px; color: var(--ink-3); } .uc-grid dd { margin: 2px 0 0; font-weight: 600; }
.uc-warn { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--neg); background: var(--neg-soft); padding: 6px 8px; border-radius: 6px; }
.uc-sent { display: flex; gap: 6px; align-items: center; margin-top: 10px; }

/* AI */
.ai { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.ai-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ai-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.ai-headline { font-size: 15.5px; line-height: 1.55; font-weight: 500; margin: 12px 0; }
.shimmer { color: transparent; background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 50%, var(--line-2) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 4px; }
@keyframes sh { to { background-position: -200% 0; } }
.ai-points { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.ai-points li { display: flex; gap: 8px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.ai-points .sent { padding-top: 6px; align-self: flex-start; }

.pulse { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.pulse header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.pulse ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pulse li { display: grid; grid-template-columns: 52px 1fr 24px; align-items: center; gap: 10px; font-size: 13px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.pulse li:hover { background: var(--hover); }
.pulse li i { height: 6px; border-radius: 3px; background: var(--mark); display: block; filter: saturate(1.6) brightness(.92); }
.pulse li .mono { text-align: right; color: var(--ink-3); }

.empty { display: grid; place-items: center; gap: 12px; padding: 48px 0; color: var(--ink-3); font-size: 13px; }
.empty-ring { width: 36px; height: 36px; border-radius: 50%; border: 2px dashed var(--line); }

/* Layout A — timeline */
.lay-timeline { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; height: 100%; padding: 0 24px; overflow: hidden; }
.tl-main { display: flex; flex-direction: column; min-height: 0; position: relative; max-width: 820px; width: 100%; justify-self: center; }
.tl-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; padding-bottom: 10px; }
.tl-list { display: flex; flex-direction: column; gap: 8px; overflow: auto; padding-bottom: 40px; min-height: 0; flex: 1; }
.tl-side { padding: 18px 0; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.newpill { position: absolute; top: 108px; left: 50%; transform: translateX(-50%); z-index: 5; display: inline-flex; gap: 6px; align-items: center; background: var(--accent); color: #fff; padding: 7px 14px; border-radius: 18px; font-size: 13px; font-weight: 500; box-shadow: 0 6px 18px oklch(0.58 0.17 35 / .35); animation: drop .3s ease-out; }
@keyframes drop { from { transform: translate(-50%, -10px); opacity: 0; } }

/* Layout B — columns */
.lay-columns { display: flex; flex-direction: column; height: 100%; padding: 0 20px; }
.cols { flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; }
.col { flex: 0 0 330px; display: flex; flex-direction: column; background: var(--line-2); border-radius: 12px; min-height: 0; }
.col-head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.col-top { display: flex; align-items: center; gap: 8px; }
.col-board { font-size: 12px; color: var(--ink-3); }
.col-head h3 { font-size: 14px; line-height: 1.45; margin: 8px 0; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; background: none; border: 0; padding: 0; text-align: left; width: 100%; color: inherit; font-weight: 600; }
.col-head h3:hover { text-decoration: underline; text-underline-offset: 3px; }
.col-stats { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.col-list { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.col-add { flex: 0 0 200px; border: 1.5px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); }
.col-add:hover { border-color: var(--ink-3); color: var(--ink); }
.col.focus { box-shadow: 0 0 0 2px var(--ink); }
.col-work { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.col-prog { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.col-prog i { display: block; height: 100%; background: var(--w-replied); transition: width .3s; }
.open-n { color: var(--w-todo); font-weight: 500; }

/* Layout C — split */
.lay-split { display: grid; grid-template-columns: 320px 1fr; height: 100%; }
.sp-list { border-right: 1px solid var(--line); overflow: auto; background: var(--panel); }
.sp-list-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; font-size: 13px; position: sticky; top: 0; background: var(--panel); border-bottom: 1px solid var(--line-2); z-index: 1; }
.sp-item { display: block; width: 100%; text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-2); position: relative; background: none; border: 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.sp-item:hover { background: var(--hover); }
.sp-item.on { background: var(--bg); }
.sp-item.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.sp-item-top { display: flex; align-items: center; gap: 8px; }
.sp-title { font-weight: 600; font-size: 13.5px; line-height: 1.45; margin: 6px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-latest { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-latest b { color: var(--ink-2); font-weight: 500; }
.sp-item-foot { display: flex; align-items: center; margin-top: 8px; }
.sp-detail { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sp-dhead { padding: 18px 24px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.sp-dmeta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sp-dhead h2 { font-size: 20px; margin: 10px 0 12px; line-height: 1.4; }
.sp-dactions { display: flex; align-items: center; gap: 12px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; font-size: 13px; }
.banner.err { background: var(--neg-soft); color: var(--neg); }
.banner .btn { margin-left: auto; }
.sp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 0 24px; overflow: hidden; }
.sp-feed { display: flex; flex-direction: column; min-height: 0; }
.sp-ai { padding: 16px 0; overflow: auto; }

/* Pages */
.page { height: 100%; overflow: auto; padding: 28px 32px 60px; max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; margin-bottom: 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tr { display: grid; grid-template-columns: 36px minmax(0, 2.6fr) 90px 100px 130px 110px 80px 110px; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.tr:last-child { border-bottom: 0; }
.tr.th { font-size: 12px; color: var(--ink-3); padding: 10px 16px; background: #FBFAF8; }
.tr.sel { background: var(--accent-soft); }
.tr input[type=checkbox] { accent-color: var(--ink); }
.tr-post { display: flex; gap: 12px; align-items: center; min-width: 0; }
.tr-post > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tr-post b { font-weight: 600; cursor: pointer; line-height: 1.4; }
.tr-post b:hover { text-decoration: underline; text-underline-offset: 3px; }
.tr-act { display: flex; justify-content: flex-end; }
.sel { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--panel); font-size: 12.5px; }
.bulkbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: var(--r); margin-bottom: 10px; font-size: 13px; }
.bulkbar .btn { color: #fff; border-color: #444; } .bulkbar .btn:hover { background: #333; } .bulkbar .lnk { color: #ccc; }
.table.exp .tr { grid-template-columns: minmax(0, 2fr) 120px 90px 90px 120px 80px; }
.tr-file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fmt { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 4px 5px; border-radius: 4px; background: oklch(0.6 0.13 155); color: #fff; }
.fmt.csv { background: var(--ink-2); }
.sched { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 14px; }

.settings .set-sec { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 24px 0; border-top: 1px solid var(--line); }
.set-l h3 { font-size: 15px; margin-bottom: 6px; }
.set-l p { line-height: 1.6; }
.set-r { padding: 4px 18px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.set-row:last-child { border-bottom: 0; }
.set-row.col { flex-direction: column; align-items: flex-start; }
.kw-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0; }
.kw { display: inline-flex; align-items: center; gap: 4px; background: var(--mark); padding: 4px 6px 4px 10px; border-radius: 6px; font-size: 13px; }
.kw button { opacity: .5; display: grid; place-items: center; width: 16px; height: 16px; } .kw button:hover { opacity: 1; }
.kw-in { border: 0; outline: 0; padding: 4px 6px; min-width: 140px; background: none; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(28,27,25,.35); display: grid; place-items: center; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 600px; max-height: 88vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.2); animation: pop .18s ease-out; }
.modal.sm { width: 500px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 17px; }
.modal-tabs { padding: 8px 20px 0; }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-body.center { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; gap: 4px; }
.fld-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.ta { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; resize: vertical; outline: 0; font-size: 12.5px; line-height: 1.7; background: #FBFAF8; }
.ta:focus { border-color: var(--ink-3); }
.detect { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 8px; }
.detect-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.detect-row:last-child { border-bottom: 0; }
.detect-row.bad .mono { color: var(--ink-3); text-decoration: line-through; }
.detect-row.pick { cursor: pointer; } .detect-row.pick:hover { background: var(--hover); }
.detect-row input { accent-color: var(--ink); }
.modal-opts { padding: 0 20px; border-top: 1px solid var(--line-2); }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.radio-list { display: grid; gap: 2px; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; }
.radio-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.radio-list label:hover { background: var(--hover); }
.radio-list .mono { margin-left: auto; }
.radio-list input { accent-color: var(--ink); }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.done-ring { width: 44px; height: 44px; border-radius: 50%; background: var(--pos); color: #fff; display: grid; place-items: center; margin-bottom: 10px; }

/* Notifications */
.notif-pop { position: absolute; top: 46px; right: 0; width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(30,25,20,.14); z-index: 40; animation: pop .15s; }
.notif-pop header, .notif-pop footer { display: flex; align-items: center; padding: 12px 16px; font-size: 13.5px; }
.notif-pop footer { border-top: 1px solid var(--line-2); }
.notif-pop ul { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.notif-pop li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-top: 1px solid var(--line-2); cursor: pointer; font-size: 13px; line-height: 1.5; }
.notif-pop li:hover { background: var(--hover); }
.notif-pop li > div { flex: 1; }
.notif-pop li > div .muted { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.notif-pop li.unread p { font-weight: 500; }
.notif-pop li .unread-dot { margin-top: 6px; }
.ni { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--ink-2); }
.ni-keyword { background: var(--mark); color: var(--ink); }
.ni-surge { background: var(--accent-soft); color: var(--accent); }
.ni-error { background: var(--neg-soft); color: var(--neg); }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: drop2 .25s ease-out; }
@keyframes drop2 { from { transform: translateY(10px); opacity: 0; } }

/* 協作 */
.cmt.handled { background: #FCFBF9; }
.cmt.handled .cmt-text { color: var(--ink-2); }
.cmt.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.workrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.cmt.dense .workrow { margin-top: 8px; padding-top: 7px; }
.wpill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 500; border: 1px solid transparent; }
.wpill i, .wdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.wpill.w-todo { background: var(--accent-soft); color: var(--w-todo); } .w-todo i, .wdot.w-todo { background: var(--w-todo); }
.wpill.w-doing { background: oklch(0.95 0.03 250); color: var(--w-doing); } .w-doing i, .wdot.w-doing { background: var(--w-doing); }
.wpill.w-replied { background: var(--pos-soft); color: var(--w-replied); } .w-replied i, .wdot.w-replied { background: var(--w-replied); }
.wpill.w-skip { background: var(--line-2); color: var(--ink-3); } .w-skip i, .wdot.w-skip { background: var(--w-skip); }
.wpill:hover { border-color: currentColor; }
.assignee { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); height: 24px; padding: 0 6px 0 2px; border-radius: 12px; }
.assignee:hover { background: var(--hover); }
.assignee.lg { height: 32px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 16px; font-size: 13px; }
.mav { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 600; flex: none; }
.mav.empty { border: 1.5px dashed #CFCBC3; color: var(--ink-3); background: none; }
.notes-n { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.work-open { font-weight: 500; }
.dd-wrap { position: relative; display: inline-flex; }
.dd { position: fixed; z-index: 45; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px rgba(30,25,20,.14); padding: 4px; animation: pop .12s; }
.dd-label { font-size: 11px; color: var(--ink-3); padding: 6px 8px 4px; }
.dd-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 6px; font-size: 13px; text-align: left; }
.dd-item:hover { background: var(--hover); }
.dd-item svg { margin-left: auto; }
.dd-item > span:nth-child(2) { flex: 1; }

/* 抽屜 */
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 430px; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(30,25,20,.06); display: flex; flex-direction: column; z-index: 20; animation: slidein .2s ease-out; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }
.dr-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line-2); }
.dr-body { flex: 1; overflow: auto; padding: 16px 18px 40px; }
.dr-post { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin-bottom: 10px; }
.dr-cmt { background: var(--bg); border-radius: var(--r); padding: 14px; }
.dr-cmt .cmt-head b { font-size: 14px; }
.dr-sec { padding: 18px 0 0; margin-top: 18px; border-top: 1px solid var(--line-2); }
.dr-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.dr-row { display: flex; align-items: center; gap: 10px; }
.stepper { display: flex; gap: 4px; margin-bottom: 14px; }
.step { flex: 1; display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.step i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: var(--mono); font-size: 10.5px; background: var(--line-2); flex: none; }
.step.done { color: var(--ink); } .step.done i { background: var(--ink); color: #fff; }
.step.cur { border-color: var(--ink); font-weight: 500; }
.step.skip { flex: 0 0 auto; }
.step.skip.cur { background: var(--line-2); color: var(--ink-2); border-color: var(--ink-3); }
.step:hover { background: var(--hover); }
.ta.reply { font-family: var(--sans); font-size: 13.5px; background: var(--panel); }
.ta.reply.shimmer { color: transparent; }
.note-in { display: flex; align-items: center; gap: 8px; }
.note-in input { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; outline: 0; font-size: 13px; min-width: 0; }
.note-in input:focus { border-color: var(--ink-3); }
.activity { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 12px; }
.activity .note { display: flex; gap: 10px; }
.activity .note p { margin-top: 4px; background: oklch(0.97 0.03 95); padding: 8px 10px; border-radius: 4px 10px 10px 10px; font-size: 13px; line-height: 1.55; }
.activity .note b { font-size: 12.5px; }
.activity .log { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); padding-left: 8px; }
.activity .log b { color: var(--ink-2); font-weight: 500; }
.activity .log > span:nth-child(2) { flex: 1; }
.log-dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #CFCBC3; flex: none; margin-right: 8px; }

/* 處理看板 */
.queue { height: 100%; display: flex; flex-direction: column; padding: 24px 24px 0; }
.q-head { margin-bottom: 14px; }
.team-load { display: flex; gap: 6px; }
.tl-m { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); font-size: 12.5px; cursor: default; }
.q-filters { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; flex-wrap: wrap; }
.q-board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 12px; padding-bottom: 16px; overflow-x: auto; }
.q-col { background: var(--line-2); border-radius: 12px; display: flex; flex-direction: column; min-height: 0; transition: box-shadow .1s; }
.q-col.over { box-shadow: inset 0 0 0 2px var(--ink); }
.q-col > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 13.5px; }
.q-list { flex: 1; overflow: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.q-empty { border: 1.5px dashed var(--line); border-radius: 10px; padding: 28px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; }
.qcard:hover { border-color: #CFCBC3; }
.qcard.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.qc-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.qc-text { font-size: 13px; line-height: 1.6; margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qc-foot { display: flex; align-items: center; gap: 8px; }
.late { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--neg); font-weight: 500; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #DAD6CF; border-radius: 5px; border: 3px solid transparent; background-clip: padding-box; }
.layout-switch { margin-left: auto; }
