/* 项目卡片样式 */
.repo-card {
    display: flex;
    padding: 5px;
    margin-bottom: 12px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.repo-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    background-color: #f5f5f5; /* 浅灰色背景，可根据需要调整色值 */
}

/* 1. 每个 tab 选中样式调整 */
.tab {
    position: relative;
    padding: 8px 12px;
    margin: 4px;
    flex: 1;
    min-width: 100px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tab.active {
    background-color: #ffebee; /* 选中时的友好背景色 */
}

.tab.show-red-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: #d75757;
}

/* 2. 对图片样式调整为 80x80 */
.repo-card .card-image {
    flex-shrink: 0;
    margin-right: 20px; /* 增加图片与内容的间距 */
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.repo-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 优化 card-content 边距，减少紧凑感 */
.repo-card .card-content {
    flex: 1;
    min-width: 200px;
    padding: 5px 0; /* 增加上下内边距 */
}

.repo-card .card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: -5px; /* 增加与下方内容的间距 */
}

.repo-card .card-rank {
    font-size: 16px;
    font-weight: 700;
    color: #999;
    margin-right: 12px; /* 增加与标题的间距 */
    min-width: 20px;
}

.repo-card .card-title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px; /* 增加标题与下方内容的间距 */
}

.repo-card .card-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.repo-card .card-title a:hover {
    color: #d75757;
}

.repo-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: center; /* 水平居中对齐 */
    gap: 12px;
    color: #aaa4a4;
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 12px;
    margin-left: 8px; /* 重置左边距为0，可根据需要调整为具体数值（如8px） */
    padding-left: 0; /* 若有内边距也一并重置 */
    flex-wrap: wrap;
}

/* 如需与左侧元素（如排名）对齐，可添加如下调整 */
/* 假设.card-header内有.card-rank元素，可让card-meta与之一致缩进 */
.repo-card .card-header + .card-meta {
    margin-left: 32px; /* 与.card-rank的宽度+右边距保持一致（20px宽度+12px右边距） */
}

.repo-card .card-info {
    display: flex;
    align-items: center;
    gap: 16px; /* 增加信息项之间的间距 */
    margin: 12px 0; /* 增加上下间距 */
    flex-wrap: wrap;
}

.repo-card .language-tag {
    background: #f3f4f6;
    padding: 3px 10px; /* 增加标签内边距 */
    border-radius: 4px;
    font-size: 13px;
    color: #4b5563;
}

.repo-card .star-count {
    display: flex;
    align-items: center;
    gap: 6px; /* 增加星星与数字的间距 */
    color: #666;
    font-size: 13px;
}

.repo-card .card-description {
    color: #555;
    margin-bottom: 10px; /* 增加与底部内容的间距 */
    line-height: 1.6; /* 增加行高，提升可读性 */
    font-size: 14px;
    max-width: 800px; /* 限制最大宽度，避免一行过长 */
}

/* 操作项容器 */
.action-group {
    display: flex;
    gap: 12px;
    margin-left: 30px; /* 增加与内容区的间距 */
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    /* 初始边框透明，hover 或 hover+active 时显示 */
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background-color: #fff;
}

.action-item i {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.action-item .count {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

/* hover 时显示边框（无论是否激活） */
.action-item:hover {
    border-color: #d75757;
}

    /* 激活状态：仅在 hover 时才显示边框（鼠标移走则边框消失） */
.action-item.active:hover {
    border-color:#d75757;
}
.action-item.active {
    border-color: transparent; /* 激活但鼠标移走时，边框透明 */
}

/* 激活状态下的图标和数字颜色（始终保持红色，与边框无关） */
.action-item.active i,
.action-item.active .count {
    color: #d75757;
}

/* 点击瞬间反馈 */
.action-item:active {
    transform: scale(0.98);
}

/* 指示动画样式优化 */
.indicator {
    position: absolute;
    /* 增大字体大小 */
    font-weight: bold;
    font-size: 16px; 
    pointer-events: none;
    animation: move 0.8s ease-out forwards;
    top: -8px;
    /* 添加文字阴影增强视觉效果 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); 
    /* 添加背景和圆角，使数字更突出 */
    padding: 2px 6px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.9);
}

.indicator.plus {
    /* 增大颜色对比度 */
    color: #ff3b30; 
}

.indicator.minus {
    /* 增大颜色对比度 */
    color: #34c759; 
}

@keyframes move {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px);
    }
}

/* tab 框大小优化 */
.tab {
    padding: 8px 12px;
    margin: 4px;
    flex: 1;
    min-width: 100px;
}

/* 响应式适配 - 移动端样式调整 */
@media (max-width: 768px) {
  .repo-card {
    padding: 8px;
  }

  .repo-card .card-image {
    width: 60px;
    height: 60px;
  }

  .repo-card .card-title {
    font-size: 16px;
      margin-bottom: 4px; /* 减小标题底部间距 */
  }

  .repo-card .card-meta {
    font-size: 13px;
    gap: 8px;
    display: none; /* 完全隐藏 */
  }

  .repo-card .card-description {
    font-size: 13px;
      margin-top: 4px; /* 调整描述顶部间距 */
  }

  .action-group {
    margin-left: auto; /* 左侧自动 margin，实现右对齐 */
    gap: 8px;
  }

  .action-item {
    padding: 6px;
  }

  .action-item i {
    font-size: 14px;
  }

  .action-item .count {
    font-size: 12px;
  }
}

/* 触摸反馈优化 */
.action-item {
  -webkit-tap-highlight-color: transparent;
}