*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg0: #f1f5f9;
  --bg1: #e8eef7;
  --brand: #1d4ed8;
  --brand-d: #1e3a8a;
  --wx: #07c160;
  --danger: #dc2626;
  --card: #ffffff;
  --radius: 18px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

html, body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #c7d7f5 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dce8f8 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.page.loading {
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}

.hidden { display: none !important; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #cbd5e1;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.top {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  background: #eff6ff;
  border: 1px solid var(--line);
}

.org-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.headline {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sub {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: transform .12s ease, opacity .12s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(180deg, #2563eb, var(--brand));
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn.primary.wx {
  background: linear-gradient(180deg, #19d06b, var(--wx));
  box-shadow: 0 10px 24px rgba(7, 193, 96, 0.28);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px;
}

.btn.text {
  background: #eff6ff;
  color: var(--brand);
  padding: 10px 12px;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 10px;
}

.hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.claim-panel {
  margin-top: 18px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  background: #f8fafc;
  outline: none;
}

.field input:focus {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.code-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}

.code-wrap input { flex: 1; }

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 1.2em;
}

.foot {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.foot a {
  color: var(--brand);
  text-decoration: none;
}

.success-card {
  margin: auto 0;
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--line);
}

.success-card h1 {
  margin: 14px 0 10px;
  font-size: 24px;
}

.success-card p {
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.6;
}

.check, .warn {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.check { background: var(--wx); }
.warn { background: #f59e0b; }
