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

/* 根元素变量定义 */
:root {
    --primary-color: #1E1E1E; /* 主色调 - 深灰 */
    --secondary-color: #0A78D9; /* 强调色 - 电蓝 */
    --accent-color: #32CD32; /* 点缀色 - 荧光绿 */
    --background-gradient: radial-gradient(circle at top left, #1E1E1E, #2C2C2C, #1E1E1E);
    --font-family: 'Poppins', sans-serif;
    --transition-speed: 0.3s;
    --code-background: #2C2C2C;
    --code-color: #FFFFFF;
    --link-color: #0A78D9;
    --link-hover-color: #32CD32;
}

/* 页面背景与基础样式 */
body {
    background: var(--background-gradient);
    color: #FFFFFF;
    font-family: var(--font-family);
    line-height: 1.6;
    padding: 20px;
    transition: background 0.5s ease;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-top: 20px;
}

h2 {
    font-size: 2rem;
    margin-top: 30px;
}

h3 {
    font-size: 1.75rem;
    margin-top: 25px;
}

h4 {
    font-size: 1.5rem;
    margin-top: 20px;
}

/* 段落样式 */
p {
    margin-bottom: 20px;
    font-weight: 400;
    word-wrap: break-word;
}

/* 链接样式 */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--link-hover-color);
}

/* 代码块样式 */
pre {
    background-color: var(--code-background);
    color: var(--code-color);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap;
}

code {
    font-size: 0.95rem;
}

/* 列表样式 */
ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

li {
    margin-bottom: 10px;
}

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 10px;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: var(--primary-color);
    transition: left var(--transition-speed) ease;
    padding-top: 60px;
}

.navbar.active {
    left: 0;
}

.navbar a {
    display: block;
    padding: 15px 20px;
    color: #FFFFFF;
    text-decoration: none;
    transition: background var(--transition-speed);
}

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

/* 主内容区样式 */
.main-content {
    margin-left: 0;
    transition: margin-left var(--transition-speed) ease;
}

.navbar.active ~ .main-content {
    margin-left: 250px;
}

/* 按钮样式 */
.toggle-button {
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: var(--secondary-color);
    border: none;
    color: #FFFFFF;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    transition: background var(--transition-speed);
}

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

/* 动态矢量线条动画 */
@keyframes aurora-move {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.dynamic-background {
    background: radial-gradient(circle, rgb(0, 123, 255), transparent);
    animation: aurora-move 15s linear infinite;
}

/* 隐藏式侧边栏 */
.hidden-navbar {
    display: none;
}

@media (max-width: 1440px) {
    /* 针对大尺寸桌面显示器的调整 */
}

@media (max-width: 1200px) {
    /* 针对桌面显示器的调整 */
}

@media (max-width: 1024px) {
    /* 针对中等屏幕的调整 */
}

@media (max-width: 768px) {
    /* 针对竖屏平板的调整 */
    .navbar {
        width: 200px;
    }
}

@media (max-width: 480px) {
    /* 针对大尺寸手机的调整 */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    .toggle-button {
        padding: 8px 12px;
    }
}

@media (max-width: 320px) {
    /* 针对小尺寸手机的调整 */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1rem;
    }

    .toggle-button {
        padding: 6px 10px;
    }
}

/* 微交互按钮效果 */
button {
    background-color: var(--secondary-color);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.2s ease, background var(--transition-speed);
}

button:hover {
    transform: scale(1.05);
    background-color: var(--accent-color);
}

/* 涟漪效果 */
.button-ripple {
    position: relative;
    overflow: hidden;
}

.button-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* 代码块预览效果 */
.code-preview {
    background-color: var(--code-background);
    color: var(--code-color);
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    overflow-x: auto;
}

/* 提示样式 */
.reference-note {
    background-color: rgba(50, 205, 50, 0.1);
    border-left: 5px solid var(--accent-color);
    padding: 10px 15px;
    margin: 20px 0;
    font-style: italic;
}

/* 超链接不使用下划线 */
a {
    text-decoration: none;
}

/* 预防横向滚动 */
body {
    overflow-x: hidden;
}

/* 进一步的视觉设计要素 */
.section {
    padding: 40px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 动态生成内容 */
.dynamic-content {
    animation: fadeIn 2s ease-in-out;
}

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

/* 优化用户体验 */
a:focus, button:focus {
    outline: none;
    box-shadow: 0 0 5px var(--accent-color);
}

