
/* 基础样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #e0e1dd;
    background: linear-gradient(135deg, #0d1b2a, #1b263b, #415a77, #778da9, #e0e1dd);
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 27, 53, 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 ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar li {
    position: relative;
    margin: 0 15px;
}

.navbar li ul {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: #0d1b2a;
    padding: 10px;
    border-radius: 5px;
}

.navbar li:hover ul {
    display: block;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 16px;
}

.navbar a:hover {
    color: #00aaff;
}

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

/* 侧边导航样式 */
.sidebar {
    position: sticky;
    top: 100px;
    background: rgba(27, 38, 59, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

.sidebar a:hover {
    color: #ff7f50;
}

/* 文章内容样式 */
article {
    background: rgba(27, 38, 59, 0.9);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

article h2, article h3, article h4 {
    color: #00aaff;
    margin-top: 20px;
    margin-bottom: 10px;
}

article p {
    margin-bottom: 15px;
}

article pre {
    background: #1b263b;
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    margin-bottom: 15px;
}

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

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

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

/* 提示信息样式 */
.prompt {
    background: #ff7f50;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in-out;
}

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

.collapsible:hover {
    background-color: #778da9;
}

.content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #1b263b;
    border-radius: 0 0 5px 5px;
}

/* 图片网格布局 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

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

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

/* 代码示例样式 */
.code-example {
    background: #1b263b;
    padding: 20px;
    border-radius: 10px;
    overflow: auto;
    margin-bottom: 30px;
    font-family: 'Courier New', Courier, monospace;
    position: relative;
}

.code-example::before {
    content: 'CSS3 代码示例';
    position: absolute;
    top: -20px;
    left: 0;
    background: #ff7f50;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
}

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

    .sidebar {
        display: none;
    }

    .navbar ul {
        flex-direction: column;
        display: none;
        background: rgba(0, 27, 53, 0.9);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
    }

    .navbar.active ul {
        display: flex;
    }

    .navbar li {
        margin: 10px 0;
    }

    .collapsible {
        font-size: 18px;
    }

    .prompt {
        font-size: 18px;
    }

    .code-example {
        font-size: 14px;
    }
}

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

