@charset "utf-8";

/* ==========================================================================
   emerson.gd.cn 后端化新增样式
   覆盖：移动端底部导航、在线客服浮窗、新闻卡片与分页、通用辅助类
   依赖 site.css 中的 CSS 变量与基础组件
   ========================================================================== */

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 移动端底部导航 ---------- */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #fff;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .bottom-nav ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: none;
  }

  .bottom-nav li {
    flex: 1 1 0;
    margin: 0;
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 2px 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11.5px;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav a svg {
    width: 22px;
    height: 22px;
  }

  .bottom-nav a.is-active {
    color: var(--accent);
    font-weight: 600;
  }

  /* 给底部菜单留出空间，避免遮挡正文与页脚 */
  body {
    padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  }

  /* 手机端顶部横向导航交给底部菜单承担，避免两套导航重复 */
  .nav {
    display: none;
  }

  .nav-toggle {
    display: none;
  }
}

/* ---------- 在线客服 ---------- */
.chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
}

@media (max-width: 768px) {
  .chat {
    right: 12px;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }
}

.chat__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(20, 58, 106, 0.25);
}

.chat__btn:hover {
  background: var(--accent-dark);
}

.chat__panel {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: 330px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 540px);
  overflow: hidden;
}

.chat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}

.chat__head strong {
  font-size: 15px;
}

.chat__note {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.chat__close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.chat__log {
  flex: 1 1 auto;
  min-height: 120px;
  padding: 12px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.chat__msg {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.6;
  max-width: none;
}

.chat__msg--user {
  text-align: right;
  color: var(--ink);
}

.chat__msg--user span {
  display: inline-block;
  padding: 8px 12px;
  background: var(--accent-weak);
  border-radius: 10px 10px 2px 10px;
}

.chat__msg--bot span {
  display: inline-block;
  padding: 8px 12px;
  background: var(--wash);
  border-radius: 10px 10px 10px 2px;
  color: var(--ink-soft);
}

.chat__msg--bot.is-pending span {
  color: var(--muted);
}

.chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.chat__form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 16px; /* 低于 16px 时 iOS 会自动放大页面 */
  font-family: inherit;
}

.chat__send {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.chat__lead {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--wash-cool);
}

.chat__lead-tip {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: none;
}

.chat__lead label {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.chat__lead input {
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
}

.chat__lead button {
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
}

.chat__status {
  margin: 0;
  padding: 0 14px 12px;
  min-height: 16px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: none;
}

/* ---------- 新闻列表与正文 ---------- */
.news-card__date {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  max-width: none;
}

.news-card__title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
}

.news-card__title a {
  color: var(--ink);
  text-decoration: none;
}

.news-card__title a:hover {
  color: var(--accent);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.pager__item {
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
}

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

.pager__info {
  font-size: 14px;
  color: var(--muted);
}

.article-body h2 {
  margin-top: 30px;
}

.article-body h3 {
  margin-top: 22px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 18px;
}

.article-body > p:first-child {
  font-size: 17.5px;
  color: var(--ink-soft);
}