* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f4f6f9; color: #1f2937;
}
header {
  background: #111827; color: #fff; padding: 14px 28px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
header h1 { font-size: 18px; font-weight: 600; }
nav { display: flex; gap: 8px; }
.tab {
  background: transparent; color: #9ca3af; border: 1px solid #374151;
  padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.tab.active { background: #2563eb; color: #fff; border-color: #2563eb; }
main { max-width: 1440px; margin: 24px auto; padding: 0 20px; }
.panel { display: none; }
.panel.active { display: block; }
h2 { font-size: 15px; margin: 24px 0 10px; color: #374151; }
.history-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 4px;
}
.history-head h2 { margin: 0; }
.sep { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0; }

.fetch-bar { display: flex; gap: 10px; }
.fetch-bar input {
  flex: 1; padding: 12px 14px; font-size: 14px;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
}
button {
  background: #2563eb; color: #fff; border: none; padding: 12px 24px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
button:disabled { background: #93c5fd; cursor: wait; }
button.secondary { background: #fff; color: #2563eb; border: 1px solid #2563eb; padding: 11px 22px; }
button.danger { background: #fff; color: #dc2626; border: 1px solid #dc2626; padding: 11px 22px; }
.btn-row { display: flex; gap: 10px; margin-top: 6px; }
label.checkbox { display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
label.checkbox input { margin-top: 3px; }
.status { margin: 10px 0; font-size: 13px; min-height: 18px; color: #6b7280; }
.status.ok { color: #059669; }
.status.error { color: #dc2626; }

.card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 20px; margin-top: 8px;
}
.hidden { display: none; }
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.badge {
  background: #dbeafe; color: #1d4ed8; font-weight: 600; font-size: 12px;
  padding: 3px 10px; border-radius: 999px;
}
.muted { color: #6b7280; }
.small { font-size: 12px; }
.caption-text {
  font-size: 13px; color: #374151; margin-bottom: 12px;
  white-space: pre-wrap; word-break: break-word;
  max-height: 90px; overflow-y: auto;
}

table { width: 100%; border-collapse: collapse; background: #fff; }
.metrics th, .metrics td {
  text-align: center; padding: 10px; border: 1px solid #e5e7eb; font-size: 15px;
}
.metrics th { background: #f9fafb; font-size: 13px; color: #6b7280; font-weight: 600; }
.metrics td { font-weight: 600; }

.table-wrap { overflow-x: auto; }
.history { margin-top: 4px; font-size: 12px; width: 100%; }
.history th, .history td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.history th { background: #f9fafb; color: #6b7280; font-weight: 600; }
.title-cell {
  max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.result-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.copy-btn {
  background: #eef2ff; color: #2563eb; border: 1px solid #c7d2fe;
  padding: 0 6px; border-radius: 4px; font-size: 11px; cursor: pointer;
  line-height: 18px;
}
.copy-btn:hover { background: #e0e7ff; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; font-size: 14px;
  border: 1px solid #d1d5db; border-radius: 8px;
}
details { margin-top: 14px; }
summary { cursor: pointer; font-size: 13px; color: #2563eb; }
pre {
  background: #0f172a; color: #a5f3fc; padding: 14px; border-radius: 8px;
  overflow: auto; max-height: 400px; font-size: 12px; margin-top: 8px;
}

#login-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff; border-radius: 12px; padding: 28px 32px;
  width: 340px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.login-card h2 { margin: 0 0 16px; font-size: 18px; }
.login-card input {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
  margin-bottom: 12px;
}
.login-card button { width: 100%; padding: 10px; font-size: 15px; }

#login-overlay.hidden { display: none; }
