/*!
 * Szxinchuan Project - Shared Core CSS
 * Extracted from app.css (sitecdn.71360.com/static/txys-001/css/app.css)
 * Shared between CN and EN sites
 */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif; color: #333; background: #fff; line-height: 1.6; min-width: 1200px; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
input, button, textarea { font-family: inherit; font-size: inherit; }

/* === Container (12-col grid, 1200px centered) === */
.container { width: 1200px; margin: 0 auto; padding: 0 15px; }
.row { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; }
.row::after { content: ""; display: table; clear: both; }

/* 12-col grid */
.col-1 { width: 8.333%; } .col-2 { width: 16.666%; } .col-3 { width: 25%; }
.col-4 { width: 33.333%; } .col-5 { width: 41.666%; } .col-6 { width: 50%; }
.col-7 { width: 58.333%; } .col-8 { width: 66.666%; } .col-9 { width: 75%; }
.col-10 { width: 83.333%; } .col-11 { width: 91.666%; } .col-12 { width: 100%; }
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 { padding: 0 15px; float: left; }

/* === Colors === */
:root {
  --primary: #006db2;
  --primary-hover: #005a96;
  --primary-light: #e6f1f8;
  --dark: #1a1a1a;
  --gray-100: #f5f5f5;
  --gray-200: #eee;
  --gray-400: #999;
  --gray-600: #666;
  --white: #fff;
  --border: #e0e0e0;
}

/* === Buttons === */
.btn { display: inline-block; padding: 10px 28px; border-radius: 4px; text-align: center; cursor: pointer; transition: all 0.3s; border: 1px solid transparent; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-white { background: #fff; color: var(--primary); border-color: #fff; }
.btn-white:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm { padding: 6px 18px; font-size: 12px; }
.btn-lg { padding: 14px 36px; font-size: 16px; }

/* === Section === */
.section { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 30px; color: var(--dark); margin-bottom: 8px; }
.section-title h2 span { color: var(--primary); }
.section-title .subtitle { font-size: 14px; color: var(--gray-400); }
.section-title .divider { display: inline-block; width: 48px; height: 3px; background: var(--primary); margin: 8px 0 0; }

/* === Card === */
.card { background: #fff; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; transition: all 0.3s; }
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); transform: translateY(-2px); }
.card-img { width: 100%; height: 220px; object-fit: cover; display: block; }
.card-body { padding: 20px; }
.card-title { font-size: 16px; font-weight: bold; color: var(--dark); margin-bottom: 8px; }
.card-text { font-size: 13px; color: var(--gray-600); line-height: 1.6; }

/* === Breadcrumb === */
.breadcrumb { background: var(--gray-100); padding: 12px 0; font-size: 13px; color: var(--gray-600); }
.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--primary); }

/* === Page Banner === */
.page-banner { position: relative; height: 300px; background: linear-gradient(135deg, #003d6b, #006db2); display: flex; align-items: center; justify-content: center; text-align: center; }
.page-banner h1 { color: #fff; font-size: 36px; }
.page-banner p { color: rgba(255,255,255,0.8); font-size: 15px; margin-top: 10px; }

/* === Back to Top === */
.back-to-top { position: fixed; right: 30px; bottom: 80px; width: 44px; height: 44px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-hover); }

/* === Utility === */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.clearfix::after { content: ""; display: table; clear: both; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* === Header === */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: transparent; transition: all 0.3s; }
.site-header.scrolled { background: rgba(0,0,0,0.9); box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.site-header .header-inner { display: flex; align-items: center; justify-content: space-between; height: 80px; max-width: 1440px; margin: 0 auto; padding: 0 30px; }
.site-header .logo img { height: 44px; }
.site-header .nav-list { display: flex; align-items: center; gap: 0; }
.site-header .nav-list li { position: relative; }
.site-header .nav-list li a { display: block; padding: 0 18px; height: 80px; line-height: 80px; color: #fff; font-size: 15px; transition: all 0.3s; }
.site-header .nav-list li a:hover,
.site-header .nav-list li a.active { color: var(--primary); }
.site-header .nav-list li a.active::after { content: ""; position: absolute; bottom: 0; left: 18px; right: 18px; height: 3px; background: var(--primary); }
.site-header .header-right { display: flex; align-items: center; gap: 20px; }
.site-header .header-phone { color: #fff; font-size: 18px; font-weight: bold; white-space: nowrap; }
.site-header .header-search { color: #fff; font-size: 20px; cursor: pointer; }
.site-header .header-search:hover { color: var(--primary); }

/* === Footer === */
.site-footer { background: #1a1a1a; color: #aaa; padding: 50px 0 20px; }
.site-footer .footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 20px; }
.site-footer .footer-info { flex: 0 0 35%; }
.site-footer .footer-info .footer-logo { margin-bottom: 15px; }
.site-footer .footer-info .footer-logo img { height: 40px; }
.site-footer .footer-info p { font-size: 13px; line-height: 1.8; margin-bottom: 6px; }
.site-footer .footer-nav h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.site-footer .footer-nav ul li { margin-bottom: 8px; }
.site-footer .footer-nav ul li a { color: #aaa; font-size: 13px; transition: color 0.3s; }
.site-footer .footer-nav ul li a:hover { color: var(--primary); }
.site-footer .footer-qr { text-align: center; }
.site-footer .footer-qr img { width: 120px; height: 120px; border: 2px solid rgba(255,255,255,0.1); }
.site-footer .footer-qr p { font-size: 12px; margin-top: 6px; }
.site-footer .footer-bottom { text-align: center; font-size: 12px; color: #666; padding-top: 15px; }

/* === Product Grid === */
.product-grid { display: flex; flex-wrap: wrap; margin: -12px; }
.product-grid .product-item { width: calc(33.333% - 24px); margin: 12px; }
.product-item { background: #fff; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; transition: all 0.3s; }
.product-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); transform: translateY(-2px); }
.product-item .product-img { width: 100%; height: 240px; object-fit: cover; display: block; }
.product-item .product-info { padding: 20px; text-align: center; }
.product-item .product-info h3 { font-size: 16px; color: var(--dark); margin-bottom: 8px; }
.product-item .product-info p { font-size: 13px; color: var(--gray-600); line-height: 1.6; margin-bottom: 12px; }

/* 产品徽标：由后台「是否热门 / 是否新品 / 是否推荐」开关驱动 */
.product-item { position: relative; }
.product-badges { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.product-badge { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 11px; line-height: 1.5; color: #fff; letter-spacing: 0.5px; }
.product-badge.badge-hot { background: #e74c3c; }
.product-badge.badge-new { background: #27ae60; }
.product-badge.badge-rec { background: var(--primary, #1a73e8); }
.product-badge-inline { position: static; display: inline-block; vertical-align: middle; margin-left: 8px; }

/* === 产品详情（编排分支 product_info / product_specs 产出）===
   这两个类只由 lib/sections.mjs 输出，早期编排版本漏了样式定义 → 裸 <p>/裸表格。 */
.detail-summary { font-size: 15px; color: var(--gray-600); line-height: 1.8; margin-top: 16px; }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.spec-table th, .spec-table td { border: 1px solid var(--border); padding: 10px 14px; font-size: 14px; text-align: left; vertical-align: top; }
.spec-table th { background: var(--gray-100); color: var(--dark); font-weight: normal; width: 180px; }
/* 规格分组标题：后台「规格参数」按分组录入（如 基本参数 / 电气参数），前台渲染成小标题。 */
.spec-group-title { font-size: 16px; font-weight: 600; color: var(--dark); margin: 22px 0 0; }
.spec-group-title:first-of-type { margin-top: 12px; }

/* === 产品详情长图（淘宝式）===
   把产品图集（清洗后）全宽纵向拼接成产品详情，排在富文本详情之前。
   由 lib/sections.mjs(product_info) 与 templates/product-detail.ejs 两条渲染路径共同输出。
   列宽 800px（对齐淘宝详情区 750~790 的标准）：长图按比例缩放，方形图也不会在 960 容器里被放大成巨块。
   font-size/line-height 归零是为了消除 inline 元素之间的空白间隙。 */
.detail-gallery { max-width: 800px; margin: 20px auto 4px; font-size: 0; line-height: 0; }
.detail-gallery img { display: block; width: 100%; height: auto; border-radius: 6px; }
.detail-gallery img + img { margin-top: 6px; }

/* === Sidebar (product page) === */
.sidebar { width: 260px; float: left; background: #fff; border: 1px solid var(--border); }
.sidebar-title { background: var(--primary); color: #fff; font-size: 18px; padding: 15px 20px; text-align: center; }
.sidebar-list li { border-bottom: 1px solid var(--gray-200); }
.sidebar-list li a { display: block; padding: 12px 20px; color: var(--dark); font-size: 14px; transition: all 0.3s; }
.sidebar-list li a:hover,
.sidebar-list li a.active { color: var(--primary); padding-left: 25px; background: var(--primary-light); }
.sidebar-contact { padding: 20px; text-align: center; }
.sidebar-contact h4 { font-size: 14px; color: var(--gray-600); margin-bottom: 6px; }
.sidebar-contact .phone { font-size: 20px; color: var(--primary); font-weight: bold; }
.main-content { margin-left: 280px; }

/* === News List === */
.news-list .news-item { display: flex; padding: 20px 0; border-bottom: 1px solid var(--gray-200); transition: all 0.3s; }
.news-list .news-item:hover { background: var(--gray-100); }
.news-list .news-date { flex: 0 0 80px; text-align: center; padding-right: 20px; border-right: 1px solid var(--gray-200); }
.news-list .news-date .day { font-size: 28px; color: var(--primary); font-weight: bold; line-height: 1; }
.news-list .news-date .ym { font-size: 12px; color: var(--gray-400); }
.news-list .news-content { flex: 1; padding-left: 20px; }
.news-list .news-content h3 { font-size: 16px; margin-bottom: 8px; }
.news-list .news-content h3 a { color: var(--dark); }
.news-list .news-content h3 a:hover { color: var(--primary); }
.news-list .news-content p { font-size: 13px; color: var(--gray-600); line-height: 1.6; }

/* === News List — 列表页（/news/）卡片版 ===
   复用首页那套「日期徽标 + 内容」时间轴（.news-list .news-item 本身已是 flex），
   额外补：白色卡片面板、摘要 2 行截断、阅读全文链接、悬停左侧强调条。
   所有规则都带 .news-list-page，故不影响首页 .section-gray 里的新闻区。 */
.news-list-page { background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; padding: 2px 28px; }
.news-list-page .news-item:last-child { border-bottom: 0; }
.news-list-page .news-item:hover { background: #fafcfe; box-shadow: inset 3px 0 0 var(--primary); }
.news-list-page .news-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-list-page .news-more { display: inline-block; margin-top: 10px; color: var(--primary); font-size: 13px; }
.news-list-page .news-more .arrow { display: inline-block; transition: transform .3s; }
.news-list-page .news-item:hover .news-more .arrow { transform: translateX(4px); }
.news-count { text-align: center; color: var(--gray-400); font-size: 13px; margin-top: 18px; }

/* === Contact Page === */
.contact-section { display: flex; gap: 40px; }
.contact-info { flex: 1; }
.contact-info h3 { font-size: 22px; color: var(--dark); margin-bottom: 20px; }
.contact-info .info-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; font-size: 14px; color: var(--gray-600); }
.contact-info .info-item .icon { flex: 0 0 36px; width: 36px; height: 36px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.contact-form { flex: 1; }
.contact-form .form-group { margin-bottom: 16px; }
.contact-form label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--dark); }
.contact-form input,
.contact-form textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; outline: none; transition: border-color 0.3s; }
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--primary); }
.contact-form textarea { height: 120px; resize: vertical; }
/* 在线留言：必填标记 / 蜜罐字段 / 提交结果提示 */
.contact-form label .req { color: var(--primary); margin-left: 2px; }
.contact-form .form-honeypot { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .form-message { display: none; margin: 0 0 14px; padding: 10px 14px; border-radius: 4px; font-size: 14px; line-height: 1.6; }
.contact-form .form-message.is-pending,
.contact-form .form-message.is-success,
.contact-form .form-message.is-error { display: block; }
.contact-form .form-message.is-pending { background: var(--primary-light); color: var(--dark); }
.contact-form .form-message.is-success { background: #e8f6ee; border: 1px solid #b7e0c6; color: #1f7a45; }
.contact-form .form-message.is-error { background: #fdecec; border: 1px solid #f3c9c7; color: #b3352f; }
.contact-form .form-message a { color: inherit; text-decoration: underline; }
.contact-form button[disabled] { opacity: 0.65; cursor: not-allowed; }

/* === Banner Swiper === */
.hero-banner { position: relative; height: 100vh; min-height: 600px; overflow: hidden; }
.hero-banner .swiper-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; display: flex; align-items: center; }
.hero-banner .swiper-slide::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.35); }

/* 轮播文案：居中覆盖在遮罩之上，文字强制白色 */
.hero-banner .swiper-slide .slide-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  margin: auto;
  max-width: 900px;
  padding: 0 20px;
}
.hero-banner .swiper-slide .slide-content h2 {
  font-size: 42px;
  margin-top: 0;
  margin-bottom: 14px;
  color: #fff;
}
.hero-banner .swiper-slide .slide-content p {
  font-size: 18px;
  margin-top: 0;
  margin-bottom: 28px;
  color: #fff;
  opacity: 0.95;
}
@media (max-width: 768px) {
  .hero-banner .swiper-slide .slide-content h2 { font-size: 28px; }
  .hero-banner .swiper-slide .slide-content p { font-size: 15px; }
}

/* 轮播指示点：底部居中，圆点默认半透明白，active 实白放大。
   main.js 仅 toggle 'active' 类，视觉样式必须在此处提供，否则指示点不可见。 */
.hero-banner .swiper-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}
.hero-banner .swiper-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.7);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.3s, transform 0.3s, width 0.3s;
}
.hero-banner .swiper-dot:hover { background: rgba(255, 255, 255, 0.75); }
.hero-banner .swiper-dot.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.25);
}
@media (max-width: 768px) {
  .hero-banner .swiper-dots { bottom: 16px; gap: 9px; }
  .hero-banner .swiper-dot { width: 9px; height: 9px; }
}

/* === Stats Row === */
.stats-row { display: flex; justify-content: space-around; text-align: center; background: var(--primary); color: #fff; padding: 40px 0; }
.stats-row .stat-item .stat-num { font-size: 36px; font-weight: bold; }
.stats-row .stat-item .stat-label { font-size: 14px; opacity: 0.8; margin-top: 4px; }
.stats-row .stat-divider { width: 1px; background: rgba(255,255,255,0.2); }

/* === Advantage Cards === */
.advantage-grid { display: flex; flex-wrap: wrap; margin: -10px; }
.advantage-card { width: calc(25% - 20px); margin: 10px; background: #fff; border: 1px solid var(--border); padding: 30px 20px; text-align: center; border-radius: 4px; transition: all 0.3s; }
.advantage-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.12); transform: translateY(-4px); }
.advantage-card .advantage-icon { width: 64px; height: 64px; margin: 0 auto 16px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--primary); }
.advantage-card h3 { font-size: 16px; margin-bottom: 8px; color: var(--dark); }
.advantage-card p { font-size: 13px; color: var(--gray-600); }

/* === Responsive === */
@media (max-width: 1240px) {
  body { min-width: 0; }
  .container { width: 100%; padding: 0 20px; }
  .site-header .header-inner { padding: 0 20px; }
}
@media (max-width: 768px) {
  .site-header .nav-list { display: none; }
  .site-header .header-inner { height: 56px; }
  .hero-banner { height: 50vh; min-height: 300px; }
  .hero-banner .swiper-slide { height: 50vh; min-height: 300px; }
  .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
  .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 { width: 100%; }
  .product-grid .product-item { width: calc(50% - 24px); }
  .advantage-card { width: calc(50% - 20px); }
  .main-content { margin-left: 0; }
  .sidebar { width: 100%; float: none; margin-bottom: 20px; }
  .contact-section { flex-direction: column; }
  .site-footer .footer-info { flex: 0 0 100%; margin-bottom: 20px; }
  .section-title h2 { font-size: 24px; }
  .page-banner { height: 200px; }
  .page-banner h1 { font-size: 26px; }
}

/* === News List — 列表页窄屏 === */
@media (max-width: 768px) {
  .news-list-page { padding: 2px 16px; }
  .news-list-page .news-content h3 { font-size: 16px; }
  .news-list-page .news-excerpt { -webkit-line-clamp: 3; }
}

/* 轮播移动端图：后台「移动端图片 mobileImage」字段，窄屏时用独立图替换桌面大图
   （仅对带 .has-mobile 的 slide 生效，未配置时继续用桌面图） */
@media (max-width: 767px) {
  .hero-banner .swiper-slide.has-mobile { background-image: var(--mb) !important; }
}
