:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-text: #1f2430;
  --color-text-muted: #6b7280;
  --color-accent: #4f46e5;
  --color-accent-dark: #4338ca;
  --color-border: #e5e7eb;
  --shadow-card: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 12px;
  --container: 1000px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ===== 导航栏 ===== */
.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: border-color 0.3s ease;
}

.navbar.scrolled {
  border-bottom-color: var(--color-border);
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

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

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

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

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

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-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 {
  padding: 140px 0 100px;
  text-align: center;
}

.avatar-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.25);
}

.avatar-letter {
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.highlight {
  color: var(--color-accent);
}

.hero-subtitle {
  margin-top: 12px;
  font-size: 1.15rem;
  color: var(--color-text-muted);
}

.hero-desc {
  margin-top: 12px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  color: var(--color-text-muted);
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

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

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.3);
}

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

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

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

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

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
}

.section-divider {
  width: 48px;
  height: 4px;
  margin: 16px auto 48px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-accent), #8b5cf6);
}

/* ===== 关于 ===== */
.about-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  color: var(--color-text-muted);
}

.about-facts {
  list-style: none;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}

.about-facts li {
  padding: 14px 18px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.about-facts strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ===== 技能 ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}

.skill-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 20px;
}

.skill-item {
  margin-bottom: 16px;
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.skill-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--color-bg-alt);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-accent), #8b5cf6);
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.project-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.1);
}

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

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

.project-tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--color-accent);
}

.project-links {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 20px;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  transition: opacity 0.2s ease;
}

.project-link:hover {
  opacity: 0.75;
}

/* ===== 联系 ===== */
.contact-intro {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

/* ===== 页脚 ===== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

/* ===== 回到顶部 ===== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, color 0.2s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

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

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

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hero {
    padding: 120px 0 72px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .section {
    padding: 72px 0;
  }

  .skills-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

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

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px 20px;
    gap: 4px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 10px 0;
  }

  .menu-toggle {
    display: flex;
  }
}
