/* =========================================
   覆盖 global.css 的 image_addon 布局，
   改为 flex wrap（方便动态增删）
   ========================================= */
.image_addon {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 4px 0;
}

/* =========================================
   通用 item
   ========================================= */
.image_addon .image_item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: visible;           /* 允许删除按钮突出 */
    flex-shrink: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
}

.image_addon .image_item:active {
    transform: scale(0.93);
}

/* 入场动画 */
.image_addon .image_item.new_item {
    animation: mediaIn 0.28s ease forwards;
}

@keyframes mediaIn {
    from { opacity: 0; transform: scale(0.72); }
    to   { opacity: 1; transform: scale(1); }
}

/* 出场动画 */
.image_addon .image_item.removing {
    animation: mediaOut 0.2s ease forwards;
    pointer-events: none;
}

@keyframes mediaOut {
    to { opacity: 0; transform: scale(0.65); }
}

/* =========================================
   拍照按钮 — 配合主题橙色风格
   ========================================= */
.image_addon .image_item.addimage {
    background: #fff;
    border: 2px dashed #C0CCDA;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    overflow: visible;
}

.image_addon .addimage .add_img_ico {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* 相机 SVG 用主题橙色 */
.image_addon .addimage .add_img_ico svg {
    width: 28px;
    height: 28px;
}

.image_addon .addimage .add_img_label {
    font-size: 10px;
    font-weight: 600;
    color: #c0ccda;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* 已上传数量徽章 */
.image_addon .addimage .media_count_badge {
    display: none;
    position: absolute;
    top: -7px;
    right: -7px;
    background: #ff8200;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    text-align: center;
    line-height: 20px;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(255, 130, 0, 0.4);
    z-index: 5;
}

/* =========================================
   媒体缩略图（图片 / 视频）
   ========================================= */
.image_addon .image_item .media_thumb {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
}

.image_addon .image_item .img_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image_addon .image_item .video_thumb {
    position: relative;
    background: #111;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
}

.image_addon .image_item .video_thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image_addon .image_item .video_play_icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 14px;
}

/* =========================================
   删除按钮
   ========================================= */
.image_addon .image_item .delete_img {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 22px;
    height: 22px;
    background: #ff3b30;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.35);
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

.image_addon .image_item .delete_img:active {
    transform: scale(0.82);
}

/* =========================================
   单张上传中覆盖层（覆盖在缩略图上）
   ========================================= */
.image_addon .image_item .upload_item_overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 6;
}

.upload_item_spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: itemSpin 0.65s linear infinite;
}

@keyframes itemSpin {
    to { transform: rotate(360deg); }
}

.retry_text {
    font-size: 9px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* 上传失败 */
.image_addon .image_item.upload_failed .upload_item_overlay {
    background: rgba(255, 59, 48, 0.6);
}

.failed_icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =========================================
   Form clarity: labels, hints, GPS status
   ========================================= */
.park_box .form_intro {
    margin: -8px 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #667085;
}

.park_form .form_field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.park_form .form_label {
    font-size: 14px;
    font-weight: 600;
    color: #201E1E;
}

.park_form .form_label .required {
    color: #e11d48;
}

.park_form .field_hint {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: #98A2B3;
}

.park_form .field_hint--block {
    margin: 0;
}

.park_form .form_field--photos .image_addon {
    margin-top: 4px;
}

.park_name_suggestions {
    margin-top: 4px;
}

.park_name_suggestions[hidden] {
    display: none !important;
}

.park_name_suggestions_status {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #667085;
}

.park_name_suggestions_list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.park_name_suggestion {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid #E4E7EC;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.park_name_suggestion:active {
    transform: scale(0.99);
}

.park_name_suggestion.is-selected,
.park_name_suggestion:hover {
    border-color: var(--primary, #F36C00);
    background: #FFF7F0;
}

.park_name_suggestion_title {
    font-size: 14px;
    font-weight: 600;
    color: #201E1E;
}

.park_name_suggestion_meta {
    font-size: 12px;
    color: #98A2B3;
}

.park_form input[type="text"],
.park_form textarea {
    width: 100%;
    box-sizing: border-box;
}

.gps_status {
    padding: 12px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gps_status[hidden] {
    display: none !important;
}

.gps_status.is-precise {
    background: #ecfdf3;
    color: #027a48;
}

.gps_status.is-approx,
.gps_status.is-missing {
    background: #fff8eb;
    color: #b54708;
}

.gps_enable_btn {
    align-self: flex-start;
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--primary, #F36C00);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.gps_enable_btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.gps_enable_btn[hidden] {
    display: none !important;
}

/* Confirm dialog */
.ubx-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(32, 30, 30, 0.55);
}

.ubx-confirm-overlay[hidden] {
    display: none !important;
}

.ubx-confirm-card {
    width: min(100%, 360px);
    padding: 24px 20px 18px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.ubx-confirm-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #201E1E;
}

.ubx-confirm-msg {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #667085;
}

.ubx-confirm-actions {
    display: flex;
    gap: 10px;
}

.ubx-confirm-btn {
    flex: 1;
    min-height: 44px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ubx-confirm-secondary {
    background: #F2F4F7;
    color: #344054;
}

.ubx-confirm-primary {
    background: var(--primary, #ff8200);
    color: #fff;
}

/* =========================================
   提交按钮
   ========================================= */
.park_form .submit_park {
    width: 100%;
    padding: 15px 20px;
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    background: var(--primary, #ff8200);
    transition: opacity 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.park_form .submit_park:active {
    transform: scale(0.97);
    opacity: 0.85;
}

.park_form .submit_park:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* =========================================
   响应式
   ========================================= */
@media (max-width: 480px) {
    .image_addon .image_item {
        width: 72px;
        height: 72px;
        border-radius: 14px;
    }

    .image_addon .addimage .add_img_ico svg {
        width: 24px;
        height: 24px;
    }
}
