/* =========================================================
   张家口宣传页 · 第 1 层扩展样式（ext.css）
   原则：只新增，不覆盖原 style.css 的结构；所有类名 ext- 前缀，
        所有新增变量 --ext- 前缀。默认 summer 态与改造前一致。
   ========================================================= */

/* ---------------------------------------------------------
   0. 新增变量（不动 :root 原变量）
   --------------------------------------------------------- */
:root {
  --ext-accent: var(--brick);
  --ext-accent-weak: rgba(167, 106, 89, .12);
  --ext-radius: 2px;
  --ext-ease: var(--ease);
}

/* 四季点缀色（低饱和） */
body[data-season="spring"] { --ext-accent: #7C9070; --ext-accent-weak: rgba(124, 144, 112, .14); }
body[data-season="summer"] { --ext-accent: #A76A59; --ext-accent-weak: rgba(167, 106, 89, .12); }
body[data-season="autumn"] { --ext-accent: #B0805A; --ext-accent-weak: rgba(176, 128, 90, .14); }
body[data-season="winter"] { --ext-accent: #8496A2; --ext-accent-weak: rgba(132, 150, 162, .16); }

/* 让既有元素取用四季色（默认值 = 砖红，切换不影响布局） */
.sec-no { color: var(--ext-accent); }
.sec-title::after { background: var(--ext-accent); }
.food-card__rule { background: var(--ext-accent); }

/* 首屏图淡入（由 ext.js 加 class，避免内联样式） */
.hero__media img.ext-hero-fading {
  transition: opacity .45s var(--ext-ease), filter .45s var(--ext-ease);
}
/* 某季节图缺失时的冷调降级（JS 加此 class，与原 CSS filter 合并） */
.hero__media img.ext-hero-dim {
  filter: saturate(.7) contrast(1.02) brightness(1.04);
}

/* ---------------------------------------------------------
   1. 通用：扩展板块标题（不复用 .sec-head，避免打乱壹贰叁）
   --------------------------------------------------------- */
.ext-section { position: relative; }

.ext-head {
  display: flex;
  align-items: flex-start;
  gap: 26px;
  margin-bottom: clamp(44px, 6vw, 64px);
}
.ext-head__rule {
  width: 1px;
  height: 54px;
  background: var(--line);
  flex: 0 0 auto;
}
.ext-head__en {
  font-size: 11px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.ext-head__title {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1.2;
}
.ext-head__title::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 20px;
  background: var(--ext-accent);
}

/* 通用描边按钮 */
.ext-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .14em;
  border-radius: var(--ext-radius);
  transition: background .35s var(--ext-ease), color .35s var(--ext-ease), border-color .35s;
}
.ext-btn:hover { background: var(--ink); color: var(--paper); }
.ext-btn:disabled {
  border-color: var(--line);
  color: var(--ink-3);
  cursor: not-allowed;
  background: transparent;
}
.ext-btn--ghost { border-color: var(--line); color: var(--ink-2); }
.ext-btn--ghost:hover { background: transparent; border-color: var(--ink-3); color: var(--ink); }

/* ---------------------------------------------------------
   2. 四季切换胶囊
   --------------------------------------------------------- */
.ext-season {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  background: rgba(255, 253, 249, .9);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(46, 51, 45, .10);
  -webkit-backdrop-filter: saturate(1.1) blur(12px);
  backdrop-filter: saturate(1.1) blur(12px);
}
.ext-season__btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--ink-2);
  transition: background .3s var(--ext-ease), color .3s var(--ext-ease);
}
.ext-season__btn:hover { color: var(--ink); }
.ext-season__btn[aria-pressed="true"] {
  background: var(--ext-accent);
  color: var(--white);
}
/* 键盘聚焦可见 */
.ext-season__btn:focus-visible {
  outline: 2px solid var(--ext-accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   3. 美食打卡
   --------------------------------------------------------- */
.ext-checkin {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: clamp(32px, 4vw, 44px);
  border-top: 1px solid var(--line);
}
.ext-checkin__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.ext-checkin__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .14em;
}
.ext-checkin__title span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--ink-3);
  margin-left: 12px;
}
.ext-checkin__count {
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink-2);
}
.ext-checkin__count b {
  font-weight: 600;
  color: var(--ext-accent);
  font-size: 15px;
}

.ext-checkin__bar {
  position: relative;
  height: 1px;
  margin: 18px 0 6px;
  background: var(--line-soft);
}
.ext-checkin__bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  height: 1px;
  background: var(--ext-accent);
  transition: width .5s var(--ext-ease);
}

.ext-checkin__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(24px, 6vw, 80px);
  margin-top: 10px;
}

.ext-checkin__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  cursor: pointer;
}
.ext-checkin__name {
  font-size: 15px;
  letter-spacing: .06em;
  color: var(--ink);
  transition: color .3s;
}
.ext-checkin__en {
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--ink-3);
  margin-left: 10px;
}

/* 方形勾选框 */
.ext-checkin__box {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 1px;
  transition: background .2s var(--ext-ease), border-color .2s;
}
.ext-checkin__box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 7px;
  height: 4px;
  border-left: 1.5px solid var(--white);
  border-bottom: 1.5px solid var(--white);
  transform: rotate(-45deg) scale(0);
  transition: transform .2s var(--ext-ease);
}
.ext-checkin__row[aria-pressed="true"] .ext-checkin__box {
  background: var(--ext-accent);
  border-color: var(--ext-accent);
}
.ext-checkin__row[aria-pressed="true"] .ext-checkin__box::after {
  transform: rotate(-45deg) scale(1);
}
.ext-checkin__row[aria-pressed="true"] .ext-checkin__name { color: var(--ink); }

.ext-checkin__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.ext-checkin__hint {
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-3);
}

/* ---------------------------------------------------------
   4. 海报预览遮罩
   --------------------------------------------------------- */
.ext-poster {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.ext-poster.is-open { display: block; }
.ext-poster__mask {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 26, .62);
  opacity: 0;
  transition: opacity .25s var(--ext-ease);
}
.ext-poster.is-open .ext-poster__mask { opacity: 1; }

.ext-poster__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(12px);
  width: min(420px, calc(100% - 40px));
  max-height: calc(100% - 48px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: var(--ext-radius);
  box-shadow: 0 30px 80px rgba(24, 32, 26, .35);
  opacity: 0;
  transition: opacity .3s var(--ext-ease), transform .3s var(--ext-ease);
  overflow: hidden;
}
.ext-poster.is-open .ext-poster__panel { opacity: 1; transform: translate(-50%, -50%); }

.ext-poster__body {
  padding: 16px;
  overflow: auto;
  text-align: center;
}
.ext-poster__body canvas,
.ext-poster__body img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
}
.ext-poster__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.ext-poster__acts {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ext-poster__tip {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .04em;
}
.ext-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 1px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
  transition: background .3s, color .3s, border-color .3s;
}
.ext-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------------------------------------------------------
   5. 更多景点
   --------------------------------------------------------- */
.ext-spots__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.ext-spot-card {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.ext-spot-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--paper-3) 0%, #8C9584 55%, var(--green-deep) 100%);
}
/* 卡片配图 */
.ext-spot-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ext-ease);
}
.ext-spot-card:hover .ext-spot-card__media img { transform: scale(1.04); }
/* 压暗遮罩，保证竖排地名可读 */
.ext-spot-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    rgba(24, 32, 26, .22) 0%,
    rgba(24, 32, 26, .04) 42%,
    rgba(24, 32, 26, .58) 100%);
  pointer-events: none;
}
.ext-spot-card__place { position: relative; z-index: 2; }
.ext-spot-card__en { z-index: 2; }
/* 每张卡给不同的渐变角度与色相，避免三张完全雷同 */
.ext-spot-card:nth-child(2) .ext-spot-card__media {
  background: linear-gradient(200deg, #E2DCCC 0%, #9AA38E 50%, #3C4A3D 100%);
}
.ext-spot-card:nth-child(3) .ext-spot-card__media {
  background: linear-gradient(115deg, #E6DFD0 0%, #8E9A9E 55%, #2F3E33 100%);
}
.ext-spot-card__place {
  writing-mode: vertical-rl;
  font-size: clamp(20px, 2.2vw, 26px);
  letter-spacing: .5em;
  color: rgba(255, 255, 255, .92);
  transition: transform .5s var(--ext-ease);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.ext-spot-card:hover .ext-spot-card__place { transform: translateY(-6px); }
.ext-spot-card__en {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: .28em;
  color: rgba(255, 255, 255, .6);
  white-space: nowrap;
}
.ext-spot-card__pending {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: .24em;
  color: rgba(255, 255, 255, .48);
  white-space: nowrap;
}
.ext-spot-card__body { display: block; padding: 20px 0 8px; }
.ext-spot-card__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
.ext-spot-card__tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--ext-accent);
  border: 1px solid var(--ext-accent);
  border-radius: 1px;
  padding: 2px 6px;
  opacity: .85;
}
.ext-spot-card__desc {
  display: block;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-2);
  margin-bottom: 14px;
}
.ext-spot-card__rule {
  display: block;
  width: 0;
  height: 1px;
  background: var(--ext-accent);
  transition: width .5s var(--ext-ease);
}
.ext-spot-card:hover .ext-spot-card__rule { width: 100%; }

/* ---------------------------------------------------------
   6. 景点详情弹窗
   --------------------------------------------------------- */
.ext-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.ext-modal.is-open { display: grid; place-items: center; }
.ext-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 26, .62);
  opacity: 0;
  transition: opacity .25s var(--ext-ease);
}
.ext-modal.is-open .ext-modal__mask { opacity: 1; }

.ext-modal__card {
  position: relative;
  width: min(560px, calc(100% - 40px));
  max-height: calc(100% - 48px);
  overflow: auto;
  background: var(--paper);
  border-radius: var(--ext-radius);
  padding: 44px 44px 38px;
  box-shadow: 0 30px 80px rgba(24, 32, 26, .35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s var(--ext-ease), transform .3s var(--ext-ease);
}
.ext-modal.is-open .ext-modal__card { opacity: 1; transform: none; }

.ext-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
}

/* 景点图片画廊（可滑动） */
.ext-gallery {
  position: relative;
  margin-bottom: 26px;
  background: var(--paper-3);
  border-radius: 1px;
  overflow: hidden;
}
.ext-gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.ext-gallery__track::-webkit-scrollbar { display: none; }
.ext-gallery__track img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  scroll-snap-align: start;
  user-select: none;
  -webkit-user-drag: none;
}
.ext-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 253, 249, .85);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 2px 12px rgba(24, 32, 26, .18);
  transition: background .3s, opacity .3s;
}
.ext-gallery__arrow:hover { background: var(--white); }
.ext-gallery__arrow:disabled { opacity: .38; cursor: not-allowed; }
.ext-gallery__arrow--prev { left: 12px; }
.ext-gallery__arrow--next { right: 12px; }
.ext-gallery__arrow[hidden] { display: none; }

.ext-gallery__dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.ext-gallery__dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 0 1px rgba(20, 26, 22, .28);
  transition: background .3s var(--ext-ease), transform .3s var(--ext-ease);
}
.ext-gallery__dots i.is-active {
  background: var(--white);
  transform: scale(1.4);
}
.ext-gallery__dots[hidden] { display: none; }
.ext-modal__en {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.ext-modal__title {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: .12em;
  margin-bottom: 14px;
}
.ext-modal__title .ext-spot-card__tag { vertical-align: middle; margin-left: 10px; }
.ext-modal__desc {
  font-size: 14px;
  line-height: 2;
  color: var(--ink-2);
  margin-bottom: 26px;
}
.ext-modal__info {
  border-top: 1px solid var(--line);
  margin-bottom: 26px;
}
.ext-modal__info dl {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0;
  margin: 0;
}
.ext-modal__info dt,
.ext-modal__info dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.ext-modal__info dt { color: var(--ink-3); letter-spacing: .08em; }
.ext-modal__info dd { color: var(--ink-2); }

/* ---------------------------------------------------------
   7. 城市年轮（时间轴）
   --------------------------------------------------------- */
.ext-timeline__track {
  position: relative;
  display: flex;
  overflow-x: auto;
  padding: 8px 0 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.ext-timeline__track::-webkit-scrollbar { display: none; }
.ext-timeline__track.is-dragging { cursor: grabbing; }

/* 横向主线：画在每个节点上，而不是画在滚动容器上。
   画在容器上时 left/right:0 只等于「可视宽度」——移动端一横向滚动，
   线不跟内容走，看起来就是"线只到一屏、圆点之间断掉"。 */
.ext-timeline__node::after {
  content: "";
  position: absolute;
  top: 33px;             /* 对齐圆点中心：padding-top 28 + 半径 5.5 */
  left: 5px;
  width: 100%;           /* 起点 5px + 节点宽 ≈ 正好接到下一个圆点中心 */
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

.ext-timeline__node {
  position: relative;
  flex: 1 0 170px;
  padding: 28px 18px 0 0;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.ext-timeline__dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--ink-3);
  margin-bottom: 26px;
  transition: background .3s var(--ext-ease), border-color .3s, box-shadow .3s;
}
.ext-timeline__node[aria-selected="true"] .ext-timeline__dot {
  background: var(--ext-accent);
  border-color: var(--ext-accent);
  box-shadow: 0 0 0 4px var(--ext-accent-weak);
}
.ext-timeline__era {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-3);
  margin-bottom: 6px;
  transition: color .3s;
}
.ext-timeline__node[aria-selected="true"] .ext-timeline__era { color: var(--ext-accent); }
.ext-timeline__label {
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--ink-2);
  line-height: 1.5;
}
.ext-timeline__node[aria-selected="true"] .ext-timeline__label { color: var(--ink); }

.ext-timeline__detail {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  min-height: 96px;
}
.ext-timeline__detail-era {
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--ext-accent);
  margin-bottom: 10px;
}
.ext-timeline__detail-title {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
.ext-timeline__detail-body {
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink-2);
  max-width: 680px;
}
.ext-timeline__detail.is-switching {
  opacity: 0;
  transition: opacity .18s var(--ext-ease);
}
.ext-timeline__detail.is-ready {
  opacity: 1;
  transition: opacity .3s var(--ext-ease);
}

.ext-timeline__nav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}
.ext-timeline__arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 1px;
  color: var(--ink-2);
  transition: border-color .3s, color .3s, opacity .3s;
}
.ext-timeline__arrow:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.ext-timeline__arrow:disabled { opacity: .35; cursor: not-allowed; }
.ext-timeline__hint {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-3);
}

/* ---------------------------------------------------------
   8. 响应式
   --------------------------------------------------------- */
@media (max-width: 1024px) {
  .ext-spots__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  /* 四季胶囊：贴底居中、缩小 */
  .ext-season {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
    padding: 5px;
  }
  .ext-season__btn { width: 38px; height: 36px; font-size: 12px; }

  .ext-head { gap: 16px; margin-bottom: 40px; }
  .ext-head__rule { height: 44px; }

  /* 打卡：单列 */
  .ext-checkin__list { grid-template-columns: 1fr; column-gap: 0; }
  .ext-checkin__name { font-size: 14px; }
  .ext-checkin__actions { gap: 12px; }

  /* 景点：单列 */
  .ext-spots__grid { grid-template-columns: 1fr; }

  /* 弹窗：底部抽屉 */
  .ext-modal.is-open { align-items: end; }
  .ext-modal__card {
    width: 100%;
    max-height: 88%;
    padding: 34px 24px 28px;
    border-radius: 16px 16px 0 0;
    transform: translateY(40px);
  }
  .ext-modal.is-open .ext-modal__card { transform: none; }
  .ext-modal__info dl { grid-template-columns: 76px 1fr; }

  /* 时间轴：节点可滚动 */
  .ext-timeline__node { flex: 0 0 150px; }
  .ext-timeline__hint { display: none; }
  .ext-timeline__detail-body { max-width: none; }

  /* 海报面板 */
  .ext-poster__panel { width: min(380px, calc(100% - 28px)); }
}

/* 极窄屏 */
@media (max-width: 380px) {
  .ext-season__btn { width: 34px; }
  .ext-modal__card { padding: 30px 20px 24px; }
}

/* ---------------------------------------------------------
   9. 无障碍：尊重减少动效
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero__media img.ext-hero-fading { transition: none; }
  .ext-season__btn,
  .ext-checkin__box,
  .ext-checkin__box::after,
  .ext-checkin__bar i,
  .ext-spot-card__place,
  .ext-spot-card__rule,
  .ext-modal__card,
  .ext-modal__mask,
  .ext-poster__panel,
  .ext-poster__mask,
  .ext-timeline__dot,
  .ext-timeline__detail {
    transition: none !important;
  }
}
