﻿:root {
  --bg-0: #f3fbff;
  --bg-1: #dff4ff;
  --bg-2: #c6e7ff;
  --ink: #203244;
  --muted: #4f6880;
  --accent: #ff7a3d;
  --accent-dark: #e56022;
  --card: #ffffff;
  --line: #b8d8ef;
  --shadow: 0 14px 30px rgba(46, 102, 144, 0.18);
  --font-title: "NanumSquareRound", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-body: "SUIT", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 16%, rgba(255, 255, 255, 0.92) 0 12%, transparent 13%),
    radial-gradient(circle at 85% 8%, rgba(255, 255, 255, 0.72) 0 10%, transparent 11%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 48%, var(--bg-2));
  padding: 24px;
  padding-bottom: 180px;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(2px);
  z-index: -1;
}

.bg-shape-a {
  width: 180px;
  height: 180px;
  right: -40px;
  top: 60px;
  background: rgba(152, 208, 255, 0.2);
}

.bg-shape-b {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: 10px;
  background: rgba(182, 225, 255, 0.3);
}

.cloud {
  position: fixed;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  filter: blur(0.4px);
  z-index: -1;
  box-shadow: inset -20px -6px 20px rgba(194, 220, 243, 0.35);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
}

.cloud-a {
  width: 170px;
  height: 50px;
  top: 100px;
  left: -180px;
  animation: cloudMove 52s linear infinite, cloudFloat 7s ease-in-out infinite;
}

.cloud-a::before {
  width: 64px;
  height: 54px;
  left: 16px;
  top: -24px;
}

.cloud-a::after {
  width: 58px;
  height: 44px;
  right: 12px;
  top: -15px;
}

.cloud-b {
  width: 210px;
  height: 58px;
  top: 56px;
  left: -220px;
  opacity: 0.84;
  animation: cloudMove 64s linear infinite, cloudFloat 9s ease-in-out infinite;
  animation-delay: -12s;
}

.cloud-b::before {
  width: 82px;
  height: 60px;
  left: 26px;
  top: -26px;
}

.cloud-b::after {
  width: 66px;
  height: 45px;
  right: 20px;
  top: -18px;
}

.cloud-c {
  width: 140px;
  height: 40px;
  top: 174px;
  left: -170px;
  opacity: 0.72;
  animation: cloudMove 58s linear infinite, cloudFloat 8s ease-in-out infinite;
  animation-delay: -20s;
}

.landscape {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 190px;
  z-index: -1;
  pointer-events: none;
}

.hill {
  position: absolute;
  border-radius: 50% 50% 0 0;
}

.hill-back {
  width: 130%;
  height: 130px;
  left: -15%;
  bottom: -30px;
  background: linear-gradient(180deg, #89cda0, #5cae79);
}

.hill-front {
  width: 120%;
  height: 110px;
  left: -8%;
  bottom: -36px;
  background: linear-gradient(180deg, #74bf8e, #459a67);
}

.tree {
  position: absolute;
  bottom: 64px;
  width: 54px;
  height: 86px;
}

.tree .trunk {
  position: absolute;
  left: 22px;
  bottom: 0;
  width: 12px;
  height: 28px;
  border-radius: 5px;
  background: linear-gradient(180deg, #7f5838, #603d21);
}

.tree .leaf {
  position: absolute;
  left: 4px;
  bottom: 22px;
  width: 46px;
  height: 52px;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 30% 25%, #9ce0aa, #55a96f 60%, #3e8f58);
  box-shadow: 0 8px 15px rgba(41, 113, 67, 0.24);
}

.tree-a {
  left: 12%;
}

.tree-b {
  right: 17%;
  transform: scale(1.08);
}

.tree-c {
  right: 7%;
  transform: scale(0.92);
}

.cloud-c::before {
  width: 50px;
  height: 40px;
  left: 20px;
  top: -15px;
}

.cloud-c::after {
  width: 42px;
  height: 34px;
  right: 16px;
  top: -11px;
}

.hero {
  max-width: 1100px;
  margin: 0 auto 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 248, 255, 0.94));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "POST";
  position: absolute;
  right: 18px;
  top: 12px;
  font-weight: 800;
  letter-spacing: 0.3rem;
  color: rgba(57, 102, 136, 0.25);
  font-size: 1rem;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 2.05rem;
  font-family: var(--font-title);
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.1fr;
  gap: 14px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 26px rgba(48, 103, 144, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  padding: 14px;
  position: relative;
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 34px rgba(48, 103, 144, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent 45%);
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-family: var(--font-title);
  letter-spacing: -0.015em;
}

.helper,
.status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.mailbox-scene {
  height: 170px;
  margin: 2px 0 10px;
  position: relative;
}

.mailbox-shadow {
  width: 150px;
  height: 22px;
  border-radius: 999px;
  background: rgba(34, 63, 92, 0.16);
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  filter: blur(1px);
}

.mailbox-body {
  width: 170px;
  height: 102px;
  border-radius: 52px 52px 16px 16px;
  background: linear-gradient(160deg, #fd8d54, #ef5c23);
  border: 3px solid #b5441a;
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  box-shadow: inset -8px -8px 14px rgba(120, 34, 7, 0.22);
}

.mailbox-slot {
  width: 86px;
  height: 9px;
  background: #65301a;
  border-radius: 8px;
  position: absolute;
  left: 50%;
  top: 36px;
  transform: translateX(-50%);
}

.mailbox-scene::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 42px;
  height: 28px;
  background: linear-gradient(145deg, #fffdfa, #f4efe8);
  border: 2px solid #c7b8a6;
  border-radius: 4px;
  transform: translateX(-50%) rotate(-6deg);
  opacity: 0;
  box-shadow: 0 6px 14px rgba(60, 72, 90, 0.18);
}

.mailbox-scene.sending::after {
  animation: dropLetter 0.92s ease-in forwards;
}

.mailbox-scene.sending .mailbox-slot {
  animation: slotFlash 0.92s ease-out;
}

.mailbox-flag {
  width: 9px;
  height: 56px;
  border-radius: 9px;
  background: #ffe0cd;
  border: 2px solid #bf4b1f;
  position: absolute;
  right: -18px;
  top: 18px;
}

.mailbox-flag::after {
  content: "";
  width: 26px;
  height: 13px;
  border-radius: 4px;
  background: #fff3ea;
  border: 2px solid #bf4b1f;
  position: absolute;
  left: -2px;
  top: -2px;
}

.mailbox-word {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  color: rgba(255, 242, 231, 0.93);
  font-weight: 800;
  letter-spacing: 0.1rem;
  font-size: 0.95rem;
}

.mailbox-stand {
  width: 24px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(180deg, #6f4c32, #4b2f1c);
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
}

label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.emotion-field {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px 10px;
  margin: 0 0 10px;
  background: #f5fbff;
}

.emotion-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.emotion-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emotion-options label {
  margin: 0;
  cursor: pointer;
}

.emotion-options label span {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #b8d8ef;
  background: #ffffff;
  font-size: 1.05rem;
  line-height: 1;
}

.emotion-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.emotion-options input:checked + span {
  border-color: #5aa7dd;
  background: #e8f5ff;
  box-shadow: 0 0 0 2px rgba(90, 167, 221, 0.2) inset;
}

input,
select,
textarea,
button {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

input[type="radio"] {
  width: auto;
  margin-top: 0;
}

input,
select,
textarea {
  padding: 10px;
  background: #fffefb;
  font-size: 0.97rem;
  line-height: 1.45;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.btn {
  border: none;
  cursor: pointer;
  padding: 10px 12px;
  transition: transform 0.12s ease, opacity 0.12s ease, background-color 0.12s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-send {
  background: linear-gradient(145deg, #f58353, var(--accent));
  color: white;
  font-weight: 700;
}

.btn-send:hover {
  background: var(--accent-dark);
}

.btn-ghost {
  background: #ecf7ff;
  color: #28597f;
  border: 1px solid #b9ddf4;
}

.btn-refresh {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #b9ddf4;
  background: #ecf7ff;
  color: #28597f;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-refresh:hover {
  background: #dff1ff;
}

.btn-refresh:active {
  transform: rotate(22deg) scale(0.96);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-list {
  margin: 0;
  display: grid;
  gap: 12px;
  max-height: 530px;
  overflow: auto;
  padding-right: 4px;
}

.emotion-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  color: #1e5985;
  font-weight: 700;
  padding: 0 2px 2px;
}

.emotion-count {
  min-width: 26px;
  text-align: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dff2ff;
  border: 1px solid #b4d8ef;
  color: #2f6f9d;
  font-size: 0.78rem;
}

.emotion-group {
  border: 1px solid #d2e7f4;
  border-radius: 12px;
  padding: 8px;
  background: #f7fcff;
}

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

.mail-tile {
  border: 1px solid #bcdcee;
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff, #eaf6ff);
  min-height: 124px;
  padding: 8px;
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: center;
  align-items: start;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.mail-tile:hover {
  transform: translateY(-2px);
  border-color: #86c2e3;
  box-shadow: 0 8px 18px rgba(54, 117, 158, 0.18);
}

.mail-emoji {
  font-size: 2.2rem;
  line-height: 1;
  margin-top: 4px;
}

.mail-emotion {
  position: absolute;
  left: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #b9dcef;
  font-size: 0.95rem;
}

.mail-title {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #2a4560;
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mail-sub {
  margin-top: auto;
  font-size: 0.72rem;
  color: #61839c;
}

.post-empty {
  margin: 4px 0;
  color: #5e7e95;
  font-size: 0.92rem;
}

.post-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fdff;
  cursor: pointer;
}

.post-item:hover {
  background: #eaf6ff;
}

.post-line {
  margin: 0;
  line-height: 1.45;
  color: #2b4459;
  font-size: 0.92rem;
}

.post-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-family: var(--font-title);
}

.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-empty {
  color: var(--muted);
  padding: 22px 8px;
}

.letter {
  border: 1px dashed #9fcae8;
  border-radius: 12px;
  padding: 12px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.62), rgba(245, 251, 255, 0.86)),
    repeating-linear-gradient(to bottom, rgba(150, 196, 228, 0.17) 0, rgba(150, 196, 228, 0.17) 1px, transparent 1px, transparent 30px);
}

.letter-title {
  margin: 0 0 6px;
  font-family: var(--font-title);
}

.letter-body {
  margin: 10px 0;
  line-height: 1.62;
  white-space: pre-wrap;
}

.reply-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.reply-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fdff;
  padding: 8px;
}

.row {
  display: flex;
  gap: 8px;
}

.row > * {
  flex: 1;
}

.global-error {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(95vw, 860px);
  background: #9e1a1a;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  z-index: 50;
  font-weight: 600;
}

.send-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(31, 76, 114, 0.26);
  backdrop-filter: blur(5px);
  animation: overlayFade 0.24s ease-out;
}

.send-overlay[hidden] {
  display: none !important;
}

.send-card {
  width: min(90vw, 460px);
  background: linear-gradient(150deg, #ffffff, #e8f6ff);
  border: 1px solid #b7d9ef;
  border-radius: 16px;
  box-shadow: 0 18px 35px rgba(67, 39, 18, 0.3);
  padding: 20px 18px;
  text-align: center;
  transform-origin: center;
  animation: cardPop 0.35s ease-out;
}

.flight-stage {
  position: relative;
  height: 100px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fcff, #eaf6ff);
  border: 1px solid #d0e7f5;
}

.overlay-plane {
  position: absolute;
  left: 12px;
  top: 56px;
  font-size: 1.7rem;
  opacity: 0;
}

.overlay-mailbox {
  position: absolute;
  right: 16px;
  top: 42px;
  width: 64px;
  height: 40px;
  border-radius: 20px 20px 9px 9px;
  background: linear-gradient(160deg, #fd8d54, #ea5a20);
  border: 2px solid #b5441a;
}

.overlay-slot {
  position: absolute;
  left: 50%;
  top: 13px;
  transform: translateX(-50%);
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: #5c2b17;
}

.send-card.is-playing .overlay-plane {
  animation: planeToBox 1.2s ease-out forwards;
}

.send-card h3 {
  margin: 2px 0 8px;
  font-size: 1.25rem;
  font-family: var(--font-title);
}

.send-card p {
  margin: 0;
  color: #4e667c;
  line-height: 1.5;
}

@keyframes planeToBox {
  0% {
    transform: translate(0, 0) rotate(-22deg) scale(1);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  82% {
    transform: translate(190px, -34px) rotate(8deg) scale(0.9);
    opacity: 1;
  }
  100% {
    transform: translate(215px, -30px) rotate(20deg) scale(0.45);
    opacity: 0;
  }
}

@keyframes cardPop {
  0% {
    transform: translateY(8px) scale(0.97);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes overlayFade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes cloudMove {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(100vw + 300px));
  }
}

@keyframes cloudFloat {
  0% {
    margin-top: 0;
  }
  50% {
    margin-top: 6px;
  }
  100% {
    margin-top: 0;
  }
}

@keyframes dropLetter {
  0% {
    transform: translate(-50%, -6px) rotate(-8deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    transform: translate(-50%, 84px) rotate(2deg) scale(0.92);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 96px) rotate(6deg) scale(0.68);
    opacity: 0;
  }
}

@keyframes slotFlash {
  0% {
    box-shadow: 0 0 0 rgba(255, 241, 231, 0);
  }
  40% {
    box-shadow: 0 0 14px rgba(255, 241, 231, 0.9);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 241, 231, 0);
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel-list {
    order: 2;
  }

  .panel-detail {
    order: 3;
  }

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

  .landscape {
    height: 150px;
  }

  .tree {
    transform: scale(0.85);
  }
}
