/*User CSS*/

/* 浅灰文字/边框在老显示器上过淡：整体加深 gray-400/500 与 muted */
:root,
[data-bs-theme=light] {
  --bs-gray-400: #8d949c;
  --bs-gray-500: #6c757d;
  --bs-secondary-color: #999;
  --bs-secondary-color-rgb: 153, 153, 153;
  --bs-tertiary-color: rgba(89, 93, 105, 0.85);
  /* 原阴影 rgba(83,88,93,0.15) 且无位移，老显示器上看不见 */
  --bs-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  --bs-box-shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.16);
  --bs-box-shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.22);
}
.text-muted,
.text-body-secondary,
.text-body-tertiary {
  color: #999 !important;
}

/* 全局重置 - 确保移动端没有左右间隙 */
@media (max-width: 768px) {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }
  
  /* 重置所有Bootstrap容器的默认边距 */
  .container, .container-fluid, .container-xxl, .container-xl, .container-lg, .container-md, .container-sm {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}
/* 页脚背景跟随配色方案（覆盖 bg-dark，比页头浅一档） */
footer.bg-dark {
    background-color: var(--sc-header-hover) !important;
}

/* 深色页脚内：辅助文字与免责声明保持浅色，不受全局主题深档辅助色影响 */
footer .text-muted,
footer .text-body-secondary,
footer .text-body-tertiary {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* 页脚链接/备案项：深底上提亮（覆盖 text-primary-hover 的 gray-400 与主题色 hover） */
footer .text-primary-hover {
    color: rgba(255, 255, 255, 0.75) !important;
}

footer .text-primary-hover a,
footer .text-primary-hover li,
footer .footer-nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

footer .text-primary-hover a:hover,
footer .footer-nav-link:hover {
    color: #fff !important;
    text-decoration: underline;
}

/* Header样式覆盖 */
header {
    background-color: var(--sc-header-bg) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    color: #ffffff !important;
    position: relative;
    z-index: 1030;
  }
  
  /* Header固定状态 - 幻灯片从上滑入效果 */
  header.navbar-sticky-on {
    position: fixed !important;
    top: 0 !important;
    z-index: 1030 !important;
    -webkit-animation: slideInFromTop 0.6s ease-out !important;
    animation: slideInFromTop 0.6s ease-out !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  }
  
  /* 从上方滑入的动画 - 只改变位置，不改变透明度 */
  @keyframes slideInFromTop {
    0% {
      transform: translateY(-100%);
    }
    100% {
      transform: translateY(0);
    }
  }
  
  /* 兼容webkit浏览器 */
  @-webkit-keyframes slideInFromTop {
    0% {
      -webkit-transform: translateY(-100%);
      transform: translateY(-100%);
    }
    100% {
      -webkit-transform: translateY(0);
      transform: translateY(0);
    }
  }
  
  /* 导航链接行高和颜色 */
  .navbar-nav .nav-link {
    line-height: 30px;
    color: #ffffff !important;
  }
  .navbar-nav .nav-link:hover {
    background-color: var(--sc-header-hover) !important;
  }
  
  /* 减小导航菜单的左右边距 */
  .navbar-nav.navbar-nav-scroll.mx-auto {
    margin-left: 2rem !important;
    margin-right: 2rem !important;
  }
  
  /* 下拉菜单背景色 */
  .nav-item.dropdown .dropdown-menu {
    background-color: var(--sc-header-hover) !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    z-index: 1050 !important;
  }
  .nav-item.dropdown .dropdown-menu .dropdown-item {
    color: #ffffff !important;
  }
  .nav-item.dropdown .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
  }
  
  /* 搜索图标颜色 */
  .nav-search .nav-link {
    color: #ffffff !important;
  }
  .nav-search .nav-link:hover {
    color: #ffffff !important;
    opacity: 0.8;
  }
  
  /* 自定义5列布局 */
  .col-md-2-4 {
    -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    width: 20%;
    padding-left: 1px;
    padding-right: 1px;
  }
  
  /* A4图书比例优化 */
  .card-img {
    aspect-ratio: 1/1.414; /* A4比例 */
    -o-object-fit: cover;
       object-fit: cover;
    width: 100%;
  }

  .card-img-top {
    border-top-left-radius: 0px !important;
    border-top-right-radius: 0px !important;
  }

  /* 文库列表封面：悬停放大只动 transform；灰度挂在链接上，避免 filter+scale 同层卡顿 */
  .library-card .library-cover-wrap {
    overflow: hidden;
  }

  .library-card .library-cover-link {
    display: block;
    overflow: hidden;
    line-height: 0;
  }

  .library-card .library-cover-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.414;
    /* object-fit: cover; */
    object-position: top center;
    image-rendering: auto;
    display: block;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* 封面未生成/加载失败：占位块与封面同比例，避免破图 */
  .library-card .library-cover-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1.414;
    min-height: 140px;
    background: linear-gradient(160deg, #f5f7fa 0%, #FFFFFF 100%);
    color: #FFFFFF;
    border: 0;
  }

  .library-card .library-cover-placeholder .fa-file-pdf {
    opacity: 0.55;
  }

  .library-card .library-cover-img.error,
  .library-card .library-cover-img[data-cover-failed="1"] {
    display: none !important;
  }

  .library-card:hover .library-cover-img {
    transform: scale(1.08);
    will-change: transform;
  }

  /* 游客灰度：滤镜在链接层，封面本身不再叠 filter，悬停放大更顺 */
  .library-card .card-image-grayscale > .library-cover-link {
    filter: grayscale(100%);
  }
  .library-card .card-image-grayscale .library-cover-img {
    filter: none !important;
  }
  
  /* 移动端操作按钮 - 自动换行，全部可见 */
  @media (max-width: 991.98px) {
    .mobile-action-buttons {
      width: 100%;
      overflow: visible;
    }
    
    .mobile-action-buttons .btn {
      font-size: 0.7rem;
      padding: 0.2rem;
      border-radius: 0.25rem;
      transition: all 0.2s ease;
      width: 32px;
      height: 32px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      white-space: nowrap;
    }
    
    .mobile-action-buttons .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }
    
    .mobile-action-buttons .btn-sm {
      font-size: 0.65rem;
      padding: 0.15rem;
      width: 28px;
      height: 28px;
    }
    
    .mobile-action-buttons .d-flex {
      gap: 0.35rem;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
      width: 100%;
      overflow: visible;
    }
    
    .mobile-action-buttons .flex-shrink-0 {
      flex-shrink: 0 !important;
      flex-grow: 0 !important;
    }
  }
  
  /* 标题超过2行时自动隐藏 */
  .text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-height: 2.4em;
    min-height: 2.4em;
    word-wrap: break-word;
    word-break: break-word;
    -webkit-hyphens: auto;
        -ms-hyphens: auto;
            hyphens: auto;
  }
  
  /* 卡片标题样式优化 */
  .card-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
  }
  
  /* 响应式搜索框样式 */
  .nav-search .input-group {
    min-width: 200px;
  }
  .nav-search .input-group .form-control {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }
  .nav-search .input-group .form-control::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
  }
  .nav-search .input-group .form-control::-moz-placeholder {
    color: rgba(255, 255, 255, 0.7);
  }
  .nav-search .input-group .form-control:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
  }
  .nav-search .input-group .form-control::-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.7);
  }
  .nav-search .input-group .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
  }
  .nav-search .input-group .form-control:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.2);
    -webkit-box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
            box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }
  
  /* 标签页内容样式 */
  .tab-content {
    padding: 10px 0;
    margin-bottom: 0px;
  }
  
  /* 卡片标题动画效果 */
  .card-title a:hover {
    color: var(--bs-primary) !important;
  }
  
  /* 卡片悬停效果 */
  .card {
    -webkit-transition: -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease;
    transition: -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease, -webkit-transform 0.3s ease, -webkit-box-shadow 0.3s ease;
    border-radius: 0px !important;
    -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  }
  .card:hover {
    -webkit-transform: translateY(-5px);
            transform: translateY(-5px);
    -webkit-box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22) !important;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22) !important;
  }
  /*# sourceMappingURL=style.css.map */
  
  /* 背景样式设置（主题页头色混白提亮一档半；soft-light 让 bg.png 纹理柔和叠加，不再压暗底色） */
  main {
    background: color-mix(in srgb, var(--sc-header-bg) 45%, #FFF 65%) url(/static/bg.png) fixed !important;
    background-blend-mode: soft-light;
  }
  
  /* 专题卷宗外壳透出全站背景 */
  .container:not(header .container):not(footer .container):not(.dossier-cover-inner):not(.dossier-top):not(.dossier-shell) {
    background-color: white !important;
  }
  
/* 重写container的内边距 */
.container, .container-fluid, .container-xxl, .container-xl, .container-lg, .container-md, .container-sm {
  padding-left: 5px !important;
  padding-right: 5px !important;
}

/* 公告区域布局优化 */
.announcement-container {
  width: 100% !important;
}

.announcement-container .tiny-slider {
  width: 100% !important;
  flex: 1 !important;
}

.announcement-container .tiny-slider-inner {
  width: 100% !important;
}

/* 首页专题：与简报同款，始终一行 3 格，小屏缩放不换行 */
.home-topics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-topics-brief-gap {
  height: 0.3rem;
}

.policy-brief-row {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  min-width: 0;
}

.policy-brief-row-label {
  flex: 0 0 clamp(1.15rem, 0.9rem + 0.7vw, 1.65rem);
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.18em;
  padding: 0.25rem 0;
  font-size: clamp(0.58rem, 0.48rem + 0.35vw, 0.72rem);
  font-weight: 700;
  line-height: 1.1;
  color: #fff !important;
  text-decoration: none !important;
  /* border-radius: 3px; */
  user-select: none;
  transition: filter 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

a.policy-brief-row-label:hover {
  color: #fff !important;
  text-decoration: none !important;
  filter: brightness(1.08);
}

.policy-brief-row-label.is-topic {
  background: color-mix(in srgb, var(--sc-btn-active) 70%, transparent);
}

.policy-brief-row-label.is-brief {
  background: color-mix(in srgb, var(--sc-btn-active) 70%, transparent);
}

/* 首页快捷发布卡：同色系三档（主色/悬停/按下），与主题相近、深浅交错；背景叠加 70% 透明档与侧栏栏目卡一致 */
.hero-quick-tone-bright {
  background: color-mix(in srgb, var(--bs-primary) 70%, transparent);
}

.hero-quick-tone-mid {
  background: color-mix(in srgb, var(--sc-btn-hover) 70%, transparent);
}

.hero-quick-tone-deep {
  background: color-mix(in srgb, var(--sc-btn-active) 70%, transparent);
}

a.hero-quick-tone-bright:hover,
a.hero-quick-tone-mid:hover,
a.hero-quick-tone-deep:hover {
  filter: brightness(1.08);
}

.policy-brief-row .policy-brief-grid {
  flex: 1 1 auto;
  min-width: 0;
}

/* 专题格子：同色系三档（悬停/主色/按下），背景叠加 70% 透明档与侧栏栏目卡一致 */
.home-topic-tone-navy {
  background: color-mix(in srgb, var(--sc-btn-hover) 70%, transparent);
}

.home-topic-tone-amber {
  background: color-mix(in srgb, var(--bs-primary) 70%, transparent);
}

.home-topic-tone-slate {
  background: color-mix(in srgb, var(--sc-btn-active) 70%, transparent);
}

/* 问题卡片响应式布局 - 小屏幕使用12列 */
@media (max-width: 575.98px) {
  .question-card-container {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* 页脚链接防止换行 */
.footer-nav-link {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.9rem !important;
}

/* 页脚列在小屏幕下的调整 - 始终保持2列布局 */
@media (max-width: 768px) {
  .footer-nav-col {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

@media (max-width: 576px) {
  .footer-nav-col {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

/* Tiny Slider 轮播样式优化 */
.tiny-slider .card {
  border: none;
  border-radius: 0;
}

.tiny-slider .card-img-overlay {
  background: linear-gradient(to bottom, transparent 30%, rgba(153, 239, 241, 0.3) 50%, rgba(var(--bs-primary-rgb), 0.25) 70%)
}

/* Tiny Slider 响应式高度 */
.tiny-slider .card {
  height: 544px !important;
}

@media (max-width: 992px) {
  .tiny-slider .card {
    height: 380px !important;
  }
}

@media (max-width: 480px) {
  .tiny-slider .card {
    height: 480px !important;
  }
}


  /* 分类导航容器基础样式 */
.category-navigation-container {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* 分类按钮容器 - 包含一二三级分类 */
.category-buttons-container {
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 当整个容器没有内容时高度为0 */
.category-buttons-container:empty {
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

/* 一级分类区域 */
.first-level-section {
    padding: 0.5rem;
    border-bottom: 0px solid #e9ecef;
}

/* 二级分类区域 */
.second-level-section {
    padding-bottom: 0.5rem;
    border-bottom: 0px solid #e9ecef;
}

/* 三级分类区域 */
.third-level-section {
    padding-bottom: 0.5rem;
    border-bottom: 0px solid #e9ecef;
}

/* 一级分类按钮样式 */

/* 列表卡片标题：语义用 h3，字号锁回原 h5/h6，避免被全站 h3 !important 撑大 */
h3.list-card-title.h6 {
  font-size: 14px !important;
  font-weight: 700;
  margin-top: 0;
}

h3.list-card-title.h5,
h3.question-title.list-card-title {
  font-size: 16px !important;
}

/* 列表可见 h1：对齐面包屑字号，避免被全站 h1 !important 撑大 */
.list-page-h1 {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: #6c757d !important;
  margin: 0 0 0.35rem !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* 首页 logo 上的 h1：保持原 logo 字号与样式 */
header h1.logo-text-small {
  font-size: 1.25rem !important;
  font-weight: bold !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  color: #ffffff !important;
  display: inline-block;
}

/* 面包屑末级：h1 内联，视觉与原「xxx列表」一致；仅桌面显示 */
.breadcrumb-item .list-page-h1--crumb {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
}

.first-level-btn {
    position: relative !important;
    overflow: visible !important;
    z-index: 1 !important;
    padding-bottom: 0rem !important;
    margin-top: -1.8rem !important;
}

/* 面包屑区域 */
.breadcrumb-area {
    border-top: 0px solid #e9ecef;
    padding: 0.5rem;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 平滑过渡效果 */
.category-buttons-container,
.breadcrumb-area {
    transition: all 0.3s ease;
}

.btn {  
  border-radius: 0px !important;
}

/* 按钮样式优化 */
.btn-xs {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 12px;
    white-space: nowrap;
}


/* 排序按钮组样式 */
.btn-group .btn-xs {
    text-decoration: none;
    display: inline-block;
}

.btn-group .btn-xs:hover {
    text-decoration: none;
}

  /* 响应式设计 */
  @media (max-width: 768px) {
    .category-navigation-container {
      padding: 0.5rem;
    }
    
    .first-level-section,
    .second-level-section,
    .third-level-section,
    .breadcrumb-area {
      padding: 0.5rem;
    }
    .navbar-nav.navbar-nav-scroll.mx-auto {
      margin-left: 0rem !important;
      margin-right: 0rem !important;
      background-color: var(--sc-header-hover) !important;
    }
  }
  .logo-text-vertical {
    writing-mode: vertical-rl; 
    text-orientation: upright; 
    font-size: 12px; 
    font-weight: bold; 
    color: #fb7885; 
    background-color: #dc3545; 
    padding: 6px 5px 6px 4px; 
    border-radius: 4px; 
    line-height: 1.0; 
    text-align: center; 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    min-width: 20px; 
    min-height: 30px;
  }
.logo-icon-small {
    width: 32px;
    height: 34px;
    background: linear-gradient(45deg, #dc3545, #e74c3c);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    flex-shrink: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon-small::before {
    content: 'G';
    color: white;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-size: 24px;
    line-height: 1;
}

.logo-text-small {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-size: 1.25rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
    bottom: 6px;
    line-height: 1;
    position: relative;
}

.logo-text-small::after {
    content: attr(data-site-host);
    position: absolute;
    bottom: -12px;
    left: 0;
    /* 域名用拉丁字体：部分 Edge 用雅黑渲染极小英文会糊/变形 */
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 10px;
    font-weight: 400;
    font-style: normal;
    color: #ffffff;
    letter-spacing: 0;
    white-space: nowrap;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    font-synthesis: none;
    pointer-events: none;
}

.logo-text-small:not([data-site-host])::after,
.logo-text-small[data-site-host=""]::after {
    content: none;
}

/* 深色模式样式 */
.dark-mode-item .logo-text-small {
    color: #ff6b6b;
}

.dark-mode-item .logo-text-small::after {
    color: #fff;
}

/* 导航栏活动状态样式 - 移除前面的点，设置背景色 */
header .navbar-nav .nav-link.active:before {
    content: none !important;
}

header .navbar-nav .nav-link:hover {
  background-color: var(--sc-header-hover) !important;
  color: white !important;
  padding: 2px var(--header-nav-pad-x);
}

header .navbar-nav .nav-link {
  --header-nav-pad-x: clamp(0.5rem, 0.15rem + 1.1vw, 1rem);
  color: white !important;
  padding: 2px var(--header-nav-pad-x);
  font-size: clamp(0.8125rem, 0.68rem + 0.32vw, 1rem);
  white-space: nowrap;
  transition: padding 0.15s ease, font-size 0.15s ease;
}

header .navbar-nav .nav-link.active {
    background-color: var(--sc-header-hover) !important;
    color: white !important;
    padding: 2px var(--header-nav-pad-x);
}

header .navbar-nav .nav-link.active:hover {
    background-color: var(--sc-header-hover) !important;
    color: white !important;
    padding: 2px var(--header-nav-pad-x);
}

/* 桌面主导航：随视口连续缩放，避免断点硬切 */
@media (min-width: 768px) {
  header .navbar > .container > .d-flex.align-items-center {
    min-width: 0;
    flex: 1 1 auto;
  }

  header .navbar-brand {
    margin-right: clamp(0.5rem, 0.15rem + 1.2vw, 1.5rem) !important;
  }

  header .logo-text-small {
    font-size: clamp(1.05rem, 0.85rem + 0.45vw, 1.25rem);
    letter-spacing: clamp(0px, 0.08vw, 1px);
  }

  header h1.logo-text-small {
    font-size: clamp(1.05rem, 0.85rem + 0.45vw, 1.25rem) !important;
  }

  header .navbar-nav.navbar-nav-scroll {
    flex-wrap: nowrap;
    flex-shrink: 1;
    min-width: 0;
    /* overflow-x: auto; */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  header .navbar-nav.navbar-nav-scroll::-webkit-scrollbar {
    display: none;
  }

  header .navbar-nav .nav-item {
    flex-shrink: 0;
  }
}

/* 强制统一右侧按钮样式 */
header .navbar .nav.flex-nowrap .nav-item .btn-sm {
    height: 31px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

    /* 强制统一右侧按钮样式 */
header .navbar .nav.flex-nowrap .nav-item .btn {
    margin-bottom: 0px !important;
}

/* 确保搜索框和按钮高度一致 */
.nav-search .input-group-sm {
    height: 31px !important;
}

.detail-title-note {
    color: #aaa;
    border-left: 1px solid #efebe9;
    padding-left: 12px;
    margin-left: 1px;
}

.detail-left-note {
  margin-left: 12px;
  margin-top: 8px;
}

	/* 右侧边栏粘性定位样式 */
	.sticky-sidebar {
		position: sticky !important;
		top: 80px !important;
		z-index: 100;
		height: fit-content;
		max-height: calc(100vh - 80px);
		overflow-y: auto;
	}

	/* 左侧边栏粘性定位样式 */
	.col-md-1 .sticky-sidebar {
		position: sticky !important;
		top: 80px !important;
		z-index: 100;
	}

	/* 响应式调整 */
	@media (max-width: 991.98px) {

		.sticky-sidebar {
			position: static !important;
		}
	}

	/* 右侧边栏导航样式优化 */
	.sticky-sidebar .nav-pills .nav-link {
		border-radius: 0.375rem;
		margin-bottom: 0.5rem;
		transition: all 0.2s ease;
	}

	.sticky-sidebar .nav-pills .nav-link:hover {
		background-color: rgba(var(--bs-primary-rgb), 0.1);
	}

	.sticky-sidebar .nav-pills .nav-link.active {
		background-color: var(--bs-primary);
		color: white;
	}

	/* 文章标题区域样式优化 */
	.article-header-card {
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	}

	.article-header-card .badge {
		font-size: 0.875rem;
		font-weight: 500;
	}

	.article-header-card h1 {
		font-size: 1.75rem;
		line-height: 1.4;
		max-width: 100%;
	}

	@media (min-width: 768px) {
		.article-header-card h1 {
			font-size: 2rem;
		}
	}

	@media (min-width: 992px) {
		.article-header-card h1 {
			font-size: 2.25rem;
		}
	}

	.text-white-25 {
		color: rgba(255, 255, 255, 0.25) !important;
	}

	.article-meta .avatar {
		flex-shrink: 0;
	}

	/* 文章标题换行样式 */
	.first-level-section .col-auto {
		max-width: 100%;
	}

	.first-level-btn {
		white-space: normal !important;
		word-break: normal !important;
		overflow-wrap: break-word !important;
		line-break: strict;
		text-wrap: balance;
		text-wrap: pretty;
		height: auto !important;
		min-height: 44px;
		font-weight: 700 !important;
		max-width: 100%;
	}

	.first-level-btn h1 {
		word-break: normal;
		overflow-wrap: break-word;
		line-break: strict;
		text-wrap: balance;
		text-wrap: pretty;
		max-width: 100%;
	}

		/* 文章内容样式 */
	.detail_content {
		text-align: justify;
		word-wrap: break-word;
		word-break: break-word;
		overflow-wrap: break-word;
		white-space: normal;
		max-width: 100%;
		overflow-x: hidden;
		box-sizing: border-box;
	}

	/* 文档区：描述/简述在 .doc-actions(flex) 内须占满整行 */
	.doc-actions > .problem_bar,
	.doc-actions > .doc-summary {
		flex: 1 1 100%;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	/* 文档简述：正文排版跟 .detail_content，标题圆点跟 .answer-content */
	.doc-summary.detail_content.answer-content {
		--doc-summary-indent: 2em; /* 与首行缩进一致 */
		margin-top: 0;
		font-size: 16px;
		line-height: 30px;
		color: inherit;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		overflow-x: hidden;
		box-sizing: border-box;
		-webkit-text-size-adjust: 100%;
	}
	.doc-summary.detail_content.answer-content > *:first-child {
		margin-top: 0;
	}
	.doc-summary.detail_content.answer-content > *:last-child {
		margin-bottom: 0;
	}
	.doc-summary.detail_content.answer-content p {
		font-size: 16px;
		line-height: 30px;
		text-align: justify;
		/* 所有正文段首行缩进（含 h3 下多段，如「影响意义」第 2 段）；换行后仍齐左 */
		text-indent: var(--doc-summary-indent) !important;
		margin-bottom: 1rem;
		color: inherit;
		word-break: break-word;
		overflow-wrap: break-word;
		padding-left: 0 !important;
		margin-left: 0;
	}
	.doc-summary.detail_content.answer-content h3 + p {
		margin-left: 0 !important;
	}
	/* 三级标题：整块左缩进；下属正文只用首行缩进（换行齐左） */
	.doc-summary.detail_content.answer-content h4,
	.doc-summary.detail_content.answer-content h5,
	.doc-summary.detail_content.answer-content h6 {
		margin-left: var(--doc-summary-indent) !important;
		max-width: calc(100% - var(--doc-summary-indent));
	}
	.doc-summary.detail_content.answer-content h4 + p,
	.doc-summary.detail_content.answer-content h5 + p,
	.doc-summary.detail_content.answer-content h6 + p {
		margin-left: 0 !important;
		max-width: 100%;
	}
	/* 列表与段落首行缩进对齐（整块左移，条目内换行齐左） */
	.doc-summary.detail_content.answer-content ul,
	.doc-summary.detail_content.answer-content ol {
		margin-left: var(--doc-summary-indent) !important;
		max-width: calc(100% - var(--doc-summary-indent));
		padding-left: 1.25em;
		margin-bottom: 0.75rem;
		text-indent: 0 !important;
	}
	.doc-summary.detail_content.answer-content li {
		font-size: 16px;
		line-height: 30px;
		word-break: break-word;
		overflow-wrap: break-word;
		text-indent: 0 !important;
	}
	/*
	 * ## 内容简述 / 影响意义（h3）真正居中：
	 * 不用 flex+::before（圆点会把标题整体往右偏，移动端更明显）
	 */
	.doc-summary.detail_content.answer-content h3 {
		display: block !important;
		text-align: center !important;
		text-indent: 0 !important;
		line-height: 30px;
		margin: 1em 0 0.6em;
		max-width: 100%;
		box-sizing: border-box;
		padding-left: 0 !important;
		padding-right: 0 !important;
		margin-left: 0;
		margin-right: 0;
	}
	.doc-summary.detail_content.answer-content h3::before {
		display: none !important;
		content: none !important;
	}
	/* 下级标题与正文左缘对齐（去掉 answer-content 额外 padding） */
	.doc-summary.detail_content.answer-content h4,
	.doc-summary.detail_content.answer-content h5,
	.doc-summary.detail_content.answer-content h6 {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		flex-wrap: nowrap;
		text-align: left !important;
		text-indent: 0 !important;
		line-height: 30px;
		padding-left: 0 !important;
		padding-right: 0 !important;
		margin-left: 0;
		max-width: 100%;
		box-sizing: border-box;
		word-break: break-word;
		overflow-wrap: break-word;
	}
	.doc-summary.detail_content.answer-content p {
		text-align: justify;
		max-width: 100%;
		padding-right: 0;
	}
	.doc-summary.detail_content.answer-content ul,
	.doc-summary.detail_content.answer-content ol {
		text-align: justify;
		padding-right: 0;
	}

	@media (max-width: 767.98px) {
		.doc-summary.detail_content.answer-content {
			--doc-summary-indent: 1.5em; /* 与窄屏首行缩进一致 */
			/* 字号/行距与桌面及 .detail_content 一致，避免手机端观感不一致 */
			font-size: 16px;
			line-height: 30px;
			padding-left: 0;
			padding-right: 0;
		}
		.doc-summary.detail_content.answer-content p,
		.doc-summary.detail_content.answer-content li {
			font-size: 16px;
			line-height: 30px;
			margin-bottom: 1rem;
		}
		.doc-summary.detail_content.answer-content h3 {
			display: block !important;
			text-align: center !important;
			font-size: 1.05em !important;
			margin: 0.7em 0 0.45em;
			line-height: 30px;
			width: 100%;
			padding-left: 0 !important;
			margin-left: 0 !important;
		}
		.doc-summary.detail_content.answer-content h4 {
			font-size: 1em !important;
			margin-top: 0.55em;
			margin-right: 0;
			margin-bottom: 0.25em;
			padding-left: 0 !important;
			gap: 0.35em;
			line-height: 30px;
		}
		.doc-summary.detail_content.answer-content h4 + p,
		.doc-summary.detail_content.answer-content h5 + p,
		.doc-summary.detail_content.answer-content h6 + p {
			padding-left: 0 !important;
			margin-left: 0 !important;
		}
		.doc-summary.detail_content.answer-content h5,
		.doc-summary.detail_content.answer-content h6 {
			font-size: 0.98em !important;
			margin-top: 0.45em;
			margin-right: 0;
			margin-bottom: 0.2em;
			padding-left: 0 !important;
			gap: 0.3em;
			line-height: 30px;
		}
		.doc-summary.detail_content.answer-content h3 + p {
			margin-left: 0 !important;
			max-width: 100%;
		}
		.doc-summary.detail_content.answer-content ul,
		.doc-summary.detail_content.answer-content ol {
			padding-left: 1.1em;
			margin-left: var(--doc-summary-indent) !important;
			max-width: calc(100% - var(--doc-summary-indent));
		}
	}
	/* 文档描述：无 <p> 的纯文本也首行缩进（子块级元素用自身规则） */
	.problem_bar > .detail_content {
		text-indent: 2em;
	}

	/* 允许HTML标签正常渲染 */
	.detail_content p {
		text-align: justify;
		text-indent: 2em;
        line-height: 30px;
        font-size: 16px;
		margin-bottom: 1rem;
		word-wrap: break-word;
		word-break: break-word;
		overflow-wrap: break-word;
	}

	/* 文档描述内列表：与段落首行缩进对齐 */
	.problem_bar .detail_content ul,
	.problem_bar .detail_content ol {
		text-indent: 0;
		margin-left: 2em;
		padding-left: 1.25em;
		margin-bottom: 1rem;
		max-width: calc(100% - 2em);
	}
	.problem_bar .detail_content li {
		text-indent: 0;
		line-height: 30px;
		font-size: 16px;
	}

	/* 正文图片：限制宽度，左右与段落缩进对齐 */
	.detail_content img {
		max-width: 100% !important;
		height: auto !important;
		display: block;
		margin: 1rem auto;
		box-sizing: border-box;
	}

	.detail_content p:has(> img),
	.detail_content p:has(> a > img):not(:has(> a[href*="/data/attach/"])),
	.detail_content figure,
	.detail_content .image,
	.detail_content span:has(> img) {
		text-indent: 0;
		max-width: 100%;
	}

	/* UEditor 附件图标：缩小尺寸，固定右间距（避免正文 img 的 margin:auto 撑开 flex 间距） */
	.detail_content a[href*="/data/attach/"] {
		width: fit-content;
		max-width: 100%;
	}

	.detail_content a[href*="/data/attach/"] img {
		display: inline-block !important;
		height: 1em !important;
		width: calc(1em * 0.84) !important;
		max-width: none !important;
		max-height: 1em !important;
		margin-top: 0 !important;
		margin-bottom: 0 !important;
		margin-left: 0 !important;
		object-fit: contain;
		vertical-align: middle;
	}
	
	/* 尊重内联样式；居中/右对齐时必须取消首行缩进，否则移动端会明显偏一侧 */
	.detail_content p[style*="text-align: center"],
	.detail_content p[align="center"],
	.detail_content div[style*="text-align: center"],
	.detail_content center {
		text-align: center !important;
		text-indent: 0 !important;
	}
	
	.detail_content p[style*="text-align: right"],
	.detail_content p[align="right"] {
		text-align: right !important;
		text-indent: 0 !important;
	}
	
	.detail_content p[style*="text-align: left"],
	.detail_content p[align="left"] {
		text-align: left !important;
	}

	@media (max-width: 767.98px) {
		.problem_bar > .detail_content {
			text-indent: 1.5em;
		}
		.detail_content p {
			/* 窄屏正文缩进略收，与简述区一致 */
			text-indent: 1.5em;
		}
		.problem_bar .detail_content ul,
		.problem_bar .detail_content ol {
			margin-left: 1.5em;
			padding-left: 1.1em;
			max-width: calc(100% - 1.5em);
		}
		.problem_bar .detail_content li {
			font-size: 16px;
			line-height: 30px;
		}
		.detail_content p:has(> img),
		.detail_content p:has(> a > img):not(:has(> a[href*="/data/attach/"])),
		.detail_content p[style*="text-align: center"],
		.detail_content p[align="center"],
		.detail_content p[style*="text-align: right"],
		.detail_content p[align="right"] {
			text-indent: 0 !important;
		}
	}
	
	.detail_content strong,
	.detail_content b {
		font-weight: bold;
	}
	
	.detail_content br {
		display: block;
		margin: 0.5rem 0;
	}
	
	/* 确保链接和URL能够自动换行 */
	.detail_content a {
		word-wrap: break-word;
		word-break: break-all;
		overflow-wrap: break-word;
	}
	
	/* 确保所有内联元素都能换行 */
	.detail_content * {
		max-width: 100%;
		word-wrap: break-word;
		overflow-wrap: break-word;
	}

	/* 免责声明等提示信息两端对齐 */
	.tips,
	.tips p,
	.tips div {
		text-align: justify !important;
	}

	/* 文章标题样式 */
	.article-header-card h1 {
		text-align: center;
		max-width: 100%;
		font-size: 20px !important;
		font-weight: 600 !important;
	}

	.first-level-btn:hover {
		white-space: normal !important;
	}

	/* 文章元数据样式 */
	.article-meta .d-flex>* {
		display: flex;
		align-items: center;
		height: 20px;
	}

	.article-meta i {
		font-size: 12px !important;
		line-height: 1;
		margin: 0;
	}

	.article-meta .gap-3 {
		gap: 0.75rem !important;
	}
  
  .navbar-nav .nav-item:last-child .nav-link {
    padding-right: 15px !important;
  }

    
    /* 搜索建议样式 */
  #searchSuggestions {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      z-index: 1050;
      border: 1px solid rgba(0,0,0,.15);
      border-radius: 0.375rem;
      box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
  }

  .suggestion-item {
      display: flex;
      align-items: center;
      padding: 0.5rem 1rem;
      text-decoration: none;
      color: #212529;
      transition: background-color 0.15s ease-in-out;
  }

  .suggestion-item:hover,
  .suggestion-item.active {
      background-color: var(--sc-header-bg);
      color: #ebecec;
  }

  .suggestion-text {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
  }

  /* 内容页标题栏样式 */
  .content-title-bar {
      background-color: var(--sc-header-bg) !important;
      padding: 8px 0 !important;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      transition: all 0.3s ease-in-out;
      display: flex;
      align-items: center;
  }
  .content-title-bar > .container {
      width: 100%;
  }

  .content-title-bar .content-title h4 {
      font-size: 0.95rem;
      font-weight: 600;
      color: #ffffff !important;
      margin: 0;
      white-space: normal;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 90%;
      flex: 1;
      line-height: 1.3;
      max-height: 2.6em;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
  }

  .content-title-bar .content-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
  }

  .content-title-bar .content-actions .btn {
      font-size: 0.9rem;
      padding: 0.1rem 0.8rem;
      border-color: rgba(255, 255, 255, 0.3);
      color: #ffffff;
      white-space: nowrap;
      flex-shrink: 0;
      font-weight: 500;
  }
  
  .content-title-bar .content-actions .btn:hover {
      background-color: rgba(255, 255, 255, 0.9);
      border-color: rgba(255, 255, 255, 0.5);
      color: var(--sc-header-bg);
  }

  .content-title-bar .content-actions .btn i {
      font-size: 1rem;
  }

/* 功能按钮动画效果 */
.social-widget-area .col-4 a {
    transition: all 0.3s ease;
    transform: translateY(0);
}

.social-widget-area .col-4 a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.social-widget-area .col-4 a i {
    transition: all 0.3s ease;
}

.social-widget-area .col-4 a:hover i {
    transform: scale(1.1);
}

/* 分享图标竖排样式 */
.nav.text-white-force {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.nav.text-white-force .nav-item {
    width: 100%;
    display: flex;
    justify-content: center;
}

.nav.text-white-force .nav-link {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin: 0.25rem 0;
}

.nav.text-white-force .nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav.text-white-force .nav-link i {
    font-size: 1.2rem;
}

  /* 发表文章按钮悬停效果 */
  .social-widget-area .col-4 a.bg-primary:hover {
      background-color: var(--sc-btn-hover) !important;
      box-shadow: 0 8px 25px rgba(var(--bs-primary-rgb), 0.3);
  }

  /* 上传文档按钮悬停效果 */
  .social-widget-area .col-4 a.bg-success:hover {
      background-color: #198754 !important;
      box-shadow: 0 8px 25px rgba(25, 135, 84, 0.3);
  }

  /* 提出问题按钮悬停效果 */
  .social-widget-area .col-4 a.bg-info:hover {
      background-color: #0dcaf0 !important;
      box-shadow: 0 8px 25px rgba(13, 202, 240, 0.3);
  }

  /* 当header变为sticky时，隐藏导航栏，显示标题栏 */
  header.navbar-sticky-on .navbar {
      display: none !important;
  }

  /* 隐藏标签云导航栏 */
  header.navbar-sticky-on .tag-header-bar {
      display: none !important;
  }

  /* 热门标签栏 - 流体均分铺满 */
  .tag-header-bar .tag-header-row {
    gap: clamp(0.35rem, 0.5vw, 0.75rem);
    min-width: 0;
    align-items: stretch;
  }

  .tag-header-bar .hot-tags-list {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    align-self: stretch;
    justify-content: flex-start;
    gap: clamp(0.18rem, 0.12rem + 0.22vw, 0.45rem);
    overflow: hidden;
  }

  .tag-header-bar .hot-tags-list .hot-tag-btn {
    flex: 0 0 auto;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.22rem, 0.12rem + 0.28vw, 0.45rem) clamp(0.3rem, 0.15rem + 0.4vw, 0.75rem) !important;
    font-size: clamp(0.68rem, 0.48rem + 0.38vw, 0.875rem);
    line-height: 1.2;
    white-space: nowrap;
  }

  .tag-header-bar .hot-tags-list .hot-tag-btn--hidden {
    display: none !important;
  }

  .tag-header-bar .hot-tags-list .hot-tag-btn-text {
    white-space: nowrap;
  }

  .tag-header-bar .hot-tags-list .hot-tag-hot-badge {
    flex-shrink: 0;
    font-size: clamp(0.52rem, 0.38rem + 0.22vw, 0.6rem) !important;
    margin-left: 0.2rem !important;
    padding: 0.1em 0.35em;
  }

  .tag-header-bar .tag-header-assistant {
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: stretch;
  }

  .tag-header-bar .tag-header-assistant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    gap: 0.4rem;
    height: auto;
    padding: clamp(0.22rem, 0.12rem + 0.28vw, 0.45rem) clamp(0.75rem, 0.4rem + 0.5vw, 1rem) !important;
    font-size: clamp(0.68rem, 0.48rem + 0.38vw, 0.875rem);
    font-weight: 600;
    line-height: 1.2;
    border-radius: clamp(0.5rem, 0.3rem + 0.5vw, 1.25rem);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .tag-header-bar .tag-header-assistant-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.45);
  }

  .tag-header-bar .tag-header-assistant-btn .text-white {
    line-height: 1.2;
    position: relative;
    top: 2px;
  }

  .tag-header-bar .tag-header-assistant-icon {
    flex-shrink: 0;
    font-size: 1.25em;
    line-height: 1;
    vertical-align: middle;
    transform-origin: center center;
    animation: tag-assistant-icon-pulse 2.4s ease-in-out infinite;
  }

  @keyframes tag-assistant-icon-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
  }

  header.navbar-sticky-on .content-title-bar {
      display: block !important;
  }

  /* 小屏幕下隐藏粘性标题栏 */
  @media (max-width: 768px) {
      .content-title-bar {
          display: none !important;
      }
      
      header.navbar-sticky-on .content-title-bar {
          display: none !important;
      }

    .g-2, .gy-2 {
        --bs-gutter-y: 1.8rem !important;
    }
    .g-2, .gx-2 {
        --bs-gutter-x: 0.5rem !important;
    }
  }

  /* 确保标题栏在sticky状态下正确显示 - 添加滑入动画 */
  .navbar-sticky-on .content-title-bar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1030;
      width: 100%;
      /* 和header使用相同的滑入动画 */
      -webkit-animation: slideInFromTop 0.8s ease-out !important;
      animation: slideInFromTop 0.8s ease-out !important;
  }

  /* 下滑缩小菜单：品牌 / 标题 / 操作 三栏，长站名不挤压中间标题 */
  /* 下滑缩小菜单：左品牌 / 中标题居中 / 右操作，两侧留空 */
  .content-title-bar .content-title-bar-inner {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
      align-items: center;
      column-gap: 0.75rem;
      min-width: 0;
      min-height: 40px;
  }
  .content-title-bar .content-title-brand {
      justify-self: start;
      max-width: 100%;
      min-width: 0;
      display: flex;
      align-items: center;
  }
  .content-title-bar .content-title-brand .navbar-brand {
      margin-right: 0 !important;
      max-width: 100%;
      padding-top: 0 !important;
      padding-bottom: 0 !important;
      line-height: 1;
      display: flex;
      align-items: center;
  }
  .content-title-bar .content-title-brand .navbar-brand-item {
      display: flex !important;
      height: auto !important;
      max-width: 100%;
      min-width: 0;
      min-height: 0;
      overflow: visible;
      padding-bottom: 0;
      align-items: center;
  }
  .content-title-bar .content-title-brand .logo-text-vertical {
      flex-shrink: 0;
      font-size: 10px;
      padding: 4px 3px 4px 3px;
      min-width: 16px;
      min-height: 24px;
  }
  .content-title-bar .content-title-brand .logo-text-small {
      display: inline-block;
      max-width: 100%;
      white-space: nowrap;
      position: relative;
      font-size: 1.05rem;
      bottom: 0;
      line-height: 1;
      padding-bottom: 10px;
  }
  .content-title-bar .content-title-brand .logo-text-small::after {
      bottom: 0;
      font-size: 9px;
      font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
      letter-spacing: 0;
      /* 域名伪元素勿挡住中间标题点击回顶 */
      pointer-events: none;
  }
  .content-title-bar .content-title {
      min-width: 0;
      padding: 0 0.25rem;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      position: relative;
      z-index: 2;
      cursor: pointer;
  }
  .content-title-bar .content-title h6 {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 0.9rem;
      line-height: 1.25;
      margin-bottom: 0 !important;
      text-align: center;
      max-width: 100%;
  }
  .content-title-bar .content-actions {
      justify-self: end;
      white-space: nowrap;
      display: flex;
      align-items: center;
      justify-content: flex-end;
  }
  .content-title-bar .content-actions .btn {
      font-size: 0.8rem;
      padding: 0.15rem 0.6rem;
  }
  @media (max-width: 991.98px) {
      .content-title-bar .content-title-bar-inner {
          column-gap: 0.5rem;
      }
  }
  
  /* content-title-bar 初始隐藏在顶部外 */
  .content-title-bar:not(.d-none) {
      -webkit-animation: slideInFromTop 0.8s ease-out;
      animation: slideInFromTop 0.8s ease-out;
  }

  /* 搜索框聚焦时显示建议 */
  #searchInput:focus + .btn + #searchSuggestions {
      display: block !important;
  }

  .grayscale {
    filter: grayscale(100%) !important;
  }

  /* 分层灰度控制 - 仅图片区域灰度（不过渡 filter，避免与放大抢主线程） */
  .card-image-grayscale .card-img-top,
  .card-image-grayscale .card-img-top i {
    filter: grayscale(100%) !important;
  }

  /* 文库封面灰度已挂到 .library-cover-link，此处取消图片自身 filter */
  .card-image-grayscale .library-cover-img.card-img-top {
    filter: none !important;
  }

  /* 文档类型图标在灰度模式下保持可见 */
  .card-image-grayscale .filetype-icon i {
    filter: grayscale(50%) !important;
    opacity: 0.8;
  } 

    /* 绝对定位的flex元素超出范围隐藏 */
    .d-flex.justify-content-between.align-items-center.position-absolute {
      overflow: hidden !important;
  }

  h1, .h1 {
    font-size: 24px !important;
  }

  h2, .h2 {
    font-size: 22px !important;
  }
  
  h3, .h3 {
    font-size: 20px !important;
  }

  /* 紧跟全站标题字号覆盖之后：页头 h1 必须等于全站 h3=20px */
  .first-level-section h1,
  .first-level-btn h1 {
    font-size: 20px !important;
  }

  h4, .h4 {
    font-size: 18px !important;
  }
  
  h5, .h5 {
    font-size: 16px !important;
  }
  
  h6, .h6 {
    font-size: 14px !important;
  }
  
  h7, .h7 {
    font-size: 12px !important;
  }

  h8, .h8 {
    font-size: 10px !important;
  }

  h9, .h9 {
    font-size: 8px !important;
  }

  .doc-preview-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    min-height: 600px;
}

.doc-info-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px 20px 10px 20px;
    margin-bottom: 15px;
}

.doc-actions {
    display: flex;
    /* gap: 10px; */
    flex-wrap: wrap;
    margin-top: 15px;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    font-size: 14px;
    color: #6c757d;
}

.doc-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-type-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.pdf-badge { background-color: #dc3545; color: white; }
.word-badge { background-color: #28a745; color: white; }
.excel-badge { background-color: #ffc107; color: black; }
.ppt-badge { background-color: #17a2b8; color: white; }
.other-badge { background-color: #6c757d; color: white; }

.preview-btn {
    background: linear-gradient(45deg, var(--sc-btn-hover), var(--sc-btn-active));
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.preview-btn:hover {
    background: linear-gradient(45deg, #1e7e34, #155724);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.doc-page-container {
    width: 100%;
    display: block;
}

.doc-page-container img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

.file-type-badge {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.price-display .badge {
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
}

.price-display .bg-success {
    background-color: var(--sc-btn-hover) !important;
}

.price-display .bg-primary {
    background-color: var(--bs-primary) !important;
}

.price-display .bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.related-docs {
    margin-top: 30px;
}

.related-doc-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.related-doc-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.doc-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    text-align: center;
}

.stat-item {
    padding: 10px;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--bs-primary);
    display: block;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* 文章目录样式 */
#toc-container {
  max-height: 400px;
  overflow-y: auto;
}

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

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  color: #6c757d;
  text-decoration: none !important;
  padding: 0.25rem 0.5rem;
  display: block;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.toc-list a:hover {
  color: var(--bs-primary);
  text-decoration: none !important;
  border-left-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.05);
  transform: translateX(2px);
}

.toc-list a.active {
  color: var(--bs-primary);
  text-decoration: none !important;
  border-left-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.1);
  font-weight: 500;
}

.toc-list .toc-h1 {
  font-size: 0.9rem;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.toc-list .toc-h2 {
  font-size: 0.85rem;
  margin-left: 0.75rem;
  color: #495057;
}

.toc-list .toc-h3 {
  font-size: 0.8rem;
  margin-left: 1.5rem;
  color: #6c757d;
}

.toc-list .toc-h4 {
  font-size: 0.75rem;
  margin-left: 2.25rem;
  color: #6c757d;
}

.toc-list .toc-h5 {
  font-size: 0.7rem;
  margin-left: 3rem;
  color: #6c757d;
}

.toc-list .toc-h6 {
  font-size: 0.65rem;
  margin-left: 3.75rem;
  color: #6c757d;
}

#tns1 > .tns-item {
  font-size: 13px !important;
}

/* 目录滚动条样式 */
#toc-container::-webkit-scrollbar {
  width: 4px;
}

#toc-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

#toc-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

#toc-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 移动端文章目录：右侧悬浮按钮 + 抽屉 + 遮罩 */
.mobile-toc-fab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1045;
    width: 20px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0px;
    background: var(--bs-primary);
    color: #fff;
    font-size: 15px;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    user-select: none;
}
.mobile-toc-fab:active {
    background: var(--sc-btn-active);
}
.mobile-toc-mask {
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.mobile-toc-mask.open {
    opacity: 1;
    visibility: visible;
}
.mobile-toc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    width: 60%;
    max-width: 280px;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
}
.mobile-toc-drawer.open {
    transform: translateX(0);
}
.mobile-toc-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f2;
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
}
.mobile-toc-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
}
.mobile-toc-drawer__body .toc-list a {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}

/* 文章内容中的标题样式 */
.detail_content h1,
.detail_content h2,
.detail_content h3,
.detail_content h4,
.detail_content h5,
.detail_content h6 {
  scroll-margin-top: 80px; /* 为固定导航栏留出空间 */
}

/* 标题锚点样式 */
.heading-anchor {
  display: block;
  scroll-margin-top: 80px;
  font-weight: bold;
  color: var(--sc-header-bg);
}

.heading-anchor:hover {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
}

/* 响应式优化 */
@media (max-width: 991px) {
  .sticky-sidebar {
      position: static !important;
  }
}

.create-question-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

@media (max-width: 991.98px) {
  .create-question-container .col-lg-3,
  .create-question-container .sidebar {
    margin-top: 0 !important;
  }
}

@media (max-width: 767.98px) {
  .create-question-container {
    padding: 0;
  }

  .create-question-container .editor-container {
    min-height: 300px;
  }

  .create-question-container .editor-container .edui-editor,
  .create-question-container .editor-container .edui-editor-iframeholder {
    min-height: 300px !important;
  }

  .answer-form-section .editor-container {
    min-height: 120px;
  }

  .answer-form-section .editor-container .edui-editor,
  .answer-form-section .editor-container .edui-editor-iframeholder {
    min-height: 120px !important;
  }
}

@media (max-width: 480px) {
  .create-question-container .editor-container {
    min-height: 240px;
  }

  .create-question-container .editor-container .edui-editor,
  .create-question-container .editor-container .edui-editor-iframeholder {
    min-height: 240px !important;
  }

  .answer-form-section .editor-container {
    min-height: 100px;
  }

  .answer-form-section .editor-container .edui-editor,
  .answer-form-section .editor-container .edui-editor-iframeholder {
    min-height: 100px !important;
  }
}

.main-content {
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: fit-content;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
font-weight: 600;
  margin-bottom: 8px;
display: block;
}

.form-control {
  border: 1px solid #ddd;
  border-radius: 4px;
}

.form-control:focus {
border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), .25);
}

.btn-primary {
  background: var(--bs-primary);
  padding: 12px 30px;
  border-radius: 4px;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--sc-btn-hover);
}

.btn-secondary {
background: #6c757d;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
font-weight: 600;
}

.category-option {
  padding: 5px 10px;
}

.category-option.level-1 {
  font-weight: bold;
  color: #333;
}

.category-option.level-2 {
  padding-left: 20px;
  color: #666;
}

.category-option.level-3 {
  padding-left: 40px;
  color: #999;
}

.editor-container {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* Bootstrap 警示框统一跟随主题徽章色（浅底 + 深字，变量见 theme.py） */
.alert-danger {
  background: var(--sc-badge-warm);
  border: 1px solid rgba(var(--sc-deep-warm-rgb), 0.25);
  color: var(--sc-deep-warm);
}

.alert-success {
  background: var(--sc-badge-cool);
  border: 1px solid rgba(var(--sc-deep-cool-rgb), 0.25);
  color: var(--sc-deep-cool);
}

.alert-warning {
  background: var(--sc-badge-gold);
  border: 1px solid rgba(var(--sc-deep-gold-rgb), 0.25);
  color: var(--sc-deep-gold);
}

.alert-info {
  background: var(--sc-badge-primary);
  border: 1px solid rgba(var(--sc-deep-primary-rgb), 0.25);
  color: var(--sc-deep-primary);
}

.alert-primary {
  background: var(--sc-badge-primary);
  border: 1px solid rgba(var(--sc-deep-primary-rgb), 0.25);
  color: var(--sc-deep-primary);
}

.alert-secondary,
.alert-light {
  background: var(--sc-badge-soft);
  border: 1px solid rgba(var(--sc-deep-soft-rgb), 0.25);
  color: var(--sc-deep-soft);
}

/* Toast 提醒条（global-notifications.js）实心底 + 白字，随主题实心档 */
.toast.bg-success {
  background-color: var(--sc-solid-cool) !important;
}

.toast.bg-danger {
  background-color: var(--sc-solid-warm) !important;
}

.toast.bg-warning {
  background-color: var(--sc-solid-gold) !important;
}

.toast.bg-info {
  background-color: var(--sc-solid-primary) !important;
}

/* 居中通知框图标圆底（bg-*-subtle，仅 global-notifications.js 使用）跟随主题徽章色 */
.bg-success-subtle {
  background-color: var(--sc-badge-cool) !important;
}

.bg-danger-subtle {
  background-color: var(--sc-badge-warm) !important;
}

.bg-warning-subtle {
  background-color: var(--sc-badge-gold) !important;
}

.bg-info-subtle {
  background-color: var(--sc-badge-primary) !important;
}

.smt {
  scroll-margin-top: 100px !important;
} 


   /* 问题列表样式 */
   .question-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
}

.question-title {
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.4;
    /* 支持多行显示 */
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    max-height: calc(1.4em * 3) !important;
    flex: 1 !important;
    min-width: 0 !important;
}

.question-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.question-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
}

 .stat-number {
     font-weight: 600;
     color: var(--bs-primary);
     font-size: 1rem;
 }

.question-status {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    white-space: nowrap;
}

/* 页脚背景跟随主题页脚色（变量 --sc-footer-bg 由 theme.py 输出，朱红 #741e1f 等每套方案手调值） */
footer.bg-dark {
    background-color: var(--sc-footer-bg) !important;
}

/* 默认头像（蓝底人形剪影）跟随主题主色：hue-rotate 滤镜旋色相，白色剪影不受影响 */
img[src*="default.jpg"] {
    filter: hue-rotate(var(--sc-avatar-hue-rotate));
}

/* 状态徽章统一跟随主题配色（变量见 theme.py build_scheme_css：浅底 + 深字随主色旋转色相） */
/* Bootstrap 语义色徽章同样映射到主题派生色：success→冷调 / info→主色调 / warning→金调 / danger→暖调 / secondary→灰调 */
.badge.bg-primary, .badge.text-bg-primary {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}

.badge.bg-success, .badge.text-bg-success {
    background-color: var(--sc-badge-cool) !important;
    color: var(--sc-deep-cool) !important;
}

.badge.bg-info, .badge.text-bg-info {
    background-color: var(--sc-badge-primary) !important;
    color: var(--sc-deep-primary) !important;
}

.badge.bg-warning, .badge.text-bg-warning {
    background-color: var(--sc-badge-gold) !important;
    color: var(--sc-deep-gold) !important;
}

.badge.bg-danger, .badge.text-bg-danger {
    background-color: var(--sc-badge-warm) !important;
    color: var(--sc-deep-warm) !important;
}

.badge.bg-secondary, .badge.text-bg-secondary {
    background-color: var(--sc-badge-soft) !important;
    color: var(--sc-deep-soft) !important;
}

/* 语义文字色统一跟随主题深字色（.text-success 已在主题化规则中跟随主色） */
.text-info {
    color: var(--sc-deep-primary) !important;
}

/* 语义描边按钮跟随主题映射（与 badge/toast 一致）：outline-danger→暖调 / outline-success→冷调 */
.btn-outline-danger {
    --bs-btn-color: var(--sc-deep-warm);
    --bs-btn-border-color: var(--sc-deep-warm);
    --bs-btn-hover-bg: var(--sc-badge-warm);
    --bs-btn-hover-color: var(--sc-deep-warm);
    --bs-btn-hover-border-color: var(--sc-deep-warm);
    --bs-btn-active-bg: var(--sc-deep-warm);
    --bs-btn-active-color: #fff;
    --bs-btn-active-border-color: var(--sc-deep-warm);
    --bs-btn-focus-shadow-rgb: var(--sc-deep-warm-rgb);
}

.btn-outline-success {
    --bs-btn-color: var(--sc-deep-cool);
    --bs-btn-border-color: var(--sc-deep-cool);
    --bs-btn-hover-bg: var(--sc-badge-cool);
    --bs-btn-hover-color: var(--sc-deep-cool);
    --bs-btn-hover-border-color: var(--sc-deep-cool);
    --bs-btn-active-bg: var(--sc-deep-cool);
    --bs-btn-active-color: #fff;
    --bs-btn-active-border-color: var(--sc-deep-cool);
    --bs-btn-focus-shadow-rgb: var(--sc-deep-cool-rgb);
}

.text-warning {
    color: var(--sc-deep-gold) !important;
}

.text-danger {
    color: var(--sc-deep-warm) !important;
}

.status-solved {
    background-color: var(--sc-badge-cool);
    color: var(--sc-deep-cool);
    border: 1px solid rgba(var(--sc-deep-cool-rgb), 0.25);
}

.status-unsolved {
    background-color: var(--sc-badge-warm);
    color: var(--sc-deep-warm);
    border: 1px solid rgba(var(--sc-deep-warm-rgb), 0.25);
}

.status-closed {
    background-color: var(--sc-badge-soft);
    color: var(--sc-deep-soft);
    border: 1px solid rgba(var(--sc-deep-soft-rgb), 0.25);
}

.status-best-answer {
    background-color: var(--sc-badge-gold);
    color: var(--sc-deep-gold);
    border: 1px solid rgba(var(--sc-deep-gold-rgb), 0.25);
    animation: bestAnswerPulse 2s ease-in-out infinite;
}

@keyframes bestAnswerPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--sc-deep-gold-rgb), 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(var(--sc-deep-gold-rgb), 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--sc-deep-gold-rgb), 0);
    }
}

.question-content {
    color: #495057;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.small-avatar {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
}

.author-avatar.small-avatar {
    width: 15px !important;
    height: 15px !important;
}

.category-badge {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.second-level-section {
    margin-bottom: 1rem;
}

.third-level-section {
    margin-bottom: 1rem;
}

.first-level-btn {
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.first-level-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .question-stats {
        gap: 10px;
    }

    .stat-item {
        font-size: 0.8rem;
    }

    .question-status {
        gap: 5px;
    }

    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    .navbar-sticky-on .navbar-nav .nav-link {
      line-height: 30px !important;
    }
}


@media (max-width: 991.98px) {
  /* 小屏幕用户按钮只显示图标 */
  .btn.dropdown-toggle .d-none.d-sm-inline {
  display: none !important;
}

.btn.dropdown-toggle {
  padding: 0.375rem 0.5rem !important;
  min-width: auto;
}

}

@media (max-width: 767.98px) {
/* 小屏幕水平横向菜单样式 */
.navbar-nav.nav-fill {
  display: flex;
  flex-direction: row;
  background-color: var(--sc-header-bg);
  width: 100%;
  flex-wrap: wrap;
  margin: 0px 0;
  border-radius: 8px;
  padding: 5px 0;
}

.navbar-nav.nav-fill .nav-item {
  min-width: 0;
}

.navbar-nav.nav-fill .nav-link {
  font-size: 13px;
  font-weight: 500;
  color: white;
  transition: all 0.3s ease;
  border-radius: 6px;
  text-align: center;
  display: block;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 0px!important;
}

.navbar-nav.nav-fill .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
}

.navbar-nav.nav-fill .nav-link.active {
  background-color: var(--sc-header-hover);
  color: white;
  font-weight: 600;
  padding: 5px 0px;
}

/* 小屏幕用户信息区域调整 */
.nav.flex-nowrap {
  flex-wrap: wrap;
  align-items: center;
}

.nav-item.dropdown {
  min-width: auto;
}

.nav-link.dropdown-toggle {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.dropdown-menu {
  font-size: 0.875rem;
  min-width: 200px;
}

/* 调整用户头像和文字大小 */
.avatar-xs {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

/* 小屏幕用户按钮只显示图标 */
.btn.dropdown-toggle .d-none.d-sm-inline {
  display: none !important;
}

.btn.dropdown-toggle {
  padding: 0.375rem 0.5rem !important;
  min-width: auto;
}

/* 调整通知按钮 */
.nav-item.dropdown .nav-link {
  padding: 0.5rem;
}

/* 调整搜索区域 */
.nav-item.dropdown.nav-search .nav-link {
  padding: 0.5rem;
}

/* 小屏幕搜索框调整（白底卡片：输入框一行、搜索按钮下方居中；带 !important 反制全局下拉菜单深蓝样式） */
.nav-item.dropdown.nav-search .dropdown-menu {
  position: fixed;
  top: 4.5rem;
  left: 50% !important;
  transform: translateX(-50%);
  width: min(86vw, 360px);
  max-width: none;
  margin: 0;
  padding: 0.8rem !important;
  border: 1px solid #e3e6ea !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12) !important;
  font-size: 0.9rem;
}
.nav-item.dropdown.nav-search .dropdown-menu .input-group {
  flex-direction: column;
  gap: 0.6rem;
}
.nav-item.dropdown.nav-search .dropdown-menu .form-control {
  width: 100%;
  border: 1px solid #d9dee7;
  border-radius: 0 !important;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  height: auto;
  background: #fff;
  color: #4a5568;
}
.nav-item.dropdown.nav-search .dropdown-menu .form-control::placeholder {
  color: #9aa5b1;
}
.nav-item.dropdown.nav-search .dropdown-menu .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: none;
}
.nav-item.dropdown.nav-search .dropdown-menu .form-control::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23c0c8d2'/%3E%3Cpath d='M5 5l6 6M11 5l-6 6' stroke='white' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center/16px no-repeat;
  cursor: pointer;
}
.nav-item.dropdown.nav-search .dropdown-menu .btn {
  align-self: center;
  margin-left: 0;
  border: 1px solid var(--bs-primary);
  border-radius: 999px !important;
  padding: 0.5rem 1.7rem;
  font-size: 0.9rem;
  background: transparent;
  color: var(--bs-primary);
}
.nav-item.dropdown.nav-search .dropdown-menu .btn:hover {
  background: var(--bs-primary);
  color: #fff;
}
.nav-item.dropdown.nav-search .dropdown-menu .btn:active {
  background: var(--sc-btn-active);
  border-color: var(--sc-btn-active);
  color: #fff;
}
}

/* 相关文档标题样式 */
.related-docs-title {
  border-left: 5px solid var(--bs-primary);
  padding-left: 16px;
  color: #333333;
  font-size: 18px;
  padding-right: 33px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .related-docs-title {
      font-size: 16px;
      padding-left: 12px;
      padding-right: 20px;
  }
}

@media (max-width: 576px) {
  .related-docs-title {
      font-size: 15px;
      padding-left: 10px;
      padding-right: 15px;
  }
}

/* 付费内容样式 - 通用样式 */
.paid-content-preview {
    position: relative;
    min-height: 200px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-indent:0px!important;
}

.paid-content-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.paid-content-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cff4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.paid-content-overlay {
    text-align: center;
    width: 100%;
    margin: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.paid-content-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.paid-content-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
    width: 100%;
}

.paid-content-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
    width: 100%;
    line-height: 1.5;
}

.paid-content-price {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.price-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #dc3545;
    text-align: center;
}

.price-unit {
    font-size: 1.2rem;
    color: #6c757d;
    text-align: center;
}

.paid-content-btn {
    padding: 0.75rem 2rem !important;
    font-weight: 600 !important;
    border-radius: 25px !important;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    text-align: center !important;
    width: auto !important;
}

.paid-content-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.4);
}

/* 问题详情页面样式 */

/* 基础样式 */
.content-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.content-section:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title.mb-0 { margin-bottom: 0; }
.section-title i { color: var(--bs-primary); }

.question-content {
  font-size: 1rem;
  line-height: 1.7;
  color: #495057;
  margin-bottom: 1.5rem;
}

.question-title-fallback {
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
  border: 2px solid var(--bs-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.question-title-fallback h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #6c757d;
}

.question-title-fallback p {
  font-size: 0.9rem;
  opacity: 0.8;
}

.question-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: nowrap;
  align-items: center;
}

.question-action-btns {
  flex-shrink: 0;
}

.question-action-btns .btn {
  justify-content: center;
}

#question-toggle-top-btn i.fa-thumbtack {
  display: inline-block;
  line-height: 1;
  /* Font Awesome 图钉字形偏下，略上移以视觉居中 */
  transform: translateY(-1px);
}

@media (max-width: 575.98px) {
  .question-actions {
    gap: 0.5rem;
  }

  .question-action-btns .btn {
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    justify-content: center;
    align-items: center;
  }

  .question-action-btns .btn i {
    font-size: 1.05rem;
    line-height: 1;
    width: 1em;
    text-align: center;
  }

  #question-toggle-top-btn i.fa-thumbtack {
    transform: translateY(-1.5px);
  }

  .question-actions .badge {
    font-size: 0.75rem !important;
    white-space: nowrap;
  }
}

.btn-action {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 徽章样式 */
.reward-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: #ff1a1a;
  color: white;
  border-radius: 5px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.reward-badge:hover {
  transform: translateY(-3px) scale(1.05);
}

.reward-amount {
  font-size: 1.3rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.reward-unit {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 悬赏规则样式 */
.reward-rules-section {
  margin-top: 1.5rem;
}

.reward-rules-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reward-rules-title {
  color: #495057;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  font-size: 1.1rem;
}

.reward-rules-title i {
  color: var(--bs-primary);
}

.reward-rules-content {
  line-height: 1.6;
}

.text-small {
  font-size: 0.7rem;
  line-height: 1.5;
}

.reward-rule-item {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: flex-start;
}

.reward-rule-item:last-child {
  margin-bottom: 0;
}

.rule-number {
  color: var(--bs-primary);
  font-weight: 600;
  margin-right: 0.5rem;
  min-width: 1.5rem;
}

.rule-text {
  color: #495057;
  flex: 1;
}

.rule-text strong {
  font-weight: 600;
}

/* 悬赏分成显示样式 */
.reward-info {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.reward-badge-small {
  display: inline-flex;
  align-items: center;
  background: var(--sc-btn-hover);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  animation: rewardGlow 2s ease-in-out infinite alternate;
}

.reward-badge-small i {
  font-size: 0.7rem;
}

@keyframes rewardGlow {
  0% {
      box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
  }
  100% {
      box-shadow: 0 4px 8px rgba(40, 167, 69, 0.5);
  }
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
  border: 1px solid #fff;
  transition: all 0.3s ease;
  margin-left: 0.75rem;
}

.countdown-badge:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.countdown-badge.text-muted {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

/* 表单样式 */
.form-group { margin-bottom: 1.5rem; }
.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
  display: block;
}

.form-control {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.form-control.textarea {
  min-height: 120px;
  resize: vertical;
}

/* 按钮样式 */
.btn-primary {
  box-shadow: 0 3px 10px rgba(var(--bs-primary-rgb), 0.3);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--sc-btn-hover), var(--sc-btn-active));
  border: none;
  box-shadow: 0 3px 10px rgba(var(--bs-primary-rgb), 0.3);
  transition: all 0.3s ease;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.4);
}

/* 状态徽章 */
.solved-badge {
  background: #28a745 !important;
  color: white !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
  border: none;
  transition: all 0.3s ease;
}

.solved-badge:hover {
  background: #218838 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.closed-badge {
  background: #6c757d !important;
  color: white !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
  border: none;
  transition: all 0.3s ease;
}

.closed-badge:hover {
  background: #5a6268 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.pending-badge {
  background: #ffc107 !important;
  color: #212529 !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
  border: none;
  transition: all 0.3s ease;
}

.pending-badge:hover {
  background: #e0a800 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* 提问区域 */
.ask-question-simple { text-align: center; }
.ask-question-title {
  color: #495057;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.ask-question-title i { color: var(--bs-primary); font-size: 1.2em; }
.ask-question-desc {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.ask-question-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--bs-primary), var(--sc-btn-hover));
  color: white;
  text-decoration: none;
  padding: 0.875rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.25);
  transition: all 0.3s ease;
  border: none;
  width: 100%;
  justify-content: center;
}

.ask-question-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(var(--bs-primary-rgb), 0.4);
  color: white;
  text-decoration: none;
}

.question-list-ask-bar {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

.question-list-ask-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  background: #fff;
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.question-list-ask-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-width: 0;
  flex: 1;
}

.question-list-ask-label {
  color: #495057;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.question-list-ask-label i {
  color: var(--bs-primary);
}

.question-list-ask-sep {
  color: #ced4da;
}

.question-list-ask-desc {
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
}

.question-list-ask-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.question-list-ask-cta {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 575.98px) {
  .question-list-ask-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .question-list-ask-text {
    justify-content: center;
  }

  .question-list-ask-actions {
    width: 100%;
  }

  .question-list-ask-cta {
    flex: 1;
    justify-content: center;
  }
}

/* 追问追答区域 */
.follow-up-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 8px;
}

.follow-up-header h6,
.follow-up-header .h6 {
  color: #495057;
  font-weight: 600;
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.follow-up-header i { color: var(--bs-primary); }

.follow-up-item {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.follow-up-question {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f3f4;
}

.follow-up-reply {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 0.75rem;
  border-left: 2px solid #ffc107;
}

.follow-up-pending {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
}

.follow-up-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.author-avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  color: #6c757d;
  font-size: 0.8rem;
}

.author-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.follow-up-author .author-info h6,
.follow-up-author .author-info .h6 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
}

.follow-up-author .author-info small {
  color: #6c757d;
  font-size: 0.75rem;
}

.follow-up-content {
  color: #495057;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-left: 2rem;
}

.follow-up-form {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid #e9ecef;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.form-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* 回答区域 */
.answers-list { display: flex; flex-direction: column; gap: 1.5rem; }
.answer-item {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.answer-item:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
}

.answer-item.best-answer {
  border: 2px solid #ffc107;
  background: #fff9e6;
}

.answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.answer-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 1rem;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info h6,
.author-info .h6 {
  margin: 0;
  font-weight: 600;
  color: #495057;
  font-size: 0.95rem;
}

.author-info small {
  color: #6c757d;
  font-size: 0.8rem;
}

.best-answer-badge {
  background: #ffc107;
  color: #212529;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.answer-author .best-answer-badge {
  margin-left: auto;
}

.answer-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #495057;
  margin-bottom: 0;
}

/* 回答区 / AI 预览 / markdown-body 标题：几何圆点 + flex 与文字垂直居中对齐 */
.answer-content h1,
.ai-reply-content h1,
.ai-reply-item h1,
.answer-ai-preview-markdown h1,
.answer-body .markdown-body h1,
.answer-content h2,
.ai-reply-content h2,
.ai-reply-item h2,
.answer-ai-preview-markdown h2,
.answer-body .markdown-body h2,
.answer-content h3,
.ai-reply-content h3,
.ai-reply-item h3,
.answer-ai-preview-markdown h3,
.answer-body .markdown-body h3,
.answer-content h4,
.ai-reply-content h4,
.ai-reply-item h4,
.answer-ai-preview-markdown h4,
.answer-body .markdown-body h4,
.answer-content h5,
.ai-reply-content h5,
.ai-reply-item h5,
.answer-ai-preview-markdown h5,
.answer-body .markdown-body h5,
.answer-content h6,
.ai-reply-content h6,
.ai-reply-item h6,
.answer-ai-preview-markdown h6,
.answer-body .markdown-body h6 {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin-left: 0;
  padding-left: 0;
  line-height: 1.45;
  border-left: none;
  color: #031e3d;
}

.answer-content h1::before,
.ai-reply-content h1::before,
.ai-reply-item h1::before,
.answer-ai-preview-markdown h1::before,
.answer-body .markdown-body h1::before,
.answer-content h2::before,
.ai-reply-content h2::before,
.ai-reply-item h2::before,
.answer-ai-preview-markdown h2::before,
.answer-body .markdown-body h2::before,
.answer-content h3::before,
.ai-reply-content h3::before,
.ai-reply-item h3::before,
.answer-ai-preview-markdown h3::before,
.answer-body .markdown-body h3::before,
.answer-content h4::before,
.ai-reply-content h4::before,
.ai-reply-item h4::before,
.answer-ai-preview-markdown h4::before,
.answer-body .markdown-body h4::before,
.answer-content h5::before,
.ai-reply-content h5::before,
.ai-reply-item h5::before,
.answer-ai-preview-markdown h5::before,
.answer-body .markdown-body h5::before,
.answer-content h6::before,
.ai-reply-content h6::before,
.ai-reply-item h6::before,
.answer-ai-preview-markdown h6::before,
.answer-body .markdown-body h6::before {
  content: "";
  flex-shrink: 0;
  box-sizing: border-box;
  border-radius: 50%;
  /* 相对当前标题字号，与文字光学居中 */
  width: 0.42em;
  height: 0.42em;
}

/* 最高层（含 Markdown ##→h3）：实心圆 */
.answer-content h1,
.ai-reply-content h1,
.ai-reply-item h1,
.answer-ai-preview-markdown h1,
.answer-body .markdown-body h1 {
  font-size: 1.18em !important;
  font-weight: 700;
  margin: 0.85em 0 0.4em;
}

.answer-content h2,
.ai-reply-content h2,
.ai-reply-item h2,
.answer-ai-preview-markdown h2,
.answer-body .markdown-body h2 {
  font-size: 1.14em !important;
  font-weight: 700;
  margin: 0.8em 0 0.35em;
}

.answer-content h3,
.ai-reply-content h3,
.ai-reply-item h3,
.answer-ai-preview-markdown h3,
.answer-body .markdown-body h3 {
  font-size: 1.1em !important;
  font-weight: 700;
  margin: 0.75em 0 0.35em;
}

.answer-content h1::before,
.ai-reply-content h1::before,
.ai-reply-item h1::before,
.answer-ai-preview-markdown h1::before,
.answer-body .markdown-body h1::before,
.answer-content h2::before,
.ai-reply-content h2::before,
.ai-reply-item h2::before,
.answer-ai-preview-markdown h2::before,
.answer-body .markdown-body h2::before,
.answer-content h3::before,
.ai-reply-content h3::before,
.ai-reply-item h3::before,
.answer-ai-preview-markdown h3::before,
.answer-body .markdown-body h3::before {
  background: var(--bs-primary);
  border: none;
}

/* 下一级（###→h4）：空心圆 */
.answer-content h4,
.ai-reply-content h4,
.ai-reply-item h4,
.answer-ai-preview-markdown h4,
.answer-body .markdown-body h4 {
  font-size: 1.05em !important;
  font-weight: 600;
  margin: 0.65em 0 0.3em;
  padding-left: 0.7em;
  color: #1a4060;
}

.answer-content h4::before,
.ai-reply-content h4::before,
.ai-reply-item h4::before,
.answer-ai-preview-markdown h4::before,
.answer-body .markdown-body h4::before {
  width: 0.4em;
  height: 0.4em;
  background: transparent;
  border: 1.5px solid #5a8ab8;
}

/* 再下一级（####→h5 / h6）：更小空心圆 */
.answer-content h5,
.ai-reply-content h5,
.ai-reply-item h5,
.answer-ai-preview-markdown h5,
.answer-body .markdown-body h5 {
  font-size: 1.02em !important;
  font-weight: 600;
  margin: 0.55em 0 0.25em;
  padding-left: 1.4em;
  color: #2a5070;
}

.answer-content h6,
.ai-reply-content h6,
.ai-reply-item h6,
.answer-ai-preview-markdown h6,
.answer-body .markdown-body h6 {
  font-size: 1em !important;
  font-weight: 600;
  margin: 0.5em 0 0.2em;
  padding-left: 1.95em;
  color: #3a6080;
}

.answer-content h5::before,
.ai-reply-content h5::before,
.ai-reply-item h5::before,
.answer-ai-preview-markdown h5::before,
.answer-body .markdown-body h5::before,
.answer-content h6::before,
.ai-reply-content h6::before,
.ai-reply-item h6::before,
.answer-ai-preview-markdown h6::before,
.answer-body .markdown-body h6::before {
  width: 0.34em;
  height: 0.34em;
  background: transparent;
  border: 1.5px solid #8a9bb8;
}

/* 下级标题下的正文/列表：与同级标题文字左缘对齐缩进 */
.answer-content h4 + p,
.answer-content h4 + ul,
.answer-content h4 + ol,
.answer-content h4 + p + p,
.answer-content h4 + p + ul,
.answer-content h4 + p + ol,
.answer-content h4 + ul + p,
.ai-reply-content h4 + p,
.ai-reply-content h4 + ul,
.ai-reply-content h4 + ol,
.ai-reply-content h4 + p + p,
.ai-reply-content h4 + p + ul,
.ai-reply-content h4 + p + ol,
.ai-reply-item h4 + p,
.ai-reply-item h4 + ul,
.ai-reply-item h4 + ol,
.ai-reply-item h4 + p + p,
.ai-reply-item h4 + p + ul,
.ai-reply-item h4 + p + ol,
.answer-ai-preview-markdown h4 + p,
.answer-ai-preview-markdown h4 + ul,
.answer-ai-preview-markdown h4 + ol,
.answer-ai-preview-markdown h4 + p + p,
.answer-ai-preview-markdown h4 + p + ul,
.answer-ai-preview-markdown h4 + p + ol,
.answer-body .markdown-body h4 + p,
.answer-body .markdown-body h4 + ul,
.answer-body .markdown-body h4 + ol,
.answer-body .markdown-body h4 + p + p,
.answer-body .markdown-body h4 + p + ul,
.answer-body .markdown-body h4 + p + ol {
  /* h4 padding-left 0.7em + gap 0.45em + 圆点 0.4em */
  margin-left: 1.55em;
}

.answer-content h5 + p,
.answer-content h5 + ul,
.answer-content h5 + ol,
.answer-content h5 + p + p,
.answer-content h5 + p + ul,
.answer-content h5 + p + ol,
.answer-content h5 + ul + p,
.ai-reply-content h5 + p,
.ai-reply-content h5 + ul,
.ai-reply-content h5 + ol,
.ai-reply-content h5 + p + p,
.ai-reply-content h5 + p + ul,
.ai-reply-content h5 + p + ol,
.ai-reply-item h5 + p,
.ai-reply-item h5 + ul,
.ai-reply-item h5 + ol,
.ai-reply-item h5 + p + p,
.ai-reply-item h5 + p + ul,
.ai-reply-item h5 + p + ol,
.answer-ai-preview-markdown h5 + p,
.answer-ai-preview-markdown h5 + ul,
.answer-ai-preview-markdown h5 + ol,
.answer-ai-preview-markdown h5 + p + p,
.answer-ai-preview-markdown h5 + p + ul,
.answer-ai-preview-markdown h5 + p + ol,
.answer-body .markdown-body h5 + p,
.answer-body .markdown-body h5 + ul,
.answer-body .markdown-body h5 + ol,
.answer-body .markdown-body h5 + p + p,
.answer-body .markdown-body h5 + p + ul,
.answer-body .markdown-body h5 + p + ol {
  margin-left: 2.2em;
}

.answer-content h6 + p,
.answer-content h6 + ul,
.answer-content h6 + ol,
.answer-content h6 + p + p,
.answer-content h6 + p + ul,
.answer-content h6 + p + ol,
.answer-content h6 + ul + p,
.ai-reply-content h6 + p,
.ai-reply-content h6 + ul,
.ai-reply-content h6 + ol,
.ai-reply-content h6 + p + p,
.ai-reply-content h6 + p + ul,
.ai-reply-content h6 + p + ol,
.ai-reply-item h6 + p,
.ai-reply-item h6 + ul,
.ai-reply-item h6 + ol,
.ai-reply-item h6 + p + p,
.ai-reply-item h6 + p + ul,
.ai-reply-item h6 + p + ol,
.answer-ai-preview-markdown h6 + p,
.answer-ai-preview-markdown h6 + ul,
.answer-ai-preview-markdown h6 + ol,
.answer-ai-preview-markdown h6 + p + p,
.answer-ai-preview-markdown h6 + p + ul,
.answer-ai-preview-markdown h6 + p + ol,
.answer-body .markdown-body h6 + p,
.answer-body .markdown-body h6 + ul,
.answer-body .markdown-body h6 + ol,
.answer-body .markdown-body h6 + p + p,
.answer-body .markdown-body h6 + p + ul,
.answer-body .markdown-body h6 + p + ol {
  margin-left: 2.75em;
}
.answer-content h1:first-child,
.answer-content h2:first-child,
.answer-content h3:first-child,
.answer-content h4:first-child,
.answer-content h5:first-child,
.answer-content h6:first-child,
.ai-reply-content h1:first-child,
.ai-reply-content h2:first-child,
.ai-reply-content h3:first-child,
.ai-reply-content h4:first-child,
.ai-reply-content h5:first-child,
.ai-reply-content h6:first-child {
  margin-top: 0.35rem;
}

.answer-ai-preview-markdown h1:first-child,
.answer-ai-preview-markdown h2:first-child,
.answer-ai-preview-markdown h3:first-child,
.answer-ai-preview-markdown h4:first-child,
.answer-ai-preview-markdown h5:first-child,
.answer-ai-preview-markdown h6:first-child,
.answer-ai-preview-markdown p:first-child {
  margin-top: 0;
}

.answer-content ul,
.answer-content ol,
.ai-reply-content ul,
.ai-reply-content ol {
  margin: 0.35rem 0 0.75rem 1.1rem;
  padding-left: 0.25rem;
}

.answer-content li,
.ai-reply-content li {
  margin: 0.25rem 0;
}

.answer-sources-block,
.ai-inline-cite {
  display: inline;
  margin: 0 0.1em;
  padding: 0 0.15em;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
  vertical-align: super;
  color: var(--bs-primary);
  text-decoration: none;
  white-space: nowrap;
}

a.ai-inline-cite:hover {
  color: var(--bs-link-hover-color);
  text-decoration: underline;
}

span.ai-inline-cite {
  color: #868e96;
  cursor: default;
}

.answer-content .answer-sources-block,
.ai-reply-content .answer-sources-block,
.ai-reply-item .answer-sources-block,
.ai-chat-sources-block {
  display: block;
  clear: both;
  margin-top: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid #e9ecef;
  border-bottom: none;
  font-size: 0.75rem;
  color: #868e96;
  line-height: 1.5;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

.answer-sources-label,
.ai-chat-sources-label {
  display: block;
  margin: 0 0 0.35rem;
  padding: 0;
  border-bottom: none;
  font-size: 0.75rem;
  color: #868e96;
  line-height: 1.5;
}

.answer-sources-list,
.ai-chat-sources-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: source-item;
  font-size: 0.75rem;
  color: #44474b;
}

.answer-sources-list .answer-sources-item,
.ai-chat-sources-list .ai-chat-sources-item {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.28em 0;
  max-width: 100%;
  min-width: 0;
  line-height: 1.5;
  counter-increment: source-item;
}

.answer-sources-list .answer-sources-item::before,
.ai-chat-sources-list .ai-chat-sources-item::before {
  content: counter(source-item) ".";
  flex: 0 0 auto;
  min-width: 1.25em;
  text-align: right;
  color: #868e96;
  font-size: 0.75rem;
  line-height: 1.5;
}

.answer-sources-list .answer-sources-item a,
.ai-chat-sources-list .ai-chat-sources-item a,
.answer-sources-list .answer-sources-item > span,
.ai-chat-sources-list .ai-chat-sources-item > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 0.75rem;
  font-weight: 400;
  background-color: #666;
  color: #fff;
  padding: 0.15em 0.45em;
  border-radius: 0.25rem;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

.answer-sources-list .answer-sources-item a:hover,
.ai-chat-sources-list .ai-chat-sources-item a:hover {
  opacity: 0.9;
  color: #fff;
  text-decoration: none;
}

.answer-sources-list .answer-sources-item > span,
.ai-chat-sources-list .ai-chat-sources-item > span {
  cursor: default;
}

.answer-sources-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0 0;
}

.answer-sources-items .badge.bg-secondary {
  font-size: 0.75rem;
  white-space: normal;
  word-wrap: break-word;
  text-align: left;
  font-weight: 400;
  line-height: 1.5;
  max-width: 100%;
}

.answer-sources-items .badge.bg-secondary:hover {
  opacity: 0.9;
}

.answer-source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.answer-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.35rem 0.6rem;
  background: #f1f3f5;
  border: 1px solid #e9ecef;
  font-size: 0.8rem;
  color: #495057;
}

.answer-source-tag-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.answer-source-tag-remove {
  border: none;
  background: transparent;
  color: #868e96;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.answer-source-tag-remove:hover {
  color: #dc3545;
}

.ai-replies-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #dee2e6;
}

.ai-reply-item + .ai-reply-item {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e9ecef;
}

.ai-reply-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.ai-reply-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #495057;
}

.ai-generating-banner {
  margin-bottom: 0.75rem;
  border-radius: 0;
}

.answer-ai-mention-hint {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.answer-ai-mention-hint .answer-ai-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, opacity 0.15s ease-in-out;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.answer-ai-mention-hint .answer-ai-action-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

.answer-ai-mention-hint .answer-ai-action-btn--call {
  color: #495057;
  border-color: #ced4da;
}

.answer-ai-mention-hint .answer-ai-action-btn--call:hover:not(:disabled):not(.is-cooldown) {
  color: #212529;
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

.answer-ai-mention-hint .answer-ai-action-btn--icon {
  min-width: 34px;
  padding: 0.375rem 0.5rem;
}

.answer-ai-mention-hint .answer-ai-action-btn--gift {
  color: #dc3545;
  border-color: #f1aeb5;
}

.answer-ai-mention-hint .answer-ai-action-btn--gift:hover:not(:disabled):not(.is-cooldown) {
  color: #bb2d3b;
  background-color: #fdf2f4;
  border-color: #ea868f;
}

.answer-ai-mention-hint .answer-ai-action-btn--purchase {
  color: var(--bs-primary);
  border-color: rgba(var(--bs-primary-rgb), 0.4);
}

.answer-ai-mention-hint .answer-ai-action-btn--purchase:hover:not(:disabled):not(.is-cooldown) {
  color: var(--bs-link-hover-color);
  background-color: #f0f6ff;
  border-color: #6ea8fe;
}

.answer-ai-mention-hint .answer-ai-action-btn.is-cooldown,
.answer-ai-mention-hint .answer-ai-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.answer-ai-mention-hint .answer-ai-action-btn.is-loading {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 575.98px) {
  .answer-ai-mention-hint {
    gap: 0.375rem;
  }

  .answer-ai-mention-hint .answer-ai-action-btn {
    min-height: 36px;
    font-size: 0.75rem;
    padding: 0.3125rem 0.625rem;
  }

  .answer-ai-mention-hint .answer-ai-action-btn--call {
    flex: 1 1 auto;
    min-width: 0;
  }

  .answer-ai-mention-hint .answer-ai-action-btn--icon {
    min-width: 36px;
    padding: 0.3125rem;
    flex: 0 0 auto;
  }
}

.answer-ai-mention-dropdown {
  position: fixed;
  z-index: 10050;
  background: #fff;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.answer-ai-mention-item {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 0.55rem 0.85rem;
  color: #212529;
  cursor: pointer;
}

.answer-ai-mention-item:hover,
.answer-ai-mention-item:focus {
  background: #f8f9fa;
  outline: none;
}

.answer-ai-preview-section {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.25);
  background: #f8fbff;
}

.answer-ai-preview-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bs-primary);
  margin-bottom: 0.5rem;
}

.answer-ai-preview-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #212529;
}

.answer-ai-preview-markdown p,
.answer-content p {
  margin: 0.35em 0;
}

.answer-ai-preview-markdown ul,
.answer-ai-preview-markdown ol,
.answer-content ul,
.answer-content ol {
  margin: 0.3em 0 0.45em;
  padding-left: 1.35em;
}

.answer-ai-preview-markdown li,
.answer-content li {
  margin: 0.15em 0;
}

.answer-ai-preview-markdown li > p,
.answer-content li > p {
  margin: 0.1em 0;
}

.answer-ai-preview-markdown strong,
.answer-content strong {
  font-weight: 600;
}

.answer-ai-preview-loading {
  color: #6c757d;
  font-size: 0.9rem;
}

.answer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid #e9ecef;
}

.answer-footer-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.answer-actions {
  display: flex;
  gap: 0.75rem;
}

.action-link {
  color: #6c757d;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
}

.action-link:hover {
  background: #f8f9fa;
  color: #495057;
}

.action-link-like {
  background: #f1f3f5;
}

.action-link-like:hover {
  background: #e9ecef;
  color: #495057;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-icon {
  font-size: 3rem;
  color: #adb5bd;
  margin-bottom: 1rem;
}

.empty-state h6 {
  color: #495057;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.empty-state p {
  color: #6c757d;
  margin-bottom: 1.5rem;
}

/* 侧边栏 */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  overflow: hidden;
  transition: all 0.3s ease;
}

.sidebar-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.sidebar-header {
  background: #f8f9fa;
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.sidebar-header h6 {
  margin: 0;
  font-weight: 600;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.sidebar-content { padding: 1rem; }

.related-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

.related-item:last-child { border-bottom: none; }

.related-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s ease;
}

.related-link:hover { color: var(--bs-primary); }

.related-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.related-meta { display: flex; align-items: center; gap: 0.75rem; }
.related-answers { font-size: 0.8rem; color: #6c757d; }

/* 问题创建页面样式 */
/* 草稿列表样式 */
.draft-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 10px;
  background: #f8f9fa;
}

.draft-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.draft-item:hover {
  border-color: var(--bs-primary);
  box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb), 0.1);
}

.draft-item.current {
  border-color: var(--sc-btn-hover);
  background: rgba(var(--bs-primary-rgb), 0.05);
}

.draft-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.draft-meta span {
  margin-right: 10px;
}

.draft-actions {
  display: flex;
  gap: 5px;
}

.draft-actions button {
  font-size: 11px;
  padding: 2px 6px;
}

.draft-loading, .draft-empty {
  text-align: center;
  color: #666;
  padding: 20px;
}

.delete-btn {
  background: #dc3545;
  border-color: #dc3545;
  color: white;
}

.delete-btn:hover {
  background: #c82333;
  border-color: #bd2130;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .content-section { padding: 1.5rem; }
  .answer-item { padding: 1.25rem; }
  .answer-header { align-items: center; }
  .answer-author { flex: 1; min-width: 0; }
  .answer-author .best-answer-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
  }
  .answer-footer { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .answer-footer-end { margin-left: 0; width: 100%; justify-content: flex-start; }
}

.cover-upload-container {
  position: relative;
}

.cover-preview {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}

.cover-upload-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafafa;
}

.cover-upload-area:hover {
  border-color: var(--bs-primary);
  background: #f0f8ff;
}

.cover-upload-area.dragover {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.1);
}

.upload-placeholder {
  color: #666;
}

.upload-placeholder i {
  margin-bottom: 10px;
}

    /* 右侧sidebar标签样式 */
    .article-tags-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        max-height: none;
        overflow: visible;
    }

    .article-tag-sidebar {
        background: #f8f9fa;
        color: #6c757d;
        border: none;
        transition: all 0.2s ease;
        text-decoration: none;
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
        border-radius: 12px;
        display: inline-block;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1.3;
        font-weight: 400;
        box-shadow: none;
    }

    .article-tag-sidebar:hover {
        background: #e9ecef;
        color: #495057;
        text-decoration: none;
        transform: none;
        box-shadow: none;
    }

    .article-tag-sidebar:focus {
        color: #495057;
        text-decoration: none;
        box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.2);
        outline: none;
    }

    .article-tag-sidebar:focus:hover {
        color: #495057;
    }

    .no-tags-sidebar {
        color: #adb5bd;
        font-style: normal;
        text-align: center;
        font-size: 0.65rem;
        padding: 0.5rem;
        background: transparent;
        border-radius: 0;
        border: none;
        width: 100%;
    }

    /* 右侧sidebar标题样式 */
    .sticky-sidebar h6 {
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #6c757d;
        border-bottom: 2px solid #e9ecef;
        padding-bottom: 0.5rem;
        position: relative;
    }

    .sticky-sidebar h6::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 30px;
        height: 2px;
        background: linear-gradient(90deg, #6c757d, #495057);
        border-radius: 1px;
    }

    .paid-content-body {
        padding: 12px 0px;
        background: white;
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .create-doc-container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 20px;
  }

  .main-content {
      background: #fff;
      border-radius: 8px;
      padding: 30px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .sidebar {
      background: #fff;
      border-radius: 8px;
      padding: 20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      height: fit-content;
      position: sticky;
      top: 20px;
      margin-left: 0;
  }

  @media (max-width: 991.98px) {
      .sidebar {
          position: static;
          margin-top: 20px;
          margin-left: 0;
      }

      .main-content {
      margin-bottom: 20px;
      }
  }

  /* 不设 position: relative：positioned 元素会在层叠顺序中盖过表单上方的自绘下拉菜单（马甲选择）。
     原扫光效果用 ::before 绝对定位铺满实现，依赖 relative 作包含块，现改为背景位移动画，效果不变 */
  .upload-area {
      background-color: #ffffff;
      background-image: linear-gradient(45deg, transparent 30%, rgba(var(--bs-primary-rgb), 0.05) 50%, transparent 70%);
      background-size: 400% 100%;
      background-repeat: no-repeat;
      background-position: 100% 0;
      border: none;
      border-radius: 12px;
      padding: 80px 40px;
      text-align: center;
      cursor: pointer;
      transition: all 0.3s ease, background-position 0.6s ease;
      overflow: hidden;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
      margin-bottom: 30px;
  }

  .upload-area:hover {
      background-color: #f8f9ff;
      background-position: 0% 0;
      transform: translateY(-3px);
      box-shadow: 0 8px 30px rgba(var(--bs-primary-rgb), 0.15);
  }

  .upload-area.dragover {
      background-color: rgba(var(--bs-primary-rgb), 0.1);
      background-position: 0% 0;
      transform: scale(1.02);
      box-shadow: 0 12px 40px rgba(var(--bs-primary-rgb), 0.25);
  }

  .upload-area i {
      color: var(--bs-primary);
      margin-bottom: 20px;
      display: block;
      transition: all 0.3s ease;
      font-size: 3rem;
  }

  .upload-area:hover i {
      transform: scale(1.1);
      color: var(--sc-btn-hover);
  }

  .upload-area h4 {
      color: #1f2937;
      font-weight: 600;
      margin-bottom: 12px;
      font-size: 1.5rem;
      transition: all 0.3s ease;
  }

  .upload-area:hover h4 {
      color: var(--bs-primary);
  }

  .upload-area p {
      color: #6b7280;
      margin-bottom: 8px;
      font-size: 0.95rem;
      transition: all 0.3s ease;
  }

  .upload-area:hover p {
      color: #4b5563;
  }

  .upload-area .text-info {
      color: var(--bs-primary) !important;
      font-weight: 500;
      font-size: 0.9rem;
  }

  .upload-area .text-muted {
      color: #999 !important;
  }

  .file-list {
      background: #fff;
      border-radius: 8px;
      padding: 20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      margin-bottom: 20px;
  }

  .file-stats {
      background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
      border-radius: 12px;
      padding: 20px;
      border: 1px solid #dee2e6;
  }

  .stats-container {
      display: flex;
      justify-content: space-around;
      align-items: center;
      gap: 20px;
  }

  .stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      min-width: 80px;
  }

  .stat-item i {
      font-size: 1.5rem;
      margin-bottom: 8px;
      display: block;
  }

  .stat-label {
      font-size: 0.85rem;
      color: #6c757d;
      margin-bottom: 4px;
      font-weight: 500;
  }

  .stat-value {
      font-size: 1.8rem;
      font-weight: 700;
      color: #212529;
      line-height: 1;
      margin-bottom: 2px;
  }

  .stat-unit {
      font-size: 0.75rem;
      color: #6c757d;
      font-weight: 500;
  }

  .stat-item .text-primary {
      color: var(--bs-primary) !important;
  }

  .stat-item .text-success {
      color: #198754 !important;
  }

  .stat-item .text-danger {
      color: #dc3545 !important;
  }

  .file-item {
      border: 1px solid #e9ecef;
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 20px;
      background: #fff;
      display: grid;
      grid-template-columns: 9fr 3fr;
      gap: 25px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
      transition: all 0.3s ease;
  }

  .file-item:hover {
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
      transform: translateY(-2px);
  }

  .file-item.valid {
      border-color: #28a745;
      background: #f8fff9;
  }

  .file-item.invalid {
      border-color: #dc3545;
      background: #fff8f8;
  }

  .file-item.editing {
      border-color: var(--bs-primary);
      background: #f0f8ff;
  }

  .file-content-form {
      margin-top: 15px;
      padding: 20px;
      background: #fff;
      border-radius: 8px;
      border: 1px solid #e9ecef;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .file-content-section {
      grid-column: 1;
      padding-right: 10px;
  }

  .file-settings {
      grid-column: 2;
      align-self: start;
      padding: 14px 16px;
      background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
      border-radius: 8px;
      border: 1px solid #dee2e6;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .file-settings h6 {
      color: #495057;
      font-weight: 600;
      margin-bottom: 10px;
      padding-bottom: 6px;
      border-bottom: 2px solid #dee2e6;
  }

  .file-settings .form-group {
      margin-bottom: 0.65rem;
  }

  .file-settings .form-group > label {
      margin-bottom: 0.25rem;
      font-size: 13px;
  }

  .file-settings .form-text {
      margin-top: 0.2rem;
      font-size: 12px;
      line-height: 1.35;
  }

  .file-settings .doc-version-pointers .form-control {
      padding: 0.25rem 0.5rem;
  }

  /* 文档可见性：分段选择，与 form-control 同宽对齐 */
  .file-settings .doc-visibility-group {
      margin-bottom: 0;
  }

  .file-settings .doc-visibility-group > label {
      margin-bottom: 0.25rem;
  }

  .file-settings .doc-visibility-segment {
      display: flex;
      width: 100%;
      padding: 3px;
      background: #fff;
      border: 1px solid #ced4da;
      border-radius: 0.375rem;
      box-sizing: border-box;
  }

  .file-settings .doc-visibility-option {
      flex: 1;
      border: none;
      background: transparent;
      color: #6c757d;
      font-size: 14px;
      font-weight: 500;
      line-height: 1.5;
      padding: 0.375rem 0.5rem;
      border-radius: 0.25rem;
      cursor: pointer;
      transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
      text-align: center;
  }

  .file-settings .doc-visibility-option:hover:not(.active) {
      background: #f1f3f5;
      color: #495057;
  }

  .file-settings .doc-visibility-option.active[data-level="1"] {
      background: var(--bs-primary);
      color: #fff;
      box-shadow: 0 1px 3px rgba(var(--bs-primary-rgb), 0.35);
  }

  .file-settings .doc-visibility-option.active[data-level="4"] {
      background: #6c757d;
      color: #fff;
      box-shadow: 0 1px 3px rgba(108, 117, 125, 0.35);
  }

  .file-settings .doc-visibility-hint {
      display: block;
      margin-top: 6px;
      line-height: 1.4;
      font-size: 12px;
  }

  .file-progress {
      margin-top: 10px;
      padding: 10px 12px;
      background: rgba(var(--bs-primary-rgb), 0.1);
      border-radius: 6px;
      border-left: 4px solid var(--bs-primary);
  }

  .file-content-form .file-progress {
      margin-bottom: 0;
  }

  .file-progress.hidden {
      display: none;
  }

  .category-option {
      padding: 5px 10px;
  }

  .category-option.level-1 {
      font-weight: bold;
      color: #333;
  }

  .category-option.level-2 {
      padding-left: 20px;
      color: #666;
  }

  .category-option.level-3 {
      padding-left: 40px;
      color: #999;
  }

  .settings-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
      margin-bottom: 10px;
  }

  .settings-row.full {
      grid-template-columns: 1fr;
  }

  .settings-row.two-thirds {
      grid-template-columns: 2fr 1fr;
  }

  .settings-row.half {
      grid-template-columns: 1fr 1fr;
  }

  .settings-row.third {
      grid-template-columns: 1fr 1fr 1fr;
  }

  .form-group {
      margin-bottom: 15px;
  }

  .form-group label {
      font-weight: bold;
      margin-bottom: 5px;
      display: block;
  }

  .form-group label.required::after {
      content: " *";
      color: #dc3545;
      font-weight: bold;
  }

  .form-control.is-invalid {
      border-color: #dc3545;
      box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
  }

  .form-control.is-valid {
      border-color: #28a745;
      box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
  }

  .invalid-feedback {
      display: block;
      width: 100%;
      margin-top: 0.25rem;
      font-size: 0.875em;
      color: #dc3545;
  }

  .form-control {
      width: 100%;
      padding: 10px 14px;
      border: 1px solid #ced4da;
      border-radius: 6px;
      font-size: 14px;
      transition: all 0.15s ease-in-out;
  }

  .form-control:focus {
      outline: none;
      border-color: var(--bs-primary);
      box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.25);
  }

  .btn-sm {
      padding: 8px 12px;
      font-size: 13px;
      border-radius: 6px;
      font-weight: 500;
      transition: all 0.15s ease-in-out;
  }

  .btn-sm:hover {
      transform: translateY(-1px);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .file-actions {
      display: flex;
      gap: 10px;
      margin-top: 10px;
  }

  .file-header {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      margin-bottom: 15px;
      padding-bottom: 10px;
      border-bottom: 1px solid #f1f3f4;
  }

  .file-header .file-progress {
      margin-top: 0;
      width: 100%;
  }

  .file-name {
      font-weight: 600;
      color: #2c3e50;
      font-size: 16px;
  }

  .file-status {
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 12px;
      font-weight: bold;
  }

  .status-valid {
      background: var(--sc-badge-cool);
      color: var(--sc-deep-cool);
  }

  .status-invalid {
      background: var(--sc-badge-warm);
      color: var(--sc-deep-warm);
  }

  .status-checking {
      background: var(--sc-badge-gold);
      color: var(--sc-deep-gold);
  }

  .file-details {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
      font-size: 14px;
      color: #6c757d;
      margin-bottom: 15px;
  }

  .file-details div {
      padding: 8px 12px;
      background: #f8f9fa;
      border-radius: 6px;
      border-left: 3px solid var(--bs-primary);
  }

  .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
      margin-bottom: 15px;
  }

  .file-item .error-message {
      color: #b42318;
      background: #fef3f2;
      border: 1px solid #fecdca;
      border-radius: 6px;
      padding: 10px 12px;
      margin-top: 10px;
      font-size: 15px;
      font-weight: 600;
      line-height: 1.6;
  }

  .file-item .duplicate-message {
      color: #b42318;
      background: #fef3f2;
      border: 1px solid #fecdca;
      border-radius: 6px;
      padding: 10px 12px;
      margin-top: 8px;
      font-size: 14px;
      line-height: 1.5;
  }

  .file-item .warning-message {
      color: #b78103;
      background: #fff8e6;
      border: 1px solid #f0d78c;
      border-radius: 6px;
      padding: 10px 12px;
      margin-top: 10px;
      font-size: 14px;
      line-height: 1.5;
  }

  .error-message {
      color: #dc3545;
      font-size: 12px;
      margin-top: 5px;
  }

  .batch-actions {
      position: sticky;
      bottom: 0;
      background: #fff;
      padding: 20px;
      border-top: 1px solid #eee;
      box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
      z-index: 9999;
  }
  .batch-actions.is-uploading #uploadAllBtn,
  .batch-actions.is-uploading #clearAllBtn {
      pointer-events: none;
      cursor: not-allowed;
      opacity: 0.75;
  }

  .progress-container {
      margin-bottom: 20px;
  }

  .progress-item {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      margin-bottom: 0;
  }

  .progress-item .file-name {
      margin-right: 0;
      margin-bottom: 2px;
      font-size: 14px;
      font-weight: 500;
      color: #495057;
  }

  .progress-item .progress {
      flex: none;
      width: 100%;
      height: 8px;
      margin-right: 0;
      background: rgba(255, 255, 255, 0.8);
      border-radius: 4px;
      overflow: hidden;
  }

  .progress-item .progress-bar {
      height: 100%;
      transition: width 0.2s ease;
  }

  .progress-item .status {
      min-width: auto;
      text-align: left;
      font-size: 13px;
  }

  /* 响应式设计 - 小屏幕适应 */
  @media (max-width: 768px) {
      .batch-upload-container {
          padding: 10px;
      }

      .file-item {
          grid-template-columns: 1fr;
          gap: 15px;
      padding: 15px;
      }

      .file-content-section {
          padding-right: 0;
      }

      .file-settings {
          grid-column: 1;
          margin-top: 15px;
      }

      .file-details {
          grid-template-columns: 1fr;
          gap: 10px;
      }

      .file-header {
          flex-direction: column;
          align-items: stretch;
          gap: 10px;
      }

      .file-actions {
          flex-direction: column;
          gap: 8px;
      }

      .btn-sm {
          width: 100%;
          text-align: center;
      }

      .batch-actions {
          padding: 15px 10px;
      }

      .batch-actions .row {
          flex-direction: column;
          gap: 15px;
      }

      .batch-actions .col-md-6 {
          width: 100%;
      }

      .batch-actions .text-right {
          text-align: left !important;
      }

      .upload-area {
          padding: 20px 15px;
      }

      .upload-area h4 {
          font-size: 18px;
      }

      .upload-area p {
      font-size: 14px;
  }

      .file-content-form {
          padding: 15px;
      }

      .file-settings {
          padding: 15px;
      }

      .form-group {
          margin-bottom: 12px;
      }

      .form-control {
          padding: 8px 12px;
          font-size: 16px;
          /* 防止iOS缩放 */
      }

      .file-progress {
          padding: 8px;
      }

      .progress-item {
          flex-direction: column;
          gap: 8px;
      }

      .progress-item .file-name {
          margin-right: 0;
          margin-bottom: 5px;
      }

      .progress-item .progress {
          margin-right: 0;
      }

      .progress-item .status {
          text-align: left;
          min-width: auto;
      }

      .stats-container {
          flex-direction: column;
          gap: 15px;
      }

      .stat-item {
          flex-direction: row;
          justify-content: space-between;
          align-items: center;
          min-width: auto;
          width: 100%;
          padding: 10px 15px;
          background: rgba(255, 255, 255, 0.7);
          border-radius: 8px;
      }

      .stat-item i {
          margin-bottom: 0;
          margin-right: 10px;
      }

      .stat-value {
          font-size: 1.4rem;
      }
  }

/* 卡片背景渐变色样式 - 蓝绿渐变 */
.card.card-overlay-bottom {
  overflow: hidden;
}

.card.card-overlay-bottom:before {
  content: "";
  position: absolute;
  height: 50%;
  width: 100%;
  bottom: 0;
  left: 0;
  right: 0;
  background-image: -webkit-gradient(linear, left top, left bottom, from(transparent), to(rgba(0, 150, 136, 0.8)));
  background-image: linear-gradient(180deg, transparent, rgba(0, 150, 136, 0.8));
  z-index: 1;
}

.card .card-img-overlay {
  z-index: 2;
}

.card-bg-scale {
  z-index: 99;
  background-color: transparent;
}

.card-bg-scale::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: inherit;
  background-size: inherit;
  background-position: inherit;
  background-repeat: no-repeat;
  -webkit-transition: all 1s !important;
  transition: all 1s !important;
  z-index: 0;
  pointer-events: none;
}

.card-bg-scale:hover::after {
  -webkit-transform: scale(1.1);
          transform: scale(1.1);
  -webkit-transition: all 1s !important;
  transition: all 1s !important;
}

/* 政策公告样式 */
.policy-announcement-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.policy-announcement-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.policy-header {
  background: linear-gradient(135deg, color-mix(in srgb, var(--bs-primary) 70%, transparent) 0%, color-mix(in srgb, var(--sc-btn-hover) 70%, transparent) 70%);
  color: white;
  padding: 0.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  min-height: 80px;
}

.policy-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 2;
  line-height: 1.4;
  text-align: center;
  color: white;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: normal;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: pretty;
}

.policy-title .policy-item-link-header {
  word-break: normal;
  overflow-wrap: break-word;
  line-break: strict;
  text-wrap: pretty;
}

/* 首页 SEO 用 h2，字号仍按原 h4/h5，避免被全站 h2 !important 撑大 */
h2.policy-title {
  font-size: 18px !important;
}

.card-grid h2.h5 {
  font-size: 16px !important;
}

.policy-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-top: 0.5rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.policy-content {
  padding: 0 0.8rem;
  background: linear-gradient(58deg, #e5feffa8, #b2d6ff42);
  flex-direction: column;
  /* justify-content: center; */
}

.policy-content-articles {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0.35rem;
}

.policy-content-articles .policy-item {
  padding: 0.48rem 0;
}

.policy-content-articles .policy-item:hover {
  margin: 0;
  padding: 0.48rem 0.2rem;
  margin: 0 0.3rem;
  border-radius: 6px;
  background: #e6feffd6;
}

.policy-brief-section {
  flex: 0 0 auto;
  margin-top: auto;
  margin-left: 0;
  margin-right: 0;
  /* padding: 0.45rem 0.35rem 0.35rem; */
  background: #e9fafc;
  border-top: 1px solid #dee2e6;
}

.policy-brief-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.8rem 0.45rem;
  gap: 0.75rem;
}

.policy-brief-bar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
}

.policy-brief-bar-link {
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.policy-brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.12rem, 0.08rem + 0.2vw, 0.3rem);
}

.policy-brief-cell {
  position: relative;
  overflow: hidden;
  min-width: 0;

  transition: all 0.3s ease;
}

.policy-brief-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.policy-brief-tone-blue {
  background: color-mix(in srgb, var(--bs-primary) 70%, transparent);
}

.policy-brief-tone-coral {
  background: color-mix(in srgb, var(--sc-btn-active) 70%, transparent);
}

.policy-brief-tone-teal {
  background: color-mix(in srgb, var(--sc-btn-hover) 70%, transparent);
}

.policy-brief-tone-violet {
  background: color-mix(in srgb, var(--sc-header-hover) 70%, transparent);
}

.policy-brief-cell-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(2.2rem, 1.6rem + 1.8vw, 3.25rem);
  padding: clamp(0.22rem, 0.15rem + 0.3vw, 0.45rem) clamp(0.15rem, 0.1rem + 0.25vw, 0.35rem);
  text-align: center;
  text-decoration: none;
  color: #fff;
  gap: 0.08rem;
  box-sizing: border-box;
}

.policy-brief-cell-link:hover {
  color: #fff;
  text-decoration: none;
}

.policy-brief-period {
  font-size: clamp(0.82rem, 0.5rem + 0.4vw, 0.78rem);
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.policy-brief-date {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.55rem, 0.45rem + 0.3vw, 0.68rem);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.policy-content-brief {
  flex: 0 0 auto;
  padding-top: 0.15rem;
  padding-bottom: 0.55rem;
}

.policy-content-brief .policy-item {
  padding: 0.55rem 0;
}

@media (max-width: 991.98px) {
  .policy-content-articles {
    max-height: none;
    overflow: hidden;
  }

  .policy-brief-section {
    margin-top: auto;
    padding: 0;
  }
}

@media (max-width: 575.98px) {
  .policy-brief-bar {
    padding-bottom: 0.55rem;
  }
}

.policy-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f3f4;
  transition: all 0.2s ease;
  min-width: 0;
}

.policy-item:last-child {
  border-bottom: none;
}

.policy-item:hover {
  background: #f8f9fa;
  border-radius: 8px;
}

.policy-bullet {
  width: 6px;
  height: 6px;
  border: 2px solid #FF6142;
  /* background: linear-gradient(135deg, #ff6b6b, #ee5a24); */
  border-radius: 50%;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.policy-item-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  color: #495057;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 中间突破显示的policy-header样式 */
.policy-content .policy-header {
  margin: 0.4rem -1.2rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, #399db6 0%, var(--bs-primary) 80%) !important;
  min-height: 66px;
}

.policy-content .policy-header .policy-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.policy-item-date {
  color: #6c757d;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 1rem;
  flex-shrink: 0;
}

.policy-item-link {
  color: inherit;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-item-link:hover {
  color: var(--bs-primary);
  text-decoration: none;
}

.policy-item-link-header {
  color: inherit;
  text-decoration: none;
}

.policy-item-link-header:hover {
  color: #fff9d8;
  text-decoration: none;
}

/* 主英雄区域 - 左/中/右顶部与底部对齐，中间断点防溢出 */
.card-grid > .container > .row.pb-1 {
  align-items: stretch;
  overflow: hidden;
}

.card-grid .row .col-lg-4,
.card-grid .row .col-lg-6,
.card-grid .row .hero-policy-col,
.card-grid .row .hero-slider-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.card-grid .row .col-lg-2,
.card-grid .row .hero-sidebar-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.card-grid .hero-slider-col .tiny-slider,
.card-grid .hero-slider-col .tiny-slider-inner {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.card-grid .hero-slider-card {
  position: relative;
  width: 100%;
  --bs-card-bg: transparent;
  background-color: transparent !important;
}

.card-grid .hero-slider-card .display-5 {
  font-size: clamp(1rem, 2.2vw, 1.75rem);
  line-height: 1.3;
}

.card-grid .hero-slider-card .card-img-overlay {
  overflow: hidden;
}

.card-grid .row .col-lg-4 .tiny-slider {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.card-grid .row .col-lg-6 .policy-announcement-card {
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.card-grid .hero-policy-col .policy-announcement-card {
  overflow: hidden;
}

.card-grid .hero-policy-col .policy-content-articles {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
}

.card-grid .hero-policy-col .policy-content-articles .policy-item {
  min-height: 0;
  padding: 0.3rem 0;
  align-items: center;
  overflow: hidden;
}

.card-grid .hero-policy-col .policy-content-articles .policy-item-text,
.card-grid .hero-policy-col .policy-content-articles .policy-item-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.card-grid .hero-policy-col .policy-brief-section {
  flex-shrink: 0;
  min-width: 0;
}

.card-grid .hero-policy-col .policy-brief-grid,
.card-grid .hero-policy-col .home-topics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (min-width: 992px) {
  .card-grid > .container > .row.pb-1 .hero-sidebar-col,
  .card-grid > .container > .row.pb-1 .hero-slider-col,
  .card-grid > .container > .row.pb-1 .hero-policy-col {
    height: clamp(440px, 40vw, 541px);
  }

  .card-grid > .container > .row.pb-1 > .col-lg-2.hero-sidebar-col {
    display: flex !important;
    flex-direction: column !important;
    height: clamp(440px, 40vw, 541px);
    overflow: hidden;
  }

  .card-grid .hero-slider-col .tiny-slider .hero-slider-card {
    height: clamp(440px, 40vw, 541px) !important;
    min-height: clamp(440px, 40vw, 541px) !important;
  }

  .card-grid > .container > .row.pb-1 > .col-lg-2.hero-sidebar-col > .social-widget-area {
    flex: 0 0 auto;
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: clamp(0.12rem, 0.06rem + 0.12vw, 0.28rem);
    margin: 0 0 clamp(0.2rem, 0.12rem + 0.22vw, 0.45rem) 0 !important;
    min-width: 0;
    width: 100%;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
  }

  .card-grid > .container > .row.pb-1 > .col-lg-2.hero-sidebar-col > .social-widget-area > .col-4 {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 0 !important;
  }

  .hero-sidebar-col .social-widget-area .col-4 a {
    width: 100%;
    min-height: clamp(3.25rem, 1.6rem + 3.8vw, 4.75rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(0.32rem, 0.18rem + 0.55vw, 0.85rem) clamp(0.12rem, 0.06rem + 0.18vw, 0.55rem) !important;
    box-sizing: border-box;
  }

  .hero-sidebar-col .social-widget-area .col-4 a i {
    font-size: clamp(0.82rem, 0.55rem + 0.65vw, 1.2rem) !important;
    margin-bottom: clamp(0.12rem, 0.06rem + 0.12vw, 0.4rem) !important;
  }

  .hero-sidebar-col .social-widget-area .col-4 a i.fs-5 {
    font-size: clamp(0.82rem, 0.55rem + 0.65vw, 1.2rem) !important;
  }

  .hero-sidebar-col .social-widget-area .col-4 a h6,
  .hero-sidebar-col .social-widget-area .col-4 a .h6 {
    font-size: clamp(0.66rem, 0.48rem + 0.42vw, 1rem);
    line-height: 1.15;
    margin-bottom: 0;
  }

  .hero-sidebar-col .social-widget-area .col-4 a .small {
    font-size: clamp(0.56rem, 0.4rem + 0.32vw, 0.82rem);
    line-height: 1.1;
  }

  .card-grid > .container > .row.pb-1 > .col-lg-2.hero-sidebar-col > .hero-sidebar-categories {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(0.12rem, 0.06rem + 0.12vw, 0.28rem);
    overflow: hidden;
  }

  .card-grid > .container > .row.pb-1 > .col-lg-2.hero-sidebar-col > .hero-sidebar-categories > .site-category-card {
    flex: 1 1 0;
    min-height: 1.75rem;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .hero-sidebar-col .hero-sidebar-categories .site-category-card > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.15rem, 0.08rem + 0.22vw, 0.55rem) !important;
  }

  .hero-sidebar-col .site-category-card a.h5 {
    font-size: clamp(0.68rem, 0.42rem + 0.55vw, 1.1rem) !important;
    line-height: 1.15;
    margin: 0;
    white-space: nowrap;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .card-grid > .container > .row.pb-1 .hero-slider-col,
  .card-grid > .container > .row.pb-1 .hero-policy-col {
    height: clamp(400px, 52vw, 520px);
    overflow: hidden;
  }

  .card-grid .hero-slider-col .tiny-slider {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .card-grid .hero-slider-col .tiny-slider-inner {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
  }

  .card-grid .hero-slider-col .tiny-slider .hero-slider-card {
    height: clamp(400px, 52vw, 520px) !important;
    min-height: clamp(400px, 52vw, 520px) !important;
  }

  .card-grid .hero-policy-col .policy-announcement-card {
    height: 100%;
    min-height: 0;
  }

  .card-grid .hero-policy-col .policy-item-date {
    font-size: 0.72rem;
    margin-left: 0.5rem;
  }
}

@media (max-width: 991.98px) {
  .policy-content {
    max-height: none;
  }

  .policy-content-articles {
    max-height: none;
    overflow: hidden;
  }

  .hero-sidebar-col .hero-sidebar-categories {
    overflow: visible;
  }
}

@media (max-width: 767.98px) {
  .card-grid > .container > .row.pb-1 {
    overflow: visible;
  }

  /* 轮播在上、政策区在下（约 734px 堆叠断点） */
  .card-grid > .container > .row.pb-1 > .hero-policy-col {
    margin-top: 0.25rem;
  }

  .card-grid .hero-policy-col .policy-header {
    min-height: 0;
    padding: 0.35rem 0.5rem;
  }

  .card-grid .hero-policy-col .policy-title {
    font-size: 0.95rem !important;
    line-height: 1.6;
  }

  .card-grid .row .col-lg-4,
  .card-grid .row .col-lg-6,
  .card-grid .row .col-lg-2,
  .card-grid .row .hero-policy-col,
  .card-grid .row .hero-slider-col,
  .card-grid .row .hero-sidebar-col {
    height: auto;
    overflow: visible;
  }

  .card-grid .hero-policy-col .policy-announcement-card {
    height: auto;
    min-height: 0;
  }

  .card-grid .hero-slider-col .tiny-slider,
  .card-grid .hero-slider-col .tiny-slider-inner {
    height: auto;
  }

  .card-grid .hero-slider-col .tiny-slider .hero-slider-card {
    height: clamp(280px, 72vw, 380px) !important;
    min-height: 280px !important;
  }
}

.card-grid .row .col-lg-2 .social-widget-area {
  flex: 0 0 auto;
  margin-bottom: 0.5rem;
}

.card-grid .row .col-lg-2 > div:last-child {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* 小卡片样式 */
.policy-announcement-card.small-card {
  height: 300px;
}

.policy-announcement-card.small-card .policy-header {
  min-height: 80px;
  padding: 1rem;
}

.policy-announcement-card.small-card .policy-content {
  padding: 1rem;
}

  @media (max-width: 480px) {
      .batch-upload-container {
          padding: 5px;
      }

      .file-item {
          padding: 12px;
          margin-bottom: 15px;
      }

      .upload-area {
          padding: 15px 10px;
      }

      .upload-area h4 {
          font-size: 16px;
      }

      .upload-area i {
          font-size: 2.5rem !important;
      }

      .file-content-form {
          padding: 12px;
      }

      .file-settings {
          padding: 12px;
      }

      .file-settings h6 {
          font-size: 14px;
          margin-bottom: 15px;
      }

      .form-group label {
          font-size: 14px;
      }

      .btn-sm {
          padding: 10px 12px;
          font-size: 14px;
      }

      .file-name {
          font-size: 14px;
      }

      .file-details div {
          padding: 6px 10px;
          font-size: 13px;
      }
  }

/* 站点栏目样式 */
.site-categories {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.site-categories h6 {
  color: #495057;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 0.5rem;
}

.site-categories .nav-link {
  color: #6c757d;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.site-categories .nav-link:hover {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  text-decoration: none;
}

.site-categories .nav-item {
  margin-bottom: 0.25rem;
}

/* 站点栏目卡片悬停效果 */
.site-category-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

/* 热门标签：主色系相近微偏移分档（微暖/本色/微冷/浅本色），局部作用不影响全局 soft 类 */
.tag-header-bar .hot-tags-list .btn-danger-soft {
  color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-warm) 42%);
  background-color: rgba(var(--bs-primary-rgb), 0.14);
}
.tag-header-bar .hot-tags-list .btn-danger-soft:active,
.tag-header-bar .hot-tags-list .btn-danger-soft:hover {
  color: #fff;
  background-color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-warm) 42%);
  border-color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-warm) 42%);
}
.tag-header-bar .hot-tags-list .btn-danger-soft:focus {
  color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-warm) 42%);
  background-color: rgba(var(--bs-primary-rgb), 0.14);
  border-color: transparent;
}
.tag-header-bar .hot-tags-list .btn-primary-soft {
  color: var(--sc-btn-active);
  background-color: rgba(var(--bs-primary-rgb), 0.12);
}
.tag-header-bar .hot-tags-list .btn-primary-soft:active,
.tag-header-bar .hot-tags-list .btn-primary-soft:hover {
  color: #fff;
  background-color: var(--sc-btn-active);
  border-color: var(--sc-btn-active);
}
.tag-header-bar .hot-tags-list .btn-primary-soft:focus {
  color: var(--sc-btn-active);
  background-color: rgba(var(--bs-primary-rgb), 0.12);
  border-color: transparent;
}
.tag-header-bar .hot-tags-list .btn-success-soft {
  color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-cool) 42%);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
}
.tag-header-bar .hot-tags-list .btn-success-soft:active,
.tag-header-bar .hot-tags-list .btn-success-soft:hover {
  color: #fff;
  background-color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-cool) 42%);
  border-color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-cool) 42%);
}
.tag-header-bar .hot-tags-list .btn-success-soft:focus {
  color: color-mix(in srgb, var(--sc-btn-active) 58%, var(--sc-deep-cool) 42%);
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  border-color: transparent;
}
.tag-header-bar .hot-tags-list .btn-dark-soft {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.08);
}
.tag-header-bar .hot-tags-list .btn-dark-soft:active,
.tag-header-bar .hot-tags-list .btn-dark-soft:hover {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.tag-header-bar .hot-tags-list .btn-dark-soft:focus {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.08);
  border-color: transparent;
}

/* 用户配色切换器面板（白底反制全局 .nav-item.dropdown .dropdown-menu 深色规则，保证可读） */
.nav-item.dropdown .dropdown-menu.theme-picker-menu {
  background-color: #fff !important;
  color: #212529 !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.theme-picker-menu {
  min-width: 210px;
}

.theme-pick-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #495057;
  cursor: pointer;
  text-align: left;
}

.theme-pick-item:hover {
  background: #f1f3f5;
}

.theme-pick-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pick-color, #2163e8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.theme-pick-dot-default {
  background: conic-gradient(#2163e8, #0d9488, #d63031, #6f42c1, #e67e22, #c2185b, #15803d, #0e7490, #2163e8);
}

.theme-pick-label {
  flex: 1;
}

.theme-pick-check {
  color: var(--bs-primary);
  font-size: 0.8rem;
}

/* .text-success 统一跟随主题色系（成功/免费/已验证等绿字全部主题化） */
.text-success {
  color: rgba(var(--bs-primary-rgb), var(--bs-text-opacity, 1)) !important;
}

/* 排序按钮组：图标在上、文字在下（适度紧凑，宽度充足） */
.btn-group-xs .category-btn-mobile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  line-height: 1.15;
  padding: 0.2rem 0.5rem !important;
  font-size: 0.65rem !important;
}

.btn-group-xs .category-btn-mobile .fas,
.btn-group-xs .category-btn-mobile .fa {
  font-size: 0.8em;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.site-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.site-category-card a {
  text-decoration: none;
  color: inherit;
}

.site-category-card a:hover {
  text-decoration: none;
  color: inherit;
}

/* 文章标签样式美化 */
.article-tags-main {
  margin: 20px 0;
  padding: 15px 15px;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  text-align: center;
}

.article-tags-main h6 {
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 12px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.article-tag-link {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #495057;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.article-tag-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

.article-tag-link:hover {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--sc-btn-hover) 100%);
  color: white;
  border-color: var(--bs-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3);
  text-decoration: none;
}

.article-tag-link:hover::before {
  left: 100%;
}

/* 不同标签等级的颜色和大小 */
.article-tag-link.tags1 {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #2196f3;
  color: #0d47a1;
  font-size: 0.65rem;
  padding: 4px 8px;
  font-weight: 400;
}

.article-tag-link.tags2 {
  background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  border-color: #9c27b0;
  color: #4a148c;
  font-size: 0.7rem;
  padding: 5px 9px;
  font-weight: 400;
}

.article-tag-link.tags3 {
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  border-color: #4caf50;
  color: #1b5e20;
  font-size: 0.75rem;
  padding: 5px 10px;
  font-weight: 500;
}

.article-tag-link.tags4 {
  background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
  border-color: #ff9800;
  color: #e65100;
  font-size: 0.8rem;
  padding: 6px 12px;
  font-weight: 500;
}

.article-tag-link.tags5 {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
  border-color: #e91e63;
  color: #880e4f;
  font-size: 0.85rem;
  padding: 6px 13px;
  font-weight: 600;
}

.article-tag-link.tags6 {
  background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
  border-color: #009688;
  color: #004d40;
  font-size: 0.9rem;
  padding: 7px 14px;
  font-weight: 600;
}

.article-tag-link.tags7 {
  background: linear-gradient(135deg, #f1f8e9 0%, #dcedc8 100%);
  border-color: #8bc34a;
  color: #33691e;
  font-size: 0.95rem;
  padding: 7px 15px;
  font-weight: 600;
}

.article-tag-link.tags8 {
  background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
  border-color: #3f51b5;
  color: #1a237e;
  font-size: 1rem;
  padding: 8px 16px;
  font-weight: 700;
}

.article-tag-link.tags9 {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-color: #ffc107;
  color: #ff6f00;
  font-size: 1.05rem;
  padding: 8px 17px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .article-tags-main {
    margin: 15px 0;
    padding: 12px 0;
  }
  
  .article-tags-list {
    gap: 6px;
  }
  
  .article-tag-link {
    padding: 4px 10px;
    font-size: 0.75rem;
  }
  
  /* 移动端标签大小调整 */
  .article-tag-link.tags1 { font-size: 0.6rem; padding: 3px 6px; }
  .article-tag-link.tags2 { font-size: 0.65rem; padding: 4px 7px; }
  .article-tag-link.tags3 { font-size: 0.7rem; padding: 4px 8px; }
  .article-tag-link.tags4 { font-size: 0.75rem; padding: 5px 9px; }
  .article-tag-link.tags5 { font-size: 0.8rem; padding: 5px 10px; }
  .article-tag-link.tags6 { font-size: 0.85rem; padding: 6px 11px; }
  .article-tag-link.tags7 { font-size: 0.9rem; padding: 6px 12px; }
  .article-tag-link.tags8 { font-size: 0.95rem; padding: 7px 13px; }
  .article-tag-link.tags9 { font-size: 1rem; padding: 7px 14px; }
  
  /* 分类按钮手机端紧凑样式 */
  .category-btn-mobile {
    padding: 0.25rem 0.25rem !important;
    font-size: 0.75rem !important;
    border-radius: 0rem !important;
    margin: 0rem !important;
  }
  
  /* 一级分类按钮手机端样式 */
  .first-level-btn {
    padding: 0.5rem 0.8rem !important;
  }
  
  .first-level-btn .first-level-icon {
    display: none !important;
  }
  .first-level-section, .second-level-section, .third-level-section, .breadcrumb-area {
    padding: 0.15rem !important;
  }
  /* 一级分类间距手机端样式 */
  .first-level-section .row {
    --bs-gutter-x: 0rem !important;
    --bs-gutter-y: 0.5rem !important;
  }
  
  .second-level-section .row {
    gap: 0.2rem !important;
  }
  
  .third-level-section .d-flex {
    gap: 0rem !important;
  }
  
  .third-category-item {
    margin: 0rem !important;
  }
}

@media (max-width: 576px) {
  .article-tags-main h6 {
    font-size: 0.8rem;
    margin-bottom: 3px;
  }
  
  .article-tag-link {
    padding: 3px 8px;
    font-size: 0.7rem;
  }
  
  /* 小屏幕标签大小调整 */
  .article-tag-link.tags1 { font-size: 0.55rem; padding: 2px 5px; }
  .article-tag-link.tags2 { font-size: 0.6rem; padding: 3px 6px; }
  .article-tag-link.tags3 { font-size: 0.65rem; padding: 3px 7px; }
  .article-tag-link.tags4 { font-size: 0.7rem; padding: 4px 8px; }
  .article-tag-link.tags5 { font-size: 0.75rem; padding: 4px 9px; }
  .article-tag-link.tags6 { font-size: 0.8rem; padding: 5px 10px; }
  .article-tag-link.tags7 { font-size: 0.85rem; padding: 5px 11px; }
  .article-tag-link.tags8 { font-size: 0.9rem; padding: 6px 12px; }
  .article-tag-link.tags9 { font-size: 0.95rem; padding: 6px 13px; }
  
  /* 超小屏幕分类按钮更紧凑样式 */
  .category-btn-mobile {
    padding: 0.26rem 0.25rem !important;
    font-size: 0.7rem !important;
    border-radius: 0rem !important;
    margin: 0rem !important;
  }
  
  /* 一级分类按钮超小屏幕样式 */
  .first-level-btn {
    padding: 0.5rem 0.5rem !important;
  }
  
  .first-level-btn .first-level-icon {
    display: none !important;
  }
  
  /* 一级分类间距超小屏幕样式 */
  .first-level-section .row {
    --bs-gutter-x: 0rem !important;
    --bs-gutter-y: 0.5rem !important;
  }
  
  .second-level-section .row {
    gap: 0.2rem !important;
  }
  
  .third-level-section .d-flex {
    gap: 0rem !important;
  }
  
  .third-category-item {
    margin: 0rem !important;
  }
}
   /* 小屏幕优化样式 */
   @media (max-width: 768px) {

    .category-btn-mobile {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        white-space: nowrap;
    }

    /* 二级菜单：移动端按内容自适应、居中换行，文字完整显示 */
    .second-level-section {
        margin-bottom: 0.35rem !important;
        padding-top: 0.1rem !important;
        padding-bottom: 0.1rem !important;
    }

    .second-level-section.mb-0 {
        margin-bottom: 0.25rem !important;
    }

    .second-level-section.pb-0 {
        padding-bottom: 0 !important;
    }

    .second-level-section .row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem 0.4rem !important;
        --bs-gutter-x: 0 !important;
        --bs-gutter-y: 0 !important;
        justify-content: center !important;
        align-items: center;
    }

    .second-level-section .row > .col-auto {
        flex: 0 0 auto;
        max-width: none;
        width: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .second-level-section .category-btn-mobile {
        display: inline-flex !important;
        width: auto !important;
        max-width: 100%;
        justify-content: center;
        align-items: center;
        margin: 0 !important;
        border-radius: 0.3rem !important;
        padding: 0.32rem 0.55rem !important;
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
    }

    .second-level-section .category-btn-mobile .fas,
    .second-level-section .category-btn-mobile .fa {
        display: inline-block !important;
        margin-right: 0.25rem !important;
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    /* Tab 导航：移动端居中换行（排除侧栏纵向菜单） */
    .nav-pills:not(.flex-column) {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.35rem 0.4rem;
        justify-content: center !important;
    }

    .nav-pills:not(.flex-column) > .nav-item {
        flex: 0 0 auto;
        min-width: 0;
        width: auto;
    }

    .sticky-sidebar .nav-pills {
        flex-direction: column !important;
    }

    .sticky-sidebar .nav-pills > .nav-item {
        flex: none;
        width: 100%;
    }

    .nav-pills:not(.flex-column) .nav-link {
        width: auto;
        text-align: center;
        padding: 0.32rem 0.55rem;
        font-size: 0.75rem;
        margin-bottom: 0 !important;
        border-radius: 0.3rem;
        white-space: nowrap;
    }

    .nav-pills:not(.flex-column) .nav-link i {
        font-size: 0.72rem;
        margin-right: 0.2rem !important;
    }
    
    /* 用户信息卡片优化 */
    .user-info-card {
        margin-bottom: 1rem;
    }
    
    .user-info-card .card-body {
        padding: 1rem;
    }
    
    .user-info-card .row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .user-info-card .col-md-8,
    .user-info-card .col-md-4 {
        width: 100%;
        max-width: 100%;
    }
    
    /* 表单优化 */
    .form-label {
        font-size: 0.85rem;
        font-weight: 500;
    }
    
    .form-control,
    .form-select {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    /* 卡片内边距优化 */
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    /* 统计卡片优化 */
    .stats-card {
        margin-bottom: 0.5rem;
    }
    
    .stats-card .card-body {
        padding: 0.75rem;
        text-align: center;
    }
    
    .stats-card h4 {
        font-size: 1.25rem;
    }
    
    .stats-card h6 {
        font-size: 0.8rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .first-level-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    .category-btn-mobile {
        font-size: 0.72rem;
        padding: 0.28rem 0.5rem;
    }

    .second-level-section .row {
        gap: 0.3rem 0.35rem !important;
        justify-content: center !important;
    }

    .second-level-section .row > .col-auto {
        flex: 0 0 auto;
        max-width: none;
        width: auto !important;
    }

    .second-level-section .category-btn-mobile {
        width: auto !important;
        padding: 0.28rem 0.5rem !important;
        font-size: 0.72rem !important;
        overflow: visible;
        text-overflow: clip;
    }

    .second-level-section .category-btn-mobile .fas,
    .second-level-section .category-btn-mobile .fa {
        display: inline-block !important;
    }

    .nav-pills:not(.flex-column) {
        justify-content: center !important;
    }

    .nav-pills:not(.flex-column) > .nav-item {
        flex: 0 0 auto;
        width: auto;
    }

    .nav-pills:not(.flex-column) .nav-link {
        width: auto;
        font-size: 0.72rem;
        padding: 0.28rem 0.5rem;
        line-height: 1.25;
    }
    
    .form-control,
    .form-select {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.5rem 0.75rem;
    }
}

/* ==================== 标签字母导航响应式样式 ==================== */
/* 通用字母导航优化 - 覆盖可能冲突的样式 */
.letter-nav-btn {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important; /* 覆盖可能影响宽度的样式 */
    max-width: none !important;
    font-size: 1rem !important;
}

.letter-nav-btn .badge {
    font-size: 0.7rem !important;
}

.letter-nav-btn:hover {
    background-color: var(--bs-success) !important;
    color: white !important;
}

/* 小屏幕优化 - 字母导航栏 */
@media (max-width: 768px) {
    .letter-nav-btn {
        font-size: 1.2rem !important;
        padding: 0.25rem 0.5rem !important;
        min-width: 2rem !important;
        height: 2rem !important;
        width: auto !important; /* 确保宽度不受其他样式影响 */
    }
    
    .letter-nav-btn .badge {
        font-size: 0.6rem !important;
        padding: 0.15rem 0.3rem !important;
    }
    
    .letter-nav-btn .ms-1 {
        margin-left: 0.1rem !important;
    }
    
    /* 字母导航容器优化 - 确保一行显示多个并居中 */
    .d-flex.flex-wrap.justify-content-center.gap-2 {
        gap: 0.25rem !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        align-items: center !important;
    }
    
    /* 字母导航卡片内边距优化 */
    .card-body.py-3 {
        padding: 0.75rem 0.5rem !important;
    }
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    .letter-nav-btn {
        font-size: 1.1rem !important;
        padding: 0.2rem 0.4rem !important;
        min-width: 1.8rem !important;
        height: 1.8rem !important;
        width: auto !important; /* 确保宽度不受其他样式影响 */
    }
    
    .letter-nav-btn .badge {
        font-size: 0.55rem !important;
        padding: 0.1rem 0.25rem !important;
    }
    
    /* 进一步减少间距 - 确保一行显示更多字母并居中 */
    .d-flex.flex-wrap.justify-content-center.gap-2 {
        gap: 0.15rem !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        align-items: center !important;
    }
    
    .card-body.py-3 {
        padding: 0.5rem 0.25rem !important;
    }
}

.dropdown-menu-width {
   min-width: 10rem !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.9);
    }
}


.download-btn {
  background: linear-gradient(45deg, var(--bs-primary), var(--sc-btn-hover));
  border: none;
  color: white;
  padding: 8px 15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.6s ease;
}

.download-btn:hover {
  background: linear-gradient(45deg, var(--sc-btn-hover), var(--sc-btn-active));
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* 下载按钮样式 */
.download-btn {
    background: rgba(var(--bs-primary-rgb), 0.3) !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 0 !important;
    line-height: 1;
    width: 2rem;
    height: 1.75rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

/* 下载图标大小设置 */
.download-btn i {
    font-size: 0.75rem !important;
    width: 1em;
    line-height: 1;
    display: inline-block;
    text-align: center;
}

/* 确保卡片悬停时下载按钮显示 */
.library-card {
    transition: all 0.3s ease;
}

/* 移动端：保留原有位移+阴影特效 */
.library-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* 桌面端：取消整卡 translate（易导致封面发糊），仅保留阴影抬升感 */
@media (min-width: 768px) {
    .library-card:hover {
        transform: none;
    }
}

/* 文档卡片悬停操作按钮样式 */
.card-action-overlay,
.download-overlay {
  display: none !important;
  z-index: 30;
  position: relative;
}

.card-action-overlay a,
.card-action-overlay button,
.download-overlay a {
  pointer-events: auto;
  transition: all 0.3s ease;
  position: relative;
  z-index: 31;
}

/* 收藏按钮样式 */
.favorite-btn {
    background: #dc354596 !important;
    border: none !important;
    border-radius: 5px !important;
    color: #6c757d !important;
    padding: 0 !important;
    line-height: 1;
    width: 2rem;
    height: 1.75rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.favorite-btn i {
    font-size: 0.75rem !important;
    width: 1em;
    line-height: 1;
    display: inline-block;
    text-align: center;
    transition: transform 0.3s ease, color 0.2s ease;
}

.favorite-btn .far.fa-heart {
    font-size: 1rem !important;
}

.favorite-btn .fa-heart.text-muted,
.favorite-btn .far.fa-heart {
    color: #ffb300 !important;
}

.favorite-btn.is-favorited {
    background: rgba(220, 53, 69, 0.85) !important;
    color: #fff !important;
}

.favorite-btn.is-favorited .fa-heart,
.favorite-btn .fas.fa-heart.text-danger {
    color: #fff !important;
}

.doc-favorite-btn .far.fa-heart.text-muted,
.login-trigger-btn .far.fa-heart.text-muted {
    color: #adb5bd !important;
}

.doc-favorite-btn .fas.fa-heart.text-danger {
    color: #dc3545 !important;
}

.doc-favorite-btn.btn-outline-secondary .far.fa-heart {
    color: #6c757d !important;
}

.doc-favorite-btn.btn-outline-danger .fas.fa-heart {
    color: #dc3545 !important;
}

.card-action-overlay a i,
.download-overlay a i {
  transition: transform 0.3s ease;
}

/* 文档卡片标题悬停效果 - 模拟btn-link的悬停效果 */
.library-card:hover .btn-link {
  background-size: 100% 6% !important;
  background-repeat: no-repeat !important;
  background-position: 0 100% !important;
  text-decoration: none !important;
}

/* 问题卡片布局优化 - 使用Flexbox确保对齐 */
.question-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

.question-card .card-body {
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1 !important;
}

.question-title {
  flex-shrink: 0 !important;
  margin-bottom: 0.5rem !important;
  line-height: 1.4 !important;
}

.question-content {
  flex-grow: 1 !important;
  margin-bottom: 0.5rem !important;
}

.question-meta {
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

/* 防止按钮晃动 */
.card-action-overlay a,
.card-action-overlay button,
.download-overlay a {
  will-change: transform;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* 一键导入按钮样式（默认显示在右上角） */
.import-knowledge-btn {
  background: rgba(40, 167, 69, 0.3) !important;
  border: none !important;
  border-radius: 5px !important;
  pointer-events: auto;
  transition: all 0.3s ease;
  position: relative;
  z-index: 31;
  color: white !important;
}

.import-knowledge-btn i {
  font-size: 0.6rem;
  transition: transform 0.3s ease;
}

/* 当鼠标悬停在导入按钮上时，放大并改变背景 */
.import-knowledge-btn:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
  background: rgba(40, 167, 69, 0.8) !important;
}

/* 悬停时图标旋转动画 */
.import-knowledge-btn:hover i {
  transform: rotate(360deg);
}

/* 防止按钮晃动 */
.import-knowledge-btn {
  will-change: transform;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* 移动端完全隐藏悬停操作按钮（含触摸 sticky hover） */
@media (max-width: 767px) {
    .desktop-only,
    .card-action-overlay,
    .download-overlay,
    .library-card:hover .card-action-overlay,
    .library-card:hover .download-overlay,
    .library-card:hover .desktop-only {
        display: none !important;
        pointer-events: none !important;
    }
}

/* 桌面端悬停显示 */
@media (min-width: 768px) {
    .library-card:hover .card-action-overlay,
    .library-card:hover .download-overlay,
    .library-card:hover .desktop-only {
        display: block !important;
        animation: fadeIn 0.3s ease-in-out;
    }

    .library-card:hover .card-action-overlay a:hover,
    .library-card:hover .card-action-overlay button:hover:not(:disabled),
    .library-card:hover .download-overlay a:hover {
        transform: scale(1.3) translateY(-3px);
    }

    .library-card:hover .card-action-overlay .download-btn:hover {
        box-shadow: 0 8px 20px rgba(var(--bs-primary-rgb), 0.4);
        background: rgba(var(--bs-primary-rgb), 0.9) !important;
    }

    .library-card:hover .card-action-overlay .favorite-btn:hover:not(:disabled) {
        box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
        background: rgba(220, 53, 69, 0.9) !important;
    }

    .library-card:hover .card-action-overlay a:hover i,
    .library-card:hover .card-action-overlay button:hover:not(:disabled) i,
    .library-card:hover .download-overlay a:hover i {
        transform: rotate(360deg) scale(1.3);
    }
}
/* 置顶/推荐标识 - 右上角圆形图标 */
.card-featured {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 15px;
  height: 15px;
  background: rgba(255, 255, 255, 0.55);
  color: #dc3545;
  border-radius: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

/* 当鼠标移到卡片上时，图标自动变色放大 */
.library-card:hover .card-featured {
  background: #dc3545;
  color: white;
  transform: scale(1.05);
}

.card-featured i {
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0px 12px 0px;
}

@media (max-width: 768px) {
  .card-featured {
    width: 26px;
    height: 26px;
    top: 6px;
    right: 6px;
  }
  
  .card-featured i {
    font-size: 11px;
  }
}

/* ===== 性能优化：系统字体栈 + AI FAB 首屏样式（ai-chat.css 按需加载） ===== */
:root {
  --bs-body-font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body,
.font-base,
.font-heading,
h1, h2, h3, h4, h5, h6 {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ai-chat-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--bs-primary), var(--sc-btn-hover));
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.4);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  gap: 2px;
  padding: 4px 0;
}

.ai-chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.5);
}

.ai-chat-fab-icon {
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ai-chat-fab-text {
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  padding-top: 2px;
  text-align: center;
  white-space: nowrap;
}

h2.markdown-h2 {
    font-size: 18px !important;
    padding: 12px 0 6px 0 !important;
}

h3.markdown-h3 {
    font-size: 16px !important;
    padding: 10px 0 4px 0 !important;
}

h4.markdown-h4 {
    font-size: 15px !important;
    padding: 8px 0 2px 0 !important;
}

h5.markdown-h5 {
    font-size: 15px !important;
    padding: 6px 0 0px 0 !important;
}

@media (max-width: 767px) {
  .ai-chat-fab {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
  }
  .ai-chat-fab-text {
    font-size: 0.45rem;
  }
  
  .ai-chat-fab-icon {
    font-size: 0.8rem;
  }
}

/* 过期/有效期提示（doc 与 article 详情页共用） */
.expire-notice {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 10px 36px 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  position: relative;
}

.expire-notice--expired {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fecaca;
}

.expire-notice--valid {
  background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.08) 0%, rgba(var(--bs-primary-rgb), 0.16) 100%);
  border-color: rgba(var(--bs-primary-rgb), 0.25);
}

.expire-notice__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.expire-notice--expired .expire-notice__icon {
  background: #dc2626;
  color: #fff;
}

.expire-notice--valid .expire-notice__icon {
  background: var(--bs-primary);
  color: #fff;
}

.expire-notice__body {
  min-width: 0;
  text-align: center;
}

.expire-notice__text {
  font-size: 12.5px;
  line-height: 1.45;
}

.expire-notice--expired .expire-notice__text {
  color: #7f1d1d;
}

.expire-notice--valid .expire-notice__text {
  color: var(--sc-header-bg);
}

.expire-notice__close {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  opacity: 0.45;
  font-size: 12px;
}

.expire-notice__close:hover {
  opacity: 0.9;
}

/* 文章详情页：提示框左右缩进，与正文内容（padding 16px）两侧对齐 */
.expire-notice--article {
  margin-left: 16px;
  margin-right: 16px;
}

/* 文档卡片右下角：过期图标（横向压缩、高度不变）与文件类型图标对齐 */
.library-card .library-cover-wrap .card-expired-icon,
.library-card .library-cover-wrap .filetype-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.library-card .library-cover-wrap .card-expired-icon {
  margin-right: 2px;
  transform: scaleX(0.8);
}

.library-card .library-cover-wrap .filetype-icon i {
  line-height: 1;
}

/* 首页友情链接：标题与链接基线对齐，竖线分隔，hover 主题色
   注：padding 与 display 由 CSS 控制（不用 py-3/px-4/d-inline 工具类，
   避免其 !important 压制下方移动端媒体查询） */
.friend-links-body {
  padding: 16px 24px;
  line-height: 2;
}

.friend-links-title {
  display: inline;
  padding-right: 16px;
  border-right: 1px solid #e9ecef;
  color: #333;
}

.friend-links-title i {
  color: var(--bs-primary);
}

.friend-link {
  display: inline-block;
  margin-left: 18px;
  color: #666;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.friend-link:hover {
  color: var(--bs-primary);
}

@media (max-width: 575.98px) {
  .friend-links-body {
    padding: 12px 15px;
    line-height: 2.2;
  }

  .friend-links-title {
    display: block;
    padding-right: 0;
    border-right: none;
    margin-bottom: 4px;
  }

  .friend-link {
    margin-left: 0;
    margin-right: 16px;
    margin-bottom: 4px;
  }
}

/* 移动端页头右侧按钮组整体缩放：搜索/AI/配色/用户/通知图标紧凑排列，窄屏不换行不溢出 */
@media (max-width: 575.98px) {
  header .navbar .navbar-brand {
    margin-right: 0.75rem !important;
  }
  header .navbar .nav.flex-nowrap > .nav-item {
    margin-left: 0.15rem !important;
    margin-right: 0.15rem !important;
  }
  header .navbar .nav.flex-nowrap .btn.btn-sm {
    min-width: 30px !important;
    padding: 0.22rem 0.38rem;
    font-size: 0.75rem;
  }
  header .navbar .nav.flex-nowrap .btn.btn-sm > i {
    font-size: 0.85rem;
  }
  header .navbar .nav.flex-nowrap #navSearch {
    padding: 0.22rem 0.3rem;
  }
  header .navbar .nav.flex-nowrap #navSearch > i {
    font-size: 0.95rem;
  }
}



/* 原生 select 下拉选项配色跟随主题（浏览器支持有限：
   Firefox 完整生效；Chrome/Edge 展开列表的悬停高亮由系统绘制，无法用 CSS 覆盖，
   仅选中行 option:checked 的浅底深字背景生效） */
select.form-control option {
  color: var(--bs-body-color, #212529);
  background-color: var(--bs-body-bg, #fff);
}

select.form-control option:checked,
select.form-control option:hover {
  background-color: var(--sc-badge-primary);
  color: var(--sc-deep-primary);
}

/* 马甲选择自绘下拉（majia-select.js）：悬停/选中行主题浅底 + 深字，完全替代系统绘制高亮 */
/* 菜单展开时由 JS 挂到 body + fixed 定位（portal），脱离表单卡片的祖先层叠上下文
   （transform/opacity 等会困住 z-index），body 直下 + 高 z-index 彻底不被上传区遮挡 */
.majia-select-menu {
  z-index: 3000;
}

.majia-select-menu .dropdown-item:hover,
.majia-select-menu .dropdown-item:focus {
  background-color: var(--sc-badge-primary);
  color: var(--sc-deep-primary);
}

.majia-select-menu .dropdown-item.active {
  background-color: var(--sc-badge-primary);
  color: var(--sc-deep-primary);
}


