/* ============ 工具卡片样式 ============ */
.tool-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 9px rgba(44, 44, 44, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

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

.tool-card-link:hover {
    color: inherit;
    text-decoration: none;
}

/* 工具头部 */
.tool-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 渐变背景 - 12种配色 */
.tool-list>div:nth-of-type(12n+1) .tool-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tool-list>div:nth-of-type(12n+2) .tool-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.tool-list>div:nth-of-type(12n+3) .tool-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.tool-list>div:nth-of-type(12n+4) .tool-header {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.tool-list>div:nth-of-type(12n+5) .tool-header {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.tool-list>div:nth-of-type(12n+6) .tool-header {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.tool-list>div:nth-of-type(12n+7) .tool-header {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.tool-list>div:nth-of-type(12n+8) .tool-header {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
}

.tool-list>div:nth-of-type(12n+9) .tool-header {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.tool-list>div:nth-of-type(12n+10) .tool-header {
    background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%);
}

.tool-list>div:nth-of-type(12n+11) .tool-header {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

.tool-list>div:nth-of-type(12n+12) .tool-header {
    background: linear-gradient(135deg, #f77062 0%, #fe5196 100%);
}

/* 图标容器 */
.tool-icon-wrapper {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.35);
}

.tool-icon {
    font-size: 36px;
    color: #fff;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 工具信息 */
.tool-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tool-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-tag {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    max-width: fit-content;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 工具内容区 */
.tool-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.tool-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    /* 限制为3行，超出显示省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 4.8em;
}

/* 操作按钮 */
.tool-action {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.tool-btn {
    font-size: 0.85rem;
    color: #0184ff;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 4px;
}

.tool-card:hover .tool-btn {
    color: #764ba2;
    padding-right: 8px;
}

/* ============ 其他样式保持 ============ */
.tool-cate .card-header strong {
    padding-bottom: 12px;
    border-bottom: 2px solid #00AAEE;
}

.tool-cate .card-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.title-info {
    border-left: 4px solid #17a2b8;
}

pre {
    border: none;
    background-color: #e4eaef;
    border-radius: 8px;
    font-size: 85%;
    padding: .75rem;
    overflow-x: auto;
}

.re-result pre {
    margin-bottom: 0;
}

.re-result p {
    margin-bottom: 5px;
}

.tool-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card ul {
    line-height: 2;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .tool-header {
        padding: 1.25rem 1rem;
    }
    
    .tool-icon-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .tool-icon {
        font-size: 32px;
    }
    
    .tool-title {
        font-size: 1rem;
    }
    
    .tool-body {
        padding: 1rem;
    }
    
    .tool-desc {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        min-height: 3.2em;
    }
}

@media (max-width: 576px) {
    .tool-card {
        border-radius: 12px;
    }
    
    .tool-header {
        padding: 1rem 0.875rem;
        gap: 0.75rem;
    }
    
    .tool-icon-wrapper {
        width: 44px;
        height: 44px;
    }
    
    .tool-icon {
        font-size: 28px;
    }
    
    .tool-title {
        font-size: 0.95rem;
    }
    
    .tool-body {
        padding: 0.875rem;
    }
}