<template>
	<view class="portal">
		<!-- 固定头部：企业信息 + 扫一扫 / 消息 -->
		<view class="portal-header">
			<view class="portal-header__row">
				<view class="portal-header__left" @tap="goMine">
					<view class="portal-logo">
						<text class="portal-logo__text">H</text>
					</view>
					<view class="portal-header__meta">
						<view class="portal-header__name-row">
							<text class="portal-header__name">{{ enterpriseName }}</text>
							<text class="portal-header__arrow">▼</text>
						</view>
						<view class="portal-header__badge" :class="authBadgeClass">
							<text class="portal-header__badge-text">{{ authBadgeText }}</text>
						</view>
					</view>
				</view>
				<view class="portal-header__actions">
					<view class="portal-header__action" @tap="onScan">
						<text class="portal-header__action-icon">▦</text>
						<text class="portal-header__action-label">扫一扫</text>
					</view>
					<view class="portal-header__action" @tap="goMessages">
						<view class="portal-header__bell-wrap">
							<text class="portal-header__action-icon">🔔</text>
							<view v-if="hasPending" class="portal-header__dot" />
						</view>
						<text class="portal-header__action-label">消息</text>
					</view>
				</view>
			</view>
		</view>

		<scroll-view scroll-y class="portal__scroll" :show-scrollbar="false">
			<view class="portal-body">
				<!-- Banner -->
				<view class="portal-panel portal-panel--banner">
					<view class="portal-banner">
						<view class="portal-banner__copy">
							<text class="portal-banner__title">数智驱动 企业未来</text>
							<text class="portal-banner__desc">一站式中小微企业数智化 (OPC) 服务平台</text>
						</view>
						<view class="portal-banner__art">
							<view class="portal-banner__block portal-banner__block--1" />
							<view class="portal-banner__block portal-banner__block--2" />
							<view class="portal-banner__block portal-banner__block--3" />
							<view class="portal-banner__circle" />
						</view>
					</view>
				</view>

				<!-- 搜索 -->
				<view class="portal-panel portal-panel--search">
					<view class="portal-search">
						<text class="portal-search__icon">🔍</text>
						<input
							class="portal-search__input"
							v-model="keyword"
							placeholder="请输入关键词搜索服务"
							confirm-type="search"
							@confirm="onSearch"
						/>
						<text class="portal-search__btn" @tap="onSearch">搜索</text>
					</view>
				</view>

				<!-- 八宫格服务 -->
				<view class="portal-panel">
					<view class="portal-svc">
						<view
							v-for="(item, idx) in services"
							:key="item.key"
							class="portal-svc__item"
							@tap="onServiceByIndex(idx)"
						>
							<view class="portal-svc__icon" :class="item.iconClass">
								<text class="portal-svc__emoji">{{ item.icon }}</text>
							</view>
							<text class="portal-svc__label">{{ item.label }}</text>
						</view>
					</view>
				</view>

				<!-- 通知公告 -->
				<view class="portal-panel portal-panel--notice">
					<view class="portal-notice">
						<view class="portal-notice__tag">
							<text class="portal-notice__tag-text">通知</text>
							<text class="portal-notice__tag-text">公告</text>
						</view>
						<view class="portal-notice__body">
							<text class="portal-notice__text">{{ noticeText }}</text>
						</view>
						<text class="portal-notice__more" @tap="onMoreNotice">更多 ›</text>
					</view>
				</view>

				<!-- 我的常用 / 热门服务 -->
				<view class="portal-panel">
					<view class="portal-tabs">
						<view
							v-for="(tab, tabIdx) in tabs"
							:key="tab.key"
							class="portal-tabs__item"
							:class="tab.itemClass"
							@tap="switchTabByIndex(tabIdx)"
						>
							<text class="portal-tabs__text" :class="tab.textClass">{{ tab.label }}</text>
						</view>
					</view>
					<view class="portal-fav">
						<view
							v-for="(item, idx) in currentFavList"
							:key="item.key"
							class="portal-fav__card"
							@tap="onFavByIndex(idx)"
						>
							<view class="portal-fav__copy">
								<text class="portal-fav__title">{{ item.title }}</text>
								<text class="portal-fav__desc">{{ item.desc }}</text>
							</view>
							<view class="portal-fav__icon" :style="{ background: item.bg }">
								<text>{{ item.icon }}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 资讯中心 -->
				<view class="portal-panel">
					<view class="portal-news-head">
						<text class="portal-news-head__title">资讯中心</text>
						<text class="portal-news-head__more" @tap="onMoreNews">更多 ›</text>
					</view>
					<view class="portal-news">
						<view
							v-for="(item, idx) in newsList"
							:key="item.key"
							class="portal-news__item"
							@tap="onNewsByIndex(idx)"
						>
							<view class="portal-news__cover" :class="item.coverClass" />
							<view class="portal-news__main">
								<text class="portal-news__title">{{ item.title }}</text>
								<view class="portal-news__meta">
									<text class="portal-news__source">{{ item.source }}</text>
									<text class="portal-news__date">{{ item.date }}</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>

		<FeBottomNav current="home" role="enterprise" />
	</view>
</template>

<script>
import FeBottomNav from '@/packageA/components/FeBottomNav.vue'
import store from '@/common/store.js'
import { showToast } from '@/common/chat-data.js'
import { listMyNotifications } from '@/api/notification.js'
import { mapNotificationPage } from '@/utils/notification.js'

const FAV_COMMON = [
	{ key: 'book', title: '智能记账报税', desc: '一键记账报税', icon: '📒', bg: '#DBEAFE' },
	{ key: 'po', title: '采购订单查询', desc: '实时订单跟踪', icon: '📦', bg: '#D1FAE5' },
	{ key: 'attend', title: '员工考勤管理', desc: '智能考勤统计', icon: '⏱', bg: '#E0E7FF' },
	{ key: 'lead', title: '客户线索跟进', desc: '线索转化分析', icon: '🎯', bg: '#FEF3C7' },
	{ key: 'invoice', title: '发票管理', desc: '电子发票开具', icon: '🧾', bg: '#FCE7F3' },
	{ key: 'stock', title: '库存实时查询', desc: '库存预警提醒', icon: '📊', bg: '#CFFAFE' },
	{ key: 'sales', title: '销售业绩看板', desc: '数据可视化', icon: '📈', bg: '#EDE9FE' },
	{ key: 'policy', title: '政策申报助手', desc: '政策智能匹配', icon: '🏛', bg: '#FEE2E2' }
]

const FAV_HOT = [
	{ key: 'h1', title: '劳务用工方案', desc: '对话生成方案', icon: '🤖', bg: '#DBEAFE' },
	{ key: 'h2', title: '成本测算助手', desc: '一键测算成本', icon: '💰', bg: '#D1FAE5' },
	{ key: 'h3', title: '电子合同签署', desc: '在线确认签署', icon: '📄', bg: '#FEF3C7' },
	{ key: 'h4', title: '用工进度跟踪', desc: '实时查看进度', icon: '📍', bg: '#E0E7FF' },
	{ key: 'h5', title: '结算发薪管理', desc: '透明可追溯', icon: '💳', bg: '#FCE7F3' },
	{ key: 'h6', title: '批次二维码', desc: '扫码快速登记', icon: '▦', bg: '#CFFAFE' },
	{ key: 'h7', title: '消息待办中心', desc: '关键节点提醒', icon: '🔔', bg: '#EDE9FE' },
	{ key: 'h8', title: '企业资料管理', desc: '认证与档案', icon: '🏢', bg: '#FEE2E2' }
]

export default {
	name: 'EnterprisePortalHome',
	components: { FeBottomNav },
	props: {
		active: { type: Boolean, default: true }
	},
	data() {
		return {
			pendingCount: 0,
			keyword: '',
			activeTab: 'common',
			enterpriseName: '游客',
			enterpriseRegistered: false,
			authBadgeText: '未认证',
			authBadgeClass: 'is-warn',
			hasPending: false,
			noticeText: '系统升级通知：浙里办企业服务系统将于 2025-06-15 00:00 进行维护升级，请提前做好安排。',
			services: [
				{ key: 'tax', label: '财税智控', icon: '💼', iconClass: 'portal-svc__icon--1', action: 'toast' },
				{ key: 'supply', label: '供销智采', icon: '🛒', iconClass: 'portal-svc__icon--2', action: 'toast' },
				{ key: 'sale', label: '销售智营', icon: '🏪', iconClass: 'portal-svc__icon--3', action: 'toast' },
				{ key: 'cs', label: '客服智应', icon: '🎧', iconClass: 'portal-svc__icon--4', action: 'toast' },
				{ key: 'labor', label: '劳务智筹', icon: '👷', iconClass: 'portal-svc__icon--5', action: 'chat' },
				{ key: 'opc', label: 'OPC 智助', icon: '🧩', iconClass: 'portal-svc__icon--6', action: 'toast' },
				{ key: 'crm', label: '客户智获', icon: '🤝', iconClass: 'portal-svc__icon--7', action: 'toast' },
				{ key: 'gov', label: '政企智联', icon: '🏛', iconClass: 'portal-svc__icon--8', action: 'toast' }
			],
			tabs: [
				{ key: 'common', label: '我的常用', itemClass: 'is-active', textClass: 'is-active' },
				{ key: 'hot', label: '热门服务', itemClass: '', textClass: '' }
			],
			favCommon: FAV_COMMON,
			favHot: FAV_HOT,
			newsList: [
				{
					key: 'n1',
					title: '数智化转型：企业提升竞争力的核心路径',
					source: '浙里办企业服务',
					date: '06-06',
					coverClass: 'portal-news__cover--a'
				},
				{
					key: 'n2',
					title: '中小微企业数字化转型政策解读',
					source: '浙里办企业服务',
					date: '06-05',
					coverClass: 'portal-news__cover--b'
				}
			]
		}
	},
	computed: {
		currentFavList() {
			return this.activeTab === 'hot' ? this.favHot : this.favCommon
		}
	},
	mounted() {
		if (this.active) this.refreshHome()
	},
	watch: {
		active(val) {
			if (val) this.refreshHome()
		}
	},
	methods: {
		refreshHome() {
			this.syncEnterprise()
			this.loadPendingCount()
		},
		syncEnterprise() {
			const s = store.getState()
			const ent = (s && s.enterprise) || {}
			const registered = !!ent.registered
			this.enterpriseRegistered = registered
			// 与「我的」一致：未企业登记视为游客，不展示缓存/接口里的企业名
			if (!registered) {
				this.enterpriseName = '游客'
				this.authBadgeText = '未认证'
				this.authBadgeClass = 'is-warn'
				return
			}
			this.enterpriseName = ent.name || '未命名企业'
			const status = String(ent.authStatus || '').toLowerCase()
			const ok = status === 'verified' || status === 'approved' || status === 'pass' || status === ''
			// 已登记默认展示已认证；若后端明确非通过态则显示未认证
			if (status && !ok) {
				this.authBadgeText = '未认证'
				this.authBadgeClass = 'is-warn'
			} else {
				this.authBadgeText = '✓ 企业已认证'
				this.authBadgeClass = 'is-ok'
			}
		},
		async loadPendingCount() {
			try {
				const raw = await listMyNotifications({ page: 1, size: 1 }, { showError: false })
				const pageData = mapNotificationPage(raw || {})
				this.pendingCount = pageData.pendingCount || 0
				this.hasPending = this.pendingCount > 0
			} catch (e) {
				this.pendingCount = 0
				this.hasPending = false
			}
		},
		syncTabsMeta() {
			this.tabs = this.tabs.map((t) => {
				const active = t.key === this.activeTab
				return {
					...t,
					itemClass: active ? 'is-active' : '',
					textClass: active ? 'is-active' : ''
				}
			})
		},
		switchTabByIndex(idx) {
			const tab = this.tabs[idx]
			if (!tab || tab.key === this.activeTab) return
			this.activeTab = tab.key
			this.syncTabsMeta()
		},
		onServiceByIndex(idx) {
			const item = this.services[idx]
			if (!item) return
			if (item.action === 'chat') {
				uni.navigateTo({ url: '/packageA/chat/index' })
				return
			}
			showToast(`${item.label}即将上线`)
		},
		onFavByIndex(idx) {
			const list = this.currentFavList
			const item = list[idx]
			if (!item) return
			if (item.key === 'h1') {
				uni.navigateTo({ url: '/packageA/chat/index' })
				return
			}
			showToast(`${item.title}即将上线`)
		},
		onNewsByIndex(idx) {
			const item = this.newsList[idx]
			if (!item) return
			showToast(item.title)
		},
		onSearch() {
			const kw = (this.keyword || '').trim()
			if (!kw) {
				showToast('请输入关键词')
				return
			}
			if (kw.indexOf('劳务') >= 0 || kw.indexOf('用工') >= 0) {
				uni.navigateTo({ url: '/packageA/chat/index' })
				return
			}
			showToast(`暂无「${kw}」相关服务`)
		},
		onScan() {
			showToast('扫一扫即将上线')
		},
		onMoreNotice() {
			showToast('更多公告即将上线')
		},
		onMoreNews() {
			showToast('更多资讯即将上线')
		},
		goMessages() {
			uni.navigateTo({ url: '/packageA/enterprise/messages' })
		},
		goMine() {
			uni.navigateTo({ url: '/packageA/enterprise/mine' })
		}
	}
}
</script>

<style lang="scss" scoped>
.portal {
	height: 100%;
	background: #f3f5f9;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.portal__scroll {
	flex: 1;
	height: 0;
}

.portal-header {
	flex-shrink: 0;
	padding: 16rpx 28rpx 20rpx;
	background: #ffffff;
	border-bottom: 1rpx solid #f3f4f6;
}

.portal-header__row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
}

.portal-header__left {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 16rpx;
	padding-right: 16rpx;
}

.portal-logo {
	width: 72rpx;
	height: 72rpx;
	border-radius: 50%;
	background: linear-gradient(145deg, #3b82f6 0%, #2563eb 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 8rpx 20rpx rgba(37, 99, 235, 0.28);
}

.portal-logo__text {
	font-size: 34rpx;
	font-weight: 800;
	color: #fff;
}

.portal-header__meta {
	flex: 1;
	min-width: 0;
}

.portal-header__name-row {
	display: flex;
	align-items: center;
	gap: 8rpx;
}

.portal-header__name {
	max-width: 360rpx;
	font-size: 30rpx;
	font-weight: 700;
	color: #111827;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.portal-header__arrow {
	font-size: 16rpx;
	color: #9ca3af;
}

.portal-header__badge {
	margin-top: 8rpx;
	display: inline-flex;
	align-items: center;
	padding: 4rpx 12rpx;
	border-radius: 8rpx;
	background: #dbeafe;
}

.portal-header__badge.is-warn {
	background: #fef3c7;
}

.portal-header__badge-text {
	font-size: 20rpx;
	color: #2563eb;
	font-weight: 600;
}

.portal-header__badge.is-warn .portal-header__badge-text {
	color: #d97706;
}

.portal-header__actions {
	display: flex;
	align-items: center;
	gap: 28rpx;
	flex-shrink: 0;
	padding-top: 4rpx;
}

.portal-header__action {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4rpx;
}

.portal-header__bell-wrap {
	position: relative;
}

.portal-header__action-icon {
	font-size: 34rpx;
	line-height: 1;
	color: #374151;
}

.portal-header__action-label {
	font-size: 20rpx;
	color: #6b7280;
}

.portal-header__dot {
	position: absolute;
	top: -2rpx;
	right: -6rpx;
	width: 14rpx;
	height: 14rpx;
	border-radius: 50%;
	background: #ef4444;
	border: 2rpx solid #fff;
}

.portal-body {
	padding: 20rpx 24rpx calc(32rpx + 120rpx + #{$fe-h-safe-bottom});
}

.portal-panel {
	background: #ffffff;
	border-radius: 20rpx;
	padding: 24rpx 20rpx;
	margin-bottom: 20rpx;
	box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.06);
	border: 1rpx solid rgba(226, 232, 240, 0.9);
	box-sizing: border-box;
}

.portal-panel--banner {
	padding: 0;
	overflow: hidden;
	border: none;
	box-shadow: 0 10rpx 28rpx rgba(37, 99, 235, 0.12);
}

.portal-panel--search {
	padding: 16rpx 16rpx;
}

.portal-panel--notice {
	padding: 0;
	overflow: hidden;
	border: none;
	background: transparent;
	box-shadow: none;
}

.portal-banner {
	position: relative;
	height: 220rpx;
	border-radius: 20rpx;
	overflow: hidden;
	padding: 36rpx 32rpx;
	box-sizing: border-box;
	background: linear-gradient(120deg, #e8f2ff 0%, #d6e8ff 45%, #c7dcff 100%);
	margin-bottom: 0;
}

.portal-banner__copy {
	position: relative;
	z-index: 2;
	max-width: 62%;
	display: flex;
	flex-direction: column;
	gap: 12rpx;
}

.portal-banner__title {
	font-size: 40rpx;
	font-weight: 800;
	color: #1d4ed8;
	letter-spacing: 1rpx;
}

.portal-banner__desc {
	font-size: 22rpx;
	color: #374151;
	line-height: 1.45;
}

.portal-banner__art {
	position: absolute;
	right: 24rpx;
	bottom: 20rpx;
	width: 220rpx;
	height: 160rpx;
	z-index: 1;
}

.portal-banner__block {
	position: absolute;
	border-radius: 12rpx;
	background: linear-gradient(145deg, #60a5fa, #2563eb);
	opacity: 0.9;
	box-shadow: 0 10rpx 20rpx rgba(37, 99, 235, 0.25);
}

.portal-banner__block--1 {
	width: 88rpx;
	height: 64rpx;
	right: 40rpx;
	bottom: 56rpx;
	transform: skewX(-12deg);
}

.portal-banner__block--2 {
	width: 56rpx;
	height: 56rpx;
	right: 110rpx;
	bottom: 28rpx;
	background: linear-gradient(145deg, #93c5fd, #3b82f6);
}

.portal-banner__block--3 {
	width: 40rpx;
	height: 72rpx;
	right: 12rpx;
	bottom: 24rpx;
	background: linear-gradient(145deg, #38bdf8, #2563eb);
}

.portal-banner__circle {
	position: absolute;
	right: 72rpx;
	bottom: 100rpx;
	width: 48rpx;
	height: 48rpx;
	border-radius: 50%;
	border: 8rpx solid rgba(59, 130, 246, 0.45);
	box-sizing: border-box;
}

.portal-search {
	height: 80rpx;
	border-radius: 16rpx;
	border: 2rpx solid #e5e7eb;
	background: #f8fafc;
	display: flex;
	align-items: center;
	padding: 0 20rpx 0 24rpx;
	box-sizing: border-box;
	margin-bottom: 0;
}

.portal-search__icon {
	font-size: 28rpx;
	margin-right: 12rpx;
	color: #9ca3af;
}

.portal-search__input {
	flex: 1;
	height: 80rpx;
	font-size: 26rpx;
	color: #111827;
}

.portal-search__btn {
	padding: 0 8rpx 0 16rpx;
	font-size: 28rpx;
	font-weight: 600;
	color: #2563eb;
}

.portal-svc {
	display: flex;
	flex-wrap: wrap;
	margin-bottom: 0;
}

.portal-svc__item {
	width: 25%;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 12rpx;
	padding-top: 8rpx;
}

.portal-svc__item:nth-child(n + 5) {
	margin-bottom: 0;
}

.portal-svc__icon {
	width: 96rpx;
	height: 96rpx;
	border-radius: 28rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12rpx;
	box-shadow: 0 6rpx 16rpx rgba(37, 99, 235, 0.08);
}

.portal-svc__icon--1 { background: #DBEAFE; }
.portal-svc__icon--2 { background: #E0F2FE; }
.portal-svc__icon--3 { background: #E0E7FF; }
.portal-svc__icon--4 { background: #CFFAFE; }
.portal-svc__icon--5 { background: #BFDBFE; }
.portal-svc__icon--6 { background: #EEF2FF; }
.portal-svc__icon--7 { background: #F0F9FF; }
.portal-svc__icon--8 { background: #EDE9FE; }

.portal-svc__emoji {
	font-size: 44rpx;
	line-height: 1;
}

.portal-svc__label {
	font-size: 24rpx;
	color: #1f2937;
	font-weight: 500;
}

.portal-notice {
	display: flex;
	align-items: center;
	gap: 12rpx;
	padding: 18rpx 20rpx;
	border-radius: 20rpx;
	background: #eff6ff;
	margin-bottom: 0;
	box-shadow: 0 8rpx 24rpx rgba(37, 99, 235, 0.08);
	border: 1rpx solid #dbeafe;
	box-sizing: border-box;
}

.portal-notice__tag {
	flex-shrink: 0;
	padding: 6rpx 10rpx;
	border-radius: 8rpx;
	background: #2563eb;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	line-height: 1.15;
}

.portal-notice__tag-text {
	font-size: 20rpx;
	color: #fff;
	font-weight: 600;
}

.portal-notice__body {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.portal-notice__text {
	display: block;
	font-size: 24rpx;
	color: #374151;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.portal-notice__more {
	flex-shrink: 0;
	font-size: 22rpx;
	color: #6b7280;
}

.portal-tabs {
	display: flex;
	align-items: center;
	gap: 40rpx;
	margin-bottom: 20rpx;
	border-bottom: 1rpx solid #f3f4f6;
}

.portal-tabs__item {
	padding-bottom: 14rpx;
	position: relative;
}

.portal-tabs__item.is-active::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 48rpx;
	height: 6rpx;
	border-radius: 6rpx;
	background: #2563eb;
}

.portal-tabs__text {
	font-size: 28rpx;
	color: #6b7280;
	font-weight: 500;
}

.portal-tabs__text.is-active {
	color: #111827;
	font-weight: 700;
}

.portal-fav {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	margin-bottom: 0;
}

.portal-fav__card {
	width: calc(50% - 10rpx);
	min-height: 140rpx;
	margin-bottom: 16rpx;
	padding: 22rpx 20rpx;
	border-radius: 16rpx;
	background: #f8fafc;
	box-shadow: none;
	border: 1rpx solid #eef2f7;
	box-sizing: border-box;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12rpx;
}

.portal-fav__card:nth-last-child(-n + 2) {
	margin-bottom: 0;
}

.portal-fav__copy {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8rpx;
	align-self: flex-start;
}

.portal-fav__title {
	font-size: 26rpx;
	font-weight: 700;
	color: #111827;
}

.portal-fav__desc {
	font-size: 22rpx;
	color: #9ca3af;
}

.portal-fav__icon {
	width: 48rpx;
	height: 48rpx;
	border-radius: 12rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26rpx;
	flex-shrink: 0;
}

.portal-news-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8rpx;
}

.portal-news-head__title {
	font-size: 30rpx;
	font-weight: 700;
	color: #111827;
}

.portal-news-head__more {
	font-size: 24rpx;
	color: #9ca3af;
}

.portal-news__item {
	display: flex;
	align-items: stretch;
	gap: 20rpx;
	padding: 20rpx 0;
	border-bottom: 1rpx solid #f3f4f6;
}

.portal-news__item:last-child {
	border-bottom: none;
	padding-bottom: 4rpx;
}

.portal-news__cover {
	width: 160rpx;
	height: 112rpx;
	border-radius: 12rpx;
	flex-shrink: 0;
}

.portal-news__cover--a {
	background: linear-gradient(135deg, #93c5fd 0%, #1d4ed8 100%);
}

.portal-news__cover--b {
	background: linear-gradient(135deg, #67e8f9 0%, #2563eb 70%, #1e3a8a 100%);
}

.portal-news__main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 4rpx 0;
}

.portal-news__title {
	font-size: 28rpx;
	font-weight: 650;
	color: #111827;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.portal-news__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.portal-news__source,
.portal-news__date {
	font-size: 22rpx;
	color: #9ca3af;
}
</style>
