/* ================================================
   专业资讯网站布局 - 完美复刻版
   左窄(130px) + 中宽(1040px) + 右中(320px)
   智能响应式：1600px+显示三栏 | 1440-1600显示中右 | <1440显示左中
   ================================================ */

/* 覆盖header容器宽度 */
body[data-page="content"] .site-header .container {
  max-width: 1600px !important;
}

/* 顶部广告位样式 */
#ad-header-bottom {
  background: #fff;
  padding: 20px 0;
  margin-bottom: 10px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#ad-header-bottom .ad-header-grid {
  width: 100%;
  max-width: 1600px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 0 20px;
}

#ad-header-bottom .baidu-ad {
  min-height: 150px;
  background: #f9f9f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-inline-block {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto 0px;
  padding: 0 20px;
  display: flex;
  gap: 5px;
}

.ad-inline-grid-left,
.ad-inline-grid-right {
  flex: 1;
  min-height: 60px;
  background: rgb(24, 144, 255);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 全局容器 */
.content-page {
  flex: 1;
  width: 100%;
  background: #f4f5f5;
  padding: 0;
}

.content-wrap {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 10px;
  align-items: flex-start;
}

/* 悬浮对联广告：由 JS 计算 left/top，仅作为固定在两侧的容器 */
.duilian-left,
.duilian-right {
  position: fixed;
  z-index: 1000;
}

.floating-ad {
  position: fixed;
  bottom: 20px;
  width: 340px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.floating-ad-left {
  left: 20px;
}

.floating-ad-right {
  right: 20px;
}

.floating-ad-slot {
  width: 100%;
  min-height: 260px;
}

.floating-ad-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  font-size: 16px;
  color: #666;
  cursor: pointer;
  padding: 0;
}

.floating-ad-close:hover {
  color: #1890ff;
}

/* ================================================
   左侧窄导航 (130px)
   ================================================ */
.left-nav-sidebar {
  width: 130px;
  flex-shrink: 0;
}

.left-nav-fixed {
  position: sticky;
  top: 70px;
  background: #fff;
  border-radius: 4px;
  padding: 20px 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-logo {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8e8e8;
}

.nav-logo img {
  max-width: 80px;
  height: auto;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li {
  margin-bottom: 5px;
}

.nav-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 5px;
  text-decoration: none;
  color: #666;
  border-radius: 4px;
  transition: all 0.3s;
  font-size: 13px;
}

.nav-links a:hover {
  background: #f0f0f0;
  color: #1890ff;
}

.nav-links a i {
  font-size: 20px;
  margin-bottom: 5px;
}

/* ================================================
   中间主内容区 (1040px)
   ================================================ */
.main-content-area {
  width: 100%;
  max-width: 1040px;
  flex-shrink: 0;
}

/* 面包屑 */
.breadcrumb-bar {
  background: #fff;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #666;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.breadcrumb-bar a {
  color: #1890ff;
  text-decoration: none;
}

.breadcrumb-bar a:hover {
  text-decoration: underline;
}

.breadcrumb-bar span {
  margin: 0 5px;
}

.breadcrumb-bar .current {
  color: #999;
}

/* 文章内容框 */
.article-content-box {
  background: #fff;
  border-radius: 4px;
  padding: 25px 30px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.article-main-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  line-height: 1.5;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #f0f0f0;
}

/* 问答样式 */
.article-qa-box {
  margin-top: 20px;
}

.qa-item {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.qa-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.qa-q {
  background: #1890ff;
}

.qa-a {
  background: #52c41a;
}

.qa-content {
  flex: 1;
  padding-top: 8px;
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.qa-question .qa-content {
  font-weight: 500;
  color: #1890ff;
}

.qa-answer .qa-content {
  text-indent: 2em;
}

/* 内容折叠样式 */
.qa-content-wrapper {
  flex: 1;
  position: relative;
}

.qa-answer .qa-content {
  max-height: 4.5em;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.qa-answer .qa-content.expanded {
  max-height: none;
}

.qa-answer .qa-content:not(.expanded)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, #fff);
}

.expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 0;
  color: #1890ff;
  font-size: 14px;
  cursor: pointer;
  border-top: 1px dashed #e8e8e8;
  margin-top: 10px;
  transition: all 0.3s;
}

.expand-btn:hover {
  color: #096dd9;
}

.expand-btn i {
  transition: transform 0.3s;
}

.expand-btn.expanded i {
  transform: rotate(180deg);
}

.expand-btn.hidden {
  display: none;
}

/* 内容结束广告 */
.content-ad {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

/* 广告块样式 */
.ad-block {
  background: #fff;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: relative;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-block .baidu-ad {
  width: 100%;
  min-height: 90px;
}

.ad-tag {
  position: absolute;
  top: -1px;
  left: 15px;
  background: #ff6b6b;
  color: #fff;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  z-index: 10;
}

.ad-after-article {
  margin-top: 20px;
}

.ad-middle {
  margin: 20px 0;
}

/* 中部广告网格：一行 3 个，最多 5 行（flex 实现，兼容性更好） */
.ad-middle-grid {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-left: -5px;
  margin-right: -5px;
}

.ad-middle-item {
  min-height: 90px;
  box-sizing: border-box;
  flex: 0 0 calc(33.333% - 10px);
  margin: 5px;
}

/* 覆盖通用 .baidu-ad 样式，避免中部广告被拉成整行 */
.ad-middle .ad-middle-item {
  display: block !important;        /* 不用 flex 容器 */
  width: calc(33.333% - 10px) !important;
  margin: 5px !important;
  flex: 0 0 calc(33.333% - 10px) !important;
  max-width: calc(33.333% - 10px) !important;
}

/* 分区标题 */
.section-title {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: #fff;
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(24,144,255,0.2);
}

.section-title i {
  font-size: 18px;
}

/* Smaller breakpoint optimizations */
@media (max-width: 1440px) {
  .content-wrap {
    max-width: 1280px;
    padding: 10px;
  }

  .left-nav-sidebar {
    display: none;
  }

  .duilian-left,
  .duilian-right {
    display: none;
  }
}

@media (max-width: 1200px) {
  .content-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .main-content-area {
    order: 1;
    max-width: 100%;
  }

  .right-sidebar {
    order: 2;
    width: 100%;
  }

  .right-sidebar .sidebar-ad-block,
  .right-sidebar .sidebar-module {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .site-header .bar {
    flex-direction: column;
    align-items: stretch;
  }

  .content-wrap {
    padding: 0;
  }

  .article-content-box {
    padding: 20px;
  }
}

/* 相关文章 - 单列布局 (1000px) */
.related-articles-section {
  margin-top: 20px;
  max-width: 1000px;
}

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

.related-card-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: all 0.3s;
}

.related-card-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateX(5px);
}

.related-card-link {
  text-decoration: none;
  display: block;
}

/* 图文容器 - 水平布局 */
.pic-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100%;
}

.img-container {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
}

.img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.related-card-item:hover .img-container img {
  transform: scale(1.05);
}

.content-container {
  padding: 12px 15px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 15px;
}

.text-content {
  flex: 1;
  min-width: 0;
}

.title-style {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  line-height: 1.5;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desc-style {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.button-style {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: #fff;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.related-card-item:hover .button-style {
  background: linear-gradient(135deg, #096dd9 0%, #0050b3 100%);
}

.button-style span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.button-style span::after {
  content: '→';
  font-size: 12px;
  transition: transform 0.3s;
}

.related-card-item:hover .button-style span::after {
  transform: translateX(3px);
}

/* 推荐列表 */
.more-recommend-section {
  margin-top: 20px;
}

.recommend-feed-list {
  background: #fff;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ================================================
   右侧边栏 (320px)
   ================================================ */
.right-sidebar {
  width: 320px;
  flex-shrink: 0;
}

/* 边栏广告块 */
.sidebar-ad-block {
  background: #fff;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 270px;
}

/* 边栏模块 */
.sidebar-module {
  background: #fff;
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.module-title {
  background: #f7f8fa;
  padding: 12px 15px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #1890ff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.module-title i {
  color: #1890ff;
  font-size: 16px;
}

/* 24小时热文 */
.hot-articles-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hot-articles-list li {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.3s;
}

.hot-articles-list li:last-child {
  border-bottom: none;
}

.hot-articles-list li:hover {
  background: #f9f9f9;
}

.hot-articles-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
}

.hot-articles-list .rank-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: #999;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hot-articles-list li:nth-child(1) .rank-num {
  background: #ff4d4f;
}

.hot-articles-list li:nth-child(2) .rank-num {
  background: #ff7a45;
}

.hot-articles-list li:nth-child(3) .rank-num {
  background: #ffa940;
}

/* 今日看点 */
.today-picks-list {
  padding: 10px 15px;
}

.today-picks-list a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
  transition: color 0.3s;
}

.today-picks-list a:last-child {
  border-bottom: none;
}

.today-picks-list a:hover {
  color: #1890ff;
}

.today-picks-list a::before {
  content: '•';
  color: #1890ff;
  font-weight: 600;
  margin-right: 8px;
}

/* 图文排行 */
.rank-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rank-list li {
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
}

.rank-list li:last-child {
  border-bottom: none;
}

.rank-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333;
  transition: color 0.3s;
}

.rank-list a:hover {
  color: #1890ff;
}

.rank-list .rank-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: #d9d9d9;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rank-list li:nth-child(1) .rank-badge {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #8b4513;
}

.rank-list li:nth-child(2) .rank-badge {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
  color: #666;
}

.rank-list li:nth-child(3) .rank-badge {
  background: linear-gradient(135deg, #cd7f32 0%, #e09b5f 100%);
  color: #fff;
}

/* 百度广告容器 */
.baidu-ad,
.ad-1 {
  min-height: 90px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
}

/* 侧边栏广告适配更大尺寸 */
.sidebar-ad-block .baidu-ad {
  min-height: 250px;
}

/* 骨架屏 */
.skeleton-item {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  height: 40px;
  margin: 8px 0;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 底部固定广告 - 已移除 */

/* ================================================
   响应式适配 - 优化显示策略
   ================================================ */

/* 1600px以上：显示全部三栏 left(130px) + main(1040px) + right(320px) = 1490px */
@media (min-width: 1600px) {
  .left-nav-sidebar {
    display: block;
  }
  .main-content-area {
    display: block;
  }
  .right-sidebar {
    display: block;
  }
}

/* 1440px - 1600px：只显示 main(1040px) + right(320px) = 1370px，隐藏左侧导航 */
@media (min-width: 1440px) and (max-width: 1599px) {
  .content-wrap {
    max-width: 1440px;
  }

  .left-nav-sidebar {
    display: none;
  }

  .main-content-area {
    display: block;
    width: 1040px;
  }

  .right-sidebar {
    display: block;
    width: 320px;
  }
}

/* 1440px以下：只显示 left(130px) + main(自适应)，隐藏右侧边栏 */
@media (max-width: 1439px) {
  .content-wrap {
    max-width: 100%;
  }

  .left-nav-sidebar {
    display: block;
    width: 130px;
  }

  .main-content-area {
    display: block;
    width: auto;
    flex: 1;
    min-width: 0;
  }

  .right-sidebar {
    display: none;
  }
}

/* ================================================
   响应式适配 - 小屏
   ================================================ */
@media (max-width: 992px) {
  .content-wrap {
    flex-direction: column;
  }

  .left-nav-sidebar {
    width: 100%;
  }

  .left-nav-fixed {
    position: static;
    display: flex;
    align-items: center;
    padding: 10px 15px;
  }

  .nav-logo {
    margin: 0;
    padding: 0;
    border: none;
  }

  .nav-links {
    display: flex;
    flex: 1;
    justify-content: space-around;
    margin-left: 20px;
  }

  .nav-links li {
    margin: 0;
  }

  .nav-links a {
    flex-direction: row;
    gap: 5px;
    padding: 8px 12px;
  }

  .nav-links a i {
    margin: 0;
    font-size: 16px;
  }

  .main-content-area {
    order: 1;
  }

  .right-sidebar {
    order: 2;
    width: 100%;
  }
}

/* ================================================
   响应式适配 - 移动端
   ================================================ */
@media (max-width: 768px) {
  .content-wrap {
    padding: 5px;
    gap: 5px;
  }

  .article-content-box {
    padding: 15px;
  }

  .article-main-title {
    font-size: 20px;
  }

  .qa-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .qa-content {
    font-size: 14px;
  }

  .nav-links a span {
    display: none;
  }

  .breadcrumb-bar {
    font-size: 12px;
    padding: 8px 10px;
  }

  /* 相关文章卡片移动端优化 */
  .related-articles-section {
    max-width: 100%;
  }

  .related-articles-grid {
    gap: 10px;
  }

  .pic-container {
    flex-direction: column;
  }

  .img-container {
    width: 100%;
    height: 120px;
  }

  .content-container {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .title-style {
    font-size: 14px;
    white-space: normal;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .desc-style {
    font-size: 12px;
    white-space: normal;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .button-style {
    width: 100%;
    justify-content: center;
  }
}

/* ================================================
   打印样式
   ================================================ */
@media print {
  .left-nav-sidebar,
  .right-sidebar,
  .ad-block,
  .baidu-ad,
  .breadcrumb-bar {
    display: none !important;
  }

  .content-wrap {
    display: block;
  }

  .article-content-box {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
