:root {
    --primary-color: #3EBF39;
    --primary-dark: #2E9D2A;
    --primary-light: #4EDF49;
    --bg-color: #FFFFFF;
    --bg-secondary: #F5F7FA;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --border-color: #E5E7EB;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 确保导航栏中的容器使用相同的宽度限制 */
.header .container {
    max-width: var(--max-width);
    width: 100%;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--text-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

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

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 10px;
    position: relative;
}

.read-more::after {
    content: '→';
    margin-left: 5px;
    transition: var(--transition);
}

.read-more:hover::after {
    margin-left: 10px;
}

/* 导航栏样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
}

.main-nav {
    display: flex;
    align-items: center;
}

.logo a {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.logo a span {
    color: var(--primary-color);
}

.main-nav {
    position: relative;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--text-color);
    position: relative;
    transition: var(--transition);
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    margin-left: 15px;
}

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

/* 个人介绍区样式 */
.hero {
    padding: 100px 0 80px;
    background-color: var(--bg-secondary);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="white"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23f0f0f0" stroke-width="0.5"/></svg>');
    background-size: 20px 20px;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.hero-image {
    flex: 0 0 200px;
}

.avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--bg-color);
    box-shadow: 0 0 20px rgba(62, 191, 57, 0.3);
    transition: var(--transition);
}

.avatar:hover {
    box-shadow: 0 0 30px rgba(62, 191, 57, 0.5);
}

.hero-text {
    flex: 1;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.stats {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-3px);
}

/* 特色内容区样式 */
.featured {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.featured-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.featured-card {
    display: none;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeIn 0.5s ease-in-out;
}

.featured-card.active {
    display: flex;
}

.featured-image {
    flex: 0 0 40%;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.featured-content .category {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 15px;
    align-self: flex-start;
}

.featured-content h3 {
    margin-bottom: 15px;
}

.featured-content p {
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

.slider-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.prev-btn,
.next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.prev-btn:hover,
.next-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

/* 文章卡片网格样式 */
.articles {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}

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

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    grid-auto-flow: row;
}

.article-card {
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.article-image {
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-content .category {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
    align-self: flex-start;
}

.article-content h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.article-content p {
    color: var(--text-light);
    margin-bottom: 15px;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-lighter);
}

.load-more {
    text-align: center;
}

.load-more-btn {
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
}

.load-more-btn:hover {
    background-color: var(--primary-dark);
}

/* 侧边栏样式 */
.sidebar {
    padding: 50px 0;
    background-color: var(--bg-color);
}

.sidebar-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.sidebar-section {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.sidebar-section h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 10px;
}

.sidebar-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.about-me .author-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
}

.about-me .author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-me p {
    color: var(--text-light);
    margin-bottom: 15px;
    text-align: center;
}

.about-me .read-more {
    display: block;
    text-align: center;
}

.popular-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.popular-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-list a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    transition: var(--transition);
}

.popular-list a:hover {
    color: var(--primary-color);
}

.post-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}

.post-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 15px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.tag:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.newsletter-form input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.subscribe-btn {
    padding: 12px 15px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.subscribe-btn:hover {
    background-color: var(--primary-dark);
}

/* 页脚样式 */
.footer {
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 70px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-section h3 {
    color: var(--bg-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    font-size: 1.3rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.footer-section .social-links {
    margin-top: 20px;
}

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

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-section.contact ul li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section.contact ul li i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

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

/* 阅读进度指示器 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* 图片查看器 */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.image-viewer.active {
    opacity: 1;
    visibility: visible;
}

.image-viewer-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.close-viewer {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--bg-color);
    font-size: 30px;
    cursor: pointer;
    transition: var(--transition);
}

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

.viewer-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--border-radius);
}

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

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-image {
        margin-bottom: 30px;
    }
    
    .stats {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .featured-card {
        flex-direction: column;
    }
    
    .featured-image {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        align-self: flex-end;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        max-width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 20px 0;
        gap: 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu ul li {
        margin: 15px 0;
    }
    
    .nav-menu ul li a {
        font-size: 1.1rem;
        padding: 10px 0;
        display: block;
    }
    
    .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);
    }
    
    .articles-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-container {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    
    .filter-container::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
    
    .filter-buttons {
        display: flex;
        gap: 8px;
        padding-bottom: 5px;
    }
    
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .hero {
        padding: 120px 0 60px;
    }
    
    .avatar {
        width: 150px;
        height: 150px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .featured,
    .articles,
    .sidebar {
        padding: 60px 0;
    }
    
    .footer {
        padding: 50px 0 20px;
    }
}

/* 代码样式 */
code, pre {
    font-family: 'Fira Code', monospace;
}

pre {
    background-color: var(--bg-secondary);
    padding: 15px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 15px 0;
}

code {
    background-color: var(--bg-secondary);
    padding: 2px 5px;
    border-radius: 3px;
    color: var(--primary-dark);
}

/* 图片懒加载 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* 图库网格 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
    grid-auto-flow: row;
}

/* 图库项目 */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 250px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* 视频网格 */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
    grid-auto-flow: row;
}

/* 视频卡片 */
.video-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.video-thumbnail {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}