/* =========================================================
   pages.css —— 子页面：相册 / 游戏 / 留言板
   ========================================================= */

/* =========================================================
   相册
   ========================================================= */
.gallery-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: clamp(20px, 3vw, 30px);
}
.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}
.tab {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 17px;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.35s var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.tab.is-active {
  color: #0d1120;
  background: linear-gradient(135deg, #ffe7bd, #ffc97f);
  font-weight: 600;
  box-shadow: 0 3px 14px -5px rgba(255, 195, 110, 0.8);
}
.gallery-tools {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.gallery-count {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-4);
}

/* 网格：给旋转和漂浮留出空间，别被裁掉 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(10px, 1.4vw, 18px);
  grid-auto-flow: dense;
  padding: clamp(20px, 3vw, 36px) 0 clamp(34px, 5vw, 64px);
  overflow: visible;
  /* 不要用 3D 变换：perspective + translateZ 会让浏览器对卡片的
     点击命中区域产生偏移（真实鼠标点不到某些卡片）。
     这里的"空间感"用 2D 的 rotate / translate / scale 叠加来做，效果一样，命中准确。 */
}

/* 无序漂浮：倾斜 / 位移 / 深度由 JS 写入，每张都不一样 */
/* 漂浮关键帧只做很小的上下呼吸；悬停抬升走 --lift，两者叠加不打架 */
@keyframes cardFloat {
  0%, 100% { translate: var(--dx, 0px) calc(var(--dy, 0px) + var(--lift, 0px)); }
  50%      { translate: var(--dx, 0px) calc(var(--dy, 0px) + var(--lift, 0px) - 9px); }
}

.gcard {
  position: relative;
  grid-column: span 4;
  aspect-ratio: 4 / 3;
  margin-top: var(--mt, 0px);
  isolation: isolate;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(30, 40, 74, 0.7), rgba(10, 14, 26, 0.92));
  cursor: pointer;
  z-index: 1;
  /* 三套独立的变换通道，互不覆盖：
     rotate    = 随手摊开的静态倾斜（--rot）
     translate = 漂浮关键帧 + 悬停抬升（--lift）
     scale     = 交互（悬停/按下）
     不用 3D：见 .gallery-grid 的注释 */
  rotate: var(--rot, 0deg);
  translate: var(--dx, 0px) calc(var(--dy, 0px) + var(--lift, 0px));
  scale: 1;
  animation: cardFloat var(--fdur, 7s) ease-in-out var(--fdel, 0s) infinite;
  transition:
    rotate 0.6s var(--ease-out), scale 0.45s var(--ease-out),
    translate 0.45s var(--ease-out),
    box-shadow 0.6s var(--ease), border-color 0.45s, filter 0.4s;
  -webkit-tap-highlight-color: transparent;
  will-change: translate, rotate;
  pointer-events: auto;
}
.gcard.is-wide { grid-column: span 8; }
.gcard.is-tall { grid-column: span 4; aspect-ratio: 3 / 4; }

/* 未悬停时按深度暗一点，强化前后关系（--dim 由 JS 给） */
.gcard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(6, 10, 20, 0.34), rgba(6, 10, 20, 0.06));
  opacity: var(--dim, 0);
  transition: opacity 0.5s var(--ease);
}
.gcard:hover::after { opacity: 0; }

.gcard:hover {
  rotate: 0deg;
  scale: 1.022;
  --lift: -6px;
  z-index: 6;
  border-color: var(--line-3);
  box-shadow: 0 36px 66px -34px rgba(120, 150, 255, 0.85);
}
/* 触屏：没有 hover，按下即给出同等的抬升反馈 */
@media (hover: none) {
  .gcard:active { scale: 0.97; }
}
/* 按下：压下去一点 */
.gcard.is-pressed { scale: 0.965; }
/* 点击后的闪光（配合水波纹） */
@keyframes cardFlash {
  0% { filter: brightness(1); }
  28% { filter: brightness(1.3) saturate(1.1); }
  100% { filter: brightness(1); }
}
.gcard.is-tapped .gcard-media { animation: cardFlash 0.55s var(--ease-out); }

/* 触屏：按下时给边框高亮（上面已有 scale 反馈） */
@media (hover: none) {
  .gcard:active { border-color: rgba(255, 215, 154, 0.4); }
}

/* 关掉漂浮时：回到规整网格（features.photoFloat = false） */
html.no-photo-float .gcard {
  animation: none;
  rotate: 0deg;
  translate: 0 0;
  margin-top: 0;
}
.gcard-media { position: absolute; inset: 0; }
.gcard-media img,
.gcard-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out), filter 0.6s;
  filter: saturate(0.96) brightness(0.93);
}
.gcard:hover .gcard-media img,
.gcard:hover .gcard-media video {
  transform: scale(1.055);
  filter: saturate(1.06) brightness(1.02);
}

/* 占位 */
.gcard-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  background:
    radial-gradient(closest-side at 50% 32%, rgba(120, 150, 255, 0.16), transparent 72%),
    linear-gradient(160deg, #131a30, #080c18);
  color: var(--ink-4);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.gcard-ph .ph-moon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-image: url("../assets/img/moon.jpg");
  background-size: 118%;
  background-position: center;
  box-shadow: 0 0 26px rgba(255, 215, 150, 0.45);
  opacity: 0.9;
}

/* 角标 */
.gcard-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: 0.45s var(--ease);
}
.gcard:hover .gcard-badges { opacity: 1; transform: none; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  background: rgba(6, 10, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink-2);
  backdrop-filter: blur(8px);
}
.badge-play {
  color: #0d1220;
  background: rgba(255, 240, 208, 0.94);
  border-color: transparent;
  font-weight: 600;
}

/* 悬停信息 */
.gcard-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 20px;
  background: linear-gradient(180deg, transparent 32%, rgba(4, 6, 14, 0.86) 100%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.gcard:hover .gcard-overlay { opacity: 1; }
.gcard-title {
  font-family: var(--serif);
  font-size: 16.5px;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.4;
}
.gcard-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.gcard-note {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gcard-del {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 4;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(6, 10, 20, 0.75);
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  /* 以前这里是 opacity:0，只在 hover 时显示 —— 手机上根本没有 hover，
     等于这个按钮不存在。现在常驻低透明度，hover/聚焦时点亮。 */
  opacity: 0.42;
  transition: opacity 0.3s, color 0.25s, border-color 0.25s, background 0.25s, transform 0.2s;
}
.gcard:hover .gcard-del,
.gcard:focus-within .gcard-del,
.gcard-del:focus-visible { opacity: 1; }
.gcard-del:hover {
  color: #fff;
  border-color: rgba(255, 120, 120, 0.6);
  background: rgba(120, 30, 30, 0.8);
}
.gcard-del:active { transform: scale(0.92); }

/* 触屏：没有 hover，直接常显并放大到手指点得到（44px 是推荐的最小触控尺寸，
   这里取 32px 是因为卡片本身不大，靠 padding 补足命中区） */
@media (hover: none) {
  .gcard-del {
    opacity: 0.92;
    width: 32px;
    height: 32px;
    font-size: 13px;
    bottom: 8px;
    right: 8px;
  }
}

/* 有删除键的卡片：文字区右边留出位置，别被 ✕ 压住
   （cardHTML 里按钮排在 overlay 前面，所以能用兄弟选择器） */
.gcard-del ~ .gcard-overlay {
  padding-right: 54px;
}

/* 空态 */
.gallery-empty {
  margin-top: 20px;
  padding: 54px 24px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 2;
}
.gallery-empty code {
  color: var(--gold);
  background: rgba(255, 216, 155, 0.1);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--mono);
}

/* ---------------- 灯箱 ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vw, 32px);
}
.lightbox[hidden] { display: none; }
.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 11, 0.86);
  backdrop-filter: blur(14px);
  animation: fadeIn 0.4s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; } }

.lb-panel {
  position: relative;
  width: min(1100px, 100%);
  max-height: 92vh;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(19, 25, 44, 0.97), rgba(8, 11, 20, 0.99));
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: panelIn 0.5s var(--ease-out);
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
}

.lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(8, 12, 22, 0.8);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.3s;
}
.lb-close:hover { color: #fff; background: rgba(255, 255, 255, 0.12); transform: rotate(90deg); }

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 22, 0.6);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.3s;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-nav[disabled] { opacity: 0.25; pointer-events: none; }

.lb-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  background:
    radial-gradient(closest-side at 50% 50%, rgba(30, 40, 74, 0.5), #04060c 78%);
  overflow: hidden;
}
.lb-media img,
.lb-media video {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.lb-media img { animation: mediaIn 0.6s var(--ease-out); }
@keyframes mediaIn {
  from { opacity: 0; transform: scale(0.985); }
}

.lb-info {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 26px 24px 18px;
  border-left: 1px solid var(--line);
  /* 面板高度有限，内容多了要能滚动，否则"编辑介绍"表单会被裁在可视区外 */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.lb-info::-webkit-scrollbar { width: 3px; }
.lb-info::-webkit-scrollbar-thumb { background: rgba(160, 180, 255, 0.28); border-radius: 3px; }

/* 编辑介绍时把评论区收起来，给表单让出空间（原来表单会被挤出面板） */
.lb-info.is-editing .lb-comments { display: none; }
.lb-info.is-editing .lb-note { display: none; }
.lb-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.lb-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.lb-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-4);
}
.lb-note {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.9;
}
.lb-note:empty { display: none; }

.lb-comments {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.lb-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.lb-comments-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.lb-comments-title b { color: var(--gold); }
.comment-list {
  flex: 1;
  min-height: 64px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
}
.comment-list::-webkit-scrollbar { width: 3px; }
.comment-list::-webkit-scrollbar-thumb { background: rgba(160, 180, 255, 0.28); border-radius: 3px; }

.comment {
  position: relative;
  display: flex;
  gap: 10px;
  padding-right: 16px;
  animation: commentIn 0.45s var(--ease-out);
}
@keyframes commentIn {
  from { opacity: 0; transform: translateY(8px); }
}
.comment-avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #0d1120;
  background: linear-gradient(135deg, #ffe9bd, #f6b45f);
}
.comment-body { min-width: 0; flex: 1; }
.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.comment-name { font-size: 12px; color: var(--gold); }
.comment-time { font-family: var(--mono); font-size: 9.5px; color: var(--ink-4); }
.comment-text {
  margin-top: 3px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
  word-break: break-word;
}
.comment-del {
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  background: none;
  color: var(--ink-4);
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: 0.25s;
}
.comment:hover .comment-del { opacity: 0.8; }
.comment-del:hover { color: #ff8d8d; }
.comment-empty {
  padding: 12px 0;
  font-size: 12.5px;
  color: var(--ink-4);
  line-height: 1.8;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.comment-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 15px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: 0.3s;
}
.comment-form input.nm { flex: 0 0 86px; }
.comment-form input:focus {
  border-color: rgba(255, 215, 154, 0.5);
  background: rgba(255, 255, 255, 0.07);
}
.comment-form input::placeholder { color: var(--ink-4); }
.comment-form button {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #ffe9bd, #f6b45f);
  color: #241a08;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.35s var(--ease-out);
}
.comment-form button:hover { transform: translateY(-1px) scale(1.06); box-shadow: 0 10px 22px -10px rgba(255, 190, 110, 0.9); }

/* =========================================================
   游戏
   ========================================================= */
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 0.85fr);
  gap: clamp(14px, 2vw, 26px);
  align-items: start;
}
.game-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: radial-gradient(120% 95% at 50% -6%, #101c3c 0%, #070b16 56%, #03050c 100%);
  box-shadow: 0 36px 80px -46px rgba(90, 130, 255, 0.7), inset 0 0 70px rgba(60, 90, 180, 0.13);
  touch-action: none;
  cursor: none;
  user-select: none;
}
.game-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 6, 14, 0.65), transparent);
}
.hud-item { display: flex; align-items: baseline; gap: 7px; }
.hud-item span {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.hud-item b {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.hud-lives { margin-left: auto; }
.hud-lives b {
  color: #ff9b9b;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-shadow: 0 0 14px rgba(255, 110, 110, 0.55);
}
.hud-combo {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.3s;
}
.hud-combo.show { opacity: 1; }

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 22px;
  background: radial-gradient(closest-side at 50% 50%, rgba(6, 9, 18, 0.72), rgba(3, 5, 12, 0.94));
  backdrop-filter: blur(5px);
  cursor: default;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.game-overlay.is-hidden { opacity: 0; visibility: hidden; }
.ov-card { text-align: center; max-width: 400px; }
.ov-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.ov-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(21px, 3vw, 28px);
  margin-bottom: 10px;
  line-height: 1.4;
}
.ov-desc {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.85;
  margin-bottom: 22px;
}
.ov-tip {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--ink-4);
}

.game-side {
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(22, 28, 50, 0.6), rgba(9, 12, 22, 0.8));
}
.game-side h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.rule-list { display: grid; gap: 10px; }
.rule {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.65;
}
.rule i {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-style: normal;
  font-family: var(--mono);
  border: 1px solid var(--line-2);
  color: var(--ink-3);
}
.rule.gold i { color: #241a08; background: linear-gradient(135deg, #ffe9bd, #f6b45f); border-color: transparent; }
.rule.bad i { color: #ffd3c9; border-color: rgba(255, 120, 100, 0.4); background: rgba(160, 50, 40, 0.35); }
.rule b { color: var(--ink); font-weight: 600; }

/* 已经拿到的那封：打勾、整行收一点，一眼能看出还剩哪封没拿到 */
.rule.is-got { color: var(--ink-3); }
.rule.is-got i {
  color: var(--gold);
  border-color: rgba(255, 215, 154, 0.4);
  background: rgba(255, 215, 154, 0.1);
  font-size: 10px;
}
.rule.is-got b { color: var(--ink-2); }

.game-side-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-3);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.3s;
}
.sound-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.sound-toggle.on { color: var(--gold); border-color: rgba(255, 215, 154, 0.35); background: rgba(255, 215, 154, 0.08); }

/* =========================================================
   那封信 —— 月亮升起，点开才读
   ---------------------------------------------------------
   流程：接满 180 分 → 月亮自动升起（游戏暂停）
        → 点月亮 → 信打开 → 收好 → 继续玩
        → 右下角留一个小月亮，随时能再读
   ========================================================= */

/* ---------------- 月亮本身 ---------------- */
.letter-moon {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 6;
  width: clamp(104px, 17%, 156px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
  /* 升起：从下方淡入，带一点模糊和放大，像真的从地平线浮上来 */
  animation: moonRise 1.15s var(--ease-out) both;
}
.letter-moon[hidden] { display: none; }

/* 光晕单独一层，方便呼吸动画不影响月亮本体 */
.lm-halo {
  position: absolute;
  inset: -58%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255, 222, 165, 0.38) 0%,
    rgba(255, 205, 140, 0.16) 42%,
    rgba(255, 200, 130, 0) 100%);
  animation: moonBreathe 4.6s ease-in-out infinite;
  pointer-events: none;
}

.lm-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  /* 不用 assets/img/moon.jpg：那是一张"夜空里的月亮"照片，
     整张平均亮度只有 52/255，裁成圆形看着像个暗盘子。
     这里直接画一颗会发光的月亮 —— 它要承担"升起"这个动作，
     必须足够亮，才撑得住那一刻。 */
  background:
    radial-gradient(circle at 34% 28%,
      #fffef8 0%,
      #fff8e4 22%,
      #fbeecb 42%,
      #f2ddb2 64%,
      #e2c795 84%,
      #cfb083 100%);
  box-shadow:
    0 0 0 1px rgba(255, 246, 224, 0.72),
    0 0 30px rgba(255, 226, 172, 0.55),
    0 0 70px rgba(255, 210, 150, 0.28),
    0 20px 50px -18px rgba(255, 190, 120, 0.55),
    inset -10px -12px 28px rgba(140, 110, 70, 0.28),
    inset 6px 8px 22px rgba(255, 255, 255, 0.5);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

/* 环形山：几个很淡的暗斑，做得克制一点，
   太密就成了月球仪，不像"抬头看见的那一颗" */
.lm-body::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 63% 32%, rgba(150, 118, 74, 0.16) 0 7%, transparent 8%),
    radial-gradient(circle at 40% 55%, rgba(150, 118, 74, 0.13) 0 10%, transparent 11%),
    radial-gradient(circle at 70% 66%, rgba(150, 118, 74, 0.11) 0 6%, transparent 7%),
    radial-gradient(circle at 27% 42%, rgba(150, 118, 74, 0.09) 0 5%, transparent 6%),
    radial-gradient(circle at 55% 78%, rgba(150, 118, 74, 0.10) 0 4.5%, transparent 5.5%);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.letter-moon:hover .lm-body,
.letter-moon:focus-visible .lm-body {
  transform: scale(1.045);
  box-shadow:
    0 0 0 1px rgba(255, 246, 224, 0.85),
    0 0 52px rgba(255, 222, 170, 0.6),
    0 18px 52px -16px rgba(255, 200, 130, 0.72),
    inset -8px -10px 24px rgba(90, 70, 40, 0.28);
}
.letter-moon:focus-visible { outline: none; }
.letter-moon:focus-visible .lm-body {
  outline: 2px solid rgba(255, 215, 154, 0.9);
  outline-offset: 6px;
}

/* 提示：只在“大月亮”状态显示 */
.lm-tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 18px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255, 231, 194, 0.82);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  animation: tipFade 2.4s ease-in-out infinite;
}

@keyframes moonRise {
  0%   { opacity: 0; transform: translate(-50%, 8%) scale(0.42); filter: blur(9px); }
  55%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}
@keyframes moonBreathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.07); }
}
@keyframes tipFade {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* 游戏暂停时把鼠标指针还回来（舞台默认 cursor: none） */
.game-stage.is-letter { cursor: default; }

/* ---------------- 收好之后：缩到右上角 ---------------- */
.letter-moon.is-corner {
  left: auto;
  /* 让开顶部 HUD 那一条（分数/最高分/生命），别压住数字 */
  top: 72px;
  right: 16px;
  width: 40px;
  transform: none;
  animation: cornerIn 0.5s var(--ease-out) both;
}
.letter-moon.is-corner .lm-halo { inset: -40%; }
.letter-moon.is-corner .lm-tip { display: none; }
.letter-moon.is-corner .lm-body {
  box-shadow:
    0 0 0 1px rgba(255, 236, 200, 0.45),
    0 0 16px rgba(255, 215, 154, 0.35),
    inset -3px -4px 8px rgba(90, 70, 40, 0.3);
}
@keyframes cornerIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------------- 侧栏那个「已解锁」小卡片 ---------------- */
.game-letter {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 154, 0.24);
  background: linear-gradient(160deg, rgba(255, 215, 154, 0.085), rgba(255, 180, 100, 0.02));
  animation: panelIn 0.6s var(--ease-out);
}
.game-letter .gl-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 7px;
}
.game-letter .gl-note {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.8;
  color: #ffeac8;
  margin-bottom: 11px;
}
.gl-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid rgba(255, 215, 154, 0.34);
  background: rgba(255, 215, 154, 0.09);
  color: var(--gold);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.gl-open:hover,
.gl-open:focus-visible {
  color: #241a08;
  background: linear-gradient(135deg, #ffe9bd, #ffc97f);
  border-color: transparent;
  outline: none;
}

/* =========================================================
   信 —— 纸张本体
   ---------------------------------------------------------
   整站是深蓝的星空，信故意做成暖色纸。
   一个人从夜空里收到一张纸，这个反差本身就是"被认真对待"的感觉。
   ========================================================= */
.letter-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 44px);
}
.letter-modal[hidden] { display: none; }

.letter-veil {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 11, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.45s var(--ease-out);
}

.letter-paper {
  position: relative;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(28px, 5vw, 46px) clamp(24px, 4.5vw, 44px) clamp(24px, 4vw, 34px);
  border-radius: 4px 4px 3px 3px;
  color: #3b2f22;
  background-color: #fbf4e4;
  /* 极淡的斜纹，像纸的纤维 */
  background-image:
    repeating-linear-gradient(115deg,
      rgba(120, 95, 60, 0.022) 0 1px,
      transparent 1px 7px),
    radial-gradient(120% 90% at 50% 0%, #fffaef 0%, #f7eed9 62%, #efe2c6 100%);
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.85),
    0 2px 0 rgba(255, 255, 255, 0.5) inset,
    0 -14px 30px -20px rgba(120, 90, 50, 0.4) inset;
  animation: paperIn 0.62s var(--ease-out);
}
/* 信纸顶端一道很淡的金线 */
.letter-paper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(198, 156, 84, 0.55), transparent);
}

@keyframes paperIn {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.letter-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(120, 95, 60, 0.22);
  background: rgba(255, 255, 255, 0.4);
  color: rgba(80, 62, 40, 0.62);
  cursor: pointer;
  transition: 0.25s;
}
.letter-close svg { width: 15px; height: 15px; }
.letter-close:hover,
.letter-close:focus-visible {
  color: #3b2f22;
  border-color: rgba(120, 95, 60, 0.42);
  background: rgba(255, 255, 255, 0.75);
  outline: none;
}

.lp-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #b08a4e;
  margin-bottom: 14px;
}

.lp-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(21px, 3.4vw, 27px);
  letter-spacing: 0.06em;
  color: #33281c;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(150, 120, 70, 0.22);
}

.lp-body {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2.15;
  letter-spacing: 0.02em;
  color: #45372a;
  /* 中文段落首行缩进，像手写的信 */
  text-align: justify;
}
.lp-body p { margin: 0 0 16px; text-indent: 2em; }
.lp-body p:last-child { margin-bottom: 0; }

/* =========================================================
   一句话的信 —— 当题字排
   ---------------------------------------------------------
   长信要首行缩进、两端对齐，那是"读一封信"的样子。
   但一句对仗的短句如果也缩进、也左对齐，看着就像没写完。

   所以短句单独处理：居中、字大、字距拉开、上下留白加厚。
   一句话撑起一张纸，靠的是留白，不是字号——字号只加到看得清分量。
   ========================================================= */
.lp-body.is-verse {
  /* 上下留白：让这句话落在纸的中间偏上，不像顶在纸上 */
  padding: clamp(26px, 5vh, 46px) 0 clamp(22px, 4vh, 36px);
  text-align: center;
}
.lp-body.is-verse p {
  text-indent: 0;
  margin: 0;
  font-size: clamp(19px, 2.5vw, 23px);
  line-height: 2.05;
  /* 中文诗性短句：字距略开，读起来有顿挫 */
  letter-spacing: 0.1em;
  color: #3a2d20;
  /* 这里刻意不补 letter-spacing 的尾部空档（以前用 margin-right: -0.1em）。
     负外边距会把块撑宽 2px，而信纸是 overflow-y: auto ——
     另一个方向会被算成 auto，于是多出一条横向滚动条。
     那点偏移只有半个字距（1px），为了它换来一条滚动条不值得。 */
}
/* 长句也允许在合适的地方折行，别撑出纸外 */
.lp-body.is-verse p { word-break: break-word; }

/* 断好的行：一行一块，各占一行 */
.lp-body.is-verse .lp-line { display: block; }

/* 最长那行超过 15 字：字号收一点。
   宁可字小一点，也别在窄屏上把一句话硬折到词中间。 */
.lp-body.is-verse.is-verse-tight p {
  font-size: clamp(17px, 2.1vw, 20px);
  letter-spacing: 0.08em;
}

/* 短句信不需要落款时，把底部按钮往上收一点，别空一大块 */
.lp-body.is-verse ~ .lp-done { margin-top: 22px; }

/* ---------------- 两封以上：翻回去看 ---------------- */
.lp-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}
.lp-nav[hidden] { display: none; }
.lp-nav-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(150, 118, 62, 0.3);
  background: rgba(255, 255, 255, 0.35);
  color: rgba(122, 95, 52, 0.8);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: 0.25s;
}
.lp-nav-btn:hover:not(:disabled),
.lp-nav-btn:focus-visible {
  color: #fffaf0;
  background: linear-gradient(135deg, #c69c54, #a97f3c);
  border-color: transparent;
  outline: none;
}
.lp-nav-btn:disabled { opacity: 0.26; cursor: default; }
.lp-nav-count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(150, 118, 62, 0.85);
}

.lp-sign {
  margin-top: 24px;
  text-align: right;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: #6b5641;
}
.lp-sign[hidden] { display: none; }

.lp-done {
  display: block;
  width: 100%;
  margin-top: 28px;
  padding: 12px 18px;
  border-radius: 99px;
  border: 1px solid rgba(150, 118, 62, 0.4);
  background: linear-gradient(135deg, rgba(198, 156, 84, 0.16), rgba(180, 138, 68, 0.1));
  color: #7a5f34;
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: 0.28s;
}
.lp-done:hover,
.lp-done:focus-visible {
  color: #fffaf0;
  background: linear-gradient(135deg, #c69c54, #a97f3c);
  border-color: transparent;
  outline: none;
}

/* 手机：字小一点、纸铺满些，别让长信挤成一条 */
@media (max-width: 560px) {
  .letter-paper { padding: 26px 20px 22px; max-height: 88vh; }
  .lp-body { font-size: 14.5px; line-height: 2.05; }
  .lp-body p { margin-bottom: 14px; }
  .letter-moon { width: clamp(92px, 30%, 132px); }
  .letter-moon.is-corner { width: 36px; }
}

/* 安静模式 / 减少动效：不浮动、不呼吸，但月亮和信照样能打开 */
html.calm .lm-halo,
html.calm .lm-tip,
html.no-anim .lm-halo,
html.no-anim .lm-tip { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .letter-moon { animation-duration: 0.01ms; }
  .lm-halo, .lm-tip { animation: none; }
  .letter-paper { animation-duration: 0.01ms; }
}

/* =========================================================
   留言板
   ========================================================= */
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.board-compose {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  padding: clamp(20px, 2.6vw, 28px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(23, 30, 54, 0.7), rgba(9, 12, 22, 0.82));
  backdrop-filter: blur(10px);
}
.compose-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.compose-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
}
.compose-head .counter-ring { margin-left: auto; }
.compose-form { display: grid; gap: 16px; }

.counter-ring {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
}
.counter-ring svg { transform: rotate(-90deg); }
.counter-ring circle {
  fill: none;
  stroke-width: 2;
}
.counter-ring .track { stroke: rgba(255, 255, 255, 0.1); }
.counter-ring .bar {
  stroke: var(--gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s var(--ease);
}
.counter-ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
}

.compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.compose-hint {
  font-size: 11.5px;
  color: var(--ink-4);
  line-height: 1.6;
}

.board-list {
  display: grid;
  gap: 14px;
}
.msg {
  position: relative;
  padding: 20px 22px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(24, 30, 54, 0.66), rgba(9, 12, 22, 0.78));
  overflow: hidden;
  transition: border-color 0.45s, transform 0.5s var(--ease-out), box-shadow 0.5s;
}
.msg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.55;
}
.msg:hover {
  border-color: var(--line-2);
  transform: translateX(3px);
  box-shadow: -6px 14px 40px -28px rgba(120, 150, 255, 0.8);
}
.msg-text {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--ink);
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--mono);
  letter-spacing: 0.06em;
}
.msg-name { color: var(--gold); }
.msg-del {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--ink-4);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: 0.3s;
}
.msg:hover .msg-del { opacity: 0.85; }
.msg-del:hover { color: #ff8d8d; }

.board-empty {
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--ink-4);
  font-size: 13.5px;
  line-height: 1.9;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1080px) {
  .game-layout { grid-template-columns: 1fr; }
  .board-layout { grid-template-columns: 1fr; }
  .board-compose { position: static; }
}

@media (max-width: 900px) {
  .gcard { grid-column: span 6; rotate: calc(var(--rot, 0deg) * 0.55); }
  .gcard.is-wide { grid-column: span 12; }
  .gcard.is-tall { grid-column: span 6; }
  .lb-panel {
    grid-template-columns: 1fr;
    max-height: 94vh;
  }
  .lb-media { max-height: 44vh; }
  .lb-media img,
  .lb-media video { max-height: 44vh; }
  .lb-info {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 50vh;
    padding: 20px 18px 16px;
  }
  .lb-nav { display: none; }
}

@media (max-width: 640px) {
  .gallery-grid { gap: 9px; padding: 14px 0 30px; }
  .gcard {
    grid-column: span 12;
    aspect-ratio: 4 / 3;
    rotate: calc(var(--rot, 0deg) * 0.35);
    translate: 0px var(--dy, 0px);
    margin-top: calc(var(--mt, 0px) * 0.5);
  }
  .gcard.is-tall { grid-column: span 12; aspect-ratio: 3 / 4; }
  .gcard.is-wide { grid-column: span 12; }
  .gcard-badges { opacity: 1; transform: none; }
  .gcard-overlay {
    opacity: 1;
    background: linear-gradient(180deg, transparent 46%, rgba(4, 6, 14, 0.88) 100%);
  }
  .gallery-bar { gap: 10px; }
  .tabs { width: 100%; justify-content: space-between; }
  .tab { flex: 1; padding: 7px 10px; font-size: 12.5px; }
  .game-stage { aspect-ratio: 4 / 3; border-radius: 18px; }
  .game-side { padding: 18px; }
  .comment-form input.nm { flex: 0 0 62px; }
  .lb-media { max-height: 38vh; }
  .lb-media img,
  .lb-media video { max-height: 38vh; }
  .lb-info { max-height: 54vh; }
}

/* =========================================================
   星轨相册：照片作为星星绕着月亮转
   ========================================================= */
.sky-view { position: relative; }

.sky-stage {
  position: relative;
  width: 100%;
  /* 高度按屏宽自适应：大屏更开阔，能容纳更多轨道 */
  height: clamp(460px, 74vh, 760px);
  perspective: 1400px;
  perspective-origin: 50% 50%;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 70% at 50% 50%, rgba(26, 36, 68, 0.55), transparent 70%),
    radial-gradient(120% 100% at 50% 0%, #0b1226 0%, #05070f 62%, #03050b 100%);
  box-shadow: inset 0 0 90px rgba(50, 80, 170, 0.14), 0 30px 70px -50px rgba(0, 0, 0, 0.9);
  touch-action: manipulation;
}

/* 中心的月亮 */
.sky-moon {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: clamp(84px, 12.5vw, 132px);
  aspect-ratio: 1;
  translate: -50% -50%;
  /* 可点：连点 7 下会触发一句夜话（见 eggs.js）。
     z-index 要高于 .sky-field(4)，否则整块星轨层会盖住月亮、点不到；
     星轨的 minR 已保证星星不会飞到月亮上，所以提层不挡任何一颗星。 */
  z-index: 20;
  pointer-events: auto;
  cursor: pointer;
}
.sky-moon-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 240, 210, 0.26),
    0 0 40px rgba(255, 214, 155, 0.5),
    0 0 110px rgba(255, 190, 120, 0.24),
    inset 0 0 30px rgba(6, 8, 16, 0.4);
}
.sky-moon-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  filter: brightness(1.42) contrast(1.03);
}
.sky-moon-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -51%;
  rotate: -6deg;
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 32px);
  font-weight: 600;
  color: rgba(60, 42, 14, 0.72);
  text-shadow: 0 1px 0 rgba(255, 250, 236, 0.55), 0 0 18px rgba(255, 214, 150, 0.4);
}
.sky-moon-aura {
  position: absolute;
  inset: -46%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 224, 172, 0.16), rgba(255, 205, 145, 0.05) 54%, transparent 74%);
  filter: blur(12px);
  animation: skyAura 9s var(--ease-soft) infinite alternate;
}
@keyframes skyAura {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.1); }
}

/* 轨道虚线 */
.sky-orbits {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.sky-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(150, 175, 255, 0.12);
  translate: -50% -50%;
  rotate: -8deg;
}
.sky-orbit.o1 { width: 34%; height: 26%; border-color: rgba(255, 215, 154, 0.18); }
.sky-orbit.o2 { width: 50%; height: 38%; }
.sky-orbit.o3 { width: 66%; height: 50%; border-color: rgba(147, 233, 255, 0.1); }
.sky-orbit.o4 { width: 84%; height: 64%; border-style: dotted; opacity: 0.7; }

/* 星星本体 */
.sky-field {
  position: absolute;
  inset: 0;
  z-index: 4;
  transform-style: preserve-3d;
}

.sky-star {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  overflow: visible;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  /* hover 放大走独立的 scale 属性，与每帧写入的 transform 不冲突 */
  scale: 1;
  transition: scale 0.4s var(--ease-out), filter 0.4s var(--ease);
  -webkit-tap-highlight-color: transparent;
  z-index: 10;
}
.sky-star.is-hover { z-index: 60; }

.sky-star-thumb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(220, 232, 255, 0.42);
  background: #0a0e1b;
  box-shadow:
    0 0 0 3px rgba(9, 13, 24, 0.7),
    0 6px 18px -8px rgba(0, 0, 0, 0.9),
    0 0 20px -2px rgba(255, 214, 158, 0.42),
    0 0 36px -8px rgba(160, 190, 255, 0.3);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.sky-star-thumb img,
.sky-star-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.96) brightness(0.9);
  transition: filter 0.4s;
}
.sky-star.is-hover .sky-star-thumb {
  border-color: rgba(255, 226, 180, 0.9);
  box-shadow:
    0 0 0 3px rgba(9, 13, 24, 0.75),
    0 14px 34px -12px rgba(0, 0, 0, 0.95),
    0 0 34px -2px rgba(255, 205, 140, 0.7);
}
.sky-star.is-hover .sky-star-thumb img,
.sky-star.is-hover .sky-star-thumb video { filter: saturate(1.06) brightness(1.04); }

/* 视频星星的小三角 */
.sky-star-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffe9bd, #f2ab58);
  color: #241a08;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.8);
}
.sky-star-badge svg { width: 8px; height: 8px; }

/* 悬停时浮出的说明牌 */
.sky-star-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  /* --tip-shift 由 JS 写入：星星靠边时把提示牌推回舞台内 */
  translate: calc(-50% + var(--tip-shift, 0px)) 6px;
  z-index: 3;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 154, 0.32);
  background: rgba(10, 14, 26, 0.96);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  width: max-content;
  max-width: 232px;
  opacity: 0;
  pointer-events: none;
  transition: 0.35s var(--ease-out);
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.95);
}
.sky-star-tip b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 12.5px;
  margin-bottom: 2px;
}
.sky-star-tip span {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
}
.sky-star-tip em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-2);
  white-space: normal;
  word-break: break-word;
}
.sky-star.is-hover .sky-star-tip {
  opacity: 1;
  translate: calc(-50% + var(--tip-shift, 0px)) 0;
}

/* 星星靠上时翻到下方，避免被舞台裁掉 */
.sky-star.is-tip-below .sky-star-tip {
  bottom: auto;
  top: calc(100% + 10px);
  translate: calc(-50% + var(--tip-shift, 0px)) -6px;
}
.sky-star.is-tip-below.is-hover .sky-star-tip {
  translate: calc(-50% + var(--tip-shift, 0px)) 0;
}

/* 提示语 */
.sky-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.sky-hint-sep { opacity: 0.4; }

/* 星星出现 / 收拢 */
@keyframes starIn {
  from { opacity: 0; scale: 0.2; }
  to { opacity: 1; scale: 1; }
}
.sky-star.is-in { animation: starIn 0.7s var(--ease-out) both; }

/* 平铺视图的容器 */
.flat-view { position: relative; }

/* 移动端 / 触屏：星星小一点，轨道收窄由 JS 处理 */
@media (max-width: 640px) {
  .sky-stage { height: clamp(380px, 62vh, 520px); border-radius: 20px; }
  .sky-star { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
  .sky-star-tip { font-size: 11px; }
  .sky-hint { font-size: 11px; }
}

/* ---------------- 灯箱里的「编辑介绍」 ---------------- */
.lb-edit {
  margin-left: auto;
  flex: none;
  border: 1px solid rgba(255, 215, 154, 0.28);
  background: rgba(255, 215, 154, 0.07);
  padding: 4px 10px;
  border-radius: 99px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: 0.3s var(--ease);
  white-space: nowrap;
}
.lb-edit:hover {
  color: #241a08;
  background: linear-gradient(135deg, #ffe9bd, #ffc97f);
  border-color: transparent;
}
.lb-edit[hidden] { display: none; }

/* 灯箱里的删除：红一点，但别太抢 */
.lb-del {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 130, 130, 0.3);
  background: rgba(255, 130, 130, 0.07);
  padding: 4px 10px;
  border-radius: 99px;
  color: #ff9d9d;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: 0.3s var(--ease);
  white-space: nowrap;
}
.lb-del:hover,
.lb-del:focus-visible {
  color: #2a0c0c;
  background: linear-gradient(135deg, #ffc9c9, #ff8f8f);
  border-color: transparent;
}
.lb-del[hidden] { display: none; }

.lb-edit-form {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 14px 15px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  animation: panelIn 0.35s var(--ease-out);
}
.lb-edit-form .field-label { margin: 4px 0 0; }
.lb-edit-form .input,
.lb-edit-form .textarea { font-size: 13px; padding: 8px 12px; }
.lb-edit-form .textarea { min-height: 54px; }

.lb-edit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.lb-edit-actions { display: flex; gap: 7px; }
.lb-edit-foot .linklike { font-size: 11px; }

/* 标题旁的小标记：说明这段是你自己改过的 */
.lb-title.is-custom::after {
  content: "自定";
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 215, 154, 0.3);
  background: rgba(255, 215, 154, 0.08);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  vertical-align: 3px;
}

/* ---------------- 星轨「换一批」---------------- */
.sky-hint b {
  color: var(--gold);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 11.5px;
}

.sky-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding: 4px 11px;
  border-radius: 99px;
  border: 1px solid rgba(255, 215, 154, 0.26);
  background: rgba(255, 215, 154, 0.06);
  color: var(--gold);
  font-family: inherit;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.sky-shuffle:hover {
  color: #241a08;
  background: linear-gradient(135deg, #ffe9bd, #ffc97f);
  border-color: transparent;
}
.sky-shuffle:active { scale: 0.96; }
.sky-shuffle[hidden] { display: none; }

/* 更换时星星的一次小闪光 */
@keyframes starPop {
  0% { opacity: 0; scale: 0.4; }
  60% { opacity: 1; scale: 1.06; }
  100% { opacity: 1; scale: 1; }
}
.sky-star.is-pop { animation: starPop 0.6s var(--ease-out) both; }

/* =========================================================
   视频卡片的占位
   ---------------------------------------------------------
   视频改成了 preload="none"（不预加载，避免和图片抢那 6 个连接），
   所以卡片上暂时没有画面。放一个居中的播放图标，
   视频真正开始加载后画面会把它盖住 —— 不需要 JS 参与。
   ========================================================= */
.gcard-media video,
.sky-star-thumb video,
.dl-thumb video {
  background-color: #0a0e1a;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffd79a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.2' stroke-opacity='0.45'/%3E%3Cpath d='M10 8.6v6.8l5.6-3.4z' fill='%23ffd79a' fill-opacity='0.8' stroke='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 40px 40px;
}

/* 小缩略图上图标也收小 */
.sky-star-thumb video,
.dl-thumb video { background-size: 22px 22px; }

/* 已经能播（有画面）时把占位图标撤掉，免得叠在画面上 */
.gcard-media video.is-ready,
.sky-star-thumb video.is-ready { background-image: none; }
