:root {
  --blue: #1d4ed8;
  --blue-2: #3b82f6;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e8eef6;
  --bg: #f4f7fb;
  --green: #047857;
  --red: #b91c1c;
  --orange: #c2410c;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #38bdf8 100%);
  color: #fff;
  padding: 34px 20px 62px;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.hero::before { width: 260px; height: 260px; right: -90px; top: -110px; }
.hero::after { width: 180px; height: 180px; left: -70px; bottom: -100px; }

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
}

.brand h1 { font-size: 22px; margin: 0; letter-spacing: 1px; }
.brand p { margin: 2px 0 0; font-size: 12px; opacity: 0.8; letter-spacing: 2px; }

.hero-note {
  margin-top: 26px;
  font-size: 12.5px;
  opacity: 0.82;
}

.wrap {
  max-width: 720px;
  margin: -34px auto 0;
  padding: 0 16px 24px;
  position: relative;
  z-index: 2;
}

.tabs {
  display: flex;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 11px 8px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab.active {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.panel {
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.hidden { display: none; }

.panel-head h2 { margin: 0 0 6px; font-size: 18px; }
.panel-head p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

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

.field { display: grid; gap: 7px; }
.field span { font-size: 13px; color: #475569; font-weight: 500; }
.field em { font-style: normal; color: #94a3b8; font-weight: 400; }

.field input,
.field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  appearance: none;
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field input:focus,
.field select:focus {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.submit {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s ease;
}

.submit:active { transform: scale(0.985); }
.submit:disabled { opacity: 0.65; cursor: not-allowed; }

.result { margin-top: 20px; }
.result:empty { margin-top: 0; }

.result-card {
  border: 1px solid #dbeafe;
  border-radius: 16px;
  overflow: hidden;
  animation: rise 0.25s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-head {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-head .type { font-size: 17px; font-weight: 700; }
.result-head .no {
  font-family: "Courier New", monospace;
  font-size: 12.5px;
  opacity: 0.85;
  margin-top: 4px;
  word-break: break-all;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
}

.pill-green { background: #ecfdf5; color: var(--green); }
.pill-orange { background: #fff7ed; color: var(--orange); }
.pill-red { background: #fef2f2; color: var(--red); }
.pill-gray { background: #f1f5f9; color: var(--muted); }
.result-head .pill-green { background: rgba(255,255,255,.18); color: #d1fae5; }
.result-head .pill-orange { background: rgba(255,255,255,.18); color: #ffedd5; }
.result-head .pill-red { background: rgba(255,255,255,.18); color: #fee2e2; }
.result-head .pill-gray { background: rgba(255,255,255,.18); color: #e2e8f0; }

.result-body { padding: 18px; }

.kv {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed #eef2f7;
  font-size: 14px;
}

.kv:last-child { border-bottom: 0; }
.kv .k { width: 92px; color: #94a3b8; flex-shrink: 0; }
.kv .v { flex: 1; color: #1e293b; word-break: break-all; }

.scope {
  margin-top: 14px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  font-size: 13px;
  color: #334155;
}

.scope b { color: #94a3b8; font-weight: 400; margin-right: 5px; }

.score-item {
  border: 1px solid #e8eef6;
  border-radius: 14px;
  padding: 15px 16px;
  margin-bottom: 12px;
  background: #fff;
}

.score-item:last-child { margin-bottom: 0; }
.score-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.score-title { font-size: 14.5px; font-weight: 600; color: #1e293b; }
.score-sub { color: #94a3b8; font-size: 12px; margin-top: 4px; }
.score-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.score-tag { font-size: 12px; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 2px 8px; }
.score-tag.pass { background: #ecfdf5; color: var(--green); }
.score-tag.fail { background: #fef2f2; color: var(--red); }

.empty {
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 26px 10px;
  background: #f8fafc;
  border-radius: 12px;
}

.err {
  color: var(--red);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 14px;
}

.help {
  margin-top: 18px;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #eef2f7;
}

.help h3 { margin: 0 0 10px; font-size: 15px; }
.help ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.9; }

.footer {
  text-align: center;
  color: #b6c2d2;
  font-size: 12px;
  padding: 10px 20px 36px;
}

.footer p { margin: 2px 0; }
.footer .small { font-size: 11px; }

.loading {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 13px;
  padding: 12px 18px;
  border-radius: 12px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 99;
}

.loading.show { display: flex; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
  .hero { padding: 48px 24px 76px; }
  .brand h1 { font-size: 26px; }
  .wrap { padding: 0 24px 30px; }
  .panel { padding: 30px 28px; }
  .form { grid-template-columns: 1fr 1fr; gap: 16px 18px; }
  .field:first-child { grid-column: 1 / -1; }
  .submit { grid-column: 1 / -1; }
}
