﻿/* 🌍 全局基础样式 */
body
{
    font-family: "Arial", sans-serif;
    /*background: #f4f7f9;*/
    color: #333;
    padding: 15px;
}

/* 标题 */
h2
{
    font-size: 20px;
    font-weight: bold;
    color: #222;
    margin-bottom: 15px;
}

/* 🌟 统一表单元素样式 */
input, select, button
{
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    transition: all 0.2s ease-in-out;
}


    input:focus, select:focus
    {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 4px rgba(0, 123, 255, 0.5);
    }

/* 🌟 让 `select` 变得更现代 */
select
{
    appearance: none;
    background: #fff;
    cursor: pointer;
    padding-right: 25px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"%3E%3Cpath fill="%23333" d="M2 0L0 2h4zM2 5L0 3h4z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
}

/* 📌 按钮优化 */
button
{
    cursor: pointer;
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

    button:hover
    {
        background: #0056b3;
    }

    button:disabled
    {
        background: #ccc;
        cursor: not-allowed;
    }


/* 样式：分组选择下拉框 */
/* 🏷️ 分组选项 & 输入框 */
.batch-select, .rename-batch
{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

    .batch-select label, .rename-batch label
    {
        width: 100px;
    }
    /* 🔥 `select` 和 `input` 变得更小 */
    .batch-select select
    {
        flex-grow: 1;
        min-width: 180px;
        max-width: 260px;
        width: 100%;
    }
    /* 🔥 `select` 和 `input` 变得更小 */
    .rename-batch input
    {
        flex-grow: 1;
        min-width: 160px;
        max-width: 240px;
        width: 100%;
    }

    .batch-select button, .rename-batch button
    {
        min-width: 90px;
    }

/* 📂 文件上传 */
#uploadForm
{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

    #uploadForm label
    {
        width: 100px;
    }

    #uploadForm input
    {
        min-width: 160px;
        max-width: 240px;
        width: 100%;
    }

    #uploadForm button
    {
        width: 90px;
    }

/* 🎵 MP3 批量上传 */
.mp3-upload
{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

    .mp3-upload label
    {
        width: 100px;
    }

    .mp3-upload input
    {
        min-width: 160px;
        max-width: 240px;
        width: 100%;
    }

    .mp3-upload button
    {
        width: 90px;
    }

/* ✅ 复选框区域 */
.column-checkboxes
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* 样式：表格容器 */
/*#example1
{
    margin-top: 20px;
    height: 900px;
    width: 100%;
    overflow: auto;
}
*/
/* Make the move buttons smaller on smaller screens */
.move-buttons
{
    display: flex;
    justify-content: right;
    /*min-width: 120px;
    max-width: 160px;*/
}

    .move-buttons button
    {
        width: 45px;
        vertical-align: middle;
        width: 25px;
    }

td
{
    white-space: inherit !important;
    /*line-height: 41px !important;*/
}

.column-checkboxes
{
    display: flex;
    flex-wrap: wrap; /* 允许换行，如果屏幕小，元素会换行 */
    gap: 10px; /* 增加元素之间的间距 */
    align-items: center; /* 垂直对齐 */
}

    .column-checkboxes label
    {
        display: flex;
        align-items: center; /* 使文本与复选框垂直居中 */
    }

    .column-checkboxes input
    {
        margin-right: 5px; /* 让复选框和文本之间有一点空隙 */
    }

/* 禁用长按菜单 */
/* 禁用单元格编辑行为 */
.handsontable td
{
    -webkit-touch-callout: none; /* 禁用长按菜单 */
    -webkit-user-select: none; /* 禁用文本选择 */
    user-select: none; /* 禁用文本选择 */
    caret-color: transparent; /* 隐藏光标 */
}

/* 🎛️ 工具栏 */
.hot-toolbar
{
    margin-bottom: 15px;
    padding: 10px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

    .hot-toolbar button
    {
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 4px;
    }

/* 📤 导出 & 刷新按钮 */
#exportCsvBtn, #refreshTableBtn
{
    background: #28a745;
}

    #exportCsvBtn:hover, #refreshTableBtn:hover
    {
        background: #218838;
    }

/* 清空优先级 */
#cleanPriorityBtn
{
    background: #d9534f;
}

    #cleanPriorityBtn:hover
    {
        background: #c9302c;
    }

/* 🎵 播放 MP3 链接 */
.audio-link, .play-word, .play-sentence
{
    color: #007bff;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
}

    .audio-link:hover, .play-word:hover, .play-sentence:hover
    {
        color: #0056b3;
        text-decoration: underline;
    }

/* 📦 操作按钮 */
.move-buttons
{
    display: flex;
    gap: 5px;
}

    .move-buttons button
    {
        padding: 5px 7px;
        font-size: 12px;
    }

/* 🔳 模态框 */
.modal
{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    border-radius: 6px;
}

    .modal.show
    {
        opacity: 1;
    }

#editModal label
{
    width: 100px;
    display: inline-block;
    text-align: right;
    vertical-align: top;
}

#editModal div
{
    margin-bottom: 10px;
    margin-top: 5px;
}

#editModal input
{
    width: 300px;
    display: inline-block;
}

#editModal textarea
{
    width: 315px;
    display: inline-block;
    height: 60px;
    border-color: #ccc;
}

#modalOverlay
{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* 🔄 加载动画 */
.loading::after
{
    content: "加载中...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
}

/* 📱 移动端适配 */
@media only screen and (max-width: 1024px)
{
    .move-buttons, #deleteBatchBtn, #renameBatchBtn, #uploadForm, .rename-batch, .other-features, .mp3-upload
    {
        display: none;
    }

    .external-checkbox
    {
        display: block;
    }

    /* 隐藏操作列 */
    .handsontable th:nth-child(9),
    .handsontable td:nth-child(9)
    {
        display: none;
    }
}

@media only screen and (max-width: 480px)
{
    .batch-select, .rename-batch, #saveOrderBtn
    {
        font-size: 13px;
        width: 100%;
    }

        .rename-batch input, .rename-batch button, .batch-select select, .batch-select label
        {
            width: 100%;
            display: block;
        }
}

/* 🛠 Handsontable 焦点捕获器 */
.htFocusCatcher
{
    width: 0;
    height: 0;
    position: absolute;
    left: -9999px;
}
