/**
 * 项目资产预览样式
 * 符合代码规范：<400行
 * 使用独立前缀 project-asset-preview-，确保面板独立性
 */

/* 预览模态框 */
.project-asset-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.project-asset-preview-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 预览遮罩层 */
.project-asset-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 预览容器 */
.project-asset-preview-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

/* 预览头部 */
.project-asset-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

/* 预览标题 */
.project-asset-preview-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 16px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

/* 预览关闭按钮 */
.project-asset-preview-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    flex-shrink: 0;
}

.project-asset-preview-close:hover {
    background: var(--bg-hover);
    color: var(--text-accent);
}

.project-asset-preview-close:active {
    transform: scale(0.95);
}

/* 预览内容区域 */
.project-asset-preview-content {
    flex: 1;
    position: relative;
    overflow: auto;
    background: var(--bg-tertiary);
}

/* 预览加载状态 */
.project-asset-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    background: var(--bg-tertiary);
    z-index: 10;
}

/* 预览主体 */
.project-asset-preview-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* 预览图片 */
.project-asset-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 预览PDF */
.project-asset-preview-pdf {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

/* 预览错误 */
.project-asset-preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.project-asset-preview-error p {
    margin: 8px 0;
    font-size: 14px;
}

.project-asset-preview-error-message {
    font-size: 12px;
    color: var(--text-muted);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .project-asset-preview-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .project-asset-preview-header {
        padding: 12px 16px;
    }

    .project-asset-preview-title {
        font-size: 14px;
    }

    .project-asset-preview-body {
        padding: 10px;
    }
}

