/* ============================================
   wwxue.com — 个人网站样式
   ============================================ */

/* --- 基础重置与变量 --- */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 8px;
  --max-width: 1100px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.10);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

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

/* --- 导航栏 --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

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

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo:hover {
  color: var(--primary) !important;
}

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

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
  border-radius: 1px;
}

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

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  padding: 6px;
}

/* --- 英雄区 --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #eff6ff 0%, #faf5ff 50%, #f0fdf4 100%);
  z-index: -1;
}

.hero-content {
  max-width: 660px;
  margin: 0 auto;
}

.hero-avatar {
  margin-bottom: 24px;
}

.hero-avatar img {
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  background: var(--bg);
  padding: 4px;
  width: 120px;
  height: 120px;
  object-fit: cover;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(37,99,235,0.30);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(37,99,235,0.40);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text) !important;
}

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

/* --- 通用版块 --- */
.section {
  padding: 80px 0;
}

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

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: -0.5px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin: 14px auto 0;
}

/* --- 关于卡片 --- */
.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 24px;
  text-align: center;
  transition: all var(--transition);
}

.about-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.about-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

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

.about-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- 兴趣卡片 --- */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.interest-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--transition);
}

.interest-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.interest-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

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

.interest-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.interest-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.interest-tech span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-alt);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* --- 项目卡片 --- */
.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: 28px 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.project-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

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

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tech span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-alt);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* --- 联系区 --- */
.contact-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1rem;
}

.contact-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text) !important;
  transition: all var(--transition);
}

.contact-item:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.contact-icon {
  font-size: 1.2rem;
}

/* --- 底部 --- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.icp {
  margin-top: 6px;
}

.icp a {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

/* ============================================
   响应式
   ============================================ */

@media (max-width: 900px) {
  .about-grid, .interests-grid, .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 2.4rem;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

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

  .menu-toggle {
    display: block;
  }

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

  .hero-title {
    font-size: 2rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 32px;
  }

  .contact-grid {
    flex-direction: column;
    align-items: center;
  }
}
