/*
Theme Name: 政务发布
Theme URI: https://typecho.org
Description: 专为党团机关、政务信息发布设计的轻量级响应式主题。包含醒目标语与轮播图功能。
Author: 专属生成
Version: 1.0.0
*/

:root {
    --main-color: #d32f2f; /* 政务红 */
    --hover-color: #b71c1c;
    --text-color: #333333;
    --bg-color: #f4f5f7;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "SimHei", sans-serif; background: var(--bg-color); color: var(--text-color); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* 头部与导航 */
header { background: var(--main-color); color: white; padding: 30px 0; }
.site-title { font-size: 32px; font-weight: bold; letter-spacing: 3px; text-align: center; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); line-height: 1.5; }

/* 强制消除网站名称的超链接样式干扰 */
.site-title a, 
.site-title a:link,
.site-title a:visited, 
.site-title a:hover, 
.site-title a:active { 
    color: #ffffff !important; 
    text-decoration: none !important; 
    border-bottom: none !important; 
    display: inline-block !important; 
    background: transparent !important;
}

/* 强制约束图片尺寸与汉字完全等高 */
.site-title img,
.site-title a img {
    display: inline-block !important;
    height: 1em !important; 
    max-height: 1em !important;
    width: auto !important; 
    vertical-align: middle !important; 
    margin: 0 10px !important; 
    position: relative !important;
    top: -0.1em !important; 
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* === 恢复导航栏（菜单选项按钮）样式 === */
nav { background: var(--hover-color); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
nav .container { display: flex; flex-wrap: wrap; justify-content: center; }
nav a { color: white; text-decoration: none; padding: 14px 25px; font-size: 16px; transition: background 0.3s; display: inline-block; }
nav a:hover, nav a.active { background: rgba(0,0,0,0.15); }

/* === 修复轮播图选项按钮（小圆点）颜色，强制覆盖默认蓝色 === */
:root { --swiper-theme-color: #d32f2f; }
.swiper-pagination-bullet { background: #999 !important; opacity: 0.8 !important; }
.swiper-pagination-bullet-active { background: var(--main-color) !important; opacity: 1 !important; }

/* 醒目标语 */
.slogan-box { background: #fff8e1; color: var(--main-color); text-align: center; padding: 18px 15px; font-size: 24px; font-weight: bold; margin-bottom: 20px; border-bottom: 3px solid var(--main-color); letter-spacing: 2px; }

/* 轮播图 */
.swiper { 
    width: 100%; 
    /* 将电脑端的最大宽度从原来的1200px缩小到900px，居中显示，避免16:9在宽屏上像一堵墙一样过高 */
    max-width: 900px; 
    margin: 0 auto 25px; 
    border-radius: 6px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    background-color: #ffffff; /* 增加白色底色，防止非16:9图片产生透明镂空 */
}
.swiper-slide img { 
    width: 100%; 
    height: auto; 
    display: block; 
    aspect-ratio: 16 / 9 !important; /* 强制全平台统一为 16:9 比例 */
    object-fit: contain !important; /* 核心：contain 属性保证图片绝对不被裁剪，完整显示（若图片非16:9，边缘会自动留白填充） */
}
/* 优化左右切换按钮在不同底色下的可见度 */
.swiper-button-next, .swiper-button-prev { 
    color: rgba(255,255,255,0.9) !important; 
    text-shadow: 0 1px 4px rgba(0,0,0,0.5); 
}

/* 内容区域 & 新闻列表 */
.content-area { background: white; padding: 35px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 30px; }
.section-title { border-bottom: 2px solid var(--main-color); padding-bottom: 12px; margin-top: 0; color: var(--main-color); font-size: 22px; margin-bottom: 20px; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px dashed #e0e0e0; align-items: center; }
.news-list li a { color: var(--text-color); text-decoration: none; font-size: 16px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 20px; transition: color 0.2s; }
.news-list li a::before { content: "■"; color: var(--main-color); margin-right: 10px; font-size: 12px; vertical-align: middle; }
.news-list li a:hover { color: var(--main-color); font-weight: bold; }
.news-list li .date { color: #888; font-size: 14px; white-space: nowrap; }

/* 文章详情 */
.post-title { text-align: center; color: var(--main-color); margin-bottom: 15px; font-size: 28px; }
.post-meta { text-align: center; color: #666; font-size: 14px; border-bottom: 1px solid #eee; padding-bottom: 20px; margin-bottom: 30px; }
.post-content { line-height: 2; font-size: 17px; color: #222; text-align: justify; }
.post-content img { max-width: 100%; height: auto; display: block; margin: 10px auto; }
.post-content p { text-indent: 2em; }

/* 分页 */
.pagination { text-align: center; margin-top: 30px; padding: 0; }
.pagination li { display: inline-block; margin: 0 4px; }
.pagination a, .pagination span { display: inline-block; padding: 8px 15px; border: 1px solid #ddd; text-decoration: none; color: #333; border-radius: 4px; }
.pagination .current { background: var(--main-color); color: white; border-color: var(--main-color); }
.pagination a:hover { background: #f4f5f7; }

/* 底部 */
footer { background: #262626; color: #999; text-align: center; padding: 25px 0; margin-top: 40px; font-size: 14px; line-height: 1.8; }
footer a { color: #ccc; text-decoration: none; }

/* 响应式适配 (手机 & 平板) */
@media (max-width: 768px) {
    .site-title { font-size: 24px; }
    nav a { padding: 12px 15px; font-size: 15px; }
    .slogan-box { font-size: 18px; padding: 15px 10px; }
    .content-area { padding: 20px 15px; }
    .news-list li { flex-direction: column; align-items: flex-start; }
    .news-list li a { margin-right: 0; margin-bottom: 8px; width: 100%; }
    .news-list li .date { margin-left: 22px; font-size: 13px; }
    .post-title { font-size: 22px; }
    .swiper-slide img { aspect-ratio: 16/9; }
}