/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  序章之家 —— Hello Kitty 粉色时间轴博客样式                ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

/* CSS 变量 */
:root {
  --pink-primary: #FF6B9D;
  --pink-deep: #E84A7F;
  --pink-light: #FFB6C1;
  --pink-pale: #FFC8D6;
  --pink-bg: #FFF5F7;
  --pink-bg-warm: #FFEDF2;
  --white: #FFFFFF;
  --text-main: #5A2D3E;
  --text-light: #8B5A6B;
  --shadow-pink: rgba(255, 107, 157, 0.18);
  --shadow-card: rgba(255, 107, 157, 0.12);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 12px;
  --font-display: 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif;
  --font-body: 'ZCOOL XiaoWei', 'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', 'Hiragino Sans GB', serif;
  --font-hand: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', 'Kaiti SC', cursive;
}

/* 基础重置 */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--pink-bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.8;
}

/* 粉色渐变背景 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 200, 214, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 245, 247, 0.8) 0%, var(--pink-bg-warm) 100%);
  z-index: -2;
  pointer-events: none;
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  浮动爱心背景动画                                       ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.floating-hearts {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* 点击爱心特效 */
.click-heart {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  animation: clickHeartFloat 1s ease-out forwards;
  user-select: none;
  line-height: 1;
}

@keyframes clickHeartFloat {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.5) rotate(0deg);
  }
  30% {
    opacity: 1;
    transform: translate(var(--tx, -10px), -40px) scale(1.2) rotate(15deg);
  }
  60% {
    opacity: 0.7;
    transform: translate(var(--tx2, 10px), -80px) scale(1) rotate(-10deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx3, 0), -140px) scale(0.6) rotate(20deg);
  }
}

/* BGM 播放器 */
.bgm-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--pink-primary);
  font-size: 22px;
  cursor: pointer;
  box-shadow:
    0 4px 16px var(--shadow-pink),
    0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 100;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bgm-toggle:hover {
  transform: scale(1.1);
  box-shadow:
    0 6px 24px var(--shadow-pink),
    0 3px 8px rgba(0, 0, 0, 0.08);
}

.bgm-toggle.playing {
  animation: bgmPulse 2s ease-in-out infinite;
}

@keyframes bgmPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 16px var(--shadow-pink); }
  50% { transform: scale(1.08); box-shadow: 0 6px 24px rgba(255, 107, 157, 0.4); }
}

.heart-float {
  position: absolute;
  color: var(--pink-light);
  opacity: 0;
  animation: floatUp linear infinite;
  font-size: 20px;
  user-select: none;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(100vh) rotate(0deg) scale(0.5);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) rotate(360deg) scale(1.2);
  }
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  页面布局                                             ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  Hello Kitty 头部                                       ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.kitty-head {
  display: flex;
  justify-content: center;
  padding-top: 10px;
  margin-bottom: -15px;
}

.kitty-head .kitty-img {
  width: 140px;
  height: auto;
  filter: drop-shadow(0 4px 12px var(--shadow-pink));
  animation: kittyBounce 2s ease-in-out infinite;
  border-radius: 50%;
  object-fit: cover;
}

@keyframes kittyBounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

/* 旧的猫耳朵隐藏 */
.kitty-ears,
.ear,
.ear-inner {
  display: none;
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  站点头部                                             ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.site-header {
  text-align: center;
  padding: 30px 0 40px;
  position: relative;
}

.header-bow {
  width: 50px;
  height: 34px;
  margin: 0 auto 12px;
}

.header-bow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  color: var(--pink-primary);
  text-shadow:
    2px 2px 0px var(--white),
    4px 4px 0px var(--pink-light);
  letter-spacing: 6px;
  margin-bottom: 8px;
  animation: titleBounce 1s ease-out;
}

@keyframes titleBounce {
  0% { transform: translateY(-30px); opacity: 0; }
  60% { transform: translateY(8px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

.site-subtitle {
  font-family: var(--font-hand);
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--text-light);
  letter-spacing: 3px;
  opacity: 0.9;
}

.header-decoration {
  margin-top: 15px;
  font-size: 1.2rem;
  letter-spacing: 15px;
}

.heart-icon {
  display: inline-block;
  animation: heartbeat 2s ease-in-out infinite;
}

.heart-icon:nth-child(2) {
  animation-delay: 0.3s;
}

.heart-icon:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  时间轴首页                                           ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.timeline-section {
  padding: 20px 0 60px;
}

.timeline {
  position: relative;
  max-width: 850px;
  margin: 0 auto;
}

/* 时间轴中央竖线 */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  background: var(--pink-primary);
  border-radius: 2px;
  opacity: 0.6;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* 左侧卡片 */
.timeline-item:nth-child(odd) {
  justify-content: flex-end;
  padding-right: 50%;
}

/* 右侧卡片 */
.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-left: 50%;
}

/* 时间轴节点 —— Hello Kitty 小头像 */
.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: var(--white);
  border: 2.5px solid var(--pink-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px var(--shadow-pink);
  z-index: 2;
  transition: all 0.3s ease;
  overflow: hidden;
  padding: 2px;
}

.timeline-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.timeline-item:hover .timeline-dot {
  transform: translate(-50%, -50%) scale(1.15);
  border-color: var(--pink-deep);
  box-shadow: 0 4px 18px rgba(232, 74, 127, 0.35);
}

/* 文章卡片 */
.timeline-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--border-radius-lg);
  padding: 22px 26px;
  width: 100%;
  max-width: 360px;
  margin: 0 35px;
  box-shadow:
    0 6px 24px var(--shadow-pink),
    0 1px 3px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px rgba(255, 182, 193, 0.2);
  border: 1px solid rgba(255, 182, 193, 0.25);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--pink-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 12px 40px var(--shadow-pink),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.timeline-card:hover::before {
  opacity: 1;
}

.card-date {
  font-family: var(--font-hand);
  font-size: 0.9rem;
  color: var(--pink-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-date::before {
  content: '💕';
  font-size: 0.8rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.4;
}

.card-summary {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 时间轴收尾 */
.timeline-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  position: relative;
}

.timeline-end::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 30px;
  background: var(--pink-primary);
  border-radius: 2px;
  opacity: 0.6;
}

.timeline-end-dot {
  width: 44px;
  height: 44px;
  background: var(--white);
  border: 3px solid var(--pink-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 3px 12px var(--shadow-pink);
  position: relative;
  z-index: 2;
  animation: heartbeat 2s ease-in-out infinite;
}

.timeline-end-text {
  font-family: var(--font-hand);
  font-size: 1rem;
  color: var(--pink-primary);
  margin-top: 12px;
  letter-spacing: 2px;
}

.card-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  margin-bottom: 14px;
  border: 2px solid rgba(255, 182, 193, 0.3);
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  文章详情页                                           ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.article-section {
  padding: 10px 0 60px;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--pink-primary);
  border: 2px solid var(--pink-light);
  padding: 10px 22px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 12px var(--shadow-card);
}

.back-btn:hover {
  background: var(--pink-primary);
  color: var(--white);
  border-color: var(--pink-primary);
  transform: translateX(-4px);
  box-shadow: 0 6px 20px var(--shadow-pink);
}

.article-container {
  max-width: 720px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  box-shadow:
    0 8px 40px var(--shadow-card),
    0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 182, 193, 0.25);
  position: relative;
}

.article-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--pink-primary);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.article-header {
  text-align: center;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 2px dashed var(--pink-light);
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-date {
  font-family: var(--font-hand);
  font-size: 1.1rem;
  color: var(--pink-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.article-date::before {
  content: '📅';
}

/* 文章内容区 */
.article-content {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-main);
}

.content-block {
  margin-bottom: 28px;
}

.content-block.text {
  text-indent: 2em;
}

.content-block.image {
  text-indent: 0;
  text-align: center;
}

.content-block.image img {
  max-width: 100%;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 20px var(--shadow-card);
  border: 3px solid rgba(255, 182, 193, 0.4);
  transition: transform 0.3s ease;
}

.content-block.image img:hover {
  transform: scale(1.02);
}

.image-caption {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 10px;
  text-align: center;
}

.content-block.video {
  text-indent: 0;
  text-align: center;
}

.content-block.video video {
  max-width: 100%;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 20px var(--shadow-card);
  border: 3px solid rgba(255, 182, 193, 0.4);
}

.video-caption {
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 10px;
  text-align: center;
}

/* 文章末尾装饰 */
.article-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px dashed var(--pink-light);
}

.article-footer .bow-divider {
  font-size: 2rem;
  margin-bottom: 10px;
  animation: heartbeat 2s ease-in-out infinite;
}

.article-footer p {
  font-family: var(--font-hand);
  color: var(--text-light);
  font-size: 1.1rem;
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  加载状态                                             ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--pink-primary);
}

.loading-kitty svg {
  width: 60px;
  height: 48px;
  margin: 0 auto 10px;
  animation: kittyBounce 1.5s ease-in-out infinite;
}

.loading p {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.error {
  text-align: center;
  padding: 80px 20px;
  color: var(--pink-deep);
}

.error p {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  页脚                                                 ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

.site-footer {
  text-align: center;
  padding: 40px 0 30px;
  color: var(--text-light);
}

.footer-kitty svg {
  width: 50px;
  height: 40px;
  margin: 0 auto 8px;
  animation: kittyBounce 2.5s ease-in-out infinite;
}

.site-footer p {
  font-family: var(--font-display);
  font-size: 0.95rem;
  opacity: 0.8;
}

.footer-note {
  font-family: var(--font-hand) !important;
  font-size: 0.85rem !important;
  margin-top: 4px;
  opacity: 0.6 !important;
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  自定义滚动条                                         ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--pink-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--pink-light);
  border-radius: 5px;
  border: 2px solid var(--pink-bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pink-primary);
}

/* ╔══════════════════════════════════════════════════════════╗ */
/* ║  响应式设计                                           ║ */
/* ╚══════════════════════════════════════════════════════════╝ */

@media (max-width: 768px) {
  .kitty-ears {
    gap: 40px;
  }

  .ear {
    width: 50px;
    height: 60px;
  }

  .ear-inner {
    width: 28px;
    height: 32px;
  }

  .timeline::before {
    left: 24px;
  }

  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-left: 55px;
    padding-right: 0;
  }

  .timeline-dot {
    left: 24px;
    transform: translate(-50%, -50%);
  }

  .timeline-item:hover .timeline-dot {
    transform: translate(-50%, -50%) scale(1.2);
  }

  .timeline-card {
    margin: 0;
    max-width: 100%;
    padding: 18px 20px;
  }

  .article-container {
    padding: 25px 20px;
  }

  .content-block.image img,
  .content-block.video video {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .site-title {
    letter-spacing: 3px;
  }

  .timeline-card {
    border-radius: var(--border-radius-md);
  }

  .article-container {
    border-radius: var(--border-radius-md);
  }
}
