
/* 定义CSS变量，便于全局色彩管理 */
:root {
    --main-dark-blue: #0A3D62; /* 主色调：深蓝色 */
    --main-blue: #3C6382;      /* 辅助色：亮蓝色 */
    --highlight-orange: #F7B731; /* 点缀色：橙色 */
    --background-color: #1E2A38; /* 页面背景色 */
    --secondary-color: #14213D;  /* 次级背景色 */
}

/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

/* 标题样式 */
h1, h2, h3, h4 {
    color: var(--main-blue);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.8em;
}

h3 {
    font-size: 1.6em;
}

h4 {
    font-size: 1.4em;
}

/* 段落样式 */
p {
    font-size: 1em;
    color: #d1d1d1;
    margin-bottom: 1em;
    max-width: 800px;
}

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

a:hover {
    color: #e0a827;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--highlight-orange);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1em;
}

.btn-primary:hover {
    background-color: #e0a827;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--main-dark-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.navbar a {
    margin: 0 15px;
    color: #ffffff;
    font-size: 1em;
}

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

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

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

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

.sidebar li {
    margin: 20px 0;
}

.sidebar a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

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

/* 主体内容容器 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    padding: 100px 30px 30px 30px;
}

/* 卡片样式 */
.card {
    background-color: #1E2A38;
    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;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid #3C6382;
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--highlight-orange);
}

.card-description {
    font-size: 0.95em;
    color: #d1d1d1;
}

/* 图片样式：圆角、阴影、悬停效果 */
.image-decor {
    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-decor:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 代码块样式 */
.code-block {
    background-color: #14213D;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    color: #fff;
    font-size: 0.95em;
}

.code-block code {
    display: block;
}

/* 加载动画样式 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--main-blue);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--main-dark-blue);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 10px 20px;
    }

    .sidebar {
        width: 200px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
    }
}

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

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

.collapsible:after {
    content: '\002B';
    font-size: 1.2em;
    float: right;
}

.collapsible.active:after {
    content: "\2212";
}

.content {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(--secondary-color);
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 导航栏调整，避免内容显示不全 */
.navbar a {
    padding: 10px;
    box-sizing: border-box;
}

/* CSS3高阶特性示例 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 多语言切换器样式 */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.language-btn {
    background-color: var(--main-blue);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
}

.language-btn:hover {
    background-color: var(--highlight-orange);
}

