/* =====================================================================
   自定义样式：只放参考样式表（css/site.css，Tailwind 编译产物）里没有的部分
   ===================================================================== */

/* ---------- 中文字体回退 ---------- */
body,
.font-\[family-name\:var\(--font-noto\)\] {
  font-family:
    var(--font-noto),
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}

/* ---------- 手写体签名 ---------- */
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../assets/fonts/caveat.woff2) format("woff2");
}
.signature {
  font-family: "Caveat", "Segoe Script", cursive;
  font-weight: 600;
  font-size: 112px;
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: #1c1917;
  white-space: nowrap;
  transform: rotate(-3deg);
  padding: 0 0.1em 0.12em;
}

/* ---------- Hero 舞台：窄屏时整体等比缩小（≥1440 与原站完全一致） ---------- */
.hero-stage {
  transform: translateX(-25px) scale(var(--hs, 1));
  transform-origin: center center;
}
@media (max-width: 1023px) {
  .hero-stage {
    transform: none;
  }
}

/* ---------- 票券（HTML 绘制） ---------- */
.ticket {
  position: relative;
  display: flex;
  width: 100%;
  aspect-ratio: 2.42;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  color: #1c1917;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.ticket-main {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 14px 10px 12px 34px;
  display: flex;
  flex-direction: column;
}
.ticket-side {
  position: absolute;
  left: 8px;
  top: 14px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 6px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #78716c;
  text-transform: uppercase;
}
.ticket-title {
  font-weight: 900;
  font-size: 24px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.ticket-heading {
  font-size: 10px;
  font-weight: 700;
  margin-top: 6px;
}
.ticket-rows {
  margin-top: 6px;
  font-size: 7.5px;
  line-height: 1.5;
  color: #57534e;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 6px;
}
.ticket-rows dt {
  font-weight: 700;
}
.ticket-pill {
  margin-top: auto;
  align-self: flex-start;
  background: #1c1917;
  color: #fff;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 3px;
}
.ticket-stub {
  width: 88px;
  flex: none;
  border-left: 2px dashed #d6d3d1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 6px;
}
.ticket-barcode {
  width: 18px;
  height: 86px;
  background: repeating-linear-gradient(90deg, #1c1917 0 1px, transparent 1px 3px);
}
.ticket-stub-text {
  writing-mode: vertical-rl;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
}
.ticket-stub-no {
  writing-mode: vertical-rl;
  font-size: 8px;
  font-weight: 800;
  color: #57534e;
}

/* ---------- 照片墙（HTML 绘制，照片可替换） ---------- */
.collage {
  position: relative;
  width: 340px;
  aspect-ratio: 340 / 400;
  border-radius: 12px;
  background-color: #c9a780;
  background-image: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.25), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(90, 60, 30, 0.18), transparent 45%), url(../assets/noise-texture.png);
  background-size: auto, auto, 200px 200px;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
.collage .pol {
  position: absolute;
  background: #fff;
  padding: 5px 5px 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.collage .pol img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.collage-caption {
  position: absolute;
  right: 14px;
  bottom: 78px;
  font-family: "Caveat", cursive;
  font-size: 24px;
  line-height: 1;
  color: #5b4636;
  transform: rotate(-8deg);
  text-align: center;
}

/* ---------- 工牌头像占位 ---------- */
.avatar-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a8a29e 0%, #78716c 55%, #57534e 100%);
  color: #fafaf9;
  font-weight: 700;
}

/* ---------- 项目预览占位 ---------- */
.preview-ph {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  text-align: center;
  padding: 24px;
}
.preview-ph img {
  width: 64px;
  height: 64px;
  filter: brightness(10);
  opacity: 0.9;
}
.preview-ph span {
  font-size: 20px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.preview-ph small {
  font-size: 12px;
  opacity: 0.75;
}

/* ---------- Playground 悬停气泡 ---------- */
.tip-label {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}
.tip-bubble {
  padding: 6px 12px;
  border-radius: 9999px;
  background: #1c1917;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  transform-origin: left top;
  animation: tip-in 0.15s ease-out both;
}
@keyframes tip-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.tip-out {
  animation: tip-out 0.15s ease-in both;
}
@keyframes tip-out {
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* ---------- 面板入场 / 切换 ---------- */
.fade-swap {
  animation: fade-swap 0.2s ease-out both;
}
@keyframes fade-swap {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.slide-up {
  animation: slide-up 0.3s ease-out both;
}
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Finder 文件夹：按下缩放 ---------- */
.folder-btn:active {
  transform: scale(0.95);
}

/* ---------- 3D 翻转卡片 ---------- */
.flip-inner {
  transform-style: preserve-3d;
  transition: transform 0.5s ease-out;
}
.flip-inner.is-flipped {
  transform: rotateY(180deg);
}
.fact-card {
  transition:
    left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 软木板卡片 ---------- */
.board-card {
  position: absolute;
  cursor: grab;
  perspective: 600px;
  touch-action: none;
}
.board-card:active {
  cursor: grabbing;
}
.board-card img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- 自定义光标 ---------- */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  will-change: transform;
}

/* ---------- 点击爆裂粒子 ---------- */
.burst {
  position: fixed;
  pointer-events: none;
  z-index: 50;
}
.burst span {
  position: absolute;
  left: 0;
  top: 0;
  animation: burst-particle 0.7s ease-out forwards;
}

/* ---------- 开场动画 ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #1e1e1e;
  font-family: var(--font-noto), "PingFang SC", system-ui, sans-serif;
  cursor: none;
}
.intro-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.intro-letter {
  position: absolute;
  font-size: 100px;
  font-weight: 900;
  color: #fff;
  opacity: 0;
  line-height: 1;
  will-change: transform, opacity;
  user-select: none;
}
.intro-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 4px rgba(255, 255, 255, 0.4);
  opacity: 0;
  will-change: transform, opacity;
}
.intro-flash {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 160, 120, 0.6) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
}
@keyframes flash-burst {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(40);
    opacity: 0;
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  10% {
    transform: translate(-4px, 2px);
  }
  20% {
    transform: translate(3px, -3px);
  }
  30% {
    transform: translate(-2px, 4px);
  }
  40% {
    transform: translate(4px, -1px);
  }
  50% {
    transform: translate(-3px, -2px);
  }
  60% {
    transform: translate(2px, 3px);
  }
  70% {
    transform: translate(-1px, -4px);
  }
  80% {
    transform: translate(3px, 2px);
  }
  90% {
    transform: translate(-2px, -1px);
  }
}
.intro-wipe {
  transition: clip-path 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 跟随鼠标的提示 ---------- */
.hover-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  pointer-events: none;
  will-change: transform;
}

/* ---------- 滚动驱动（Safari 兼容：用 JS 写入 --p） ---------- */
.scroll-y {
  transform: translateY(var(--scroll-y, 0));
}

/* ---------- 小屏 ---------- */
@media (max-width: 1023px) {
  .signature {
    font-size: 64px;
  }
}

/* ---------- 参考站编译表中缺失的工具类 ---------- */
.duration-400 {
  transition-duration: 0.4s;
}

/* Finder 项目预览面板进入 */
@keyframes preview-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 成就列表逐行进入 */
.ach-in {
  opacity: 0;
  transform: translateY(6px);
  animation: ach-in 0.3s ease-out both;
  animation-delay: var(--d, 0s);
}
@keyframes ach-in {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Design Notes 便利贴 hover 阴影 */
[data-notes]:hover {
  box-shadow: 4px 6px 16px rgba(0, 0, 0, 0.1);
}

/* Hero 舞台：参考站为固定 1400px 容器，窄屏由 JS 设置 --hs 缩放 */
.hero-stage {
  max-width: none;
}

/* 手机工牌：site.css 自带 badge-drop 动画，这里由 WAAPI 接管，避免双重播放 */
.mobile-hero .badge-drop {
  animation: none;
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }
  .cursor-dot {
    display: none;
  }
}
