/* 
 * 云南省戒毒网 - 自定义样式
 * 包含页面特殊样式和覆盖样式
 */

/* ==================== Header 顶部工具栏移动端优化 ==================== */
@media (max-width: 768px) {
  .header .header_info .inner {
    justify-content: center !important;
    padding: 0 10px !important;
  }

  .header .header_toolbar {
    width: auto !important;
  }

  .header .header_toolbar a {
    font-size: 11px !important;
  }

  .header .header_toolbar_right {
    width: auto !important;
  }

  /* 简繁体切换字体放大 */
  .header .header_toolbar_lang a {
    font-size: 14px !important;
  }
}

@media (max-width: 600px) {
  .header .header_info .inner {
    padding: 0 8px !important;
  }

  .header .header_toolbar a {
    font-size: 10px !important;
  }

  /* 简繁体切换字体放大 */
  .header .header_toolbar_lang a {
    font-size: 13px !important;
  }
}

@media (max-width: 480px) {
  .header .header_info .inner {
    padding: 0 6px !important;
  }

  .header .header_toolbar a {
    font-size: 9px !important;
  }

  /* 简繁体切换字体放大 */
  .header .header_toolbar_lang a {
    font-size: 12px !important;
    padding: 0 3px;
  }
}

/* ==================== Header Logo 样式 ==================== */
/* PC端样式保护 */
@media (min-width: 769px) {
  .header_logo img {
    height: 100px !important;
    width: auto !important;
  }

  .header .header_logo {
    height: 86px;
  }
}

/* 默认样式（适用于所有屏幕） */
.header_logo img {
  height: 100px !important;
  width: auto !important;
}

@media (max-width: 768px) {
  .header_logo img {
    height: 60px !important;
  }

  .header .header_logo {
    height: auto !important;
    min-height: 70px !important;
  }

  .header .header_main.inner {
    padding: 10px 15px 40px !important;
  }

  .header .header_logo .header_logo_text {
    margin-left: 12px !important;
    flex: 1;
    min-width: 0;
  }

  .header .header_logo_text_h2 {
    font-size: 24px !important;
    line-height: 28px !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header .header_logo_text_h3 {
    font-size: 11px !important;
    line-height: 14px !important;
    margin-top: 4px !important;
    white-space: normal !important;
  }
}

@media (max-width: 600px) {
  .header_logo img {
    height: 50px !important;
  }

  .header .header_logo {
    height: auto !important;
    min-height: 65px !important;
  }

  .header .header_main.inner {
    padding: 10px 12px 40px !important;
  }

  .header .header_logo .header_logo_text {
    margin-left: 10px !important;
    flex: 1;
    min-width: 0;
  }

  .header .header_logo_text_h2 {
    font-size: 21px !important;
    line-height: 25px !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header .header_logo_text_h3 {
    font-size: 10px !important;
    line-height: 13px !important;
    white-space: normal !important;
  }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
  .header_logo img {
    height: 45px !important;
  }

  .header .header_logo {
    height: auto !important;
    min-height: 60px !important;
  }

  .header .header_main.inner {
    padding: 8px 10px 35px !important;
  }

  .header .header_logo .header_logo_text {
    margin-left: 8px !important;
    flex: 1;
    min-width: 0;
  }

  .header .header_logo_text_h2 {
    font-size: 18px !important;
    line-height: 22px !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header .header_logo_text_h3 {
    font-size: 9px !important;
    line-height: 12px !important;
    white-space: normal !important;
  }
}

/* ==================== 内容区域布局 ==================== */
/* 首页第一区域 */
.p1 > .inner.p-30r.bgc-fff1 {
  padding-top: 0 !important;
}

/* 头条文本居中 */
.toutiao {
  text-align: center !important;
}

/* 列布局宽度 - 仅PC端应用 */
@media (min-width: 769px) {
  .p1 .col-md-l {
    width: 50% !important;
  }

  .p1 .col-md-r {
    width: 47% !important;
  }

  .p3 .col-md-l {
    width: 65% !important;
  }

  .p3 .col-md-r {
    width: 30% !important;
  }

  /* Tab内部列布局 */
  .pane.row .col-md-l {
    width: 65% !important;
  }

  .pane.row .col-md-r {
    width: 30% !important;
  }
}

/* 移动端列布局 - 全宽显示 */
@media (max-width: 768px) {
  .p1 .col-md-l,
  .p1 .col-md-r,
  .p3 .col-md-l,
  .p3 .col-md-r,
  .pane.row .col-md-l,
  .pane.row .col-md-r {
    width: 100% !important;
  }
}

/* Tab和Pane间距 */
.tab_pane1 > .tab + .pane {
  margin-top: -15px !important;
}

.zfxkgk_tab .tab + .pane .list_t {
  margin-top: -15px !important;
}

.zfxkgk_tab h3.tab {
  margin-bottom: 14px !important;
}

/* ==================== 专题宣传横幅 ==================== */
.promotion-banner {
  width: 100%;
  max-width: 1320px;
  height: 176px;
  margin: 0 auto 60px auto;
  text-align: center;
  padding: 20px;
}

.promotion-banner img {
  width: 100%;
  height: 176px;
  object-fit: cover;
  border: 0;
}

/* 移动端专题横幅适配 */
@media (max-width: 768px) {
  .promotion-banner {
    height: auto;
    padding: 15px;
    margin-bottom: 30px;
  }

  .promotion-banner img {
    height: auto;
    min-height: 100px;
    object-fit: inherit;
  }
}

/* ==================== 专题图片容器样式 ==================== */
.promotion-images-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  padding: 0 20px 20px 20px;
  max-width: 1320px;
  margin: 0 auto;
}

.promotion-image-item {
  flex: 1;
  max-width: calc(50% - 10px);
  transition: transform 0.3s ease;
}

.promotion-image-item:hover {
  transform: translateY(-5px);
}

.promotion-image-item .img_box {
  display: block;
  height: 250px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.promotion-image-item:hover .img_box {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.promotion-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.promotion-image-item:hover img {
  transform: scale(1.05);
}

/* ==================== 轮播图容器居中对齐 ==================== */
.swiper_box2 {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 轮播图容器基础样式 */
.swiper_box2 .swiper-container {
  width: 100% !important;
}

/* 互动频道轮播图(Swiper3-下方) - 高度100px */
#Swiper3.swiper-container {
  height: 100px !important;
}

#Swiper3 .img_box {
  height: 100px !important;
  overflow: hidden;
  border-radius: 8px;
}

#Swiper3 .img_box img {
  width: 100% !important;
  height: 100px !important;
  object-fit: fill !important;
}

#Swiper3 .swiper-slide {
  height: 100px !important;
  box-sizing: border-box;
}

/* 专题专栏轮播图(Swiper4-上方) - 高度150px */
#Swiper4.swiper-container {
  height: 150px !important;
}

#Swiper4 .img_box {
  height: 150px !important;
  overflow: hidden;
  border-radius: 8px;
}

#Swiper4 .img_box img {
  width: 100% !important;
  height: 150px !important;
  object-fit: fill !important;
}

#Swiper4 .swiper-slide {
  height: 150px !important;
  box-sizing: border-box;
}

/* 优化导航按钮位置 - 垂直居中 */
#Swiper3Prev,
#Swiper3Next,
#Swiper4Prev,
#Swiper4Next {
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin-top: 0 !important;
}

/* 也可以用class选择器作为备选 */
.swiper_box2 .swiper-button-prev,
.swiper_box2 .swiper-button-next {
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin-top: 0 !important;
}

/* ==================== 列表样式调整 ==================== */
.list_t li:not(.panel-more) a {
  font-size: 20px !important;
}

/* Tab区域对齐优化 - 让tab按钮和列表文字第一个字对齐 */
.tab_pane h3.tab {
  padding-left: 16px !important;
}

.tab_pane h3.tab a {
  margin-left: 0 !important;
}

/* 修改原有小圆点样式 - 放大并改为红色 */
.tab_pane .list_t li:not(.panel-more)::before {
  width: 8px !important;
  height: 8px !important;
  background-color: #d61d16 !important;
  left: 8px !important;
}

/* 调整list_t_22列表项左边距 */
.list_t_22 li:not(.panel-more) {
  padding: 24px 0px 24px 24px !important;
}

/* 调整列表链接宽度 */
.list_t li:not(.panel-more) a {
  width: calc(100% - 100px) !important;
}

/* ==================== 版权信息文字大小 ==================== */
.copyright_item_info p {
  font-size: 15px !important;
  line-height: 1.8 !important;
}

.copyright_item_info p span {
  font-size: 15px !important;
}

/* ==================== 底部背景色改为红色渐变主题 ==================== */
.copyright_box {
  background: linear-gradient(#e96060, #b80017) !important;
}

/* ==================== 左侧浮窗样式 ==================== */
.floating-widget {
  position: fixed;
  left: 15px;
  width: 180px;
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 98;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: slideInLeft 0.5s ease;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

/* 浮窗标题文字不换行 */
.floating-widget p {
  white-space: nowrap;
  width: 100%;
  text-align: right;
  margin: 0 0 10px 0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #333 !important;
}

/* 统一图片大小 */
.floating-widget img {
  width: 140px !important;
  height: auto !important;
  margin: 0 !important;
}

/* 第一个浮窗 - 政府公报（上方） */
#govReport {
  top: 55%;
  transform: translateY(-100%);
  animation: slideInLeftTop 0.5s ease;
}

/* 第二个浮窗 - 云南评议（下方，有20px间隔） */
#ynEvaluation {
  top: 55%;
  margin-top: 20px;
  animation: slideInLeft 0.5s ease;
}

/* 浮窗关闭按钮 */
.floating-widget .floating-close-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #d61d16;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.floating-widget .floating-close-btn:hover {
  background: #b51812;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(214, 29, 22, 0.4);
}

/* 浮窗图片样式 */
.floating-widget img {
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

/* 浮窗hover效果 */
.floating-widget:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

#govReport:hover {
  transform: translateY(-100%) scale(1.02);
}

#ynEvaluation:hover {
  transform: scale(1.02);
}

/* 关闭动画 */
.floating-widget.closing {
  opacity: 0;
}

#govReport.closing {
  transform: translateY(-100%) translateX(-150px);
}

#ynEvaluation.closing {
  transform: translateX(-150px);
}

/* 从左侧滑入动画 */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 移动端隐藏浮窗 */
@media (max-width: 768px) {
  .floating-widget {
    display: none !important;
  }
}

/* ==================== 主题色配置 ==================== */
:root {
  --primary-color: #d61d16;
  --primary-hover: #b51812;
}

/* 更新特定元素的蓝色主题色 */
.tab a.cur,
.tab a:hover,
.enter:hover,
.list_t li a:hover,
.marquee-item:hover,
.more-link:hover,
.section-header a:hover,
.section-list li a:hover {
  color: var(--primary-color) !important;
}

/* ==================== Header 样式修复 ==================== */
/* 修复可能导致文字看不见的hover状态 */
.header .header_toolbar_right .mode-a:hover,
.header .header_toolbar_right .mode-b:hover {
  color: #fff !important;
}

.nav > li:hover > a {
  color: #fff !important;
}

/* 下拉菜单hover时文字颜色 - 使用深色确保可读性 */
.nav .dropdown li:hover a {
  color: #d61d16 !important;
  background: #fff0f0 !important;
}

/* ==================== Tab 样式优化 ==================== */
/* 添加缺失的tab hover样式 */
.tab a:not(.enter):hover {
  color: var(--primary-color) !important;
  border-bottom-color: var(--primary-color) !important;
}

/* 修复tab选中状态的文字颜色 - 强制移除背景色 */
.tab a:not(.enter).cur {
  color: var(--primary-color) !important;
  border-bottom-color: var(--primary-color) !important;
  background: none !important;
  background-color: transparent !important;
}

/* 同样修复hover状态 - 移除背景色 */
.tab a:not(.enter):hover {
  background: none !important;
  background-color: transparent !important;
}

/* 修复标题相关hover状态 */
.title .more:hover {
  color: var(--primary-color) !important;
}

.where a:hover {
  color: var(--primary-color) !important;
}

/* ==================== Footer 样式修复 ==================== */
/* 修复其他可能遗漏的hover状态 */
.footer .links > ul > li a:hover {
  color: var(--primary-color) !important;
}

.footer .copyright p a:hover {
  color: var(--primary-color) !important;
}

.header .hotwords a:hover {
  color: var(--primary-color) !important;
}

.menu .mobile-dropdown li a:hover {
  color: var(--primary-color) !important;
}

/* ==================== 政务信息公开Tab样式 ==================== */
/* 优化政务信息公开tab的hover样式 */
.zfxkgk_tab .tab a {
  transition: all 0.3s ease !important;
  border-radius: 4px 4px 0 0 !important;
  padding: 8px 16px !important;
  margin-right: 2px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  line-height: 1.2 !important;
}

.zfxkgk_tab .tab a:hover {
  background-color: rgba(214, 29, 22, 0.1) !important;
  color: var(--primary-color) !important;
  transform: translateY(-1px) !important;
}

.zfxkgk_tab .tab a.cur {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(214, 29, 22, 0.3) !important;
}

.zfxkgk_tab .tab a.cur:hover {
  background-color: var(--primary-hover) !important;
  transform: none !important;
}

/* ==================== 互动交流区域样式 ==================== */
/* 优化互动交流区域样式 */
.hdjl_box {
  background: transparent !important;
  padding: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: flex-start !important;
  margin-top: 0 !important;
}

.hdjl_box .tab {
  border-bottom: 2px solid var(--primary-color) !important;
  margin-bottom: 20px !important;
  padding-bottom: 10px !important;
}

.hdjl_box .tab a {
  color: #333333 !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

/* 优化互动交流按钮样式 */
.hdjl_box .zfxkgk_btn_box {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  background: transparent !important;
}

.hdjl_box .zfxkgk_btn_box a {
  display: flex !important;
  align-items: center !important;
  padding: 12px 16px !important;
  background: #ffffff !important;
  border: 1px solid #e9ecef !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  color: #333333 !important;
  font-weight: 700 !important;
  transition: all 0.2s ease !important;
  margin-bottom: 20px !important;
  outline: none !important;
  box-shadow: none !important;
}

.hdjl_box .zfxkgk_btn_box a:hover,
.hdjl_box .zfxkgk_btn_box a:focus,
.hdjl_box .zfxkgk_btn_box a:active {
  background-color: rgba(214, 29, 22, 0.05) !important;
  background: rgba(214, 29, 22, 0.05) !important;
  border: 1px solid var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  outline: none !important;
  box-shadow: 0 2px 8px rgba(214, 29, 22, 0.1) !important;
  text-decoration: none !important;
  transform: none !important;
}

/* 覆盖外部CSS的::before伪元素 */
.hdjl_box .zfxkgk_btn_box a:hover::before,
.hdjl_box .zfxkgk_btn_box a:focus::before,
.hdjl_box .zfxkgk_btn_box a:active::before {
  display: none !important;
}

/* 强制覆盖任何可能的红色边框 */
.hdjl_box .zfxkgk_btn_box a:hover *,
.hdjl_box .zfxkgk_btn_box a:focus *,
.hdjl_box .zfxkgk_btn_box a:active * {
  border-color: transparent !important;
  outline: none !important;
}

.hdjl_box .zfxkgk_btn_box a img {
  width: 36px !important;
  height: 36px !important;
  margin-right: 12px !important;
  filter: none !important;
  transition: none !important;
}

.hdjl_box .zfxkgk_btn_box a:hover img,
.hdjl_box .zfxkgk_btn_box a:focus img,
.hdjl_box .zfxkgk_btn_box a:active img {
  filter: none !important;
  transform: none !important;
}

.hdjl_box .zfxkgk_btn_box a span {
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

/* ==================== 通用样式覆盖 ==================== */
/* 边框颜色 */
.info-section,
.interaction-panel .panel-title,
.section-header {
  border-color: var(--primary-color) !important;
}

/* 背景色 */
.tab a.cur {
  background-color: var(--primary-color) !important;
}

/* 按钮和链接颜色 */
a[href]:hover,
.btn:hover,
.button:hover {
  color: var(--primary-color) !important;
}

/* ==================== 友情链接显示控制 ==================== */
/* 友情链接在PC端和移动端都显示 */
.footer .links {
  display: block !important;
  padding: 30px !important;
  margin-bottom: 0 !important;
}

@media (max-width: 768px) {
  .footer .links {
    padding: 0 15px !important;
    margin-bottom: 25px !important;
  }
}

/* ==================== 页脚版权区域图片尺寸 ==================== */
/* 页脚版权区域图片统一尺寸 */
.copyright_box .copyright_wrapper .copyright_item_img_container {
  width: 120px !important;
  height: 140px !important;
}

.copyright_box .copyright_wrapper .copyright_item_img_container img {
  max-width: 120px !important;
  max-height: 140px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

.copyright_badge_large,
.copyright_badge_medium {
  max-width: 120px !important;
  max-height: 140px !important;
  width: auto !important;
  height: auto !important;
}

/* ==================== 移动端响应式适配 ==================== */
@media screen and (max-width: 768px) {
  /* 专题图片容器 */
  .promotion-images-container {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px 20px 15px;
  }

  .promotion-image-item {
    max-width: 100%;
    width: 100%;
  }

  .promotion-image-item .img_box {
    height: 200px;
  }

  /* 轮播图容器 */
  .swiper_box2 {
    padding: 0 15px;
  }

  .swiper_box2 .swiper-container {
    height: auto !important;
  }

  #Swiper3 .img_box,
  #Swiper3 .swiper-slide {
    height: auto !important;
    min-height: 120px;
  }

  #Swiper3 .img_box img {
    height: auto !important;
    min-height: 120px;
  }

  /* Tab间距调整 */
  .zfxkgk_tab h3.tab {
    margin-bottom: 10px !important;
  }

  .tab_pane1 > .tab + .pane {
    margin-top: -10px !important;
  }

  .zfxkgk_tab .tab + .pane .list_t {
    margin-top: -10px !important;
  }

  /* 移动端政务信息公开按钮区域优化 */
  .zfxkgk_btn_box {
    padding: 15px !important;
    margin-top: 0 !important;
    margin-bottom: 40px !important;
  }

  .zfxkgk_btn_box a {
    display: block !important;
    width: 100% !important;
    margin-bottom: 12px !important;
    padding: 12px 15px !important;
    text-align: center !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    border-radius: 8px !important;
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    transition: all 0.3s ease !important;
  }

  .zfxkgk_btn_box a:hover {
    background: #ffe8e7 !important;
    border-color: #d61d16 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(214, 29, 22, 0.15) !important;
  }

  .zfxkgk_btn_box a img {
    width: 24px !important;
    height: 24px !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
  }

  .zfxkgk_btn_box a:last-child {
    margin-bottom: 0 !important;
  }
}

/* ==================== 浮窗样式 ==================== */
.floating-window {
  position: fixed;
  bottom: 20px;
  right: 10px;
  z-index: 9999;
  max-width: 280px;
  width: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.floating-window a {
  display: block;
  width: 100%;
}

.floating-window img {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
}

/* 关闭按钮 */
.floating-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 28px;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.3s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* 移动端隐藏浮窗 */
@media (max-width: 768px) {
  .floating-window {
    display: none !important;
  }
}
