
/* 页面整体样式设置 */
/* 使用CSS变量定义主题色彩 */
:root {
    --main-color: #87CEEB; /* 主色调：浅蓝色 */
    --secondary-color: #C0C0C0; /* 辅助色：银色 */
    --accent-color: #FFA500; /* 点缀色：橙色 */
    --background-color: #F0F8FF; /* 页面背景色 */
    --text-color: #333333; /* 正文字体颜色 */
    --heading-color: #ffffff; /* 标题字体颜色 */
    --font-primary: 'Roboto', sans-serif; /* 主字体 */
    --font-secondary: 'Open Sans', sans-serif; /* 辅字体 */
}

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    background: var(--background-color);
    font-family: var(--font-secondary);
    color: var(--text-color);
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(135, 206, 235, 0.8); /* 半透明浅蓝色 */
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
}

.navbar .logo {
    font-family: var(--font-primary);
    font-size: 1.5em;
    color: var(--heading-color);
    text-decoration: none;
}

.navbar .nav-links a {
    margin: 0 15px;
    text-decoration: none;
    color: var(--heading-color);
    font-size: 1em;
    transition: color 0.3s ease;
}

.navbar .nav-links a:hover {
    color: var(--accent-color);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 60px; /* 高度与导航栏一致 */
    left: 0;
    width: 200px;
    height: calc(100vh - 60px);
    background: rgba(192, 192, 192, 0.9); /* 半透明银色 */
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar a {
    margin: 10px 0;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1em;
    transition: color 0.3s ease;
}

.sidebar a:hover {
    color: var(--accent-color);
}

/* 主内容区样式 */
.main-content {
    margin-left: 220px; /* 侧边栏宽度 + padding */
    padding: 80px 20px 20px 20px; /* 上方留出导航栏空间 */
}

/* 标题样式 */
h1, h2, h3, h4 {
    font-family: var(--font-primary);
    color: var(--heading-color);
}

h1 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
    background: var(--main-color);
    padding: 10px;
    border-radius: 10px;
}

h2 {
    font-size: 1.8em;
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
}

h3 {
    font-size: 1.6em;
    margin-top: 30px;
    margin-bottom: 15px;
}

h4 {
    font-size: 1.4em;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* 段落和文本样式 */
p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

span {
    font-size: 1em;
}

/* 链接样式 */
a {
    color: var(--main-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* 卡片式设计 */
.card {
    background: rgba(255, 255, 255, 0.2); /* 半透明白色 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* 图片样式 */
.card img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.card img:hover {
    transform: scale(1.05);
}

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

code {
    font-family: 'Courier New', Courier, monospace;
    color: #ffcc00;
}

/* 渐变线条分隔 */
.separator {
    height: 2px;
    background: linear-gradient(to right, var(--main-color), var(--accent-color));
    margin: 40px 0;
    border: none;
}

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

@media (max-width: 992px) {
    .sidebar {
        width: 150px;
    }
    .main-content {
        margin-left: 170px;
    }
}

@media (max-width: 768px) {
    .navbar .nav-links {
        display: none;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }
    h2 {
        font-size: 1.5em;
    }
    h3 {
        font-size: 1.3em;
    }
    h4 {
        font-size: 1.2em;
    }
    .card {
        flex: 1 1 100%;
    }
}

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

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    text-align: center;
}

.button:hover {
    background: darken(var(--accent-color), 10%);
}

/* 提示文本样式 */
.notification {
    background: var(--main-color);
    color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2em;
}

/* 装饰元素 */
.decorative-line {
    width: 50px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto;
    border-radius: 2px;
}


