:root {
  --bg: #0b0e1f;
  --panel: rgba(23, 27, 51, 0.78);
  --card: #1b2041;
  --card-2: #222848;
  --text: #eef1ff;
  --muted: #9ba3cc;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #7b8cff;
  --accent-2: #b06cff;
  --danger: #ff6b81;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(4, 6, 20, 0.5);

  --love: #ff6f9c;
  --love-2: #ff9a6c;
  --wish: #7ee0ff;
  --wish-2: #9d8cff;
  --note: #9de5a4;
  --note-2: #6fc7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- ambient background ---------- */

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

.blob {
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 18s ease-in-out infinite;
}

.blob-a {
  top: -14vw;
  left: -10vw;
  background: radial-gradient(circle, #5b6cff, transparent 68%);
}

.blob-b {
  top: 6vw;
  right: -14vw;
  background: radial-gradient(circle, #b06cff, transparent 68%);
  animation-delay: -6s;
}

.blob-c {
  bottom: -20vw;
  left: 24vw;
  background: radial-gradient(circle, #2fb8ff, transparent 70%);
  animation-delay: -12s;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2vw, -3vw, 0) scale(1.08);
  }
}

/* ---------- layout ---------- */

.shell {
  position: relative;
  z-index: 1;
  max-width: 940px;
  margin: 0 auto;
  padding: 54px 22px 80px;
}

.hero {
  text-align: center;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5.4vw, 46px);
  letter-spacing: -0.6px;
  background: linear-gradient(100deg, #ffffff 6%, var(--accent) 52%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub {
  margin: 0 auto;
  max-width: 480px;
  color: var(--muted);
  font-size: 15px;
}

.stats {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
}

.stats li {
  min-width: 82px;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(6px);
}

.stats strong {
  font-size: 19px;
  line-height: 1.2;
}

.stats span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ---------- composer ---------- */

.composer {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.composer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: background 0.3s ease;
}

.composer[data-type="love"]::before {
  background: linear-gradient(90deg, var(--love), var(--love-2));
}

.composer[data-type="wish"]::before {
  background: linear-gradient(90deg, var(--wish), var(--wish-2));
}

.composer[data-type="note"]::before {
  background: linear-gradient(90deg, var(--note), var(--note-2));
}

.composer.pulse {
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(123, 140, 255, 0.28), var(--shadow);
  }
  100% {
    box-shadow: 0 0 0 22px rgba(123, 140, 255, 0), var(--shadow);
  }
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.tab:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.tab-emoji {
  font-size: 15px;
}

.tab[data-type="love"].active {
  color: #2a0d1c;
  background: linear-gradient(100deg, var(--love), var(--love-2));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(255, 111, 156, 0.28);
}

.tab[data-type="wish"].active {
  color: #08202c;
  background: linear-gradient(100deg, var(--wish), var(--wish-2));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(126, 224, 255, 0.24);
}

.tab[data-type="note"].active {
  color: #0a2413;
  background: linear-gradient(100deg, var(--note), var(--note-2));
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(157, 229, 164, 0.22);
}

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

.form-row + .form-row {
  margin-top: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 190px;
}

.field.grow {
  flex: 1 1 100%;
}

label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  background: rgba(8, 10, 24, 0.66);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(155, 163, 204, 0.7);
}

.composer[data-type="love"] input:focus,
.composer[data-type="love"] textarea:focus {
  border-color: var(--love);
  box-shadow: 0 0 0 3px rgba(255, 111, 156, 0.18);
}

.composer[data-type="wish"] input:focus,
.composer[data-type="wish"] textarea:focus {
  border-color: var(--wish);
  box-shadow: 0 0 0 3px rgba(126, 224, 255, 0.18);
}

.composer[data-type="note"] input:focus,
.composer[data-type="note"] textarea:focus {
  border-color: var(--note);
  box-shadow: 0 0 0 3px rgba(157, 229, 164, 0.18);
}

textarea {
  min-height: 100px;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.counter {
  font-size: 13px;
  color: var(--muted);
  margin: 0 auto 0 0;
}

.counter.warn {
  color: var(--danger);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 11px 24px;
  color: #0c0f22;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease,
    background 0.25s ease;
}

.composer[data-type="love"] #submit {
  background: linear-gradient(100deg, var(--love), var(--love-2));
}

.composer[data-type="wish"] #submit {
  background: linear-gradient(100deg, var(--wish), var(--wish-2));
}

.composer[data-type="note"] #submit {
  background: linear-gradient(100deg, var(--note), var(--note-2));
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- wall header & filters ---------- */

.wall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 38px 4px 14px;
}

.wall-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.02em;
}

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

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.chip:hover {
  color: var(--text);
}

.chip.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
}

.chip-emoji {
  font-size: 13px;
}

/* ---------- wall grid ---------- */

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
  align-items: start;
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(4, 6, 20, 0.34);
  animation: rise 0.36s cubic-bezier(0.22, 0.9, 0.3, 1) both;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--note), var(--note-2));
}

.card[data-type="love"]::before {
  background: linear-gradient(90deg, var(--love), var(--love-2));
}

.card[data-type="wish"]::before {
  background: linear-gradient(90deg, var(--wish), var(--wish-2));
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 42px rgba(4, 6, 20, 0.5);
}

.card.is-love {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 111, 156, 0.16), transparent 62%),
    linear-gradient(180deg, var(--card), var(--card-2));
}

.card.leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badge {
  position: absolute;
  top: 12px;
  right: 44px;
  font-size: 17px;
  line-height: 1;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
  padding-right: 46px;
}

.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #10142c;
  font-size: 15px;
}

.who {
  min-width: 0;
  flex: 1;
}

.who strong {
  display: block;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target {
  display: none;
  font-size: 12px;
  color: var(--love);
}

.target.show {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-head time {
  flex: none;
  font-size: 11.5px;
  color: var(--muted);
}

.text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.68;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.like:hover:not(:disabled) {
  color: var(--love);
  border-color: rgba(255, 111, 156, 0.5);
  transform: none;
}

.like.active {
  color: #2a0d1c;
  background: linear-gradient(100deg, var(--love), var(--love-2));
  border-color: transparent;
}

.like.active .heart {
  animation: pop 0.34s ease;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.45);
  }
  100% {
    transform: scale(1);
  }
}

.stamp {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(155, 163, 204, 0.7);
  text-transform: uppercase;
}

.remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    background 0.18s ease;
}

.card:hover .remove,
.remove:focus-visible {
  opacity: 1;
}

.remove:hover:not(:disabled) {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(255, 107, 129, 0.12);
  transform: none;
}

/* ---------- states ---------- */

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 52px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  font-size: 15px;
}

.empty .emoji {
  display: block;
  font-size: 30px;
  margin-bottom: 8px;
}

.empty-text {
  display: block;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: #262c50;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 20;
}

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

.toast.error {
  border-color: rgba(255, 107, 129, 0.55);
}

.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 30px;
}

@media (max-width: 560px) {
  .shell {
    padding: 36px 14px 60px;
  }
  .composer {
    padding: 16px;
  }
  .wall {
    grid-template-columns: 1fr;
  }
  .form-foot button {
    width: 100%;
  }
  .stats li {
    min-width: 70px;
    padding: 8px 12px;
  }
}

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


/* ---------- hero action + card share ---------- */

.hero-actions {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.ghost-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.13);
  border-color: var(--accent);
}

.card-foot .share {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.card-foot .share:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--card-accent, var(--accent));
}

.card-foot .stamp {
  margin-left: 0;
}

.card-foot .stamp + .share {
  margin-left: auto;
}

/* A field marked hidden must stay hidden: .field sets display, which would
   otherwise win over the browser default for [hidden]. */
.field[hidden] {
  display: none;
}
