
/* 全局样式设置 */
/* 设置页面的背景渐变色，从深蓝到浅蓝 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #2C3E50, #4CA1AF);
    color: #ecf0f1;
    overflow-x: hidden;
}

/* 导航栏样式 */
/* 导航栏固定在顶部，具有半透明磨砂玻璃效果 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
}

/* 导航链接样式 */
/* 使用无下划线的链接，鼠标悬停时改变颜色 */
.navbar a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #f1c40f;
}

/* 主容器样式 */
/* 使用Grid布局，响应式调整列数 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 100px 40px 40px 40px;
}

/* 信息模块样式 */
/* 每个模块具有半透明背景、圆角和阴影，悬停时轻微放大 */
.grid-item {
    background: rgba(76, 161, 175, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: scale(1.05);
}

/* 文章样式 */
/* 设置文章内容区域的排版和样式 */
article {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(236, 240, 241, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: #2C3E50;
}

/* 文章标题样式 */
/* 使用Montserrat字体，较大的字号和颜色 */
article h2, article h3 {
    font-family: 'Montserrat', sans-serif;
    color: #2C3E50;
}

article h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

article h3 {
    font-size: 20px;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* 文章段落样式 */
/* 设置文字行高和段落间距 */
article p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 代码块样式 */
/* 设置代码块的背景、边框和字体样式 */
code, pre {
    font-family: 'Courier New', Courier, monospace;
    background: #f4f4f4;
    border-left: 3px solid #e67e22;
    padding: 10px;
    display: block;
    margin: 20px 0;
    border-radius: 5px;
    overflow-x: auto;
}

/* CSS3 示例代码块样式 */
/* 专门为CSS3代码示例设计的样式，与文章样式区分 */
.css-example {
    background: #34495e;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    margin: 20px 0;
    overflow-x: auto;
}

.css-example code {
    color: #1abc9c;
}

/* 图片样式 */
/* 设置图片的圆角、阴影和悬停效果 */
img.decorative {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img.decorative:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 章节导航栏样式 */
/* 设置侧边栏导航，帮助快速定位内容 */
.chapter-nav {
    position: fixed;
    top: 80px;
    left: 20px;
    background: rgba(44, 62, 80, 0.7);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.chapter-nav a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    margin: 10px 0;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #f1c40f;
}

/* 响应式设计 */
/* 针对不同屏幕尺寸调整布局 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 20px;
    }

    .grid-container {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px 20px;
    }

    .chapter-nav {
        display: none;
    }

    article {
        padding: 15px;
    }
}

/* 动画效果 */
/* 定义按钮的渐变动画 */
@keyframes buttonGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

button.animated-button {
    background: linear-gradient(270deg, #1abc9c, #3498db, #9b59b6);
    background-size: 600% 600%;
    animation: buttonGradient 8s ease infinite;
    border: none;
    border-radius: 30px;
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

button.animated-button:hover {
    transform: scale(1.1);
}

/* 链接样式 */
/* 设置内部链接的样式，确保添加rel="nofollow" */
a.internal-link {
    color: #e67e22;
    text-decoration: none;
}

a.internal-link:hover {
    text-decoration: underline;
    color: #f1c40f;
}

/* 信息卡片悬停效果 */
/* 卡片悬停时提升阴影和移动 */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* 背景装饰线条 */
/* 使用伪元素添加渐变线条作为装饰 */
.decorative-line::before {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #1abc9c, #3498db);
    margin: 20px 0;
}

/* 表单元素样式 */
/* 设置输入框和按钮的样式，确保美观和一致性 */
input[type="text"], input[type="password"], textarea {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    margin-bottom: 15px;
    background: rgba(236, 240, 241, 0.8);
    color: #2C3E50;
}

input[type="text"]::placeholder, input[type="password"]::placeholder, textarea::placeholder {
    color: #95a5a6;
}

button.submit-button {
    background: #2C3E50;
    color: #ecf0f1;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button.submit-button:hover {
    background: #1abc9c;
}

