
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto无衬线字体 */
    font-size: 16px; /* 正文字号设置为16px */
    line-height: 1.6;
    background: linear-gradient(135deg, #ff7e5f, #feb47b); /* 主色调为暖色系渐变 */
    color: #2c3e50; /* 主文本颜色 */
    transition: background 0.3s ease, color 0.3s ease;
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.8); /* 半透明背景 */
    backdrop-filter: blur(10px); /* 背景模糊效果 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 细微阴影 */
}

.navbar ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

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

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

.navbar a:hover {
    color: #feb47b; /* 辅助色悬停效果 */
}

/* 多级菜单样式 */
.navbar li:hover > ul {
    display: block;
}

.navbar ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(44, 62, 80, 0.9);
    padding: 10px 0;
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.navbar ul ul li {
    margin: 10px 0;
}

.navbar ul ul a {
    padding: 10px 20px;
    display: block;
    color: #ecf0f1;
}

.navbar ul ul a:hover {
    background: #feb47b; /* 一级菜单悬停背景 */
    color: #2c3e50; /* 文本颜色反转 */
}

/* 主要内容容器样式 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 100px 30px 30px 30px; /* 留出导航栏空间 */
}

/* 文章样式 */
article {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
}

/* 文章标题样式 */
article h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    position: relative;
}

article h2::after {
    content: '';
    width: 50px;
    height: 3px;
    background: #feb47b; /* 辅助色 */
    position: absolute;
    left: 0;
    bottom: -10px;
}

/* 文章段落样式 */
article p {
    font-size: 16px;
    color: #34495e;
    margin-bottom: 15px;
}

/* 代码块样式 */
article pre {
    background: #2c3e50;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

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

/* 按钮样式 */
.button {
    background: linear-gradient(45deg, #8e44ad, #2980b9);
    border: none;
    padding: 10px 20px;
    color: #ecf0f1;
    cursor: pointer;
    transition: background 0.3s ease, filter 0.3s ease;
    border-radius: 5px;
}

.button:hover {
    background: linear-gradient(45deg, #2980b9, #8e44ad);
    filter: blur(2px);
}

/* 加载动画样式 */
.loader {
    border: 8px solid rgba(255, 255, 255, 0.2);
    border-top: 8px solid #feb47b;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite, blurEffect 1.5s ease-in-out infinite;
    margin: 50px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blurEffect {
    0%, 100% { filter: blur(2px); }
    50% { filter: blur(4px); }
}

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

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

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background: rgba(44, 62, 80, 0.8);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.chapter-nav a {
    display: block;
    color: #ecf0f1;
    margin-bottom: 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.chapter-nav a:hover {
    color: #feb47b;
}

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

.collapsible:hover {
    background: #8e44ad;
}

.content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        background-color: rgba(44, 62, 80, 0.9);
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        display: none;
    }

    .navbar ul.active {
        display: flex;
    }

    .container {
        grid-template-columns: 1fr;
        padding: 100px 15px 15px 15px;
    }

    .chapter-nav {
        display: none;
    }
}

/* CSS3代码示例块样式 */
.code-example {
    background: #1e272e;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.code-example code {
    color: #d2dae2;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 提示信息样式 */
.reference-note {
    background: #dff9fb;
    color: #2c3e50;
    padding: 15px;
    border-left: 5px solid #0abde3;
    border-radius: 3px;
    margin-bottom: 20px;
    font-size: 15px;
}

/* 点缀色应用 */
.highlight {
    color: #ff6b6b;
    font-weight: bold;
}

/* 按需自定义其他样式 */

/* 按照黄金比例进行色彩分配 */
/* 主色：70% - 冷暖色系渐变 */
/* 辅色：25% - 中性色与高对比色 */
/* 点缀色：5% - 强调色 */

/* 优化图片展示效果 */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.05);
}

/* 平滑过渡效果 */
.transition-effect {
    transition: all 0.3s ease;
}

/* 立体感与阴影效果 */
.shadow-effect {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 立体按钮效果 */
.button-3d {
    perspective: 1000px;
}

.button-3d button {
    background: linear-gradient(45deg, #8e44ad, #2980b9);
    border: none;
    padding: 10px 20px;
    color: #ecf0f1;
    cursor: pointer;
    border-radius: 5px;
    transform: translateZ(0);
    transition: transform 0.2s ease;
}

.button-3d button:hover {
    transform: translateZ(10px);
}

/* 悬停时旋转效果 */
.rotate-hover:hover {
    transform: rotate(5deg);
}

/* 动态背景装饰元素 */
.dynamic-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.gptkong.com/demo/sample1.png') repeat;
    opacity: 0.1;
    z-index: -1;
}

/* 高级质感按钮 */
.fancy-button {
    background: radial-gradient(circle, #ff7e5f, #feb47b);
    border: 2px solid #fff;
    border-radius: 50px;
    padding: 10px 30px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.fancy-button:hover {
    background: radial-gradient(circle, #feb47b, #ff7e5f);
    transform: scale(1.05);
}

