/**
 * 主题: 纸鸢图床ZIH
 * 灯箱
 *
 * @package Zhiyuan_Imgzus
 */

/* ===== 灯箱样式 ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(1.5rem);
    -webkit-backdrop-filter: blur(1.5rem);
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border: 0.0625rem solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-white);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: var(--neon-secondary);
    border-color: var(--neon-secondary);
}

.lightbox-close svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    stroke-width: 2;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 0.0625rem solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-white);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: var(--neon-primary);
    border-color: var(--neon-primary);
    color: var(--bg-deep);
}

.lightbox-nav.prev {
    left: 1.5rem;
}

.lightbox-nav.next {
    right: 1.5rem;
}

.lightbox-nav svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
    stroke-width: 2;
}

.lightbox-image-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4.5rem 2rem 1rem;
    padding-right: 320px;
    position: relative;
    min-height: 0;
}

.lightbox-image-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    position: relative;
}

.lightbox-image {
    max-width: calc(100% - 8rem);
    max-height: calc(100vh - 16rem);
    object-fit: contain;
    border-radius: var(--radius-md);
}

.lightbox-disclaimer {
    flex-shrink: 0;
    max-width: calc(100% - 8rem);
    margin: 0.75rem 0 0;
    padding: 0 1rem;
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--text-white-50);
    text-align: center;
}

.lightbox-loading {
    position: absolute;
    display: none;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.1875rem solid var(--border-light);
    border-top-color: var(--neon-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lightbox-info {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(1.5rem) saturate(200%);
    -webkit-backdrop-filter: blur(1.5rem) saturate(200%);
    border: 0.0625rem solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow:
        0 1.5rem 3rem rgba(0, 0, 0, 0.1),
        0 0 0.75rem rgba(14, 165, 233, 0.08),
        inset 0 0 0 0.0625rem rgba(255, 255, 255, 0.6);
    z-index: 20;
}

.lightbox-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-description {
    color: var(--text-white-60);
    margin-bottom: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-white-50);
}

.lightbox-meta .meta-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-meta .lightbox-original-tag {
    display: inline-block;
    width: auto;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neon-primary);
    background: rgba(14, 165, 233, 0.12);
    border: 0.0625rem solid rgba(14, 165, 233, 0.35);
}

.lightbox-meta .lightbox-fanwork-tag {
    display: inline-block;
    width: auto;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: #a855f7;
    background: rgba(168, 85, 247, 0.12);
    border: 0.0625rem solid rgba(168, 85, 247, 0.35);
}

.lightbox-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.lightbox-actions .action-btn {
    width: auto;
    height: auto;
    padding: 0.5rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    background: rgba(14, 165, 233, 0.1);
    border: 0.0625rem solid rgba(14, 165, 233, 0.3);
    border-radius: var(--radius-md);
    color: var(--neon-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-actions .action-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: var(--neon-primary);
    box-shadow: 0 0 0.625rem rgba(14, 165, 233, 0.2);
}

.lightbox-actions .action-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.copy-dropdown {
    position: relative;
}

.copy-options {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(1rem);
    -webkit-backdrop-filter: blur(1rem);
    border: 0.0625rem solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(5px);
    transition: all 0.2s ease;
    z-index: 10;
}

/* 伪元素填补间隙 */
.copy-dropdown::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 1rem;
    background: transparent;
}

.copy-dropdown:hover .copy-options {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.copy-options button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-white-70);
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.copy-options button:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--neon-primary);
}
