:root {
  color-scheme: dark;
  --bg: #0b151b;
  --sidebar: #101d25;
  --card: #14242d;
  --line: #2b424f;
  --text: #dbe8ec;
  --muted: #8fb3c4;
  --accent: #45dcc0;
  --field: #0d1b23;
  --danger: #ffa1a1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    14px/1.65 Inter,
    system-ui,
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #192831;
  color: var(--text);
  padding: 10px 16px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover {
  background: #223b46;
  border-color: #426472;
}
button.primary {
  background: var(--accent);
  color: #082a27;
  border-color: var(--accent);
  font-weight: 650;
}
button.primary:hover {
  background: #67e7cf;
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
button.danger {
  color: var(--danger);
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #45dcc030;
  border-color: var(--accent);
}
input[type="checkbox"] {
  display: inline-block;
  width: auto;
}
input[type="file"] {
  font-size: 12px;
}
textarea {
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #658392;
}
label {
  display: block;
  color: #b9d0d9;
  font-size: 13px;
  margin: 18px 0 8px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
  line-height: 1.3;
  margin: 12px 0 0;
}
h2 {
  font-size: 18px;
  margin: 0 0 12px;
  font-weight: 650;
}
h3 {
  font-size: 17px;
  margin: 14px 0 4px;
}
p {
  margin: 8px 0;
  color: var(--muted);
}
a {
  color: var(--accent);
  text-decoration: none;
}
code,
pre,
.endpoint {
  font-family: ui-monospace, Consolas, monospace;
}
code {
  font-size: 12px;
  overflow-wrap: anywhere;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  color: var(--muted);
  background: var(--field);
  padding: 16px;
  border-radius: 8px;
  max-height: 320px;
  overflow: auto;
}
[hidden] {
  display: none !important;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 34px 22px 24px;
  display: flex;
  flex-direction: column;
}
.brand {
  color: #49e7d1;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.brand-mark {
  margin-right: 3px;
}
.brand-caption {
  font-size: 10px;
  letter-spacing: 2px;
  color: #4ad9d5;
  margin: 8px 0 24px;
}
.sidebar nav {
  display: grid;
  gap: 10px;
}
.nav {
  width: 100%;
  padding: 14px;
  text-align: left;
  background: transparent;
  border-color: transparent;
  font-weight: 500;
}
.nav span {
  display: inline-block;
  width: 18px;
  color: #91d2df;
}
.nav.active {
  color: #69ead0;
  background: #1c3939;
  border-color: #285e56;
}
.nav.active span {
  color: #69ead0;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 32px;
  font-size: 11px;
  color: var(--muted);
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
}
.sidebar-footer p {
  font-size: 11px;
  margin: 8px 0 20px;
}
.logout {
  width: 100%;
  font-size: 12px;
}
main {
  min-width: 0;
  padding: 44px 42px 60px;
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
}
.eyebrow {
  font-size: 10px;
  color: #52dbd7;
  letter-spacing: 2px;
}
.refresh {
  font-size: 13px;
  white-space: nowrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.metric {
  border: 1px solid var(--line);
  background: linear-gradient(115deg, #192e37, #12212a);
  padding: 23px 24px;
  border-radius: 12px;
  min-height: 128px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.metric strong {
  display: block;
  font-size: 36px;
  line-height: 1.3;
  margin-top: 14px;
  font-weight: 650;
}
.metric strong.metric-label {
  font-size: 24px;
  margin-top: 20px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
}
.section-heading p {
  font-size: 13px;
  margin: 8px 0 0;
}
.section-heading h2 {
  margin: 0;
}
.section-heading select {
  width: auto;
  max-width: 250px;
}
.pill {
  display: inline-block;
  font-size: 11px;
  color: #65e6c9;
  background: #1d433d;
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}
.pill.muted {
  color: var(--muted);
  background: #22353e;
}
.pill.bad {
  color: var(--danger);
  background: #402b31;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  min-width: 0;
  margin-bottom: 20px;
}
.card-grid .card {
  margin-bottom: 0;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-heading h2 {
  margin: 0;
}
.card-heading button {
  font-size: 12px;
  white-space: nowrap;
}
.site-card {
  display: flex;
  flex-direction: column;
  min-height: 235px;
}
.site-card .site-id {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.site-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: auto;
  gap: 10px;
}
.card-footer span {
  font-size: 12px;
  color: var(--muted);
}
.card-footer button {
  font-size: 12px;
}
.empty-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 54px 24px;
  text-align: center;
}
.empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  border: 1px solid #2c5757;
  border-radius: 14px;
  color: var(--accent);
  background: #173532;
  font-size: 26px;
}
.empty-card h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.empty-card p {
  font-size: 13px;
}
.empty-card button {
  margin-top: 22px;
}
.empty-line {
  text-align: center;
  padding: 35px 14px;
  color: var(--muted);
  font-size: 13px;
}
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.field-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.field-grid .full {
  grid-column: 1/-1;
}
.form-footer,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}
.small {
  font-size: 12px;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toolbar button {
  white-space: nowrap;
}
.table-card {
  padding: 0;
}
.table-scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th,
td {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
th {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
}
td button {
  padding: 6px 10px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}
.task-list .card {
  padding: 22px 24px;
}
.task-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.task-prompt {
  margin: 14px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.task-actions button,
.task-actions a {
  font-size: 12px;
}
.log-card {
  margin-top: 22px;
}
summary {
  cursor: pointer;
  color: var(--muted);
}
.endpoint {
  font-size: 19px;
  color: var(--accent);
  overflow-wrap: anywhere;
  margin: 10px 0;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 15px 0;
  font-size: 12px;
}
.detail-row span {
  color: var(--muted);
}
.wide {
  width: 100%;
  margin-top: 18px;
}
.key-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.key-row:last-child {
  border-bottom: 0;
}
.key-row button {
  font-size: 12px;
  padding: 7px 12px;
}
.key-row p {
  font-size: 11px;
  margin: 4px 0 0;
}
.asset-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 14px;
  padding: 12px 0;
  font-size: 12px;
}
.asset-row span {
  overflow-wrap: anywhere;
}
.asset-row button {
  padding: 4px 9px;
}
.notice {
  padding: 12px 16px;
  border: 1px solid #285e56;
  border-radius: 8px;
  background: #16342f;
  color: var(--accent);
  margin: -18px 0 22px;
  overflow-wrap: anywhere;
}
.notice.bad {
  background: #342127;
  border-color: #67414a;
  color: var(--danger);
}
.bad {
  color: var(--danger);
}
dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  overflow: auto;
  background: var(--card);
  color: var(--text);
  border: 1px solid #3b5663;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 24px 90px #0008;
}
dialog::backdrop {
  background: #050d13b8;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.dialog-heading h2 {
  margin: 4px 0;
}
.dialog-heading > button {
  padding: 4px 11px;
  font-size: 20px;
}
.dialog-actions {
  justify-content: flex-end;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 0, #17342f55, transparent 65%), var(--bg);
}
.login-wrap {
  width: min(440px, calc(100% - 40px));
  padding: 50px 0;
}
.login-brand {
  margin-bottom: 30px;
  text-align: center;
}
.login-brand .brand-caption {
  margin-bottom: 0;
}
.login-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.login-card h1 {
  font-size: 26px;
  margin: 0 0 8px;
}
.login-card .primary {
  width: 100%;
  margin-top: 20px;
}
.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
  color: var(--muted);
}
@media (min-width: 1600px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1100px;
  }
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .sidebar {
    padding: 28px 16px;
  }
  main {
    padding: 34px 24px;
  }
  .two-column {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 12px;
  }
  .metric {
    padding: 20px 16px;
  }
  .metric strong.metric-label {
    font-size: 20px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand-caption {
    margin-bottom: 14px;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }
  .nav {
    width: auto;
    white-space: nowrap;
    padding: 9px 12px;
    font-size: 12px;
  }
  .sidebar-footer {
    margin-top: 14px;
    padding-top: 12px;
  }
  main {
    padding: 28px 20px;
  }
  .page-header {
    margin-bottom: 26px;
  }
  h1 {
    font-size: 26px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .metric:last-child {
    grid-column: 1/-1;
    min-height: 90px;
  }
  .metric {
    min-height: 110px;
    padding: 18px;
  }
  .metric strong {
    font-size: 30px;
  }
  .metric strong.metric-label {
    margin-top: 10px;
  }
  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .toolbar {
    width: 100%;
  }
  .toolbar select {
    max-width: none;
    flex: 1;
  }
  .card {
    padding: 20px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .detail-row {
    flex-wrap: wrap;
  }
  .empty-card {
    padding: 40px 18px;
  }
  .task-top,
  .task-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .table-card {
    padding: 0;
  }
  th,
  td {
    padding: 14px;
  }
  .refresh {
    padding: 9px 12px;
  }
}
