/* 基础样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --light-text: #666;
    --background-color: #f9f9f9;
    --card-background: #fff;
    --border-color: #eaeaea;
    --hover-color: #2980b9;
}

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hover-color);
}

h1, h2, h3, h4 {
    margin-bottom: 15px;
    color: var(--secondary-color);
}

section {
    padding: 60px 0;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 100px 0 60px;
    text-align: center;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}

/* 导航样式 */
.main-nav {
    margin-bottom: 30px;
}

.main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 20px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 语言切换按钮样式 */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 5px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.lang-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.lang-btn:hover:not(.active) {
    background-color: rgba(52, 152, 219, 0.1);
}

/* 技能部分样式 */
.skill-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-top: 30px;
}

.skill-category {
    flex: 1;
    min-width: 250px;
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.skill-category ul {
    list-style-type: none;
}

.skill-category li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.skill-category li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 项目展示部分 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 现代化项目卡片样式 */
.project-card {
    background: var(--card-background);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

.project-image {
    position: relative;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-icon {
    font-size: 3rem;
    color: white;
    opacity: 0.9;
}

.project-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.project-content {
    padding: 1.2rem;
}

.project-content h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
}

.project-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(52, 152, 219, 0.2);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: var(--primary-color);
}

.project-features {
    margin-bottom: 1.2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.3rem 0;
    color: var(--light-text);
    font-size: 0.9rem;
}

.feature-item i {
    color: var(--primary-color);
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-support {
    background: #FF813F;
    color: white;
    border: 1px solid #FF813F;
}

.btn-support:hover {
    background: #ff6a1f;
    border-color: #ff6a1f;
    transform: translateY(-2px);
}

.project-links a, .project-links button {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    border: none;
}

.project-links a {
    background-color: var(--primary-color);
    color: white;
}

.project-links a:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

.project-links .donate-link {
    background-color: #28a745;
}

.project-links .donate-link:hover {
    background-color: #218838;
}

.more-info-btn {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--primary-color);
}

.more-info-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

/* 项目详情样式 */
.project-detail {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.project-detail:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.project-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.project-content {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.project-info {
    flex: 1;
    min-width: 300px;
}

.project-description {
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-color);
}

.feature-list {
    padding-left: 20px;
    margin-top: 15px;
}

.feature-list li {
    margin-bottom: 10px;
    line-height: 1.5;
    color: var(--light-text);
}

.project-info h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.project-screenshots {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.screenshot {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.screenshot:hover {
    transform: scale(1.02);
}

.project-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 60px 0;
    opacity: 0.6;
}

.app-link, .github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.app-link {
    background-color: var(--primary-color);
    color: white;
}

.app-link:hover {
    background-color: var(--hover-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.github-link {
    background-color: #333;
    color: white;
}

.github-link:hover {
    background-color: #555;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--background-color);
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10;
}

.close-modal:hover {
    color: var(--primary-color);
}

.project-support {
    margin-top: 20px;
}

.support-options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.support-option {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background-color: var(--card-background);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.support-option:hover {
    transform: translateY(-5px);
}

.support-option i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.qr-codes {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.donate-option:hover .qr-codes {
    display: flex;
    justify-content: space-between;
}

.qr-code {
    text-align: center;
}

.qr-image {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    margin-bottom: 5px;
}

/* 个人信息样式 */
.personal-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.info-item {
    display: flex;
    gap: 10px;
    background-color: var(--card-background);
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.info-label {
    font-weight: bold;
    color: var(--secondary-color);
}

.info-value {
    color: var(--primary-color);
}

/* 联系部分样式 */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--card-background);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background-color: var(--hover-color);
    transform: translateY(-3px);
}

/* 错误消息样式 */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f44336;
    color: white;
    padding: 15px;
    border-radius: 4px;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* 页面加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* 定义了 spin 动画但没有找到使用的地方 */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

/* 但是没有定义 @keyframes spin */

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

.skill-category, .project-card, .tech-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-play-state: paused; /* 初始暂停动画 */
}

.animate {
    animation-play-state: running; /* 当添加animate类时运行动画 */
}

/* 添加动画延迟，使元素依次显示 */
.skill-category:nth-child(1) { animation-delay: 0.1s; }
.skill-category:nth-child(2) { animation-delay: 0.2s; }
.skill-category:nth-child(3) { animation-delay: 0.3s; }

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }

.tech-item:nth-child(1) { animation-delay: 0.1s; }
.tech-item:nth-child(2) { animation-delay: 0.2s; }
.tech-item:nth-child(3) { animation-delay: 0.3s; }
.tech-item:nth-child(4) { animation-delay: 0.4s; }
.tech-item:nth-child(5) { animation-delay: 0.5s; }
.tech-item:nth-child(6) { animation-delay: 0.6s; }
.tech-item:nth-child(7) { animation-delay: 0.7s; }


/* Buy Me a Coffee 按钮样式 */
.bmc-btn-container {
    display: inline-block;
}

.bmc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: #FF813F;
    color: white;
    font-weight: 500;
}

.bmc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    background-color: #ff6a1f;
    color: white;
}

/* 无障碍支持 */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* 响应式设计 - 统一管理所有媒体查询 */
@media (max-width: 768px) {
    /* 头部响应式 */
    header {
        padding: 60px 0 40px;
    }
    
    .avatar {
        width: 120px;
        height: 120px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    /* 语言切换按钮响应式 */
    .language-switcher {
        top: 10px;
        right: 10px;
    }
    
    .lang-btn {
        padding: 3px 8px;
        font-size: 0.8rem;
    }
    
    /* 项目响应式 */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        margin: 0 10px;
    }
    
    .project-image {
        height: 100px;
    }
    
    .project-icon {
        font-size: 2.5rem;
    }
    
    .project-content {
        padding: 1.2rem;
    }
    
    .project-content h3 {
        font-size: 1.2rem;
    }
    
    .project-description {
        font-size: 0.9rem;
    }
    
    .project-links {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1rem;
    }
    
    .project-tags {
        gap: 0.3rem;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
    
    .feature-item {
        font-size: 0.85rem;
    }
    
    /* 保持旧样式兼容性 */
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .project-screenshots {
        order: -1;
    }
    
    .project-detail {
        padding: 20px;
        margin-bottom: 0;
    }
    
    /* 技能响应式 */
    .skill-categories {
        flex-direction: column;
    }
    
    .skill-category {
        width: 100%;
        margin-bottom: 20px;
    }
    
    /* 联系方式响应式 */
    .contact-info {
        flex-direction: column;
    }
    
    .contact-item {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    section {
        padding: 40px 0;
    }
}

/* 暗黑模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f0f0f0;
        --light-text: #ccc;
        --background-color: #121212;
        --card-background: #1e1e1e;
        --border-color: #333;
    }
    
    .loader {
        background-color: #121212;
    }
    
    .loader-spinner {
        border-color: rgba(255, 255, 255, 0.1);
        border-top-color: var(--primary-color);
    }
    
    .project-card, .skill-category, .contact-item, .info-item {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
}

/* 打印样式 */
@media print {
    header, footer, .back-to-top, .social-links, .project-links {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    section {
        padding: 20px 0;
        page-break-inside: avoid;
    }
    
    .container {
        max-width: 100%;
    }
    
    .skill-category, .project-card, .contact-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 技术栈部分样式 */
.tech-stack {
    background-color: var(--section-background);
    padding: 80px 0;
}

.tech-stack-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 30px;
}

.tech-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background-color: var(--card-background);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 1;  /* 确保默认可见 */
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.tech-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tech-icon {
    font-size: 2rem;
    color: var(--primary-color);
    min-width: 50px;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.tech-item p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    flex: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tech-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 15px;
    }
    
    .tech-icon {
        margin-bottom: 15px;
    }
    
    .tech-item p {
        font-size: 1rem;
    }
}

/* 关于我部分样式 */
.about {
    background-color: var(--background-color);
    padding: 80px 0;
}

.about-intro {
    text-align: center;
    margin-bottom: 40px;
}

.about-description {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 30px;
    color: var(--text-color);
}

/* 确保技术栈列表在关于我部分中的样式一致 */
.about .tech-stack-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 30px;
}

/* 个人照片样式 */
.about-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .profile-image {
        width: 150px;
        height: 150px;
    }
}
