:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9dee5;
  --text: #1f2933;
  --muted: #667085;
  --brand: #1f6feb;
  --danger: #c92a2a;
  --ok: #137333;
  --warn: #a15c00;
  --nav: #17202a;
  --nav-active: #253545;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

button.primary {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

button.danger {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

button.text {
  border: 0;
  background: transparent;
  padding: 0 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-height: 34px;
  padding: 6px 10px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef1f5;
}

.login-box {
  width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-box p {
  margin: 0 0 24px;
  color: var(--muted);
}

.form-row {
  margin-bottom: 16px;
}

.sidebar {
  background: var(--nav);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  display: block;
  margin-top: 6px;
  color: #b7c0ca;
  font-size: 12px;
}

.nav {
  padding: 12px;
}

.nav button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d8dee6;
  text-align: left;
  height: 40px;
  margin-bottom: 4px;
}

.nav button.active {
  color: #fff;
  background: var(--nav-active);
}

.main {
  min-width: 0;
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar h2 {
  margin: 0;
  font-size: 18px;
}

.content {
  padding: 20px 24px 32px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  width: 220px;
}

.job-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.job-status i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
}

.job-status.ok i {
  background: var(--ok);
}

.job-status.danger {
  color: var(--danger);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: #344054;
  background: #f8fafc;
  font-weight: 600;
}

.table .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  background: #e9edf2;
  color: #344054;
}

.badge.ok {
  color: var(--ok);
  background: #e8f5e9;
}

.badge.warn {
  color: var(--warn);
  background: #fff4e5;
}

.badge.danger {
  color: var(--danger);
  background: #fdecec;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-title {
  margin: 8px 0 14px;
  font-size: 16px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 20, 30, 0.42);
  z-index: 20;
}

.modal {
  width: 620px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.modal header,
.modal footer {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal h3 {
  margin: 0;
  font-size: 18px;
}

.modal .body {
  padding: 18px;
}

.copy-box {
  display: flex;
  gap: 8px;
}

.copy-box input {
  flex: 1;
}

.toast {
  position: fixed;
  right: 22px;
  top: 22px;
  max-width: 420px;
  padding: 12px 14px;
  background: #17202a;
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 30;
}

.muted {
  color: var(--muted);
}

.danger-text {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    font-size: 13px;
  }

  button {
    min-height: 36px;
    height: auto;
    padding: 7px 10px;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: block;
  }

  .brand {
    padding: 12px 14px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span {
    margin-top: 3px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 10px 10px;
    -webkit-overflow-scrolling: touch;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto;
    height: 34px;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .topbar {
    height: auto;
    min-height: 52px;
    padding: 10px 14px;
    gap: 10px;
  }

  .topbar h2 {
    font-size: 16px;
  }

  .content {
    padding: 12px;
  }

  .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
    min-width: 0;
    flex: 1 1 150px;
  }

  .job-status {
    width: 100%;
    align-items: flex-start;
    line-height: 1.45;
    padding: 8px 10px;
  }

  .panel {
    padding: 10px;
    border-radius: 6px;
  }

  .table {
    min-width: 980px;
  }

  .table th,
  .table td {
    padding: 8px 6px;
  }

  .pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .grid,
  .grid.three {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-mask {
    align-items: end;
    place-items: end center;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
  }

  .modal header,
  .modal footer,
  .modal .body {
    padding: 14px;
  }

  .modal footer {
    flex-wrap: wrap;
  }

  .modal footer button {
    flex: 1 1 120px;
  }

  .copy-box {
    flex-direction: column;
  }

  .toast {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .login-wrap {
    padding: 14px;
  }

  .login-box {
    width: 100%;
    padding: 22px;
  }

  .toolbar button {
    flex: 1 1 auto;
  }

  .table .actions {
    max-width: 260px;
  }
}
