
/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置整体背景，使用线性渐变 */
body {
    font-family: 'Lato', sans-serif; /* 使用易读性强的字体 */
    background: linear-gradient(135deg, #1A237E, #6200EA); /* 冷色调渐变背景 */
    color: #E0E0E0; /* 浅色文字，增强对比度 */
    line-height: 1.6;
    padding: 20px;
}

/* 标题样式 */
h2, h3 {
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    color: #FFFFFF; /* 白色标题 */
    margin-bottom: 20px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

/* 段落样式 */
p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 强调文本颜色 */
p span {
    color: #4CAF50; /* 辅助色用于强调 */
}

/* 链接样式 */
a {
    color: #FFC107; /* 点缀色用于链接 */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #FFEB3B; /* 悬停时颜色变化 */
}

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    border-radius: 10px; /* 圆角效果 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 阴影效果 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

img:hover {
    transform: scale(1.05); /* 悬停时放大 */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); /* 加强阴影 */
}

/* 代码块样式 */
pre {
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

code {
    font-family: 'Courier New', Courier, monospace;
    color: #FF9800; /* 代码字体颜色 */
}

/* 导航栏样式 */
.navbar {
    position: sticky; /* 粘性定位 */
    top: 0;
    background: rgba(26, 35, 126, 0.9); /* 半透明背景 */
    padding: 15px 30px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.navbar li {
    position: relative;
}

.navbar li ul {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: #6200EA;
    padding: 10px;
    border-radius: 5px;
}

.navbar li:hover ul {
    display: block;
}

.navbar a {
    color: #FFFFFF;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
}

/* 按钮样式 */
.button {
    background-color: #FFC107;
    border: none;
    padding: 10px 20px;
    color: #FFFFFF;
    font-size: 16px;
    border-radius: 5px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.button:hover {
    transform: scale(1.05);
    background-color: #FFEB3B;
}

/* 响应式网格布局 */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 40px;
}

.grid-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.halo {
    animation: pulse 5s infinite;
}

/* 视差滚动效果 */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 500px;
    position: relative;
}

/* 轮播图样式 */
.carousel {
    position: relative;
    overflow: hidden;
    height: 400px;
    margin: 40px 0;
}

.carousel-inner {
    display: flex;
    animation: slide 15s infinite;
}

.carousel-item {
    min-width: 100%;
    transition: transform 1s ease;
}

@keyframes slide {
    0% { transform: translateX(0); }
    25% { transform: translateX(-100%); }
    50% { transform: translateX(-200%); }
    75% { transform: translateX(-300%); }
    100% { transform: translateX(0); }
}

/* 代码块在文章中的特殊样式 */
.article-code {
    background: rgba(0, 0, 0, 0.8); /* 深色背景 */
    color: #00FF00; /* 代码颜色 */
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
    margin: 20px 0;
}

/* 提示信息样式 */
.alert {
    background: #4CAF50;
    color: #FFFFFF;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 30px;
    font-size: 18px;
}

/* 折叠区域样式 */
.details-summary {
    cursor: pointer;
    color: #FFC107;
    margin-bottom: 10px;
    display: block;
    font-size: 18px;
}

details[open] summary {
    color: #FFEB3B;
}

/* 保证宽度不小于500px的容器 */
.container {
    min-width: 500px;
}

/* 自适应调整 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        background: #6200EA;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        display: none;
    }

    .navbar li:hover ul {
        display: none;
    }

    .navbar.active ul {
        display: flex;
    }
}

