/* 禁止全站跟随系统字号改变大小 */
html, body {
  -webkit-text-size-adjust: none !important;
  text-size-adjust: none !important;
  -moz-text-size-adjust: none !important;
  -ms-text-size-adjust: none !important;
}

/* ============================================
   家族宗谱网站 - 全局样式表
   Chinese Traditional Classical Style
   ============================================ */

/* 已移除 Tailwind CDN 导入以降低强刷时阻塞（当前项目未使用 Tailwind 工具类） */


/* ===== CSS 变量体系 ===== */
:root {
  /* 主题色 - 金色系 */
  --gold: #d4af37;
  --gold-light: #ffd700;
  --gold-dark: #b8860b;

  /* 背景色 - 深绿渐变 */
  --bg-from: #2d5a5a;
  --bg-to: #1a3838;
  
  /* 卷轴色 - 羊皮纸暖色调 */
  --parchment-from: #f5e6d3;
  --parchment-via: #e8d4a8;
  --parchment-to: #d4c4a0;
  --border-brown: #8B7355;
  --text-brown: #8B4513;

  /* 功能色 */
  --wood-dark: #3a2817;
  --wood-mid: #5a4436;
  --destructive: #d4183d;

  /* 分类颜色（家族史记用） */
  --cat-migration-bg: rgba(59, 130, 246, 0.2);
  --cat-migration-border: #60a5fa;
  --cat-event-bg: rgba(245, 158, 11, 0.2);
  --cat-event-border: #fbbf24;
  --cat-person-bg: rgba(168, 85, 247, 0.2);
  --cat-person-border: #c084fc;
  --cat-motto-bg: rgba(34, 197, 94, 0.2);
  --cat-motto-border: #4ade80;

  /* 字体 */
  --font-serif: Georgia, 'Times New Roman', 'Noto Serif SC', 'SimSun', serif;
  --font-size-base: 16px;

  /* 间距 */
  --radius: 0.625rem;
  --bento-gap: 1.5rem;
}

/* ===== Bento Grid 主题样式 ===== */

.bento-theme {
  background: #0f1c1c; /* 极深色底，配合背景图使用 */
  color: #fff;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
}

/* 沉浸式背景 */
.parallax-bg {
  position: fixed;
  inset: -10%;
  width: 120%;
  height: 120%;
  background: url('../bg.webp') center/cover no-repeat;
  filter: brightness(0.4) contrast(1.1);
  z-index: -2;
  transition: transform 0.1s ease-out;
}

.mist-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, 
    rgba(15, 28, 28, 0.4) 0%, 
    transparent 40%, 
    transparent 60%, 
    rgba(15, 28, 28, 0.6) 100%
  );
  z-index: -1;
  pointer-events: none;
}

/* 容器布局 */
.bento-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(4rem, calc(env(safe-area-inset-top) + 3.15rem), 5.75rem) 1rem max(1rem, env(safe-area-inset-bottom));
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
  box-sizing: border-box;
}

.bento-container::-webkit-scrollbar {
  display: none; /* Webkit (Chrome/Safari) 隐藏滚动条 */
}


/* 头部样式 */
.bento-header {
  text-align: center;
}

.home-auth-entry-wrap {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 10030;
  display: flex;
  justify-content: flex-end;
}

.home-user-entry {
  pointer-events: auto;
  position: relative;
  border: 2px solid rgba(212, 175, 55, 0.6);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #d4af37;
  min-height: 30px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.75);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.28);
  transition: all 0.2s ease;
  text-align: left;
  max-width: min(86vw, 260px);
  appearance: none;
  -webkit-appearance: none;
}

.home-user-entry:hover {
  transform: translateY(-1px);
  background: rgba(212, 175, 55, 0.2);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.42);
}

.home-user-entry__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex: 0 0 auto;
}

.home-user-entry__icon-svg {
  width: 18px;
  height: 18px;
  display: block;
  color: currentColor;
}

.home-user-entry__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}

.home-user-entry__meta {
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.82;
}

.home-user-entry__label {
  color: #ffe8a1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.home-entry-modal-open {
  overflow: hidden;
}

.home-entry-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(61, 50, 38, 0.5);
  backdrop-filter: blur(4px);
  z-index: 20020;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.home-entry-modal__dialog {
  position: relative;
  width: min(96vw, 1240px);
  height: min(90vh, 920px);
  background: #faf8f3;
  border: 2px solid #8b7355;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(61, 50, 38, 0.35);
}

.home-entry-modal__header {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 14px 56px 14px 20px;
  background: linear-gradient(135deg, #efe6d7, #e1d0b0);
  border-bottom: 1px solid rgba(139, 115, 85, 0.28);
}

.home-entry-modal__title {
  margin: 0;
  font-size: 20px;
  color: #6b5744;
  letter-spacing: 0.06em;
}

.home-entry-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: #fefdfb;
  border: 1px solid #8b7355;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b5744;
  font-size: 20px;
  line-height: 1;
  z-index: 2;
  transition: all 0.2s ease;
}

.home-entry-modal__close:hover {
  background: #f3ece0;
  transform: scale(1.05);
}

.home-entry-modal__frame {
  display: block;
  width: 100%;
  height: calc(100% - 56px);
  border: 0;
  background: #faf8f3;
}

@media (max-width: 768px) {
  .home-auth-entry-wrap {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }

  .home-user-entry {
    max-width: min(88vw, 220px);
    min-height: 28px;
    padding: 4px 9px;
    font-size: 12px;
  }

  .home-entry-modal {
    padding: 8px;
  }

  .home-entry-modal__dialog {
    width: 100%;
    height: min(92vh, 860px);
    border-radius: 12px;
  }

  .home-entry-modal__header {
    min-height: 52px;
    padding: 12px 48px 12px 16px;
  }

  .home-entry-modal__title {
    font-size: 18px;
  }
}



.title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
}

.title-crane {
  width: 96px;
  height: 96px;
  object-fit: contain;
  opacity: 0.78;
  filter: grayscale(0.3) drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.bento-header .main-title {
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--gold);
  letter-spacing: 0.15em;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.35);
}

.title-decoration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  margin: 0.7rem 0 0.5rem;
}

.title-decoration .line {
  height: 2px;
  width: 120px;
  background: linear-gradient(to var(--direction, right), transparent, var(--gold));
}
.title-decoration .line:last-child { --direction: left; }
.title-decoration .circle {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold);
  transform: rotate(45deg);
}

.subtitle {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: rgba(212, 175, 55, 0.75);
}

/* 网格系统（左主区 + 右侧栏） */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: var(--bento-gap);
  flex: 1 1 0;    /* 自然填满剩余空间 */
  min-height: 0;
}


.bento-item {
  position: relative;
  background: rgba(45, 90, 90, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 1.5rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bento-item:hover {
  border-color: var(--gold);
  background: rgba(45, 90, 90, 0.25);
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 图片组/入口组背板固定，不参与悬浮 */
.item-image-row:hover,
.item-nav-row:hover,
.item-hero:hover {
  border-color: rgba(212, 175, 55, 0.2);
  background: rgba(45, 90, 90, 0.15);
  transform: none;
  box-shadow: none;
}


/* 英雄区内容重构 */
.item-hero {
  grid-column: 1 / 4;
  grid-row: 1 / 6;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(45, 90, 90, 0.2));
  padding: 0 !important;
}

.item-nav-row {
  grid-column: 4 / 5;
  grid-row: 1 / 6;
  padding: 0.55rem;
}

.nav-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  height: 100%;
}

.nav-inline {
  border-radius: 1rem;
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(45, 90, 90, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 1rem 0.8rem;
  gap: 0.3rem;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.nav-inline:hover {
  border-color: var(--gold);
  background: rgba(45, 90, 90, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.5), 0 8px 18px rgba(0, 0, 0, 0.25);
}




.hero-merged-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  gap: 1rem;
}

/* 史官：无圆圈无卡片，放大并与诗词高度一致 */
.hero-scholar-block {
  flex: 0 0 44%;
  height: 86%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.hero-scholar-wrap {
  height: calc(100% - 2rem);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hero-scholar-img {
  width: auto;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.38));
}
.hero-scholar-label {
  margin-top: 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.1vw, 1.2rem);
  letter-spacing: 0.22em;
  color: #e8c86a;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.25), 0 1px 2px rgba(0, 0, 0, 0.35);
  opacity: 0.95;
}


/* 诗词：始终三列竖排，字号由 JS + CSS 共同缩放 */
.poem-wrapper {
  flex: 0 0 52%;
  height: 86%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.poem-vertical {
  --poem-size: clamp(14px, 2.1vw, 34px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.2vw, 1.4rem);
  width: 100%;
  height: 100%;
}
.poem-col {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: var(--poem-size);
  line-height: 1.1;
  letter-spacing: 0.15em;
  font-weight: 600;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.45), 0 2px 4px rgba(0,0,0,0.9);
}

/* ===== 轮播面板 ===== */

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  display: flex;
  flex-direction: column;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===== 图文幻灯片（第2/3/4页）：上图完整展示 + 下方文字区 ===== */

.hero-info-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 图片区域：深色底衬，完整展示图片 */
.hero-info-image {
  flex: 0 0 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 8, 0.75);
  position: relative;
  overflow: hidden;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.hero-info-image img {
  width: 85%;
  height: 85%;
  object-fit: contain; /* 完整展示，不裁切 */
  display: block;
  filter: brightness(0.95) saturate(0.9);
}

/* 文字区域：固定在下半部，可滚动 */
.hero-info-text {
  flex: 1;
  padding: 0.9rem 1.4rem 1.8rem; /* 底部留给指示点 */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.2) transparent;
  background: rgba(6, 12, 12, 0.55);
  min-height: 0;
}

/* 标题 */
.hero-info-title {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  letter-spacing: 0.22em;
  font-weight: 700;
  margin-bottom: 0.65rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.hero-info-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* 列表 */
.hero-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-serif);
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  color: #f5e6d3; /* 改为极亮米色 */
  line-height: 1.55;
}

.hero-info-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
}

/* 标签胶囊 */
.info-label {
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 0.25rem;
  padding: 0.05rem 0.45rem;
  font-size: 0.78em;
  color: var(--gold-light);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

/* 子列表 */
.info-sub {
  list-style: none;
  padding: 0;
  margin: 0.12rem 0 0 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  width: 100%;
}

.info-sub li {
  position: relative;
  padding-left: 0.8rem;
  color: rgba(210, 195, 155, 0.75);
  font-size: 0.92em;
  line-height: 1.48;
}

.info-sub li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: rgba(212, 175, 55, 0.6);
}

.info-sub li strong {
  color: rgba(212, 175, 55, 0.95);
}

/* 箭头按钮 */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(15, 28, 28, 0.55);
  backdrop-filter: blur(4px);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  opacity: 0.4;
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.carousel-arrow svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: var(--gold);
}

.carousel-arrow-prev { left: 0.6rem; }
.carousel-arrow-next { right: 0.6rem; }

#heroCarousel:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
}

/* 底部指示点 */
.carousel-dots {
  position: absolute;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 20;
}

.carousel-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  border: none;
  background: rgba(212, 175, 55, 0.35);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, transform 0.3s ease;
}

.carousel-dot.active {
  background: var(--gold);
  transform: scale(1.35);
}

/* 连山归藏 = 下方两张图片卡片（旧版遗留，已废弃） */

.item-lsgz-image {
  background: rgba(212, 175, 55, 0.06);
  aspect-ratio: 16 / 10;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.item-lsgz-image img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 等比缩放，不裁切 */
}


/* 导航项内容 */


.nav-icon {
  margin-bottom: 1rem;
}
.nav-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.5;
}
.item-nav h2 {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.item-nav p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== 首页响应式断点 ===== */

/* 平板横屏（641px~1024px，landscape） */
@media (max-width: 1024px) and (orientation: landscape) {
  .bento-grid {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    margin-top: 0;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr;
    gap: 0.7rem;
  }

  .item-hero {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .item-nav-row {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  .nav-row-grid {
    gap: 0.45rem;
  }

  .hero-merged-content {
    padding: 0.9rem 0.95rem;
    gap: 0.45rem;
  }

  .hero-scholar-block {
    flex: 0 0 42%;
    height: 84%;
  }

  .hero-scholar-wrap {
    height: calc(100% - 1.7rem);
  }

  .hero-scholar-label {
    font-size: clamp(0.86rem, 1.5vw, 1rem);
    letter-spacing: 0.14em;
  }

  .poem-wrapper {
    flex: 0 0 54%;
    height: 84%;
  }

  .nav-inline {
    padding: 0.35rem 0.3rem;
  }

  .item-nav h2 {
    font-size: 1rem;
    margin-bottom: 0.08rem;
  }

  .item-nav p {
    font-size: 0.7rem;
    line-height: 1.1;
  }
}

/* 平板竖屏（641px~1024px，portrait） */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
  html, body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .bento-theme {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    overflow: hidden;
  }

  .bento-container {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(3.9rem, calc(env(safe-area-inset-top) + 3rem)) 0.8rem max(0.8rem, env(safe-area-inset-bottom));
    gap: 0.55rem;
    overflow: hidden;
  }

  .bento-grid {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.45rem;
  }

  .item-hero {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    min-height: 0;
    height: auto;
  }

  .item-nav-row {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    padding: 0.4rem;
  }

  .nav-row-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr;
    gap: 0.4rem;
  }

  .nav-inline {
    min-height: 0;
    padding: 0.5rem 0.35rem;
    gap: 0.22rem;
  }

  .hero-info-text {
    max-height: none;
    padding: 0.75rem 1rem 1.2rem;
  }

  .hero-merged-content {
    padding: 0.65rem 0.85rem;
    gap: 0.45rem;
  }

  .hero-scholar-block {
    flex: 0 0 42%;
    height: 84%;
  }

  .hero-scholar-wrap {
    height: calc(100% - 1.5rem);
  }

  .poem-wrapper {
    flex: 0 0 54%;
    height: 84%;
  }
}

/* 手机端（≤640px） */
@media (max-width: 640px) {
  html, body {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .bento-theme {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    overflow: hidden;
  }

  .bento-container {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(3.75rem, calc(env(safe-area-inset-top) + 3rem)) 0.56rem max(0.56rem, env(safe-area-inset-bottom));
    gap: 0.4rem;
    justify-content: flex-start;
    overflow: hidden;
  }

  .bento-header {
    flex: 0 0 auto;
    padding: 0 0.2rem;
  }

  .title-row {
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  .title-crane {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .bento-header .main-title {
    font-size: clamp(1.68rem, 7.9vw, 2.16rem);
    letter-spacing: 0.08em;
    line-height: 1.02;
    min-width: 0;
  }

  .title-decoration {
    margin: 0.16rem 0 0.14rem;
    gap: 0.45rem;
  }

  .title-decoration .line {
    width: clamp(24px, 10vw, 44px);
    height: 1.5px;
  }

  .title-decoration .circle {
    width: 8px;
    height: 8px;
  }

  .subtitle {
    font-size: clamp(0.66rem, 2.7vw, 0.8rem);
    line-height: 1.08;
    letter-spacing: 0.04em;
    padding: 0 0.35rem;
  }

  .bento-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    margin-top: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.22rem;
    overflow: hidden;
  }

  .item-hero {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    min-height: 0;
    height: auto;
  }

  .item-nav-row {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    padding: 0.3rem;
    align-self: stretch;
    min-height: clamp(88px, 13.8svh, 112px);
  }

  .nav-row-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr;
    gap: 0.28rem;
    align-items: stretch;
  }

  .nav-inline {
    min-height: 0;
    height: 100%;
    padding: 0.56rem 0.28rem 0.5rem;
    border-radius: 0.86rem;
    flex-direction: column;
    gap: 0.2rem;
    justify-content: center;
    text-align: center;
  }

  .nav-text {
    min-width: 0;
    width: 100%;
    flex: 0 1 auto;
  }

  .nav-icon {
    margin-bottom: 0.1rem;
    flex: 0 0 auto;
  }

  .nav-icon svg {
    width: 1.24rem;
    height: 1.24rem;
  }

  .item-nav h2 {
    font-size: clamp(0.82rem, 3.1vw, 0.96rem);
    margin-bottom: 0.06rem;
    line-height: 1.08;
    letter-spacing: 0.03em;
    white-space: normal;
    word-break: keep-all;
  }

  .item-nav p {
    font-size: clamp(0.54rem, 2.2vw, 0.64rem);
    line-height: 1.1;
    opacity: 0.64;
    margin-top: 0;
    white-space: normal;
  }

  .hero-merged-content {
    padding: 0.18rem 0.26rem 0.08rem;
    gap: 0.12rem;
  }

  .hero-scholar-block {
    flex: 0 0 38%;
    height: 100%;
    justify-content: flex-end;
  }

  .hero-scholar-wrap {
    height: calc(100% - 0.54rem);
  }

  .hero-scholar-label {
    margin-top: 0;
    font-size: 0.54rem;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .poem-wrapper {
    flex: 0 0 62%;
    height: 100%;
  }

  .poem-vertical {
    gap: 0.1rem;
    --poem-size: clamp(13px, 4.15vw, 19px) !important;
  }

  .hero-info-content,
  .carousel-track,
  .carousel-slide {
    min-height: 0;
  }

  .hero-info-image {
    flex: 0 0 52%;
    padding: 0.14rem 0.28rem;
  }

  .hero-info-image img {
    width: 92%;
    height: 92%;
  }

  .hero-info-text {
    padding: 0.24rem 0.46rem 0.42rem;
    overflow: hidden;
  }

  .hero-info-title {
    font-size: clamp(0.82rem, 4vw, 0.96rem);
    margin-bottom: 0.12rem;
    letter-spacing: 0.05em;
    gap: 0.28rem;
  }

  .hero-info-list {
    font-size: clamp(0.64rem, 2.7vw, 0.78rem);
    gap: 0.08rem;
    line-height: 1.18;
  }

  .hero-info-list > li {
    gap: 0.12rem;
  }

  .info-label {
    padding: 0.02rem 0.26rem;
    font-size: 0.68em;
  }

  .info-sub {
    margin: 0.02rem 0 0 0.24rem;
    gap: 0.05rem;
  }

  .info-sub li {
    padding-left: 0.52rem;
    font-size: 0.84em;
    line-height: 1.14;
  }

  .carousel-arrow {
    width: 1.35rem;
    height: 1.35rem;
    opacity: 0.58;
  }

  .carousel-arrow svg {
    width: 0.72rem;
    height: 0.72rem;
  }

  .carousel-arrow-prev { left: 0.18rem; }
  .carousel-arrow-next { right: 0.18rem; }

  .carousel-dots {
    bottom: 0.1rem;
    gap: 0.22rem;
  }

  .carousel-dot {
    width: 0.28rem;
    height: 0.28rem;
  }

  .bento-footer { display: none; }
}

@media (max-width: 640px) and (max-height: 760px) {
  .bento-container {
    padding: max(3.35rem, calc(env(safe-area-inset-top) + 2.65rem)) 0.48rem max(0.42rem, env(safe-area-inset-bottom));
    gap: 0.24rem;
  }

  .home-auth-entry-wrap {
    top: max(5px, env(safe-area-inset-top));
    right: max(6px, env(safe-area-inset-right));
  }

  .home-user-entry {
    min-height: 26px;
    padding: 3px 8px;
    font-size: 11px;
  }

  .home-user-entry__meta {
    font-size: 9px;
  }

  .title-crane {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .bento-header .main-title {
    font-size: clamp(1.48rem, 7vw, 1.9rem);
  }

  .subtitle {
    font-size: 0.6rem;
  }

  .item-nav-row {
    min-height: 80px;
    padding: 0.24rem;
  }

  .nav-inline {
    padding: 0.42rem 0.14rem 0.38rem;
  }

  .nav-icon svg {
    width: 1.02rem;
    height: 1.02rem;
  }

  .item-nav h2 {
    font-size: 0.72rem;
  }

  .item-nav p {
    font-size: 0.48rem;
  }

  .hero-info-image {
    flex-basis: 50%;
  }

  .hero-info-text {
    padding: 0.2rem 0.4rem 0.32rem;
  }

  .hero-info-list {
    font-size: clamp(0.58rem, 2.4vw, 0.7rem);
    gap: 0.06rem;
    line-height: 1.14;
  }

  .info-sub li {
    line-height: 1.1;
  }

  .carousel-dots {
    bottom: 0.08rem;
  }
}

@media (max-width: 390px) {
  .bento-container {
    padding: max(3.3rem, calc(env(safe-area-inset-top) + 2.7rem)) 0.42rem max(0.42rem, env(safe-area-inset-bottom));
    gap: 0.24rem;
  }

  .home-auth-entry-wrap {
    top: max(5px, env(safe-area-inset-top));
    right: max(5px, env(safe-area-inset-right));
  }

  .home-user-entry {
    max-width: min(78vw, 172px);
    padding: 3px 7px;
    gap: 5px;
  }

  .home-user-entry__meta {
    font-size: 8px;
  }

  .title-row {
    gap: 0.32rem;
  }

  .title-crane {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .bento-header .main-title {
    font-size: clamp(1.38rem, 7.2vw, 1.78rem);
    letter-spacing: 0.05em;
  }

  .title-decoration {
    gap: 0.34rem;
    margin: 0.12rem 0 0.1rem;
  }

  .title-decoration .line {
    width: 20px;
  }

  .subtitle {
    font-size: 0.58rem;
    letter-spacing: 0.02em;
    padding: 0 0.2rem;
  }

  .bento-grid {
    gap: 0.2rem;
  }

  .nav-row-grid {
    gap: 0.16rem;
  }

  .nav-inline {
    padding: 0.36rem 0.12rem 0.34rem;
    border-radius: 0.72rem;
  }

  .nav-icon {
    margin-bottom: 0.04rem;
  }

  .nav-icon svg {
    width: 0.98rem;
    height: 0.98rem;
  }

  .item-nav h2 {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }

  .item-nav p {
    font-size: 0.46rem;
  }

  .hero-merged-content {
    padding: 0.14rem 0.16rem 0.06rem;
    gap: 0.06rem;
  }

  .hero-scholar-block {
    flex-basis: 35%;
  }

  .poem-wrapper {
    flex-basis: 65%;
  }

  .poem-vertical {
    gap: 0.06rem;
    --poem-size: clamp(12px, 4.05vw, 16px) !important;
  }

  .hero-scholar-label {
    font-size: 0.56rem;
  }

  .hero-info-image {
    flex-basis: 43%;
    padding: 0.1rem 0.16rem;
  }

  .hero-info-text {
    padding: 0.12rem 0.26rem 0.2rem;
  }

  .hero-info-title {
    font-size: clamp(0.84rem, 3.95vw, 0.96rem);
    margin-bottom: 0.08rem;
  }

  .hero-info-list {
    font-size: clamp(0.64rem, 2.75vw, 0.76rem);
    line-height: 1.12;
  }

  .info-label {
    padding: 0.02rem 0.22rem;
  }

  .item-nav-row {
    min-height: 74px;
    padding: 0.22rem;
  }
}

/* ===== 祭祀文化页特定布局 ===== */
.sacrifice-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1.2fr; /* 左:时代 中:主显/预留 右:现代 */
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 1024px) {
  .sacrifice-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* 四时祭导航 */
.seasonal-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.seasonal-btn {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #f5e6d3;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-family: var(--font-serif);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4), 0 1px 2px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seasonal-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke: var(--gold-light);
}

.seasonal-btn:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold-light);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
  transform: translateY(-3px) scale(1.05);
}

.seasonal-btn:hover svg {
  stroke: #000;
}

/* 时代入口 (左侧) */
.era-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.era-entry {
  width: 100%;
  background: rgba(45, 90, 90, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 0.75rem;
  padding: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.era-entry:hover {
  border-color: var(--gold-light);
  background: rgba(212, 175, 55, 0.2);
  transform: translateX(8px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.era-name {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.6), 0 1px 2px rgba(0,0,0,0.9);
}

.era-time {
  color: rgba(245, 230, 211, 0.6);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

/* 箭头指向 */
.era-arrow {
  color: rgba(212, 175, 55, 0.3);
  display: flex;
  justify-content: center;
  padding: 0.1rem 0;
  animation: arrowBlink 2s infinite alternate;
}

@keyframes arrowBlink {
  from { opacity: 0.3; transform: translateY(-2px); }
  to { opacity: 0.7; transform: translateY(2px); }
}

/* 现代范本 (右侧) */
.modern-templates {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.template-box {
  background: rgba(45, 90, 90, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.template-box:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(45, 90, 90, 0.18);
}

.template-box h4 {
  color: var(--gold-light);
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.template-box h4 svg {
  width: 1rem;
  height: 1rem;
  stroke: var(--gold);
}

.template-box p {
  color: #f5e6d3;
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.85;
}

/* 文字光晕增强 */
.text-glow {
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.6), 0 0 30px rgba(212, 175, 55, 0.2), 0 2px 4px rgba(0,0,0,0.9);
}

.text-bright {
  color: #f5e6d3 !important;
}

/* ===== 祭祀文化页特定布局优化 ===== */
.sacrifice-grid {
  display: grid;
  grid-template-columns: 1.1fr 2fr 1.1fr; 
  gap: 1rem;
  margin-top: 0.5rem;
  flex: 1; 
  min-height: 0; 
}

/* 窄屏响应式针对性优化：保持两列，内容重新排序 */
@media (max-width: 1024px) {
  .sacrifice-page .page-inner {
    padding-top: 1rem !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    display: flex;
    flex-direction: column;
  }

  .sacrifice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 强制两列 */
    grid-template-areas: 
      "left right"
      "center center";
    gap: 0.75rem;
    order: 3; /* 放在最后 */
    height: auto;
  }

  .era-timeline { 
    grid-area: left; 
    height: auto;
    max-height: 400px; 
    border: 1px solid rgba(212,175,55,0.2);
    padding: 0.5rem;
    border-radius: 0.8rem;
  }
  .modern-templates { 
    grid-area: right; 
    height: auto;
    gap: 0.5rem;
  }
  .central-display { grid-area: center; margin-top: 1rem; }

  .seasonal-nav {
    order: 2; /* 移动到序言下方 */
    justify-content: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
  }

  .sacrifice-page .central-preface {
    order: 1; /* 序言排在最前 */
    margin-bottom: 0.5rem !important;
  }

  .template-box {
    flex: none;
    padding: 0.85rem;
  }
}

@media (max-width: 640px) {
  .sacrifice-grid {
    grid-template-columns: 1.1fr 0.9fr; /* 略微向左倾斜给时代名更多空间 */
    gap: 0.5rem;
  }

  .era-name { font-size: 0.8rem; letter-spacing: 0; }
  .era-time { font-size: 0.6rem; }
  
  .template-box h4 { font-size: 0.85rem; gap: 0.2rem; }
  .template-box p { font-size: 0.7rem; line-height: 1.4; }

  .seasonal-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }
}


/* ===== Reset & Base ===== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: linear-gradient(to bottom, var(--bg-from), var(--bg-to));
  color: var(--text-brown);
  font-family: var(--font-serif);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar {
  display: none;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== CSS 动画 Keyframes ===== */

/* 淡入+下移 (标题) */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 淡入+上移 (底部装饰) */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 淡入+缩放 (卷轴主体) */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* 淡入+左移 (左侧元素) */
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 淡入+右移 (右侧元素) */
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 纯淡入 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 淡入+缩小 */
@keyframes fadeInShrink {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* 弹窗背景淡入 */
@keyframes modalBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 弹窗内容缩放进入 */
@keyframes modalContentIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* 动画工具类 - 配合 animation-delay 使用 */
.anim-fade-down { animation: fadeInDown 0.8s ease-out both; }
.anim-fade-up { animation: fadeInUp 0.6s ease-out both; }
.anim-fade-scale { animation: fadeInScale 0.8s ease-out both; }
.anim-fade-left { animation: fadeInLeft 1s ease-out both; }
.anim-fade-right { animation: fadeInRight 0.6s ease-out both; }
.anim-fade-in { animation: fadeIn 0.8s ease-out both; }
.anim-fade-shrink { animation: fadeInShrink 0.8s ease-out both; }

.delay-0 { animation-delay: 0s; }
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.5s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }
.delay-5 { animation-delay: 1.0s; }
.delay-6 { animation-delay: 1.2s; }
.delay-7 { animation-delay: 1.4s; }
.delay-8 { animation-delay: 1.5s; }

/* 仙鹤入场动画 */
@keyframes craneInLeft {
  from { opacity: 0; transform: translate(-30px, 10px); }
  to { opacity: 1; transform: translate(0, 0); }
}
@keyframes craneInRight {
  from { opacity: 0; transform: translate(30px, 10px); }
  to { opacity: 1; transform: translate(0, 0); }
}
.anim-crane-left { animation: craneInLeft 1.2s ease-out 0.5s both; }
.anim-crane-right { animation: craneInRight 1.2s ease-out 0.5s both; }

/* ===== 通用组件样式 ===== */

/* 返回按钮 */
.back-btn {
  position: fixed;
  top: 2rem;
  left: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: all 0.3s;
  text-decoration: none;
}
.back-btn:hover { background: rgba(212, 175, 55, 0.2); }
.back-btn svg { width: 1.5rem; height: 1.5rem; }

/* 页面容器 */
.page-container {
  padding: 2rem;
  overflow-y: visible;
}
.page-inner {
  max-width: 72rem; /* 1152px = 6xl */
  margin: 0 auto;
  padding-top: 5rem;
}

/* ===== 家族志页（含分页）沉浸式升级：对齐首页气质 ===== */
.genealogy-immersive .page-container,
.page-immersive .page-container {
  position: relative;
  z-index: 1;
}

.genealogy-immersive .page-inner,
.page-immersive .page-inner {
  background: linear-gradient(135deg, var(--bg-from), var(--bg-to));
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  padding: 4.75rem 1.25rem 1.25rem;
}

.genealogy-immersive .page-title,
.page-immersive .page-title {
  text-shadow: 0 0 22px rgba(212, 175, 55, 0.3);
}

.genealogy-immersive .preface-block,
.genealogy-immersive .preface-compact,
.genealogy-immersive .tree-container,
.genealogy-immersive .timeline-event-body,
.genealogy-immersive .section-card-compact,
.page-immersive .preface-block,
.page-immersive .tree-container,
.page-immersive .timeline-event-body {
  backdrop-filter: blur(4px);
}

/* 页面标题区 */
.page-header {
  text-align: center;
  margin-bottom: 4rem;
}
.page-title {
  font-size: 2.25rem; /* text-4xl */
  color: var(--gold-light);
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 2px 5px rgba(0, 0, 0, 0.9);
}
.title-divider {
  height: 4px;
  width: 8rem;
  margin: 0 auto 1.25rem;
  background: linear-gradient(to right, transparent, var(--gold-light), transparent);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}
.page-subtitle { 
  color: #e8c86a; 
  font-weight: 500;
  letter-spacing: 0.35em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* 图标圆形容器 */
.icon-circle {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  flex-shrink: 0;
}
.icon-circle svg { width: 3rem; height: 3rem; stroke: var(--gold); fill: none; stroke-width: 2; }
.icon-circle svg.fill-icon { fill: var(--gold); stroke: none; }

.icon-circle-sm {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  flex-shrink: 0;
}
.icon-circle-sm svg { width: 2.25rem; height: 2.25rem; stroke: var(--gold); fill: none; stroke-width: 2; }

.icon-circle-xs {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  flex-shrink: 0;
}
.icon-circle-xs svg { width: 1.5rem; height: 1.5rem; stroke: var(--gold); fill: none; stroke-width: 2; }

/* 序言区块 */
.preface-block {
  background: linear-gradient(to bottom right, rgba(45, 90, 90, 0.5), transparent);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  padding: 2.5rem;
  margin-bottom: 3rem;
}
.preface-block .preface-main { color: rgba(212, 175, 55, 0.9); font-size: 1.125rem; line-height: 1.75; text-align: center; font-family: var(--font-serif); }
.preface-block .preface-sub { color: rgba(212, 175, 55, 0.8); line-height: 1.75; text-align: center; }

/* 入口卡片 */
.entry-card {
  position: relative;
  height: 100%;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.entry-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.2), transparent);
  border-radius: 0.5rem;
  filter: blur(20px);
  transition: filter 0.3s;
  z-index: 0;
}
.entry-card:hover::before { filter: blur(40px); }
.entry-card-body {
  position: relative;
  background: linear-gradient(to bottom right, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  padding: 2rem;
  transition: all 0.3s;
  height: 100%;
  z-index: 1;
}
.entry-card:hover .entry-card-body {
  border-color: var(--gold-light);
  transform: scale(1.05);
}
.entry-card h3 { font-size: 1.5rem; color: var(--gold); margin-bottom: 0.75rem; }
.entry-card p { color: rgba(212, 175, 55, 0.7); line-height: 1.65; }
.entry-card-footer {
  margin-top: 1.5rem;
  display: flex;
  align-items: justify-end;
  color: rgba(212, 175, 55, 0.6);
  transition: color 0.3s;
}
.entry-card:hover .entry-card-footer { color: var(--gold); }
.entry-card-footer span { font-size: 0.875rem; margin-right: 0.5rem; }
.entry-card-footer svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; stroke-width: 2; }

/* 卡片网格 */
.card-grid-2 { display: grid; grid-template-columns: 1fr; gap: 2rem; }

/* 底部装饰圆点 */
.bottom-dots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 4rem;
}
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(212, 175, 55, 0.5); }
.dot-sm { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: rgba(212, 175, 55, 0.4); }

/* ===== 首页专用样式 ===== */

.home-page {
  min-height: 100vh;
  background: linear-gradient(to bottom, var(--bg-from), var(--bg-to));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  overflow: hidden;
}

/* 标题区 */
.home-title h1 {
  font-size: 1.875rem; /* text-3xl */
  color: var(--gold);
  font-family: var(--font-serif);
  margin-bottom: 0.75rem;
}
.home-title .divider {
  height: 4px;
  width: 6rem;
  margin: 0 auto 0.75rem;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.home-title p { color: rgba(212, 175, 55, 0.8); font-size: 0.875rem; }

/* 卷轴容器 */
.scroll-container {
  width: 100%;
  max-width: 64rem; /* max-w-5xl */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 轴杆 */
.scroll-rod {
  position: relative;
  height: 2rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
}
.scroll-rod svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scroll-rod-base {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(58, 40, 23, 0.8), transparent, rgba(58, 40, 23, 0.8));
}
.scroll-rod-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--wood-dark), var(--wood-mid), var(--wood-dark));
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  opacity: 0.9;
}
.scroll-rod-gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
}
.ornament-ring {
  position: absolute;
  inset-y: 0;
  width: 0.75rem;
  background: linear-gradient(to bottom, var(--gold), var(--gold-light), var(--gold));
  border-radius: 9999px;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  z-index: 10;
}
.ornament-ring-left { left: 1.5rem; }
.ornament-ring-right { right: 1.5rem; }
.ornament-center {
  position: absolute;
  inset-y: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4rem;
  background: linear-gradient(to bottom, var(--gold), var(--gold-light), var(--gold));
  border-radius: 9999px;
  opacity: 0.9;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  z-index: 10;
}

/* 仙鹤 */
.crane-decoration {
  position: absolute;
  top: -6rem;
  width: 8rem;
  height: 8rem;
  z-index: 30;
}
.crane-left { left: -4rem; }
.crane-right { right: -4rem; transform: scaleX(-1); }
.crane-decoration img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }

/* 卷轴主体 */
.scroll-body {
  position: relative;
  background: linear-gradient(to bottom right, var(--parchment-from), var(--parchment-via), var(--parchment-to));
  border-radius: 0.125rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  width: calc(100% - 3rem);
}
.scroll-border-outer {
  position: absolute;
  inset: 0;
  border: 6px solid var(--border-brown);
  border-radius: 0.125rem;
  pointer-events: none;
}
.scroll-border-inner {
  position: absolute;
  inset: 4px;
  border: 3px solid var(--gold);
  border-radius: 0.125rem;
  opacity: 0.6;
  pointer-events: none;
}
.scroll-texture {
  position: absolute;
  inset: 0;
  opacity: 0.05;
}
.scroll-inset-shadow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 30px rgba(139, 115, 85, 0.3);
  border-radius: 0.125rem;
  pointer-events: none;
}

/* 卷轴内容 */
.scroll-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  min-height: 500px;
}

/* 卷轴顶部装饰图 */
.scroll-top-images {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.scroll-top-img-left,
.scroll-top-img-right {
  width: 20%;
  max-width: 10rem;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
.scroll-top-poem {
  color: var(--text-brown);
  font-family: var(--font-serif);
  text-align: center;
  line-height: 1.8;
  letter-spacing: 0.05em;
  font-size: 1.25rem;
  flex: 1;
  min-width: 0;
}
.scroll-top-poem span {
  display: block;
  white-space: nowrap;
}

/* 卷轴主体行（史官 + 导航） */
.scroll-main-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
  flex: 1;
}

/* 史官区 */
.scholar-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
}
.scholar-section img {
  width: 10rem;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(139, 69, 19, 0.3));
}
.scholar-label {
  margin-top: 0.75rem;
  color: var(--text-brown);
  text-align: center;
  font-family: var(--font-serif);
}

/* 导航入口列表 */
.nav-entries {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  min-width: 0;
}

/* 单个入口项 */
.nav-entry {
  cursor: pointer;
  text-decoration: none;
}
.nav-entry-desktop {
  display: none;
  align-items: center;
  gap: 1rem;
}
.nav-entry-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.nav-icon-circle {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  border: 3px solid var(--text-brown);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
  transition: all 0.3s;
}
.nav-entry:hover .nav-icon-circle {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
}
.nav-icon-circle svg { width: 2.75rem; height: 2.75rem; stroke: var(--text-brown); fill: none; stroke-width: 2; }
.nav-entry h2 { font-size: 1.875rem; color: var(--text-brown); transition: color 0.3s; font-family: var(--font-serif); margin-bottom: 0.25rem; }
.nav-entry:hover h2 { color: var(--gold); }
.nav-entry p { color: rgba(139, 69, 19, 0.7); font-size: 0.875rem; }
.nav-entry-mobile .nav-icon-circle { margin-bottom: 0.75rem; }
.nav-entry-mobile h2 { font-size: 1.5rem; }

/* 底部圆点 */
.home-dots { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.home-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(212, 175, 55, 0.5); }

/* ===== 祭祖页专用 ===== */
.decoration-circle {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.3), transparent);
  position: relative;
  overflow: hidden;
}
.decoration-circle svg { width: 4rem; height: 4rem; position: relative; z-index: 10; }

.action-btn-group { display: flex; gap: 1.5rem; margin-bottom: 3rem; }
.action-btn {
  padding: 0.75rem 2rem;
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s;
}
.action-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: scale(1.05);
}

.message-btn {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  transition: all 0.3s;
}
.message-btn:hover { background: rgba(212, 175, 55, 0.2); }
.message-btn svg { width: 2rem; height: 2rem; stroke: var(--gold); fill: none; stroke-width: 2; }

.feedback-message {
  position: absolute;
  bottom: 8rem;
  background: rgba(212, 175, 55, 0.9);
  color: var(--bg-to);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  display: none;
}
.feedback-message.show { display: block; animation: fadeInUp 0.3s ease-out; }

/* ===== 族谱世系树形图 ===== */
.tree-container {
  background: linear-gradient(to bottom right, rgba(45, 90, 90, 0.3), transparent);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  padding: 3rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}
.tree-wrapper { display: flex; justify-content: center; min-width: max-content; }

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.tree-node-card {
  position: relative;
  cursor: pointer;
}
.tree-node-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(212, 175, 55, 0.2);
  border-radius: 0.5rem;
  filter: blur(12px);
  transition: filter 0.3s;
}
.tree-node-card:hover::before { filter: blur(18px); }
.tree-node-body {
  position: relative;
  background: linear-gradient(to bottom right, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  padding: 1rem;
  min-width: 140px;
  transition: all 0.3s;
}
.tree-node-card:hover .tree-node-body {
  border-color: var(--gold-light);
  transform: scale(1.05);
}
.tree-node-body .node-avatar {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
}
.tree-node-body .node-avatar svg { width: 1.5rem; height: 1.5rem; fill: var(--gold); }
.tree-node-name { color: var(--gold); margin-bottom: 0.25rem; }
.tree-node-spouse { color: rgba(212, 175, 55, 0.7); font-size: 0.875rem; }
.tree-node-gen { color: rgba(212, 175, 55, 0.5); font-size: 0.75rem; margin-top: 0.25rem; }
.tree-connector-v {
  width: 2px;
  height: 2rem;
  background: rgba(212, 175, 55, 0.3);
  margin: 0.5rem 0;
}
.tree-children { display: flex; gap: 2rem; }

/* 说明网格 */
.info-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.info-item h4 { color: var(--gold); margin-bottom: 0.5rem; }
.info-item p { color: rgba(212, 175, 55, 0.8); font-size: 0.875rem; line-height: 1.65; padding-left: 1rem; }

/* ===== 时间线 ===== */
.timeline {
  position: relative;
}
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(212, 175, 55, 0.3);
  transform: translateX(-50%);
  display: none;
}
.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}
.timeline-item::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 2rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid var(--bg-to);
  transform: translateX(-50%);
  display: none;
}

.timeline-event {
  cursor: pointer;
  position: relative;
}
.timeline-event::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.2), transparent);
  border-radius: 0.5rem;
  filter: blur(12px);
  transition: filter 0.3s;
  z-index: 0;
}
.timeline-event:hover::before { filter: blur(18px); }
.timeline-event-body {
  position: relative;
  background: linear-gradient(to bottom right, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s;
  z-index: 1;
}
.timeline-event:hover .timeline-event-body {
  border-color: var(--gold-light);
  transform: scale(1.05);
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  border-style: solid;
  border-width: 1px;
}
.cat-migration { background: var(--cat-migration-bg); border-color: var(--cat-migration-border); }
.cat-event { background: var(--cat-event-bg); border-color: var(--cat-event-border); }
.cat-person { background: var(--cat-person-bg); border-color: var(--cat-person-border); }
.cat-motto { background: var(--cat-motto-bg); border-color: var(--cat-motto-border); }

/* 历史时间线（左侧时间标记模式） */
.history-timeline > div { position: relative; }
.history-connector {
  position: absolute;
  left: 1.5rem;
  top: 5rem;
  width: 2px;
  height: 100%;
  background: rgba(212, 175, 55, 0.3);
  display: none;
}
.history-event {
  cursor: pointer;
  position: relative;
}
.history-event::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.2), transparent);
  border-radius: 0.5rem;
  filter: blur(12px);
  transition: filter 0.3s;
  z-index: 0;
}
.history-event:hover::before { filter: blur(18px); }
.history-event-body {
  position: relative;
  background: linear-gradient(to bottom right, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s;
  z-index: 1;
}
.history-event:hover .history-event-body {
  border-color: var(--gold-light);
  transform: scale(1.02);
}
.history-time-marker { flex-shrink: 0; }
.history-time-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.2);
  position: relative;
  z-index: 10;
}
.history-time-icon svg { width: 1.5rem; height: 1.5rem; stroke: var(--gold); fill: none; stroke-width: 2; }
.history-time-year { color: rgba(212, 175, 55, 0.7); font-size: 0.75rem; text-align: center; margin-top: 0.5rem; white-space: nowrap; }

/* 家族志 - 紧凑卡片网格 */
.section-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%; /* 与上方文字框保持同宽 */
}

/* 第5个卡片位于第三行并通铺两列 */
.section-grid-compact .section-card-compact:nth-child(5) {
  grid-column: 1 / -1;
}

/* 紧凑卡片基础样式 - 对齐首页 bento-item 沉浸式风格 */
.section-card-compact {
  position: relative;
  background: rgba(45, 90, 90, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 1.5rem;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-height: 7rem;
  overflow: hidden;
}

.section-card-compact:hover {
  border-color: var(--gold);
  background: rgba(45, 90, 90, 0.25);
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.section-card-soon {
  opacity: 0.6;
}

.section-card-soon:hover {
  opacity: 0.8;
}

.section-card-compact-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.section-card-compact-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke: var(--gold);
  fill: none;
}

.section-card-compact:hover .section-card-compact-icon {
  background: rgba(212, 175, 55, 0.2);
  transform: scale(1.1);
  border-color: var(--gold);
}

.section-card-compact-info {
  flex: 1;
}

.section-card-compact-info h3 {
  color: var(--gold);
  font-size: 0.9rem;
  margin: 0;
  font-family: var(--font-serif);
  white-space: nowrap;
  line-height: 1.2;
}

.section-card-compact-info p {
  color: rgba(212, 175, 55, 0.5);
  font-size: 0.7rem;
  margin-top: 0.15rem;
  font-family: var(--font-serif);
}

.section-card-compact-arrow {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  opacity: 0;
  transition: opacity 0.25s;
}

.section-card-compact-arrow svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke: var(--gold);
  fill: none;
}

.section-card-compact:hover .section-card-compact-arrow {
  opacity: 0.6;
}

/* 序言紧凑样式 */
.preface-compact {
  position: relative;
  background: linear-gradient(to bottom right, rgba(45, 90, 90, 0.45), rgba(26, 56, 56, 0.55));
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  border-radius: 0.65rem;
  padding: 0.85rem 2.5rem 0.85rem 0.85rem;
  margin-bottom: 1rem;
}

.preface-compact-text {
  color: rgba(212, 175, 55, 0.85);
  font-size: 0.85rem;
  line-height: 1.65;
  text-align: center;
  font-family: var(--font-serif);
  margin: 0;
}

.btn-inline-edit {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: transparent;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.25s;
  padding: 0;
}

.btn-inline-edit:hover {
  background: rgba(212, 175, 55, 0.2);
  opacity: 1;
}

.btn-inline-edit svg {
  width: 0.8rem;
  height: 0.8rem;
  stroke: currentColor;
  fill: none;
}

/* 序言编辑面板 */
.preface-edit-panel {
  background: linear-gradient(135deg, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.75rem;
  width: 100%;
  max-width: 32rem;
  padding: 1.5rem;
  animation: modalContentIn 0.3s ease-out;
}

/* 编辑按钮 */
.btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 0.5rem;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  font-size: 0.825rem;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-serif);
}

.btn-edit:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold);
}

.btn-edit svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
}

/* 即将上线标签 */
.badge-coming-soon {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: rgba(212, 175, 55, 0.6);
}

/* 箭头图标 */
.arrow-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--gold);
  fill: none;
  opacity: 0.5;
}

/* 管理员指示器 */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  margin-bottom: 1.5rem;
}

.admin-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s infinite;
}

.admin-text {
  color: #4ade80;
  font-size: 0.8rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== 详情弹窗系统 ===== */

/* 弹窗面板 */
.modal-panel {
  background: linear-gradient(135deg, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.75rem;
  width: 100%;
  max-width: 48rem;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalContentIn 0.3s ease-out;
  overflow: hidden;
}

/* 弹窗头部 */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.modal-header h2 {
  color: var(--gold);
  font-size: 1.35rem;
  font-family: var(--font-serif);
}

.modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: transparent;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
}

.modal-close:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
}

.modal-close svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
}

/* 查看模式内容 */
.modal-view {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* 编辑模式内容 */
.modal-edit {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.15);
}

/* 底部操作栏 */
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* 主按钮 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-serif);
}

.btn-primary:hover {
  background: rgba(212, 175, 55, 0.3);
  transform: translateY(-1px);
}

.btn-primary svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
}

/* 保存按钮 */
.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border: 2px solid #4ade80;
  border-radius: 0.5rem;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-serif);
}

.btn-save:hover {
  background: rgba(34, 197, 94, 0.35);
}

.btn-save svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
}

/* 取消按钮 */
.btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(212, 175, 55, 0.7);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-serif);
}

.btn-cancel:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.5);
}

/* 删除按钮 */
.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border: 2px solid #ef4444;
  border-radius: 0.5rem;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-serif);
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.35);
}

/* ===== 删除确认弹窗 ===== */
.confirm-dialog {
  background: linear-gradient(135deg, var(--bg-from), var(--bg-to));
  border: 2px solid #ef4444;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 24rem;
  padding: 2rem;
  text-align: center;
  animation: modalContentIn 0.3s ease-out;
}

.confirm-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 2px solid #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.15);
}

.confirm-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  stroke: #ef4444;
  fill: none;
}

.confirm-dialog h3 {
  color: #ef4444;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.confirm-dialog p {
  color: rgba(212, 175, 55, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ===== 表单样式 ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(230, 215, 175, 0.9);
  font-size: 0.9rem;
  font-family: var(--font-serif);
  transition: border-color 0.25s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.6;
}

/* ===== 查看模式内容样式 ===== */

/* 通用段落 */
.view-paragraph {
  color: rgba(212, 175, 55, 0.85);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-family: var(--font-serif);
}

.view-title {
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-serif);
}

/* 卡片列表 */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.record-card {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 0.5rem;
  padding: 1.25rem;
  position: relative;
}

.record-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.record-title {
  color: var(--gold);
  font-size: 1.05rem;
  font-family: var(--font-serif);
}

.record-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.record-meta span {
  color: rgba(212, 175, 55, 0.6);
  font-size: 0.8rem;
}

/* 记录操作按钮组 */
.record-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.25s;
}

.record-card:hover .record-actions {
  opacity: 1;
}

.record-action-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(45, 90, 90, 0.5);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.record-action-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
}

.record-action-btn svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke: currentColor;
  fill: none;
}

.record-action-btn.delete:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.record-description {
  color: rgba(212, 175, 55, 0.8);
  line-height: 1.65;
  font-size: 0.875rem;
}

/* 添加记录按钮 */
.add-record-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  border: 2px dashed rgba(212, 175, 55, 0.35);
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(212, 175, 55, 0.7);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-serif);
}

.add-record-btn:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
}

.add-record-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  fill: none;
}

/* 字辈网格（查看模式） */
.zibei-grid-wrapper {
  width: 100%;
  overflow: hidden;
  margin: 1rem 0;
}

.zibei-grid {
  display: grid;
  gap: 0.5rem;
  margin: 0 auto;
  transition: transform 0.3s ease;
  transform-origin: center top;
}

.zibei-char {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.35rem;
  color: var(--gold);
  font-size: 1.1rem;
  font-family: var(--font-serif);
  font-weight: 500;
  width: 48px;
  height: 48px;
}

/* 分类标签 */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  border: 1px solid;
}

.tag-migration {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.tag-event {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.tag-person {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

/* ===== 美化滚动条 ===== */
.modal-view::-webkit-scrollbar,
.modal-edit::-webkit-scrollbar {
  width: 6px;
}

.modal-view::-webkit-scrollbar-track,
.modal-edit::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.modal-view::-webkit-scrollbar-thumb,
.modal-edit::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 3px;
  transition: background 0.25s;
}

.modal-view::-webkit-scrollbar-thumb:hover,
.modal-edit::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.55);
}

/* Firefox滚动条 */
.modal-view,
.modal-edit {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) rgba(0, 0, 0, 0.15);
}

/* ===== 表单下拉框样式修复 ===== */
.form-input,
.form-textarea,
select.form-input {
  color: rgba(230, 215, 175, 0.95) !important;
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.form-input:focus,
.form-textarea:focus,
select.form-input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

select.form-input option {
  background: #1a3838;
  color: rgba(230, 215, 175, 0.95);
  padding: 0.5rem;
}

/* ===== 家族史记导航标签（分页切换） ===== */
.genealogy-immersive .jizu-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.35rem;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(20, 36, 36, 0.5), rgba(30, 54, 54, 0.42));
}

.genealogy-immersive .jizu-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  text-align: center;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 0.62rem;
  color: rgba(245, 230, 190, 0.78);
  font-size: 0.92rem;
  font-family: var(--font-serif);
  cursor: pointer;
  transition: all 0.22s ease;
}

.genealogy-immersive .jizu-tab:hover {
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.12);
}

.genealogy-immersive .jizu-tab.active {
  color: #1c1610;
  background: linear-gradient(180deg, rgba(255, 223, 120, 0.95), rgba(212, 175, 55, 0.92));
  border-color: rgba(255, 220, 120, 0.6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 0 10px rgba(212,175,55,0.2);
}

.genealogy-immersive .jizu-tab-icon {
  margin-right: 0;
  opacity: 0.95;
}

.genealogy-immersive .jizu-tab-content {
  display: none;
}

.genealogy-immersive .jizu-tab-content.active {
  display: block;
}

/* ===== 文字颜色优化 ===== */
.view-title {
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-serif);
  font-weight: 600;
}

.view-paragraph {
  color: rgba(230, 215, 175, 0.9);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-family: var(--font-serif);
}

.record-title {
  color: var(--gold);
  font-size: 1.05rem;
  font-family: var(--font-serif);
  font-weight: 500;
}

.record-description {
  color: rgba(230, 215, 175, 0.85);
  line-height: 1.65;
  font-size: 0.875rem;
}

.form-label {
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
  font-weight: 500;
}

/* 保存提示 */
.save-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  background: rgba(34, 197, 94, 0.9);
  color: #fff;
  font-size: 0.9rem;
  font-family: var(--font-serif);
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.save-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 统计卡片网格 */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 4rem; }
.stat-card {
  background: linear-gradient(to bottom right, rgba(45, 90, 90, 0.5), transparent);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
}
.stat-value { font-size: 1.875rem; color: var(--gold); margin-bottom: 0.5rem; }
.stat-label { color: rgba(212, 175, 55, 0.7); font-size: 0.875rem; }

/* 祭祀节期卡片 */
.festival-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.5rem; }
.festival-card {
  background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.1), transparent);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
}
.festival-card h4 { font-size: 1.25rem; color: var(--gold); margin-bottom: 0.5rem; }
.festival-time { color: rgba(212, 175, 55, 0.7); font-size: 0.875rem; margin-bottom: 0.5rem; }
.festival-desc { color: rgba(212, 175, 55, 0.6); font-size: 0.75rem; }

/* 流程步骤卡片 */
.steps-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.step-card {
  cursor: pointer;
  position: relative;
}
.step-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.2), transparent);
  border-radius: 0.5rem;
  filter: blur(12px);
  transition: filter 0.3s;
  z-index: 0;
}
.step-card:hover::before { filter: blur(18px); }
.step-card-body {
  position: relative;
  background: linear-gradient(to bottom right, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s;
  height: 100%;
  z-index: 1;
}
.step-card:hover .step-card-body {
  border-color: var(--gold-light);
  transform: scale(1.05);
}
.step-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
  color: var(--gold);
  font-weight: 500;
}
.step-card h3 { font-size: 1.25rem; color: var(--gold); margin-bottom: 0.5rem; }
.step-card .step-desc { color: rgba(212, 175, 55, 0.7); font-size: 0.875rem; line-height: 1.65; }
.step-hint { color: rgba(212, 175, 55, 0.6); font-size: 0.75rem; text-align: right; margin-top: 1rem; }

/* 祭品卡片 */
.offerings-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.offering-card {
  background: linear-gradient(to bottom right, rgba(45, 90, 90, 0.5), transparent);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  padding: 1.5rem;
}
.offering-card h3 { font-size: 1.125rem; color: var(--gold); margin-bottom: 0.5rem; }
.offering-items { color: rgba(212, 175, 55, 0.7); font-size: 0.875rem; margin-bottom: 0.5rem; }
.offering-meaning { color: rgba(212, 175, 55, 0.6); font-size: 0.75rem; font-style: italic; }

/* 祭祀须知 */
.notice-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.notice-item h4 { color: var(--gold); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.notice-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); flex-shrink: 0; }
.notice-item p { color: rgba(212, 175, 55, 0.8); font-size: 0.875rem; line-height: 1.65; padding-left: 1rem; }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-overlay .modal-bg { animation: modalBgIn 0.3s ease-out; }
.modal-content {
  background: linear-gradient(to bottom right, var(--bg-from), var(--bg-to));
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  padding: 2rem;
  width: 100%;
  max-width: 28rem; /* default max-w-md */
  max-height: 80vh;
  overflow-y: auto;
  animation: modalContentIn 0.3s ease-out;
}
.modal-content.lg { max-width: 42rem; } /* max-w-2xl */
.modal-content.xl { max-width: 48rem; max-height: 85vh; } /* max-w-3xl */

.modal-close-btn {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gold);
  border-radius: 0.5rem;
  color: var(--gold);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1.5rem;
  transition: all 0.3s;
}
.modal-close-btn:hover { background: rgba(212, 175, 55, 0.2); }

.modal-divider {
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding-top: 1rem;
  margin-top: 1rem;
}
.modal-source-box {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

/* ===== 响应式设计 ===== */

@media (min-width: 640px) {
  .home-title h1 { font-size: 2.25rem; }
  .home-title p { font-size: 1rem; }
  .scroll-content { padding: 2rem; gap: 2rem; min-height: 700px; }
  .scholar-section img { width: 12rem; }
  .scholar-label { font-size: 1rem; }
  .nav-entries { gap: 2.5rem; }
  .nav-entry-mobile h2 { font-size: 1.875rem; }
  .card-grid-2 { grid-template-columns: 1fr; }
  .motto-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .festival-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .offerings-grid { grid-template-columns: repeat(2, 1fr); }
  .notice-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .history-connector { display: block; }
  .timeline-line { display: block; }
  .timeline-item::after { display: block; }
}

/* ============================================
   家族志页面新增样式
   ============================================ */

/* 通用板块容器 */
.genealogy-section {
  margin-bottom: 3rem;
}

/* 板块头部 */
.section-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.section-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  flex-shrink: 0;
}

.section-icon svg {
  width: 2rem;
  height: 2rem;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
}

.section-icon svg.fill-icon {
  fill: var(--gold);
  stroke: none;
}

.section-title {
  font-size: 1.75rem;
  color: var(--gold);
  font-family: var(--font-serif);
  margin-bottom: 0.25rem;
}

.section-desc {
  color: rgba(212, 175, 55, 0.7);
  font-size: 0.95rem;
  font-family: var(--font-serif);
  letter-spacing: 0.08em;
}

/* 家族志文字可读性增强：与标题拉开层级 */
.genealogy-immersive .page-title {
  color: #ffd96b;
  text-shadow: 0 0 22px rgba(212, 175, 55, 0.55), 0 2px 8px rgba(0, 0, 0, 0.85);
}

.genealogy-immersive .preface-compact-text {
  color: #f7ead2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.78);
}

.genealogy-immersive .section-card-compact-info h3 {
  color: #ffe19a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.genealogy-immersive .section-card-compact-info p {
  color: rgba(245, 230, 190, 0.9);
}


/* 板块内容容器 */
.section-content {
  position: relative;
}

/* 模板卡片 */
.template-card {
  position: relative;
  background: linear-gradient(135deg, rgba(45, 90, 90, 0.5), rgba(26, 56, 56, 0.6));
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.3s;
}

.template-card:hover {
  border-color: var(--gold);
}

.template-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

.template-body {
  color: rgba(230, 215, 175, 0.9);
}

.template-body h3,
.template-body h4 {
  color: var(--gold);
  font-family: var(--font-serif);
}

.template-body h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.template-body h4 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

/* 说明段落 */
.info-paragraph {
  color: rgba(212, 175, 55, 0.85);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-family: var(--font-serif);
}

/* 信息块网格 */
.info-blocks {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-block {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
}

.info-block h4 {
  color: var(--gold);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.info-block p {
  color: rgba(212, 175, 55, 0.75);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* 提示框 */
.template-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1.5rem;
}

.template-notice svg {
  stroke: var(--gold);
  fill: none;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.template-notice p {
  color: rgba(212, 175, 55, 0.75);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* 氏系图占位区域 */
.clan-chart-placeholder {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(45, 90, 90, 0.3);
  border: 2px dashed rgba(212, 175, 55, 0.4);
  border-radius: 0.75rem;
  padding: 2rem;
  min-height: 8rem;
  cursor: pointer;
  transition: all 0.3s;
}

.clan-chart-placeholder:hover {
  border-color: var(--gold);
  background: rgba(45, 90, 90, 0.4);
}

.chart-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chart-icon svg {
  width: 2rem;
  height: 2rem;
  stroke: var(--gold);
  fill: none;
}

.chart-text h4 {
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  font-family: var(--font-serif);
}

.chart-text p {
  color: rgba(212, 175, 55, 0.6);
  font-size: 0.85rem;
}

.api-placeholder {
  display: none; /* 对接API时删除此属性 */
}

/* 郡望堂号网格 */
.junwang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.junwang-item {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 0.65rem;
  padding: 1.5rem;
  text-align: center;
}

.junwang-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
}

.junwang-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: var(--gold);
  fill: none;
}

.junwang-item h4 {
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.junwang-example {
  color: var(--gold-light);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-serif);
}

.junwang-desc {
  color: rgba(212, 175, 55, 0.7);
  font-size: 0.825rem;
  line-height: 1.6;
}

/* 示例详情 */
.example-detail {
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  padding-top: 1.5rem;
}

.example-detail h4 {
  margin-bottom: 1rem;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-label {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold);
  padding: 0.25rem 0.65rem;
  border-radius: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
  font-family: var(--font-serif);
}

.detail-value {
  color: rgba(230, 215, 175, 0.85);
  line-height: 1.7;
  font-size: 0.9rem;
  font-family: var(--font-serif);
  flex: 1;
  min-width: 0;
}

/* 迁徙时间线 */
.migration-timeline {
  position: relative;
  padding-left: 1.5rem;
}

.migration-timeline::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: rgba(212, 175, 55, 0.25);
}

.migration-item {
  position: relative;
  margin-bottom: 2rem;
}

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

.migration-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg-to);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

.migration-content {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.migration-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.migration-era {
  color: rgba(212, 175, 55, 0.65);
  font-size: 0.825rem;
  font-family: var(--font-serif);
}

.migration-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  border-style: solid;
  border-width: 1px;
}

.migration-title {
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
}

.migration-desc {
  color: rgba(212, 175, 55, 0.8);
  line-height: 1.7;
  font-size: 0.9rem;
}

/* 名人卡片网格 */
.celebrity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.celebrity-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 0.5rem;
  padding: 1.25rem;
  transition: all 0.3s;
}

.celebrity-card:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
}

.celebrity-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  flex-shrink: 0;
}

.celebrity-avatar svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: var(--gold);
}

.celebrity-info h4 {
  color: var(--gold);
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
  font-family: var(--font-serif);
}

.celebrity-era {
  color: rgba(212, 175, 55, 0.6);
  font-size: 0.775rem;
  display: block;
  margin-bottom: 0.5rem;
}

.celebrity-desc {
  color: rgba(212, 175, 55, 0.8);
  line-height: 1.65;
  font-size: 0.85rem;
}

/* 字辈内容 */
.zibei-content h4 {
  margin-bottom: 0.6rem;
}

.zibei-intro {
  color: rgba(212, 175, 55, 0.8);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* 字辈诗卡片 */
.zibei-poem {
  margin-bottom: 1.5rem;
}

.poem-card {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 0.65rem;
  padding: 1.5rem;
  text-align: center;
}

.poem-card h4 {
  color: var(--gold);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.poem-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.poem-char {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 0.35rem;
  color: var(--gold);
  font-size: 1.15rem;
  font-family: var(--font-serif);
  font-weight: 500;
  transition: all 0.3s;
}

.poem-char:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: scale(1.08);
}

/* 字辈规则 */
.zibei-rules {
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  padding-top: 1.5rem;
}

.zibei-rules h4 {
  margin-bottom: 0.75rem;
}

.rule-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rule-list li {
  color: rgba(212, 175, 55, 0.8);
  line-height: 1.65;
  font-size: 0.875rem;
  padding-left: 1.25rem;
  position: relative;
}

.rule-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--gold);
}

.rule-list li strong {
  color: var(--gold-light);
}

/* 分支入口 */
.branch-entries {
  margin-top: 3.5rem;
}

.branch-title {
  color: var(--gold);
  font-size: 1.35rem;
  text-align: center;
  margin-bottom: 1.5rem;
  font-family: var(--font-serif);
  letter-spacing: 0.12em;
}

/* ===== 响应式 ===== */

/* 平板 */
@media (min-width: 640px) {
  .celebrity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .info-blocks {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .section-title {
    font-size: 1.875rem;
  }
}

/* 桌面端 */
@media (min-width: 1024px) {
  .celebrity-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .info-blocks {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .poem-grid {
    grid-template-columns: repeat(10, 1fr);
  }
}

@media (min-width: 1024px) {
  .home-title h1 { font-size: 3rem; }
  .scroll-content { padding: 3rem; gap: 3rem; min-height: 500px; }
  .scholar-section img { width: 14rem; }
  .nav-entries { gap: 3rem; }
  .nav-entry-desktop { display: flex; }
  .nav-entry-mobile { display: none; }
  .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .motto-grid { grid-template-columns: repeat(5, 1fr); }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .festival-grid { grid-template-columns: repeat(4, 1fr); }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .offerings-grid { grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* 时间线左右交替 */
  .timeline-item:nth-child(odd) { padding-right: calc(50% + 1rem); text-align: right; }
  .timeline-item:nth-child(even) { padding-left: calc(50% + 1rem); text-align: left; }
  .timeline-item:nth-child(odd) .event-inner { flex-direction: row-reverse; }
}

/* ============================================
   家族志 & 沉浸式页面深度优化
   ============================================ */

/* 通用：隐藏全局滚动条，强化卷轴式交互感 */
.page-immersive {
  overflow: hidden !important;
}

/* 沉浸式页面的内滚动容器 */
.bento-scroll-container {
  max-height: 86vh;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  padding-bottom: 2rem;
}
.bento-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* 家族志移动端 (窄屏 <= 640px) 极简适配 */
@media (max-width: 640px) {
  .page-immersive .page-inner {
    padding: 3.5rem 0.75rem 1.5rem !important; /* 压缩顶部间距 */
    margin: 0.5rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, rgba(45, 90, 90, 0.95), rgba(26, 56, 56, 0.98)); /* 手机端背景更扎实 */
  }

  .page-header {
    margin-bottom: 1.25rem !important;
  }

  .page-title {
    font-size: 1.75rem !important;
    letter-spacing: 0.1em !important;
  }

  .page-subtitle {
    font-size: 0.8rem !important;
  }

  .preface-block {
    padding: 1rem 1.25rem !important;
    margin-bottom: 1.5rem !important;
    border-width: 1px !important;
  }

  .preface-text {
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
    color: #fff !important; /* 手机端强制白色/极亮米色 */
    text-shadow: 0 1px 3px rgba(0,0,0,0.9) !important;
  }

  .timeline-item {
    margin-bottom: 1.25rem !important;
  }

  .timeline-event-body {
    padding: 0.85rem 1rem !important;
    border-radius: 0.75rem !important;
  }

  .timeline-event-body h3 {
    font-size: 1.05rem !important;
    margin-bottom: 0.35rem !important;
  }

  .timeline-event-body p {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    color: #e8d4a8 !important; /* 提升正文明度 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.8) !important;
    -webkit-line-clamp: 2 !important; /* 手机端仅保留两行预览 */
  }

  /* 压缩分类标签 */
  .category-badge {
    padding: 0.15rem 0.5rem !important;
    font-size: 0.7rem !important;
  }

  /* 家族箴言网格压缩 */
  .motto-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }

  .motto-item {
    padding: 0.65rem 0.35rem !important;
    font-size: 0.85rem !important;
    min-height: auto !important;
  }

  .motto-item p {
    margin: 0 !important;
  }

  /* 底部装饰块压缩 */
  .page-immersive div[style*="margin-top:4rem"] {
    margin-top: 2rem !important;
  }
}

/* 家族志页：标题上提并对齐祭祀文化页头部 */
.genealogy-immersive .page-container {
  padding-top: 0.8rem;
}

.genealogy-immersive .page-inner {
  padding-top: 1.35rem !important;
}

.genealogy-immersive .back-btn {
  left: auto;
  right: 2rem;
  top: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  position: absolute;
  z-index: 60;
}

.genealogy-immersive .back-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}

.genealogy-immersive .page-header {
  text-align: left;
  margin-bottom: 0.8rem !important;
}

.genealogy-immersive .page-header > div {
  justify-content: flex-start !important;
  gap: 0.9rem !important;
}

.genealogy-immersive .page-header .icon-circle-sm {
  width: 3.2rem !important;
  height: 3.2rem !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-width: 2px !important;
}

.genealogy-immersive .page-header .icon-circle-sm svg {
  width: 1.7rem;
  height: 1.7rem;
}

.genealogy-immersive .page-header .page-title {
  margin-bottom: 0 !important;
}

@media (max-width: 640px) {
  .genealogy-immersive .page-container {
    padding: 0.75rem;
  }

  .genealogy-immersive .page-inner {
    padding: 1rem 0.8rem 1.2rem !important;
  }

  .genealogy-immersive .back-btn {
    right: 1rem;
    top: 1rem;
    width: 2.25rem;
    height: 2.25rem;
  }

  .genealogy-immersive .page-header {
    margin-bottom: 0.7rem !important;
  }

  .genealogy-immersive .page-header > div {
    gap: 0.7rem !important;
  }

  .genealogy-immersive .page-header .icon-circle-sm {
    width: 2.55rem !important;
    height: 2.55rem !important;
  }

  .genealogy-immersive .page-header .icon-circle-sm svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .genealogy-immersive .page-header .page-title {
    font-size: 1.5rem !important;
    letter-spacing: 0.08em !important;
  }
}

/* 祭祀文化页：极致紧凑的一屏化布局 */
.sacrifice-page .page-container {
  height: 100vh;
  overflow: hidden;
  padding: 0.8rem;
}

.sacrifice-page .page-inner {
  padding-top: 1.2rem !important;
  height: calc(100vh - 1.6rem);
  max-height: calc(100vh - 1.6rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 返回按钮移至右上角 */
.sacrifice-page .back-btn {
  left: auto;
  right: 2rem;
  top: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  position: absolute; /* 确保在容器内定位 */
  z-index: 60;
}

.sacrifice-page .back-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* 标题区左对齐 */
.sacrifice-page .page-header {
  text-align: left;
  margin-bottom: 0.6rem;
}

.sacrifice-page .title-flex {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* 礼仪列：默认窄屏逻辑（按钮切换） */
.sacrifice-page .ritual-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 1rem;
  overflow: hidden;
}

/* 模组切换导航（作为面板头部） */
.sacrifice-page .module-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  margin-bottom: 0;
  padding: 0.28rem;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-bottom: none;
  border-radius: 1rem 1rem 0 0;
  background: linear-gradient(135deg, rgba(45, 90, 90, 0.38), rgba(26, 56, 56, 0.42));
  box-shadow: inset 0 -1px 0 rgba(212, 175, 55, 0.12);
  flex-shrink: 0;
  position: relative;
  --active-x: 0px;
  --active-w: 120px;
}

.sacrifice-page .module-switch::after {
  content: '';
  position: absolute;
  left: calc(var(--active-x) + 0.5rem);
  width: calc(var(--active-w) - 1rem);
  bottom: -0.48rem;
  height: 0.48rem;
  background: linear-gradient(to bottom, rgba(255, 223, 120, 0.45), rgba(212, 175, 55, 0));
  pointer-events: none;
  transition: left 0.25s ease, width 0.25s ease;
}

.sacrifice-page .module-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0 !important;
  text-align: center;
  white-space: nowrap;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 0.42rem 0.8rem !important;
  min-height: 2.1rem;
  opacity: 0.72;
  box-shadow: none !important;
  transform: none !important;
  color: rgba(245, 230, 211, 0.88) !important;
  font-size: 0.84rem !important;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
}

.sacrifice-page .module-btn:hover {
  opacity: 0.95;
  color: var(--gold-light) !important;
  background: rgba(212, 175, 55, 0.08) !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}

.sacrifice-page .module-btn.active {
  opacity: 1;
  color: #1c1610 !important;
  background: linear-gradient(180deg, rgba(255, 223, 120, 0.92), rgba(212, 175, 55, 0.92)) !important;
  border-color: rgba(255, 220, 120, 0.6) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 0 8px rgba(212, 175, 55, 0.18) !important;
}

/* 模组面板切换逻辑（窄屏） */
.sacrifice-page .ritual-panel {
  display: none;
  height: 100%;
  min-height: 0;
}

.sacrifice-page .ritual-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: linear-gradient(to bottom right, rgba(45, 90, 90, 0.2), rgba(26, 56, 56, 0.24));
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-top: none;
  border-radius: 0 0 1rem 1rem;
  padding: 0.7rem 0.75rem 0.75rem;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.sacrifice-page .ritual-column.active-era #era-panel.active,
.sacrifice-page .ritual-column.active-modern #modern-panel.active {
  border-color: rgba(255, 220, 120, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 220, 120, 0.12), 0 0 18px rgba(212, 175, 55, 0.12);
}

/* 宽屏：不使用按钮切换，恢复两部分并列展示 */
@media (min-width: 1025px) {
  .sacrifice-page .sacrifice-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sacrifice-page .central-display {
    display: none;
  }

  .sacrifice-page .module-switch {
    display: none !important;
  }

  .sacrifice-page .ritual-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    border-radius: 0;
    overflow: visible;
  }

  .sacrifice-page .ritual-panel,
  .sacrifice-page .ritual-panel.active {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 1rem;
    padding: 0.7rem 0.75rem 0.75rem;
    background: linear-gradient(to bottom right, rgba(45, 90, 90, 0.2), rgba(26, 56, 56, 0.24));
    box-shadow: none;
  }

  /* 双列标题：黑底黄字，宽度随文字 */
  .sacrifice-page .era-timeline > h3,
  .sacrifice-page .modern-templates > h3 {
    position: sticky;
    top: 0;
    z-index: 5;
    display: table;
    width: auto;
    text-align: center;
    margin: 0 auto 0.7rem !important;
    padding: 0.5rem 0.7rem;
    border: 1px solid rgba(212, 175, 55, 0.42);
    border-radius: 0.6rem;
    background: linear-gradient(135deg, rgba(20, 36, 36, 0.86), rgba(32, 58, 58, 0.84));
    color: var(--gold-light) !important;
    font-size: 1rem !important;
    letter-spacing: 0.12em;
    font-weight: 700;
    opacity: 1 !important;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.35), 0 1px 2px rgba(0,0,0,0.8);
    box-shadow: 0 2px 10px rgba(0,0,0,0.22);
  }

}

/* 内容面板滚动限制 */
.sacrifice-page .era-timeline,
.sacrifice-page .modern-templates {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.55rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,55,0.22) transparent;
}

.sacrifice-page .era-timeline::-webkit-scrollbar,
.sacrifice-page .modern-templates::-webkit-scrollbar {
  width: 4px;
}
.sacrifice-page .era-timeline::-webkit-scrollbar-thumb,
.sacrifice-page .modern-templates::-webkit-scrollbar-thumb {
  background: rgba(212,175,55,0.3);
  border-radius: 10px;
}

/* 双栏 Grid 布局：左侧面板 (45%) + 右侧展示 (55%) */
.sacrifice-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr; 
  gap: 1.5rem;
  margin-top: 0.4rem;
  flex: 1;
  min-height: 0;
}

/* 时代项压缩 */
.era-entry {
  padding: 0.5rem 0.8rem !important;
  margin-bottom: 0;
}

.era-arrow {
  padding: 0.05rem 0 !important;
}

.central-display {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 90, 90, 0.05);
  border-radius: 1.5rem;
  border: 1px solid rgba(212, 175, 55, 0.1);
  margin-bottom: 1rem;
}

/* 窄屏适配：礼仪区独占高度，内部可滚动 */
@media (max-width: 1024px) {
  .sacrifice-page .page-inner {
    height: calc(100vh - 1.6rem) !important;
    max-height: calc(100vh - 1.6rem) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .sacrifice-page .sacrifice-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 0;
    height: 100%;
    min-height: 0;
    flex: 1;
  }

  .sacrifice-page .central-display {
    display: none;
  }

  .sacrifice-page .ritual-column {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .sacrifice-page .ritual-panel.active {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .sacrifice-page .era-timeline,
  .sacrifice-page .modern-templates {
    min-height: 0;
    flex: 1 1 auto;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  .sacrifice-page .page-container {
    padding: 0.28rem !important;
  }

  .sacrifice-page .back-btn {
    right: 0.72rem;
    top: 0.72rem;
  }
  
  .sacrifice-page .page-inner {
    padding: 0.72rem 0.24rem 0.72rem !important;
  }

  .sacrifice-page .sacrifice-grid,
  .sacrifice-page .ritual-column,
  .sacrifice-page .module-switch,
  .sacrifice-page .ritual-panel.active {
    width: 100% !important;
    max-width: none !important;
  }
  
  .sacrifice-page .module-switch {
    gap: 0.14rem;
    padding: 0.12rem;
    border-radius: 0.82rem 0.82rem 0 0;
  }
  
  .sacrifice-page .module-btn {
    font-size: 0.76rem !important;
    padding: 0.3rem 0.52rem !important;
    min-height: 1.9rem;
  }

  .sacrifice-page .ritual-panel.active {
    border-radius: 0 0 0.82rem 0.82rem;
    padding: 0.56rem 0.42rem 0.58rem;
  }

  .sacrifice-page .era-timeline,
  .sacrifice-page .modern-templates {
    padding-right: 0.12rem;
  }
}

@media (max-width: 390px) {
  .sacrifice-page .page-container {
    padding: 0.16rem !important;
  }

  .sacrifice-page .page-inner {
    padding: 0.62rem 0.14rem 0.64rem !important;
  }

  .sacrifice-page .ritual-panel.active {
    padding: 0.5rem 0.32rem 0.54rem !important;
  }

  .sacrifice-page .era-timeline,
  .sacrifice-page .modern-templates {
    padding-right: 0.08rem !important;
  }
}

/* ===== 首页轮播最终修正：禁上浮 + 恢复文字可读性 ===== */
.item-hero,
.item-hero:hover,
.item-hero:active,
.item-hero:focus,
.item-hero:focus-within {
  transform: none !important;
}

.item-hero:hover,
.item-hero:active,
.item-hero:focus,
.item-hero:focus-within {
  box-shadow: none !important;
}

@media (max-width: 640px) {
  .item-hero {
    overflow: hidden;
  }

  .hero-merged-content {
    padding: 0.16rem 0.24rem 0.06rem !important;
    gap: 0.1rem !important;
  }

  .hero-scholar-block {
    flex: 0 0 37% !important;
  }

  .hero-scholar-wrap {
    height: calc(100% - 0.6rem) !important;
  }

  .hero-scholar-label {
    margin-top: 0.02rem !important;
    font-size: 0.62rem !important;
    line-height: 1 !important;
  }

  .poem-wrapper {
    flex: 0 0 63% !important;
  }

  .poem-vertical {
    gap: 0.08rem !important;
    --poem-size: clamp(14px, 4.45vw, 21px) !important;
  }

  .hero-info-image {
    flex: 0 0 60% !important;
    padding: 0.12rem 0.24rem !important;
  }

  .hero-info-text {
    flex: 0 0 40% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 0.16rem 0.42rem 0.16rem !important;
    overflow: hidden !important;
  }

  .hero-info-title {
    flex: 0 0 auto !important;
    font-size: clamp(0.94rem, 4.4vw, 1.08rem) !important;
    margin-bottom: 0.08rem !important;
    gap: 0.24rem !important;
  }

  .hero-info-list {
    flex: 1 1 auto !important;
    justify-content: space-between !important;
    font-size: clamp(0.74rem, 2.95vw, 0.88rem) !important;
    gap: 0.04rem !important;
    line-height: 1.16 !important;
  }

  .hero-info-list > li {
    gap: 0.1rem !important;
  }

  .info-label {
    font-size: 0.72em !important;
  }

  .info-sub {
    margin: 0.02rem 0 0 0.22rem !important;
    gap: 0.04rem !important;
  }

  .info-sub li {
    padding-left: 0.48rem !important;
    font-size: 0.9em !important;
    line-height: 1.12 !important;
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  .poem-vertical {
    --poem-size: clamp(13px, 4.2vw, 18px) !important;
  }

  .hero-scholar-label {
    font-size: 0.58rem !important;
  }

  .hero-info-image {
    flex-basis: 60% !important;
  }

  .hero-info-text {
    flex-basis: 40% !important;
    padding: 0.1rem 0.3rem 0.1rem !important;
  }

  .hero-info-title {
    font-size: clamp(0.9rem, 4.1vw, 1.02rem) !important;
  }

  .hero-info-list {
    font-size: clamp(0.72rem, 2.8vw, 0.82rem) !important;
    gap: 0.03rem !important;
    line-height: 1.08 !important;
  }

  .info-sub li {
    line-height: 1.08 !important;
  }
}

@media (max-width: 390px) {
  .hero-merged-content {
    padding: 0.14rem 0.16rem 0.06rem !important;
    gap: 0.06rem !important;
  }

  .hero-scholar-block {
    flex-basis: 35% !important;
  }

  .poem-wrapper {
    flex-basis: 65% !important;
  }

  .poem-vertical {
    gap: 0.06rem !important;
    --poem-size: clamp(12px, 4.05vw, 16px) !important;
  }

  .hero-scholar-label {
    font-size: 0.56rem !important;
  }

  .hero-info-image {
    flex-basis: 60% !important;
    padding: 0.1rem 0.16rem !important;
  }

  .hero-info-text {
    flex-basis: 40% !important;
    padding: 0.08rem 0.22rem 0.1rem !important;
  }

  .hero-info-title {
    font-size: clamp(0.88rem, 4.15vw, 0.98rem) !important;
    margin-bottom: 0.05rem !important;
  }

  .hero-info-list {
    font-size: clamp(0.68rem, 2.95vw, 0.78rem) !important;
    gap: 0.03rem !important;
    line-height: 1.08 !important;
  }
}

/* ===== 首页手机端轮播高度最终压缩 ===== */
@media (max-width: 640px) {
  .bento-grid {
    grid-template-rows: minmax(0, 4.7fr) minmax(0, 1.3fr) !important;
  }

  .item-nav-row {
    min-height: clamp(96px, 14.6svh, 122px) !important;
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  .bento-grid {
    grid-template-rows: minmax(0, 4.45fr) minmax(0, 1.45fr) !important;
  }

  .item-nav-row {
    min-height: 90px !important;
  }
}

@media (max-width: 390px) {
  .bento-grid {
    grid-template-rows: minmax(0, 4.25fr) minmax(0, 1.55fr) !important;
  }

  .item-nav-row {
    min-height: 84px !important;
  }
}

/* ===== 首页轮播文字最终覆盖：放大文字，取消拉间距填充 ===== */
@media (max-width: 640px) {
  .hero-info-text {
    padding: 0.14rem 0.4rem 0.12rem !important;
  }

  .hero-info-title {
    font-size: clamp(1.08rem, 5.1vw, 1.24rem) !important;
    margin-bottom: 0.05rem !important;
    gap: 0.2rem !important;
  }

  .hero-info-list {
    flex: 0 1 auto !important;
    justify-content: flex-start !important;
    font-size: clamp(0.86rem, 3.45vw, 1rem) !important;
    gap: 0.02rem !important;
    line-height: 1.08 !important;
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  .hero-info-text {
    padding: 0.1rem 0.3rem 0.1rem !important;
  }

  .hero-info-title {
    font-size: clamp(0.96rem, 4.35vw, 1.1rem) !important;
  }

  .hero-info-list {
    font-size: clamp(0.78rem, 3.02vw, 0.88rem) !important;
    gap: 0.02rem !important;
    line-height: 1.06 !important;
  }
}

@media (max-width: 390px) {
  .hero-info-text {
    padding: 0.08rem 0.22rem 0.1rem !important;
  }

  .hero-info-title {
    font-size: clamp(0.94rem, 4.4vw, 1.04rem) !important;
    margin-bottom: 0.04rem !important;
  }

  .hero-info-list {
    font-size: clamp(0.74rem, 3.12vw, 0.84rem) !important;
    gap: 0.02rem !important;
    line-height: 1.06 !important;
  }
}

/* ===== 首页轮播短屏文字终态覆盖 ===== */
@media (max-width: 640px) and (max-height: 760px) {
  .hero-info-title {
    font-size: clamp(0.96rem, 4.35vw, 1.1rem) !important;
  }

  .hero-info-list {
    font-size: clamp(0.78rem, 3.02vw, 0.88rem) !important;
    gap: 0.02rem !important;
    line-height: 1.06 !important;
  }
}

/* ===== 首页窄屏终态修正：按钮略矮，文字更大 ===== */
@media (max-width: 640px) {
  .item-nav-row {
    min-height: clamp(90px, 13.6svh, 116px) !important;
  }

  .nav-inline {
    padding: 0.48rem 0.26rem 0.42rem !important;
  }
}

@media (max-width: 390px) {
  .item-nav-row {
    min-height: 78px !important;
  }

  .nav-inline {
    padding: 0.3rem 0.1rem 0.28rem !important;
  }

  .hero-info-text {
    padding: 0.08rem 0.2rem 0.08rem !important;
  }

  .hero-info-title {
    font-size: clamp(1rem, 4.75vw, 1.1rem) !important;
    margin-bottom: 0.04rem !important;
  }

  .hero-info-list {
    font-size: clamp(0.8rem, 3.45vw, 0.9rem) !important;
    gap: 0.02rem !important;
    line-height: 1.04 !important;
  }
}







/* ============================================
   用户面板样式 - 从 worship-v7/css/user-panel.css 迁移
   首页专用：.home-user-panel-modal 替代 .user-panel-modal
   ============================================ */

/* 首页用户面板模态框覆盖层 */
.home-user-panel-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 50, 38, 0.5);
  backdrop-filter: blur(4px);
  z-index: 25000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

/* 首页确认对话框覆盖层 */
.home-up-confirm-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 50, 38, 0.6);
  backdrop-filter: blur(4px);
  z-index: 35000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
/* ============================================
   用户面板 - 古风新设计
   ============================================ */

/* ==================== 用户栏入口 ==================== */
/* 用户入口栏：左侧用户信息入口，右侧公告入口 */
.user-bar {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 2%;
  z-index: 6200;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-bar__cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
  max-width: min(92vw, 520px);
}

.user-bar__cluster--left {
  justify-content: flex-start;
}

.user-bar__cluster > * {
  pointer-events: auto;
}

.user-entry {
  pointer-events: auto;
  position: relative;
  border: 2px solid rgba(212, 175, 55, 0.6);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #d4af37;
  min-height: 30px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.75);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.28);
  transition: all 0.2s ease;
}

.user-entry:hover {
  transform: translateY(-1px);
  background: rgba(212, 175, 55, 0.2);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.42);
}

.user-entry-user-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.user-entry-user-icon-svg {
  width: 18px;
  height: 18px;
  display: block;
  color: currentColor;
}

.entry-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff2d2d;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 45, 45, 0.5);
  pointer-events: none;
}

@media (orientation: portrait) {
  .user-bar {
    position: fixed;
    left: 4vw;
    right: 4vw;
    bottom: 6px;
    z-index: 6200;
  }

  .user-entry {
    max-width: 45vw;
    min-height: 28px;
    padding: 4px 9px;
    font-size: 12px;
  }
}

@media (orientation: landscape) and (max-width: 1200px) {
  .user-entry {
    font-size: 12px;
    min-height: 28px;
    padding: 4px 9px;
  }
}

/* ==================== 模态框 ==================== */
.user-panel-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 50, 38, 0.5);
  backdrop-filter: blur(4px);
  z-index: 20000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.user-panel-container {
  position: relative;
  background: #faf8f3;
  border: 2px solid #8b7355;
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(61, 50, 38, 0.35);
  animation: modalSlideIn 0.3s ease-out;
}

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

/* ==================== 关闭按钮 ==================== */
.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: #fefdfb;
  border: 1px solid #8b7355;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b5744;
  transition: all 0.3s;
  z-index: 10;
}

.close-btn:hover {
  background: #f5f1e8;
  border-color: #6b5744;
  transform: rotate(90deg);
}

/* ==================== 头部 ==================== */
.panel-header {
  padding: 16px 20px 14px;
  background: linear-gradient(to right, #faf8f3, #f5f1e8);
  border-bottom: 1px solid #8b7355;
}

.panel-title {
  font-size: 22px;
  font-weight: 900;
  color: #2d2419;
  text-align: center;
  letter-spacing: 2px;
}

/* ==================== 标签页 ==================== */
.tabs-container {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
  background: #faf8f3;
  border-bottom: 1px solid #e8d9c0;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: #fefdfb;
  border: 1px solid #d4c4b0;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 14px;
  font-weight: 900;
  color: #6b5744;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn:hover {
  background: #f5f1e8;
  border-color: #b8a896;
}

.tab-btn.user-panel-tab-btn--active {
  background: #f5f1e8;
  border-color: #8b7355;
  color: #2d2419;
  position: relative;
}

.tab-btn.user-panel-tab-btn--active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #f5f1e8;
}

.tab-icon {
  font-size: 20px;
}

.tab-label {
  font-weight: 900;
}

/* ==================== 标签页内容 ==================== */
.tabs-content {
  padding: 16px;
  background: #f5f1e8;
}

.tab-panel {
  display: block;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.stats-grid .stat-card {
  flex: 1 1 calc(50% - 5px);
  min-width: 120px;
}

@media (min-width: 768px) {
  .stats-grid {
    gap: 12px;
  }
  
  .stats-grid .stat-card {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 140px;
  }
}

.stat-card {
  position: relative;
  background: #fcf9f5;
  border: 1px solid #d4af78;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(61, 50, 38, 0.12);
  transition: all 0.3s;
  min-height: 100px;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(61, 50, 38, 0.25);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed #e8d9c0;
  border-radius: 6px;
  pointer-events: none;
}

.stat-card--privilege {
  border-color: #b08968;
}

.stat-card--privilege::before {
  border-color: #d4c4b0;
}

.stat-card--active {
  border-color: #8fbc8f;
}

.stat-card--active::before {
  border-color: #c5e1c5;
}

.stat-card-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #f5f1e8;
  border: 1px solid;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-icon--fire {
  background: #c85a54;
  border-color: #8b3a3a;
}

.stat-icon--privilege {
  background: #9d7652;
  border-color: #7d5a3f;
}

.stat-icon--family {
  width: 32px;
  height: 32px;
  font-size: 14px;
  background: #c85a54;
  border-color: #8b3a3a;
  flex-shrink: 0;
}

.stat-emoji {
  font-size: 24px;
}

.stat-label {
  font-size: 14px;
  font-weight: 700;
  color: #8b7355;
}

.stat-value {
  font-size: 28px;
  font-weight: 900;
  color: #1a1410;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-expiry {
  font-size: 12px;
  font-weight: 700;
  color: #a0825f;
  min-height: 16px;
}

.stat-expiry-placeholder {
  height: 16px;
}

/* ==================== 用户信息卡片 ==================== */
.user-info-card {
  position: relative;
  background: #fefdfb;
  border: 1px solid #8b7355;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(61, 50, 38, 0.12);
}

.user-info-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed #a0825f;
  border-radius: 4px;
  pointer-events: none;
}

.user-info-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item--family {
  align-items: flex-start;
}

.info-emoji {
  font-size: 24px;
  flex-shrink: 0;
}

.info-content {
  flex: 1;
  min-width: 0;
}

.info-content--family {
  flex: 1;
  min-width: 0;
}

.info-label {
  font-size: 12px;
  font-weight: 700;
  color: #8b7355;
  margin-bottom: 2px;
}

.info-value {
  font-size: 15px;
  font-weight: 900;
  color: #1a1410;
}

.info-value--family {
  font-size: 15px;
  font-weight: 900;
  color: #1a1410;
  letter-spacing: 1px;
  word-break: break-all;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #faf8f3;
  border: 2px solid #8b7355;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 900;
  color: #4a3f2f;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: #f5f1e8;
  border-color: #6b5744;
}

.copy-btn.copied {
  background: #e8f5e9;
  border-color: #7cb342;
  color: #33691e;
}

.copy-btn--family {
  padding: 8px 12px;
  font-size: 13px;
}

/* ==================== 家族信息卡片（三行显示） ==================== */
.family-info-card {
  position: relative;
  background: #fefdfb;
  border: 1px solid #8b7355;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(61, 50, 38, 0.12);
}

.family-info-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed #a0825f;
  border-radius: 4px;
  pointer-events: none;
}

.family-info-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #d4c4b0;
}

.family-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.family-info-row:first-child {
  padding-top: 0;
}

.family-info-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c85a54;
  border: 2px solid #8b3a3a;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  color: #f5f1e8;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.family-info-icon--tablet {
  background: #9d7652;
  border-color: #7d5a3f;
  font-size: 16px;
  font-weight: normal;
}

.family-info-icon--permissions {
  background: #7b9e5c;
  border-color: #5a7a3e;
  font-size: 16px;
  font-weight: normal;
}

.family-info-content {
  flex: 1;
  min-width: 0;
}

.family-info-label {
  font-size: 12px;
  font-weight: 700;
  color: #8b7355;
  margin-bottom: 4px;
}

.family-info-value {
  font-size: 16px;
  font-weight: 900;
  color: #1a1410;
  letter-spacing: 1px;
  word-break: break-all;
}

.family-info-value--tablet {
  color: #2d2419;
  font-size: 15px;
}

.family-info-content--permissions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.family-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f5f1e8;
  border: 2px solid #d4af78;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #6b5744;
  transition: all 0.3s;
}

.permission-tag:hover {
  background: #faf8f3;
  border-color: #b89860;
  transform: translateY(-1px);
}

.permission-tag--none {
  background: #f0f0f0;
  border-color: #d0d0d0;
  color: #999;
}

.permission-icon {
  font-size: 14px;
}

.permission-name {
  white-space: nowrap;
}

.family-info-row--id {
  align-items: center;
}

/* ==================== 快捷按钮 ==================== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.quick-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: #faf8f3;
  border: 1px solid #8b7355;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  color: #4a3f2f;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(61, 50, 38, 0.1);
}

.quick-btn:hover {
  background: #f5f1e8;
  border-color: #6b5744;
  color: #2d2419;
  box-shadow: 0 4px 10px rgba(61, 50, 38, 0.2);
}

.quick-icon {
  font-size: 20px;
}

.quick-label {
  font-weight: 900;
}

/* ==================== 折叠面板 ==================== */
.collapse-panel {
  margin-bottom: 20px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.collapse-panel-inner {
  background: #fefdfb;
  border: 2px solid #8b7355;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(61, 50, 38, 0.15);
}

.collapse-title {
  font-size: 18px;
  font-weight: 900;
  color: #2d2419;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #d4c4b0;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-label {
  font-size: 14px;
  font-weight: 700;
  color: #8b7355;
  min-width: 60px;
}

.contact-value {
  font-size: 16px;
  font-weight: 900;
  color: #1a1410;
}

.rule-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rule-section {
  display: flex;
  gap: 12px;
}

.rule-number {
  font-size: 20px;
  font-weight: 900;
  color: #c85a54;
  flex-shrink: 0;
}

.rule-text {
  flex: 1;
}

.rule-title {
  font-size: 16px;
  font-weight: 900;
  color: #2d2419;
  margin-bottom: 8px;
}

.rule-desc {
  font-size: 14px;
  font-weight: 700;
  color: #4a3f2f;
  line-height: 1.6;
}

/* ==================== 退出登录 ==================== */
.logout-section {
  text-align: center;
  margin-top: 16px;
}

.logout-btn {
  padding: 10px 24px;
  background: #fefdfb;
  border: 1px solid #c85a54;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 900;
  color: #c85a54;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(200, 90, 84, 0.2);
}

.logout-btn:hover {
  background: #ffebee;
  border-color: #b84a44;
  color: #b84a44;
  box-shadow: 0 4px 10px rgba(200, 90, 84, 0.3);
}

/* ==================== 余额卡片 ==================== */
.balance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .balance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.balance-card {
  position: relative;
  background: #fefdfb;
  border: 2px solid #d4af78;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(61, 50, 38, 0.15);
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed #e8d9c0;
  border-radius: 6px;
  pointer-events: none;
}

.balance-card--privilege {
  border-color: #b08968;
}

.balance-card--privilege::before {
  border-color: #d4c4b0;
}

.balance-card-inner {
  position: relative;
}

.balance-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* ==================== 余额条（紧凑单行显示） ==================== */
.balance-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #faf8f3;
  border: 1px solid #d4af78;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(61, 50, 38, 0.1);
}

.balance-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.balance-dot--fire {
  background: #c85a54;
  box-shadow: 0 0 4px #c85a54;
}

.balance-dot--privilege {
  background: #9d7652;
  box-shadow: 0 0 4px #9d7652;
}

.balance-name {
  font-size: 13px;
  color: #8b7355;
  font-weight: 700;
}

.balance-amount {
  font-size: 18px;
  font-weight: 900;
  color: #2d2419;
  min-width: 30px;
  text-align: right;
}

.balance-divider {
  color: #d4c4b0;
  font-weight: 300;
  margin: 0 4px;
}

@media (max-width: 640px) {
  .balance-bar {
    padding: 10px 12px;
    gap: 12px;
  }
  
  .balance-name {
    font-size: 12px;
  }
  
  .balance-amount {
    font-size: 16px;
  }
}

/* ==================== 用户信息统计条 ==================== */
.user-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 8px;
  background: linear-gradient(to right, #fefdfb, #faf8f3);
  border: 2px solid #d4af78;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(61, 50, 38, 0.12);
}

.user-stats-bar::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed #e8d9c0;
  border-radius: 6px;
  pointer-events: none;
}

.user-stats-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-stats-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.user-stats-dot--fire {
  background: #c85a54;
  box-shadow: 0 0 6px #c85a54;
}

.user-stats-dot--privilege {
  background: #9d7652;
  box-shadow: 0 0 6px #9d7652;
}

.user-stats-dot--active {
  background: #7cb342;
  box-shadow: 0 0 6px #7cb342;
}

.user-stats-name {
  font-size: 13px;
  color: #6b5744;
  font-weight: 700;
}

.user-stats-value {
  font-size: 20px;
  font-weight: 900;
  color: #2d2419;
  min-width: 30px;
  text-align: right;
}

.user-stats-divider {
  color: #d4c4b0;
  font-weight: 300;
  margin: 0 4px;
  font-size: 14px;
}

.user-stats-expiry {
  text-align: center;
  font-size: 12px;
  color: #8b7355;
  margin-bottom: 16px;
  padding: 0 8px;
}

@media (max-width: 640px) {
  .user-stats-bar {
    padding: 12px 16px;
    gap: 12px;
  }
  
  .user-stats-name {
    font-size: 12px;
  }
  
  .user-stats-value {
    font-size: 18px;
  }
  
  .user-stats-dot {
    width: 8px;
    height: 8px;
  }
}

.balance-label {
  font-size: 16px;
  font-weight: 700;
  color: #6b5744;
}

.balance-value {
  font-size: 48px;
  font-weight: 900;
  color: #2d2419;
  line-height: 1;
}

/* ==================== 兑换卡片 - 所有屏幕统一用窄屏样式 ==================== */
.exchange-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exchange-card {
  position: relative;
  background: #fefdfb;
  border: 2px solid #d4af78;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(61, 50, 38, 0.15);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  min-height: 140px;
}

.exchange-card::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed #e8d9c0;
  border-radius: 6px;
  pointer-events: none;
}

.exchange-card:hover {
  box-shadow: 0 4px 12px rgba(61, 50, 38, 0.25);
  transform: translateY(-4px);
}

/* 价格放到右上角 - 古风标签样式 */
.exchange-price {
  position: absolute;
  top: 12px;
  right: 12px;
  text-align: center;
  background: #faf8f3;
  border: 2px solid #d4af78;
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 2px 6px rgba(61, 50, 38, 0.15);
  min-width: 60px;
}

.exchange-price::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1px dashed #e8d9c0;
  border-radius: 4px;
  pointer-events: none;
}

.exchange-price .price-label {
  font-size: 10px;
  color: #8b7355;
  margin-bottom: 2px;
  font-weight: 700;
}

.exchange-price .price-value {
  font-size: 18px;
  color: #c85a54;
  font-weight: 900;
}

/* 特权值价格用不同颜色 */
.exchange-card[data-currency="privilege"] .exchange-price .price-value {
  color: #9d7652;
}

/* 头部信息 */
.exchange-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-right: 80px;
}

.exchange-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #e8d9c0, #d4c4b0);
  border: 2px solid #b08968;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(61, 50, 38, 0.1);
}

.exchange-info {
  flex: 1;
  min-width: 0;
}

.exchange-title {
  font-size: 16px;
  font-weight: 900;
  color: #2d2419;
  line-height: 1.3;
  margin-bottom: 4px;
}

.exchange-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #f5f1e8;
  border: 2px solid #c4b5a0;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  color: #6b5744;
}

/* 商品说明 */
.exchange-note {
  flex: 1;
  margin: 6px 0 10px;
  font-size: 12px;
  color: #6b5744;
  line-height: 1.4;
}

/* 按钮横向排列 */
.exchange-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: auto;
}

.exchange-btn {
  flex: 1;
  padding: 12px 8px;
  background: #d4af78;
  border: 2px solid #b89860;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 900;
  color: #2d2419;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(61, 50, 38, 0.15);
  white-space: nowrap;
}

.exchange-btn:hover {
  background: #c9a165;
  box-shadow: 0 4px 10px rgba(61, 50, 38, 0.25);
  transform: scale(1.02);
}

.exchange-btn:active {
  transform: scale(0.98);
}

.exchange-btn:disabled {
  background: #e8e0d0;
  border-color: #d4c4b0;
  color: #8b7355;
  cursor: not-allowed;
  box-shadow: none;
}

.exchange-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.exchange-btn--demo {
  flex: 0 0 80px;
  min-width: 80px;
  background: #faf8f3;
  border: 2px solid #8b7355;
  color: #6b5744;
  order: 2;
  font-size: 12px;
}

.exchange-btn--demo:hover {
  background: #f5f1e8;
  border-color: #6b5744;
}

.exchange-btn--primary {
  order: 1;
}

/* 已解锁商品样式 */
.exchange-card--unlocked {
  border-color: #7cb342;
  background: #f1f8e9;
}

.exchange-card--unlocked::before {
  border-color: #c5e1a5;
}

.exchange-card--unlocked .exchange-icon {
  background: #7cb342;
  border-color: #558b2f;
}

.exchange-card--unlocked .exchange-btn {
  background: #7cb342;
  border-color: #558b2f;
  color: #fff;
}

.exchange-card--unlocked .exchange-btn:hover {
  background: #689f38;
}

/* 兑换目录状态文字 */
.exchange-catalog-state {
  text-align: center;
  padding: 40px 20px;
  color: #8b7355;
  font-size: 14px;
}

  .exchange-btn--demo {
    flex: 0 0 80px;
    min-width: 80px;
    padding: 12px 4px;
    font-size: 12px;
    order: 2;
  }

  .exchange-btn--primary {
    order: 1;
  }

  .exchange-note {
    margin: 6px 0 10px;
    font-size: 12px;
    line-height: 1.4;
  }
}

/* ==================== 确认对话框 ==================== */
.confirm-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 50, 38, 0.6);
  backdrop-filter: blur(4px);
  z-index: 30000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-dialog {
  background: #faf8f3;
  border: 3px solid #8b7355;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(61, 50, 38, 0.5);
  animation: confirmSlideIn 0.3s ease-out;
}

@keyframes confirmSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 2px solid #d4c4b0;
}

.confirm-icon {
  font-size: 32px;
}

.confirm-title {
  font-size: 20px;
  font-weight: 900;
  color: #2d2419;
}

.confirm-message {
  padding: 24px;
  font-size: 16px;
  font-weight: 700;
  color: #4a3f2f;
  line-height: 1.6;
  text-align: center;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px 20px;
}

.confirm-btn {
  flex: 1;
  padding: 12px 24px;
  border: 2px solid;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s;
}

.confirm-btn--cancel {
  background: #fefdfb;
  border-color: #8b7355;
  color: #4a3f2f;
}

.confirm-btn--cancel:hover {
  background: #f5f1e8;
  border-color: #6b5744;
}

.confirm-btn--ok {
  background: #d4af78;
  border-color: #b89860;
  color: #2d2419;
}

.confirm-btn--ok:hover {
  background: #c9a165;
  box-shadow: 0 2px 6px rgba(61, 50, 38, 0.2);
}

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
  .user-panel-container {
    border-radius: 10px;
    max-height: 90vh;
  }

  .panel-title {
    font-size: 20px;
  }

  .tabs-container {
    padding: 10px 12px 0;
  }

  .tab-btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  .tab-icon {
    font-size: 16px;
  }

  .tabs-content {
    padding: 12px;
  }

  .stat-value {
    font-size: 24px;
  }

  .info-value {
    font-size: 14px;
  }

  .quick-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .quick-icon {
    font-size: 18px;
  }

  .balance-value {
    font-size: 40px;
  }

  .price-value {
    font-size: 32px;
  }
}

/* ==================== 横屏优化 ==================== */
@media (orientation: landscape) and (min-width: 1024px) {
  .user-panel-container {
    max-width: 720px;
  }

  .panel-header {
    padding: 18px 24px 16px;
  }

  .panel-title {
    font-size: 24px;
  }

  .tabs-container {
    padding: 14px 20px 0;
  }

  .tab-btn {
    padding: 12px 18px;
    font-size: 15px;
  }

  .tabs-content {
    padding: 20px;
  }

  .stats-grid {
    gap: 14px;
    margin-bottom: 18px;
  }

  .stat-card {
    padding: 14px;
    min-height: 110px;
  }

  .stat-value {
    font-size: 32px;
  }

  .user-info-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .user-info-grid {
    gap: 14px;
  }

  .info-value {
    font-size: 17px;
  }

  .family-info-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .family-info-row {
    padding: 10px 0;
    gap: 10px;
  }

  .family-info-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .family-info-icon--tablet,
  .family-info-icon--permissions {
    font-size: 16px;
  }

  .family-info-value {
    font-size: 16px;
  }

  .family-info-value--tablet {
    font-size: 15px;
  }

  .permission-tag {
    padding: 4px 10px;
    font-size: 12px;
  }

  .permission-icon {
    font-size: 14px;
  }

  .quick-actions {
    gap: 12px;
    margin-bottom: 24px;
  }
  
  .quick-btn {
    padding: 14px 20px;
    font-size: 16px;
  }
}

/* 活动任务（用户中心第三页签） */
.activity-tasks-hint {
  font-size: 12px;
  color: rgba(80, 60, 40, 0.85);
  line-height: 1.5;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: rgba(139, 90, 43, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(139, 90, 43, 0.15);
}

.activity-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-tasks-state {
  text-align: center;
  padding: 24px 12px;
  color: rgba(80, 60, 40, 0.65);
  font-size: 14px;
}

.activity-tasks-state--err {
  color: #a94442;
}

.activity-task-card {
  border: 1px solid rgba(139, 90, 43, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(165deg, rgba(255, 252, 248, 0.95), rgba(245, 236, 224, 0.5));
}

.activity-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.activity-task-name {
  font-weight: 600;
  font-size: 15px;
  color: #3d2914;
  flex: 1 1 auto;
}

.activity-task-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(101, 67, 33, 0.12);
  color: #5c3d1e;
}

.activity-task-status {
  font-size: 12px;
  color: #7a5c3a;
}

.activity-task-desc,
.activity-task-hint {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(60, 45, 30, 0.8);
  margin-bottom: 6px;
}

.activity-task-hint {
  color: #8a6d4b;
}

.activity-task-progress {
  font-size: 13px;
  color: #4a3724;
  margin-top: 4px;
}

.activity-task-reward-line {
  font-size: 12px;
  color: #5c4a38;
  margin-top: 6px;
  line-height: 1.4;
}

.activity-task-reward-family-note {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(100, 75, 45, 0.9);
}

.activity-task-claim {
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  background: linear-gradient(180deg, #c9a227, #a67c00);
  color: #fff;
  box-shadow: 0 2px 6px rgba(166, 124, 0, 0.35);
}

.activity-task-claim:active {
  transform: translateY(1px);
}

.activity-tasks-fire-stats {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(139, 90, 43, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.95), rgba(247, 238, 225, 0.85));
  box-shadow: 0 6px 16px rgba(86, 56, 31, 0.08);
}

.activity-tasks-fire-stats__row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.activity-tasks-fire-stats__prefix {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #5b3c1e;
  letter-spacing: 0.2px;
}

.activity-tasks-fire-stats__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(166, 124, 0, 0.25);
  background: rgba(255, 255, 255, 0.7);
}

.activity-tasks-fire-stats__label {
  font-size: 12px;
  color: rgba(77, 55, 34, 0.9);
  white-space: nowrap;
}

.activity-tasks-fire-stats__value {
  font-size: 15px;
  font-weight: 800;
  color: #b4492a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
