﻿/* 文游页面样式：紫金 · 全屏图 + 底部文字 */
:root {
  --ink: #f3e9d2;
  --dim: #a99bb5;
  --gold: #d4af37;
  --gold-l: #f2d98d;
  --purple-l: #a67ce0;
  --bg: #07040a;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* 背景两层，交叉淡入 */
#stage { position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 0%, #1a0e28 0%, #07040a 70%); }

.bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0;
  transition: opacity .5s ease;
}

.bg.show { opacity: 1; }

/* 背景模糊铺底，避免上下出现空黑边 */
.bg {
  filter: blur(28px) brightness(.3) saturate(.85);
  transform: scale(1.15);
}

/* 完整图：不裁，整张给你看 */
.photo {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 0;
  height: 58vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(42px + env(safe-area-inset-top)) 10px 4px;
  pointer-events: none;
}

.photo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .62), 0 0 0 1px rgba(212, 175, 55, .18);
  opacity: 0;
  transition: opacity .35s ease;
}

.photo img.show { opacity: 1; }

#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 45% at 50% 30%, rgba(107, 63, 160, .22) 0%, rgba(7, 4, 10, 0) 70%),
    linear-gradient(to bottom,
      rgba(7, 4, 10, .45) 0%,
      rgba(7, 4, 10, .05) 28%,
      rgba(7, 4, 10, .72) 70%,
      rgba(7, 4, 10, .96) 100%);
}

/* 顶部 */
#hud {
  position: absolute;
  z-index: 4;
  top: calc(12px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: .2em;
  color: rgba(243, 233, 210, .62);
}

#hud a {
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(212, 175, 55, .4);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .14em;
}

/* 文本区 */
#textbox {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 42vh;
  overflow-y: auto;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(7, 4, 10, .97) 0%, rgba(7, 4, 10, .9) 60%, rgba(7, 4, 10, .55) 100%);
  -webkit-overflow-scrolling: touch;
}

#text {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(15px, 3.9vw, 18px);
  line-height: 1.85;
  letter-spacing: .02em;
  white-space: pre-wrap;
  min-height: 2.6em;
  max-width: 34em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .9);
}

#hint {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: .26em;
  color: rgba(169, 155, 181, .7);
  animation: breathe 2.6s ease-in-out infinite;
}

#hint:empty { animation: none; }

@keyframes breathe {
  0%, 100% { opacity: .3; }
  50% { opacity: .85; }
}

/* 选项 */
#choices { display: none; flex-direction: column; gap: 10px; margin-top: 14px; max-width: 34em; }
#choices.show { display: flex; animation: rise .3s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.choice {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: #f6ecd6;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, .38);
  background: linear-gradient(180deg, rgba(45, 22, 62, .8), rgba(16, 9, 24, .88));
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .1);
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease;
}

.choice:active {
  transform: translateY(1px);
  border-color: var(--gold);
}

.choice.big { text-align: center; letter-spacing: .16em; font-size: 14px; }

.choice:disabled { opacity: .5; }

.choice.picked {
  opacity: 1;
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212, 175, 55, .30), rgba(120, 90, 20, .16));
  box-shadow: 0 0 18px rgba(212, 175, 55, .3);
}

/* 电脑上：居中成一块手机屏 */
@media (min-width: 720px) {
  html, body { background: #05030a; }
  #app {
    max-width: 430px; margin: 0 auto;
    border-left: 1px solid rgba(212, 175, 55, .12);
    border-right: 1px solid rgba(212, 175, 55, .12);
    box-shadow: 0 0 90px rgba(0, 0, 0, .9);
  }
}

/* 大屏 */
@media (min-aspect-ratio: 1/1) and (min-width: 720px) {
  #textbox { padding: 26px 48px 30px; }
  #text { font-size: 19px; }
}
