:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --bg-soft: #eef0f6;
  --text: #1f2430;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-soft: #eef2ff;
  --shadow: 0 8px 30px rgba(31, 36, 48, 0.08);
  --shadow-lg: 0 16px 48px rgba(31, 36, 48, 0.14);
  --radius: 16px;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-alt: #171a23;
  --bg-soft: #1f2330;
  --text: #e6e8ee;
  --text-muted: #9aa1b2;
  --border: #2a2f3d;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-soft: #1e2038;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
}

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

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: transparent;
  display: flex;
  align-items: center;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: var(--bg);
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

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

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

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

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

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}

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

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--bg-soft);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: linear-gradient(160deg, var(--primary-soft) 0%, var(--bg) 60%);
  padding-top: var(--nav-height);
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  width: 100%;
  padding-bottom: 80px;
}

.hero-content {
  flex: 1;
  animation: fadeUp 0.8s ease both;
}

.hero-greet {
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.hero-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
  background: linear-gradient(120deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-desc {
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-avatar {
  flex-shrink: 0;
  animation: fadeUp 0.8s ease 0.15s both;
}

.avatar-circle {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.avatar-circle::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

.avatar-circle::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 90px;
  height: 90px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 80px;
  fill: var(--bg);
}

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

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
}

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

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

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

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

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  letter-spacing: -0.5px;
  position: relative;
}

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

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

.about-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.about-card h3 {
  margin-bottom: 16px;
  font-size: 1.15rem;
  color: var(--primary);
}

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

.info-list {
  list-style: none;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list li span:first-child {
  color: var(--text-muted);
}

.info-list li span:last-child {
  font-weight: 500;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.tag-green {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

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

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

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.skill-icon {
  font-size: 1.6rem;
}

.skill-card h3 {
  font-size: 1.05rem;
}

.skill-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

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

.skill-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 999px;
  animation: growBar 1.2s ease both;
}

@keyframes growBar {
  from { width: 0; }
}

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

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.project-banner {
  height: 160px;
  position: relative;
}

.project-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 23, 0.2);
}

.banner-1 {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.banner-2 {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.banner-3 {
  background: linear-gradient(135deg, #f7971e, #ffd200);
}

.project-body {
  padding: 24px;
}

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

.project-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
  min-height: 64px;
}

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

.project-tags span {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

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

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

/* ===== 联系我 ===== */
.section-contact {
  background: linear-gradient(180deg, var(--bg) 0%, var(--primary-soft) 100%);
  text-align: center;
}

.contact-intro {
  color: var(--text-muted);
  margin-bottom: 32px;
}

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

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

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.social-link:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}

.social-link svg {
  width: 22px;
  height: 22px;
}

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

/* ===== 动画 ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

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

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

  .avatar-circle {
    width: 200px;
    height: 200px;
    font-size: 4.5rem;
  }

  .nav-links {
    gap: 20px;
  }

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

  .section {
    padding: 64px 0;
  }
}

@media (max-width: 480px) {
  .nav-links a {
    font-size: 0.85rem;
  }
}
