<template>
    <div>
        <div class="headers">
            <div class="headers-left">
                <div class="imgs">
                    <img v-if="enterpriseLogo" :src="enterpriseLogo" alt="企业LOGO" class="enterprise-logo-img" />
                </div>
                <div class="img-right">
                    <div class="name-title">微育科技</div>
                    <div class="right-name">数智科创 · 通达未来 </div>
                </div>
            </div>
            <div class="headers-right">
                <div class="rights">
                  

                    {{ isEdit ? '论文编辑' : '论文添加' }}
                   

                </div>
            </div>
        </div>
        
        <div class="contents">
            <div class="content-left">
                
                <div class="content-lefts">
                    <div class="leftss">

                        

                        <div class="leftss-header">
                            <div>论文信息编辑</div>
                            <div>
                                <el-button size="small" style="background-color: #5165f7;color:white;" @click="btnEdint">保存提交</el-button>
                                <el-button size="small" style="width: 82px;" @click="closeguan">取消</el-button>
                            </div>
                        </div>
                        <div class="table-area">
                            <div class="table-header">
                                <div class="names">
                                    <span class="times">上传凭证｜<span class="namess">上传《产权证书》后可对其进行数据解析，解析结果自动填充</span> </span>
                                </div>
                             
                                
                            </div>
                           <div class="tab-area">
                            <el-table :data="tableData2" border style="width: 97%">
                                <el-table-column prop="date" label="论文文献（扫描件/pdf）" align="center">
                                    <template #default>
                                        <el-upload
                                    action=""
                                    list-type="picture-card"
                                    :http-request="(options) => handleUpload(options, 0)"
                                    :file-list="fileListMap[0]"
                                    :on-preview="handlePictureCardPreview"
                                    :on-remove="(file, fileList) => handleRemove(file, fileList, 0)">
                                    <i class="el-icon-plus"></i>
                                    <div class="shangchuang">上传材料</div>
                                    </el-upload>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="name" label="论文Word文档（选传）" align="center">
                                    <el-upload
                                    action=""
                                    list-type="picture-card"
                                    :http-request="(options) => handleUploadWord(options)"
                                    :on-preview="handlePictureCardPreview"
                                    :on-remove="handleRemoveWord">
                                    <i class="el-icon-plus"></i>
                                    <div class="shangchuang">上传材料</div>
                                    </el-upload>
                                </el-table-column>
                                <el-table-column prop="name" label="收录证明" align="center">
                                    <el-upload
                                    action=""
                                    list-type="picture-card"
                                    :http-request="(options) => handleUpload(options, 1)"
                                    :file-list="fileListMap[1]"
                                    :on-preview="handlePictureCardPreview"
                                    :on-remove="(file, fileList) => handleRemove(file, fileList, 1)">
                                    <i class="el-icon-plus"></i>
                                    <div class="shangchuang">上传材料</div>
                                    </el-upload>
                                </el-table-column>
                            </el-table>
                           </div>
                        </div>
                        
                        <div class="table-area" style="margin-top: 30px;">
                            <div class="table-header">
                                <div>
                                    <span class="times"> 论文信息｜  </span>
                                </div>
                                
                            </div>
                        </div>
                    </div>
                    <div class="content-table">
                       <div class="content-areas">
                         <div class="contents-left">
                           <span style="margin-left: 20px;">论文标题</span>
                         </div>
                         <div class="contents-right">
                            <span style="margin-left: 20px;"><el-input v-model="formData.title" placeholder="请输入论文标题"></el-input></span>
                         </div>
                       </div>
                       <div class="content-areas content-areas2">
                         <div class="contents-left">
                           <span class="table-name">发表日期</span>
                         </div>
                         <div class="contents-right">
                            <div class="rightss rightss1"><span class="table-name">
                                <el-date-picker
                                style="width: 88%;"
                                v-model="formData.publish_date"
                                type="date"
                                value-format="yyyy-MM-dd"
                                placeholder="选择日期">
                                </el-date-picker>  
                            </span></div>
                            
                          
                         </div>
                       </div>
                       <div class="content-areas content-areas2" style="top: 4px;">
                         <div class="contents-left" style="border-top: none;">
                           <span class="table-name">期刊名称</span>
                         </div>
                         <div class="contents-right" style="border: none;">
                            <div class="rightss rightss1" ><span class="table-name">
                                <el-input v-model="formData.journal_name" style="width:88%" placeholder="请输入期刊名称"></el-input>
                            </span></div>
                            <div class="rightss rightss2" style="border-top: none;"><span class="table-name">期刊类型</span></div>
                            <div class="rightss rightss3" ><span class="table-name">
                                <el-select v-model="formData.journal_type" placeholder="请选择" style="width:88%">
                                <el-option
                                v-for="item in journalTypeOptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                            </span></div>
                         </div>
                       </div>
                     
                    
                       <div class="content-areas content-areas2" style="top: 5px;">
                         <div class="contents-left" style="border-top: none;">
                           <span class="table-name">分区</span>
                         </div>
                         <div class="contents-right" style="border: none;">
                            <div class="rightss rightss1" ><span class="table-name">
                                <el-select v-model="formData.partition_level" placeholder="请选择" style="width:88%">
                                <el-option
                                v-for="item in partitionLevelOptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                            </span></div>
                            <div class="rightss rightss2" style="border-top: none;"><span class="table-name">影响因子（IF）</span></div>
                            <div class="rightss rightss3" ><span class="table-name">
                                <el-input v-model="formData.impact_factor" placeholder="请输入" style="width:88%"></el-input>
                            </span></div>
                         </div>
                       </div>
                       <div class="content-areas content-areas2" style="top: 7px;">
                         <div class="contents-left" style="border-top: none;">
                           <span class="table-name">第一作者</span>
                         </div>
                         <div class="contents-right" style="border: none;">
                            <div class="rightss rightss1" ><span class="table-name">
                                <el-input v-model="formData.first_author" style="width:88%" placeholder="请输入第一作者"></el-input>
                            </span></div>
                            <div class="rightss rightss2" style="border-top: none;"><span class="table-name">通信作者</span></div>
                            <div class="rightss rightss3" ><span class="table-name">
                                <el-input v-model="formData.corresponding_author" style="width:88%" placeholder="请输入通信作者"></el-input>
                            </span></div>
                         </div>
                       </div>
                       <div class="content-areas content-areas2" style="top: 8px;">
                         <div class="contents-left">
                           <span style="margin-left: 20px;">其他作者</span>
                         </div>
                         <div class="contents-right">
                            <span style="margin-left: 20px;"> <el-input v-model="formData.other_authors" style="width:88%" placeholder="多个作者用逗号分隔"></el-input></span>
                         </div>
                       </div>
                    </div>
                    
                </div>
             
            </div>
            <div class="content-right">

                <div class="leftss-header right-header">
                    <div class="header-area">
                        <div class="area-name" v-for="(item,index) in listDate" 
                        :key="index"
                        @click="btnNmae(index)"
                        :class="{'active':active ==index}"
                        >
                            {{item.name }}
                        </div>
                      
                    </div>
                    <div> <el-button size="small" style="color:#5165f7;">
                           解析中</el-button>
                    </div>
                </div>
                <div class="right-area">
                    <div class="preview-images" v-if="currentFileList.length > 0">
                        <div class="image-item" v-for="(file, index) in currentFileList" :key="index">
                            <img :src="file.url" alt="预览图" @click="handlePictureCardPreview(file)" />
                        </div>
                    </div>
                    <div class="no-image-tip" v-else>
                        暂无上传图片
                    </div>
                </div>
                <!-- 图片预览对话框 -->
                <el-dialog :visible.sync="dialogVisible">
                    <img width="100%" :src="dialogImageUrl" alt="">
                </el-dialog>

            </div>
        </div>

        <!-- 保存成功对话框 -->
        <el-dialog
            :visible.sync="saveSuccessDialog"
            width="500px"
            :show-close="false"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            class="success-dialog">
            <div class="dialog-content">
                <div class="success-icon">
                    <img src="@/assets/succes.png" alt="成功" class="result-icon-img" />
                </div>
                <div class="success-title">提交保存成功</div>
                <div class="success-message">
                    <div>您提交的数据已保存成功</div>
                    <div>等待管理员审核后生效</div>
                </div>
                <div class="dialog-buttons">
                    <el-button type="primary" class="confirm-btn" @click="closeSuccessDialog">确定</el-button>
                </div>
            </div>
        </el-dialog>

        <!-- 保存失败对话框 -->
        <el-dialog
            :visible.sync="saveFailDialog"
            width="500px"
            :show-close="false"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
            class="fail-dialog">
            <div class="dialog-content">
                <div class="fail-icon">
                    <img src="@/assets/err.png" alt="失败" class="result-icon-img" />
                </div>
                <div class="fail-title">提交保存失败</div>
                <div class="fail-message">
                    <div>{{ errorMessage || '保存失败，请稍后重试' }}</div>
                </div>
                <div class="dialog-buttons">
                    <el-button type="primary" class="confirm-btn" @click="closeFailDialog">确定</el-button>
                </div>
            </div>
        </el-dialog>

    </div>
</template>
<script>
import { save, Details } from '@/api/resource/achievement/paper'
import { getEnterpriseLogo } from '@/utils/auth'
import { images } from '@/api/public'
export default {
    data() {
        return {
            enterpriseLogo: '',
            isEdit: false, // 是否编辑模式
            editId: null, // 编辑的ID
            active: 0,
            listDate: [
                { name: '论文文献' },
                { name: '收录证明' }
            ],
            // 文件列表，按tab分类（0: 论文文献, 1: 收录证明）
            fileListMap: {
                0: [],
                1: []
            },
            dialogVisible: false,
            dialogImageUrl: '',
            value1: "",
            yuanright: 0,
            // 期刊类型选项：1.一般核心,2.北大核心,3.SCI,4.EI,5.其他
            journalTypeOptions: [
                { value: 1, label: '一般核心' },
                { value: 2, label: '北大核心' },
                { value: 3, label: 'SCI' },
                { value: 4, label: 'EI' },
                { value: 5, label: '其他' }
            ],
            // 分区选项：1,2,3,4
            partitionLevelOptions: [
                { value: 1, label: '1区' },
                { value: 2, label: '2区' },
                { value: 3, label: '3区' },
                { value: 4, label: '4区' }
            ],
            // 表单数据
            formData: {
                title: '', // 论文标题
                publish_date: '', // 发表日期
                journal_name: '', // 期刊名称
                journal_type: '', // 期刊类型
                partition_level: '', // 分区
                impact_factor: '', // 影响因子
                first_author: '', // 第一作者
                corresponding_author: '', // 通信作者
                other_authors: '' // 其他作者
            },
            // Word文档URL
            wordFileUrl: '',
            // 保存成功/失败对话框
            saveSuccessDialog: false,
            saveFailDialog: false,
            errorMessage: '',
            tables: [
                {
                    name: '有效'
                },
                {
                    name: '无效'
                },
            ],
            shu: 0,
           
            lastActiveKey: 'headerActiveIndex',
            tableData: [
                {
                    date: "其中",
                    name: "",
                    address: "",
                    children: [
                        { date: "2024", name: "年度审计报告及财务情况说明书", address: "8000" },
                        { date: "2025", name: "年度审计报告及财务情况说明书", address: "7500" },
                      
                    ],
                },
                { date: "其他项目", name: "5000", address: "4000" },
            ],

            tableData2: [
       
            { date: "2025", name: "年度审计报告及财务情况说明书", address: "7500" },]
        }
    },

    created() {
        this.loadEnterpriseLogo()
        // 检查是否编辑模式
        const id = this.$route.query.id
        if (id) {
            this.isEdit = true
            this.editId = id
            this.fetchDetail()
        }
    },

    computed: {
        // 根据当前激活的tab返回对应的文件列表
        currentFileList() {
            return this.fileListMap[this.active] || []
        }
    },

    watch: {

    },

    methods: {
        // 加载企业logo
        loadEnterpriseLogo() {
            const logo = getEnterpriseLogo()
            if (logo) {
                this.enterpriseLogo = logo
            }
        },
        // 获取详情数据（编辑模式）
        async fetchDetail() {
            try {
                const res = await Details(this.editId)
                if (res && res.code === 1 && res.data) {
                    const data = res.data
                    // 回显表单数据
                    this.formData = {
                        title: data.title || '',
                        publish_date: data.publish_date || '',
                        journal_name: data.journal_name || '',
                        journal_type: data.journal_type || '',
                        partition_level: data.partition_level || '',
                        impact_factor: data.impact_factor ? String(data.impact_factor) : '',
                        first_author: data.first_author || '',
                        corresponding_author: data.corresponding_author || '',
                        other_authors: data.other_authors || ''
                    }
                    // 回显 Word 文档 URL
                    this.wordFileUrl = data.word_file_path || ''
                    // 回显论文文献图片
                    if (data.pdf_file_path) {
                        const urls = data.pdf_file_path.split(',').filter(url => url)
                        this.fileListMap[0] = urls.map((url, index) => ({
                            name: `论文文献${index + 1}`,
                            url: url,
                            uid: Date.now() + index
                        }))
                    }
                    // 回显收录证明图片
                    if (data.acceptance_proof_path) {
                        const urls = data.acceptance_proof_path.split(',').filter(url => url)
                        this.fileListMap[1] = urls.map((url, index) => ({
                            name: `收录证明${index + 1}`,
                            url: url,
                            uid: Date.now() + 100 + index
                        }))
                    }
                }
            } catch (error) {
                console.error('获取详情失败:', error)
                this.$message.error('获取详情失败，请稍后重试')
            }
        },
        // 自定义上传方法（论文文献、收录证明）
        async handleUpload(options, tabIndex) {
            const file = options.file
            const formData = new FormData()
            formData.append('image', file)
            
            try {
                const res = await images(formData)
                console.log('上传响应:', res)
                
                let imageUrl = ''
                if (res && res.data) {
                    const data = res.data.data || res.data
                    if (data.fullURL) {
                        imageUrl = data.fullURL
                    } else if (data.host && data.path) {
                        imageUrl = data.host + data.path
                    } else if (data.url) {
                        imageUrl = data.url
                    } else if (typeof data === 'string') {
                        imageUrl = data
                    }
                }
                
                if (imageUrl) {
                    const newFile = {
                        name: file.name,
                        url: imageUrl,
                        uid: Date.now()
                    }
                    this.$set(this.fileListMap, tabIndex, [...this.fileListMap[tabIndex], newFile])
                    this.$message.success('上传成功')
                } else {
                    this.$message.error('上传失败，未获取到图片地址')
                }
            } catch (error) {
                console.error('上传失败:', error)
                this.$message.error('上传失败，请稍后重试')
            }
        },
        // Word文档上传（不在右侧显示，但保存URL）
        async handleUploadWord(options) {
            const file = options.file
            const formData = new FormData()
            formData.append('image', file)
            
            try {
                const res = await images(formData)
                let imageUrl = ''
                if (res && res.data) {
                    const data = res.data.data || res.data
                    if (data.fullURL) {
                        imageUrl = data.fullURL
                    } else if (data.host && data.path) {
                        imageUrl = data.host + data.path
                    } else if (data.url) {
                        imageUrl = data.url
                    } else if (typeof data === 'string') {
                        imageUrl = data
                    }
                }
                if (imageUrl) {
                    this.wordFileUrl = imageUrl
                    this.$message.success('上传成功')
                } else {
                    this.$message.error('上传失败')
                }
            } catch (error) {
                console.error('上传失败:', error)
                this.$message.error('上传失败，请稍后重试')
            }
        },
        // 图片预览
        handlePictureCardPreview(file) {
            this.dialogImageUrl = file.url
            this.dialogVisible = true
        },
        // 删除图片
        handleRemove(file, fileList, tabIndex) {
            this.$set(this.fileListMap, tabIndex, fileList)
        },
        // Word文档删除
        handleRemoveWord() {
            // Word文档删除逻辑
        },
        //取消
        closeguan(){
            this.$router.go('-1')
        },
        btnNmae(e){
            this.active = e
        },
        //切换时效性
        btnYuan(e) {
            this.yuanright = e
        },
        // 保存提交
        async btnEdint() {
            // 验证必填字段
            if (!this.formData.title) {
                this.$message.warning('请输入论文标题')
                return
            }
            if (!this.formData.first_author) {
                this.$message.warning('请输入第一作者')
                return
            }
            if (!this.formData.journal_name) {
                this.$message.warning('请输入期刊名称')
                return
            }

            try {
                // 构建保存数据
                const saveData = {
                    title: this.formData.title,
                    publish_date: this.formData.publish_date || '',
                    journal_name: this.formData.journal_name,
                    journal_type: this.formData.journal_type || null,
                    partition_level: this.formData.partition_level || null,
                    impact_factor: this.formData.impact_factor ? parseFloat(this.formData.impact_factor) : null,
                    first_author: this.formData.first_author,
                    corresponding_author: this.formData.corresponding_author || '',
                    other_authors: this.formData.other_authors || '',
                    // 文件路径
                    pdf_file_path: this.fileListMap[0].length > 0 ? this.fileListMap[0].map(f => f.url).join(',') : '',
                    word_file_path: this.wordFileUrl || '',
                    acceptance_proof_path: this.fileListMap[1].length > 0 ? this.fileListMap[1].map(f => f.url).join(',') : ''
                }

                // 编辑模式带上ID
                if (this.isEdit && this.editId) {
                    saveData.id = this.editId
                }

                console.log('保存数据:', saveData)

                const res = await save(saveData)
                if (res && res.code === 1) {
                    // 保存成功
                    this.saveSuccessDialog = true
                } else {
                    // 保存失败
                    this.errorMessage = res?.msg || '保存失败，请稍后重试'
                    this.saveFailDialog = true
                }
            } catch (error) {
                console.error('保存失败:', error)
                this.errorMessage = '保存失败，请稍后重试'
                this.saveFailDialog = true
            }
        },
        // 关闭成功对话框
        closeSuccessDialog() {
            this.saveSuccessDialog = false
            this.$router.go(-1)
        },
        // 关闭失败对话框
        closeFailDialog() {
            this.saveFailDialog = false
            this.errorMessage = ''
        },
        btnShang() {
            this.$router.push('/annual')
        }

    }
}
</script>
<style>
.el-tooltip__popper.is-dark {
    color: #F04B4B !important;
    background: #FCF1EB !important;
}

.el-tooltip__popper .popper__arrow {
    border-top-color: #FCF1EB !important;
    /* 上方箭头 */
}

.el-tooltip__popper .popper__arrow::after {
    border-top-color: #FCF1EB !important;
}

/* 其他方向的箭头（按需添加） */
.el-tooltip__popper[x-placement^='bottom'] .popper__arrow {
    border-bottom-color: #FCF1EB !important;
}

.el-tooltip__popper[x-placement^='left'] .popper__arrow {
    border-left-color: #FCF1EB !important;
}

.el-tooltip__popper[x-placement^='right'] .popper__arrow {
    border-right-color: #FCF1EB !important;
}
</style>
<style scoped>
.area-name{
margin-left: 30px;
cursor: pointer;
}
.active{
   
    border-bottom: 3px solid #5165f7;
    height: 45px;
}
.header-area{
    display: flex;
    position: relative;
    left: -30px;
}
.rightss3{
    border-right: none;
    border-left: none;
}
.table-name{
    margin-left: 20px;
}
.rightss2{
    background: #EDEFFE;
}
.rightss1{
    border-left: none !important;
    border-right: none !important;
   
}
.rightss{
    height: 100%;
    border: 1px solid #DCE0FD;
    width: 100%;
    border-top: none;

}
.content-areas2{
    position: relative;
    top: 1px;

}
.contents-right{
    flex: 1;
    border: 1px solid #DCE0FD;
    line-height: 50px;
    font-size: 14px;
    color: #363636;
    display: flex
}
.contents-left{
    width: 30%;
    border: 1px solid #DCE0FD;
    background: #EDEFFE;;
    line-height: 50px;
    font-size: 14px;
    color: #363636;
    
}
.content-areas{
    display: flex;
    height: 50px;
    flex-wrap: wrap;
}
.tab-area{
    margin-top: 24px;
}
.namess{
    color: #5B5E72;
    font-size: 13px;
    margin-left: 12px;
}
.names{
    font-size: 14px;
    color: #363636;
}
:deep .el-tooltip__popper.is-dark {
    color: #F04B4B !important;
}

.right-area {
    width: 90%;
    margin: 0 auto;
    height: 80vh;
    background: #f8f8f8;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
}

.image-item {
    width: 200px;
    height: 200px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
}

.image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #5165f7;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}

.no-image-tip {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 14px;
}

.right-header {
    width: 90%;
    margin: 0 auto;
}

.ths {
    text-align: center;
    background: #DCE0FD !important;
    color: #363636;
}

.tou {
    height: 30px;
    line-height: 30px;
    color: #606266;
    text-align: center;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.financial-table th,
.financial-table td {
    border: 1px solid #ddd;
    padding: 8px 7px;
    text-align: center;
}

.financial-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.financial-table .nested-label {
   
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
}

.table-right {
    flex: 1;
}

.table-left {
    flex: 1;
}

.content-table {
   
    width: 90%;
    margin: 0 auto;
    margin-top: 14px;
}

/* 默认情况（有效）左边圆角 */
.left-radius {
    border-bottom-left-radius: 16px !important;
    border-top-left-radius: 16px !important;
}

/* 无效情况右边圆角 */
.right-radius {
    border-bottom-right-radius: 16px !important;
    border-top-right-radius: 16px !important;
}

.yuan-left {
    flex: 1;
    text-align: center;
    line-height: 30px;
    background: #f8f8f8;
    /* border-bottom-left-radius: 16px;
    border-top-left-radius: 16px; */
    cursor: pointer;
}

.yuanright {
    flex: 1;
    background: #5165f7;
    color: white;

    /* border-bottom-right-radius: 16px;
    border-top-right-radius: 16px;  */
    text-align: center;
    line-height: 30px;
    cursor: pointer;

}

.youxiaos {
    position: relative;
    top: 6px;
    left: -12px;
    cursor: pointer;
}

/* 修改.yuan的样式，移除外层圆角 */
.yuan {
    width: 100px;
    height: 30px;
    background: white;
    display: flex;
    font-size: 14px;
    overflow: hidden;
    /* 关键：确保内部div的圆角效果不被截断 */
}

/* 默认状态下两个按钮的外侧圆角 */
.yuan-left:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.yuan-left:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* 选中状态样式 */
.yuanright {
    background: #5165f7;
    color: white;
}

/* 选中"有效"时的样式 */
.yuan-left.left-radius {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* 选中"无效"时的样式 */
.yuan-left.right-radius {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}


.times {
    position: relative;
    top: 3px;
}

.youxiao {
    color: #5B5D76;
    font-size: 13px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
}

.table-area {
    margin-top: 12px;
    font-size: 15px;
}

.leftss-header {
    display: flex;
    height: 60px;
    line-height: 60px;
    border-bottom: 1px solid #3333;
    font-weight: bold;
    justify-content: space-between;
}

.leftss {
    width: 90%;
    margin: 0 auto;
}

.content-lefts {
    background: white;
    height: 100%;
    width: 100%;
}

.content-left {
    flex: 1;
    height: 100%;
}

.content-right {
    width: 600px;
    height: 100%;
    background: white;
}

.contents {
    width: 100%;
    height: 92vh;
    background: #f8f8f8;
    display: flex;
    margin-top: 6px;
    /* flex-wrap: wrap */
}


.shu{
  width: 10px;
    height: 20px;
    background: #5165f7;
    position: relative;
    top: -24px;
    left: 40%;
}
.active{
    color: #5165f7 !important;
}
.rights-names{
    margin-left: 32px;
    cursor: pointer;
}
.rights{
    width: 96%;
    height: 100%;
    margin: 0 auto;
    line-height: 94px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    left: -27px;
}
.name-title{
    position: relative;
    top: -6px;
    font-weight: bold;
}
.right-name{
    font-size: 12px;
}
.img-right{
    font-size: 14px;
    position: relative;
    top: 40px;
    height: 40px;
    margin-left: 12px;
}
.imgs{
    width: 42px;
    height: 40px;
    border-radius: 6px;
    position: relative;
    top: 26px;
    margin-left: 24px;
    overflow: hidden;
}
.enterprise-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}
.headers-right{
    flex: 1;
    background: white;
  
}
.headers-left{
    width: 222px;
    height: 100%;
    display: flex;
    background: white;
    border-right: 1px solid #EDEFFE;
}
.headers{
  width: 100%;
    height: 90px;
    display: flex
;
    border-bottom: 1px solid #EDEFFE;
}



::v-deep .el-table thead {
    background-color: #DCE0FD !important;
    color: #363636 !important;
    font-weight: bold;
}

::v-deep .el-table__header th {
    background-color: #DCE0FD !important;
    color: #363636 !important;
    font-weight: bold;
}


.patent-container {
      max-width: 1000px;
      margin: 0 auto;
      background: white;
      border-radius: 8px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
      overflow: hidden;
    }
    .patent-header {
      background: linear-gradient(135deg, #6a5acd, #8a7dff);
      color: white;
      padding: 20px 30px;
      text-align: center;
    }
    .patent-header h1 {
      font-size: 24px;
      margin-bottom: 10px;
      font-weight: 600;
    }
    .patent-header p {
      opacity: 0.9;
      font-size: 14px;
    }
    .search-box {
      padding: 15px 30px;
      background-color: #f8f9fa;
      border-bottom: 1px solid #eaeaea;
    }
    .search-box input {
      width: 100%;
      padding: 10px 15px;
      border: 1px solid #ddd;
      border-radius: 4px;
      font-size: 14px;
      transition: border-color 0.3s;
    }
    .search-box input:focus {
      outline: none;
      border-color: #8a7dff;
      box-shadow: 0 0 0 2px rgba(138, 125, 255, 0.2);
    }
    .patent-table {
      width: 100%;
      border-collapse: collapse;
    }
    .patent-table th {
      background-color: #f0e6ff;
      color: #5a4fcf;
      padding: 12px 15px;
      text-align: left;
      font-weight: 600;
      border-bottom: 1px solid #ddd;
    }
    .patent-table td {
      padding: 12px 15px;
      border-bottom: 1px solid #f0f0f0;
      transition: background-color 0.2s;
    }
    .patent-table tr:hover td {
      background-color: #f9f7ff;
    }
    .patent-table tr:last-child td {
      border-bottom: none;
    }
    .status-badge {
      display: inline-block;
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 12px;
      font-weight: 500;
    }
    .status-paid {
      background-color: #e8f5e9;
      color: #2e7d32;
    }
    .patent-footer {
      padding: 15px 30px;
      text-align: center;
      color: #777;
      font-size: 14px;
      border-top: 1px solid #eaeaea;
      background-color: #fafafa;
    }

/* 成功/失败对话框样式 */
.success-dialog ::v-deep .el-dialog,
.fail-dialog ::v-deep .el-dialog {
    border-radius: 8px;
    padding: 0;
}

.success-dialog ::v-deep .el-dialog__body,
.fail-dialog ::v-deep .el-dialog__body {
    padding: 0;
}

.dialog-content {
    padding: 40px 30px 30px;
    text-align: center;
}

.success-icon,
.fail-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.result-icon-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.success-title,
.fail-title {
    font-size: 18px;
    font-weight: 500;
    color: #363636;
    margin-bottom: 20px;
}

.success-message,
.fail-message {
    font-size: 14px;
    color: #606266;
    line-height: 24px;
    margin-bottom: 30px;
}

.dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.confirm-btn {
    background-color: #5165f7;
    border-color: #5165f7;
    color: white;
    padding: 10px 40px;
    border-radius: 4px;
}

.confirm-btn:hover {
    background-color: #4054e6;
    border-color: #4054e6;
}

</style>