/* ============================================================
   图牛工具网 — 博客专用样式
   玻璃质感 + 现代博客卡片设计
   ============================================================ */

/* ─── 博客分类导航 ─── */
.blog-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.blog-cat-nav a {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.25s;
  white-space: nowrap;
}
.blog-cat-nav a:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.blog-cat-nav a.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.blog-cat-nav a .count {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-left: 4px;
}

/* ─── 博客文章卡片 ─── */
.blog-card {
  display: block;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 18px;
  padding: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  position: relative;
}
.blog-card:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

/* 卡片封面区域 */
.blog-card-cover {
  position: relative;
  height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-card-cover .placeholder {
  font-size: 64px;
  opacity: 0.2;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}
.blog-card-cover .gradient-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  transition: opacity 0.4s;
}
.blog-card:hover .gradient-bg {
  opacity: 0.25;
}
.blog-card-cover .cat-badge-cover {
  position: absolute;
  top: 14px;
  left: 14px;
}

/* 卡片内容区 */
.blog-card-body {
  padding: 20px 22px 22px;
}
.blog-card-body h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.45;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-body p {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.blog-card-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── 分类徽章 ─── */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-badge:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* 分类颜色方案 */
.cat-text { color: #a8d8ff; }
.cat-format { color: #ffd8a8; }
.cat-image { color: #ffb3b3; }
.cat-security { color: #b3ffb3; }
.cat-web { color: #b3d9ff; }
.cat-code { color: #d4b3ff; }
.cat-calc { color: #ffe066; }
.cat-gen { color: #ffb3e6; }
.cat-other { color: rgba(255,255,255,0.5); }

/* 网格布局 */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ─── 文章详情页 ─── */

/* 文章头部特色区 */
.blog-post-hero {
  position: relative;
  padding: 48px 0 32px;
  text-align: center;
}
.blog-post-hero h1 {
  font-size: 32px;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.blog-post-hero .post-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
}
.blog-post-hero .post-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.blog-post-hero .cat-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 文章描述摘要块 */
.post-summary {
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 28px;
  border-left: 4px solid rgba(255,255,255,0.25);
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
}

/* 双栏布局 */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 32px;
  align-items: start;
}

/* 文章正文 */
.post-content {
  color: rgba(255,255,255,0.85);
  line-height: 1.85;
  font-size: 15px;
}
.post-content h2 {
  font-size: 24px;
  color: #fff;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.post-content h3 {
  font-size: 19px;
  color: #fff;
  margin: 28px 0 12px;
}
.post-content h4 {
  font-size: 16px;
  color: #fff;
  margin: 22px 0 10px;
}
.post-content p {
  margin-bottom: 16px;
}
.post-content a {
  color: #a8d8ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-content a:hover {
  color: #c8e8ff;
}
.post-content strong {
  color: #fff;
}
.post-content ul, .post-content ol {
  padding-left: 24px;
  margin-bottom: 18px;
}
.post-content li {
  margin-bottom: 8px;
}
.post-content li strong { color: #fff; }

/* 代码样式 */
.post-content code {
  background: rgba(255,255,255,0.1);
  padding: 2px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: #ffd700;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
.post-content pre {
  background: rgba(0,0,0,0.35);
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: #e6e6e6;
}
.post-content pre::before {
  content: '</>';
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.15);
  font-family: monospace;
}

/* 引用 */
.post-content blockquote {
  border-left: 4px solid rgba(255,255,255,0.25);
  padding: 14px 20px;
  margin: 20px 0;
  background: rgba(255,255,255,0.05);
  border-radius: 0 10px 10px 0;
  color: rgba(255,255,255,0.65);
  font-style: italic;
}
.post-content blockquote p:last-child { margin-bottom: 0; }

/* 图片 */
.post-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 24px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* 表格 */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.post-content th {
  background: rgba(255,255,255,0.1);
  color: #fff;
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
}
.post-content td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
}
.post-content tr:last-child td {
  border-bottom: none;
}

/* ─── 教程步骤样式 ─── */
.tutorial-step {
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 24px 0;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.tutorial-step .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-right: 10px;
  flex-shrink: 0;
}
.tutorial-step .step-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}
.tutorial-step .step-content {
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
}

/* 难度标签 */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.difficulty-beginner {
  background: rgba(81, 207, 102, 0.2);
  color: #69db7c;
  border: 1px solid rgba(81, 207, 102, 0.3);
}
.difficulty-intermediate {
  background: rgba(255, 193, 7, 0.2);
  color: #ffd43b;
  border: 1px solid rgba(255, 193, 7, 0.3);
}
.difficulty-advanced {
  background: rgba(255, 107, 107, 0.2);
  color: #ff8787;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ─── 目录侧边栏 ─── */
.post-toc {
  position: sticky;
  top: 80px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 20px;
}
.post-toc h3 {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.post-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-toc li {
  margin-bottom: 6px;
}
.post-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1.4;
}
.post-toc a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.post-toc a.toc-h3 {
  padding-left: 24px;
  font-size: 12px;
}
.post-toc .toc-active {
  color: #a8d8ff;
  background: rgba(168, 216, 255, 0.1);
}

/* ─── FAQ 区块 ─── */
.blog-faq {
  margin-top: 36px;
  padding: 24px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.blog-faq h2 {
  font-size: 20px;
  color: #fff;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.blog-faq .faq-item {
  margin-bottom: 18px;
}
.blog-faq .faq-item:last-child {
  margin-bottom: 0;
}
.blog-faq .faq-q {
  font-size: 15px;
  color: #b8a0ff;
  font-weight: 600;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.blog-faq .faq-q::before {
  content: 'Q:';
  color: rgba(255,255,255,0.3);
  font-size: 13px;
}
.blog-faq .faq-a {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  padding-left: 24px;
}

/* ─── 相关工具 ─── */
.related-tools-blog {
  margin: 36px 0;
  padding: 24px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
}
.related-tools-blog h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 16px;
}
.related-tools-blog .tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.related-tools-blog .tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: all 0.25s;
}
.related-tools-blog .tool-chip:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

/* ─── 文章导航 ─── */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 36px 0;
}
.post-nav a {
  flex: 1;
  padding: 16px 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.25s;
}
.post-nav a:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.post-nav a .nav-label {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.post-nav a .nav-title {
  font-size: 14px;
  line-height: 1.4;
}
.post-nav .nav-next { text-align: right; }

/* ─── 返回按钮 ─── */
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back-to-blog:hover {
  color: #fff;
}

/* ─── 空状态 ─── */
.blog-empty {
  text-align: center;
  padding: 80px 20px;
  color: rgba(255,255,255,0.4);
}
.blog-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

/* ─── 响应式 ─── */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .blog-card-cover {
    height: 140px;
  }
  .blog-card-body {
    padding: 16px 18px 18px;
  }
  .blog-card-body h3 {
    font-size: 16px;
  }
  .blog-post-hero h1 {
    font-size: 24px;
  }
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-toc {
    display: none;
  }
  .post-nav {
    flex-direction: column;
  }
  .post-nav a .nav-title {
    font-size: 13px;
  }
  .blog-cat-nav {
    gap: 6px;
    padding: 4px;
  }
  .blog-cat-nav a {
    font-size: 13px;
    padding: 6px 14px;
  }
}

@media (max-width: 480px) {
  .blog-card-cover {
    height: 120px;
  }
  .blog-card-body h3 {
    font-size: 15px;
  }
  .blog-post-hero {
    padding: 32px 0 20px;
  }
  .blog-post-hero h1 {
    font-size: 20px;
  }
  .blog-cat-nav a {
    font-size: 12px;
    padding: 5px 10px;
  }
  .post-content h2 {
    font-size: 20px;
  }
  .post-content {
    font-size: 14px;
  }
}
