/* ============================================
   1. 卡片样式
   ============================================ */

.archive-header {
  margin-bottom: 30px;
  text-align: center;
}

.archive-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--red-2);
  margin-bottom: 10px;
}

.archive-count {
  font-size: 14px;
  color: var(--grey-7);
}

/* 网格容器 */
.reimu-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
  padding: 0 10px;
}

/* 单个卡片 */
.reimu-grid-item {
  background: var(--color-wrap);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.reimu-grid-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(255, 82, 82, 0.2);
}

.reimu-grid-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 封面图 - 固定180px高度 */
.reimu-grid-cover {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--red-6) 0%, var(--red-5) 100%);
}

.reimu-grid-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.reimu-grid-item:hover .reimu-grid-cover img {
  transform: scale(1.1);
}

/* 文字信息 */
.reimu-grid-info {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reimu-grid-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--red-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.reimu-grid-desc {
  font-size: 13px;
  color: var(--grey-7);
  margin: 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 响应式 */
@media (max-width: 768px) {
  .reimu-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
  
  .reimu-grid-cover {
    height: 140px;
  }
}

/* ============================================
   2. 用你的iconfont覆盖主题图标
   ============================================ */

/* 顶部导航按钮 - 全部用iconfont */
#main-nav-toggle:before,
#nav-rss-link:before,
#nav-search-btn:before,
#nav-sun-btn:before,
#nav-moon-btn:before {
  font-family: "iconfont" !important;
}

/* 菜单按钮（手机） */
#main-nav-toggle:before {
  content: "\e602" !important;  /* 列表 */
}

/* RSS按钮 */
#nav-rss-link:before {
  content: "\e603" !important;  /* RSS */
}

/* 搜索按钮 */
#nav-search-btn:before {
  content: "\e604" !important;  /* 搜索 */
}

/* 太阳（亮色模式） */
#nav-sun-btn:before {
  content: "\e601" !important;  /* 烈日 */
  font-weight: normal !important;
}

/* 月亮（暗色模式） */
#nav-moon-btn:before {
  content: "\e8a2" !important;  /* 月亮 */
  font-weight: normal !important;
}

/* 隐藏半圆按钮（自动模式） */
#nav-circle-half-stroke-btn {
  display: none !important;
}

/* 社交图标 - 用你的iconfont */
.icon-email:before {
  content: "\e856" !important;  /* email-fill */
}

.icon-github:before {
  content: "\e607" !important;  /* githublogo */
}

.icon-youtube:before {
  content: "\e84b" !important;  /* youtube */
}

.icon-bilibili:before {
  content: "\e606" !important;  /* bilibili */
}

/* 统一所有社交图标大小 */
.sidebar-social-icon a, 
.my-friend-info-box ul li a i.iconfont {
    width: 32px !important;
    height: 32px !important;
    font-size: 22px !important; /* 图标本体大小 */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    transition: all 0.3s;
}

/* 页面中间列表的图标间距调整 */
.my-friend-info-box ul li a {
    text-decoration: none !important;
    margin-right: 5px;
}

/* ============================================
   3. 隐藏侧边栏的TOC
   ============================================ */

.sidebar-toc-sidebar {
  display: none !important;
}

.sidebar-toc-btn {
  display: none !important;
}

.sidebar-common-btn {
  display: none !important;
}

.sidebar-common-sidebar {
  display: block !important;
}

.sidebar-common-sidebar.hidden {
  display: block !important;
}

/* ============================================
   4. 右侧浮动TOC - 标签式
   ============================================ */

.toc-float-container {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* TOC标签按钮 */
.toc-toggle-btn {
  position: relative;
  width: 60px;
  height: 40px;
  background: var(--red-1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.toc-toggle-btn:hover {
  background: var(--red-0);
  width: 70px;
}

/* TOC内容区 */
.toc-float-content {
  position: fixed;
  top: 50%;
  right: -350px;
  transform: translateY(-50%);
  width: 300px;
  max-height: 70vh;
  background: var(--color-wrap);
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  overflow-y: auto;
  padding: 20px;
  transition: right 0.3s ease;
}

.toc-float-container.expanded .toc-float-content {
  right: 0;
}

.toc-float-content h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: var(--red-1);
  font-weight: 600;
  border-bottom: 2px solid var(--red-5);
  padding-bottom: 10px;
}

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

.toc-float-content li {
  margin: 8px 0;
}

.toc-float-content a {
  text-decoration: none;
  color: var(--color-default);
  font-size: 13px;
  line-height: 1.6;
  transition: all 0.2s;
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  border-left: 3px solid transparent;
}

.toc-float-content a:hover {
  color: var(--red-1);
  background: var(--red-6);
  border-left-color: var(--red-1);
}

.toc-float-content .active > a {
  color: var(--red-1);
  background: var(--red-6);
  font-weight: 600;
  border-left-color: var(--red-1);
}

.toc-float-content ul ul {
  padding-left: 16px;
}

.toc-float-content::-webkit-scrollbar {
  width: 6px;
}

.toc-float-content::-webkit-scrollbar-track {
  background: var(--red-6);
  border-radius: 3px;
}

.toc-float-content::-webkit-scrollbar-thumb {
  background: var(--red-3);
  border-radius: 3px;
}

.toc-float-content::-webkit-scrollbar-thumb:hover {
  background: var(--red-2);
}

/* 回到顶部按钮 - 在TOC下面 */
.back-to-top-custom {
  width: 60px;
  height: 40px;
  background: var(--red-1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  font-family: "iconfont" !important;
}

.back-to-top-custom:hover {
  background: var(--red-0);
  width: 70px;
}

.back-to-top-custom::before {
  content: "↑";
  font-size: 24px;
}

@media (max-width: 768px) {
  .toc-float-container {
    top: auto;
    bottom: 80px;
    right: 10px;
    transform: none;
  }
  
  .toc-float-content {
    right: -300px;
    top: auto;
    bottom: 50px;
    transform: none;
    max-width: calc(100vw - 80px);
    width: 280px;
  }
  
  .toc-float-container.expanded .toc-float-content {
    right: 10px;
  }
}

/* 隐藏主题原本的回到顶部按钮 */
#back-to-top {
  display: none !important;
}

/* ============================================
   5. 深色模式适配
   ============================================ */

[data-theme="dark"] .reimu-grid-item {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .reimu-grid-item:hover {
  box-shadow: 0 8px 20px rgba(255, 82, 82, 0.4);
}

[data-theme="dark"] .toc-float-content {
  box-shadow: -4px 0 20px rgba(0,0,0,0.5);
}

/* =============================================
    6. 友链样式
   ============================================= */

/* 友链页本站信息美化 */
.my-friend-info-box {
    background: var(--color-wrap) !important;
    padding: 25px !important;
    border-radius: 12px !important;
    margin-bottom: 40px !important;
    line-height: 1.8 !important; /* 让文字散开 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
    border-left: 5px solid var(--red-1) !important; /* 加入红条装饰 */
}

/* 让每行信息都有间距 */
.my-friend-info-box p, 
.my-friend-info-box div {
    margin-bottom: 12px !important;
}

/* 让"名称："这类加粗文字颜色好看点 */
.my-friend-info-box strong {
    color: var(--red-1) !important;
    margin-right: 8px !important;
}