/* Article-only stylesheet: minimal, markdown-safe, and strictly scoped */

:root {
  --post-text: #1f2937;
  --post-muted: #6b7280;
  --post-border: rgba(0, 0, 0, 0.08);
  --post-bg: #ffffff;
  --post-radius: 12px;
}

.post-article {
  padding-top: 2rem;
  padding-bottom: 72px;
  background: #fafafa;
}

/* 覆盖 style.css 中 post-header 的装饰性样式，保持文章页简洁 */
.post-header {
  position: static;
  text-align: center;
  margin-bottom: 28px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.post-title {
  font-size: clamp(24px, 18px + 2vw, 36px);
  line-height: 1.35;
  color: #111827;
  font-weight: 800;
  max-width: 720px;
  margin: 0 auto;
  word-break: break-word;
  overflow-wrap: break-word;
}

.post-content {
  margin: 0 auto;
  max-width: 1000px;
  background: var(--post-bg);
  color: var(--post-text);
  line-height: 1.8;
  font-size: 16px;
  padding: 28px 24px;
  border: 1px solid var(--post-border);
  border-radius: var(--post-radius);
}

/* Headings rhythm; do not enforce colors that could fight inline styles from editor */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  color: #111827;
  border-bottom: none;
}
.post-content h1 {
  font-size: 2rem;
}
.post-content h2 {
  font-size: 1.6rem;
}
.post-content h3 {
  font-size: 1.3rem;
}

.post-content p {
  margin: 1em 0;
  text-align: left;
}

.post-content img,
.post-content video,
.post-content iframe {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2em auto;
  border-radius: 8px;
}

.post-content blockquote {
  margin: 1.2em 0;
  padding: 0.8em 1em;
  border-left: 4px solid #d1d5db;
  color: var(--post-muted);
  background: #fafafa;
}

.post-content code {
  background: #f3f4f6;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}
.post-content pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 1em;
  border-radius: 8px;
  overflow: auto;
  margin: 1.2em 0;
}
.post-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Lists */
.post-content ul,
.post-content ol {
  padding-left: 1.4em;
  margin: 1em 0;
}
.post-content li {
  margin: 0.4em 0;
}

/* Tables */
.post-content .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14px;
}
.post-content th,
.post-content td {
  border: 1px solid var(--post-border);
  padding: 10px 12px;
}
.post-content thead th {
  background: #f9fafb;
}

/* Media helpers */
.post-content .aligncenter,
.post-content .align-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.post-content .alignleft,
.post-content .align-left {
  float: left;
  margin: 8px 16px 8px 0;
}
.post-content .alignright,
.post-content .align-right {
  float: right;
  margin: 8px 0 8px 16px;
}
.post-content::after {
  content: "";
  display: block;
  clear: both;
}

.post-footer {
  max-width: 860px;
  margin: 28px auto 0;
  padding: 20px 24px;
}

/* Responsive */
@media (max-width: 768px) {
  .post-content {
    padding: 20px 16px;
  }
  .post-footer {
    padding: 16px;
    margin-top: 20px;
  }
}

/* Bottom share bar */
.post-share-bar {
  padding: 20px 0 40px;
}
.post-share-bar .post-share {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.post-share .share-label {
  font-weight: 600;
  color: var(--post-muted);
}
.post-share a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}
.post-share .share-weibo {
  background: #e6162d;
  color: #fff;
}
.post-share .share-weibo:hover {
  background: #c01430;
  transform: translateY(-1px);
}
.post-share .share-qq {
  background: #12b7f5;
  color: #fff;
}
.post-share .share-qq:hover {
  background: #0ea5e9;
  transform: translateY(-1px);
}

/* =====================
   面包屑导航栏（独立条带，紧贴导航栏）
   ===================== */
.post-breadcrumb-bar {
  margin-top: var(--header-height, 80px);
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.post-breadcrumb-bar .container {
  max-width: 1200px;
  width: min(95vw, 1200px);
  margin: 0 auto;
  padding: 0 16px;
}
.post-breadcrumb {
  display: inline-flex;  /* 只占内容实际宽度，不撑满整行 */
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  font-size: 13px;
  color: var(--post-muted);
  padding: 9px 0;
  max-width: 100%;       /* 超出容器时自动换行，不溢出 */
}
.post-breadcrumb a {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.post-breadcrumb a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.post-breadcrumb-sep {
  color: #d1d5db;
  padding: 0 2px;
  user-select: none;
}
.post-breadcrumb-current {
  color: #6b7280;
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =====================
   文章元信息
   ===================== */
.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--post-muted);
}
.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.post-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* =====================
   标签入口
   ===================== */
.post-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1000px;
  margin: 24px auto 0;
  padding: 16px 24px;
  background: #f8fafc;
  border: 1px solid var(--post-border);
  border-radius: var(--post-radius);
  font-size: 13px;
  color: var(--post-muted);
}
.post-tags svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.post-tags-label {
  font-weight: 600;
  color: #374151;
}
.post-tag-item {
  display: inline-block;
  padding: 3px 12px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: default;
}

/* =====================
   上一篇 / 下一篇
   ===================== */
.post-nav {
  display: flex;
  gap: 16px;
  max-width: 1000px;
  margin: 24px auto 0;
}
.post-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--post-border);
  border-radius: var(--post-radius);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.post-nav-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.post-nav-next {
  text-align: right;
}
.post-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3b82f6;
}
.post-nav-title {
  font-size: 14px;
  color: #111827;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================
   相关文章
   ===================== */
.post-related {
  max-width: 1000px;
  margin: 32px auto 0;
}
.post-related-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  position: relative;
}
.post-related-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: #3b82f6;
  border-radius: 1px;
}
.post-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.post-related-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--post-border);
  border-radius: var(--post-radius);
  overflow: hidden;
  text-decoration: none;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}
.post-related-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.post-related-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f1f5f9;
}
.post-related-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.post-related-card:hover .post-related-cover img {
  transform: scale(1.04);
}
.post-related-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
}
.post-related-info {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.post-related-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  margin: 0;
}
.post-related-date {
  font-size: 12px;
  color: var(--post-muted);
}

@media (max-width: 768px) {
  .post-nav {
    flex-direction: column;
  }
  .post-nav-next {
    text-align: left;
  }
  .post-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .post-related-grid {
    grid-template-columns: 1fr;
  }
}
