:root {
  --bg: #f6f8fa;
  --card: #fff;
  --ink: #1f2937;
  --sub: #6b7280;
  --line: #e5e7eb;
  --gp: #10a37f;
  --gp2: #0d8c6d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button, input, textarea { font: inherit; }

.hidden { display: none !important; }
.wrap { max-width: 560px; margin: 0 auto; padding: 18px; }

.top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px 18px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0d8c6d, #10a37f 45%, #34d399 75%, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 14px rgba(16, 163, 127, .38);
}

.brand { font-weight: 700; font-size: 16px; }
.spacer { flex: 1; }

.lang {
  font-size: 12px;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  cursor: pointer;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  margin-bottom: 14px;
}

h1 { font-size: 22px; margin: 2px 0 6px; }
.query-title { font-size: 20px; }

.lead {
  color: var(--sub);
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 1.6;
}

label {
  font-size: 13px;
  color: var(--sub);
  display: block;
  margin: 14px 0 6px;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  font-family: ui-monospace, Menlo, monospace;
  background: #fbfdfc;
}

input {
  letter-spacing: 1px;
  text-transform: uppercase;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--gp);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, .12);
}

.inline-row {
  display: flex;
  gap: 8px;
}

.inline-row input { flex: 1; }

.hint {
  font-size: 12px;
  margin: 6px 0 0;
  min-height: 16px;
}

.hint.ok { color: var(--gp); }
.hint.bad { color: #b91c1c; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--gp);
  cursor: pointer;
  margin-top: 16px;
}

.btn:hover { background: var(--gp2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.fit {
  width: auto;
  margin-top: 0;
  padding: 0 18px;
}

.btn.ghost {
  background: #fff;
  color: var(--gp);
  border: 1px solid var(--gp);
}

details {
  margin-top: 12px;
  font-size: 13px;
  color: var(--sub);
}

summary {
  cursor: pointer;
  color: var(--gp);
}

details ol {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.notes {
  margin-top: 14px;
  font-size: 12px;
  color: var(--sub);
  line-height: 1.9;
}

.notes b { color: var(--ink); }

.chip {
  display: inline-block;
  font-size: 12px;
  color: var(--gp);
  background: rgba(16, 163, 127, .1);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 12px;
}

.steps {
  display: flex;
  align-items: center;
  margin: 6px 0 18px;
}

.step {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--sub);
  position: relative;
}

.dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-weight: 700;
  font-size: 13px;
}

.step.on .dot { background: var(--gp); color: #fff; }
.step.on { color: var(--ink); font-weight: 600; }
.step.done .dot { background: #34d399; color: #fff; }

.bar {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e5e7eb;
  z-index: -1;
}

.step:last-child .bar { display: none; }

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.kv b {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.badge {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.b-proc { background: #fff7ed; color: #c2410c; }
.b-ok { background: #ecfdf5; color: #047857; }
.b-exp { background: #fef2f2; color: #b91c1c; }

.center { text-align: center; padding: 8px 0; }
.big { font-size: 46px; margin: 8px 0; }

.spin {
  width: 34px;
  height: 34px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--gp);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 14px auto;
}

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

.muted {
  color: var(--sub);
  font-size: 13px;
  line-height: 1.6;
}

.err {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

.status-badge-wrap {
  text-align: right;
  margin-bottom: 6px;
}

.info-box {
  border-radius: 10px;
  padding: 11px 12px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.65;
}

.info-box.warn { background: #fff7ed; color: #c2410c; }
.info-box.danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.query-result { margin-top: 14px; }

.foot {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 8px 0 24px;
}
