/*
 * wxrx overrides — behaviour that layui.js used to provide at runtime on the
 * legacy site, reimplemented in CSS so we don't have to ship jQuery + layui JS.
 * Loaded last, after the original theme stylesheets.
 */

/* Dropdown menus: layui.js toggled these on hover. */
.header .layui-nav .layui-nav-item > .layui-nav-child {
  display: none;
}
.header .layui-nav .layui-nav-item:hover > .layui-nav-child {
  display: block;
}
/* layui rotates the caret via a class on hover */
.header .layui-nav .layui-nav-item:hover > a .layui-nav-more {
  transform: rotate(180deg);
  margin-top: -9px;
}

/* layui hides breadcrumbs until element.render() runs; we render them server-side. */
.layui-breadcrumb {
  visibility: visible;
  font-size: 14px;
}
.layui-breadcrumb > * {
  font-size: 14px;
}

/* Tailwind preflight (loaded by the admin bundle) resets images to display:block
   and strips list/heading defaults — restore what the legacy theme assumes. */
.header img,
.index-container img,
.footer-cust img,
.wxrx-main img {
  display: inline-block;
}

/* Mobile nav toggle (legacy theme used layui's JS) */
@media screen and (max-width: 768px) {
  .header .ew-nav-group .layui-nav {
    display: none;
  }
  .header .ew-nav-group .layui-nav.nav-open {
    display: block;
  }
  .header .layui-nav .layui-nav-item > .layui-nav-child,
  .header .layui-nav .layui-nav-item:hover > .layui-nav-child {
    position: static;
    display: block;
    box-shadow: none;
  }
}

/* ---------------------------------------------------------------------------
 * 列表行（栏目列表 / 搜索结果）
 *
 * 原主题只在 @media(min-width:1441px) 给 li a 补了 width/nowrap/ellipsis，
 * 而 768–1440px 那段漏了，导致标题无宽度约束换行、与右侧日期串行
 * （表现为日期被截断、下一行标题前多出残字）。
 * 这里统一改成 flex：标题单行省略号，日期永不换行且右对齐。
 * ------------------------------------------------------------------------ */
.news-list-right .i_content ul#fanye li {
  display: flex;
  align-items: center;
  gap: 16px;
}

.news-list-right .i_content ul#fanye li a {
  float: none;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;          /* 允许在 flex 容器内出现省略号 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-list-right .i_content ul#fanye li span {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: auto;
}

/* ---------------------------------------------------------------------------
 * 站内搜索结果（原主题没有对应样式，沿用其配色与间距）
 * ------------------------------------------------------------------------ */
.wx-search-form { display: flex; align-items: center; background: #fff;
  border: 1px solid #dcdfe6; border-radius: 4px; overflow: hidden; }
.wx-search-form input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0;
  padding: 8px 12px; font-size: 14px; background: transparent; }
.wx-search-form button { flex: 0 0 auto; border: 0; cursor: pointer;
  background: #1199ee; color: #fff; padding: 0 14px; line-height: 34px; }

.wx-search-summary { padding: 16px 0; color: #666; font-size: 15px;
  border-bottom: 1px solid #eee; }
.wx-search-summary b { color: #1199ee; }

.news-list-right .i_content ul.wx-search-list li,
.wx-search-list li { height: auto; display: block; }
.wx-search-list { list-style: none; margin: 0; padding: 0; }
.wx-search-list li { padding: 18px 0; border-bottom: 1px dashed #a6aaad; }
.wx-search-list .t { display: block; font-size: 17px; color: #2d3037;
  line-height: 1.5; margin-bottom: 8px; }
.wx-search-list .t:hover { color: #1199ee; }
.wx-search-list .s { margin: 0 0 10px; color: #7a7f87; font-size: 14px;
  line-height: 1.8; }
.wx-search-list .m { font-size: 13px; color: #999; display: flex; gap: 18px; }
/* 关键词高亮（接口只输出这一种标签，内容已转义） */
.wx-search-list em.kw, .wx-search-list .t em.kw {
  font-style: normal; color: #FF003E; font-weight: 600;
}

@media (max-width: 768px) {
  .wx-search-list .t { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
 * 容器自适应
 *
 * 原主题把 .header/.index-container/.news-cust/.cust-details/.footer-cust
 * 全部写死 width:1440px，且 768–1440 的媒体查询里也照抄，导致整站在
 * 1280/1366 等常见笔记本宽度下横向溢出、出现水平滚动条。
 * 改为 max-width，≥1441px 时表现与原站完全一致。
 * ------------------------------------------------------------------------ */
@media (max-width: 1440px) {
  .header,
  .index-container,
  .news-cust,
  .cust-details,
  .cust-details2,
  .footer-cust {
    width: 100% !important;
    max-width: 1440px;
  }
}

/* 内容容器在窄屏下为右侧悬浮客服条留出避让空间，
   否则列表右侧的日期会被压住（首页 banner 为通栏设计，不加）。 */
@media (max-width: 1440px) {
  .news-cust,
  .cust-details,
  .cust-details2 {
    padding-left: 24px;
    padding-right: 72px;
    box-sizing: border-box;
  }
}
@media (max-width: 768px) {
  .news-cust,
  .cust-details,
  .cust-details2 {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* 搜索结果标题需撤掉原主题对 .i_content ul li a 的 float/定高/单行限制 */
.news-list-right .i_content ul.wx-search-list li a.t {
  float: none;
  width: auto;
  display: block;
  line-height: 1.5;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.news-list-right .i_content ul.wx-search-list li span { line-height: 1.6; }

/* ---------------------------------------------------------------------------
 * 导航下拉：桥接悬停死区
 *
 * 下拉框用 absolute top:75px 定位，而菜单项高 70px —— 两者之间有 5px 空隙。
 * 原站由 layui.js 控制开合（带延迟）所以无妨；改成纯 CSS :hover 后，鼠标
 * 下移途中经过这段空隙会同时脱离两者，菜单随即收起，二级菜单很难点到。
 * 用一个透明伪元素把空隙补成可悬停区域，视觉不变。
 * ------------------------------------------------------------------------ */
.header .layui-nav .layui-nav-item > .layui-nav-child::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;      /* 略大于实际 5px 间隙，留出容错 */
  height: 10px;
  background: transparent;
}

/* ---------------------------------------------------------------------------
 * 顶部搜索框：恢复原站盒模型
 *
 * 原主题写于 Tailwind 之前，整体按 content-box 排版：
 *   .header-apply div:last-child { height:40px; border:1px solid #ddd }  → 实际 42px
 *   .header-search-inner input   { height:40px }                        → 正好填满内容区
 * 而 Tailwind preflight 的 *{box-sizing:border-box} 把外壳压成 40px（内容区 38px），
 * 40px 高的 input 就上下各溢出 1px；input 是白底且带 20px 圆角，
 * 正好把外壳那圈 1px 灰边的上下两段盖掉 —— 表现为胶囊边框粗细不匀、像被削掉两块。
 * 这里把搜索框这一小块还原成 content-box，几何与原站逐像素一致。
 * ------------------------------------------------------------------------ */
.header .header-apply > div,
.header .header-search-inner,
.header .header-search-inner input {
  box-sizing: content-box;
}

/* 原主题的 placeholder 规则把 ::-moz-placeholder 等私有伪元素写在同一个选择器组里，
   浏览器遇到无法识别的选择器会整条丢弃，所以原站实际用的是浏览器默认灰 #757575。
   preflight 把它改成了半透明灰、对比度偏低，这里显式写回原站的观感。 */
.header .header-search-inner input::placeholder {
  color: #757575;
  opacity: 1;
}
