/* 模态框样式 */

/* 图片查看浮层 */
.image-viewer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
    touch-action: none; /* 防止浏览器默认手势 */
}

.image-viewer-modal.active {
    display: flex;
}

.viewer-content {
    max-width: 100vw;
    max-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图片容器 - 支持缩放和拖动 */
.viewer-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.viewer-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: default; /* 允许长按保存 */
}

.viewer-image.zoomed {
    cursor: grab;
}

.viewer-image.dragging {
    cursor: grabbing;
    transition: none;
}

.viewer-image.loading {
    filter: blur(1px);
    opacity: 0.75;
    transition: opacity 0.2s ease-in;
}

.viewer-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-size: 0.85rem;
    z-index: 10002;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.viewer-loading-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    animation: viewer-spin 0.9s linear infinite;
}

.viewer-loading-text {
    letter-spacing: 0.04em;
}

.viewer-mobile-toolbar {
    display: none;
}

.viewer-toolbar-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.viewer-toolbar-btn:active {
    transform: scale(0.96);
}

/* 下载按钮 - 右下角小巧浮动 */
.viewer-download {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.viewer-download:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

.viewer-download svg {
    width: 20px;
    height: 20px;
}

/* 提示文字 - 底部居中 */
.viewer-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    z-index: 10001;
    pointer-events: none;
    animation: fadeIn 0.5s;
}

.viewer-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    line-height: 1;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.viewer-close:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes viewer-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 登录模态框样式 */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.auth-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
