/* =========================================================
   张家口城市宣传页 · 样式表
   风格：新中式 × 莫兰迪简约
   —— 低饱和大地色 / 细线条 / 留白 / 克制动画
   ========================================================= */

/* ---------------------------------------------------------
   1. 设计变量（改配色只需动这里）
   --------------------------------------------------------- */
:root {
  /* 纸与底色 */
  --paper:      #F7F4EE;   /* 宣纸主底 */
  --paper-2:    #F1ECE3;   /* 次级底（板块交替） */
  --paper-3:    #E9E2D6;   /* 图片占位底 */
  --white:      #FFFDF9;

  /* 墨色文字 */
  --ink:        #2E332D;   /* 主文字 */
  --ink-2:      #5F655B;   /* 次要文字 */
  --ink-3:      #8B8F84;   /* 辅助/英文小字 */

  /* 线与点缀 */
  --line:       #DCD5C8;
  --line-soft:  #E8E2D6;
  --green:      #46594A;   /* 墨绿 */
  --green-deep: #2F3E33;   /* 深墨绿（页脚/图题） */
  --brick:      #A76A59;   /* 砖红（低饱和） */
  --gold:       #B29A6B;   /* 暗金（极少点缀） */

  /* 阴影 */
  --shadow:      0 14px 40px rgba(46, 51, 45, .07);
  --shadow-hover:0 22px 50px rgba(46, 51, 45, .14);

  /* 尺寸与节奏 */
  --max:  1200px;
  --nav-h: 84px;

  /* 动画曲线（统一缓动，克制） */
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* 字体：全站无衬线 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

/* ---------------------------------------------------------
   2. 基础重置
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--green); color: var(--white); }

/* 通用容器 */
.container {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

/* ---------------------------------------------------------
   3. 顶部导航
   --------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .45s var(--ease), border-color .45s var(--ease),
              backdrop-filter .45s var(--ease);
}

/* 滚动后：纸底 + 模糊 + 细线 */
.site-header.is-scrolled {
  background: rgba(247, 244, 238, .92);
  -webkit-backdrop-filter: saturate(1.1) blur(14px);
  backdrop-filter: saturate(1.1) blur(14px);
  border-bottom-color: var(--line-soft);
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* 品牌 */
.brand { display: flex; align-items: center; gap: 12px; }

.seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brick);
  color: var(--white);
  font-size: 20px;
  line-height: 1;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1.2;
}
.brand-en {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .24em;
  color: var(--ink-3);
  margin-top: 4px;
}

/* 菜单 */
.nav-menu { display: flex; align-items: center; gap: 40px; }

.nav-menu a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--ink-2);
  transition: color .3s var(--ease);
}
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width .35s var(--ease);
}
.nav-menu a:hover { color: var(--ink); }
.nav-menu a:hover::after,
.nav-menu a.is-active::after { width: 100%; }
.nav-menu a.is-active { color: var(--ink); }

/* Hero 状态：导航文字反白 */
.site-header.is-hero .brand-text { color: var(--white); }
.site-header.is-hero .brand-en   { color: rgba(255, 255, 255, .72); }
.site-header.is-hero .nav-menu a { color: rgba(255, 255, 255, .82); }
.site-header.is-hero .nav-menu a:hover,
.site-header.is-hero .nav-menu a.is-active { color: var(--white); }

/* 汉堡按钮（移动端才显示） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  color: var(--ink);
  transition: transform .35s var(--ease), opacity .3s var(--ease);
}
.site-header.is-hero .nav-toggle span {
  background: var(--white);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18); /* 浅色风光图上也能分辨 */
}

/* 汉堡展开成叉 */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------------------------------------------------------
   4. 首屏 Hero
   --------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;      /* 垂直居中 */
  justify-items: stretch;   /* 水平撑满，保证窄屏文字正常换行不溢出 */
  overflow: hidden;
  background: var(--green-deep);
  isolation: isolate;
}

.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.96) contrast(1.02);
  /* 极缓慢的定格推进，幅度很小，不做廉价特效 */
  animation: heroDrift 22s ease-out both;
}
@keyframes heroDrift {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}

/* 墨绿遮罩，保证文字对比度 */
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(27, 36, 30, .58) 0%,
      rgba(27, 36, 30, .34) 42%,
      rgba(23, 31, 26, .74) 100%);
}

/* 右侧竖排装饰 */
.hero__vertical {
  position: absolute;
  right: clamp(20px, 4vw, 60px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: .55em;
  color: rgba(255, 255, 255, .55);
  user-select: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;            /* 撑满，保证窄屏文字正常换行不溢出 */
  min-width: 0;
  padding: 120px 24px 80px;
  text-align: center;
  color: var(--white);
}

.hero__eyebrow {
  font-size: 13px;
  letter-spacing: .42em;
  color: rgba(255, 255, 255, .84);
  margin-bottom: 28px;
  text-indent: .42em;
}

.hero__title {
  font-size: clamp(62px, 13vw, 150px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: .16em;
  text-indent: .16em;      /* 抵消末字字距，视觉居中 */
  text-shadow: 0 4px 34px rgba(0, 0, 0, .28);
}

/* 标题下的细线与菱形点缀 */
.hero__divider {
  position: relative;
  width: 58px;
  height: 1px;
  margin: 34px auto 26px;
  background: var(--gold);
}
.hero__divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

.hero__slogan {
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 300;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .9);
  text-wrap: balance;      /* 窄屏折行更均衡（支持则生效，不支持自动忽略） */
}

/* 向下滚动提示 */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, .82);
}
.hero__scroll-text {
  font-size: 11px;
  letter-spacing: .3em;
  text-indent: .3em;
}
.hero__scroll-line {
  width: 1px;
  height: 46px;
  background: linear-gradient(rgba(255, 255, 255, .85), transparent);
  transform-origin: top;
  animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: .3; transform: scaleY(.55); }
  50%      { opacity: 1;  transform: scaleY(1); }
}

/* ---------------------------------------------------------
   5. 通用板块与标题
   --------------------------------------------------------- */
.section { padding: clamp(80px, 10vw, 138px) 0; }
.section--tint { background: var(--paper-2); }

.sec-head {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 26px;
  margin-bottom: clamp(44px, 6vw, 68px);
}

.sec-head__side {
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 6px;
}
.sec-no {
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--brick);
}
.sec-rule {
  width: 1px;
  height: 62px;
  background: var(--line);
}

.sec-en {
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.sec-title {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: .14em;
}
.sec-title::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 20px;
  background: var(--brick);
}

.sec-desc {
  grid-column: 2;
  max-width: 640px;
  margin-top: 26px;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-2);
}

/* ---------------------------------------------------------
   6. 城市印象
   --------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.about-card {
  position: relative;
  padding: 42px 30px 40px;
  background: var(--paper);
  transition: background .4s var(--ease), transform .4s var(--ease);
}
.about-card:hover { background: var(--white); }

.about-card__en {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 9px;
  letter-spacing: .18em;
  color: var(--ink-3);
}

.about-card__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 20px;
  color: var(--green);
  transition: color .4s var(--ease), border-color .4s var(--ease);
}
.about-card:hover .about-card__icon {
  color: var(--brick);
  border-color: var(--brick);
}

.about-card h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .12em;
  margin-bottom: 14px;
}

.about-card p {
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
}

/* ---------------------------------------------------------
   7. 坝上风味（美食卡片）
   --------------------------------------------------------- */
.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.food-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease),
              border-color .45s var(--ease);
}
.food-card:hover {
  transform: translateY(-6px);
  border-color: var(--line);
  box-shadow: var(--shadow-hover);
}

.food-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-3);
}
.food-card__media img {
  object-position: center 42%;   /* 1:1 图放入 4:3 容器时略偏上，底部裁切更充分 */
  filter: saturate(.95) contrast(1.03);
  transition: transform .9s var(--ease);
}
.food-card:hover .food-card__media img { transform: scale(1.05); }

.food-card__no {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(247, 244, 238, .92);
  color: var(--green);
  font-size: 11px;
  letter-spacing: .05em;
  border-radius: 1px;
}

.food-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 28px 30px;
}

.food-card__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .1em;
  margin-bottom: 14px;
}
.food-card__title span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--ink-3);
}

.food-card__body p {
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
  margin-bottom: 22px;
}

/* 底部细线：hover 时展开（display:block 才能让 width/height 生效） */
.food-card__rule {
  display: block;
  width: 0;
  height: 1px;
  margin-top: auto;
  background: var(--brick);
  transition: width .5s var(--ease);
}
.food-card:hover .food-card__rule { width: 100%; }

/* ---------------------------------------------------------
   8. 大好河山（风光）
   --------------------------------------------------------- */
.scenery-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: repeat(2, 300px);
  gap: 24px;
}

.view-card {
  position: relative;
  overflow: hidden;
  background: var(--green-deep);
}
.view-card--large { grid-row: span 2; }

.view-card img {
  filter: saturate(.95) contrast(1.03);
  transition: transform 1s var(--ease);
}
.view-card:hover img { transform: scale(1.04); }

/* 底部渐暗，保证标题可读（亮雪/草甸背景也能压住） */
.view-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(24, 32, 26, 0) 28%,
    rgba(24, 32, 26, .52) 62%,
    rgba(24, 32, 26, .9) 100%);
  pointer-events: none;
}

.view-card__caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 32px;
  color: var(--white);
  transform: translateY(8px);
  transition: transform .45s var(--ease);
}
.view-card:hover .view-card__caption { transform: translateY(0); }

.view-card__tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--gold);
  margin-bottom: 10px;
}
.view-card h3 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: .12em;
  margin-bottom: 10px;
}
.view-card p {
  max-width: 460px;
  font-size: 13px;
  line-height: 1.85;
  color: rgba(255, 255, 255, .82);
}

/* 大卡标题略大 */
.view-card--large h3 { font-size: clamp(28px, 3vw, 36px); }

/* ---------------------------------------------------------
   9. 页脚
   --------------------------------------------------------- */
.footer {
  background: var(--green-deep);
  color: rgba(255, 255, 255, .76);
  padding: 68px 0 34px;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand meta"
    "note  meta";
  align-items: center;
  gap: 24px 30px;
}

.footer__brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 14px;
}
.seal--light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  color: rgba(255, 255, 255, .9);
}
.footer__brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.footer__brand-text strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--white);
}
.footer__brand-text span {
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(255, 255, 255, .5);
  margin-top: 4px;
}

.footer__note {
  grid-area: note;
  font-size: 13px;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .6);
}

.footer__meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-size: 12px;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .55);
  text-align: right;
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .78);
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.back-top:hover { color: var(--white); border-color: rgba(255, 255, 255, .6); }

/* ---------------------------------------------------------
   10. 滚动渐入（初态；is-visible 由 JS 添加）
   --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------
   11. 响应式
   --------------------------------------------------------- */

/* 中屏：四列 → 两列，三列 → 两列 */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .food-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* 小屏 / 移动端：统一单列 */
@media (max-width: 720px) {
  :root { --nav-h: 70px; }

  .container { width: min(100% - 36px, var(--max)); }

  /* 移动端菜单：下拉面板 */
  .nav-toggle { display: flex; }

  .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 18px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .nav-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  /* 展开时强制深色文字，避免继承 Hero 反白 */
  .site-header .nav-menu.is-open a {
    color: var(--ink-2);
    padding: 15px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .site-header .nav-menu.is-open a:last-child { border-bottom: 0; }
  .site-header .nav-menu.is-open a.is-active { color: var(--brick); }

  /* 板块与栅格：单列 */
  .section { padding: 72px 0; }

  .sec-head { column-gap: 16px; margin-bottom: 42px; }
  .sec-head__side { padding-top: 2px; }
  .sec-rule { height: 48px; }
  .sec-desc { margin-top: 20px; font-size: 14.5px; }

  .about-grid { grid-template-columns: 1fr; }
  .about-card { padding: 32px 26px; }

  .food-grid { grid-template-columns: 1fr; gap: 20px; }
  .food-card__body { padding: 24px 24px 26px; }

  .scenery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 18px;
  }
  .view-card { min-height: 260px; }
  .view-card--large { grid-row: auto; min-height: 340px; }
  .view-card__caption { padding: 26px 24px; }

  .hero__vertical { display: none; }
  .hero__content { padding: 92px 22px 70px; }
  .hero__eyebrow { font-size: 12px; letter-spacing: .3em; text-indent: .3em; }
  .hero__title {
    font-size: clamp(44px, 13vw, 88px);
    letter-spacing: .12em;
    text-indent: .12em;
  }
  .hero__slogan {
    max-width: 22em;            /* 窄屏自动折行，避免溢出 */
    margin-inline: auto;
    font-size: 14px;
    line-height: 1.9;
    letter-spacing: .1em;
  }

  .footer { padding: 54px 0 30px; }
  .footer__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "note"
      "meta";
    gap: 20px;
  }
  .footer__meta { align-items: flex-start; text-align: left; }
}

/* 超小屏微调 */
@media (max-width: 380px) {
  .hero__title { letter-spacing: .1em; text-indent: .1em; }
  .nav-menu { padding-inline: 16px; }
}

/* ---------------------------------------------------------
   12. 无障碍：尊重"减少动态效果"偏好
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__media img,
  .hero__scroll-line { animation: none; }
  .food-card:hover,
  .view-card:hover img,
  .food-card:hover .food-card__media img { transform: none; }
}
