
/* 全局样式设置，包含字体、背景以及响应式布局 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，提升可读性 */
    background: linear-gradient(135deg, #0A2E62 70%, #F7F9FC 25%, #FFA500 5%);
    color: #333;
    transition: background 0.5s ease-in-out;
}

/* 固定导航栏样式 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    background-color: rgba(10, 46, 98, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* 品牌Logo样式 */
.header-logo {
    font-size: 24px;
    font-weight: bold;
    color: #F7F9FC;
    cursor: pointer;
    transition: color 0.3s ease;
}

.header-logo:hover {
    color: #FFA500; /* 悬停时变为点缀色橙色 */
}

/* 导航菜单样式 */
.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-item {
    color: #F7F9FC;
    text-decoration: none;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: #FFA500; /* 悬停时变为点缀色橙色 */
}

.nav-item::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #FFA500;
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

.nav-item:hover::after {
    width: 100%;
}

/* 主内容区样式 */
.container {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: auto;
    gap: 20px;
    padding: 100px 40px 40px 40px; /* 留出导航栏空间 */
}

/* 侧边导航栏样式 */
.sidebar {
    grid-column: 1 / 2;
    background-color: #0A2E62;
    color: #F7F9FC;
    padding: 20px;
    border-radius: 8px;
    position: fixed;
    top: 80px;
    bottom: 40px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar a {
    display: block;
    color: #F7F9FC;
    text-decoration: none;
    margin: 15px 0;
    font-size: 16px;
    transition: color 0.3s ease;
}

.sidebar a:hover {
    color: #FFA500; /* 悬停时变为点缀色橙色 */
}

.sidebar a::before {
    content: '•';
    color: #FFA500;
    margin-right: 8px;
}

/* 主内容区布局 */
.main-content {
    grid-column: 2 / 3;
    margin-left: 270px; /* 侧边栏宽度加间隙 */
    display: grid;
    grid-template-areas:
        "hero"
        "section1"
        "section2"
        "section3"
        "section4";
    gap: 40px;
}

/* 各个内容区块样式 */
.hero-section {
    grid-area: hero;
    position: relative;
    height: 600px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center / cover;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 46, 98, 0.6); /* 半透明覆盖层 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title {
    color: #F7F9FC;
    font-size: 48px;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease forwards;
}

.hero-tagline {
    color: #FFA500;
    font-size: 24px;
    animation: fadeInUp 1.5s ease forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.content-section h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #0A2E62;
}

.content-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.content-section img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 代码示例区块样式 */
.code-example {
    background-color: #F7F9FC;
    padding: 20px;
    border-left: 4px solid #FFA500;
    margin: 20px 0;
    border-radius: 4px;
    overflow-x: auto;
}

.code-example code {
    font-family: 'Courier New', Courier, monospace;
    color: #0A2E62;
}

/* CSS3 示例代码区块 */
.css-sample {
    background-color: #FFF;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.css-sample pre {
    background-color: #F7F9FC;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

/* 图片展示区块 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.image-gallery img {
    width: calc(25% - 15px);
    border-radius: 8px;
    box-shadow: 0 2px 4px 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 4px 8px rgba(0,0,0,0.2);
}

/* 章节导航样式 */
.chapter-navigation {
    position: fixed;
    top: 100px;
    right: 40px;
    background-color: rgba(10, 46, 98, 0.8);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chapter-navigation a {
    display: block;
    color: #F7F9FC;
    text-decoration: none;
    margin: 10px 0;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-navigation a:hover {
    color: #FFA500; /* 悬停时变为点缀色橙色 */
}

/* footer 样式 */
.footer {
    background-color: #0A2E62;
    color: #F7F9FC;
    text-align: center;
    padding: 20px 40px;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.footer p {
    margin: 0;
    font-size: 14px;
}

/* 响应式设计，适配不同设备 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 200px 1fr;
    }

    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 220px;
    }

    .image-gallery img {
        width: calc(33.333% - 15px);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 20px;
    }

    .nav-menu {
        flex-direction: column;
        align-items: center;
    }

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

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        margin-bottom: 20px;
    }

    .main-content {
        margin-left: 0;
        grid-template-areas:
            "hero"
            "section1"
            "section2"
            "section3"
            "section4";
    }

    .image-gallery img {
        width: calc(50% - 15px);
    }

    .chapter-navigation {
        position: static;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .hero-tagline {
        font-size: 18px;
    }

    .image-gallery img {
        width: 100%;
    }

    .chapter-navigation a {
        font-size: 12px;
    }
}

/* 按钮样式 */
.button {
    background-color: #FFA500;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.button:hover {
    background: linear-gradient(45deg, #FFA500, #0A2E62);
    transform: translateY(-3px);
}

/* 链接样式 */
a {
    color: #0A2E62;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #FFA500;
}

/* 装饰性元素 */
.decorative-line {
    height: 2px;
    background: linear-gradient(90deg, #0A2E62, #FFA500);
    margin: 20px 0;
    border: none;
}

/* 数据可视化图表样式 */
.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #F7F9FC;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chart-bar {
    position: absolute;
    bottom: 0;
    width: 50px;
    background-color: #0A2E62;
    transition: height 0.5s ease, background-color 0.3s ease;
}

.chart-bar:hover {
    background-color: #FFA500;
    transform: scaleY(1.1);
}

/* 加载动画样式 */
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border: 6px solid #FFA500;
    border-top: 6px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2000;
}

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