
/* 
    全局样式设置
    定义页面的基本字体、颜色、背景以及响应式布局。
*/

/* 引入jQuery库 */
@import url('https://www.gptkong.com/static/js/jquery.js');

/* 主体字体与颜色 */
body {
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #1e3c72 70%, #2a5298 25%, #ffcc00 5%); /* 应用渐变背景色 */
    color: #ffffff; /* 主文本颜色为白色 */
    margin: 0;
    padding: 0;
}

/* 页眉样式 */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 60, 114, 0.8); /* 半透明背景 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    z-index: 1000;
}

.header .logo {
    font-size: 1.5em;
    font-weight: bold;
}

.header nav a {
    margin-left: 20px;
    text-decoration: none;
    color: #ffffff;
    font-size: 1em;
    transition: color 0.3s ease;
}

.header nav a:hover {
    color: #ffcc00; /* 点缀色在悬停时变化 */
}

/* 导航菜单样式 */
.navbar {
    display: flex;
    justify-content: center;
    margin-top: 80px; /* 留出页眉空间 */
    background: rgba(255, 255, 255, 0.1); /* 磨砂玻璃效果 */
    backdrop-filter: blur(10px);
    padding: 10px 0;
}

.navbar a {
    margin: 0 15px;
    text-decoration: none;
    color: #ffffff;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ffcc00;
}

/* 主内容区块样式 */
.section {
    padding: 60px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    background: rgba(0, 0, 0, 0.5); /* 半透明背景 */
    margin: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* 阴影增强层次感 */
}

/* 文章内容样式 */
.article {
    flex: 2 1 600px;
    max-width: 800px;
}

.article h2, .article h3, .article h4 {
    color: #ffcc00; /* 点缀色用于标题 */
}

.article p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.article pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 代码块样式 */
.code-block {
    background: #2a5298;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.code-block code {
    color: #ffcc00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 图片样式 */
.image-gallery {
    flex: 1 1 300px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.image-gallery img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 页脚样式 */
.footer {
    background: rgba(30, 60, 114, 0.9); /* 深色背景 */
    padding: 40px 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    color: #ffffff;
}

.footer .section-footer {
    flex: 1 1 200px;
    margin: 10px;
}

.footer h3 {
    color: #ffcc00;
    margin-bottom: 15px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul li a {
    text-decoration: none;
    color: #ffffff;
    transition: color 0.3s ease;
}

.footer ul li a:hover {
    color: #ffcc00;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header, .navbar, .footer {
        flex-direction: column;
        align-items: center;
    }

    .navbar a {
        margin: 10px 0;
    }

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

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* 动效与过渡效果 */
.button {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.button:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ff9900, #ffcc00);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section {
    animation: fadeIn 1s ease-in;
}

/* 磨砂玻璃效果 */
.frosted-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 高亮关键内容 */
.highlight {
    background: rgba(255, 204, 0, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(30, 60, 114, 0.8);
    padding: 15px;
    border-radius: 10px;
}

.chapter-nav a {
    display: block;
    margin-bottom: 10px;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

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

/* AI助手图标样式 */
.ai-assistant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #ffcc00;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: float 3s ease-in-out infinite;
    z-index: 1000;
}

.ai-assistant:hover {
    background: #ff9900;
}

.ai-assistant::before {
    content: '';
    width: 30px;
    height: 30px;
    background: url('https://images.gptkong.com/demo/sample1.png') no-repeat center center;
    background-size: contain;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* CSS3代码示例区块 */
.css-example {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

.css-example pre {
    color: #ffcc00;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 提示文字样式 */
.tip-text {
    font-size: 1.2em;
    text-align: center;
    margin: 40px 0;
    color: #ffcc00;
}

