/* ============================================================
   Sakura 主题 - 幻灯片小工具样式
   ============================================================ */

.widget-slideshow {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 320px;
    max-height: 560px;
    border-radius: 16px;
    overflow: hidden;
    background: #0f172a;
    isolation: isolate;
    user-select: none;
    outline: none;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.widget-slideshow:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.widget-slideshow .ss-viewport {
    position: absolute;
    inset: 0;
}

.widget-slideshow .ss-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ---------- 单张幻灯片 ---------- */
.widget-slideshow .ss-slide {
    position: absolute;
    inset: 0;
    display: block;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.03);
    transition: opacity 0.55s ease, transform 0.55s ease, visibility 0.55s;
    will-change: opacity, transform;
}
.widget-slideshow .ss-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 1;
}
.widget-slideshow .ss-slide:hover { color: #fff; text-decoration: none; }

/* ---------- 图片 ---------- */
.widget-slideshow .ss-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 8s linear;
}
.widget-slideshow .ss-slide.is-active .ss-img {
    transform: scale(1.04);
}

.widget-slideshow .ss-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #475569;
    font-size: 4rem;
}

/* ---------- 遮罩 ---------- */
.widget-slideshow .ss-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.92) 0%,
        rgba(15, 23, 42, 0.55) 35%,
        rgba(15, 23, 42, 0.10) 70%,
        rgba(15, 23, 42, 0.35) 100%
    );
}

/* ---------- 内容层 ---------- */
.widget-slideshow .ss-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 720px;
    padding: 32px 40px 36px;
    z-index: 2;
}

.widget-slideshow .ss-tag {
    display: inline-block;
    padding: 3px 12px;
    margin-bottom: 12px;
    background: rgba(37, 99, 235, 0.85);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 14px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.widget-slideshow .ss-title {
    margin: 0 0 8px;
    font-size: clamp(1.2rem, 2.4vw, 2rem);
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget-slideshow .ss-desc {
    margin: 0 0 14px;
    color: rgba(226, 232, 240, 0.92);
    font-size: 0.92rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.widget-slideshow .ss-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 30px;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.widget-slideshow .ss-slide:hover .ss-play {
    background: rgba(37, 99, 235, 0.85);
    border-color: #2563eb;
    transform: translateY(-1px);
}
.widget-slideshow .ss-play-icon {
    font-size: 0.72rem;
    line-height: 1;
}

/* ---------- 左右箭头 ---------- */
.widget-slideshow .ss-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0 0 3px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
    font-family: inherit;
}
.widget-slideshow .ss-prev { left: 16px; }
.widget-slideshow .ss-next { right: 16px; }

.widget-slideshow:hover .ss-arrow { opacity: 1; }
.widget-slideshow .ss-arrow:hover {
    background: #2563eb;
    transform: translateY(-50%) scale(1.06);
}

/* ---------- 指示点 ---------- */
.widget-slideshow .ss-dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}
.widget-slideshow .ss-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    transition: width 0.25s, background 0.25s, border-radius 0.25s;
    font-family: inherit;
}
.widget-slideshow .ss-dot.is-active {
    width: 26px;
    border-radius: 4px;
    background: #fff;
}
.widget-slideshow .ss-dot:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.7);
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
    .widget-slideshow {
        aspect-ratio: 16 / 10;
        min-height: 240px;
        border-radius: 10px;
    }
}
@media (max-width: 640px) {
    .widget-slideshow .ss-content {
        padding: 20px 18px 30px;
    }
    .widget-slideshow .ss-title {
        font-size: 1.05rem;
    }
    .widget-slideshow .ss-desc {
        display: none;
    }
    .widget-slideshow .ss-arrow {
        opacity: 1;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .widget-slideshow .ss-prev { left: 8px; }
    .widget-slideshow .ss-next { right: 8px; }
    .widget-slideshow .ss-dots { bottom: 8px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    .widget-slideshow .ss-slide,
    .widget-slideshow .ss-img,
    .widget-slideshow .ss-play,
    .widget-slideshow .ss-arrow,
    .widget-slideshow .ss-dot {
        transition: none !important;
    }
    .widget-slideshow .ss-slide.is-active .ss-img {
        transform: none;
    }
}