/* 让这块内容左右贴边（仅该模块生效） */
.cb-card.fav-card {
  padding-bottom: 0;   /* 去除卡片底部内边距 */
  margin-bottom: 0;    /* 防止卡片之间也有缝隙 */
}
.cb-card-body.fav-body {

  /* 假设每行大约 64px 高度（含 padding、边框） */
  max-height: calc(64px * 5);  /* 显示约 5 行 */
  overflow-y: auto;            /* 超出时滚动 */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  
  margin-top: 0;        /* 消除 body 的上外边距 */
  padding: 0 !important;           /* 或至少把底部清掉 */
}

/* 列表容器：取消行间距，让行与行无缝贴合 */
.fav-list {
  display: grid;
  gap: 0; /* 没有空隙 */
  padding-bottom: 0;  /* ✅ 关键1：无内边距 */
  margin-bottom: 0;   /* ✅ 关键2：无外边距 */
}

/* 行：透明背景 + 蓝色发光边框 + 左右贴容器 */
.fav-row {
  display: grid;
  /* 题目 | 知识点 | 公司 | 难度（最后一列不再扩张） */
  grid-template-columns: 1.6fr 1.2fr 1fr max-content;
  align-items: center; /* 元素垂直居中 */
  background: transparent;
  border: 0.5px solid rgba(107, 114, 128, 0.25);
  margin: 0;
  border-radius: 8px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease; /* 平滑过渡 */
}
/* hover 时高亮发光 */
.fav-row:hover {
  border-color: rgba(37, 99, 235, 0.6); /* 蓝色边框 */
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.35); /* 🟢 发光效果 */
}

/* 让每一列有内边距，并用竖线分隔 */
.fav-row > * {
  padding: 12px 14px;
  min-width: 0; /* 防止文字把列撑开 */
}
.fav-row > * + * {
  border-left: 1px solid rgba(107, 114, 128, 0.25);
}
.fav-row { align-items: stretch; grid-template-columns: 1.6fr 1.2fr 1fr max-content; }
.fav-row > * { padding: 12px 14px; min-width: 0; display:flex; align-items:center; }
.fav-row > * + * { border-left: 1px solid rgba(107,114,128,0.25); }


/* 文字与标签等原有风格 */
.fav-title {
  white-space: nowrap; /* 整体不换行 */
}
.fav-title a {
  color: #111827;
  font-weight: 600;
  text-decoration: none;
}
.fav-title a:hover { text-decoration: underline !important; }

.fav-title .fav-problem-link {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;   /* 让省略号生效的关键 */
}

/* 第二个 a：正常显示，不被省略 */
.fav-title .fav-record-link {
  flex-shrink: 0; /* 不被压缩 */
  margin-left: auto;   /* ✅ 关键：推到最右边 */
  padding-left: 4px;   /* 与标题间距 */

}
/* 鼠标悬停时加下划线 */
.fav-title .fav-record-link:hover {
  border-bottom: 1px solid currentColor;
}



.fav-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fav-chip {
  display: inline-flex; align-items: center;
  font-size: 12px; line-height: 1;
  padding: 6px 8px; border-radius: 999px;
  background: #f3f4f6; color: #374151; white-space: nowrap;
  cursor: pointer;       /* 鼠标变小手 */
  transition: background 0.2s;
  
}
.fav-chip:hover {
  background: #e5edff;   /* 可选：hover 时轻微高亮 */
}


.fav-company {
  color: #374151; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; /* 保证省略号生效 */
  gap : 6px;
}

.fav-diff {
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  justify-content: center; /* 水平居中内部块 */
  align-items: center;     /* 垂直居中 */
}

/* 难度块：在自己的“窄列”中居中显示，仅包裹内容 */
.fav-diff-block {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 700;
  border: 1px solid rgba(107, 114, 128, 0.25);
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.diff-easy{background:#e8f7ec;color:#0f7b32;}
.diff-medium{background:#fff4e5;color:#b45309;}
.diff-hard{background:#fee2e2;color:#b91c1c;}

/* 小屏：两行布局也保持“难度列不扩张” */
@media (max-width: 640px) {
  .fav-row {
    grid-template-columns: 1fr max-content; /* 第一行：题目 | 难度 */
    grid-template-areas:
      "title diff"
      "tags company";
  }
  .fav-title  { 
    grid-area: title; 
  }
  .fav-tags   { grid-area: tags; }
  .fav-company{ grid-area: company; }
  .fav-diff   { grid-area: diff; place-self: center; }

  /* 移动端分隔线：仅在标题 | 难度之间保留，其它用行距表达 */
  .fav-row > * { padding: 12px; }
  .fav-row > * { border-left: none; }
  .fav-title { border-right: 1px solid rgba(107,114,128,0.25); }
}

/* 容器 */
.tip-box {
  position: relative;
  display: inline-block;
  /* 创建独立层级，避免被兄弟元素 z-index 干扰（不改变子元素视觉） */
  isolation: isolate;
}

/* 不要改问号的颜色/填充：保持默认或继承父色 */
.tip-box > i {
  font-size: 18px;
  line-height: 1;
  vertical-align: -2px;
  /* 不设 color，不设 :hover 颜色 */
}

/* tips 内容（白底简洁） */
.tip-content {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  width: 180px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);

  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;            /* 置顶（受父级堆叠上下文限制） */
}

/* 箭头 */
.tip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}

/* 图片 + 文本 */
.tip-content img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 6px;
}
.tip-content p {
  margin: 0;
  font-size: 13px;
  color: #333;
}

.fav-tip-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.fav-tip-star {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #f59e0b;
}

/* hover 淡入 */
.tip-box:hover .tip-content {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -6px);
}
/* tip 容器本身不改问号样式，只负责定位 */
.tip-box { position: relative; display: inline-block; }

/* tip 面板置顶（在当前层级体系内） */
.tip-content { z-index: 9999; }


.fav-empty {
  text-align: center;
  color: #6b7280;           /* 灰色文字 */
  font-size: 15px;
  padding: 40px 0;          /* 上下留白 */
  background: #fff;
  border-radius: 8px;
  border: 1px dashed #d1d5db; /* 可选：虚线边框，轻提示感 */
}


/* 收藏卡片整体：跟其它 cb-card 深色风格一致 */
.theme--dark .cb-card.fav-card {
  background: #151821;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

/* 收藏列表 body：暗底、内部滚动 */
.theme--dark .cb-card-body.fav-body {
  background: #18181b;
}

/* 列表行：暗色边框 + hover 发光 */
.theme--dark .fav-row {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.35);
}

.theme--dark .fav-row:hover {
  border-color: rgba(96, 165, 250, 0.8); /* 蓝边 */
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

/* 行内竖线分隔也用暗色 */
.theme--dark .fav-row > * + * {
  border-left-color: rgba(148, 163, 184, 0.35);
}

/* 标题文字 & 链接颜色 */
.theme--dark .fav-title a {
  color: #e5e7ff;
}

.theme--dark .fav-title a:hover {
  text-decoration: underline !important;
}

/* 第二个链接（记录）保持高对比 */
.theme--dark .fav-title .fav-record-link {
  color: #93c5fd;
}

/* 标签 chip：暗底 + 轻微高亮 hover */
.theme--dark .fav-chip {
  background: #1f2933;
  color: #e5e7f5;
}

.theme--dark .fav-chip:hover {
  background: #1d3358;
}

/* 公司列文字：浅灰蓝 */
.theme--dark .fav-company {
  color: #cbd5f5;
}

/* 难度列容器本身不用变，保持居中 */
/* 难度块：边框略亮一点，背景原色保持可读 */
.theme--dark .fav-diff-block {
  border-color: rgba(148, 163, 184, 0.5);
}

/* 提示 tip 面板：暗底白字 */
.theme--dark .tip-content {
  background: #111827;
  border-color: #374151;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .75);
}

.theme--dark .tip-content::after {
  border-top-color: #111827;
}

.theme--dark .tip-content p {
  color: #e5e7f5;
}

/* tip 图片可以保留原样，略加暗底防闪眼 */
.theme--dark .tip-content img {
  background: #111827;
}

/* 空状态：暗底 + 虚线边框 */
.theme--dark .fav-empty {
  background: #111827;
  color: #9ca3af;
  border-color: #374151;
}
