/* ============================================================
   全站样式（仿 gov.cn 简洁风格）
   参数取自 gov.cn 真实 CSS：
   - 容器 1220px / 头条标题 42px #015293 / 栏目标题 26px 宋体
   - 页头页脚分割线 #2e5586 / 搜索框 38px 高 圆角20px 居中
   ============================================================ */

/* ---------- 基础 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  color: #1a1a1a;
  background: #ffffff;
  line-height: 1.6;
  /* 横向溢出保护：任何子元素超出视口都不产生页面级左右滚动条（导航栏等内部滚动不受影响） */
  overflow-x: hidden;
  /* 吸底页脚：内容不足一屏时页脚仍贴在视口底部，保证所有页面底部外观一致 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
}

a {
  color: #1a1a1a;
  text-decoration: none;
}

a:hover {
  color: #015293;
}

ul {
  list-style: none;
}

/* 容器：全站唯一宽度标准，对标 gov.cn 满宽 1220px（无内边距，内容顶到容器边缘）；窄屏由媒体查询补内边距 */
.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0;
}

/* ---------- 页头（高110px，底部蓝色分割线 #2e5586） ---------- */
.site-header {
  border-bottom: 1px solid #2e5586;
  background: #ffffff;
}

.header-inner {
  display: flex;
  align-items: center;
  min-height: 128px;
}

.site-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.site-brand:hover {
  color: inherit;
}

/* 站点 Logo：方形头像裁圆形，置于标题左侧 */
.site-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-family: "SimHei", "黑体", "Microsoft YaHei", sans-serif;
  font-size: 30px;
  font-weight: bold;
  color: #c7000b;
  letter-spacing: 2px;
  line-height: 1.3;
}

.site-domain {
  font-size: 13px;
  color: #999999;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* 搜索框：与导航组成右对齐组（gov.cn 同款位置），高38px 圆角20px 背景#f0f0f0 */
.header-search {
  display: flex;
  align-items: center;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 0 16px;
  width: 260px;
  height: 38px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #333333;
}

.header-search button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #888888;
  display: flex;
  align-items: center;
  padding: 2px;
}

.header-search button:hover {
  color: #015293;
}

.site-nav {
  margin-left: 20px;
  font-size: 15px;
  color: #666666;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav a {
  color: #444444;
}

.site-nav a:hover {
  color: #015293;
}

.nav-sep {
  color: #cccccc;
  margin: 0 1px;
}

/* ---------- 页脚（顶部蓝色分割线 #2e5586） ---------- */
.site-footer {
  border-top: 1px solid #2e5586;
  background: #ffffff;
  text-align: center;
  color: #646464;
  font-size: 14px;
  padding: 20px 0;
  margin-top: 56px;
}

/* ---------- 首页：焦点区（头条大标题 42px #015293） ---------- */
.featured {
  padding-top: 38px;
}

.featured-title {
  text-align: center;
  font-size: 38px;
  font-weight: normal;
  line-height: 1.3;
}

.featured-title a {
  color: #015293;
}

/* 头条副标题：文章摘要，颜色与大标题一致（front matter 的 summary，缺省取正文第一段）。
   行数截断：最多 2 行，超出才在末尾加省略号；宽度自适应，不按字数硬切 */
.featured-meta {
  text-align: center;
  font-size: 19px;
  color: #015293;
  line-height: 1.7;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* 焦点区主体：grid 两列（54:46，对标 gov.cn 660+510）。图下标题独占第二行，
   第一行行高由焦点图决定，右侧列表随网格拉伸，天然与图片顶/底对齐 */
.featured-body {
  display: grid;
  /* gov.cn 实测：.news .focus 660px + .news .list 510px（1220 容器）→ 54:46 */
  grid-template-columns: 54fr 46fr;
  column-gap: 40px;
  margin-top: 32px;
}

.fcarousel-wrap {
  min-width: 0;
}

.fcarousel {
  position: relative;
  overflow: hidden;
}

.fcarousel-slide {
  display: none;
}

.fcarousel-slide.active {
  display: block;
}

/* 焦点图：宽高比 850:477（gov.cn 首页焦点图文件实测像素） */
.fcarousel-slide img {
  width: 100%;
  /* gov.cn 焦点图实际文件 850×477（宽高比 1.78），按其比例显示 */
  aspect-ratio: 850 / 477;
  height: auto;
  object-fit: cover;
  display: block;
}

/* 左右切换箭头：鼠标移入才显示 */
.fcarousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 48px;
  border: none;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.fcarousel:hover .fcarousel-arrow {
  opacity: 1;
}

.fcarousel-arrow.prev {
  left: 0;
}

.fcarousel-arrow.next {
  right: 0;
}

/* 轮播圆点指示器（右下角，gov.cn 同款长条激活态） */
.fcarousel-dots {
  position: absolute;
  right: 16px;
  bottom: 12px;
  display: flex;
  gap: 8px;
}

.fcarousel-dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: #999999;
  cursor: pointer;
  padding: 0;
}

.fcarousel-dot.active {
  background: #2e5586;
  width: 24px;
  border-radius: 6px;
}

/* 焦点图下方：当前焦点文章标题 */
.fcarousel-caption {
  text-align: center;
  font-size: 18px;
  padding: 12px 0 0;
}

/* 右侧最新文章列表：网格拉伸，高度 = 焦点图高度（顶/底精确对齐） */
.latest-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 与焦点图上/下边缘视觉对齐：行盒的半行距会让文字上下各空出一截，
   顶部标题行高 1.6→1.15（文字上移约 6px），末条行高 1.6→1（底部空隙归零） */
.latest-block .block-head h3 {
  line-height: 1.15;
}

.latest-block .block-list li:last-child {
  line-height: 1;
}

.latest-block .block-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.latest-block .block-list li {
  font-size: 20px;
  line-height: 1.6;
}

/* ---------- 栏目块（标题 26px 宋体，对标 gov.cn「要闻」） ---------- */
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid #015293;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.block-head h3 {
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: bold;
  color: #000000;
}

.more-link {
  font-size: 15px;
  color: #015293;
}

.block-list li {
  display: flex;
  align-items: baseline;
  line-height: 2.1;
  font-size: 18px;
}

.block-list li::before {
  content: "●";
  font-size: 10px;
  color: #999999;
  margin-right: 10px;
  flex-shrink: 0;
}

.block-list li a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-list li .date {
  margin-left: auto;
  padding-left: 16px;
  color: #999999;
  font-size: 15px;
  flex-shrink: 0;
}

.block-list li.empty {
  color: #aaaaaa;
}

.block-list li.empty::before {
  content: "";
  margin: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 60px;
  margin-top: 44px;
}

/* 栏目块作为 grid 项：允许收缩到 1fr 轨道宽度，避免长标题把网格撑出横向滚动 */
.section-block {
  min-width: 0;
}

.section-grid .block-list li {
  font-size: 18px;
  line-height: 2.5;
}

/* ---------- 分类列表页 ---------- */
/* 栏目条：对标 gov.cn .channel_tab（底部 2px 深蓝线 #004986） */
.section-bar {
  display: flex;
  align-items: center;
  background: #f4f6f9;
  border-radius: 3px 3px 0 0;
  border-bottom: 2px solid #004986;
  margin-top: 28px;
  margin-bottom: 22px;
}

.section-label {
  background: #015293;
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  padding: 9px 26px;
  border-radius: 3px 0 0 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.section-sort {
  margin-left: auto;
  padding-right: 18px;
  font-size: 14px;
  color: #999999;
}

.post-list li {
  display: flex;
  align-items: baseline;
  padding: 13px 4px;
  border-bottom: 1px dashed #e5e5e5;
}

.post-list li::before {
  content: "●";
  font-size: 10px;
  color: #999999;
  margin-right: 10px;
  flex-shrink: 0;
}

.post-list-title {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-list-date {
  margin-left: auto;
  padding-left: 16px;
  color: #999999;
  font-size: 14px;
  flex-shrink: 0;
}

.empty-tip {
  font-size: 16px;
  color: #aaaaaa;
  padding: 24px 4px;
}

/* ---------- 文章页 ---------- */
/* 文章页正文栏：gov.cn 文章页实测 .oneColumn（content-box 宽度 950px = 纯文字宽，左右各 60px 内边距，总宽 1070px） */
.post {
  max-width: 1070px;
  margin: 0 auto;
  padding: 50px 60px 80px;
}

/* 正文标题：gov.cn 文章页 h1 实测（38px 微软雅黑、常规粗细、居中、#333 黑色系、行高 56px） */
.post-title {
  text-align: center;
  font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", sans-serif;
  font-size: 38px;
  font-weight: normal;
  line-height: 1.47;
  color: #333333;
  padding-bottom: 26px;
}

/* 元信息行：字体字号与正文一致（宋体 16px），颜色保持现状 */
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  font-size: 16px;
  color: #999999;
  border-bottom: 1px solid #dcdcdc;
  padding-bottom: 14px;
  margin-top: 16px;
}

.post-meta a {
  color: #015293;
}

.post-meta .disabled {
  color: #cccccc;
}

/* 字号切换器：文字式按钮，融入元信息行 */
.font-switch {
  margin-right: 4px;
}

.font-switch button {
  border: none;
  background: none;
  padding: 0;
  margin: 0 3px;
  font: inherit;
  color: #999999;
  cursor: pointer;
}

.font-switch button:hover {
  color: #015293;
}

.font-switch button.active {
  color: #015293;
  font-weight: bold;
}

/* 字号档位（桌面/移动两端统一）：默认 18px（基准），大 20px，超大 22px；行高按比例自动跟随 */
.post-content.font-large {
  font-size: 20px;
}

.post-content.font-xlarge {
  font-size: 22px;
}

/* 正文：宋体、行高 1.875、段首缩进（对标 gov.cn 文章页排版） */
.post-content {
  font-family: "SimSun", "宋体", "Noto Serif SC", serif;
  font-size: 18px;
  line-height: 1.875;
  color: #333333;
  padding-top: 22px;
}

.post-content p {
  text-indent: 2em;
  margin-bottom: 1em;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #015293;
  line-height: 1.5;
  margin: 1.4em 0 0.6em;
}

.post-content h2 {
  font-size: 22px;
  border-left: 4px solid #015293;
  padding-left: 10px;
}

.post-content h3 {
  font-size: 19px;
}

.post-content a {
  color: #015293;
  text-decoration: underline;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1em 2em;
}

.post-content li {
  margin-bottom: 0.4em;
}

.post-content img {
  max-width: 100%;
  display: block;
  margin: 12px auto;
}

.post-content blockquote {
  border-left: 4px solid #dddddd;
  background: #f9f9f9;
  padding: 10px 16px;
  margin: 0 0 1em;
  color: #555555;
}

.post-content blockquote p {
  text-indent: 0;
  margin-bottom: 0;
}

.post-content code {
  font-family: Consolas, "Courier New", monospace;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
}

.post-content pre {
  background: #f6f8fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 1em;
}

.post-content pre code {
  background: transparent;
  padding: 0;
  font-size: 14px;
  line-height: 1.7;
}

.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
  font-size: 15px;
}

.post-content th,
.post-content td {
  border: 1px solid #dddddd;
  padding: 8px 12px;
  text-align: left;
}

.post-content th {
  background: #f4f6f9;
}

.post-content video {
  max-width: 100%;
  display: block;
  margin: 12px auto;
}

/* ---------- 搜索页 ---------- */
.search-page {
  padding-top: 36px;
}

.search-bar {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
}

.search-bar input {
  flex: 1;
  border: 1px solid #cccccc;
  border-right: none;
  border-radius: 3px 0 0 3px;
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
}

.search-bar input:focus {
  border-color: #015293;
}

.search-bar button {
  background: #015293;
  color: #ffffff;
  border: none;
  border-radius: 0 3px 3px 0;
  padding: 10px 28px;
  font-size: 16px;
  cursor: pointer;
}

.search-bar button:hover {
  background: #2e5586;
}

.search-count {
  font-size: 16px;
  color: #999999;
  margin: 14px 0 6px;
}

.search-result-item {
  padding: 18px 0;
  border-bottom: 1px solid #eeeeee;
}

.result-title {
  font-size: 18px;
  color: #015293;
  font-weight: bold;
}

.result-excerpt {
  font-size: 16px;
  color: #666666;
  line-height: 1.8;
  margin-top: 6px;
}

.result-date {
  font-size: 16px;
  color: #aaaaaa;
  margin-top: 6px;
}

.hl {
  color: #d43c3c;
}

/* ---------- 响应式：窄屏适配（手机竖屏一屏完整显示，无横向滚动） ---------- */
@media (max-width: 768px) {
  /* 窄屏补回内容两侧内边距 */
  .container {
    padding: 0 16px;
  }

  /* 上面的 .container padding 会连带覆盖 .search-page 的 padding-top（优先级相同、后写生效），
     导致搜索框与页头分割线相贴，这里重新声明顶部间距 */
  .search-page {
    padding-top: 24px;
  }

  /* 页头：标题 + 搜索框一行，分类导航自动换行显示 */
  .header-inner {
    min-height: 0;
    padding: 14px 0;
    gap: 12px;
    flex-wrap: wrap;
  }

  .site-brand {
    flex-shrink: 1;
    min-width: 0;
    gap: 10px;
  }

  .site-logo {
    width: 40px;
    height: 40px;
  }

  .site-title {
    font-size: 20px;
    letter-spacing: 1px;
    white-space: nowrap;
  }

  .site-domain {
    display: none;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    font-size: 15px;
    line-height: 2;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .header-search {
    order: 2;
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    height: 34px;
    margin-left: 0;
  }

  /* 焦点区：单栏堆叠，顺序 = 图 → 图下标题 → 最新文章 */
  .featured {
    padding-top: 20px;
  }

  .featured-title {
    font-size: 24px;
  }

  /* 头条副标题：字号与「最新文章」列表标题一致 */
  .featured-meta {
    font-size: 16px;
  }

  .featured-body {
    grid-template-columns: 1fr;
    row-gap: 24px;
    margin-top: 14px;
  }

  .fcarousel-wrap {
    order: 1;
  }

  .fcarousel-caption {
    order: 2;
    margin-top: -12px;
    /* 焦点图下文章标题：字号与「最新文章」列表标题一致 */
    font-size: 16px;
  }

  .latest-block {
    order: 3;
  }

  /* 栏目块：单栏 */
  .section-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .block-head h3 {
    font-size: 22px;
  }

  .block-list li,
  .post-list-title {
    font-size: 16px;
  }

  /* 栏目块（分栏）文章标题：桌面端 18px 优先级更高，需显式覆盖为与「最新文章」一致的 16px */
  .section-grid .block-list li {
    font-size: 16px;
  }

  /* 移动端栏目块列表：去掉圆点，每条之间加细分隔线（gov.cn 手机端样式） */
  .section-grid .block-list li::before,
  .latest-block .block-list li::before {
    content: none;
  }

  .section-grid .block-list li,
  .latest-block .block-list li {
    border-bottom: 1px solid #eeeeee;
    padding: 10px 0;
    line-height: 1.6;
  }

  /* 移动端「最新文章」列表：字号/行高/颜色与下方栏目块完全一致（覆盖桌面端 20px） */
  .latest-block .block-list li {
    font-size: 16px;
  }

  .latest-block .block-list {
    justify-content: flex-start;
  }

  /* 文章页：正文栏收窄内边距，标题缩小，正文长串自动断行，表格内部横向滚动 */
  .post {
    padding: 20px 16px 40px;
  }

  .post-title {
    font-size: 24px;
  }

  .post-content h2 {
    font-size: 20px;
  }

  .post-content h3 {
    font-size: 18px;
  }

  .post-meta {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  /* 字号档位两端已统一为 18/20/22（见基准 .post-content），此处只保留移动端特有的长串断行 */
  .post-content {
    overflow-wrap: break-word;
  }

  .post-content table {
    display: block;
    overflow-x: auto;
  }
}
