
/* 全局样式重置，确保不同浏览器下的一致性 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 定义色彩变量，主色70%，辅色25%，点缀色5% */
:root {
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #ff7e5f;
    --background-gradient: linear-gradient(135deg, #1e3c72, #2a5298, #6a11cb);
    --font-family: 'Roboto', sans-serif;
    --text-color: #ffffff;
    --card-bg: #ffffff;
    --card-text-color: #333333;
}

/* 设置全局字体和背景 */
body {
    background: var(--background-gradient);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    padding-top: 80px; /* 为固定导航栏预留空间 */
    transition: background 0.5s ease;
}

/* 统一标题样式 */
h2, h3, h4 {
    color: var(--text-color);
    margin-bottom: 20px;
}

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

.navbar.scrolled {
    background: rgba(30, 60, 114, 1);
}

.navbar a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.3s ease;
}

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

/* 容器和网格系统 */
.container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.col-4 {
    flex: 0 0 33.3333%;
    padding: 15px;
}

@media (max-width: 1024px) {
    .col-4 {
        flex: 0 0 50%;
    }
}

@media (max-width: 768px) {
    .col-4 {
        flex: 0 0 100%;
    }
}

/* 卡片式设计 */
.card {
    background: var(--card-bg);
    color: var(--card-text-color);
    border-radius: 8px;
    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 10px 15px rgba(0,0,0,0.2);
}

/* 按钮样式 */
.btn-highlight {
    background-color: var(--accent-color);
    border: none;
    padding: 10px 20px;
    color: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-highlight:hover {
    background-color: #feb47b;
    transform: scale(1.05);
}

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

img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

/* 工具提示框样式 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    color: var(--accent-color);
}

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

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* 样式化代码块 */
pre code {
    display: block;
    padding: 20px;
    background: #2a5298;
    color: #ffffff;
    border-radius: 8px;
    overflow: auto;
    position: relative;
    font-family: 'Courier New', Courier, monospace;
}

pre code::before {
    content: 'CSS3 示例代码';
    position: absolute;
    top: -20px;
    left: 10px;
    background: var(--secondary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #ffffff;
}

pre code:hover {
    background: #1e3c72;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

.icon-zoom {
    display: inline-block;
    transition: transform 0.3s ease;
}

.icon-zoom:hover {
    transform: scale(1.2);
}

/* 滚动动画 */
.scroll-animation {
    animation: fadeIn 1s forwards;
}

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

.sidebar.collapsed {
    width: 60px;
}

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

.sidebar li {
    padding: 15px 20px;
    position: relative;
    cursor: pointer;
    color: #ffffff;
    transition: background 0.3s ease;
}

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

.sidebar li ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar li.expanded ul {
    max-height: 500px;
}

/* 底部样式 */
.footer {
    background: var(--secondary-color);
    padding: 40px 20px;
    text-align: center;
    color: #ffffff;
}

.footer .partner-logo {
    display: inline-block;
    margin: 10px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.footer .partner-logo:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* 响应式布局调整，确保在320px到1920px之间自适应 */
@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sidebar {
        display: none;
    }

    .container {
        padding: 10px;
    }

    .footer {
        padding: 20px 10px;
    }
}

/* 强调提示信息的位置和样式 */
.reference-note {
    background: rgba(255, 126, 95, 0.8);
    color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    font-size: 1.2em;
    animation: fadeIn 2s ease-in-out;
}

/* 菜单项的样式 */
.sidebar li a {
    color: #ffffff;
    text-decoration: none;
    display: block;
}

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

/* 文章内容区块 */
.article-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

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

.content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(30, 60, 114, 0.8);
    border-radius: 0 0 8px 8px;
}

.content p {
    color: #ffffff;
    margin-bottom: 15px;
}

/* 保证没有水平滚动条 */
body, html {
    overflow-x: hidden;
}

