/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局变量 */
:root {
    --primary-color: #00f5ff;
    --secondary-color: #ff006e;
    --accent-color: #8338ec;
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --gradient-1: linear-gradient(45deg, #00f5ff, #8338ec);
    --gradient-2: linear-gradient(135deg, #ff006e, #00f5ff);
    --gradient-3: linear-gradient(270deg, #8338ec, #ff006e);
    --glow-color: rgba(0, 245, 255, 0.5);
}

/* 基础样式 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

/* 粒子背景 */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(138, 56, 236, 0.1) 0%, rgba(0, 0, 0, 1) 100%);
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部英雄区域 */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
}

/* 头像容器 */
.avatar-container {
    position: relative;
    margin-bottom: 2rem;
}

.avatar {
    width: 200px;
    height: 200px;
    position: relative;
    margin: 0 auto;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
    z-index: 2;
    animation: avatarFloat 3s ease-in-out infinite;
}

.tech-ring {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    border-right-color: transparent;
    animation: rotate 4s linear infinite;
}

.ai-glow {
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

/* 主标题 */
.main-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.glitch {
    position: relative;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 2s infinite;
    color: var(--secondary-color);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 2s infinite;
    color: var(--accent-color);
    z-index: -2;
}

.subtitle {
    display: block;
    font-size: 1.5rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 0.5rem;
}

/* 标语 */
.tagline {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
}

.typing-text {
    border-right: 2px solid var(--primary-color);
    animation: typing 3s steps(20, end), blink 1s infinite;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
}

/* 滚动指示器 */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-secondary);
    animation: bounce 2s infinite;
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    margin: 0 auto 10px;
    position: relative;
}

.wheel {
    width: 3px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: wheel 2s infinite;
}

/* 章节通用样式 */
section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-decoration {
    width: 100px;
    height: 4px;
    background: var(--gradient-2);
    margin: 0 auto;
    border-radius: 2px;
    position: relative;
}

.title-decoration::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px var(--glow-color);
}

/* 关于我区域 */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.about-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, var(--primary-color), transparent);
    animation: rotate 4s linear infinite;
    z-index: -1;
}

.about-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 20px;
    background: var(--bg-color);
    z-index: -1;
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 245, 255, 0.3);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--glow-color));
}

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

.about-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

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

.skill-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 245, 255, 0.2);
    transition: all 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.skill-item h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 4px;
    animation: progressLoad 2s ease-in-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.skill-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 245, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px) rotateY(5deg);
    box-shadow: 0 25px 50px rgba(0, 245, 255, 0.2);
}

.project-image {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--glow-color));
}

.project-card h4 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.project-tech {
    display: inline-block;
    background: var(--gradient-2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 联系区域 */
.contact-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
}

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

.contact-btn {
    background: var(--gradient-1);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.contact-btn:hover::before {
    left: 100%;
}

.contact-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 245, 255, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

/* 联系信息弹窗 */
.contact-info-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.popup-content {
    background: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: popupShow 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--secondary-color);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 50px 0;
    border-top: 1px solid rgba(0, 245, 255, 0.2);
    color: var(--text-secondary);
}

.footer-motto {
    margin-top: 10px;
    font-style: italic;
    color: var(--primary-color);
}

/* 动画定义 */
@keyframes avatarFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-2px, -2px); }
    20% { transform: translate(2px, 2px); }
    30% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    50% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    70% { transform: translate(-2px, 2px); }
    80% { transform: translate(2px, -2px); }
    90% { transform: translate(-2px, -2px); }
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-5px, -2px); }
    20% { transform: translate(5px, 2px); }
    30% { transform: translate(-5px, 2px); }
    40% { transform: translate(5px, -2px); }
    50% { transform: translate(-5px, -2px); }
    60% { transform: translate(5px, 2px); }
    70% { transform: translate(-5px, 2px); }
    80% { transform: translate(5px, -2px); }
    90% { transform: translate(-5px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(5px, 2px); }
    20% { transform: translate(-5px, -2px); }
    30% { transform: translate(5px, -2px); }
    40% { transform: translate(-5px, 2px); }
    50% { transform: translate(5px, 2px); }
    60% { transform: translate(-5px, -2px); }
    70% { transform: translate(5px, -2px); }
    80% { transform: translate(-5px, 2px); }
    90% { transform: translate(5px, 2px); }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

@keyframes wheel {
    0% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(15px); }
    100% { transform: translateX(-50%) translateY(0); }
}

@keyframes progressLoad {
    from { width: 0; }
    to { width: var(--progress-width, 100%); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes popupShow {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .avatar {
        width: 150px;
        height: 150px;
    }
    
    .avatar-inner {
        font-size: 60px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .about-card, .skill-item, .project-card {
        padding: 25px 20px;
    }
    
    .popup-content {
        padding: 30px 20px;
    }
}