
/* 基本样式设置 */
body {
    font-family: 'Open Sans', sans-serif; /* 设置正文字体 */
    color: #FFFFFF; /* 正文字体颜色 */
    background-color: #1E2A38; /* 设置背景主色调 */
    margin: 0;
    padding: 0;
}

/* 导航栏样式 */
.navbar {
    position: fixed; /* 固定在顶部 */
    top: 0;
    width: 100%;
    background-color: rgba(30, 42, 56, 0.9); /* 半透明背景 */
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 底部阴影 */
}

.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 16px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.navbar a:hover {
    color: #00BCD4; /* 悬停时字体颜色变化 */
    background-color: rgba(255, 152, 0, 0.2); /* 悬停时背景颜色变化 */
    border-radius: 5px;
}

/* 主内容区块 */
.container {
    display: grid;
    grid-template-areas:
        "header"
        "main"
        "footer";
    grid-gap: 20px;
    padding: 100px 20px 50px 20px; /* 上边距预留导航栏空间 */
}

.header {
    grid-area: header;
    text-align: center;
    padding: 20px;
}

.header h1 {
    font-family: 'Montserrat', sans-serif; /* 标题字体 */
    color: #00BCD4; /* 标题颜色 */
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2em;
    color: #FFFFFF;
    margin: 0;
}

.main {
    grid-area: main;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.section {
    background-color: #263238; /* 辅色背景 */
    border-radius: 10px;
    padding: 20px;
    flex: 1 1 calc(50% - 40px); /* 两列布局 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影效果 */
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.section:hover {
    transform: translateY(-10px); /* 悬停时上移 */
    background-color: #37474F; /* 悬停时背景颜色变化 */
}

.section h2 {
    font-family: 'Montserrat', sans-serif;
    color: #FF9800; /* 辅助色标题 */
    font-size: 1.8em;
    margin-bottom: 10px;
}

.section p {
    font-size: 1em;
    line-height: 1.6;
    color: #B0BEC5;
}

.section img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.section img:hover {
    transform: scale(1.05); /* 悬停时图片放大 */
}

/* 代码示例样式 */
.code-block {
    background-color: #1E2A38;
    border-left: 4px solid #FF9800;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #00BCD4;
    margin: 20px 0;
}

.code-block code {
    display: block;
    white-space: pre-wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .section {
        flex: 1 1 100%; /* 单列布局 */
    }
}

/* 提示信息样式 */
.prompt {
    text-align: center;
    font-size: 1.5em;
    color: #FF9800;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* 导航链接样式 */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.nav-links a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00BCD4;
}

/* 图片容器样式 */
.image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.image-container img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.image-container img:hover {
    transform: rotate(5deg) scale(1.05);
}

/* 折叠区域样式 */
.collapsible {
    background-color: #37474F;
    color: #FFFFFF;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1em;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #455A64;
}

.content {
    padding: 0 15px;
    display: none;
    background-color: #263238;
    overflow: hidden;
    border-radius: 5px;
}

.content p {
    color: #B0BEC5;
    font-size: 1em;
    line-height: 1.6;
}

/* CSS3示例代码块样式 */
.css-example {
    background-color: #1E2A38;
    border-left: 4px solid #00BCD4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #00BCD4;
    margin: 20px 0;
}

.css-example code {
    display: block;
    white-space: pre-wrap;
}

/* 底部样式 */
.footer {
    grid-area: footer;
    background-color: #1E2A38;
    padding: 20px;
    text-align: center;
    color: #B0BEC5;
    font-size: 0.9em;
}

/* 平滑滚动效果 */
html {
    scroll-behavior: smooth;
}

