:root {
  --main-color: #8b0000;   /* 古典红 */
  --main-color2: #a52a2a;  /* 深红色 */
  --accent: #EFB3B3;       /* 桃花粉 */
  --bg: #fff8dc;           /* 浅暖米色 */
  --pink: #EFB3B3;         /* 桃花粉 */
  --wood: #9C7B58;         /* 檀木色 */
  --font-main: 'Noto Serif SC', serif;
  --gradient-bg: linear-gradient(135deg, #fff8dc 0%, #f5f0e6 50%, #fff8dc 100%);
  --card-shadow: 0 8px 32px rgba(156,123,88,0.1);
  --card-shadow-hover: 0 16px 48px rgba(239,179,179,0.25);
  --border-radius: 20px;
}

body {
  background: var(--gradient-bg);
  font-family: var(--font-main);
  color: var(--wood);
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.8;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(239,179,179,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(156,123,88,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3 {
  font-family: var(--font-main);
  font-weight: 700;
  color: var(--main-color);
  margin-bottom: 20px;
  position: relative;
}

h1 { 
  font-size: 42px; 
  line-height: 1.2; 
  text-shadow: 2px 2px 4px rgba(139,0,0,0.1);
  letter-spacing: 1px;
}

h2 { 
  font-size: 32px; 
  line-height: 1.3; 
  margin-bottom: 30px;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--main-color), var(--accent));
  border-radius: 2px;
}

h3 { 
  font-size: 24px; 
  line-height: 1.4; 
  color: var(--main-color2);
  margin-bottom: 16px;
}

.fixed-back-button {
    /* 使用 fixed 定位，相对于浏览器窗口 */
    position: fixed; 
    top: 30px; /* 距离窗口顶部30px */
    left: 30px; /* 距离窗口左侧30px */
    z-index: 9999; /* 设置一个非常高的层级，确保在最上层 */

    display: flex; 
    align-items: center; 
    text-decoration: none; 
    padding: 10px; 
    border-radius: 50%; 
    backdrop-filter: blur(10px); 
    background: rgba(255, 255, 255, 0.3); /* 稍微调整背景使其在深色背景上更明显 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all .3s ease;
}
.fixed-back-button:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.5); 
}
.fixed-back-button .back-icon {
    width: 40px; 
    height: 40px; 
}

/* 美化的英雄区域 */
.hero {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}


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

/* 美化的内容区域 */
.section {
  max-width: 1000px;
  margin: 100px auto 0 auto;
  padding: 0 40px;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 美化的卡片样式 */
.card {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 50px;
  padding: 40px 32px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--main-color), var(--accent), var(--main-color));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-8px);
}

.card p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: #5a4a3a;
}

/* 美化的悬停文本 */
.hover-text {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
  padding-top: 0;
  background: rgba(239,179,179,0.05);
  border-radius: 12px;
  padding: 0 20px;
}

.card:hover .hover-text,
.card.expanded .hover-text {
  opacity: 1;
  max-height: 800px;
  margin-top: 24px;
  padding: 20px;
  border-top: 2px solid var(--accent);
  background: rgba(239,179,179,0.08);
}

/* 展开状态的视觉指示 */
.card.expanded::after {
  content: '▼';
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--accent);
  font-size: 16px;
  transition: transform 0.3s ease;
}

.card:not(.expanded)::after {
  content: '▶';
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--accent);
  font-size: 16px;
  opacity: 0.6;
  transition: transform 0.3s ease;
}

.hover-text p {
  margin-bottom: 12px;
  font-style: italic;
  color: #6b5b4a;
  position: relative;
  padding-left: 20px;
}

.hover-text p::before {
  content: '❀';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 14px;
}

/* hover-text中的text标签样式 */
.hover-text text {
  display: block;
  font-weight: bold;
  color: var(--main-color);
  font-size: 16px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-left: 4px solid var(--accent);
  position: relative;
}



/* 美化的图片行 */
.image-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.image-with-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.image-with-caption:hover {
  transform: scale(1.02);
}

.image-with-caption img {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(156,123,88,0.15);
  transition: all 0.3s ease;
}

.image-with-caption:hover img {
  box-shadow: 0 12px 32px rgba(239,179,179,0.3);
}

.caption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--wood);
  font-style: italic;
  text-align: center;
  opacity: 0.8;
}



/* 花神人物画廊样式调整 */
.gallery-carousel {
  margin: 80px auto 60px auto;
  max-width: 1000px;
  text-align: center;
  padding: 0 40px;
}

.gallery-carousel h2 {
  margin-bottom: 40px;
}

.carousel-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 20px 16px;
  justify-items: center;
  align-items: center;
  overflow: visible;
  position: relative;
  height: auto;
  padding: 20px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
}

.carousel-item {
  position: relative;
  width: 110px;
  transition: all 0.4s cubic-bezier(.4,2,.6,1);
  z-index: 1;
}

.carousel-item .item-img {
  position: relative;
  width: 110px;
  height: 140px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(156,123,88,0.2);
  transition: all 0.4s ease;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.item-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(139,0,0,0.3);
  transition: all 0.4s ease;
  border-radius: 12px;
}

.carousel-item .item-name {
  margin-top: 8px;
  font-size: 12px;
  font-family: 'Noto Serif SC', serif;
  color: var(--main-color);
  opacity: 0;
  transition: all 0.4s ease;
  font-weight: 500;
}

.carousel-item.active, .carousel-item:hover {
  transform: scale(1.15);
  z-index: 2;
}

.carousel-item.active .item-overlay,
.carousel-item:hover .item-overlay {
  background: rgba(239,179,179,0.2);
}

.carousel-item.active .item-name,
.carousel-item:hover .item-name {
  opacity: 1;
  transform: translateY(-2px);
}

.carousel-item:hover img {
  transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-container { padding: 12px 18px; }
  .nav-list { display: none; }
  .nav-toggle { display: block; }
  .hero { height: 300px; }
  .hero-overlay h1 { font-size: 32px; }
  .hero-overlay p { font-size: 18px; }
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  body { font-size: 14px; }
  .section { padding: 0 20px; margin-top: 80px; }
  .card { padding: 24px 20px; margin-bottom: 30px; }
  .image-row { gap: 20px; }
  .carousel-container {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 15px;
  }
  .carousel-item { width: 90px; }
  .carousel-item .item-img { width: 90px; height: 120px; }
}

@media (max-width: 480px) {
  .carousel-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(6, 1fr);
  }
  .image-row { flex-direction: column; align-items: center; }
  .image-with-caption img { width: 280px !important; }
}

/* 额外的美化效果 */
/* 滚动动画 */
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: slideInFromBottom 0.8s ease-out;
}

/* 卡片进入动画 */
.card {
  animation: slideInFromBottom 0.8s ease-out;
  animation-fill-mode: both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }

/* 图片悬停效果增强 */
.image-with-caption img {
  filter: brightness(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-with-caption:hover img {
  filter: brightness(1.05);
  transform: scale(1.03);
}

/* 文字选择样式 */
::selection {
  background: rgba(239,179,179,0.3);
  color: var(--main-color);
}


/* 加载动画 */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* 焦点状态美化 */
.card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 链接样式 */
a {
  color: var(--main-color);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

a:hover {
  color: var(--main-color2);
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* 特殊文本样式 */
.quote {
  font-style: italic;
  color: var(--wood);
  border-left: 4px solid var(--accent);
  padding-left: 20px;
  margin: 20px 0;
  background: rgba(239,179,179,0.05);
  padding: 15px 20px;
  border-radius: 0 8px 8px 0;
}

/* 装饰性元素 */
.decorative-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 30px 0;
  border-radius: 1px;
}

/* 卡片内容增强 */
.card h3::before {
  content: '🌸';
  margin-right: 8px;
  font-size: 18px;
  opacity: 0.7;
}

/* 响应式图片优化 */
main img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 打印样式 */
@media print {
  .navbar, .hero, .carousel-container {
    display: none;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  body {
    background: white;
    color: black;
  }
}