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

:root {
    --primary-color: #0088cc;
    --secondary-color: #00aced;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

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

/* 导航栏 */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 40px;
    width: auto;
    border-radius: 6px;
    transition: var(--transition);
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

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

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

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

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: var(--transition);
}

/* 头部横幅 */
.hero {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.8), rgba(0, 172, 237, 0.8)), url('assets/banners/bannner-pc.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 4rem 0;
    text-align: center;
    position: relative;
}

/* 为hero添加一个遮罩层以确保文字可读性 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

/* 横幅图片样式（备选方案） */
.hero-banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 主要内容区域 */
.section {
    padding: 4rem 0;
}

.alt-bg {
    background-color: #fff;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    text-align: center;
}

.section-desc {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* 视图切换按钮 */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.view-toggle button {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.view-toggle button.active {
    background: var(--primary-color);
    color: white;
}

.view-toggle button:hover {
    background: var(--primary-color);
    color: white;
}

/* 资源卡片网格视图 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 列表视图 */
.resource-grid.list-view {
    display: block;
    max-width: 900px;
    margin: 2rem auto;
}

.resource-grid.list-view .resource-card {
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.resource-grid.list-view .resource-card h3 {
    font-size: 1.1rem;
    display: inline-block;
    margin-right: 1rem;
}

.resource-grid.list-view .resource-card p {
    display: inline;
    margin: 0;
}

.resource-grid.list-view .resource-card .btn {
    float: right;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* 子分类标题 */
.col-span-full {
    grid-column: 1 / -1;
}

.resource-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid #e0e0e0;
}

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

.resource-grid.list-view .resource-card:hover {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.resource-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.resource-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.resource-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* 资源统计信息样式 */
.resource-stats {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    font-weight: 500;
}

.stats-number {
    color: var(--primary-color);
    font-weight: 600;
}

/* 资源附加信息样式 */
.resource-info {
    color: #777;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.resource-card p:last-of-type {
    margin-bottom: 1.5rem;
}

/* 资源标签样式 */
.resource-tags {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resource-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.resource-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

/* 申请加入按钮特殊样式 */
.btn-apply {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    position: relative;
}

.btn-apply:hover {
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
    transform: scale(1.05);
}

.btn-apply::before {
    content: "🔒 ";
    margin-right: 0.25rem;
}

/* 页脚 */
.footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer p {
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .logo-img {
        height: 32px;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 0;
    }

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

    .nav-menu li {
        margin: 1rem 0;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 3rem 0;
        background-position: center top;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

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

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
