/*
Theme Name: ADMS
Theme URI: https://sgadms.com/
Author: ADMS
Description: ADMS 官网主题（sgadms.com，英文为主）。由外包交付的静态中文首页改造而来，支持多语言（Polylang / WPML）、自定义 banner、产品、工程业绩、优势、新闻与内置询价表单。
Version: 1.0.8
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietary
Text Domain: adms
Tags: business, industrial, bilingual
*/

/*
真正的样式在 assets/css/ 下，由 functions.php 依次入队：
  swiper-bundle.min.css → animate.min.css → data-aos.css → iconfont.css → style.css → media.css
这里只保留主题信息头，以及少量主题层的补丁。
*/

/* 头部默认是浮在首屏大图上的白字（position:absolute + 透明底）。
   没有大图的视图 —— 所有内页，以及首页还没配 banner 的时候 —— 这套会变成
   白字白底，导航整个看不见，而且绝对定位会压住第一屏内容。切成实心白底。 */
body.adms-no-hero #header {
  position: relative;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
body.adms-no-hero #header .nav-menu > ul > li > a,
body.adms-no-hero #header .nav-menu .mob-lanuage a,
body.adms-no-hero #header .h_language .icon span,
body.adms-no-hero #header .h_language .icon i,
body.adms-no-hero #header .logo-text { color: #222; }
body.adms-no-hero #header .logo .logo-tu1 { display: none; }
body.adms-no-hero #header .logo .logo-tu2 { display: block; }
body.adms-no-hero .adms-page { padding-top: 60px; }

/* 还没上传 logo 时的文字替身 —— 默认继承 14px 正文字号，太小了 */
.logo-text {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1;
}
#header.header-transparent .logo-text { color: #fff; }
.ft_logo .logo-text { color: #fff; font-size: 22px; }

/* 屏幕阅读器专用文字。原静态站没有这个类，跳转链接和表单 label 会直接露在页面上 */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus,
.skip-link:focus {
  position: fixed !important;
  top: 8px; left: 8px;
  z-index: 100000;
  width: auto; height: auto;
  padding: 10px 18px; margin: 0;
  clip: auto;
  background: #fff;
  color: #0a4d8c;
  font-size: 15px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
}

/* 无图占位：CPT 未配图时不至于塌成 0 高 */
.adms-noimg {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #eef2f6 0%, #dfe6ee 100%);
}

/* 表单反馈信息 */
.adms-form-msg {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.6;
  display: none;
}
.adms-form-msg.is-error { color: #d33; display: block; }
.adms-form-msg.is-ok    { color: #1a8917; display: block; }
.adms-form-group.has-error input,
.adms-form-group.has-error textarea { border-color: #d33 !important; }

/* 蜜罐：对人不可见，对机器人可见 */
.adms-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* 内页通用容器 */
.adms-page { padding: 140px 0 80px; }
.adms-page .entry-title { font-size: 32px; line-height: 1.4; margin: 0 0 24px; }
.adms-page .entry-content { font-size: 16px; line-height: 1.9; color: #444; }
.adms-page .entry-content img { max-width: 100%; height: auto; }
.adms-page .entry-content h2 { font-size: 24px; margin: 36px 0 14px; }
.adms-page .entry-content h3 { font-size: 19px; margin: 28px 0 12px; }
.adms-page .entry-content table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.adms-page .entry-content th,
.adms-page .entry-content td { border: 1px solid #e3e8ee; padding: 10px 12px; font-size: 15px; }
.adms-page .entry-content th { background: #f5f8fb; text-align: left; }

.adms-breadcrumb { font-size: 14px; color: #888; margin-bottom: 18px; }
.adms-breadcrumb a { color: #888; }

.adms-list { list-style: none; margin: 0; padding: 0; }
.adms-list li { border-bottom: 1px solid #eee; padding: 22px 0; }
.adms-list .day { color: #999; font-size: 14px; }
.adms-list h2 { font-size: 19px; margin: 6px 0 8px; }
.adms-list p { color: #666; font-size: 15px; line-height: 1.8; margin: 0; }

.adms-pagination { margin-top: 40px; display: flex; gap: 8px; flex-wrap: wrap; }
.adms-pagination .page-numbers {
  display: inline-block; padding: 8px 14px; border: 1px solid #e3e8ee; color: #555; font-size: 14px;
}
.adms-pagination .page-numbers.current { background: #0a4d8c; border-color: #0a4d8c; color: #fff; }

@media (max-width: 989px) {
  .adms-page { padding: 100px 0 60px; }
  .adms-page .entry-title { font-size: 24px; }
  .adms-page .entry-content { font-size: 15.5px; }
}

/* ---- inline [adms_form] ---- */
.adms-inline-form {
  margin: 48px 0 0;
  padding: 32px 34px 34px;
  background: #f5f8fb;
  border: 1px solid #e3e8ee;
  border-radius: 10px;
}
.adms-inline-form__title { font-size: 24px; margin: 0 0 8px; }
.adms-inline-form__intro { font-size: 15.5px; color: #556; line-height: 1.8; margin: 0 0 22px; }
.adms-inline-form .adms-inquiry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.adms-inline-form .form-group { display: flex; flex-direction: column; }
.adms-inline-form .form-group:nth-of-type(5),
.adms-inline-form .adms-hp,
.adms-inline-form .adms-submit,
.adms-inline-form .adms-form-msg,
.adms-inline-form .form-note { grid-column: 1 / -1; }
.adms-inline-form label { font-size: 14px; color: #445; margin-bottom: 6px; }
.adms-inline-form .required-star { color: #d33; }
.adms-inline-form input,
.adms-inline-form textarea {
  width: 100%; padding: 11px 13px; font-size: 15px; line-height: 1.5;
  border: 1px solid #d5dde6; border-radius: 6px; background: #fff; color: #223;
}
.adms-inline-form textarea { min-height: 92px; resize: vertical; }
.adms-inline-form input:focus,
.adms-inline-form textarea:focus { outline: none; border-color: #0a4d8c; box-shadow: 0 0 0 3px rgba(10,77,140,.12); }
.adms-inline-form .captcha-row { display: flex; gap: 12px; align-items: center; }
.adms-inline-form .captcha-row input { flex: 1 1 auto; }
.adms-inline-form .adms-captcha-question {
  flex: 0 0 auto; min-width: 96px; text-align: center; padding: 11px 14px;
  background: #0a4d8c; color: #fff; border-radius: 6px; font-size: 15px; font-weight: 700; letter-spacing: .04em;
}
.adms-inline-form .adms-submit {
  justify-self: start; min-width: 200px; padding: 13px 30px; margin-top: 6px;
  background: #0a4d8c; color: #fff; border: 0; border-radius: 6px;
  font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.adms-inline-form .adms-submit:hover { background: #0d5ea8; }
.adms-inline-form .adms-submit:disabled { opacity: .6; cursor: default; }
.adms-inline-form .form-note { font-size: 13.5px; color: #7a8794; margin: 0; }

/* ---- [adms_contact] ---- */
.adms-contact-block { list-style: none; margin: 20px 0; padding: 0; }
.adms-contact-block li { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid #eef2f6; font-size: 16px; }
.adms-contact-block li span { flex: 0 0 110px; color: #7a8794; }

@media (max-width: 767px) {
  .adms-inline-form { padding: 24px 20px 26px; }
  .adms-inline-form .adms-inquiry-form { grid-template-columns: 1fr; }
  .adms-inline-form .adms-submit { width: 100%; }
}

/* ---- 手机端表格 ----
   这类页面每页 5–9 个表格，是内容的主体而不是点缀。默认 auto 布局下，
   长型号（CENTUM CS 3000、ControlLogix）会把某一列撑宽，其余列被压成一字一行。
   固定列宽 + 允许长词换行 + 收字号，读起来才是一张表而不是一堆碎片。
   （neodriveai.com 上同样的内容密度踩过一次，这里直接照搬结论。） */
@media (max-width: 767px) {
  .adms-page .entry-content .wp-block-table,
  .adms-inline-form + .wp-block-table {
    overflow-x: auto;                 /* 兜底：真放不下时可横向滑，而不是撑破页面 */
    -webkit-overflow-scrolling: touch;
  }
  .adms-page .entry-content table {
    table-layout: fixed;
    width: 100%;
    font-size: 13.5px;
    line-height: 1.55;
  }
  .adms-page .entry-content th,
  .adms-page .entry-content td {
    padding: 8px 7px;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    vertical-align: top;
  }
  /* 两列表（对照表、包含/不包含）左列窄一点，右列是正文 */
  .adms-page .entry-content table tr > *:first-child:nth-last-child(2) { width: 38%; }
  .adms-page .entry-content table tr > *:first-child:nth-last-child(2) ~ * { width: 62%; }
  /* 三列表均分 */
  .adms-page .entry-content table tr > *:first-child:nth-last-child(3),
  .adms-page .entry-content table tr > *:first-child:nth-last-child(3) ~ * { width: 33.33%; }
  /* 表头略小，避免两行标题挤掉内容 */
  .adms-page .entry-content th { font-size: 13px; }
}

/* 极窄屏再收一档 */
@media (max-width: 380px) {
  .adms-page .entry-content table { font-size: 13px; }
  .adms-page .entry-content th,
  .adms-page .entry-content td { padding: 7px 6px; }
}

/* ── 手机端右侧悬浮按钮 ─────────────────────────────────────────────
   原样式：.fix-side 固定在 right:0 / bottom:100px，是一条 50px 宽、贴着
   屏幕右边缘的实心方块。390px 宽的手机上它正好压在表格最右一列上——
   上一个项目（neodriveai.com）踩过同一个坑，结论是「按钮下移，不再压表」。
   这里改成右下角两个圆钮：离边 10px、贴到底部安全区，只在需要时出现。
   「返回顶部」在没滚动时用 display:none 而不是 scaleY(0)，否则它虽然看不见
   仍然占着 42px 的位置，把客服钮顶到半空中。 */
@media (max-width: 767px) {
  .fix-side {
    right: 10px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
  .fix-side ul {
    display: flex;
    flex-direction: column-reverse;   /* 返回顶部在下，拇指够得到 */
    gap: 8px;
  }
  .fix-side li {
    width: 42px;
    height: 42px;
    padding: 0;
    border-bottom: none;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    opacity: 0.93;
  }
  .fix-side li .show,
  .fix-side li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
  }
  .fix-side li .iconfont,
  .fix-side .chat-service .show span,
  .fix-side .return span {
    font-size: 20px;
    line-height: 1;
    margin: 0;
  }
  .fix-side .return {
    display: none;                    /* 未滚动时不占位 */
    transform: none;
  }
  .fix-side .return.active {
    display: flex;
    transform: none;
  }
  .chat-bubble,
  .chat-bubble.show {
    display: none;                    /* 手机上气泡只会挡内容 */
  }
}

/* ── 手机端顶栏 ────────────────────────────────────────────────────
   外包模板的手机头部是散的：#header 是 position:relative，会跟着页面滚走，
   但搜索按钮（.headerBotRig）和汉堡按钮（.mobile-nav-toggle）都是 fixed 在
   top:10px。结果一往下滚，两个按钮就悬空贴在正文上——一个透明背景的放大镜
   压着表格文字，旁边一个蓝方块，看着像页面坏了。
   把顶栏本身改成 sticky，两个按钮就重新有了背景板，顺带手机上任何位置都能
   点开菜单。≤990px 时 #header 本来就是 background:#fff !important，
   首页那个透明头在手机上不存在，所以 sticky 不会出现「透明条压内容」。 */
@media (max-width: 990px) {
  #header {
    position: sticky !important;
    top: 0;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  }
  /* 登录状态下 WP 管理条占着顶部，别让顶栏钻到它下面 */
  body.admin-bar #header { top: 46px; }
}

/* ── 白底白字的 logo ───────────────────────────────────────────────
   #header.header-transparent .logo-text 是白色，配首页 hero 上的透明头是对的。
   但 header 一变实心，这行字就看不见了，而它变实心有两种情况：
     1) 桌面滚动后 —— #header.header-scrolled { background:#fff }
     2) 手机上任何时候 —— media.css 里 ≤990px 强制 background:#fff !important
   原模板靠两张图（logo-tu1/tu2）切换躲开这个坑，我们用的是文字替身，
   得自己把颜色切回来。2026-08-16 线上首页滚动后顶栏是没有站名的。 */
#header.header-transparent.header-scrolled .logo-text { color: #222; }
@media (max-width: 990px) {
  #header .logo-text,
  #header.header-transparent .logo-text { color: #222; }
}
