:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --card: #1e293b;
  --card-border: #334155;
  --radius: 12px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1px;
}

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

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

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

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

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

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

/* ---------- Hero ---------- */
.hero {
  padding: 160px 0 100px;
  background:
    radial-gradient(ellipse at top right, rgba(37, 99, 235, 0.25), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(37, 99, 235, 0.15), transparent 55%),
    var(--bg);
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

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

.hero-name {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.2;
}

.hero-role {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
}

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

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

.avatar-ring {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(37, 99, 235, 0.4);
  animation: float 4s ease-in-out infinite;
}

.avatar-letter {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 700;
  color: var(--primary);
}

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

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

.section-tag {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 8px 0 48px;
  color: var(--text);
}

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

.about-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s, border-color 0.25s;
}

.about-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
}

.about-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text);
}

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

/* ---------- 技能 ---------- */
.skills-list {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
}

.skill-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.skill-percent {
  color: var(--text-muted);
}

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

.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  border-radius: 4px;
  transition: width 1.2s ease;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tech-tag {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}

.tech-tag:hover {
  color: var(--primary);
  border-color: var(--primary);
}

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

.project-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.15);
}

.project-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

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

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

.project-links {
  margin-top: 16px;
}

.project-stack {
  font-size: 0.8rem;
  color: var(--primary);
}

/* ---------- 联系 ---------- */
.contact-inner {
  text-align: center;
}

.contact-desc {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 32px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

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

.btn:hover {
  transform: translateY(-2px);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

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

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

/* ---------- 动画 ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
  }

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

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

  .hero-name {
    font-size: 2.8rem;
  }

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

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--card-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-links.open {
    max-height: 260px;
  }

  .nav-links li {
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 16px 0;
  }

  .nav-toggle {
    display: flex;
  }
}
