/* 基础重置 */
* {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
li,
pre,
code,
p,
img,
form,
input,
select,
textarea,
button {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  line-height: 1.6;
  background: #f8f9fa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 容器 */
.container {
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 20px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 1000;
}

.site_header_placeholder {
  height: 64px;
}

nav.navbar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

nav.navbar .navbar-brand img {
  max-height: 40px;
  width: auto;
}

/* 主内容区 */
.main {
  min-height: calc(100vh - 64px);
  padding: 40px 0 60px;
}

.site_body {
  position: relative;
}

/* 顶部横幅区域 */
.site_hero {
  text-align: center;
  padding: 40px 0 50px;
  margin-bottom: 40px;
}

.site_title {
  font-size: 42px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.site_subtitle {
  font-size: 18px;
  color: #666;
  margin-bottom: 24px;
}

.site_stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 15px;
  color: #666;
}

.stats_item strong {
  color: #ffd600;
  font-weight: 600;
  margin-right: 4px;
}

.stats_divider {
  color: #ddd;
}

/* 搜索和筛选区域 */
.site_search_section {
  margin-bottom: 40px;
}

.search_box_wrapper {
  margin-bottom: 24px;
}

.site_font_previewer {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.site_font_previewer input {
  width: 100%;
  height: 52px;
  padding: 0 140px 0 20px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 26px;
  font-size: 15px;
  color: #1a1a1a;
  transition: all 0.3s ease;
  outline: none;
}

.site_font_previewer input:focus {
  border-color: #ffd600;
  box-shadow: 0 0 0 4px rgba(255, 214, 0, 0.1);
}

.site_font_previewer input::placeholder {
  color: #9ca3af;
}

.search_btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 44px;
  padding: 0 20px;
  background: #ffd600;
  border: none;
  border-radius: 22px;
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.search_btn:hover {
  background: #ffed4e;
  transform: translateY(-50%) scale(1.02);
}

.search_btn svg {
  width: 18px;
  height: 18px;
}

/* 分类筛选 */
.site_filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.filter_label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.filter_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter_tag {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 14px;
  color: #666;
  transition: all 0.2s ease;
  display: inline-block;
}

.filter_tag:hover {
  border-color: #ffd600;
  color: #1a1a1a;
  background: #fffef5;
}

.filter_tag.active {
  background: #ffd600;
  border-color: #ffd600;
  color: #1a1a1a;
  font-weight: 500;
}

/* 字体网格布局 */
.site_content {
  margin-bottom: 40px;
}

.font_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* 字体卡片 */
.font_card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.font_card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.font_card_image {
  position: relative;
  width: 100%;
  padding-top: 45%;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #f1f3f5 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f0f0f0;
}

.font_card_image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.02) 2px,
      rgba(0, 0, 0, 0.02) 4px
    );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.font_card_image a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.font_card_image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: contrast(1.02) saturate(1.05);
  max-width: 100%;
  max-height: 100%;
}

.font_card:hover .font_card_image img {
  transform: scale(1.06);
  filter: contrast(1.05) saturate(1.1) brightness(1.02);
}

.font_card:hover .font_card_image::after {
  opacity: 1;
}

/* 图片加载状态 */
.font_card_image img[loading='lazy'] {
  opacity: 0;
  animation: fadeInImage 0.5s ease-in-out forwards;
}

@keyframes fadeInImage {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.font_card_overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.font_card:hover .font_card_overlay {
  opacity: 1;
}

.download_btn {
  padding: 12px 24px;
  background: #ffd600;
  color: #1a1a1a;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.download_btn:hover {
  background: #ffed4e;
  transform: scale(1.05);
}

.download_btn svg {
  width: 18px;
  height: 18px;
}

.font_card_info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.font_card_name {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.4;
}

.font_card_name a:hover {
  color: #ffd600;
}

.font_card_meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #666;
  margin-top: auto;
}

.font_category {
  padding: 4px 12px;
  background: #f3f4f6;
  border-radius: 12px;
  color: #666;
  transition: all 0.2s ease;
}

.font_category:hover {
  background: #ffd600;
  color: #1a1a1a;
}

.font_views {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #9ca3af;
}

.font_views svg {
  width: 14px;
  height: 14px;
}

/* 空状态 */
.empty_state {
  text-align: center;
  padding: 80px 20px;
}

.empty_icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  color: #d1d5db;
}

.empty_icon svg {
  width: 100%;
  height: 100%;
}

.empty_title {
  font-size: 24px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.empty_text {
  font-size: 15px;
  color: #6b7280;
}

/* 分页器 */
.site_paginator {
  margin-top: 60px;
  padding: 40px 0;
}

.pagination_nav {
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.page-item {
  display: inline-block;
}

.page-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #666;
  font-size: 14px;
  transition: all 0.2s ease;
  min-height: 40px;
}

.page-link:hover:not(.disabled) {
  border-color: #ffd600;
  color: #1a1a1a;
  background: #fffef5;
}

.page-item.active .page-link {
  background: #ffd600;
  border-color: #ffd600;
  color: #1a1a1a;
  font-weight: 500;
}

.page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9fafb;
}

.page-link svg {
  width: 16px;
  height: 16px;
}

/* Footer */
div.site_footer {
  width: 100%;
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: #9ca3af;
  padding: 60px 0 0;
  margin-top: 80px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

div.site_footer>div.site_footer_container {
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 20px;
}

div.site_footer>div.site_footer_container>div.site_footer_main {
  padding: 0;
}

.footer_content {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer_section {
  display: flex;
  flex-direction: column;
}

.footer_brand {
  max-width: 400px;
}

.footer_title {
  padding-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer_title a {
  color: #ffd600;
  font-size: 24px;
  transition: transform 0.2s ease;
}

.footer_title a:hover {
  transform: scale(1.1);
}

.footer_description {
  font-size: 14px;
  color: #9ca3af;
  line-height: 1.6;
  margin: 0;
}

.footer_section_title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 214, 0, 0.2);
}

.footer_link_list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer_link_list li {
  font-size: 14px;
  line-height: 1.6;
}

.footer_link_list a {
  color: #9ca3af;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-left: 0;
}

.footer_link_list a::before {
  content: '';
  position: absolute;
  left: -12px;
  width: 0;
  height: 2px;
  background: #ffd600;
  transition: width 0.2s ease;
  top: 50%;
  transform: translateY(-50%);
}

.footer_link_list a:hover {
  color: #ffd600;
  padding-left: 12px;
}

.footer_link_list a:hover::before {
  width: 6px;
}

.footer_bottom {
  padding: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer_disclaimer {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer_copyright {
  text-align: center;
}

div.site_footer>div.site_footer_container>div.site_footer_main p.site_footer_text {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.8;
  margin: 0;
}

.footer_copyright p.site_footer_text {
  color: #9ca3af;
  font-size: 14px;
}

.footer_copyright a {
  color: #ffd600;
  transition: color 0.2s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: all 0.2s ease;
}

.footer_copyright a:hover {
  color: #ffed4e;
  text-decoration-color: #ffed4e;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .site_title {
    font-size: 32px;
  }

  .site_subtitle {
    font-size: 16px;
  }

  .site_stats {
    font-size: 14px;
    flex-direction: column;
    gap: 8px;
  }

  .stats_divider {
    display: none;
  }

  .site_font_previewer {
    max-width: 100%;
  }

  .site_font_previewer input {
    height: 48px;
    padding: 0 120px 0 16px;
    font-size: 14px;
  }

  .search_btn {
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
  }

  .search_btn svg {
    width: 16px;
    height: 16px;
  }

  .site_filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter_label {
    width: 100%;
  }

  .font_grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .font_card_image {
    padding-top: 30%;
  }

  .font_card_image a {
    padding: 16px;
  }

  .font_card_info {
    padding: 16px;
  }

  .font_card_name {
    font-size: 16px;
  }

  .pagination {
    gap: 4px;
  }

  .page-link {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
  }

  .page-link span {
    display: none;
  }

  /* Footer 响应式 */
  .footer_content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer_brand {
    max-width: 100%;
  }

  .footer_section_title {
    font-size: 15px;
    margin-bottom: 16px;
  }

  div.site_footer {
    padding: 40px 0 0;
    margin-top: 60px;
  }

  .footer_bottom {
    padding: 24px 0;
    gap: 16px;
  }

  .footer_disclaimer {
    padding-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .site_hero {
    padding: 30px 0 40px;
  }

  .site_title {
    font-size: 28px;
  }

  .font_grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .font_card_image {
    padding-top: 25%;
  }

  .font_card_image a {
    padding: 12px;
  }

  .pagination {
    gap: 4px;
  }

  .page-link {
    padding: 8px 10px;
    min-width: 36px;
    justify-content: center;
  }

  /* Footer 小屏幕响应式 */
  div.site_footer {
    padding: 30px 0 0;
    margin-top: 40px;
  }

  .footer_content {
    gap: 24px;
  }

  .footer_title {
    font-size: 18px;
  }

  .footer_description {
    font-size: 13px;
  }

  .footer_section_title {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .footer_link_list {
    gap: 10px;
  }

  .footer_link_list li {
    font-size: 13px;
  }
}

/* 其他页面样式保持兼容 */
.site_filter_active {
  padding: 0 10px;
  height: 26px;
  background: #ddd;
  border-radius: 4px;
  color: #000;
  line-height: 26px;
  display: inline-block;
}

.img-fluid {
  width: 100%;
}

/* 字体详情页等其他页面样式 */
div.site_font_detail {
  position: relative;
  padding: 0 !important;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

div.site_font_detail div.site_font_subject {
  position: relative;
  padding: 30px;
}

div.site_font_detail div.site_font_subject>h2 {
  text-align: left;
  padding-bottom: 12px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
  color: #1a1a1a;
}

div.site_font_detail div.site_font_subject p.site_font_meta {
  font-size: 14px;
  color: #666;
  line-height: 28px;
}

div.site_font_detail div.site_font_buttons button.button {
  margin-right: 12px;
  padding: 0 20px;
  height: 44px;
  background: #ffd600;
  border: 0;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 44px;
  display: inline-block;
  cursor: pointer;
  transition: all 0.2s ease;
}

div.site_font_detail div.site_font_buttons button.button:hover {
  background: #ffed4e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 214, 0, 0.3);
}

/* 字体详情页优化样式 */
.site_font_detail {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 40px;
}

.site_font_subject {
  padding: 0;
}

/* 字体预览图 */
.font_preview_image {
  width: 100%;
  padding: 40px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #f1f3f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f0f0f0;
}

.font_preview_image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 字体信息区域 */
.font_info_section {
  padding: 30px 40px;
}

.font_detail_name {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 16px;
  line-height: 1.3;
}

/* 面包屑导航 */
.font_breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.font_breadcrumb a {
  color: #666;
  transition: color 0.2s ease;
}

.font_breadcrumb a:hover {
  color: #ffd600;
}

.breadcrumb_separator {
  color: #ddd;
}

.breadcrumb_current {
  color: #1a1a1a;
  font-weight: 500;
}

/* 字体统计信息 */
.font_stats_info {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat_item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #666;
}

.stat_item svg {
  width: 16px;
  height: 16px;
  color: #9ca3af;
}

/* 下载按钮 */
.site_font_buttons {
  margin-bottom: 24px;
}

.site_font_buttons button.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 48px;
  background: #ffd600;
  border: 0;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.site_font_buttons button.button:hover {
  background: #ffed4e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 214, 0, 0.3);
}

.site_font_buttons button.button svg {
  width: 18px;
  height: 18px;
}

/* 字体信息表格 */
.font_info_table {
  padding: 0 40px 40px;
}

.font_info_table table {
  width: 100%;
  border-collapse: collapse;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.font_info_table thead {
  background: #1a1a1a;
}

.font_info_table thead th {
  padding: 16px 20px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.font_info_table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s ease;
}

.font_info_table tbody tr:last-child {
  border-bottom: none;
}

.font_info_table tbody tr:hover {
  background: #fff;
}

.font_info_table tbody td {
  padding: 16px 20px;
  font-size: 14px;
  color: #1a1a1a;
}

/* 章节标题 */
.section_title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section_title svg {
  width: 24px;
  height: 24px;
  color: #ffd600;
}

/* 博客/新闻卡片 */
.blog_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.blog_card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.blog_card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.blog_card_link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.blog_card_image {
  width: 100%;
  padding-top: 60%;
  position: relative;
  overflow: hidden;
  background: #f8f9fa;
}

.blog_card_image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog_card:hover .blog_card_image img {
  transform: scale(1.05);
}

.blog_card_info {
  padding: 20px;
}

.blog_card_title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog_card:hover .blog_card_title {
  color: #ffd600;
}

/* 推荐字体和字体排行区域 */
.site_similar_fonts {
  margin-top: 60px;
}

/* 响应式设计 - 字体详情页 */
@media (max-width: 768px) {
  .font_preview_image {
    padding: 24px;
  }

  .font_info_section {
    padding: 24px;
  }

  .font_detail_name {
    font-size: 24px;
  }

  .font_stats_info {
    gap: 16px;
  }

  .font_info_table {
    padding: 0 24px 24px;
  }

  .font_info_table thead th,
  .font_info_table tbody td {
    padding: 12px 16px;
    font-size: 13px;
  }

  .blog_grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }

  .section_title {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .font_preview_image {
    padding: 16px;
  }

  .font_info_section {
    padding: 20px;
  }

  .font_detail_name {
    font-size: 20px;
  }

  .font_stats_info {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .font_info_table {
    padding: 0 16px 20px;
  }

  .font_info_table thead th,
  .font_info_table tbody td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .blog_grid {
    grid-template-columns: 1fr;
  }

  .section_title {
    font-size: 18px;
  }
}
