:root {
  color-scheme: light;
  --ink: #1f2630;
  --muted: rgba(31, 38, 48, 0.64);
  --soft: rgba(255, 255, 255, 0.56);
  --glass: rgba(255, 255, 255, 0.62);
  --shadow: 0 24px 80px rgba(72, 64, 120, 0.2);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --mint: #9ee8cc;
  --orange: #ffbd7a;
  --violet: #b8a7ff;
  --rose: #ff9db5;
  --blue: #89c8ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(184, 167, 255, 0.9), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(137, 200, 255, 0.78), transparent 30%),
    radial-gradient(circle at 70% 84%, rgba(255, 189, 122, 0.76), transparent 34%),
    linear-gradient(135deg, #f6f1ff 0%, #eef4ff 45%, #fff6ec 100%);
  transition: background 900ms ease;
}

body.result-mode {
  background:
    radial-gradient(circle at 10% 12%, rgba(158, 232, 204, 0.92), transparent 35%),
    radial-gradient(circle at 86% 14%, rgba(255, 189, 122, 0.82), transparent 31%),
    radial-gradient(circle at 70% 86%, rgba(255, 157, 181, 0.48), transparent 34%),
    linear-gradient(135deg, #effff8 0%, #fff7eb 52%, #f8f0ff 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 42vmax;
  height: 42vmax;
  border-radius: 42%;
  filter: blur(28px);
  opacity: 0.42;
  animation: drift 16s ease-in-out infinite alternate;
}

.ambient-one {
  top: -16vmax;
  left: -12vmax;
  background: var(--violet);
}

.ambient-two {
  right: -12vmax;
  top: 12vmax;
  background: var(--mint);
  animation-delay: -5s;
}

.ambient-three {
  left: 28vw;
  bottom: -22vmax;
  background: var(--orange);
  animation-delay: -9s;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  align-items: center;
}

.screen {
  animation: enter 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.glass {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.28);
  -webkit-backdrop-filter: blur(24px) saturate(1.28);
}

.hero {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
  gap: 28px;
  align-items: stretch;
  padding: clamp(22px, 4vw, 42px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: rgba(31, 38, 48, 0.62);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 8px 0 18px;
  font-size: clamp(1.8rem, 3.2vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.12rem;
}

.lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.32rem);
  line-height: 1.7;
}

.hero-visual {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-radius: 40px;
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.9), transparent 18%),
    radial-gradient(circle at 48% 42%, rgba(158, 232, 204, 0.95), transparent 25%),
    radial-gradient(circle at 60% 70%, rgba(255, 189, 122, 0.88), transparent 29%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12));
}

.cactus-mark {
  position: absolute;
  inset: 52px;
  display: grid;
  place-items: center;
}

.cactus-body {
  position: relative;
  width: 150px;
  height: 260px;
  border-radius: 76px 76px 68px 68px;
  background: linear-gradient(145deg, #58caa1, #b7f0d5);
  box-shadow: inset -18px -28px 44px rgba(37, 114, 90, 0.18), 0 26px 60px rgba(35, 90, 72, 0.18);
}

.cactus-body::before,
.cactus-body::after {
  content: "";
  position: absolute;
  top: 74px;
  width: 74px;
  height: 140px;
  border-radius: 42px;
  background: linear-gradient(145deg, #66d3ad, #c5f6df);
}

.cactus-body::before {
  left: -54px;
  transform: rotate(-20deg);
}

.cactus-body::after {
  right: -54px;
  transform: rotate(20deg);
}

.face {
  position: absolute;
  top: 86px;
  left: 50%;
  width: 86px;
  height: 52px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
}

.face::before,
.face::after {
  content: "";
  position: absolute;
  top: 17px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(31, 38, 48, 0.72);
}

.face::before {
  left: 24px;
}

.face::after {
  right: 24px;
}

.start-card,
.input-card,
.result-card,
.wallpaper-preview,
.lock-card {
  padding: clamp(20px, 3.4vw, 34px);
}

.start-card {
  align-self: end;
}

.choice-grid,
.avatar-grid,
.result-grid,
.history-grid {
  display: grid;
  gap: 14px;
}

.choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card,
.avatar-option,
.step-card,
.history-item {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 14px 38px rgba(60, 52, 96, 0.08);
}

.choice-card {
  min-height: 148px;
  padding: 22px;
  text-align: left;
  color: var(--ink);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  border: 2px solid transparent;
  position: relative;
}

.choice-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 44px rgba(60, 52, 96, 0.12);
}

.choice-card.selected {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 44px rgba(60, 52, 96, 0.14);
}

.choice-card[data-role="parent"].selected {
  border-color: #5bd7a6;
  background: rgba(91, 215, 166, 0.12);
}

.choice-card[data-role="child"].selected {
  border-color: #6eb5ff;
  background: rgba(110, 181, 255, 0.12);
}

.choice-card.selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.choice-card[data-role="parent"].selected::after {
  color: #2a9d74;
}

.choice-card[data-role="child"].selected::after {
  color: #4a8fd4;
}

.avatar-option.selected {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.72);
}

.choice-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.choice-card span,
.hint,
.small {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

label {
  display: grid;
  gap: 8px;
  color: rgba(31, 38, 48, 0.78);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input {
  height: 58px;
  padding: 0 18px;
}

textarea {
  min-height: 260px;
  resize: vertical;
  padding: 22px;
  line-height: 1.7;
}

.avatar-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.avatar-option {
  min-height: 92px;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
}

.pin-row {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 12px;
  align-items: end;
}

.primary-button,
.ghost-button,
.icon-button {
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  min-height: 58px;
  padding: 0 24px;
  color: #16251e;
  font-weight: 900;
  background: linear-gradient(135deg, #b8f4dd, #ffd09a);
  box-shadow: 0 18px 42px rgba(82, 125, 100, 0.22);
}

.ghost-button {
  min-height: 54px;
  padding: 0 20px;
  color: var(--ink);
  font-weight: 850;
  background: rgba(255, 255, 255, 0.44);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-2px);
}

.topbar,
.row-actions,
.footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar,
.footer {
  justify-content: space-between;
}

.footer {
  min-height: 44px;
  padding: 0 8px;
  color: rgba(31, 38, 48, 0.48);
  font-size: 0.9rem;
}

.footer button {
  color: inherit;
  background: transparent;
}

.input-layout,
.result-layout {
  display: grid;
  gap: 18px;
}

.input-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  font-weight: 850;
}

.side-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.history-item {
  padding: 16px;
  text-align: left;
}

.history-item time {
  display: block;
  margin-top: 8px;
  color: rgba(31, 38, 48, 0.48);
  font-size: 0.82rem;
}

.loading-stage {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  text-align: center;
}

.breath {
  width: min(56vw, 320px);
  aspect-ratio: 1;
  margin: 0 auto 28px;
  border-radius: 42%;
  background:
    radial-gradient(circle at 44% 38%, rgba(255, 255, 255, 0.95), transparent 22%),
    radial-gradient(circle at 60% 64%, rgba(158, 232, 204, 0.9), transparent 35%),
    linear-gradient(135deg, rgba(184, 167, 255, 0.9), rgba(255, 189, 122, 0.74));
  box-shadow: 0 32px 90px rgba(79, 80, 130, 0.22);
  animation: breathe 2200ms ease-in-out infinite;
}

.loading-text {
  min-height: 38px;
  font-size: clamp(1.18rem, 3vw, 2.1rem);
  font-weight: 900;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-card {
  min-height: 190px;
}

.result-card.wide {
  grid-column: 1 / -1;
}

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

.quote-box {
  min-height: 140px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
  line-height: 1.75;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.step-card {
  padding: 18px;
  line-height: 1.65;
}

.wallpaper-area {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.wallpaper-preview {
  aspect-ratio: 9 / 16;
  overflow: hidden;
  color: #1f2630;
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 255, 255, 0.92), transparent 26%),
    radial-gradient(circle at 72% 28%, rgba(158, 232, 204, 0.92), transparent 32%),
    radial-gradient(circle at 50% 80%, rgba(255, 189, 122, 0.86), transparent 36%),
    linear-gradient(150deg, #fbf6ff, #eefff8 54%, #fff3e6);
}

.wallpaper-preview .avatar-big {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 2.8rem;
}

.wallpaper-preview h3 {
  font-size: 2rem;
  line-height: 1.1;
}

.wallpaper-preview p {
  line-height: 1.72;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hidden {
  display: none !important;
}

.modal-panel {
  position: relative;
  width: min(560px, 100%);
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  font-size: 1.4rem;
}

.admin-section {
  display: grid;
  gap: 14px;
}

.family-panel,
.mail-list {
  display: grid;
  gap: 14px;
}

.status-card,
.status-warning,
.mail-capsule,
.polish-box {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.46);
  padding: 16px;
  line-height: 1.62;
}

.status-warning {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  background: rgba(255, 157, 181, 0.22);
}

.status-card {
  margin-top: 14px;
}

.status-card span {
  display: inline-flex;
  margin-bottom: 8px;
  font-weight: 900;
}

.status-card.red {
  background: rgba(255, 157, 181, 0.28);
}

.status-card.yellow {
  background: rgba(255, 210, 122, 0.32);
}

.status-card.green {
  background: rgba(158, 232, 204, 0.34);
}

.status-card p,
.status-warning span,
.mail-capsule p {
  margin: 8px 0 0;
  color: var(--muted);
}

.status-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.status-button {
  min-height: 92px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 10px 6px;
  color: var(--ink);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
}

.status-button span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.status-button.red span {
  background: #ff6e89;
}

.status-button.yellow span {
  background: #ffc857;
}

.status-button.green span {
  background: #5bd7a6;
}

.status-button.selected {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 34px rgba(60, 52, 96, 0.12);
}

.status-button small,
.mail-capsule small,
.account-item small {
  color: rgba(31, 38, 48, 0.52);
  font-size: 0.78rem;
  font-weight: 800;
}

.account-results {
  display: grid;
  gap: 10px;
}

.account-item {
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
}

.mail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.mail-controls {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.mail-capsule {
  display: grid;
  gap: 12px;
}

.mail-capsule.ready {
  background: rgba(158, 232, 204, 0.32);
}

.mail-capsule.locked {
  background: rgba(184, 167, 255, 0.22);
}

.mail-capsule.sent {
  background: rgba(255, 189, 122, 0.2);
}

.reaction-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.reaction-row button,
.reaction-badge {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  font-weight: 900;
}

.heart-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

.heart-layer span {
  position: absolute;
  left: calc(8% + var(--i) * 5%);
  bottom: -40px;
  font-weight: 900;
  animation: floatHeart 1500ms ease-out forwards;
  animation-delay: calc(var(--i) * 35ms);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  max-width: min(420px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 999px;
  color: #1f2630;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 50px rgba(52, 56, 88, 0.16);
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  transition: 240ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  to {
    transform: translate3d(5vw, 4vh, 0) rotate(18deg) scale(1.12);
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.92);
    border-radius: 45%;
  }
  50% {
    transform: scale(1.04);
    border-radius: 38%;
  }
}

@keyframes floatHeart {
  from {
    opacity: 0;
    transform: translateY(0) scale(0.8) rotate(-8deg);
  }
  15% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-78vh) scale(1.3) rotate(8deg);
  }
}

@media (max-width: 880px) {
  .hero-panel,
  .input-layout,
  .wallpaper-area,
  .mail-layout {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 260px;
  }

  .result-grid,
  .comparison,
  .step-list {
    grid-template-columns: 1fr;
  }

  .pin-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0;
  }

  .hero {
    min-height: calc(100vh - 20px);
  }

  .hero-panel {
    padding: 20px;
  }

  .choice-grid,
  .avatar-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topbar,
  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions .primary-button,
  .row-actions .ghost-button {
    width: 100%;
  }
}
