* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0e0b09;
  color: #f2efe8;
  font-family: "PingFang SC", "Source Han Serif SC", "Songti SC", "Microsoft YaHei", "Noto Serif CJK SC", serif;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#scene.grabbing { cursor: grabbing; }

/* 方块后方的情绪光晕（颜色由 JS 按阶段渐变） */
#glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    46% 42% at 66% 48%,
    rgba(120, 80, 40, 0.28) 0%,
    rgba(120, 80, 40, 0.06) 45%,
    transparent 70%
  );
}

.ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}

/* ---------- 左上品牌 ---------- */
.brand {
  position: absolute;
  top: 36px;
  left: 48px;
}
.brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.42em;
  color: #f6f2ea;
}
.brand p {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(246, 242, 234, 0.55);
}

/* ---------- 左侧标题与诗 ---------- */
.headline {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 42vw;
  opacity: 1;
}
/* 覆盖 .ui > * 的 opacity:0（优先级更高），让 backwards 动画结束后保持可见 */
.ui > .headline { opacity: 1; }
.headline .l1,
.headline .l2,
.headline-poem {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.headline.switching .l1,
.headline.switching .l2,
.headline.switching .headline-poem {
  opacity: 0;
  transform: translateY(10px);
}
.headline-en {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.headline-en .l1 {
  font-size: clamp(34px, 4.4vw, 62px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #f6f2ea;
  text-shadow: 0 0 28px rgba(246, 242, 234, 0.12);
}
.headline-en .l2 {
  font-size: clamp(34px, 4.4vw, 62px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(246, 242, 234, 0.82);
}
.headline-zh {
  margin-top: 30px;
  font-size: clamp(15px, 1.2vw, 18px);
  letter-spacing: 0.3em;
  color: rgba(246, 242, 234, 0.85);
}
.headline-poem {
  margin-top: 22px;
  font-size: clamp(12px, 1.0vw, 14px);
  line-height: 2.1;
  letter-spacing: 0.14em;
  color: rgba(246, 242, 234, 0.55);
}

/* ---------- 右下状态：竖排时间轴 ---------- */
.timeline {
  position: absolute;
  right: 48px;
  bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 18px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(246, 242, 234, 0.05),
    rgba(246, 242, 234, 0.35),
    rgba(246, 242, 234, 0.05)
  );
}
.tl-item {
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0.38;
  transition: opacity 0.5s ease;
}
.tl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(246, 242, 234, 0.45);
  flex: none;
  transition: background 0.5s ease, transform 0.5s ease, box-shadow 0.5s ease;
}
.tl-name {
  font-size: 13px;
  letter-spacing: 0.22em;
  color: rgba(246, 242, 234, 0.85);
  transition: font-size 0.5s ease, letter-spacing 0.5s ease, color 0.5s ease;
  white-space: nowrap;
}
.tl-item.active {
  opacity: 1;
}
.tl-item.active .tl-dot {
  width: 10px;
  height: 10px;
  margin: -2px 0 0 -2px;
  background: #f6f2ea;
  box-shadow: 0 0 12px rgba(246, 242, 234, 0.55);
}
.tl-item.active .tl-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: #f6f2ea;
}
.tl-item.past { opacity: 0.55; }
.tl-item.future { opacity: 0.3; }

/* ---------- 右上 hover 状态名 ---------- */
.hoverbox {
  position: absolute;
  top: 36px;
  right: 48px;
  text-align: right;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  min-width: 110px;
}
.hoverbox.visible { opacity: 1; transform: translateY(0); }
.hoverbox .hb-zh {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: #f6f2ea;
}
.hoverbox .hb-en {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 0.32em;
  color: rgba(246, 242, 234, 0.45);
}

/* ---------- 底部提示 ---------- */
.hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(246, 242, 234, 0.4);
}

/* ---------- 首屏淡入 ---------- */
.ui > * { opacity: 0; animation: rise 1.2s ease forwards; }
.brand { animation-delay: 0.15s; }
.headline { animation: riseSoft 1.4s ease 0.45s backwards; }
.timeline { animation-delay: 0.6s; }
.hint { animation-delay: 1.1s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes riseSoft {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 900px) {
  .headline { left: 24px; max-width: 60vw; }
  .brand { left: 24px; }
  .timeline { right: 24px; }
  .hoverbox { right: 24px; }
}
