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

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #fafbfc;
    color: #1a1a1a;
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #1a1a1a;
    text-align: center;
    padding: 60px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    border-bottom: 1px solid #e1e5e9;
    overflow: hidden;
}

/* 添加动画背景粒子效果 */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(52, 152, 219, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(52, 152, 219, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(52, 152, 219, 0.05) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-10px) rotate(1deg);
        opacity: 1;
    }
}


header .container {
    position: relative;
    z-index: 1;
}

h1 {
    margin: 0;
    font-size: 2.8em;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #1a1a1a;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.subtitle {
    font-size: 1.2em;
    color: #6c757d;
    margin-top: 12px;
    font-weight: 400;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}

/* 主要内容区域 */
main {
    background: white;
    margin: 0 20px 20px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* 区块样式 */
.section {
    padding: 50px 40px;
    border-bottom: 1px solid #f0f0f0;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.section:nth-child(1) {
    animation-delay: 0.1s;
}

.section:nth-child(2) {
    animation-delay: 0.2s;
}

.section:nth-child(3) {
    animation-delay: 0.3s;
}

.section:nth-child(4) {
    animation-delay: 0.4s;
}

.section:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.section:last-child {
    border-bottom: none;
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 32px;
    font-size: 1.8em;
    font-weight: 600;
    position: relative;
    letter-spacing: -0.3px;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 48px;
    height: 2px;
    background: #3498db;
    border-radius: 1px;
}

/* 关于我区域 */
.about {
    display: flex;
    align-items: center;
    gap: 40px;
}

.profile-img {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5em;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile-img::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(52, 152, 219, 0.1) 50%, transparent 60%);
    transform: rotate(-45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.profile-img:hover::before {
    animation: shine 0.6s ease-in-out;
}

.profile-img:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(-45deg);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(100%) rotate(-45deg);
        opacity: 0;
    }
}

/* 技能网格 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.skill-item {
    background: #ffffff;
    padding: 28px;
    border-radius: 8px;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e1e5e9;
}

.skill-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.02) 0%, rgba(52, 152, 219, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.skill-item {
    position: relative;
}

.skill-item:hover::before {
    opacity: 1;
}

.skill-item h3 {
    color: #2c3e50;
    margin-bottom: 16px;
    font-size: 1.2em;
    font-weight: 600;
}

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

.project-card {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #3498db;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.02) 0%, rgba(52, 152, 219, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    pointer-events: none;
}

.project-card {
    position: relative;
}

.project-card:hover::after {
    opacity: 1;
}

.project-content {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.project-content h3 {
    color: #2c3e50;
    margin-bottom: 16px;
    font-size: 1.3em;
    font-weight: 600;
}

.project-content p {
    margin-bottom: 16px;
    color: #5a6c7d;
    line-height: 1.6;
}

.project-content strong {
    color: #333;
}

/* 联系方式 */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.contact-item:hover {
    background: #e9ecef;
}

.contact-item span {
    font-size: 1.5em;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 32px 20px;
    background: #f8f9fa;
    color: #5a6c7d;
    margin-top: 40px;
    border-top: 1px solid #e1e5e9;
}

footer p {
    margin: 5px 0;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header {
        padding: 40px 20px;
    }

    h1 {
        font-size: 2.2em;
    }

    .subtitle {
        font-size: 1.1em;
    }

    .about {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .profile-img {
        width: 200px;
        height: 200px;
        font-size: 4em;
    }

    .section {
        padding: 30px 20px;
    }

    .section h2 {
        font-size: 1.6em;
    }

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

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

    .contact-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }

    .profile-img {
        width: 150px;
        height: 150px;
        font-size: 3em;
    }

    .section {
        padding: 20px 15px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.section {
    animation: fadeInUp 0.6s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B22222;
}

/* Project link styles */
.project-link {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.project-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    background: #2980b9;
}

/* 添加滚动条动画 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

/* 添加选择文本的样式 */
::selection {
    background: rgba(52, 152, 219, 0.2);
    color: #2c3e50;
}

::-moz-selection {
    background: rgba(52, 152, 219, 0.2);
    color: #2c3e50;
}

/* 添加加载预动画 */
.skill-item,
.project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.skill-item.loaded,
.project-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 添加hover时的微妙脉冲效果 */
.project-link {
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.project-link:active::before {
    width: 300px;
    height: 300px;
}