
/* 
    全局样式设置
    设置页面的基本字体、背景色及整体布局
*/
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', 'Open Sans', sans-serif; /* 使用无衬线字体，提升可读性 */
    background: linear-gradient(135deg, #A8E063 70%, #56AB2F 25%, #FF6F61 5%); /* 渐变背景，符合黄金比例配色 */
    color: #333333; /* 主字体颜色 */
    line-height: 1.6;
}

/* 
    导航栏样式
    使用Flexbox布局，使导航项水平排列
*/
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9); /* 半透明背景，增加层次感 */
    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;
    font-weight: bold;
    color: #56AB2F; /* 主色调 */
}

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

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

.navbar ul li a {
    text-decoration: none;
    color: #333333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #56AB2F; /* 悬停时颜色变化 */
}

/* 
    主内容区域样式
    采用网格布局，确保响应式设计
*/
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 100px 20px 20px 20px; /* 上方留出导航栏空间 */
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 3fr 1fr; /* 桌面端两栏布局 */
    }
}

/* 
    文章内容模块样式
    每个段落为独立的视觉区块，包含图文
*/
.article-section {
    background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-section:hover {
    transform: translateY(-5px); /* 悬停微动画 */
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.article-section img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.article-section img:hover {
    transform: scale(1.05); /* 图片悬停放大效果 */
}

.article-section h2, 
.article-section h3, 
.article-section h4 {
    color: #2E7D32; /* 辅色调 */
}

.article-section pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border-left: 4px solid #56AB2F; /* 代码块装饰线 */
}

.article-section code {
    font-family: 'Courier New', Courier, monospace;
    color: #d63384;
}

/* 
    侧边栏样式
    包含导航链接，使用固定定位
*/
.sidebar {
    display: none; /* 移动端隐藏 */
}

@media (min-width: 768px) {
    .sidebar {
        display: block;
        position: sticky;
        top: 100px;
        padding: 20px;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 10px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    text-decoration: none;
    color: #56AB2F;
    transition: color 0.3s ease;
}

.sidebar ul li a:hover {
    color: #FF6F61; /* 点缀色变化 */
}

/* 
    底部样式
    简洁明了，包含版权信息
*/
.footer {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-top: 40px;
}

.footer p {
    margin: 0;
    color: #555555;
}

/* 
    图片展示样式
    统一的圆角、阴影、悬停效果
*/
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.image-gallery img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 
    提示信息样式
    显著位置显示提示文字
*/
.highlight {
    background-color: #FFEB3B; /* 黄色高亮背景 */
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 30px;
}

/* 
    导航链接样式
    确保内部链接有 rel="nofollow" 属性
*/
a {
    color: #56AB2F;
    text-decoration: none;
}

a:hover {
    color: #FF6F61;
}

/* 
    渐变线条作为装饰元素
*/
.deco-line {
    height: 4px;
    background: linear-gradient(90deg, #56AB2F, #FF6F61);
    margin: 40px 0;
    border: none;
}

/* 
    留白设置，确保页面呼吸感
*/
.section {
    padding: 60px 20px;
}

.section + .section {
    border-top: 1px solid #e0e0e0;
}

/* 
    动画与过渡效果
    用于交互和动态展示
*/
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 1s forwards;
}

.fade-in.visible {
    opacity: 1;
}

/* 
    3D变换效果
    增强视觉层次感
*/
.card-3d {
    perspective: 1000px;
}

.card-3d .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-3d:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-back {
    transform: rotateY(180deg);
    background-color: #FF6F61;
    color: white;
}

/* 
    高级CSS3示例代码块样式
    与正文内容区分开，增强可读性
*/
.css-example {
    background-color: #f0f0f0;
    padding: 15px;
    border-left: 4px solid #56AB2F;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

.css-example code {
    color: #d63384;
}

/* 
    按钮样式
    统一的按钮设计，包含悬停效果
*/
.button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #56AB2F;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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