:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --ink: #ffffff;
  --ink-7: rgba(255,255,255,.7);
  --ink-5: rgba(255,255,255,.5);
  --ink-3: rgba(255,255,255,.3);
  --ink-1: rgba(255,255,255,.12);
  --line: rgba(255,255,255,.18);
  --accent: #f5d90a;

  --side: clamp(20px, 4vw, 72px);
  --header-h: 64px;

  /* hover 缩放幅度（2026-10-04 第二次试用，逐步加大摸索上限）：
     1.012 / 1.02 / 1.04 用户设备均不出线；1.06 曾在旧结构（will-change+外扩+
     isolation 那套）下出底边闪烁线，当前干净结构（.settled 清层）重试中。
     改这一个值即可全局调节，设 1 即关闭 */
  --hover-scale: 1.06;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ===================== 顶部导航 ===================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  padding: 0 var(--side);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 默认：在 banner 顶部时为带灰度的纯黑；滚动后由 JS 加 .is-floating 变带透明度的灰黑 */
  background: #111111;
  transition: background-color .35s ease, transform .4s cubic-bezier(.4, 0, .2, 1);
}
/* 滚动中：带灰度黑色的半透明，浮在作品之上 */
.site-header.is-floating {
  background: rgba(17, 17, 17, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* 向下滚动时：向上滑出隐藏 */
.site-header.is-hidden {
  transform: translate3d(0, -100%, 0);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 1px;
  font-weight: 500;
}
.logo > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: invert(1);
}
.logo small {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-5);
  margin-left: 6px;
}

.site-nav {
  display: flex;
  gap: clamp(18px, 2.4vw, 40px);
  align-items: center;
}
.site-nav a {
  position: relative;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--ink-7);
  padding: 4px 0;
  transition: color .25s;
}
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a + a::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--ink-1);
}

.menu-toggle {
  display: none;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink);
  padding: 8px 0;
}

/* ===================== 首页 & 作品页：错落瀑布流（绝对定位 + JS 布局）===================== */
.home-page { min-height: 100vh; }

/* ===================== 首页 Banner：全屏自动轮播 ===================== */
.banner {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--bg);
}
.banner-track,
.banner-slide {
  position: absolute;
  inset: 0;
}
.banner-slide {
  opacity: 0;
  transition: opacity 1.1s ease;
  z-index: 1;
  /* 顶部留出固定导航高度，避免 header 遮挡作品内容 */
  padding-top: var(--header-h);
}
.banner-slide.active { opacity: 1; z-index: 2; }
.banner-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transform: scale(1.001);
  transition: transform 7s cubic-bezier(.2,.6,.3,1);
}
.banner-slide.active img { transform: scale(1.08); }

/* 轮播指示点 */
.banner-dots {
  position: absolute;
  left: var(--side);
  bottom: clamp(32px, 6vh, 56px);
  z-index: 5;
  display: flex;
  gap: 10px;
}
.banner-dot {
  width: 30px;
  height: 2px;
  padding: 0;
  background: rgba(255,255,255,.32);
  border: 0;
  cursor: pointer;
  transition: background .3s, width .3s;
}
.banner-dot.active { background: #fff; width: 48px; }

/* 左右箭头 */
.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.28);
  color: #fff;
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .3s, border-color .3s;
}
.banner-arrow:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); }
.banner-arrow.prev { left: 24px; }
.banner-arrow.next { right: 24px; }

/* 底部滚动提示 */
.banner-scroll-hint {
  position: absolute;
  right: var(--side);
  bottom: clamp(32px, 6vh, 56px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
}
.banner-scroll-hint::after {
  content: "";
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,.35);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(.4); opacity: .5; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* 单元网格版：16:9 单元重复布局（2026-10-01 用户手绘单元确立）。
   6 列坐标系；每格 16:9（封面原图 3200×1800 正好铺满，零裁剪）。
   单元 = 9 格，显式行列由 app.js 的 assignUnitGrid 按时间序写入；
   gap = 5px：格子之间留细缝（用户 2026-10-01 要求，10px 偏大 → 收窄到 5px）；
   app.js 的 layoutGrid 会读这里 computedStyle 的 columnGap 来算行高，改这一个值即可全局生效。 */
.masonry {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  grid-auto-flow: row;
}
.masonry .item {
  /* position:relative 保留（2026-10-03）：img/overlay 是 absolute inset 定位，
     原先靠 .item 自身的 transform 隐式提供包含块，
     系统「减少动效」下 transform 变 none 时图片会脱框铺满整个网格容器 */
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  /* 行高由 app.js 的 layoutGrid 按 16:9 精确写入 grid-template-rows，
     格子 stretch 填满行高 → 比例严格 16:9（不能用 aspect-ratio：stretch 会覆盖它导致塌陷） */
  /* 加载占位时与页面背景融为一体，不露出"图片框" */
  background: var(--bg);
  display: block;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 140px, 0);
  will-change: transform, opacity;
}
/* 手机端：两格行 ×2 → 一格行循环（2026-10-01 用户要求，节奏 2-2-1），
   行高与显式行列由 app.js 的 layoutGrid 按时间序精确写入 */
@media (max-width: 767px) {
  .masonry { grid-template-columns: repeat(2, 1fr); }
  /* 触屏没有真正的 hover，点按后 :hover 可能粘住导致图片一直放大 → 手机端关掉缩放 */
  :root { --hover-scale: 1; }
}

/* 加载占位黄点：参考站为上下弹跳的小球，图片加载完成后淡出 */
.masonry .item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,0,0,.35);
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity .4s ease;
  animation: loaderBounce .85s ease-in-out infinite;
}
.masonry .item.loaded::before { opacity: 0; }
@keyframes loaderBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-11px); }
}
/* 入场动画：从下方 140px 向上滑入 + 渐显，错峰用 animation-delay（内联） */
.masonry .item.is-in {
  animation: masonrySlideUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes masonrySlideUp {
  from {
    opacity: 0;
    transform: translate3d(0, 140px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
/* 滑入结束（app.js 监听 animationend 后加 .settled）：清掉 transform 与合成层
   （照抄极简网格版 .reveal.visible 的收尾方式——渐显结束 transform 归 none，
   卡片不常驻 GPU 层，hover 缩放时层结构干净，这是极简版不出底边亮线的
   结构性原因）。这里显式补 opacity/transform 终态，防移除 animation 后跳回起始帧。 */
.masonry .item.settled {
  opacity: 1;
  transform: none;
  animation: none;
  will-change: auto;
}
/* 尊重系统「减少动效」设置：直接显示 */
@media (prefers-reduced-motion: reduce) {
  .masonry .item {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
  .masonry .item.loaded:hover img,
  .masonry .item.loaded.settled:hover img { transform: none !important; }
}

.masonry .item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .45s ease;
}
/* 图片加载完成后淡入；hover 变暗只在已加载时生效，避免加载过程中误触。
   transform 曲线照抄极简网格版（.65s 慢曲线，微缩放走柔和呼吸感） */
.masonry .item.loaded img {
  opacity: 1;
  transition: opacity .45s ease, transform .65s cubic-bezier(.2,.6,.3,1);
}
.masonry .item.loaded:hover img {
  opacity: .72;
}
/* 缩放只在滑入动画结束后（.settled）才生效（2026-10-04 实测定论）：
   滑入的 transform 与缩放的 transform 同时活跃时，用户 GPU 上会出底边闪烁线
   ——这是出线的真实条件之一，与缩放幅度无关（1.06 在 settled 后干净）。
   变暗/文字浮现仍即时，不受影响 */
.masonry .item.loaded.settled:hover img {
  transform: scale(var(--hover-scale));
}

/* 信息层：默认全部隐藏，鼠标 hover 时才浮现文字与暗化 */
.masonry .item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.2) 35%, rgba(0,0,0,0) 65%);
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
}
.masonry .item.loaded:hover .overlay { opacity: 1; }
.masonry .item .meta {
  position: absolute;
  left: 18px;
  bottom: 16px;
  right: 18px;
  color: #fff;
  opacity: 0;
  transition: opacity .45s ease;
}
.masonry .item.loaded:hover .meta { opacity: 1; }
.masonry .item .meta b {
  display: block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .5px;
  margin-bottom: 4px;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.masonry .item .meta span {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  transition: color .45s ease;
}
.masonry .item:hover .meta span { color: rgba(255,255,255,.95); }

/* ===================== Footer ===================== */.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px var(--side);
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 32px;
  font-size: 13px;
  color: var(--ink-5);
  line-height: 1.8;
}
.footer-brand {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.footer-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.footer-links a { transition: color .25s; }
.footer-links a:hover { color: var(--ink); }
.footer-social {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: flex-start;
}
.footer-social a {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 12px;
  transition: background .25s, border-color .25s;
}
.footer-social a:hover { background: var(--ink-1); border-color: var(--ink-3); }

/* ===================== 通用页标签 ===================== */
.page-label {
  padding: calc(var(--header-h) + 40px) var(--side) 24px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-5);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.page-label span { color: var(--accent); margin-right: 12px; }


/* ===================== 案例详情页：全幅宽度 · 不裁剪 · 高度自适应 · 仅图片 ===================== */
.project-page { background: var(--bg); }
.project-page main { position: relative; width: 100%; }
/* 详情页只展示图片，不显示任何文字介绍 */
.project-stage {
  padding-top: 0;
  /* 详情页图片之间同样留细缝（用户 2026-10-01 要求 5px，与列表页格间隙一致）：
     用 flex column + gap，缝里露出页面底色，不留白边、不改图片尺寸、不裁剪 */
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.project-stage figure {
  margin: 0;
  width: 100%;
  display: block;
  line-height: 0;
  background: var(--bg);
  position: relative;
}
/* 详情页图片加载占位：与首页一致的上下弹跳黄点，图片加载完成后淡出 */
.project-stage figure:not(.loaded) {
  min-height: 70vh;
}
.project-stage figure::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,0,0,.35);
  pointer-events: none;
  z-index: 2;
  opacity: 1;
  transition: opacity .4s ease;
  animation: loaderBounce .85s ease-in-out infinite;
}
.project-stage figure.loaded::before { opacity: 0; }
/* 首张图顶部留出固定导航高度，避免 header 遮挡作品内容 */
.project-stage figure:first-child {
  padding-top: var(--header-h);
}
/* 图片宽度最大化：宽度铺满整幅，高度按原始比例自适应，绝不裁剪 */
.project-stage figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  opacity: 0;
  transition: opacity .45s ease;
}
.project-stage figure.loaded img { opacity: 1; }

.project-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 32px var(--side);
  border-top: 1px solid var(--line);
  font-size: 14px;
  letter-spacing: 1px;
}
.project-navigation a { transition: color .25s; }
.project-navigation a:hover { color: var(--accent); }
.project-navigation #project-prev { text-align: left; }
.project-navigation #project-next { text-align: right; }
.project-navigation .back-link {
  padding: 10px 24px;
  border: 1px solid var(--line);
  text-align: center;
}
.project-navigation .back-link:hover { border-color: var(--ink-3); }

/* ===================== 关于页 ===================== */
.about-hero {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  padding: 64px var(--side);
}
.about-hero .visual {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 48px;
}
.about-hero .visual img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  filter: grayscale(20%);
}
.about-hero .body {
  max-width: 560px;
}
.about-hero .body h1 {
  margin: 0 0 32px;
  font-size: clamp(32px, 4.5vw, 64px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 1px;
}
.about-hero .body p {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 2;
  color: var(--ink-7);
}
.about-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.about-services .service {
  background: var(--bg);
  padding: 48px var(--side);
}
.about-services .service h3 {
  margin: 0 0 16px;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
}
.about-services .service p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-5);
}

/* ===================== 经历页 ===================== */
.honors-list {
  padding: 48px var(--side) 96px;
  max-width: 900px;
}
.honor-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.honor-item .year {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--accent);
}
.honor-item .title { font-size: 19px; font-weight: 500; }
.honor-item .desc { color: var(--ink-5); text-align: right; }

/* ===================== 联系页 ===================== */
.contact-hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px var(--side);
}
.contact-hero .eyebrow {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.contact-hero h1 {
  margin: 0 0 48px;
  font-size: clamp(32px, 6vw, 72px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 2px;
}
.contact-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.contact-people .person {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  padding: 24px;
}
.contact-people .person img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: grayscale(100%);
  margin-bottom: 20px;
  background: #111;
}
.contact-people .person span {
  display: block;
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.contact-people .person b {
  display: block;
  font-size: 21px;
  font-weight: 500;
  color: var(--ink);
}
/* 二维码卡片：不做灰度处理，保持可扫描 */
.contact-people .person img.qr-code {
  filter: none;
  object-fit: contain;
  background: #fff;
}

/* ===================== 动效 ===================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===================== 响应式 ===================== */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .menu-toggle { display: block; }
  .menu-toggle[aria-expanded="true"] + .site-nav,
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: var(--header-h) 0 0;
    background: rgba(0,0,0,.96);
    padding: 40px var(--side);
    gap: 24px;
    align-items: flex-start;
  }
  .site-nav a + a::before { display: none; }

  .masonry .item .meta b { font-size: 14px; }

  .project-navigation { grid-template-columns: 1fr 1fr; gap: 12px; }
  .project-navigation .back-link { grid-column: 1 / -1; order: -1; }
  .about-hero { grid-template-columns: 1fr; }
  .about-services { grid-template-columns: 1fr; }
  .honor-item { grid-template-columns: 1fr; gap: 6px; }
  .honor-item .desc { text-align: left; }
  .contact-people { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; gap: 24px; }
  .footer-social { justify-content: flex-start; }
}

@media (max-width: 640px) {
  :root { --header-h: 56px; }
  /* 手机端网格封面不显示文字和暗化层，纯图片 */
  .masonry .item .meta,
  .masonry .item .overlay { display: none; }

  .banner { min-height: 480px; height: 100svh; }
  .banner-arrow { display: none; }
  .banner-scroll-hint { display: none; }
}
