@charset "UTF-8";

/**
 * ytbs53 · 主站样式（紫色系）
 *
 * @desc     设计令牌驱动，浅色/暗黑双模式；Bootstrap 5.3.8 + 原生 CSS
 * @version  1.0.2
 * @updated  2026-10-16
 *
 * 8 层结构：
 *   L1 设计令牌 · L2 基准排版 · L3 布局导航 · L4 通用组件
 *   L5 业务模块 · L6 暗黑覆盖 · L7 响应式 · L8 无障碍与工具类
 */

/* ==========================================================================
   Layer 1: Design Tokens & CSS Variables (设计令牌层)
   --------------------------------------------------------------------------
   全站视觉决策的唯一定义源。业务组件与模板仅消费令牌，不直接书写裸色裸值。
   ========================================================================== */
:root {
  /* -- 1.1 品牌主色阶梯（国风雅紫 #5a3ea6）---------------------------------- */
  --bs-primary: #5a3ea6;
  --bs-primary-rgb: 90, 62, 166;
  --bs-primary-hover: #4c338e;
  --bs-primary-active: #432c7d;
  /* 变量名须与 Bootstrap 原生完全一致（-bg-subtle / -border-subtle / -text-emphasis） */
  --bs-primary-bg-subtle: #f3effa;
  --bs-primary-border-subtle: #d6caee;
  --bs-primary-text-emphasis: #432c7d;

  /* -- 1.2 辅助色阶梯 -------------------------------------------------------- */
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-secondary-hover: #565e64;
  --bs-secondary-bg-subtle: #f8f9fa;
  --bs-secondary-border-subtle: #e9ecef;

  /* -- 1.3 深度链接色 -------------------------------------------------------- */
  --bs-link-color: #5a3ea6;
  --bs-link-hover-color: #4c338e;

  /* -- 1.4 点缀色（雅金 / 暖金）---------------------------------------------- */
  --yt-gold: #c89b3c;
  --yt-gold-hover: #b3882f;
  --yt-gold-soft: #fcf8ee;
  --yt-gold-text: #9a7218;
  --yt-gold-border: rgba(200, 155, 60, 0.28);

  /* -- 1.5 语义文字阶梯 ------------------------------------------------------ */
  --yt-text: #212529;
  --yt-text-muted: #6c757d;
  --yt-text-subtle: #8c959f;
  --yt-text-inverse: #ffffff;
  --yt-muted: #6c757d;

  /* -- 1.6 语义表面与底色 ---------------------------------------------------- */
  --yt-bg: #f8f9fa;
  --yt-surface: #ffffff;
  --yt-surface-2: #fdfdfe;
  --yt-surface-3: #f5f2fb;
  --yt-surface-hover: #faf7fd;
  --yt-surface-active: #f3effa;
  --yt-surface-sunken: #f0f2f5;
  --yt-surface-elevated: #ffffff;
  --yt-surface-glass: rgba(255, 255, 255, 0.85);

  /* -- 1.7 语义描边 ---------------------------------------------------------- */
  --yt-border: rgba(0, 0, 0, 0.08);
  --yt-border-subtle: rgba(0, 0, 0, 0.04);
  --yt-border-strong: rgba(0, 0, 0, 0.16);
  --yt-border-hover: rgba(90, 62, 166, 0.28);
  --yt-border-active: rgba(90, 62, 166, 0.55);

  /* -- 1.8 几何圆角阶梯 ------------------------------------------------------ */
  --yt-radius: 0.5rem;
  --yt-radius-xs: 0.25rem;       /* 4px: 徽章、紧凑指示器 */
  --yt-radius-sm: 0.5rem;        /* 8px: 按钮、输入框、缩略图 */
  --yt-radius-md: 0.75rem;       /* 12px: 标准卡片、下拉菜单 */
  --yt-radius-lg: 1rem;          /* 16px: 详情页大卡片、模态弹窗 */
  --yt-radius-xl: 1.5rem;        /* 24px: 特色容器 */
  --yt-radius-pill: 999rem;      /* 胶囊圆角: 搜索框、Tag */

  /* -- 1.9 紫调分层阴影 ------------------------------------------------------ */
  --yt-shadow-xs: 0 1px 2px rgba(46, 31, 85, 0.04);
  --yt-shadow-sm: 0 4px 14px rgba(31, 41, 55, 0.06);
  --yt-shadow-md: 0 8px 20px -3px rgba(46, 31, 85, 0.08), 0 3px 6px -1px rgba(46, 31, 85, 0.04);
  --yt-shadow-lg: 0 16px 36px -6px rgba(46, 31, 85, 0.12), 0 6px 12px -2px rgba(46, 31, 85, 0.04);
  --yt-shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --yt-shadow-hover: 0 10px 24px -4px rgba(46, 31, 85, 0.12), 0 4px 8px -2px rgba(46, 31, 85, 0.06);
  --yt-shadow-lift: 0 10px 24px -4px rgba(46, 31, 85, 0.12), 0 4px 8px -2px rgba(46, 31, 85, 0.06);
  --yt-shadow-glow: 0 0 0 3px rgba(90, 62, 166, 0.18);

  /* -- 1.10 动效与物理微交互 ------------------------------------------------- */
  --yt-dur-fast: 0.12s;
  --yt-dur: 0.18s;
  --yt-dur-slow: 0.32s;
  --yt-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --yt-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --yt-lift: -2px;
  --yt-focus-ring: 0 0 0 3px rgba(90, 62, 166, 0.22);

  /* -- 1.11 字体与排版阶梯 --------------------------------------------------- */
  --yt-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --yt-text-xs: 0.75rem;
  --yt-text-sm: 0.875rem;
  --yt-text-base: 1rem;
  --yt-text-lg: 1.125rem;
  --yt-text-xl: 1.25rem;
  --yt-text-2xl: 1.5rem;
  --yt-leading-tight: 1.25;
  --yt-leading-normal: 1.6;
  --yt-leading-loose: 1.8;

  /* -- 1.12 全局布局基准 ----------------------------------------------------- */
  --yt-nav-height: 56px;
  --yt-nav-gradient: linear-gradient(135deg, #5a3ea6 0%, #4c338e 100%);
  --sidebar-soft: rgba(var(--bs-primary-rgb), 0.04);
}

/* ==========================================================================
   Layer 2: Base & Typography (基准重置与全局排版)
   --------------------------------------------------------------------------
   规范化全局平滑滚动、字体渲染质量以及通用链接交互反馈。
   ========================================================================== */
html,
body {
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--yt-font-sans);
  background-color: var(--yt-bg);
  color: var(--yt-text);
  font-size: var(--yt-text-base);
  line-height: var(--yt-leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

::selection {
  background-color: rgba(90, 62, 166, 0.2);
  color: inherit;
}

a {
  color: var(--bs-link-color);
  text-decoration: none;
  transition: color var(--yt-dur) var(--yt-ease);
}

a:hover {
  color: var(--bs-link-hover-color);
  text-decoration: none;
}

a.d-block:hover img,
a.ratio:hover img,
.hover-scale:hover img {
  transform: scale(1.04);
}

.transition-all {
  transition: all var(--yt-dur) var(--yt-ease);
}

.min-w-0 {
  min-width: 0 !important;
}

.border-bottom-dashed {
  border-bottom: 1px dashed var(--yt-border) !important;
}

/* ==========================================================================
   Layer 3: Layout & Navigation (全局布局与导航)
   --------------------------------------------------------------------------
   主导航 Navbar、桌面端悬停展开、移动端抽屉、搜索框、页脚与返回顶部。
   ========================================================================== */
/* -- 3.1 导航栏主体与渐变背景 ---------------------------------------------- */
.bg-purple,
.navbar-purple {
  background-color: var(--bs-primary) !important;
  background-image: var(--yt-nav-gradient) !important;
}

.navbar {
  transition: box-shadow var(--yt-dur) var(--yt-ease),
              background-color var(--yt-dur) var(--yt-ease);
}

body.is-scrolled .navbar,
.navbar.is-scrolled {
  box-shadow: 0 4px 16px -2px rgba(46, 31, 85, 0.22) !important;
}

.navbar-brand {
  min-width: 0;
  font-size: 1.05rem;
  transition: opacity var(--yt-dur) var(--yt-ease);
}

.navbar-brand:hover {
  opacity: 0.88;
}

.navbar-brand img {
  display: block;
}

.navbar-nav .nav-link {
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  transition: color var(--yt-dur) var(--yt-ease), opacity var(--yt-dur) var(--yt-ease);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff !important;
}

.navbar-dark .navbar-nav:not(#dr_member_info) > .nav-item > .nav-link {
  position: relative;
}

.navbar-dark .navbar-nav:not(#dr_member_info) > .nav-item > .nav-link::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.35rem;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar-dark .navbar-nav:not(#dr_member_info) > .nav-item > .nav-link:hover::before,
.navbar-dark .navbar-nav:not(#dr_member_info) > .nav-item > .nav-link:focus::before,
.navbar-dark .navbar-nav:not(#dr_member_info) > .nav-item > .nav-link.active::before {
  opacity: 1;
  transform: scaleX(1);
}

/* 导航栏用户登录区域 */
#dr_member_info {
  margin-bottom: 0;
}
/* 用户下拉菜单顶部垫上一层 10px 高的隐形桥梁，消除 8px 空隙死区 */
#dr_member_info .dropdown-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
#dr_member_info .dropdown-menu-end {
  right: 0;
  left: auto;
  top: 100%;
  margin-top: 0.5rem;
}

#dr_member_info .nav-link {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

#dr_member_info .nav-link:hover,
#dr_member_info .nav-link:focus,
#dr_member_info .nav-link.show {
  background: rgba(255, 255, 255, 0.14);
}

#dr_member_info .nav-link img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  object-fit: cover;
}

.nav-auth-link {
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem !important;
  border-radius: 999px;
  line-height: 1.2;
}

.nav-auth-link-ghost {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff !important;
}

.nav-auth-link-solid {
  background: #fff;
  color: var(--bs-primary) !important;
}

.nav-auth-link:hover,
.nav-auth-link:focus {
  opacity: 0.9;
}

#dr_member_info .dropdown {
  position: relative;
}

/* -- 3.2 桌面端 Hover 展开与点击跳转频道 (>= 992px) ------------------------ */
@media (min-width: 992px) {
  .navbar .dropdown:hover > .dropdown-menu {
    display: block;
    margin-top: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .navbar .dropdown > .dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity var(--yt-dur) var(--yt-ease),
                transform var(--yt-dur) var(--yt-ease-out),
                visibility var(--yt-dur);
  }
  /* 二级菜单项作为三级菜单的定位锚点 */
  .navbar-nav .subdropdown {
    position: relative;
  }
/* 三级子菜单向右错落展开，与二级菜单层级分明 */
  .navbar .dropdown-menu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -0.35rem;
    margin-left: 0.25rem;
  }
  /* 三级菜单左侧垫上一层 10px 宽的隐形桥梁，鼠标斜向滑过绝不掉落 */
  .navbar .dropdown-menu .dropdown-menu::before {
    content: "";
    position: absolute;
    top: -5px;
    bottom: -5px;
    left: -10px;
    width: 10px;
  }
  /* 鼠标滑过二级条目时，平滑展开三级子菜单 */
  .navbar-nav .subdropdown:hover > .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .navbar-nav .nav-item.dropdown:hover > .dropdown-menu,
  .navbar-nav .subdropdown:hover > .dropdown-menu {
    display: block;
  }
}
.menu-arrow::after {
  content: "";
  float: right;
  margin-top: 0.35rem;
  border-top: 0.3em solid transparent;
  border-right: 0;
  border-bottom: 0.3em solid transparent;
  border-left: 0.3em solid currentColor;
  opacity: 0.65;
  transition: transform var(--yt-dur) var(--yt-ease);
}

.dropdown-item:hover .menu-arrow::after {
  opacity: 1;
  transform: translateX(2px);
}

/* -- 3.3 导航栏搜索框（纯净圆润胶囊，消除长方形外发光）--------------------- */
.site-search .input-group {
  max-width: 180px;
  border-radius: var(--yt-radius-pill);
}

.site-search .form-control {
  padding-left: 1rem;
  border-top-left-radius: var(--yt-radius-pill);
  border-bottom-left-radius: var(--yt-radius-pill);
}

.site-search .btn {
  border-top-right-radius: var(--yt-radius-pill);
  border-bottom-right-radius: var(--yt-radius-pill);
}

.site-search .form-control,
.site-search .btn {
  box-shadow: none !important;
}

.site-search .form-control:focus,
.site-search .btn:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* -- 3.4 明暗模式切换按钮微动效 ------------------------------------------- */
#bd-theme {
  transition: color var(--yt-dur) var(--yt-ease),
              transform var(--yt-dur-slow) var(--yt-ease-out);
}
#bd-theme:hover {
  color: #fff !important;
  transform: rotate(-12deg);
}

/* -- 3.5 全局页脚（Footer）与友情链接 -------------------------------------- */
.footer {
  background-color: #1a1824;
  color: #adb5bd;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}

.footer h5 {
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.footer a {
  color: #adb5bd;
}

.footer a:hover {
  color: #fff;
}

/* -- 3.6 返回顶部按钮（坚实深紫实心钮，消除按压透底）---------------------- */
.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1030;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--yt-radius-pill);
  background-color: var(--bs-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(46, 31, 85, 0.28);
  transition: transform var(--yt-dur) var(--yt-ease),
              background-color var(--yt-dur) var(--yt-ease),
              box-shadow var(--yt-dur) var(--yt-ease);
}

.back-to-top:hover {
  background-color: var(--bs-primary-hover) !important;
  border-color: var(--bs-primary-hover) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(46, 31, 85, 0.38);
  transform: translateY(-2px);
}

.back-to-top:active,
.back-to-top:focus,
.back-to-top:focus-visible {
  background-color: var(--bs-primary-active) !important;
  border-color: var(--bs-primary-active) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(46, 31, 85, 0.32) !important;
  transform: translateY(0);
}

.back-to-top:not([hidden]) {
  display: inline-flex;
}

.back-to-top[hidden] {
  display: none !important;
}

.back-to-top .bi {
  font-size: 0.95rem;
  line-height: 1;
}

/* ==========================================================================
   Layer 4: UI Shared Components (通用 UI 组件层)
   --------------------------------------------------------------------------
   规范全站卡片、按钮、徽章、分页器、下拉菜单、模态框等基础构件。
   ========================================================================== */
/* -- 4.1 Card 卡片设计 ----------------------------------------------------- */
.card {
  --bs-card-border-radius: var(--yt-radius);
  border-radius: var(--yt-radius);
  border: 1px solid var(--yt-border);
  box-shadow: var(--yt-shadow-sm);
  background-color: var(--yt-surface);
  transition: border-color var(--yt-dur) var(--yt-ease),
              box-shadow var(--yt-dur) var(--yt-ease),
              transform var(--yt-dur) var(--yt-ease-out);
}

.card.rounded-3,
.card.rounded-4 {
  border-radius: var(--yt-radius) !important;
}

.card-header {
  background-color: var(--yt-surface-2);
  border-bottom: 1px solid var(--yt-border-subtle);
}

.card-header:first-child {
  border-top-left-radius: var(--yt-radius);
  border-top-right-radius: var(--yt-radius);
}

.card-header.border-bottom-0,
.border-bottom-0 {
  border-bottom: 0 !important;
}

.portal-card-title:has(.bi.text-purple),
.card-title:has(.bi.text-purple),
.card-title:has(.text-purple) {
  color: var(--bs-primary) !important;
}

.card-footer {
  background-color: var(--yt-surface-2);
  border-top: 1px solid var(--yt-border-subtle) !important;
}

.card .list-group-item:last-child {
  border-bottom: 0;
}

.hover-lift,
.card.hover-lift {
  transition: transform var(--yt-dur) var(--yt-ease-out),
              box-shadow var(--yt-dur) var(--yt-ease-out),
              border-color var(--yt-dur) var(--yt-ease);
}

.hover-lift:hover,
.card.hover-lift:hover {
  transform: translateY(var(--yt-lift));
  box-shadow: var(--yt-shadow-hover);
  border-color: var(--yt-border-strong);
}

.hover-lift:hover .card-title a,
.card.hover-lift:hover .card-title a {
  color: var(--bs-primary);
}

.nomove.card {
  transform: none !important;
}

/* -- 4.2 Buttons 按钮规范 -------------------------------------------------- */
.btn {
  --bs-btn-border-radius: 0.375rem;
  font-weight: 500;
  transition: all var(--yt-dur) var(--yt-ease);
}

.btn:focus-visible {
  box-shadow: var(--yt-focus-ring);
}

.btn:not(.disabled):not(:disabled):active {
  transform: translateY(1px);
}

.btn-purple {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--bs-primary-hover);
  --bs-btn-hover-border-color: var(--bs-primary-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--bs-primary-active);
  --bs-btn-active-border-color: var(--bs-primary-active);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

.btn-purple:hover {
  background-color: var(--bs-primary-hover);
  border-color: var(--bs-primary-hover);
  color: #fff;
}

.btn-purple:active,
.btn-purple:focus {
  background-color: var(--bs-primary-active);
  border-color: var(--bs-primary-active);
  color: #fff;
}

.btn-purple:focus-visible {
  box-shadow: var(--yt-focus-ring);
}

.btn-outline-purple {
  color: var(--bs-primary);
  border-color: var(--bs-primary);
  background-color: transparent;
}

.btn-outline-purple:hover,
.btn-outline-purple:active {
  color: #fff;
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-gold {
  background-color: var(--yt-gold);
  border-color: var(--yt-gold);
  color: #fff;
}

.btn-gold:hover {
  background-color: var(--yt-gold-hover);
  border-color: var(--yt-gold-hover);
  color: #fff;
}

.btn-check:focus-visible + .btn,
.btn-check:checked + .btn:focus-visible {
  box-shadow: var(--yt-focus-ring);
}

/* -- 4.3 Badge 徽章规范 ---------------------------------------------------- */
.badge {
  --bs-badge-border-radius: var(--yt-radius-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-purple {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  border: 1px solid var(--bs-primary-border-subtle);
}

.badge-gold {
  background-color: var(--yt-gold-soft);
  color: var(--yt-gold-text);
  border: 1px solid var(--yt-gold-border);
}

/* -- 4.4 Pagination 现代独立圆角微方块分页 --------------------------------- */
.pagination {
  --bs-pagination-border-radius: var(--yt-radius-xs);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.pagination .page-item {
  margin: 0;
}

.pagination .page-link {
  border-radius: var(--yt-radius-xs, 4px) !important;
  border: 1px solid var(--yt-border);
  color: var(--yt-text);
  background-color: var(--yt-surface);
  min-width: 2.125rem;
  height: 2.125rem;
  padding: 0 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--yt-dur) var(--yt-ease);
}

.pagination .page-link:hover {
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
  color: var(--bs-primary);
  transform: translateY(-1px);
}

.pagination .page-item.active .page-link,
.pagination .page-item.active > .page-link,
.pagination .page-link.active {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), 0.25);
}

.pagination .page-item.disabled .page-link {
  opacity: 0.45;
  background-color: transparent;
  border-color: var(--yt-border-subtle);
  pointer-events: none;
}

.ds-paginator,
.bbs-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.ds-paginator a,
.bbs-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.125rem;
  height: 2.125rem;
  padding: 0 0.6rem;
  border: 1px solid var(--yt-border);
  border-radius: var(--yt-radius-xs) !important;
  background: var(--yt-surface);
  color: var(--yt-text);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all var(--yt-dur) var(--yt-ease);
}

.ds-paginator a:hover,
.bbs-pagination a:hover {
  background-color: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
  color: var(--bs-primary);
}

.ds-paginator a.ds-current,
.bbs-pagination a.active {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #fff !important;
}

/* -- 4.5 Dropdown 下拉菜单 ------------------------------------------------- */
.dropdown-menu {
  --bs-dropdown-border-radius: var(--yt-radius-md);
  --bs-dropdown-border-color: var(--yt-border);
  --bs-dropdown-link-hover-bg: var(--yt-surface-3);
  --bs-dropdown-link-active-bg: var(--bs-primary);
  border-radius: var(--yt-radius-md);
  padding: 0.35rem;
  border: 1px solid var(--yt-border);
  box-shadow: var(--yt-shadow-lg);
  animation: ytDropdownIn var(--yt-dur) var(--yt-ease-out);
}

@keyframes ytDropdownIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  border-radius: var(--yt-radius-xs);
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 0.45rem 0.85rem;
  transition: background-color var(--yt-dur-fast) var(--yt-ease),
              color var(--yt-dur-fast) var(--yt-ease);
}

.dropdown-item:hover {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

/* -- 4.6 Breadcrumb 面包屑 ------------------------------------------------- */
.breadcrumb {
  --bs-breadcrumb-margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--yt-muted);
}
.breadcrumb-item + .breadcrumb-item::before {
  color: var(--yt-text-subtle);
}
.breadcrumb-item a {
  color: var(--yt-text-muted);
}
.breadcrumb-item a:hover {
  color: var(--bs-primary);
}
.breadcrumb-item.active,
.breadcrumb-item:last-child {
  color: var(--yt-muted, #6c757d) !important;
  font-weight: 400 !important;
}

/* -- 4.7 Forms 表单元素 ---------------------------------------------------- */
.form-control,
.form-select {
  border-radius: var(--yt-radius-sm);
  border: 1px solid var(--yt-border);
  transition: border-color var(--yt-dur) var(--yt-ease),
              box-shadow var(--yt-dur) var(--yt-ease);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: var(--yt-focus-ring);
}

.form-control::placeholder {
  color: var(--yt-text-subtle);
  opacity: 0.8;
}

.form-control:disabled,
.form-select:disabled {
  background-color: var(--yt-surface-sunken);
  opacity: 0.7;
}

.form-check-input:focus {
  border-color: var(--bs-primary);
  box-shadow: var(--yt-focus-ring);
}

.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.input-group-text {
  border-radius: var(--yt-radius-sm);
  border-color: var(--yt-border);
  background-color: var(--yt-surface-2);
}

/* -- 4.8 Modal 弹窗、Toast 提示与 Skeleton 骨架屏 -------------------------- */
.modal-content {
  --bs-modal-border-radius: var(--yt-radius-lg);
  border-radius: var(--yt-radius-lg);
  border: 1px solid var(--yt-border);
  box-shadow: var(--yt-shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--yt-border-subtle);
  background-color: var(--yt-surface-2);
}

.modal-footer {
  border-top: 1px solid var(--yt-border-subtle);
  background-color: var(--yt-surface-2);
}

#drIframeModal .modal-dialog,
#drFormModal .modal-dialog {
  width: min(100% - 1rem, var(--dr-modal-width, 900px));
}

#drIframeContent,
#drFormIframe {
  width: 100%;
  min-height: 280px;
}

.dr-form-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.dr-form-loading[hidden] {
  display: none !important;
}

.toast {
  --bs-toast-border-radius: var(--yt-radius-md);
  border-radius: var(--yt-radius-md);
  border: 1px solid var(--yt-border);
  box-shadow: var(--yt-shadow-md);
}

.toast-container {
  z-index: 1090;
}

.list-group {
  --bs-list-group-border-radius: var(--yt-radius-md);
}

.list-group-item {
  border-color: var(--yt-border-subtle);
}

.list-group-flush:empty::after {
  content: "该栏目下暂无内容";
  display: block;
  padding: 2.75rem 0;
  color: var(--yt-muted);
  font-size: var(--yt-text-sm);
  text-align: center;
}

.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  margin-bottom: 12px;
  width: 60%;
}

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

/* -- 4.9 头像、认证卡片、编辑器与业务组件 ---------------------------------- */
.avatar {
  display: inline-block;
  position: relative;
  line-height: 1;
  border-radius: 50%;
  overflow: hidden;
}

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

.avatar b {
  font-weight: 600;
}

.awh-s { width: 28px; height: 28px; }
.awh-m { width: 40px; height: 40px; }
.awh-l { width: 56px; height: 56px; }

.auth-shell {
  max-width: 1040px;
}

.auth-card {
  border: 1px solid var(--yt-border);
  border-radius: var(--yt-radius-lg);
  box-shadow: var(--yt-shadow-md);
  overflow: hidden;
}

.auth-oauth-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-code img,
.fc-code img {
  max-width: 100%;
  height: auto;
  border-radius: var(--yt-radius-xs, 0.25rem);
}

.auth-card .help-block,
.auth-card label.error {
  display: block;
  margin-top: 0.35rem;
  color: #b02a37;
  font-size: 0.82rem;
}

.auth-aside {
  background-color: var(--bs-primary);
  background-image: var(--yt-nav-gradient);
  color: #fff;
  padding: 2rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.auth-iframe {
  width: 100%;
  height: min(600px, 70vh);
  border: 0;
  border-radius: 0 0 var(--yt-radius) var(--yt-radius);
}

.note-editor, .note-frame, .dr_ueditor, div.note-editor {
  border-radius: var(--yt-radius-sm);
  border-color: var(--yt-border) !important;
}

.vote-bar {
  border-radius: var(--yt-radius-xs);
  overflow: hidden;
  background: var(--yt-surface-sunken);
}

.tile-container {
  padding: 0.75rem;
  border: 1px solid var(--yt-border);
  border-radius: var(--yt-radius-sm);
  background: var(--yt-surface);
  transition: all var(--yt-dur) var(--yt-ease);
}

.tile-container:hover {
  border-color: var(--yt-border-hover);
  box-shadow: var(--yt-shadow-sm);
}

.reward-pill {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: var(--yt-radius-pill);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  border: 1px solid var(--bs-primary-border-subtle);
  font-size: 0.85rem;
}

/* -- 4.10 Bootstrap 原生组件品牌色映射 --------------------------------------
   Bootstrap 把部分组件颜色烘焙成 Sass 硬值（--bs-btn-bg 等），仅覆盖 --bs-primary
   无法触达，须在此显式重映射。升级 Bootstrap 后请逐条复核变量名是否仍然存在。
   注：勾选框选中态、下拉项选中态已分别在 4.7 / 4.5 处理，此处不重复。 */
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary-hover);
  --bs-btn-hover-border-color: var(--bs-primary-hover);
  --bs-btn-active-bg: var(--bs-primary-active);
  --bs-btn-active-border-color: var(--bs-primary-active);
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-active-bg: var(--bs-primary-active);
  --bs-btn-active-border-color: var(--bs-primary-active);
  --bs-btn-disabled-color: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--bs-primary);
  --bs-nav-pills-link-active-color: #fff;
}

.progress {
  --bs-progress-bar-bg: var(--bs-primary);
}

/* ==========================================================================
   Layer 5: Module-Specific Styles (业务与模块样式层)
   --------------------------------------------------------------------------
   门户首页组件、排行榜与阶梯序号、列表与搜索页、文章正文排版、单页与侧边栏。
   ========================================================================== */
/* -- 5.1 门户首页：焦点头条与文章列表 -------------------------------------- */
.portal-card {
  overflow: hidden;
}

.portal-card-header,
.portal-card > .card-header,
.category-card > .card-header,
.portal-sidebar-card > .card-header {
  border-bottom: 0 !important;
  padding: 0.85rem 1.25rem 0.5rem;
}

.portal-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: var(--bs-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-card-title .bi {
  color: var(--bs-primary);
}

.portal-title-mark {
  position: relative;
  padding-left: 0.75rem;
}

.portal-title-mark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--bs-primary);
}

.portal-card .card-body > a.text-purple:first-child {
  display: block;
  font-size: var(--yt-text-base);
  font-weight: 700;
  color: var(--yt-text) !important;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.25rem 0.5rem;
  margin: -0.25rem -0.5rem 0.4rem !important;
  border-radius: var(--yt-radius-xs, 0.25rem);
  transition: color var(--yt-dur) var(--yt-ease),
              background-color var(--yt-dur) var(--yt-ease);
}

.portal-card .card-body > a.text-purple:first-child:hover {
  color: var(--bs-primary) !important;
  background-color: var(--yt-surface-hover);
}

/* 首页焦点头条文章列表：方案B（文字保持正常原文字号，序号小巧袖珍精致） */
.portal-card .sidebar-link-list,
.focus-rank-list {
  counter-reset: portal-rank;
  display: grid;
  gap: 0.5rem;
}

.portal-card .sidebar-link-list .sidebar-link,
.focus-rank-list .sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.15rem 0.35rem 0.15rem 1.6rem;
  line-height: 1.45;
  border-radius: var(--yt-radius-xs, 0.25rem);
  text-decoration: none;
  color: var(--yt-text, #2b2733);
  transition: all var(--yt-dur) var(--yt-ease);
}

.portal-card .sidebar-link-list .sidebar-link::before,
.focus-rank-list .sidebar-link::before {
  content: counter(portal-rank);
  counter-increment: portal-rank;
  position: absolute;
  top: calc(50% - 0.55rem);
  left: 0.1rem;
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--yt-surface-3, #f0eef6);
  color: var(--yt-muted, #6b7280);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all var(--yt-dur) var(--yt-ease);
}

.portal-card .sidebar-link-list .sidebar-link:nth-child(1)::before,
.focus-rank-list .sidebar-link:nth-child(1)::before {
  background: rgba(var(--bs-primary-rgb), 0.16);
  color: var(--yt-primary-dark, #332467);
  font-weight: 700;
}

.portal-card .sidebar-link-list .sidebar-link:nth-child(2)::before,
.focus-rank-list .sidebar-link:nth-child(2)::before {
  background: rgba(var(--bs-primary-rgb), 0.10);
  color: var(--bs-primary);
}

.portal-card .sidebar-link-list .sidebar-link:nth-child(3)::before,
.focus-rank-list .sidebar-link:nth-child(3)::before {
  background: rgba(var(--bs-primary-rgb), 0.06);
  color: var(--bs-secondary);
}

.portal-card .sidebar-link-list .sidebar-link:hover,
.focus-rank-list .sidebar-link:hover {
  background: var(--yt-surface-2, #f8f7fb);
  color: var(--bs-primary) !important;
}

.portal-card .sidebar-link-list .sidebar-link:hover::before,
.focus-rank-list .sidebar-link:hover::before {
  background: var(--bs-primary);
  color: #ffffff;
}

.portal-card .list-group-item {
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: var(--yt-radius-xs);
  transition: background-color var(--yt-dur) var(--yt-ease);
}

.portal-card .list-group-item:hover {
  background-color: var(--yt-surface-hover);
}

.portal-card .list-group-item a {
  color: var(--yt-text);
  font-size: 0.95rem;
  transition: color var(--yt-dur) var(--yt-ease);
}

.portal-card .list-group-item:hover a {
  color: var(--bs-primary);
}

/* 首页与频道页轮播幻灯 */
.home-carousel {
  min-height: 280px;
  height: 100%;
  border-radius: var(--yt-radius-lg, 1rem);
  overflow: hidden;
  border: 1px solid var(--yt-border);
}

.home-carousel .carousel-inner,
.home-carousel .carousel-item {
  min-height: 280px;
  border-radius: inherit;
}

.home-carousel .carousel-item img,
.home-carousel-img {
  height: clamp(280px, 36vw, 420px);
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 鼠标滑过轮播区域时，图片在画框内轻微放大 1.04 倍，产生画框景深聚焦感 */
.home-carousel:hover .carousel-item.active img,
.home-carousel:hover .home-carousel-img {
  transform: scale(1.04);
}

.home-carousel .carousel-caption {
  right: 0;
  bottom: 0;
  left: 0;
  padding: 2.5rem 1.25rem 2.2rem;
  background: linear-gradient(180deg, transparent 0%, rgba(18, 16, 24, 0.45) 35%, rgba(18, 16, 24, 0.9) 100%);
  text-align: left;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

.home-carousel .carousel-caption a {
  color: #fff;
  text-decoration: none;
}

.home-carousel .carousel-caption h5 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.home-carousel .carousel-indicators {
  margin-bottom: 0.65rem;
  z-index: 5;
}

.home-carousel .carousel-indicators [data-bs-target] {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin: 0 3px;
  background-color: rgba(255, 255, 255, 0.45);
  border: 0;
  transition: all var(--yt-dur) var(--yt-ease);
}

.home-carousel .carousel-indicators .active {
  width: 20px;
  background-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* -- 5.2 全站排行榜与阶梯序号徽标（统一 1~3 紫色阶梯、4~10 柔灰底）-------- */
.portal-card .badge:not(.icoC),
.category-card .badge:not(.icoC),
.portal-sidebar-card .badge:not(.icoC),
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  line-height: 1;
  transition: all var(--yt-dur) var(--yt-ease);
}

.portal-card .list-group-item:nth-child(1) .badge:not(.icoC),
.category-card .list-group-item:nth-child(1) .badge:not(.icoC),
.portal-sidebar-card .list-group-item:nth-child(1) .badge:not(.icoC) {
  background-color: #5a3ea6 !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(90, 62, 166, 0.3);
}

.portal-card .list-group-item:nth-child(2) .badge:not(.icoC),
.category-card .list-group-item:nth-child(2) .badge:not(.icoC),
.portal-sidebar-card .list-group-item:nth-child(2) .badge:not(.icoC) {
  background-color: #7b5ec7 !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(123, 94, 199, 0.25);
}

.portal-card .list-group-item:nth-child(3) .badge:not(.icoC),
.category-card .list-group-item:nth-child(3) .badge:not(.icoC),
.portal-sidebar-card .list-group-item:nth-child(3) .badge:not(.icoC) {
  background-color: #9c84dc !important;
  color: #fff !important;
}

.portal-card .list-group-item:nth-child(n+4) .badge:not(.icoC),
.category-card .list-group-item:nth-child(n+4) .badge:not(.icoC),
.portal-sidebar-card .list-group-item:nth-child(n+4) .badge:not(.icoC) {
  background-color: #e9ecef !important;
  color: #6c757d !important;
}

.portal-card .list-group-item:hover .badge:not(.icoC),
.category-card .list-group-item:hover .badge:not(.icoC),
.portal-sidebar-card .list-group-item:hover .badge:not(.icoC) {
  transform: scale(1.08);
}

/* -- 5.3 首页图文速览（拆壳流式布局）与栏目块 ------------------------------ */
.quick-view-card {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.quick-view-card .card-body {
  padding: 0.5rem 0 0 !important;
}

.quick-view-card .card-title {
  font-size: 0.95rem;
  line-height: 1.35;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.quick-view-card .card-title a {
  color: var(--yt-text);
}

.quick-view-card:hover .card-title a {
  color: var(--bs-primary);
}

.quick-view-title,
.category-lead-title {
  min-width: 0;
  color: var(--yt-text, #252033);
  transition: color var(--yt-dur) var(--yt-ease);
}

.quick-view-title:hover,
.category-lead-title:hover {
  color: var(--bs-primary) !important;
}

.category-title-link {
  color: var(--bs-primary);
  display: inline-flex;
  align-items: center;
  transition: color var(--yt-dur) var(--yt-ease);
}

.category-title-link::before {
  content: "";
  display: inline-block;
  width: 0.24rem;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--bs-primary);
  margin-right: 0.5rem;
}

.category-card {
  position: relative;
  overflow: hidden;
}

.category-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bs-primary) 0%, #7b5ec7 60%, transparent 100%);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: left center;
  transition: opacity var(--yt-dur) var(--yt-ease),
              transform var(--yt-dur) var(--yt-ease-out);
}

.category-card:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.category-more-link {
  font-size: 0.85rem;
  color: var(--yt-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: color var(--yt-dur) var(--yt-ease);
}

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

.category-more-link .bi {
  font-size: 0.75rem;
  transition: transform var(--yt-dur) var(--yt-ease);
}

.category-more-link:hover .bi {
  transform: translateX(2px);
}

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

.category-link-list li {
  position: relative;
  padding: 0.45rem 0 0.45rem 0.85rem;
  border-bottom: 1px dashed var(--yt-border-subtle);
  font-size: 0.95rem;
  line-height: 1.5;
}

.category-link-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bs-primary);
  opacity: 0.5;
}

.category-link-list li:last-child {
  border-bottom: 0;
}

.category-link-list li a {
  color: var(--yt-text);
  transition: color var(--yt-dur) var(--yt-ease);
}

.category-link-list li a:hover {
  color: var(--bs-primary);
}

/* -- 5.4 列表页与搜索页（List & Search）------------------------------------ */
.portal-list-item {
  position: relative;
  padding: 0.85rem 0.5rem;
  border-bottom: 1px dashed var(--yt-border);
  transition: background-color var(--yt-dur) var(--yt-ease);
}

.portal-list-item:hover {
  background-color: var(--yt-surface-hover);
}

.portal-list-item a.ratio {
  position: relative;
  border: 1px solid var(--yt-border);
}

.portal-list-thumb {
  transition: transform var(--yt-dur-slow) var(--yt-ease-out);
}

.portal-list-item a.ratio:hover .portal-list-thumb {
  transform: scale(1.05);
}

.portal-list-item h5 {
  font-size: 1.15rem !important;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.35rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-list-item p {
  margin-top: 0.15rem;
  margin-bottom: 0.25rem !important;
  line-height: 1.45;
}

.portal-list-item .content-meta {
  margin-top: 0.1rem !important;
  font-size: 0.825rem;
}

.portal-list-item h5 a,
.portal-list-item .portal-title-link {
  font-size: 1.15rem !important;
  font-weight: 700;
  color: var(--yt-text, #25222c) !important;
  text-decoration: none;
  transition: color var(--yt-dur) var(--yt-ease);
}

.portal-list-item:hover h5 a,
.portal-list-item:hover .portal-title-link,
.portal-list-item .portal-title-link:hover {
  color: var(--bs-primary) !important;
}

.content-meta {
  font-size: 0.875rem;
  color: var(--yt-text-muted);
  gap: 1.25rem;
}

.content-meta span {
  display: inline-flex;
  align-items: center;
}

.content-meta .bi {
  color: var(--yt-text-muted);
  transition: color var(--yt-dur) var(--yt-ease);
}

.portal-list-item:hover .content-meta .bi {
  color: var(--bs-primary);
}

/* -- 5.5 文章详情页 Show & 单页 Page --------------------------------------- */
.article-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--yt-border-subtle);
}

.article-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--yt-text);
}

.yt-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--bs-primary);
  z-index: 1040;
  transition: width 0.1s ease;
}

.article-content,
.comment-content {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.8;
}

.article-content img,
.comment-content img {
  max-width: 100%;
  height: auto;
}

.article-content table,
.comment-content table {
  max-width: 100%;
}

.article-content iframe,
.article-content video,
.comment-content iframe,
.comment-content video {
  max-width: 100%;
}

.article-content pre,
.comment-content pre {
  white-space: pre-wrap;
  word-break: break-all;
}

.article-prose {
  font-size: 1.0625rem;
  line-height: var(--yt-leading-loose);
  color: #2b2f32;
  word-break: break-word;
}

.article-prose p {
  margin-bottom: 1.35rem;
}

.article-prose h2,
.article-prose h3,
.article-prose h4,
.article-prose h5,
.article-prose h6 {
  font-weight: 700;
  color: var(--yt-text);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  line-height: 1.35;
}

.article-prose h2 { font-size: 1.45rem; }
.article-prose h3 { font-size: 1.25rem; }
.article-prose h4 { font-size: 1.125rem; }
.article-prose h5 { font-size: 1rem; }
.article-prose h6 { font-size: 0.95rem; }

.article-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--yt-radius-sm);
  margin: 1rem 0;
}

.article-prose blockquote {
  position: relative;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem 1rem 3rem;
  border-left: 4px solid var(--bs-primary);
  background-color: var(--yt-surface-hover);
  border-radius: 0 var(--yt-radius-md) var(--yt-radius-md) 0;
  color: var(--yt-text-muted);
  font-style: normal;
}

.article-prose blockquote::before {
  content: "“";
  position: absolute;
  top: 0.25rem;
  left: 0.85rem;
  font-size: 2.5rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--bs-primary);
  opacity: 0.35;
}

.article-prose table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
}

.article-prose th,
.article-prose td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--yt-border);
}

.article-prose th {
  background-color: var(--yt-surface-sunken);
  font-weight: 600;
}

.article-prose tr:nth-child(even) td {
  background-color: var(--yt-surface-2);
}

.article-prose tbody tr:hover td {
  background-color: var(--yt-surface-hover);
}

.article-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: var(--yt-radius-pill);
  background-color: rgba(var(--bs-primary-rgb), 0.06) !important;
  color: var(--bs-primary) !important;
  font-size: 0.85rem;
  margin: 0.25rem;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.18) !important;
  text-decoration: none;
  transition: all var(--yt-dur) var(--yt-ease);
}

.article-tag:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.12) !important;
  border-color: rgba(var(--bs-primary-rgb), 0.32) !important;
  color: var(--bs-primary) !important;
  transform: translateY(-1px);
}

.article-meta {
  border-bottom: 1px solid var(--yt-border) !important;
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.article-nav-card,
.article-nav,
.article-nav:hover {
  position: relative;
  display: block;
  padding: 0.85rem 1rem;
  border-radius: var(--yt-radius-md);
  border: 1px solid var(--yt-border) !important;
  background-color: var(--yt-surface) !important;
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
  color: var(--yt-text);
}

.article-nav a {
  color: var(--bs-primary);
  transition: color var(--yt-dur) var(--yt-ease);
}

.article-nav a:hover {
  color: var(--bs-primary-hover, #4c338e);
  text-decoration: underline;
}

.prev-post span::before {
  content: "« ";
  font-weight: 700;
  margin-right: 2px;
  color: var(--bs-primary);
}

.next-post span::before {
  content: "» ";
  font-weight: 700;
  margin-right: 2px;
  color: var(--bs-primary);
}

.related-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--yt-text);
  font-size: 1.125rem;
}

.related-section-title::before {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 0.24rem;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--bs-primary);
}

.related-card {
  transition: all var(--yt-dur) var(--yt-ease);
}

.related-card:hover {
  transform: translateY(-2px);
}

.related-card img {
  border-radius: var(--yt-radius-sm);
  transition: transform var(--yt-dur-slow) var(--yt-ease-out);
}

.related-card:hover img {
  transform: scale(1.04);
}

.related-title,
.related-card .related-title {
  font-size: 0.92rem;
  line-height: 1.45;
  margin-top: 0.45rem;
  color: var(--yt-text);
  transition: color var(--yt-dur) var(--yt-ease);
}

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

.page-lead-title,
.card-body > h1.text-purple.text-center {
  position: relative;
  display: inline-block;
  font-weight: 700;
  color: var(--bs-primary);
  padding-bottom: 0.5rem;
}

.page-lead-title::after,
.card-body > h1.text-purple.text-center::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bs-primary), var(--yt-gold));
}

/* -- 5.6 侧边栏、论坛与题库 Exam 模块 -------------------------------------- */
.portal-sidebar-card {
  margin-bottom: 1.25rem;
}

.portal-sidebar-card .card-header {
  padding: 0.75rem 1rem;
}

.portal-sidebar-card .portal-card-title {
  color: var(--bs-primary);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.portal-sidebar-card .portal-card-title .bi {
  color: var(--bs-primary);
}

.sidebar-link-list {
  display: grid;
  gap: 0.58rem;
}

.sidebar-link {
  position: relative;
  display: block;
  padding: 0.08rem 0.35rem 0.08rem 0.85rem;
  color: var(--yt-text, #2f2c35) !important;
  line-height: 1.5;
  text-decoration: none;
  border-radius: var(--yt-radius-xs, 0.25rem);
  transition: color var(--yt-dur) var(--yt-ease), background-color var(--yt-dur) var(--yt-ease);
}

.sidebar-link::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0.08rem;
  width: 0.24rem;
  height: 0.24rem;
  border-radius: 50%;
  background: rgba(var(--bs-primary-rgb), 0.24);
}

.sidebar-link:hover {
  color: var(--bs-primary) !important;
  background-color: var(--yt-surface-hover);
}

.sidebar-link:hover::before {
  background: var(--bs-primary);
}

/* 统一侧边栏文章列表（精彩内容、艺术专题、热门文章）标题字号为 0.95rem（与首页双栏目一致） */
.portal-sidebar-card .sidebar-link,
.sidebar-rank-item a {
  font-size: 0.95rem;
  line-height: 1.5;
}
/* 侧边栏热门文章条目间距：与其它侧边栏 0.58rem 严格拉齐 */
.sidebar-rank-item {
  margin-bottom: 0.58rem !important;
}
.sidebar-rank-item:last-child {
  margin-bottom: 0 !important;
}
/* 侧边栏热门文章列表：标题文字与悬停 */
.sidebar-rank-item a {
  color: var(--yt-text, #2f2c35);
  transition: color var(--yt-dur) var(--yt-ease);
}

.sidebar-rank-item:hover a,
.sidebar-rank-item a:hover {
  color: var(--bs-primary) !important;
}

/* 侧边栏热门文章数字序号：与焦点头条方案B视觉完全一致（1.1rem袖珍方块、0.65rem字体、3px微圆角） */
.sidebar-rank-item .rank-badge {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 3px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--yt-surface-3, #f0eef6);
  color: var(--yt-muted, #6b7280);
  margin-right: 0.65rem !important;
  transition: all var(--yt-dur) var(--yt-ease);
}

.sidebar-rank-item:nth-child(1) .rank-badge {
  background-color: rgba(var(--bs-primary-rgb), 0.16) !important;
  color: var(--yt-primary-dark, #332467) !important;
  box-shadow: none !important;
}

.sidebar-rank-item:nth-child(2) .rank-badge {
  background-color: rgba(var(--bs-primary-rgb), 0.10) !important;
  color: var(--bs-primary) !important;
  box-shadow: none !important;
}

.sidebar-rank-item:nth-child(3) .rank-badge {
  background-color: rgba(var(--bs-primary-rgb), 0.06) !important;
  color: var(--bs-secondary) !important;
  box-shadow: none !important;
}

.sidebar-rank-item:hover .rank-badge {
  background-color: var(--bs-primary) !important;
  color: #ffffff !important;
}

.friendly-link {
  color: var(--yt-text-muted);
  background: var(--yt-surface);
  border: 1px solid var(--yt-border);
  font-weight: 500;
  border-radius: var(--yt-radius-xs);
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  transition: all var(--yt-dur) var(--yt-ease);
}

.friendly-link:hover {
  color: var(--bs-primary);
  border-color: var(--bs-primary-border-subtle);
  background: var(--bs-primary-bg-subtle);
}

/* -- 论坛与用户主页自定义 Tab 切换 -- */
.nav-tabs-custom {
  border-bottom: 0;
  gap: 1.5rem;
}

.nav-tabs-custom .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--yt-text-muted, #6c757d);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.2rem 0.65rem;
  background: transparent;
  transition: color var(--yt-dur) var(--yt-ease), border-color var(--yt-dur) var(--yt-ease);
}

.nav-tabs-custom .nav-link:hover:not(.active) {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary-border-subtle, #d6caee);
}

.nav-tabs-custom .nav-link.active {
  color: var(--yt-text, #212529);
  font-weight: 700;
  border-bottom: 3px solid var(--bs-primary);
  background: transparent;
}

/* -- 默认首字或首字母头像（严格锁定正圆，防椭圆拉伸） -- */
.avatar-fallback {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
}

.avatar-fallback-sm {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  font-size: 1rem;
}

/* -- 帖子详情操作按钮组（胶囊圆角与顶踩交互响应） -- */
.post-action-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.75rem;
}

.post-action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.post-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--yt-border);
  border-radius: 999px;
  color: var(--yt-text);
  background: var(--yt-surface, #fff);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.2;
  transition: all var(--yt-dur) var(--yt-ease);
}

.post-action-btn:hover,
.post-action-btn:focus {
  border-color: var(--yt-border-strong);
  color: var(--bs-primary);
  box-shadow: var(--yt-shadow-sm);
}

.post-action-btn.is-favorite {
  color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
}

.post-action-btn.is-up:hover {
  color: #198754;
  border-color: rgba(25, 135, 84, 0.3);
  background: rgba(25, 135, 84, 0.08);
}

.post-action-btn.is-down:hover {
  color: #dc3545;
  border-color: rgba(220, 53, 69, 0.3);
  background: rgba(220, 53, 69, 0.08);
}

.post-action-count {
  font-weight: 700;
  margin-left: 0.15rem;
}

/* -- 论坛帖子签名档与虚线间隔 -- */
.user-signature {
  max-height: 5.5rem;
  overflow: hidden;
  color: var(--yt-text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.user-signature:empty {
  display: none;
}

.user-signature::before {
  content: "";
  display: block;
  width: 4.25rem;
  margin-bottom: 0.35rem;
  border-top: 1px dashed rgba(107, 114, 128, 0.45);
}

[data-bs-theme="dark"] .user-signature::before {
  border-top-color: rgba(255, 255, 255, 0.2);
}

/* -- 论坛帖子列表与侧边栏体验优化 -- */
.list-group-item .badge:has(.bi-paperclip),
.list-group-item .badge:has(.bi-bar-chart-fill) {
  padding: 0.15rem 0.35rem !important;
  font-size: 0.7rem !important;
  border-radius: 3px !important;
  vertical-align: middle;
}

.stats-label {
  font-size: 0.75rem !important;
  color: var(--yt-muted, #6c757d);
}

.floor-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  color: var(--yt-muted, #6c757d);
  background: var(--yt-surface-3, #f1f2f6);
  font-size: 0.78rem;
}

.download-action {
  width: 36px;
  height: 36px;
  line-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wenda-title-input {
  font-size: 1.35rem;
  font-weight: 600;
  box-shadow: none !important;
}

/* -- 论坛投票选项精致细进度条（8px 高度与细腻圆角） -- */
.progress-thin {
  height: 8px !important;
  border-radius: 999px !important;
  background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
  overflow: hidden;
}

.progress-thin .progress-bar {
  border-radius: 999px !important;
  opacity: 0.85;
}

/* -- 论坛帖子详情页特殊分页（后端输出结构） -- */
.reply-page {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.reply-page a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--yt-text, #333);
  background-color: var(--yt-surface, #fff);
  border: 1px solid var(--yt-border, #dee2e6);
  border-radius: var(--yt-radius-sm, 0.375rem);
  text-decoration: none !important;
  transition: all var(--yt-dur) var(--yt-ease);
}

.reply-page a:hover {
  background-color: var(--bs-primary);
  color: #fff !important;
  border-color: var(--bs-primary);
  transform: translateY(-1px);
}

.reply-page a.ds-current {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
  border-color: var(--bs-primary) !important;
  font-weight: 700;
  cursor: default;
  transform: none;
}

.tag-cloud a,
.portal-tag-link {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  margin: 0.2rem 0.15rem;
  font-size: 0.825rem;
  border-radius: var(--yt-radius-xs);
  background: var(--yt-surface-sunken);
  color: var(--yt-text-muted);
  border: 1px solid var(--yt-border-subtle);
  transition: all var(--yt-dur) var(--yt-ease);
}

.tag-cloud a:hover,
.portal-tag-link:hover {
  background: var(--bs-primary-bg-subtle);
  border-color: var(--bs-primary-border-subtle);
  color: var(--bs-primary);
  transform: translateY(-1px);
}

.sidebar-media-title {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--yt-text);
  transition: color var(--yt-dur) var(--yt-ease);
}

.sidebar-media-title:hover {
  color: var(--bs-primary);
}

/* 考试模块与评论 */
.exam-comment-module {
  margin-top: 1.5rem;
  border-radius: var(--yt-radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.exam-comment-textarea {
  border-radius: var(--yt-radius-sm);
  border: 1px solid var(--yt-border);
  resize: vertical;
  transition: border-color var(--yt-dur) var(--yt-ease);
}

.exam-comment-textarea:focus {
  border-color: var(--bs-primary);
  box-shadow: var(--yt-focus-ring);
}

.comment-item-card {
  padding: 1rem;
  border-bottom: 1px solid var(--yt-border-subtle);
  transition: background-color var(--yt-dur) var(--yt-ease);
}

.comment-item-card:hover {
  background-color: var(--yt-surface-hover);
}

.sub-replies-wrap {
  border-left: 3px solid rgba(var(--bs-primary-rgb), 0.35);
}

.sub-replies-list {
  background: var(--yt-surface-sunken);
  border-radius: var(--yt-radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.sub-reply-item {
  padding: 0.35rem 0;
  font-size: 0.875rem;
  border-bottom: 1px dashed var(--yt-border-subtle);
}

.sub-reply-item:last-child {
  border-bottom: 0;
}

.comment-actions button {
  font-size: 0.825rem;
  transition: color 0.15s ease;
}

/* ==========================================================================
   Layer 6: Dark Mode Theming (暗黑模式集中覆盖与反转)
   --------------------------------------------------------------------------
   集中收拢所有 [data-bs-theme="dark"] 变量反转与特异性覆盖，禁止散落四处。
   ========================================================================== */
[data-bs-theme="dark"] {
  /* -- 6.1 暗色语义底色与表面反转 -------------------------------------------- */
  --yt-bg: #121018;
  --yt-surface: #1a1724;
  --yt-surface-2: #211e2e;
  --yt-surface-3: #2b273b;
  --yt-surface-hover: #262235;
  --yt-surface-active: #312c44;
  --yt-surface-sunken: #15131f;
  --yt-surface-elevated: #242033;
  --yt-surface-glass: rgba(26, 23, 36, 0.85);

  /* -- 6.2 暗色文字与描边 ---------------------------------------------------- */
  --yt-text: #e1dff0;
  --yt-text-muted: #9f9baa;
  --yt-text-subtle: #797585;
  --yt-muted: #9f9baa;
  --yt-border: rgba(255, 255, 255, 0.08);
  --yt-border-subtle: rgba(255, 255, 255, 0.04);
  --yt-border-strong: rgba(255, 255, 255, 0.18);
  --yt-border-hover: rgba(156, 132, 220, 0.35);

  /* -- 6.3 点缀金色在暗底提亮 ------------------------------------------------ */
  --yt-gold: #d4a84d;
  --yt-gold-soft: rgba(212, 168, 77, 0.12);
  --yt-gold-text: #e6be6a;
  --yt-gold-border: rgba(212, 168, 77, 0.28);

  /* -- 6.4 阴影反转与高光消除 ------------------------------------------------ */
  --yt-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --yt-shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --yt-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --yt-shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.55);
  --yt-shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* -- 6.5 Bootstrap 变量与自适应覆盖 --------------------------------------- */
  --bs-body-bg: #121018;
  --bs-body-color: #e1dff0;
  --bs-border-color: rgba(255, 255, 255, 0.08);
  --bs-tertiary-bg: #211e2e;
  --comment-bg: #1a1724;
  --comment-text: #e1dff0;
  --sidebar-soft: rgba(255, 255, 255, 0.03);

  /* -- 6.5.1 Bootstrap 暗色默认值为蓝，须改写为本主题紫 ---------------------- */
  --bs-primary-bg-subtle: rgba(143, 131, 184, 0.14);
  --bs-primary-border-subtle: rgba(143, 131, 184, 0.32);
  --bs-primary-text-emphasis: #b79ced;
}

/* -- 6.6 暗黑模式下的元素细节覆盖 ------------------------------------------ */
/* Bootstrap 的 .table-light 是固定浅色（--bs-table-bg 写死），须显式跟随主题 */
[data-bs-theme="dark"] .table-light {
  --bs-table-color: var(--yt-text);
  --bs-table-bg: var(--yt-surface-3);
  --bs-table-border-color: var(--yt-border);
  --bs-table-striped-bg: var(--yt-surface-2);
  --bs-table-striped-color: var(--yt-text);
  --bs-table-hover-bg: var(--yt-surface-hover);
  --bs-table-hover-color: var(--yt-text);
}

[data-bs-theme="dark"] .portal-card .card-body > a.text-purple:first-child {
  color: #e1dff0 !important;
}

[data-bs-theme="dark"] .portal-card .card-body > a.text-purple:first-child:hover {
  color: #b79ced !important;
  background-color: var(--yt-surface-hover);
}

[data-bs-theme="dark"] .portal-card .list-group-item:nth-child(n+4) .badge:not(.icoC),
[data-bs-theme="dark"] .category-card .list-group-item:nth-child(n+4) .badge:not(.icoC),
[data-bs-theme="dark"] .portal-sidebar-card .list-group-item:nth-child(n+4) .badge:not(.icoC) {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #9f9baa !important;
}

[data-bs-theme="dark"] .portal-card .sidebar-link-list .sidebar-link::before,
[data-bs-theme="dark"] .focus-rank-list .sidebar-link::before,
[data-bs-theme="dark"] .sidebar-rank-item .rank-badge {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--yt-muted) !important;
}

[data-bs-theme="dark"] .portal-card .sidebar-link-list .sidebar-link:nth-child(1)::before,
[data-bs-theme="dark"] .focus-rank-list .sidebar-link:nth-child(1)::before,
[data-bs-theme="dark"] .sidebar-rank-item:nth-child(1) .rank-badge {
  background-color: rgba(164, 142, 255, 0.28) !important;
  color: #ffffff !important;
  font-weight: 700;
}

[data-bs-theme="dark"] .portal-card .sidebar-link-list .sidebar-link:nth-child(2)::before,
[data-bs-theme="dark"] .focus-rank-list .sidebar-link:nth-child(2)::before,
[data-bs-theme="dark"] .sidebar-rank-item:nth-child(2) .rank-badge {
  background-color: rgba(164, 142, 255, 0.18) !important;
  color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .portal-card .sidebar-link-list .sidebar-link:nth-child(3)::before,
[data-bs-theme="dark"] .focus-rank-list .sidebar-link:nth-child(3)::before,
[data-bs-theme="dark"] .sidebar-rank-item:nth-child(3) .rank-badge {
  background-color: rgba(164, 142, 255, 0.10) !important;
  color: var(--bs-secondary) !important;
}

[data-bs-theme="dark"] .sidebar-rank-item:hover .rank-badge {
  background-color: var(--bs-primary) !important;
  color: #ffffff !important;
}

[data-bs-theme="dark"] iframe.auth-iframe {
  filter: invert(0.9) hue-rotate(180deg);
}

/* 暗黑模式下对原生 text-dark 元素的自动浅色反转（杜绝黑底黑字） */
[data-bs-theme="dark"] .text-dark {
  color: var(--yt-text, #e1dff0) !important;
}

/* 文章详情页正文富文本在暗黑模式下的可读性兜底保护 */
[data-bs-theme="dark"] .article-content,
[data-bs-theme="dark"] .article-content p,
[data-bs-theme="dark"] .article-content span,
[data-bs-theme="dark"] .article-content li {
  color: var(--yt-text, #e1dff0) !important;
}
[data-bs-theme="dark"] .article-content a {
  color: var(--bs-link-color) !important;
}
[data-bs-theme="dark"] .article-content h1,
[data-bs-theme="dark"] .article-content h2,
[data-bs-theme="dark"] .article-content h3,
[data-bs-theme="dark"] .article-content h4,
[data-bs-theme="dark"] .article-content h5,
[data-bs-theme="dark"] .article-content h6 {
  color: #ffffff !important;
}

[data-bs-theme="dark"] .article-prose {
  color: #c9c6d8;
}

[data-bs-theme="dark"] .article-prose img {
  filter: brightness(0.92);
}

[data-bs-theme="dark"] .article-prose blockquote {
  background-color: rgba(90, 62, 166, 0.12);
  color: #b0acca;
}

[data-bs-theme="dark"] .article-prose th {
  background-color: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .article-prose tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.02);
}

[data-bs-theme="dark"] .article-prose tbody tr:hover td {
  background-color: rgba(90, 62, 166, 0.15);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1a1724;
  border-color: rgba(255, 255, 255, 0.14);
  color: #e1dff0;
}

[data-bs-theme="dark"] .auth-card .form-control,
[data-bs-theme="dark"] .auth-card .form-select {
  background-color: #1a1724;
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

[data-bs-theme="dark"] .xr-comment-text,
[data-bs-theme="dark"] .xr-comment-text * {
  color: #c9c6d8 !important;
}

[data-bs-theme="dark"] .xr-textarea,
[data-bs-theme="dark"] .xr-toolbar-author-input {
  background-color: #1a1724 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #e1dff0 !important;
}

[data-bs-theme="dark"] .exam-comment-module .bg-white,
[data-bs-theme="dark"] .comment-item-card {
  background-color: var(--yt-surface) !important;
}

[data-bs-theme="dark"] .sub-replies-list {
  background-color: var(--yt-surface-sunken) !important;
}

[data-bs-theme="dark"] .exam-comment-textarea {
  background-color: #1a1724;
  border-color: rgba(255, 255, 255, 0.15);
  color: #e1dff0;
}

[data-bs-theme="dark"] .sidebar-link {
  color: #c9c6d8 !important;
}

[data-bs-theme="dark"] .sidebar-link:hover {
  color: #b79ced !important;
  background-color: var(--yt-surface-hover);
}

[data-bs-theme="dark"] .friendly-link {
  background-color: var(--yt-surface-2);
  color: #c9c6d8;
  border-color: var(--yt-border);
}

[data-bs-theme="dark"] .friendly-link:hover {
  color: #b79ced;
  background-color: var(--yt-surface-hover);
}

[data-bs-theme="dark"] .nav-tabs-custom .nav-link.active {
  color: #fff;
  border-bottom-color: var(--bs-primary);
}

[data-bs-theme="dark"] .post-action-btn {
  background-color: var(--yt-surface-2);
  color: var(--yt-text);
  border-color: var(--yt-border);
}

[data-bs-theme="dark"] .post-action-btn:hover {
  border-color: var(--yt-border-strong);
  background-color: var(--yt-surface-hover);
}

[data-bs-theme="dark"] .reply-page a {
  background-color: var(--yt-surface-2);
  border-color: var(--yt-border);
  color: var(--yt-text);
}

[data-bs-theme="dark"] .reply-page a:hover,
[data-bs-theme="dark"] .reply-page a.ds-current {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
  border-color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .dr-form-loading {
  background: rgba(18, 16, 24, 0.85);
}

/* ==========================================================================
   Layer 7: Responsive & Mobile Adapters (响应式与移动端适配)
   --------------------------------------------------------------------------
   集中收拢移动端超小屏收口、抽屉自适应与触摸设备交互优化。
   ========================================================================== */
/* -- 7.1 平板与移动端通用断点 (< 992px) ------------------------------------ */
@media (max-width: 991.98px) {
  .offcanvas.bg-purple {
    background-color: #3b2575 !important;
  }
  .navbar-nav .dropdown-menu {
    border: none;
    box-shadow: none;
    padding-left: 1rem;
    background: transparent;
  }
  .navbar-nav .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.4rem 0.5rem;
  }
  .navbar-nav .dropdown-item:hover,
  .navbar-nav .dropdown-item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }
  .site-search .input-group {
    max-width: 100%;
  }
  .menu-arrow::after {
    content: none;
  }
}

/* -- 7.2 手机超小屏专项收口 (< 576px) -------------------------------------- */
@media (max-width: 575.98px) {
  .portal-list-item h5 {
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.35;
    font-size: 0.95rem;
  }

  .portal-list-item .content-meta {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
    font-size: 0.75rem !important;
  }

  .article-content {
    font-size: 1rem !important;
  }

  .article-prose {
    line-height: 1.8;
  }

  .article-prose img {
    max-width: 100% !important;
    height: auto !important;
  }

  .article-title {
    font-size: 1.35rem;
  }

  .back-to-top {
    right: 0.75rem;
    bottom: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* -- 7.3 触摸设备：消除 hover 状态粘连残留 (@media (hover: none)) ---------- */
@media (hover: none) {
  .portal-list-item:hover {
    background-color: transparent;
  }
  .portal-list-item a.ratio:hover .portal-list-thumb {
    transform: none;
  }
  .category-card:hover::after {
    opacity: 0;
  }
  .hover-lift:hover,
  .card.hover-lift:hover {
    transform: none;
  }
  .friendly-link:hover {
    transform: none;
  }
  .back-to-top:hover {
    transform: none;
  }
}

/* ==========================================================================
   Layer 8: Accessibility & Utilities (无障碍、打印与实用类)
   --------------------------------------------------------------------------
   动效减弱模式支持、打印样式以及通用截断工具类。
   ========================================================================== */
/* -- 8.1 尊重系统无障碍减弱动态效果 --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -- 8.2 打印样式 (@media print) ------------------------------------------- */
@media print {
  .navbar,
  .footer,
  .back-to-top,
  .portal-sidebar,
  .site-search,
  #bd-theme {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
}

/* -- 8.3 通用辅助类 -------------------------------------------------------- */
.text-purple {
  color: var(--bs-primary) !important;
}

.text-hover-purple:hover {
  color: var(--bs-primary) !important;
}

/* 列表项 / 卡片悬停底色（主题感知）；hover-bg-light 为历史别名 */
.hover-bg:hover,
.hover-bg-light:hover {
  background-color: var(--bs-tertiary-bg);
}

.border-purple {
  border-color: var(--bs-primary) !important;
}

.text-gold {
  color: var(--yt-gold) !important;
}

.text-accent {
  color: var(--yt-gold) !important;
}

.bg-accent-subtle {
  background-color: var(--yt-gold-soft) !important;
}

.border-accent-subtle {
  border-color: var(--yt-gold-border) !important;
}

.last-border-0:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   页面级样式（原为模板内联块，2026-10-16 迁入）
   --------------------------------------------------------------------------
   .user-card 的边框色改用主题紫 —— 内联块里写死的 #6f42c1 是 Bootstrap 默认紫，
   与全站 #5a3ea6 不一致；.btn-purple / .text-purple 的两处覆盖已删除，改由本文件定义。
   ========================================================================== */
.exam-sidebar-hot-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-sidebar-hot-title {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.35;
}

.exam-sidebar-hot-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
}

.exam-sidebar-hot-actions .btn {
  padding: 2px 7px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.user-card {
  transition: all var(--yt-dur) var(--yt-ease);
}

.user-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  border-color: var(--bs-primary) !important;
}

/* 列表缩略图与用户头像占位：原为模板行内尺寸，2026-10-17 收进此处 */
.category-thumb {
  width: 124px;
  height: 90px;
}

.bd-placeholder-img {
  width: 60px;
  height: 60px;
}

/* 由模板行内样式回收而来，2026-10-17。保留 !important 以复刻行内声明的层叠地位。 */
.yt-tnum { font-variant-numeric: tabular-nums !important; }
.yt-toast-layer { z-index: 9999 !important; }
.yt-cover { object-fit: cover !important; }
.yt-opt-thumb { max-height: 28px !important; margin-top: 4px !important; }
.yt-icon-dim { opacity: .7 !important; }
.yt-avatar-50 { width: 50px !important; height: 50px !important; }
.yt-th-170 { width: 170px !important; }
.yt-th-pad { padding-left: 15px !important; }

/* 同上，2026-10-17 第二批 */
.yt-fs-15 { font-size: 15px !important; }
.yt-fs-xs { font-size: .75rem !important; }
.yt-side-link { max-width: 85% !important; font-size: .95rem !important; }

/* 同上，2026-10-17 第三批 */
.yt-msg-icon { font-size: 3.5rem !important; }
.yt-code-input { text-transform: uppercase !important; letter-spacing: 1px !important; font-family: monospace !important; }
