/* BSTrainTool 全局样式 */

/* 通用输入样式 */
.param-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg text-sm;
    @apply focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 outline-none;
    transition: all 0.15s ease;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 表格悬停 */
table tbody tr:hover {
    background-color: #f8fafc;
}

/* 按钮过渡 */
button, a.btn {
    transition: all 0.15s ease;
}

/* Toast 动画 */
#toast {
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 文件上传按钮样式 */
input[type="file"] {
    cursor: pointer;
}

/* 文件输入包装器 - 带清除按钮 */
.file-input-wrapper {
    position: relative;
}
.file-input-wrapper input[type="file"] {
    width: 100%;
}
.file-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #e2e8f0;
    color: #64748b;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 2;
}
.file-clear-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Tooltip 悬浮提示 ========== */
.has-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted #94a3b8;
}
.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 12px;
    line-height: 1.5;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100;
    max-width: 320px;
    white-space: normal;
    text-align: left;
}
.has-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 帮助图标 */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    margin-left: 3px;
    vertical-align: text-top;
}
/* 让包含 help-icon 的 label 成为 tooltip 的定位容器，避免被 15px 图标宽度限制 */
label:has(.help-icon) {
    position: relative;
}
.help-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translate(-50%, -100%);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.65;
    padding: 10px 14px;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 440px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.help-icon:hover::after {
    opacity: 1;
    visibility: visible;
}
