
/* 基础样式 */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1e1e1e, #121212);
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.9);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: background 0.3s ease;
}

header.scrolled {
    background: rgba(18, 18, 18, 1);
}

header h1 {
    margin: 0;
    font-size: 24px;
    color: #4A90E2;
}

nav a {
    color: #AFAFAF;
    text-decoration: none;
    margin-left: 20px;
    position: relative;
    transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
    color: #FFC107;
}

nav a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #FFC107;
    transition: width 0.3s;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

.section {
    padding: 100px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.section:nth-child(even) {
    background: linear-gradient(135deg, #2c2c2c, #1e1e1e);
}

h2, h3, h4 {
    color: #4A90E2;
    margin-bottom: 20px;
}

p, li {
    color: #AFAFAF;
    max-width: 800px;
    text-align: center;
}

ul {
    list-style: none;
    padding: 0;
}

ul li {
    margin-bottom: 10px;
}

pre {
    background: #2c2c2c;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    max-width: 90%;
    margin: 20px auto;
}

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

img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    margin: 10px;
    border-radius: 10px;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.footer {
    padding: 40px 20px;
    background: #1e1e1e;
    text-align: center;
    color: #AFAFAF;
}

.footer p {
    margin: 0;
}

.reference {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(74, 144, 226, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    color: #FFFFFF;
}

@media (max-width: 1440px) {
    header h1 {
        font-size: 22px;
    }
    nav a {
        margin-left: 15px;
        font-size: 14px;
    }
    .section {
        padding: 80px 15px;
    }
}

@media (max-width: 1200px) {
    header {
        padding: 15px 30px;
    }
    .section {
        padding: 70px 10px;
    }
}

@media (max-width: 1024px) {
    nav a {
        margin-left: 10px;
        font-size: 13px;
    }
    img {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    nav {
        margin-top: 10px;
    }
    .section {
        padding: 60px 8px;
    }
    img {
        width: 240px;
        height: 240px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 20px;
    }
    nav a {
        margin-left: 8px;
        font-size: 12px;
    }
    .section {
        padding: 50px 5px;
    }
    img {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 320px) {
    header h1 {
        font-size: 18px;
    }
    nav a {
        margin-left: 5px;
        font-size: 11px;
    }
    .section {
        padding: 40px 3px;
    }
    img {
        width: 160px;
        height: 160px;
    }
}

/* 动态效果 */
.line {
    width: 100%;
    height: 2px;
    background: #4A90E2;
    animation: lineGrow 1s ease-in-out forwards;
}

@keyframes lineGrow {
    from { width: 0; }
    to { width: 100%; }
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.menu-overlay.open {
    display: flex;
}

.menu-overlay nav a {
    display: block;
    margin: 20px 0;
    font-size: 24px;
    color: #FFFFFF;
}

.menu-button {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
}

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

body.fade-in {
    animation: fadeIn 1s ease-in-out;
}

