/* ===== 记忆星海 · 粒子相册 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  user-select: none;
}

#stage {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

/* 暗角，让边缘更黑、主体更聚焦 */
#vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 55%, rgba(0,0,0,.55) 100%);
}

/* ===== 加载屏 ===== */
#loader {
  position: fixed; inset: 0;
  background: #000;
  z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 34px;
  transition: opacity .9s ease;
}
#loader.done { opacity: 0; pointer-events: none; }

#loader-text {
  color: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 15px;
  letter-spacing: .45em;
  text-indent: .45em;
  white-space: nowrap;
}

#loader-bar {
  width: 264px; height: 2px;
  background: rgba(255,255,255,.14);
  border-radius: 2px;
  overflow: hidden;
}
#loader-bar-fill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, #9db8ff, #ffffff);
  border-radius: 2px;
  transition: width .25s ease;
}

/* ===== 左上：返回现实（加载完成后淡入） ===== */
#btn-back {
  position: fixed; top: 26px; left: 26px;
  z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  background: rgba(10,10,12,.55);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #eee;
  font-size: 14px; letter-spacing: 2px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0; transform: translateY(-10px);
  transition: background .25s, transform .25s, opacity .9s ease .3s;
}
#btn-back.show { opacity: 1; transform: translateY(0); }
#btn-back:hover { background: rgba(40,40,48,.7); }

/* ===== 音乐播放条 ===== */
#music-pill {
  position: fixed; top: 26px; left: 190px;
  z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px 9px 14px;
  background: rgba(10,10,12,.55);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-10px);
  transition: opacity .9s ease .5s, transform .9s ease .5s;
}
#music-pill.show { opacity: 1; transform: translateY(0); }
#music-info { line-height: 1.25; }
#music-title { color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 1px; }
#music-artist { color: #9a9aa2; font-size: 11px; }
#music-divider { width: 1px; height: 22px; background: rgba(255,255,255,.16); }
#music-pill button {
  background: none; border: none;
  color: #cfcfd6; font-size: 14px;
  cursor: pointer; padding: 4px 5px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
#music-pill button:hover { color: #fff; background: rgba(255,255,255,.08); }

/* 播放时音符跳动 */
#music-pill.playing #music-icon {
  animation: note-bounce 1s ease-in-out infinite;
  transform-origin: 50% 80%;
}
@keyframes note-bounce {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50%      { transform: rotate(8deg) translateY(-3px); }
}

/* ===== 底部提示 ===== */
#photo-hint {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  color: rgba(255,255,255,.38);
  font-size: 12px; letter-spacing: 3px;
  pointer-events: none;
  transition: opacity 1.2s ease;
  white-space: nowrap;
}
#photo-hint.fade { opacity: 0; }

/* ===== 照片日记弹窗（左图右面板 + 评论，对齐参考视频） ===== */
#diary-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
#diary-overlay.on { opacity: 1; pointer-events: auto; }

#diary-dialog {
  position: relative;
  width: min(860px, 92vw); height: min(560px, 84vh);
  display: flex;
  background: rgba(16,17,24,.92);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transform: translateY(14px) scale(.98);
  transition: transform .3s ease;
}
#diary-overlay.on #diary-dialog { transform: translateY(0) scale(1); }

#diary-photo {
  flex: 0 0 55%;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
}
#diary-photo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

#diary-panel {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 26px 26px 18px;
  min-width: 0;
}

#diary-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #ddd; font-size: 14px; line-height: 1;
  cursor: pointer;
  transition: background .2s, color .2s;
}
#diary-close:hover { background: rgba(255,255,255,.16); color: #fff; }

#diary-kicker { color: rgba(255,255,255,.45); font-size: 12px; letter-spacing: 3px; }

/* ===== 感言信纸卡片：金色角标 + 金色渐变文字 ===== */
#diary-note-card {
  position: relative;
  flex: 1;
  margin-top: 18px;
  padding: 28px 26px 18px;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(255,215,0,.06), rgba(255,255,255,.02) 45%);
  border: 1px solid rgba(255,215,0,.18);
  border-radius: 4px;
  min-height: 0;
}
/* 左上 / 右下 金色相框角标 */
#diary-note-card::before,
#diary-note-card::after {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  border: 0 solid rgba(255,203,64,.65);
}
#diary-note-card::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
#diary-note-card::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

#diary-title {
  font-size: 21px; font-weight: 700;
  line-height: 2; letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 0 0 12px rgba(255,255,255,.12);
  word-break: break-word; white-space: pre-wrap;
  overflow-y: auto; min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}

/* 时间 / 心情标签胶囊（对齐博客文章头部的 #标签 样式，粉色系） */
#diary-tags {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed rgba(255,203,64,.3);
  display: flex; flex-wrap: wrap; gap: 8px;
  flex-shrink: 0;
}
.diary-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,122,184,.1);
  border: 1px solid rgba(255,122,184,.28);
  color: #ff8cc6;
  font-size: 12px; letter-spacing: 1px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  #diary-dialog { flex-direction: column; }
  #diary-photo { flex: 0 0 42%; }
}

/* ===== 拖入照片提示层 ===== */
#drop-hint {
  position: fixed; inset: 18px;
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(180,140,255,.55);
  border-radius: 22px;
  background: rgba(20,14,36,.42);
  color: #d9c8ff;
  font-size: 20px; letter-spacing: 6px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
#drop-hint.on { opacity: 1; }
