
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体，提升可读性 */
    background: linear-gradient(135deg, #0F2027, #203A43, #2C5364); /* 渐变背景，营造科技感 */
    color: #ffffff; /* 文字颜色为白色，确保高对比度 */
    line-height: 1.6;
}

/* 统一标题样式 */
h1, h2, h3, h4 {
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffcc00; /* 高亮颜色，吸引注意 */
}

/* 正文段落样式 */
p {
    font-size: 16px;
    margin-bottom: 15px;
    color: #f0f0f0;
    max-width: 800px; /* 确保段落不小于500px，提升可读性 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 32, 39, 0.9); /* 半透明背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

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

.navbar a:hover {
    color: #ffcc00; /* 悬停效果，颜色变化 */
}

/* 主要内容区域 */
.container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 100px 20px 50px 20px; /* 顶部留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

/* 文章样式 */
article {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* 代码块样式 */
pre {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

code {
    color: #00ffcc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 代码块标题 */
pre code::before {
    content: "CSS 示例代码";
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffcc00;
}

/* 图片装饰样式 */
.decorative-image {
    width: 320px;
    height: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 响应式布局 */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 1fr 1fr; /* 两栏布局 */
    }
}

@media (min-width: 1200px) {
    .container {
        grid-template-columns: 1fr 1fr 1fr; /* 三栏布局 */
    }
}

/* 轮播图样式 */
.carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
}

.carousel img {
    width: 100%;
    display: none;
    border-radius: 10px;
}

.carousel img.active {
    display: block;
    animation: fadeIn 2s ease-in-out;
}

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

/* 提示框样式 */
.tooltip {
    background: rgba(255, 204, 0, 0.9);
    color: #0F2027;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    margin: 20px 0;
}

/* 按钮样式 */
.button {
    background-color: #ffcc00;
    border: none;
    color: #1e3c72;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 10px 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* 折叠区域样式 */
.collapsible {
    background-color: rgba(255, 204, 0, 0.1);
    color: #ffffff;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: rgba(255, 204, 0, 0.2);
}

.content {
    padding: 0 18px;
    display: none;
    background-color: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    border-radius: 5px;
}

/* 底部样式 */
.footer {
    background: rgba(15, 32, 39, 0.9);
    color: #ffffff;
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

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

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

.footer a:hover {
    color: #ffffff;
}

/* 动画效果 */
@keyframes slideIn {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: slideIn 1s ease-out forwards;
}

