
/* 全局样式设置 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif; /* 主字体 */
    background: linear-gradient(135deg, #1e3c72, #2a5298); /* 主色调蓝紫渐变背景 */
    color: #ffffff; /* 全局文字颜色 */
    line-height: 1.6;
}

/* 响应式网格系统 */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); /* 每个板块至少500px宽 */
    gap: 20px;
    padding: 40px;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(30, 60, 114, 0.9); /* 半透明深蓝背景 */
    padding: 15px 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 ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar li {
    position: relative;
    margin: 0 15px;
}

.navbar a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ff9800; /* 点缀色橙色 */
}

.dropdown {
    position: absolute;
    top: 35px;
    left: 0;
    background: #2a5298;
    display: none;
    flex-direction: column;
    padding: 10px 0;
    border-radius: 4px;
}

.navbar li:hover .dropdown {
    display: flex;
}

.dropdown a {
    padding: 10px 20px;
    color: #fff;
    white-space: nowrap;
}

.dropdown a:hover {
    background: #1e3c72;
}

/* 主要内容区样式 */
.article {
    margin-top: 80px; /* 避免被固定导航栏遮挡 */
    padding: 20px;
    background: rgba(255, 255, 255, 0.1); /* 半透明背景 */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.article h2, .article h3, .article h4, .article h5 {
    color: #ffffff;
    margin-bottom: 15px;
}

.article p {
    font-size: 16px;
    color: #f0f0f0;
    margin-bottom: 20px;
}

.article pre {
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 5px;
    overflow: auto;
}

.article code {
    color: #ff9800; /* 点缀色用于代码高亮 */
    font-family: 'Courier New', Courier, monospace;
}

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

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

/* 按钮样式 */
.button {
    background-color: #ff9800; /* 点缀色橙色 */
    border: none;
    padding: 10px 20px;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

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

.article th, .article td {
    border: 1px solid #ffffff;
    padding: 10px;
    text-align: left;
}

.article th {
    background: #2a5298;
}

.article tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.1);
}

/* 代码块样式 */
.code-block {
    background: #1e3c72;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    overflow: visible;
}

.code-block::before {
    content: 'CSS3 示例代码';
    position: absolute;
    top: -20px;
    left: 0;
    background: #ff9800;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.code-block pre {
    overflow: visible;
}

/* 悬浮聊天按钮样式 */
.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4caf50;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.chat-button:hover {
    background-color: #45a049;
    transform: rotate(360deg);
}

/* 聊天窗口样式 */
.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-window.visible {
    display: flex;
}

.chat-header {
    background: #2a5298;
    color: #fff;
    padding: 15px;
    text-align: center;
}

.chat-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
}

.chat-input {
    display: flex;
    border-top: 1px solid #ddd;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: none;
    outline: none;
}

.chat-input button {
    background: #4caf50;
    border: none;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background: #45a049;
}

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

.collapsible:hover {
    background-color: #1e3c72;
}

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

/* 视差滚动效果 */
.parallax {
    background-image: url('https://images.gptkong.com/demo/sample1.png');
    height: 500px;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

