/* ==================================
   🏡 IIGM Family Blog — Warm & Cozy Style
   ================================== */

:root {
  --primary-color: #8b5a2b;     /* 暖木色 */
  --accent-color: #d4a76a;      /* 浅木纹色 */
  --bg-color: #fdf8f3;          /* 纸质奶油白 */
  --text-color: #3a3a3a;        /* 深灰近黑 */
  --light-text: #6c6c6c;
  --border-color: #e8d8c8;
  --shadow: 0 4px 12px rgba(139, 90, 43, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Merriweather', Georgia, serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  padding: 0;
  margin: 0;
}

.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
.family-header {
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: 0 0 20px 20px;
  box-shadow: var(--shadow);
}

.header-inner {
  text-align: center;
  color: white;
  padding: 0 1rem;
}

.blog-title {
  font-family: 'Dancing Script', cursive;
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.tagline {
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.family-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.15);
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* ========== WELCOME NOTE ========== */
.welcome-note {
  text-align: center;
  margin: 2rem 0;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 2px dashed var(--accent-color);
}

.note-image {
  max-width: 120px;
  margin-bottom: 1rem;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

.welcome-note blockquote {
  font-family: 'Dancing Script', cursive;
  font-size: 1.4rem;
  color: var(--primary-color);
  font-style: normal;
  line-height: 1.6;
}

/* ========== POST GRID ========== */
.section-title {
  text-align: center;
  font-size: 2.2rem;
  margin: 2rem 0 1.5rem;
  color: var(--primary-color);
  position: relative;
}

.section-title:after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  background: var(--accent-color);
  margin: 10px auto;
  border-radius: 3px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.post-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(139, 90, 43, 0.15);
}

.post-image-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-image {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
}

.post-body {
  padding: 1.5rem;
}

.post-body h3 a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.4rem;
  line-height: 1.4;
  transition: color 0.3s;
}

.post-body h3 a:hover {
  color: var(--accent-color);
}

.post-meta {
  color: var(--light-text);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.post-excerpt {
  color: var(--text-color);
  margin: 1rem 0;
  line-height: 1.6;
}

.read-more-btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s;
  margin-top: 0.5rem;
}

.read-more-btn:hover {
  background: var(--accent-color);
  transform: translateX(4px);
}

/* ========== SINGLE POST ========== */
.single-post .post-header {
  text-align: center;
  margin: 2rem 0;
}

.single-post .post-header h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  line-height: 1.3;
}

.post-meta {
  font-size: 1rem;
  color: var(--light-text);
  margin-top: 0.5rem;
}

.post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  line-height: 1.8;
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content em {
  font-style: italic;
  color: var(--primary-color);
}

.post-content strong {
  color: var(--primary-color);
}

/* 图片浮动样式 */
.image-left, .image-right {
  margin: 2rem 0;
  text-align: center;
}

.image-left img, .image-right img {
  max-width: 300px;
  border: 4px solid var(--accent-color);
  box-shadow: var(--shadow);
}

.image-left figcaption, .image-right figcaption {
  font-size: 0.9rem;
  color: var(--light-text);
  margin-top: 0.5rem;
  font-style: italic;
}

/* 圆形图片 */
.post-image.circle {
  border-radius: 50%;
}

/* ========== POST NAVIGATION ========== */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 3rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.nav-btn {
  background: var(--bg-color);
  color: var(--primary-color);
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  border: 2px solid var(--border-color);
  transition: all 0.3s;
}

.nav-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ========== FOOTER ========== */
.family-footer {
  background: var(--primary-color);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  border-radius: 20px 20px 0 0;
}

.footer-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  margin: 0 0.5rem;
  font-weight: 500;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 0.8;
}

.heart {
  margin-top: 1rem;
  font-size: 1.1rem;
}

.heart span {
  color: #ff6b6b;
  animation: heartbeat 1.2s infinite;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .blog-title { font-size: 2.8rem; }
  .post-grid { grid-template-columns: 1fr; }
  .post-navigation { flex-direction: column; gap: 1rem; }
  .family-nav { gap: 1rem; }
}

@media (max-width: 480px) {
  .blog-title { font-size: 2.2rem; }
  .tagline { font-size: 1rem; }
}

/* =============== 👨‍👧 作者头像角标 =============== */
.author-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
  margin-right: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* =============== 🤖 AI 对话气泡样式 =============== */
.ai-dialogue {
  margin: 2rem 0;
  text-align: center;
}

.ai-bubble {
  display: inline-block;
  max-width: 90%;
  background: #f0f7ff;
  border: 1px solid #c2d8ff;
  border-radius: 18px;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  position: relative;
  font-style: italic;
  color: #4a6fa5;
  line-height: 1.6;
}

.ai-bubble.ai-left:before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 12px solid #f0f7ff;
}

/* =============== 🖋️ 签名样式 =============== */
.signature {
  text-align: right;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 2rem;
  font-size: 1.2rem;
}

/* =============== 📱 响应式优化 =============== */
@media (max-width: 768px) {
  .author-avatar {
    width: 24px;
    height: 24px;
    margin-right: 4px;
  }

  .ai-bubble {
    max-width: 95%;
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
  }
}

/* 增强版：彻底隐藏滚动条的样式 */
    .time-capsule-container {
      width: 100%;
      overflow: hidden; /* 隐藏容器滚动条 */
      margin: 30px 0;
      position: relative;
      /* 增加一点内边距避免内容被截断 */
      padding-right: 15px;
    }

    .time-capsule-embed {
      width: calc(100% + 30px); /* 超出容器宽度，隐藏横向滚动条空间 */
      min-height: 1400px; /* 进一步增大高度确保内容显示完全 */
      border: none;
      overflow: hidden; /* 隐藏iframe自身滚动 */
      display: block;
    }

    /* 针对所有浏览器的滚动条隐藏 */
    .time-capsule-embed {
      -ms-overflow-style: none;  /* IE和Edge */
      scrollbar-width: none;  /* Firefox */
    }

    .time-capsule-embed::-webkit-scrollbar {
      display: none;  /* Chrome, Safari, Opera */
    }

    /* 确保iframe内部内容也不产生滚动 */
    .time-capsule-embed body {
      overflow: hidden !important;
    }