
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，提升可读性 */
    color: #333333; /* 主文本颜色 */
    background: linear-gradient(135deg, #1E3C72 70%, #2A5298 30%); /* 主色调渐变背景 */
    box-sizing: border-box;
}

/* 导航栏样式 */
.header {
    position: fixed; /* 固定导航栏，始终可见 */
    top: 0;
    width: 100%;
    background-color: rgba(0, 45, 114, 0.9); /* 深蓝色半透明背景 */
    color: #FFFFFF;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 细微阴影增加层次感 */
    z-index: 1000;
}

.header .logo {
    font-size: 24px;
    font-weight: bold;
}

.header nav a {
    color: #FFFFFF;
    text-decoration: none;
    margin-left: 20px;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

.header nav a:hover {
    color: #FFA500; /* 点缀色橙色，吸引视线 */
}

/* 主内容区域样式 */
.main {
    padding: 100px 40px 40px 40px; /* 顶部留出导航栏空间 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); /* 每个板块不小于500px宽度 */
    gap: 40px;
}

/* 模块卡片样式 */
.module {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
    transform: translateY(-10px); /* 悬浮效果 */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
.main h2, .main h3, .main h4 {
    color: #002D72; /* 主色调深蓝色 */
    margin-bottom: 15px;
}

.main h2 {
    font-size: 28px;
}

.main h3 {
    font-size: 24px;
}

.main h4 {
    font-size: 20px;
}

/* 段落样式 */
.main p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
    color: #444444;
}

/* 代码块样式 */
main pre code {
    display: block;
    background-color: #F5F5F5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

main pre code::before {
    content: "代码示例";
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #FF6600; /* 点缀色橙色 */
}

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

.module img:hover {
    transform: scale(1.05); /* 放大效果 */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* 提示信息样式 */
.notice {
    background-color: rgba(255, 165, 0, 0.1); /* 点缀色橙色背景 */
    border-left: 4px solid #FFA500;
    padding: 10px 20px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #FFA500;
}

/* 折叠内容样式 */
.collapsible {
    background-color: #FFFFFF;
    color: #002D72;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    font-size: 18px;
    transition: background-color 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.active, .collapsible:hover {
    background-color: rgba(0, 45, 114, 0.1);
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f9f9f9;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header nav {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 100px 20px 20px 20px;
        grid-template-columns: 1fr;
    }

    .header {
        padding: 15px 20px;
    }

    .header .logo {
        font-size: 20px;
    }

    .header nav a {
        margin-left: 10px;
        font-size: 14px;
    }

    .main h2 {
        font-size: 24px;
    }

    .main h3 {
        font-size: 20px;
    }

    .main h4 {
        font-size: 18px;
    }

    .main p {
        font-size: 14px;
    }
}

/* 按钮样式 */
.button-primary, .button-secondary {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.button-primary {
    background-color: #FF6600; /* 点缀色橙色 */
    color: #FFFFFF;
}

.button-primary:hover {
    background-color: #e65c00;
}

.button-secondary {
    background-color: #28a745; /* 辅色绿色 */
    color: #FFFFFF;
}

.button-secondary:hover {
    background-color: #218838;
}

/* 背景图装饰 */
.decorative-line {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,102,0,1) 0%, rgba(42,82,152,1) 100%);
    margin: 20px 0;
    border-radius: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* 按钮动画 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.button-animated {
    background-color: #28a745;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.button-animated:hover {
    background-color: #218838;
    transform: rotate(5deg);
}

