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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #EEDFCC, #D2B48C);
    color: #444;
    padding: 20px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: #8B4513;
}

a {
    text-decoration: none;
    color: #FFD700;
    transition: color 0.3s ease-in-out;
}

a:hover {
    color: #CD7F32;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(to bottom, #8B4513, #A0522D);
    color: #FFFAF0;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 300%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent);
    transform: translateX(-50%) scale(0);
    animation: glow-expand 2s ease-in-out forwards;
}

@keyframes glow-expand {
    to {
        transform: translateX(-50%) scale(1);
        opacity: 0;
    }
}

.section {
    background: #FFF8DC;
    border: 2px solid #FFD700;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.section img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
}

.code-block {
    background: #2E2E2E;
    color: #FFFAF0;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.image-fade {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.image-fade.in-view {
    opacity: 1;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    background: #8B4513;
    color: #FFFAF0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.footer {
    text-align: center;
    padding: 20px;
    background: #8B4513;
    color: #FFFAF0;
    margin-top: 40px;
    border-top: 2px solid #FFD700;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 20px 0;
    }

    .section {
        padding: 15px;
    }

    .code-block {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

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