:root {
  --ink: #3d332e;
  --muted: #7f6e68;
  --paper: #fffaf0;
  --paper-strong: #fff4cf;
  --pink: #ff9eb4;
  --girl: #ff8fb0;
  --girl-soft: #ffe2eb;
  --boy: #78aef8;
  --boy-soft: #e4f0ff;
  --rose: #ffe0e7;
  --mint: #a9dfc6;
  --blue: #a8c7ff;
  --yellow: #ffd86f;
  --green: #578b6f;
  --shadow: 0 18px 40px rgba(91, 65, 48, 0.14);
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 216, 111, 0.28), transparent 24rem),
    radial-gradient(circle at 88% 4%, rgba(168, 199, 255, 0.28), transparent 22rem),
    linear-gradient(135deg, #fff8ea 0%, #f8efe5 44%, #eef7ed 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 0;
  backdrop-filter: blur(10px);
}

.brand,
.nav button,
.segmented button,
.ghost,
.primary,
.danger {
  border: 0;
  border-radius: 8px;
  color: var(--ink);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pink);
  color: white;
}

.nav,
.segmented,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav button,
.segmented button,
.ghost {
  background: rgba(255, 250, 240, 0.78);
  padding: 10px 14px;
  box-shadow: inset 0 0 0 1px rgba(61, 51, 46, 0.08);
}

.nav button:hover,
.segmented button.active,
.segmented button:hover,
.ghost:hover {
  background: white;
}

.role-picker .role-pill {
  font-weight: 800;
}

.role-picker .role-girl {
  background: var(--girl-soft);
  color: #8b2948;
}

.role-picker .role-boy {
  background: var(--boy-soft);
  color: #255a91;
}

.role-picker .role-girl.active,
.role-picker .role-girl:hover {
  background: var(--girl);
  color: white;
}

.role-picker .role-boy.active,
.role-picker .role-boy:hover {
  background: var(--boy);
  color: white;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.8fr);
  gap: 28px;
  align-items: center;
  min-height: 300px;
  padding: 42px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  color: var(--green);
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 800;
}

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

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 1.03;
}

h2 {
  margin: 0 0 10px;
  font-size: 25px;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 18px;
}

.sticker-stack {
  position: relative;
  min-height: 260px;
}

.mini-note {
  position: absolute;
  display: grid;
  place-items: center;
  width: 170px;
  min-height: 120px;
  background: var(--paper);
  border: 1px solid rgba(61, 51, 46, 0.08);
  box-shadow: var(--shadow);
  transform: rotate(-7deg);
  left: 42px;
  top: 24px;
  font-weight: 800;
}

.mini-note.yellow {
  background: #fff1a8;
  transform: rotate(8deg);
  left: 160px;
  top: 88px;
}

.mini-note.pink {
  background: #ffe2ec;
  transform: rotate(-2deg);
  left: 88px;
  top: 160px;
}

.tape {
  position: absolute;
  width: 102px;
  height: 30px;
  background: rgba(169, 223, 198, 0.75);
  z-index: 2;
  transform: rotate(-14deg);
  left: 78px;
  top: 10px;
}

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

.choice-box,
.paper-panel {
  position: relative;
  background: rgba(255, 250, 240, 0.92);
  border: 1px solid rgba(61, 51, 46, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.choice-box {
  min-height: 250px;
  padding: 28px;
  overflow: hidden;
}

.choice-box::before {
  content: "";
  position: absolute;
  top: 14px;
  right: -24px;
  width: 145px;
  height: 38px;
  background: rgba(255, 158, 180, 0.45);
  transform: rotate(18deg);
}

.eat-box::before {
  background: rgba(255, 216, 111, 0.55);
}

.box-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--blue);
  font-size: 24px;
  margin-bottom: 24px;
}

.eat-box .box-icon {
  background: var(--yellow);
}

.choice-box p {
  color: var(--muted);
  line-height: 1.7;
  min-height: 80px;
}

.primary,
.danger {
  padding: 11px 16px;
  font-weight: 800;
}

.primary {
  background: var(--ink);
  color: white;
}

.danger {
  background: #e85d75;
  color: white;
}

.paper-panel {
  padding: 22px;
  margin-top: 18px;
}

.role-accent {
  border-top: 8px solid var(--role-color, var(--pink));
}

.role-girl {
  --role-color: var(--girl);
  --role-soft: var(--girl-soft);
}

.role-boy {
  --role-color: var(--boy);
  --role-soft: var(--boy-soft);
}

.profile-form {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.panel-head,
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-title {
  margin: 42px 0 18px;
}

.draw-card {
  position: relative;
  margin: 18px 0;
  padding: 28px;
  min-height: 150px;
  background: white;
  border: 1px dashed rgba(61, 51, 46, 0.22);
  border-radius: 8px;
  font-size: 24px;
  line-height: 1.55;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--role-soft, var(--rose));
  color: var(--role-color, var(--pink));
  font-weight: 800;
  vertical-align: middle;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(61, 51, 46, 0.16);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 12px 13px;
}

textarea {
  resize: vertical;
}

.memory-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.memory-card,
.note-item {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(61, 51, 46, 0.08);
  border-radius: 8px;
}

.memory-card {
  padding: 12px;
  transform: rotate(-0.7deg);
}

.memory-card:nth-child(even) {
  transform: rotate(0.8deg);
}

.polaroid {
  background: white;
  min-height: 190px;
  padding: 10px 10px 32px;
  box-shadow: 0 10px 24px rgba(61, 51, 46, 0.12);
}

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

.photo-grid img,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--rose);
  border-radius: 4px;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.memory-body {
  padding: 14px 4px 4px;
}

.memory-body p {
  line-height: 1.65;
}

.comment-form,
.upload-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.note-list {
  display: grid;
  gap: 10px;
}

.note-item {
  padding: 14px;
}

.note-item p {
  line-height: 1.55;
  margin: 6px 0 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(90px);
  background: var(--ink);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  transition: transform 0.2s ease;
  z-index: 20;
  max-width: calc(100% - 32px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .box-grid,
  .desk-grid,
  .section-title {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-title {
    align-items: stretch;
  }

  .hero {
    display: block;
    padding-top: 26px;
  }

  .sticker-stack {
    margin-top: 12px;
    transform: scale(0.86);
    transform-origin: left top;
    min-height: 235px;
  }

  .box-grid,
  .desk-grid,
  .memory-wall {
    grid-template-columns: 1fr;
  }

  .nav button,
  .segmented button {
    flex: 1 1 auto;
  }
}
