
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif; /* 使用易读字体 */
    background: linear-gradient(135deg, #4A90E2, #9013FE); /* 主背景渐变色 */
    color: #333333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: #4A90E2;
}

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

.navbar ul li a {
    text-decoration: none;
    color: #333333;
    font-size: 16px;
    transition: color 0.3s;
}

.navbar ul li a:hover {
    color: #9013FE;
}

/* 主标题样式 */
.header {
    padding-top: 100px; /* 为固定导航栏预留空间 */
    text-align: center;
    color: #ffffff;
}

.header h1 {
    font-size: 48px;
    margin-bottom: 10px;
}

.header p {
    font-size: 18px;
}

/* 章节导航样式 */
.section-nav {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.section-nav a {
    text-decoration: none;
    color: #ffffff;
    font-size: 18px;
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s, color 0.3s;
}

.section-nav a:hover {
    background: #ffffff;
    color: #9013FE;
}

/* 文章内容样式 */
article {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

article h2 {
    font-size: 28px;
    color: #4A90E2;
    margin-bottom: 20px;
}

article h3 {
    font-size: 22px;
    color: #9013FE;
    margin-top: 20px;
    margin-bottom: 10px;
}

article p {
    font-size: 16px;
    margin-bottom: 15px;
}

article code {
    display: block;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    margin: 10px 0;
    overflow-x: auto;
}

/* 图片样式 */
.img-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.img-container img {
    width: 100%;
    max-width: 320px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

/* 微交互效果 */
.button {
    display: inline-block;
    padding: 12px 25px;
    font-size: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #4A90E2, #9013FE);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.5s ease;
    text-decoration: none;
}

.button:hover {
    background: linear-gradient(135deg, #9013FE, #4A90E2);
}

/* 响应式布局 */
@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        position: absolute;
        top: 60px;
        right: 30px;
        width: 200px;
        display: none;
        border-radius: 10px;
    }

    .navbar ul.active {
        display: flex;
    }

    .navbar .menu-toggle {
        display: block;
        cursor: pointer;
    }

    .section-nav {
        flex-direction: column;
        gap: 15px;
    }
}

.menu-toggle {
    display: none;
    font-size: 24px;
    color: #4A90E2;
}

/* 加载动画样式 */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 100px auto;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 代码示例样式 */
.code-sample {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    margin: 20px 0;
}

.code-sample code {
    color: #f8f8f2;
}

/* 按钮动画 */
.button-animated {
    position: relative;
    overflow: hidden;
    transition: color 0.4s;
}

.button-animated::before {
    content: '';
    position: absolute;
    left: -50%;
    top: 0;
    width: 50%;
    height: 100%;
    background: #ffffff;
    transform: skewX(-45deg);
    transition: all 0.4s;
}

.button-animated:hover::before {
    left: 100%;
}

.button-animated:hover {
    color: #9013FE;
}

/* 分隔线样式 */
.divider {
    height: 2px;
    background: linear-gradient(90deg, #4A90E2, #9013FE);
    margin: 40px 0;
    border: none;
}

/* 带阴影的卡片 */
.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-10px);
}

/* 高级动画效果 */
.animated-element {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

/* 黄金比例布局 */
.main-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
}

.sidebar {
    position: sticky;
    top: 100px;
}

/* 内部链接样式 */
a[rel="nofollow"] {
    color: #4A90E2;
    text-decoration: none;
    border-bottom: 1px dashed #9013FE;
    transition: color 0.3s, border-bottom-color 0.3s;
}

a[rel="nofollow"]:hover {
    color: #9013FE;
    border-bottom-color: #4A90E2;
}

/* 结语样式 */
.footer {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.footer p {
    color: #333333;
    font-size: 16px;
}

