/* 性能优化：图片懒加载样式 */
img[loading="lazy"] {
    transition: opacity 0.3s ease;
}

img[loading="lazy"]:not([src]) {
    opacity: 0;
}

/* 项目卡片样式 - 现代化统一设计 */
.project-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    will-change: transform;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.project-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

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

.project-card:hover .project-image img {
    transform: scale(1.08);
}

/* 分类标签 */
.project-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    background-color: rgba(231, 76, 60, 0.9);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-info {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.project-description {
    color: #7f8c8d;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #95a5a6;
    font-weight: 500;
}

/* 难度标签样式优化 */
.difficulty {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.difficulty:contains('初级'), .difficulty:contains('beginner') {
    background-color: #27ae60;
    color: white;
}

.difficulty:contains('中级'), .difficulty:contains('intermediate') {
    background-color: #f39c12;
    color: white;
}

.difficulty:contains('高级'), .difficulty:contains('advanced') {
    background-color: #e74c3c;
    color: white;
}

/* View Details按钮样式优化 */
.view-details-btn {
    width: 100%;
}

.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.view-all-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.view-all-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* DIY Tips Section */
.diy-tips {
    margin: 4rem 0;
    background-color: #f8f9fa;
    padding: 3rem;
    border-radius: 8px;
}

.diy-tips h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2c3e50;
}

.tips-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tip-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.tip-card h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.tip-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

/* Featured Tutorials */
.featured-tutorials {
    margin: 4rem 0;
}

.featured-tutorials h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2c3e50;
}

.tutorial-highlight {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.tutorial-highlight img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tutorial-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tutorial-content h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.tutorial-content p {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tutorial-meta span {
    padding: 0.5rem 1rem;
    background-color: #f1f2f6;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.read-more {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    align-self: flex-start;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: #2980b9;
}

/* User Stories */
.user-stories {
    margin: 4rem 0;
    background-color: #f8f9fa;
    padding: 3rem;
    border-radius: 8px;
}

.user-stories h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    color: #2c3e50;
}

.user-stories p {
    text-align: center;
    margin-bottom: 2rem;
    color: #7f8c8d;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.story-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.story-card::before {
    content: "\"";
    font-size: 4rem;
    color: #ecf0f1;
    position: absolute;
    top: 10px;
    left: 10px;
    opacity: 0.5;
}

.story-text {
    font-style: italic;
    color: #2c3e50;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    padding-left: 1rem;
}

.story-author {
    color: #e74c3c;
    font-weight: 600;
    text-align: right;
    margin-bottom: 0;
}

/* Newsletter Section */
.newsletter {
    margin: 4rem 0;
    text-align: center;
    background-color: #2c3e50;
    color: white;
    padding: 4rem 2rem;
    border-radius: 8px;
}

.newsletter h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.newsletter p {
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
}

.newsletter-form button {
    padding: 1rem 2rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #c0392b;
}

#loadMoreBtn {
    padding: 12px 30px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#loadMoreBtn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

#loadMoreBtn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

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

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.logo .tagline {
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
    margin: 0;
}

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

.nav-links a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 16px;
}

.nav-links a:hover,
.nav-links a.active {
    color: #e74c3c;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    margin: 3px 0;
    transition: 0.3s;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero-content h2 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: bold;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
}

.search-box button {
    padding: 15px 30px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background-color: #c0392b;
}

/* 分类导航 */
.categories {
    margin-bottom: 50px;
}

.categories h3 {
    text-align: center;
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 40px;
}

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

.category-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-card h4 {
    padding: 20px;
    text-align: center;
    color: #2c3e50;
    font-size: 18px;
}

/* 项目网格 */
.featured-projects {
    margin: 4rem 0;
}

.featured-projects h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    color: #2c3e50;
}

.featured-projects p {
    text-align: center;
    margin-bottom: 2rem;
    color: #7f8c8d;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

/* 项目卡片样式已在文件上方定义 */

.difficulty {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

/* 标准CSS类选择器 - 支持各种难度级别 */
.difficulty-badge.beginner,
.difficulty-badge.junior,
.difficulty.beginner,
.difficulty.junior {
    background-color: #27ae60;
    color: white;
}

.difficulty-badge.intermediate,
.difficulty-badge.medium,
.difficulty.intermediate,
.difficulty.medium {
    background-color: #f39c12;
    color: white;
}

.difficulty-badge.advanced,
.difficulty-badge.expert,
.difficulty.advanced,
.difficulty.expert {
    background-color: #e74c3c;
    color: white;
}

/* 难度筛选 */
.difficulty-filter {
    text-align: center;
    margin-bottom: 40px;
}

.difficulty-filter h3 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #3498db;
    color: white;
}

/* 最新教程 */
.recent-tutorials {
    margin-bottom: 50px;
}

.recent-tutorials h3 {
    text-align: center;
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 40px;
}

.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.tutorial-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.tutorial-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.tutorial-card-content {
    padding: 20px;
}

.tutorial-card h4 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
}

.tutorial-card .category {
    display: inline-block;
    padding: 3px 8px;
    background-color: #ecf0f1;
    color: #7f8c8d;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* 页脚 */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
}

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

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #ecf0f1;
}

.footer-section p {
    line-height: 1.6;
    color: #bdc3c7;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #ecf0f1;
}

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

.social-links a {
    font-size: 24px;
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #ecf0f1;
}

.friendly-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friendly-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.friendly-links a:hover {
    color: #ecf0f1;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .hero-content h2 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .search-box {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box input,
    .search-box button {
        width: 100%;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .tutorials-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Gallery Page Responsive Styles */
    .search-filter-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sort-options {
        width: 100%;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tutorial-highlight {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero-content h2 {
        font-size: 28px;
    }
    
    .categories h3,
    .featured-projects h3,
    .recent-tutorials h3 {
        font-size: 24px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .project-card img {
        height: 200px;
    }
    
    /* Gallery Page Mobile Styles */
    .gallery-title h1 {
        font-size: 28px;
    }
    
    .search-input {
        font-size: 14px;
        padding: 10px;
    }
    
    .filter-group label {
        font-size: 14px;
    }
    
    .filter-group select {
        font-size: 14px;
        padding: 10px;
    }
    
    .results-count {
        font-size: 14px;
    }
    
    .pagination button {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .tip-card,
    .story-card {
        padding: 1.5rem;
    }
    
    .tip-card h4,
    .story-card h4 {
        font-size: 1.2rem;
    }
}

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

.project-card,
.tutorial-card,
.category-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%, 100% {
        content: "...";
    }
}