:root {
  --bg: #fff8f4;
  --card: #ffffff;
  --ink: #33242a;
  --muted: rgba(51, 36, 42, 0.56);
  --line: rgba(255, 107, 129, 0.16);
  --pink: #ff6b81;
  --pink-deep: #ff4f6d;
  --peach: #ffb36b;
  --blue: #6a8cff;
  --radius: 20px;
  --shadow: 0 12px 28px rgba(255, 107, 129, 0.1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffe6e2 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #fff1dd 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100%;
}

body { padding-bottom: env(safe-area-inset-bottom); }

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

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* ---------- 开场 ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 22px 40px; max-width: 520px; margin: 0 auto; }
.brand-mark { font-size: 13px; letter-spacing: 0.18em; color: var(--muted); }
.hero-title { font-size: 40px; line-height: 1.15; margin: 8px 0 10px; font-weight: 900; letter-spacing: -0.5px; }
.hero-title em { font-style: normal; color: var(--pink); }
.hero-sub { color: var(--muted); margin: 0 0 26px; font-size: 14px; }

.panel { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.panel h3 { margin: 0 0 10px; font-size: 15px; }
.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffaf8;
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.12); }
.code-input { text-transform: uppercase; letter-spacing: 0.22em; font-weight: 800; text-align: center; }
.textarea { resize: none; min-height: 92px; line-height: 1.6; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, #ff8196, var(--pink-deep)); color: #fff; border: 0; box-shadow: 0 10px 22px rgba(255, 79, 109, 0.28); }
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.foot-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.7; }

/* ---------- 顶部 ---------- */
.app-head { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 16px; }
.couple-line { font-size: 20px; font-weight: 900; letter-spacing: -0.3px; line-height: 1.3; }
.couple-line .heart { color: var(--pink); font-size: 16px; margin: 0 2px; }
.days-line { color: var(--muted); font-size: 12px; margin-top: 3px; }
.days-line b { color: var(--pink); font-size: 15px; }
.code-chip {
  margin-left: auto;
  border: 1px dashed rgba(255, 107, 129, 0.4);
  background: #fff;
  color: var(--pink-deep);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  white-space: nowrap;
}
.head-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.gear { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px; }

/* ---------- 发布 ---------- */
.composer { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 18px; }
.moods { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 2px; margin-bottom: 10px; }
.mood {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fffaf8;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}
.mood.on { background: #fff0f2; border-color: var(--pink); color: var(--pink-deep); font-weight: 700; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: 12px; overflow: hidden; background: #f6eeea; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 12px; line-height: 1; cursor: pointer;
}
.composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.photo-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: #fffaf8; font-size: 18px; cursor: pointer; color: var(--pink);
}
.publish { flex: 1; margin-left: auto; width: auto; padding: 11px 22px; border-radius: 12px; }
.counter { font-size: 11px; color: var(--muted); }

/* ---------- 动态 ---------- */
.feed { display: flex; flex-direction: column; gap: 14px; }
.post { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.post-head { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #fff0f2; font-size: 17px; flex: 0 0 auto;
}
.avatar.b { background: #eef2ff; }
.post-who { font-weight: 800; font-size: 14px; }
.post-time { font-size: 11px; color: var(--muted); }
.post-mood { margin-left: auto; font-size: 12px; background: #fff6ee; color: #b06a2c; border-radius: 999px; padding: 4px 9px; }
.post-del { border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; margin-left: 8px; }
.post-text { margin: 10px 0 0; white-space: pre-wrap; word-break: break-word; }
.photos { display: grid; gap: 6px; margin-top: 10px; }
.photos.n1 { grid-template-columns: 1fr; }
.photos.n2 { grid-template-columns: 1fr 1fr; }
.photos.n3 { grid-template-columns: 1fr 1fr 1fr; }
.photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; cursor: zoom-in; background: #f4ece8; }
.photos.n1 img { width: 100%; height: auto; max-height: 480px; object-fit: cover; }
.photos.n2 img, .photos.n3 img { aspect-ratio: 1; }
.post-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.act {
  border: 0; background: transparent; padding: 4px 0; font-size: 13px; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.act.liked { color: var(--pink-deep); font-weight: 800; }
.act .emoji { font-size: 16px; }
.comments { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.comment { font-size: 13px; color: #4a3840; line-height: 1.5; }
.comment b { color: var(--pink-deep); font-weight: 700; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form .input { padding: 8px 11px; border-radius: 10px; }
.comment-form .btn { width: auto; padding: 8px 14px; border-radius: 10px; }

.empty { text-align: center; padding: 46px 16px; color: var(--muted); }
.empty .big { font-size: 38px; margin-bottom: 10px; }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(36, 20, 26, 0.55); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
.sheet {
  width: 100%; max-width: 640px; background: #fff; border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto;
}
.sheet h3 { margin: 0 0 14px; font-size: 17px; }
.sheet .row { display: flex; gap: 10px; margin-top: 8px; }
.sheet .row .btn { flex: 1; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 6, 8, 0.94); z-index: 60; display: grid; place-items: center; padding: 12px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(40, 26, 32, 0.92); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 999px;
  z-index: 70; pointer-events: none; animation: toast-in 0.18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }

@media (min-width: 700px) {
  .wrap { padding-top: 30px; }
  .composer { position: sticky; top: 10px; z-index: 5; }
}
