
/* 
整体页面样式设计
设置全局字体、背景色以及响应式布局基础
*/
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #0f172a, #1E3A8A); /* 主色调渐变背景 */
    color: #FFFFFF;
    line-height: 1.6;
    overflow-x: hidden; /* 避免水平滚动 */
}

/* 
导航栏样式
固定在顶部，包含品牌标识与菜单链接
*/
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 58, 138, 0.9); /* 半透明主色背景 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 轻微阴影增强质感 */
    z-index: 1000;
}

.navbar .logo {
    font-size: 1.5em;
    font-weight: bold;
}

.navbar .menu a {
    color: #FFFFFF;
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s ease;
}

.navbar .menu a:hover {
    color: #8B5CF6; /* 点缀色用于悬停效果 */
}

/* 
汉堡菜单样式（移动端）
*/
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background: #FFFFFF;
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* 
响应式设计：移动端调整
*/
@media (max-width: 768px) {
    .navbar .menu {
        display: none;
        flex-direction: column;
        background: rgba(30, 58, 138, 0.9);
        position: absolute;
        top: 60px;
        right: 30px;
        padding: 10px;
        border-radius: 5px;
    }

    .navbar .menu.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }
}

/* 
主内容区样式
采用网格布局，确保内容模块化与响应性
*/
.main-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 顶部留出导航栏空间 */
}

/* 
卡片样式
用于展示示例数据中的各个项目
*/
.card {
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover {
    background: rgba(139, 92, 246, 0.2); /* 悬停时背景变化 */
    transform: translateY(-10px); /* 悬停时上浮效果 */
}

.card img {
    width: 100%;
    max-width: 650px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

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

.card-title {
    font-size: 1.2em;
    margin-top: 15px;
    color: #8B5CF6; /* 辅助色用于标题 */
}

.card-description {
    margin-top: 10px;
    font-size: 1em;
    color: #d1d5db; /* 次要文本颜色 */
}

/* 
突出提示区域样式
用于显示“这是一个网页样式设计参考”
*/
.highlight {
    text-align: center;
    font-size: 1.5em;
    margin: 40px 0;
    color: #FFFFFF;
    background: linear-gradient(90deg, #1E3A8A, #8B5CF6);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* 
文章内容样式
确保阅读体验与代码示例的区分
*/
article {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #FFFFFF;
}

article h2, article h3, article h4 {
    color: #8B5CF6; /* 标题使用辅助色 */
}

article pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

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

/* 
折叠区域样式
用于次要信息的隐藏与展开
*/
.collapsible {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1em;
    margin-top: 10px;
    border-radius: 5px;
}

.active, .collapsible:hover {
    background-color: rgba(139, 92, 246, 0.2);
}

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

/* 
响应式图片处理，确保最大宽度不超过650px
*/
.responsive-img {
    width: 100%;
    max-width: 650px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 
代码示例块样式
区别于正文，便于阅读
*/
.code-example {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-example code {
    color: #D1D5DB;
    font-family: 'Courier New', Courier, monospace;
}

/* 
页脚样式
简单信息展示
*/
footer {
    background: rgba(30, 58, 138, 0.9);
    color: #FFFFFF;
    text-align: center;
    padding: 20px;
    position: relative;
    bottom: 0;
    width: 100%;
}

