/* ==========================================
   模板 02 - 抗重叠与防错位 Flexbox 骨架 CSS
   ========================================== */

:root {
  --_n2_bg: #f4f6f9;
  --_n2_card_bg: #ffffff;
  --_n2_border: #e2e8f0;
  --_n2_border_dark: #cbd5e1;
  --_n2_primary: #2563eb;
  --_n2_primary_hover: #1d4ed8;
  --_n2_text_dark: #1e293b;
  --_n2_text_muted: #64748b;
  --_n2_font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 全局布局重置：强制像素清零与盒模型 */
html, body._n2_body_fix {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  background-color: var(--_n2_bg);
  color: var(--_n2_text_dark);
  font-family: var(--_n2_font);
  line-height: 1.6;
  overflow-x: hidden !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

._n2_shell_wrap {
  width: 100% !important;
  margin: 0 auto !important;
  display: block;
}

/* 核心居中容器：绝对强制居中 */
._n2_inner_container {
  width: 100% !important;
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* 1. 顶栏样式 */
._n2_header_bar {
  width: 100% !important;
  background: #ffffff;
  border-bottom: 1px solid var(--_n2_border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

._n2_hdr_flex {
  height: 68px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

._n2_brand_logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--_n2_text_dark);
}

._n2_logo_icon {
  font-size: 1.2rem;
  color: var(--_n2_primary);
}

._n2_brand_logo h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0;
}

._n2_nav_list {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

._n2_nav_item {
  color: var(--_n2_text_muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}

._n2_nav_item:hover {
  color: var(--_n2_primary);
}

/* 2. Hero 搜索区 */
._n2_hero_section {
  width: 100% !important;
  background: #ffffff;
  border-bottom: 1px solid var(--_n2_border);
  padding: 40px 0 50px;
}

._n2_hero_center {
  text-align: center;
}

._n2_hero_badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--_n2_primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 16px;
}

._n2_badge_dot {
  width: 6px;
  height: 6px;
  background: var(--_n2_primary);
  border-radius: 50%;
}

._n2_hero_title {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 900;
  color: var(--_n2_text_dark);
  margin: 0 0 12px 0;
  line-height: 1.3;
}

._n2_hero_desc {
  font-size: 0.95rem;
  color: var(--_n2_text_muted);
  max-width: 680px;
  margin: 0 auto 28px;
}

._n2_search_form {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

._n2_search_input {
  width: 100%;
  height: 48px;
  background: #ffffff;
  border: 2px solid var(--_n2_border_dark);
  border-radius: 8px;
  padding: 0 120px 0 16px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

._n2_search_input:focus {
  border-color: var(--_n2_primary);
}

._n2_search_btn {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  background: var(--_n2_primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

._n2_search_btn:hover {
  background: var(--_n2_primary_hover);
}

/* 3. 主体双栏 Flexbox 抗漂移布局（解决站群注释导致的错位） */
._n2_main_content {
  width: 100% !important;
  padding: 40px 0 60px;
}

._n2_flex_layout {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
}

/* 左侧强制占用 70% 宽度，物理顺序定义为 order: 1 */
._n2_content_area {
  order: 1 !important;
  flex: 0 0 70% !important;
  width: 70% !important;
  max-width: 70% !important;
}

/* 右侧强制占用 26% 宽度，物理顺序定义为 order: 2 */
._n2_sidebar_area {
  order: 2 !important;
  flex: 0 0 26% !important;
  width: 26% !important;
  max-width: 26% !important;
}

/* 推荐文章大卡片 */
._n2_featured_card {
  background: var(--_n2_card_bg);
  border: 1px solid var(--_n2_border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

._n2_card_head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

._n2_tag_primary {
  background: #dbeafe;
  color: var(--_n2_primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

._n2_post_date {
  font-size: 0.8rem;
  color: var(--_n2_text_muted);
}

._n2_featured_title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  line-height: 1.4;
  color: var(--_n2_text_dark);
}

._n2_featured_summary {
  font-size: 0.92rem;
  color: var(--_n2_text_muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

._n2_btn_primary {
  display: inline-block;
  background: var(--_n2_primary);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

._n2_btn_primary:hover {
  background: var(--_n2_primary_hover);
}

/* 栏目标题 */
._n2_section_bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--_n2_text_dark);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

._n2_bar_title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
}

._n2_bar_more {
  font-size: 0.8rem;
  color: var(--_n2_text_muted);
}

/* 文章列表 */
._n2_article_list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

._n2_article_item {
  background: var(--_n2_card_bg);
  border: 1px solid var(--_n2_border);
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
}

._n2_article_item:hover {
  border-color: var(--_n2_primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

._n2_item_title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--_n2_text_dark);
}

._n2_item_snippet {
  font-size: 0.88rem;
  color: var(--_n2_text_muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

._n2_item_meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

._n2_meta_tag {
  font-size: 0.75rem;
  color: var(--_n2_text_muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
}

._n2_item_link {
  color: var(--_n2_primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

/* 右侧侧边栏部件 */
._n2_sidebar_area {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

._n2_widget_box {
  background: var(--_n2_card_bg);
  border: 1px solid var(--_n2_border);
  border-radius: 12px;
  padding: 20px;
}

._n2_widget_highlight {
  background: #f8fafc;
  border-color: #cbd5e1;
}

._n2_widget_title {
  font-size: 0.95rem;
  font-weight: 800;
  border-bottom: 1px solid var(--_n2_border);
  padding-bottom: 10px;
  margin: 0 0 14px 0;
}

._n2_widget_list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}

._n2_widget_list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

._n2_label {
  color: var(--_n2_text_muted);
}

._n2_val {
  font-weight: 700;
  color: var(--_n2_text_dark);
}

._n2_widget_desc {
  font-size: 0.85rem;
  color: var(--_n2_text_muted);
  margin-bottom: 16px;
}

._n2_widget_btn {
  display: block;
  text-align: center;
  border: 1px solid var(--_n2_primary);
  color: var(--_n2_primary);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

._n2_widget_btn:hover {
  background: var(--_n2_primary);
  color: #ffffff;
}

/* 友链通栏 */
._n2_link_container {
  margin-top: 40px;
}

._n2_link_box {
  background: var(--_n2_card_bg);
  border: 1px solid var(--_n2_border);
  border-radius: 12px;
  padding: 20px;
}

._n2_link_title {
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: var(--_n2_text_dark);
}

._n2_link_group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

._n2_link_item {
  background: #f1f5f9;
  border: 1px solid var(--_n2_border);
  color: var(--_n2_text_muted);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}

._n2_link_item:hover {
  background: #ffffff;
  border-color: var(--_n2_primary);
  color: var(--_n2_primary);
}

/* 4. 页脚 */
._n2_footer_bar {
  width: 100% !important;
  background: #ffffff;
  border-top: 1px solid var(--_n2_border);
  padding: 24px 0;
  margin-top: 40px;
}

._n2_ft_center {
  text-align: center;
  font-size: 0.82rem;
  color: var(--_n2_text_muted);
}

/* 移动端自适应 */
@media (max-width: 868px) {
  ._n2_content_area, ._n2_sidebar_area {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  ._n2_sidebar_area {
    margin-top: 24px;
  }
  ._n2_hdr_flex {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }
}

/* 伪动效无意义 Keyframes */
@keyframes _n2_ghost_kf_001 {
  0% { transform: scale(1); }
  100% { transform: scale(1); }
}