:root {
  /* 颜色定义 */
  --bg-color: #0d1117;
  --text-main: #ffffff;
  --text-muted: #8b949e;
  --primary: #58a6ff;
  --secondary: #bc8cff;
  --accent: #238636;
  --card-bg: rgba(22, 27, 34, 0.7);
  --glass-border: rgba(240, 246, 252, 0.1);

  /* 渐变色 */
  --gradient-1: linear-gradient(135deg, #ff6b6b 0%, #556270 100%);
  --gradient-2: linear-gradient(135deg, #4ac29a 0%, #bdfff3 100%);
  --gradient-3: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
  --text-gradient: linear-gradient(90deg, #58a6ff, #bc8cff);

  /* 间距 */
  --container-width: 1200px;
  --header-height: 70px;

  /* 动画过渡 */
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Outfit", "Segoe UI", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* 背景特效 */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.4;
  animation: float 10s infinite alternate;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--secondary);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  pointer-events: none;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(30px, 30px);
  }
}

/* 排版与通用工具类 */
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}
.section {
  padding: 100px 0;
}
.gradient-text {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-main);
    transition: var(--transition);
    display: flex;
    align-items: center;
}
.logo:hover {
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.5);
}
.logo .dot { 
    color: var(--primary); 
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.logo:hover .dot {
    transform: translateY(-5px);
    color: var(--secondary);
}

.nav-links { display: flex; gap: 40px; }
.nav-links a {
    font-weight: 500;
    position: relative;
    padding: 8px 0;
    color: var(--text-muted);
    transition: color 0.3s ease;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--text-gradient);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}
.nav-links a:hover::after { width: 100%; }

.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

/* 首屏区域 */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding-top: var(--header-height);
}
.badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(88, 166, 255, 0.15);
  color: var(--primary);
  border-radius: 50px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(88, 166, 255, 0.3);
}
.hero h1 {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 20px;
  font-weight: 800;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}
.cta-group {
  display: flex;
  gap: 20px;
  justify-content: center;
}
.btn {
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: #4090e6;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px var(--primary);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  animation: bounce 2s infinite;
}
.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 20px;
  position: relative;
}
.mouse::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translate(-50%, 0);
  }
  40% {
    transform: translate(-50%, -10px);
  }
  60% {
    transform: translate(-50%, -5px);
  }
}

/* 标题样式 */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 60px;
  position: relative;
  display: inline-block;
}
.section-title .line {
  position: absolute;
  bottom: 10px;
  right: -20px;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* 关于我区域 */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}
.about-card {
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  transition: var(--transition);
}
.about-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
}
.about-card .icon {
  font-size: 2.5rem;
  color: var(--secondary);
  margin-bottom: 25px;
}
.about-card h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}
.about-card p {
  color: var(--text-muted);
}

/* 项目展示区域 */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}
.project-card {
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}
.card-image-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.8);
}
.gradient-1 {
  background: var(--gradient-1);
}
.gradient-2 {
  background: var(--gradient-2);
}
.gradient-3 {
  background: var(--gradient-3);
}

.card-content {
  padding: 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.card-content h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}
.card-content p {
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
}
.tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tags span {
  font-size: 0.8rem;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--primary);
}
.card-links .link-text {
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.card-links .link-text:hover {
  color: var(--primary);
  gap: 10px;
}

/* 联系我区域 */
.contact-box {
  text-align: center;
  padding: 80px 40px;
  border-radius: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.contact-box h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}
.contact-box p {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-bottom: 40px;
}
.social-links {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 20px;
}
.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.2rem;
}
.social-icon:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

/* 页尾 */
.footer {
    position: relative;
    background: linear-gradient(to top, #0a0e14, var(--bg-color));
    border-top: 1px solid transparent;
    padding-top: 80px;
    margin-top: 80px;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}
.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    padding-bottom: 60px;
}
.footer-brand p {
    color: var(--text-muted);
    margin-top: 20px;
    max-width: 300px;
    font-size: 0.95rem;
}
.footer-links h4, .footer-social h4 {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-weight: 600;
}
.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.footer-links a {
    color: var(--text-muted);
    transition: var(--transition);
    display: inline-block;
}
.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px);
}
.social-icons {
    display: flex;
    gap: 15px;
}
.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    color: var(--text-muted);
    border: 1px solid transparent;
}
.social-link:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary);
    border-color: rgba(88, 166, 255, 0.3);
    transform: translateY(-3px);
}
.footer-bottom {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 媒体查询 */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(13, 17, 23, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        transition: var(--transition);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    .nav-links.active { right: 0; }
    .menu-toggle { display: block; z-index: 1001; }
    
    .hero h1 { font-size: 2.8rem; }
    .section-title { font-size: 2rem; }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .footer-brand p { margin: 20px auto 0; }
    .footer-links a:hover { transform: translateX(0) scale(1.05); }
    .social-icons { justify-content: center; }
}

/* 加载动画 */
.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 1.2rem;
}
.loading-spinner i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary);
}

/* 动画工具类 */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s forwards;
}
.fade-in {
  opacity: 0;
  transition:
    opacity 1s ease,
    transform 1s ease;
}
.hidden {
  opacity: 0;
  transform: translateY(30px);
}
.show {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  animation-delay: 0.2s;
  transition-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
  transition-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.6s;
  transition-delay: 0.6s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
