/* ===== 基础变量（共享变量见 css/tokens.css） ===== */

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }
body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* 全局键盘聚焦环（暖色） */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* 跳到内容（无障碍） */
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 300;
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: var(--color-accent); color: #fff;
  font-size: .9rem; box-shadow: var(--shadow-lg);
  transform: translateY(-150%); transition: transform .25s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* 极淡颗粒质感叠加，打破数字扁平感 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1;
  pointer-events: none; opacity: .035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== 导航栏 ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-height); padding: 0 32px;
  background: rgba(250,248,245,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background .3s;
}
.nav--scrolled { background: rgba(250,248,245,.97); box-shadow: var(--shadow); }
.nav__logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--color-accent); letter-spacing: 2px;
}
.nav__links { display: flex; gap: 8px; list-style: none; }
.nav__links a {
  padding: 8px 18px; border-radius: 20px;
  font-size: .92rem; font-weight: 400;
  color: var(--color-text-light);
  transition: all .25s;
}
.nav__links a:hover,
.nav__links a.active { color: var(--color-accent); background: rgba(193,120,74,.08); }
.nav__toggle { display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 22px; height: 2px;
  background: var(--color-text); border-radius: 2px; transition: all .3s; }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100dvh; display: flex;
  align-items: center; justify-content: center; text-align: center;
  background: url('/images/optimized/微信图片_20260528181532_1023_74-82a502e01e-w1920-q78.webp') center/cover no-repeat;
  color: #fff;
}
@supports not (height: 100dvh) { .hero { min-height: 100vh; } }
.hero__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 28%, rgba(30,20,10,.18) 0%, rgba(30,20,10,.62) 100%),
    linear-gradient(180deg, rgba(120,70,40,.22) 0%, rgba(30,20,10,.30) 100%);
}
.hero__content { position: relative; z-index: 2; max-width: 680px; padding: 0 24px; }
.hero__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 700; margin-bottom: 18px;
  letter-spacing: 1px; line-height: 1.08;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0,0,0,.35);
}
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 300;
  opacity: .92; margin-bottom: 40px; letter-spacing: .5px;
}
.hero__cta {
  display: inline-block; padding: 14px 42px;
  border: 1.5px solid rgba(255,255,255,.85); border-radius: var(--radius-lg);
  font-size: 1rem; font-weight: 500; color: #fff;
  backdrop-filter: blur(2px);
  transition: background .3s var(--ease-out), color .3s var(--ease-out), transform .15s var(--ease-out);
}
.hero__cta:hover { background: #fff; color: var(--color-text); border-color: #fff; }
.hero__cta:active { transform: scale(.97); }

/* ===== Section 通用 ===== */
.section { max-width: var(--max-width); margin: 0 auto; padding: var(--space-section) 24px calc(var(--space-section) + 12px); }
.section--alt { background: var(--color-alt); max-width: 100%; padding-left: 0; padding-right: 0; }
.section--alt > * { max-width: var(--max-width); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.section--alt .section__header { padding-left: 24px; padding-right: 24px; }

/* 杂志式左对齐板块头：序号 + 眉标 + 标题 + 细线 */
.section__header {
  display: flex; align-items: baseline; gap: 22px;
  text-align: left; margin-bottom: clamp(34px, 5vw, 58px);
}
.section__heading { display: flex; flex-direction: column; gap: 8px; }
.section__kicker {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--color-accent);
}
.section__index {
  font-family: var(--font-serif); font-style: italic;
  font-weight: 600; margin-right: 8px; opacity: .85;
}
.section__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 700;
  letter-spacing: -.01em; line-height: 1.05;
  color: var(--color-text); text-wrap: balance;
}
.section__rule { flex: 1; height: 1px; background: var(--color-border); align-self: center; }
@media (max-width: 480px) {
  .section__rule { display: none; }
}

/* ===== 骨架屏 ===== */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-alt) 50%, var(--color-border) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ===== 画廊通用 ===== */
.gallery { display: grid; gap: 20px; max-width: 1040px; margin: 0 auto; }
.gallery__item {
  position: relative; border-radius: var(--radius); overflow: hidden;
  cursor: pointer;
  /* 图片加载前的占位背景 — 图片加载后用 object-fit:cover 覆盖 */
  background: linear-gradient(135deg, var(--color-alt) 0%, var(--color-border) 100%);
  box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s;
  aspect-ratio: 4 / 5;
}
.gallery__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .5s; }
.gallery__item:hover img { transform: scale(1.05); }
.gallery__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, transparent 50%);
  opacity: 0; transition: opacity .3s;
  display: flex; align-items: flex-end; padding: 16px;
}
.gallery__item:hover .gallery__overlay { opacity: 1; }
.gallery__caption {
  color: #fff; font-size: .9rem; font-weight: 400;
}

/* 瀑布流 (旅行) */
.gallery--masonry,
.gallery--grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
}

.gallery__item--landscape,
.gallery__item--panorama {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

/* 网格 (美食) */
.gallery--grid { align-items: stretch; }

/* ===== 视频区 ===== */
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.video-card {
  background: var(--color-surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.video-card__player {
  position: relative; padding-bottom: 56.25%; /* 16:9 */
}
.video-card__player iframe,
.video-card__player video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; object-fit: cover;
}
.video-card__external {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
  background: linear-gradient(135deg, #111 0%, #2f2a25 52%, #c1784a 100%);
  color: #fff;
  overflow: hidden;
}
.video-card__external img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .35s;
}
.video-card__external:hover img {
  transform: scale(1.04);
}
.video-card__external::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,.08);
}
.video-card__external-icon {
  position: relative; z-index: 1;
}
.video-card__external-icon {
  display: grid; place-items: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.35);
  font-size: 1.05rem; font-weight: 700;
}
.video-card__info { padding: 16px 20px; }
.video-card__caption { font-size: .95rem; font-weight: 500; }

/* ===== 关于 ===== */
.about {
  position: relative; isolation: isolate;
  max-width: 600px; text-align: center; margin: 0 auto;
  padding: 8px 0;
}
.about::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 30px; width: min(520px, 90%); height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--color-accent-soft), transparent 72%);
  pointer-events: none;
}
.about__avatar {
  width: 124px; height: 124px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 26px; border: 4px solid var(--color-surface);
  box-shadow: var(--shadow);
}
.about__text {
  font-size: 1.06rem; color: var(--color-text-light); line-height: 1.95;
  max-width: 46ch; margin: 0 auto; text-wrap: pretty;
}

/* ===== 滚动渐入（渐进增强，仅 JS 启用时隐藏初始态） ===== */
.js-enabled .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  will-change: opacity, transform;
}
.js-enabled .reveal.is-visible { opacity: 1; transform: none; }

/* ===== 按下/聚焦反馈 ===== */
.nav__links a:active { transform: scale(.96); }
.nav__logo { transition: opacity .2s; }
.nav__logo:hover { opacity: .82; }
.section__retry:active { transform: scale(.97); }
.gallery__item:active { transform: scale(.99); }

/* ===== 减少动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js-enabled .reveal { opacity: 1; transform: none; }
  .gallery__item:hover img,
  .gallery__item:hover,
  .video-card:hover { transform: none; }
}

/* ===== 灯箱 ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,15,10,.92);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; padding: 40px;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lightbox--open { opacity: 1; pointer-events: auto; }
.lightbox__close {
  position: absolute; top: 24px; right: 32px;
  background: none; border: none; font-size: 2.4rem;
  color: #fff; cursor: pointer; opacity: .7; transition: opacity .2s;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__img {
  max-width: 90vw; max-height: 75vh; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); object-fit: contain;
}
.lightbox__caption {
  margin-top: 16px; color: rgba(255,255,255,.75);
  font-size: .95rem; text-align: center;
}

/* ===== 错误状态 ===== */
.section__error {
  text-align: center;
  padding: 32px 24px;
  color: var(--color-text-light);
  font-size: .95rem;
}
.section__error p { margin-bottom: 12px; }
.section__retry {
  display: inline-block;
  padding: 8px 24px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-accent);
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
}
.section__retry:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ===== 页脚 ===== */
.footer {
  text-align: center; padding: 40px 24px;
  color: var(--color-text-light); font-size: .85rem;
  border-top: 1px solid var(--color-border);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav__links {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; background: rgba(250,248,245,.97);
    backdrop-filter: blur(12px); padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-120%); opacity: 0; transition: all .3s;
  }
  .nav__links--open { transform: translateY(0); opacity: 1; }
  .nav__links a { display: block; text-align: center; padding: 12px; border-radius: 0; }
  .nav__toggle { display: flex; }

  .gallery { gap: 14px; }
  .gallery--masonry,
  .gallery--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .section { padding: 56px 16px; }
  .gallery--masonry,
  .gallery--grid { grid-template-columns: 1fr; }
  .gallery__item--landscape,
  .gallery__item--panorama { grid-column: span 1; }
  .hero__title { font-size: 1.8rem; letter-spacing: 2px; }
}
