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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.nav-logo h2 {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
}

.nav-logo i {
    margin-right: 10px;
    color: #ffd700;
}

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

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

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

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

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

/* 首页横幅 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* 搜索容器 */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    outline: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.search-btn {
    position: absolute;
    right: 5px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(238, 90, 36, 0.4);
}

/* 过滤器部分 */
.filter-section {
    padding: 40px 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.filter-btn {
    padding: 12px 25px;
    border: 2px solid #667eea;
    background-color: transparent;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* 内容展示区域 */
.content-section {
    padding: 60px 0;
}

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

/* 内容卡片 */
.content-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.content-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-header {
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-header i {
    font-size: 2rem;
    color: #667eea;
}

.card-header h3 {
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

.card-body p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.7;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.card-footer {
    padding: 20px 25px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.learn-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.learn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.difficulty {
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.difficulty.easy {
    background-color: #d4edda;
    color: #155724;
}

.difficulty.medium {
    background-color: #fff3cd;
    color: #856404;
}

.difficulty.hard {
    background-color: #f8d7da;
    color: #721c24;
}

/* 无搜索结果 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ccc;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* 关于部分 */
.about-section {
    background-color: white;
    padding: 80px 0;
    margin-top: 40px;
}

.about-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #333;
}

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

.about-text p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.8;
}

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

.feature {
    text-align: center;
    padding: 30px 20px;
}

.feature i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.feature h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
}

.feature p {
    color: #666;
    line-height: 1.6;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
}

.footer p {
    margin-bottom: 10px;
}

.icp-info {
    font-size: 0.9rem;
    opacity: 0.8;
}

.icp-info a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-info a:hover {
    color: white;
    text-decoration: underline;
}

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

.content-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 20px 0;
    }

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

    .nav-toggle {
        display: flex;
    }

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

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

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

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-buttons {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .search-container {
        max-width: 90%;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

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

    .hero-content h1 {
        font-size: 2rem;
    }

    .nav-container {
        padding: 0 15px;
    }

    .container {
        padding: 0 15px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        padding: 20px;
    }

    .card-body {
        padding: 20px;
    }

    .card-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 隐藏/显示动画 */
.hidden {
    display: none !important;
}

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