
/* 基本重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 变量定义 */
:root {
    --primary-deep-blue: #004AAD;
    --secondary-purple: #6A00C7;
    --accent-teal: #00C7B7;
    --background-light: #f5f5f5;
    --text-dark: #333333;
    --text-light: #ffffff;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --font-family: 'Roboto', sans-serif;
}

/* 全局样式 */
body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--primary-deep-blue), var(--secondary-purple));
    background-attachment: fixed;
    animation: backgroundMove 15s linear infinite;
    padding: 20px;
}

/* 动态背景动画 */
@keyframes backgroundMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 固定导航栏 */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav .logo {
    color: var(--text-light);
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 16px;
    transition: color var(--transition-speed);
}

nav ul li a:hover {
    color: var(--accent-teal);
}

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 100px auto 50px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 文章样式 */
article h2 {
    font-size: 2em;
    color: var(--primary-deep-blue);
    margin-bottom: 20px;
}

article h3 {
    font-size: 1.5em;
    color: var(--secondary-purple);
    margin: 20px 0 10px;
}

article h4 {
    font-size: 1.2em;
    color: var(--accent-teal);
    margin: 15px 0 10px;
}

article p {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

article pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 14px;
    margin-bottom: 20px;
}

article code {
    font-family: 'Courier New', Courier, monospace;
    background: #f0f0f0;
    padding: 2px 4px;
    border-radius: 4px;
}

article ul, article table {
    margin-bottom: 20px;
}

article ul li {
    margin-left: 20px;
    list-style-type: disc;
}

article table {
    width: 100%;
    border-collapse: collapse;
}

article table, article th, article td {
    border: 1px solid #ddd;
}

article th, article td {
    padding: 10px;
    text-align: left;
}

.article-section {
    margin-bottom: 40px;
}

/* 示例展示区 */
.sample-display {
    background: var(--background-light);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sample-display h2 {
    color: var(--secondary-purple);
    margin-bottom: 15px;
}

.sample-display pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 10px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-size: 14px;
}

.sample-display code {
    background: #3c3c3c;
    color: #ffffff;
    padding: 2px 4px;
    border-radius: 4px;
}

/* 按钮样式 */
.button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-teal);
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    transition: background var(--transition-speed);
}

.button:hover {
    background: var(--secondary-purple);
}

.button::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%);
    transition: all 0.4s ease;
}

.button:hover::before {
    width: 200px;
    height: 200px;
    opacity: 0;
}

/* 图片样式 */
img {
    max-width: 100%;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.decorative-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.decorative-images img {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

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

th, td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: var(--primary-deep-blue);
    color: var(--text-light);
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* 响应式设计 */
@media (max-width: 1440px) {
    .main-content {
        max-width: 1100px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        max-width: 900px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        max-width: 750px;
    }
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .decorative-images {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 10px 20px;
    }

    nav .logo {
        font-size: 20px;
    }

    nav ul li a {
        font-size: 14px;
    }

    .button {
        padding: 8px 16px;
        font-size: 14px;
    }

    article h2 {
        font-size: 1.8em;
    }

    article h3 {
        font-size: 1.3em;
    }

    article p, article ul, article table, .sample-display pre {
        font-size: 14px;
    }

    .decorative-images img {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 320px) {
    nav ul {
        display: none;
    }

    .main-content {
        padding: 10px;
    }

    article h2 {
        font-size: 1.5em;
    }
}

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

a:hover {
    color: var(--secondary-purple);
}

/* 提示文字样式 */
.reference-note {
    text-align: center;
    font-size: 14px;
    color: var(--text-dark);
    margin-top: 20px;
}

