/* style.css */
:root {
    --primary-light: #e0f7fa;      /* 淡绿色 */
    --primary-blue: #4fc3f7;       /* 天蓝色 */
    --accent-green: #81c784;       /* 点缀绿色 */
    --accent-orange: #ffb74d;      /* 点缀橙色 */
    --accent-purple: #ba68c8;      /* 点缀紫色 */
    --text-dark: #2c3e50;
    --text-light: #546e7a;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-light) 0%, #f5f5f5 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* 欢迎区域 */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 25px;
    padding: 20px;
}

.welcome-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-blue);
    animation: rotate 20s linear infinite;
    flex-shrink: 0;
}

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

.welcome-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-text {
    flex: 1;
}

.typing-text {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-dark);
    line-height: 1.4;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    display: inline-block;
    max-width: 100%;
}

/* 光标样式 */
.typing-text::after {
    content: '|';
    animation: blink-caret 0.75s step-end infinite;
    margin-left: 2px;
}

/* 打字完成后的样式 */
.typing-text.typing-done::after {
    display: none;
}

@keyframes blink-caret {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 介绍卡片 */
.intro-card {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 15px;
}

.intro-card::-webkit-scrollbar {
    width: 8px;
}

.intro-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.intro-card::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

/* 项目卡片网格 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.project-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
}

.project-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
}

.project-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-green));
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.project-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-dark);
    transform: rotate(90deg);
}

/* 文章列表 */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.article-item:hover {
    border-left-color: var(--primary-blue);
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.search-box {
    margin-bottom: 30px;
}

.search-box input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

/* 联系我 */
.contact-section {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-green));
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.contact-item i {
    font-size: 20px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    color: var(--text-light);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .welcome-section {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 15px;
    }
    
    .welcome-avatar {
        width: 80px;
        height: 80px;
        border-width: 3px;
    }
    
    .typing-text {
        font-size: 1.2em;
        line-height: 1.5;
        max-width: 100%;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-section {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-item {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .welcome-section {
        padding: 12px;
        gap: 12px;
    }
    
    .welcome-avatar {
        width: 70px;
        height: 70px;
        border-width: 2px;
    }
    
    .typing-text {
        font-size: 1em;
        line-height: 1.6;
        max-width: 100%;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .typing-text {
        font-size: 0.9em;
        line-height: 1.7;
    }
    
    .welcome-avatar {
        width: 60px;
        height: 60px;
    }
}

/* 按钮 */
.btn {
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: white;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(79, 195, 247, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
}

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

/* 通知 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--accent-green);
    color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1001;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}