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

/* CSS 变量定义 */
:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --accent-color: #3498db;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
}

/* 基础样式 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

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

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-logo a:hover {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

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

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

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.hero-content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.hero-avatar {
    margin-bottom: var(--spacing-lg);
}

.avatar-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-bg);
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
}

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

.hero-title {
    margin-bottom: var(--spacing-md);
}

.title-main {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.title-sub {
    display: block;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-secondary);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.tag {
    background: var(--accent-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--primary-bg);
    color: var(--text-secondary);
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

.social-link:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

/* 通用 Section 样式 */
section {
    padding: var(--spacing-xxl) 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* 关于我 Section */
.about {
    background: var(--secondary-bg);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* 摄影作品 Section */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.photo-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: var(--transition);
}

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

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: var(--spacing-lg);
    transform: translateY(100%);
    transition: var(--transition);
}

.photo-item:hover .photo-overlay {
    transform: translateY(0);
}

.photo-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xs);
}

/* 文章 Section */
.articles {
    background: var(--secondary-bg);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.article-card {
    background: var(--primary-bg);
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.article-meta {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.article-category {
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-date,
.article-read-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.article-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    line-height: 1.4;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.article-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.article-link:hover {
    text-decoration: underline;
}

/* 简历 Section */
.resume-content {
    max-width: 800px;
    margin: 0 auto;
}

.resume-section {
    margin-bottom: var(--spacing-xl);
}

.resume-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: var(--spacing-xs);
}

.resume-item {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--secondary-bg);
    border-radius: 8px;
}

.resume-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.resume-date {
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.skills-grid {
    display: grid;
    gap: var(--spacing-md);
}

.skill-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.skill-name {
    min-width: 120px;
    font-weight: 500;
}

.skill-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

.resume-download {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--accent-color);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.download-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* AI助手模块样式 */
#ai-assistant-section {
    margin-top: 30px; /* 与上方下载PDF按钮的垂直间距 */
    padding: 40px;
    background: #f8f9fa; /* 浅灰色背景 */
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* 轻微阴影营造悬浮效果 */
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto; /* 水平居中 */
    border: 1px solid #e9ecef;
}

#ai-assistant-section .section-title {
    position: relative;
    margin-bottom: var(--spacing-xl);
}

#ai-assistant-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent-color); /* 蓝色分隔线 */
    border-radius: 2px;
}

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

.ai-assistant-intro p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.ai-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--secondary-bg);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.feature-icon.training {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.feature-icon.photography {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.feature-icon.chat {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.feature-icon.online {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.feature-card h4 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.ai-chat-button-container {
    text-align: center;
    margin-top: 40px;
}

.chat-button {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
    color: white;
    text-decoration: none;
}

/* 聊天窗口样式 */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.chat-window {
    background: white;
    width: 90%;
    max-width: 500px;
    height: 600px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: white;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
}

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.send-button:hover {
    transform: scale(1.05);
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
}

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.assistant {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
}

.message p {
    margin: 0;
}

/* 页脚 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-social {
    display: flex;
    gap: var(--spacing-sm);
}

.footer .social-link {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.footer .social-link:hover {
    background: var(--accent-color);
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-light);
        padding: var(--spacing-lg) 0;
    }

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

    .hamburger {
        display: flex;
    }

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

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

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

    .title-main {
        font-size: 2.5rem;
    }

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

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

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

    .photo-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .footer .container {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .hero-tags {
        justify-content: center;
    }

    .article-meta {
        justify-content: center;
    }

    .skill-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .skill-name {
        min-width: auto;
    }

    .ai-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .chat-window {
        width: 95%;
        height: 80vh;
    }
}

@media (max-width: 480px) {
    .title-main {
        font-size: 2rem;
    }

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

    .nav-container {
        padding: 0 var(--spacing-md);
    }

    .photo-grid,
    .articles-grid {
        gap: var(--spacing-md);
    }
}

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

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}