/* ===== 底部悬浮AI生图栏 ===== */
.float-search-wrap {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.float-search-wrap.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== 收起状态：椭圆药丸条 ===== */
.float-pill {
    display: flex;
    align-items: center;
    width: 608px;
    height: 58px;
    background: #fff;
    border: 1px solid #8078f7;
    border-radius: 29px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    padding: 0 6px 0 10px;
    /* margin-left: -3px; */
    transition: opacity 0.25s, visibility 0.25s;
}
.leftfour{left:40% !important;}

.float-pill {}
.float-pill .pill-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 35px;
    border-radius: 5px;
    border: 1.5px solid #d0d0d8;
    color: #b0b0b8;
    font-size: 16px;
    font-weight: 300;
    flex-shrink: 0;
    margin-right: 6px;
    background: #f7f7fa;
    cursor: pointer;
    transition: transform .3s cubic-bezier(.4,0,.2,1), border-color .2s, color .2s, background .2s;
    line-height: 1;
    will-change: transform;
    transform: skewX(8deg);
    margin-left: 14px;
}
.float-pill .pill-add:hover {
    border-color: #8b7cf7;
    color: #8b7cf7;
    background: #f0eeff;
    transform: skewX(10deg) translateY(-3px) scale(1.1);
}
.float-pill .pill-add:active {
    transform: skewX(10deg) scale(0.97);
}
.float-pill .pill-placeholder {
    flex: 1;
    font-size: 14px;
    color: #999;
    padding-left: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.float-pill .pill-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 18px;
    background: #4318d9;
    color: #fff;
    border: none;
    border-radius: 17px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.float-pill .pill-btn:hover {
    background: linear-gradient(135deg, #7c6cf7, #b865ff);
}
.float-pill .pill-btn .pill-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('../img/icon.png') no-repeat;
    background-size: 254px 185px;
    background-position: -10.3px -57px;
    vertical-align: middle;
}

/* ===== 展开状态：方形面板 ===== */
.float-panel {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    background: #fff;
    border: 1px solid #e0ddf7;
    border-radius: 21px;
    /* box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12); */
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow: visible;
    border: 1px solid #8078f7;
}
.float-search-wrap.expanded .float-pill {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.float-search-wrap.expanded .float-panel {
    opacity: 1;
    visibility: visible;
}

/* --- 设置栏 --- */
.float-panel .panel-settings {
    display: flex;
    align-items: center;
    padding: 12px 16px 12px;
    gap: 8px;
    background: #f8f8f8;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
}

/* --- 精灵图标通用 --- */
.sp-icon {
    display: inline-block;
    width: 20px;
    height: 18px;
    background: url('../img/icon.png') no-repeat;
    background-size: 254px 185px;
    vertical-align: middle;
    flex-shrink: 0;
}
.sp-icon.icon-model    {background-position: -8px -103px;}
.sp-icon.icon-ratio    {background-position: -51px -104px;}
.sp-icon.icon-setting  { background-position: -80px -97px; }
.sp-icon.icon-text     {background-position: -136px -102px;}
.sp-icon.icon-hd       { background-position: -155px -97px; }
.sp-icon.icon-clock    { background-position: -192px -97px; }
.sp-icon.icon-sparkle  { background-position: -10.3px -57px; }
.sp-icon.icon-upload   { background-position: -42px -140px; }


.float-panel .setting-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 18px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: background 0.2s;
}
.float-panel .setting-item:hover {
    background: #eeeef5;
}
.float-panel .setting-item .setting-icon {
    font-size: 14px;
}
.float-panel .setting-item .setting-arrow {
    font-size: 10px;
    color: #999;
}
.float-panel .setting-item .setting-sep {
    color: #ccc;
    margin: 0 2px;
    font-size: 13px;
}

/* --- 下拉菜单 --- */
.setting-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 8px 0;
    min-width: 213px;
    white-space: nowrap;
    display: none;
    z-index: 10;
    text-align: left;
}
.setting-dropdown.show {
    display: block;
}
.setting-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 24px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 8px;
    margin: 2px 6px;
}
.setting-dropdown .dropdown-item:hover {
    background: #f5f5f7;
}
.setting-dropdown .dropdown-item.selected {
    background: #f8f8f8;
}
.setting-dropdown .dropdown-item .item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.setting-dropdown .dropdown-item.selected .item-name {
    color: #333;
}
.setting-dropdown .dropdown-item .item-desc {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.setting-dropdown .dropdown-item .item-check {
    color: #333;
    font-size: 16px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* --- 比例选择弹窗 --- */
.ratio-popup {
    position: absolute;
    bottom: 100%;
    left: -54px;
    margin-bottom: 6px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 16px;
    min-width: 420px;
    white-space: nowrap;
    display: none;
    z-index: 10;
}
.ratio-popup.show {
    display: block;
}
.ratio-popup .popup-title {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-bottom: 13px;
    text-align: left;
}
.ratio-popup .ratio-options {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: flex-end;
    margin-bottom: 16px;
}
.ratio-popup .ratio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    cursor: pointer;
    height: 57px;
    width: 47px;
    padding: 0;
    border-radius: 10px;
    transition: background 0.2s;
    box-sizing: border-box;
    border: 1px solid #fff;
}
.ratio-popup .ratio-item:hover {
    background: #f5f5f5;
}
.ratio-popup .ratio-item.active {
    background: #f8f8f8;
    border: 1px solid #f3f3f3;
}
.ratio-popup .ratio-item .ratio-box {
    border: 2px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}
.ratio-popup .ratio-item.active .ratio-box {
    border-color: #ddd;
}
.ratio-popup .ratio-item .ratio-label {
    font-size: 12px;
    color: #666;
}
.ratio-popup .count-title {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-bottom: 10px;
}
.ratio-popup .count-options {
    display: flex;
    gap: 10px;
}
.ratio-popup .count-item {
    padding: 12px 12px;
    border: 1px solid #fff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.ratio-popup .count-item.active {
    background: #f8f8f8;
    border: 1px solid #f3f3f3;
}

/* --- 内容区 --- */
.float-panel .panel-body {
    padding: 12px 16px 6px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    /* margin-top: 8px; */
}
.float-panel .panel-textarea {
    flex: 1;
    height: 52px;
    border: none;
    border-radius: 8px;
    outline: none;
    resize: none;
    font-size: 14px;
    color: #333;
    font-family: inherit;
    line-height: 1.6;
    padding: 10px 12px;
    box-sizing: border-box;
    text-align: left;
}
.float-panel .panel-textarea:focus {
    border: none;
    box-shadow: none;
}
.float-panel .panel-textarea::placeholder {
    color: #bbb;
}

/* --- 底部操作栏 --- */
.float-panel .panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 16px 16px;
    color: #666;
}
.float-panel .panel-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 52px;
    border-radius: 6px;
    border: 1.5px solid #d0d0d8;
    color: #b0b0b8;
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    transition: transform .3s cubic-bezier(.4,0,.2,1), border-color .2s, color .2s, background .2s;
    background: #f7f7fa;
    line-height: 1;
    will-change: transform;
    transform: skewX(10deg);
    margin-top: 5px;
}
.float-panel .panel-add-btn:hover {
    /* border-color: #8b7cf7; */
    /* color: #8b7cf7; */
    /* background: #f0eeff; */
    transform: skewX(10deg) translateY(-4px) scale(1.05);
}
.float-panel .panel-add-btn:active {
    transform: skewX(10deg) translateY(-4px) scale(0.97);
}
.float-panel .panel-generate {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 22px;
    background: #4318d9;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    margin-left: 12px;
}
.float-panel .panel-generate:hover {
    background: #5629e6;
}
.float-panel .panel-generate .gen-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: none;
    vertical-align: middle;
}
.float-panel .panel-generate .gen-icon::before {
    content: '✦';
    font-size: 14px;
    color: #fff;
}

/* 在 CSS 文件中添加 */
.image-preview-item {
    position: relative;
    overflow: visible;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /*transition: all 0.3s ease;*/
    /*pointer-events: auto !important;*/
}

.image-delete-btn{
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all .2s ease;
    font-size: 16px;
    border: none;
    color: #fff;
    z-index: 10;

}

.image-preview-item:hover {
    transform: scale(1.05) !important;
    z-index: 100 !important;
}

.image-preview-item:hover .image-delete-btn {
    opacity: 1 !important;
    background: #f00c;
    pointer-events: auto !important;
}

.image-preview-item .resetToSmall {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f7f7fa;
    border: 1.5px solid #d0d0d8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0b0b8;
    cursor: pointer;
    font-size: 18px;
    font-weight: 300;
    bottom: -5px;
    right: -5px;
    z-index: 5;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
    pointer-events: auto;
}

.image-preview-item .setToLarge {
    position: absolute;
    width: 40px;
    height: 52px;
    border-radius: 6px;
    background: #f7f7fa;
    border: 1.5px solid #d0d0d8;
    bottom: 0;
    top: 0;
    left: 35px;
    right: auto;
    font-size: 18px;
    transform: skewY(10deg) scale(1.12);
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #b0b0b8;
}

.image-container {
    display: flex;
    flex-wrap: nowrap;
    overflow: visible;
    align-items: flex-start;
    pointer-events: auto !important;
}

/*!* 悬停时扇形展开 *!*/
/* 或者加一个延迟，避免快速 hover 时反复触发 */
.image-container:hover .image-preview-item {
    margin-right: 20px;
    transition: margin-right 0.2s ease;
}

/* 最后一张去掉 margin-right */
.image-container:hover .image-preview-item:last-child {
    margin-right: 0;
}

/* 防止快速 hover 闪屏 - 添加稳定区域 */
/*.image-preview-item {*/
/*    pointer-events: auto;*/
/*    transition: margin-right 0.2s ease;*/
/*}*/

/* 给图片容器增加内边距，稳定悬停区域 */
.image-container {
    padding: 20px;
    margin: -15px;
}
