body {
    background-color: #f0f0f2;
    margin: 0;
    padding: 0;
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 1em auto;
    padding: 0.8em;
    background-color: #fdfdff;
    border-radius: 0.5em;
    box-shadow: 2px 3px 7px 2px rgba(0, 0, 0, 0.02);
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
}

.main-content, .side-content {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.main-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 文章内容中的图片自适应 */
.main-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5em auto;
}

/* 确保所有图片容器内的图片都自适应 */
img {
    max-width: 100%;
    height: auto;
}

/* 文章内容区域样式，确保内容不会超出容器 */
.main-content div[style*="text-align"] {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
}

/* 针对移动设备，确保图片和内容完全自适应 */
@media (max-width: 699px) {
    .main-content img,
    img {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    .main-content div {
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 确保所有容器内的图片都自适应 */
    p img,
    div img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* 防止内容溢出 */
    body {
        overflow-x: hidden;
    }
}

h1, h2, p {
    margin: 0.8em 0;
}

h2 {
    font-size: 1.3em;
}

@media (min-width: 700px) {
    body {
        font-size: 16px;
    }
    
    h1, h2, p {
        margin: 1em 0;
    }
    
    h2 {
        font-size: 1.5em;
    }
}

a:link, a:visited {
    color: #38488f;
    text-decoration: none;
}

.download-section {
    margin-top: 20px;
}

.download-links a {
    display: inline-flex;
    margin: 8px;
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    min-height: 44px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
}

@media (min-width: 700px) {
    .download-section {
        margin-top: 30px;
    }
    
    .download-links a {
        font-size: 16px;
        padding: 10px 20px;
        min-height: auto;
    }
}

.download-links a:hover {
    background-color: #0056b3;
}

.download-links img {
    max-width: 140px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .download-links img {
        max-width: 180px;
    }
}

.articles-section {
    width: 100%;
    max-width: 900px;
    margin: 1em auto;
    padding: 0.8em;
    background-color: #fdfdff;
    border-radius: 0.5em;
    box-shadow: 2px 3px 7px 2px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.articles-section h2 {
    text-align: center;
    margin-bottom: 0.8em;
    font-size: 1.1em;
}

@media (min-width: 700px) {
    .articles-section {
        margin: 2em auto;
        padding: 1em;
    }
    
    .articles-section h2 {
        margin-bottom: 1em;
        font-size: 1.25em;
    }
}

.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.2em;
}

.article-item {
    padding: 0.2em 0;
}

.article-item a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    padding: 4px 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}

@media (min-width: 700px) {
    .article-item a {
        font-size: 15px;
        padding: 0;
        min-height: auto;
        display: block;
    }
}

.article-item a:hover {
    color: #38488f;
    text-decoration: underline;
}

.error {
    color: #c0392b;
    font-weight: bold;
    text-align: center;
}

@media (min-width: 700px) {
    .container {
        flex-direction: row;
    }

    .main-content {
        flex: 1;
    }

    .side-content {
        width: 250px;
        padding-left: 20px;
        border-left: 1px solid #ccc;
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5em;
    }
}
