.tool-content {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.2em;
    border-radius: .6em;
    position: relative;
}

.tool-content .port-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-simple);
}

.tool-content .port-item label {
    display: block;
}

.tool-content .port-item label span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 5px;
    margin: 0 4px;
    color: #f84d4d;
    border-radius: 4px;
    background-color: rgba(248, 77, 77, 0.1);
    border: solid 1px rgba(248, 77, 77, 0.4);
    font-size: 13px;
    font-family: var(--font-family);
}

.tool-content .port-item .port-search {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    position: relative;
}

.tool-content hr {
    border: none;
    height: 0;
    border-top: 1px solid #eaeaea;
    margin: 1.5em 0 1.5em;
    padding: 0;
}

/*按钮样式*/
.btn {
    outline: none;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 18px 0 15px;
    color: #fff;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: var(--font-simple);
    position: absolute;
    top: 0;
    right: 0;
}

.btn .ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 1;
    animation: ripple-effect 0.6s ease-out forwards;
}

/* 关键动画：扩散 + 淡出 */
@keyframes ripple-effect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/*文本框样式*/
.input-text {
    border: solid 1px #ddd;
    background-color: var(--main-bg);
    min-width: 150px;
    width: 100%;
    height: 40px;
    line-height: 40px;
    padding: 0 12px;
    border-radius: 7px;
    font-family: var(--font-simple);
    outline: none;
    font-size: 14px;
}

.input-text:focus {
    border-color: var(--primary-color);
    background-color: #f8f7fd;
    box-shadow: inset 0 1px 4px rgba(90, 77, 248, 0.2), /* 主题色内影 */ 0 0 0 2px rgba(90, 77, 248, 0.1); /* 外发光点缀（可选） */
}

/*表格样式*/
.table-container table th, .table-container table td {
    border-width: 0;
    white-space: nowrap;
}

.table-container table td:nth-child(1), .table-container table td:nth-child(2), .table-container table td:nth-child(4), .table-container table td:nth-child(5) {
    text-align: center;
}

.table-container table td:nth-child(1) input.port-checkbox, .table-container table th:nth-child(1) input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #474afd;
    border-radius: 3px;
    border: 1px solid #bbb;
    vertical-align: middle; /* 关键属性 */
    position: relative;
    top: -1px; /* 微调位置 */
    background-color: #fff;
}

.table-container table tr{
    cursor: pointer;
    user-select: none;
}

.table-container table td:nth-child(1) input.port-checkbox:hover, .table-container table th:nth-child(1) input:hover {
    border-color: var(--primary-color);
}

.table-container table td:nth-child(1) input.port-checkbox:checked, .table-container table th:nth-child(1) input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.table-container table td:nth-child(1) input.port-checkbox:checked::after, .table-container table th:nth-child(1) input:checked::after {
    content: "✓";
    color: white;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.table-container a {
    color: var(--primary-color);
}

.table-container a:hover {
    text-decoration: underline;
}

.port-loading {
    color: #666;
}

.port-open {
    color: #128b00;
}

.port-close {
    color: #ff4d4f;
}

.port-unknown {
    color: #999;
}

@media (max-width: 768px) {
    .tool-content {
        padding: .9em !important;
    }

    .operate-buttons .btn {
        line-height: 32px !important;
        height: 32px !important;
        padding: 0 8px !important;
    }

    .tool-content .mobile-item label span {
        height: 16px !important;
        padding: 0 4px !important;
        margin: 0 2px !important;
        font-size: 12px !important;
    }

    .table-container table th, .table-container table td {
        padding: 8px !important;
    }
}
