/* 基本样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    max-width: 1200px; /* 设置 PC 端页面宽度为 1200px */
    margin: 0 auto; /* 使页面居中 */
}

header {
    background-color: #333;
    color: #fff;
    padding: 10px 0;
    text-align: center;
}

nav {
    background-color: #444;
    color: #fff;
    padding: 10px;
    text-align: center;
    white-space: nowrap; /* 防止换行 */
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

nav ul li {
    display: inline-block; /* 修改: 使用 inline-block 以便水平排列 */
    margin-right: 10px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

main {
    padding: 20px;
    display: flex;
    gap: 20px; /* 新闻板块与侧边栏之间留出间隙 */
    flex-wrap: wrap; /* 添加: 允许换行 */
}

.sidebar {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-width: 100%; /* 添加: 确保侧边栏在小屏幕上不会超出视口 */
}

.news-list {
    flex: 3;
    max-width: 100%; /* 添加: 确保新闻列表在小屏幕上不会超出视口 */
}

.news-list article {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-width: 100%; /* 添加: 确保文章在小屏幕上不会超出视口 */
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px 0;
}

/* 响应式设计 */
@media (max-width: 600px) {
    header, footer {
        padding: 10px;
    }

    main {
        padding: 10px;
        flex-direction: column;
        gap: 10px; /* 新闻板块与侧边栏之间留出间隙 */
    }

    .sidebar {
        margin-top: 20px;
    }

    nav ul li {
        display: inline-block; /* 保持横排 */
        margin-bottom: 5px;
    }
}


/* 详情页设计 */
.news-detail {
    flex: 3;
    max-width: 100%;
}

.news-detail article {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
}

.news-detail h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.news-detail p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.news-detail .source {
    font-size: 14px;
    color: #999;
}

/* 详情页设计 */
/* 详情页设计 */
.detail-page {
    width: 100%;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    padding: 20px;
}

.detail-page header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap; // 添加换行属性
}

.detail-page header .author-details {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap; // 添加换行属性
}

.detail-page header .author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

.detail-page header .author-info {
    flex-grow: 1;
}

.detail-page header .author-info h1 {
    font-size: 2em;
    color: #333;
    margin: 0;
}

.detail-page header .author-info .author-name {
    font-size: 1em;
    color: #333;
    margin: 5px 0 0;
}

.detail-page header .author-info .meta {
    color: #999;
    font-size: 0.9em;
    margin: 0;
}

.detail-page header .follow-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px; // 添加间距以适应小屏幕
}

.detail-page header .follow-button:hover {
    background-color: #218838;
}

.detail-page main {
    line-height: 1.6;
    color: #555;
}

.detail-page footer {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.detail-page footer p {
    font-weight: bold;
}

.detail-page footer ul {
    list-style-type: none;
    padding: 0;
}

.detail-page footer ul li {
    display: inline-block;
    margin-right: 10px;
}

.detail-page footer ul li a {
    text-decoration: none;
    color: #007BFF;
}

.detail-page footer ul li a:hover {
    text-decoration: underline;
}


.ai1{
     background: #007bff;
          color: white;
          border: none;
          padding: 6px 12px;
          border-radius: 4px;
          cursor: pointer;
          margin-left: auto; /* 确保按钮靠右 */
}