From 691b17428703b4ef8bbcd285d7c225fdf6dd8879 Mon Sep 17 00:00:00 2001 From: imeepos Date: Wed, 3 Sep 2025 19:15:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E4=B8=8A=E6=96=B9=E7=A9=BA=E7=99=BD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit � 问题修复: - 减少积分徽章上边距:top: 20px → 12px - 优化内边距:padding: 4px 8px → 3px 6px - 调整圆角大小:border-radius: 12px → 10px � 布局优化: - 添加flexbox布局:display: flex, align-items: center, justify-content: center - 设置最小高度:min-height: 18px,确保徽章有合适高度 - 重置行高:line-height: 1,消除默认行高空白 � 文字样式: - 重置文字外边距和内边距:margin: 0, padding: 0 - 设置行高为1,消除文字上下空白 - 使用block显示确保文字正确渲染 ✅ 修复效果: - 积分徽章紧贴图片右上角,无多余空白 - 文字在徽章中完美居中显示 - 整体视觉更加紧凑和专业 --- src/components/TemplateCard/index.css | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/TemplateCard/index.css b/src/components/TemplateCard/index.css index 16cfa81..5950851 100644 --- a/src/components/TemplateCard/index.css +++ b/src/components/TemplateCard/index.css @@ -122,15 +122,20 @@ /* 积分悬浮徽章 - 图片右上角 */ .credit-badge { position: absolute; - top: 20px; + top: 12px; right: 12px; z-index: 4; background: rgba(255, 107, 53, 0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); - border-radius: 12px; - padding: 4px 8px; + border-radius: 10px; + padding: 3px 6px; box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3); + display: flex; + align-items: center; + justify-content: center; + min-height: 18px; + line-height: 1; } .credit-text { @@ -138,6 +143,10 @@ font-size: 11px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); + margin: 0; + padding: 0; + line-height: 1; + display: block; } /* 标签悬浮 - 图片底部 */