.tool-content {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.2em;
    border-radius: .6em;
    position: relative;
}

.tool-content .item-compress {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-simple);
}

.tool-content .item-compress > label {
    display: block;
}

.tool-content .item-select {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2em 2em;
    flex-direction: row;
    margin: 1.2em 0;
    border-bottom: solid 1px #ddd;
    padding-bottom: 1.2em;
}

.tool-content .item-select .options {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.tool-content .item-select .options .custom-select {
    position: relative;
}

/*下拉框*/
.tool-content .item-select .options .custom-select button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 8px;
    gap: 0 6px;
    min-width: 120px;
}

.tool-content .item-select .options .select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 7px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 2px 0;
    white-space: nowrap;
}

.select-dropdown li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin: 3px 5px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #333;
    font-size: 13.7px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

/* hover 背景 */
.select-dropdown li:hover,
.select-dropdown li[aria-selected="true"] {
    background-color: #f5f5f5;
}

.select-dropdown li .check-icon {
    flex: 0 0 15px; /* 不缩放，固定宽高 */
    width: 15px;
    height: 15px;
    opacity: 0;
    display: block !important;
}

/* 默认选中项始终显示对勾 */
.select-dropdown li[aria-selected="true"] .check-icon {
    opacity: 1;
}


.tool-content .operate-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.input-number {
    border: 1px solid #ddd;
    background-color: var(--main-bg);
    width: 120px;
    height: 36px;
    line-height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    font-family: var(--font-simple);
    outline: none;
    font-size: 14px;
    text-align: center;
}

.input-number:focus {
    border-color: #5a4df8;
    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);
}

/*按钮样式*/
.btn {
    outline: none;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 12px;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    font-family: var(--font-simple);
}

.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;
}

.btn svg {
    width: 0.92em;
    height: 0.92em;
}

.btn-purple {
    color: #fff;
    background-color: rgb(93 79 248 / 95%);
    border-color: var(--primary-color);
}

.btn-green {
    color: #fff;
    background-color: rgba(34, 197, 94, 0.95);
    border-color: #22c55e;
}

/*输出样式*/
.compress-result {
    display: none;
    margin-top: 1.2em;
}

table th {
    font-weight: 600;
    font-size: 14.5px !important;
}

table th, table td {
    border-width: 0 !important;
}

table td .warning {
    color: #ff7f00;
}

table td .success {
    color: #0daa47;
}

table td:nth-child(1), table th:nth-child(1) {
    width: 80px;
    text-align: center;
}

table td:nth-child(2) {
    color: var(--primary-color);
    white-space: nowrap;
}

table td:nth-child(2) span {
    display: block;
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

table td:nth-child(3), table td:nth-child(4), table td:nth-child(6) {
    width: 130px;
    text-align: center;
}

table td:nth-child(5) {
    width: 100px;
    text-align: center;
}

table td:nth-child(5) span{
    background-color: #31b691;
    color: #fff;
    border-radius: 4px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: 18px;
    font-size: 12px;
    margin: 0 auto;
}

table td:nth-child(7) {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0 8px;
}

table td .btn-download {
    color: var(--primary-color);
    border: solid 1px var(--primary-color);
    height: 25px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 4px;
}

table td .btn-preview {
    color: var(--primary-color);
    border: solid 1px var(--primary-color);
    height: 25px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 4px;
}

table td .btn-delete {
    color: rgb(242 55 55 / 95%);
    border: solid 1px rgb(255 31 31);
    height: 25px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 4px;
}

/* 关键动画：扩散 + 淡出 */
@keyframes ripple-effect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ==================== 图片上传框 ==================== */
.image-upload {
    border: solid 1px #ddd;
    background-color: var(--main-bg);
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    min-height: 300px;
    line-height: 30px;
    padding: 0 12px;
    border-radius: 7px;
    font-family: var(--font-simple);
    outline: none;
    font-size: 15px;
    color: #6c6c6c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px 0;
    cursor: pointer;
    position: relative;
}

/* 拖拽时高亮 */
.image-upload.dragover {
    border-color: #5a4df8;
    background-color: #f0edff;
    color: #5a4df8;
}

.image-upload .upload-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px 0;
}

/*弹窗图片*/
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 27, 31, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay .item-image{
    max-width: 1000px;
    height: auto;
    padding: 10px;
    border-radius: 0.5em;
    box-shadow: 0 12px 40px rgba(90, 77, 248, 0.15);
    background-color: #fff;
    transform-origin: center;
    transform: scale(0.5);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
    .tool-content {
        padding: .8em !important;
        box-shadow: unset;
    }

    .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;
    }

    .image-upload {
        min-height: 180px;
        padding: 10px;
    }

    .image-upload img {
        max-width: 100%;
    }

    .upload-prompt > svg {
        width: 50px;
        height: 50px;
    }

    .upload-prompt p {
        text-align: center;
    }

    .input-number {
        height: 36px;
        line-height: 36px;
        display: flex;
        flex: 1;
    }

    .tool-content .item-select {
        gap: 1em 1em;
    }

    .tool-content .item-select .options {
        display: flex;
        flex: 1;
    }

    .tool-content .item-select .options > label {
        width: 78px;
        text-align: right;
    }

    .tool-content .item-select .options .custom-select {
        display: flex;
        flex: 1;
    }

    .tool-content .item-select .options .custom-select button {
        display: flex;
        flex: 1 !important;
    }

    table td, table th {
        white-space: nowrap !important;
    }
}