/* =========================================================
   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;
  cursor: pointer;
  opacity: 0;
  transition: 0.3s;
}
.gcard:hover .gcard-del { opacity: 1; }
.gcard-del:hover {
  color: #fff;
  border-color: rgba(255, 120, 120, 0.6);
  background: rgba(120, 30, 30, 0.8);
}

/* 空态 */
.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; }

.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); }

.game-letter {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 154, 0.26);
  background: linear-gradient(160deg, rgba(255, 215, 154, 0.09), rgba(255, 180, 100, 0.025));
  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: 8px;
}
.game-letter p:last-child {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.95;
  color: #ffeac8;
}

/* =========================================================
   留言板
   ========================================================= */
.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-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; }
