
/* 基础样式设置 */
:root {
    --主色: #0A2463; /* 深蓝色 */
    --辅色: #4D4D4D; /* 灰色 */
    --点缀色: #FF914D; /* 亮橙色 */
    --背景主色: linear-gradient(135deg, #0A2463, #4D4D4D);
    --字体主色: #FFFFFF;
    --字体辅色: #CCCCCC;
    --字体标题: 'Roboto Bold', sans-serif;
    --字体正文: 'Roboto Regular', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--背景主色);
    color: var(--字体主色);
    font-family: var(--字体正文);
    line-height: 1.6;
    min-width: 320px;
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(10, 36, 99, 0.9);
    padding: 15px 30px;
    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-decoration: none;
    margin-left: 20px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: var(--点缀色);
}

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

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

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

.sidebar ul li {
    margin: 15px 0;
}

.sidebar ul li a {
    color: var(--字体主色);
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sidebar ul li a:hover {
    background-color: var(--点缀色);
}

/* 主要内容容器 */
.container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 100px 30px 30px 30px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 文章样式 */
article {
    grid-column: 1 / -1;
    background-color: rgba(30, 42, 56, 0.9);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

article h2, article h3, article h4 {
    font-family: var(--字体标题);
    color: var(--字体主色);
    margin-bottom: 15px;
}

article h2 {
    font-size: 2em;
}

article h3 {
    font-size: 1.5em;
    margin-top: 25px;
}

article p {
    margin-bottom: 20px;
    font-size: 1em;
    color: var(--字体辅色);
}

article pre {
    background-color: #1E2A38;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 20px;
}

article code {
    color: #FF914D;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

article pre code {
    display: block;
    white-space: pre-wrap;
}

article pre code::before {
    content: 'CSS3 示例代码';
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--点缀色);
}

.language-css .token.selector {
    color: #FF914D;
}

.language-css .token.property {
    color: #FFAB40;
}

.language-css .token.value {
    color: #84B6A7;
}

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

img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* 突出提示文本样式 */
.highlight-text {
    background-color: var(--点缀色);
    color: #0A2463;
    padding: 10px 20px;
    border-radius: 4px;
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 代码块样式 */
pre {
    background: #1E2A38;
    border-left: 4px solid var(--点缀色);
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 20px;
}

pre code {
    font-family: 'Courier New', Courier, monospace;
    color: #FFFFFF;
    font-size: 0.9em;
}

/* 按钮样式 */
button {
    background-color: var(--点缀色);
    color: #0A2463;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

/* 滚动动画 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 图表样式 */
.chart {
    width: 100%;
    height: 400px;
    background-color: #0A2463;
    border-radius: 8px;
    padding: 20px;
}

.chart svg {
    width: 100%;
    height: 100%;
}

.bar {
    fill: var(--点缀色);
    transition: fill 0.3s ease, transform 0.3s ease;
}

.bar:hover {
    fill: var(--字体主色);
    transform: scaleY(1.1);
}

/* 适应不同设备的响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .card {
        width: 100%;
        margin: 10px 0;
    }
}

@media (max-width: 500px) {
    .container {
        padding: 100px 15px 15px 15px;
    }
    
    .highlight-text {
        font-size: 1em;
        padding: 8px 15px;
    }
}

