/* 与官网表单保持一致的字体、红色强调和浅灰细边框。 */
#guestbookForm .contact-images-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

#guestbookForm .contact-images-optional,
#guestbookForm .contact-images-count {
    color: #a6a6a6;
    font-size: 12px;
}

#guestbookForm .contact-images-input {
    display: none;
}

#guestbookForm .contact-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#guestbookForm .contact-images-item,
#guestbookForm .contact-images-add {
    position: relative;
    flex: 0 0 104px;
    width: 104px;
    height: 104px;
    overflow: hidden;
    border: 1px solid #c4c4c4;
    border-radius: 3px;
    background: #fff;
}

#guestbookForm .contact-images-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #666;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background-color .15s;
}

#guestbookForm .contact-images-plus {
    position: relative;
    width: 24px;
    height: 24px;
    margin-bottom: 10px;
    color: #a6a6a6;
}

#guestbookForm .contact-images-plus:before,
#guestbookForm .contact-images-plus:after {
    position: absolute;
    content: '';
    background: currentColor;
}

#guestbookForm .contact-images-plus:before {
    top: 11px;
    left: 0;
    width: 24px;
    height: 1px;
}

#guestbookForm .contact-images-plus:after {
    top: 0;
    left: 11px;
    width: 1px;
    height: 24px;
}

#guestbookForm .contact-images-add:hover,
#guestbookForm .contact-images-add:focus-visible {
    border-color: #be0000;
    color: #be0000;
    background: #fcf7f7;
}

#guestbookForm .contact-images-add:hover .contact-images-plus {
    color: inherit;
}

#guestbookForm .contact-images-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#guestbookForm .contact-images-remove {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 28px;
    padding: 3px 0;
    border: 0;
    border-top: 1px solid #e5e5e5;
    background: rgba(255, 255, 255, .95);
    color: #be0000;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

#guestbookForm .contact-images-remove:hover {
    background: #fcf7f7;
}

#guestbookForm .contact-images-add:focus-visible,
#guestbookForm .contact-images-remove:focus-visible {
    outline: 2px solid #be0000;
    outline-offset: -3px;
}

#guestbookForm .contact-images-add:disabled,
#guestbookForm .contact-images-remove:disabled {
    border-color: #dcdcdc;
    background: #f7f7f7;
    color: #a6a6a6;
    cursor: default;
}

#guestbookForm .contact-images-add:disabled .contact-images-plus {
    color: #c4c4c4;
}

#guestbookForm .contact-images-help {
    margin: 10px 0 0;
    font-size: 12px;
}

#guestbookForm .contact-images-error {
    margin: 5px 0 0;
    color: #be0000;
    font-size: 12px;
}

#guestbookForm .contact-images-error:empty {
    display: none;
}

@media (max-width: 767px) {
    #guestbookForm .contact-images-grid {
        gap: 10px;
    }

    #guestbookForm .contact-images-item,
    #guestbookForm .contact-images-add {
        flex-basis: calc((100% - 20px) / 3);
        width: calc((100% - 20px) / 3);
        height: auto;
        aspect-ratio: 1;
    }
}
