/* ============================================================
   壹动力官网 · PHP 版补充样式
   只补锚点滚动、移动菜单、富文本排版，不改动原有视觉体系
   ============================================================ */

/* ---------- 锚点定位：避开 sticky 头部 ---------- */
main [id] {
  scroll-margin-top: 92px;
}
@media (max-width: 768px) {
  main [id] { scroll-margin-top: 80px; }
}

/* 导航当前项高亮（滚动联动时由 JS 加 .is-active） */
.nav-links a.is-active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

/* ---------- 移动端下拉菜单 ---------- */
.mobile-nav {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 45;
  background: #fff;
  border-bottom: 1px solid var(--c-line);
  box-shadow: 0 12px 30px rgba(26, 22, 20, .10);
  padding: 10px 6vw 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav a {
  padding: 13px 4px;
  font-size: 16px;
  color: var(--c-ink);
  border-bottom: 1px solid #f1efed;
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a:hover { color: var(--c-primary); }
.mobile-nav .mobile-phone {
  margin-top: 10px;
  text-align: center;
  background: var(--c-primary);
  color: #fff;
  border-radius: 999px;
  padding: 12px 4px;
  font-weight: 600;
  border-bottom: 0;
}
@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}

/* ---------- 富文本板块排版 ---------- */
.rich-content {
  max-width: 860px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.95;
  color: var(--c-ink);
}
.rich-content h3 {
  font-size: clamp(19px, 2.2vw, 23px);
  margin: 1.4em 0 .55em;
  color: var(--c-ink);
  letter-spacing: .5px;
}
.rich-content h3:first-child { margin-top: 0; }
.rich-content p { margin: 0 0 1.05em; }
.rich-content ul, .rich-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.25em;
}
.rich-content li { margin-bottom: .5em; }
.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: .6em 0;
}
.rich-content a { color: var(--c-primary); text-decoration: underline; }
.rich-content strong { font-weight: 700; }

/* ---------- 卡片图片缺失兜底 ---------- */
.case-media img,
.g-item img {
  background: linear-gradient(135deg, #ece8e4, #f7f5f3);
}
.case-media img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* ---------- 后台入口（前台不显示） ---------- */
.admin-link { display: none; }

/* ---------- 同板块内的附属内容 ---------- */
.factory-gallery { margin-top: 56px; }
.case-clients { margin-top: 64px; }
.case-clients .client-wall { margin-top: 28px; }

/* ---------- 图片点击放大查看（灯箱） ---------- */
img.zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 15, 13, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  background: #fff;
}
.lightbox-cap {
  color: #f2eeea;
  font-size: 15px;
  letter-spacing: .5px;
  text-align: center;
  max-width: 80vw;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .28); }
.lightbox-close svg { width: 20px; height: 20px; }


/* ---------- 新闻文章详情页 ---------- */
.article-root { max-width: 780px; margin: 0 auto; padding: 36px 0 56px; }
.article-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; color: var(--c-primary); text-decoration: none; margin-bottom: 22px;
}
.article-back:hover { text-decoration: underline; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.article-cat {
  display: inline-block; font-size: 12px; color: var(--c-primary);
  background: var(--grad-soft); padding: 3px 12px; border-radius: 999px;
}
.article-date { font-size: 13px; color: var(--c-muted); }
.article-title { font-size: 30px; line-height: 1.35; color: var(--c-deep); margin: 0 0 22px; }
.article-cover {
  margin: 0 0 26px; border-radius: var(--r-lg); overflow: hidden;
  background: linear-gradient(135deg, #d8cdc6 0%, #b8a89e 100%);
  aspect-ratio: 16 / 9;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { font-size: 16px; line-height: 1.95; color: var(--c-ink); }
.article-body p { margin: 0 0 16px; }
.article-body p:last-child { margin-bottom: 0; }
.article-missing { text-align: center; padding: 80px 0; }
.article-missing p { margin-top: 20px; }
@media (max-width: 640px) {
  .article-title { font-size: 23px; }
  .article-cover { aspect-ratio: 4 / 3; }
}
