模板:卡片/Cards.css:修订间差异

来自Hokubu Wiki
(目白光明Mejiro Bright移动页面模板:卡片/style.css模板:卡片/Card.css,不留重定向)
无编辑摘要
第1行: 第1行:
/* 首页网格布局 - 三列卡片 */
/* 首页网格布局 - 自适应卡片数量 */
.home-grid {
.home-grid {
   display: grid;
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
   gap: 20px;
   gap: 20px;
   padding: 20px;
   padding: 20px;
第9行: 第9行:
/* 活动卡片主体样式 */
/* 活动卡片主体样式 */
.home-card {
.home-card {
   overflow: visible;
   overflow: hidden;
  max-width: 400px;
  margin-bottom: 1.6rem;
   background: var(--color-surface-2);
   background: var(--color-surface-2);
   border: 1px solid var(--border-color-base); /* 基础边框 */
   border: 1px solid var(--border-color-base);
   border-radius: 15px; /* 15px边框圆角 */
   border-radius: 15px;
   box-shadow: var(--box-shadow-card);
   box-shadow: var(--box-shadow-card);
   font-size: 0.875rem;
   transition: all 0.3s ease;
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
}


.home-card:hover {
.home-card:hover {
   transform: translateY(-5px);
   transform: translateY(-5px);
   border-color: var(--color-primary); /* 悬停时边框变色 */
   border-color: var(--color-primary);
   box-shadow: 0 10px 20px rgba(0,0,0,0.1);
   box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
}
第30行: 第27行:
/* 卡片标题区域 */
/* 卡片标题区域 */
.home-card__header {
.home-card__header {
   width: 100%;
   margin: 0;
   margin-top: 20px;
   padding: 15px 20px;
   margin-bottom: 5px;
   background: var(--color-surface-3);
   color: var(--color-base--emphasized);
   border-bottom: 1px solid var(--border-color-base);
   font-size: 1.4rem;
   font-size: 1.2rem;
   line-height: 1.4;
   font-weight: bold;
  padding: 0 20px; /* 与15px边框匹配的内边距 */
}
}


第51行: 第47行:
   inset: 0;
   inset: 0;
   margin: 0;
   margin: 0;
   border-radius: 14px 14px 0 0; /* 图片区域圆角比卡片小1px,避免边框重叠 */
   border-radius: 0;
   overflow: hidden;
   overflow: hidden;
}
}


.home-card .transport-image img {
.home-card .transport-image img {
   display: block;
   width: 100%;
  max-width: 100%;
   height: 100%;
   height: 100%;
   object-fit: cover;
   object-fit: cover;
第70行: 第65行:
.home-card__text {
.home-card__text {
   margin: 0;
   margin: 0;
   padding: 0 20px 15px;
   padding: 15px 20px;
   line-height: 1.6;
   line-height: 1.6;
}
   flex-grow: 1;
 
/* 卡片数据行样式(模仿infobox-data) */
.home-card .data-row {
   display: flex;
  flex-direction: row;
  padding: 5px 20px;
  border-bottom: 1px solid var(--border-color-base); /* 数据行分隔线 */
}
 
.home-card .data-label {
  color: var(--color-base--subtle);
  font-size: 0.8125rem;
  font-weight: normal;
  letter-spacing: 0.75px;
  width: 30%;
}
 
.home-card .data-value {
  font-weight: 600;
  width: 70%;
}
}


/* 卡片按钮区域 */
/* 卡片按钮区域 */
.home-link {
.home-link {
   margin: 10px 20px 15px;
   margin: 0 20px 15px;
   text-align: center;
   text-align: center;
}
}
第108行: 第83行:
   border-radius: 8px;
   border-radius: 8px;
   text-decoration: none;
   text-decoration: none;
   transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
   transition: background 0.3s ease;
   font-weight: 600;
   font-weight: 600;
}
}
第116行: 第91行:
}
}


/* 响应式布局 - 小屏幕下自动调整为单列 */
/* 响应式布局调整 */
@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}
 
@media (max-width: 768px) {
@media (max-width: 768px) {
   .home-grid {
   .home-grid {
     grid-template-columns: 1fr;
     grid-template-columns: 1fr;
  }
  .home-card {
    max-width: 100%;
   }
   }
}
}

2025年6月18日 (三) 20:43的版本

/* 首页网格布局 - 自适应卡片数量 */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* 活动卡片主体样式 */
.home-card {
  overflow: hidden;
  background: var(--color-surface-2);
  border: 1px solid var(--border-color-base);
  border-radius: 15px;
  box-shadow: var(--box-shadow-card);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.home-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* 卡片标题区域 */
.home-card__header {
  margin: 0;
  padding: 15px 20px;
  background: var(--color-surface-3);
  border-bottom: 1px solid var(--border-color-base);
  font-size: 1.2rem;
  font-weight: bold;
}

/* 卡片图片容器 */
.home-card .transport-card {
  position: relative;
  height: 180px;
  margin: 0;
  border: none !important;
}

.home-card .transport-image {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

.home-card .transport-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0, 0.8, 0.2, 1);
}

.home-card .transport-image img:hover {
  transform: scale(1.1);
}

/* 卡片文本内容 */
.home-card__text {
  margin: 0;
  padding: 15px 20px;
  line-height: 1.6;
  flex-grow: 1;
}

/* 卡片按钮区域 */
.home-link {
  margin: 0 20px 15px;
  text-align: center;
}

.home-link__button {
  display: inline-block;
  padding: 8px 16px;
  background: var(--color-primary);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.3s ease;
  font-weight: 600;
}

.home-link__button:hover {
  background: var(--color-primary--hover);
}

/* 响应式布局调整 */
@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}