
/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #0A1F44, #0D285B);
    color: #ECEFF1;
    line-height: 1.6;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}
h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto Slab', serif;
    color: #00FFA3;
    margin-bottom: 15px;
}
a {
    color: #8C52FF;
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: #6A0DAD;
}
button {
    background: linear-gradient(to right, #8C52FF, #6A0DAD);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
button:hover {
    transform: scale(1.05);
}
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 8px;
}

/* 布局与模块化设计 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}
.grid-item {
    background: #1A2A4F;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}
.grid-item:hover {
    transform: translateY(-5px);
}
.grid-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 文章排版 */
article {
    background: #1A2A4F;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}
article h2 {
    font-size: 28px;
    margin-bottom: 15px;
}
article p, article ul, article pre {
    margin-bottom: 15px;
}
article code {
    background: #0A1F44;
    color: #00FFA3;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
}
article pre {
    background: #0A1F44;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}
article pre code {
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    article h2 {
        font-size: 24px;
    }
}
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    article {
        padding: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.fade-in {
    animation: fadeIn 1.5s ease-in-out;
}

