
/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设定主色调及背景渐变 */
:root {
    --primary-color: #003366; /* 深蓝色，传达专业与信任感 */
    --secondary-color: #1E90FF; /* 亮蓝色，突出科技感 */
    --accent-color: #20B2AA; /* 青绿色，增加视觉层次 */
    --background-gradient: linear-gradient(135deg, #0F2027, #203A43, #2C5364); /* 渐变背景，增强深邃感 */
    --text-color: #FFFFFF; /* 白色文字 */
    --secondary-text-color: #DDDDDD; /* 灰色次要文字 */
    --card-background: rgba(255, 255, 255, 0.2); /* 卡片背景半透明白 */
    --modal-background: rgba(255, 255, 255, 0.8); /* 模态窗口背景 */
}

/* 设置页面背景和全局字体 */
body {
    background: var(--background-gradient);
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    padding-top: 80px; /* 为固定导航栏预留空间 */
    overflow-x: hidden; /* 防止水平滚动 */
}

/* 固定导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--primary-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 导航栏链接样式 */
.navbar a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--secondary-color);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 250px;
    height: 100%;
    background: #001122;
    padding: 20px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
}

.sidebar.active {
    transform: translateX(0);
}

/* 侧边栏链接样式 */
.sidebar a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    margin: 15px 0;
    font-size: 16px;
    transition: color 0.3s ease;
}

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

/* 主内容区域样式 */
.main-content {
    margin-left: 0;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

.sidebar.active ~ .main-content {
    margin-left: 250px;
}

/* 文章标题样式 */
article h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

article h3 {
    font-size: 24px;
    margin: 20px 0 10px;
    color: var(--accent-color);
}

article p {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--secondary-text-color);
}

/* 强调文本颜色 */
article p span {
    color: var(--secondary-color);
}

/* 代码块容器样式 */
article pre {
    background: #2c3e50;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* 代码文本样式 */
article code {
    color: #ecf0f1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

/* 表格样式 */
article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

article table th,
article table td {
    border: 1px solid #34495e;
    padding: 10px;
    text-align: left;
    color: #ecf0f1;
}

article table th {
    background: var(--primary-color);
}

/* 图片样式 */
article img {
    max-width: 650px;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 20px 0;
}

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

/* 卡片容器样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 40px;
}

/* 单个卡片样式 */
.card {
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    padding: 20px;
}

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

/* 信息按钮在悬停时出现 */
.card .info-button {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: #FFFFFF;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.card:hover .info-button {
    opacity: 1;
}

/* 模态窗口样式 */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--modal-background);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1001;
}

.modal.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

/* 模态窗口动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 仪表盘容器样式 */
.dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 40px;
}

.dashboard .widget {
    background: var(--card-background);
    border-radius: 8px;
    padding: 20px;
    flex: 1 1 calc(33% - 40px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.dashboard .widget:hover {
    transform: scale(1.05);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .dashboard .widget {
        flex: 1 1 100%;
    }
}

/* 样式提示文字 */
.reference-note {
    text-align: center;
    font-size: 18px;
    margin: 30px 0;
    color: var(--secondary-color);
}

/* 代码示例块样式 */
.code-example {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

/* 折叠区域样式 */
.collapsible {
    background-color: var(--primary-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    margin-bottom: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.collapsible:hover {
    background-color: var(--secondary-color);
}

.content {
    padding: 0 18px;
    display: none;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 图片描述样式 */
.image-description {
    font-size: 14px;
    color: var(--secondary-text-color);
    text-align: center;
    margin-top: 5px;
}

/* 按钮样式 */
button {
    background: var(--secondary-color);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: var(--accent-color);
}

/* 响应式字体调整 */
@media (max-width: 600px) {
    article h2 {
        font-size: 24px;
    }

    article h3 {
        font-size: 20px;
    }

    article p {
        font-size: 14px;
    }
}

