
/* 基本样式设置，定义全局字体和背景 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', Arial, sans-serif; /* 使用易读性强的字体 */
    font-size: 16px; /* 设置基础字体大小 */
    background: linear-gradient(135deg, #0B486B 70%, #F2F2F2 25%, #FF9F1C 5%); /* 渐变背景，主色占70%，辅色25%，点缀色5% */
    color: #333;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(11, 72, 107, 0.9); /* 半透明主色背景 */
    padding: 20px 40px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
}

.navbar a {
    color: #F2F2F2;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s;
    font-size: 16px;
}

.navbar a:hover {
    color: #FF9F1C; /* 点缀色悬停效果 */
}

/* 顶部横幅样式 */
.banner {
    height: 500px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 80px; /* 避免内容被导航栏遮挡 */
}

.banner::after {
    content: '这是一个网页样式设计参考';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(11, 72, 107, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 主内容区域样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

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

article h2, article h3, article h4 {
    color: #0B486B;
    margin-top: 20px;
}

article p {
    line-height: 1.6;
    margin-bottom: 20px;
}

article pre {
    background: #F2F2F2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

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

/* 图片样式 */
img.decorative {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    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.2);
}

/* 代码块样式，区别于文章内容 */
.code-example {
    background-color: #0B486B;
    color: #fff;
    padding: 20px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

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

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

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

/* 折叠区域样式 */
.details {
    margin-top: 20px;
}

.details summary {
    cursor: pointer;
    color: #FF9F1C;
    font-weight: bold;
}

.details[open] summary {
    color: #0B486B;
}

/* 数据可视化图表样式 */
.pie-chart, .line-chart {
    width: 100%;
    max-width: 400px;
    height: 300px;
    margin: 20px auto;
    position: relative;
}

.pie-chart {
    background: conic-gradient(#0B486B 25%, #FF9F1C 25% 50%, #F2F2F2 50% 75%, #FF9F1C 75%);
    border-radius: 50%;
    position: relative;
}

.pie-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.line-chart {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 8px;
}

.line-chart::before {
    content: '';
    position: absolute;
    left: 50px;
    bottom: 50px;
    width: calc(100% - 100px);
    height: calc(100% - 100px);
    border-left: 2px solid #0B486B;
    border-bottom: 2px solid #0B486B;
}

.line {
    position: absolute;
    bottom: 50px;
    left: 50px;
    width: 2px;
    height: 100%;
    background-color: #FF9F1C;
    animation: grow 2s ease-out forwards;
}

@keyframes grow {
    from { height: 0; }
    to { height: 100%; }
}

/* 按钮样式 */
.button {
    background-color: #FF9F1C;
    border: none;
    padding: 10px 20px;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-size: 16px;
}

.button:hover {
    background-color: #e68a00;
    transform: scale(1.1);
}

/* 底部样式 */
.footer {
    background-color: #0B486B;
    color: #F2F2F2;
    text-align: center;
    padding: 30px 20px;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chapter-nav {
        display: none;
    }
}

