/**
 * RiPro 图片模式入口模块
 * Version: V1.1.2
 * 右侧入口与分类选择合并为一个整体卡片
 */

.ripro-igmode-dock,
.ripro-igmode-dock * {
    box-sizing: border-box;
}

/* 整体外壳：按钮 + 分类都装进一个卡片，避免看起来像两个独立模块 */
.ripro-igmode-dock {
    position: fixed;
    right: 18px;
    top: 58%;
    z-index: 9998;
    width: 112px;
    padding: 7px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    transform: translateY(-50%);
    background: linear-gradient(180deg, rgba(31, 41, 55, .94), rgba(17, 24, 39, .94));
    border: 1px solid rgba(255, 255, 255, .58);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .24), 0 5px 16px rgba(0, 0, 0, .16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ripro-igmode-dock:before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 21px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 46%);
}

/* 顶部主按钮：作为整体卡片的头部，不再单独漂浮 */
.ripro-igmode-float {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    min-height: 74px;
    padding: 12px 8px 10px;
    border-radius: 17px;
    color: #fff;
    text-decoration: none !important;
    text-align: center;
    background: linear-gradient(145deg, #ff2d75 0%, #ff7a18 56%, #ffd000 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), 0 10px 24px rgba(255, 83, 44, .28);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    isolation: isolate;
}

.ripro-igmode-dock.is-normal-target .ripro-igmode-float {
    background: linear-gradient(145deg, #2563eb 0%, #7c3aed 58%, #06b6d4 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30), 0 10px 24px rgba(37, 99, 235, .25);
}

.ripro-igmode-float:hover {
    color: #fff;
    transform: translateY(-1px) scale(1.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 14px 31px rgba(255, 83, 44, .36);
    filter: saturate(1.08);
}

.ripro-igmode-dock.is-normal-target .ripro-igmode-float:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .36), 0 14px 31px rgba(37, 99, 235, .34);
}

.ripro-igmode-float:before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, .42);
    pointer-events: none;
}

/* NEW 角标贴在整体卡片右上方，视觉上归属于整个模块 */
.ripro-igmode-new {
    position: absolute;
    right: -10px;
    top: -15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 19px;
    padding: 0 7px;
    border-radius: 999px;
    background: #12e277;
    color: #052e16;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .2px;
    box-shadow: 0 7px 16px rgba(18, 226, 119, .38);
    animation: ripro-igmode-new-pulse 1.7s ease-in-out infinite;
}

.ripro-igmode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 25px;
    margin: 0 auto 5px;
}

.ripro-igmode-text {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: .04em;
    text-shadow: 0 1px 5px rgba(0, 0, 0, .24);
}

@keyframes ripro-igmode-new-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.11); }
}

/* 分类区域：取消独立卡片外观，变成整体模块的下半部分 */
.ripro-igmode-cat-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-height: 286px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.ripro-igmode-cat-panel::-webkit-scrollbar { width: 0; height: 0; }

.ripro-igmode-cat-link {
    display: block;
    width: 100%;
    margin: 0 0 6px;
    padding: 7px 7px;
    border-radius: 13px;
    color: rgba(255, 255, 255, .88) !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .08);
    transition: background .18s ease, transform .18s ease, color .18s ease, border-color .18s ease;
}

.ripro-igmode-cat-link:last-child { margin-bottom: 0; }

.ripro-igmode-cat-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .18);
    transform: translateY(-1px);
}

.ripro-igmode-cat-link.is-active {
    color: #111827 !important;
    background: linear-gradient(135deg, #fef08a, #fb923c);
    border-color: rgba(255, 255, 255, .22);
    box-shadow: 0 8px 18px rgba(251, 146, 60, .22);
}

/* 首页滚动提醒 */
.ripro-igmode-prompt,
.ripro-igmode-prompt * {
    box-sizing: border-box;
}

.ripro-igmode-prompt {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(620px, calc(100vw - 28px));
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 22px;
    background: rgba(17, 24, 39, .88);
    color: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .26);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 28px) scale(.98);
    transition: opacity .24s ease, visibility .24s ease, transform .24s ease;
}

.ripro-igmode-prompt.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

.ripro-igmode-prompt-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff2d75, #ff7a18);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(255, 75, 75, .34);
}

.ripro-igmode-prompt-main {
    flex: 1 1 auto;
    min-width: 0;
}

.ripro-igmode-prompt-main strong {
    display: block;
    margin-bottom: 3px;
    color: #fff;
    font-size: 17px;
    line-height: 1.25;
}

.ripro-igmode-prompt-main span {
    display: block;
    color: rgba(255, 255, 255, .76);
    font-size: 13px;
    line-height: 1.4;
}

.ripro-igmode-prompt-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ripro-igmode-prompt-go,
.ripro-igmode-prompt-later {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
}

.ripro-igmode-prompt-go {
    background: linear-gradient(135deg, #ff2d75, #ff7a18);
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(255, 75, 75, .3);
}

.ripro-igmode-prompt-later {
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .84);
}

.ripro-igmode-prompt-close {
    position: absolute;
    right: 9px;
    top: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .78);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 768px) {
    .ripro-igmode-dock {
        right: 12px;
        top: auto;
        bottom: 112px;
        width: 106px;
        padding: 6px;
        border-radius: 21px;
        transform: none;
    }

    .ripro-igmode-float {
        min-height: 70px;
        border-radius: 16px;
    }

    .ripro-igmode-float:hover {
        transform: translateY(-1px) scale(1.02);
    }

    .ripro-igmode-new {
        right: -8px;
        top: -14px;
    }

    .ripro-igmode-cat-panel {
        max-height: 184px;
    }

    .ripro-igmode-cat-link {
        padding: 6px 6px;
        font-size: 11px;
        border-radius: 12px;
    }

    .ripro-igmode-prompt {
        bottom: 14px;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 13px;
        border-radius: 18px;
    }

    .ripro-igmode-prompt-badge {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .ripro-igmode-prompt-main strong {
        font-size: 15px;
    }

    .ripro-igmode-prompt-main span {
        font-size: 12px;
    }

    .ripro-igmode-prompt-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ripro-igmode-prompt-go,
    .ripro-igmode-prompt-later {
        height: 32px;
        padding: 0 11px;
        font-size: 12px;
    }
}
