/* 下拉列表样式 */
.selector {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    padding: 0 5px 5px 5px;
    z-index: 10;
    border-radius: 6px;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.selector .title {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 3px;
    position: sticky;
    top: 0;
    background: #fff;
    padding: 5px 0;
    z-index: 11;
}

.selector button {
    width: 38px;
    padding: 3px;
    margin-bottom: 1px;
    cursor: pointer;
    border: 1px solid #666;
    background: #f0f0f0;
    border-radius: 4px;
}
.selector button:hover {
    background: #ddd;
}

.selector .clear-btn {
    width: 120px;
    margin-top: 8px;
    padding: 2px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.selector .preview {
    width: 36px;
    height: 36px;
    border-collapse: collapse;
    pointer-events: none;
}
.selector .preview td {
    position: relative;
    width: 12px;
    height: 12px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background-color: #ffffff;
}
.selector .preview .attach {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.option-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.option-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    padding-top: 4px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    cursor: pointer;
}
.option-item:hover {
    background-color: #eee;
}

/* 自定义颜色相关样式 */
.color-input-container {
    position: fixed;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    min-width: 160px;
}
.color-input-container input {
    padding: 6px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 80px;
    text-transform: uppercase;
}
.color-preview-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.color-preview {
    width: 36px;
    height: 36px;
    border: 2px solid #000;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.color-preview.valid {
    cursor: pointer;
}
.color-preview.valid:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
.color-preview.invalid {
    cursor: not-allowed;
    background-color: transparent !important;
}
/* 自定义附着圆形样式 */
.custom-attach-circle {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    border-radius: 50%;
    width: 70%;
    height: 70%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.square-box {
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 1px solid #000;
}
.wall-box {
    width: 32px;
    height: 7px;
    margin-right: 8px;
    border: 1px solid #000;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .selector {
        padding: 0 3px 3px 3px;
        border-radius: 4px;
        max-height: 60vh;
        transform: translate(6px, 6px);
    }

    .selector .title {
        font-size: 14px;
        padding: 2px 0;
    }
    .selector button {
        width: 28px;
        padding: 1px;
        margin-bottom: 1px;
        font-size: 12px;
    }
    .selector .clear-btn {
        width: 100px;
        margin-top: 5px;
        padding: 1px;
        font-size: 12px;
    }

    .selector .preview {
        width: 27px;
        height: 27px;
    }
    .selector .preview td {
        width: 9px;
        height: 9px;
    }
    .selector .preview .attach {
        width: 9px;
        height: 9px;
    }

    .color-input-container {
        min-width: 150px;
        padding: 8px;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) scale(1) !important;   /* 防止移动端缩放 */
        -webkit-transform: translate(-50%, -50%) scale(1) !important;
    }
    .color-input-container input {
        width: 80px;
        font-size: 12px;
        padding: 5px;
    }
    .color-preview {
        width: 30px;
        height: 30px;
    }

    .wall-box {
        width: 22px;
        height: 5px;
    }
}
