/* ===== 候选素材功能样式 ===== */

/* 候选按钮 - 图片右上角叠加 */
.fav-img-wrap {
    position: relative;
    display: block;
    max-width: 100%;
}

.fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 18px;
    opacity: 0.7;
    pointer-events: auto;
}

/* 鼠标悬停图片时候选按钮高亮 */
.fav-img-wrap:hover .fav-btn {
    opacity: 1;
}

.fav-btn:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.15);
    opacity: 1;
}

.fav-btn.fav-active {
    opacity: 1;
    pointer-events: auto;
    background: rgba(255, 102, 0, 0.85);
    color: #ffd700;
}

.fav-btn.fav-active:hover {
    background: rgba(255, 68, 0, 0.9);
}

/* 候选按钮动画 */
.fav-btn i {
    transition: transform 0.3s ease;
}

.fav-btn:active i {
    transform: scale(0.8);
}

.fav-btn.fav-active i {
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* 详情页候选按钮 */
.fav-btn-detail {
    position: relative;
    top: auto;
    right: auto;
    display: inline-flex;
    width: auto;
    height: auto;
    padding: 6px 16px;
    margin-top: 10px;
    margin-left: 28px;
    background: #f0f0f0;
    border-radius: 20px;
    color: #666;
    font-size: 14px;
    gap: 6px;
    opacity: 1;
    pointer-events: auto;
    border: 1px solid #ddd;
}

.fav-btn-detail:hover {
    background: #e8e8e8;
    border-color: #ff8601;
    color: #ff8601;
    transform: none;
}

.fav-btn-detail.fav-active {
    background: #fff3e0;
    border-color: #ff8601;
    color: #ff8601;
}

.fav-btn-detail.fav-active i {
    color: #ffd700;
}

/* ===== 右侧候选面板 ===== */
#fav-panel {
    position: fixed;
    right: 0;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    width: 190px;
    background: #fff;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 15px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    border-right: none;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 20px);
    overflow: hidden;
}

/* 面板标题栏 */
#fav-panel-toggle {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    background: linear-gradient(135deg, #ff8601, #ff6a00);
    color: #fff;
    font-size: 14px;
    user-select: none;
    white-space: nowrap;
}

.fav-panel-title {
    font-weight: bold;
    font-size: 15px;
    margin-right: 6px;
}

.fav-badge {
    font-size: 13px;
    opacity: 0.9;
}

.fav-count {
    font-weight: bold;
}

/* 面板主体 */
.fav-panel-body {
    flex: 1;
    overflow-y: auto;
    display: block;
}

/* 操作按钮 */
.fav-panel-actions {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.fav-btn-sm {
    flex: 1;
    padding: 4px 0;
    font-size: 12px;
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    text-align: center;
}

.fav-btn-sm:hover {
    background: #ff8601;
    color: #fff;
    border-color: #ff8601;
}

/* 候选列表 */
.fav-list {
    padding: 6px;
}

.fav-empty {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 20px 0;
}

/* 候选列表项 - 纵向卡片：图上文下 */
.fav-item {
    position: relative;
    display: block;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    margin-bottom: 6px;
}

.fav-item:hover {
    background: #f5f5f5;
}

.fav-item a {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-decoration: none;
    color: #333;
    min-width: 0;
}

.fav-item img {
    display: block;
    width: 166px;
    max-width: 100%;
    height: auto;
    max-height: 190px;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
    border: 1px solid #eee;
    margin: 0 0 6px 0;
    background: #fafafa;
    flex-shrink: 0;
}

.fav-item-title {
    display: block;
    width: 100%;
    font-size: 12px;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.fav-item-del {
    position: absolute;
    right: 4px;
    top: 2px;
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    font-size: 36px;
    font-weight: bold;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    line-height: 1;
}

.fav-item:hover .fav-item-del {
    display: flex;
}

.fav-item-del:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* 点击放大遮罩 */
.fav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.fav-overlay.active {
    display: flex;
}

.fav-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: fav-zoom-in 0.3s ease;
}

@keyframes fav-zoom-in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 悬浮logo预览（拖拽） */
.logo-floating-preview {
    position: absolute;
    z-index: 999;
    cursor: move;
    max-width: 430px;
    height: auto;
 
    user-select: none;
    -webkit-user-select: none;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
}
.logo-floating-preview:hover {
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45));
}

/* 点击放大提示 */
.fav-item img {
    cursor: zoom-in;
}
.fav-panel-body::-webkit-scrollbar {
    width: 4px;
}

.fav-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.fav-panel-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.fav-panel-body::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}