:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-card {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
  font-size: 24px;
}

.login-error {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 14px;
}

.login-button {
  width: 100%;
}

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

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid #e4e8f0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  font-weight: 700;
  color: #172033;
}

nav {
  display: flex;
  gap: 18px;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px;
}

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

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

h1 {
  margin-bottom: 6px;
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
  margin-top: 18px;
}

p, .muted {
  color: #5f6b7d;
}

.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 18px;
}

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

.notice {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.notice strong {
  display: block;
  margin-bottom: 6px;
}

.notice span, .hint {
  color: #5f6b7d;
}

.notice.inbound {
  border-color: #86efac;
  background: #f0fdf4;
}

.notice.outbound {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.endpoint-panel p {
  margin-bottom: 10px;
}

.endpoint-code {
  background: #f8fafc;
  color: #172033;
  border: 1px solid #cbd5e1;
  max-height: none;
}

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

.panel-title h2 {
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stats div, .detail-grid div, .result-card div {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px;
}

.stats span, .detail-grid span, .result-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 6px;
}

.stats strong, .detail-grid strong, .result-card strong {
  font-size: 22px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.grid.compact {
  gap: 12px;
}

.form-grid {
  align-items: start;
}

.interface-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.interface-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
}

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

textarea, pre, .mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

pre {
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 14px;
  color: #172033;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.button.primary {
  color: #fff;
  background: #0f5fbd;
  border-color: #0f5fbd;
}

.button.danger {
  color: #fff;
  background: #c2410c;
  border-color: #c2410c;
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 14px;
  flex-wrap: wrap;
}

.inline-form label {
  min-width: 280px;
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

.detail-table-wrap {
  max-height: 520px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.detail-table td {
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: #475569;
  background: #f8fafc;
}

td small {
  display: block;
  color: #64748b;
  margin-top: 3px;
}

.url {
  max-width: 340px;
  word-break: break-all;
}

.url-full {
  word-break: break-all;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
}

.error {
  max-width: 260px;
  color: #b91c1c;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill.ok, .ok {
  color: #15803d;
}

.pill.ok {
  background: #dcfce7;
}

.pill.bad, .bad {
  color: #b91c1c;
}

.pill.bad {
  background: #fee2e2;
}

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

.result-card.success div {
  border-color: #bbf7d0;
}

.result-card.failed div {
  border-color: #fecaca;
}

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

.empty {
  padding: 18px;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .topbar, .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two, .stats, .detail-grid, .result-card, .notice-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 16px;
  }
}
