
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用Roboto字体，确保可读性 */
    background: linear-gradient(135deg, #1a2a6c 70%, #b21f1f 25%, #fdbb2d 5%); /* 主色70%，辅色25%，点缀色5% */
    color: #333;
    line-height: 1.6;
    transition: background 0.5s ease;
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 42, 108, 0.9); /* 半透明背景 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 1000;
    transition: background 0.3s ease;
}

.navbar.scrolled {
    background: rgba(26, 42, 108, 1); /* 滚动后背景不透明 */
}

.navbar a {
    color: #fff;
    margin: 0 15px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* 主容器样式 */
.container {
    padding-top: 80px; /* 给固定导航栏留出空间 */
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

/* 标题样式 */
h1, h2, h3, h4 {
    color: #1a2a6c;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.75em;
}

h4 {
    font-size: 1.5em;
}

/* 文章样式 */
article {
    margin-bottom: 40px;
}

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

article pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.image-gallery img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 6px 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 10px 15px rgba(0,0,0,0.2);
}

/* 按钮样式 */
.button-cta {
    background: linear-gradient(45deg, #ff7e5f, #feb47b);
    border: none;
    padding: 12px 24px;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.button-cta:hover {
    background: linear-gradient(45deg, #feb47b, #ff7e5f);
}

/* 可折叠内容样式 */
.collapsible {
    background-color: #f1f1f1;
    color: #1a2a6c;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    transition: background 0.3s ease;
    margin-bottom: 10px;
}

.collapsible:hover {
    background-color: #ddd;
}

.collapsible.active, .collapsible:focus {
    background-color: #ccc;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f9f9f9;
}

.content.show {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

/* 网格系统样式 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 40px 0;
}

.grid-item {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 底部区域样式 */
.footer {
    background-color: #1a2a6c;
    color: #fff;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer .resources, .footer .support {
    flex: 1 1 200px;
    margin: 10px;
}

.footer a {
    color: #feb47b;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

.footer a:hover {
    text-decoration: underline;
}

/* 实时聊天按钮样式 */
.chat-button {
    background: #ff7e5f;
    border: none;
    padding: 10px 20px;
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    position: fixed;
    bottom: 20px;
    right: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background 0.3s ease;
}

.chat-button:hover {
    background: #feb47b;
}

/* 聊天弹窗样式 */
.chat-popup {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: fadeIn 0.5s ease;
}

.chat-popup.active {
    display: block;
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 悬停动画 */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.slide-in {
    animation: slideIn 1s forwards;
}

/* 响应式设计媒体查询 */
@media (max-width: 1200px) {
    .navbar {
        padding: 15px 30px;
    }
    
    .grid-container {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
    }
    
    .split-screen {
        flex-direction: column;
        height: auto;
    }
    
    .split-left, .split-right {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .button-cta {
        width: 100%;
        padding: 10px;
    }
}

/* 代码块样式 */
.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

.code-block code {
    display: block;
    white-space: pre-wrap;
}

/* 提示信息样式 */
.reference-note {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

