/* ============================================================
   2026 Product Design Portfolio — 陈洁仪
   Shared stylesheet
   ============================================================ */

:root {
  --bg: #060608;
  --bg-soft: #0a0a0e;
  --bg-elev: #101017;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f3f1;
  --text-dim: rgba(244, 243, 241, 0.58);
  --text-faint: rgba(244, 243, 241, 0.34);
  --accent: #8b7cff;
  --accent-2: #5f7bff;
  --accent-3: #b39cff;
  --grad: linear-gradient(100deg, #b39cff 0%, #8b7cff 38%, #5f7bff 100%);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(20px, 5vw, 72px);
  --nav-h: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection { background: rgba(139, 124, 255, 0.35); }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- grain ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 900;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- page transition ---------- */
.page {
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}
.page.is-ready { opacity: 1; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}
.nav.is-scrolled {
  background: rgba(6, 6, 8, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav__brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}
.nav__brand em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 40px);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.nav__links a {
  position: relative;
  display: inline-block;
  padding: 4px 0;
  transition: color 0.3s ease, transform 0.45s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 10px rgba(179, 156, 255, 0.75);
  opacity: 0;
  transform: translateY(4px) scale(0.5);
  transition: opacity 0.3s ease, transform 0.45s var(--ease);
}
.nav__links a:hover { color: var(--text); transform: translateY(-2px); }
.nav__links a:hover::after { opacity: 1; transform: none; }

.nav__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  transition: color 0.3s ease, gap 0.3s ease;
}
.nav__back:hover { color: var(--text); gap: 12px; }
.nav__back span.arrow { font-size: 14px; }

/* mobile nav */
@media (max-width: 760px) {
  .nav__links a:not(.nav__back) { display: none; }
  .nav__links { gap: 16px; }
}

/* ============================================================
   SHARED LAYOUT
   ============================================================ */
.section {
  padding: clamp(72px, 11vw, 150px) var(--pad);
  position: relative;
}
.section--tight { padding-top: clamp(48px, 7vw, 96px); }

.inner {
  max-width: 1320px;
  margin: 0 auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad);
  flex: none;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head h2 {
  margin: 10px 0 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(25px, 3.4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.section-head .note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-faint);
  text-align: right;
  max-width: 280px;
  flex: none;
}
/* 小屏：标题与说明上下堆叠，避免撑宽页面 */
@media (max-width: 760px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-head .note { text-align: left; max-width: 100%; }
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--grad);
  z-index: 600;
  transition: width 0.12s linear;
}

/* ============================================================
   HERO (home)
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: calc(var(--nav-h) + 24px) var(--pad) clamp(36px, 6vw, 72px);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(110% 100% at 72% 20%, #131623 0%, #090a10 45%, #060608 100%);
}

/* 首页封面图：图片白角已在素材层裁掉，全屏铺满；上下边缘蒙版渐隐，与页面背景自然过渡 */
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.005);
  animation: heroZoom 2.4s var(--ease) both;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 84%, transparent 100%);
}

@keyframes heroZoom {
  from { transform: scale(1.06); }
  to { transform: scale(1.005); }
}

.hero__scroll {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 44px auto 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero__scroll i {
  display: block;
  width: 54px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}
.hero__scroll i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad);
  transform: translateX(-100%);
  animation: scrollLine 2.6s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}



/* ============================================================
   ABOUT
   ============================================================ */
.about {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(70% 50% at 85% 0%, rgba(95, 123, 255, 0.12), transparent 70%),
    var(--bg);
}

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

.about__lead {
  margin: 0 0 40px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.about__lead em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about__intro {
  max-width: 620px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 2;
  margin: 0 0 48px;
}

.cv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 48px;
}
.cv__block h3 {
  margin: 0 0 18px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cv__block h3::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.cv__item {
  position: relative;
  padding: 0 0 20px 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cv__item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.cv__item .t {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.cv__item .s {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-faint);
}
.cv__item .time {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.tags span:hover { border-color: var(--line-strong); color: var(--text); }

.about__portrait {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}
.about__portrait figure {
  margin: 0;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.about__portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
}
.about__portrait figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 6, 8, 0.65), transparent 45%);
  pointer-events: none;
}
.about__portrait figcaption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
}
.about__portrait figcaption small {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}
.about__portrait .side-note {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { position: static; max-width: 340px; }
  .cv { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================================
   CATALOG
   ============================================================ */
.catalog {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  position: relative;
}

/* ============================================================
   目录：悬挂卡片（Framer 风 — 摆动 / 3D 倾斜 / 全息反光 / 翻转）
   ============================================================ */
.hanglist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 4.5vw, 64px) clamp(24px, 3vw, 44px);
  perspective: 1400px;
}

.hang {
  display: block;
  transition: transform 0.35s ease-out;
  will-change: transform;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

/* 摆动层：绕顶部挂点轻微摇摆（preserve-3d 保证翻转/背面裁切在链路上不断裂） */
.hang__swing {
  transform-origin: 50% -26px;
  animation: hangSway 5.8s ease-in-out infinite;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.hang:nth-child(3n + 2) .hang__swing { animation-duration: 6.7s; animation-delay: -2.2s; }
.hang:nth-child(3n) .hang__swing { animation-duration: 7.4s; animation-delay: -4.1s; }
.hang:nth-child(2n) .hang__swing { animation-direction: reverse; }
@keyframes hangSway {
  0%, 100% { transform: rotate(-1.1deg); }
  50% { transform: rotate(1.1deg); }
}

/* 挂绳 */
.hang__string {
  display: block;
  width: 1px;
  height: 34px;
  margin: 0 auto;
  background: linear-gradient(to bottom, transparent, var(--line-strong));
  position: relative;
}
.hang__string i {
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 8px rgba(179, 156, 255, 0.6);
}

/* 卡片翻转容器 */
.hang__card {
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.85s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .hang:hover .hang__card { transform: rotateY(180deg); }
}

.hang__face {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
}
.hang__face--front { position: relative; }
.hang__face--back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg) translateZ(0.5px);
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  padding: 26px 24px;
  background: linear-gradient(150deg, #15151f 0%, #0d0d14 70%);
}
.hang__face--back h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}
.hang__meta {
  margin: 0;
  font-size: 11.5px;
  line-height: 2;
  color: var(--text-dim);
}
.hang__enter {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-3);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  width: 100%;
}

/* 封面缩略图：16:9 与原图同比例 + 内边距，文字完整不裁切 */
.hang__thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 10px 10px 0;
  border-radius: 12px;
}
.hang__thumb img {
  width: 100%;
  height: 100%;
  /* 完整显示封面，文字不被裁切 */
  object-fit: contain;
  background: #0b0b10;
  transition: transform 0.9s var(--ease);
}
.hang:hover .hang__thumb img { transform: scale(1.05); }

.hang__info { padding: 16px 18px 18px; }
.hang__info h3 {
  margin: 6px 0 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hang__info p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-faint);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hang__no {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.hang__face--back .hang__no { color: var(--accent-3); }

/* 全息反光：跟随鼠标的径向亮斑 + 彩虹斜向光泽 */
.hang__glare {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 18px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background:
    radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.17), transparent 55%),
    linear-gradient(115deg, transparent 32%, rgba(179, 156, 255, 0.1) 46%, rgba(95, 123, 255, 0.13) 54%, transparent 68%);
  background-position:
    0 0,
    calc((var(--mx, 50%) - 50%) * 1.6) 0;
  mix-blend-mode: screen;
  transform: translateZ(1px);
}
.hang:hover .hang__glare { opacity: 1; }
/* 背面同样跟随光标的全息亮斑（变量设在 .hang 上，正反两面共用） */
.hang__face--back::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.15), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.hang:hover .hang__face--back::after { opacity: 1; }

@media (max-width: 1080px) {
  .hanglist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hanglist { grid-template-columns: 1fr; }
  .hang__swing { animation: none; }
}

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding: clamp(64px, 9vw, 120px) var(--pad) clamp(40px, 6vw, 70px);
}
.contact__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(90% 100% at 50% 120%, #10131c 0%, #07070b 60%, #060608 100%);
}
.contact__bg::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -42%;
  width: 76vw;
  height: 76vw;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(139, 124, 255, 0.28) 0%, rgba(60, 70, 120, 0.18) 35%,
      #060608 68%);
  filter: blur(10px);
}
.contact__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 60% at 25% 40%, rgba(6, 6, 8, 0.75), transparent 75%);
}

.contact__inner {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 0 auto;
}
.contact__sub {
  margin: 22px 0 0;
  color: var(--text-dim);
  font-size: 13.5px;
  letter-spacing: 0.06em;
}

.contact__links {
  margin-top: clamp(36px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.contact__link .k {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact__link .v {
  margin-top: 8px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(17px, 2vw, 24px);
  word-break: break-all;
  transition: color 0.3s ease;
}
a.contact__link:hover .v { color: var(--accent-3); }

.footer {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: clamp(56px, 8vw, 100px) auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--text-faint);
}
.footer p { margin: 0; }

@media (max-width: 760px) {
  .contact__links { grid-template-columns: 1fr; gap: 20px; }
  .footer { flex-direction: column; }
}

/* ============================================================
   PROJECT PAGE — HERO
   封面图直接做 hero 背景（和设计稿封面一模一样），文字叠加
   ============================================================ */
.phero {
  position: relative;
  min-height: 92svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: calc(var(--nav-h) + 24px) var(--pad) clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
.phero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.phero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
}

.phero__inner {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}
.phero__grid {
  max-width: 1020px;
}
.phero h1 {
  margin: 14px 0 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(42px, 5.8vw, 92px);
  line-height: 1.02;
  letter-spacing: -0.018em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.2);
  max-width: 16ch;
}
.phero__sub {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25);
}
.phero .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.pmeta {
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.pmeta__item .k {
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.pmeta__item .v {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

/* 封面图自带标题：hero 只展示封面图，不再叠加文字；
   深色页用圆角深色面板遮罩导出图自带的杂色角（与画廊 slide 一致） */
.phero--bare {
  min-height: 0;
  padding: calc(var(--nav-h) + clamp(16px, 3vh, 32px)) var(--pad) 0;
  display: block;
  border-bottom: none;
}
.phero--bare .phero__bg {
  position: relative;
  inset: auto;
  z-index: 0;
  max-width: 1320px;
  margin: 0 auto;
  border-radius: clamp(12px, 1.6vw, 22px);
  overflow: hidden;
  background: #0d0d12;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}
.phero--bare .phero__bg img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transform: none;
}

/* 封面下方的 meta 栏：吸附成与顶部导航同款的高斯模糊条 */
.pmeta-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 440;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  background: rgba(6, 6, 8, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.pmeta-bar .pmeta {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  gap: clamp(20px, 3.6vw, 60px);
}
.pmeta-bar .pmeta__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.pmeta-bar .pmeta__item .k {
  flex: none;
  font-size: 9px;
  line-height: 1.4;
  color: var(--text-faint);
}
.pmeta-bar .pmeta__item .v {
  margin-top: 0;
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 980px) {
  .pmeta-bar .pmeta__item:nth-child(3) { display: none; }
}
@media (max-width: 720px) {
  .pmeta-bar .pmeta__item:nth-child(2) { display: none; }
}
html.theme-light .pmeta-bar {
  background: rgba(255, 255, 255, 0.78);
  border-bottom-color: rgba(30, 28, 24, 0.1);
}
html.theme-light .pmeta-bar .pmeta__item .k { color: rgba(26, 24, 20, 0.45); }
html.theme-light .pmeta-bar .pmeta__item .v { color: rgba(26, 24, 20, 0.8); }

@media (max-width: 760px) {
  .phero { min-height: 84svh; }
  .phero--bare { min-height: 0; }
  .pmeta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
}
@media (max-width: 900px) {
  .phero h1 { max-width: none; }
}

/* ============================================================
   PROJECT PAGE — DECK / GALLERY
   ============================================================ */
.deck-section {
  position: relative;
  padding: clamp(28px, 4vw, 48px) 0 0;
  background: var(--bg);
}

.deck-head {
  max-width: 1320px;
  margin: 0 auto clamp(16px, 2vw, 26px);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.deck-head .left {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.deck-head .left i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--grad);
}
.deck-head .hint {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.deck-head .hint kbd {
  font-family: var(--sans);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-dim);
}
@media (max-width: 640px) {
  .deck-head .hint { display: none; }
}

.deck {
  position: relative;
  /* 预留 nav(64) + 封面吸附条(64) 两层高度：吸附条出现时画廊不会被遮挡 */
  height: calc(100svh - var(--nav-h) - var(--nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: auto;
  /* 原生滚动条隐藏，改用自定义 .deck-rail */
  scrollbar-width: none;
  -ms-overflow-style: none;
    background:
    radial-gradient(50% 40% at 50% 0%, rgba(95, 123, 255, 0.06), transparent 70%),
    #08080b;
  border-top: 1px solid var(--line);
}
.deck::-webkit-scrollbar { display: none; }

/* 画廊自定义滚动轨：固定在右侧，可拖拽/点击快速跳转 */
.deck-rail {
  position: fixed;
  right: 6px;
  top: calc(var(--nav-h) + var(--nav-h) + 6px);
  bottom: 8px;
  width: 6px;
  z-index: 430;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}
.deck-rail__thumb {
  width: 100%;
  min-height: 36px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent-3), var(--accent-2));
  cursor: grab;
  touch-action: none;
  transition: width 0.2s ease;
}
.deck-rail__thumb:active { cursor: grabbing; }
.deck-rail:hover { width: 8px; }
html.theme-light .deck-rail { background: rgba(30, 28, 24, 0.1); }
@media (max-width: 760px) { .deck-rail { display: none; } }

.slide {
  position: relative;
  height: calc(100svh - var(--nav-h) - var(--nav-h));
  min-height: 420px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  /* 纵向布局：页码独占一行在画面上方，不再与图框圆角重叠 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(14px, 2.6vh, 30px) clamp(16px, 4vw, 56px);
}

/* dark rounded panel that contains the slide image — masks original white corners */
.slide::before {
  content: "";
  position: absolute;
  left: clamp(16px, 4vw, 56px);
  right: clamp(16px, 4vw, 56px);
  top: clamp(18px, 3.4vh, 40px);
  bottom: clamp(18px, 3.4vh, 40px);
  border-radius: clamp(12px, 1.6vw, 22px);
  background: #0d0d12;
  z-index: 0;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.slide__frame {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(1180px, 88vw);
  max-height: calc(100svh - var(--nav-h) - var(--nav-h) - clamp(36px, 6.8vh, 80px));
  width: calc(100% - 20px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: clamp(12px, 1.6vw, 22px);
  background: #0d0d12;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.slide__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.8s var(--ease);
}
.slide.is-active .slide__frame img { transform: scale(1.004); }
.slide__frame img:hover { transform: scale(1.012); }

.slide__no {
  position: static;
  align-self: flex-start;
  flex: none;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.3);
  font-variant-numeric: tabular-nums;
  z-index: 2;
  pointer-events: none;
}
.slide__no b {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
}

/* 移动端：整屏一屏一图改为内容高度连续流，只留小间隙，提高信息密度 */
@media (max-width: 820px) {
  .deck { scroll-snap-type: none; }
  .slide {
    height: auto;
    min-height: 0;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    justify-content: flex-start;
    gap: 6px;
    padding: 14px 10px;
  }
  .slide::before { display: none; }
  .slide__frame {
    width: 100%;
    max-width: none;
    max-height: none;
    border-radius: 10px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
  }
  .slide__no { align-self: flex-start; margin-left: 4px; }
  /* 浅色页：图片改为文档流，避免帧高度塌陷导致叠屏 */
  html.theme-light .slide__frame { overflow: hidden; border-radius: 10px; }
  html.theme-light .slide__frame img { position: static; }
}

/* deck controls */
.deck-ui {
  position: fixed;
  right: clamp(12px, 2.4vw, 30px);
  bottom: clamp(18px, 3vh, 34px);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 10, 14, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s var(--ease), bottom 0.5s var(--ease);
}
.deck-ui.is-on { opacity: 1; transform: none; pointer-events: auto; }
body:has(.filmstrip.is-on) .deck-ui { bottom: clamp(132px, 17vh, 172px); }

.deck-ui button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: background 0.3s ease, color 0.3s ease;
}
.deck-ui button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.deck-ui button:disabled { opacity: 0.25; cursor: default; }

.deck-counter {
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.deck-counter b { font-weight: 400; color: #fff; }

.deck-progress {
  position: relative;
  width: 52px;
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  overflow: hidden;
}
.deck-progress i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--grad);
  transition: width 0.25s ease;
}

/* filmstrip */
.filmstrip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 350;
  padding: 14px clamp(12px, 2.4vw, 30px) 16px;
  background: rgba(8, 8, 11, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.6s var(--ease);
}
.filmstrip.is-on { transform: none; }
/* 缩略图展开时：隐藏底部控制条与回顶按钮，避免与缩略图重叠误触 */
body.has-strip .deck-ui,
body.has-strip .to-top {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.filmstrip__track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.filmstrip__track::-webkit-scrollbar { display: none; }
.filmstrip__item {
  flex: 0 0 auto;
  width: clamp(72px, 9vw, 116px);
  border: 1px solid transparent;
  opacity: 0.4;
  transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  background: #111;
  padding: 0;
}
.filmstrip__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.filmstrip__item:hover { opacity: 0.85; transform: translateY(-2px); }
.filmstrip__item.is-active {
  opacity: 1;
  border-color: rgba(139, 124, 255, 0.75);
}
.filmstrip__close {
  position: absolute;
  right: 18px;
  top: -38px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 10, 14, 0.9);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 3, 5, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding: clamp(16px, 4vw, 48px);
}
.lightbox.is-on { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 100%;
  max-height: calc(100svh - 120px);
  object-fit: contain;
  border-radius: clamp(8px, 0.9vw, 14px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  transform: scale(0.97);
  transition: transform 0.5s var(--ease);
}
.lightbox.is-on img { transform: scale(1); }

.lightbox__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}
.lightbox__bar .nav-btns { display: flex; gap: 8px; }
.lightbox__bar button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.lightbox__bar button:hover { border-color: var(--line-strong); color: #fff; }
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.lightbox__close:hover { color: #fff; border-color: var(--line-strong); }

/* next project */
.next-project {
  border-top: 1px solid var(--line);
  padding: clamp(56px, 9vw, 110px) var(--pad);
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
  /* 末尾页撑满一屏：内容垂直居中，滚动到底时正好定格 */
  min-height: calc(100svh - var(--nav-h) - var(--nav-h) - 61px);
  display: flex;
  align-items: center;
}
.next-project a {
  display: block;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}
.next-project .k {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.next-project h2 {
  margin: 14px 0 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(28px, 4.4vw, 58px);
  line-height: 1.2;
  transition: color 0.4s ease;
}
.next-project a:hover h2 { color: var(--accent-3); }
.next-project .arrow {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: gap 0.4s var(--ease);
}
.next-project a:hover .arrow { gap: 18px; }

/* project footer */
.pfoot {
  padding: 26px var(--pad) 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 640px) {
  .pfoot { flex-direction: column; gap: 8px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  .deck { scroll-snap-type: y proximity; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ============================================================
   LIGHT THEME — 微信游戏 & 集换卡 & 住这儿 (万科系)
   封面图自带暖/绿浅底，gallery 用通廊式白背景直接显示图片
   （图片本身就是完整的设计稿，不需要额外面板叠层）
   ============================================================ */
html.theme-light {
  --bg: #ffffff;
  --bg-soft: #f8f7f4;
  --bg-elev: #ffffff;
  --line: rgba(30, 28, 24, 0.08);
  --line-strong: rgba(30, 28, 24, 0.18);
  --text: #1a1814;
  --text-dim: rgba(26, 24, 20, 0.62);
  --text-faint: rgba(26, 24, 20, 0.34);
  --grad: linear-gradient(100deg, #d97840 0%, #c15b28 55%, #8f3e18 100%);
}
html.theme-light body::after { opacity: 0.03; }

/* phero 背景：图片直接铺，文字叠加 */
html.theme-light .phero__bg img { filter: none; }
html.theme-light .phero h1 {
  color: var(--text);
  text-shadow: none;
  -webkit-text-stroke: 0;
}
html.theme-light .phero__sub {
  color: rgba(26, 24, 20, 0.7);
  text-shadow: none;
}
html.theme-light .phero .eyebrow { color: rgba(26, 24, 20, 0.45); }
html.theme-light .pmeta { border-top-color: rgba(30, 28, 24, 0.12); }
html.theme-light .pmeta__item .k { color: rgba(26, 24, 20, 0.45); }
html.theme-light .pmeta__item .v { color: rgba(26, 24, 20, 0.8); }

/* 浅色页封面：纯白通廊，不要面板/圆角/阴影 */
html.theme-light .phero--bare .phero__bg {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}


/* Next Project 标题：逐字渐变扫过 + 波浪上浮 */
.next-project h2 .ch {
  display: inline-block;
  background-image: var(--grad);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  transition: background-position 0.55s var(--ease), transform 0.45s var(--ease), color 0.3s ease;
  transition-delay: calc(var(--i) * 26ms);
  will-change: transform;
}
.next-project a:hover h2 .ch,
.next-project a:focus-visible h2 .ch {
  background-position: 0 0;
  color: transparent;
  transform: translateY(-5px);
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 36px);
  bottom: clamp(96px, 13vh, 132px);
  z-index: 550;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 14, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s var(--ease), color 0.3s ease, border-color 0.3s ease;
}
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--text); border-color: var(--accent); }
html.theme-light .to-top { background: rgba(255, 255, 255, 0.75); }
html.theme-light .bot__pet { color: #5b48c8; }

/* 悬浮联系小宠物：与右下角一键置顶同列对齐（机器人 → 邮箱 → 电话 → 置顶，纵向一列） */
.bot {
  position: fixed;
  right: clamp(16px, 3vw, 36px);
  /* 与一键置顶同列：置顶按钮 44px + 间距 11px */
  bottom: calc(clamp(96px, 13vh, 132px) + 44px + 11px);
  z-index: 560;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.55s var(--ease);
}
.bot.is-on { opacity: 1; transform: none; pointer-events: auto; }

/* 宠物本体：极简线圈小猫，与置顶按钮同尺寸同右缘，点击展开微信二维码 */
.bot__pet {
  width: 44px;
  height: 44px;
  flex: none;
  /* 图形右侧留白 2px，负边距让线稿右缘与置顶按钮右缘重合 */
  margin-right: -2px;
  color: var(--accent-3);
  filter: drop-shadow(0 4px 14px rgba(139, 124, 255, 0.22));
  transition: color 0.3s ease;
}
.bot__pet-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  transition: transform 0.45s var(--ease);
  /* 常态：缓慢上下浮动 */
  animation: booFloat 3.8s ease-in-out infinite;
}
.bot__pet:hover .bot__pet-svg { transform: scale(1.08); }

/* Boo 小动作：浮动 / 眨眼 / Q 弹 / 星光闪烁 */
@keyframes booFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}
.boo-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: booBlink 5.4s ease-in-out infinite;
}
@keyframes booBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  93% { transform: scaleY(0.12); }
  96% { transform: scaleY(1); }
}
.boo-body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: booSquish 7.2s ease-in-out infinite;
}
@keyframes booSquish {
  0%, 87%, 100% { transform: scale(1, 1); }
  90% { transform: scale(1.09, 0.88); }
  93.5% { transform: scale(0.93, 1.08); }
  96.5% { transform: scale(1.03, 0.97); }
}
.boo-star {
  transform-box: fill-box;
  transform-origin: center;
  animation: booTwinkle 2.6s ease-in-out infinite;
}
@keyframes booTwinkle {
  0%, 100% { opacity: 0.9; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.3; transform: scale(0.65) rotate(25deg); }
}

/* 气泡：默认隐藏，用户 10s 无操作时从机器人左侧弹出 */
.bot__bubble {
  position: absolute;
  right: calc(100% + 12px);
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 14px 8px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(12, 12, 18, 0.84);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  white-space: nowrap;
  transform-origin: right center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(12px) scale(0.88);
  transition: opacity 0.3s ease, transform 0.5s var(--ease), visibility 0.3s;
}
.bot.is-nudge .bot__bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
}
.bot__bubble::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -5px;
  transform: rotate(45deg);
  border-right: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  background: rgba(12, 12, 18, 0.84);
}
/* 气泡弹出时，机器人做一个弹跳现身动画 */
@keyframes botPetNudge {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-9px) scale(1.08); }
  55% { transform: translateY(1px) scale(0.96); }
  78% { transform: translateY(-4px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}
.bot.is-nudge .bot__pet-svg { animation: botPetNudge 0.85s var(--ease) 0.05s, booFloat 3.8s ease-in-out infinite; }
.bot__msg {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
  /* 气泡弹出时文字轻微上下漂 */
  animation: booMsgBob 2.8s ease-in-out infinite;
}
@keyframes booMsgBob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -1.5px; }
}

/* 联系方式：与机器人同列纵向排列，44px 与置顶按钮对齐 */
.bot__link {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.25s ease, transform 0.25s var(--ease);
}
.bot__link svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}
.bot__link:hover { background: rgba(255, 255, 255, 0.07); transform: translateY(-1px); }
.bot__link:hover svg { transform: scale(1.1); }
.bot__link--mail,
.bot__link--tel { color: var(--accent-3); }

/* 悬浮 icon 时在左侧展开信息（纵向列右侧无空间） */
.bot__tip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 16, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateX(6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s var(--ease);
}
.bot__tip::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  transform: rotate(45deg);
  border-right: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  background: rgba(10, 10, 16, 0.94);
}
.bot__link:hover .bot__tip,
.bot__link:focus-visible .bot__tip { opacity: 1; transform: translateY(-50%); }

/* 点击宠物展开的微信二维码卡片 */
.bot__qr {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 198px;
  padding: 10px 10px 9px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(12, 12, 18, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.46);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s var(--ease), visibility 0.3s;
}
.bot.is-qr .bot__qr {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.bot__qr::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(12, 12, 18, 0.92);
}
.bot__qr-t {
  margin: 0 0 7px;
  font-size: 11.5px;
  line-height: 1.6;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}
.bot__qr-frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
}
.bot__qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.bot__qr-frame.is-missing img { display: none; }
.bot__qr-frame.is-missing::after {
  content: "把微信二维码放到 assets/portrait/wechat-qr.png";
  padding: 0 12px;
  font-size: 10px;
  line-height: 1.7;
  color: #55505f;
}

html.theme-light .bot__bubble {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(30, 28, 24, 0.14);
}
html.theme-light .bot__bubble::after {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(30, 28, 24, 0.14);
}
html.theme-light .bot__msg { color: var(--text); }
html.theme-light .bot__link:hover { background: rgba(30, 28, 24, 0.06); }
html.theme-light .bot__link--mail,
html.theme-light .bot__link--tel { color: #5b48c8; }
html.theme-light .bot__qr {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(30, 28, 24, 0.14);
  box-shadow: 0 20px 48px rgba(30, 28, 24, 0.16);
}
html.theme-light .bot__qr::after {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(30, 28, 24, 0.14);
}
html.theme-light .bot__qr-frame { border: 1px solid rgba(30, 28, 24, 0.1); }
html.theme-light .bot__tip {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(30, 28, 24, 0.14);
  color: #1a1814;
}
html.theme-light .bot__tip::after {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(30, 28, 24, 0.14);
}

@media (max-width: 560px) {
  .bot { gap: 2px; }
  .bot__pet { width: 64px; height: 64px; }
  .bot__bubble { padding: 8px 12px 7px; }
  .bot__msg { font-size: 11.5px; }
}

/* 首页封面窄屏适配：整图完整显示，素材已无白角，不留圆角卡片 */
@media (max-aspect-ratio: 16/9) {
  .hero__bg {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hero__bg img {
    width: min(100%, calc(100svh * 1.7778));
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    animation: none;
  }
  /* 窄屏：hero 不再强制整屏，高度贴合封面图，上下只留小空隙 */
  .hero {
    min-height: 0;
    justify-content: flex-start;
    padding-top: calc(var(--nav-h) + 8px);
    padding-bottom: 24px;
  }
  .hero__bg { position: relative; inset: auto; }
  .hero__scroll { display: none; }
}

/* gallery: 纯白通廊，slide 不要深色面板叠层 */
html.theme-light .deck {
  background: #ffffff;
  border-top: 1px solid rgba(30, 28, 24, 0.06);
}
html.theme-light .slide::before {
  background: transparent;
  box-shadow: none;
  border: none;
}
html.theme-light .slide__frame {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  aspect-ratio: auto;
  max-width: min(1320px, 92vw);
}
html.theme-light .slide__frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 0;
  transition: transform 0.4s ease;
}
html.theme-light .slide.is-active .slide__frame img { transform: none; }

html.theme-light .deck-ui {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(30, 28, 24, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}
html.theme-light .deck-ui button { color: var(--text-dim); }
html.theme-light .deck-ui button:hover { background: rgba(30, 28, 24, 0.06); color: var(--text); }
html.theme-light .deck-counter b { color: var(--text); }
html.theme-light .deck-progress { background: rgba(30, 28, 24, 0.14); }
html.theme-light .filmstrip { background: rgba(255, 255, 255, 0.95); border-top-color: rgba(30, 28, 24, 0.08); }
html.theme-light .filmstrip__item { background: #fff; border: 1px solid rgba(30, 28, 24, 0.08); }
html.theme-light .filmstrip__item.is-active { border-color: #c15b28; box-shadow: 0 0 0 1px #c15b28; }
html.theme-light .next-project { background: #f8f7f4; }
html.theme-light .next-project a:hover h2 { color: #c15b28; }
html.theme-light .pfoot { color: rgba(26, 24, 20, 0.4); }
html.theme-light .scroll-progress { background: linear-gradient(100deg, #d97840, #c15b28); }
html.theme-light .nav.is-scrolled { background: rgba(255, 255, 255, 0.88); border-bottom-color: rgba(30, 28, 24, 0.08); }
html.theme-light .nav__links a { color: rgba(26, 24, 20, 0.55); }
html.theme-light .nav__links a:hover { color: var(--text); }

/* 设计稿内的动效层：按 --x/--y/--w/--h 覆盖在原图对应区域，自动循环播放 */
.slide__frame .slide__anim {
  position: absolute;
  inset: auto;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  object-fit: contain;
  object-position: center;
  z-index: 2;
  pointer-events: none;
  transform: none;
  border-radius: 0;
  mix-blend-mode: normal;
}
.slide.is-active .slide__frame .slide__anim { transform: none; }
html.theme-light .slide__frame .slide__anim {
  width: var(--w);
  height: var(--h);
  object-fit: contain;
}
/* 壁纸动效：黑底盖住原静态图，圆角融入手机屏 */
.slide__frame .slide__anim--screen {
  mix-blend-mode: normal;
  background: #000;
  border-radius: 8% / 3.7%;
  overflow: hidden;
}
.slide__frame { isolation: isolate; }

/* 项目吸附条已由 .pmeta-bar 的 sticky 毛玻璃条实现 */

