/* ==========================================================================
   个人作品集样式 —— 深色底 + 粉紫渐变强调色
   ========================================================================== */

:root {
  --bg: #1a1a2e;
  --bg-card: #202038;
  --bg-card-hover: #262644;
  --text: #eaeaf2;
  --text-soft: #a8a8c0;
  --accent-1: #e94560;
  --accent-2: #c850c0;
  --gradient: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --radius: 18px;
  --nav-h: 68px;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 18px 42px rgba(233, 69, 96, 0.22), 0 8px 30px rgba(200, 80, 192, 0.18);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}

/* ==========================================================================
   顶部导航栏
   ========================================================================== */

.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  background: transparent;
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

/* 滚动后：半透明毛玻璃 */
.navbar.scrolled {
  background: rgba(26, 26, 46, 0.62);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.nav-container {
  width: min(1160px, 92%);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  gap: 2.2rem;
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-soft);
  padding: 0.3rem 0;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover,
.nav-link.active { color: var(--text); }

.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url('images/hero-bg.jpg') center / cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(26, 26, 46, 0.35) 0%,
      rgba(26, 26, 46, 0.55) 60%,
      rgba(26, 26, 46, 0.92) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 1.5rem;
}

.hero-greeting {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.hero-name {
  font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.15;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--text);
  opacity: 0.9;
  margin-bottom: 1.2rem;
}

/* 打字机效果 */
.hero-type {
  font-size: clamp(1.05rem, 2.6vw, 1.45rem);
  color: var(--text-soft);
  min-height: 1.9em;          /* 占住高度，避免打字时布局跳动 */
  margin-bottom: 2.4rem;
}

#typeText {
  font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.type-cursor {
  display: inline-block;
  width: 3px;
  height: 1.15em;
  margin-left: 5px;
  vertical-align: -0.18em;
  background: var(--accent-1);
  animation: cursorBlink 0.85s steps(1) infinite;
}

@keyframes cursorBlink {
  50% { opacity: 0; }
}

/* 全局星空粒子画布：固定在内容层之下、页面背景之上 */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-cta {
  display: inline-block;
  padding: 0.85rem 2.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: var(--gradient);
  background-size: 160% auto;
  box-shadow: 0 10px 26px rgba(233, 69, 96, 0.35);
  transition: background-position 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-cta:hover {
  background-position: right center;
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(233, 69, 96, 0.45);
}

/* 首屏淡入动画（逐项延迟） */
.fade-item {
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 0.9s ease forwards;
}
.fade-item:nth-child(1) { animation-delay: 0.15s; }
.fade-item:nth-child(2) { animation-delay: 0.35s; }
.fade-item:nth-child(3) { animation-delay: 0.55s; }
.fade-item:nth-child(4) { animation-delay: 0.75s; }
.fade-item:nth-child(5) { animation-delay: 0.95s; }

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* 向下滚动指示 */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  z-index: 1;
}

.hero-scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.7);
  animation: scrollHint 1.8s ease-in-out infinite;
}

@keyframes scrollHint {
  0%   { transform: translateY(0);    opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 0; }
}

/* ==========================================================================
   通用 Section
   ========================================================================== */

.section { padding: 110px 0; }

.section-head { text-align: center; margin-bottom: 3.5rem; }

.section-sub {
  display: inline-block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.6rem;
}

.section-title {
  font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.section-desc {
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto;
}

/* 滚动进入动画：淡入 + 上滑 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ==========================================================================
   作品集
   ========================================================================== */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.work-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.work-card:hover {
  transform: translateY(-10px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.work-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-card:hover .work-cover img { transform: scale(1.06); }

.work-info {
  padding: 1.4rem 1.5rem 1.6rem;
}

.work-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #ffd9e2;
  background: rgba(233, 69, 96, 0.18);
  border: 1px solid rgba(233, 69, 96, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  margin-bottom: 0.7rem;
}

.work-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.work-desc {
  font-size: 0.92rem;
  color: var(--text-soft);
}

/* ==========================================================================
   关于我
   ========================================================================== */

.about { background: rgba(255, 255, 255, 0.015); }

.about-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 4rem;
  align-items: center;
}

.about-avatar {
  position: relative;
  width: 100%;
  border-radius: 50%;
  padding: 6px;
  background: var(--gradient);
  box-shadow: var(--shadow-glow);
}

.about-avatar img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--bg);
}

.about-text .section-sub,
.about-text .section-title { margin-bottom: 0.6rem; }

.about-text p {
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.about-skills span {
  font-size: 0.85rem;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 80, 192, 0.4);
  color: #e7c8f0;
  background: rgba(200, 80, 192, 0.1);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.about-skills span:hover {
  background: rgba(233, 69, 96, 0.18);
  border-color: rgba(233, 69, 96, 0.55);
}

/* ==========================================================================
   联系方式
   ========================================================================== */

.contact-inner { text-align: center; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.4rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.contact-pill svg { color: var(--accent-1); flex: none; }

.contact-pill:hover {
  transform: translateY(-4px);
  border-color: rgba(233, 69, 96, 0.6);
  background: rgba(233, 69, 96, 0.1);
  box-shadow: 0 12px 28px rgba(233, 69, 96, 0.25);
}

/* button 形式的联系方式（微信，点击复制） */
button.contact-pill {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
  text-align: left;
}

.contact-pill.copied {
  border-color: rgba(82, 196, 128, 0.7);
  background: rgba(82, 196, 128, 0.12);
}
.contact-pill.copied svg { color: #52c480; }

/* ==========================================================================
   页脚
   ========================================================================== */

.footer {
  padding: 2.2rem 1rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.88rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.copyright-notice {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   作品详情页（projects/*.html 共用）
   ========================================================================== */

.project-hero {
  padding-top: calc(var(--nav-h) + 40px);
}

.project-hero img {
  width: min(1160px, 92%);
  margin: 0 auto;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.project-body {
  padding: 3.5rem 0 5rem;
  max-width: 820px;
}

.back-link {
  display: block;
  width: fit-content;
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-bottom: 2rem;
  transition: color 0.25s ease;
}
.back-link:hover { color: var(--accent-1); }

.project-body h1 {
  font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin: 0.4rem 0 1rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  padding-bottom: 1.8rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.project-meta strong { color: var(--text); font-weight: 500; }

.project-body .content p {
  color: var(--text-soft);
  margin-bottom: 1.2rem;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.project-nav a {
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.project-nav a:hover {
  border-color: rgba(233, 69, 96, 0.6);
  box-shadow: 0 8px 22px rgba(233, 69, 96, 0.2);
  transform: translateY(-2px);
}

/* 嵌入式作品演示（iframe） */
.embed-wrap { margin-bottom: 2.6rem; }

.work-embed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 76vh;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  background: #12121f;
}

.embed-tip {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  text-align: center;
}

/* ==========================================================================
   响应式
   ========================================================================== */

/* 平板：双列 */
@media (max-width: 1024px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 260px 1fr; gap: 2.5rem; }
}

/* 手机：单列 + 汉堡菜单 */
@media (max-width: 768px) {
  .section { padding: 80px 0; }

  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    width: min(78vw, 320px);
    height: calc(100vh - var(--nav-h));
    flex-direction: column;
    gap: 0.4rem;
    padding: 2rem 2.2rem;
    background: rgba(26, 26, 46, 0.85);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }

  .nav-menu.open { transform: translateX(0); }

  .nav-link { display: block; padding: 0.7rem 0; font-size: 1.05rem; }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    text-align: center;
  }
  .about-avatar { width: min(220px, 60%); margin: 0 auto; }
  .about-skills { justify-content: center; }
}

/* 手机：作品单列 */
@media (max-width: 640px) {
  .work-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* 减弱动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-item { animation: none; opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-scroll span { animation: none; }
  .type-cursor { animation: none; }
}
