/* ==========================================================================
   响应式补丁 + 新增组件样式
   在不修改原站样式表的前提下，保证 320px ~ 1440px 全区间排版正常
   ========================================================================== */

/* ---------- 1. 布局宽度：原站写死 1200px，改为流式 ---------- */
#fh5co-services {
  width: auto;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.dev-header {
  max-width: 1200px;
  margin: 0 auto;
}
@media screen and (max-width: 1240px) {
  #fh5co-services {
    max-width: none;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }
  .dev-header {
    width: 96%;
  }
}
@media screen and (max-width: 991px) {
  #fh5co-services {
    padding-left: 14px;
    padding-right: 14px;
  }
}
@media screen and (max-width: 768px) {
  #fh5co-services {
    max-width: none;
    width: 100%;
  }
  #fh5co-hero .flexslider .slides li {
    background-size: cover !important;
    background-position: center center;
  }
  /* 手机端底部导航改为纵向堆叠，便于访问 */
  #fh5co-footer .dev-footer-link-a,
  #fh5co-footer .dev-footer-frindlink {
    display: block !important;
    padding-left: 20px;
    padding-right: 20px;
    text-align: center;
  }
  #fh5co-footer .dev-footer-link-a span a {
    display: inline-block;
    margin: 4px 8px;
  }
  #fh5co-footer .col-md-2 {
    display: block !important;
    width: 100%;
  }
}

/* ---------- 2. 移动端导航 ---------- */
.dev-nav-toggle {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  margin-top: -18px;
  width: 36px;
  height: 36px;
  background: #6BAE0D;
  border-radius: 3px;
  z-index: 1002;
}
.dev-nav-toggle span,
.dev-nav-toggle span:before,
.dev-nav-toggle span:after {
  position: absolute;
  left: 8px;
  width: 20px;
  height: 2px;
  background: #fff;
  content: '';
  display: block;
}
.dev-nav-toggle span { top: 17px; }
.dev-nav-toggle span:before { top: -6px; left: 0; }
.dev-nav-toggle span:after { top: 6px; left: 0; }

@media screen and (max-width: 991px) {
  .dev-nav-toggle { display: block; }
  /* 原站在 768px 以下直接隐藏了菜单且移动菜单缺失，这里恢复并由汉堡按钮控制 */
  .fh5co-nav .menu-1 { display: block !important; }
  .dev-header { position: relative; }
  .dev-menubox { width: 100%; position: static !important; }
  .dev-contantus { display: none; } /* 药物警戒与电话已包含在菜单中 */
  #devMainMenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
    z-index: 1001;
    padding: 6px 0;
    margin: 0;
    list-style: none;
    text-align: left;
    max-height: 70vh;
    overflow-y: auto;
  }
  #devMainMenu.dev-open { display: block; }
  #devMainMenu > li {
    display: block;
    width: 100%;
    float: none;
    border-bottom: 1px solid #f0f0f0;
  }
  #devMainMenu > li > a {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    color: #333;
  }
  #devMainMenu > li.active > a { color: #6BAE0D; }
  #devMainMenu > li > a:after { display: none !important; } /* 移动端菜单去掉悬停下划线 */
  #devMainMenu #navst29,
  #devMainMenu div[id^="navst"] {
    position: static;
    display: block;
    width: auto;
    height: auto;
    background: #fafafa;
    box-shadow: none;
    padding: 0;
  }
  #devMainMenu div[id^="navst"] span {
    display: block;
    width: 100%;
    float: none;
  }
  #devMainMenu div[id^="navst"] span a {
    display: block;
    padding: 9px 34px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
  }
  #myj { display: block !important; }
}

/* ---------- 3. 栏目选项卡 ---------- */
.dev-tab-menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dev-tab-menu ul li {
  float: none;
  display: inline-block;
}
/* 文字在选项卡内 Y 方向严格居中：a 占满 li 高度并使用相同行高 */
.dev-tab-menu ul li a {
  display: block;
  padding: 0 14px;
  height: 40px;
  line-height: 40px;
}
@media screen and (max-width: 768px) {
  .dev-tab-menu ul li { width: auto; height: 36px; line-height: 36px; }
  .dev-tab-menu ul li a { font-size: 13px; padding: 0 10px; height: 36px; line-height: 36px; }
  .product-list .dev-tab-menu { margin: 0 0 12px 0; }
  /* 移动端产品中心等列表页：收紧 banner 与选项卡之间的间隔 */
  #fh5co-services.product-list { padding-top: 16px; }
  #fh5co-services.product-list .dev-tab-menu ul { gap: 8px; }
  #fh5co-services.product-list .dev-tab-menu ul li { margin-right: 8px; }
  #fh5co-services.product-list .animate-box:first-child { margin-bottom: 0; }
}

/* ---------- 4. 新闻列表条目 ---------- */
.dev-news-thumb {
  height: 140px;
  background: #eef4e6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6BAE0D;
  font-size: 18px;
  font-weight: bold;
}
.dev-news-meta {
  margin-top: 10px;
  font-size: 12px;
  color: #999;
}
.dev-news-meta .dev-news-cat {
  display: inline-block;
  background: #6BAE0D;
  color: #fff;
  padding: 1px 8px;
  border-radius: 2px;
  margin-right: 8px;
}
.dev-news-meta .dev-news-date { margin-right: 10px; }
.dev-news-meta .p-btn-inline { color: #6BAE0D; }

/* ---------- 5. 分页 ---------- */
.dev-pages {
  clear: both;
  text-align: center;
  padding: 30px 0 10px;
  font-size: 14px;
}
.dev-pages .dev-pages-total {
  color: #999;
  margin-right: 12px;
}
.dev-pages a {
  display: inline-block;
  min-width: 34px;
  height: 34px;
  line-height: 34px;
  padding: 0 8px;
  margin: 0 3px 6px;
  border: 1px solid #ddd;
  border-radius: 2px;
  color: #666;
  text-decoration: none;
}
.dev-pages a:hover { border-color: #6BAE0D; color: #6BAE0D; }
.dev-pages a.active {
  background: #6BAE0D;
  border-color: #6BAE0D;
  color: #fff;
}

/* ---------- 6. 详情页上一篇/下一篇 ---------- */
.dev-article-nav {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px dashed #e3e3e3;
  font-size: 14px;
  color: #666;
  line-height: 2;
}
.dev-article-nav a { color: #6BAE0D; }
.dev-article-nav .dev-article-back { margin-top: 10px; }

/* ---------- 7. 表单 ---------- */
.dev-form .table_form th {
  font-weight: normal;
  color: #333;
  vertical-align: middle;
  padding: 8px 10px;
}
.dev-form .table_form td { padding: 8px 10px; }
.dev-form .input-text {
  border: 1px solid #dcdcdc;
  height: 34px;
  line-height: 34px;
  padding: 0 10px;
  border-radius: 2px;
  background: #fff;
  color: #333;
  max-width: 100%;
  box-sizing: border-box;
}
.dev-form textarea {
  border: 1px solid #dcdcdc;
  padding: 8px 10px;
  border-radius: 2px;
  box-sizing: border-box;
  max-width: 100%;
}
.dev-form .input-text.dev-invalid,
.dev-form textarea.dev-invalid,
.dev-form select.dev-invalid { border-color: #e4393c; background: #fff7f7; }
.dev-field-error {
  color: #e4393c;
  font-size: 12px;
  margin-top: 4px;
}
.dev-form .btnbox {
  border: 1px solid #6BAE0D;
  height: 36px;
  line-height: 34px;
  padding: 0 26px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
}
.dev-form .btnbox[type="reset"] { border-color: #dcdcdc; color: #666; }
.dev-alert {
  padding: 10px 14px;
  border-radius: 3px;
  margin: 0 0 16px;
  font-size: 14px;
}
.dev-alert-error { background: #fff1f0; border: 1px solid #ffccc7; color: #cf1322; }
.dev-alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.dev-form-intro { margin-bottom: 10px; color: #444; line-height: 1.9; font-size: 14px; }
.dev-form-intro strong { color: #333; }
@media screen and (max-width: 768px) {
  .dev-form .table_form th,
  .dev-form .table_form td {
    display: block;
    width: 100% !important;
    text-align: left !important;
    padding: 4px 0;
  }
  .dev-form .table_form tr { display: block; margin-bottom: 10px; }
  .dev-form .table_form th { padding-top: 10px; }
  .dev-form .input-text,
  .dev-form textarea { width: 100% !important; }
  .dev-form .table_form label.ib { width: auto !important; margin-right: 10px; }
}

/* ---------- 8. 联系部门 ---------- */
.dev-contact-side { font-size: 14px; color: #444; line-height: 1.9; }
.dev-contact-side h1 { font-size: 14px; margin: 0 0 10px; }
.dev-contact-block { margin-bottom: 18px; }
.dev-contact-block strong { color: #333; }

/* ---------- 9. 原料药表格：窄屏横向滚动 ---------- */
.dev-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dev-table-wrap table { min-width: 640px; }
.dev-table-note {
  padding: 10px 0 40px;
  font-size: 13px;
  color: #666;
  line-height: 1.9;
  text-align: center;
}

/* ---------- 10. 招聘条目 ---------- */
.dev-job-toggle { cursor: pointer; }
.job-desc { display: none; }
.job-desc p { margin: 6px 0; }
.job-desc.dev-open { display: block; }
.dev-job-toggle .job-desc { line-height: 1.7; }
/* 职位卡片内部上下留白对称（标题行高 50px 居中，去掉底部多余 margin） */
.dev-job-toggle > p { margin-bottom: 0; }
.dev-job-toggle p span {
  display: block;
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

/* ---------- 11. 首页产品轮播在小屏下的间距 ---------- */
@media screen and (max-width: 768px) {
  .flexsliderproduct .slides li { padding: 0 6px; }
  .flexsliderproduct .slides li p { font-size: 13px; }
  .dev-blok-licheng .dev-licheng-box { margin-bottom: 14px; }
  .dev-news-linkbox .news-list-box .desc { padding: 8px 12px; }
}

/* ---------- 12. 修正背景图区块在中等屏幕下的比例 ---------- */
@media screen and (min-width: 769px) and (max-width: 1240px) {
  #fh5co-hero .flexslider .slides li {
    background-size: cover !important;
    background-position: center center;
    min-height: 260px;
  }
  #fh5co-hero .flexslider .slides li.sbox-home { min-height: 420px; }
}

/* ---------- 13. 桌面端导航下拉菜单（产品中心 → 制剂产品/原料药） ---------- */
@media screen and (min-width: 992px) {
  #devMainMenu > li { position: relative; }
  #devMainMenu > li div[id^="navst"] {
    display: none;
    position: absolute;
    top: 100%; /* 紧贴菜单项底边，避免悬停穿越空隙时下拉闪没 */
    left: 50%;
    transform: translateX(-50%);
    min-width: 110px;
    background: #fff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .08);
    z-index: 1005;
    padding: 4px 0;
    margin: 0;
    border-top: 2px solid transparent; /* 顶部安全区，鼠标斜穿不丢 hover */
  }
  #devMainMenu > li:hover div[id^="navst"],
  #devMainMenu > li div[id^="navst"]:hover { display: block; }
  #devMainMenu > li:hover > a { color: #6BAE0D; }
  #devMainMenu div[id^="navst"] span {
    display: block;
    width: 100%;
    float: none;
    text-align: center;
  }
  #devMainMenu div[id^="navst"] span a {
    display: block;
    padding: 8px 12px;
    line-height: 1.6;
    color: #555;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
  }
  #devMainMenu div[id^="navst"] span a:hover { color: #6BAE0D; background: #f6fbf2; }
}

/* ---------- 14. 列表页内容区上间距（与底部间距一致） ---------- */
.dev-list-body { clear: both; padding-top: 16px; }

/* ---------- 15. 表单输入框宽度统一（与文本域一致 70%） ---------- */
.dev-form .table_form input.input-text { width: 70%; }

/* ---------- 16. 提交成功吐司提示 ---------- */
.dev-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: 86vw;
  background: rgba(50, 50, 50, .92);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
  padding: 11px 22px;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  animation: devToastIn .3s ease-out;
  pointer-events: none;
}
.dev-toast-success { background: rgba(88, 146, 10, .95); }
.dev-toast-error { background: rgba(196, 47, 50, .95); }
.dev-toast.dev-hide { opacity: 0; transition: opacity .4s; }
@keyframes devToastIn {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 17. 禁用原站 main.js 的黑色 offcanvas 面板与克隆菜单按钮 ---------- */
/* 移动端菜单统一由 #devMainMenu 下拉提供，黑色面板会导致"菜单键黑条纹/点击全屏黑" */
#fh5co-offcanvas,
.js-fh5co-nav-toggle,
.fh5co-nav-toggle { display: none !important; }

/* ---------- 在研产品表格（catid=39） ---------- */
.dev-dev-table { padding: 6px 0 30px; }
.dev-dev-table table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}
.dev-dev-table th,
.dev-dev-table td {
  border: 1px solid #e5e8ea;
  padding: 10px 12px;
  line-height: 1.7;
  vertical-align: middle;
}
.dev-dev-table thead th {
  background: linear-gradient(55deg, #6BAE0D 0%, #7EC022 100%);
  color: #fff;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
}
.dev-dev-table tbody tr:nth-child(even) { background: #f8fbf5; }
.dev-dev-table tbody tr:hover { background: #f2f8ea; }
.dev-dev-table th.w50, .dev-dev-table td.w50 { width: 56px; text-align: center; }
.dev-dev-table th.w80, .dev-dev-table td.w80 { width: 90px; text-align: center; white-space: nowrap; }

/* ---------- 页脚内容宽度与主体内容一致（1200px 居中） ---------- */
#fh5co-footer > .row {
  max-width: 1200px;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* 去掉 push 偏移，让页脚导航与主体内容左缘对齐 */
#fh5co-footer .dev-footer-link-a,
#fh5co-footer .dev-footer-frindlink { left: auto; }
