/* 关键CSS - 确保页面基本布局在完整CSS加载前可见 */
.category-content {
    display: none !important;
}
.category-content.active {
    display: block !important;
}
.category-button.active {
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    color: white;
    box-shadow: 0 4px 12px rgba(36, 198, 220, 0.2);
}
/* 确保编程语言默认显示 */
#language-content.active {
    display: block !important;
}

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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f6f9fc 0%, #edf1f7 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

header {
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(36, 198, 220, 0.2);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.1) 50%, transparent 55%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header-content {
    text-align: center;
}

.header-content h1 {
    color: white;
    font-size: 2.4em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.back-link {
    position: absolute;
    top: 15px;
    left: 15px;
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    font-size: 14px;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-link:hover {
    transform: translateX(-5px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

.back-link::before {
    content: '←';
    margin-right: 6px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.back-link:hover::before {
    transform: translateX(-5px);
}

.category-nav {
    background: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.category-button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #f8f9fa;
    color: #514A9D;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    min-width: 100px;
}

.category-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 10px;
}

.knowledge-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

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

.knowledge-icon {
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    border-radius: 12px;
    transition: transform 0.3s ease;
    color: white;
    font-size: 2em;
}

.knowledge-card:hover .knowledge-icon {
    transform: scale(1.1) rotate(5deg);
}

.knowledge-info {
    flex: 1;
}

.knowledge-info h3 {
    color: #514A9D;
    font-size: 1.3em;
    margin-bottom: 8px;
}

.knowledge-info p {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 12px;
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 页面加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f6f9fc 0%, #edf1f7 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loader-content svg {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 添加加载文字 */
.loader-content::after {
    content: '加载中...';
    color: #514A9D;
    font-size: 16px;
    font-weight: 500;
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '加载中.'; }
    40% { content: '加载中..'; }
    60%, 100% { content: '加载中...'; }
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header-content h1 {
        font-size: 2em;
    }

    .category-button {
        padding: 10px 15px;
        font-size: 14px;
        min-width: 90px;
    }

    .knowledge-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .knowledge-card {
        padding: 15px;
    }

    .knowledge-icon {
        min-width: 50px;
        height: 50px;
        font-size: 1.5em;
    }

    .knowledge-info h3 {
        font-size: 1.2em;
    }

    .knowledge-info p {
        font-size: 0.9em;
    }
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link:hover {
    text-decoration: none;
}

/* 防止卡片链接和详情按钮冲突 */
.detail-link {
    position: relative;
    z-index: 2;
}

/* 当点击详情按钮时阻止卡片链接触发 */
.detail-link:hover {
    text-decoration: none;
}

.knowledge-links {
    display: flex;
    gap: 10px;
}

.knowledge-links a {
    padding: 8px 15px;
    background: linear-gradient(135deg, #24C6DC, #514A9D);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.knowledge-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 198, 220, 0.2);
} 