/* style.css */

/* 全局样式和字体设置 */
body {
    font-family: 'Inter', sans-serif; /* 正文使用 Inter 字体 */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #1a1a2e; /* 深蓝色/紫色背景，营造科技感和高档感 */
    color: #e0e0e0; /* 浅灰色文字 */
    line-height: 1.6;
    scroll-behavior: smooth; /* 平滑滚动效果 */
}

/* 容器居中 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 链接样式 */
a {
    color: #00f0ff; /* 强调色：青色/电光蓝 */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #00b3cc; /* 鼠标悬停时颜色略深 */
}

/* 标题样式 */
h1, h2, h3 {
    font-family: 'Montserrat', sans-serif; /* 标题使用 Montserrat 字体 */
    color: #f0f0f0; /* 略亮的标题颜色 */
    margin-top: 0;
    margin-bottom: 20px;
}

h1 {
    font-size: 3.5em;
    font-weight: 700;
}

h2 {
    font-size: 2.5em;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

/* 标题下划线装饰 */
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #00f0ff; /* 强调色下划线 */
    margin: 15px auto 0;
    border-radius: 2px;
}

h3 {
    font-size: 1.8em;
    font-weight: 600;
}

p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

ul {
    list-style: none;
    padding: 0;
}

/* 头部导航栏 */
.header {
    background-color: rgba(26, 26, 46, 0.9); /* 略带透明度的背景 */
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000; /* 确保在最上层 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* 阴影增加层次感 */
}

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

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: #00f0ff; /* Logo 使用强调色 */
    letter-spacing: 1px;
}

.nav ul {
    display: flex;
}

.nav ul li {
    margin-left: 30px;
}

.nav ul li a {
    color: #e0e0e0;
    font-weight: 400;
    font-size: 1.1em;
    position: relative;
    padding-bottom: 5px;
}

/* 导航链接下划线动画 */
.nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #00f0ff;
    left: 0;
    bottom: 0;
    transition: width 0.3s ease;
}

.nav ul li a:hover::after,
.nav ul li a.active::after {
    width: 100%;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: #00f0ff;
    color: #1a1a2e; /* 按钮文字使用深色背景色 */
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3); /* 强调色阴影 */
}

.btn:hover {
    background-color: #00b3cc;
    transform: translateY(-3px); /* 悬停时上浮效果 */
}

/* 英雄区域 (Hero Section) */
.hero {
    position: relative;
    height: 100vh; /* 占满整个视口高度 */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    padding-top: 80px; /* 为固定头部留出空间 */
}

.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* 确保在内容下方 */
}

.hero-content {
    position: relative;
    z-index: 1; /* 确保在粒子动画上方 */
    max-width: 800px;
    color: #ffffff;
}

.hero-content h1 {
    font-size: 4.5em;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.4); /* 标题发光效果 */
}

.hero-content p {
    font-size: 1.4em;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: #d0d0d0;
}

.learning-status {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 40px;
    color: #00f0ff; /* “持续学习”使用强调色 */
    letter-spacing: 0.5px;
}

/* 各个内容区域的通用内边距 */
.section-padding {
    padding: 100px 0;
}

/* 关于 CTF 区域 */
.about-ctf {
    background-color: #121220; /* 略微不同的深色背景 */
}

.about-ctf p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    margin-bottom: 30px;
}

.ctf-categories {
    margin-top: 50px;
    text-align: center;
}

.ctf-categories h3 {
    margin-bottom: 25px;
    color: #00f0ff;
}

.ctf-categories ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px; /* 间距 */
}

.ctf-categories ul li {
    background-color: #2a2a4a; /* 卡片背景色 */
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 400;
    color: #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ctf-categories ul li:hover {
    transform: translateY(-5px);
    background-color: #3a3a5a;
}

.category-icon {
    color: #00f0ff;
    font-size: 1.3em;
}

/* 学习路径区域 */
.learning-path {
    background-color: #1a1a2e;
}

.learning-path > .container > p {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 50px;
}

.path-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 响应式网格布局 */
    gap: 30px;
    margin-top: 40px;
}

.path-card {
    background-color: #2a2a4a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #00f0ff; /* 左侧强调色边框 */
}

.path-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.2); /* 悬停时强调色阴影 */
}

.path-card h3 {
    color: #00f0ff;
    margin-bottom: 15px;
    font-size: 1.6em;
}

.path-card p {
    font-size: 1em;
    color: #c0c0c0;
}

/* 资源区域 */
.resources {
    background-color: #121220;
}

.resources > .container > p {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 50px;
}

.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.resource-item {
    background-color: #2a2a4a;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resource-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.resource-item h3 {
    color: #f0f0f0;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.resource-item ul li {
    margin-bottom: 10px;
}

.resource-item ul li a {
    color: #c0c0c0;
    font-size: 1em;
}

.resource-item ul li a:hover {
    color: #00f0ff;
}

/* 底部信息 */
.footer {
    background-color: #0d0d1a; /* 更深的底部背景色 */
    color: #888;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
    border-top: 1px solid rgba(0, 240, 255, 0.1); /* 顶部强调色细线 */
}

/* 动画效果 */
/* 首页内容渐入上浮动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-up.delay-1 { animation-delay: 0.2s; }
.fade-in-up.delay-2 { animation-delay: 0.4s; }
.fade-in-up.delay-3 { animation-delay: 0.6s; }

/* 滚动时内容显示动画 */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Mobile Warning Modal Styles --- */
.mobile-warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* 更深的半透明背景 */
    display: flex; /* 使用 flexbox 轻松居中内容 */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* 确保在所有内容之上 */
    opacity: 0; /* 初始隐藏 */
    visibility: hidden; /* 初始隐藏 */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* 平滑显示动画 */
}

.mobile-warning-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-warning-content {
    background-color: #2a2a4a; /* 卡片背景色 */
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    color: #e0e0e0;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6); /* 强调色发光阴影 */
    max-width: 450px;
    margin: 20px; /* 确保在小屏幕上有边距 */
    transform: translateY(-20px); /* 初始轻微偏移，用于动画 */
    transition: transform 0.3s ease;
}

.mobile-warning-overlay.active .mobile-warning-content {
    transform: translateY(0); /* 模态框激活时回到原位 */
}

.mobile-warning-content h2 {
    font-size: 2em;
    color: #00f0ff; /* 强调色标题 */
    margin-bottom: 20px;
}

.mobile-warning-content p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.mobile-warning-content a {
    color: #00f0ff;
    font-weight: 600;
}

/* 简单的加载指示器 (Spinner) */
.spinner {
    border: 4px solid rgba(0, 240, 255, 0.2);
    border-top: 4px solid #00f0ff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* 响应式设计 */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 3.5em;
    }
    .hero-content p {
        font-size: 1.2em;
    }
    h2 {
        font-size: 2em;
    }
    .nav ul li {
        margin-left: 20px;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    .nav ul {
        margin-top: 15px;
        justify-content: center;
    }
    .nav ul li {
        margin: 0 10px;
    }
    .hero-content h1 {
        font-size: 2.8em;
    }
    .hero-content p {
        font-size: 1em;
    }
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    .learning-status {
        font-size: 1em;
    }
    .section-padding {
        padding: 80px 0;
    }
    .ctf-categories ul {
        flex-direction: column;
        align-items: center;
    }
    .path-grid, .resource-list {
        grid-template-columns: 1fr; /* 小屏幕下卡片堆叠 */
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5em;
    }
    .nav ul li {
        margin: 0 5px;
    }
    .hero-content h1 {
        font-size: 2.2em;
    }
    .hero-content p {
        font-size: 0.9em;
    }
    h2 {
        font-size: 1.8em;
    }
    .path-card, .resource-item {
        padding: 20px;
    }
}