/* ==========================================================================
   我的导航页 - “单页应用”布局样式 (SPA Layout Styles)
   ========================================================================== */

/* --- 全局颜色和字体变量 --- */
:root {
    --text-color: #1f2937;
    --secondary-text-color: #6b7280;
    --border-color: #e5e7eb;
    --title-color: #1e40af;
    --accent-color: #3b82f6;
    --app-bg: linear-gradient(to bottom, #f3f7ff, #ffffff);
}

/* --- 基础和背景样式 --- */
html {
    height: 100%;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    margin: 0;
    color: var(--text-color);
    /* 移除 body 的背景 */
    /* background: var(--app-bg); */
    
    /* 核心改动：设置相对定位，让伪元素可以固定在视口 */
    position: relative;
    /* 移除 min-height 和 padding-top，让 body 适应内容 */
    /* min-height: 100vh; */
    /* padding-top: 5vh; */
    box-sizing: border-box;

    /* 使用Flex布局让内容居中 */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* --- [核心] 使用伪元素创建覆盖整个视口的渐变背景 --- */
body::before {
    content: '';
    /* 固定在视口，确保它不会随页面滚动 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--app-bg);
    /* 将伪元素放在所有内容下方 */
    z-index: -1; 
}


/* --- [新] 整体应用容器 --- */
#app-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    box-sizing: border-box;
    /* 核心改动：用 margin-top 创建顶部间距 */
    margin-top: 5vh;
}


/* 导航条容器 */
#main-nav {
    width: 100%;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

/* 导航列表 */
#nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

/* 导航链接 (默认状态) */
#nav-list a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

/* 鼠标悬停状态 */
#nav-list a:hover {
    background-color: var(--bg-main, #f9fafb);
    color: var(--text-dark);
}

/* 激活状态的链接 */
#nav-list a.active-link {
    color: var(--primary-color, #2563eb);
    font-weight: 600;
    border-bottom-color: var(--primary-color, #2563eb);
    background-color: var(--bg-main, #f9fafb);
}

/* --- [新] 主内容“大卡片” --- */
#main-card {
    background-color: #ffffff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
    border: 1px solid #f0f0f0;
}

#card-category-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--text-color);
}

/* [新] 内容切换时的淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#card-grid-container {
    animation: fadeIn 0.5s ease;
}

/* --- 卡片网格和小卡片样式 (基本不变) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.site-card {
    overflow: hidden;
    padding-left: 24px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: #fafafa;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.site-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.site-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    object-position: center;
}

.site-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 16px;
}

.site-desc {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}