
/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置字体和基础颜色 */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #0d1b2a, #1b263b, #0f3460);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 渐变动画 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(13, 27, 42, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    transition: background 0.3s ease;
}

.navbar.scrolled {
    background: rgba(13, 27, 42, 1);
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

.navbar .nav-links {
    display: flex;
    gap: 1.5rem;
}

.navbar .nav-links a {
    color: #ffffff;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.navbar .nav-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #00ff7f;
    transition: width 0.3s;
}

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

.navbar .nav-links a:hover {
    color: #00ff7f;
}

/* 搜索框样式 */
.search-box {
    position: relative;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    outline: none;
    transition: width 0.4s ease, box-shadow 0.3s ease;
    width: 150px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.search-box input::placeholder {
    color: #cccccc;
}

.search-box input:focus {
    width: 250px;
    box-shadow: 0 0 10px #00ff7f;
}

/* 主容器样式 */
.container {
    max-width: 1200px;
    margin: 100px auto 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 栏目样式 */
.section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 64px 0 rgba(31, 38, 135, 0.5);
}

/* 标题样式 */
h2, h3, h4 {
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

/* 段落样式 */
p {
    margin-bottom: 1rem;
    color: #dddddd;
}

p span {
    color: #00ff7f;
}

/* 代码块样式 */
pre {
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

/* 按钮样式 */
.button-primary, .button-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none;
    color: #ffffff;
    font-size: 1rem;
}

.button-primary {
    background-color: #ff8c00;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.button-primary:hover {
    background-color: #ffa500;
    transform: translateY(-2px);
}

.button-secondary {
    background-color: #00ff7f;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.button-secondary:hover {
    background-color: #32cd32;
    transform: translateY(-2px);
}

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

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

/* 章节导航样式 */
.chapter-nav {
    position: fixed;
    right: 20px;
    top: 100px;
    background: rgba(13, 27, 42, 0.8);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chapter-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

/* 摘示信息样式 */
.reference-note {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-left: 5px solid #00ff7f;
    margin-bottom: 2rem;
    border-radius: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .nav-links {
        display: none;
    }
    .container {
        padding: 1rem;
    }
    .chapter-nav {
        display: none;
    }
    img {
        max-width: 100%;
    }
}

