:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #fff;
  --text: #22292f;
  --muted: #65717c;
  --line: #e2e6e9;
  --accent: #235c49;
  --accent-bg: #eef5f1;
  --warning: #8c5b12;
  --danger: #a23131;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
h2 {
  font-size: 16px;
  font-weight: 650;
}
p {
  line-height: 1.7;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--muted);
  display: block;
  margin-bottom: 7px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  line-height: 1.3;
}
button:hover {
  filter: brightness(0.95);
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.text-button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 6px 7px;
}
input,
textarea {
  border: 1px solid #cfd6dc;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  padding: 9px;
  width: 100%;
}
input:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  margin: 0;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
main {
  display: grid;
  grid-template-columns: 305px minmax(0, 1fr);
  min-height: calc(100vh - 107px);
}
aside {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.content {
  padding: 24px 32px;
  min-width: 0;
}
nav {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
nav button {
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
nav button.active {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 650;
}
.summary {
  display: flex;
  gap: 28px;
  padding-bottom: 26px;
  flex-wrap: wrap;
}
.summary b {
  font-size: 25px;
  font-weight: 600;
  display: block;
  line-height: 1.5;
}
.summary span {
  font-size: 12px;
  color: var(--muted);
}
#tree {
  flex: 1;
  max-height: calc(100vh - 345px);
  overflow: auto;
  min-height: 240px;
}
details {
  margin: 9px 0;
}
summary {
  cursor: pointer;
  color: var(--text);
  line-height: 1.5;
  font-size: 13px;
}
.branch {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  margin-left: 4px;
}
.leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 3px;
  font-size: 12px;
  line-height: 1.5;
}
.leaf em {
  font-style: normal;
  color: var(--warning);
  font-size: 10px;
  margin-left: auto;
}
.selection-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.task {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 7px;
  margin-bottom: 13px;
}
.task-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}
.task-heading h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}
.badge {
  font-size: 11px;
  white-space: nowrap;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 4px;
}
.badge.warning {
  background: #fff4df;
  color: var(--warning);
}
.badge.error {
  background: #f9eeee;
  color: var(--danger);
}
progress {
  width: 100%;
  height: 6px;
  margin: 18px 0 10px;
  accent-color: var(--accent);
}
.metrics {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.metrics strong {
  color: var(--text);
  font-weight: 600;
}
.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}
.task-actions {
  display: flex;
  gap: 6px;
}
.reason {
  font-size: 12px;
  color: var(--warning);
  margin-top: 12px;
  line-height: 1.7;
}
.empty {
  padding: 55px 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #cfd6dc;
  border-radius: 6px;
  background: var(--surface);
  line-height: 1.8;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 12px;
  text-align: left;
}
th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.7;
}
th {
  font-weight: 600;
  color: var(--muted);
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 430px;
  width: 100%;
  padding: 38px;
  display: grid;
  gap: 21px;
}
.login h1 {
  font-size: 28px;
}
.login p {
  color: var(--muted);
  font-size: 13px;
}
.login #login-notice {
  color: var(--danger);
  background: #f9eeee;
  border: 1px solid #ecd0d0;
  border-radius: 5px;
  padding: 10px 12px;
}
dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: #17262f60;
}
dialog form {
  display: grid;
  gap: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
#notice {
  margin: 16px 32px 0;
  background: #fff4df;
  border: 1px solid #ead8b9;
  padding: 12px 16px;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 850px) {
  header {
    padding: 20px;
  }
  .content {
    padding: 20px;
  }
  main {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .header-actions #connection {
    display: none;
  }
  .metrics {
    gap: 10px;
  }
  .task-heading {
    align-items: flex-start;
  }
  .task-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 620px) {
  header {
    padding: 16px;
  }
  h1 {
    font-size: 20px;
  }
  .header-actions {
    gap: 4px;
  }
  main {
    display: block;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }
  #tree {
    max-height: 280px;
    min-height: 100px;
  }
  .content {
    padding: 18px;
  }
  nav {
    gap: 20px;
  }
  .summary {
    gap: 20px;
  }
  .summary b {
    font-size: 22px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .task {
    padding: 16px;
  }
  #notice {
    margin: 12px 18px 0;
  }
  dialog {
    padding: 22px;
  }
}
