@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #121212; /* 深邃背景 */
    --card-bg: #1e1e1e; /* 卡片背景 */
    --text-color: #e0e0e0; /* 主要文本颜色 */
    --primary-color: #00aaff; /* 主题亮色，例如蓝色 */
    --secondary-color: #00ddc6; /* 次要亮色，例如青色 */
    --card-shadow: rgba(0, 0, 0, 0.4);
    --card-hover-shadow: rgba(0, 170, 255, 0.5);
    --border-radius: 12px;
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* 炫酷的动态渐变背景 (可选) */
    background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #1a2a6c);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    text-align: center;
    padding: 50px 20px 30px;
    animation: fadeInDown 1s ease-out;
}

header h1 {
    font-size: 2.8em;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    color: var(--text-color);
    opacity: 0.8;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 响应式列 */
    gap: 25px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    flex-grow: 1;
}

.nav-item {
    background-color: var(--card-bg);
    /* 使用半透明背景以透出动态背景 (如果启用了动态背景) */
    /* background-color: rgba(30, 30, 30, 0.8); */
    /* backdrop-filter: blur(5px); */ /* 毛玻璃效果，配合半透明背景 */
    
    border-radius: var(--border-radius);
    padding: 25px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 5px 15px var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* 确保伪元素在卡片内 */
    position: relative; /* 为伪元素定位 */
    min-height: 180px; /* 确保卡片有一定高度 */
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0; /* 初始不可见，由动画显示 */
}

/* 为每个卡片设置不同的动画延迟，实现交错入场效果 */
.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }
.nav-item:nth-child(6) { animation-delay: 0.6s; }
.nav-item:nth-child(7) { animation-delay: 0.7s; }
.nav-item:nth-child(8) { animation-delay: 0.8s; }
.nav-item:nth-child(9) { animation-delay: 0.9s; }
.nav-item:nth-child(10) { animation-delay: 1.0s; }
.nav-item:nth-child(11) { animation-delay: 1.1s; }
.nav-item:nth-child(12) { animation-delay: 1.2s; }
.nav-item:nth-child(13) { animation-delay: 1.3s; }
.nav-item:nth-child(14) { animation-delay: 1.4s; }
.nav-item:nth-child(15) { animation-delay: 1.5s; }
.nav-item:nth-child(16) { animation-delay: 1.6s; }


.nav-item i {
    font-size: 3em; /* 图标大小 */
    margin-bottom: 15px;
    color: var(--primary-color);
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-item h3 {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff; /* 卡片标题更亮一些 */
}

.nav-item p.url-hint {
    font-size: 0.85em;
    color: var(--text-color);
    opacity: 0.7;
    word-break: break-all;
}

.nav-item:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 25px var(--card-hover-shadow);
    background-color: lighten(var(--card-bg), 5%);
    /* background-color: rgba(45, 45, 45, 0.9); */ /* 悬停时半透明背景调整 */
}

.nav-item:hover i {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* 炫酷的悬停边框光效 */
.nav-item::before,
.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary-color));
    transition: width 0.4s ease-out;
}
.nav-item::before { top: 0; left: 50%; transform: translateX(-50%); }
.nav-item::after { bottom: 0; right: 50%; transform: translateX(50%); }

.nav-item:hover::before,
.nav-item:hover::after {
    width: 100%;
}

/* 也可以添加左右边框的光效，这里省略以保持简洁 */

footer {
    text-align: center;
    padding: 25px 20px;
    background-color: rgba(0,0,0,0.2); /* 页脚背景稍暗 */
    color: var(--text-color);
    opacity: 0.8;
    margin-top: auto; /* 将页脚推到底部 */
    animation: fadeInUp 1s 1.5s ease-out forwards; /* 在卡片加载后出现 */
    opacity: 0;
}

/* 动画效果 */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 自定义滚动条 (可选, 增强炫酷感) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    header h1 { font-size: 2.2em; }
    header p { font-size: 1em; }
    .nav-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 移动端卡片稍小 */
        gap: 20px;
    }
    .nav-item { padding: 20px 15px; min-height: 160px;}
    .nav-item i { font-size: 2.5em; }
    .nav-item h3 { font-size: 1.2em; }
}

@media (max-width: 480px) {
    .nav-grid {
        grid-template-columns: 1fr; /* 极小屏幕单列 */
        gap: 15px;
        padding: 15px;
    }
    header h1 { font-size: 2em; }
}