/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --scene-w: 4000px;   /* 场景原始宽度（与参考图一致） */
  --scene-h: 2249px;   /* 场景原始高度 */
  --scale: 1;          /* 由 JS 计算，等比缩放场景 */
}

html, body {
  height: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 800px at 20% 0%, #fdfaf1 0%, transparent 60%),
    radial-gradient(1000px 700px at 85% 100%, #f4ecd7 0%, transparent 55%),
    linear-gradient(160deg, #f9f4e6 0%, #f1ead8 100%);
  color: #4a3f2f;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(253,250,241,.92) 0%, rgba(253,250,241,.55) 70%, rgba(253,250,241,0) 100%);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.site-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 22px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #6b5836;
}

.site-nav { display: flex; gap: 6px; }
.nav-link {
  padding: 7px 14px;
  font-size: 14px;
  color: #6b5836;
  text-decoration: none;
  border-radius: 999px;
  transition: background .25s, color .25s, transform .25s;
}
.nav-link:hover {
  background: rgba(255,255,255,.85);
  color: #a05a2c;
  transform: translateY(-1px);
}

/* ============ 场景 ============ */
.scene-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.scene {
  position: relative;
  width: var(--scene-w);
  height: var(--scene-h);
  transform: scale(var(--scale));
  transform-origin: center center;
  flex: none;
}

/* 备用静态画面 */
.poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(90, 70, 30, .18);
}

/* 动态视频层 */
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;   /* 让鼠标事件穿透到下面的文件夹 */
}
.layer-back  { z-index: 1; }
.layer-front { z-index: 6; }

/* ============ 文件夹 ============ */
.folder {
  position: absolute;
  z-index: 2;
  display: block;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 12px rgba(60, 40, 10, .18));
  /* 悬停：快速上浮；移开：缓慢回位 */
  transition: transform .55s cubic-bezier(.22, .61, .36, 1),
              filter .55s ease;
  will-change: transform;
}

.folder-1 { left: 1355px; top: 846px; width: 575px; height: 697px; z-index: 5; }
.folder-2 { left: 1697px; top: 769px; width: 423px; height: 696px; z-index: 4; }
.folder-3 { left: 1976px; top: 774px; width: 441px; height: 713px; z-index: 3; }
.folder-4 { left: 2162px; top: 708px; width: 557px; height: 765px; z-index: 2; }

/* 触发区域由 js/script.js 按文件夹“真实可见形状”（透明像素）精确判断：
   鼠标指到某个文件夹看得见的像素上，就给这个文件夹加 .lifted。
   这样即使 folder-3 被 folder-2 的部分区域遮住，只要它露出来的地方被指到就会触发。 */
.folder.lifted {
  /* 放大 1.12 倍 + 上浮 40px：明显但不会超出画框（已按 4 个文件夹计算过边界） */
  transform: translateY(-70px) scale(1.10);
  transform-origin: center;
  transition-duration: .16s;                /* 进入时更快 */
  filter: drop-shadow(0 22px 20px rgba(60, 40, 10, .3));
}

/* 视频不可用时的降级：只显示静态封面 */
.no-video .layer,
.no-video .folder { display: none; }
.no-video .poster { z-index: 10; }

/* ============ 底部 ============ */
.site-footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  text-align: center;
  padding: 10px 16px;
  font-size: 12px;
  color: rgba(107, 88, 54, .65);
  background: linear-gradient(0deg, rgba(253,250,241,.9) 0%, rgba(253,250,241,.4) 70%, rgba(253,250,241,0) 100%);
  pointer-events: none;
}

/* ============ 小屏 / 移动端 ============ */
@media (max-width: 640px) {
  .site-header { padding: 10px 16px; }
  .brand-name { font-size: 16px; letter-spacing: 1px; }
  .nav-link { font-size: 12px; padding: 5px 9px; }
}

/* ============ 点击文件夹1后的页面过渡 ============ */
.scene-wrap,
.site-header,
.site-footer {
  transition: opacity .28s ease, transform .28s ease;
}

body.is-leaving .scene-wrap {
  opacity: 0;
  transform: scale(.985);
}

body.is-leaving .site-header,
body.is-leaving .site-footer {
  opacity: 0;
}
/* 尊重系统“减少动态效果”设置 */
@media (prefers-reduced-motion: reduce) {
  .folder { transition: none; }
  .folder:hover { transform: none; filter: none; }
}
