/* ============================================================
 * 南京市雨花台区人民政府 · 区长信箱页
 * 说明：本页只引用本文件，故将基础/概览样式（原 gl-20261009.css）
 *       合并于此；后半部分为本页 Tabs、须知等专属样式。
 * 配色：
 *   主蓝 #325d92  深蓝 #1d3f77  高亮蓝 #3b82d6
 *   正文 #333 / 次要 #666 / 日期 #999 / 分割线 #e5e5e5
 * ============================================================ */

/* ============================================================
 * 基础样式（原 gl-20261009.css）
 * 内容区最大宽度 1300px；左栏 ≤280px，右栏 ≤940px，响应式自适应
 * ============================================================ */

:root {
  --primary: rgba(50, 93, 146, 1);
  --deep: #1d3f77;
  --accent: #3b82d6;
  --bullet: #6fb4ea;
  --text: #333333;
  --sub: #666666;
  --date: #999999;
  --line: #e5e5e5;
  --container: 1300px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

/* 防横向溢出保险（真正的溢出源在页头，下面已修） */
html,
body {
  overflow-x: hidden;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

img {
  border: 0;
  display: block;
}

button,
input {
  font-family: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  /* padding: 0 20px; */
}

/* ===== 图片占位盒：后期补图时直接给内部 img 填 src 即可 ===== */
.img-slot {}

.img-slot>img {
  width: 100%;
  height: 100%;
}

.img-slot.skin-transparent {
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* ===== 面包屑 ===== */
.crumb {
  padding: 14px 0;
  font-size: 16px;
  color: #8a8f99;
  display: flex;
  align-items: center;
}

.crumb a {
  color: var(--primary);
  margin: 0 8px;
}

.crumb a:hover {
  text-decoration: underline;
}

.crumb .sep {
  margin: 0 8px;
  color: #b8bdc6;
}

.crumb svg {
  vertical-align: -2px;
  margin-right: 4px;
}

/* ===== 主体两栏 ===== */
.page-main {
  padding-bottom: 40px;
}

.layout {
  display: flex;
  gap: 34px;
  align-items: flex-start;
}

/* 左栏：≤280px */
.side-col {
  flex: 0 1 280px;
  width: 280px;
  max-width: 280px;
  min-width: 220px;
}

.side-item {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 80px;
  padding: 0 22px;
  font-size: 22px;
  color: #333;
  border-right: 4px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background .2s, color .2s;
}

.side-item:hover {
  background: #f5f8fd;
  color: var(--primary);
}

.side-item.active {
  background: linear-gradient(90deg, #e0ecff 0%, #ffffff 100%);
  border-right-color: var(--accent);
  color: var(--primary);
  font-weight: 600;
}

.side-item .s-icon {
  width: 16px;
  height: 16px;
  display: none;
  position: absolute;
  top: 50%;
  left: 50px;
  transform: translate(0, -50%);
}

.side-item.active .s-icon {
  display: block;
}

/* 右栏：≤940px */
.main-col {
  flex: 1 1 auto;
  max-width: 940px;
  min-width: 0;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 12px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: background .2s ease;
}

.news-item:hover {
  background: #f6f9fd;
}

.news-item:hover .news-title {
  color: var(--primary);
}

.diamond {
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--bullet);
  border-radius: 1.5px;
  transform: rotate(45deg);
}

.news-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s ease;
}

.news-date {
  flex: none;
  font-size: 18px;
  color: var(--date);
  font-variant-numeric: tabular-nums;
}

.news-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.empty-tip {
  padding: 60px 0;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* 置标 trs_pagenav 输出：当前页为 .pagenav_span，其余为 .pagenav_a */
.pagination .pagenav_span,
.pagination .pagenav_a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #dcdfe5;
  background: #f5f6f8;
  color: #555;
  font-size: 13px;
  line-height: 1;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.pagination .pagenav_a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .pagenav_span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: default;
}

.pg-jump {
  height: 28px;
  width: 44px;
  border: 1px solid #dcdfe5;
  border-radius: 3px;
  text-align: center;
  font-size: 13px;
  outline: 0;
  color: #333;
}

.pg-jump:focus {
  border-color: var(--accent);
}

/* ===== 响应式：窄屏堆叠，不写死宽度 ===== */
/* 与首页保持一致：1360 以下留 16px 边距，640 以下收紧到 12px */
@media (max-width:1360px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width:980px) {

  /* stretch：纵向排列时两栏宽度都占满容器，避免被长标题撑宽后裁切 */
  .layout {
    flex-direction: column;
    gap: 18px;
    align-items: stretch;
  }

  /* 列方向下 flex-basis 作用于高度，必须复位为 auto，否则空占 280px 高 */
  .side-col {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
    min-width: 0;
  }

  /* 侧栏变为横向可滑动的标签条 */
  .side-menu {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid #eee;
  }

  .side-menu::-webkit-scrollbar {
    display: none;
  }

  .side-item {
    height: 42px;
    border-right: 0;
    border-bottom: 3px solid transparent;
    padding: 0 14px;
    font-size: 17px;
    white-space: nowrap;
  }

  .side-item.active {
    border-bottom-color: var(--accent);
  }

  /* 整格可点，手机上不必精准点中文字 */
  .side-item > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
  }

  /* 横向标签条空间有限，选中图标不再挤占文字 */
  .side-item.active .s-icon,
  .side-item.active .p-icon {
    display: none;
  }

  .main-col {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
  }
}

@media (max-width:640px) {

  /* 手机边距与首页保持一致 */
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .crumb {
    padding: 10px 0;
    font-size: 13px;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .crumb a,
  .crumb .sep {
    margin: 0 4px;
  }

  .side-item {
    height: 40px;
    padding: 0 12px;
    font-size: 15px;
  }

  .news-item {
    gap: 8px;
    min-height: 0;
    padding: 10px 0;
    align-items: flex-start;
  }

  .diamond {
    width: 6px;
    height: 6px;
    margin-top: 7px;
  }

  /* 手机标题最多两行，比单行省略能看到更多内容 */
  .news-title {
    font-size: 15px;
    line-height: 1.5;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .news-date {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 2px;
  }

  .news-divider {
    margin: 4px 0;
  }

  .empty-tip {
    padding: 40px 0;
  }

  .pagination {
    gap: 6px;
    margin-top: 18px;
  }

  .pagination .pagenav_span,
  .pagination .pagenav_a {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
  }

  .pg-jump {
    height: 30px;
    width: 40px;
  }
}

/* ============================================================
 * 本页专属样式：区长信箱 Tabs
 * ============================================================ */

/* ===== Tabs 导航条 ===== */
.mb-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  border-bottom: 1px solid var(--line);
}

.mb-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  height: 58px;
  padding: 0 28px;
  font-family: inherit;
  font-size: 18px;
  letter-spacing: .5px;
  color: #5a6472;
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s ease;
}

.mb-tab:hover {
  color: var(--primary);
}

.mb-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
  border-radius: 4px;
}

/* 选中下划线：居中展开 */
.mb-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 64%;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform .32s cubic-bezier(.65, .05, .36, 1);
}

.mb-tab.active {
  color: var(--primary);
  font-weight: 600;
}

.mb-tab.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== 面板切换动画 ===== */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: mb-panel-in .36s ease both;
}

.tab-panel[hidden] {
  display: none;
}

@keyframes mb-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 网上信箱须知（公文式排版） ===== */
.notice-title {
  margin-top: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  text-indent: 2px; /* 抵消字间距带来的视觉偏移，保证真正居中 */
  color: var(--deep);
}

.notice-subtitle {
  margin: 24px 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: #333;
}

.rule-list {
  list-style: decimal;
  padding-left: 1.9em;
}

.rule-list li {
  padding-left: 2px;
  font-size: 16px;
  line-height: 1.9;
  color: #444;
}

.rule-list li::marker {
  color: #555;
  font-variant-numeric: tabular-nums;
}

/* ===== 我要写信 ===== */
.mb-write {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px dashed #e0e8f2;
  text-align: center;
}

.btn-write {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  height: 48px;
  padding: 0 36px;
  border-radius: 3px;
  background: #2a5caa;
  color: #fff;
  font-size: 17px;
  letter-spacing: 2px;
  transition: background .2s ease;
}

.btn-write:hover {
  background: var(--deep);
  color: #fff;
}

.btn-write:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== 回复选登 iframe ===== */
.mb-frame {
  margin-top: 22px;
  border: 1px solid #e6eef8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.mb-frame iframe {
  display: block;
  width: 100%;
  border: 0;
}

/* ===== 信件办结率统计 ===== */

/* 筛选条 */
.stat-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid #e6eef8;
  border-radius: 8px;
  background: #f7faff;
}

.stat-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #333;
}

.stat-label {
  color: #5a6472;
  white-space: nowrap;
}

.stat-select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  min-width: 96px;
  padding: 0 30px 0 12px;
  border: 1px solid #d5dfec;
  border-radius: 3px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a95a5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-family: inherit;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  outline: 0;
  transition: border-color .2s ease;
}

.stat-select:focus {
  border-color: var(--accent);
}

.stat-btn {
  height: 38px;
  padding: 0 30px;
  border: 0;
  border-radius: 3px;
  background: #2a5caa;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background .2s ease;
}

.stat-btn:hover {
  background: var(--deep);
}

.stat-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stat-period {
  margin-left: auto;
  font-size: 13px;
  color: #8a8f99;
  font-variant-numeric: tabular-nums;
}

/* 表格 */
.stat-table-wrap {
  margin-top: 16px;
  border: 1px solid #e6eef8;
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stat-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
}

.stat-table th {
  height: 50px;
  background: #eef4fc;
  color: var(--primary);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.stat-table th,
.stat-table td {
  padding: 0 16px;
  border-bottom: 1px solid #eef2f7;
  text-align: center;
}

.stat-table th:first-child,
.stat-table td:first-child {
  width: 40%;
  padding-left: 24px;
  text-align: left;
}

.stat-table td {
  height: 50px;
  font-size: 15px;
  color: #444;
  font-variant-numeric: tabular-nums;
}

.stat-table tbody tr {
  transition: background .2s ease;
}

.stat-table tbody tr:hover {
  background: #f7faff;
}

.stat-table tbody tr:last-child td {
  border-bottom: 0;
}

.stat-dept {
  color: #333;
}

.stat-rate {
  color: var(--primary);
  font-weight: 600;
}

.stat-none {
  height: 140px;
  padding: 0 16px;
  text-align: center;
  color: #9aa4b2;
  font-size: 14px;
}

.stat-table td.stat-none:first-child {
  text-align: center;
  padding-left: 16px;
}

.stat-error {
  color: #c0392b;
}

/* ===== 本页响应式 ===== */
@media (max-width:980px) {
  .mb-tab {
    height: 50px;
    padding: 0 22px;
    font-size: 17px;
  }

  .notice-title {
    font-size: 22px;
  }

  /* 筛选条空间不足时，统计区间换行到下一行 */
  .stat-bar {
    flex-wrap: wrap;
  }

  .stat-period {
    flex: 1 1 100%;
    margin-left: 0;
    text-align: right;
  }
}

@media (max-width:640px) {
  /* Tab 条横向滑动，避免三个标题挤压换行 */
  .mb-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mb-tabs::-webkit-scrollbar {
    display: none;
  }

  .mb-tab {
    flex: none;
    height: 44px;
    padding: 0 16px;
    font-size: 15px;
    letter-spacing: 0;
  }

  .notice-title {
    margin-top: 20px;
    padding-bottom: 14px;
    font-size: 19px;
    letter-spacing: 1px;
    text-indent: 1px;
  }

  .notice-subtitle {
    margin: 18px 0 6px;
    font-size: 16px;
  }

  .rule-list {
    padding-left: 1.7em;
  }

  .rule-list li {
    padding-left: 0;
    font-size: 14.5px;
    line-height: 1.85;
  }

  .mb-write {
    margin-top: 24px;
    padding-top: 22px;
  }

  .btn-write {
    width: 100%;
    height: 46px;
    padding: 0 24px;
    font-size: 16px;
    letter-spacing: 1px;
  }

  .mb-frame {
    margin-top: 16px;
    border-radius: 6px;
  }

  /* 统计筛选条：年度/月份并排，按钮单独一行 */
  .stat-bar {
    gap: 10px;
    margin-top: 16px;
    padding: 14px;
  }

  .stat-field {
    flex: 1 1 0;
    min-width: 0;
    gap: 6px;
    font-size: 14px;
  }

  .stat-select {
    flex: 1;
    min-width: 0;
    height: 40px;
    font-size: 14px;
  }

  .stat-btn {
    flex: 1 1 100%;
    height: 40px;
    font-size: 15px;
  }

  .stat-period {
    font-size: 12px;
  }

  .stat-table-wrap {
    margin-top: 12px;
    border-radius: 6px;
  }

  /* 手机上四列本就可以放下，取消最小宽度避免横向滚动 */
  .stat-table {
    min-width: 0;
  }

  .stat-table th:first-child,
  .stat-table td:first-child {
    width: 34%;
  }

  .stat-table th {
    height: 44px;
    font-size: 14px;
  }

  .stat-table td {
    height: 44px;
    font-size: 14px;
  }

  .stat-table th,
  .stat-table td {
    padding: 0 10px;
  }

  .stat-table th:first-child,
  .stat-table td:first-child {
    padding-left: 14px;
  }

  .stat-none {
    height: 110px;
  }

  .stat-table td.stat-none:first-child {
    padding-left: 10px;
  }
}

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  .tab-panel.active {
    animation: none;
  }

  .mb-tab::after,
  .btn-write,
  .stat-btn,
  .stat-select {
    transition: none;
  }
}
