/* ===== 全局基础 ===== */
body {
  background-color: #f9fafb;
  font-family: "Inter", system-ui, sans-serif;
  color: #1e293b;
  margin: 0;
  padding: 0;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== 头部整体 ===== */
.header-top {
  background-color: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.header-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
@media (min-width: 768px) {
  .header-flex {
    flex-direction: row;
  }
}
.header-logo a {
  font-size: 48px;
  font-weight: bold;
  color: #3b82f6;
  text-decoration: none;
}
.header-banner {
  background-color: #3b82f6;
  color: white;
  font-weight: 500;
  padding: 8px;
  text-align: right;
}

/* ===== 导航栏 ===== */
.header-nav {
  background-color: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 10px;
}
.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
}
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}
.nav-item {
  position: relative;
}
.nav-item a {
  display: block;
  padding: 12px 16px;
  color: #1e293b;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}
.nav-item.active a,
.nav-item a:hover {
  background-color: #3b82f6;
  color: white;
}

.nav-item.active a {
  background-color: #3b82f6;
  color: white;
}

.nav-menu:hover .nav-item.active:not(:hover) a {
  background-color: transparent;
  color: #1e293b;
}
.nav-item.dropdown:hover .dropdown-menu {
  display: block;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 10;
  min-width: 160px;
}
.dropdown-item a {
  display: block;
  padding: 8px 16px;
  color: #1e293b;
}
.dropdown-item a:hover {
  background-color: #3b82f6;
  color: white;
}
#mobile-menu-button {
  background: none;
  border: none;
  color: #1e293b;
  font-size: 20px;
  cursor: pointer;
}
#mobile-menu {
  display: none;
  padding-bottom: 12px;
  list-style: none; /* 新增 */
  margin: 0; /* 新增 */
  padding: 0; /* 新增 */
}
#mobile-menu li { /* 新增 */
    margin: 0;
    padding: 0;
}
#mobile-menu a {
  display: block;
  padding: 8px 16px;
  color: #1e293b;
  text-decoration: none;
}
#mobile-menu a:hover {
  color: #3b82f6;
}
@media (min-width: 768px) {
  .nav-menu { display: flex; }
  #mobile-menu-button { display: none; }
}
/* 移动端子菜单样式 */

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-dropdown-toggle i {
    transition: transform 0.3s ease;
}

.active .mobile-dropdown-toggle i {
    transform: rotate(180deg);
}

/* 移动端子菜单默认隐藏 */
.mobile-dropdown-menu {
  display: none;
}

/* 激活状态时显示子菜单 */
.mobile-dropdown.active .mobile-dropdown-menu {
  display: block;
}


/* ===== 主体布局 ===== */
main {
  padding: 8px 0 16px;
}
.main-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 1024px) {
  .main-layout { flex-direction: row; gap: 10px; }
}
.left-content { flex: 3; min-width: 0; }
.right-sidebar { flex: 1; max-width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 1280px) {
    .right-sidebar {
        max-width: 100%;
        width: 100%;
    }
    .main-layout {
        flex-direction: column; /* 确保移动端动端垂直排列 */
    }
}
/* ===== 模块与卡片 ===== */
.section-gap { margin-top: 10px; }
.card {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.card-block { border-top: 2px solid #ef4444; }
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f9fafb;
  padding: 10px 15px;
}
.card-header a {
  color: #1e293b;
  text-decoration: none;
  font-weight: 600;
}
.card-header a:hover { color: #3b82f6; }
.card ul {
  list-style: none;
  margin: 0;
  padding: 12px;
  width: 100%;
  box-sizing: border-box;
}
.card li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}
.card li a {
  max-width: calc(100% - 80px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  color: #1e293b;
  text-decoration: none;
}
.card li a:hover { color: #3b82f6; }
.card li span { flex-shrink: 0; color: #6b7280; font-size: 13px; }

/* ===== 右侧边栏 ===== */
.sidebar { padding: 0 12px; width: 100%; box-sizing: border-box; }
.right-sidebar .card { margin-bottom: 10px; border: 1px solid #e5e7eb; padding: 0 15px;}

.sidebar-title-text { position: relative; margin-top: 10px; margin-bottom: 10px;}
.sidebar-title-line { width: 100%; height: 2px; background-color: #e5e7eb; position: relative; top: -2px; }
.sidebar-title-line::after { content: ''; position: absolute; left: 0; bottom: 0; width: 80px; height: 2px; background-color: #ef4444; }

/* 右侧边栏列表排版 */
.sidebar ul { padding-left: 0; margin: 0; width: 100%; box-sizing: border-box; }
.sidebar ul li { display: flex; align-items: center; margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px solid #f1f5f9; width: 100%; box-sizing: border-box; white-space: nowrap; }
.sidebar ul li:last-child { border-bottom: none; }
.sidebar ul li .text-content { flex: 1 1 0; min-width: 0; line-height: 1.1; overflow: hidden; }
.sidebar ul li .text-content .title-link {max-width: calc(100% - 10px); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #1e293b; text-decoration: none; }
.sidebar ul li .text-content .title-link:hover { color: #3b82f6; }
.sidebar ul li .text-content .date { display: block; font-size: 12px; color: #6b7280; }

/* ===== 图片轮播 ===== */
.carousel { position: relative; overflow: hidden; height: 100%; margin-bottom: 0;}
.carousel-inner { display: flex; width: 100%; height: 100%; transition: transform 0.5s ease; }
.carousel-item { flex: 0 0 100%; height: 100%; position: relative; }
.carousel-item img { width: 100%; height: 100%; display: block; object-fit: cover; }
.carousel-indicators { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.carousel-indicator { width: 10px; height: 10px; background: rgba(255,255,255,0.6); cursor: pointer; }
.carousel-indicator.active { background: white; }
.carousel-control-prev,
.carousel-control-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.3); color: white; border: none; width: 36px; height: 36px; cursor: pointer; z-index: 5;
}
.carousel-control-prev { left: 8px; }
.carousel-control-next { right: 8px; }
.carousel-caption {
  /* 定位在图片底部居中 */
  position: absolute;
  bottom: 30px; /* 距离底部距离，可调整 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 4; /* 确保在图片上方 */

  /* 文字样式 - 红色突出显示 */
  color: #ff0000; /* 红色文字 */
  font-size: 18px; /* 标题大小 */
  font-weight: bold;

  text-align: center;

  /* 可选：添加半透明背景增强可读性

  */

    background-color: rgba(0, 0, 0, 0.5);
  padding: 0 4px;
  /* 防止文字换行溢出 */
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 文字描边 */
  -webkit-text-stroke: 0.5px #fff;
  text-shadow:
    -0.5px -0.5px 0 #fff,
     0.5px -0.5px 0 #fff,
    -0.5px  0.5px 0 #fff,
     0.5px  0.5px 0 #fff;

}

/* ===== 横排区 ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; margin-bottom: 0; }
.grid-2 > * { align-self: stretch; }
@media (max-width: 1280px) {
    .grid-2 {
        grid-template-columns: 1fr; /* 移动端列改为单列列 */
    }
}
/* ===== 功能区按钮 ===== */
.button-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px; }
.btn { padding: 8px 16px; border: none; cursor: pointer; font-size: 14px; color: white; transition: 0.3s; }
.btn:hover { background-color: #b7c4d8; }
.btn-blue { background-color: #3b82f6; }
.btn-blue:hover { background-color: #2563eb; }
.btn-gray { background-color: #6b7280; }
.btn-gray:hover { background-color: #4b5563; }
.btn-amber { background-color: #f59e0b; }
.btn-amber:hover { background-color: #d97706; }
.btn-green { background-color: #22c55e; }
.btn-green:hover { background-color: #16a34a; }



/* ===== 友情链接 ===== */
.friend-links { background-color: #fff; color: #111; padding: 8px 0 16px 0; margin-top: 0px;}
.friend-links h3 {font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.friend-links .links-wrap { display: flex; flex-wrap: wrap; gap: 12px; }
.friend-links a { color: #111; text-decoration: none; font-size: 14px; }
.friend-links a:hover { color: #3b82f6; }

/* ===== 页脚 ===== */
footer { background-color: #1f2937; color: white; margin-top: 8px; padding-bottom: 12px; font-size: 14px; color: #9ca3af; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-grid h3 { font-size: 16px; margin-bottom: 12px; color: white;}
.footer-grid a { color: #9ca3af; text-decoration: none; display: block; margin: 4px 0; }
.footer-grid a:hover { color: white; }
.footer-icons a { display: inline-flex; width: 36px; height: 36px; background-color: #374151; align-items: center; justify-content: center; margin-right: 8px; transition: 0.3s; }
.footer-icons a:hover { background-color: #3b82f6; }
.footer-bottom { border-top: 1px solid #374151; text-align: center; margin-top: 16px; padding-top: 8px; color: #9ca3af; font-size: 12px; }

/* ===== 版块标题左侧蓝条 ===== */
.section-title-blue { position: relative; padding-left: 10px; font-weight: 600; color: #1e293b; display: inline-block; }
.section-title-blue::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 16px; background-color: #3b82f6; }

/* ===== 通用小方框样式 ===== */
.box { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-size: 12px; font-weight: 500; color: white !important; flex-shrink: 0; }
.box-blue { background-color: #3b82f6; }
.box-gray { background-color: #9ca3af; }
.box-amber { background-color: #f59e0b; }
.box-green { background-color: #22c55e; }
.box-red { background-color: #ef4444; }

/* ===== 文章列表新容器样式 ===== */
.article-container {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-top: 2px solid #ef4444;
  margin-bottom: 10px;
  overflow: hidden;
}

/* ===== 文章列表样式 ===== */
.article-list {
  padding: 15px;
}
.article-item {
  padding: 15px 0;
  border-bottom: 1px solid #f1f5f9;
}
.article-item:last-child {
  border-bottom: none;
}

/* 标题与阅读量同行样式 */
.article-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.article-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
}
.article-title:hover {
  color: #3b82f6;
}

.article-views {
  font-size: 13px;
  color: #64748b;
  margin-left: 10px;
  white-space: nowrap;
}

.article-content {
  margin-bottom: 30px;
  line-height: 1.6;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 12px;
  background-color: #f1f5f9;
  color: #64748b;
  text-decoration: none;
}
.tag-color1 { background-color: #dbeafe; color: #1e40af; }
.tag-color2 { background-color: #fef3c7; color: #92400e; }
.tag-color3 { background-color: #dcfce7; color: #166534; }
.tag-color4 { background-color: #fee2e2; color: #991b1b; }
.tag-color5 { background-color: #e0e7ff; color: #4338ca; }

.tag:hover {
  background-color: #e2e8f0;
}

.article-date {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

/* 文章页 */
.article-breadcrumb {
    font-size: 14px;
    color: #64748b;
    margin: 12px 0;
}
.crumb-link {
    color: #64748b;
    text-decoration: none;
}
.crumb-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}
.crumb-current {
    color: #1e293b;
}

.article-container {
    padding: 20px;
    line-height: 1.8;
}

.article-main-title {
    font-size: 24px;
    color: #1e293b;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.article-meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.article-tags-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.article-summary {
    background-color: #f8fafc;
    border-left: 3px solid #3b82f6;
    padding: 2px 10px;
    margin: 15px 0;
}
.article-summary h3 {
    margin-top: 8px;
    margin-bottom: 0px;
    font-size: 16px;
    color: #1e293b;
}
.article-summary p {
    margin: 4px 0px;
}
.article-content h2.content-title {
    font-size: 20px;
    color: #1e293b;
    margin: 25px 0 15px 0;
    padding-left: 8px;
    border-left: 3px solid #ef4444;
}

.article-content h3.content-subtitle {
    font-size: 18px;
    color: #1e293b;
    margin: 20px 0 12px 0;
}

.article-content p {
    margin: 0 0 15px 0;
    color: #334155;
}

.article-content .content-list {
    margin: 0 0 15px 20px;
    padding-left: 10px;
}
.article-content .content-list li {
    margin-bottom: 8px;
}

/* 声明模块 */
.article-declaration {
    padding: 0;
    margin: 10px 0;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.declaration-container {
    display: flex;
}

.declaration-left {
    background-color: #3b82f6; /* 左侧背景色 */
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 10px 5px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.declaration-right {
    flex: 1;
    padding: 10px 15px;
}

.declaration-right p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.declaration-right p:last-child {
    margin-bottom: 0;
}

.article-url {
    color: #1e293b; /* 默认链接色 */
    text-decoration: none;
}

.article-url:hover {
    color: #3b82f6; /* 鼠标经过变色 */
    text-decoration: underline;
}

.article-navigation {
    margin: 15px 0;
    padding: 15px;
    background-color: #f9fafb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-prev, .nav-next {
    margin-bottom: 10px;
}
.nav-prev:last-child, .nav-next:last-child {
    margin-bottom: 0;
}
.nav-label {
    font-weight: 600;
    color: #1e293b;
}
.nav-link {
    color: #3b82f6;
    text-decoration: none;
}
.nav-link:hover {
    text-decoration: underline;
}

.related-articles {
    margin: 10px 0;
    padding: 15px;
}
.related-title {
    margin-top: 0;
    margin-bottom: 15px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}
.related-item {
    text-decoration: none;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.related-item:hover .related-text {
    color: #3b82f6;
}
.related-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}
.related-text {
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
