
/* 全局样式设置 */
body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #f5f5f5;
    background: linear-gradient(135deg, #002366, #228b22);
    background-blend-mode: overlay;
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 51, 102, 0.9);
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.navbar ul li {
    position: relative;
}

.navbar ul li a {
    color: #ffffff;
    text-decoration: none;
    font-family: 'Roboto Slab', serif;
    font-size: 18px;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #ffeb3b;
}

/* 主内容区样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* 章节导航提示 */
.reference-note {
    text-align: center;
    font-size: 20px;
    color: #ffeb3b;
    margin-bottom: 30px;
    animation: fadeIn 2s ease-in-out;
}

/* 文章内容样式 */
article h2 {
    font-family: 'Roboto Slab', serif;
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 20px;
}

article h3 {
    font-size: 20px;
    color: #ffd700;
    margin-top: 30px;
}

article p {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 15px;
}

article pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    color: #00ffff;
    font-family: 'Courier New', Courier, monospace;
    margin-bottom: 20px;
}

article code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
    color: #ffeb3b;
}

/* 图片装饰样式 */
.decorative-images {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.decorative-images img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.decorative-images img:hover {
    transform: scale(1.05) rotate(3deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* 按钮样式 */
button, .cta-button {
    background-color: #008CBA;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
}

button:hover, .cta-button:hover {
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    transform: scale(1.05);
}

/* 加载动画样式 */
.loader {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #3498db;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 背景动画 */
@keyframes moveBackground {
    from { transform: translateX(0); }
    to { transform: translateX(-100px); }
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.gptkong.com/demo/sample1.png') repeat;
    opacity: 0.05;
    animation: moveBackground 30s linear infinite;
    z-index: -1;
}

/* 渐变和阴影效果 */
section {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: background 0.5s ease;
}

section:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 2fr 1fr;
    }
}

@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        align-items: center;
    }

    .decorative-images {
        flex-direction: column;
    }
}

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

/* 点缀色应用 */
.highlight {
    color: #ffeb3b;
    font-weight: bold;
}

/* 3D变换效果 */
.photo-card {
    perspective: 1000px;
}

.photo-card img {
    transition: transform 0.5s;
}

.photo-card:hover img {
    transform: rotateY(10deg) rotateX(10deg);
}

/* 过渡效果优化 */
a, button, .cta-button {
    transition: all 0.3s ease;
}

/* 页脚样式 */
.footer {
    background-color: rgba(0, 51, 102, 0.9);
    color: #ffffff;
    text-align: center;
    padding: 20px 0;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* 确保图片不影响布局 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

