/* ===== 基础与变量 ===== */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(79, 70, 229, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.navbar.scrolled {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-dot {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links .nav-cta {
  color: #fff;
  background: var(--primary);
  padding: 8px 20px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-links .nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 168px 0 120px;
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 100%);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 48px;
}

.hero-greet {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.hero-name {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-role {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags li {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary-dark);
  background: #fff;
  border: 1px solid #dbe2ff;
  padding: 6px 16px;
  border-radius: 999px;
}

/* Hero 右侧插画 */
.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

.avatar-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 12px;
  background: conic-gradient(from 0deg, var(--primary), #22d3ee, var(--primary));
  box-shadow: var(--shadow-lg);
  animation: spin 12s linear infinite;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5.5rem;
  font-weight: 800;
  color: var(--primary);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.float-card {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 600;
  background: #fff;
  color: var(--text);
  padding: 10px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  animation: float 5s ease-in-out infinite;
}

.fc-1 {
  top: 12%;
  left: 4%;
}

.fc-2 {
  top: 58%;
  right: 2%;
  animation-delay: 1.2s;
}

.fc-3 {
  bottom: 6%;
  left: 14%;
  animation-delay: 2.4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg);
  border-radius: 100% 100% 0 0 / 100% 100% 0 0;
}

/* ===== 通用 Section ===== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  text-align: center;
  margin-bottom: 56px;
}

.section-kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-sub {
  color: var(--text-muted);
  margin-top: 10px;
}

/* ===== 关于 ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.about-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.about-card h3::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--primary);
  margin-right: 10px;
  vertical-align: 2px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== 作品 ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.project-cover {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.cover-1 {
  background: linear-gradient(135deg, #eef2ff, #e0f2fe);
}

.cover-2 {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.cover-3 {
  background: linear-gradient(135deg, #fdf4ff, #fae8ff);
}

.project-body {
  padding: 24px;
}

.project-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: 999px;
}

/* ===== 博客 ===== */
.blog-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-item {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.blog-item:hover {
  transform: translateY(-4px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-md);
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.blog-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

.blog-item h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  transition: color 0.2s ease;
}

.blog-item:hover h3 {
  color: var(--primary);
}

.blog-item p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.blog-more {
  text-align: center;
  margin-top: 40px;
}

/* ===== 联系 CTA ===== */
.section-cta {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #fff;
}

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

.cta-inner h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.cta-inner p {
  opacity: 0.9;
  margin-bottom: 32px;
}

.cta-inner .btn-primary {
  background: #fff;
  color: var(--primary-dark);
}

.cta-inner .btn-primary:hover {
  background: var(--primary-soft);
}

.social-list {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 36px;
}

.social-list a {
  font-weight: 500;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.social-list a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

/* ===== 页脚 ===== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-inner p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ===== 滚动渐显动画 ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-tags {
    justify-content: center;
  }

  .hero-art {
    order: -1;
    min-height: 260px;
  }

  .avatar-ring {
    width: 180px;
    height: 180px;
  }

  .avatar {
    font-size: 4.2rem;
  }

  .about-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 12px 24px 20px;
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
  }

  .nav-links .nav-cta {
    text-align: center;
    margin-top: 12px;
    color: #fff;
  }

  .menu-toggle {
    display: flex;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .avatar-ring,
  .float-card {
    animation: none;
  }
}
