/* welcome.css - 首页故事翻页 (5 段情书)
   index.html 和 home.html 共用
   ----------------------------------------- */

.story-frame {
  position: relative;
  width: min(720px, 92vw);
  min-height: 60vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.story-page {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 0 24px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.7s ease, transform 0.7s ease;
  transform: translateY(12px);
}
.story-page.active {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}

/* 故事: 逐行浮现 (一行一行) */
.story-page .line {
  display: block;
  opacity: 0;
  transform: translateY(10px);
}
.story-page.active .line {
  animation: lineFadeIn 0.7s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.4s);
}
@keyframes lineFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-num {
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--pink-400);
  letter-spacing: 12px;
  margin-bottom: 24px;
  text-indent: 12px;
}
.page-content {
  font-family: var(--font-cn);
  color: var(--pink-700);
  line-height: 1.9;
  letter-spacing: 2px;
  font-weight: 500;
}
.page-content.big { font-size: clamp(28px, 5vw, 40px); }
.page-content.mid { font-size: clamp(22px, 3.6vw, 30px); }
.page-content .verse {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 24px;
  font-size: clamp(20px, 3.2vw, 26px);
}
.page-content .verse > div { position: relative; padding-left: 20px; }
.page-content .verse > div::before {
  content: '·'; position: absolute; left: 0;
  color: var(--pink-400);
}
.page-content .final-line {
  font-size: clamp(28px, 4.5vw, 38px);
  margin-bottom: 32px;
}
.enter-site {
  background: var(--pink-400);
  color: white;
  border: none;
  font-family: var(--font-cn);
  font-size: 17px;
  padding: 14px 32px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(238, 106, 146, 0.35);
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 3px;
}
.enter-site:hover {
  background: var(--pink-500);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(238, 106, 146, 0.5);
}
.page-hint {
  position: fixed; bottom: 36px; left: 0; right: 0;
  text-align: center;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: 4px;
  font-family: var(--font-cn);
  pointer-events: none;
  animation: hintBreath 2s ease-in-out infinite;
}
.page-progress {
  position: fixed; top: 30px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px;
  z-index: 5;
}
.page-progress .dot {
  width: 28px; height: 3px;
  background: var(--pink-100);
  border-radius: 2px;
  transition: background 0.4s, width 0.4s;
}
.page-progress .dot.active {
  background: var(--pink-400);
  width: 44px;
}
.page-progress .dot.passed { background: var(--pink-200); }

@keyframes hintBreath {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* 故事覆盖层 (home.html 用, 跟主页内容分开) */
.story-overlay {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(900px 500px at 50% 0%, #fff5f9 0%, transparent 70%),
    var(--bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.4s ease;
}
.story-overlay.hidden { display: none; }
.story-close {
  position: fixed; top: 20px; right: 20px;
  width: 38px; height: 38px;
  background: white; color: var(--pink-500);
  border: 1px solid var(--pink-200);
  border-radius: 50%;
  font-size: 24px; line-height: 1; font-weight: 300;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-s);
  z-index: 210;
  transition: all 0.2s;
  padding: 0;
}
.story-close:hover {
  background: var(--pink-50);
  transform: scale(1.08);
  color: var(--pink-600);
}

@media (max-width: 640px) {
  /* 故事字号缩小 */
  .story-frame { min-height: 50vh; }
  .page-num {
    font-size: 11px; letter-spacing: 8px;
    margin-bottom: 16px; text-indent: 8px;
  }
  .page-content { letter-spacing: 1px; line-height: 1.7; }
  .page-content.big  { font-size: 22px; }
  .page-content.mid  { font-size: 18px; }
  .page-content .verse {
    gap: 12px; margin-top: 18px;
    font-size: 16px;
  }
  .page-content .verse > div { padding-left: 18px; }
  .page-content .final-line { font-size: 22px; margin-bottom: 24px; }
  .enter-site { font-size: 14px; padding: 12px 24px; letter-spacing: 2px; }
  .page-hint { bottom: 18px; font-size: 11px; letter-spacing: 2px; }
  .page-progress { top: 14px; gap: 4px; }
  .page-progress .dot { width: 18px; height: 2px; }
  .page-progress .dot.active { width: 30px; }
  .story-close {
    width: 34px; height: 34px;
    font-size: 20px;
    top: 12px; right: 12px;
  }
  .story-overlay { padding: 16px; }
}

@media (max-width: 380px) {
  .page-content.big  { font-size: 19px; }
  .page-content.mid  { font-size: 16px; }
  .page-content .verse { font-size: 14px; }
  .page-content .final-line { font-size: 19px; }
  .enter-site { font-size: 13px; padding: 10px 18px; }
  .page-hint { font-size: 10px; }
}
