
.tool-common {
    position: absolute;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 8px;
    padding: 8px;
    box-sizing: border-box;
}

/* 顶部工具栏：自适应宽度+靠右 */
.tool-buttons-top {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    transform: translateY(-10px);
    display: inline-flex;
    gap: 8px;
}

/* 底部工具栏：铺满宽度+居中 */
.tool-bar-bottom {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    transform: translateY(10px);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px 16px;
    border-radius: 0 0 8px 8px;
}

.tool-common.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* 顶部按钮样式 */
.tool-btn-top {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: #fff;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tool-btn-top:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #00c6ff;
}

/* 底部按钮样式 */
.tool-btn-bottom {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tool-btn-bottom span {
    font-size: 12px;
}

.tool-btn-bottom:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #00c6ff;
}

/* --------------- 预览层样式 --------------- */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 20px;
    box-sizing: border-box;
}

.preview-overlay.show {
    display: flex;
}

.preview-wrap {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    overflow: hidden;
}

.preview-media {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.4);
}

/* 预览层工具栏适配 */
.preview-wrap ~ .tool-buttons-top {
    z-index: 100;
}
.preview-wrap ~ .tool-bar-bottom {
    z-index: 100;
    border-radius: 8px;
}