* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #1f2937;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app {
  width: min(640px, 92vw);
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.hidden { display: none !important; }

h1 { font-size: 24px; margin-bottom: 6px; }
.sub { color: #6b7280; font-size: 14px; margin-bottom: 24px; }
.hint { color: #9ca3af; font-size: 13px; margin-top: 6px; }

form { margin-top: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }

input[type="text"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid #2f6fed; border-color: transparent; }

button {
  margin-top: 14px;
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: #2f6fed;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: #1e5adb; }
button.ghost { background: #e5e7eb; color: #374151; }
button.danger { background: #dc2626; }
button.link { background: none; color: #2f6fed; box-shadow: none; margin-top: 8px; font-weight: 500; }

.token-info { color: #059669; font-size: 13px; margin-top: 8px; }

.pulse { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.pulse span {
  width: 12px; height: 12px; border-radius: 50%; background: #2f6fed;
  animation: pulse 1.2s ease-in-out infinite;
}
.pulse span:nth-child(2) { animation-delay: 0.2s; }
.pulse span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }

.progress { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin: 14px 0; }
.progress-bar { height: 100%; width: 0; background: #2f6fed; transition: width 0.4s ease; }

.stage { text-align: center; font-weight: 600; }
.elapsed { text-align: center; color: #6b7280; font-size: 13px; margin: 6px 0 14px; }

.ok, .fail {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  font-size: 34px; color: #fff; margin: 0 auto 14px;
}
.ok { background: #059669; }
.fail { background: #dc2626; }

.btn-primary {
  display: block; text-align: center; text-decoration: none;
  background: #059669; color: #fff; font-weight: 600;
  padding: 11px; border-radius: 8px; margin-top: 14px;
}

.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
  display: flex; justify-content: center; align-items: center; z-index: 10;
}
.modal-box {
  background: #fff; border-radius: 12px; padding: 24px 28px;
  width: min(420px, 90vw);
}
.modal-box h3 { margin-bottom: 8px; }
.modal-box p { color: #6b7280; font-size: 14px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { margin-top: 0; flex: 1; }
