/* 月光宝盒 MoonBox · 深空月光主题 */
:root {
  --bg: #070b16;
  --bg2: #0b1224;
  --ink: #e9edf6;
  --dim: #93a0bb;
  --gold: #f2d491;
  --gold-deep: #d8a94e;
  --tier-legend: #f5d78e;
  --tier-epic: #c9a0ff;
  --tier-grace: #7ee0d0;
  --tier-modern: #8ab8ff;
  --radius: 18px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 70% -10%, #14204a 0%, var(--bg2) 40%, var(--bg) 100%);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }

/* 星空 */
.stars, .stars-far {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 22%, #fff9 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 78% 12%, #fff8 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 32% 68%, #ffe9b05c 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 88% 72%, #fff7 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 55% 42%, #fff6 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 8% 84%, #cfe2ff7e 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 64% 88%, #fff5 50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate;
}
.stars-far { opacity: .5; transform: scale(1.4); animation-delay: -3s; }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }

main { position: relative; z-index: 1; }

/* 首屏：自适应高度（原 100dvh 会让用户空滚一整屏才到星图；开盒动画层是 fixed 全屏，不依赖本区高度） */
.hero {
  min-height: auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 56px 20px 40px;
}
.moonbox { position: relative; width: 168px; height: 168px; }
.moon-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #f2d49166;
  border-top-color: var(--gold); border-right-color: #f2d49122;
  animation: spin 7s linear infinite;
  box-shadow: 0 0 34px #f2d4912e, inset 0 0 26px #f2d4911f;
}
.moon-core {
  position: absolute; inset: 26px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fdf3d8, #e5bd6c 58%, #9c7433);
  display: grid; place-items: center;
  box-shadow: 0 0 44px #f2d49155, inset 0 -8px 18px #00000033;
  animation: breathe 3.6s ease-in-out infinite;
}
.moon-glyph {
  font-size: 44px; font-weight: 700; color: #5d4513;
  text-shadow: 0 1px 0 #fffc, 0 -1px 2px #00000030;
}
.moon-glow {
  position: absolute; inset: -18px; border-radius: 50%;
  background: radial-gradient(circle, #f2d49126 0%, transparent 62%);
  animation: breathe 3.6s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.title {
  font-size: clamp(30px, 7vw, 44px); letter-spacing: .18em; font-weight: 700;
  background: linear-gradient(180deg, #fdf6e3, var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px #f2d49126;
}
.tagline { color: var(--dim); font-size: 15px; letter-spacing: .04em; }
.hint { color: #6d7a96; font-size: 12px; }

.btn-open {
  margin-top: 18px; padding: 15px 52px; font-size: 17px; letter-spacing: .3em; text-indent: .3em;
  color: #3d2e0b; font-weight: 700; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #f9e3ab, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 6px 26px #d8a94e4d, inset 0 1px 0 #fff8;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-open:hover { transform: translateY(-2px); box-shadow: 0 10px 34px #d8a94e66, inset 0 1px 0 #fff8; }
.btn-open:active { transform: translateY(0) scale(.97); }

.hero-foot { margin-top: 26px; display: flex; align-items: center; gap: 10px; }
.top-bar {
  position: fixed; top: 14px; right: 16px; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: #0a112299; border: 1px solid #ffffff14; border-radius: 999px;
  padding: 4px 14px; backdrop-filter: blur(8px);
}
.link-btn {
  background: none; border: 0; color: var(--dim); font-size: 14px; cursor: pointer;
  padding: 6px 4px; letter-spacing: .04em;
}
.link-btn:hover { color: var(--ink); }
.link-btn.gold { color: var(--gold); font-weight: 600; }
.dot { color: #4a5570; }

/* 抽取动画层 */
.draw-layer {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
  background: rgba(5, 8, 18, .88); backdrop-filter: blur(6px);
}
.draw-burst {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, #fdf3d8 0%, var(--gold) 30%, transparent 70%);
  animation: burst 1.4s ease-out infinite;
}
@keyframes burst {
  0% { transform: scale(.35); opacity: .9; }
  100% { transform: scale(2.4); opacity: 0; }
}
.draw-flash {
  font-size: clamp(22px, 6vw, 34px); font-weight: 700; letter-spacing: .06em;
  color: var(--gold); min-height: 1.4em; text-shadow: 0 0 22px #f2d49155;
}
.draw-tip { color: var(--dim); font-size: 13px; letter-spacing: .2em; }

/* 时空卡 */
.card { min-height: auto; display: grid; place-items: center; padding: 28px 18px 46px; }
.card-inner {
  width: min(560px, 100%); text-align: center; position: relative;
  padding: 40px 26px 30px; border-radius: var(--radius);
  background: linear-gradient(180deg, #101a33e8, #0a1122f2);
  border: 1px solid var(--tier, var(--gold));
  box-shadow: 0 0 0 1px #ffffff08, 0 0 44px color-mix(in srgb, var(--tier, #f2d491) 18%, transparent), 0 24px 60px #00000080;
  animation: cardIn .5s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes cardIn {
  from { transform: translateY(26px) scale(.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.card-tier { font-size: 12px; letter-spacing: .5em; text-indent: .5em; color: var(--tier); margin-bottom: 14px; }
.card-symbol {
  font-size: 64px; line-height: 1; margin-bottom: 12px;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--tier) 55%, transparent));
}
.card-name { font-size: clamp(22px, 5.6vw, 30px); letter-spacing: .04em; margin-bottom: 6px; }
.card-meta { color: var(--tier); font-size: 14px; letter-spacing: .12em; margin-bottom: 18px; }
.card-desc {
  color: #c6cfe2; font-size: 15.5px; line-height: 1.95; text-align: justify; text-align-last: center;
  margin-bottom: 26px; padding: 0 4px;
}
.card-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.card-actions.sub { margin-top: 16px; }
.btn {
  padding: 11px 26px; border-radius: 12px; font-size: 14.5px; cursor: pointer;
  border: 1px solid #ffffff1f; background: #ffffff0d; color: var(--ink);
  transition: transform .15s ease, background .15s ease; letter-spacing: .04em;
}
.btn:hover { transform: translateY(-1px); border-color: #ffffff38; }
/* 主按钮金色渐变不受通用 hover 覆盖（此前 background:#ffffff17 盖掉渐变致深金字不可见） */
.btn-primary:hover, .btn-primary:focus-visible {
  background: linear-gradient(180deg, #fdeec2, #f5d78e 45%, #d8a94e);
  box-shadow: 0 6px 22px #d8a94e5c;
}
.btn-primary {
  background: linear-gradient(180deg, #f9e3ab, var(--gold) 50%, var(--gold-deep));
  color: #3d2e0b; font-weight: 700; border: 0;
  box-shadow: 0 4px 18px #d8a94e3d;
}

/* 足迹抽屉 & 弹窗 */
.mask { position: fixed; inset: 0; z-index: 50; background: #04071199; backdrop-filter: blur(3px); }
.trail {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(620px, 92vw); max-height: 82dvh; overflow: auto;
  background: #0d1528f5; border: 1px solid #ffffff1c; border-radius: var(--radius);
  padding: 26px 22px; text-align: center;
}
.trail h3, .modal h3 { font-size: 18px; letter-spacing: .1em; margin-bottom: 10px; }
.trail-sub { color: var(--dim); font-size: 13px; margin-bottom: 18px; }
.trail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 20px; }
.trail-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: 12px; background: #ffffff08; border: 1px solid #ffffff10;
  color: var(--ink); font-size: 12px;
}
.trail-cell .sym { font-size: 26px; }
.trail-cell i { font-style: normal; color: var(--dim); font-size: 11px; }
.trail-empty { color: var(--dim); font-size: 14px; padding: 26px 0; }

.modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(480px, 92vw); text-align: center;
  background: #0d1528f5; border: 1px solid #f2d4914d; border-radius: var(--radius);
  padding: 28px 24px; box-shadow: 0 0 50px #f2d4911a;
}
.modal-text { color: #c6cfe2; font-size: 14.5px; line-height: 1.9; margin-bottom: 18px; text-align: justify; text-align-last: center; }
.wait-form { display: flex; gap: 10px; margin-bottom: 12px; }
.wait-form input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 12px; font-size: 14px;
  border: 1px solid #ffffff24; background: #0a1122; color: var(--ink); outline: none;
}
.wait-form input:focus { border-color: var(--gold); }
.modal-count { color: var(--gold); font-size: 13px; margin-bottom: 14px; min-height: 1.2em; }

.foot { position: relative; z-index: 1; text-align: center; padding: 18px; color: #5d6986; font-size: 12px; }

/* 落地页 */
.landing { background: radial-gradient(1100px 700px at 50% -12%, hsl(var(--hue, 230) 45% 14%) 0%, var(--bg2) 45%, var(--bg) 100%) fixed, var(--bg); min-height: 100dvh; }
.landing-main { max-width: 720px; margin: 0 auto; padding: 34px 16px 40px; text-align: center; position: relative; z-index: 1; }
.landing-card {
  background: linear-gradient(180deg, #101a33e8, #0a1122f2);
  border: 1px solid color-mix(in srgb, var(--tier-color, #f2d491) 30%, transparent);
  border-radius: 18px;
  box-shadow: 0 0 40px color-mix(in srgb, var(--tier-color, #f2d491) 10%, transparent), 0 24px 60px #00000080;
  padding: 30px 20px 26px;
  margin-bottom: 20px;
}
.crumbs { text-align: left; font-size: 13px; margin-bottom: 28px; color: var(--dim); }
.crumbs a { color: var(--gold); }
.landing-foot p { color: #7a86a3; }
.space-symbol { font-size: 58px; margin-bottom: 6px; filter: drop-shadow(0 0 16px var(--tier-color)); }
.space-tier { font-size: 12px; letter-spacing: .4em; text-indent: .4em; margin-bottom: 10px; }
.landing h1 { font-size: clamp(24px, 6vw, 34px); margin-bottom: 8px; }
.space-meta { color: var(--tier-color); letter-spacing: .1em; margin-bottom: 26px; font-size: 15px; }
.space-desc { color: #ccd5e8; line-height: 2.05; font-size: 16px; text-align: justify; text-align-last: center; }
.space-desc.en { color: #8a97b4; font-size: 13.5px; margin-top: 14px; font-style: italic; }
.landing-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 32px 0 44px; }
.rel-h { font-size: 15px; color: var(--dim); font-weight: 400; letter-spacing: .14em; margin-bottom: 16px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; text-align: left; }
.faq { border: 1px solid #ffffff14; border-radius: 12px; background: #ffffff07; padding: 12px 16px; }
.faq summary { cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 500; list-style-position: inside; }
.faq summary:hover { color: var(--gold); }
.faq p { color: #b9c3d9; font-size: 13.5px; line-height: 1.8; margin-top: 10px; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.rel {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: #ffffff07; border: 1px solid #ffffff12; color: var(--ink); font-size: 13.5px;
  transition: background .15s ease, transform .15s ease;
}
.rel:hover { background: #ffffff12; transform: translateY(-1px); }
.rel-sym { font-size: 22px; }
.rel-t { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.rel-t i { font-style: normal; color: var(--dim); font-size: 11.5px; }

@media (max-width: 420px) {
  .card-desc, .modal-text { text-align: left; text-align-last: auto; }
  .wait-form { flex-direction: column; }
}

/* 全部时空的完整链条（首页星图） */
.atlas-jump { margin-top: 2px; font-size: 13px; color: var(--tier-grace); border-bottom: 1px dashed #7ee0d066; padding-bottom: 3px; }
.atlas-jump:hover { color: #fff; }
.atlas { max-width: 980px; margin: 0 auto; padding: 64px 18px 72px; scroll-margin-top: 20px; }
.atlas-head { text-align: center; margin-bottom: 28px; }
.atlas-head h2 { font-size: clamp(20px, 5vw, 26px); font-weight: 500; letter-spacing: .12em; color: var(--gold); }
.atlas-head p { color: var(--dim); font-size: 13.5px; line-height: 1.8; margin-top: 10px; }
.atlas-progress { color: var(--tier-grace) !important; font-size: 13px !important; letter-spacing: .06em; }
.atlas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 10px;
  border-left: 1px solid #7ee0d033; padding-left: 18px;
}
.atlas-cell {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, #12203de0, #0a1224e8);
  border: 1px solid #ffffff18; color: var(--ink);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.atlas-cell:hover { transform: translateX(3px); border-color: var(--cell-accent); background: #16243fe8; }
.atlas-cell.tier-legend { --cell-accent: var(--tier-legend); }
.atlas-cell.tier-epic { --cell-accent: var(--tier-epic); }
.atlas-cell.tier-grace { --cell-accent: var(--tier-grace); }
.atlas-cell.tier-modern { --cell-accent: var(--tier-modern); }
.atlas-cell.unlocked { border-color: color-mix(in srgb, var(--cell-accent) 45%, transparent); background: #0d1c30e0; }
.atlas-idx { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #6b7a9c; min-width: 20px; }
.atlas-sym { font-size: 22px; }
.atlas-name { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; font-size: 13.5px; text-align: left; }
.atlas-name span, .atlas-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-name i { font-style: normal; color: var(--dim); font-size: 11.5px; }
.atlas-check { color: var(--tier-grace); font-size: 14px; }
.atlas-foot { text-align: center; color: #5d6986; font-size: 12px; margin-top: 24px; }
.card-chain { margin-top: 16px; font-size: 11.5px; color: #7d8aa8; letter-spacing: .04em; line-height: 1.7; }

/* 落地页时间坐标：上一站 / 本站 / 下一站 */
.timeline-nav { margin: 0 0 44px; padding: 22px 18px; border-radius: 14px; background: #ffffff07; border: 1px solid #7ee0d029; }
.timeline-nav .rel-h { color: var(--tier-grace); margin-bottom: 8px; }
.tl-pos { font-size: 12.5px; color: var(--dim); margin-bottom: 18px; }
.tl-steps { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.tl-step {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border-radius: 10px; background: #0a1224d0;
  border: 1px solid #ffffff14; color: var(--ink); font-size: 13px;
}
.tl-step:hover { border-color: var(--tier-grace); }
.tl-step small { color: var(--dim); font-size: 11px; }
.tl-step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-step i { font-style: normal; color: var(--dim); font-size: 11px; }
.tl-step.tl-empty { border: 0; background: transparent; }
.tl-now { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 92px; font-size: 22px; color: var(--tier-color); }
.tl-now b { font-size: 11.5px; font-weight: 400; color: var(--gold); max-width: 110px; line-height: 1.4; }
.tl-back { margin-top: 16px; font-size: 12.5px; }

@media (max-width: 420px) {
  .atlas { padding: 48px 14px 56px; }
  /* minmax(0,1fr)：裸 1fr 的隐式 min 是 auto，长卡名（尤其英文名）会把轨道撑出视口造成横向溢出 */
  .atlas-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; padding-left: 14px; }
  .atlas-cell { padding: 10px; gap: 6px; }
  .atlas-idx { display: none; }
  .atlas-sym { font-size: 18px; }
  .atlas-name { font-size: 12px; }
  .tl-steps { flex-wrap: wrap; }
  .tl-now { order: -1; width: 100%; flex-direction: row; gap: 8px; }
  .tl-step { min-width: 44%; }
}

/* 合影生成弹窗 */
.gen-space { color: var(--gold); font-size: 13.5px; letter-spacing: .05em; margin-bottom: 12px; }
.upload-zone { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 14px; }
.photo-preview { width: 132px; height: 132px; object-fit: cover; border-radius: 14px; border: 2px solid #f2d49166; box-shadow: 0 6px 22px #00000066; }
.upload-hint { color: var(--dim); font-size: 11.5px; line-height: 1.6; }
.gen-status { color: var(--gold); font-size: 13.5px; min-height: 1.4em; margin: 10px 0 4px; letter-spacing: .04em; }
.gen-result { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }
.gen-result img { width: 100%; max-width: 420px; border-radius: 14px; border: 1px solid #ffffff1f; box-shadow: 0 14px 40px #000000aa; }
.gen-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.gen-tip { color: var(--dim); font-size: 12.5px; }

/* ===== 国宝系列徽章（稀有度错位修复：不动年代档位，给系列金色情感标识） ===== */
.card.series-nt .card-inner { box-shadow: 0 0 0 1px #f2d4914d, 0 0 34px #f2d49124; }
.atlas-cell.series-nt { border-color: #f2d49140; }
.atlas-series {
  position: absolute; top: 6px; right: 7px; font-size: 11px; line-height: 1;
  filter: drop-shadow(0 0 6px #f2d49166);
}
.atlas-quiz {
  position: absolute; top: 6px; right: 26px; width: 14px; height: 14px; border-radius: 50%;
  display: grid; place-items: center; font: bold 9px/1 var(--ink); color: #06121f;
  background: var(--tier-grace); box-shadow: 0 0 8px #7ee0d066;
}

/* ===== P3 时空问答 ===== */
.quiz-options { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.quiz-opt {
  text-align: left; padding: 11px 14px; border-radius: 10px; cursor: pointer;
  background: #101b31; border: 1px solid #ffffff1c; color: var(--ink); font-size: 14px;
  transition: border-color .12s ease, background .12s ease;
}
.quiz-opt:hover:not(:disabled) { border-color: #f2d49166; }
.quiz-opt.sel { border-color: var(--gold); background: #18233c; }
.quiz-opt.right { border-color: #7ee0d0; background: #10312e; }
.quiz-opt.wrong { border-color: #ff8a8a66; background: #2e1b1b; }
.quiz-opt:disabled { cursor: default; opacity: .92; }
.quiz-submit { margin-top: 4px; padding: 10px 30px; font-size: 14px; }
.gen-status.ok { color: var(--tier-grace); }
.gen-status.no { color: #ff9d9d; }
.quiz-explain {
  color: var(--dim); font-size: 12.5px; line-height: 1.75; text-align: left;
  background: #0d1626; border-left: 2px solid #f2d49155; padding: 10px 12px; border-radius: 0 8px 8px 0; margin: 8px 0 4px;
}

/* ===== P3 穿越者日志（心情行） ===== */
.mood-row { margin-top: 14px; }
.mood-label { color: var(--dim); font-size: 12px; letter-spacing: .05em; margin-bottom: 8px; }
.mood-emojis { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mood-btn {
  font-size: 21px; line-height: 1; padding: 7px; border-radius: 10px; cursor: pointer;
  background: #101b31; border: 1px solid #ffffff17; transition: transform .12s ease, border-color .12s ease;
}
.mood-btn:hover { transform: translateY(-2px); }
.mood-btn.on { border-color: var(--gold); background: #1c2438; box-shadow: 0 0 12px #f2d49133; }

/* 足迹抽屉里的心情与答题标记 */
.trail-mood { font-weight: 400; margin-left: 4px; }
.trail-quiz {
  font-weight: 600; font-size: 10px; color: #06121f; background: var(--tier-grace);
  border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px;
}
