html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

body {
  margin: 0;
  padding: 0;
  background-image: url('/images/bc.png') !important;
  background-size: cover !important;
  background-position: center !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  min-height: 100vh;
}

/* 导航栏置顶悬浮 */
header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* 主站标题（隶书、黑色，仅首页显示，随页面滚动自然消失） */
.site-masthead {
  text-align: center;
  padding: 18px 16px 14px;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

/* 非首页默认收起，仅首页显示 */
body:not(.is-home) .site-masthead {
  display: none;
}

.home-shell {
  overflow: hidden;
}

.home-body {
  padding: 28px 30px 34px;
}

@media (max-width: 767.98px) {
  .home-body {
    padding: 20px 16px 26px;
  }
}

.site-brand {
  font-family: "LiSu", "STLiti", "隶书", "SimLi", serif;
  font-size: 2rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

/* 中文阅读字体与行距 */
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑",
    "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: #333;
}

/* 保证页面总比屏幕高出一段（下方留空白），滚动隐藏必然可触发 */
main[role="main"] {
  min-height: calc(100vh + 160px);
}

.navbar-nav .nav-link.active {
  color: #0d6efd;
  font-weight: 600;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  text-decoration: none;
  box-shadow: none;
  outline: none;
}

/* 板块页头 */
.subsite-header {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  padding: 22px 26px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
  margin-bottom: 28px;
}

.subsite-breadcrumb {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 10px;
}

.subsite-breadcrumb a {
  color: #555;
  text-decoration: none;
}

.subsite-breadcrumb a:hover {
  color: #0d6efd;
}

.subsite-breadcrumb .sep {
  margin: 0 6px;
  color: #999;
}

.subsite-breadcrumb .current {
  color: #222;
  font-weight: 600;
}

.subsite-title {
  font-weight: 700;
  margin: 0;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

.subsite-desc {
  margin: 8px 0 0;
  color: #444;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 博客：面向对象2026 */
.blog-hero {
  text-align: left;
  margin: 12px 0 30px;
}

.blog-main-title {
  font-family: "KaiTi", "楷体", "STKaiti", "Kaiti SC", serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #000;
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.blog-subtitle {
  color: #555;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  margin: 0;
}

.unit-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.unit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
}

.unit-title {
  font-weight: 700;
  font-size: 1.15rem;
}

/* 单文章单元：整卡直接进入文章页 */
.unit-card-link {
  display: flex;
  text-decoration: none;
}

.unit-card-link:hover {
  border-color: rgba(13, 110, 253, 0.45);
}

.unit-single-post {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  margin: 0;
  padding: 18px 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  border-radius: 8px;
}

.unit-card-link:hover .unit-single-post {
  color: #0d6efd;
}

.unit-post-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.unit-post-list li {
  border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

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

.unit-post-list a {
  display: block;
  padding: 8px 6px;
  font-size: 0.88rem;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
}

.unit-post-list a:hover {
  color: #0d6efd;
  background-color: rgba(255, 255, 255, 0.25);
}

.unit-empty {
  font-size: 0.85rem;
  color: #999;
  margin: 0 0 14px;
}

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

.post-list li {
  border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

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

.post-list a {
  display: block;
  padding: 14px 10px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
}

.post-list a:hover {
  color: #0d6efd;
  background-color: rgba(255, 255, 255, 0.25);
}

/* 文章页排版 */
.post-article {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 2.2rem;
}

.post-header {
  margin-bottom: 1.6rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.post-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
}

.post-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #777;
}

@media (max-width: 767.98px) {
  .post-article {
    padding: 1.4rem 1.2rem;
  }

  .post-title {
    font-size: 1.55rem;
  }
}

/* Markdown 正文排版 */
.markdown-body {
  line-height: 1.85;
  color: #333;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.markdown-body > *:first-child {
  margin-top: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: #1f2937;
  font-weight: 700;
  margin: 1.8em 0 0.7em;
  line-height: 1.4;
}

.markdown-body h1 {
  font-size: 1.7rem;
}

.markdown-body h2 {
  font-size: 1.4rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.markdown-body h3 {
  font-size: 1.2rem;
}

.markdown-body h4 {
  font-size: 1.08rem;
}

.markdown-body p {
  margin: 0.95em 0;
}

.markdown-body a {
  color: #2563eb;
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.6em;
  margin: 0.9em 0;
}

.markdown-body li {
  margin: 0.35em 0;
}

.markdown-body li > ul,
.markdown-body li > ol {
  margin: 0.3em 0;
}

.markdown-body code {
  background-color: rgba(13, 110, 253, 0.08);
  color: #1d4ed8;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
}

.markdown-body pre {
  background-color: #282a36;
  color: #f8f8f2;
  padding: 18px 20px;
  border-radius: 12px;
  overflow: auto;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.markdown-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.9em;
}

.markdown-body blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(13, 110, 253, 0.02));
  border-left: 4px solid #2563eb;
  border-radius: 0 10px 10px 0;
  color: #444;
}

.markdown-body blockquote p {
  margin: 0.4em 0;
}

.markdown-body table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 1.2em 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.95em;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 9px 12px;
  text-align: left;
}

.markdown-body thead th {
  background-color: rgba(13, 110, 253, 0.08);
  font-weight: 700;
  color: #1f2937;
}

.markdown-body tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.35);
}

.markdown-body tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2em auto;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.markdown-body hr {
  border: none;
  height: 1px;
  margin: 2em 0;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.15), transparent);
}

/* ===== 首页布局 ===== */
.hero-title {
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(255, 255, 255, 0.9);
}

.hero-subtitle {
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.divider {
  border-color: rgba(0, 0, 0, 0.15);
}

.section-title {
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

/* 通用毛玻璃面板 */
.glass-panel {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.glass-header {
  background-color: rgba(255, 255, 255, 0.18);
  font-weight: bold;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 站点简介卡片 */
.intro-tile {
  height: 100%;
  padding: 18px;
  background-color: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
}

/* 整块可点击的入口卡片 */
.intro-tile-link {
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.intro-tile-link:hover {
  transform: translateY(-3px);
  border-color: rgba(13, 110, 253, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.intro-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.intro-name {
  font-weight: bold;
  margin-top: 10px;
}

.intro-desc {
  font-size: 0.85rem;
  color: #444;
  margin-bottom: 0;
}

.news-list {
  font-size: 0.9rem;
  padding-left: 20px;
  margin-bottom: 0;
}

/* 右下角悬浮媒体：无边框、无文字说明 */
.media-float {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1020;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.media-float-video,
.media-float-img {
  position: relative;
  width: fit-content;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28));
  transition: transform 0.25s ease, filter 0.25s ease;
}

/* 悬浮效果：鼠标悬停时轻轻抬起并加深阴影 */
.media-float-video:hover,
.media-float-img:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.38));
}

.media-float-video:active,
.media-float-img:active {
  cursor: grabbing;
}

/* 拖拽中：去掉过渡，保持跟手，并置顶显示 */
.media-float-video.dragging,
.media-float-img.dragging {
  transition: none;
  z-index: 1100;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.45));
}

/* 视频与图片统一高度（当前尺寸的 4/5，约 102px） */
.media-float-video video,
.media-float-img img {
  display: block;
  height: 102px;
  width: auto;
  max-width: 60vw;
  object-fit: contain;
}

.media-float-video video {
  border-radius: 8px;
  background-color: #000;
}

.media-float-img img {
  border-radius: 8px;
}

/* 视频作者标注：小号、低调 */
.media-credit {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.sound-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

/* 声音按钮默认隐藏，鼠标停留在视频上时才显示 */
.media-float-video:hover .sound-toggle,
.media-float-video:focus-within .sound-toggle {
  opacity: 1;
  visibility: visible;
}

.sound-toggle:hover {
  background-color: rgba(0, 0, 0, 0.75);
  transform: scale(1.08);
}

.sound-hint {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 6;
}

/* 入场动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-in {
  animation: fadeInUp 0.7s ease both;
}

.animate-in-delay-1 {
  animation-delay: 0.15s;
}

.animate-in-delay-2 {
  animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .animate-in,
  .animate-in-delay-1,
  .animate-in-delay-2 {
    animation: none;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
