/*
Theme Name: 启辉五金
Theme URI: https://chinayuanhui.com.cn
Description: 启辉五金制品厂官方博客主题，商务蓝灰风格
Version: 1.0
Author: 启辉五金
*/

:root {
  --blue:    #2563a8;
  --blue-dk: #1a4580;
  --blue-lt: #eff6ff;
  --gray:    #4a5568;
  --gray-lt: #718096;
  --bg:      #f7f8fa;
  --border:  #e2e8f0;
  --white:   #ffffff;
  --text:    #1a202c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC","Microsoft YaHei","微软雅黑",-apple-system,sans-serif;
  color: var(--gray);
  background: var(--white);
  line-height: 1.7;
  font-size: 16px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== 导航 ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
}
.logo-text { font-size: 20px; font-weight: 700; color: var(--blue-dk); letter-spacing: 1px; }
.logo-sub  { font-size: 12px; color: var(--gray-lt); letter-spacing: 2px; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 6px 14px; border-radius: 6px;
  font-size: 15px; color: var(--gray);
  transition: background .2s, color .2s;
}
.site-nav a:hover { background: var(--bg); color: var(--blue); }
.site-nav a.active { color: var(--blue); font-weight: 600; }
.nav-btn {
  margin-left: 8px; padding: 8px 20px; border-radius: 6px;
  background: var(--blue); color: #fff !important;
  font-size: 14px; font-weight: 600;
}
.nav-btn:hover { background: var(--blue-dk) !important; }

/* ===== 博客 Hero ===== */
.blog-hero {
  background: linear-gradient(135deg, #1a3a5c, #2563a8);
  color: #fff; padding: 52px 24px; text-align: center;
}
.blog-hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.blog-hero p  { font-size: 15px; opacity: .85; }

/* ===== 主体布局 ===== */
.site-main {
  max-width: 1200px; margin: 48px auto;
  padding: 0 24px;
  display: grid; grid-template-columns: 1fr 300px; gap: 40px;
  align-items: start;
}

/* ===== 文章列表 ===== */
.post-feed { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.post-card {
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--white);
  transition: box-shadow .25s, transform .25s;
}
.post-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.1); transform: translateY(-3px); }

.post-thumb {
  aspect-ratio: 16/9; overflow: hidden; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.post-card:hover .post-thumb img { transform: scale(1.04); }
.post-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--blue); font-weight: 800; opacity: .3;
}

.post-body { padding: 20px; }
.post-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.post-cat {
  display: inline-block; background: var(--blue-lt); color: var(--blue);
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.post-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  line-height: 1.4; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.post-title:hover { color: var(--blue); }
.post-excerpt {
  font-size: 13px; color: var(--gray-lt); line-height: 1.7;
  margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--gray-lt);
  padding-top: 12px; border-top: 1px solid var(--border);
}
.post-meta .read-more { margin-left: auto; color: var(--blue); font-weight: 600; font-size: 13px; }

/* ===== 分页 ===== */
.pagination {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 36px; grid-column: 1 / -1;
}
.pagination a, .pagination span {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid var(--border);
  font-size: 14px; color: var(--gray); transition: all .2s;
}
.pagination a:hover, .pagination .current {
  background: var(--blue); color: #fff; border-color: var(--blue);
}

/* ===== 侧边栏 ===== */
.sidebar { position: sticky; top: 80px; }
.widget { background: var(--white); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.widget-title {
  padding: 14px 20px; background: var(--bg);
  font-size: 14px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.widget-body { padding: 16px 20px; }

.recent-list { list-style: none; }
.recent-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.recent-item:last-child { border-bottom: none; }
.recent-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue-lt); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.recent-item:nth-child(1) .recent-num { background: var(--blue); color: #fff; }
.recent-item:nth-child(2) .recent-num { background: #3b82f6; color: #fff; }
.recent-item:nth-child(3) .recent-num { background: #93c5fd; color: #fff; }
.recent-title { font-size: 13px; color: var(--text); line-height: 1.5; }
.recent-title:hover { color: var(--blue); }

.cat-list { list-style: none; }
.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: 14px; color: var(--gray);
  transition: color .2s;
}
.cat-list li a:hover { color: var(--blue); }
.cat-count { font-size: 12px; background: var(--bg); padding: 2px 8px; border-radius: 10px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  padding: 5px 12px; border-radius: 20px; font-size: 13px;
  border: 1px solid var(--border); color: var(--gray);
  transition: all .2s;
}
.tag-cloud a:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-lt); }

.sidebar-cta {
  background: linear-gradient(135deg, #1a3a5c, #2563a8);
  color: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px;
}
.sidebar-cta h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.sidebar-cta p  { font-size: 13px; opacity: .85; line-height: 1.8; margin-bottom: 16px; }
.sidebar-cta a {
  display: block; padding: 10px; background: #fff;
  color: var(--blue); border-radius: 8px;
  text-align: center; font-weight: 700; font-size: 14px;
}

/* ===== 文章详情 ===== */
.post-header {
  max-width: 800px; margin: 48px auto 0; padding: 0 24px;
}
.post-header .post-cats { margin-bottom: 14px; }
.post-full-title {
  font-size: 34px; font-weight: 800; color: var(--text);
  line-height: 1.3; margin-bottom: 16px;
}
.post-full-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; color: var(--gray-lt);
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.post-feature-img {
  max-width: 900px; margin: 32px auto; padding: 0 24px;
}
.post-feature-img img { width: 100%; border-radius: 12px; }

/* 正文 */
.post-content {
  max-width: 800px; margin: 0 auto; padding: 32px 24px 64px;
}
.post-content h2 {
  font-size: 22px; font-weight: 800; color: var(--text);
  margin: 36px 0 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--blue);
}
.post-content h3 { font-size: 18px; font-weight: 700; color: var(--text); margin: 24px 0 10px; }
.post-content p  { font-size: 16px; color: var(--gray); line-height: 1.9; margin-bottom: 18px; }
.post-content ul, .post-content ol { padding-left: 22px; margin-bottom: 18px; }
.post-content li { font-size: 15px; color: var(--gray); line-height: 1.8; margin-bottom: 6px; }
.post-content img { border-radius: 8px; margin: 20px 0; }
.post-content a { color: var(--blue); text-decoration: underline; }
.post-content blockquote {
  border-left: 4px solid var(--blue); padding: 14px 18px;
  background: var(--blue-lt); border-radius: 0 8px 8px 0;
  margin: 20px 0; font-size: 15px; color: var(--blue-dk);
}
.post-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.post-content th { background: var(--blue); color: #fff; padding: 10px 14px; text-align: left; }
.post-content td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.post-content tr:nth-child(even) td { background: var(--bg); }
.post-content code {
  background: var(--bg); padding: 2px 6px; border-radius: 4px;
  font-size: 14px; color: var(--blue-dk);
}
.post-content pre {
  background: #1a202c; color: #e2e8f0; padding: 20px;
  border-radius: 8px; overflow-x: auto; margin: 20px 0;
}
.post-content pre code { background: none; color: inherit; padding: 0; }

/* 文章底部 CTA */
.post-cta {
  background: linear-gradient(135deg, #1a3a5c, #2563a8);
  color: #fff; text-align: center; padding: 52px 24px;
}
.post-cta h2 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.post-cta p  { font-size: 15px; opacity: .85; margin-bottom: 28px; }
.post-cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-white { padding: 12px 28px; border-radius: 8px; background: #fff; color: var(--blue); font-size: 15px; font-weight: 700; }
.btn-outline { padding: 12px 28px; border-radius: 8px; border: 2px solid rgba(255,255,255,.6); color: #fff; font-size: 15px; }

/* 相关文章 */
.post-related { background: var(--bg); padding: 48px 24px; }
.post-related-inner { max-width: 1200px; margin: 0 auto; }
.post-related h3 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }

/* ===== Footer ===== */
.site-footer {
  background: #0f1a2e; color: rgba(255,255,255,.6);
  padding: 48px 24px 24px; margin-top: 72px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand p { font-size: 14px; margin-top: 12px; line-height: 1.8; max-width: 300px; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 14px; color: rgba(255,255,255,.6); transition: color .2s; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px; margin: 0 auto; padding-top: 20px;
  display: flex; justify-content: space-between; font-size: 13px; flex-wrap: wrap; gap: 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .site-main { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post-feed { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .site-nav { display: none; }
  .post-full-title { font-size: 24px; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
