/* 全局变量 */
:root {
    --primary: #3bf4fb;
    --secondary: #32ffa5;
    --text: #e2e8f0;
    --bg: #000000;
    --card-bg: rgba(255, 255, 255, 0.05);
    --dark-card: rgba(0, 0, 0, 0.3);
    --gradient: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

/* 全局样式 */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin: 2rem;
}

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

/* 导航栏样式 */
.nav {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size:10rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Hero 区域基础样式 */
.hero {
  position: relative; /* 确保是定位上下文 */
    background: linear-gradient(135deg, rgba(59, 244, 251, 0.1) 0%, rgba(50, 255, 165, 0.1) 100%);
    min-height: 88vh;
display: flex;
align-items: center;
    padding: 2rem 0;
}

/* Hero 区域样式 */
.hero-content {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.subtitle {
    font-size: 1.25rem;
    color: #a0aec0;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

/* CTA 按钮容器 */
.hero-cta {
    margin-top: 2.5rem;
    display: flex;
    gap: 1.5rem;
        justify-content: center;
    }

/* 按钮基础样式 */
.cta-button {
    position: relative;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* 主按钮样式 */
.cta-button:not(.secondary) {
    background: var(--gradient);
    color: var(--bg);
    box-shadow: 0 4px 15px rgba(59, 244, 251, 0.3);
}

/* 次要按钮样式 */
.cta-button.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* 悬停效果 */
.cta-button:not(.secondary):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 244, 251, 0.4);
}

.cta-button.secondary:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 244, 251, 0.3);
}

/* 添加波纹效果 */
.cta-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.cta-button:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* 添加光效 */
.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cta-button:hover::before {
    opacity: 1;
}

/* 项目展示区域样式 */
.projects-section {
    padding: 2rem 0;
    background: var(--bg);
}

.project-showcase {
    padding: 4rem 0;
    background: var(--bg);
    border-radius: 16px;
    }
    
.project-header {
    text-align: center;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    }
    
.project-title {
    font-size: 3.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    }

.project-meta {
    display: flex;
        justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.meta-item i {
    font-size: 1.2rem;
    color: var(--primary);
}

/* 标签列表容器 */
.tag-list {
    display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
    justify-content: center;
  margin: 1.5rem 0;
}

/* 标签样式 */
.tag {
  padding: 0.5rem 1rem;
  border-radius: 8px;
    font-size: 0.9rem;
  font-weight: 500;
    color: var(--text);
  background: rgba(59, 244, 251, 0.1);
  border: 1px solid rgba(59, 244, 251, 0.2);
    transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 标签悬停效果 */
.tag:hover {
  background: rgba(59, 244, 251, 0.15);
  border-color: rgba(59, 244, 251, 0.3);
  transform: translateY(-2px);
}

/* 添加发光效果 */
.tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(59, 244, 251, 0.2),
    transparent
  );
}

/* 响应式调整 */
@media (max-width: 768px) {
  .tag-list {
    gap: 0.5rem;
    }
    
  .tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    }
    }

/* 标签类型样式 */
.tag[data-type="framework"] {
  background: rgba(111, 66, 193, 0.1);
  border-color: rgba(111, 66, 193, 0.2);
}

.tag[data-type="language"] {
  background: rgba(50, 255, 165, 0.1);
  border-color: rgba(50, 255, 165, 0.2);
}

.tag[data-type="tool"] {
  background: rgba(59, 244, 251, 0.1);
  border-color: rgba(59, 244, 251, 0.2);
}

.project-description {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    color: var(--text);
    line-height: 1.8;
    font-size: 1.1rem;
    opacity: 0.9;
  }
  
/* 设备展示区域 */
.devices-section {
    margin-top: 1rem;
    background: var(--dark-card);
    border-radius: 20px;
    padding: 2rem;
  }
  
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

/* 设备切换标签容器 */
.devices-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    padding: 0.5rem;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

/* 滑动背景指示器 */
.devices-tabs::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: calc(33.33% - 1.33rem);
    /* 调整宽度计算 */
    height: calc(100% - 1rem);
    background: rgba(59, 244, 251, 0.1);
    border-radius: 8px;
    transition: transform 0.5s cubic.4, 0, 0.2, 1);
    z-index: 0;
}

/* 标签按钮样式 */
.device-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 2rem;
    background: transparent;
    border: none;
    color: #4a5568;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 1;
    flex: 1;
    justify-content: center;
}

/* 根据激活的标签位置移动背景指示器 */
.devices-tabs[data-active="0"]::before {
    transform: translateX(0);
}

.devices-tabs[data-active="1"]::before {
    transform: translateX(100%);
}

.devices-tabs[data-active="2"]::before {
    transform: translateX(200%);
}

/* 标签激活状态 */
.device-tab.active {
    color: var(--primary);
}

.device-tab.active i {
    transform: scale(1.2);
}

/* 标签悬停效果 */
.device-tab:hover:not(.active) {
    color: var(--text);
}

.device-tab:hover i {
    transform: scale(1.1);
}

/* 波纹效果 */
.device-tab .ripple {
    position: absolute;
    background: rgba(59, 244, 251, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 预览区域 */
.device-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
}
.preview-images {
    position: relative;
    width: 300px;
    height: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #4299e1, #3bf4fb);
    border-radius: 30px;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* 右侧指示器容器样式更新 */
.preview-indicators {
    position: relative;
    display: flex;
flex-direction: column;
        gap: 0.5rem; /* 减小间距 */
    transform-style: preserve-3d;
    padding-left: 0.5rem;
    }

/* 指示器样式更新 */
.indicator {
    position: relative;
    padding: 0.5rem 1rem; /* 减小上下内边距 */
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transform: translateX(0);
    opacity: 0.7; /* 默认状态稍微淡化 */
}

/* 连接线 */
.indicator::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    width: 1.5rem;
    height: 1px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

/* 激活状态增强 */
.indicator.active {
    background: rgba(59, 244, 251, 0.08);
    border-left: 2px solid var(--primary);
    transform: translateX(0.75rem);
    opacity: 1;
    box-shadow: 
        0 0 20px rgba(59, 244, 251, 0.1),
        inset 0 0 10px rgba(59, 244, 251, 0.05);
}

.indicator.active::before {
    transform: scaleX(1.4);
}

/* 标题样式 */
.indicator h3 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
    font-weight: 500;
    transition: transform 0.3s ease;
}

/* 描述文本 */
.indicator p {
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.8;
    line-height: 1.2;
    transition: transform 0.3s ease;
}

/* 悬停效果 */
.indicator:hover:not(.active) {
    background: rgba(59, 244, 251, 0.03);
    transform: translateX(0.25rem);
    opacity: 0.85;
}

/* 切换动效 */
.indicator.active h3 {
    transform: translateX(0.5rem);
}

.indicator.active p {
    transform: translateX(0.5rem);
}

/* 添加进入和退出动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(1rem);
    }
}

.indicator-enter {
    animation: slideIn 0.3s ease forwards;
}

.indicator-leave {
    animation: slideOut 0.3s ease forwards;
}

/* 设备预览区域样式更新 */
.devices-content {
    position: relative;
    min-height: 600px;
    /* 设置固定高度，防止跳变 */
  }
  
.device-view {
    position: absolute;
  width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.device-view.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.device-preview {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    display: grid;
}

.device-preview.show {
    opacity: 1;
    transform: translateY(0);
}

/* 预览图片过渡效果优化 */
.preview-img {
    position: absolute;
    width: 280px;
    height: auto;
    max-height: 580px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95) translateZ(0);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

.preview-img.active {
    opacity: 1;
    transform: scale(1) translateZ(0);
}

/* 指示器过渡效果优化 */
.indicator {
    opacity: 0.7;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.indicator.active {
    opacity: 1;
    transform: translateX(0);
    background: rgba(59, 244, 251, 0.1);
}

.indicator h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.indicator p {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 预览图片容器样式更新 */
.preview-images {
    position: relative;
    width: 300px;
    height: 600px;
    background: linear-gradient(135deg, #4299e1, #3bf4fb);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    perspective: 2000px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

/* 预览图片样式更新 */
.preview-img {
    position: absolute;
    width: 280px;
    height: auto;
    max-height: 580px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95) translateZ(0);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

.preview-img.active {
    opacity: 1;
    transform: scale(1) translateZ(0);
}

/* 添加悬停效果 */
.preview-images:hover {
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg) translateY(-5px);
    box-shadow:
        25px 25px 40px rgba(0, 0, 0, 0.3),
        inset -5px -5px 15px rgba(255, 255, 255, 0.1),
        inset 5px 5px 15px rgba(0, 0, 0, 0.1);
}

.preview-images:hover .preview-img.active {
    transform: scale(1.05) translateZ(50px);
}

/* 添加光影效果 */
.preview-images::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.preview-images:hover::before {
    opacity: 1;
}

/* 添加鼠标移动时的动态效果 */
.preview-images.moving {
    transition: transform 0.1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 添加反光效果 */
.preview-images::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(125deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%,
            rgba(255, 255, 255, 0) 100%);
    transform: translateZ(1px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.preview-images:hover::after {
    opacity: 1;
}

/* 添加底部阴影效果 */
.preview-images::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: -100px;
    left: 0;
    background: radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.35) 0%,
            rgba(0, 0, 0, 0) 80%);
    transform-origin: center center;
    transform: scale(0.85) translateZ(-50px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

.preview-images:hover::before {
    opacity: 1;
    transform: scale(1) translateZ(-50px);
}

/* 鼠标移动时的动态效果优化 */
.preview-images.moving {
    transition: transform 0.1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 添加移动时的光影效果 */
.preview-images.moving::after {
    transition: opacity 0.1s ease;
}

/* 项目列表样式 */
.project-list {
    margin: 1rem -2rem 0;
    position: relative;
}
.project-list::after {
    display: none; /* 完全移除遮罩 */
}

.project-scroll {
    display: flex;
    gap: 1rem; /* 增加项目间距 */
    padding: 1rem 2rem;
    overflow-x: auto;
    /* scroll-snap-type: x mandatory; */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.project-scroll::-webkit-scrollbar {
    display: none;
}

.project-logo-card {
    flex: 0 0 100px; /* 固定宽度，不压缩 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 12px;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.03);
}

.project-logo {
    width: 64px; /* 增大图标尺寸 */
    height: 64px;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.project-logo-card:hover {
    background: rgba(59, 244, 251, 0.05);
    transform: translateY(-15px);
}

.project-logo-card:hover .project-logo {
    transform: scale(1.6);
}

.project-name {
    font-size: 1rem; /* 增大字体 */
    color: var(--text);
    opacity: 0.8;
    text-align: center;
    white-space: nowrap;
}

/* 添加渐变遮罩效果 */
.project-list::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--bg));
    pointer-events: none;
    opacity: 0.8;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .project-logo-card {
        width: 80px;
    }

    .project-logo {
        width: 32px;
        height: 32px;
    }

    .logo {
        font-size: 2.5rem;
    }
}

/* 页脚样式 */
.site-footer {
    padding: 1rem 0;
    background: var(--bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4rem;
}

/* 页脚样式优化 */
.site-footer {
    padding: 12px 0;
    /* 减小内边距 */
    background: var(--bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    height: 32px;
    /* 设置合适的高度 */
}

.copyright,
.beian {
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.6;
}

.beian a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.beian a:hover {
    opacity: 1;
}

display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
text-align: center;
}

.copyright {
    color: var(--text);
    opacity: 0.6;
    font-size: 0.9rem;
}

.beian {
    font-size: 0.9rem;
}

.beian a {
    color: var(--text);
    opacity: 0.6;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.beian a:hover {
    opacity: 1;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
}

/* GitHub 角标样式 */
.github-corner {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 100;
}

.github-corner:hover .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
}

.github-corner svg {
    filter: drop-shadow(0 0 8px rgba(59, 244, 251, 0.4));
    transition: all 0.3s ease;
}

.github-corner:hover svg {
    filter: drop-shadow(0 0 12px rgba(59, 244, 251, 0.6));
}

@keyframes octocat-wave {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(-25deg); }
    40%, 80% { transform: rotate(10deg); }
}

/* 移动端优化 */
@media (max-width: 500px) {
    .github-corner:hover .octo-arm {
        animation: none;
    }
    
    .github-corner .octo-arm {
        animation: octocat-wave 560ms ease-in-out;
    }
    
    .github-corner svg {
        width: 60px;
        height: 60px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .github-corner svg {
    width: 60px;
    height: 60px;
  }
  
  .github-corner:hover .octo-arm {
    animation: none;
  }
  
  .github-corner .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
  }
}

/* 背景 Canvas 样式 */
.background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--bg);
}
.github-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.github-link:hover {
  color: var(--primary);
}
.demo-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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