/* 全局重置 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* 大背景保持浅灰，作为衬托 */
    background: #f4f6f8; 
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
header {
    background: white;
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
}

/* --- 核心容器 --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); 
    gap: 12px;
}

/* --- 卡片样式 (关键修改) --- */
.nav-card {
    /* 【修改点】背景色改为纯白，与 #f4f6f8 形成鲜明对比 */
    background: #ffffff; 
    
    border-radius: 8px;
    
    /* 【修改点】阴影稍微加深一点，因为白底在灰底上需要更强的边界感 */
    box-shadow: 0 0 8px rgba(0,0,0,0.12); 
    
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: #333;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    
    padding: 4px 6px; 
}

.nav-card:hover {
    transform: translateY(-2px);
    /* 悬停时阴影更重，突出悬浮感 */
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

/* 图片：圆角正方形 */
.nav-card img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    object-fit: cover;
    /* 图片背景如果透明，这里设为白色或浅灰以防穿帮 */
    background: #f9f9f9; 
    display: block;
    
    border-radius: 6px;
    
    /* 图标阴影保持柔和 */
    box-shadow: 0 0 4px rgba(0,0,0,0.1);
    
    max-width: 90px; 
}

/* 网站名称 */
.nav-card .name {
    margin-top: 4px;
    
    width: 100%;
    max-width: 90px;
    
    background-color: transparent;
    color: #000000;
    
    padding: 0;      
    border-radius: 0;
    
    font-size: 0.75rem;
    font-weight: 500;
    
    text-align: center;
    line-height: 1.2;
    height: 1.2em;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    white-space: nowrap;      
    overflow: hidden;         
    text-overflow: ellipsis;
}

/* 加载提示 */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* --- 底部版权样式 --- */
.site-footer {
    grid-column: 1 / -1; 
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 2rem 0;
    margin-top: 2rem;
    color: #999;
    font-size: 0.85rem;
    background: transparent;
    border-top: 1px solid #e0e0e0; /* 底部边框稍微加深 */
}

.site-footer p {
    margin: 0;
    padding: 0;
}

/* --- 手机端特别优化 --- */
@media (max-width: 480px) {
	.site-footer {
	    padding: 1.5rem 0;
	    font-size: 0.75rem;
	}
    .container {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); 
        gap: 10px;
    }
    
    header {
        padding: 0.8rem 1rem;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .nav-card {
        padding: 2px 4px;
        background: #ffffff; /* 手机也是白底 */
        box-shadow: 0 0 6px rgba(0,0,0,0.1);
    }

    .nav-card:hover {
        box-shadow: 0 0 10px rgba(0,0,0,0.15);
    }
    
    .nav-card img {
        max-width: 75px;
        border-radius: 4px;
        background: #f9f9f9;
        box-shadow: 0 0 3px rgba(0,0,0,0.1);
    }
    
    .nav-card .name {
        max-width: 75px;
        font-size: 0.65rem;
        margin-top: 3px;
        line-height: 1.2;
        height: 1.2em;
    }
}