/* =====================================================
   🌌 恋爱小宇宙 · 样式
   ===================================================== */

:root {
  --bg1: #070b1e;
  --bg2: #171238;
  --accent: #ff8fab;
  --accent2: #ffd6a5;
  --text: #f5f3ff;
  --muted: #a9a6cf;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-line: rgba(255, 255, 255, 0.12);
  --radius: 20px;
}

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

html { height: 100%; }

body {
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 143, 171, 0.14), transparent 60%),
    radial-gradient(1000px 500px at 10% 110%, rgba(255, 214, 165, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  overflow-x: hidden;
}

.custom-bg {
  position: fixed; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  display: none;
}
.custom-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(rgba(10, 9, 28, 0.6), rgba(10, 9, 28, 0.82));
}
#starfield {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hidden { display: none !important; }

/* ---------------- 暗号门 ---------------- */
#gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(7, 11, 30, 0.72);
  backdrop-filter: blur(10px);
  transition: opacity .5s ease;
}

.gate-card {
  width: 100%; max-width: 360px;
  text-align: center;
  padding: 36px 28px;
  border-radius: 28px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: rise .7s ease both;
}

.gate-planet { font-size: 44px; animation: bob 3s ease-in-out infinite; }

.gate-card h1 { font-size: 24px; margin: 10px 0 6px; letter-spacing: 1px; }
.gate-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

#gateForm { display: flex; gap: 10px; }

#gateInput {
  flex: 1; min-width: 0;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 16px;
  text-align: center;
  letter-spacing: 6px;
  outline: none;
  transition: border-color .2s;
}
#gateInput:focus { border-color: var(--accent); }
#gateInput::placeholder { letter-spacing: 1px; color: var(--muted); }

#gateForm button {
  padding: 13px 18px;
  border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #ff6f91);
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s;
}
#gateForm button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 111, 145, .35); }

.gate-hint { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

.gate-card.shake { animation: shake .45s ease; }

/* ---------------- 主布局 ---------------- */
#app { position: relative; z-index: 1; animation: fade .8s ease both; }

#main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 110px;
}

.page { display: none; animation: fade .45s ease both; }
.page.active { display: block; }

.page-head { text-align: center; margin: 8px 0 22px; }
.page-head h2 { font-size: 24px; letter-spacing: 1px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* ---------------- 首页 ---------------- */
.hero { text-align: center; padding: 22px 0 26px; }
.hero-eyebrow {
  font-size: 12.5px; letter-spacing: 4px;
  color: var(--accent2); text-transform: uppercase;
}
.hero-title {
  margin-top: 10px;
  font-size: clamp(30px, 7vw, 44px);
  letter-spacing: 2px;
  background: linear-gradient(120deg, #fff, var(--accent) 45%, var(--accent2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { margin-top: 10px; color: var(--muted); font-size: 14.5px; }

.card {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  margin-bottom: 16px;
}

.day-card { text-align: center; padding: 30px 22px; }
.day-label { color: var(--muted); font-size: 14px; letter-spacing: 3px; }
.day-number { margin: 10px 0 6px; }
.day-number span:first-child {
  font-size: clamp(52px, 13vw, 76px);
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.day-unit { font-size: 20px; margin-left: 6px; color: var(--muted); }
.day-tick { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

.anni-card { text-align: center; padding: 24px 22px; }
.anni-emoji { font-size: 30px; }
.anni-text { margin-top: 8px; font-size: 17px; }
.anni-tick { margin-top: 4px; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }

.milestones { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.milestone {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  padding: 14px;
  display: flex; align-items: center; gap: 10px;
}
.milestone .mi-icon { font-size: 22px; }
.milestone .mi-label { display: block; font-size: 13px; color: var(--muted); }
.milestone .mi-days { display: block; font-size: 15px; font-weight: 600; margin-top: 2px; }

.tip-card { text-align: center; color: var(--muted); font-size: 13.5px; }
.tip-card b { color: var(--accent2); }

/* ---------------- 生日星座卡 ---------------- */
.bday-top { display: flex; align-items: center; gap: 14px; }
.bday-zodiac { font-size: 44px; line-height: 1; }
.bday-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bday-sky { flex: 0 0 auto; margin-left: auto; text-align: center; }
#constCanvas { width: 128px; height: auto; display: block; }
.bday-sky-cap {
  display: block; margin-top: 2px;
  font-size: 11px; color: var(--muted); letter-spacing: 2px;
}
@media (max-width: 420px) { #constCanvas { width: 100px; } }
.bday-name { font-size: 19px; font-weight: 600; }
.bday-name i {
  font-style: normal;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
  letter-spacing: 1.5px;
}
.bday-range { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.bday-date { margin-top: 16px; font-size: 14.5px; }
.bday-count { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--accent2); }
.bday-traits { margin-top: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.8; }

/* ---------------- 相册 ---------------- */
.photo-grid {
  column-count: 2; column-gap: 14px;
}
@media (min-width: 640px) { .photo-grid { column-count: 3; } }

.polaroid {
  break-inside: avoid;
  margin-bottom: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 10px 12px;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  transition: transform .25s ease, box-shadow .25s ease;
  animation: rise .5s ease both;
}
.polaroid:hover { transform: scale(1.03) rotate(0deg) !important; box-shadow: 0 20px 44px rgba(0,0,0,.5); }
.polaroid:nth-child(3n)   { transform: rotate(2deg); }
.polaroid:nth-child(3n+1) { transform: rotate(-2deg); }

.polaroid img {
  display: block; width: 100%;
  border-radius: 8px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #eee;
}
.polaroid .cap {
  margin-top: 8px;
  color: #5b4a68;
  font-size: 13px;
  text-align: center;
}

.polaroid.placeholder { background: linear-gradient(160deg, #2b2350, #43306b); }
.polaroid.placeholder .ph-emoji { font-size: 44px; text-align: center; padding: 46px 0 10px; }
.polaroid.placeholder .cap { color: rgba(255,255,255,.75); }

.hint-card {
  break-inside: avoid;
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--glass-line);
  border-radius: 16px;
  padding: 18px;
}

/* ---------------- 灯箱 ---------------- */
#lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 24px;
  background: rgba(5, 8, 22, 0.9);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  animation: fade .25s ease both;
}
#lightbox img {
  max-width: 92vw; max-height: 78vh;
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
#lightboxCap { color: var(--text); font-size: 14.5px; }

/* ---------------- 🪄 魔法手势 ---------------- */
.magic-toggle {
  position: absolute; top: 18px; right: 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 999px; padding: 8px 16px;
  font-size: 13.5px; cursor: pointer;
  backdrop-filter: blur(6px);
  z-index: 3;
  transition: background .2s ease;
}
.magic-toggle:hover { background: rgba(255, 255, 255, 0.2); }
.magic-toggle.on { background: rgba(155, 120, 255, 0.35); border-color: #b79aff; }
.magic-video {
  position: absolute; top: 62px; right: 18px;
  width: 110px; height: auto; aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1.5px solid rgba(183, 154, 255, 0.6);
  transform: scaleX(-1);
  z-index: 3;
  opacity: .92;
}
.magic-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}
.magic-hint {
  position: absolute; bottom: 16px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px; color: rgba(255, 255, 255, 0.85);
  background: rgba(20, 16, 45, 0.6);
  padding: 6px 14px; border-radius: 999px;
  white-space: nowrap; z-index: 3;
  backdrop-filter: blur(6px);
}
@media (max-width: 480px) {
  .magic-hint { font-size: 10.5px; white-space: normal; text-align: center; width: 86%; }
  .magic-video { width: 84px; top: 58px; }
}

/* ---------------- 游戏 ---------------- */
.subtabs {
  display: flex; gap: 8px;
  margin-bottom: 16px;
}
.subtab {
  flex: 1;
  padding: 11px 6px;
  border-radius: 14px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .2s;
}
.subtab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #ff6f91);
  box-shadow: 0 8px 20px rgba(255, 111, 145, .3);
}

.pane { display: none; animation: fade .3s ease both; }
.pane.active { display: block; }

.game-card { padding: 20px; }
.game-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; font-size: 14px; color: var(--muted);
}
.game-meta b { color: var(--accent2); }

.btn-ghost {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-line);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s;
}
.btn-ghost:hover { border-color: var(--accent); }

.btn-primary {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #ff6f91);
  color: #fff; font-size: 15.5px; font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn-primary:active { transform: scale(.97); }

/* 记忆翻牌 */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.mem-card { aspect-ratio: 3/4; perspective: 600px; cursor: pointer; }
.mem-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .4s ease;
}
.mem-card.flip .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: clamp(22px, 6vw, 30px);
}
.mem-face.front {
  background: linear-gradient(150deg, #2b2350, #43306b);
  border: 1px solid var(--glass-line);
}
.mem-face.front::after { content: "🌙"; opacity: .35; font-size: 20px; }
.mem-face.back {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--glass-line);
  transform: rotateY(180deg);
}
.mem-card.done .mem-face.back {
  background: rgba(255, 143, 171, 0.22);
  border-color: rgba(255, 143, 171, 0.5);
}
.win-banner { margin-top: 16px; text-align: center; font-size: 16px; color: var(--accent2); }

/* 问答 */
.quiz-q { font-size: 17px; line-height: 1.6; margin-bottom: 16px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
  transition: all .2s;
}
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt.correct { background: rgba(103, 232, 167, .18); border-color: #67e8a7; }
.quiz-opt.wrong   { background: rgba(255, 107, 129, .18); border-color: #ff6b81; }
.quiz-opt:disabled { cursor: default; opacity: .85; }

.quiz-progress { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.quiz-result { text-align: center; padding: 10px 0; }
.quiz-result .big { font-size: 40px; }
.quiz-result p { margin-top: 10px; line-height: 1.7; }

/* 情话胶囊 */
.note-card { text-align: center; padding: 30px 22px; }
.note-inner {
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255,143,171,.14), rgba(255,214,165,.10));
  border: 1px solid var(--glass-line);
  padding: 24px 18px;
}
.note-inner.flip { animation: noteFlip .5s ease; }
#noteText { font-size: 17.5px; line-height: 1.8; }

/* ---------------- 信 ---------------- */
.letter-card {
  font-size: 15.5px;
  line-height: 2.1;
  white-space: pre-wrap;
  min-height: 320px;
}
.letter-body p { margin: 0 0 10px; }
.letter-body p:last-child { margin-bottom: 0; }
.letter-body p.indent { text-indent: 2em; }
.letter-body p.greet { text-indent: 0; }
.letter-body p.sign { text-indent: 0; text-align: right; color: var(--muted); }
.caret { display: inline-block; animation: blink 1s step-end infinite; color: var(--accent); }
.letter-sign { text-align: right; color: var(--muted); margin-top: 18px; }

/* ---------------- 底部导航 ---------------- */
#tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex; gap: 6px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(15, 18, 44, 0.78);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 74px;
  padding: 8px 0 7px;
  border: none; border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: all .2s;
}
.tab span { font-size: 20px; }
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255,143,171,.25), rgba(255,214,165,.18));
}

/* ---------------- 音乐按钮 ---------------- */
#musicBtn {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 45;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-line);
  background: rgba(15, 18, 44, 0.78);
  color: var(--text);
  font-size: 19px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  animation: bob 2.6s ease-in-out infinite;
}
#musicBtn.playing { border-color: var(--accent); box-shadow: 0 0 18px rgba(255, 143, 171, .45); }

/* ---------------- 飘浮爱心 ---------------- */
.float-heart {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  font-size: 20px;
  animation: floatUp 1.1s ease-out forwards;
}

/* ---------------- 网页内容编辑器 ---------------- */
.edit-entry { display: flex; justify-content: center; margin: -6px 0 14px; }
.mini-edit {
  border: none; background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  border-radius: 999px; padding: 6px 14px;
  font-size: 12.5px; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.mini-edit:hover { background: rgba(255, 255, 255, 0.14); color: var(--text); }

.editor-overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(8, 7, 20, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fade .25s ease both;
}
.editor-sheet {
  background: #221c44;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 20px 18px 16px;
  width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.editor-sheet h3 { margin: 0 0 4px; font-size: 18px; }
.ed-hint { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.editor-sheet label {
  display: block;
  font-size: 13px; color: var(--muted);
  margin: 14px 0 6px;
}
.editor-sheet textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px; line-height: 1.7;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.editor-sheet textarea:focus { outline: none; border-color: var(--accent); }
.ed-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ed-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px; cursor: pointer;
}
.ed-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------------- 时光信笺 ---------------- */
.letters-list { display: flex; flex-direction: column; gap: 12px; }
.letter-item {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform .2s ease;
  animation: rise .4s ease both;
}
.letter-item:hover { transform: translateY(-2px); }
.letter-item.manage { outline: 2px dashed #e0566b; outline-offset: 3px; }
.li-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.li-date {
  font-size: 12px; color: #7a6fb0;
  background: rgba(120, 100, 220, 0.12);
  padding: 2px 9px; border-radius: 999px;
}
.li-title { font-size: 14.5px; font-weight: 600; color: #3a3160; }
.li-preview { font-size: 13.5px; color: #6b6584; line-height: 1.7; }
.letter-item .del-btn {
  display: none;
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(224, 86, 107, 0.92);
  color: #fff; font-size: 14px; cursor: pointer;
}
.letter-item.manage .del-btn { display: flex; }

/* 阅读器：米白信纸 */
.reader-overlay {
  position: fixed; inset: 0; z-index: 58;
  background: rgba(8, 7, 20, 0.78);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .25s ease both;
}
.reader-paper {
  position: relative;
  background: linear-gradient(175deg, #fdfaf3, #f6f0e0);
  color: #4a4232;
  border-radius: 16px;
  width: 100%; max-width: 560px;
  max-height: 86vh; overflow-y: auto;
  padding: 26px 24px 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  animation: rise .35s ease both;
}
.reader-paper .letter-body p { color: #4a4232; }
.reader-paper .letter-body p.sign { color: #8a7c5e; }
.reader-paper .caret { color: #b09a5e; }
.reader-x {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #6b6350; font-size: 14px; cursor: pointer;
}
.reader-meta {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px dashed #d8cfba;
}
#readerDate { font-size: 12.5px; color: #9a8d6c; }
#readerTitle { font-size: 16px; font-weight: 700; color: #4a4232; }
.reader-actions { display: flex; gap: 10px; margin-top: 18px; }
.reader-actions .ed-ghost { border-color: rgba(74, 66, 50, 0.3); color: #6b6350; }
.ed-ghost.danger { border-color: rgba(224, 86, 107, 0.5); color: #c94f63; }
.editor-sheet input[type="date"],
.editor-sheet input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.editor-sheet input:focus { outline: none; border-color: var(--accent); }
.mini-edit.on { border-style: solid; border-color: #e0566b; color: #ffb3bd; background: rgba(224, 86, 107, 0.12); }

/* ---------------- 动画 ---------------- */
@keyframes fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise   { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bob    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes blink  { 50% { opacity: 0; } }
@keyframes shake  { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes floatUp {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to   { opacity: 0; transform: translate(var(--dx, 0), -90px) scale(1.5); }
}
@keyframes noteFlip {
  0%   { transform: rotateY(0); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 云端照片上传 ---------------- */
.upload-bar {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 4px 0 16px;
}
/* 电脑上隐藏“拍照”按钮（没有意义），手机上显示 */
@media (pointer: fine) { #cameraBtn { display: none; } }
.upload-btn {
  border: 1.5px dashed var(--accent);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.upload-btn:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-1px); }
.upload-btn:disabled { opacity: .55; cursor: wait; }
.upload-btn.manage.on { border-style: solid; border-color: #e0566b; color: #ffb3bd; background: rgba(224, 86, 107, .12); }

.polaroid { position: relative; }
.polaroid .del-btn {
  display: none;
  position: absolute; top: 18px; right: 18px;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(224, 86, 107, .92);
  color: #fff; font-size: 15px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.manage-mode .polaroid.cloud .del-btn { display: flex; }
.manage-mode .polaroid.cloud { outline: 2px dashed #e0566b; outline-offset: 3px; }
.polaroid .up-ok {
  position: absolute; left: 50%; bottom: 40px;
  transform: translateX(-50%);
  background: rgba(30, 25, 60, .85); color: #fff;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
