/* 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: calc(var(--header-height, 80px) + 2rem);
  padding-bottom: 72px;
  background: #fafafa;
}

.post-header {
  position: static; /* ensure it follows content flow */
  text-align: center;
  margin-bottom: 28px;
  background: transparent; /* avoid covering nav */
  border: 0;
  box-shadow: none;
}

.post-title {
  font-size: clamp(28px, 22px + 2vw, 44px);
  line-height: 1.25;
  color: #111827;
  font-weight: 800;
}

.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;
}
.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;
}

.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);
}

/* =====================
   Article header/footer
   (post page only)
   ===================== */

/* Header (align with homepage style) */
header {
  background: #ffffff;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  border-top: 3px solid #3b82f6; /* blue top line */
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.06);
}
header.scrolled {
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.08);
}
header .container {
  max-width: 1200px;
  width: min(95vw, 1200px);
  margin: 0 auto;
  padding: 0 16px;
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.logo {
  display: flex;
  align-items: center;
}
.logo-img {
  height: 34px;
  display: block;
}
.logo-text {
  display: none;
}
.nav-links {
  list-style: none;
  display: flex;
}
.nav-links li {
  margin-left: 28px;
}
.nav-links a {
  text-decoration: none;
  color: #111827;
  font-weight: 600;
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: #3b82f6;
  transition: width 0.25s ease;
}
.nav-links a:hover {
  color: #0f172a;
}
.nav-links a:hover::after {
  width: 100%;
}

/* Footer (align with homepage style) */
footer {
  background: linear-gradient(135deg, #0c0f1c 0%, #1a1d2e 100%);
  color: white;
  padding: 80px 0 40px;
  position: relative;
  overflow: hidden;
  margin-top: 48px;
}
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(28, 65, 172, 0.3),
    transparent
  );
}
footer .container {
  max-width: 1200px;
  width: min(95vw, 1200px);
  margin: 0 auto;
  padding: 0 16px;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
  position: relative;
  z-index: 2;
}
.footer-column h3 {
  color: #ffffff;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: relative;
}
.footer-column h3::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, #1c41ac, #f4193c);
  border-radius: 1px;
}
.footer-column p {
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 16px;
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 12px;
  transition: transform 0.2s ease;
}
.footer-links li:hover {
  transform: translateX(4px);
}
.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  font-size: 0.95rem;
  line-height: 1.5;
}
.footer-links a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(28, 65, 172, 0.3);
}
.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #a3aed0;
  font-size: 0.9rem;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}
.footer-bottom::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #1c41ac, transparent);
}
.footer-bottom p {
  margin-bottom: 8px;
  opacity: 0.9;
}
.footer-bottom p:last-child {
  margin-bottom: 0;
  opacity: 0.8;
}
.footer-bottom strong {
  color: #ffffff;
  font-weight: 600;
}

/* Header/Footer responsive tweaks */
@media (max-width: 992px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 32px;
  }
  footer {
    padding: 48px 0 24px;
  }
  .footer-column h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
  }
  .footer-bottom {
    padding-top: 24px;
    font-size: 0.85rem;
  }
}
