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

/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap');

/* 根元素设置 */
:root {
    --primary-gradient: linear-gradient(135deg, #000066, #660099, #00ff00);
    --secondary-gradient: linear-gradient(135deg, #660099, #00ff00, #ff66cc);
    --background-animation-duration: 15s;
    --nav-height: 60px;
    --font-color: #ffffff;
    --accent-color: #00ff00;
    --button-hover-color: rgba(0, 255, 0, 0.3);
}

/* 页面背景与动画 */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--font-color);
    background: var(--primary-gradient);
    background-size: 400% 400%;
    animation: gradientAnimation var(--background-animation-duration) ease infinite;
    position: relative;
    min-height: 100vh;
}

/* 渐变背景动画 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 粒子背景效果 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('') repeat;
    opacity: 0.1;
    pointer-events: none;
}

/* 固定导航栏 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 导航栏链接 */
nav a {
    color: var(--font-color);
    margin-right: 20px;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
}

/* 主内容区域 */
main {
    padding: calc(var(--nav-height) + 20px) 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 模块化布局 */
.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
}

.module {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin: 10px;
    flex: 1 1 calc(33.33% - 40px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
}

/* 标题样式 */
h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--accent-color);
    margin-bottom: 10px;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

/* 段落与代码块 */
p {
    margin-bottom: 15px;
    font-size: 1em;
}

pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

code {
    font-family: 'Roboto Mono', monospace;
    color: #00ff00;
}

/* 按钮样式 */
.button {
    position: relative;
    padding: 10px 20px;
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--font-color);
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
    transition: color 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background-color: var(--button-hover-color);
    border-radius: 50%;
    z-index: -1;
    transition: transform 0.4s ease;
}

.button:hover::after {
    transform: translate(-50%, -50%) scale(2);
}

.button:hover {
    color: var(--accent-color);
}

/* 图片样式 */
img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 10px;
    margin: 10px;
}

/* 提示样式 */
.reference-note {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-left: 5px solid var(--accent-color);
    margin: 20px 0;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
}

/* 响应式设计 */
@media (max-width: 1440px) {
    .module {
        flex: 1 1 calc(33.33% - 40px);
    }
}

@media (max-width: 1200px) {
    .module {
        flex: 1 1 calc(50% - 40px);
    }
}

@media (max-width: 768px) {
    .module {
        flex: 1 1 100%;
    }

    nav {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
    }

    nav a {
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.75em;
    }

    h3 {
        font-size: 1.25em;
    }

    pre, code {
        font-size: 0.9em;
    }

    .button {
        padding: 8px 16px;
        font-size: 0.9em;
    }

    img {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 320px) {
    h1 {
        font-size: 1.75em;
    }

    h2 {
        font-size: 1.5em;
    }

    h3 {
        font-size: 1em;
    }

    .button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

