:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fb;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-border: #e5e7eb;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 16px 40px rgba(37, 99, 235, 0.15);
  --font-main: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

.nav.scrolled {
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

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

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

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

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

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--nav-height) + 96px) 0 96px;
  background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%);
  text-align: center;
}

.hero-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

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

.hero-name {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero-role {
  font-size: 1.25rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-desc {
  max-width: 560px;
  margin: 0 auto 40px;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  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;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

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

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

.btn-outline {
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
  background: #fff;
}

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

/* ---------- 通用区块 ---------- */
.section {
  padding: 88px 0;
}

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

.section-title {
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

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

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.about-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

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

.about-card p {
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.about-card p:last-child {
  margin-bottom: 0;
}

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

.tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--color-primary-dark);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid #e0e7ff;
}

/* ---------- 项目 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

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

.project-icon {
  font-size: 2rem;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

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

.project-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

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

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.skill-group {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.skill-group h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skill-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--color-text);
  font-weight: 500;
}

.skill-bar-head span:last-child {
  color: var(--color-text-muted);
}

.skill-bar-track {
  height: 8px;
  border-radius: 4px;
  background: #eef0f3;
  overflow: hidden;
}

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

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

.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 840px;
  margin: 0 auto;
}

.contact-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

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

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

.contact-label {
  font-weight: 600;
}

.contact-value {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  word-break: break-all;
}

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

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
}

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

.back-to-top:hover {
  background: var(--color-primary-dark);
}

/* ---------- 动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    width: 240px;
    padding: 16px 0;
    border-radius: 0 0 0 var(--radius-lg);
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

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

  .nav-links a {
    padding: 14px 28px;
  }

  .nav-toggle {
    display: flex;
  }

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

  .hero {
    padding-top: calc(var(--nav-height) + 72px);
  }
}
