:root {
  color: #142536;
  background: #f0f3f4;
  font: 16px/1.55 "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --muted: #536478;
  --line: #d9e2e6;
  --primary: #086151;
  --primary-dark: #064a3f;
  --paper: #fff;
  --rail: #142735;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #168b79; outline-offset: 3px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 41px;
  padding: .5rem .9rem;
  border: 1px solid #c6d2d9;
  border-radius: 8px;
  color: #24384b;
  background: #fff;
  font-weight: 650;
  font-size: .875rem;
  line-height: 1.4;
  text-decoration: none;
}
.button:hover { background: #f1f5f5; }
.button.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.button.primary:hover { background: var(--primary-dark); }
.button.full { width: 100%; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 760; font-size: 1.04rem; }
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
  align-items: end;
  justify-content: center;
  padding-bottom: 9px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #0b6657;
}
.brand-mark i { display: block; height: 13px; border-radius: 2px; background: #defbf0; }
.brand-mark i:first-child { height: 7px; }
.brand-mark i:last-child { height: 17px; }
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 20% 10%, #274858 0, #172c3a 48%, #10212e 100%);
}
.login-card {
  width: min(100%, 430px);
  padding: clamp(25px, 6vw, 44px);
  border: 1px solid #dbe4e7;
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 20px 60px #081b2659;
}
.login h1 { margin: 24px 0 18px; font-size: 1.9rem; letter-spacing: -.04em; line-height: 1.3; }
.login form, .dialog-form { display: grid; gap: 15px; }
.login-invite { margin-bottom: 14px; padding: .55rem .65rem; border-radius: 7px; color: #075847; background: #e4f3ee; font-size: .84rem; }
label { display: grid; gap: 5px; color: #314559; font-size: .875rem; font-weight: 650; }
input, textarea, select {
  width: 100%;
  min-height: 43px;
  padding: .55rem .7rem;
  color: #182b3c;
  border: 1px solid #becdd4;
  border-radius: 8px;
  background: #fff;
  font-weight: 450;
}
textarea { resize: vertical; }
.form-error { color: #992f28; font-size: .875rem; overflow-wrap: anywhere; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 237px minmax(0, 1fr); }
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-height: 100vh;
  padding: 26px 17px 20px;
  color: #f5fbff;
  background: var(--rail);
}
.sidebar .brand { padding-inline: 9px; }
.sidebar-label { color: #b5c8d3; font-size: .75rem; font-weight: 650; }
.sidebar-body > .sidebar-label { padding-inline: 10px; margin-bottom: 8px; }
.team { padding: 0; margin: 0; list-style: none; display: grid; gap: 4px; }
.team li {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #ebf5fa;
  font-size: .88rem;
  font-weight: 650;
}
.team li[aria-current="true"] { border-color: #3e655e; background: #233f45; }
.team small { display: block; color: #b5c8d3; font-size: .74rem; font-weight: 450; }
.team-dot { margin-top: .47rem; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #8fabbc; }
[data-role="codex"] .team-dot { background: #69d1aa; }
[data-role="accio"] .team-dot { background: #f1bc75; }
[data-role="deepseek"] .team-dot { background: #96b6fa; }
.account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 4px 0 8px;
  margin-top: auto;
  border-top: 1px solid #375060;
}
.account span, .account strong { display: block; }
.account strong { font-size: .9rem; }
.sidebar-button { color: #f2f8fb; border-color: #54707e; background: transparent; min-height: 40px; }
.sidebar-button:hover { background: #2c4657; }
.board { width: min(100%, 1260px); padding: clamp(25px, 4.1vw, 63px); }
.board-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 29px; }
.board h1 { font-size: clamp(1.8rem, 3.4vw, 2.65rem); line-height: 1.16; letter-spacing: -.05em; }
.board-header p { color: var(--muted); margin-top: 8px; font-size: .91rem; }
.toolbar, .dialog-actions, .task-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tasks, .devices, .identity { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.devices, .identity { margin-bottom: 17px; }
.device-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 23px 12px; }
.device-heading h2 { font-size: 1.1rem; }
.device-heading p { margin-top: 2px; color: var(--muted); font-size: .81rem; }
.device-heading .button { flex-shrink: 0; }
.identity .device-heading { padding-bottom: 16px; }
.identity .board-error { margin: 0 23px 14px; }
.identity-device { margin: -6px 23px 15px; color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.device-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; padding: 0 17px 16px; }
.device-list .message-card { grid-column: 1 / -1; padding: 12px; }
.device { display: grid; align-content: start; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.device-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.device-role { font-size: .95rem; }
.device-name, .device-browser, .device-id, .device-seen { margin-top: 3px; color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.device-name { margin-top: 5px; color: #314559; font-weight: 600; font-size: .84rem; }
.device-code { justify-self: start; margin-top: 10px; min-height: 34px; padding: .3rem .62rem; font-size: .8rem; }
.task-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 21px 23px 14px; }
.task-heading h2 { font-size: 1.1rem; }
#task-count { color: var(--muted); font-size: .8rem; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 23px 15px; border-bottom: 1px solid var(--line); }
.filters button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 4px 11px;
  background: #f1f4f6;
  color: #43576b;
  white-space: nowrap;
  font-weight: 620;
  font-size: .82rem;
}
.filters button:hover { border-color: #a2b8b7; }
.filters [aria-pressed="true"] { background: #e4f3ee; color: #075847; border-color: #a2cdbf; }
.board-error { margin: 14px 23px 0; padding: 9px 12px; background: #fff1ed; border-radius: 7px; }
.task-list { display: grid; gap: 12px; padding: 17px; background: #f8fafb; min-height: 206px; }
.message-card { display: grid; place-content: center; gap: 5px; text-align: center; padding: 30px 12px; }
.message-card h3 { font-size: 1rem; }
.message-card p { color: var(--muted); font-size: .86rem; }
.task { min-width: 0; padding: 16px 18px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-title-wrap { min-width: 0; }
.task-title { overflow-wrap: anywhere; font-size: 1.05rem; }
.task-meta { overflow-wrap: anywhere; color: var(--muted); font-size: .76rem; margin-top: 3px; }
.status { flex-shrink: 0; padding: 3px 8px; border-radius: 6px; font-size: .75rem; line-height: 1.55; font-weight: 700; }
.status[data-status="pending"] { color: #455f75; background: #e9f0f6; }
.status[data-status="running"] { color: #20528a; background: #e5f0ff; }
.status[data-status="review"] { color: #765000; background: #fff1d0; }
.status[data-status="returned"] { color: #8d352b; background: #ffeae4; }
.status[data-status="done"] { color: #175b45; background: #def3eb; }
.status[data-status="online"] { color: #175b45; background: #def3eb; }
.status[data-status="offline"] { color: #765000; background: #fff1d0; }
.status[data-status="unpaired"] { color: #455f75; background: #e9f0f6; }
.task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 22px; margin: 14px 0; }
.task-fields dt { color: var(--muted); font-size: .77rem; font-weight: 650; }
.task-fields dd { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; }
.task-fields .device-audit { font-size: .78rem; }
.worker-note { margin-bottom: 10px; padding: 7px 9px; border-radius: 6px; color: #43576b; background: #f1f5f6; font-size: .8rem; }
.task-actions .button { min-height: 37px; padding: .38rem .7rem; font-size: .82rem; }
.task-error { margin-top: 9px; }
.notice {
  position: fixed;
  right: 20px;
  bottom: 18px;
  max-width: calc(100vw - 40px);
  border-radius: 8px;
  padding: 8px 13px;
  color: #fff;
  background: #173a37;
  box-shadow: 0 4px 12px #112d2a35;
  font-size: .875rem;
  z-index: 1;
}
.notice:empty { display: none; }
dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 15px;
  color: inherit;
  box-shadow: 0 18px 54px #10253242;
}
dialog::backdrop { background: #102532a6; }
.dialog-form h2 { font-size: 1.28rem; }
.dialog-actions { justify-content: flex-end; }
.action-task-title { color: var(--muted); font-size: .87rem; overflow-wrap: anywhere; }
.history-events { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.history-event { padding: 0 0 0 11px; border-left: 2px solid #a2cdbf; min-width: 0; }
.history-event h3 { font-size: .9rem; }
.history-meta { margin-top: 1px; color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.history-content { margin-top: 5px; font-size: .86rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.pair-code, .pair-invite { background: #f2f6f5; color: var(--primary-dark); font-family: ui-monospace, Consolas, monospace; }
.pair-code { font-weight: 700; }
.pair-feedback { color: var(--muted); font-size: .84rem; }
.pair-feedback:empty { display: none; }
.clipboard-helper { position: fixed; inset: auto auto 0 -9999px; opacity: 0; width: 1px; height: 1px; }
@media (max-width: 770px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; min-height: auto; padding: 12px 16px; }
  .sidebar .brand { padding-inline: 0; }
  .sidebar-body { display: none; }
  .account { border-top: 0; margin-top: 0; padding: 0; }
  .sidebar-button { min-height: 37px; }
  .board { padding: 23px 14px; }
  .board-header { margin-bottom: 18px; align-items: start; }
  .toolbar { justify-content: flex-end; flex-shrink: 0; }
}
@media (max-width: 480px) {
  .board-header { flex-direction: column; }
  .task-fields { grid-template-columns: 1fr; }
  .task-heading { padding: 15px 12px 10px; }
  .device-heading { padding: 14px 12px 10px; }
  .identity .device-heading { align-items: flex-start; flex-direction: column; }
  .identity .board-error { margin-inline: 12px; }
  .identity-device { margin-inline: 12px; }
  .device-list { grid-template-columns: 1fr; padding: 0 9px 9px; }
  .filters { padding-inline: 12px; }
  .filters button { padding-inline: 8px; }
  .task-list { padding: 9px; }
  .task { padding: 12px; }
}
