删除备份文件
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s

This commit is contained in:
2025-12-03 17:03:57 +08:00
parent 1cb612bdf8
commit 7b9e348cf6
11 changed files with 288 additions and 1342 deletions

View File

@@ -2,34 +2,31 @@
{block name="style"} {block name="style"}
<!-- 将rem适配JS移到这里确保优先执行 --> <!-- 将rem适配JS移到这里确保优先执行 -->
<script type="text/javascript"> <script type="text/javascript">
(function (doc, win) { (function (doc, win) {
var docEl = doc.documentElement; var docEl = doc.documentElement;
var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'; var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
function setRootFontSize() { function setRootFontSize() {
var clientWidth = docEl.clientWidth; var clientWidth = docEl.clientWidth;
if (!clientWidth) return; if (!clientWidth) return;
var fontSize = clientWidth / 7.5; // 750px/7.5=100px375px/7.5=50px var fontSize = clientWidth / 7.5; // 750px/7.5=100px375px/7.5=50px
// 直接修改内联样式,优先级最高 // 直接修改内联样式,优先级最高
docEl.setAttribute('style', 'font-size: ' + fontSize + 'px !important;'); docEl.setAttribute('style', 'font-size: ' + fontSize + 'px !important;');
} }
setRootFontSize(); setRootFontSize();
win.addEventListener(resizeEvt, setRootFontSize); win.addEventListener(resizeEvt, setRootFontSize);
doc.addEventListener('DOMContentLoaded', setRootFontSize); doc.addEventListener('DOMContentLoaded', setRootFontSize);
})(document, window); })(document, window);
console.log("根元素实际 font-size:", getComputedStyle(document.documentElement).fontSize); </script>
// 查看内联设置的 font-sizeJS 代码设置的值)
console.log("内联设置的 font-size:", document.documentElement.style.fontSize);
</script>
<link rel="stylesheet" href="__CSS__/topic_power_prodline/index.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/index.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/swiper1.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/swiper.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/nav1.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/nav.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/advantage1.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/advantage.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/moren.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/moren.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/mask.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/mask.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/product1.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/product.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/product_list1.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/product_list.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/product_card.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/product_card.css">
<link rel="stylesheet" href="__CSS__/topic_power_prodline/footer.css"> <link rel="stylesheet" href="__CSS__/topic_power_prodline/footer.css">
@@ -298,28 +295,6 @@ console.log("内联设置的 font-size:", document.documentElement.style.fontSiz
</div> </div>
{assign name="dc_second_section" value=":array_splice($data.desktop_charger, 0, 2)" /} {assign name="dc_second_section" value=":array_splice($data.desktop_charger, 0, 2)" /}
{notempty name="dc_second_section"} {notempty name="dc_second_section"}
<!-- <div class="product-card-box">
<div class="product-card-container">
{volist name="dc_second_section" id="dcs"}
<a class="product-card" href="{$dcs.link}">
<div class="product-text">
<div class="product-text-content">
<div class="product-card-title">{$dcs.title}</div>
<div class="product-card-desc">{$dcs.short_title}</div>
<div class="product-card-link">
<img src="__IMAGES__/ljgd.png" alt="了解更多">
</div>
</div>
</div>
<div class="product-card-img">
<img src="{$dcs.image}" alt="{$dcs.title}">
</div>
</a>
{/volist}
</div>
</div> -->
<div class="product-card-box"> <div class="product-card-box">
<div class="product-card-container"> <div class="product-card-container">
{volist name="dc_second_section" id="dcs"} {volist name="dc_second_section" id="dcs"}

View File

@@ -2,56 +2,64 @@
.advantage-section { .advantage-section {
width: 93.5%; width: 93.5%;
margin: 0 auto; margin: 0 auto;
padding: clamp(4rem, 5vw, 6rem) 0 clamp(1.8rem, 3vw, 3rem) 0; padding-top:0.99rem;
position: relative; position: relative;
z-index: 1; z-index: 1;
height: auto !important; height: auto !important;
min-height: auto !important; min-height: auto !important;
margin-bottom: 0.51rem;
} }
/* 标题容器:恢复原有居中样式 */ /* 标题容器:恢复原有居中样式 */
.advantage-section__title { .advantage-section__title {
font-size: clamp(2rem, 3vw, 2.4rem); font-size: 0.46rem;
font-weight: 700; font-weight: 700;
text-align: center; text-align: center;
color: #333; color: #101010;
line-height: 1.2;
margin:0 auto; margin:0 auto;
margin-bottom: clamp(1.5rem, 2vw, 2.5rem); margin-bottom: 0.51rem;
width: 80%; width: 80%;
} }
/* 列表容器:强制设置高度相关属性,确保内容正常显示 */ /* 列表容器:改为wrap换行实现2+3布局间距设为0.08rem8px */
.advantage-section__list { .advantage-section__list {
display: flex; display: flex;
justify-content: center; justify-content: flex-start; /* 左对齐排列 */
align-items: flex-start; align-items: flex-start;
gap: clamp(0.1rem, 0.3vw, 0.8rem); gap: 0.08rem; /* 列间距设计稿8px=0.08rem */
row-gap: 0.08rem; /* 行间距设计稿8px=0.08rem */
width: 100% !important; width: 100% !important;
flex-wrap: nowrap; flex-wrap: wrap; /* 允许换行 */
overflow: visible !important; /* 改为visible确保内容显示 */ overflow: visible !important;
padding: 0 !important; padding: 0 !important;
/* 强制设置高度相关属性 */
height: auto !important; height: auto !important;
min-height: 1px !important; /* 确保容器至少有高度 */ min-height: 1px !important;
position: relative !important; /* 建立BFC */ position: relative !important;
} }
/* 卡片包裹容器:确保为块级元素并继承高度 */ /* 卡片包裹容器:动态宽度控制 */
.advantage-card-wrap { .advantage-card-wrap {
display: block !important; display: block !important;
width: 100% !important;
height: auto !important; height: auto !important;
min-height: 1px !important; min-height: 1px !important;
} }
/* 卡片核心:高度自适应内容 */ /* 第一行2个卡片宽度=(100% - 1个间距)/2 */
.advantage-card-wrap:nth-child(1),
.advantage-card-wrap:nth-child(2) {
width: calc((100% - 0.08rem) / 2) !important;
}
/* 第二行3个卡片宽度=(100% - 2个间距)/3 */
.advantage-card-wrap:nth-child(3),
.advantage-card-wrap:nth-child(4),
.advantage-card-wrap:nth-child(5) {
width: calc((100% - 2 * 0.08rem) / 3) !important;
}
/* 卡片核心:宽度继承父容器,高度自适应 */
.advantage-card { .advantage-card {
flex: 0 0 calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5); width: 100% !important;
min-width: calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
max-width: calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
border-radius: 0.5rem;
overflow: hidden; overflow: hidden;
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1); box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease; transition: transform 0.3s ease;
@@ -59,254 +67,77 @@
background: #fff; background: #fff;
position: relative; position: relative;
z-index: 1; z-index: 1;
height: auto !important; /* 高度自适应内容 */ height: auto !important;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-radius: 0.1rem 0.1rem 0 0 !important;
} }
/* 图片容器:设置为1:1比例 */ /* 图片容器:保持1:1比例 */
.advantage-card__img { .advantage-card__img {
width: 100%; width: 100%;
aspect-ratio: 1 / 1; /* 1:1图片比例 */ aspect-ratio: 1 / 1; /* 1:1比例 */
object-fit: cover; object-fit: cover;
background-color: #f9f9f9; background-color: #f9f9f9;
display: block; display: block;
flex-shrink: 0; flex-shrink: 0;
} }
/* 文字区域:flex垂直分布确保标题和描述都垂直居中 */ /* 文字区域:保持内边距和布局内部间距也调整为0.08rem */
.advantage-card__content { .advantage-card__content {
width: 100%; width: 100%;
padding: clamp(1rem,3vw, 1.5rem); padding: 0.4rem 0.23rem 0.31rem 0.2rem; /* 上下内边距 */
display: flex; gap: 0.08rem; /* 内部元素间距设计稿8px=0.08rem */
flex-direction: column;
justify-content: center;
align-items: center;
flex-grow: 1;
gap: 4px;
} }
/* 标题容器:水平居中+内部两端对齐,同时垂直居中 */ /* 标题容器:间距设为0.08rem8px */
.advantage-card__heading-wrap { .advantage-card__heading-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: clamp(0.3rem, 0.5vw, 0.5rem); gap: 0.08rem; /* 设计稿8px=0.08rem */
width: 80%; width: 100%;
} }
/* 卡片标题:居左显示 */ /* 卡片标题:字体大小调整 */
.advantage-card__heading { .advantage-card__heading {
font-size: clamp(16px, 1.5vw, 32px); font-size: 0.34rem;
font-weight: 600; font-weight: 600;
color: #333; color: #101010;
line-height: 1.3;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; /* 强制不换行 */
overflow: hidden; /* 超出隐藏 */
text-overflow: ellipsis; /* 显示省略号 */
} }
/* 卡片标题右侧箭头:自适应大小,与标题协调 */ /* 描述文字样式 */
.advantage-card__description {
font-size: 0.24rem;
color:#666666;
margin-top: 0.08rem; /* 与标题间距设计稿8px=0.08rem */
white-space: nowrap; /* 强制不换行 */
overflow: hidden; /* 超出隐藏 */
text-overflow: ellipsis; /* 显示省略号 */
}
/* 箭头大小 */
.card-arrow { .card-arrow {
color: #409eff;
transition: transform 0.3s ease; transition: transform 0.3s ease;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
/* 箭头大小根据标题字体大小自适应 */ width: 0.33rem;
width: clamp(1rem, 1.8vw, 1.5rem); height: 0.33rem;
height: clamp(1rem, 1.8vw, 1.5rem);
font-size: clamp(0.7rem, 1.2vw, 1.1rem);
flex-shrink: 0;
}
/* 卡片hover时箭头动画 */
.advantage-card:hover .card-arrow {
transform: translateX(3px);
}
/* 描述文字:水平+垂直居中,与标题容器对齐,设置最小高度统一占位 */
.advantage-card__description {
font-size: clamp(10px, 1vw, 18px);
line-height: 1.2;
width: 80%;
color: #666666;
/* 强制固定2行显示 */
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
/* 非webkit内核浏览器降级方案 */
display: block;
height: calc(1.2em * 2); /* 行高 × 行数确保高度刚好容纳2行 */
/* 最小高度兜底,适配不同字体大小 */
min-height: clamp(24px, 2.4vw, 43.2px); /* 1.2em×2换算对应字体范围的最小/最大高度 */
/* 防止内容溢出 */
white-space: normal;
word-wrap: break-word;
} }
/* 卡片hover效果 */ /* 卡片hover效果 */
.advantage-card:hover { /* .advantage-card:hover {
transform: scale(1.03); transform: scale(1.03);
} } */
/* 箭头容器:自适应尺寸 */ /* 箭头hover位移 */
.arrow { .advantage-card:hover .card-arrow {
position: relative; transform: translateX(0.03rem);
/* 箭头尺寸跟随card-arrow自适应 */
width: 100%;
height: 100%;
}
/* 箭头线条基础样式:自适应粗细 */
.arrow::before,
.arrow::after {
content: '';
position: absolute;
background-color: #fff;
border-radius: clamp(0.05rem, 0.1vw, 0.1rem);
/* 线条粗细自适应 */
height: clamp(0.08rem, 0.15vw, 0.12rem);
}
/* 右箭头:自适应长度 */
.arrow-right::before {
width: clamp(0.3rem, 0.7vw, 0.55rem);
top: 50%;
left: 0;
transform: translateY(-50%) rotate(45deg);
transform-origin: right center;
}
.arrow-right::after {
width: clamp(0.3rem, 0.7vw, 0.55rem);
top: 50%;
left: 0;
transform: translateY(-50%) rotate(-45deg);
transform-origin: right center;
}
/* 左箭头:自适应长度 */
.arrow-left::before {
width: clamp(0.3rem, 0.7vw, 0.55rem);
top: 50%;
right: 0;
transform: translateY(-50%) rotate(-45deg);
transform-origin: left center;
}
.arrow-left::after {
width: clamp(0.3rem, 0.7vw, 0.55rem);
top: 50%;
right: 0;
transform: translateY(-50%) rotate(45deg);
transform-origin: left center;
}
/* 平板端和移动端统一布局第一行2个第二行3个 */
@media (max-width: 1024px) {
/* 列表容器flex布局+换行,左对齐确保排列规则,仅保留列间距 */
.advantage-section__list {
display: flex !important;
flex-wrap: wrap !important;
justify-content: flex-start !important;
gap: clamp(0.3rem, 1.5vw, 0.8rem) !important; /* 列间距 */
row-gap: clamp(0.5rem, 2vw, 1rem) !important; /* 行间距 */
width: 100% !important;
height: auto !important;
overflow: visible !important;
padding: 0 !important;
}
/* 卡片包裹容器:基础样式 */
.advantage-card-wrap {
display: block !important;
height: auto !important;
min-height: 1px !important;
margin-bottom: 0 !important; /* 移除额外margin */
}
/* 第一行2个卡片宽度=(100% - 1个间距)/2 */
.advantage-card-wrap:nth-child(1),
.advantage-card-wrap:nth-child(2) {
width: calc((100% - clamp(0.3rem, 1.5vw, 0.8rem)) / 2) !important;
}
/* 第二行3个卡片宽度=(100% - 2个间距)/3 */
.advantage-card-wrap:nth-child(3),
.advantage-card-wrap:nth-child(4),
.advantage-card-wrap:nth-child(5) {
width: calc((100% - 2 * clamp(0.3rem, 1.5vw, 0.8rem)) / 3) !important;
}
/* 卡片核心:宽度继承父容器,高度自适应 */
.advantage-card {
width: 100% !important;
min-width: 100% !important;
max-width: 100% !important;
flex: none !important;
height: auto !important;
display: flex;
flex-direction: column;
}
.advantage-card__img {
aspect-ratio: 1 / 1;
}
.advantage-card__content {
flex-grow: 1;
padding: clamp(1.2rem, 3vw, 2rem) 0;
}
/* 平板端字体稍大 */
.advantage-card__heading {
font-size: clamp(16px, 3vw, 20px);
}
.advantage-card__description {
font-size: clamp(11px, 2vw, 18px);
min-height: clamp(24px, 4vw, 30px);
color:#666666;
}
.card-arrow {
width: clamp(1.17rem, 2.5vw, 2.2rem);
height: clamp(1.17rem, 2.5vw, 2.2rem);
}
}
/* 移动端进一步优化间距 */
@media (max-width: 767px) {
.advantage-section__list {
gap: clamp(0.2rem, 1vw, 0.5rem) !important; /* 进一步缩小列间距 */
row-gap: clamp(0.3rem, 1.5vw, 0.8rem) !important; /* 进一步缩小行间距 */
}
.advantage-card-wrap:nth-child(1),
.advantage-card-wrap:nth-child(2) {
width: calc((100% - clamp(0.2rem, 1vw, 0.5rem)) / 2) !important;
}
.advantage-card-wrap:nth-child(3),
.advantage-card-wrap:nth-child(4),
.advantage-card-wrap:nth-child(5) {
width: calc((100% - 2 * clamp(0.2rem, 1vw, 0.5rem)) / 3) !important;
}
.advantage-card__description {
min-height: clamp(20px, 4.5vw, 26px);
color:#666666;
}
}
/* 超小屏优化 */
@media (max-width: 374px) {
.advantage-card__description {
min-height: clamp(18px, 4vw, 24px);
color:#666666;
font-size: clamp(11px, 2vw, 18px);
}
} }

View File

@@ -1,143 +0,0 @@
/* 核心模块固定90%宽度PC端优化移动端边距 */
.advantage-section {
width: 93.5%;
margin: 0 auto;
padding-top:0.99rem;
position: relative;
z-index: 1;
height: auto !important;
min-height: auto !important;
margin-bottom: 0.51rem;
}
/* 标题容器:恢复原有居中样式 */
.advantage-section__title {
font-size: 0.46rem;
font-weight: 700;
text-align: center;
color: #101010;
margin:0 auto;
margin-bottom: 0.51rem;
width: 80%;
}
/* 列表容器改为wrap换行实现2+3布局间距设为0.08rem8px */
.advantage-section__list {
display: flex;
justify-content: flex-start; /* 左对齐排列 */
align-items: flex-start;
gap: 0.08rem; /* 列间距设计稿8px=0.08rem */
row-gap: 0.08rem; /* 行间距设计稿8px=0.08rem */
width: 100% !important;
flex-wrap: wrap; /* 允许换行 */
overflow: visible !important;
padding: 0 !important;
height: auto !important;
min-height: 1px !important;
position: relative !important;
}
/* 卡片包裹容器:动态宽度控制 */
.advantage-card-wrap {
display: block !important;
height: auto !important;
min-height: 1px !important;
}
/* 第一行2个卡片宽度=(100% - 1个间距)/2 */
.advantage-card-wrap:nth-child(1),
.advantage-card-wrap:nth-child(2) {
width: calc((100% - 0.08rem) / 2) !important;
}
/* 第二行3个卡片宽度=(100% - 2个间距)/3 */
.advantage-card-wrap:nth-child(3),
.advantage-card-wrap:nth-child(4),
.advantage-card-wrap:nth-child(5) {
width: calc((100% - 2 * 0.08rem) / 3) !important;
}
/* 卡片核心:宽度继承父容器,高度自适应 */
.advantage-card {
width: 100% !important;
overflow: hidden;
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
cursor: pointer;
background: #fff;
position: relative;
z-index: 1;
height: auto !important;
display: flex;
flex-direction: column;
border-radius: 0.1rem 0.1rem 0 0 !important;
}
/* 图片容器保持1:1比例 */
.advantage-card__img {
width: 100%;
aspect-ratio: 1 / 1; /* 1:1比例 */
object-fit: cover;
background-color: #f9f9f9;
display: block;
flex-shrink: 0;
}
/* 文字区域保持内边距和布局内部间距也调整为0.08rem */
.advantage-card__content {
width: 100%;
padding: 0.4rem 0.23rem 0.31rem 0.2rem; /* 上下内边距 */
gap: 0.08rem; /* 内部元素间距设计稿8px=0.08rem */
}
/* 标题容器间距设为0.08rem8px */
.advantage-card__heading-wrap {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.08rem; /* 设计稿8px=0.08rem */
width: 100%;
}
/* 卡片标题:字体大小调整 */
.advantage-card__heading {
font-size: 0.34rem;
font-weight: 600;
color: #101010;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; /* 强制不换行 */
overflow: hidden; /* 超出隐藏 */
text-overflow: ellipsis; /* 显示省略号 */
}
/* 描述文字样式 */
.advantage-card__description {
font-size: 0.24rem;
color:#666666;
margin-top: 0.08rem; /* 与标题间距设计稿8px=0.08rem */
white-space: nowrap; /* 强制不换行 */
overflow: hidden; /* 超出隐藏 */
text-overflow: ellipsis; /* 显示省略号 */
}
/* 箭头大小 */
.card-arrow {
transition: transform 0.3s ease;
display: inline-flex;
align-items: center;
justify-content: center;
width: 0.33rem;
height: 0.33rem;
}
/* 卡片hover效果 */
/* .advantage-card:hover {
transform: scale(1.03);
} */
/* 箭头hover位移 */
.advantage-card:hover .card-arrow {
transform: translateX(0.03rem);
}

View File

@@ -1,20 +1,20 @@
/* 设计稿750px → 1rem=100px所有尺寸按设计稿÷100换算 */
.nav-box { .nav-box {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
width: 93.5%; width: 93.5%;
margin: 0 auto; margin: 0 auto;
background-color: #fff; background-color: #fff;
border-radius: 3.125rem; border-radius: 3.125rem; /* 设计稿312.5px */
box-shadow: 0 0.125rem 0.9375rem rgba(0, 0, 0, 0.05); box-shadow: 0 0.125rem 0.9375rem rgba(0, 0, 0, 0.05); /* 设计稿12.5px/93.75px */
position: relative; position: relative;
z-index: 1; z-index: 1;
overflow: visible; overflow: visible;
padding: 0 clamp(21px, 5.6vw, 42px); padding: 0 0.42rem; /* 设计稿42px左右内边距取中间值 */
/* 新增:确保容器能捕获子元素高度 */ /* min-height: fit-content; */
min-height: fit-content; /* height:0.86rem; */
/* 平板端补偿内边距,抵消负边距影响 */ box-sizing: border-box;
/* padding-top: clamp(1rem, 3vw, 2rem);*/ padding-bottom: 0.2rem;
padding-bottom: clamp(0.5rem, 2vw, 1.5rem);
} }
.nav-item { .nav-item {
@@ -23,46 +23,21 @@
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
flex: 1; flex: 1;
min-width: 3rem; margin-top: -0.5rem;
max-width: 5rem;
text-align: center; text-align: center;
/* 修改:用相对单位+媒体查询区分设备,避免过度上移 */
margin-top: clamp(-8%, -2vw, -15%);
/* 新增:确保子元素高度被正确计算 */
align-self: flex-start; align-self: flex-start;
} }
/* 平板端单独调整负边距 */ .nav-item img {
@media (max-width: 1023px) and (min-width: 767px) { width: 0.94rem; /* 设计稿80px示例图片尺寸可按实际调整 */
.nav-item { height: 0.94rem;
margin-top: -8%; /* 减小负边距,避免溢出 */ margin-bottom: 0.15rem; /* 设计稿10px图片与文字间距 */
}
.nav-item p {
padding-top:clamp(6px,2vw,12px);
font-size: clamp(11px, 3vw, 21px);
}
} }
@media (min-width: 1024px) {
.nav-item {
margin-top: -5%; /* 减小负边距,避免溢出 */
}
.nav-item p {
padding-top:clamp(6px,2vw,12px);
font-size: clamp(11px, 3vw, 21px);
} .nav-item p {
}
@media (max-width: 76px) and (min-width: 374px) {
.nav-item {
margin-top: -15%; /* 减小负边距,避免溢出 */
}
.nav-item p {
padding-top:clamp(6px,2vw,12px);
font-size: clamp(11px, 3vw, 21px);
}
font-size: 0.22rem; /* 设计稿16px文字大小 */
margin: 0;
} }

View File

@@ -1,43 +0,0 @@
/* 设计稿750px → 1rem=100px所有尺寸按设计稿÷100换算 */
.nav-box {
display: flex;
justify-content: space-around;
width: 93.5%;
margin: 0 auto;
background-color: #fff;
border-radius: 3.125rem; /* 设计稿312.5px */
box-shadow: 0 0.125rem 0.9375rem rgba(0, 0, 0, 0.05); /* 设计稿12.5px/93.75px */
position: relative;
z-index: 1;
overflow: visible;
padding: 0 0.42rem; /* 设计稿42px左右内边距取中间值 */
/* min-height: fit-content; */
/* height:0.86rem; */
box-sizing: border-box;
padding-bottom: 0.2rem;
}
.nav-item {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
flex: 1;
margin-top: -0.5rem;
text-align: center;
align-self: flex-start;
}
.nav-item img {
width: 0.94rem; /* 设计稿80px示例图片尺寸可按实际调整 */
height: 0.94rem;
margin-bottom: 0.15rem; /* 设计稿10px图片与文字间距 */
}
.nav-item p {
font-size: 0.22rem; /* 设计稿16px文字大小 */
margin: 0;
}

View File

@@ -1,38 +1,50 @@
/* 设计稿750px → 1rem=100px所有尺寸按设计稿÷100换算 */
.product-box { .product-box {
background: #fff; background: #fff;
padding-top: clamp(3.2rem, 3vw, 5rem); padding-top: 0.93rem;
/* 产品块之间留间距 */
} }
.product-title { .product-title {
width: 93.5%; width: 93.5%;
margin: 0 auto; margin: 0 auto;
padding-bottom: clamp(1.5rem, 3vw, 3rem); padding-bottom: 0.83rem;
} }
.product-title-h2 { .product-title-h2 {
font-size: clamp(24px, 3vw, 2.25rem); font-size: 0.46rem;
/* padding-top: clamp(1.5rem, 3vw, 3rem); */
} }
.product-title-p { .product-title-p {
font-size: clamp(0.875rem, 1.5vw, 1.125rem); font-size: 0.24rem;
color: #646464; color: #646464;
margin-top: clamp(0.5rem, 1vw, 0.75rem); margin-top: 0.21rem;
} }
/* 容器布局:两个产品通用 */ /* 容器布局:改为上下结构(右侧在上,左侧在下) */
.product-container { .product-container {
display: flex; display: flex;
gap: clamp(0.4rem, 1vw, 0.71rem); flex-direction: column-reverse;
gap: 0.1rem; /* 上下间距 */
margin: 0 auto; margin: 0 auto;
width: 93.5%; width: 93.5%;
align-items: flex-start; align-items: stretch; /* 宽度铺满 */
} }
/* 侧容器:两个产品通用 */ /* 侧容器:移到上方 */
.product-right {
flex: none; /* 取消flex比例自适应高度 */
position: relative;
border-radius: 0.1rem;
overflow: hidden;
width: 100%;
background-color: #f5f5f5;
min-height: 1.94rem;
aspect-ratio: 16/9;
}
/* 左侧容器:移到下方 */
.product-left { .product-left {
flex: 1.8; flex: none; /* 取消flex比例自适应高度 */
position: relative; position: relative;
width: 100%; width: 100%;
} }
@@ -40,37 +52,18 @@
.product-img { .product-img {
width: 100%; width: 100%;
height: auto; height: auto;
border-radius: 10px; border-radius: 0.1rem;
display: block; display: block;
/* 取消图片底部空隙 */
} }
/* 悬浮图公共样式两个产品尺寸完全一致100%宽度 */ /* 第二个产品:悬浮图位置调整(适配下方布局 */
/* 第二个产品:悬浮图上右超出(仅定位差异) */
.product-img-2 { .product-img-2 {
top: -10%; top: auto; /* 取消顶部定位 */
/* 超出 */ bottom: -0.8rem; /* 底部超出 */
transform: none; transform: none;
width: 108%; width: 1.08rem;
/* 取消居中 */ position: absolute;
} right: 0;
/* 右侧容器:两个产品通用 */
.product-right {
flex: 3.2;
position: relative;
border-radius: 10px;
overflow: hidden;
width: 100%;
background-color: #f5f5f5;
align-self: stretch;
position: relative;
} }
.right-content { .right-content {
@@ -97,10 +90,9 @@
opacity: 0; opacity: 0;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
z-index: 2; z-index: 2;
display: none; /* 默认隐藏 */ display: none;
} }
/* 播放图标默认显示,暂停图标默认隐藏 */
.play-icon { .play-icon {
display: inline-block; display: inline-block;
} }
@@ -108,7 +100,6 @@
display: none; display: none;
} }
/* .paused类时切换图标 */
.video-play-btn.paused .play-icon { .video-play-btn.paused .play-icon {
display: none; display: none;
} }
@@ -116,163 +107,43 @@
display: inline-block; display: inline-block;
} }
/* 视频显示时按钮可见 */
.right-video[playing] ~ .video-play-btn, .right-video[playing] ~ .video-play-btn,
.product-right:hover .video-play-btn { .product-right:hover .video-play-btn {
opacity: 1; opacity: 1;
display: block; display: block;
} }
/* PC端适配仅1024px以上应用PC样式 */ /* 悬浮图容器:适配下方布局 */
@media (min-width: 1025px) { .product-img-hover {
.product-container { width: auto;
width: 93.5%; position: absolute;
} right: 0;
bottom: 0;
.product-left { z-index: 33;
flex: 2;
}
.product-right {
flex: 5;
}
.product-img-2 {
top: -12%;
}
} }
.right {
/* 移动端+平板端适配1024px以下统一样式表现 */ right: -0.3rem;
@media (max-width: 1024px) {
.product-container {
flex-direction: column-reverse; /* 反转列顺序,右在上左在下 */
}
.product-left, .product-right {
flex: none; /* 重置flex比例 */
width: 100%; /* 宽度铺满 */
}
.product-right {
align-self: auto; /* 重置对齐方式 */
aspect-ratio: 16/9;
min-height: 194px;
}
.product-img {
/* max-height: 202px;
object-fit: contain; */
width: 100%;
}
/* 悬浮图容器宽高与图片一致 */
.product-img-hover {
width: auto; /* 宽度由图片决定 */
position: absolute;
right: 0;
bottom: 0;
z-index: 33;
}
.product-img-2 {
top: -8%;
width: auto;
right: 0;
left: auto;
}
.img1 {
width:356px;
/* 或者保持原有width:100%只设置max-width */
max-width:356px;
}
.img2 {
width:356px;
/* 或者保持原有width:100%只设置max-width */
max-width:356px;
}
.img3 {
width:356px;
/* 或者保持原有width:100%只设置max-width */
max-width:356px;
}
.img4 {
width:356px;
/* 或者保持原有width:100%只设置max-width */
max-width:356px;
}
.img5 {
width:356px;
/* 或者保持原有width:100%只设置max-width */
max-width:356px;
}
} }
/* 图片尺寸统一用rem */
/* 超小屏适配375px以下 */ .img1, .img2, .img3, .img4, .img5 {
/* @media (max-width: 768px) and (min-width: 375px) */ width: 3.56rem;
@media (min-width: 375px) and (max-width: 767px){ max-width: 3.56rem;
.img1 {
width: clamp(138px, 20vw, 276px);
/* 或者保持原有width:100%只设置max-width */
max-width: clamp(138px, 20vw, 276px) !important;
}
.img2 {
width: clamp(135px, 20vw, 270px);
/* 或者保持原有width:100%只设置max-width */
max-width: clamp(135px, 20vw, 270px) !important;
}
.img3 {
width: clamp(142px, 20vw, 284px);
/* 或者保持原有width:100%只设置max-width */
max-width: clamp(142px, 20vw, 284px) !important;
}
.img4 {
width: clamp(125px, 20vw,250px);
/* 或者保持原有width:100%只设置max-width */
max-width: clamp(125px, 20vw,250px) !important;
}
.img5 {
width: clamp(129px, 20vw,258px);
max-width: clamp(129px, 20vw,258px)!important;
}
.product-right {
min-height: 194px;
}
.product-img-hover {
width:auto;
}
} }
@media (min-width: 768px) and (max-width: 1023px) {
.img1 {
width:100%;
/* 或者保持原有width:100%只设置max-width */
max-width:276px;
}
.img2 {
width:100%;
/* 或者保持原有width:100%只设置max-width */
max-width:270px;
}
.img3 {
width:284px;
/* 或者保持原有width:100%只设置max-width */
max-width: 284px;
}
.img4 {
width:250px;
/* 或者保持原有width:100%只设置max-width */
max-width: 250px;
}
.img5 {
width: 258px;
max-width: 258px;
}
.img1 {
max-width: 2.76rem;
}
.img2 {
max-width: 2.7rem;
}
.img3 {
max-width: 2.84rem;
}
.img4 {
max-width: 2.5rem;
}
.img5 {
max-width: 2.68rem;
} }

View File

@@ -1,149 +0,0 @@
/* 设计稿750px → 1rem=100px所有尺寸按设计稿÷100换算 */
.product-box {
background: #fff;
padding-top: 0.93rem;
}
.product-title {
width: 93.5%;
margin: 0 auto;
padding-bottom: 0.83rem;
}
.product-title-h2 {
font-size: 0.46rem;
}
.product-title-p {
font-size: 0.24rem;
color: #646464;
margin-top: 0.21rem;
}
/* 容器布局:改为上下结构(右侧在上,左侧在下) */
.product-container {
display: flex;
flex-direction: column-reverse;
gap: 0.1rem; /* 上下间距 */
margin: 0 auto;
width: 93.5%;
align-items: stretch; /* 宽度铺满 */
}
/* 右侧容器:移到上方 */
.product-right {
flex: none; /* 取消flex比例自适应高度 */
position: relative;
border-radius: 0.1rem;
overflow: hidden;
width: 100%;
background-color: #f5f5f5;
min-height: 1.94rem;
aspect-ratio: 16/9;
}
/* 左侧容器:移到下方 */
.product-left {
flex: none; /* 取消flex比例自适应高度 */
position: relative;
width: 100%;
}
.product-img {
width: 100%;
height: auto;
border-radius: 0.1rem;
display: block;
}
/* 第二个产品:悬浮图位置调整(适配下方布局) */
.product-img-2 {
top: auto; /* 取消顶部定位 */
bottom: -0.8rem; /* 底部超出 */
transform: none;
width: 1.08rem;
position: absolute;
right: 0;
}
.right-content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
transition: opacity 0.3s ease;
}
.right-video {
display: none;
}
.video-play-btn {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: none;
border: none;
cursor: pointer;
opacity: 0;
transition: opacity 0.3s ease;
z-index: 2;
display: none;
}
.play-icon {
display: inline-block;
}
.pause-icon {
display: none;
}
.video-play-btn.paused .play-icon {
display: none;
}
.video-play-btn.paused .pause-icon {
display: inline-block;
}
.right-video[playing] ~ .video-play-btn,
.product-right:hover .video-play-btn {
opacity: 1;
display: block;
}
/* 悬浮图容器:适配下方布局 */
.product-img-hover {
width: auto;
position: absolute;
right: 0;
bottom: 0;
z-index: 33;
}
.right {
right: -0.3rem;
}
/* 图片尺寸统一用rem */
.img1, .img2, .img3, .img4, .img5 {
width: 3.56rem;
max-width: 3.56rem;
}
.img1 {
max-width: 2.76rem;
}
.img2 {
max-width: 2.7rem;
}
.img3 {
max-width: 2.84rem;
}
.img4 {
max-width: 2.5rem;
}
.img5 {
max-width: 2.68rem;
}

View File

@@ -1,7 +1,8 @@
/* 容器布局:通用基础样式(仅宽度、外边距,不涉及高度) */ /* 设计稿750px → 1rem=100px所有尺寸按设计稿÷100换算 */
/* 容器布局:通用基础样式 */
.product-card-box { .product-card-box {
width: 93.5%; width: 93.5%;
margin: clamp(0.7rem, 2vw, 1.5rem) auto 0; margin: 0.12rem auto 0;
padding: 0; padding: 0;
} }
@@ -9,288 +10,115 @@
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: wrap;
overflow: visible !important; /* 改为visible显示所有内容 */ overflow: visible !important;
/* padding: 0 clamp(0.2rem, 0.6vw, 0.3rem); */ height: auto !important;
height: auto !important; /* 高度自适应内容 */ gap: 0.12rem; /* 间距调整为0.12rem */
justify-content: space-between; /* 两端对齐,确保铺满 */
align-items: flex-start;
} }
/* 卡片包裹容器:确保不独占一行 */ /* 卡片包裹容器:强制一行2个并铺满 */
.product-card-wrap { .product-card-wrap {
display: contents; /* 让包裹容器不影响布局 */ display: block !important;
width: calc(50% - 0.06rem) !important; /* 50%宽度 - 间距的一半0.12rem/2=0.06rem */
height: auto !important;
margin: 0 !important; /* 移除额外margin */
}
/* 卡片核心:通用样式 */
.product-card {
background: rgb(242, 243, 245);
cursor: pointer;
width: 100% !important;
flex: none;
box-shadow: 0 0.1125rem 0.4rem rgba(0, 0, 0, 0.05);
margin: 0 !important;
box-shadow: 0 0.05rem 0.15rem rgba(0, 0, 0, 0.08); /* 包裹容器阴影 */
display: flex;
flex-direction: column;
height: auto !important;
transition: transform 0.3s ease;
border-radius: 0.07rem;
}
/* 卡片hover效果通用 */
.product-card:hover {
transform: scale(1.02);
}
/* 图片容器:通用样式 */
.product-card-img {
display: flex;
justify-content: center;
align-items: center;
width: 100%; width: 100%;
flex: 0 0 auto;
aspect-ratio: 3 / 2.8;
overflow: hidden;
} }
/* ######################################################################### */ /* 产品图片:通用样式 */
/* 移动端+平板样式max-width: 1023px- 后续修改仅改这里 */ .product-card img {
/* ######################################################################### */ width: 100%;
@media (max-width: 1024px) { height: 100%;
/* 卡片容器:移动端+平板特有 - 改为wrap换行一行2个高度自适应 */ object-fit: contain;
.product-card-container { object-position: center;
align-items: flex-start; /* 改为flex-start避免拉伸 */
flex-wrap: wrap !important; /* 强制开启换行 */
justify-content: flex-start !important; /* 左对齐 */
gap: clamp(0.5rem, 1vw, 1rem) !important; /* 设置间距 */
height: auto !important; /* 高度自适应内容 */
}
/* 卡片包裹容器:移动端+平板适配 */
.product-card-wrap {
display: block !important;
width: calc(50% - clamp(0.25rem, 0.5vw, 0.5rem)) !important;
margin: 0 !important;
padding: 0 !important;
height: auto !important; /* 高度自适应 */
}
/* 卡片核心:移动端+平板改为一行2个高度自适应内容 */
.product-card {
background: rgb(242, 243, 245);
border-radius: clamp(0.375rem, 1vw, 0.5rem);
cursor: pointer;
width: 100% !important; /* 卡片宽度100%,由包裹容器控制 */
flex: none;
box-shadow: 0 clamp(0.1rem, 0.2vw, 0.125rem)
clamp(0.3rem, 0.8vw, 0.5rem) rgba(0, 0, 0, 0.05);
margin: 0 !important; /* 移除margin用gap控制间距 */
display: flex;
flex-direction: column;
height: auto !important; /* 高度自适应内容 */
}
/* 卡片hover效果移动端+平板特有 */
.product-card:hover {
transform: scale(clamp(1.01, 1.02, 1.03));
transition: transform 0.3s ease;
}
/* 图片容器:移动端+平板固定占比 */
.product-card-img {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
flex: 0 0 auto; /* 改为auto高度自适应 */
aspect-ratio: 3 / 2.8; /* 保持图片比例 */
margin-bottom: clamp(0.4rem, 0.6vw, 0.5rem);
overflow: hidden;
border-radius: clamp(0.2rem, 0.4vw, 0.25rem);
}
/* 产品图片:移动端+平板特有 */
.product-card img {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
}
/* 文字容器:移动端+平板高度自适应 */
.product-card-text {
flex: 1 1 auto; /* 改为flex:1高度自适应内容 */
display: flex;
flex-direction: column;
justify-content: center;
padding-left: clamp(0.8rem, 2vw, 1.5rem);
padding-right: clamp(0.8rem, 2vw, 1.5rem);
height: auto !important; /* 高度自适应 */
align-items: center;
}
/* 标题样式:移动端+平板特有,高度自适应 */
.product-card-title {
font-size: clamp(15px, 2vw, 30px);
font-weight: 600;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
height: auto !important; /* 移除固定高度 */
margin-bottom: clamp(10px, 2vw, 20px); /* 添加间距 */
line-height: 1.2;
text-align: center;
}
/* 描述样式:移动端+平板高度自适应 */
.product-card-desc {
font-size: clamp(12px, 1.5vw,21px);
color: #656565;
word-break: break-word;
height: auto !important; /* 移除固定高度 */
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.4;
text-align: center;
}
/* 链接图标容器:移动端+平板高度自适应,添加较小的底部内边距 */
.product-card-link {
width: 100%;
display: flex;
align-items: center;
justify-content: center; /* 水平居中 */
flex: 0 0 auto;
/* padding: clamp(0.5rem, 1vw, 0.8rem); */
padding-top: clamp(1.25rem, 3vw, 2.5rem);
padding-bottom: clamp(1.45rem, 3vw,2.9rem);
/* padding-left: clamp(0.8rem, 2vw, 1.5rem); */
height: auto !important;
text-align: center; /* 针对inline元素的居中 */
}
/* 链接图标:移动端+平板特有 */
.product-card-link img {
width: clamp(5.5rem, 5vw,8.5rem);
height: auto;
object-fit: contain;
}
/* 平板端768px-1023px补充样式 */
@media (min-width: 768px) and (max-width: 1023px) {
.product-card-img {
aspect-ratio: 3 / 2.8; /* 保持图片比例 */
}
/* 平板端字体稍大 */
.product-card-title {
font-size: 30px;
text-align: center;
}
.product-card-desc {
font-size: 21px;
text-align: center;
}
/* 平板端底部内边距稍大但仍较小 */
.product-card-link {
width: 100%;
padding-top: clamp(2.3rem, 4vw, 3.2rem);
padding-bottom: clamp(2.7rem, 5vw,3.9rem);
}
.product-card-link img {
width: 100%;
max-width: 154px;
}
}
} }
/* ######################################################################### */ /* 文字容器:通用样式(居中对齐) */
/* PC端样式单独配置min-width: 1024px- 后续修改仅改这里 */ .product-card-text {
/* ######################################################################### */ flex: 1 1 auto;
@media (min-width: 1024px) { display: flex;
/* 卡片容器PC端特有高度自适应内容 */ flex-direction: column;
.product-card-container { justify-content: center;
align-items: flex-start; /* 改为flex-start避免拉伸 */
height: auto !important; /* 高度自适应内容 */
}
/* 卡片包裹容器PC端适配 */ height: auto !important;
.product-card-wrap { align-items: center;
display: contents; text-align: center;
} }
/* 卡片核心PC端高度自适应内容 */ /* 标题样式:通用 */
.product-card { .product-card-title {
background: rgb(242, 243, 245); font-size: 0.3rem;
border-radius: clamp(0.375rem, 1vw, 0.5rem); font-weight: 600;
cursor: pointer; color: #333;
width: calc(25% - clamp(0.3rem, 0.5vw, 0.36rem)); white-space: nowrap;
flex: none; overflow: hidden;
box-shadow: 0 clamp(0.1rem, 0.2vw, 0.125rem) text-overflow: ellipsis;
clamp(0.3rem, 0.8vw, 0.5rem) rgba(0, 0, 0, 0.05); height: auto !important;
margin: 0 clamp(0.16rem, 0.24vw, 0.2rem); margin-bottom: 0.21rem;
display: flex;
flex-direction: column; }
height: auto !important; /* 高度自适应内容 */
} /* 描述样式通用2行截断 */
.product-card-desc {
/* 卡片hover效果PC端特有 */ font-size: 0.24rem;
.product-card:hover { color: #656565;
transform: scale(clamp(1.01, 1.02, 1.03)); word-break: break-word;
transition: transform 0.3s ease; height: auto !important;
} overflow: hidden;
display: -webkit-box;
/* 图片容器PC端高度自适应 */ -webkit-line-clamp: 2;
.product-card-img { -webkit-box-orient: vertical;
display: flex; line-height: 1.4;
justify-content: center; }
align-items: center;
width: 100%; /* 链接图标容器:通用样式(居中) */
flex: 0 0 auto; /* 改为auto高度自适应 */ .product-card-link {
aspect-ratio: 3 / 2.8; /* 保持图片比例 */ width: 100%;
margin-bottom: clamp(0.4rem, 0.6vw, 0.5rem); display: flex;
overflow: hidden; align-items: center;
border-radius: clamp(0.2rem, 0.4vw, 0.25rem); justify-content: center;
} flex: 0 0 auto;
padding: 0.35rem 0 0.4rem;
/* 产品图片PC端特有 */ height: auto !important;
.product-card img { text-align: center;
width: 100%; }
height: 100%;
object-fit: contain; /* 链接图标:通用样式 */
object-position: center; .product-card-link img {
} width: 1.54rem;
height: auto;
/* 文字容器PC端高度自适应 */ object-fit: contain;
.product-card-text {
flex: 1 1 auto; /* 改为flex:1高度自适应内容 */
flex-direction: column;
justify-content: center;
padding-left: clamp(0.8rem, 2vw, 1.5rem);
padding-right: clamp(0.8rem, 2vw, 1.5rem);
display: flex; /* 确保flex布局 */
height: auto !important; /* 高度自适应 */
}
/* 标题样式PC端特有高度自适应 */
.product-card-title {
font-size: clamp(15px, 1.5vw, 30px);
font-weight: 600;
color: #101010;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
height: auto !important; /* 高度自适应 */
margin-bottom: clamp(0.2rem, 0.4vw, 0.3rem); /* 添加间距 */
line-height: 1.2;
display: flex;
align-items: center;
}
/* 描述样式PC端高度自适应 */
.product-card-desc {
font-size: clamp(11px, 1.5vw,21px);
color: #656565;
word-break: break-word;
height: auto !important; /* 高度自适应 */
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.4;
text-align: center;
}
/* 链接图标容器PC端高度自适应添加较小的底部内边距 */
.product-card-link {
width: 100%;
display: flex; /* 确保flex布局 */
align-items: center;
flex: 0 0 auto; /* 改为auto高度自适应 */
/* padding-left: clamp(0.8rem, 2vw, 1.5rem); */
padding-bottom: clamp(1rem, 3vw, 1.5rem) ; /* 更小的底部内边距 */
height: auto !important; /* 高度自适应 */
}
/* 链接图标PC端特有 */
.product-card-link img {
width: clamp(2.5rem, 5vw, 4.5rem);
height: auto;
object-fit: contain;
}
} }

View File

@@ -1,124 +0,0 @@
/* 设计稿750px → 1rem=100px所有尺寸按设计稿÷100换算 */
/* 容器布局:通用基础样式 */
.product-card-box {
width: 93.5%;
margin: 0.12rem auto 0;
padding: 0;
}
.product-card-container {
width: 100%;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
overflow: visible !important;
height: auto !important;
gap: 0.12rem; /* 间距调整为0.12rem */
justify-content: space-between; /* 两端对齐,确保铺满 */
align-items: flex-start;
}
/* 卡片包裹容器强制一行2个并铺满 */
.product-card-wrap {
display: block !important;
width: calc(50% - 0.06rem) !important; /* 50%宽度 - 间距的一半0.12rem/2=0.06rem */
height: auto !important;
margin: 0 !important; /* 移除额外margin */
}
/* 卡片核心:通用样式 */
.product-card {
background: rgb(242, 243, 245);
cursor: pointer;
width: 100% !important;
flex: none;
box-shadow: 0 0.1125rem 0.4rem rgba(0, 0, 0, 0.05);
margin: 0 !important;
box-shadow: 0 0.05rem 0.15rem rgba(0, 0, 0, 0.08); /* 包裹容器阴影 */
display: flex;
flex-direction: column;
height: auto !important;
transition: transform 0.3s ease;
border-radius: 0.07rem;
}
/* 卡片hover效果通用 */
.product-card:hover {
transform: scale(1.02);
}
/* 图片容器:通用样式 */
.product-card-img {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
flex: 0 0 auto;
aspect-ratio: 3 / 2.8;
overflow: hidden;
}
/* 产品图片:通用样式 */
.product-card img {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
}
/* 文字容器:通用样式(居中对齐) */
.product-card-text {
flex: 1 1 auto;
display: flex;
flex-direction: column;
justify-content: center;
height: auto !important;
align-items: center;
text-align: center;
}
/* 标题样式:通用 */
.product-card-title {
font-size: 0.3rem;
font-weight: 600;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
height: auto !important;
margin-bottom: 0.21rem;
}
/* 描述样式通用2行截断 */
.product-card-desc {
font-size: 0.24rem;
color: #656565;
word-break: break-word;
height: auto !important;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
line-height: 1.4;
}
/* 链接图标容器:通用样式(居中) */
.product-card-link {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
padding: 0.35rem 0 0.4rem;
height: auto !important;
text-align: center;
}
/* 链接图标:通用样式 */
.product-card-link img {
width: 1.54rem;
height: auto;
object-fit: contain;
}

View File

@@ -5,7 +5,7 @@
.auto-swiper-container { .auto-swiper-container {
width: 100%; width: 100%;
/* 关键:高度 = 视口高度的百分比可调整如60vh=屏幕高度60% */ /* 关键:高度 = 视口高度的百分比可调整如60vh=屏幕高度60% */
margin-bottom: 5.7rem; margin-bottom:1.5rem;
/* max-height: 900px; */ /* max-height: 900px; */
min-height: 300px; min-height: 300px;
position: relative; position: relative;

View File

@@ -1,75 +0,0 @@
.swiper-container {
padding: 0 !important;
}
/* 轮播容器 - 核心:基于视口高度自适应 */
.auto-swiper-container {
width: 100%;
/* 关键:高度 = 视口高度的百分比可调整如60vh=屏幕高度60% */
margin-bottom:1.5rem;
/* max-height: 900px; */
min-height: 300px;
position: relative;
margin-top:60px;
}
/* 轮播项 - 填充容器高度 */
.auto-swiper-slide {
width: 100%;
/*height: 100%;*/
display: flex;
align-items: center;
justify-content: center;
}
/* 图片自适应核心:填充屏幕比例高度,保持比例 */
.auto-swiper-slide img {
width: 100%;
height: 100%;
object-fit: contain; /* 替换 cover 为 contain完整显示图片 */
display: block;
}
/* 轮播容器保持相对定位 */
.auto-swiper-container {
position: relative;
width: 100%;
}
/* 轮播容器保持相对定位 */
.auto-swiper-container {
position: relative;
width: 100%;
}
/* 指示标容器:居中排列 */
.swiper-pagination {
position: absolute;
bottom: 10%; /* 距离底部的距离,可调整 */
left: 50%;
transform: translateX(-50%);
/* width:100%;
display: flex; */
/* justify-content: center; */
z-index: 10;
}
/* 激活状态:白色长条 */
.swiper-pagination-bullet-active {
background:#fff !important;
}
/* 未激活状态:黑色透明圆点(可调整透明度) */
.swiper-pagination-bullet {
display: inline-block;
width: 16px !important;
height: 16px !important;
border-radius: 8px;
/*background: #555;*/
margin: 0 5px;
/*opacity: 0.8;*/
border: 1px solid #fff;
/*cursor: pointer;*/
}