/* 颜色沿用旧项目台：浅底墨字、黑底青柠当强调，状态各有自己的颜色。手机一列，宽屏两列 */
:root {
  --bg: #F5F5EF; --surface: #FFFFFF; --line: #E6E6DF; --ink: #111111; --ink2: #45453F; --ink3: #6F6F68;
  --accent: #111111; --on-accent: #FFFFFF; --accent-soft: #E8F9BE; --lime: #B2F417; --on-lime: #121410;
  --st-user: #A35A00; --st-user-bg: #FFF1DC; --st-ans: #0F6E62; --st-ans-bg: #DDF3EF;
  --st-doing: #1F5FAD; --st-doing-bg: #E5EEFA; --st-session: #6A35B8; --st-session-bg: #EFE7FA;
  --st-blocked: #B3261E; --st-blocked-bg: #FCE8E6; --st-todo: #4A4656; --st-todo-bg: #F1EEF2;
  --st-rel: #0B6E8A; --st-rel-bg: #DFF1F6; --st-done: #2B7A3D; --st-done-bg: #E5F4E8;
  --bar-bg: #ECECE5;
  --f-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --f-num: "DM Serif Display", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15121A; --surface: #1F1B25; --line: #342D3C; --ink: #F3EFF6; --ink2: #CFC7D8; --ink3: #A39BAE;
  --accent: #B2F417; --on-accent: #1A0F17; --accent-soft: #2B3612;
  --st-user: #F4B868; --st-user-bg: #3A2A14; --st-doing: #8DB8F0; --st-doing-bg: #172840;
  --st-session: #C3A3F2; --st-session-bg: #2A1E3E; --st-blocked: #F29A92; --st-blocked-bg: #3D1B19;
  --st-ans: #7FD6C8; --st-ans-bg: #15312D; --st-rel: #7CCBE3; --st-rel-bg: #123039;
  --st-todo: #CFC7D8; --st-todo-bg: #2A2531; --st-done: #8BD49B; --st-done-bg: #18301E; --bar-bg: #2C2733;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #15121A; --surface: #1F1B25; --line: #342D3C; --ink: #F3EFF6; --ink2: #CFC7D8; --ink3: #A39BAE;
  --accent: #B2F417; --on-accent: #1A0F17; --accent-soft: #2B3612;
  --st-user: #F4B868; --st-user-bg: #3A2A14; --st-doing: #8DB8F0; --st-doing-bg: #172840;
  --st-session: #C3A3F2; --st-session-bg: #2A1E3E; --st-blocked: #F29A92; --st-blocked-bg: #3D1B19;
  --st-ans: #7FD6C8; --st-ans-bg: #15312D; --st-rel: #7CCBE3; --st-rel-bg: #123039;
  --st-todo: #CFC7D8; --st-todo-bg: #2A2531; --st-done: #8BD49B; --st-done-bg: #18301E; --bar-bg: #2C2733;
  color-scheme: dark }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--f-body); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
.wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.brand small { display: block; font-size: 11.5px; letter-spacing: .12em; color: var(--ink3); }
h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: .02em; }
.me { font-size: 12.5px; color: var(--ink3); text-align: right; }
.me button { border: 0; background: none; color: var(--ink3); text-decoration: underline; cursor: pointer; padding: 4px; min-height: 32px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding-block: 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 40px; white-space: nowrap; }
.tab .c { font-family: var(--f-mono); font-size: 12px; margin-left: 5px; color: var(--ink3); font-weight: 500; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab[aria-selected="true"] .c { color: var(--bg); opacity: .7; }
.tab .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--st-blocked); margin-left: 6px; vertical-align: middle; }

.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.hi { box-shadow: inset 0 0 0 1.5px var(--accent); }
.card.alert { border-color: var(--st-blocked); box-shadow: inset 0 0 0 1px var(--st-blocked); }
.card h3 { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.card h3 button { all: unset; cursor: pointer; }
.card h3 button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sum { margin: 0; color: var(--ink2); font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.sec h2 { margin: 6px 0 0; font-size: 17px; font-weight: 900; display: flex; gap: 8px; align-items: baseline; }
.sec h2 .n { font: 400 18px var(--f-num); color: var(--ink3); }

.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--st-todo-bg); color: var(--st-todo); white-space: nowrap; }
.tag.tid { font-family: var(--f-mono); font-weight: 500; font-size: 12.5px; background: var(--ink); color: var(--bg); }
.tag.ln { background: transparent; border: 1px solid var(--line); color: var(--ink2); }
.tag.rec { background: var(--accent-soft); color: var(--accent); }
.tag.design { background: var(--st-session-bg); color: var(--st-session); }
.st-waiting_user { background: var(--st-user-bg) !important; color: var(--st-user) !important; }
.st-waiting_pickup, .st-answered { background: var(--st-ans-bg) !important; color: var(--st-ans) !important; }
.st-doing { background: var(--st-doing-bg) !important; color: var(--st-doing) !important; }
.st-testing, .st-waiting_session { background: var(--st-session-bg) !important; color: var(--st-session) !important; }
.st-to_release { background: var(--st-rel-bg) !important; color: var(--st-rel) !important; }
.st-blocked { background: var(--st-blocked-bg) !important; color: var(--st-blocked) !important; }
.st-done, .st-approved { background: var(--st-done-bg) !important; color: var(--st-done) !important; }
.who { font-size: 12.5px; color: var(--ink3); overflow-wrap: anywhere; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 700; font-size: 14px; min-height: 44px; }
.btn:hover { border-color: var(--ink3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink2); }
.btn.danger { color: var(--st-blocked); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn:focus-visible, .tab:focus-visible, .opt:focus-within, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row .grow { flex: 1 1 auto; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }

.dec { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.dec .q { margin: 0; font-weight: 700; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.opts { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.opt { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; min-height: 44px; }
.opt input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.opt .t { font-weight: 700; font-size: 14.5px; }
.opt .d { display: block; font-size: 13px; color: var(--ink2); }
.opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
textarea, input[type=search], input[type=text] { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 12px; font-size: 15px; }
textarea { min-height: 72px; resize: vertical; }
.note { font-size: 13px; color: var(--ink3); }
.err { font-size: 13px; color: var(--st-blocked); }

.reply { border-left: 3px solid var(--st-ans); background: var(--st-ans-bg); border-radius: 0 10px 10px 0; padding: 8px 12px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.reply b { display: block; font-size: 12px; color: var(--st-ans); }
.gate { font-size: 13.5px; color: var(--ink2); display: grid; gap: 2px; }
.gate b { color: var(--ink); }

/* 在做的：一个方向一块，一行一张票 */
.lane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 0; }
.lane > header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 14px 6px; }
.lane > header b { font-size: 15.5px; }
.lane > header .ck { font-size: 13px; color: var(--ink2); flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 9px 14px; border-top: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; width: 100%; }
.item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.item .t { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item .who { grid-column: 2; }
.item .tag { align-self: center; }

/* 机器 */
.mstrip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mstrip::-webkit-scrollbar { display: none; }
.mchip { flex: none; display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; min-height: 36px; }
.mchip .d { width: 8px; height: 8px; border-radius: 50%; background: var(--st-done); }
.mchip.alert { border-color: var(--st-blocked); color: var(--st-blocked); }
.mchip.alert .d { background: var(--st-blocked); }
.mchip .v { font-family: var(--f-mono); font-size: 12px; color: var(--ink3); }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 2.6em 1fr 3em; gap: 8px; align-items: center; font-size: 13px; }
.bar .tr { display: block; height: 8px; border-radius: 99px; background: var(--bar-bg); overflow: hidden; }
.bar .fl { display: block; height: 100%; border-radius: 99px; background: var(--st-doing); }
.bar.hot .fl { background: var(--st-blocked); }
.bar .v { font-family: var(--f-mono); font-size: 12.5px; text-align: right; }
svg.spark { width: 100%; height: 44px; display: block; }
svg.spark .cpu { stroke: var(--st-doing); }
svg.spark .mem { stroke: var(--st-session); }
svg.spark path { fill: none; stroke-width: 1.6; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink3); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* 谁在干什么 */
.acct { border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 6px; }
.sess { display: grid; grid-template-columns: 12px 1fr; gap: 0 8px; font-size: 14px; }
.sess .on { width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-top: 8px; }
.sess .on.y { background: var(--st-done); }
.sess .x { font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; cursor: pointer; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.empty { border: 1px dashed var(--line); border-radius: var(--r); padding: 28px 20px; text-align: center; color: var(--ink2); }
.empty b { display: block; color: var(--ink); font-size: 16px; }
.banner { border-radius: 10px; padding: 8px 12px; font-size: 13.5px; background: var(--st-user-bg); color: var(--st-user); }

.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(12, 9, 16, .45); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; overscroll-behavior: contain;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.sheet[hidden] { display: none; }
.sheetbox { width: 100%; max-width: 760px; background: var(--bg); border-radius: 18px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-bottom: 40px; }
.sheettop { display: flex; gap: 10px; align-items: flex-start; }
.sheettop .meta { flex: 1; }
.sheetbox h2 { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.4; overflow-wrap: anywhere; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.k { font-size: 12px; font-weight: 900; letter-spacing: .08em; color: var(--ink3); }
.cm { display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.cm .av { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; }
.cm.me .av { background: var(--st-ans-bg); color: var(--st-ans); }
.cm .bd { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 7px 11px; min-width: 0; }
.cm .hd { font-size: 12px; color: var(--ink3); }
.cm .hd b { color: var(--ink); }
.cm .tx { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.hist { font-family: var(--f-mono); font-size: 12px; color: var(--ink2); display: grid; gap: 2px; overflow-wrap: anywhere; }
pre.detail { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; color: var(--ink2); }

.login { max-width: 420px; margin: 12vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.login .logo { width: 72px; height: 72px; border-radius: 20px; background: #111; color: var(--lime); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 900; }
@media (prefers-reduced-motion: no-preference) { .card, .item { transition: border-color .15s, background .15s; } }
