
/* 
整体页面样式设计
使用CSS3的高级特性实现未来感与高级质感的视觉效果
*/

/* CSS变量定义，方便统一管理色彩 */
:root {
    --main-color: #003366; /* 主色调：深蓝色，营造专业与信任感 */
    --secondary-color: #00CC66; /* 辅色调：亮绿色，增强活力与科技感 */
    --accent-color: #FF9900; /* 点缀色：橙色，用于视觉焦点 */
    --background-color: #f0f2f5; /* 背景色：浅灰色，避免纯白，提供舒适的视觉体验 */
    --text-color: #333333; /* 正文文字颜色 */
    --header-height: 60px; /* 页头高度 */
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* 防止横向滚动条 */
}

/* 页头样式 */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: linear-gradient(90deg, var(--main-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* 页头标题 */
header .logo {
    font-size: 1.5rem;
    color: #ffffff;
    text-decoration: none;
}

/* 导航栏样式 */
nav {
    display: flex;
    gap: 15px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background 0.3s ease, transform 0.3s ease;
}

nav a:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* 主要内容区样式 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    padding: 100px 20px 20px 20px; /* 顶部留出页头空间 */
    max-width: 1200px;
    margin: 0 auto;
}

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

/* 侧边栏图片样式 */
aside img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

aside img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

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

/* 文章标题样式 */
article h2 {
    font-size: 2rem;
    color: var(--main-color);
    margin-bottom: 15px;
    position: relative;
}

article h2::after {
    content: '';
    width: 50px;
    height: 4px;
    background-color: var(--secondary-color);
    position: absolute;
    bottom: -5px;
    left: 0;
    border-radius: 2px;
}

/* 文章副标题样式 */
article h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 10px;
}

/* 正文段落样式 */
article p {
    font-size: 1rem;
    margin-bottom: 15px;
}

/* 代码块样式 */
article pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* 代码块内代码样式 */
article code {
    font-family: 'Courier New', Courier, monospace;
    color: var(--main-color);
}

/* 表格样式 */
article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

article table, th, td {
    border: 1px solid #dddddd;
}

article th, td {
    padding: 10px;
    text-align: left;
}

article th {
    background-color: var(--secondary-color);
    color: #ffffff;
}

article td {
    background-color: #f9f9f9;
}

/* 折叠区域样式 */
details {
    margin-bottom: 15px;
}

summary {
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--main-color);
}

details p {
    margin-top: 10px;
    padding-left: 20px;
}

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

.image-gallery img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 3px 10px 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 5px 15px rgba(0,0,0,0.2);
}

/* 提示信息样式 */
.banner {
    background: linear-gradient(90deg, var(--main-color), var(--secondary-color));
    color: #ffffff;
    text-align: center;
    padding: 15px 0;
    font-size: 1.2rem;
    position: sticky;
    top: var(--header-height);
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

@media (max-width: 992px) {
    header {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        grid-template-columns: 1fr;
        padding: 100px 10px 10px 10px;
    }

    aside {
        flex-direction: row;
        overflow-x: scroll;
    }

    aside img {
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    header .logo {
        font-size: 1.2rem;
    }

    nav a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    article h2 {
        font-size: 1.75rem;
    }

    article h3 {
        font-size: 1.3rem;
    }

    article p, article code {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .banner {
        font-size: 1rem;
        padding: 10px 0;
    }

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

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, var(--main-color), var(--secondary-color));
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 1rem;
}

.button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* 代码示例样式，区别于正常文章 */
.code-example {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 高亮关键字 */
.code-example .keyword {
    color: #66d9ef;
}

/* 强调文本 */
.code-example .string {
    color: #e6db74;
}


