:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --primary: #07c160; /* 微信绿 */
  --primary-dark: #06a850;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --error: #dc2626;
  --success: #07c160;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef2f7 0%, #f7fafc 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-hero {
  width: 100%;
  max-width: 560px;
  min-height: 188px;
  display: grid;
  place-items: center;
  margin: 0 0 30px;
  background: radial-gradient(circle, rgba(7, 193, 96, 0.13), rgba(7, 193, 96, 0) 66%);
}

.mascot {
  width: 164px;
  height: 164px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
  animation: mascot-float 5.5s ease-in-out infinite;
}

.mascot:focus-visible {
  outline: 3px solid rgba(7, 193, 96, 0.45);
  outline-offset: 7px;
  border-radius: 24px;
}

.mascot svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mascot-halo {
  fill: rgba(7, 193, 96, 0.12);
}

.mascot-page rect {
  fill: var(--card);
  stroke: currentColor;
  stroke-width: 3;
}

.mascot-page path {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
}

.mascot-page .mascot-lines {
  stroke: var(--muted);
  stroke-linecap: round;
}

.mascot-dog > path:first-child,
.mascot-dog > circle:not(.mascot-eye) {
  fill: var(--primary);
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
}

.mascot-eye {
  fill: currentColor;
}

.mascot-smile {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.mascot-page,
.mascot-dog {
  transform-box: fill-box;
  transform-origin: center;
}

.mascot:hover .mascot-dog {
  transform: translateY(-3px);
}

.mascot.is-playing {
  animation: mascot-wiggle 0.46s ease 3;
}

.mascot.is-playing .mascot-page {
  animation: mascot-page-flip 0.48s ease 2;
}

.mascot.is-playing .mascot-dog {
  animation: mascot-pop 0.46s ease 3;
}

@keyframes mascot-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@keyframes mascot-wiggle {
  0%,
  100% {
    transform: scale(1) rotate(0);
  }
  50% {
    transform: scale(1.05) rotate(-3deg);
  }
}

@keyframes mascot-page-flip {
  50% {
    transform: rotate(-8deg) translateY(-4px);
  }
}

@keyframes mascot-pop {
  50% {
    transform: scale(1.1) translateY(-4px);
  }
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(17, 24, 39, 0.08);
}

.head h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

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

.form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.15);
}

.btn {
  flex: 0 0 auto;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 18px;
  min-height: 22px;
  font-size: 14px;
  line-height: 1.6;
}

.status.loading {
  color: var(--muted);
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

.tips {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.tips summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.tips ul {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.tips code {
  background: #f1f3f5;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.footer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.footer-brand-link {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: 2px;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.footer-dog {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  max-width: none !important;
  flex: 0 0 18px;
}

.footer-brand-link:hover,
.footer-brand-link:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
}

.footer-brand-link:hover .footer-dog,
.footer-brand-link:focus-visible .footer-dog {
  animation: footer-dog-bark 0.44s ease 3;
}

.footer-brand-link.is-barking .footer-dog {
  animation: footer-dog-bark 0.44s ease 3;
}

@keyframes footer-dog-bark {
  0%,
  100% {
    transform: scale(1) rotate(0);
  }
  50% {
    transform: scale(1.12) rotate(-4deg) translateY(-2px);
  }
}

@media (max-width: 640px) {
  body {
    align-items: flex-start;
  }

  .brand-hero {
    min-height: 144px;
    margin-bottom: 20px;
  }

  .mascot {
    width: 128px;
    height: 128px;
  }

  .card {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mascot,
  .mascot.is-playing,
  .mascot.is-playing .mascot-page,
  .mascot.is-playing .mascot-dog {
    animation: none;
  }

  .footer-brand-link:hover .footer-dog,
  .footer-brand-link:focus-visible .footer-dog,
  .footer-brand-link.is-barking .footer-dog {
    animation: none;
  }
}
