/* ============================================
   BLOG SYSTEM CSS
   ============================================ */

/* === 博客列表页 === */
.blog-hero {
  position: relative;
  padding: 70px 0 50px;
  background: linear-gradient(180deg, #F0F6FF 0%, #ffffff 100%);
  text-align: center;
  overflow: hidden;
}
.blog-hero-blob {
  position: absolute;
  width: 500px; height: 500px;
  background: var(--primary-100);
  opacity: 0.5;
  border-radius: 50%;
  filter: blur(80px);
  top: -200px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.blog-hero .container { position: relative; }
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  margin: 14px 0 16px;
  line-height: 1.15;
}
.blog-hero p {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

.blog-filters {
  padding: 24px 0 0;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: calc(var(--nav-h) + var(--topbar-h));
  z-index: 10;
}
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text); background: var(--border-soft); }
.filter-tab.active {
  background: var(--primary);
  color: #fff;
}

.blog-list { padding: 50px 0 80px; }
.blog-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.blog-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.blog-card-page {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.blog-card-page:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-100);
}
.blog-card-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  overflow: hidden;
}
/* 大图标水印 */
.blog-card-thumb-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  width: 64px; height: 64px;
  color: rgba(255, 255, 255, 0.92);
  z-index: 1;
}
.blog-card-thumb-icon svg { width: 100%; height: 100%; }
/* 分类配色（免维护，无需任何图片） */
.blog-card-thumb.cat-first-home   { background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%); }
.blog-card-thumb.cat-refinance    { background: linear-gradient(135deg, #0E7490 0%, #06B6D4 100%); }
.blog-card-thumb.cat-self-employed{ background: linear-gradient(135deg, #B45309 0%, #F59E0B 100%); }
.blog-card-thumb.cat-investment   { background: linear-gradient(135deg, #047857 0%, #10B981 100%); }
.blog-card-thumb.cat-commercial   { background: linear-gradient(135deg, #6D28D9 0%, #8B5CF6 100%); }
/* 微妙的装饰光斑 */
.blog-card-thumb::after {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.blog-card-cat {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}
.blog-card-featured {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.blog-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--text);
}
.blog-card-excerpt {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 14px;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-mute);
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

/* === 单篇文章页 === */
.article-page {
  padding: 40px 0 80px;
  background: #fff;
}
.article-container {
  max-width: 760px;
  margin: 0 auto;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  transition: color 0.2s var(--ease);
}
.article-back:hover { color: var(--primary); }

.article-header { margin-bottom: 28px; }
.article-category {
  display: inline-block;
  padding: 5px 12px;
  background: var(--accent-50);
  color: var(--accent-dark);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.article-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text-dim);
}
.article-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.article-cover {
  aspect-ratio: 21/9;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-cover.cat-first-home    { background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%); }
.article-cover.cat-refinance     { background: linear-gradient(135deg, #0E7490 0%, #06B6D4 100%); }
.article-cover.cat-self-employed { background: linear-gradient(135deg, #B45309 0%, #F59E0B 100%); }
.article-cover.cat-investment    { background: linear-gradient(135deg, #047857 0%, #10B981 100%); }
.article-cover.cat-commercial    { background: linear-gradient(135deg, #6D28D9 0%, #8B5CF6 100%); }
.article-cover-icon {
  width: 88px; height: 88px;
  color: rgba(255,255,255,0.92);
  z-index: 1;
}
.article-cover-icon svg { width: 100%; height: 100%; }
.article-cover::after {
  content: '';
  position: absolute;
  top: -30%; right: -10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, transparent 70%);
  pointer-events: none;
}

/* 正文样式 */
.article-body {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.article-body h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 40px 0 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
}
.article-body h4 {
  font-size: 17px;
  font-weight: 700;
  margin: 22px 0 10px;
  color: var(--text);
}
.article-body p { margin-bottom: 16px; }
.article-body strong { color: var(--text); font-weight: 700; }
.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary-100);
  text-underline-offset: 3px;
}
.article-body a:hover { text-decoration-color: var(--primary); }
.article-body ul, .article-body ol {
  margin: 12px 0 18px;
  padding-left: 26px;
}
.article-body li {
  margin-bottom: 6px;
  line-height: 1.65;
}
.article-body ul.tasklist {
  list-style: none;
  padding-left: 0;
}
.article-body li.task {
  display: flex;
  align-items: start;
  gap: 8px;
  padding-left: 0;
}
.article-body li.task input[type="checkbox"] {
  margin-top: 4px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  font-size: 14.5px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.article-body th {
  background: var(--primary-50);
  color: var(--primary);
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid var(--border-soft);
}
.article-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.article-body tr:last-child td { border-bottom: 0; }
.article-body tr:hover td { background: var(--bg-soft); }
.article-body code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-dark);
}
.article-body pre {
  background: #0F172A;
  color: #E2E8F0;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 18px 0;
}
.article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-50);
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}

/* === 朋友圈分享盒子 === */
.share-box {
  margin: 50px 0 30px;
  padding: 28px;
  background: linear-gradient(135deg, #DCFCE7 0%, #ECFDF5 100%);
  border: 1.5px dashed #16A34A;
  border-radius: var(--radius-lg);
}
.share-box-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.share-emoji { font-size: 26px; }
.share-box h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.share-hint {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 14px;
  line-height: 1.5;
}
.share-text {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
}
.share-text:focus {
  outline: none;
  border-color: #16A34A;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}
.share-copy-btn {
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%) !important;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.28) !important;
}
.share-copy-btn:hover {
  background: linear-gradient(135deg, #15803D 0%, #166534 100%) !important;
}
.share-url {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 12.5px;
  color: var(--text-dim);
  word-break: break-all;
}

/* === 文末 CTA === */
.article-cta {
  margin-top: 40px;
  padding: 36px 32px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-blue);
}
.article-cta-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.article-cta h3 {
  font-size: 22px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 8px;
}
.article-cta p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  margin-bottom: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .blog-hero { padding: 50px 0 36px; }
  .blog-filters { position: relative; top: auto; }
  .filter-tabs { padding: 0 24px 16px; }
  .blog-list { padding: 36px 0 60px; }
  .blog-grid-page { grid-template-columns: 1fr; gap: 18px; }

  .article-page { padding: 24px 0 60px; }
  .article-title { font-size: 28px; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 22px; }
  .article-body h3 { font-size: 18px; }
  .share-box { padding: 22px; margin: 36px 0 24px; }
  .article-cta { padding: 28px 22px; }
}
