
/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298, #6a11cb, #2575fc, #00c6ff);
    color: #ffffff;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: rgba(42, 82, 152, 0.9);
    color: #ffffff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: width 0.3s ease;
}

.navbar:hover {
    width: 260px;
}

.navbar h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    margin-bottom: 30px;
}

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

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

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

.navbar ul li a:hover {
    color: #00c6ff;
}

/* 主要内容区域 */
.main-content {
    margin-left: 250px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.navbar:hover + .main-content {
    margin-left: 260px;
}

.section {
    margin-bottom: 50px;
    padding: 20px;
    background: rgba(37, 117, 252, 0.2);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.section:hover {
    background: rgba(37, 117, 252, 0.3);
}

.section h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    margin-bottom: 15px;
    color: #ffffff;
}

.section p {
    font-size: 16px;
    color: #f0f0f0;
}

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

.section img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.5);
}

.decorative-line {
    height: 4px;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    margin: 40px 0;
    border-radius: 2px;
}

.footer {
    text-align: center;
    padding: 20px;
    background: rgba(33, 150, 243, 0.8);
    color: #ffffff;
    position: fixed;
    bottom: 0;
    width: calc(100% - 250px);
    left: 250px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease, width 0.3s ease;
}

.navbar:hover ~ .footer {
    left: 260px;
    width: calc(100% - 260px);
}

.footer p {
    margin: 0;
    font-size: 14px;
}

/* 渐变动画 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

/* 微交互效果 */
.btn {
    background-color: #2575fc;
    color: #ffffff;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: #00c6ff;
    transform: scale(1.05);
}

.code-block {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

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

@media (max-width: 768px) {
    .navbar {
        width: 60px;
    }

    .navbar h1 {
        display: none;
    }

    .navbar ul li a {
        font-size: 12px;
    }

    .main-content {
        margin-left: 60px;
    }

    .footer {
        left: 60px;
        width: calc(100% - 60px);
    }
}

@media (max-width: 480px) {
    .section h2 {
        font-size: 18px;
    }

    .section p {
        font-size: 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 图片悬停效果 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.image-gallery img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* 导航链接样式 */
.nav-links a {
    display: block;
    padding: 10px 0;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #00c6ff;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 100px;
    right: 20px;
    background: rgba(42, 82, 152, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chapter-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.chapter-nav ul li a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.chapter-nav ul li a:hover {
    color: #00c6ff;
}

/* CSS3代码示例样式 */
.css-sample {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', Courier, monospace;
    color: #00c6ff;
    margin: 20px 0;
}

.css-sample pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}


