/* 全局样式 */
:root {
    --primary-bg: #f8f5f2;
    --primary-text: #333;
    --secondary-text: #666;
    --accent-color: #8b9a8b;
    --accent-color-light: #a6b3a6;
    --border-color: #e8e4e0;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', Georgia, Times New Roman, serif;
    background-color: var(--primary-bg);
    color: var(--primary-text);
    line-height: 1.8;
    font-size: 1rem;
    width: 100%;
    min-width: 320px;
    overflow-x: hidden;
}

code, pre {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

/* 导航栏 */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(248, 245, 242, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-text);
    text-decoration: none;
    transition: color 0.3s ease;
    font-family: Georgia, Times New Roman, serif;
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-text);
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

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

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

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-text);
}

/* 容器 */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 内容区域 */
main {
    padding: 2rem 0;
    width: 100%;
}

section {
    width: 100%;
}

/* 通用部分样式 */
section {
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-text);
    position: relative;
    padding-bottom: 1rem;
}

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

/* 关于部分 */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

.about-content p {
    margin-bottom: 1.5rem;
}

/* 文章列表样式 */
.articles-section, .articles-page {
    background-color: var(--primary-bg);
}

.latest-articles, .article-list {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

.article-item {
    background-color: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.article-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

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

.article-title a:hover {
    color: var(--accent-color);
}

.article-meta {
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-excerpt {
    color: var(--secondary-text);
    margin-bottom: 1.5rem;
}

.read-more {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: var(--accent-color-light);
}

.view-all-container {
    text-align: center;
    margin-top: 2rem;
}

.view-all-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: transparent;
    color: var(--accent-color);
    text-decoration: none;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.view-all-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* 文章标签页样式 */
.article-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
}

.tab-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 文章详情页样式 */
.post-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background-color: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-text);
    line-height: 1.3;
}

.post-meta {
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-content {
    font-size: 1.1rem;
    color: var(--primary-text);
}

.post-content h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--primary-text);
}

.post-content h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--primary-text);
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content strong {
    font-weight: 600;
    color: var(--primary-text);
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.8rem 1.5rem;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.back-link:hover {
    background-color: var(--accent-color-light);
}

/* 项目部分样式 */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.project-item {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

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

.project-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-text);
}

/* 页脚样式 */
footer {
    background-color: var(--primary-text);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Instagram和LinkedIn图标使用白色 */
.social-links a[href*="instagram"],
.social-links a[href*="linkedin"] {
    color: white;
    font-size: 1.5rem;
}

.copyright {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    text-align: center;
    animation: slideIn 0.3s ease;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-text);
    transition: color 0.3s ease;
}

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

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--primary-text);
}

.modal-content img {
    max-width: 100%;
    height: auto;
}

/* 小红书图标样式 */
.xhx-logo {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1199px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--primary-bg);
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 2rem;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .hamburger {
        display: block;
    }

    .container {
        padding: 0 1.5rem;
    }

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

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

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

    .post-container {
        padding: 2rem;
    }

    .article-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .social-links {
        gap: 1.5rem;
    }

    .social-links a {
        font-size: 1.3rem;
        width: 35px;
        height: 35px;
        line-height: 35px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .nav-container {
        padding: 1rem;
    }

    .container {
        padding: 0 1rem;
    }

    main {
        margin-top: 70px;
        padding: 1.5rem 0;
    }

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

    .about-content {
        font-size: 1rem;
    }

    .article-item, .project-item {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.3rem;
    }

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

    .post-container {
        padding: 1.5rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-links a {
        font-size: 1.2rem;
        width: 30px;
        height: 30px;
        line-height: 30px;
    }

    footer {
        padding: 2rem 0;
    }
}
