
/* 全局样式重置，确保不同浏览器下的一致性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置网页的基础字体和颜色 */
body {
    font-family: 'Open Sans', sans-serif; /* 无衬线字体，保证可读性 */
    font-size: 16px; /* 正文字号 */
    color: #333333; /* 主文字颜色 */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); /* 主色调渐变背景 */
    line-height: 1.6;
    overflow-x: hidden; /* 防止出现水平滚动条 */
}

/* 头部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 60, 114, 0.9); /* 半透明背景 */
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 细微阴影 */
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 15px;
    position: relative;
}

.navbar a:hover {
    color: #ff9a9e; /* 点缀色悬停效果 */
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    padding: 12px 16px;
    z-index: 1;
    border-radius: 4px;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease-in-out; /* 渐显动画 */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 主要内容区样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px; /* 顶部留白以避免被导航栏遮挡 */
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 轻微阴影 */
}

article h2, article h3, article h4 {
    font-family: 'Bebas Neue', sans-serif; /* 带有复古特色的衬线字体 */
    color: #2a5298;
    margin-bottom: 15px;
}

article p {
    margin-bottom: 15px;
    color: #333333;
}

article pre {
    background: #f4f4f4;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 15px;
}

article code {
    font-family: 'Courier New', Courier, monospace;
    color: #d6336c;
}

/* 突出显示提示信息 */
.notice {
    text-align: center;
    font-size: 1.5em;
    color: #ffffff;
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in-out;
}

/* 图片样式 */
img.decorative {
    max-width: 650px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 20px 0;
}

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

/* 按钮样式 */
button, .btn {
    background-color: #ff9a9e; /* 点缀色 */
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

button:hover, .btn:hover {
    background-color: #fad0c4;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .container {
        grid-template-columns: 1fr;
    }
}

/* 折叠内容区域样式 */
.collapsible {
    background-color: #2a5298;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.2em;
    border-radius: 4px;
    margin-bottom: 10px;
    transition: background-color 0.3s;
}

.collapsible:hover {
    background-color: #1e3c72;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    margin-bottom: 15px;
}

/* 强调代码示例部分 */
.code-snippet {
    background: #2a5298;
    color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 高亮显示关键词 */
.highlight {
    color: #ff9a9e;
    font-weight: bold;
}

/* 底部样式 */
footer {
    text-align: center;
    padding: 20px;
    background: rgba(30, 60, 114, 0.9);
    color: #ffffff;
    position: relative;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

