:root {
  --ink: #2d1d16;
  --cream: #fff8e8;
  --orange: #ff7a2f;
  --orange-dark: #d94a1c;
  --green: #325c47;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #efcf84;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button {
  font: inherit;
}

.page {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: 40px 20px;
  isolation: isolate;
  transition: background 420ms ease;
}

.page::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
}

.mood-waiting {
  background: linear-gradient(145deg, #f7d98b, #eeb267);
}

.mood-barks {
  background: linear-gradient(145deg, #ffbb5c, #f05b36);
}

.mood-quiet {
  background: linear-gradient(145deg, #a9c6ad, #648b74);
}

.sun {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255, 251, 224, 0.4);
  filter: blur(1px);
}

.sun-one {
  top: -90px;
  right: -70px;
  width: 270px;
  height: 270px;
}

.sun-two {
  bottom: -110px;
  left: -80px;
  width: 310px;
  height: 310px;
}

.dog-card {
  width: min(92vw, 560px);
  text-align: center;
}

.intro {
  margin-bottom: 20px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: rgba(45, 29, 22, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.28em;
}

h1 {
  margin: 0;
  font-family: Impact, "Microsoft YaHei", sans-serif;
  font-size: clamp(3.5rem, 13vw, 6.4rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 0.95;
  text-shadow: 3px 3px 0 rgba(255, 248, 232, 0.72);
}

.intro p {
  margin: 14px 0 0;
  font-size: clamp(0.95rem, 3vw, 1.08rem);
  font-weight: 600;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  width: min(100%, 450px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 10px solid var(--cream);
  border-radius: 28px;
  background: #c69963;
  box-shadow:
    0 22px 44px rgba(73, 39, 20, 0.26),
    0 5px 0 rgba(72, 43, 27, 0.12);
  transform: rotate(-1deg);
}

.dog-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  animation: photo-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quiet-label {
  position: absolute;
  right: 50%;
  bottom: 12%;
  padding: 10px 22px 12px;
  border: 3px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  color: #fff;
  background: rgba(39, 67, 52, 0.8);
  box-shadow: 0 8px 24px rgba(17, 33, 24, 0.28);
  font-size: clamp(1.45rem, 6vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: translateX(50%) rotate(1deg);
  backdrop-filter: blur(6px);
  animation: label-in 420ms cubic-bezier(0.2, 1.2, 0.3, 1);
}

.bark-lines span {
  position: absolute;
  padding: 6px 11px;
  border-radius: 12px;
  color: #fff8e8;
  background: var(--orange-dark);
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 3px 4px 0 rgba(65, 22, 11, 0.35);
  animation: bark-pop 800ms ease-in-out infinite alternate;
}

.bark-lines span:first-child {
  top: 11%;
  left: 7%;
  transform: rotate(-10deg);
}

.bark-lines span:last-child {
  top: 17%;
  right: 6%;
  transform: rotate(11deg);
  animation-delay: 160ms;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.actions button {
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  padding: 0 23px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 7px 0 rgba(73, 38, 21, 0.34);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.actions button:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 9px 0 rgba(73, 38, 21, 0.31);
}

.actions button:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(73, 38, 21, 0.35);
}

.actions button:focus-visible {
  outline: 4px solid #fff8e8;
  outline-offset: 4px;
}

.primary-button {
  background: var(--orange-dark);
  font-size: clamp(1rem, 4vw, 1.2rem);
}

.bark-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--green);
  animation: button-in 300ms cubic-bezier(0.2, 1.2, 0.4, 1);
}

.bark-button.is-playing span {
  animation: speaker-shake 260ms ease-in-out infinite;
}

.result {
  min-height: 24px;
  margin: 19px 0 0;
  color: rgba(45, 29, 22, 0.76);
  font-size: 0.92rem;
  font-weight: 700;
}

@keyframes photo-in {
  from { opacity: 0.2; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes label-in {
  from { opacity: 0; transform: translateX(50%) translateY(16px) scale(0.8); }
  to { opacity: 1; transform: translateX(50%) rotate(1deg) scale(1); }
}

@keyframes bark-pop {
  from { scale: 0.92; }
  to { scale: 1.08; }
}

@keyframes button-in {
  from { opacity: 0; transform: translateX(-8px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes speaker-shake {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

@media (max-width: 520px) {
  .page {
    padding: 28px 16px;
  }

  .photo-frame {
    border-width: 7px;
    border-radius: 22px;
  }

  .actions {
    gap: 9px;
  }

  .actions button {
    min-height: 50px;
    padding: 0 16px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
