/* ==================================================
   江苏寰宇电气有限公司 · 站点样式
   ================================================== */
:root {
  --primary: #1e6fd9;
  --primary-dark: #1558b3;
  --deep-blue: #0a2b57;
  --text: #333;
  --text-light: #666;
  --bg-gray: #f5f7fa;
  --white: #fff;
  --radius: 6px;
  --shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  background: var(--white);
}


a { text-decoration: none; color: inherit; }
/* 锚点跳转时避开吸顶导航 */
[id] { scroll-margin-top: 100px; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.feature-list img { margin: auto; }

.container { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 15px; }

/* ---------- 头部导航 ---------- */
header.site-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 96px; padding: 12px 0; gap: 20px;
}

.logo { display: flex; align-items: center; flex-shrink: 0; }
/* PC 端按 logo.jpg 原始尺寸显示（342 × 76） */
.logo img { display: block; width: 342px; height: 76px; }

nav.main-nav ul { display: flex; gap: 8px; }
nav.main-nav a {
  display: block; padding: 10px 18px;
  color: var(--text); font-size: 15px; border-radius: 4px;
  transition: all .25s;
}
nav.main-nav a:hover, nav.main-nav a.active { color: var(--primary); background: rgba(30, 111, 217, .08); }

.header-phone { display: flex; align-items: center; gap: 8px; color: var(--primary); font-weight: bold; }
.header-phone .num { font-size: 18px; }
.header-phone .label { font-size: 12px; color: var(--text-light); display: block; line-height: 1.2; }

.nav-toggle {
  display: none; background: none; border: 2px solid var(--primary);
  border-radius: 4px; cursor: pointer; padding: 6px 10px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--primary); margin: 4px 0; transition: .3s; }

/* ---------- Hero 横幅 · 轮播 ---------- */
/* 按横幅原始比例（1920 × 580）显示，保证图片完整不被裁切 */
.hero {
  position: relative;
  aspect-ratio: 1920 / 580;
  overflow: hidden;
}
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.hero-slider .slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .8s ease;
}
.hero-slider .slide.is-active { opacity: 1; }
.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; }

.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 64px; border: none; cursor: pointer;
  background: rgba(0, 0, 0, .3); color: #fff; font-size: 30px; line-height: 1;
  z-index: 3; transition: background .25s;
}
.hero-arrow:hover { background: rgba(0, 0, 0, .55); }
.hero-arrow.prev { left: 0; border-radius: 0 4px 4px 0; }
.hero-arrow.next { right: 0; border-radius: 4px 0 0 4px; }

.hero-dots {
  position: absolute; left: 0; right: 0; bottom: 18px;
  display: flex; justify-content: center; gap: 10px; z-index: 3;
}
.hero-dots .dot {
  width: 12px; height: 12px; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .55); transition: all .25s;
}
.hero-dots .dot.is-active { background: var(--primary); width: 28px; border-radius: 6px; }

/* ---------- 通用区块标题 ---------- */
section { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 28px; color: var(--text); letter-spacing: 3px; }
.section-title .en {
  font-size: 13px; color: #b0b8c4; letter-spacing: 2px;
  text-transform: uppercase; display: block; margin-top: 4px;
}
.section-title.left { text-align: left; }
.section-title .en-dot { color: var(--primary); }

/* ---------- 关于我们 ---------- */
.about {
  background: #f4f8fd url("../images/bg_about.jpg") center center / cover no-repeat;
  position: relative;
}
.about .container { position: relative; z-index: 1; }
/* PC：正文有效宽度 800px，贴 1440px 容器左侧（与 Logo 左边缘对齐） */
.about-grid { max-width: 800px; margin-right: auto; }
.about-text p { color: var(--text-light); font-size: 18px; line-height: 1.9; margin-bottom: 16px; text-align: justify; }
.btn-more {
  display: inline-block; margin-top: 10px;
  background: var(--primary); color: #fff;
  padding: 10px 30px; border-radius: 3px; font-size: 14px; transition: background .25s;
}
.btn-more:hover { background: var(--primary-dark); }

/* ---------- 产品中心 ---------- */
/* 左侧分类与右侧产品列表顶对齐（不再强制等高） */
.products-grid-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 25px; align-items: start; }
.cate-box { background: var(--primary); color: #fff; border-radius: var(--radius); overflow: hidden; }
.cate-box .cate-head {
  text-align: center; padding: 16px; font-size: 18px; font-weight: bold;
  letter-spacing: 4px; background: var(--primary-dark);
}
.cate-box li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 18px; font-size: 13px; border-bottom: 1px solid rgba(255, 255, 255, .15);
  transition: background .2s, padding-left .2s;
}
.cate-box > li:last-child > a { border-bottom: none; }
.cate-box > li > a:hover, .cate-box > li > a.active { background: rgba(255, 255, 255, .15); padding-left: 24px; }
.cate-box li .arrow { opacity: .7; font-size: 12px; transition: transform .25s; }

/* 二级分类 */
.cate-box .sub-cate { max-height: 0; overflow: hidden; background: rgba(0, 0, 0, .12); transition: max-height .3s ease; }
.cate-box li.open > .sub-cate { max-height: 480px; }
.cate-box li.open > a { background: rgba(255, 255, 255, .18); }
.cate-box .sub-cate a {
  padding: 8px 18px 8px 32px; font-size: 12px; color: rgba(255, 255, 255, .85);
  border-bottom: none; position: relative;
}
.cate-box .sub-cate a::before {
  content: ""; position: absolute; left: 20px; top: 50%;
  width: 4px; height: 4px; margin-top: -2px; border-radius: 50%;
  background: rgba(255, 255, 255, .6);
}
.cate-box .sub-cate a:hover, .cate-box .sub-cate a.active { background: rgba(255, 255, 255, .12); color: #fff; }

.product-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.product-card {
  background: #fff; border: 1px solid #eef1f5; border-radius: var(--radius);
  overflow: hidden; transition: transform .3s, box-shadow .3s;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.product-card .thumb { aspect-ratio: 4 / 3; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.product-card:hover .thumb img { transform: scale(1.06); }
.product-card .info { padding: 16px; }
.product-card h3 {
  font-size: 15px; color: var(--text); margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-card p {
  font-size: 12px; color: #999;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card:hover h3 { color: var(--primary); }

/* ---------- 市场应用：铺满全屏的手风琴 ---------- */
.market { background: var(--bg-gray); }
.market-grid {
  display: flex;
  width: 100%;          /* 不套 container，直接铺满全屏 */
  height: 600px;        /* 展开态高度 */
  overflow: hidden;
}
.market-item {
  position: relative; flex: 1 1 0; min-width: 0;
  overflow: hidden; cursor: pointer;
  transition: flex .5s ease;
}
.market-item.is-open { flex: 0 0 760px; max-width: 100%; }  /* 展开态宽度 760px */

.market-item .thumb { position: absolute; inset: 0; }
.market-item .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.market-item:hover .thumb img { transform: scale(1.06); }

.market-item .mask {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .15) 55%, rgba(0, 0, 0, .25) 100%);
  transition: background .4s;
}
.market-item.is-open .mask {
  background: linear-gradient(to top, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .05) 60%, rgba(0, 0, 0, .05) 100%);
}

.market-item .caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 36px 40px; color: #fff;
}
/* 标题统一横排、30px、加粗 */
.market-item .caption h3 {
  font-size: 30px; font-weight: bold; letter-spacing: 2px; line-height: 1.3;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.market-item.is-open .caption h3 { letter-spacing: 3px; }
.market-item .caption p {
  font-size: 15px; line-height: 1.9; color: rgba(255, 255, 255, .9);
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .5s ease, opacity .4s ease, margin-top .4s ease;
  margin-top: 0;
}
.market-item.is-open .caption p { max-height: 260px; opacity: 1; margin-top: 16px; }
.market-item.is-open .caption p + p { margin-top: 12px; }

/* 未展开项：标题同样横排，靠底部渐变蒙版保证可读 */
.market-item:not(.is-open) .caption { padding: 28px 16px; }

/* ---------- 新闻动态 ---------- */
.news-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 35px; }
.news-tabs a {
  display: inline-block; padding: 7px 22px; border: 1px solid #d9e2ec;
  border-radius: 20px; color: var(--text-light); font-size: 13px; margin-left: 10px; transition: all .25s;
}
.news-tabs a.active, .news-tabs a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.news-card {
  background: #fff; border: 1px solid #eef1f5; border-radius: var(--radius);
  overflow: hidden; transition: transform .3s, box-shadow .3s;
}
.news-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.news-card .thumb { aspect-ratio: 16 / 10; overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.news-card:hover .thumb img { transform: scale(1.06); }
.news-card .info { padding: 16px; }
.news-card h3 {
  font-size: 14px; line-height: 1.5; margin-bottom: 10px; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card:hover h3 { color: var(--primary); }
.news-card .date { font-size: 12px; color: #aaa; }

/* ---------- 页脚 ---------- */
footer { background: var(--deep-blue); color: #cdd8e6; padding: 50px 0 0; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 30px; padding-bottom: 40px; }
footer h4 { color: #fff; font-size: 15px; margin-bottom: 18px; letter-spacing: 1px; }
footer li { margin-bottom: 9px; }
footer li a { color: #cdd8e6; transition: color .2s; }
footer li a:hover { color: #fff; }
.footer-contact p { margin-bottom: 10px; }
.footer-contact strong { color: #fff; }
.copyright {
  border-top: 1px solid rgba(255, 255, 255, .12);
  text-align: center; padding: 16px 0; font-size: 12px; color: #8fa3ba;
}

/* ---------- 返回顶部 ---------- */
#backTop {
  position: fixed; right: 20px; bottom: 30px;
  width: 44px; height: 44px; border-radius: 6px;
  background: var(--primary); color: #fff; border: none;
  font-size: 18px; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .3s; z-index: 99; box-shadow: var(--shadow);
}
#backTop.show { opacity: 1; pointer-events: auto; }

/* ==================================================
   二级页面通用
   ================================================== */
/* 子页顶部横幅 */
.page-banner {
  position: relative;
  height: 300px;
  background: #0d3a75 center / cover no-repeat;
  display: flex; align-items: center;
}
/* 各栏目使用指定横幅图 */
.banner-about { background-image: url("../images/bn1.jpg"); }    /* 关于我们 / 新闻资讯 */
.banner-honor { background-image: url("../images/bn2.jpg"); }    /* 企业荣誉 / 企业资质 */
.banner-product { background-image: url("../images/bn3.jpg"); }  /* 产品中心 */
.banner-contact { background-image: url("../images/bn4.jpg"); }  /* 联系我们 */
.page-banner::after { content: ""; position: absolute; inset: 0; background: rgba(13, 58, 117, .55); }
.page-banner .container { position: relative; z-index: 1; color: #fff; }
.page-banner h1 { font-size: 34px; font-weight: bold; letter-spacing: 4px; }
.page-banner .en { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255, 255, 255, .7); display: block; margin-top: 6px; }

/* 面包屑 */
.breadcrumb { background: #f5f7fa; border-bottom: 1px solid #e8edf3; }
.breadcrumb .container { padding: 14px 15px; font-size: 13px; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; color: #c3ccd8; }
.breadcrumb .current { color: var(--primary); }

/* 二级页主体：左侧侧栏 + 右侧内容 */
.sub-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
.sub-layout > aside { order: -1; }
.sub-side .side-title {
  background: var(--primary); color: #fff; padding: 14px 18px;
  font-size: 16px; letter-spacing: 2px; border-radius: var(--radius) var(--radius) 0 0;
}
.sub-side ul { border: 1px solid #e8edf3; border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.sub-side li a {
  display: block; padding: 12px 18px; font-size: 14px; color: var(--text-light);
  border-bottom: 1px solid #f0f3f7; transition: all .2s;
}
.sub-side li:last-child a { border-bottom: none; }
.sub-side li a:hover, .sub-side li a.active { color: var(--primary); background: #f2f7fd; padding-left: 24px; }

/* 图文详情正文 */
.article { font-size: 16px; line-height: 2; color: #444; }
.article h2 { font-size: 22px; color: var(--text); margin: 30px 0 14px; }
.article p { margin-bottom: 16px; text-align: justify; }
.article .article-img { margin: 24px 0; }
.article .article-img img { width: 100%; height: auto; border-radius: var(--radius); }
.article .article-img figcaption { text-align: center; font-size: 13px; color: #999; margin-top: 8px; }
/* 图文混排（图左文右 / 图右文左） */
.feature-list .feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px;
  align-items: center; padding: 26px 0; border-bottom: 1px solid #eef1f5;
}
.feature-list .feature:last-child { border-bottom: none; }
.feature-list .feature img { width: 100%; border-radius: var(--radius); }
.feature-list .feature h3 { font-size: 20px; margin-bottom: 12px; color: var(--text); }
.feature-list .feature p { font-size: 15px; color: var(--text-light); line-height: 1.9; }
.feature-list .feature.reverse .feature-img { order: 2; }

/* 图片列表（企业荣誉 / 企业资质） */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.gallery-item {
  background: #fff; border: 1px solid #eef1f5; border-radius: var(--radius);
  overflow: hidden; transition: transform .3s, box-shadow .3s;
}
.gallery-item:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.gallery-item .thumb { aspect-ratio: 4 / 3; overflow: hidden; }
.gallery-item .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery-item:hover .thumb img { transform: scale(1.06); }
.gallery-item .info { padding: 14px; text-align: center; }
.gallery-item h3 {
  font-size: 15px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-item:hover h3 { color: var(--primary); }
.gallery-item .date { font-size: 12px; color: #aaa; }

/* 新闻列表 */
.news-list { border-top: 2px solid var(--primary); }
.news-list-item {
  display: grid; grid-template-columns: 200px 1fr auto; gap: 24px;
  align-items: center; padding: 22px 0; border-bottom: 1px solid #eef1f5;
  transition: background .2s;
}
.news-list-item:hover { background: #fafbfd; }
.news-list-item .thumb { aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); }
.news-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-list-item h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.5; }
.news-list-item:hover h3 { color: var(--primary); }
.news-list-item p {
  font-size: 13px; color: #999;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-list-item .date { font-size: 13px; color: #aaa; white-space: nowrap; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
  display: inline-block; min-width: 36px; height: 36px; line-height: 34px; text-align: center;
  padding: 0 10px; border: 1px solid #dde4ec; border-radius: 4px;
  font-size: 14px; color: var(--text-light); transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled { opacity: .5; pointer-events: none; }

/* 联系我们 */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-info li {
  display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #eef1f5; font-size: 15px;
}
.contact-info li:last-child { border-bottom: none; }
.contact-info .ico {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
}
.contact-info .ico svg { width: 20px; height: 20px; display: block; }
.contact-info .txt strong { display: block; color: var(--text); margin-bottom: 2px; }
.contact-info .txt span { color: var(--text-light); }
.contact-map { border: 1px solid #e8edf3; border-radius: var(--radius); overflow: hidden; }
.contact-map iframe { width: 100%; height: 420px; border: 0; display: block; }
.contact-map .map-tip { padding: 10px 14px; font-size: 13px; color: var(--text-light); background: #f7f9fc; }

/* 详情页标题区 */
.detail-head { text-align: center; padding: 30px 0 24px; border-bottom: 1px solid #eef1f5; margin-bottom: 26px; }
.detail-head h1 { font-size: 26px; color: var(--text); margin-bottom: 10px; }
.detail-head .meta { font-size: 13px; color: #aaa; }
.detail-head .meta span { margin: 0 10px; }

/* ==================================================
   响应式
   ================================================== */
@media (max-width: 1024px) {
  .header-inner { min-height: 80px; }
  .logo img { width: auto; height: 52px; }
  nav.main-nav a { padding: 10px 12px; font-size: 14px; }
  .products-grid-wrap { grid-template-columns: 200px 1fr; }
  .product-cards { grid-template-columns: repeat(2, 1fr); }
  .market-grid { height: 500px; }
  .market-item.is-open { flex: 0 0 520px; }
  .market-item .caption h3 { font-size: 24px; }
  .market-item .caption { padding: 28px 28px; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-inner { min-height: 64px; padding: 8px 0; }
  .logo img { width: auto; height: 38px; }
  .header-phone { display: none; }   /* 移动端隐藏头部电话 */

  .nav-toggle { display: block; }
  nav.main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; box-shadow: 0 8px 16px rgba(0, 0, 0, .1);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  nav.main-nav.open { max-height: 400px; }
  nav.main-nav ul { flex-direction: column; padding: 10px 15px; gap: 2px; }
  nav.main-nav a { padding: 11px 12px; border-bottom: 1px solid #f0f2f5; }

  /* 移动端：banner 完整展示，按原图比例不裁切 */
  .hero-slider .slide img { object-fit: contain; object-position: center; }
  .hero-arrow { width: 32px; height: 48px; font-size: 22px; }
  section { padding: 40px 0; }

  .about-grid { max-width: 100%; margin: 0; }
  .about-text p { font-size: 15px; line-height: 1.8; }

  .products-grid-wrap { grid-template-columns: 1fr; }
  .cate-box li a { padding: 12px 18px; }
  .product-cards { grid-template-columns: 1fr; }

  /* 移动端改为纵向手风琴 */
  .market-grid { flex-direction: column; height: auto; }
  .market-item { flex: none; height: 90px; }
  .market-item.is-open { flex: none; height: 320px; }
  .market-item .caption h3 { font-size: 20px; letter-spacing: 1px; }
  .market-item .caption { padding: 16px 18px; }
  .market-item:not(.is-open) .caption { padding: 16px 18px; }
  .market-item:not(.is-open) .caption h3 { font-size: 16px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-head { flex-direction: column; align-items: flex-start; gap: 15px; }
  .news-tabs a { margin-left: 0; margin-right: 10px; }

  .footer-grid { display: none; }    /* 移动端页脚只保留版权信息 */
  footer { padding-top: 0; }

  /* 二级页 */
  .page-banner { height: 200px; }
  .page-banner h1 { font-size: 24px; letter-spacing: 2px; }
  .sub-layout { grid-template-columns: 1fr; }
  .article { font-size: 15px; line-height: 1.9; }
  .feature-list .feature,
  .feature-list .feature.reverse { grid-template-columns: 1fr; }
  .feature-list .feature.reverse .feature-img { order: 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .news-list-item { grid-template-columns: 110px 1fr; gap: 14px; }
  .news-list-item .date { grid-column: 2; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-map iframe { height: 300px; }
  .pagination { flex-wrap: wrap; }
}
