
/* 引用字体 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@700&family=Roboto:wght@400&family=Montserrat:wght@500&display=swap');

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    color: #333333;
    background: linear-gradient(135deg, #0a3d62, #1e3799);
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

/* 顶部导航栏 */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.header .logo {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    color: #FFC107;
}

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

.header nav a:hover {
    color: #FF5722;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 200px;
    height: calc(100% - 80px);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.sidebar a:hover {
    color: #FFC107;
    transform: scale(1.1);
}

/* 主内容区 */
.main-content {
    margin: 80px 20px 20px 220px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    color: #ffffff;
    flex: 1;
}

/* 文章样式 */
article {
    max-width: 800px;
    margin: 0 auto;
}

article h2, article h3 {
    font-family: 'Poppins', sans-serif;
    color: #FFC107;
    margin-top: 20px;
}

article p {
    line-height: 1.6;
    margin: 15px 0;
    font-size: 16px;
}

article pre {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
    margin: 15px 0;
}

article code {
    font-family: 'Courier New', Courier, monospace;
    color: #00FF00;
}

/* 示例展示区 */
.example-display {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #FFC107;
    padding: 20px;
    margin: 30px 0;
    border-radius: 5px;
}

.example-display h2 {
    color: #FF5722;
}

.example-display pre {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 5px;
    overflow: auto;
}

/* 图片样式 */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.image-gallery img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.1);
}

/* 底部提示 */
.footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    position: fixed;
    bottom: 0;
    width: 100%;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1440px) {
    .sidebar {
        width: 180px;
    }
    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 160px;
    }
    .main-content {
        margin-left: 180px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 140px;
    }
    .main-content {
        margin-left: 160px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        flex-direction: row;
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        height: 60px;
        justify-content: space-around;
    }
    .main-content {
        margin: 80px 10px 80px 10px;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .header nav {
        display: none;
    }
    .sidebar {
        display: none;
    }
}

@media (max-width: 320px) {
    .main-content {
        margin: 80px 5px 80px 5px;
    }
}

/* 按钮样式 */
button {
    background-color: #FF5722;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

/* 卡片布局 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.card {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.card h4 {
    margin-top: 0;
    color: #FFC107;
}

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

/* 互动元素 */
.interactive {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.interactive div {
    flex: 1;
    min-width: 200px;
}

/* 数据可视化 */
.chart {
    width: 100%;
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

/* 代码块预览 */
.code-preview {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 5px;
    color: #d4d4d4;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

