﻿/* 导航栏布局调整 - 左侧菜单靠左，右侧搜索登录靠右 */
@media (min-width: 992px) {
  #nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 36px !important;
  }

  #nav #menus {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    margin-left: 30px !important;
  }

  #nav #menus .menus-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  #nav #menus .menus-left {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    justify-content: flex-start !important;
  }

  #nav #menus .menus-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
  }

  /* 导航菜单字体大小调整 */
  #nav #menus .menus_items .site-page {
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    margin: 0 15px !important;
  }

  /* 搜索按钮样式 */
  #nav #menus #search-button {
    margin-left: 20px !important;
    margin-right: 20px !important;
  }

  #nav #menus #search-button .site-page {
    font-size: 1rem !important;
  }

  /* 登录按钮样式 */
  #nav #menus .menus_items .site-page[href*="dashboard"] {
    background: #3b82f6 !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
  }

  #nav #menus .menus_items .site-page[href*="dashboard"]:hover {
    background: #2563eb !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
  }
}

/* Sidebar webinfo alignment fix */
#aside-content .card-webinfo .webinfo {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#aside-content .card-webinfo .webinfo-item {
  width: 100% !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#aside-content .card-webinfo .item-name {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: nowrap;
}

#aside-content .card-webinfo .item-count {
  min-width: 4.6rem;
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Hot tags visual polish */
#aside-content .card-tag-cloud a {
  display: inline-flex;
  align-items: center;
  margin: 0.22rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.3;
  background: #eef2ff;
  color: #334155;
  border: 1px solid #dbe4ff;
}

/* Home modules */
.home-showcase {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  gap: 0.9rem;
  margin-bottom: 0.95rem;
  align-items: stretch;
}

.home-showcase .home-hero-carousel {
  margin-bottom: 0;
  height: 100%;
}

.home-showcase-right {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.9rem;
  height: 100%;
}

/* 轮播图高度调整 - 使用固定高度确保左右对齐 */
.home-hero-carousel {
  height: 100%;
  min-height: 280px;
}

.home-hero-carousel .hero-track {
  height: 100%;
  min-height: 280px;
}

/* 公告和特点推荐高度 - 与轮播图对齐 */
.home-showcase-right .home-card {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.home-card {
  background: #f5f5f5;
  border-radius: 12px;
  border: 1px solid #e6ebf5;
  box-shadow: var(--card-box-shadow);
  padding: 0.88rem 0.92rem 0.82rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-card-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--font-color);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.home-card-title::before {
  content: '';
  width: 4px;
  height: 1rem;
  border-radius: 20px;
  background: #4f46e5;
}

.notice-list {
  margin: 0;
  padding-left: 0.95rem;
}

.notice-list li {
  margin-bottom: 0.38rem;
  line-height: 1.4;
}

.notice-list a {
  color: var(--font-color);
}

.notice-list a:hover {
  color: #4f46e5;
}

.featured-mini {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  margin-top: 0.05rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.featured-mini-thumb {
  flex: 1 1 auto;
  min-height: 98px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.featured-mini-thumb.no-cover {
  background-image: linear-gradient(135deg, #e9edf5 0%, #f5f7fb 100%);
}

.featured-mini-title {
  margin: 0;
  padding: 0.55rem 0.1rem 0;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
}

/* Carousel */
.home-hero-carousel {
  position: relative;
  width: 100%;
  min-height: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  background: #f5f5f5;
}

.home-hero-carousel .hero-track {
  position: relative;
  min-height: 200px;
}

.home-hero-carousel .hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.home-hero-carousel .hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.home-hero-carousel .hero-slide.no-cover {
  background-image: linear-gradient(135deg, #e9edf5 0%, #f5f7fb 100%);
}

.home-hero-carousel .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(245, 245, 245, 0.08) 0%, rgba(245, 245, 245, 0.68) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.2rem 1.35rem;
}

.home-hero-carousel .hero-content {
  color: #333;
  max-width: 90%;
}

.home-hero-carousel .hero-tag {
  display: inline-block;
  margin-bottom: 0.55rem;
  padding: 0.22rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(2px);
}

.home-hero-carousel .hero-title {
  margin: 0;
  color: #333;
  font-size: 1.72rem;
  line-height: 1.3;
}

.home-hero-carousel .hero-desc {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: #444;
  opacity: 1;
}

.home-hero-carousel .hero-controls {
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  z-index: 2;
  display: flex;
  gap: 0.4rem;
}

.home-hero-carousel .hero-dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
}

.home-hero-carousel .hero-dot.is-active {
  background: #333;
}

@media (max-width: 991px) {
  .home-showcase {
    grid-template-columns: 1fr;
  }

  .home-showcase-right {
    grid-template-rows: unset;
    grid-template-columns: 1fr;
    height: auto;
  }
}

@media (max-width: 768px) {
  .home-hero-carousel,
  .home-hero-carousel .hero-track {
    min-height: 150px;
  }

  .home-hero-carousel .hero-title {
    font-size: 1.24rem;
  }

  .home-hero-carousel .hero-content {
    max-width: 100%;
  }
}

/* 轮播图背景改为浅色 */
.carousel-item {
  background: #f5f5f5 !important;
  color: #333 !important;
}

/* 特别文章卡片背景改为浅色 */
#aside-content .sticky_layout .card-widget:nth-child(2) {
  background: #f5f5f5 !important;
  color: #333 !important;
}

/* 轮播图文字颜色适配浅色背景 */
.carousel-item .carousel-info h2,
.carousel-item .carousel-info p {
  color: #333 !important;
}
.home-showcase-right .home-card:nth-child(2),
.home-showcase-right .home-card:nth-child(2) .featured-mini {
  background: #f5f5f5 !important;
  color: #333 !important;
}