/* 全局样式 */
:root {
    --primary-color: #4a6bff;
    --secondary-color: #6c63ff;
    --accent-color: #00d9ff;
    --dark-color: #2a2a72;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-light: #666;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(74, 107, 255, 0.3);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 107, 255, 0.4);
}

.btn.secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn.secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 导航栏样式 */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

header.scrolled {
    padding: 0.5rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 英雄区域样式 */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(74, 107, 255, 0.05) 0%, transparent 100%),
        radial-gradient(circle at 80% 70%, rgba(0, 217, 255, 0.05) 0%, transparent 100%);
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.ai-animation {
    width: 400px;
    height: 400px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(74, 107, 255, 0.2);
}

.ai-animation::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: conic-gradient(
        transparent, 
        transparent, 
        transparent, 
        var(--primary-color)
    );
    animation: rotate 3s linear infinite;
}

.ai-animation::after {
    content: '';
    position: absolute;
    width: 94%;
    height: 94%;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    z-index: 1;
}

.code-lines {
    position: absolute;
    width: 80%;
    height: 80%;
    z-index: 2;
    overflow: hidden;
}

.code-lines::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, transparent 0%, transparent 50%, var(--primary-color) 50%, var(--primary-color) 51%, transparent 51%, transparent 100%),
        linear-gradient(90deg, transparent 0%, transparent 50%, var(--accent-color) 50%, var(--accent-color) 51%, transparent 51%, transparent 100%),
        linear-gradient(90deg, transparent 0%, transparent 50%, var(--secondary-color) 50%, var(--secondary-color) 51%, transparent 51%, transparent 100%);
    background-size: 
        200% 3px,
        200% 3px,
        200% 3px;
    background-position:
        0 20%,
        0 50%,
        0 80%;
    background-repeat: no-repeat;
    animation: codeScan 3s infinite linear;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes codeScan {
    0% {
        background-position:
            0% 20%,
            0% 50%,
            0% 80%;
    }
    100% {
        background-position:
            200% 20%,
            200% 50%,
            200% 80%;
    }
}

/* 项目展示区域样式 */
.projects {
    padding: 6rem 5%;
    background-color: white;
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(236, 240, 255, 0.85));
    border-radius: calc(var(--border-radius) + 2px);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 18px 35px rgba(74, 107, 255, 0.18);
}

.project-image {
    height: 260px;
    padding: 1.2rem;
    background: radial-gradient(circle at top, rgba(74, 107, 255, 0.18), rgba(74, 107, 255, 0.05));
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(74, 107, 255, 0.12);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
    border-radius: var(--border-radius);
    box-shadow: 0 12px 30px rgba(74, 107, 255, 0.18);
    background-color: white;
}

.project-card:hover .project-image img {
    transform: translateY(-6px) scale(1.02);
}

.project-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.project-type {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.project-content p {
    color: var(--text-light);
}

.project-meta {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
}

.project-info {
    flex: 1 1 280px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(74, 107, 255, 0.15);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.project-info p {
    margin: 0;
}

.project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-features span {
    background: rgba(74, 107, 255, 0.16);
    color: var(--dark-color);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(74, 107, 255, 0.2);
}

.project-qr {
    margin-top: 0.5rem;
    padding: 1.2rem;
    border-radius: var(--border-radius);
    background: linear-gradient(145deg, rgba(74, 107, 255, 0.08), rgba(74, 107, 255, 0.15));
    border: 1px solid rgba(74, 107, 255, 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 12px 28px rgba(74, 107, 255, 0.15);
}

.project-qr img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: var(--border-radius);
    background-color: white;
    padding: 0.75rem;
    box-shadow: 0 10px 25px rgba(74, 107, 255, 0.18);
}

.project-qr p {
    color: var(--dark-color);
    font-size: 0.95rem;
    font-weight: 600;
}

/* AI编程之旅样式 */
.ai-journey {
    padding: 6rem 5%;
    background-color: #f8f9ff;
    position: relative;
    overflow: hidden;
}

.ai-journey::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(74, 107, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 90%, rgba(0, 217, 255, 0.05) 0%, transparent 50%);
    z-index: 0;
}

.journey-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.journey-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    z-index: -1;
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 0 4px rgba(74, 107, 255, 0.2);
    z-index: 2;
}

.timeline-icon i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.timeline-content {
    width: 45%;
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.timeline-content h3 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-light);
}

/* 关于我样式 */
.about {
    padding: 6rem 5%;
    background-color: white;
}

.about-content {
    display: flex;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.about-image {
    flex: 1;
    max-width: 400px;
}

.about-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.about-text {
    flex: 2;
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.skills {
    margin-top: 2rem;
}

.skills h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tags span {
    background-color: rgba(74, 107, 255, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 页脚样式 */
footer {
    background-color: #2a2a72;
    color: white;
    padding: 4rem 5% 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 3rem;
}

.footer-logo h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links h3,
.footer-projects h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-links h3::after,
.footer-projects h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-links ul,
.footer-projects ul {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a,
.footer-projects a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-links a:hover,
.footer-projects a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }
    
    .hero-content {
        margin-bottom: 3rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-image {
        margin: 0 auto;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .timeline-item {
        flex-direction: column !important;
        align-items: center;
    }
    
    .timeline-content {
        width: 80%;
        margin-top: 60px;
    }
    
    .journey-timeline::before {
        left: 50%;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: white;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        z-index: 1000;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 1.5rem 0;
    }
    
    .nav-links a {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
        display: block;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .ai-animation {
        width: 300px;
        height: 300px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links h3::after,
    .footer-projects h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-links ul,
    .footer-projects ul {
        align-items: center;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.7rem 1.3rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content h2 {
        font-size: 1.2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .ai-animation {
        width: 250px;
        height: 250px;
    }
    
    .timeline-content {
        width: 90%;
    }
    
    .project-cards {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .project-features span {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.7rem;
    }
    
    nav {
        padding: 0.8rem 5%;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
}

/* 添加小屏幕设备的优化 */
@media (max-width: 400px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .ai-animation {
        width: 200px;
        height: 200px;
    }
    
    .project-content {
        padding: 1.2rem;
    }
    
    .project-content h3 {
        font-size: 1.3rem;
    }
    
    .contact-item i {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}