
/* 
整体页面样式
使用CSS3实现极光渐变背景，科技感强的布局和动态效果
*/

/* 导入字体 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); /* 深蓝渐变背景 */
    color: #fff;
    line-height: 1.6;
}

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

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.9);
}

.navbar a {
    color: #ffdd57; /* 点缀色 */
    text-decoration: none;
    margin: 0 15px;
    font-size: 16px;
    transition: color 0.3s, transform 0.3s;
}

.navbar a:hover {
    color: #ffa500;
    transform: scale(1.1);
}

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    top: 80px;
    left: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
}

.chapter-nav a {
    display: block;
    color: #fff;
    text-decoration: none;
    margin: 10px 0;
    font-size: 14px;
    transition: color 0.3s;
}

.chapter-nav a:hover {
    color: #ffdd57;
}

/* 主内容区样式 */
.container {
    max-width: 1200px;
    margin: 150px auto 50px auto; /* 顶部留出导航栏空间 */
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* 文章样式 */
article h2 {
    font-size: 28px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s infinite;
}

article h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #ffa500;
}

article p {
    font-size: 17px;
    margin-bottom: 15px;
    text-align: justify;
}

article pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 15px;
}

article code {
    color: #ffdd57;
    font-family: 'Courier New', Courier, monospace;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.5s, transform 0.3s;
}

.btn:hover {
    background: linear-gradient(45deg, #fad0c4, #ff9a9e);
    transform: translateY(-5px);
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: scale(1.05);
}

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

img.decorative:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* 折叠内容样式 */
.collapsible {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    padding: 10px 20px;
    border: none;
    text-align: left;
    outline: none;
    font-size: 18px;
    transition: background 0.3s;
    border-radius: 5px;
}

.collapsible:hover {
    background: rgba(255, 255, 255, 0.2);
}

.content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 10px 10px;
}

.content.show {
    max-height: 500px; /* 根据内容调整 */
}

/* 视觉提示样式 */
.visual-prompt {
    text-align: center;
    font-size: 20px;
    padding: 20px;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 40px;
    animation: fadeIn 2s ease-in-out;
}

/* 动画效果 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 3fr 1fr;
    }
    .chapter-nav {
        top: 100px;
    }
}

@media (max-width: 768px) {
    .chapter-nav {
        position: static;
        background: none;
        padding: 0;
    }
    .chapter-nav a {
        display: inline-block;
        margin: 0 10px;
    }
}

