:root {
  --primary: #6c5ce7;
  --secondary: #00cec9;
  --accent: #fd79a8;
  --warning: #fdcb6e;
  --text: #2d3436;
  --text-light: #636e72;
  --bg: #ffffff;
  --bg-soft: #f8f9ff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --border: rgba(108, 92, 231, 0.15);
  --shadow: 0 8px 30px rgba(108, 92, 231, 0.12);
  --shadow-hover: 0 12px 40px rgba(108, 92, 231, 0.22);
  --radius: 16px;
  --gradient: linear-gradient(135deg, #6c5ce7 0%, #00cec9 50%, #fd79a8 100%);
  --gradient-text: linear-gradient(120deg, #6c5ce7, #00cec9 45%, #fd79a8);
}

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

html {
  scroll-behavior: smooth;
}

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

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

ul {
  list-style: none;
}

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

/* ===== 背景渐变 ===== */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(160deg, #fdf4ff 0%, #eef2ff 30%, #ecfeff 60%, #fff7ed 100%);
}

.bg-blob {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
  animation: float 16s ease-in-out infinite;
}

.blob-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -100px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.55), rgba(0, 206, 201, 0.45));
}

.blob-2 {
  width: 360px;
  height: 360px;
  top: 40%;
  left: -140px;
  background: linear-gradient(135deg, rgba(0, 206, 201, 0.5), rgba(253, 121, 168, 0.4));
  animation-delay: -5s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  bottom: -100px;
  right: 20%;
  background: linear-gradient(135deg, rgba(253, 121, 168, 0.5), rgba(108, 92, 231, 0.4));
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.08); }
}

/* ===== 顶栏 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

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

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

.nav-link {
  font-weight: 500;
  color: var(--text-light);
  position: relative;
  transition: color 0.3s;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--gradient);
  transition: width 0.3s;
}

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

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  color: #fff;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--gradient);
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.nav-cta::after {
  display: none;
}

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

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

.nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 40px;
  padding: 90px 0 70px;
  min-height: calc(100vh - 68px);
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.25);
  margin-bottom: 20px;
}

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

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

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 14px;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
}

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

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-ghost {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(108, 92, 231, 0.35);
}

.btn-ghost:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.06);
}

/* ===== Hero 动画装饰 ===== */
.hero-art {
  position: relative;
  height: 380px;
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 2px dashed rgba(108, 92, 231, 0.35);
}

.orbit-outer {
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
  animation: spin 22s linear infinite;
}

.orbit-inner {
  width: 230px;
  height: 230px;
  transform: translate(-50%, -50%);
  border-color: rgba(0, 206, 201, 0.4);
  animation: spin 16s linear infinite reverse;
}

.orbit-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gradient);
  top: -8px;
  left: 50%;
  box-shadow: 0 0 14px rgba(108, 92, 231, 0.6);
}

.orbit-inner .orbit-dot {
  background: var(--gradient);
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: var(--radius);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: bob 4s ease-in-out infinite;
}

.hero-card-icon {
  font-size: 1.4rem;
}

.hero-card-text {
  font-weight: 600;
  font-size: 0.95rem;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -58%); }
}

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

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

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  position: relative;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--gradient);
  margin-right: 12px;
  transform: rotate(12deg);
}

.section-sub {
  color: var(--text-light);
  font-weight: 500;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.35s, box-shadow 0.35s;
}

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

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

.about-card {
  padding: 32px 28px;
}

.card-icon {
  font-size: 2rem;
  display: inline-block;
  margin-bottom: 14px;
}

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

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

.skills {
  padding: 28px 32px;
}

.skills h3 {
  margin-bottom: 16px;
}

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

.tag {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.2);
  transition: transform 0.3s, background 0.3s;
  cursor: default;
}

.tag:hover {
  transform: translateY(-3px);
  background: rgba(108, 92, 231, 0.15);
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  overflow: hidden;
}

.blog-tag {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.blog-card h3 {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 10px;
  transition: color 0.3s;
}

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

.blog-excerpt {
  flex: 1;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.blog-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-light);
}

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

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

.project-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.project-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.project-lang {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--secondary);
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.3);
}

.project-desc {
  flex: 1;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.project-link {
  margin-left: auto;
  color: var(--primary);
  font-weight: 600;
}

/* ===== Contact ===== */
.contact-card {
  padding: 48px;
  text-align: center;
}

.contact-card .section-title::before {
  display: none;
}

.contact-desc {
  color: var(--text-light);
  margin: 12px 0 28px;
}

.contact-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: rgba(255, 255, 255, 0.7);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 0.9rem;
}

.back-top {
  font-weight: 600;
  color: var(--primary);
  transition: opacity 0.3s;
}

.back-top:hover {
  opacity: 0.7;
}

/* ===== 入场动画 ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

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

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

  .hero-art {
    display: none;
  }

  .about-grid,
  .blog-grid,
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 260px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }

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

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

  .section {
    padding: 56px 0;
  }

  .contact-card {
    padding: 32px 20px;
  }
}
