/* 🔴 第一步：全局清除默认样式，解决浏览器自带边距问题 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 清除ul/li的默认列表符号 */
    list-style: none;
    /* 清除a标签的默认下划线 */
    text-decoration: none;
}

/* 版心容器：控制整体宽度，居中显示 */
.wrapper {
    width: 1200px;
    margin: 0 auto;
}

body {
    background-color: #ffffff;
}

/* 头部容器 */
.header {
    height: 100px;
    background-color: antiquewhite;
}

/* 🔴 核心：给wrapper加flex，让logo/导航/搜索/用户全部横排！ */
.header .wrapper {
    height: 100%; /* 继承父元素高度，实现垂直居中 */
    display: flex;
    /* 主轴：水平方向，子元素从左到右排列（默认row，显式写更清晰） */
    flex-direction: row;
    /* 交叉轴：垂直方向，让所有子元素居中对齐 */
    align-items: center;
    /* 子元素之间的间距，避免挤在一起 */
    gap: 40px;
}

/* logo样式 */
.header .logo {
    /* 不需要固定宽高，让内容自适应 */
}
.header .logo a {
    font-size: 28px;
    color: #1976d2;
    font-weight: bold;
}

/* 🔴 导航栏：给ul加flex，让li横排！ */
.header .daohang ul {
    display: flex;
    flex-direction: row;
    /* 导航项之间的间距 */
    gap: 30px;
}
.header .daohang a {
    font-size: 18px;
    color: #1976d2;
}
.header .daohang a.active {
    color: #000;
    font-weight: bold;
}

/* 搜索框样式 */
.header .search {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header .search input {
    height: 32px;
    padding: 0 10px;
    font-size: 14px;
}
.header .search a {
    font-size: 16px;
    color: #1976d2;
}

/* 用户样式 */
.header .yonghu {
    font-size: 18px;
    color: #000;
    margin-left: auto; /* 让用户模块自动靠右，完美对齐 */
}

/* ========================
   横幅 banner 样式
======================== */
.banner {
    height: 400px;
    background-color: #e3f2fd;
    overflow: hidden;
}

.banner .wrapper {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 50px;
}

/* 左侧文字 */
.banner-text {
    color: #1976d2;
}

.banner-text h2 {
    font-size: 48px;
    margin-bottom: 15px;
    font-weight: bold;
}

.banner-text p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* 右侧装饰图 - 已删除，因为使用轮播图替代 */

/* 美食分类区样式 - 自动跃动效果 */
.category {
  padding: 0 0 20px;
  background: #ffffff;
  overflow: hidden;
  position: relative;
}

.photo-wall {
  width: min(1200px, 92vw);
  height: clamp(280px, 32vw, 480px);
  position: relative;
  margin: 0 auto 0;
}

.photo-card {
  position: absolute;
  top: 50%;
  width: clamp(180px, 16vw, 300px);
  aspect-ratio: 3 / 4;
  transform-origin: 50% 58%;
  border: 1.5px solid #1976d2;
  box-shadow: 0 10px 20px -8px rgba(25, 118, 210, 0.25);
  background: #d8d8d8;
  overflow: hidden;
  border-radius: 4px;
  animation: hop 2.8s ease-in-out infinite;
  cursor: pointer;
  transition: filter 0.3s ease;
}

.photo-card:hover {
  filter: brightness(1.05) saturate(1.1);
  z-index: 10 !important;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.95) contrast(1.03);
}

.photo-card:nth-child(1) {
  left: 2%;
  z-index: 1;
  --r: -5deg;
  --x: -6px;
  --d: 0s;
}

.photo-card:nth-child(2) {
  left: 16%;
  z-index: 2;
  --r: 2.5deg;
  --x: 0px;
  --d: 0.2s;
}

.photo-card:nth-child(3) {
  left: 30%;
  z-index: 3;
  --r: -3.5deg;
  --x: 4px;
  --d: 0.4s;
}

.photo-card:nth-child(4) {
  left: 44%;
  z-index: 4;
  --r: 3deg;
  --x: 0px;
  --d: 0.6s;
}

.photo-card:nth-child(5) {
  left: 58%;
  z-index: 5;
  --r: -3deg;
  --x: -4px;
  --d: 0.8s;
}

.photo-card:nth-child(6) {
  left: 72%;
  z-index: 6;
  --r: 2deg;
  --x: -6px;
  --d: 1s;
}

.photo-card {
  animation-delay: var(--d);
}

@keyframes hop {
  0%, 100% {
    transform: translate(var(--x), calc(-50% + 0px)) rotate(var(--r)) scale(1);
  }
  35% {
    transform: translate(calc(var(--x) + 1px), calc(-50% - 18px)) rotate(calc(var(--r) + 0.6deg)) scale(1.012);
  }
  65% {
    transform: translate(calc(var(--x) - 1px), calc(-50% + 4px)) rotate(calc(var(--r) - 0.45deg)) scale(0.996);
  }
}

/* 底部文字标签 */
.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 响应式设计 */
@media (max-width: 1160px) {
  .photo-wall {
    height: 780px;
    width: min(650px, 90vw);
  }

  .photo-card {
    width: min(50vw, 340px);
    left: 50% !important;
    top: auto;
  }

  .photo-card:nth-child(1) { top: 5%; --r: -6deg; }
  .photo-card:nth-child(2) { top: 20%; --r: 2deg; }
  .photo-card:nth-child(3) { top: 35%; --r: -4deg; }
  .photo-card:nth-child(4) { top: 50%; --r: 2deg; }
  .photo-card:nth-child(5) { top: 65%; --r: -3deg; }
  .photo-card:nth-child(6) { top: 80%; --r: 1deg; }

  @keyframes hop {
    0%, 100% {
      transform: translate(-50%, 0) rotate(var(--r)) scale(1);
    }
    35% {
      transform: translate(-50%, -14px) rotate(calc(var(--r) + 0.6deg)) scale(1.01);
    }
    65% {
      transform: translate(-50%, 3px) rotate(calc(var(--r) - 0.4deg)) scale(0.997);
    }
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .photo-card {
    animation: none;
    transform: translate(var(--x), -50%) rotate(var(--r));
  }
}

.section-title {
  font-size: 32px;
  color: #1976d2;
  text-align: center;
  margin-bottom: 8px;
  margin-top: 25px;
  font-weight: bold;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #1976d2, #42a5f5);
  margin: 8px auto 0;
  border-radius: 2px;
}
