
/* 主色调与辅助色定义 */
:root {
    --main-color: #2c3e50; /* 深灰色，传达专业与稳定性 */
    --accent-color: #3498db; /* 亮蓝色，突出现代与科技感 */
    --secondary-color: #95a5a6; /* 辅助色，增强层次感 */
    --highlight-color: #e67e22; /* 点缀色，吸引视线 */
    --background-color: #f0f2f5; /* 背景颜色，避免纯白，增加舒适感 */
    --text-color: #2d3436; /* 主要文字颜色，保持清晰可读 */
    --link-color: #3498db; /* 内部链接颜色 */
    --link-hover-color: #e67e22; /* 链接悬停颜色 */
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: center;
    background-color: var(--main-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-item {
    margin: 0 20px;
    color: #fff;
    font-size: 18px;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-item::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--highlight-color);
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

.nav-item:hover {
    color: var(--highlight-color);
}

.nav-item:hover::after {
    width: 100%;
}

/* 主要内容区域 */
.container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    max-width: 1200px;
    margin: 40px auto;
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.sidebar img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

/* 文章内容样式 */
article {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

article h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--main-color);
    position: relative;
    padding-bottom: 10px;
}

article h2::after {
    content: '';
    width: 50px;
    height: 3px;
    background-color: var(--highlight-color);
    position: absolute;
    bottom: 0;
    left: 0;
}

article h3 {
    font-size: 20px;
    margin: 20px 0 10px;
    color: var(--accent-color);
}

article p {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--text-color);
}

/* 代码块样式 */
article pre {
    background-color: #2d3436;
    color: #dfe6e9;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

article code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

article .language-css {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 提示信息样式 */
.prominent-message {
    background: linear-gradient(90deg, var(--accent-color), var(--highlight-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 20px;
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in-out;
}

/* 图片集成样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.image-gallery img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* 底部样式 */
.footer {
    background-color: var(--main-color);
    color: #fff;
    padding: 40px 20px;
    margin-top: 40px;
    border-radius: 10px;
}

.footer h4 {
    margin-bottom: 15px;
    color: var(--highlight-color);
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer ul li a:hover {
    color: var(--highlight-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
    }

    .sidebar img {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
    }

    .nav-item {
        margin: 10px 0;
    }

    article {
        padding: 20px;
    }

    .prominent-message {
        font-size: 18px;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

/* 折叠区域样式 */
.collapsible {
    background-color: var(--secondary-color);
    color: #fff;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

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

.content {
    padding: 0 20px;
    display: none;
    overflow: hidden;
    background-color: #f9f9f9;
    color: #333;
    border-radius: 5px;
    margin-bottom: 15px;
}

.active + .content {
    display: block;
}

/* 内部链接样式 */
a[rel="nofollow"] {
    color: var(--link-color);
    text-decoration: none;
    position: relative;
}

a[rel="nofollow"]:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* 图片描述属性为空的图片样式 */
img[alt=""] {
    display: block;
}

/* 代码示例区块样式 */
.code-example {
    background-color: #2d3436;
    color: #dfe6e9;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.code-example code {
    display: block;
}

