@charset "UTF-8";
.cm-navbar {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.cm-navbar .navbar-nav .nav-link {
  font-size: 18px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  padding-left: 16px;
  padding-right: 16px;
  color: var(--bs-body-color, #212529);
  transition: color 0.15s ease-in-out;
}
.cm-navbar .navbar-nav .nav-link.active {
  color: var(--bs-primary, #0d6efd);
}

.navbar-nav-scroll {
  max-width: 100%;
  height: 2.5rem;
  /*margin-top: .25rem;*/
  overflow: hidden;
}

.navbar-nav-scroll .navbar-nav {
  /*padding-bottom: 2rem;*/
  overflow-x: auto;
  white-space: nowrap;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  -webkit-overflow-scrolling: touch;
}

.cm-hidden {
  display: none !important;
}

.cm-pointer {
  cursor: pointer;
}

.cm-ff-yh {
  font-family: "Microsoft YaHei", 微软雅黑, "MicrosoftJhengHei", serif;
}

.cm-block-head-bottom {
  border-bottom: solid 2px;
  border-color: var(--bs-primary, #0d6efd);
  display: inline-block;
  padding-bottom: 0.3rem;
}

.cm-trans-bottom {
  width: 100%;
  bottom: 0;
  position: absolute;
  background-color: rgba(var(--bs-dark-rgb, 0, 0, 0), 0.5);
}

.cm-media-img, .cm-d-flex-img {
  max-width: 180px;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--bs-border-radius);
}

@media screen and (max-width: 767.98px) {
  .cm-media-img, .cm-d-flex-img {
    max-width: 120px;
    max-height: 80px;
  }
}
.cm-video-card {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--bs-border-radius);
  padding: 6px;
  background-color: var(--bs-body-bg, #fff);
}

.cm-video-card .card-img-top {
  border-radius: calc(var(--bs-border-radius) - 4px);
}

.cm-link {
  color: var(--bs-body-color, #212529);
  text-decoration: none;
}
.cm-link:hover {
  color: var(--bs-primary, #0d6efd);
}

a,
a:hover,
a:focus {
  text-decoration: none;
}

.btn-link,
.btn-link:hover,
.btn-link:focus {
  text-decoration: none;
}

.es-highlight em {
  color: var(--bs-danger, #dc3545);
  font-style: normal;
  font-weight: bold;
}

/* ====== 搜索框 ====== */
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-box .search-icon {
  position: absolute;
  left: 12px;
  color: #999;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}
.search-box .search-input {
  width: 200px;
  padding: 8px 16px 8px 36px;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  outline: none;
  font-size: 0.9rem;
  background: #f5f5f5;
  transition: border-color 0.3s, background 0.3s, width 0.3s;
}
.search-box .search-input:focus {
  border-color: var(--bs-primary, #0d6efd);
  background: #fff;
  width: 260px;
}
/* 暗黑模式 */
body.dark .search-box .search-input {
  background: #3a3b3c;
  color: #e4e6eb;
  border-color: #555;
}
body.dark .search-box .search-input:focus {
  border-color: var(--bs-primary, #0d6efd);
  background: #4a4b4c;
}
body.dark .search-box .search-icon {
  color: #777;
}

/* ====== B站风格视频卡片网格 ====== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1200px) {
  .video-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
}
.video-card {
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background: #fff;
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.video-card a { color: inherit; text-decoration: none; }
.video-cover {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #f0f0f0;
  overflow: hidden;
}
.video-cover img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.video-cover-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8e8e8, #f5f5f5);
}
.video-duration {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,.65);
  color: #fff;
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.5;
}
.video-info {
  padding: 10px 12px 12px;
}
.video-title {
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #222;
  min-height: 2.6em;
  transition: color 0.2s;
}
.video-card:hover .video-title { color: var(--bs-primary, #0d6efd); }
.video-meta {
  font-size: .78rem;
  color: #999;
  margin-top: 6px;
  display: flex; align-items: center;
}
/* 暗黑模式 */
body.dark .video-card { background: #242526; }
body.dark .video-cover { background: #3a3b3c; }
body.dark .video-cover-placeholder { background: linear-gradient(135deg, #2a2b2c, #3a3b3c); }
body.dark .video-title { color: #e4e6eb; }
body.dark .video-card:hover .video-title { color: var(--bs-primary, #0d6efd); }

/* 手机端搜索框全宽 */
@media (max-width: 1199px) {
  .search-box { width:100%; display:flex; }
  .search-box .search-input { width:100% !important; }
}
