* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #222;
  background: #f5f6f8;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

a {
  color: #0b66d8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.sidebar {
  background: #111827;
  color: #fff;
  padding: 22px 18px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 24px;
}

.brand span {
  color: #aeb8c8;
  font-size: 13px;
  font-weight: 400;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a,
.logout button {
  display: block;
  width: 100%;
  color: #e5e7eb;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.sidebar nav a:hover,
.logout button:hover {
  background: #1f2937;
  text-decoration: none;
}

.logout {
  margin-top: 28px;
}

.content {
  min-width: 0;
  padding: 24px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
}

.page-head span,
.hint {
  color: #667085;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow-x: auto;
}

.home-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.metric,
.quick {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
}

.metric span {
  display: block;
  color: #667085;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 42px;
}

.quick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel.narrow {
  max-width: 820px;
}

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

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

.panel-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  text-align: left;
}

th {
  color: #475467;
  background: #f9fafb;
  font-weight: 600;
}

.mono {
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  word-break: break-all;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3538cd;
  white-space: nowrap;
}

.tag.ok {
  background: #ecfdf3;
  color: #027a48;
}

.tag.off {
  background: #fef3f2;
  color: #b42318;
}

.tag.warn {
  background: #fffaeb;
  color: #b54708;
}

.actions {
  min-width: 190px;
}

.actions form,
td form {
  display: inline-block;
  margin: 3px 4px 3px 0;
}

button,
.button {
  display: inline-block;
  border: 0;
  border-radius: 6px;
  background: #0b66d8;
  color: #fff;
  padding: 8px 13px;
  font: inherit;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: #0957ba;
  text-decoration: none;
}

.button.secondary {
  background: #344054;
}

.form {
  display: grid;
  gap: 10px;
}

.form label {
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}

textarea.code {
  font-family: Consolas, "Liberation Mono", monospace;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

.flash {
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #eff8ff;
  color: #175cd3;
}

.flash.success {
  background: #ecfdf3;
  color: #027a48;
}

.flash.error {
  background: #fef3f2;
  color: #b42318;
}

.flash.warn {
  background: #fffaeb;
  color: #b54708;
}

.settings {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 16px;
}

.settings dt {
  color: #667085;
  font-weight: 600;
}

.settings dd {
  margin: 0;
  font-family: Consolas, "Liberation Mono", monospace;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-card {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
  margin: 0;
  text-align: center;
}

.login-card p {
  margin: 6px 0 22px;
  text-align: center;
  color: #667085;
}

.login-card form {
  display: grid;
  gap: 10px;
}

.login-card button {
  margin-top: 8px;
  width: 100%;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}
