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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    transition: background-color 0.3s, color 0.3s;
}

/* 深色模式 */
body.dark-mode {
    background-color: #1a1a1a;
    color: #f0f0f0;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.dark-mode {
    background: #2d2d2d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo h1 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo h1.dark-mode {
    color: #f0f0f0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link.dark-mode {
    color: #f0f0f0;
}

.nav-link:hover {
    color: #3498db;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3498db;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* 语言切换 */
.language-toggle {
    display: flex;
    gap: 5px;
    margin-left: 20px;
}

#lang-toggle, #lang-toggle-en {
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: transparent;
    color: #333;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#lang-toggle.dark-mode, #lang-toggle-en.dark-mode {
    border: 1px solid #555;
    color: #f0f0f0;
}

#lang-toggle:hover, #lang-toggle-en:hover {
    background: #f0f0f0;
}

#lang-toggle.dark-mode:hover, #lang-toggle-en.dark-mode:hover {
    background: #444;
}

#lang-toggle.active, #lang-toggle-en.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 主题切换 */
.theme-toggle {
    margin-left: 20px;
}

#theme-toggle {
    background: transparent;
    border: 1px solid #ccc;
    color: #333;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

#theme-toggle.dark-mode {
    border: 1px solid #555;
    color: #f0f0f0;
}

#theme-toggle:hover {
    background: #f0f0f0;
}

#theme-toggle.dark-mode:hover {
    background: #444;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger.dark-mode span {
    background-color: #f0f0f0;
}

/* 主要内容区域 */
main {
    margin-top: 70px;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 100px 100px;
}

.hero-content {
    max-width: 800px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.cta-button {
    background: #fff;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease-out 0.6s both;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* 关于我部分 */
.about {
    padding: 80px 0;
    background-color: #fff;
    transition: background-color 0.3s;
}

.about.dark-mode {
    background-color: #2d2d2d;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #2c3e50;
    position: relative;
}

.section-title.dark-mode {
    color: #f0f0f0;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 2px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 20px;
}

.about-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.about-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    margin-top: 2em;
    line-height: 1.8;
}

/* 技能和成就组合布局 */
.skills-achievements-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    align-items: stretch;
}

/* 技能标签样式 */
.skills {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.skills h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    flex-shrink: 0;
}

.skills h3.dark-mode {
    color: #f0f0f0;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-content: center;
    height: 100%;
}

.skill-tag {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 0 0 auto;
}

.skill-tag.dark-mode {
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.skill-tag.expert {
    background: linear-gradient(135deg, #FF9A8B 0%, #FF6A88 50%, #FF99AC 100%);
    color: white;
}

.skill-tag.intermediate {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.skill-tag.beginner {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

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

/* 个人成就样式 */
.achievements {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.achievements h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.achievements h3.dark-mode {
    color: #f0f0f0;
}

.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
    flex: 1;
    justify-content: space-evenly;
    padding: 20px 0;
}

.achievement-item {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    width: 20rem;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
    color: white;
    text-align: center;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
    font-size: 0.9rem;
}

.achievement-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(106, 17, 203, 0.4);
}

/* 时间线样式 */
.timeline-section {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.timeline h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.4rem;
}

.timeline h3.dark-mode {
    color: #f0f0f0;
}

.timeline-container {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #6a11cb;
    transition: all 0.3s ease;
}

.timeline-item.dark-mode {
    background: #3d3d3d;
    border-left: 4px solid #2575fc;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 25px;
    width: 12px;
    height: 12px;
    background: #6a11cb;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #6a11cb;
}

.timeline-item.dark-mode::before {
    border: 3px solid #2d2d2d;
    box-shadow: 0 0 0 3px #2575fc;
}

.timeline-date {
    font-weight: bold;
    color: #6a11cb;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.timeline-content p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-line;
}

.timeline-content p.dark-mode {
    color: #ccc;
}

/* 个人头像样式 */
.profile-image {
    width: 100%;
    max-width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 4px solid #fff;
    margin-bottom: 25px;
    overflow: hidden;
}

.profile-image.dark-mode {
    border: 4px solid #2d2d2d;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

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

/* 项目部分 */
.projects {
    padding: 80px 0;
    background-color: #f8f9fa;
    transition: background-color 0.3s;
}

.projects.dark-mode {
    background-color: #1a1a1a;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.project-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.dark-mode {
    background: #2d2d2d;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.project-card.dark-mode:hover {
    box-shadow: 0 15px 30px rgba(37, 117, 252, 0.4);
}

.project-card.dark-mode:hover .project-img {
    transform: scale(1.05);
}

.project-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    position: relative;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-img:hover {
    transform: scale(1.05);
}

.project-img.dark-mode {
    filter: brightness(0.9);
}

.project-placeholder {
    font-size: 4rem;
    color: rgba(255,255,255,0.8);
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.project-info h3.dark-mode {
    color: #f0f0f0;
}

.project-info p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

.project-info p.dark-mode {
    color: #ccc;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #3498db;
}

.project-link.dark-mode {
    color: #64b5f6;
    border: 1px solid #64b5f6;
}

.project-link:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.1);
}

.project-link.dark-mode:hover {
    color: #42a5f5;
    background: rgba(100, 181, 246, 0.1);
}

/* 联系部分 */
.contact {
    padding: 80px 0;
    background-color: #fff;
    transition: background-color 0.3s;
}

.contact.dark-mode {
    background-color: #2d2d2d;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.social-section {
    text-align: center;
    padding: 20px;
}

.social-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 30px;
    text-align: center;
}

.social-section h3.dark-mode {
    color: #f0f0f0;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

.social-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.4);
}

.social-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.social-item span:last-child {
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.contact-form.dark-mode {
    background: #3d3d3d;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.contact-form h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.3rem;
    text-align: center;
}

.contact-form h3.dark-mode {
    color: #f0f0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 1rem;
}

.form-group label.dark-mode {
    color: #f0f0f0;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    font-family: inherit;
}

.form-group input.dark-mode,
.form-group textarea.dark-mode {
    background: #444;
    border: 2px solid #555;
    color: #f0f0f0;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.4);
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 30px 0;
    transition: background-color 0.3s;
}

.footer.dark-mode {
    background: #1a1a1a;
    color: #f0f0f0;
}

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

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 20px 0;
    }

    .nav-menu.dark-mode {
        background-color: #2d2d2d;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* 移动端关于我部分调整 */
    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .about-left {
        order: 2;
    }
    
    .about-right {
        order: 1;
        align-items: center;
    }
    
    .profile-image {
        max-width: 220px;
        height: 220px;
    }
    
    /* 移动端技能和成就布局 */
    .skills-achievements-container {
        grid-template-columns: 1fr;
        gap: 20px;
        align-items: start;
    }
    
    .skills {
        height: auto;
    }
    
    .achievements {
        max-width: 100%;
        height: auto;
    }
    
    .achievement-list {
        max-width: 350px;
        margin: 0 auto;
        flex: none;
        justify-content: flex-start;
        padding: 0;
    }
    
    .skill-tags {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        height: auto;
        align-content: flex-start;
    }
    
    .skill-tag {
        height: auto;
        padding: 8px 16px;
        min-height: auto;
    }
    
    /* 移动端时间线样式 */
    .timeline-container {
        padding-left: 20px;
    }
    
    .timeline-container::before {
        left: 10px;
    }
    
    .timeline-item {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .timeline-item::before {
        left: -27px;
    }
    
    /* 移动端联系区域布局 */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .social-section {
        order: 1;
    }
    
    .contact-form {
        order: 2;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .about,
    .projects,
    .contact {
        padding: 50px 0;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* 小屏幕联系区域优化 */
    .contact-content {
        gap: 20px;
    }
    
    .social-section {
        padding: 15px;
    }
    
    .contact-form {
        padding: 20px;
    }
}