* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2328; font-size: 14px; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 18% 0%, #d1fae5 0%, transparent 55%),
    radial-gradient(700px 480px at 100% 100%, #e0f2fe 0%, transparent 55%),
    #f7f8fa;
  min-height: 100vh;
}
.hidden { display: none !important; }
.wrap { max-width: 920px; margin: 0 auto; padding: 48px 24px 60px; }

/* hero */
.hero { text-align: center; margin-bottom: 26px; }
.logo {
  width: 52px; height: 52px; border-radius: 14px; background: #059669; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; margin: 0 auto 16px;
}
.hero h1 { font-size: 26px; font-weight: 800; }
.tagline { color: #6b7280; font-size: 14px; margin-top: 8px; line-height: 1.6; }

/* query card */
.query-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 22px; box-shadow: 0 1px 3px rgba(16,24,40,.08); margin-bottom: 20px;
}
.q-label { display: block; font-size: 13px; font-weight: 600; color: #6b7280; margin-bottom: 8px; }
.q-row { display: flex; gap: 10px; }
#key-input {
  flex: 1; padding: 11px 13px; border: 1px solid #d1d5db; border-radius: 9px;
  font-size: 14px; font-family: ui-monospace, Menlo, monospace;
  transition: border-color .15s, box-shadow .15s;
}
#key-input:focus { outline: none; border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.14); }
#query-btn {
  padding: 11px 24px; border: none; border-radius: 9px; background: #059669; color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s;
}
#query-btn:hover { background: #047857; }
#query-btn:disabled { opacity: .6; cursor: not-allowed; }
.err { color: #dc2626; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* stat cards */
.cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 16px 20px; flex: 1; min-width: 130px; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.stat-card .n { font-size: 22px; font-weight: 800; }
.stat-card .l { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* info card */
.info-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.info-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.hint { color: #6b7280; font-size: 13px; margin-bottom: 14px; line-height: 1.7; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 24px; }
.info-grid .item { font-size: 13px; }
.info-grid .k { color: #9ca3af; margin-right: 6px; }
.info-grid .v { color: #1f2328; font-weight: 500; word-break: break-all; }

/* table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
}
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #eef0f2; font-size: 12.5px; }
th { background: #fafbfc; color: #6b7280; font-weight: 600; }
tr:last-child td { border-bottom: none; }
code.ip {
  background: #f3f4f6; padding: 1px 6px; border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #374151;
}
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.ok { background: #ecfdf5; color: #059669; }
.pill.bad { background: #fef2f2; color: #dc2626; }
.pill.on { background: #ecfdf5; color: #059669; }
.pill.off { background: #f3f4f6; color: #6b7280; }

.foot { text-align: center; color: #9ca3af; font-size: 12px; margin-top: 24px; }

/* endpoints */
.endpoints { margin-bottom: 20px; }
.ep-item { padding: 12px 0; border-bottom: 1px solid #eef0f2; }
.ep-item:first-of-type { padding-top: 0; }
.ep-item:last-child { padding-bottom: 0; border-bottom: none; }
.ep-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.ep-name { font-size: 13px; font-weight: 700; color: #1f2328; }
.ep-desc { font-size: 12px; color: #9ca3af; }
.ep-row { display: flex; gap: 8px; align-items: stretch; }
.ep-url {
  flex: 1; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 8px 11px; font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  color: #374151; word-break: break-all; display: flex; align-items: center;
}
.copy-btn {
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  border-radius: 8px; padding: 0 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.copy-btn:hover { background: #f3f4f6; }
.copy-btn.copied { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }

/* ===== 流畅过渡 ===== */
html { scroll-behavior: smooth; }
@keyframes panelIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; } to { opacity: 1; } }
#result:not(.hidden) { animation: panelIn .3s cubic-bezier(.2,.7,.2,1); }
table tr { animation: rowIn .22s ease both; }
#query-btn:active { transform: scale(.97); }
#loadbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: #059669; z-index: 999; border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px #059669; opacity: 0;
  transition: width .3s ease, opacity .35s ease;
}
#loadbar.active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #result:not(.hidden), table tr { animation: none !important; }
}
