
/* 基础样式重置与全局设定 */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #e0e0e0;
    background: linear-gradient(135deg, #03071e, #370617, #6a040f, #9d0208, #d00000, #dc2f02, #e85d04, #f48c06, #faa307, #ffba08);
    background-size: 200% 200%;
    animation: gradientAnimation 15s ease infinite;
    overflow-x: hidden; /* 避免水平滚动条 */
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 页面通用元素样式 */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    color: #fff;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.2;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1em;
    color: #d4d4d4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

a {
    color: #5bc0de;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #fff;
}

ul,
ol {
    margin-bottom: 1em;
    padding-left: 20px;
    color: #d4d4d4;
}

li {
    margin-bottom: 0.5em;
}

code {
    font-family: 'Courier New', monospace;
    background-color: #2c3e50;
    color: #f8f8f2;
    padding: 0.2em 0.4em;
    border-radius: 5px;
    font-size: 0.9em;
}

pre {
    background-color: #282a36;
    color: #f8f8f2;
    padding: 1em;
    border-radius: 8px;
    overflow-x: auto; /* 代码块超出时显示水平滚动条 */
    tab-size: 4;
    margin-bottom: 1em;
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.9rem;
    display: block; /* 确保代码块独占一行，便于滚动 */
    white-space: pre; /* 保留空白符和换行符 */
    word-break: break-all; /* 长单词换行 */
    word-wrap: break-word; /* 兼容旧版本浏览器 */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    color: #d4d4d4;
}

th,
td {
    border: 1px solid #444;
    padding: 0.5em;
    text-align: left;
}

th {
    background-color: #343a40;
    color: #fff;
}

/* 页面布局与模块化样式 */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 3rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 4px 4px 5px rgba(0, 0, 0, 0.5);
}

.section {
    margin-bottom: 40px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px); /* 毛玻璃效果 */
    border: 1px solid rgba(255, 255, 255, 0.1); /* 边框增强层次感 */
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: #f8f9fa;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #faa307;
    border-radius: 2px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background-color: rgba(44, 62, 80, 0.7); /* 卡片背景色 */
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.card p {
    font-size: 1rem;
    line-height: 1.5;
}

.article-section article {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #f0f0f0;
}

.article-section article h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    text-align: left;
    border-bottom: 2px solid #faa307;
    padding-bottom: 10px;
}

.article-section article h3 {
    font-size: 1.8rem;
    margin-top: 25px;
    margin-bottom: 15px;
}

.article-section article p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.2em;
}

.article-section article ul,
.article-section article ol {
    margin-bottom: 1.2em;
}

.article-section article li {
    font-size: 1.1rem;
    line-height: 1.7;
}

.article-section article pre {
    margin: 1.5em 0;
}

.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #999;
    font-size: 0.9rem;
}

/* 装饰性图片样式 */
.decorative-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    .header {
        padding: 30px 0;
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 25px;
        margin-bottom: 30px;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .card-grid {
        gap: 20px;
    }

    .card {
        padding: 20px;
    }

    .card h3 {
        font-size: 1.3rem;
    }

    .article-section article h2 {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    .article-section article h3 {
        font-size: 1.6rem;
        margin-top: 20px;
        margin-bottom: 12px;
    }

    .article-section article p,
    .article-section article li {
        font-size: 1rem;
        line-height: 1.6;
    }
}

@media screen and (max-width: 768px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .card-grid {
        grid-template-columns: 1fr; /* 平板竖屏及更小屏幕，卡片单列显示 */
    }

    .article-section article h2 {
        font-size: 1.8rem;
    }

    .article-section article h3 {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .section {
        padding: 20px;
    }

    .card {
        padding: 15px;
    }

    .card h3 {
        font-size: 1.2rem;
    }

    .article-section article h2 {
        font-size: 1.6rem;
    }

    .article-section article h3 {
        font-size: 1.4rem;
    }

    .article-section article p,
    .article-section article li {
        font-size: 0.95rem;
    }
}

@media screen and (max-width: 320px) {
    .container {
        width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    .article-section article h2 {
        font-size: 1.4rem;
    }

    .article-section article h3 {
        font-size: 1.3rem;
    }
}

