/* ==========================================================================
   个人作品集 — 暗色科技感设计系统
   3D Designer / Rive Motion Designer Portfolio
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #0A0C14;          /* 午夜蓝黑（避免纯黑的死板，参考 2026 暗色珠宝色调趋势） */
  --bg-deep: #070910;     /* 更深一级，用于页面底部渐变 */
  --bg-soft: #0F131E;
  --panel: #131725;
  --text: #ECEDEF;
  --text-2: #B9BFC9;
  --text-3: #8A919B;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --accent: #8FD9C7;
  --accent-glow: rgba(143, 217, 199, .4);
  --indigo: #7A8BFF;      /* 辅助色：靛蓝光晕（hero 渐变同款） */

  --sans: 'Space Grotesk', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --serif: 'Instrument Serif', 'Noto Serif SC', Georgia, serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 全局氛围背景：午夜蓝基底 + 薄荷/靛蓝光晕，滚动时保持固定 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 720px at 84% -6%, rgba(143, 217, 199, .075), transparent 62%),
    radial-gradient(1000px 820px at -14% 16%, rgba(122, 139, 255, .10), transparent 62%),
    radial-gradient(1200px 900px at 50% 116%, rgba(122, 139, 255, .07), transparent 64%),
    linear-gradient(180deg, #0D1019 0%, var(--bg) 30%, var(--bg-deep) 66%, #0B0E17 100%);
}
/* 顶部细网格线：只在首屏附近可见，向下渐隐 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(130% 100% at 50% 0%, #000 25%, transparent 72%);
  mask-image: radial-gradient(130% 100% at 50% 0%, #000 25%, transparent 72%);
}

img, svg, video, canvas { display: block; max-width: 100%; }
ul { list-style: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #06120E; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border: 3px solid var(--bg); border-radius: 6px; }

a:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- 工具类 ---------- */
.container { max-width: 1700px; margin: 0 auto; padding: 0 clamp(24px, 4vw, 64px); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); font-weight: 500; }
.serif-i { font-family: var(--serif); font-style: italic; font-weight: 400; }

.section { padding: clamp(110px, 12vh, 170px) 0; scroll-margin-top: 80px; position: relative; z-index: 0; }

/* 各区块专属光晕：薄荷与靛蓝交替，制造纵深与呼吸感 */
.section::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
#about::before   { background: radial-gradient(1000px 620px at 6% 26%, rgba(143, 217, 199, .05), transparent 64%); }
#works::before   { background: radial-gradient(1100px 680px at 94% 12%, rgba(122, 139, 255, .06), transparent 64%); }
#gallery::before { background: radial-gradient(1200px 720px at 6% 30%, rgba(143, 217, 199, .055), transparent 64%); }
#skills::before  { background: radial-gradient(900px 560px at 50% 96%, rgba(143, 217, 199, .045), transparent 62%); }
#contact::before { background: radial-gradient(1100px 760px at 50% 112%, rgba(122, 139, 255, .085), transparent 68%); }

/* 分区标题栏 */
.section-bar {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: clamp(56px, 7vh, 90px);
}
.bar-index { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .2em; }
.bar-en   { font-family: var(--mono); font-size: 13px; color: var(--text-2); letter-spacing: .3em; }
.bar-line { flex: 1; height: 1px; background: var(--line); }
.bar-cn   { font-family: var(--mono); font-size: 13px; color: var(--text-3); letter-spacing: .3em; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 14px; letter-spacing: .12em;
  padding: 16px 30px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background .35s, border-color .35s, color .35s;
}
.btn-arr { transition: transform .35s var(--ease-out); }
.btn:hover .btn-arr { transform: translate(3px, -3px); }
.btn-solid { background: var(--text); color: var(--bg); }
.btn-solid:hover { background: var(--accent); }
.btn-line { border-color: var(--line-strong); color: var(--text); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { padding: 12px 22px; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* 滚动入场 */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 全局噪点 ---------- */
.noise {
  position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 导航栏 ---------- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid transparent;
  transition: background .4s, border-color .4s;
}
.site-nav.scrolled {
  background: rgba(10, 12, 20, .72);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-logo {
  display: flex; align-items: baseline; gap: 3px;
  font-weight: 700; font-size: 22px; letter-spacing: .02em;
  color: var(--text); text-decoration: none;
}
.nav-logo-r { font-size: 10px; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-links a:not(.btn) {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 15px; letter-spacing: .06em; color: var(--text-2); text-decoration: none;
  transition: color .3s;
}
.nav-links a:not(.btn):hover, .nav-links a.active { color: var(--text); }
.nav-index { font-size: 11px; color: var(--text-3); transition: color .3s; }
.nav-links a:hover .nav-index, .nav-links a.active .nav-index { color: var(--accent); }
.nav-burger { display: none; }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }

/* 视频缺失/加载失败时的兜底背景 */
.hero-fallback {
  position: absolute; inset: 0; background: var(--bg);
  transition: opacity 1.2s ease;
}
.hero-fallback::before,
.hero-fallback::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px);
}
.hero-fallback::before {
  width: 62vmax; height: 62vmax; left: -18vmax; top: -26vmax;
  background: conic-gradient(from 120deg at 50% 50%,
    rgba(143, 217, 199, .16), transparent 42%,
    rgba(122, 139, 255, .12) 62%, transparent 82%);
  animation: hero-drift 26s ease-in-out infinite alternate;
}
.hero-fallback::after {
  width: 54vmax; height: 54vmax; right: -20vmax; bottom: -24vmax;
  background: conic-gradient(from 300deg at 50% 50%,
    rgba(143, 217, 199, .10), transparent 45%,
    rgba(122, 139, 255, .08) 65%, transparent 85%);
  animation: hero-drift 30s ease-in-out infinite alternate-reverse;
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1.2s ease;
}
body.has-hero-video .hero-video { opacity: .5; }
body.has-hero-video .hero-fallback { opacity: 0; }

.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 12, 20, .62) 0%, rgba(10, 12, 20, .28) 45%, rgba(10, 12, 20, .9) 100%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(10, 12, 20, .55) 100%);
}

.hero-side {
  position: absolute; right: clamp(24px, 4vw, 64px); top: 50%; z-index: 2;
  transform: translateY(-50%); writing-mode: vertical-rl;
  font-size: 12px; letter-spacing: .4em; color: var(--text-3);
}

.hero-inner { position: relative; z-index: 2; padding: 130px 0 150px; }
.hero-kicker {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; letter-spacing: .32em; color: var(--text-3);
  margin-bottom: 30px;
}
.hero-kicker::before { content: ""; width: 36px; height: 1px; background: var(--accent); }

.hero-title {
  font-size: clamp(56px, 7.6vw, 132px);
  font-weight: 600; line-height: .98; letter-spacing: -.02em;
}
.hero-line { display: block; }
.hero-sub {
  margin-top: 34px; max-width: 560px;
  color: var(--text-2); font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.95; font-weight: 400;
}
.hero-cta { margin-top: 50px; display: flex; gap: 20px; flex-wrap: wrap; }

.hero-anim { opacity: 0; animation: hero-rise .9s var(--ease-out) forwards; }
.hero-title.hero-anim { animation-delay: .12s; }
.hero-sub.hero-anim { animation-delay: .32s; }
.hero-cta.hero-anim { animation-delay: .52s; }

.hero-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: 26px;
  padding: 26px clamp(24px, 4vw, 64px);
  border-top: 1px solid var(--line);
  background: rgba(10, 12, 20, .25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 12px; letter-spacing: .26em; color: var(--text-3);
}
.hero-scroll { display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.hero-scroll i {
  position: relative; width: 1px; height: 38px;
  background: var(--line-strong); overflow: hidden;
}
.hero-scroll i::after {
  content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%;
  background: var(--accent);
  animation: scroll-dot 2.2s cubic-bezier(.65, 0, .35, 1) infinite;
}
.hero-meta-line { flex: 1; height: 1px; background: var(--line); }

@keyframes hero-rise { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes hero-drift { to { transform: translate(10vmax, 7vmax) rotate(45deg); } }
@keyframes scroll-dot { 0% { top: -50%; } 100% { top: 100%; } }

/* ---------- ABOUT / 个人经历 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(340px, 480px) 1fr;
  gap: clamp(48px, 6vw, 110px);
  align-items: start;
}
.portrait-frame { position: relative; }
.portrait-img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
}
.portrait-img.hidden { display: none; }
.portrait-placeholder {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.portrait-placeholder::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 40% at 50% 18%, rgba(143, 217, 199, .07), transparent 70%);
}
.portrait-zy {
  font-family: var(--sans); font-weight: 700; font-size: clamp(72px, 6vw, 110px);
  letter-spacing: .04em; color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
}
.portrait-note { font-size: 11px; letter-spacing: .2em; color: var(--text-3); }
.media-tag {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 18px;
  background: rgba(10, 12, 20, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: .22em; color: var(--text-2);
}

.about-title {
  font-size: clamp(40px, 4.2vw, 68px);
  font-weight: 700; line-height: 1.28; letter-spacing: .01em;
}
.about-text {
  margin-top: 32px; max-width: 720px;
  display: grid; gap: 18px;
  color: var(--text-2); font-size: 17px; line-height: 2.05; font-weight: 400;
}
.about-contacts { margin-top: 40px; border-top: 1px solid var(--line); font-size: 14px; }
.about-contacts li {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.about-contacts li span:first-child { color: var(--text-3); letter-spacing: .2em; }
.about-contacts a { color: var(--text); text-decoration: none; transition: color .3s; }
.about-contacts a:hover { color: var(--accent); }
.about-body .btn { margin-top: 36px; }

/* 状态点（在线/可接单） */
.dot { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 10px rgba(143, 217, 199, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 217, 199, 0); }
}

/* 项目数据 */
.stats-row {
  margin-top: clamp(70px, 8vh, 110px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: clamp(36px, 4vh, 52px) clamp(24px, 2.6vw, 44px); border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat-num {
  display: flex; align-items: baseline; gap: 2px;
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(52px, 4.6vw, 84px); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-num::after { content: attr(data-suffix); color: var(--accent); font-size: .55em; font-weight: 500; }
.stat-label { display: block; margin-top: 12px; font-size: 12px; letter-spacing: .22em; color: var(--text-3); }

/* Rive 插槽 */
.rive-block { margin-top: clamp(56px, 6vh, 90px); }
.rive-body { display: flex; border: 1px solid var(--line); border-top: 0; background: var(--bg-soft); }

/* 右侧输入面板：真实输入框，直接点击输入，动画实时同步 */
.rive-login-panel {
  flex: 0 0 320px;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  padding: 28px 24px;
  border-left: 1px solid var(--line);
}
.rive-field { display: flex; flex-direction: column; gap: 8px; }
.rive-field-label { font-size: 11px; letter-spacing: .2em; color: var(--text-3); }
.rive-field-row { display: flex; gap: 8px; }
.rive-field-input {
  width: 100%; min-width: 0;
  padding: 12px 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px;
  font-family: var(--mono); font-size: 15px; letter-spacing: .04em;
  transition: border-color .25s, box-shadow .25s;
}
.rive-field-input::placeholder { color: var(--text-3); }
.rive-field-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(143, 217, 199, .1); }
.rive-eye-btn {
  flex: 0 0 auto; width: 46px;
  background: var(--bg); color: var(--text-2);
  border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; font-size: 15px; line-height: 1;
  transition: border-color .25s, color .25s;
}
.rive-eye-btn:hover { border-color: var(--accent); color: var(--accent); }
.rive-field-note { margin: 0; font-size: 12.5px; line-height: 1.9; letter-spacing: .06em; color: var(--text-3); }

.rive-stage {
  position: relative; overflow: hidden;
  flex: 1; min-width: 0;
  aspect-ratio: 21 / 9;
  background: var(--bg-soft);
}
.rive-block-head {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; letter-spacing: .18em; color: var(--text-3);
}
.rive-tag { color: var(--accent); display: flex; align-items: center; gap: 10px; }
.rive-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s infinite; }
.rive-hint { color: var(--text-3); text-align: right; }
#rive-canvas-1 { position: absolute; inset: 0; width: 100%; height: 100%; }
.rive-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  text-align: center; transition: opacity .5s;
  background:
    radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(55% 65% at 50% 50%, rgba(143, 217, 199, .05), transparent 72%);
}
.rive-placeholder-mark { font-size: 14px; letter-spacing: .3em; color: var(--text-2); }
.rive-placeholder p { font-size: 12.5px; line-height: 2.1; letter-spacing: .08em; color: var(--text-3); }
.rive-placeholder code { color: var(--accent); }
.rive-placeholder.hidden { opacity: 0; pointer-events: none; }

/* Rive 作品介绍（动画下方，改 index.html 里的文字即可） */
.rive-intro {
  margin-top: 30px;
  padding: 22px 28px;
  border-left: 2px solid var(--accent);
  background: linear-gradient(90deg, rgba(143, 217, 199, .06), transparent 70%);
}
.rive-intro-label { display: block; font-size: 11.5px; letter-spacing: .26em; color: var(--text-3); }
.rive-intro-text {
  margin-top: 10px; max-width: 900px;
  font-size: 16px; line-height: 2; letter-spacing: .03em; color: var(--text-2);
}


/* ---------- WORKS / 精选项目（纯文字列表） ---------- */
.works-list { display: flex; flex-direction: column; }

.work-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "idx titles side"
    "idx desc   side";
  column-gap: clamp(18px, 2.6vw, 44px);
  row-gap: 12px;
  align-items: start;
  padding: clamp(26px, 3.4vh, 42px) clamp(4px, .6vw, 12px);
  border-top: 1px solid var(--line);
  transition: padding-left .5s var(--ease-out), background .5s;
}
.work-row:last-child { border-bottom: 1px solid var(--line); }
.work-row:hover {
  padding-left: clamp(16px, 1.8vw, 30px);
  background: linear-gradient(90deg, rgba(143, 217, 199, .045), transparent 60%);
}
.work-row-index {
  grid-area: idx; padding-top: 6px;
  font-size: 13px; letter-spacing: .2em; color: var(--text-3);
  transition: color .3s;
}
.work-row:hover .work-row-index { color: var(--accent); }
.work-row-titles { grid-area: titles; min-width: 0; }
.work-title {
  font-size: clamp(23px, 2.1vw, 34px); font-weight: 600; letter-spacing: .01em;
  transition: color .3s;
}
.work-row:hover .work-title { color: var(--accent); }
.work-sub { display: block; margin-top: 8px; font-size: 11px; letter-spacing: .18em; color: var(--text-3); }
.work-desc {
  grid-area: desc; max-width: 760px;
  font-size: 16px; line-height: 2; letter-spacing: .03em; color: var(--text-2);
}
.work-row-side { grid-area: side; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.work-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.work-tags span {
  padding: 4px 11px; font-size: 11.5px; letter-spacing: .12em; color: var(--text-2);
  border: 1px solid var(--line);
  transition: border-color .3s, color .3s;
}
.work-row:hover .work-tags span { border-color: var(--line-strong); color: var(--text); }
.work-year { font-size: 12px; letter-spacing: .2em; color: var(--text-3); }
.works-more { margin-top: clamp(40px, 5vh, 60px); text-align: center; font-size: 12px; letter-spacing: .2em; color: var(--text-3); }

/* ---------- GALLERY / 作品展示（横向滑动 · 居中放大） ---------- */
.gallery { margin-top: clamp(24px, 3.5vh, 44px); }

.gallery-viewport {
  overflow: hidden;
  padding: 30px 0 10px;               /* 给放大后的投影留空间 */
  cursor: grab; touch-action: pan-y;  /* 手指横滑交给轮播，纵向仍可滚动页面 */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
}
.gallery-viewport.is-dragging { cursor: grabbing; }
.gallery-track {
  display: flex; align-items: center;
  gap: clamp(22px, 2.8vw, 48px);
  width: max-content;
  transition: transform .8s var(--ease-out);
  will-change: transform;
}
.gallery-track.is-dragging { transition: none; }

.gallery-item {
  flex: none;
  width: clamp(300px, 36vw, 640px);
  opacity: .3; transform: scale(.8);
  transition: transform .8s var(--ease-out), opacity .8s var(--ease-out);
  cursor: pointer; user-select: none; -webkit-user-drag: none;
}
.gallery-item.is-center { opacity: 1; transform: scale(1); cursor: zoom-in; }
.gallery-item.is-side   { opacity: .38; transform: scale(.82); }
.gallery-item.is-far    { opacity: .14; transform: scale(.74); }

.gallery-media {
  position: relative; overflow: hidden;
  /* 不加固定宽高比：盒子高度跟随作品图片的实际比例，各作品尺寸不一也互不影响 */
  background: var(--bg-soft);
  border: 1px solid var(--line);
  transition: border-color .5s, box-shadow .5s;
}
.gallery-item.is-center .gallery-media {
  border-color: var(--line-strong);
  box-shadow: 0 36px 100px rgba(0, 0, 0, .55), 0 0 70px rgba(143, 217, 199, .07);
}
/* 图片缺失（占位画面）时兜底 4/3；图片加载后盒子自动跟随图片原始比例 */
.gallery-item:has(.gallery-img.hidden) .gallery-media { aspect-ratio: 4 / 3; }
.gallery-img {
  display: block; position: relative; z-index: 1;
  width: 100%; height: auto;              /* 按原始比例显示，不裁切 */
  transition: transform 1s var(--ease-out);
  -webkit-user-drag: none; user-select: none;  /* 不触发浏览器原生图片拖拽，保证鼠标滑动可用 */
}
.gallery-item.is-center .gallery-media:hover .gallery-img { transform: scale(1.03); }
.gallery-img.hidden { display: none; }

/* 截图占位画面：点阵 + 渐晕 + 衬线大字，替换截图后自动被图片盖住 */
.gallery-ph {
  position: absolute; inset: 0; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background:
    radial-gradient(120% 95% at 50% 112%, rgba(143, 217, 199, .14), transparent 58%),
    linear-gradient(160deg, #161C2E 0%, #0C101E 60%, #11162A 100%);
}
.gallery-ph::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(72% 72% at 50% 46%, #000, transparent);
  mask-image: radial-gradient(72% 72% at 50% 46%, #000, transparent);
}
.gallery-ph-num {
  position: absolute; top: 14px; left: 16px;
  font-size: 12px; letter-spacing: .24em; color: var(--text-3);
}
.gallery-ph-label {
  font-size: clamp(30px, 3.2vw, 50px);
  color: rgba(255, 255, 255, .15);
  letter-spacing: .06em;
}
.gallery-ph-tag {
  padding: 5px 11px; font-size: 10.5px; letter-spacing: .26em; color: var(--text-3);
  border: 1px solid var(--line);
}

/* 作品文字描述（在作品下方，跟随轮播居中高亮） */
.gallery-cap { padding: 18px 8px 0; }
.gallery-cap-title {
  font-size: clamp(17px, 1.4vw, 22px); font-weight: 600;
  color: var(--text-2); transition: color .5s;
}
.gallery-item.is-center .gallery-cap-title { color: var(--accent); }
.gallery-cap-desc {
  margin-top: 8px; font-size: 14.5px; line-height: 1.9; letter-spacing: .03em;
  color: var(--text-3); transition: color .5s;
}
.gallery-item.is-center .gallery-cap-desc { color: var(--text-2); }

/* 轮播控制条 */
.gallery-ui { margin-top: 30px; display: flex; align-items: center; justify-content: center; gap: 26px; }
.gallery-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--text);
  background: rgba(10, 12, 20, .5);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: border-color .35s, color .35s, box-shadow .35s, opacity .35s;
}
.gallery-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 26px var(--accent-glow); }
.gallery-btn:disabled { opacity: .28; cursor: default; }
.gallery-count { min-width: 96px; text-align: center; font-size: 13px; letter-spacing: .28em; color: var(--text-2); }
.gallery-count i { font-style: normal; color: var(--text-3); margin: 0 8px; }
.gallery-current { color: var(--accent); }
.gallery-hint { margin-top: 16px; text-align: center; font-size: 11px; letter-spacing: .2em; color: var(--text-3); }

/* ---------- 灯箱（点击中间作品放大查看） ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 80px);
  background: rgba(5, 6, 10, .93);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s, visibility .4s;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; visibility: visible; }
body.lb-open { overflow: hidden; }
.lightbox-close {
  position: absolute; top: 26px; right: 30px; z-index: 3;
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--text);
  background: rgba(10, 12, 20, .6);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: border-color .3s, color .3s;
}
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-figure {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  max-width: min(1400px, 92vw); max-height: 88vh;
  transform: scale(.94);
  transition: transform .45s var(--ease-out);
}
.lightbox.open .lightbox-figure { transform: none; }
.lightbox-img {
  max-width: 100%; max-height: 76vh;
  object-fit: contain;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: 0 40px 140px rgba(0, 0, 0, .7);
}
.lightbox-ph {
  position: relative;
  width: min(1100px, 88vw); aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background:
    radial-gradient(120% 95% at 50% 112%, rgba(143, 217, 199, .14), transparent 58%),
    linear-gradient(160deg, #161C2E 0%, #0C101E 60%, #11162A 100%);
  border: 1px solid var(--line);
  box-shadow: 0 40px 140px rgba(0, 0, 0, .7);
}
/* hidden 属性优先于 display 声明，避免占位框在有图时残留 */
.lightbox-ph[hidden], .lightbox-img[hidden] { display: none; }
.lightbox-cap { text-align: center; max-width: 860px; font-size: 14.5px; line-height: 1.9; letter-spacing: .04em; color: var(--text-2); }
.lightbox-cap b { color: var(--accent); font-weight: 600; margin-right: 12px; letter-spacing: .1em; }

/* ---------- 跑马灯 ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 26px 0;
}
.marquee-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-set { display: flex; align-items: center; gap: 56px; padding-right: 56px; }
.marquee-set span {
  font-family: var(--sans); font-weight: 600; white-space: nowrap;
  font-size: clamp(40px, 4.6vw, 76px); letter-spacing: .02em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .22);
}
.marquee-set i { font-style: normal; font-size: 18px; color: var(--accent); opacity: .7; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- SKILLS / 个人优势 ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 2vw, 32px); }
.skill-card {
  position: relative;
  display: flex; flex-direction: column; min-height: 350px;
  padding: clamp(28px, 2.4vw, 40px);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  transition: transform .45s var(--ease-out), border-color .45s;
}
.skill-card:hover { transform: translateY(-6px); border-color: var(--accent-glow); }
.skill-index {
  position: absolute; top: 24px; right: 26px;
  font-size: 13px; letter-spacing: .2em; color: var(--text-3);
  transition: color .4s;
}
.skill-card:hover .skill-index { color: var(--accent); }
.skill-icon { width: 44px; height: 44px; margin-bottom: 30px; color: var(--text-2); transition: color .4s; }
.skill-icon svg { width: 100%; height: 100%; }
.skill-card:hover .skill-icon { color: var(--accent); }
.skill-title { font-size: 22px; font-weight: 600; letter-spacing: .01em; }
.skill-en { display: block; margin-top: 8px; font-size: 11.5px; letter-spacing: .22em; color: var(--text-3); }
.skill-desc { margin-top: 18px; flex: 1; color: var(--text-2); font-size: 15.5px; line-height: 1.95; font-weight: 400; }
.skill-tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags span {
  padding: 4px 10px; font-size: 11px; letter-spacing: .12em;
  color: var(--text-3); border: 1px solid var(--line);
}

/* 工具链 */
.toolchain {
  margin-top: clamp(56px, 6vh, 80px);
  display: flex; align-items: center; gap: 26px;
  padding: 26px clamp(24px, 2.6vw, 40px);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.toolchain-label { font-size: 12px; letter-spacing: .22em; color: var(--accent); white-space: nowrap; }
.toolchain-line { flex: 1; height: 1px; background: var(--line); }
.toolchain-items { font-size: 13px; letter-spacing: .16em; color: var(--text-2); }

/* ---------- CONTACT / 整屏收尾 ---------- */
.contact {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(110px, 12vh, 170px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 0;
  z-index: 0;
}
.contact::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 50% at 50% 100%, rgba(143, 217, 199, .08), transparent 70%);
}
.contact .container {
  position: relative; flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: clamp(60px, 8vh, 100px);
}
.contact-title {
  font-size: clamp(56px, 8.2vw, 144px);
  font-weight: 600; line-height: 1.02; letter-spacing: -.02em;
}
.contact-sub {
  margin-top: 28px; max-width: 640px;
  color: var(--text-2); font-size: clamp(16px, 1.25vw, 20px);
  font-weight: 400; line-height: 1.9;
}
.contact-email {
  margin-top: clamp(40px, 5vh, 64px); align-self: flex-start;
  display: inline-block;
  font-size: clamp(26px, 3.2vw, 56px); font-weight: 500; letter-spacing: .01em;
  color: var(--text); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size .6s var(--ease-out), color .3s;
}
.contact-email:hover { background-size: 100% 1.5px; color: var(--accent); }
.contact-arr { display: inline-block; font-size: .5em; color: var(--accent); transition: transform .4s var(--ease-out); }
.contact-email:hover .contact-arr { transform: translate(6px, -6px); }

.contact-grid {
  margin-top: clamp(60px, 8vh, 100px);
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 4vw, 64px);
  border-top: 1px solid var(--line);
  padding-top: clamp(32px, 4vh, 48px);
}
.contact-col { display: flex; flex-direction: column; gap: 12px; font-size: 14px; letter-spacing: .08em; }
.contact-col h4 { font-size: 12px; font-weight: 500; letter-spacing: .28em; color: var(--text-3); margin-bottom: 8px; }
.contact-col a, .contact-col span { color: var(--text-2); text-decoration: none; transition: color .3s; }
.contact-col a:hover { color: var(--accent); }
.contact-col a i { font-style: normal; color: var(--text-3); margin-left: 4px; }

.footer-bar {
  margin-top: clamp(48px, 6vh, 72px);
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px; letter-spacing: .18em; color: var(--text-3);
}
.footer-bar a { color: var(--text-3); text-decoration: none; transition: color .3s; }
.footer-bar a:hover { color: var(--accent); }
.footer-mid { letter-spacing: .28em; }

/* ---------- 入场错峰（stagger） ---------- */
.works-list .work-row:nth-child(2) { --reveal-delay: .05s; }
.works-list .work-row:nth-child(3) { --reveal-delay: .1s; }
.works-list .work-row:nth-child(4) { --reveal-delay: .15s; }
.works-list .work-row:nth-child(5) { --reveal-delay: .2s; }
.works-list .work-row:nth-child(6) { --reveal-delay: .25s; }
.skills-grid .skill-card:nth-child(2) { --reveal-delay: .08s; }
.skills-grid .skill-card:nth-child(3) { --reveal-delay: .16s; }
.skills-grid .skill-card:nth-child(4) { --reveal-delay: .24s; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-media { max-width: 440px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 1px solid var(--line); }
  .stat:nth-child(odd) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- 平板 / 小屏笔记本 ---------- */
@media (max-width: 900px) {
  .section { padding: 96px 0; }

  .nav-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 7px;
    width: 44px; height: 44px; padding: 8px;
    background: none; border: 0; cursor: pointer;
  }
  .nav-burger span { display: block; height: 1.5px; background: var(--text); transition: transform .35s; }
  .nav-burger.open span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .nav-burger.open span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

  .nav-links {
    position: fixed; top: 76px; left: 0; right: 0; z-index: 99;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 16px clamp(24px, 6vw, 48px) 32px;
    background: rgba(10, 12, 20, .96);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: opacity .35s, transform .35s;
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a:not(.btn) {
    flex-direction: row-reverse; justify-content: space-between;
    padding: 18px 0; width: 100%;
    font-size: 24px; border-bottom: 1px solid var(--line);
  }
  .nav-cta { margin-top: 24px; justify-content: center; }

  .hero-side { display: none; }
  .hero-meta span:last-child { display: none; }
  .about-media { max-width: 400px; }
  .work-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "idx titles" "idx desc" "side side";
  }
  .work-row-side { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
  .work-tags { justify-content: flex-start; }
  .toolchain { flex-direction: column; align-items: flex-start; gap: 18px; }
  .toolchain-items { line-height: 2; }
  .rive-block-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .rive-hint { text-align: left; }
  .rive-body { flex-direction: column; }
  .rive-login-panel { flex: none; border-left: 0; border-bottom: 1px solid var(--line); order: -1; }
  .rive-stage { aspect-ratio: 4 / 3; }

  /* 平板画廊：中间作品占一半屏宽，两侧留窥视 */
  .gallery-item { width: min(56vw, 430px); }
  .gallery-track { gap: clamp(18px, 3vw, 30px); }
}

/* ---------- 手机端重设计：留白呼吸感，内容不顶满屏幕 ---------- */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .section { padding: 84px 0; scroll-margin-top: 72px; }
  html { scroll-padding-top: 72px; }
  .section-bar { gap: 12px; margin-bottom: 44px; }
  .bar-index, .bar-en, .bar-cn { font-size: 12px; letter-spacing: .22em; }
  a, button, .gallery-item { -webkit-tap-highlight-color: transparent; }

  /* 导航 */
  .site-nav { height: 64px; padding: 0 20px; }
  .nav-logo { font-size: 20px; }
  .nav-links { top: 64px; padding: 10px 20px 26px; }
  .nav-links a:not(.btn) { font-size: 21px; padding: 15px 0; }
  .nav-cta { margin-top: 18px; }

  /* HERO：更紧凑的节奏，按钮不再通栏 */
  .hero { min-height: 100vh; min-height: 100svh; }
  .hero-inner { padding: 96px 0 120px; }
  .hero-kicker { font-size: 11px; letter-spacing: .26em; margin-bottom: 24px; }
  .hero-title { font-size: clamp(40px, 12.8vw, 56px); }
  .hero-sub { margin-top: 24px; font-size: 15.5px; line-height: 1.9; max-width: 460px; }
  .hero-cta { margin-top: 36px; gap: 12px; }
  .hero-cta .btn { width: auto; padding: 14px 24px; font-size: 13px; }
  .hero-meta { padding: 16px 20px; }
  .hero-scroll { font-size: 11px; letter-spacing: .22em; }
  .hero-scroll i { height: 30px; }
  /* 移动端降低背景光斑模糊半径，省 GPU */
  .hero-fallback::before, .hero-fallback::after { filter: blur(60px); }

  /* ABOUT：人物图收窄居中，文字行距收紧 */
  .about-media { max-width: 300px; margin: 0 auto; }
  .media-tag { font-size: 10px; padding: 10px 14px; }
  .about-title { font-size: clamp(30px, 8.8vw, 40px); line-height: 1.35; }
  .about-text { margin-top: 24px; gap: 14px; font-size: 15.5px; line-height: 1.95; }
  .about-contacts { margin-top: 30px; font-size: 13px; }
  .about-contacts li { padding: 13px 0; gap: 16px; }
  .about-body .btn { margin-top: 28px; padding: 14px 22px; font-size: 13px; }

  /* 数据：2×2 网格，数字收小 */
  .stat { padding: 26px 16px; }
  .stat-num { font-size: clamp(40px, 11vw, 52px); }
  .stat-label { margin-top: 8px; font-size: 10.5px; letter-spacing: .16em; }

  /* Rive：输入框 16px 防 iOS 聚焦缩放 */
  .rive-block { margin-top: 56px; }
  .rive-block-head { padding: 12px 14px; font-size: 11.5px; }
  .rive-login-panel { padding: 20px 16px; gap: 16px; }
  .rive-field-input { font-size: 16px; }
  .rive-field-note { font-size: 12px; }
  .rive-intro { margin-top: 22px; padding: 18px 16px; }
  .rive-intro-text { font-size: 14.5px; line-height: 1.9; }

  /* WORKS：单列排版，收紧间距 */
  .work-row {
    grid-template-columns: 1fr;
    grid-template-areas: "idx" "titles" "desc" "side";
    row-gap: 10px; padding: 24px 2px;
  }
  .work-row-index { padding-top: 0; }
  .work-title { font-size: clamp(19px, 5.6vw, 23px); }
  .work-desc { font-size: 14.5px; line-height: 1.9; }
  .work-row-side {
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 12px; margin-top: 4px;
  }
  .work-tags span { font-size: 10.5px; padding: 3px 9px; }
  .work-year { font-size: 11px; }
  .works-more { margin-top: 36px; font-size: 11px; }

  /* GALLERY：图片收窄，两侧露出相邻作品，呼吸感 */
  .gallery-viewport { padding: 20px 0 8px; }
  .gallery-track { gap: clamp(14px, 4vw, 22px); }
  .gallery-item { width: min(76vw, 320px); }
  .gallery-cap { padding: 14px 4px 0; }
  .gallery-cap-title { font-size: 16px; }
  .gallery-cap-desc { margin-top: 6px; font-size: 13px; line-height: 1.85; max-width: 92%; }
  .gallery-ui { margin-top: 22px; gap: 16px; }
  .gallery-btn { width: 44px; height: 44px; font-size: 15px; }
  .gallery-count { min-width: 76px; font-size: 12px; letter-spacing: .2em; }
  .gallery-hint { margin-top: 12px; font-size: 10px; letter-spacing: .14em; line-height: 1.9; }

  /* 跑马灯 */
  .marquee { padding: 18px 0; }
  .marquee-set { gap: 36px; padding-right: 36px; }
  .marquee-set span { font-size: clamp(30px, 9vw, 42px); }
  .marquee-set i { font-size: 14px; }

  /* SKILLS：卡片纵向节奏收紧 */
  .skills-grid { grid-template-columns: 1fr; gap: 14px; }
  .skill-card { min-height: 0; padding: 24px 22px; }
  .skill-index { top: 18px; right: 20px; }
  .skill-icon { width: 38px; height: 38px; margin-bottom: 20px; }
  .skill-title { font-size: 19px; }
  .skill-desc { margin-top: 12px; font-size: 14.5px; line-height: 1.9; }
  .skill-tags { margin-top: 16px; }
  .toolchain { margin-top: 40px; padding: 20px 16px; gap: 14px; }
  .toolchain-items { font-size: 12px; letter-spacing: .12em; line-height: 2.1; }

  /* CONTACT：邮箱可换行，纵向节奏收紧 */
  .contact { padding-top: 84px; }
  .contact-title { font-size: clamp(36px, 11.5vw, 46px); }
  .contact-sub { margin-top: 20px; font-size: 15px; line-height: 1.9; }
  .contact-email { margin-top: 32px; font-size: clamp(19px, 5.6vw, 24px); word-break: break-all; }
  .contact-grid { margin-top: 44px; gap: 26px; padding-top: 26px; }
  .contact-col { gap: 10px; font-size: 13px; }
  .contact-col h4 { font-size: 11px; }
  .footer-bar {
    flex-direction: column; text-align: center; gap: 10px;
    font-size: 11px; letter-spacing: .14em;
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
  }

  /* 灯箱 */
  .lightbox-close { top: 14px; right: 14px; width: 40px; height: 40px; font-size: 15px; }
  .lightbox-figure { gap: 12px; }
  .lightbox-cap { font-size: 13px; line-height: 1.8; }
}

/* ---------- 小屏手机（≤400px） ---------- */
@media (max-width: 400px) {
  .section-bar { flex-wrap: wrap; row-gap: 8px; }
  .bar-line { display: none; }
  .hero-title { font-size: 38px; }
  .about-media { max-width: 260px; }
  .gallery-item { width: 78vw; }
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .hero-anim { opacity: 1; transform: none; }
}
