/* 云边的月 — 暗色基调纯文字样式 */
:root {
  --bg: #0e1320;
  --bg2: #161d2e;
  --ink: #e8ecf5;
  --ink-dim: #9aa6be;
  --line: #2a3550;
  --accent: #8fb8ff;
  --gold: #d8c79a;
  --be: #c98b8b;
  --he: #9ad6b4;
  --te: #c4a3e0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, #1c2740 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.9;
  min-height: 100vh;
}

/* 背景图层：铺满 + 深色遮罩保证文字可读；缺图时透明回退到 body 渐变 */
#bg-layer {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .4s ease;
  z-index: 0;
}
#bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,11,20,.62) 0%, rgba(8,11,20,.78) 100%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

#game-title {
  text-align: center;
  font-size: 30px;
  letter-spacing: 6px;
  font-weight: 600;
  color: var(--gold);
  margin: 8px 0 28px;
  text-shadow: 0 0 24px rgba(216, 199, 154, 0.25);
}

#screen { animation: fade .5s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 文本 */
.story p, .subtitle {
  color: var(--ink);
  font-size: 17px;
  margin: 0 0 18px;
  text-align: justify;
}
.subtitle { color: var(--ink-dim); text-align: center; font-size: 15px; margin-bottom: 32px; }

/* 逐段揭示：每段淡入上浮 */
.story { cursor: pointer; }
.story p.reveal { animation: rise .45s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 点击继续提示 */
.advance-hint {
  text-align: center;
  color: var(--ink-dim);
  font-size: 14px;
  letter-spacing: 2px;
  margin-top: 10px;
  cursor: pointer;
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: .35; } 50% { opacity: .9; } }

/* 结局复盘块 */
.recap {
  margin-top: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(22, 29, 46, .6);
  text-align: center;
}
.recap-title { color: var(--ink-dim); font-size: 13px; letter-spacing: 3px; }
.recap-nums { color: var(--gold); font-size: 18px; font-weight: 600; margin: 10px 0; }
.recap-hint { color: var(--ink-dim); font-size: 14px; margin: 0; }

/* 选项按钮 */
.choices { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.choice {
  width: 100%;
  text-align: left;
  background: var(--bg2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all .18s ease;
}
.choice:hover {
  border-color: var(--accent);
  background: #1b2540;
  transform: translateY(-1px);
}
.choice.primary {
  background: linear-gradient(135deg, #2b3a63, #233055);
  border-color: var(--accent);
  text-align: center;
  font-weight: 600;
}

/* 标题界面 */
.home { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 40px auto 0; }
.version { text-align: center; color: var(--ink-dim); font-size: 12px; letter-spacing: 1px; margin-top: 28px; opacity: .7; }
.name-input {
  width: 100%;
  background: var(--bg2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 17px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 2px;
}
.name-input:focus { outline: none; border-color: var(--accent); background: #1b2540; }

/* 结局界面 */
.ending-tag {
  text-align: center;
  font-size: 14px;
  letter-spacing: 3px;
  padding: 6px 0 22px;
  color: var(--gold);
}
.ending-BE .ending-tag { color: var(--be); }
.ending-HE .ending-tag { color: var(--he); }
.ending-TE .ending-tag { color: var(--te); }
.ending-extra { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 18px; }

/* 图鉴 */
.gallery h2 { text-align: center; color: var(--ink); font-weight: 600; margin-bottom: 24px; }
.gallery-list { display: grid; gap: 12px; margin-bottom: 24px; }
.gallery-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg2);
}
.gallery-card.locked { opacity: .55; }
.gallery-card-tag { font-size: 15px; font-weight: 600; color: var(--gold); }
.gallery-card.locked .gallery-card-tag { color: var(--ink-dim); }
.gallery-card-desc { font-size: 14px; color: var(--ink-dim); margin: 8px 0 0; }
