:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ink: #221715;
  --muted: #746761;
  --line: rgba(34, 23, 21, 0.14);
  --paper: #fffaf3;
  --cream: #fff1d9;
  --coral: #f06f4f;
  --blue: #3b82f6;
  --mint: #56c7a6;
  --gold: #f4b740;
  --shadow: 0 24px 80px rgba(60, 32, 20, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 12%, rgba(86, 199, 166, 0.24), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(240, 111, 79, 0.22), transparent 24%),
    linear-gradient(145deg, #fff7e9 0%, #f8e6d0 45%, #e9f5ff 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  align-items: center;
}

.screen {
  width: 100%;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 28px;
  padding: 28px;
  background: rgba(255, 250, 243, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: 42px;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.hero-cover {
  height: 218px;
  margin: 6px 0 24px;
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(circle at 28% 32%, rgba(86, 199, 166, 0.22), transparent 28%),
    radial-gradient(circle at 76% 35%, rgba(244, 183, 64, 0.2), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #fff7ea 100%);
}

.hero-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  padding: 8px 8px 0;
}

.primary,
.secondary,
.ghost,
.choice {
  min-height: 52px;
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 800;
}

.primary {
  width: 100%;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 28px rgba(34, 23, 21, 0.2);
}

.secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.ghost {
  color: var(--muted);
  background: transparent;
}

.grid {
  display: grid;
  gap: 14px;
}

.pet-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pet-card {
  min-height: 160px;
  padding: 20px 14px;
  border-radius: 24px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(46, 33, 24, 0.1);
}

.pet-card span {
  display: block;
  margin-bottom: 12px;
  font-size: 46px;
}

.name-input {
  width: 100%;
  height: 58px;
  margin: 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

.name-input:focus {
  border-color: rgba(240, 111, 79, 0.65);
  box-shadow: 0 0 0 4px rgba(240, 111, 79, 0.12);
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.progress {
  flex: 1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(34, 23, 21, 0.1);
}

.progress i {
  display: block;
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--mint));
}

.count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.question {
  margin-bottom: 20px;
  font-size: 24px;
  line-height: 1.3;
}

.choice {
  width: 100%;
  color: var(--ink);
  text-align: left;
  line-height: 1.42;
  background: #fff;
  border: 1px solid var(--line);
}

.choice + .choice {
  margin-top: 12px;
}

.loading-card {
  text-align: center;
}

.loader {
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, transparent 0 35%, rgba(255, 255, 255, 0.8) 35% 48%, transparent 48%),
    linear-gradient(135deg, var(--coral), var(--gold), var(--mint));
  animation: spin 1.2s linear infinite;
}

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

.result-screen {
  padding: 14px 0;
}

.result-card {
  border-radius: 30px;
  padding: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 244, 225, 0.92)),
    var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.result-owner {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.type-code {
  font-size: 34px;
  font-weight: 950;
  letter-spacing: 0;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 9px 12px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.portrait {
  display: block;
  width: 100%;
  height: auto;
  margin: 18px 0;
  border-radius: 26px;
  box-shadow: 0 12px 24px rgba(34, 23, 21, 0.12);
}

.image-portrait {
  height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), var(--type-b));
}

.image-portrait img {
  display: block;
  width: 96%;
  height: 96%;
  object-fit: contain;
}

.result-name {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.15;
}

.headline {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.tags,
.recommendations {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}

.pill {
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(34, 23, 21, 0.1);
  font-size: 13px;
  font-weight: 800;
}

.share-copy {
  margin: 0 0 18px;
  border-left: 4px solid var(--coral);
  padding: 10px 0 10px 14px;
  color: var(--ink);
  line-height: 1.55;
}

.mini-title {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 950;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.actions .primary {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 10;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 11px 16px;
  color: #fff;
  background: rgba(34, 23, 21, 0.88);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 380px) {
  .app {
    padding: 12px;
  }

  .panel,
  .result-card {
    padding: 20px;
  }

  h1 {
    font-size: 36px;
  }

  .hero-cover {
    height: 190px;
  }

  .type-code {
    font-size: 28px;
  }

  .image-portrait {
    height: 280px;
  }
}
