/* ========================================
   myWebsite 全站样式
   设计系统参考 stormzhang.ai 骨架，规格见 AGENTS.md
   ======================================== */

/* Fonts（本地托管，index.html 已 preload） */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========================================
   CSS Variables（设计系统）
   ======================================== */

:root {
  --color-bg: #050510;
  --color-accent: #38f9d7;
  --color-blue: #60a5fa;
  --accent-rgb: 56, 249, 215;
  --blue-rgb: 96, 165, 250;
  --white-rgb: 230, 237, 243;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;

  --font-display: 'Space Grotesk', sans-serif;
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

main {
  display: block;
}

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

/* ========================================
   星云背景（body::after）+ 噪点纹理（body::before）
   ======================================== */

body::after {
  content: '';
  position: fixed;
  inset: -30%;
  width: 160%;
  height: 160%;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(25, 10, 60, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(10, 40, 60, 0.3) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 80%, rgba(15, 25, 50, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 90%, rgba(20, 15, 45, 0.25) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  animation: nebulaDrift 60s ease-in-out infinite alternate;
}

@keyframes nebulaDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(5%, -3%) scale(1.02); }
  66%  { transform: translate(-4%, 4%) scale(0.98); }
  100% { transform: translate(3%, -2%) scale(1.01); }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* 星空 canvas */
.starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   鼠标跟随光晕
   ======================================== */

.cursor-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(var(--accent-rgb), 0.06),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-glow.active {
  opacity: 1;
}

/* ========================================
   转动地球（首屏右侧，cobe 渲染）
   ======================================== */

.globe-canvas {
  position: absolute;
  right: -20%;
  top: 50%;
  transform: translateY(-50%);
  width: 800px;
  height: 800px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 30%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 30%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0) 100%);
}

@media (max-width: 1023px) {
  .globe-canvas {
    display: none;
  }
}

/* ========================================
   Hero 首屏
   ======================================== */

.section-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 8vw;
  padding-bottom: 10vh;
  z-index: 2;
  overflow: hidden;
  scroll-snap-align: start;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  max-width: 700px;
}

/* 主标题：名字，流动渐变文字 */
.hero-badge {
  font-family: var(--font-cn);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--color-accent), var(--color-blue), var(--color-accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradientFlow 6s linear infinite;
}

@keyframes gradientFlow {
  to { background-position: 200% center; }
}

/* 副标题：身份一句话 */
.hero-title {
  font-family: var(--font-cn);
  font-size: clamp(18px, 3.2vw, 32px);
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.4;
  margin-top: 24px;
}

/* 胶囊标签 */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 48px;
}

.hero-tag {
  font-family: var(--font-cn);
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 600;
  letter-spacing: 1px;
  padding: clamp(5px, 0.8vw, 8px) clamp(12px, 2vw, 20px);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 999px;
  color: rgba(var(--white-rgb), 0.85);
  background: rgba(var(--accent-rgb), 0.06);
}

/* 向下滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
}

.scroll-arrow {
  display: block;
  width: 14px;
  height: 14px;
  border-right: 2px solid rgba(var(--accent-rgb), 0.7);
  border-bottom: 2px solid var(--color-blue);
  transform: rotate(45deg);
  animation: arrowBounce 2s var(--ease-smooth) infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.6; }
  50%      { transform: rotate(45deg) translate(6px, 6px); opacity: 1; }
}

/* 首屏入场动画（整体上浮，避免与 .hero-badge 渐变动画的 animation-name 冲突） */
.hero-content {
  animation: heroFadeUp 0.9s var(--ease-smooth) both;
  animation-delay: 0.1s;
}

.scroll-hint {
  animation: heroFadeIn 0.9s var(--ease-smooth) both;
  animation-delay: 0.6s;
}

@keyframes heroFadeUp {
  0%   { opacity: 0; transform: translateY(25px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* ========================================
   页码导航点（左侧固定，移动端隐藏）
   ======================================== */

.page-nav {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-nav::before {
  content: '';
  position: absolute;
  left: calc((8px - var(--dot-w, 8px)) / 2);
  top: var(--dot-top, 0px);
  width: var(--dot-w, 8px);
  height: var(--dot-height, 8px);
  border-radius: var(--dot-br, 50%);
  background: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.2);
  pointer-events: none;
}

.page-dot {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--white-rgb), 0.15);
}

.page-dot span {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-cn);
  font-size: 12px;
  color: rgba(var(--white-rgb), 0.5);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.page-dot:hover span,
.page-dot:focus-visible span {
  opacity: 1;
}

.page-dot.active span {
  color: var(--color-accent);
}

@media (max-width: 767px) {
  .page-nav {
    display: none;
  }
}

/* ========================================
   内容区块通用（about/focus/works/contact）
   ======================================== */

.section-about,
.section-focus,
.section-works,
.section-contact {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
  padding: 18vh 24px 60px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* 顶部分隔光线 */
.section-about::before,
.section-focus::before,
.section-works::before,
.section-contact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(var(--accent-rgb), 0.12) 20%,
    rgba(var(--blue-rgb), 0.2) 50%,
    rgba(var(--accent-rgb), 0.12) 80%,
    transparent
  );
  box-shadow:
    0 0 20px 4px rgba(var(--accent-rgb), 0.05),
    0 0 60px 12px rgba(var(--blue-rgb), 0.03);
  pointer-events: none;
  z-index: 1;
}

/* 顶部辉光 */
.section-about::after,
.section-focus::after,
.section-works::after,
.section-contact::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: radial-gradient(ellipse 70% 100% at 50% 0%,
    rgba(var(--accent-rgb), 0.05) 0%,
    rgba(var(--blue-rgb), 0.025) 40%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.section-title {
  font-family: var(--font-cn);
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 500;
  letter-spacing: 2px;
  color: rgba(var(--accent-rgb), 0.7);
  margin-bottom: 52px;
  text-align: center;
}

/* 滚动 reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s var(--ease-reveal), transform 0.6s var(--ease-reveal);
}

.reveal.visible {
  opacity: 1;
  /* 结束态必须归位为 none：残留的 translateY(0) 会把 fixed 后代（二维码弹层）的包含块劫持住 */
  transform: none;
}

/* ========================================
   About：时间线 + 核心数据 + 一句话定位
   ======================================== */

.about-inner {
  max-width: 900px;
  width: 100%;
  margin: 40px auto auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}

/* 时间线 */
.timeline {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 700px;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.5s ease-out, transform 0.5s var(--ease-spring);
}

.timeline-node.show {
  opacity: 1;
  transform: scale(1);
}

.timeline-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.8);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.4), 0 0 16px rgba(var(--accent-rgb), 0.15);
  margin: 0 auto;
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: rgba(var(--accent-rgb), 0.6);
  letter-spacing: 2px;
}

.timeline-label {
  font-family: var(--font-cn);
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* 流星连线 */
.timeline-line {
  position: relative;
  flex: 1;
  height: 2px;
  margin: 0 -4px 36px;
}

.timeline-line::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.35), rgba(67, 233, 123, 0.15));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease-out;
}

.timeline-line.show::before {
  transform: scaleX(1);
}

.timeline-meteor {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -30px;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), rgba(var(--accent-rgb),0.8), #fff);
  box-shadow: 0 0 6px rgba(var(--accent-rgb),0.5), 0 0 12px rgba(var(--accent-rgb),0.2);
  opacity: 0;
}

.timeline-meteor.show {
  animation: meteorSweep 0.5s ease-out forwards;
}

@keyframes meteorSweep {
  0%   { left: -30px; opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* 核心数据 */
.about-stats {
  display: flex;
  justify-content: center;
  gap: 80px;
  width: 100%;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(90deg, var(--color-accent), var(--color-blue), var(--color-accent));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: logoShimmer 2s linear infinite;
}

@keyframes logoShimmer {
  to { background-position: 300% center; }
}

.stat-plus,
.stat-unit {
  font-size: 0.5em;
}

.stat-label {
  font-family: var(--font-cn);
  font-size: clamp(14px, 1.6vw, 16px);
  color: rgba(var(--white-rgb), 0.85);
  letter-spacing: 1px;
}

/* 一句话定位 */
.about-quote {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  line-height: 1.8;
  text-align: center;
  max-width: 600px;
  letter-spacing: 2px;
  color: rgba(var(--accent-rgb), 0.5);
  margin-top: 20px;
}

/* ========================================
   Focus：星座图（我在做什么）
   ======================================== */

.constellation {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 5 / 3;
}

/* SVG 连线 */
.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-line {
  stroke: rgba(var(--accent-rgb), 0.25);
  stroke-width: 1;
  filter: drop-shadow(0 0 2px rgba(var(--accent-rgb), 0.2));
}

@keyframes lineFlow {
  0%   { stroke-dashoffset: 16; }
  100% { stroke-dashoffset: 0; }
}

.constellation-line.flowing {
  stroke-dasharray: 8 8;
  animation: lineFlow 1.5s linear infinite;
}

/* 星座流星 — 扫过连线的高亮光痕 */
.constellation-meteor {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
}

.constellation-meteor.active {
  opacity: 1;
}

.constellation-meteor::before {
  content: '';
  position: absolute;
  top: -1px;
  right: 0;
  width: 200px;
  height: 2px;
  background: linear-gradient(to right,
    transparent,
    rgba(var(--accent-rgb), 0.06) 40%,
    rgba(255, 255, 255, 0.3) 75%,
    #fff
  );
}

.constellation-meteor::after {
  content: '';
  position: absolute;
  top: -2.5px;
  right: -2.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px #fff, 0 0 10px rgba(var(--accent-rgb), 0.5);
}

/* 星节点 */
.star-node {
  position: absolute;
  cursor: default;
  opacity: 0;
  transition: opacity 0.5s ease-out;
  z-index: 2;
  text-align: left;
  transform: translate(-3px, -3px);
}

.star-node.visible { opacity: 1; }

.star-0 { left: 50%; top: 5%; }
.star-1 { left: 88%; top: 32%; }
.star-2 { left: 70%; top: 88%; }
.star-3 { left: 30%; top: 88%; }
.star-4 { left: 12%; top: 32%; }

/* 星核 — 与背景星空呼应 */
.star-core {
  position: relative;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 0 0 12px;
  background: #fff;
  box-shadow: 0 0 2px #fff, 0 0 6px rgba(255, 255, 255, 0.4);
  animation: starTwinkle 3s ease-in-out infinite;
  transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;
}

.star-core::before,
.star-core::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.star-core::before {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.star-core::after {
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.star-core.flash {
  box-shadow: 0 0 6px #fff, 0 0 14px rgba(255, 255, 255, 0.5), 0 0 28px rgba(255, 255, 255, 0.15);
}

.star-core.flash::before,
.star-core.flash::after {
  opacity: 1;
}

.star-0 .star-core { animation-delay: 0s; }
.star-1 .star-core { animation-delay: -1.5s; }
.star-2 .star-core { animation-delay: -0.4s; }
.star-3 .star-core { animation-delay: -1.1s; }
.star-4 .star-core { animation-delay: -2.2s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.5; }
  20% { opacity: 0.9; }
  40% { opacity: 0.4; }
  60% { opacity: 1; }
  80% { opacity: 0.6; }
}

/* 星节点信息卡 */
.star-info {
  width: 210px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.star-node.show-info .star-info {
  opacity: 1;
  transform: translateY(0);
}

.star-0 .star-info {
  text-align: center;
  transform: translateX(-50%) translateY(8px);
  margin-left: 1.5px;
}

.star-0.show-info .star-info {
  transform: translateX(-50%) translateY(0);
}

.star-2 .star-info,
.star-3 .star-info {
  text-align: center;
  transform: translateX(-50%) translateY(8px);
}

.star-2.show-info .star-info,
.star-3.show-info .star-info {
  transform: translateX(-50%) translateY(0);
}

.star-4 .star-info {
  text-align: right;
  transform: translateX(-100%) translateY(8px);
  margin-left: -12px;
}

.star-4.show-info .star-info {
  transform: translateX(-100%) translateY(0);
}

.star-info h3 {
  font-family: var(--font-cn);
  font-size: 18px;
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  letter-spacing: 1px;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.star-node:hover .star-info h3 {
  color: rgba(var(--white-rgb), 1);
}

.star-info p {
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(var(--white-rgb), 0.55);
  transition: color 0.3s;
}

.star-node:hover .star-info p {
  color: var(--text-secondary);
}

/* ========================================
   Works：作品与工具卡片网格
   卡片沿用单强调色系（青/蓝），不引入第三种色相
   ======================================== */

.section-works .section-title {
  margin-bottom: 118px;
}

.works-inner {
  width: 100%;
  max-width: 1400px;
}

.works-grid {
  display: flex;
  justify-content: center;
  width: 100%;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.works-grid .work-card + .work-card {
  margin-left: 14px;
}

.works-grid .work-card:nth-child(1) { transform: translateZ(0); }
.works-grid .work-card:nth-child(2) { transform: translateZ(4px); }
.works-grid .work-card:nth-child(3) { transform: translateZ(8px); }

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 260px;
  flex-shrink: 0;
  padding: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(90deg, transparent, rgba(var(--glow-rgb), 0.2) 50%, transparent) top / 100% 2px no-repeat,
    rgba(var(--card-bg), var(--card-bg-a));
  border: 1px solid rgba(var(--glow-rgb), 0.25);
  color: inherit;
  text-align: left;
}

.work-card-1 { --glow-rgb: 56, 249, 215; --card-bg: 12, 54, 40; --card-bg-a: 0.25; --hover-bg: 16, 66, 50; --hover-bg-a: 0.6; }
.work-card-2 { --glow-rgb: 96, 165, 250; --card-bg: 16, 42, 76; --card-bg-a: 0.3;  --hover-bg: 20, 52, 92; --hover-bg-a: 0.65; }
.work-card-3 { --glow-rgb: 96, 165, 250; --card-bg: 12, 46, 72; --card-bg-a: 0.25; --hover-bg: 16, 56, 88; --hover-bg-a: 0.6; }

.work-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(var(--glow-rgb), 0.1) 45%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(var(--glow-rgb), 0.1) 55%,
    transparent 60%
  );
  background-size: 250% 100%;
  background-position: 200% 0;
  border-radius: 16px;
  pointer-events: none;
  z-index: 1;
  transition: none;
}

.work-card:hover::before {
  animation: cardSweep 0.6s ease-out forwards;
}

@keyframes cardSweep {
  from { background-position: 200% 0; }
  to { background-position: -50% 0; }
}

.work-card:hover {
  background:
    linear-gradient(90deg, transparent, rgba(var(--glow-rgb), 0.6) 50%, transparent) top / 100% 2px no-repeat,
    rgba(var(--hover-bg), var(--hover-bg-a));
  border-color: rgba(var(--glow-rgb), 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--glow-rgb), 0.08);
}

.work-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: rgba(var(--white-rgb), 0.85);
  margin-bottom: 14px;
  transition: color 0.45s var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-card h3::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgb(var(--glow-rgb));
  flex-shrink: 0;
}

.work-card:hover h3 {
  color: #fff;
}

.work-card p {
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.7;
  color: rgba(var(--white-rgb), 0.55);
  transition: color 0.45s var(--ease-smooth);
}

.work-card:hover p {
  color: var(--text-secondary);
}

/* 3D 景深交互（桌面端，JS 配合） */
.section-works .work-card {
  transition: transform 0.45s var(--ease-smooth), opacity 0.45s var(--ease-smooth), scale 0.45s var(--ease-smooth), filter 0.45s var(--ease-smooth), box-shadow 0.45s var(--ease-smooth);
}

.section-works .work-card.depth-active {
  transform: translateY(-18%) translateZ(80px) scale(1.12);
  z-index: 10;
  opacity: 1;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45), 0 0 30px rgba(var(--glow-rgb), 0.15);
  transition: all 0.5s var(--ease-spring);
}

.section-works .work-card:nth-child(odd).depth-active {
  transform: translateY(-18%) translateZ(80px) scale(1.12) rotate(-2.5deg);
}

.section-works .work-card:nth-child(even).depth-active {
  transform: translateY(-18%) translateZ(80px) scale(1.12) rotate(2.5deg);
}

.section-works .work-card.depth-active h3 { color: #fff; }
.section-works .work-card.depth-active p { color: var(--text-secondary); }

.section-works .work-card.depth-dimmed {
  opacity: 0.4;
  z-index: 1;
  scale: 0.95;
  filter: brightness(0.6);
  animation: none;
  transition: all 0.45s var(--ease-smooth);
}

/* 待机浮动 — 卡片错峰 */
.section-works .work-card-1 { animation: cardFloat 5s ease-in-out infinite; }
.section-works .work-card-2 { animation: cardFloat 4.5s ease-in-out infinite 0.8s; }
.section-works .work-card-3 { animation: cardFloat 5.5s ease-in-out infinite 1.6s; }

@keyframes cardFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

.work-card-cta {
  display: block;
  margin-top: 14px;
  font-family: var(--font-cn);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(var(--glow-rgb), 0.8);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease, color 0.3s ease;
  pointer-events: none;
}

.work-card.depth-active .work-card-cta {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ========================================
   Contact：联系方式
   ======================================== */

.section-contact {
  padding-top: 25vh;
  gap: 48px;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.9);
  outline-offset: 4px;
}

.contact-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
}

.section-contact .contact-item:nth-child(1) { animation: contactFloat 4s ease-in-out infinite; }
.section-contact .contact-item:nth-child(2) { animation: contactFloat 4.5s ease-in-out infinite 0.6s; }
.section-contact .contact-item:nth-child(3) { animation: contactFloat 3.8s ease-in-out infinite 1.2s; }

@keyframes contactFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.contact-item:hover {
  color: var(--color-accent);
  transform: translateY(-4px);
}

.contact-icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  background: rgba(var(--accent-rgb), 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.contact-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  pointer-events: none;
}

.contact-icon svg {
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.contact-item:hover .contact-icon {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.15);
  background: rgba(var(--accent-rgb), 0.06);
}

.contact-item:hover .contact-icon::after {
  animation: iconRipple 1.5s ease-out infinite;
}

@keyframes iconRipple {
  0% { inset: 0; border-color: rgba(var(--accent-rgb), 0.3); opacity: 1; }
  100% { inset: -14px; border-color: rgba(var(--accent-rgb), 0); opacity: 0; }
}

.contact-item:hover .contact-icon svg {
  opacity: 1;
}

.contact-item span {
  font-family: var(--font-cn);
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.contact-wechat-trigger {
  perspective: 800px;
}

/* 公众号二维码弹层：桌面悬停展开，移动端点击居中弹出 */
.contact-qrcode-popup {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) rotateX(-80deg);
  transform-origin: top center;
  padding: 16px;
  background-color: rgba(7, 11, 9, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.45s var(--ease-spring), visibility 0.35s ease;
  pointer-events: none;
  text-align: center;
  z-index: 20;
}

.contact-qrcode-popup img {
  display: block;
  border-radius: 8px;
  margin-bottom: 8px;
}

.contact-qrcode-popup span {
  font-size: 14px;
  color: var(--text-secondary);
}

.contact-wechat-trigger:hover .contact-qrcode-popup,
.contact-item.qr-open .contact-qrcode-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) rotateX(0);
  pointer-events: auto;
}

.contact-copy {
  margin-top: auto;
  padding-bottom: 40px;
  text-align: center;
  font-size: 14px;
  letter-spacing: 1px;
  background: linear-gradient(90deg, rgba(var(--white-rgb), 0.2), rgba(var(--accent-rgb), 0.4), rgba(var(--white-rgb), 0.2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: copyShimmer 4s linear infinite;
}

@keyframes copyShimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ========================================
   响应式（768 / 1023 / 1366 三档）
   ======================================== */

@media (min-width: 768px) and (max-width: 1366px) {
  .section-works .section-title {
    margin-bottom: 72px;
  }

  .works-inner {
    max-width: 900px;
  }

  .works-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 14px;
    align-items: stretch;
  }

  .works-grid .work-card {
    justify-self: center;
    width: 100%;
    max-width: 260px;
  }

  .works-grid .work-card + .work-card {
    margin-left: 0;
  }

  .constellation {
    max-width: 520px;
  }

  .star-info {
    width: 190px;
  }
}

@media (max-width: 767px) {
  /* 移动端关闭整屏 snap，改用自然滚动（与参考站一致） */
  html {
    scroll-snap-type: none;
  }

  .section-hero,
  .section-about,
  .section-focus,
  .section-works,
  .section-contact {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }

  .section-about,
  .section-focus,
  .section-works,
  .section-contact {
    min-height: auto;
  }

  .section-hero {
    padding: 0 24px;
    padding-bottom: 14vh;
  }

  .section-about {
    padding: 12vh 24px 60px;
  }

  /* 时间线移动端竖排 */
  .timeline {
    flex-direction: column;
    align-items: center;
  }

  .timeline-line {
    width: 2px;
    height: 40px;
    flex: none;
    margin: 0;
  }

  .timeline-line::before {
    transform-origin: top;
    transform: scaleY(0);
  }

  .timeline-line.show::before {
    transform: scaleY(1);
  }

  .timeline-label {
    font-size: 12px;
  }

  .timeline-meteor {
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 30px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.15), rgba(var(--accent-rgb),0.8), #fff);
  }

  .timeline-meteor.show {
    animation: meteorSweepV 0.5s ease-out forwards;
  }

  @keyframes meteorSweepV {
    0%   { top: -30px; opacity: 1; }
    85%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
  }

  .about-stats {
    flex-direction: column;
    align-items: center;
    gap: 36px;
  }

  .about-inner {
    gap: 48px;
  }

  /* 星座图移动端：转为竖排卡片列表（参考站同款） */
  .section-focus {
    padding: 12vh 20px 40px;
  }

  .constellation {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 0;
    width: 100%;
  }

  .constellation-lines,
  .constellation-meteor {
    display: none;
  }

  .star-node {
    position: static;
    transform: none;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(var(--accent-rgb), 0.02);
    border: 1px solid rgba(var(--accent-rgb), 0.06);
  }

  .star-core {
    flex-shrink: 0;
    margin: 6px 0 0;
  }

  .star-core::before,
  .star-core::after {
    display: none;
  }

  .star-info {
    opacity: 1 !important;
    transform: none !important;
    width: auto !important;
    flex: 1;
    text-align: left !important;
    margin-left: 0 !important;
  }

  .star-info h3 {
    font-size: 15px;
  }

  /* 作品卡片移动端：纵向全宽，关闭 3D（参考站同款） */
  .section-works .section-title {
    margin-bottom: 48px;
  }

  .works-grid {
    flex-direction: column;
    gap: 16px;
    perspective: none;
    transform-style: flat;
  }

  .work-card {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 24px 20px !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  .work-card-cta {
    display: none;
  }

  /* 联系区移动端：两列网格，二维码弹层锚定在被点按钮上（与参考站行为一致）。
     不加全屏遮罩：弹层打开时页面其余部分保持可操作；浮动动画保留（弹层随之浮动，
     absolute 定位不受包含块劫持影响） */

  /* 触屏上 hover 会粘在按钮上，桌面开合规则（rotateX 翻转）会与点击规则打架：
     移动端统一为同一锚定位置。弹层锚定按钮左缘向右展开（当前唯一弹层项在左列，
     屏幕内侧不会溢出；日后右列项加弹层时改用 right: 0 锚定） */
  .contact-wechat-trigger:hover .contact-qrcode-popup,
  .contact-item.qr-open .contact-qrcode-popup {
    left: 0;
    transform: translateY(0) scale(1);
  }

  /* 触屏粘滞 hover 会让按钮停在位移状态，关闭 */
  .contact-item:hover {
    transform: none;
  }

  .contact-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 16px;
    justify-items: center;
    width: 100%;
    max-width: 280px;
  }

  .contact-item span {
    font-size: 13px;
  }

  .contact-qrcode-popup {
    position: absolute;
    top: calc(100% + 16px);
    left: 0;
    transform: translateY(8px) scale(0.95);
    transform-origin: top left;
    z-index: 200;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }

  /* 被点图标保持点亮，明确「是它弹出来的」（不加遮罩，页面其余部分可正常操作） */
  .contact-item.qr-open {
    z-index: 201;
  }

  .contact-item.qr-open .contact-icon {
    border-color: rgba(var(--accent-rgb), 0.5);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
  }

  .contact-item.qr-open .contact-icon svg {
    opacity: 1;
  }

  .contact-item.qr-open > span {
    color: var(--color-accent);
  }
}

/* ========================================
   Reduced Motion：关闭星空动画与所有动效
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-content,
  .scroll-hint {
    opacity: 1;
    transform: none;
  }
}
