/* ============================================ */
/*  徐州文旅推介网站 — 全局样式                     */
/*  国风浅黄 + 青蓝色调，响应式布局                  */
/* ============================================ */

/* ----- 1. CSS Reset & 基础变量 ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 国风配色体系 */
  --color-cream:    #faf6ed;    /* 浅米黄 — 背景主色          */
  --color-parch:    #f5edd6;    /* 古纸色 — 区块背景          */
  --color-teal:     #2d6a8c;    /* 青蓝 — 主色调/标题         */
  --color-teal-soft:#5a9bb5;    /* 浅青蓝 — 鼠标悬停/装饰     */
  --color-teal-dim: #3d7a9a;    /* 中青蓝 — 导航栏背景        */
  --color-gold:     #b8860b;    /* 金色 — 点缀/按钮           */
  --color-gold-soft:#d4a843;    /* 浅金 — 按钮悬停            */
  --color-dark:     #3a3a3a;    /* 深灰 — 正文文字            */
  --color-light:    #f0ebe0;    /* 浅米色 — 页脚背景          */
  --color-white:    #ffffff;
  --shadow-card:    0 4px 20px rgba(45, 106, 140, 0.10);
  --radius:         12px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background-color: var(--color-cream);
  color: var(--color-dark);
  line-height: 1.7;
  padding-top: 68px;          /* 给固定导航栏预留空间 */
}

/* ----- 2. 顶部导航栏 ----- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--color-teal-dim);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 滚动后导航栏变深色（配合 JS） */
#navbar.scrolled {
  background-color: #1f4d66;   /* 更深青蓝 */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 68px;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-white);
  text-decoration: none;
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.90);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  display: block;
  height: 2px;
  width: 0;
  background: var(--color-gold);
  transition: width 0.3s;
  position: absolute;
  bottom: -4px;
  left: 0;
}

.nav-links a:hover {
  color: var(--color-gold);
}

.nav-links a:hover::after {
  width: 100%;
}

/* 汉堡菜单按钮（移动端） */
.hamburger {
  display: none;
  font-size: 1.6rem;
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ----- 3. Hero 首页欢迎区 ----- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #1f4d66 0%, #3d7a9a 50%, #5a9bb5 100%);
  overflow: hidden;
}

/* 装饰性背景纹理 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.hero-overlay {
  display: none;   /* 纯色渐变足以，无需额外覆盖层 */
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 24px;
  max-width: 800px;
}

.hero-content h1 {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 6px;
  margin-bottom: 20px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hero-content p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 36px;
  line-height: 1.8;
}

.hero-btn {
  display: inline-block;
  padding: 14px 44px;
  background-color: var(--color-gold);
  color: var(--color-white);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 40px;
  transition: background-color 0.3s, transform 0.3s;
  letter-spacing: 2px;
}

.hero-btn:hover {
  background-color: var(--color-gold-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.35);
}

/* ----- 4. 通用版块样式 ----- */
.section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-alt {
  background-color: var(--color-parch);
  max-width: 100%;
  padding-left: calc((100% - 1200px) / 2 + 24px);
  padding-right: calc((100% - 1200px) / 2 + 24px);
}

.section-title {
  text-align: center;
  margin-bottom: 52px;
}

.section-title h2 {
  font-size: 2rem;
  color: var(--color-teal);
  margin-bottom: 10px;
  letter-spacing: 3px;
}

.section-title p {
  color: #777;
  font-size: 1rem;
}

/* ----- 5. 卡片网格（景点/美食/文化共用） ----- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 36px rgba(45, 106, 140, 0.15);
}

/* 图片容器 — 控制图片 hover 放大效果（配合 JS 备用，同时保留 CSS 实现） */
.card-img {
  width: 100%;
  height: 220px;
  overflow: hidden;
  /* 图片加载失败时的兜底渐变背景 */
  background: linear-gradient(135deg, #2d6a8c 0%, #5a9bb5 50%, #3d7a9a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* 图片加载失败的兜底提示文本 */
.card-img img[src]:not([src^="data"]):not([src*="."]) {
  display: none;
}

/* 图片 hover 放大（CSS 实现，JS 作为备选/增强） */
.card:hover .card-img img {
  transform: scale(1.10);
}

.card-body {
  padding: 20px 22px 26px;
}

.card-body h3 {
  font-size: 1.2rem;
  color: var(--color-teal);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.card-body p {
  font-size: 0.93rem;
  color: #666;
  line-height: 1.7;
}

/* ----- 6. 底部页脚 ----- */
.footer {
  background-color: var(--color-light);
  padding: 36px 24px;
  text-align: center;
  border-top: 3px solid var(--color-teal);
}

.footer-content p {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

/* ----- 7. 返回顶部按钮 ----- */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 30px;
  width: 48px;
  height: 48px;
  background-color: var(--color-teal);
  color: var(--color-white);
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(45, 106, 140, 0.30);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s, transform 0.3s;
  z-index: 999;
}

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

.back-to-top:hover {
  background-color: var(--color-teal-soft);
  transform: translateY(-3px);
}

/* ----- 8. 响应式 — 平板（≤ 900px） ----- */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content h1 {
    font-size: 2.4rem;
  }
}

/* ----- 9. 响应式 — 手机（≤ 640px） ----- */
@media (max-width: 640px) {
  body {
    padding-top: 60px;
  }

  .nav-container {
    height: 60px;
    padding: 0 16px;
  }

  /* 显示汉堡菜单 */
  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: var(--color-teal-dim);
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
  }

  .card-grid {
    grid-template-columns: 1fr;   /* 手机端单列 */
  }

  .section {
    padding: 50px 16px;
  }

  .section-alt {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: 70vh;
  }

  .hero-content h1 {
    font-size: 1.8rem;
    letter-spacing: 3px;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-btn {
    padding: 12px 32px;
    font-size: 0.95rem;
  }

  .section-title h2 {
    font-size: 1.5rem;
  }

  .card-img {
    height: 180px;
  }

  .back-to-top {
    bottom: 24px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
}
