/* 设置整个页面的字体 */
html, body {
    font-family: KaiTi, "Microsoft YaHei", Georgia, sans-serif;
    font-size: 15px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* 星空背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

@keyframes twinkle {
    0% { 
        opacity: 0.3; 
        transform: scale(0.8);
    }
    100% { 
        opacity: 1; 
        transform: scale(1.2);
    }
}

/* 浮动形状 */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.floating-shape {
    position: absolute;
    opacity: 0.1;
    animation: float 15s infinite linear;
}

.floating-shape.circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.floating-shape.triangle {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid rgba(255, 255, 255, 0.3);
}

.floating-shape.square {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
    }
}

/* 主容器 */
.container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 1s ease-out;
}

.header-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.header h1 {
    color: white;
    font-size: 3.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    font-weight: bold;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #ffffff, #f0f8ff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 3s ease-in-out infinite alternate;
}

.header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.3em;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
    font-weight: 300;
    letter-spacing: 1px;
}

@keyframes glow {
    0% {
        text-shadow: 2px 2px 8px rgba(0,0,0,0.4), 0 0 20px rgba(255,255,255,0.3);
    }
    100% {
        text-shadow: 2px 2px 8px rgba(0,0,0,0.4), 0 0 30px rgba(255,255,255,0.5);
    }
}

/* 项目容器 */
.projects-container {
    position: relative;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* 项目卡片 */
.project-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

/* 项目图标 */
.project-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    text-align: center;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.project-card:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
}

/* 项目内容 */
.project-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.project-title {
    color: white;
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: #f0f8ff;
}

.project-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 20px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.project-tag {
    display: inline-block;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.project-card:hover .project-tag {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
    transform: scale(1.05);
}

/* 悬浮效果 */
.project-hover-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
    z-index: 1;
}

.project-card:hover .project-hover-effect {
    left: 100%;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2em;
    padding: 80px 20px;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

.empty-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.empty-hint {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
}

/* Toast 消息 */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 0;
    border-radius: 16px;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.toast-icon {
    font-size: 18px;
    animation: sparkle 1s ease-in-out infinite alternate;
}

@keyframes sparkle {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

/* 动画定义 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-8px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 2.5em;
    }
    
    .header p {
        font-size: 1.1em;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-card {
        padding: 25px;
    }
    
    .project-icon {
        font-size: 3em;
    }
    
    .toast {
        right: 15px;
        top: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2em;
    }
    
    .header-icon {
        font-size: 3em;
    }
    
    .project-card {
        padding: 20px;
        border-radius: 18px;
    }
    
    .project-icon {
        font-size: 2.5em;
    }
    
    .project-title {
        font-size: 1.2em;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}