:root {
  --bg: #0f1115;
  --bg-alt: #161a22;
  --surface: #1c212b;
  --border: #2a3140;
  --text: #e8eaf0;
  --text-muted: #9aa3b2;
  --accent: #6c8cff;
  --accent-2: #8b5cf6;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: rgba(108, 140, 255, 0.35);
}

/* ===== 导航栏 ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 17, 21, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.5px;
}

.brand span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  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: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  gap: 60px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  flex: 1.1;
  position: relative;
  z-index: 2;
}

.hero-greet {
  color: var(--accent);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: 64px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 8px;
  background: linear-gradient(120deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 24px rgba(108, 140, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(108, 140, 255, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

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

/* Hero 装饰 */
.hero-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 380px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.orb-1 {
  width: 260px;
  height: 260px;
  background: var(--accent);
  top: 10%;
  left: 10%;
  animation: float 7s ease-in-out infinite;
}

.orb-2 {
  width: 200px;
  height: 200px;
  background: var(--accent-2);
  bottom: 12%;
  right: 8%;
  animation: float 9s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-24px); }
}

.code-card {
  position: relative;
  z-index: 2;
  background: rgba(28, 33, 43, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  width: 360px;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}

.code-card .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  background: #ff5f57;
}

.code-card .dot:nth-child(2) {
  background: #febc2e;
}

.code-card .dot:nth-child(3) {
  background: #28c840;
  margin-right: 0;
}

.code-card pre {
  margin-top: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ===== Section 通用 ===== */
.section {
  padding: 96px 24px;
}

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

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

.section-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ===== 关于 ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 16px;
}

.about-text strong {
  color: var(--text);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.about-tags span {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 12px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.stat:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.stat strong {
  display: block;
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.stat span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 技能 ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

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

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

.skill-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
}

.skill-card ul {
  list-style: none;
}

.skill-card li {
  color: var(--text-muted);
  font-size: 14px;
  padding: 5px 0;
  position: relative;
  padding-left: 18px;
}

.skill-card li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

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

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

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

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

.project-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
}

.project-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

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

.project-tags span {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
}

.project-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

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

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

.contact-box .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

.contact-desc {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  font-size: 16px;
}

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

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== 滚动动画 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    padding-top: 140px;
    text-align: center;
    gap: 40px;
  }

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

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

  .hero-art {
    min-height: 300px;
  }

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

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    gap: 0;
  }

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

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

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

  .nav-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 44px;
  }
}

@media (max-width: 560px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .code-card {
    width: 100%;
  }
}
