* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: #f4f6f8;
  color: #17202a;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #17202a;
  color: #fff;
  padding: 22px 16px;
}

.brand {
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 16px;
}

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

.brand p {
  margin: 6px 0 0;
  color: #b8c2cc;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  height: 42px;
  text-align: left;
  background: transparent;
  color: #d9e0e7;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background: #1f6feb;
  color: #fff;
}

main {
  min-width: 0;
  padding: 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h2, h3, p {
  margin-top: 0;
}

header h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

header p {
  margin-bottom: 0;
  color: #526373;
}

.page {
  display: none;
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 16px;
}

.page.active {
  display: block;
}

.row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h3 {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
}

.form-grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.info-panel {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  background: #f8fafc;
  color: #405160;
  font-size: 13px;
}

label {
  display: grid;
  gap: 4px;
  color: #405160;
  font-size: 13px;
}

label.full-row {
  grid-column: 1 / -1;
}

input, select, textarea {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #b8c2cc;
  border-radius: 6px;
  min-width: 180px;
  background: #fff;
  color: #17202a;
}

textarea {
  min-height: 260px;
  padding: 10px;
  font-family: Consolas, "Courier New", monospace;
  resize: vertical;
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

label.check input {
  min-width: auto;
  width: 16px;
  height: 16px;
  padding: 0;
}

button {
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: #1f6feb;
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

button.secondary {
  background: #526373;
}

button.danger {
  background: #c2410c;
}

button.small {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.actions {
  white-space: nowrap;
}

.actions button {
  margin: 0 4px 4px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

th, td {
  border: 1px solid #d9e0e7;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef3f8;
}

pre {
  background: #111827;
  color: #d1fae5;
  padding: 12px;
  border-radius: 6px;
  overflow: auto;
  min-height: 90px;
}

.health-result {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.health-group {
  border: 1px solid #d9e0e7;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.health-group h4 {
  margin: 0 0 8px;
}

.health-group ul {
  margin: 0;
  padding-left: 18px;
}

@media (max-width: 860px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
  }

  nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  main {
    padding: 16px;
  }

  header {
    align-items: stretch;
    flex-direction: column;
  }
}
