<template>
	<div class="resource-library-section">
		<div class="home-content-footer-header">
			<div class="btn-box">
				<div class="btn" :class="{ btnActive: activeTabName === cate.name, disabled: cate.active === false}"
					v-for="(cate, index) in tabList" :key="index" @click="cate.active === true && handleClickTab(cate)">
					{{ cate.name }}
				</div>
			</div>
		</div>
		<div class="home-content-footer-main" :class="{ 'committee-full-layout': activeTabName === '委员会' }">
			<div class="left" v-if="['国会法案', '国会议员', '议员合作关系'].includes(activeTabName)">
				<div class="select-box">
					<div class="select-box-header">
						<div class="icon"></div>
						<div class="title">科技领域</div>
					</div>
					<div class="select-main">
						<el-checkbox-group class="checkbox-group" v-model="activeAreaList" @change="handleAreaChange">
							<el-checkbox class="filter-checkbox" label="全部领域"> 全部领域 </el-checkbox>
							<el-checkbox v-for="(area, index) in cateKuList" :key="index" :label="area.id" class="filter-checkbox">
								{{ area.name }}
							</el-checkbox>
						</el-checkbox-group>
					</div>
				</div>
				<div class="select-box" v-if="activeTabName !== '议员合作关系'">
					<div class="select-box-header">
						<div class="icon"></div>
						<div class="title">党派</div>
					</div>
					<div class="select-main">
						<el-checkbox-group class="checkbox-group" v-model="activeDpList" @change="handleDpChange">
							<el-checkbox v-for="(dp, index) in dpList" :key="index" :label="dp.id" class="filter-checkbox">
								{{ dp.name }}
							</el-checkbox>
						</el-checkbox-group>
					</div>
				</div>
				<div class="select-box" v-if="activeTabName !== '议员合作关系'">
					<div class="select-box-header">
						<div class="icon"></div>
						<div class="title">议院</div>
					</div>
					<div class="select-main">
						<el-checkbox-group class="checkbox-group" v-model="activeYyList" @change="handleYyChange">
							<el-checkbox v-for="(yy, index) in yyList" :key="index" :label="yy.id" class="filter-checkbox">
								{{ yy.name }}
							</el-checkbox>
						</el-checkbox-group>
					</div>
				</div>
				<div class="select-box" v-if="activeTabName === '国会法案'">
					<div class="select-box-header">
						<div class="icon"></div>
						<div class="title">发布时间</div>
					</div>
					<div class="select-main">
						<el-checkbox-group class="checkbox-group" v-model="activePubTime" @change="handlePubTimeChange">
							<el-checkbox v-for="(time, index) in pubTime" :key="index" :label="time.id" class="filter-checkbox">
								{{ time.name }}
							</el-checkbox>
						</el-checkbox-group>
					</div>
				</div>
				<div class="select-box" v-if="activeTabName === '议员合作关系'">
					<div class="select-box-header">
						<div class="icon"></div>
						<div class="title">合作关系</div>
					</div>
					<div class="select-main">
						<el-checkbox-group class="checkbox-group" v-model="activeCoopList" @change="handleCoopChange">
							<el-checkbox v-for="(coop, index) in coopList" :key="index" :label="coop.id" class="filter-checkbox">
								{{ coop.name }}
							</el-checkbox>
						</el-checkbox-group>
					</div>
				</div>
			</div>
			<div class="right" :class="{ 'right-full': activeTabName === '委员会' }">
				<div class="right-header" v-if="activeTabName !== '委员会'">
					<div class="right-header-box">
						<el-select v-model="footerSelect1" placeholder="选择委员会" style="width: 240px" @change="handleFooterSelect1Change">
							<el-option v-for="item in postOrgList" :key="item.departmentId" :label="item.departmentName" :value="item.departmentId" />
						</el-select>
					</div>
					<template v-if="activeTabName === '国会法案'">
						<div class="right-header-box">
							<el-select v-model="footerSelect2" placeholder="选择提出议员" style="width: 240px" @change="handleFooterSelect2Change">
								<el-option v-for="item in postMemberList" :key="item.memberId" :label="item.memberName" :value="item.memberId" />
							</el-select>
						</div>
						<div class="right-header-box right-header-sort" style="margin-left: auto">
							<el-checkbox v-model="isInvolveCn" true-label="Y" false-label="N" class="involve-checkbox" @change="handleInvolveCnChange">只看涉华法案</el-checkbox>
							<el-select v-model="releaseTime" placeholder="选择排序方式" style="width: 120px" @change="handlePxChange">
								<template #prefix>
									<div style="display: flex; align-items: center; height: 100%">
										<img :src="desc" style="width: 14px; height: 14px" />
									</div>
								</template>
								<el-option v-for="item in releaseTimeList" :key="item.value" :label="item.label" :value="item.value" />
							</el-select>
						</div>
					</template>
				</div>
				<div class="right-main" v-loading="loading">
					<template v-if="activeTabName === '国会法案'">
						<div class="right-main-box" v-for="(item, index) in bills" :key="index">
							<div v-if="item.riskSignal" class="risk-tag" :class="getRiskTagClass(item.riskSignal)">{{ item.riskSignal }}</div>
							<div class="header">
								<div class="title" @click="onClickToDetail(item)" :title="item.name">{{ item.name }}</div>
								<div class="en-title" :title="item.eName">{{ item.eName }}</div>
							</div>
							<div class="main">
								<div class="item"><div class="item-left">提案人：</div><div class="item-right">{{ item.tcr }}</div></div>
								<div class="item"><div class="item-left">委员会：</div><div class="item-right">{{ item.wyh }}</div></div>
								<div class="item"><div class="item-left">相关领域：</div><div class="item-right1"><div class="tag" v-for="(val, idx) in item.areaList" :key="idx">{{ val }}</div></div></div>
								<div class="item"><div class="item-left">最新动议：</div><div class="item-right"><CommonPrompt :content="item.zxdy" /></div></div>
								<div class="item">
									<div class="item-left">法案进展：</div>
									<div class="item-right2">
										<div class="tag" v-for="(val, idx) in [...item.progress].reverse()" :key="idx" :style="{ zIndex: item.progress.length - idx }">{{ val }}</div>
									</div>
								</div>
							</div>
						</div>
						<div class="right-footer">
							<div class="footer-left">{{ `共 ${total} 项` }}</div>
							<div class="footer-right">
								<el-pagination @current-change="handleCurrentChange" :page-size="pageSize" :current-page="currentPage" background layout="prev, pager, next" :total="total" />
							</div>
						</div>
					</template>
					<div v-else-if="activeTabName === '国会议员'">
						<div class="member-grid">
							<div class="member-card" v-for="item in memberList" :key="item.id">
								<div class="member-card-top">
									<div class="member-avatar-wrap">
										<img class="member-avatar" :src="item.avatar || defaultAvatar" alt="avatar" />
										<div class="member-icon-row">
											<img v-if="item.partyIcon" class="member-mini-icon-img" :src="item.partyIcon" alt="party" />
											<img v-if="item.chamberIcon" class="member-mini-icon-img" :src="item.chamberIcon" alt="chamber" />
										</div>
									</div>
									<div class="member-main">
										<div class="member-title-row">
											<div class="member-name">{{ item.name || '-' }}</div>
											<div class="member-link">{{ item.billCountText || '0项提案 >' }}</div>
										</div>
										<div class="member-meta">{{ item.partyText || '-' }} · {{ item.chamberText || '-' }} · {{ item.termText || '-' }}</div>
										<div class="member-committee">{{ item.committeeText || '-' }}</div>
										<div class="member-tags">
											<div class="member-tag" v-for="(tag, idx) in item.focusTags" :key="idx">{{ tag }}</div>
										</div>
									</div>
								</div>
								<div class="member-card-bottom" @click="handleClickLatestProposal(item)">
									<div class="member-latest">最新提案：{{ item.latestProposal || '-' }}</div>
									<div class="member-arrow">></div>
								</div>
							</div>
						</div>
						<div class="right-footer">
							<div class="footer-left">{{ `共 ${memberTotal} 项` }}</div>
							<div class="footer-right">
								<el-pagination @current-change="handleMemberCurrentChange" :page-size="memberPageSize" :current-page="memberCurrentPage" background layout="prev, pager, next" :total="memberTotal" />
							</div>
						</div>
					</div>
					<div v-else-if="activeTabName === '议员合作关系'" class="coop-list">
						<div class="member-card" v-for="item in memberList" :key="`coop-${item.id}`">
							<div class="member-name">{{ item.name || '-' }}</div>
							<div class="member-info">党派：{{ item.party || '-' }}</div>
							<div class="member-info">议院：{{ item.chamber || '-' }}</div>
							<div class="member-info">任期：{{ item.term || '-' }}</div>
							<div class="member-info">委员会：{{ item.committee || '-' }}</div>
							<div class="member-info">关注领域：{{ item.focus || '-' }}</div>
						</div>
					</div>
					<div v-else-if="activeTabName === '委员会'" class="committee-list">
						<div class="committee-card" v-for="item in committeeList" :key="item.id">
							<div class="committee-info">
								<img class="committee-avatar" :src="item.avatar || defaultAvatar" alt="committee-avatar" />
								<div class="committee-text">
									<div class="committee-name">{{ item.name }}</div>
									<div class="committee-desc">{{ item.desc }}</div>
								</div>
							</div>
							<div class="committee-bill-grid">
								<div class="committee-bill-item" v-for="(bill, idx) in item.bills" :key="`${item.id}-bill-${idx}`">
									{{ bill }}
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script setup>
import { onMounted, ref } from "vue";
import { getHylyList, getPostOrgList, getPostMemberList, getBills, getBillsPerson } from "@/api/bill/billHome";
import CommonPrompt from "../commonPrompt/index.vue";
import desc from "./assets/icons/icon-desc.png";
import defaultAvatar from "./assets/images/user.png";
import zyyIcon from "@/assets/icons/zyy.png";
import cyyIcon from "@/assets/icons/cyy.png";
import ghdIcon from "@/assets/icons/ghd.png";
import mzdIcon from "@/assets/icons/mzd.png";

const props = defineProps({
	onClickToDetail: { type: Function, required: true },
	onAfterPageChange: { type: Function, default: null }
});

const tabList = ref([
	{ name: "国会法案", active: true },
	{ name: "国会议员", active: true },
	{ name: "议员合作关系", active: false },
	{ name: "委员会", active: true }
]);
const activeTabName = ref("国会法案");
const handleClickTab = tab => {
	activeTabName.value = tab.name;
	if (tab.name === "国会议员") {
		memberCurrentPage.value = 1;
		handleGetBillsPerson();
		return;
	}
	if (tab.name === "国会法案") {
		currentPage.value = 1;
		handleGetBills();
		return;
	}
	if (tab.name === "委员会") {
		handleGetCommitteeList();
	}
};

const releaseTime = ref(true);
const releaseTimeList = ref([{ label: "正序", value: true }, { label: "倒序", value: false }]);
const isInvolveCn = ref("Y");

const cateKuList = ref([]);
const activeAreaList = ref(["全部领域"]);
const dpList = ref([{ id: "全部党派", name: "全部党派" }, { id: "Democratic", name: "民主党" }, { id: "Republican", name: "共和党" }]);
const activeDpList = ref(["全部党派"]);
const yyList = ref([{ id: "全部议院", name: "全部议院" }, { id: "S", name: "参议院" }, { id: "H", name: "众议院" }]);
const activeYyList = ref(["全部议院"]);
const pubTime = ref([{ id: "全部时间", name: "全部时间" }, { id: "2025", name: "2025年" }, { id: "2024", name: "2024年" }, { id: "2023", name: "2023年" }, { id: "2022", name: "2022年" }, { id: "2021", name: "2021年" }]);
const activePubTime = ref(["全部时间"]);
const coopList = ref([
	{ id: "全部合作关系", name: "全部合作关系" },
	{ id: "跨党派合作", name: "跨党派合作" },
	{ id: "同党派合作", name: "同党派合作" },
	{ id: "地域利益合作", name: "地域利益合作" },
	{ id: "委员会内合作", name: "委员会内合作" }
]);
const activeCoopList = ref(["全部合作关系"]);

const footerSelect1 = ref("全部委员会");
const footerSelect2 = ref("全部提出议员");
const postOrgList = ref([{ departmentName: "全部委员会", departmentId: "全部委员会" }]);
const postMemberList = ref([{ memberName: "全部提出议员", memberId: "全部提出议员" }]);
const memberList = ref([]);
const memberTotal = ref(0);
const memberPageSize = ref(15);
const memberCurrentPage = ref(1);

const committeeList = ref([
	{
		id: "committee-1",
		avatar: "",
		name: "美中经济与安全审查委员会",
		desc: "聚焦中美经贸、科技与国家安全议题，跟踪涉华政策与立法动态。",
		bills: ["2025年涉华关键技术审查法案", "供应链安全与关键矿产保障法案", "对华投资限制与透明度加强法案", "联邦科研合作安全审查法案"]
	},
	{
		id: "committee-2",
		avatar: "",
		name: "众议院外交事务委员会",
		desc: "负责对外政策与国际关系立法，持续推进对华议题相关审议与听证。",
		bills: ["印太战略资源配置法案", "对外援助合规与问责法案", "跨境数据安全与执法协作法案", "关键基础设施网络韧性法案"]
	},
	{
		id: "committee-3",
		avatar: "",
		name: "参议院军事委员会",
		desc: "围绕国防授权、军费及安全合作展开审查，关注涉华国防与技术议题。",
		bills: ["国防授权法涉华条款（示例）", "先进半导体供应安全法案", "军民两用技术出口管制法案", "海外关键设施安全评估法案"]
	}
]);

const bills = ref([]);
const total = ref(0);
const pageSize = ref(4);
const currentPage = ref(1);
const loading = ref(false);
const abortController = ref(null);

const getRiskTagClass = riskSignal => {
	if (riskSignal === "特别重大风险") return "risk-tag-critical";
	if (riskSignal === "重大风险") return "risk-tag-high";
	if (riskSignal === "较大风险") return "risk-tag-medium";
	return "";
};

// 获取委员会列表（占位）
const handleGetCommitteeList = async () => {
	loading.value = true;
	try {
		// TODO: 接入委员会列表接口后，在此替换为真实请求并赋值 committeeList
		// const res = await getCommitteeList(params);
		// committeeList.value = res?.data?.content || [];
	} catch (error) {
		committeeList.value = [];
	} finally {
		loading.value = false;
	}
};

const handleGetHylyList = async () => {
	try {
		const res = await getHylyList();
		cateKuList.value = res.data || [];
	} catch (error) {}
};

const handleGetPostOrgList = async () => {
	try {
		const res = await getPostOrgList();
		if (res.code === 200) {
			const list = (res.data || []).filter(item => item.departmentId);
			postOrgList.value = [{ departmentName: "全部委员会", departmentId: "全部委员会" }, ...list];
		}
	} catch (error) {}
};

const handleGetPostMemberList = async () => {
	try {
		const res = await getPostMemberList();
		if (res.code === 200) {
			const list = (res.data || []).filter(item => item.memberId);
			postMemberList.value = [{ memberName: "全部提出议员", memberId: "全部提出议员" }, ...list];
		}
	} catch (error) {}
};

// 获取资源库法案列表
const handleGetBills = async () => {
	if (abortController.value) abortController.value.abort();
	abortController.value = new AbortController();
	loading.value = true;

	const params = {
		currentPage: currentPage.value,
		pageSize: pageSize.value,
		isInvolveCn: isInvolveCn.value
	};

	if (!activeYyList.value.includes("全部议院")) params.congressIds = activeYyList.value.join(",");
	if (footerSelect1.value !== "全部委员会") params.departmentId = footerSelect1.value;
	if (!activeDpList.value.includes("全部党派")) params.partyIds = activeDpList.value.join(",");
	if (footerSelect2.value !== "全部提出议员") params.personId = footerSelect2.value;
	if (!activeAreaList.value.includes("全部领域")) params.researchIds = activeAreaList.value.join(",");
	if (releaseTime.value !== true) params.sortFun = releaseTime.value;
	if (!activePubTime.value.includes("全部时间")) params.years = activePubTime.value.join(",");

	try {
		const res = await getBills(params, abortController.value.signal);
		if (res.code === 200 && res.data && res.data.content) {
			bills.value = res.data.content.map(item => ({
				billId: item.billId,
				name: item.billName,
				eName: item.billNameEn,
				tcr: item.personName,
				wyh: item.congressName,
				areaList: item.hylyList || [],
				zxdy: item.latestAction,
				progress: item.stageList || [],
				riskSignal: item.riskSignal || ""
			}));
			total.value = res.data.totalElements;
		} else {
			bills.value = [];
			total.value = 0;
		}
	} catch (error) {
		if (error.name !== "AbortError") {
			bills.value = [];
			total.value = 0;
		}
	} finally {
		loading.value = false;
	}
};

// 获取资源库国会议员列表
const handleGetBillsPerson = async () => {
	if (abortController.value) abortController.value.abort();
	abortController.value = new AbortController();
	loading.value = true;

	const params = {
		currentPage: memberCurrentPage.value,
		pageSize: memberPageSize.value
	};

	if (footerSelect1.value !== "全部委员会") params.committeeId = footerSelect1.value;
	if (!activeYyList.value.includes("全部议院")) params.congressIds = activeYyList.value;
	if (!activeDpList.value.includes("全部党派")) params.partyIds = activeDpList.value;
	if (!activeAreaList.value.includes("全部领域")) params.domainIds = activeAreaList.value;

	const formatDateYm = dateStr => {
		if (!dateStr) return "";
		const date = String(dateStr).slice(0, 10);
		const parts = date.split("-");
		if (parts.length < 2) return dateStr;
		return `${parts[0]}.${parts[1]}`;
	};

	try {
		const res = await getBillsPerson(params, abortController.value.signal);
		if (res.code === 200 && res.data && res.data.content) {
			memberList.value = res.data.content.map(item => {
				const partyMap = { Democratic: "民主党", Republican: "共和党" };
				const partyText = partyMap[item.partyId] || item.partyId || "-";
				const chamberText = item.congressType || "-";
				const start = formatDateYm(item.startTime);
				const end = formatDateYm(item.endTime);
				const termText = start || end ? `${start}${end ? `-${end}` : ""}` : "-";
				const focusTags = (item.domainNames || []).slice(0, 3);
				const proposalSize = Number(item.proposalSize || 0);
				const partyIcon = item.partyId === "Democratic" ? mzdIcon : item.partyId === "Republican" ? ghdIcon : "";
				const chamberIcon = chamberText === "众议院" ? zyyIcon : chamberText === "参议院" ? cyyIcon : "";
				return {
					id: item.id,
					name: item.name || "-",
					avatar: item.imageUrl || "",
					partyIcon,
					chamberIcon,
					billCountText: `${proposalSize.toLocaleString()}项提案 >`,
					partyText,
					chamberText,
					termText,
					committeeText: item.position || "-",
					focusTags,
					latestProposal: item.latestBillInfo?.billName || "-",
					latestProposalBillId: item.latestBillInfo?.billId || "",
					party: item.partyId,
					chamber: item.congressType,
					term: `${item.startTime || ""}${item.endTime ? ` 至 ${item.endTime}` : ""}`,
					committee: item.position,
					focus: (item.domainNames || []).join("、")
				};
			});
			memberTotal.value = res.data.totalElements || 0;
		} else {
			memberList.value = [];
			memberTotal.value = 0;
		}
	} catch (error) {
		if (error.name !== "AbortError") {
			memberList.value = [];
			memberTotal.value = 0;
		}
	} finally {
		loading.value = false;
	}
};

const normalizeWithAll = (val, allLabel, targetRef) => {
	if (val.includes(allLabel) && val.length > 1) {
		targetRef.value = val[val.length - 1] === allLabel ? [allLabel] : val.filter(item => item !== allLabel);
	} else if (val.length === 0) {
		targetRef.value = [allLabel];
	} else {
		targetRef.value = val;
	}
	currentPage.value = 1;
	memberCurrentPage.value = 1;
	if (activeTabName.value === "国会议员") {
		handleGetBillsPerson();
		return;
	}
	handleGetBills();
};

const handleAreaChange = val => normalizeWithAll(val, "全部领域", activeAreaList);
const handleDpChange = val => normalizeWithAll(val, "全部党派", activeDpList);
const handleYyChange = val => normalizeWithAll(val, "全部议院", activeYyList);
const handlePubTimeChange = val => normalizeWithAll(val, "全部时间", activePubTime);
const handleCoopChange = val => normalizeWithAll(val, "全部合作关系", activeCoopList);

const handleFooterSelect1Change = val => {
	footerSelect1.value = val;
	currentPage.value = 1;
	memberCurrentPage.value = 1;
	if (activeTabName.value === "国会议员") {
		handleGetBillsPerson();
		return;
	}
	handleGetBills();
};
const handleFooterSelect2Change = val => {
	footerSelect2.value = val;
	currentPage.value = 1;
	handleGetBills();
};
const handlePxChange = val => {
	releaseTime.value = val;
	currentPage.value = 1;
	handleGetBills();
};
const handleInvolveCnChange = val => {
	isInvolveCn.value = val;
	currentPage.value = 1;
	handleGetBills();
};

const handleCurrentChange = page => {
	currentPage.value = page;
	handleGetBills();
	props.onAfterPageChange && props.onAfterPageChange();
};

const handleClickLatestProposal = item => {
	if (!item?.latestProposalBillId) return;
	props.onClickToDetail({
		billId: item.latestProposalBillId,
		name: item.latestProposal
	});
};

const handleMemberCurrentChange = page => {
	memberCurrentPage.value = page;
	handleGetBillsPerson();
	props.onAfterPageChange && props.onAfterPageChange();
};

onMounted(() => {
	handleGetHylyList();
	handleGetPostOrgList();
	handleGetPostMemberList();
	handleGetBills();
});
</script>

<style lang="scss" scoped>
.home-content-footer-header {
	width: 1600px;
	margin: 0 auto;
	margin-top: 37px;
	margin-bottom: 36px;
	height: 42px;
	display: flex;
	justify-content: space-between;

	.btn-box {
		display: flex;
		gap: 24px;
		width: 1000px;

		.btn {
			height: 42px;
			line-height: 42px;
			padding: 0 20px;
			color: rgba(59, 65, 75, 1);
			font-family: Microsoft YaHei;
			font-size: 20px;
			font-weight: 400;
			border-radius: 21px;
			cursor: pointer;

			&:hover {
				background: rgba(20, 89, 187, 0.1);
			}
		}

		.btnActive {
			background: var(--color-main-active);
			color: #fff;
			font-weight: 700;

			&:hover {
				color: #fff;
				background: var(--color-main-active);
			}
		}

		.disabled {
			cursor: not-allowed;
			opacity: 0.5;

			&:hover {
				background: transparent;
			}
		}
	}
}

.home-content-footer-main {
	width: 1600px;
	height: 1401px;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;

	&.committee-full-layout {
		.right {
			margin-left: 0;
			width: 1600px;

			.right-main {
				height: auto;
			}
		}
	}

	.left {
		width: 300px;
		padding-bottom: 33px;
		box-sizing: border-box;
		border: 1px solid rgba(234, 236, 238, 1);
		border-radius: 10px;
		box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
		background: rgba(255, 255, 255, 1);

		.select-box {
			margin-top: 20px;

			.select-box-header {
				display: flex;
				gap: 17px;

				.icon {
					margin-top: 4px;
					width: 8px;
					height: 16px;
					background: var(--color-main-active);
					border-radius: 0 4px 4px 0;
				}

				.title {
					color: var(--color-main-active);
					font-family: Microsoft YaHei;
					font-size: 20px;
					font-weight: 700;
					line-height: 26px;
					letter-spacing: 1px;
					text-align: left;
				}
			}

			.select-main {
				margin-left: 25px;
				margin-top: 16px;

				.checkbox-group {
					display: flex;
					flex-wrap: wrap;

					.filter-checkbox {
						width: 50%;
						margin-right: 0;
						margin-bottom: 4px;

						:deep(.el-checkbox__label) {
							color: rgb(95, 101, 108);
							font-size: 16px;
							font-weight: 400;
							font-family: "Microsoft YaHei";
							line-height: 24px;
						}
					}
				}
			}
		}
	}

	.right {
		margin-left: 20px;
		width: 1280px;

		.right-header {
			height: 48px;
			display: flex;
			gap: 18px;

			.right-header-sort {
				display: flex;
				align-items: center;
				gap: 20px;
			}

			.involve-checkbox {
				height: 40px;
				display: inline-flex;
				align-items: center;
				margin-right: 0;

				:deep(.el-checkbox__inner) {
					width: 18px;
					height: 18px;
					border-radius: 5px;
				}

				:deep(.el-checkbox__input.is-checked .el-checkbox__inner) {
					background-color: #1677ff;
					border-color: #1677ff;
				}

				:deep(.el-checkbox__inner::after) {
					box-sizing: content-box;
				}

				:deep(.el-checkbox__label) {
					color: #5f656c;
					font-family: "Microsoft YaHei";
					font-size: 16px;
					font-weight: 400;
					line-height: 24px;
					padding-left: 10px;
				}
			}
		}

		.right-main {
			height: 1264px;

			.member-grid,
			.coop-list,
			.committee-list {
				display: grid;
				column-gap: 16px;
				row-gap: 16px;
			}

			.member-grid,
			.coop-list {
				display: grid;
				column-gap: 16px;
				row-gap: 16px;

				.member-card {
					height: 200px;
					padding: 10px 16px 0;
					box-sizing: border-box;
					border-radius: 10px;
					box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
					background: #fff;
					overflow: hidden;
					display: flex;
					flex-direction: column;
					justify-content: space-between;

					.member-card-top {
						display: flex;
						gap: 16px;
					}

					.member-avatar-wrap {
						width: 88px;
						display: flex;
						flex-direction: column;
						align-items: center;
						flex-shrink: 0;
						position: relative;
						/* padding-bottom: 22px; */
						margin-top: 5px;
					}

					.member-avatar {
						width: 88px;
						height: 88px;
						border-radius: 50%;
						object-fit: cover;
					}

					.member-icon-row {
						position: absolute;
						left: 50%;
						bottom: 18px;
						transform: translateX(-50%);
						display: flex;
						gap: 2px;
						align-items: center;
					}

					.member-mini-icon-img {
						width: 16px;
						height: 16px;
						padding: 2px;
						box-sizing: border-box;
						object-fit: contain;
						border-radius: 50%;
						background: #fff;
					}

					.member-main {
						flex: 1;
						min-width: 0;
						padding-top: 2px;
					}

					.member-title-row {
						display: flex;
						align-items: baseline;
						justify-content: space-between;
						align-items: center;
						gap: 8px;
					}

					.member-name {
						color: rgb(59, 65, 75);
						font-family: "Source Han Sans CN";
						font-size: 18px;
						font-weight: 700;
						line-height: 24px;
						white-space: nowrap;
						overflow: hidden;
						text-overflow: ellipsis;
					}

					.member-link {
						flex-shrink: 0;
						color: #1459bb;
						font-size: 16px;
						line-height: 24px;
					}

					.member-meta,
					.member-committee {
						margin-top: 6px;
						color: #5f656c;
						font-size: 16px;
						line-height: 24px;
						font-weight: 400;
						white-space: nowrap;
						overflow: hidden;
						text-overflow: ellipsis;
					}

					.member-tags {
						margin-top: 10px;
						display: flex;
						gap: 8px;
						flex-wrap: wrap;
					}

					.member-tag {
						height: 24px;
						padding: 5px 8px;
						border-radius: 4px;
						background: rgb(231, 243, 255);
						color: rgb(5, 95, 194);
						font-size: 14px;
						font-weight: 400;
						line-height: 14px;
					}

					.member-card-bottom {
						height: 52px;
						margin: 10px -16px 0;
						padding: 0 16px;
						display: flex;
						align-items: center;
						justify-content: space-between;
						border-top: 1px solid #eaeced;
						color: #5f656c;
						font-size: 16px;
						cursor: pointer;

						&:hover {
							background: rgba(20, 89, 187, 0.04);
						}
					}

					.member-latest {
						flex: 1;
						white-space: nowrap;
						overflow: hidden;
						text-overflow: ellipsis;
						padding-right: 8px;
					}

					.member-arrow {
						font-size: 16px;
						line-height: 1;
						color: #5f656c;
					}

					.member-info {
						color: #5f656c;
						font-family: "Microsoft YaHei";
						font-size: 15px;
						font-weight: 400;
						line-height: 28px;
					}
				}
			}

			.member-grid {
				grid-template-columns: repeat(3, 1fr);
			}

			.coop-list {
				grid-template-columns: 1fr;
			}

			.committee-list {
				grid-template-columns: 1fr;

				.committee-card {
					padding: 20px 24px;
					border-radius: 10px;
					box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
					background: #fff;
				}

				.committee-info {
					display: flex;
					gap: 16px;
					align-items: flex-start;
					padding-bottom: 16px;
					border-bottom: 1px solid #eaeced;
				}

				.committee-avatar {
					width: 64px;
					height: 64px;
					border-radius: 50%;
					object-fit: cover;
					flex-shrink: 0;
				}

				.committee-name {
					color: #3b414b;
					font-family: "Microsoft YaHei";
					font-size: 20px;
					font-weight: 700;
					line-height: 28px;
				}

				.committee-desc {
					margin-top: 8px;
					color: #5f656c;
					font-family: "Microsoft YaHei";
					font-size: 16px;
					font-weight: 400;
					line-height: 24px;
				}

				.committee-bill-grid {
					margin-top: 16px;
					display: grid;
					grid-template-columns: repeat(2, minmax(0, 1fr));
					gap: 12px;
				}

				.committee-bill-item {
					height: 48px;
					padding: 0 14px;
					border-radius: 6px;
					background: #f5f8fc;
					color: #3b414b;
					font-family: "Microsoft YaHei";
					font-size: 15px;
					font-weight: 400;
					line-height: 48px;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
			}

			.right-main-box {
				position: relative;
				width: 1280px;
				height: 300px;
				padding-bottom: 24px;
				border-radius: 10px;
				box-shadow: 0px 0px 20px 0px rgba(25, 69, 130, 0.1);
				background: rgba(255, 255, 255, 1);
				margin-bottom: 16px;
				overflow: hidden;

				.risk-tag {
					position: absolute;
					top: 16px;
					right: 40px;
					height: 28px;
					border-radius: 20px;
					display: inline-flex;
					align-items: center;
					gap: 6px;
					padding: 0 10px;
					box-sizing: border-box;
					font-family: "Microsoft YaHei";
					font-size: 14px;
					font-weight: 500;
					line-height: 28px;
					white-space: nowrap;

					&::before {
						content: "";
						width: 5px;
						height: 5px;
						border-radius: 50%;
						background: currentColor;
						flex-shrink: 0;
					}
				}

				.risk-tag-critical {
					background: rgba(206, 79, 81, 0.1);
					color: rgb(206, 79, 81);
				}

				.risk-tag-high {
					background: rgba(255, 149, 77, 0.1);
					color: rgb(255, 149, 77);
				}

				.risk-tag-medium {
					background: rgba(232, 189, 11, 0.1);
					color: rgb(232, 189, 11);
				}

				.header {
					height: 91px;
					width: 1200px;
					margin: 0 auto;
					border-bottom: 1px solid rgba(234, 236, 238, 1);
					padding-top: 19px;

					.title {
						cursor: pointer;
						height: 26px;
						color: rgba(59, 65, 75, 1);
						font-family: Microsoft YaHei;
						font-size: 20px;
						font-weight: 700;
						line-height: 26px;
						letter-spacing: 0px;
						text-align: left;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}

					.en-title {
						margin-top: 8px;
						height: 24px;
						color: rgba(95, 101, 108, 1);
						font-family: Microsoft YaHei;
						font-size: 16px;
						font-weight: 400;
						line-height: 24px;
						letter-spacing: 0px;
						text-align: left;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
				}

				.main {
					width: 1200px;
					margin: 0 auto;
					margin-top: 2px;

					.item {
						margin-top: 12px;
						display: flex;

						.item-left {
							width: 100px;
							color: rgb(59, 65, 75);
							font-family: "Microsoft YaHei";
							font-size: 16px;
							font-weight: 700;
							line-height: 24px;
							letter-spacing: 1px;
							text-align: left;
						}

						.item-right {
							max-width: 1000px;
							margin-left: 10px;
							color: rgba(95, 101, 108, 1);
							font-family: "Microsoft YaHei";
							font-size: 16px;
							font-weight: 400;
							line-height: 24px;
							letter-spacing: 0px;
							text-align: left;
						}

						.item-right1 {
							margin-left: 10px;
							display: flex;
							gap: 8px;

							.tag {
								height: 24px;
								line-height: 24px;
								padding: 0 8px;
								border-radius: 4px;
								background: rgba(231, 243, 255, 1);
								color: var(--color-main-active);
								font-family: "Microsoft YaHei";
								font-size: 14px;
								font-weight: 400;
							}
						}

						.item-right2 {
							margin-left: 10px;
							display: flex;
							align-items: center;

							.tag {
								height: 24px;
								line-height: 22px;
								padding: 0 10px 0 30px;
								background: rgba(255, 255, 255, 1);
								color: rgb(95, 101, 108);
								border-top: 1px solid rgb(234, 236, 238);
								border-bottom: 1px solid rgb(234, 236, 238);
								position: relative;
								margin-left: -10px;
								font-family: "Microsoft YaHei";
								font-size: 14px;
								font-weight: 400;

								&::after {
									content: "";
									position: absolute;
									top: 50%;
									right: -8.485px;
									width: 16.97px;
									height: 16.97px;
									background: inherit;
									border-top: 1px solid rgb(234, 236, 238);
									border-right: 1px solid rgb(234, 236, 238);
									transform: translateY(-50%) rotate(45deg);
									z-index: 1;
									box-shadow: 2px -2px 2px rgba(0, 0, 0, 0.05);
									box-sizing: border-box;
								}

								&:first-child {
									margin-left: 0;
									padding-left: 10px;
									border-left: 1px solid rgb(234, 236, 238);
									border-radius: 4px 0 0 4px;
								}

								&:last-child {
									background: rgb(59, 65, 75);
									color: rgba(255, 255, 255, 1);
									border-color: rgb(59, 65, 75);
									padding-right: 10px;
									border-radius: 0;
									border-right: none;

									&::after {
										display: block;
										border-color: rgb(59, 65, 75);
										box-shadow: none;
									}
								}

								&:first-child:last-child {
									margin-left: 0;
									padding: 0 10px;
									border-radius: 4px 0 0 4px;
									background: rgb(59, 65, 75);
									color: rgba(255, 255, 255, 1);
									border: 1px solid rgb(59, 65, 75);
									border-right: none;
								}
							}
						}
					}
				}
			}
		}

		.right-footer {
			height: 85px;
			display: flex;
			justify-content: space-between;
			box-sizing: border-box;
			padding-top: 12px;

			.footer-left {
				color: rgba(59, 65, 75, 1);
				font-family: "Microsoft YaHei";
				font-size: 16px;
				font-weight: 400;
				line-height: 32px;
			}
		}
	}
}
</style>
