.tool-content {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.2em;
    border-radius: .6em;
    position: relative;
}

.tool-content .text-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-simple);
}

.tool-content .text-item > label {
    display: block;
}

.tool-content .operate-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/*按钮样式*/
.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-purple {
    color: #fff;
    background-color: rgb(93 79 248 / 95%);
    border-color: var(--primary-color);
}

.btn-purple svg {
    fill: #fff;
}

.btn-green {
    color: #fff;
    background-color: rgba(34, 197, 94, 0.95);
    border-color: #22c55e;
}

.btn-green svg {
    fill: #fff;
}

/* 关键动画：扩散 + 淡出 */
@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: 400px;
    line-height: 30px;
    padding: 10px 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;
    position: relative;
    cursor: pointer;
}

.image-upload-top{
    padding-top: 95px;
}

.image-upload .upload-prompt{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px 0;
    text-align: center;
}

.image-upload #previewContainer{
    position: relative;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    /*overflow: hidden;*/
}

.image-upload #previewContainer img {
    max-width: 100%;
    max-height: 600px;
    background: url("../images/transparent.png") repeat;
    background-size: 20px;
}

.image-upload .image-header{
    width: 100%;
    height: 85px;
    background: url(../images/favicon-header-center.png) repeat-x;
    background-size: contain;
    position: absolute;
    top: 0;
    left: 0;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    overflow: hidden;
    display: none;
}

.image-upload .image-header .favicon-header-left{
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

.image-upload .image-header .favicon-header-right{
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
}

.image-upload .image-header .favicon-header-preview{
    position: absolute;
    top: 11px;
    left: 47px;
    width: 16px;
    height: 16px;
}

/* ==================== 尺寸选择框 ==================== */
.icon-size-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.size-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    position: relative;
}

.size-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 外圈 - 圆形边框 */
.size-item::before {
    content: '';
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid #adb5bd;
    border-radius: 50%;
    background-color: white;
    transition: all 0.2s ease;
    z-index: 1;
}

.size-item.active::before {
    border-color: rgba(90, 77, 248, 0.9);
}

/* 内点 - 默认不显示，active 时出现 */
.size-item::after {
    content: '';
    position: absolute;
    left: 16px;
    width: 10px;
    height: 10px;
    background-color: rgba(90, 77, 248, 0.9);
    border-radius: 50%;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.size-item.active::after {
    opacity: 1;
}

.size-label {
    color: #212529;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.size-item.active .size-label {
    color: rgba(90, 77, 248, 0.9);
}

/* ==================== 关键：松手后整体弹出动画 ==================== */

@keyframes popIn {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 同时给外圈和内点添加动画 */
.size-item.pop-animation::before,
.size-item.pop-animation::after {
    animation: popIn 0.3s cubic-bezier(0.25, 0.1, 0.75, 1) forwards;
}

/* 裁剪框 - 虚线流动边框 */
.crop-box {
    position: absolute;
    top: 50px;
    left: 50px;
    width: 120px;
    height: 120px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5);
    cursor: move;
    z-index: 9;
    /* 虚线流动效果 */
    background:
            linear-gradient(90deg, #333 50%, transparent 0) 0 0/10px 1px,
            linear-gradient(90deg, #333 50%, transparent 0) 0 100%/10px 1px,
            linear-gradient(0deg, #333 50%, transparent 0) 0 0/1px 10px,
            linear-gradient(0deg, #333 50%, transparent 0) 100% 0/1px 10px;
    background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
    animation: flowDash 1s linear infinite;
}

@keyframes flowDash {
    0% {
        background-position: 0 0, 0 100%, 0 0, 100% 0;
    }
    100% {
        background-position: 10px 0, -10px 100%, 0 -10px, 100% 10px;
    }
}

/* 手柄 - 完全保持不变 */
.crop-handle {
    position: absolute;
    width: 7px;
    height: 7px;
    border: 1px solid #eee;
    background: rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: inherit;
}

.crop-handle[data-dir="n"]   { top: 0;     left: 50%; cursor: ns-resize; }
.crop-handle[data-dir="e"]   { top: 50%;  right: 0;  cursor: ew-resize; }
.crop-handle[data-dir="s"]   { bottom: 0; left: 50%; cursor: ns-resize; }
.crop-handle[data-dir="w"]   { top: 50%;  left: 0;   cursor: ew-resize; }
.crop-handle[data-dir="ne"]  { top: 0;     right: 0;  cursor: nesw-resize; }
.crop-handle[data-dir="se"]  { bottom: 0; right: 0;  cursor: nwse-resize; }
.crop-handle[data-dir="sw"]  { bottom: 0; left: 0;   cursor: nesw-resize; }
.crop-handle[data-dir="nw"]  { top: 0;     left: 0;   cursor: nwse-resize; }

.crop-box:hover {
    cursor: move;
}
@media (max-width: 768px) {
    .tool-content {
        padding: .8em !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;
    }

    .image-upload{
        min-height: 200px;
        font-size: 13px;
        padding: 5px 8px;
    }

    .icon-size-selector{
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px 0;
    }

    .size-item{
        gap: 8px;
        padding: 0 8px;
    }

    .size-item::after{
        left: 12px;
    }


}