
/* 整体页面设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif; /* 使用现代无衬线字体 */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 渐变背景色 */
    color: #ffffff;
}

/* 顶部导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(32, 58, 67, 0.9); /* 半透明背景 */
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 阴影效果 */
}

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

.navbar a:hover {
    color: #FF9800; /* 鼠标悬停时颜色变化 */
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: -250px;
    top: 60px;
    width: 250px;
    height: 100%;
    background: #203a43;
    transition: left 0.3s ease;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1); /* 阴影效果 */
}

.sidebar.open {
    left: 0;
}

/* 主内容区域 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 20px;
    padding: 100px 20px 20px 20px; /* 顶部留出导航栏空间 */
}

/* 卡片样式 */
.card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

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

.card img {
    width: 100%;
    height: auto;
    border-bottom: 1px solid #e0e0e0;
    transition: transform 0.3s ease;
}

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

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: #203a43; /* 辅助色 */
}

.card-description {
    font-size: 16px;
    color: #555555;
}

/* 按钮样式 */
.button-primary {
    background-color: #FF9800; /* 点缀色 */
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.button-primary:hover {
    background-color: #e68900;
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background: rgba(32, 58, 67, 0.8);
    padding: 10px;
    border-radius: 8px;
}

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

.chapter-nav a:hover {
    color: #FF9800;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    .sidebar {
        width: 200px;
    }
    .container {
        grid-template-columns: 1fr;
        padding: 80px 10px 10px 10px;
    }
    .chapter-nav {
        display: none; /* 移动端隐藏章节导航 */
    }
}

/* 图片装饰效果 */
.card img {
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card:hover img {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 过渡效果 */
.card, .button-primary, .navbar a, .chapter-nav a {
    transition: all 0.3s ease;
}

/* 加载动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    animation: fadeIn 1s ease-in;
}

/* 提示信息样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333333;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 代码块样式 */
code {
    background: #2c5364;
    padding: 2px 4px;
    border-radius: 4px;
    color: #FF9800;
    font-family: 'Courier New', Courier, monospace;
}

/* 高亮代码 */
pre code {
    display: block;
    padding: 15px;
    background: #203a43;
    border-radius: 8px;
    overflow-x: auto;
    color: #ffffff;
}

/* 页面底部样式 */
.footer {
    background: rgba(32, 58, 67, 0.9);
    color: #ffffff;
    text-align: center;
    padding: 20px 0;
    position: relative;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

