All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s
1040 lines
19 KiB
CSS
1040 lines
19 KiB
CSS
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
font-family: '微软雅黑', sans-serif;
|
||
}
|
||
|
||
body {
|
||
overflow-x: hidden;
|
||
|
||
}
|
||
|
||
a {
|
||
text-decoration: none;
|
||
}
|
||
.header {
|
||
position: fixed;
|
||
top:0;
|
||
z-index: 999;
|
||
max-width: 1920px;
|
||
width: 100%;
|
||
background: #fff;
|
||
font-size: 16px;
|
||
box-sizing: border-box;
|
||
height: 64px;
|
||
}
|
||
/* 导航外容器:1920px宽,居中 */
|
||
.header-nav-outer {
|
||
max-width: 1920px;
|
||
position: relative;
|
||
padding: 0 12.5em;
|
||
overflow: visible;
|
||
height: 64px;
|
||
background: #fff;
|
||
display: flex;
|
||
align-items: center;
|
||
/* margin: 0 auto; */
|
||
}
|
||
|
||
/* 顶部导航栏:内容区带左右边距,外框1920px */
|
||
.header-nav-bar {
|
||
width: 100%;
|
||
max-width: 1520px;
|
||
height: 4em;
|
||
display: flex;
|
||
align-items: center;
|
||
flex-wrap: nowrap;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.header-log {
|
||
width: 6.9375em;
|
||
height: 1.75em;
|
||
margin-right: 9.125em;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.header-nav-items {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
height: 100%;
|
||
flex-wrap: nowrap;
|
||
flex: 1;
|
||
min-width: 0;
|
||
margin-right: 5.125em;
|
||
}
|
||
|
||
.header-nav-item {
|
||
height: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
cursor: pointer;
|
||
color: #1d1d1f;
|
||
flex-shrink: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.header-nav-title {
|
||
position: relative;
|
||
height: 100%;
|
||
font-size: 1em;
|
||
display: flex;
|
||
align-items: center;
|
||
flex-wrap: nowrap;
|
||
white-space: nowrap;
|
||
padding: 0 0.3em;
|
||
}
|
||
|
||
/* 导航项下划线 */
|
||
.header-nav-title::after {
|
||
content: '';
|
||
position: absolute;
|
||
bottom: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 0.125em;
|
||
background-color: #004bfa;
|
||
transform: scaleX(0);
|
||
transition: transform 0.2s ease;
|
||
}
|
||
|
||
.header-nav-title:hover::after,
|
||
.header-nav-title.active::after {
|
||
transform: scaleX(1);
|
||
}
|
||
|
||
.header-nav-title.active {
|
||
color: #004bfa;
|
||
}
|
||
|
||
/* 右侧功能按钮 */
|
||
.header-nav-actions {
|
||
margin-left: auto;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 2em;
|
||
position: relative;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
/* 搜索按钮容器 */
|
||
.header-search-wrapper {
|
||
position: relative;
|
||
display: inline-block;
|
||
}
|
||
|
||
/* 语言按钮容器 */
|
||
.header-lang-wrapper {
|
||
position: relative;
|
||
display: inline-block;
|
||
}
|
||
|
||
/* 购买按钮容器 */
|
||
.header-buy-wrapper {
|
||
position: relative;
|
||
display: inline-block;
|
||
}
|
||
|
||
.header-nav-btn {
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
transition: color 0.2s;
|
||
}
|
||
|
||
/* .header-nav-btn img {
|
||
width: 1.5em;
|
||
max-width: 17px;
|
||
max-height: 17px;
|
||
height: 1.5em;
|
||
} */
|
||
|
||
.header-nav-btn:hover {
|
||
color: #004bfa;
|
||
}
|
||
|
||
.header-buy-btn {
|
||
background-color:#004bfa;
|
||
color: #fff;
|
||
padding: 0.375em 1.125em;
|
||
border-radius: 1.25em;
|
||
border: none;
|
||
cursor: pointer;
|
||
font-size: 1em;
|
||
white-space: nowrap;
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
}
|
||
|
||
/* ========== 响应式设计 - 整体缩放,保持比例 ========== */
|
||
|
||
/* 1920px 及以上 - 100% */
|
||
@media screen and (min-width: 1920px) {
|
||
.header {
|
||
font-size: 16px;
|
||
}
|
||
}
|
||
|
||
/* 1680px - 1919px - 缩放至 93.75% */
|
||
@media screen and (max-width: 1919px) and (min-width: 1680px) {
|
||
.header {
|
||
font-size: 15px;
|
||
}
|
||
}
|
||
|
||
/* 1600px - 1679px - 缩放至 90.625% */
|
||
@media screen and (max-width: 1679px) and (min-width: 1600px) {
|
||
.header {
|
||
font-size: 14.5px;
|
||
}
|
||
}
|
||
|
||
/* 1520px - 1599px - 缩放至 87.5% */
|
||
@media screen and (max-width: 1599px) and (min-width: 1520px) {
|
||
.header {
|
||
font-size: 14px;
|
||
}
|
||
}
|
||
|
||
/* 1440px - 1519px - 缩放至 84.375% */
|
||
@media screen and (max-width: 1519px) and (min-width: 1440px) {
|
||
.header {
|
||
font-size: 13.5px;
|
||
}
|
||
}
|
||
|
||
/* 1360px - 1439px - 缩放至 81.25% */
|
||
@media screen and (max-width: 1439px) and (min-width: 1360px) {
|
||
.header {
|
||
font-size: 13px;
|
||
}
|
||
}
|
||
|
||
/* 1280px - 1359px - 缩放至 78.125% */
|
||
@media screen and (max-width: 1359px) and (min-width: 1280px) {
|
||
.header {
|
||
font-size: 12.5px;
|
||
}
|
||
}
|
||
|
||
/* 1200px - 1279px - 缩放至 75% */
|
||
@media screen and (max-width: 1279px) and (min-width: 1200px) {
|
||
.header {
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
/* 1140px - 1199px - 缩放至 75% (保持最小12px) */
|
||
@media screen and (max-width: 1199px) and (min-width: 1140px) {
|
||
.header {
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
/* 1080px - 1139px - 缩放至 75% (保持最小12px) */
|
||
@media screen and (max-width: 1139px) and (min-width: 1080px) {
|
||
.header {
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
/* 992px - 1079px - 缩放至 75% (保持最小12px) */
|
||
@media screen and (max-width: 1079px) and (min-width: 992px) {
|
||
.header {
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
/* 小于992px - 保持最小12px */
|
||
@media screen and (max-width: 991px) {
|
||
.header {
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
/* ========== 以下为原有样式,保持不变 ========== */
|
||
|
||
/* 原有的下拉框样式 */
|
||
.header-dropdown {
|
||
box-sizing: border-box;
|
||
max-width: 1920px;
|
||
width: 100%;
|
||
position: absolute;
|
||
top: 4em;
|
||
left: 0;
|
||
right: 0;
|
||
background-color: #fafafb;
|
||
z-index: 199;
|
||
border-top: none;
|
||
overflow: hidden;
|
||
padding-bottom: 2.375em;
|
||
display: none;
|
||
}
|
||
|
||
.header-nav-item:hover .header-dropdown {
|
||
display: block;
|
||
}
|
||
|
||
/* Tabs切换栏:居中,宽度100%(基于下拉框内容区) */
|
||
.header-dropdown-tabs {
|
||
display: flex;
|
||
justify-content: center;
|
||
margin: 0 auto;
|
||
padding-bottom: 1.75em;
|
||
padding-top: 1.75em;
|
||
width: calc(100% - 2.5em);
|
||
}
|
||
|
||
.header-tab-item:last-child {
|
||
margin-right: 0;
|
||
}
|
||
|
||
.header-tab-item {
|
||
font-size: 1em;
|
||
color: #1d1d1f;
|
||
cursor: pointer;
|
||
position: relative;
|
||
margin-right: 9.375em;
|
||
}
|
||
|
||
.header-tab-item.active::after {
|
||
content: '';
|
||
position: absolute;
|
||
bottom: -0.6875em;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 0.125em;
|
||
background-color: #004bfa;
|
||
}
|
||
|
||
/* 下拉框内容容器:宽度100%,左右留20px边距 */
|
||
.header-dropdown-content {
|
||
width: 100%;
|
||
min-width: 1080px;
|
||
padding: 0 12.5em;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
box-sizing: border-box;
|
||
align-items: flex-start;
|
||
}
|
||
|
||
/* 左侧6个分类区块 */
|
||
.header-dropdown-category {
|
||
/* display: flex;
|
||
flex-wrap: wrap;
|
||
flex-direction: column;
|
||
flex: 1; */
|
||
flex: 1;
|
||
|
||
}
|
||
|
||
.header-category-box {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
margin-top:1.7em;
|
||
}
|
||
.header-category-box:nth-child(1) {
|
||
margin-top: 0;
|
||
}
|
||
/* 单个分类区块 */
|
||
.header-category-block {
|
||
flex: 1;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* .header-category-block:nth-child(5) {
|
||
margin-bottom: 0;
|
||
}
|
||
|
||
.header-category-block:nth-child(6) {
|
||
margin-bottom: 0;
|
||
} */
|
||
|
||
.header-category-title {
|
||
font-size: 1em;
|
||
color: #1d1d1f;
|
||
margin-bottom: 0.75em;
|
||
font-weight: 900;
|
||
}
|
||
|
||
.header-category-list {
|
||
list-style: none;
|
||
}
|
||
|
||
.header-category-item {
|
||
font-size: 0.875em;
|
||
color: #686a70;
|
||
margin-bottom: 0.71em;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.header-category-item a {
|
||
color: #686a70;
|
||
}
|
||
|
||
.header-category-item:last-child {
|
||
margin: 0;
|
||
}
|
||
|
||
.header-category-item a:hover {
|
||
color: #0066ff;
|
||
}
|
||
|
||
/* 右侧产品展示区:自适应剩余宽度,无溢出 */
|
||
/* .header-dropdown-products {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: flex-end;
|
||
max-width: 46.75em;
|
||
} */
|
||
|
||
|
||
.header-dropdown-products {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: space-between;
|
||
flex: 1;
|
||
min-width: 0;
|
||
gap: 1.5em 0;
|
||
}
|
||
|
||
|
||
|
||
.header-product-card {
|
||
text-align: center;
|
||
width: calc(50% - 0.75em);
|
||
max-width: 22.625em;
|
||
flex-shrink: 1;
|
||
min-width: 260px;
|
||
transition: transform 0.2s ease;
|
||
}
|
||
|
||
|
||
.header-product-card-1 {
|
||
text-align: center;
|
||
width: 100%;
|
||
max-width: 22.625em;
|
||
|
||
}
|
||
|
||
.header-product-card:hover {
|
||
transform: translateY(-2px)
|
||
}
|
||
|
||
.header-product-card-1:hover {
|
||
transform: translateY(-2px)
|
||
}
|
||
|
||
.header-product-card:nth-child(1) {
|
||
margin-right: 1.5em;
|
||
}
|
||
|
||
.header-product-card:nth-child(3) {
|
||
margin-right: 1.5em;
|
||
margin-top: 1.4375em;
|
||
}
|
||
|
||
.header-product-card:nth-child(4) {
|
||
margin-top: 1.4375em;
|
||
}
|
||
|
||
/*.header-product-img {*/
|
||
/* width: 22.625em;*/
|
||
/* height: 12.25em;*/
|
||
/* background-color: #f5f5f5;*/
|
||
/* display: flex;*/
|
||
/* align-items: center;*/
|
||
/* justify-content: center;*/
|
||
/* color: #999;*/
|
||
/*}*/
|
||
|
||
/*.header-product-img img {*/
|
||
/* width: 22.625em;*/
|
||
/* height: 12.25em;*/
|
||
/*}*/
|
||
.header-product-img {
|
||
width: 100%;
|
||
aspect-ratio: 22.625 / 12.25;
|
||
background-color: #f5f5f5;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #999;
|
||
overflow: hidden;
|
||
border-radius: 0.5em;
|
||
}
|
||
|
||
.header-product-img img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
display: block;
|
||
}
|
||
.header-product-name {
|
||
font-size: 1em;
|
||
color: #1d1d1f;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
/* 修改 .dropdown-content1 的样式 - 卡片居中对齐 */
|
||
.header-dropdown-content1 {
|
||
width: 100%;
|
||
min-width: 1080px;
|
||
padding: 3.4em 12.5em;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: center;
|
||
gap: 3.4em 1.875em;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* 修改 .product-card-1 的样式 - 设置宽度,确保一行最多4个 */
|
||
.header-product-card-1 {
|
||
width: calc(25% - 1.40625em);
|
||
/* background: #fff; */
|
||
border-radius: 0.5em;
|
||
max-width: 362px;
|
||
flex-shrink: 0;
|
||
|
||
}
|
||
|
||
/* 如果需要更好的兼容性,用 padding 技巧替代 aspect-ratio */
|
||
.header-product-img-1 {
|
||
background-color: #f5f5f5;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #999;
|
||
width: 100%;
|
||
position: relative;
|
||
padding-bottom: 53%;
|
||
height: 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
/* 图片样式 - 确保图片正确显示 */
|
||
.header-product-img-1 img {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
display: block;
|
||
}
|
||
|
||
/* 内容区域自适应 */
|
||
.header-product-title-1 {
|
||
font-weight: 900;
|
||
font-size: 1em;
|
||
color: #1d1d1f;
|
||
text-align: left;
|
||
margin-top: 1.125em;
|
||
padding: 0 0.5em;
|
||
word-break: break-word;
|
||
}
|
||
|
||
.header-product-name-1 {
|
||
font-size: 1em;
|
||
color: #686a70;
|
||
text-align: left;
|
||
margin-top: 0.25em;
|
||
margin-bottom: 1.0625em;
|
||
padding: 0 0.5em;
|
||
word-break: break-word;
|
||
}
|
||
|
||
/* 隐藏非当前选中的Tabs内容 */
|
||
.header-tab-content {
|
||
display: none;
|
||
}
|
||
|
||
.header-tab-content.active {
|
||
display: flex;
|
||
}
|
||
|
||
/* ========== 搜索下拉框样式 ========== */
|
||
.header-search-dropdown {
|
||
position: absolute;
|
||
top: 100%;
|
||
right: 0;
|
||
margin-top: 0.75em;
|
||
background: #ffffff;
|
||
border-radius: 0.75em;
|
||
box-shadow: 0 0.5em 1.5em rgba(0, 0, 0, 0.12);
|
||
width: 26em;
|
||
padding: 1.5em;
|
||
z-index: 1000;
|
||
display: none;
|
||
animation: fadeIn 0.2s ease;
|
||
}
|
||
|
||
.header-search-dropdown.show {
|
||
display: block;
|
||
}
|
||
|
||
.header-search-input-wrapper {
|
||
display: flex;
|
||
gap: 0.625em;
|
||
border: 1px solid #e5e7eb;
|
||
border-radius: 2em;
|
||
padding: 0.5em 1em;
|
||
background: #f9fafb;
|
||
margin-bottom: 1em;
|
||
}
|
||
|
||
.header-search-input {
|
||
flex: 1;
|
||
border: none;
|
||
outline: none;
|
||
background: transparent;
|
||
font-size: 0.875em;
|
||
color: #1d1d1f;
|
||
}
|
||
|
||
.header-search-input::placeholder {
|
||
color: #9ca3af;
|
||
}
|
||
|
||
.header-search-submit {
|
||
background: #004bfa;
|
||
color: white;
|
||
border: none;
|
||
padding: 0.375em 1em;
|
||
border-radius: 1.5em;
|
||
cursor: pointer;
|
||
font-size: 0.8125em;
|
||
transition: background 0.2s;
|
||
}
|
||
|
||
.header-search-submit:hover {
|
||
background: #0039cc;
|
||
}
|
||
|
||
/* 搜索记录区域 */
|
||
.header-search-history {
|
||
margin-bottom: 1.25em;
|
||
}
|
||
|
||
.header-history-title {
|
||
font-size: 1em;
|
||
color: #9ca3af;
|
||
margin-bottom: 0.625em;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.header-clear-history {
|
||
color: #004bfa;
|
||
cursor: pointer;
|
||
font-size: 14px;
|
||
padding: 0.2em 0.5em;
|
||
border-radius: 0.25em;
|
||
transition: background 0.2s;
|
||
}
|
||
|
||
.header-clear-history:hover {
|
||
background: #f0f7ff;
|
||
}
|
||
|
||
.header-history-list {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 0.5em;
|
||
}
|
||
|
||
.header-history-item {
|
||
font-size: 0.8125em;
|
||
color: #1d1d1f;
|
||
cursor: pointer;
|
||
padding: 0.25em 0.625em;
|
||
background: #f3f4f6;
|
||
border-radius: 1em;
|
||
transition: all 0.2s;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.25em;
|
||
}
|
||
|
||
.header-history-item:hover {
|
||
background: #004bfa;
|
||
color: white;
|
||
}
|
||
|
||
.header-history-item .header-delete-icon {
|
||
font-size: 0.875em;
|
||
opacity: 0;
|
||
transition: opacity 0.2s;
|
||
}
|
||
|
||
.header-history-item:hover .header-delete-icon {
|
||
opacity: 1;
|
||
}
|
||
|
||
/* 热销产品区域 - 使用flex-wrap,一行最多3个,超过自动换行 */
|
||
.header-hot-products {
|
||
border-top: 1px solid #f0f0f0;
|
||
padding-top: 0.75em;
|
||
}
|
||
|
||
.header-hot-title {
|
||
font-size: 1em;
|
||
color: #9ca3af;
|
||
margin-bottom: 0.75em;
|
||
}
|
||
|
||
.header-hot-product-list {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 1.5em;
|
||
margin: 0;
|
||
padding: 0;
|
||
}
|
||
|
||
.header-hot-product-item {
|
||
flex: 0 0 calc(33.333% - 1em);
|
||
min-width: 0;
|
||
cursor: pointer;
|
||
text-align: center;
|
||
transition: transform 0.2s;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.header-hot-product-item:hover {
|
||
transform: translateY(-2px);
|
||
}
|
||
|
||
.header-hot-product-img {
|
||
width: 7.1875em;
|
||
height: 7.1875em;
|
||
max-width: 115px;
|
||
max-height: 115px;
|
||
background: linear-gradient(135deg, #f5f7fc 0%, #eef2f8 100%);
|
||
border-radius: 0.5em;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin: 0 auto 0.5em auto;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.header-hot-product-img img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
display: block;
|
||
}
|
||
|
||
.header-hot-product-img .emoji {
|
||
font-size: 2.5em;
|
||
}
|
||
|
||
.header-hot-product-name {
|
||
font-size: 0.8125em;
|
||
color: #1d1d1f;
|
||
font-weight: 500;
|
||
line-height: 1.4;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* 语言下拉框样式 */
|
||
.header-lang-dropdown {
|
||
position: absolute;
|
||
top: 100%;
|
||
right: 0;
|
||
margin-top: 0.75em;
|
||
background: #ffffff;
|
||
border-radius: 0.75em;
|
||
box-shadow: 0 0.5em 1.5em rgba(0, 0, 0, 0.12);
|
||
min-width: 12em;
|
||
padding: 1.5em 0;
|
||
z-index: 1000;
|
||
display: none;
|
||
animation: fadeIn 0.2s ease;
|
||
}
|
||
|
||
.header-lang-dropdown.show {
|
||
display: block;
|
||
}
|
||
|
||
.header-lang-item {
|
||
display: block;
|
||
padding: 0.75em 1.25em;
|
||
cursor: pointer;
|
||
transition: background 0.2s;
|
||
width: 100%;
|
||
font-size: 0.875em;
|
||
color: #1d1d1f;
|
||
text-decoration: none;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.625em;
|
||
}
|
||
|
||
.header-lang-item:hover {
|
||
background: #f3f4f6;
|
||
color: #004bfa;
|
||
}
|
||
|
||
.header-lang-item.active {
|
||
color: #004bfa;
|
||
background: #f0f7ff;
|
||
}
|
||
|
||
.header-lang-code {
|
||
font-weight: 500;
|
||
min-width: 2.5em;
|
||
white-space:nowrap;
|
||
}
|
||
|
||
.header-lang-name {
|
||
flex: 1;
|
||
}
|
||
.header-lang-name-en {
|
||
flex: 1;
|
||
min-width: 126px;
|
||
}
|
||
.header-lang-dropdown-delete-icon,
|
||
.header-search-dropdown-delete-icon {
|
||
font-size: 12px;
|
||
position: absolute;
|
||
top: 10px;
|
||
right: 14px;
|
||
cursor: pointer;
|
||
|
||
}
|
||
|
||
/* ========== 购买下拉框样式 ========== */
|
||
.header-buy-dropdown {
|
||
box-sizing: border-box;
|
||
max-width: 1920px;
|
||
width: 100%;
|
||
position: absolute;
|
||
top: 3.75em;
|
||
left: 0;
|
||
right: 0;
|
||
background-color: #fafafb;
|
||
z-index: 999;
|
||
border-top: none;
|
||
overflow: visible;
|
||
display: none;
|
||
padding: 3.5em 12.5em;
|
||
}
|
||
|
||
.header-buy-dropdown.show {
|
||
display: block;
|
||
}
|
||
|
||
/* 购买下拉框内容容器 - 居中显示,固定一行7个卡片 */
|
||
.header-buy-dropdown-content {
|
||
width: 100%;
|
||
max-width: 1520px;
|
||
margin: 0 auto;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
justify-content: center;
|
||
box-sizing: border-box;
|
||
row-gap: 121px;
|
||
}
|
||
|
||
/* 购买产品卡片:宽度96px,右边距动态计算 */
|
||
.header-buy-product-card {
|
||
width: 96px;
|
||
text-align: center;
|
||
cursor: pointer;
|
||
margin-right: calc((100% - (96px * 7)) / 6);
|
||
|
||
}
|
||
|
||
.header-buy-product-card:hover {
|
||
transform: translateY(-2px)
|
||
}
|
||
|
||
/* 每行第7个卡片(一行最后一个)清除右边距 */
|
||
.header-buy-product-card:nth-child(7n) {
|
||
margin-right: 0;
|
||
}
|
||
|
||
.header-buy-product-card a {
|
||
text-decoration: none;
|
||
display: block;
|
||
}
|
||
|
||
/* 图片容器:宽度100%,高度自适应,保持正方形比例 */
|
||
.header-buy-product-img {
|
||
width: 100%;
|
||
aspect-ratio: 1 / 1;
|
||
background-color: #f5f5f5;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
overflow: hidden;
|
||
border-radius: 0.5em;
|
||
position: relative;
|
||
}
|
||
|
||
/* 图片样式:实现悬浮切换效果,完全填充容器 */
|
||
.header-buy-product-img img {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
display: block;
|
||
transition: opacity 0.2s ease;
|
||
}
|
||
|
||
/* 默认显示普通图,隐藏悬浮图 */
|
||
.header-buy-product-img .header-default-img {
|
||
opacity: 1;
|
||
}
|
||
|
||
.header-buy-product-img .header-hover-img {
|
||
opacity: 0;
|
||
}
|
||
|
||
/* 鼠标悬停时:显示悬浮图,隐藏普通图 */
|
||
/* .header-buy-product-card:hover .header-buy-product-img .header-default-img {
|
||
opacity: 0;
|
||
}
|
||
|
||
.header-buy-product-card:hover .header-buy-product-img .header-hover-img {
|
||
opacity: 1;
|
||
} */
|
||
|
||
/* 产品标题样式:不加粗,字体大小16px,超出一行显示省略号 */
|
||
.header-buy-product-title {
|
||
font-weight: normal;
|
||
font-size: 1em;
|
||
color: #1d1d1f;
|
||
text-align: center;
|
||
margin-top: 0.75em;
|
||
word-break: break-word;
|
||
line-height: 1.4;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
display: -webkit-box;
|
||
-webkit-line-clamp: 1;
|
||
-webkit-box-orient: vertical;
|
||
white-space: normal;
|
||
}
|
||
|
||
/* 动画 */
|
||
@keyframes fadeIn {
|
||
from {
|
||
opacity: 0;
|
||
transform: translateY(-0.5em);
|
||
}
|
||
|
||
to {
|
||
opacity: 1;
|
||
transform: translateY(0);
|
||
}
|
||
}
|
||
|
||
/* 1280px及以下屏幕,渐进式调整间距 */
|
||
@media screen and (max-width: 1280px) {
|
||
.header-log {
|
||
margin-right: 2em;
|
||
}
|
||
|
||
.header-nav-items {
|
||
margin-right: 1em;
|
||
}
|
||
|
||
.header-nav-outer {
|
||
padding: 0 12em;
|
||
}
|
||
|
||
.header-dropdown-content {
|
||
padding: 0 12em;
|
||
}
|
||
|
||
.header-dropdown-content1 {
|
||
padding: 0 12em;
|
||
}
|
||
|
||
.header-buy-dropdown {
|
||
padding: 3.5em 12em;
|
||
}
|
||
|
||
.header-buy-dropdown-content {
|
||
max-width: 1200px;
|
||
row-gap: 100px;
|
||
}
|
||
}
|
||
|
||
/* 1152px及以下,进一步缩小 */
|
||
@media screen and (max-width: 1152px) {
|
||
.header-log {
|
||
margin-right: 1em;
|
||
}
|
||
|
||
.header-nav-outer {
|
||
padding: 0 10em;
|
||
}
|
||
|
||
.header-dropdown-content {
|
||
padding: 0 10em;
|
||
}
|
||
|
||
.header-dropdown-content1 {
|
||
padding: 0 10em;
|
||
}
|
||
|
||
.header-buy-dropdown {
|
||
padding: 3.5em 10em;
|
||
}
|
||
|
||
.buy-dropdown-content {
|
||
max-width: 1080px;
|
||
row-gap: 80px;
|
||
}
|
||
}
|
||
|
||
/* 1080px及以下,最小间距 */
|
||
@media screen and (max-width: 1080px) {
|
||
.header-log {
|
||
margin-right: 1em;
|
||
}
|
||
|
||
.header-nav-outer {
|
||
padding: 0 8em;
|
||
}
|
||
|
||
.header-dropdown-content {
|
||
padding: 0 8em;
|
||
}
|
||
|
||
.header-dropdown-content1 {
|
||
padding: 0 8em;
|
||
}
|
||
|
||
.header-buy-dropdown {
|
||
padding: 3.5em 8em;
|
||
}
|
||
|
||
.header-buy-dropdown-content {
|
||
max-width: 1000px;
|
||
row-gap: 60px;
|
||
}
|
||
}
|
||
#mhk {
|
||
width: 100%;
|
||
height: 100%;
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
backdrop-filter: blur(5px);
|
||
background-color: rgba(0, 0, 0, 0.5);
|
||
z-index: 88;
|
||
display: none;
|
||
}
|