/* ============================================================
   page-blog-article.css — 博客文章页专属样式
   网格背景 / 切角 CTA 见 site-chrome.css；阅读页无全站顶栏与页脚
   ============================================================ */

#site-nav,
#site-footer,
.blog-offer-fab {
  display: none !important;
}

/* ---- 文章小目录 ---- */
.article-toc {
  margin-bottom: 2rem;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}

.article-toc__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}

.article-toc__label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #090a0f;
  font-family: ui-monospace, 'JetBrains Mono', monospace;
}

.article-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-toc__list a {
  display: block;
  padding: 6px 10px 6px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.article-toc__list a:hover {
  color: #dc2626;
  background: #fff;
  border-left-color: rgba(220, 38, 38, 0.35);
}

.article-toc__list a.is-active {
  color: #dc2626;
  background: #fff;
  border-left-color: #dc2626;
}

@media (min-width: 1024px) {
  .article-toc {
    position: sticky;
    top: 6.5rem;
    z-index: 5;
  }
}

/* ---- 正文排版 ---- */
.blog-article-body {
  font-size: 15px;
  line-height: 1.85;
  color: #475569;
}

.blog-article-body p {
  margin: 0 0 1.25em;
}

.blog-article-body p strong {
  color: #090a0f;
  font-weight: 800;
}

.blog-article-body a {
  color: #dc2626;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-article-body a:hover {
  color: #b91c1c;
}

.blog-article-body h2 {
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 900;
  color: #090a0f;
  letter-spacing: -0.02em;
  margin: 2.25em 0 0.75em;
  padding-bottom: 0.45em;
  border-bottom: 2px solid #f1f5f9;
  scroll-margin-top: 6rem;
}

.blog-article-body h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  margin-right: 10px;
  vertical-align: -0.1em;
  background: #dc2626;
  border-radius: 2px;
}

.article-body-list {
  margin: 0 0 1.25em 1.2em;
  padding: 0;
  list-style: disc;
  color: #475569;
}

.article-body-list li {
  margin-bottom: 0.5em;
}

.article-body-list strong {
  color: #090a0f;
  font-weight: 800;
}

/* ---- 数据卡 ---- */
.article-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 1.75em 0;
}

.article-stat-card {
  text-align: center;
  padding: 20px 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.article-stat-card:hover {
  border-color: rgba(220, 38, 38, 0.25);
  box-shadow: 0 12px 28px -16px rgba(220, 38, 38, 0.12);
}

.article-stat-num {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  line-height: 1;
  color: #dc2626;
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  letter-spacing: -0.03em;
}

.article-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.4;
}

/* ---- Callout ---- */
.article-callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  margin: 1.5em 0;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.article-callout--blue {
  background: #f8fafc;
  border-left: 3px solid #dc2626;
}

.article-callout--pink {
  background: #fef2f2;
  border-left: 3px solid #dc2626;
}

.article-callout--green {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
}

.article-callout__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #090a0f;
  color: #fff;
  font-size: 14px;
}

.article-callout--green .article-callout__icon {
  background: #16a34a;
}

.article-callout__title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #090a0f;
  margin-bottom: 4px;
}

.article-callout__body {
  font-size: 14px;
  line-height: 1.65;
  color: #475569;
}

/* ---- 表格 ---- */
.article-table-wrap {
  margin: 1.5em 0;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.article-table th {
  background: #090a0f;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

.article-table td {
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
  line-height: 1.55;
  background: #fff;
}

.article-table tr:nth-child(even) td {
  background: #f8fafc;
}

.article-table tr:hover td {
  background: #fef2f2;
}

.article-table tr:last-child td {
  border-bottom: none;
}

/* ---- 代码块 ---- */
.article-code-wrap {
  margin: 1.5em 0;
}

.article-code-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 10px 10px 0 0;
  background: #dc2626;
  color: #fff;
}

.article-code {
  font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  line-height: 1.75;
  background: #090a0f;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 0 14px 14px 14px;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}

.article-code .code-path {
  color: #86efac;
}

.article-code .code-comment {
  color: #94a3b8;
}

/* ---- 图片 ---- */
.article-hero {
  margin: 0 0 2em;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px -24px rgba(9, 10, 15, 0.12);
}

.article-hero img {
  width: 100%;
  height: clamp(200px, 36vw, 420px);
  object-fit: cover;
  display: block;
}

.article-fig {
  margin: 2em 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.article-fig img {
  width: 100%;
  display: block;
}

.article-fig figcaption {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

/* ---- Mac 推广块 ---- */
.article-mac-promo {
  margin: 2.25em 0 0;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #fef2f2 0%, #fff 55%, #f8fafc 100%);
}

.article-mac-promo h2 {
  margin-top: 0 !important;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem) !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.article-mac-promo h2::before {
  display: none !important;
}

.article-mac-promo p {
  font-size: 14px;
  color: #475569;
  margin-bottom: 0.85em;
}

.article-cta-link {
  color: #dc2626 !important;
  font-weight: 800 !important;
}

/* ---- 浮动 CTA ---- */
.blog-offer-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  text-decoration: none;
  color: #fff;
  background: #090a0f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(9, 10, 15, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-offer-fab:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(220, 38, 38, 0.35);
}

.blog-offer-fab__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dc2626;
  flex-shrink: 0;
  font-size: 13px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.blog-offer-fab:hover .blog-offer-fab__icon {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.blog-offer-fab__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blog-offer-fab__label {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.blog-offer-fab__sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
}

.blog-offer-fab__arrow {
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.blog-offer-fab:hover .blog-offer-fab__arrow {
  color: #fff;
  transform: translateX(2px);
}

@media (max-width: 600px) {
  .article-stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .article-stats-row .article-stat-card:last-child {
    grid-column: span 2;
  }

  .blog-offer-fab__sub {
    display: none;
  }
}
