/* ============================================================
   推荐字体页专属样式（font_** 前缀，与色卡页样式隔离）
   依赖：style.css（站点外壳：site-shell / site-sidebar / site-main / site-aside / site-footer / crumbs 等）
   说明：纯静态预览页，无复制 / 无搜索功能。
   ============================================================ */

/* 标题区 */
.font-head {
  margin: 18px 0 4px;
}
.font-head h1 {
  font-size: 26px;
  font-weight: 700;
  color: #1f2430;
  margin: 0 0 6px;
}
.font-tip {
  color: #5b6172;
  font-size: 14px;
  margin: 0 0 16px;
}

/* 卡片网格：默认 4 列，与色卡页一致 */
.font-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 6px 0 24px;
}
@media (max-width: 1180px) {
  .font-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .font-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 卡片本体：整卡即链接，点击新开 */
.font-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 8px solid #f8f8f8;
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.font-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(54, 76, 198, .16);
  border-color: #eceefe;
}

/* 预览区：展示该字体的字样（背景 #DFDFDF，字体高级灰） */
.font-swatch {
  height: 156px;
  background: #DFDFDF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  color: #6b6b6b;
  overflow: hidden;
}
.font-sample {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: #6b6b6b;
  word-break: break-all;
  max-width: 100%;
}

/* 信息区 */
.font-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
}
.font-name {
  font-size: 15px;
  font-weight: 600;
  color: #1f2430;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 原 color-hex 位置：这里显示「免费商用」徽标 */
.font-hex {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #ffd55d;
  background: #364cc6;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
/* 付费 / 需授权徽标（区别于免费蓝黄） */
.font-hex.is-paid {
  background: #8a8f9c;
  color: #fff;
}

/* 字体简介（参考站 item-desc） */
.font-desc {
  padding: 0 14px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #5b6172;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 分类子菜单（复用主站 .cat-tabs 的黄色下划线高亮，小屏自动换行） */
.font-cat-tabs {
  flex-wrap: wrap;
  row-gap: 10px;
}

/* ============================================================
   图片字体卡（参考 qijishow，仿 .font-card 版式；首页与分类页共用）
   与首页 index.html 内联样式保持一致。
   ============================================================ */
.fcard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 6px;
}
.fcard {
  display: flex;
  flex-direction: column;
  height: 210px;
  background: #fff;
  border: 8px solid #f8f8f8;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.fcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(54, 76, 198, .16);
  border-color: #eceefe;
}
.fcard-thumb {
  background: #efefef;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fcard-thumb img {
  max-width: 82%;
  max-height: 82%;
  object-fit: contain;
  transition: transform .25s ease;
}
.fcard:hover .fcard-thumb img {
  transform: scale(1.04);
}
.fcard-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 17px;
}
.fcard-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fcard:hover .fcard-name {
  color: #364cc6;
}
.fcard-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  color: #6b6b6b;
  background: #efefef;
  border-radius: 999px;
  padding: 2px 9px;
}
@media (max-width: 1200px) {
  .fcard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .fcard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .fcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 380px) {
  .fcard-grid { grid-template-columns: 1fr; }
}
