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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(30, 41, 59, 0.08);
}

html {
  scroll-behavior: smooth;
}

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

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.nav.nav-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 12px rgba(30, 41, 59, 0.06);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

/* ---------- Hero ---------- */
.hero {
  padding: 160px 20px 90px;
  text-align: center;
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%);
}

.hero-inner {
  max-width: 680px;
  margin: 0 auto;
}

.avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

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

.tagline {
  margin-top: 8px;
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 500;
}

.subtitle {
  margin-top: 8px;
  color: var(--text-muted);
}

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

.btn {
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-outline {
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: #eef2ff;
  transform: translateY(-2px);
}

/* ---------- 通用段落 ---------- */
.section {
  padding: 80px 20px;
}

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

.section-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 48px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

/* ---------- 关于 ---------- */
.about-text {
  max-width: 680px;
  margin: 0 auto 48px;
  text-align: center;
  color: var(--text-muted);
}

.about-cards {
  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: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.about-card:hover {
  transform: translateY(-4px);
}

.about-icon {
  font-size: 1.75rem;
}

.about-card h3 {
  margin-top: 12px;
  font-size: 1.05rem;
}

.about-card p {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
}

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

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

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

.skill-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  transition: width 1s ease;
}

/* ---------- 项目 ---------- */
.projects-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);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(30, 41, 59, 0.14);
}

.project-cover {
  height: 120px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 16px;
}

.project-title {
  font-size: 1.1rem;
}

.project-desc {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag {
  background: #eef2ff;
  color: var(--primary-dark);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.project-link {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.project-link:hover {
  text-decoration: underline;
}

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

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

.contact-card {
  width: 120px;
  padding: 24px 12px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.5rem;
  line-height: 2;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.2s, color 0.2s, border-color 0.2s;
}

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

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

.footer-tip {
  margin-top: 4px;
  font-size: 0.8rem;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .name {
    font-size: 1.8rem;
  }

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

  .nav-links {
    gap: 14px;
    font-size: 0.85rem;
  }

  .section {
    padding: 60px 20px;
  }
}

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

  .skill-fill {
    transition: none;
  }
}
