
/* 整体页面样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 正文字体 */
    background: linear-gradient(135deg, #a8e063, #56ab2f, #0f9b8e); /* 主色调渐变背景 */
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f9b8e; /* 辅色背景 */
    padding: 20px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .logo {
    font-size: 1.5em;
    color: #fff;
    text-decoration: none;
    font-family: 'Roboto', sans-serif; /* 主标题字体 */
}

.navbar ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar ul li {
    margin-left: 20px;
}

.navbar ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #a8e063; /* 点缀色 */
}

/* 移动端导航样式 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 4px 0;
    transition: all 0.3s ease;
}

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

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    transition: box-shadow 0.3s ease;
}

article:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* 文章标题样式 */
article h2, article h3 {
    font-family: 'Roboto', sans-serif;
    color: #0f9b8e; /* 辅色 */
    margin-bottom: 20px;
}

article h2 {
    font-size: 1.8em;
}

article h3 {
    font-size: 1.6em;
}

/* 段落样式 */
article p {
    font-size: 1em;
    margin-bottom: 20px;
    color: #333;
}

/* 代码块样式 */
pre {
    background: #f4f4f4;
    padding: 15px;
    border-radius: 10px;
    overflow: auto;
    position: relative;
}

pre::before {
    content: "代码示例";
    position: absolute;
    top: -20px;
    left: 10px;
    background: #0f9b8e;
    color: #fff;
    padding: 2px 8px;
    font-size: 0.9em;
    border-radius: 5px 5px 0 0;
}

code {
    font-family: 'Courier New', Courier, monospace;
    color: #2F4F4F;
    display: block;
}

/* 图片样式 */
img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    cursor: pointer;
}

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

@media (min-width: 1024px) {
    .container {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* 提示信息样式 */
.prompt-message {
    background: #1E90FF; /* 点缀色 */
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 按钮样式 */
.btn {
    background: #56ab2f; /* 主颜色 */
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background: #a8e063; /* 点缀色 */
    transform: translateY(-3px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px #999;
}

/* 折叠区域样式 */
.collapsible {
    background: #f9f9f9;
    color: #333;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1em;
    transition: background 0.3s ease;
    border-radius: 5px;
}

.collapsible:hover {
    background: #e2e2e2;
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: #f1f1f1;
    border-radius: 0 0 5px 5px;
}

/* 代码高亮样式 */
.language-css {
    color: #2F4F4F;
}

.language-css .keyword { color: #1E90FF; }
.language-css .property { color: #FF6347; }
.language-css .value { color: #32CD32; }

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

.animated-section {
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

.animated-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 背景流动效果 */
.flowing-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(60deg, #a8e063, #56ab2f, #0f9b8e);
    animation: flow 10s linear infinite;
    z-index: -1;
    opacity: 0.3;
}

@keyframes flow {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-25%, -25%); }
    100% { transform: translate(0, 0); }
}

/* 页面链接样式 */
a {
    color: #1E90FF; /* 点缀色 */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #56ab2f; /* 主色调 */
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #0f9b8e;
    color: white;
}

/* 响应式导航设置 */
@media (max-width: 768px) {
    .navbar ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #0f9b8e;
    }
    
    .navbar ul.nav-active {
        display: flex;
    }
    
    .navbar ul li {
        margin: 10px 0;
        text-align: center;
    }
    
    .hamburger {
        display: flex;
    }
}

