html, body.image-post-body {
    margin: 0;
    padding: 0;
    background: #0a0a0a;
    overflow-x: hidden;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ip-viewer {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 12px 0;
    box-sizing: border-box;
}

.ip-viewer__backdrop {
    position: fixed;
    inset: 0;
    background-color: #0a0a0a;
    background-size: cover;
    background-position: center;
    filter: blur(32px) brightness(0.4);
    transform: scale(1.1);
    z-index: 0;
}

.ip-viewer__stage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.ip-viewer__frame {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    max-width: 420px;
    height: min(100vh - 24px, 860px);
    min-height: 480px;
    background: #111;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.65);
    touch-action: pan-y;
}

.ip-viewer__progress {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 20;
}

.ip-viewer__progress span {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    overflow: hidden;
}

.ip-viewer__progress span i {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
    transition: width 0.1s linear;
}

.ip-viewer__progress span.is-done i { width: 100%; }
.ip-viewer__progress span.is-active i { width: var(--ip-progress, 0%); }

.ip-viewer__header {
    position: absolute;
    top: 22px;
    left: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
    gap: 8px;
}

.ip-viewer__header-left {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.ip-viewer__header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.ip-viewer__share,
.ip-viewer__close {
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    line-height: 36px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ip-viewer__close {
    font-size: 26px;
    line-height: 1;
}

.ip-viewer__slides {
    position: absolute;
    inset: 0;
}

.ip-viewer__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.ip-viewer__slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.ip-viewer__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #111;
}

.ip-viewer__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12;
    padding: 56px 16px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
    pointer-events: none;
}

.ip-viewer__caption-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.ip-viewer__caption-desc {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.ip-viewer__slide--end {
    background: linear-gradient(180deg, #1e1e1e 0%, #121212 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ip-viewer__end {
    padding: 64px 14px 20px;
    color: #fff;
    min-height: 100%;
    box-sizing: border-box;
}

.ip-viewer__end-title {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ip-viewer__end-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ip-viewer__end-item {
    display: block;
    text-decoration: none;
    color: #fff;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.ip-viewer__end-item:hover,
.ip-viewer__end-item:focus {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: #fff;
    text-decoration: none;
}

.ip-viewer__end-item:active {
    transform: translateY(0);
}

.ip-viewer__end-thumb {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #2a2a2a;
}

.ip-viewer__end-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.ip-viewer__end-item:hover .ip-viewer__end-thumb img {
    transform: scale(1.04);
}

.ip-viewer__end-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    display: flex;
    gap: 3px;
}

.ip-viewer__end-badge span {
    flex: 1;
    height: 2px;
    border-top: 2px dashed rgba(255, 255, 255, 0.85);
}

.ip-viewer__end-caption {
    display: block;
    padding: 8px 10px 10px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
}

.ip-viewer__end-empty {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    margin: 0;
}

.ip-viewer__tap {
    position: absolute;
    top: 56px;
    bottom: 120px;
    width: 32%;
    z-index: 15;
}

.ip-viewer__tap--prev { left: 0; }
.ip-viewer__tap--next { right: 0; }

.ip-viewer__nav {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.92);
    color: #1a1a1a;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    z-index: 5;
    padding: 0;
}

.ip-viewer__nav:hover {
    background: #fff;
    transform: scale(1.06);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
}

.ip-viewer__nav:active {
    transform: scale(0.98);
}

.ip-viewer__nav i {
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
}

.ip-viewer__nav--prev i {
    margin-right: 2px;
}

.ip-viewer__nav--next i {
    margin-left: 2px;
}

.ip-viewer__tags {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    padding: 20px 16px 32px;
    border-radius: 12px 12px 0 0;
    margin-top: 8px;
}

.ip-viewer__tags-inner {
    max-width: 720px;
    margin: 0 auto;
}

.ip-viewer__tags-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.ip-viewer__tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ip-viewer__tagcloud a {
    display: inline-block;
    padding: 6px 12px;
    background: #f2f2f2;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
}

.ip-viewer__tagcloud a:hover {
    background: #e31e25;
    color: #fff;
}

@media (max-width: 600px) {
    .ip-viewer {
        padding: 0;
        min-height: 100vh;
        justify-content: flex-start;
    }

    .ip-viewer__stage {
        max-width: 100%;
        gap: 0;
        position: relative;
    }

    .ip-viewer__frame {
        max-width: 100%;
        height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .ip-viewer__nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.88);
        z-index: 25;
    }

    .ip-viewer__nav:hover {
        transform: translateY(-50%) scale(1.05);
    }

    .ip-viewer__nav--prev {
        left: 8px;
    }

    .ip-viewer__nav--next {
        right: 8px;
    }

    .ip-viewer__nav i {
        font-size: 24px;
    }

    .ip-viewer__caption-title {
        font-size: 18px;
    }

    .ip-viewer__caption-desc {
        font-size: 13px;
    }

    .ip-viewer__tap {
        bottom: 110px;
    }

    .ip-viewer__tags {
        border-radius: 0;
        margin-top: 0;
    }
}
