/* Google Fonts 引入，必须放最前面 */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@600&family=Fira+Code&display=swap');

/* 🌟 修改点 1：主题色调整（可选） 
   目前是飞凌主蓝 #005bac。如果 embedSBC 有自己的品牌色（比如科技黑、极客绿或深空灰），可以在这里全局替换 */
.wy-side-nav-search {
  background-color: #005bac !important; 
}

/* 搜索栏中版本号字体颜色 */
.wy-side-nav-search > div.version {
  color: white;
}

/* 侧边栏菜单项 hover 效果 */
.wy-menu-vertical a:hover {
  background-color: #e6f0ff !important;
  color: #005bac !important;
}

/* 扩展主内容区域宽度 */
.wy-nav-content {
  max-width: 1200px;
}

/* 正文字体，主体区域和容器统一 */
body, .rst-content, .wy-nav-content {
  font-family: 'Lato', Arial, sans-serif !important;
  font-size: 16px;
  line-height: 1.7;
  color: #2c2c2c;
}

/* 标题统一字体设定 */
.rst-content h1, .rst-content h2, .rst-content h3, .rst-content h4, .rst-content h5, .rst-content h6 {
  font-family: 'Montserrat', 'Lato', sans-serif !important;
  font-weight: 600;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* 分级颜色设置 */
.rst-content h1 { color: #0071e3 !important; }
.rst-content h2 { color: #2c2c2c !important; }
.rst-content h3 { color: #2c2c2c !important; }

/* 链接样式 */
a {
  color: #0071e3;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* 正文内页面目录（Table of Contents）字体 */
.rst-content .toctree-wrapper, .rst-content .toctree-wrapper ul, .rst-content .toctree-wrapper li, .rst-content .toctree-wrapper a {
  font-family: 'Lato', Arial, sans-serif !important;
  font-size: 16px !important;            
  color: #333333 !important;              
  line-height: 1.5 !important;
  text-decoration: none !important;
}
.rst-content .toctree-wrapper a:hover { color: #0071e3 !important; }
.rst-content .toctree-wrapper > p {
  font-family: 'Montserrat', 'Lato', sans-serif !important;
  font-weight: 600 !important;
  font-size: 24px !important;
  color: #0071e3 !important;            
  margin-bottom: 0.5em !important;
}

/* 禁止页面横向滚动 */
body { overflow-x: hidden; }

/* 移动端优化 */
@media (max-width: 768px) {
  .wy-nav-content {
    max-width: 100% !important;
    padding: 1em !important;
    box-sizing: border-box;
  }
  .rst-content .toctree-wrapper > p { font-size: 18px !important; }
  .rst-content .toctree-wrapper a { font-size: 14px !important; }
  pre { overflow-x: auto; }
}



/* ================== 🌟 修改点 2：将原有的 Product 样式重构为 News 资讯流样式 ================== */
/* 容器：采用更现代的 Grid 网格布局，自动适配屏幕 */
.news-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 20px 0;
  align-items: stretch !important; /* 🌟 确保同一排的卡片绝对等高 */
}

/* 单个资讯卡片 */
.news-card {
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

/* 资讯封面图及超链接容器（强力锁死高度至 200px） */
.news-card a {
  display: block !important;
  width: 100% !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: none !important; 
}

img.news-thumbnail {
  width: 100% !important;
  height: 200px !important;
  min-height: 200px !important; 
  max-height: 200px !important; 
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 8px 8px 0 0 !important; 
}

.news-card:hover .news-thumbnail {
  opacity: 0.9;
}

/* 资讯文字内容区（进一步压缩底部留白） */
.news-content {
  padding: 16px 16px 24px 16px !important; 
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-date, .news-category {
  font-size: 0.8rem !important; 
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 0 !important;
  margin-bottom: 6px !important; 
}

/* ================== 🌟 重点修改：标题强制统一高度 (放宽至 3 行) ================== */
.news-title {
  font-size: 1.1rem !important; 
  color: #24292e !important;
  margin: 0 0 8px 0 !important; 
  line-height: 1.3 !important;
  font-family: 'Montserrat', sans-serif !important;
  
  /* 强制溢出隐藏并显示省略号 */
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important; /* 🌟 增加到 3 行 */
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  height: 3.9em !important; /* 🌟 1.3 的行高 * 3 行 = 3.9em 锁死高度 */
}

/* ================== 🌟 重点修改：摘要强制统一高度 (放宽至 4 行) ================== */
.news-excerpt {
  color: #586069;
  font-size: 0.9rem !important; 
  line-height: 1.5 !important;
  margin-top: 0 !important;
  margin-bottom: 24px !important; 
  
  /* 强制溢出隐藏并显示省略号 */
  display: -webkit-box !important;
  -webkit-line-clamp: 4 !important; /* 🌟 增加到 4 行 */
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  height: 6em !important; /* 🌟 1.5 的行高 * 4 行 = 6.0em 锁死高度 */
}

/* ================== 🌟 恢复为纯文本链接样式 ================== */
.link-more {
  align-self: flex-start !important; 
  margin-top: auto !important; /* 配合上方的锁死高度，这会让所有按钮像强迫症一样在底部完美对齐 */
  
  /* 恢复极简文字风格 */
  color: #0071e3 !important;         
  font-weight: 600 !important;
  font-size: 0.9em !important;
  text-transform: uppercase;
  text-decoration: none !important;  
  
  /* 彻底洗掉之前的按钮和高度占位属性 */
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  height: auto !important;
  line-height: normal !important;
  box-shadow: none !important;
  display: inline-block !important;
}

/* 简单的文字悬浮效果 */
.link-more:hover {
  color: #005bb5 !important; 
  text-decoration: underline !important; 
  
  /* 清理按钮悬浮特效 */
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important; 
}


/* ================== 🌟 修改点 3：视频评测版块专属样式 ================== */
.video-essay-section {
  padding: 20px 0;
}
.video-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.video-cover {
  width: 100%;
  height: auto;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.video-card:hover .video-cover {
  opacity: 0.5;
}
.video-info {
  position: absolute;
  bottom: 30px;
  left: 30px;
  color: white;
  max-width: 80%;
}
.video-info h3 {
  color: white !important;
  font-size: 1.8rem !important;
  margin-bottom: 10px !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.btn-watch {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 24px;
  background-color: #ff0000; /* YouTube 红 */
  color: white !important;
  border-radius: 6px;
  font-weight: bold;
}
.btn-watch:hover { background-color: #cc0000; text-decoration: none; }


/* ================== 🌟 修改点 4：暗色主题适配类名同步更新 ================== */
.theme-dark .news-card {
  background-color: #1e1e1e !important; 
  border-color: #333 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.theme-dark .news-title { color: #f5f5f5 !important; }
.theme-dark .news-date, .theme-dark .news-category { color: #999; }
.theme-dark .news-excerpt { color: #bbb; }
.theme-dark .link-more { color: #4da3ff; }
.theme-dark .news-thumbnail { filter: brightness(0.85); }


/* ================== 🌟 修改点 5：更新 Banner 类名以匹配新闻站 ================== */
.banner-news {
  position: relative;
  width: 100%;
  min-height: 400px;  /* 资讯站不需要像官网产品图那么高 */
  border-radius: 12px; /* 给 banner 加个圆角显得更极客 */
  background: url('images/banner/banner-bg.webp') center/cover no-repeat;
  overflow: hidden;
  margin-bottom: 40px;
}
.banner-content {
  position: absolute;
  bottom: 40px;
  left: 40px;
  max-width: 600px;
  color: white;
  z-index: 2;
}
.banner-news::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  z-index: 1;
}
.category-tag {
  background: #0071e3;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 15px;
  display: inline-block;
}
.banner-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: white !important;
}
.banner-content p {
  font-size: 1.1rem;
  margin-bottom: 25px;
  color: #e0e0e0 !important;
}


.btn-read-more {
  background-color: white !important;
  color: #24292e !important;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  text-decoration: none !important; /* 去除默认状态下的下划线 */
  border-bottom: none !important;   /* 防止部分主题用底部边框模拟下划线 */
  display: inline-block;            /* 确保 padding 正常生效 */
}

.btn-read-more:hover { 
  background-color: #f0f0f0 !important; 
  text-decoration: none !important; /* 确保鼠标悬停时也没有下划线 */
  border-bottom: none !important; 
}


@media (max-width: 768px) {
  .banner-content { left: 20px; bottom: 20px; max-width: 90%; }
  .banner-content h1 { font-size: 1.8rem; }
  .video-info h3 { font-size: 1.3rem !important; }
}


/* =====================================================
   RTD 移动端：目录打开时正文等比例缩小 (保留不动)
   ===================================================== */
@media (max-width: 768px) {
    .wy-nav-top { position: fixed !important; top: 0; left: 0; right: 0; z-index: 9999; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
    .wy-nav-top .fa-bars { position: fixed; top: 10px; right: 10px; z-index: 10000; }
    .wy-nav-side { width: 35% !important; transition: left 0.3s ease; }
    .wy-nav-content-wrap { transition: transform 0.3s ease, left 0.3s ease; transform-origin: right top !important; background-color: #fcfcfc; }
    .wy-nav-content-wrap.shift {
        left: 0 !important;
        transform: scale(0.65) !important;
        box-shadow: -10px 0 20px rgba(0,0,0,0.2);
        height: 153.85vh !important;
        overflow-y: auto !important;
    }
}