.tool-content {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.2em;
    border-radius: .6em;
    position: relative;
}

.text-group {
    display: flex;
    flex-direction: column;
    gap: 1em;
    font-family: var(--font-simple);
}

.text-group .input-group {
    display: flex;
    align-items: center;
    justify-content: start;
    position: relative;
    width: 100%;
    gap: 0 10px;
}

.text-group .input-group label {
    min-width: 60px;
    text-align: right;
}

/*文本框样式*/
.input-text {
    border: solid 1px #ddd;
    background-color: var(--main-bg);
    display: flex;
    flex: 1;
    min-width: 100px;
    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: #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); /* 外发光点缀（可选） */
}

/* 彻底干掉颜色输入框所有默认样式 */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 40px;
    border: solid 1px #ddd;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    outline: none;
    display: inline-block;
    vertical-align: middle;
}

/* 清除Chrome内核强制留白（最关键！） */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0 !important;
    margin: 0 !important;
}

input[type="color"]::-webkit-color-swatch {
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/*按钮样式*/
.tool-content .btn-group {
    display: flex;
    align-items: center;
    margin-left: 70px;
    gap: 10px;
}

.btn {
    outline: none;
    position: relative;
    overflow: hidden;
    display: 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: rgb(93 79 248 / 95%);
}

.btn-red {
    color: #fff;
    background-color: rgb(242 55 55 / 95%);
    border-color: rgb(255 31 31);
}

.btn-green {
    color: #fff;
    background-color: rgba(34, 197, 94, 0.95);
    border-color: #22c55e;
}

.preview {
    max-width: 100%;
    border: solid 1px #ddd;
    border-radius: 6px;
    padding: 12px;
    overflow: hidden;
}

.preview > div {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    /* 火狐 / IE 隐藏滚动条 */
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab; /* 鼠标变成抓手 */
    user-select: none; /* 禁止选中文字干扰 */
}

/* Chrome / Edge / Safari 隐藏滚动条 */
.preview > div::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

.preview > div:active {
    cursor: grabbing; /* 按住时变抓取状态 */
}

.preview > div canvas {
    display: block;
    position: relative;
    left: 0; /* 拖动靠这个值 */
    max-width: unset;
    cursor: pointer;
}

/* 关键动画：扩散 + 淡出 */
@keyframes ripple-effect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .tool-content {
        padding: .8em !important;
    }

    .input-group {
        flex-direction: column;
        align-items: start !important;
        gap: 8px !important;
    }

    .input-textarea, .input-text, .custom-select {
        width: 100%;
    }

    .tool-content .btn-group {
        flex-direction: row;
        justify-content: center;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .tab-group a {
        padding: 6px 10px;
    }
}