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

/* 定义根变量，便于全局色彩管理 */
:root {
    --primary-color: #0f2027; /* 主色调，深蓝色 */
    --secondary-color: #203a43; /* 辅色调，较深蓝 */
    --accent-color: #2c5364; /* 辅色调，青蓝色 */
    --highlight-color: #00c6ff; /* 点缀色，亮蓝色 */
    --text-color: #ffffff; /* 文字颜色，白色 */
    --background-gradient: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    --nav-background: rgba(0, 0, 0, 0.5); /* 导航栏半透明背景 */
    --nav-hover-background: rgba(0, 0, 0, 0.7); /* 导航栏悬停背景 */
    --button-bg: #0072ff; /* 按钮背景色 */
    --button-hover-bg: #00c6ff; /* 按钮悬停背景色 */
    --font-family: 'Roboto', sans-serif; /* 全局字体 */
}

/* 设置页面背景和基础文字样式 */
body {
    background: var(--background-gradient);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden; /* 禁止水平滚动 */
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-background);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    transition: background 0.3s ease;
}

.navbar:hover {
    background: var(--nav-hover-background);
}

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

.navbar a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--highlight-color);
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

.navbar a:hover::after {
    width: 100%;
}

/* 主内容区样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 50px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* 标题样式 */
h2, h3, h4 {
    color: var(--highlight-color);
}

h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

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

h4 {
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 10px;
}

/* 段落样式 */
p {
    font-size: 16px;
    margin-bottom: 15px;
    text-align: justify;
}

/* 强调文字样式 */
.highlight {
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    -webkit-background-clip: text;
    color: transparent;
}

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 198, 255, 0.6);
}

/* 代码块样式 */
pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    position: relative;
}

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

/* 代码块内代码样式 */
.language-css {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

/* 按钮样式 */
.button {
    background: var(--button-bg);
    border: none;
    padding: 15px 30px;
    color: var(--text-color);
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s, box-shadow 0.3s;
    display: inline-block;
    text-decoration: none;
}

.button:hover {
    background: var(--button-hover-bg);
    box-shadow: 0 0 20px rgba(0, 198, 255, 0.6);
}

/* 交互式图表样式 */
.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.chart-bar {
    width: 30px;
    margin: 0 10px;
    background: linear-gradient(to top, #23a6d5, #23d5ab);
    transition: height 0.5s ease;
}

.chart-bar:hover {
    background: linear-gradient(to top, #0072ff, #00c6ff);
    transform: scaleY(1.1);
}

/* 图标样式 */
.icon {
    width: 40px;
    height: 40px;
    stroke: var(--highlight-color);
    fill: none;
    stroke-width: 2;
    transition: stroke 0.3s, transform 0.3s;
}

.icon:hover {
    stroke: #0072ff;
    transform: scale(1.2);
}

/* 客服按钮样式 */
.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #23d5ab;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(35, 213, 171, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.chat-button::before {
    content: '💬';
    font-size: 24px;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(35, 213, 171, 0.6);
}

/* 加载屏幕样式 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: nebula 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-text {
    color: #ffffff;
    font-size: 24px;
    font-family: var(--font-family);
    animation: fadeIn 2s ease-in-out;
}

/* 关键帧动画 */
@keyframes nebula {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes twinkling {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 0.8; transform: scale(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px;
    }

    .navbar a {
        margin: 10px 0;
        font-size: 14px;
    }

    .container {
        margin: 80px auto 30px;
        padding: 15px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 18px;
    }

    h4 {
        font-size: 16px;
    }

    p {
        font-size: 14px;
    }

    .button {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    .chart-container {
        flex-direction: column;
        gap: 20px;
    }
}

