:root {
  --blue-deep: #266d9d;
  --blue: #3489bd;
  --blue-soft: #dcebf5;
  --ink: #203849;
  --ink-soft: #35546b;
  --muted: #7d90a1;
  --line: #d4e0ea;
  --bg: #eef3f8;
  --surface: #ffffff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */
.top {
  padding: 16px 16px 14px;
  background: linear-gradient(160deg, #3a90c2 0%, #266d9d 78%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(24, 80, 118, 0.18);
}

.org-name {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  letter-spacing: 0.4px;
  text-align: center;
}

.page-title {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 1.5px;
  text-align: center;
}

/* ---------- search ---------- */
.search-bar {
  display: flex;
  gap: 8px;
  margin: 12px 14px 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(24, 58, 83, 0.06);
}

.search-bar input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-bar input::placeholder { color: #a5b5c2; }

.search-bar button {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #3388bb 0%, #2874a5 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}

.search-bar button:active { background: #226897; }

/* ---------- content ---------- */
.content {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 8px 14px 22px;
}

/* ---------- states ---------- */
.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 46px;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
}

.state-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  color: #a9c1d2;
}

.state-title {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
}

.state-desc {
  margin: 0;
  font-size: 12.5px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #d7e7f2;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- certificate card ---------- */
.cert-card {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(24, 58, 83, 0.07);
}

.cert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #3489bd 0%, #266d9d 100%);
  color: #fff;
}

.cert-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.cert-head-badge {
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  letter-spacing: 0.3px;
}

.cert-rows { background: var(--surface); }

.cert-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.cert-row:last-child { border-bottom: 0; }

.cert-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: var(--blue-soft);
  color: #244960;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.1px;
}

.cert-value {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  line-height: 1.55;
  word-break: break-word;
}

.cert-value.is-mono {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.1px;
}

/* ---------- footer ---------- */
.foot {
  padding: 18px 14px calc(22px + env(safe-area-inset-bottom));
  color: #93a5b4;
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.2px;
}

@media (min-width: 640px) {
  .search-bar { margin-top: 16px; }
  .cert-row { grid-template-columns: 120px minmax(0, 1fr); font-size: 14px; }
}
