
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代感强的无衬线字体 */
    color: #333333;
    background: linear-gradient(135deg, #1e3c72, #2a5298, #6a11cb, #2575fc); /* 渐变背景色，符合主色调 */
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 60, 114, 0.9); /* 半透明背景，符合主色调 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background 0.3s ease;
}

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

.navbar a:hover {
    color: #ff9800; /* 点缀色用于悬停效果 */
    transform: scale(1.1);
}

/* 主内容区样式 */
.main-content {
    padding-top: 80px; /* 留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
    color: #ffffff;
}

/* 标题样式 */
h1, h2, h3, h4 {
    font-weight: 700;
    margin-bottom: 20px;
}

h1 {
    font-size: 36px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 22px;
}

h4 {
    font-size: 18px;
}

/* 段落样式 */
p {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* 代码块样式 */
pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

code {
    color: #ff9800; /* 点缀色用于代码高亮 */
    font-family: 'Courier New', Courier, monospace;
}

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

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

/* 按钮样式 */
.button {
    background-color: #ff9800; /* 点缀色 */
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.button:hover {
    background-color: #e68900;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* 卡片布局样式 */
.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    padding: 20px;
    border-radius: 10px;
    width: calc(33% - 20px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.2);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .card {
        width: 100%;
    }
}

/* 折叠内容样式 */
.collapsible {
    background-color: rgba(38, 194, 129, 0.8);
    color: #ffffff;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #2575fc;
}

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

.active + .content {
    max-height: 500px; /* 根据内容长度调整 */
}

/* 导航链接样式 */
.nav-links {
    display: flex;
    justify-content: space-around;
}

.nav-links a {
    margin: 0 10px;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
}

.nav-links a:hover {
    color: #ff9800;
    text-decoration: underline;
}

/* 背景过渡效果 */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #1e3c72, #2a5298, #6a11cb, #2575fc);
    color: #ffffff;
    transition: background 0.5s ease-in-out;
}

.hero-section h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero-section .button {
    margin-top: 20px;
}

/* 数据图表样式 */
.chart {
    width: 100%;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center;
    background-size: cover;
    opacity: 0.3;
}

/* 滚动触发动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 滚动到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #ff9800;
    color: #ffffff;
    padding: 10px 15px;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
    background-color: #e68900;
    transform: scale(1.1);
}

/* 链接去除默认样式 */
a {
    text-decoration: none;
    color: inherit;
}

/* 高亮当前导航项 */
.navbar a.active {
    border-bottom: 2px solid #ff9800;
    padding-bottom: 8px;
}

/* 章节内容样式 */
.section {
    padding: 60px 20px;
}

.section h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.section p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 自定义CSS代码块样式 */
.css-example {
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.css-example code {
    color: #00ff7f;
    display: block;
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
}

/* 动画按钮 */
@keyframes hoverAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.button.animated:hover {
    animation: hoverAnimation 0.5s infinite;
}

