/* 自定义配置 - 防止样式冲突 */
@layer utilities {
  .frosted-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  
  .text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }
}

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #fafaf8;
  color: #2d2d2d;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 页面淡入动画 */
.page-enter {
  animation: fadeIn 0.6s ease-out;
}

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

/* 导航栏样式 */
.nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.3s ease;
}

.nav-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 轮播图容器 */
.carousel-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 轮播指示器 */
.carousel-indicators {
  position: absolute;
  bottom: 40px;
  right: 40px;
  z-index: 10;
  display: flex;
  gap: 12px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: rgba(255, 255, 255, 1);
  width: 24px;
  border-radius: 4px;
}

/* 图片悬停效果 */
.hover-zoom {
  overflow: hidden;
  transition: all 0.3s ease;
}

.hover-zoom img {
  transition: transform 0.6s ease, filter 0.3s ease;
}

.hover-zoom:hover img {
  transform: scale(1.05);
}

/* 图片遮罩层 */
.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.hover-zoom:hover .image-overlay {
  opacity: 1;
}

/* 不对称网格布局 */
.asymmetric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 300px);
  gap: 20px;
}

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

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

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

.grid-item-4 {
  grid-column: 2 / 5;
  grid-row: 2;
}

/* 瀑布流网格 */
.masonry-grid {
  column-count: 3;
  column-gap: 24px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 24px;
}

/* 筛选按钮 */
.filter-btn {
  position: relative;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.3s ease;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #2d2d2d;
  transition: width 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  color: #2d2d2d;
}

.filter-btn.active::after {
  width: 100%;
}

/* 色彩块 */
.color-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 卡片悬停效果 */
.card-hover {
  transition: all 0.4s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 40;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

/* 文章阅读区域 */
.article-content {
  line-height: 1.8;
  letter-spacing: 0.5px;
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 300;
  letter-spacing: 1px;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: #4b5563;
}

/* 引用样式 */
.quote-highlight {
  position: relative;
  padding-left: 24px;
  font-size: 1.25rem;
  font-weight: 300;
  font-style: italic;
  color: #6b7280;
  letter-spacing: 1px;
}

.quote-highlight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #d4af37, #c9a961);
}

/* 响应式布局 */
@media (max-width: 1024px) {
  .asymmetric-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 250px);
  }
  
  .grid-item-1,
  .grid-item-2,
  .grid-item-3,
  .grid-item-4 {
    grid-column: span 2;
    grid-row: auto;
  }
  
  .masonry-grid {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .asymmetric-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 300px);
  }
  
  .grid-item-1,
  .grid-item-2,
  .grid-item-3,
  .grid-item-4 {
    grid-column: 1;
  }
  
  .masonry-grid {
    column-count: 1;
  }
  
  .carousel-indicators {
    bottom: 20px;
    right: 20px;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
  }
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid #f3f4f6;
  border-top-color: #2d2d2d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 平滑滚动容器 */
.scroll-smooth {
  scroll-behavior: smooth;
}

/* 隐藏滚动条但保留功能 */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}