Hepatocellular carcinoma (HCC) is the sixth most common malignancy globally and ranks third in terms of both mortality and incidence rates. Surgical resection holds potential as a curative approach for HCC. However, the residual disease contributes to a high 5-year recurrence rate of 70%. Due to their excellent specificity and optical properties, fluorescence-targeted probes are deemed effective auxiliary tools for addressing residual lesions, enabling precise surgical diagnosis and treatment. Research indicates histone deacetylase 6 (HDAC6) overexpression in HCC cells, making it a potential imaging biomarker. This study designed a targeted small-molecule fluorescent probe, SeCF3-IRDye800cw (SeCF3-IRD800), operating within the Second near-infrared window (NIR-II, 1000-1700nm). The study confirms the biocompatibility of SeCF3-IRD800 and proceeds to demonstrate its applications in imaging invivo, fluorescence-guided surgery (FGS) for liver cancer, liver fibrosis imaging, and clinical samples incubation, thereby preliminarily validating its utility in liver cancer. SeCF3-IRD800 was synthesized by combining the near-infrared fluorescent dye IRDye800cw-NHS with an improved HDAC6 inhibitor. Initially, a HepG2-Luc subcutaneous tumor model (n=12) was constructed to investigate the metabolic differences between SeCF3-IRD800 and ICG invivo. Subsequently, HepG2-Luc (n=12) and HCCLM3-Luc (n=6) subcutaneous xenograft mouse models were used to assess invivo targeting by SeCF3-IRD800. The HepG2-Luc orthotopic liver cancer model (n=6) was employed to showcase the application of SeCF3-IRD800 in FGS. Liver fibrosis (n=6) and HepG2-Luc orthotopic (n=6) model imaging results were used to evaluate the impact of different pathological backgrounds on SeCF3-IRD800 imaging. Three groups of fresh HCC and normal liver samples from patients with liver cancer were utilized for SeCF3-IRD800 incubation exvivo, while preclinical experiments illustrated its potential for clinical application. The HDAC6 inhibitor 6 (SeCF3) modified with trifluoromethyl was labeled with IRDy800CW-NHS to synthesize the small-molecule targeted probe SeCF3-IRD800, with NIR-II fluorescence signals. SeCF3-IRD800 was rapidly metabolized by the kidneys and exhibited excellent biocompatibility. Invivo validation demonstrated that SeCF3-IRD800 achieved optimal imaging within 8h, displaying high tumor fluorescence intensity (7658.41±933.34) and high tumor-to-background ratio (5.20±1.04). Imaging experiments with various expression levels revealed its capacity for HDAC6-specific targeting across multiple HCC tumor models, suitable for NIR-II intraoperative imaging. Fluorescence-guided surgery experiments were found feasible and capable of detecting sub-visible 2mm tumor lesions under white light, aiding surgical decision-making. Further imaging of liver fibrosis mice showed that SeCF3-IRD800's imaging efficacy remained unaffected by liver pathological conditions. Correlations were observed between HDAC6 expression levels and corresponding fluorescence intensity (R2=0.8124) among normal liver, liver fibrosis, and HCC tissues. SeCF3-IRD800 identified HDAC6-positive samples from patients with HCC, holding advantages for perspective intraoperative identification in liver cancer. Thus, the rapidly metabolized HDAC6-targeted small-molecule NIR-II fluorescence probe SeCF3-IRD800 holds significant clinical translational value. The successful application of NIR-II fluorescence-guided surgery in liver cancer indicates that SeCF3-IRD800 has great potential to improve the clinical diagnosis and treatment of liver cancer, and could be used as an auxiliary tool for surgical treatment of liver cancer without being affected by liver pathology. This paper is supported by the National Natural Science Foundation of China (NSFC) (92,059,207, 62,027,901, 81,930,053, 81,227,901, 82,272,105, U21A20386 and 81,971,773), CAS Youth Interdisciplinary Team (JCTD-2021-08), the Zhuhai High-level Health Personnel Team Project (Zhuhai HLHPTP201703), and Guangdong Basic and Applied Basic Research Foundation under Grant No. 2022A1515011244.