/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg1: #07130e; --bg2: #0d2419; --bg3: #143526;
  --green: #7fe0a7; --green-soft: #bdf2d3; --green-deep: #1c5b3c;
  --gold: #f2d98c; --text: #eef7ee; --muted: #a9c4b0;
  --card: rgba(255, 255, 255, .045);
  --card-border: rgba(159, 216, 180, .18);
  --kai: "STKaiti", "KaiTi", "Kaiti SC", "FangSong", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 700px at 75% -10%, #1d4a33 0%, transparent 60%),
    radial-gradient(900px 650px at 5% 110%, #123024 0%, transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2) 45%, var(--bg3));
}
button { font-family: inherit; }
main { max-width: 640px; margin: 0 auto; padding-bottom: 70px; }
::selection { background: var(--green); color: #0d2a1b; }

/* ============ 星空 ============ */
#stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star {
  position: absolute; background: #dff7e8; border-radius: 50%;
  opacity: .7; animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .2; transform: scale(.8); }
  50% { opacity: .9; transform: scale(1.2); }
}

/* ============ 首屏 ============ */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 24px; position: relative; z-index: 1;
}
.hero-visual { position: relative; width: 230px; height: 230px; margin-bottom: 28px; }
.planet {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #b9f0cf, #4fae7f 45%, #1c5b3c 80%);
  box-shadow:
    0 0 42px rgba(127, 224, 167, .45),
    inset -12px -10px 30px rgba(0, 0, 0, .35),
    inset 8px 8px 24px rgba(255, 255, 255, .12);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.5rem; color: #0d2a1b;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 42px rgba(127,224,167,.45), inset -12px -10px 30px rgba(0,0,0,.35), inset 8px 8px 24px rgba(255,255,255,.12); }
  50% { box-shadow: 0 0 64px rgba(127,224,167,.7), inset -12px -10px 30px rgba(0,0,0,.35), inset 8px 8px 24px rgba(255,255,255,.12); }
}
.orbit { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.orbit-1 { width: 100%; height: 100%; border: 1px dashed rgba(184, 242, 207, .35); animation: spin 14s linear infinite; }
.orbit-2 { width: 70%; height: 70%; border: 1px dashed rgba(242, 217, 140, .35); animation: spin 9s linear infinite reverse; }
.orbit-dot { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 1.1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.title {
  font-family: var(--kai); font-weight: 700;
  font-size: clamp(1.9rem, 6vw, 2.6rem); letter-spacing: .12em;
}
.accent { color: var(--green-soft); }
.typewriter { min-height: 1.8em; margin-top: 14px; color: var(--muted); font-size: 1rem; }
.cursor { color: var(--green); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { margin-top: 10px; color: var(--gold); font-size: .95rem; letter-spacing: .05em; }
.scroll-hint {
  position: absolute; bottom: 26px; left: 0; right: 0;
  color: var(--muted); font-size: .85rem; animation: bounce 1.6s ease-in-out infinite;
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px; padding: 26px 20px; margin: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
  position: relative; z-index: 1;
}
.card h2 {
  font-size: 1.12rem; letter-spacing: .14em; text-align: center;
  color: var(--green-soft); margin-bottom: 4px;
}
.section-sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 18px; }

/* ============ 时间卡片 ============ */
.clock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 480px) { .clock-grid { grid-template-columns: 1fr; gap: 14px; } }
.clock-item { background: rgba(0, 0, 0, .18); border-radius: 14px; padding: 16px 8px; text-align: center; }
.clock-num {
  font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; color: var(--green-soft);
  text-shadow: 0 0 20px rgba(127, 224, 167, .45);
}
.clock-label { font-size: .78rem; color: var(--muted); margin-top: 6px; letter-spacing: .06em; }

/* ============ 心的航线 ============ */
.route { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.route-label { font-size: .85rem; color: var(--green-soft); white-space: nowrap; }
.route-line {
  flex: 1; height: 3px; border-radius: 3px; position: relative;
  background: linear-gradient(90deg, var(--green), var(--gold));
  box-shadow: 0 0 12px rgba(127, 224, 167, .35);
}
.route-heart {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  font-size: 1.25rem; white-space: nowrap;
  filter: drop-shadow(0 0 8px rgba(127, 224, 167, .9));
}

/* ============ 照片墙 ============ */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px; }
@media (min-width: 560px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.polaroid {
  background: #f2ecdd; padding: 8px 8px 12px; border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  transform: rotate(-2deg); transition: transform .3s;
}
.polaroid:nth-child(even) { transform: rotate(2.2deg); }
.polaroid:hover { transform: rotate(0) scale(1.04); }
.polaroid .ph {
  aspect-ratio: 1 / 1; border-radius: 4px;
  background: linear-gradient(135deg, #d9f3e3, #a3d9ba);
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem;
}
.polaroid img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px; display: none;
}
.polaroid figcaption {
  padding-top: 8px; text-align: center; font-size: .8rem;
  color: #4a5c50; font-family: var(--kai);
}

/* ============ 美食清单 ============ */
.food-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: rgba(0, 0, 0, .18); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 10px;
  color: var(--text); font-size: .95rem; cursor: pointer; transition: all .25s;
}
.food-item:hover { border-color: var(--green); }
.food-emoji { font-size: 1.2rem; }
.food-name { flex: 1; text-align: left; }
.food-city {
  font-size: .72rem; color: var(--muted);
  border: 1px solid var(--card-border); border-radius: 999px; padding: 2px 8px;
}
.food-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--muted); display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: transparent; transition: all .25s;
}
.food-item.done { opacity: .62; }
.food-item.done .food-name { text-decoration: line-through; }
.food-item.done .food-check { background: var(--green); border-color: var(--green); color: #0d2a1b; font-weight: 700; }
.food-progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 16px; }
#food-bar {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .5s;
}
.food-progress-text { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* ============ 答题 ============ */
.quiz-q { text-align: center; margin-bottom: 14px; }
.quiz-num {
  display: inline-block; font-size: .72rem; color: var(--gold);
  border: 1px solid rgba(242, 217, 140, .4); border-radius: 999px;
  padding: 2px 10px; margin-bottom: 8px;
}
.quiz-q p { font-size: 1.05rem; }
.quiz-opt {
  display: block; width: 100%; background: rgba(0, 0, 0, .18);
  border: 1px solid var(--card-border); border-radius: 12px;
  padding: 12px; margin-bottom: 10px; color: var(--text);
  font-size: .95rem; cursor: pointer; transition: all .2s;
}
.quiz-opt:hover { border-color: var(--green-soft); transform: translateY(-1px); }
.quiz-opt.right { border-color: var(--green); background: rgba(127, 224, 167, .15); animation: pop .35s; }
.quiz-opt.wrong { border-color: #e08a8a; animation: shake .4s; }
.quiz-tease { text-align: center; color: #e8b4b4; font-size: .85rem; margin-top: 4px; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ============ 信 ============ */
.hidden { display: none !important; }
.letter-paper {
  background: linear-gradient(180deg, #fbf6e8, #f4ecd9);
  color: #3d4a41; font-family: var(--kai);
  border-radius: 10px; padding: 34px 26px 28px;
  line-height: 2.1; font-size: 1.02rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .4);
  position: relative; transform: scale(.92); opacity: 0;
  transition: all .9s ease;
}
#letter.open .letter-paper { transform: scale(1); opacity: 1; }
.letter-seal {
  position: absolute; top: -16px; right: 20px; width: 48px; height: 48px;
  border-radius: 50%; background: linear-gradient(135deg, #63c08e, #2c7a52);
  color: #eafaf0; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; box-shadow: 0 5px 14px rgba(0, 0, 0, .35); transform: rotate(12deg);
}

/* ============ 飘浮爱心 / 彩带 ============ */
.float-heart {
  position: fixed; pointer-events: none; z-index: 98; user-select: none;
  animation: floatUp 2s ease-out forwards;
}
@keyframes floatUp { to { transform: translateY(-150px) rotate(24deg); opacity: 0; } }
.confetti {
  position: fixed; top: -30px; pointer-events: none; z-index: 97;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(115vh) rotate(340deg); opacity: .5; } }

/* ============ 提示 / 音乐按钮 ============ */
#toast {
  position: fixed; top: 18px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(13, 36, 25, .92); border: 1px solid var(--card-border);
  color: var(--text); padding: 10px 18px; border-radius: 999px; font-size: .85rem;
  opacity: 0; pointer-events: none; transition: all .35s; z-index: 100;
  max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#music-btn {
  position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--card-border);
  background: rgba(13, 36, 25, .9); color: var(--text);
  font-size: 1.1rem; cursor: pointer; z-index: 90; transition: transform .2s;
}
#music-btn:hover { transform: scale(1.1); }

/* ============ 页脚 ============ */
footer {
  position: relative; z-index: 1; text-align: center;
  color: var(--muted); font-size: .78rem; padding: 26px 16px 40px; letter-spacing: .04em;
}
footer .egg { color: #5c7a68; margin-top: 8px; font-size: .72rem; }

/* ============ 我们的碎碎念 ============ */
.board-feed { margin-top: 16px; }
.board-empty {
  text-align: center; color: var(--muted); font-size: .88rem;
  padding: 26px 0; border: 1.5px dashed var(--card-border); border-radius: 14px;
}
.board-note {
  background: #f4efe0; color: #3d4a41; border-radius: 14px;
  padding: 14px 16px; margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .32);
  transition: transform .25s;
}
.board-note:hover { transform: rotate(0deg) scale(1.02) !important; }
.board-note-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.board-note-from {
  font-weight: 700; font-size: .82rem; color: #1c5b3c;
  background: rgba(127, 224, 167, .35); border-radius: 999px; padding: 2px 10px;
}
.board-note-time { font-size: .72rem; color: #8a9c8f; }
.board-note-text {
  font-size: .95rem; line-height: 1.75; word-break: break-word;
  white-space: pre-wrap; font-family: var(--kai);
}
.board-note-img {
  width: 100%; margin-top: 10px; border-radius: 10px; cursor: zoom-in;
  display: block; max-height: 420px; object-fit: cover;
}
.board-bar { display: flex; gap: 10px; margin-top: 18px; }
.board-compose-btn {
  flex: 1; padding: 13px; border: none; border-radius: 999px; cursor: pointer;
  font-size: .98rem; letter-spacing: .08em; color: #0d2a1b; font-weight: 700;
  background: linear-gradient(90deg, var(--green), var(--gold));
  box-shadow: 0 6px 18px rgba(127, 224, 167, .3); transition: transform .2s;
}
.board-compose-btn:active { transform: scale(.97); }
.board-refresh {
  width: 46px; border: 1px solid var(--card-border); border-radius: 50%;
  background: rgba(0, 0, 0, .18); color: var(--muted); font-size: 1rem; cursor: pointer;
}
.board-refresh:active { transform: rotate(180deg); transition: transform .4s; }

/* 发布面板（底部弹出） */
.board-panel { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; justify-content: center; }
.board-panel[hidden] { display: none; }
.board-panel-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .3s; }
.board-sheet {
  position: relative; width: 100%; max-width: 560px;
  background: linear-gradient(180deg, #123024, #0d2419);
  border: 1px solid var(--card-border); border-bottom: none;
  border-radius: 22px 22px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .32s cubic-bezier(.22, .8, .36, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
}
.board-panel.open .board-panel-mask { opacity: 1; }
.board-panel.open .board-sheet { transform: translateY(0); }
.board-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; color: var(--green-soft); letter-spacing: .1em;
}
.board-close {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, .2); color: var(--muted); cursor: pointer;
}
.board-field { position: relative; display: block; margin-bottom: 12px; }
.board-field-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.board-field input, .board-field textarea {
  width: 100%; background: rgba(0, 0, 0, .22); border: 1px solid var(--card-border);
  border-radius: 12px; color: var(--text); padding: 11px 13px; font-size: .95rem;
  font-family: inherit; resize: none; outline: none; transition: border-color .2s;
}
.board-field input:focus, .board-field textarea:focus { border-color: var(--green); }
.board-count { position: absolute; right: 12px; bottom: 10px; font-size: .7rem; color: var(--muted); pointer-events: none; }
.board-img-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.board-img-btn {
  padding: 9px 14px; border-radius: 999px; border: 1px dashed var(--green);
  background: rgba(127, 224, 167, .08); color: var(--green-soft); font-size: .85rem; cursor: pointer;
}
#board-img-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--card-border); }
.board-img-del {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: #5a3232; color: #ffd9d9; font-size: .75rem; cursor: pointer;
}
.board-send {
  width: 100%; padding: 13px; border: none; border-radius: 999px; cursor: pointer;
  font-size: 1rem; letter-spacing: .12em; color: #0d2a1b; font-weight: 700;
  background: linear-gradient(90deg, var(--green), var(--gold));
  box-shadow: 0 6px 18px rgba(127, 224, 167, .3);
}
.board-send:disabled { opacity: .6; }
.board-hint { text-align: center; color: var(--muted); font-size: .72rem; margin-top: 12px; }

/* 看图灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 99; background: rgba(3, 10, 7, .92);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 0 50px rgba(127, 224, 167, .25); }

/* ============ 隐藏星星 ============ */
.magic-star {
  position: absolute; z-index: 3; background: none; border: none; cursor: pointer;
  font-size: 1.15rem; color: var(--gold); padding: 12px; line-height: 1;
  text-shadow: 0 0 10px rgba(242, 217, 140, .55);
  animation: starPulse 3s ease-in-out infinite;
  transition: transform .2s;
}
.magic-star:hover { transform: scale(1.22); }
.magic-star.found {
  color: #ffe9a8; animation: none;
  text-shadow: 0 0 16px rgba(242, 217, 140, .95);
}
.magic-star.pop { animation: starPop .65s ease; }
@keyframes starPulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes starPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.65); filter: brightness(1.7); }
  100% { transform: scale(1); }
}
/* 五颗星的位置（藏在原有设计的角落里，不改变布局） */
.magic-star[data-star="star-hero"]  { top: 4px; right: 26px; }
.magic-star[data-star="star-clock"] { top: 8px; right: 12px; }
.magic-star[data-star="star-route"] { bottom: 2px; right: 14px; }
.magic-star[data-star="star-photo"] { top: 6px; left: 14px; }
.magic-star[data-star="star-foot"]  { top: 4px; right: 20px; }

/* 发现进度 + 信封入口（左下角） */
.star-counter {
  position: fixed; left: 16px; bottom: 16px; z-index: 90;
  background: rgba(13, 36, 25, .9); border: 1px solid var(--card-border);
  color: var(--gold); padding: 9px 14px; border-radius: 999px;
  font-size: .82rem; letter-spacing: .06em; pointer-events: none;
}
.envelope-btn {
  position: fixed; left: 16px; bottom: 62px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(242, 217, 140, .5);
  background: rgba(13, 36, 25, .9); font-size: 1.25rem; cursor: pointer;
  opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s;
  animation: envPulse 2.2s ease-in-out infinite;
}
.envelope-btn.show { opacity: 1; transform: translateY(0); }
@keyframes envPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(242, 217, 140, 0); }
  50% { box-shadow: 0 0 18px rgba(242, 217, 140, .5); }
}

/* ============ 最终信封 ============ */
.env-overlay {
  position: fixed; inset: 0; z-index: 96;
  background: rgba(3, 10, 7, .85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .4s;
}
.env-overlay[hidden] { display: none; }
.env-overlay.show { opacity: 1; }
.env-stage { perspective: 900px; cursor: pointer; }
.env {
  position: relative; width: min(240px, 72vw); height: 160px;
  transform-style: preserve-3d;
}
.env-flap, .env-pocket {
  position: absolute; inset: 0; border-radius: 8px;
  background: linear-gradient(180deg, #fbf6e8, #efe6cf);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.env-flap {
  clip-path: polygon(0 0, 100% 0, 50% 52%);
  transform-origin: top; z-index: 3;
  transition: transform .8s cubic-bezier(.4, .1, .3, 1);
}
.env-pocket {
  z-index: 2; clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  display: flex; align-items: center; justify-content: center;
}
.env-seal { font-size: 1.6rem; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.env-letter {
  position: absolute; left: 50%; bottom: 10px; width: min(230px, 72vw);
  max-height: 54vh; overflow-y: auto; z-index: 1;
  transform: translateX(-50%) translateY(36%);
  opacity: 0;
  transition: transform .9s cubic-bezier(.4, .1, .3, 1) .12s, opacity .7s .15s;
  border-radius: 10px;
}
.env-stage.opened .env-flap { transform: rotateX(-180deg); }
.env-stage.opened .env-letter {
  transform: translateX(-50%) translateY(calc(-100% + 26px));
  opacity: 1;
}
.env-paper {
  background: linear-gradient(180deg, #fdfaf1, #f6efdc);
  border-radius: 10px; padding: 20px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  color: #3d4a41; font-family: var(--kai);
  font-size: .95rem; line-height: 1.95;
}
.env-hint { margin-top: 26px; color: var(--muted); font-size: .82rem; letter-spacing: .08em; }

/* ============ 减弱动效 ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
