/* ==========================================================================
   Article & Multi-Ad Layout Styles
   Optimized for high RPM Google AdSense / Mediavine slots & long-form SEO
   ========================================================================== */

.layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
}

/* Article Main Content */
.article-main {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
  color: #1f2937;
}

.article-main h1 {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 12px;
}

.article-main h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 36px 0 14px 0;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
}

.article-main h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 24px 0 10px 0;
}

.article-main p {
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.article-main ul, .article-main ol {
  margin: 0 0 20px 24px;
  font-size: 1rem;
}

.article-main li {
  margin-bottom: 8px;
}

/* ==========================================================================
   Ad Unit Containers (AdSense / Mediavine Compatible)
   未接入正式广告时默认完全隐形，不留任何占位符或空白；
   一旦填入 Google 广告标签 (如 ins/iframe) 会自动无缝展开显示。
   ========================================================================== */

.ad-slot {
  display: none; /* 默认未接入广告时完全隐藏，页面极致干净 */
  margin: 24px auto;
  text-align: center;
  overflow: hidden;
  position: relative;
}

/* 现代 CSS 选择器：当且仅当容器内被填充了真实的广告标签 (ins, iframe, script) 时，才自动激活显示 */
.ad-slot:has(ins),
.ad-slot:has(iframe),
.ad-slot.ad-active {
  display: block;
}

/* 顶部通栏横幅广告 (Leaderboard 728x90) */
.ad-slot-leaderboard {
  max-width: 970px;
  width: 100%;
}

/* 正文中插广告 */
.ad-slot-in-article {
  width: 100%;
  margin: 32px 0;
}

/* 侧边栏 300x250 */
.ad-slot-sidebar-rect {
  width: 300px;
  margin: 0 auto 24px auto;
}

/* 侧边栏 300x600 深度吸顶广告 (Highest RPM) */
.ad-slot-sidebar-halfpage {
  width: 300px;
  margin: 0 auto;
}

/* Sidebar Column */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-sticky-wrap {
  position: sticky;
  top: 80px;
}

.sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.sidebar-widget-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;  font-size: 0.9rem;
}

.sidebar-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Category Hub Teaser Cards (栏目大厅卡片网格)
   ========================================================================== */

.guides-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.hub-teaser-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.hub-teaser-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.teaser-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: inline-block;
}

.teaser-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 10px;
  color: #0f172a;
}

.teaser-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.teaser-cta {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 栏目标签筛选按钮 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 8px 0;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
