/*
 * OneNav 清爽底部与友链卡片
 * 所有样式均使用 onfb 前缀，避免影响首页其他模块。
 */

.onfb-friend-section,
.onfb-friend-section *,
.widget_onfb_friend_links,
.widget_onfb_friend_links * {
	box-sizing: border-box;
}

.onfb-friend-section {
	width: 100%;
	margin: 18px 0;
	padding: 0;
}

.onfb-friend-section > .container-footer {
	background: transparent !important;
	box-shadow: none !important;
	border: 0 !important;
}

.onfb-friend-card {
	width: 100%;
	min-width: 0;
	padding: 18px 22px;
	border: 1px solid var(--onfb-panel-border);
	border-radius: var(--onfb-friend-radius);
	background: var(--onfb-panel-bg);
	box-shadow: var(--onfb-shadow);
	color: var(--main-color, inherit);
}

.onfb-friend-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 8px;
}

.onfb-friend-heading h3 {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--main-color, inherit);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
}

.onfb-friend-heading h3::before,
.onfb-friend-heading h3::after {
	display: none !important;
	content: none !important;
}

.onfb-friend-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px 14px;
	width: 100%;
	min-width: 0;
}

.onfb-friend-links a {
	position: relative;
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 2px 0;
	color: var(--muted-color, #6b7280);
	font-size: 12px;
	line-height: 1.55;
	text-decoration: none !important;
	white-space: nowrap;
	transition: color .2s ease, transform .2s ease;
}

.onfb-friend-links a:hover {
	color: var(--theme-color, #f1404b);
	transform: translateY(-1px);
}

.onfb-separator-dot .onfb-friend-links a::before {
	content: "•";
	margin-right: 7px;
	color: color-mix(in srgb, var(--muted-color, #6b7280) 72%, transparent);
	font-size: 10px;
}

.onfb-separator-line .onfb-friend-links a:not(:first-child)::before {
	content: "";
	width: 1px;
	height: 11px;
	margin-right: 14px;
	background: var(--onfb-panel-border);
}

.onfb-more-link {
	color: var(--theme-color, #f1404b) !important;
	font-weight: 600;
}

.onfb-friend-widget-card {
	container-type: inline-size;
	padding: 16px;
	box-shadow: none;
}

@container (max-width: 300px) {
	.onfb-friend-widget-card {
		padding: 14px;
	}
	.onfb-friend-widget-card .onfb-friend-links {
		gap: 4px 10px;
	}
}

/* 隐藏 OneNav 大页脚内部自带的友情链接，避免与独立卡片重复。 */
body.onfb-hide-native-friend .main-footer #friendlink {
	display: none !important;
}

/* ---------------- 清爽大页脚 ---------------- */

body.onfb-footer-beauty .main-footer {
	width: 100%;
	margin: 18px 0 0;
	padding: 0 0 22px;
	background: transparent;
}

body.onfb-footer-beauty .main-footer > .container-footer {
	container-type: inline-size;
	overflow: hidden;
	border: 1px solid var(--onfb-panel-border);
	border-radius: var(--onfb-footer-radius);
	background: var(--onfb-panel-bg);
	box-shadow: var(--onfb-shadow);
}

body.onfb-footer-beauty .main-footer .footer.row {
	position: relative;
	display: grid !important;
	/*
	 * 左侧介绍不再无限吞掉剩余空间。
	 * 这样在普通桌面宽度下，中间导航不会被第一列推到最右侧。
	 */
	grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
	align-items: start;
	justify-content: space-between;
	gap: var(--onfb-footer-gap);
	width: 100%;
	margin: 0 !important;
	padding: calc(var(--onfb-footer-padding) + 8px) var(--onfb-footer-padding) 0 !important;
	text-align: left !important;
}

body.onfb-footer-beauty .main-footer .footer.row > [class*="col-"] {
	width: auto !important;
	max-width: none !important;
	flex: none !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: left !important;
}

body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-4 {
	grid-column: 1;
	justify-self: start;
	width: 100% !important;
	max-width: 520px !important;
	min-width: 0;
}

body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-5 {
	grid-column: 2;
	align-self: start;
	width: max-content !important;
	max-width: min(620px, 100%) !important;
	min-width: 0;
	padding-top: 6px !important;
	text-align: center !important;
	transform: translateX(var(--onfb-nav-offset));
}

body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-3 {
	grid-column: 3;
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
	gap: 14px;
	min-width: 170px;
	text-align: right !important;
}

body.onfb-footer-beauty .main-footer .footer-logo {
	display: inline-flex;
	align-items: center;
	max-width: 190px;
}

body.onfb-footer-beauty .main-footer .footer-logo img {
	display: block;
	width: auto;
	max-width: 100%;
	height: 38px;
	object-fit: contain;
}

body.onfb-footer-beauty .main-footer .footer-logo + .text-sm {
	max-width: 500px;
	margin-top: 18px !important;
	color: var(--muted-color, #6b7280);
	font-size: 12px !important;
	line-height: 1.75;
	overflow-wrap: anywhere;
}

body.onfb-footer-beauty .main-footer .footer-social {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin-top: 18px !important;
}

body.onfb-footer-beauty .main-footer .footer-social .social-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0 !important;
	border: 1px solid var(--onfb-panel-border);
	border-radius: 50%;
	background: var(--muted-bg-color, rgba(127,127,127,.08));
	box-shadow: none;
	color: var(--muted-color, #6b7280);
	transition: color .2s ease, transform .2s ease, background .2s ease;
}

body.onfb-footer-beauty .main-footer .footer-social .social-btn:hover {
	color: var(--theme-color, #f1404b);
	background: var(--theme-color-bg, rgba(241,64,75,.08));
	transform: translateY(-2px);
}

body.onfb-footer-beauty .main-footer .footer-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 7px 12px;
	margin: 0 !important;
	padding: 0 !important;
}

body.onfb-footer-beauty .main-footer .footer-links a {
	display: inline-flex;
	align-items: center;
	margin: 0 !important;
	padding: 3px 0 !important;
	color: var(--main-color, inherit);
	font-size: 12px;
	line-height: 1.5;
	text-decoration: none;
	white-space: nowrap;
}

body.onfb-footer-beauty .main-footer .footer-links a:not(:first-child)::before {
	content: "·";
	margin-right: 12px;
	color: var(--muted-color, #8a9199);
}

body.onfb-footer-beauty .main-footer .footer-links a:hover {
	color: var(--theme-color, #f1404b);
}

body.onfb-footer-beauty .main-footer .footer-mini-img {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	width: 76px;
	margin: 0 !important;
	vertical-align: top;
}

body.onfb-footer-beauty .main-footer .footer-mini-img > .bg-l {
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	padding: 4px !important;
	border: 1px solid var(--onfb-panel-border);
	border-radius: 10px !important;
	background: var(--muted-bg-color, rgba(127,127,127,.06)) !important;
}

body.onfb-footer-beauty .main-footer .footer-mini-img img {
	display: block;
	width: 66px;
	height: 66px;
	margin: 0 !important;
	object-fit: contain;
	border-radius: 6px;
}

body.onfb-footer-beauty .main-footer .footer-mini-img > span {
	display: block;
	margin-top: 7px !important;
	color: var(--muted-color, #8a9199);
	font-size: 10px !important;
	line-height: 1.35;
	white-space: nowrap;
}

body.onfb-footer-beauty .main-footer .footer-copyright {
	grid-column: 1 / -1;
	width: 100%;
	margin: 22px 0 0 !important;
	padding: 16px 0 18px !important;
	border-top: 1px solid var(--onfb-panel-border);
	color: var(--muted-color, #7b838c);
	font-size: 11px !important;
	line-height: 1.75;
}

body.onfb-footer-beauty .main-footer .footer-copyright,
body.onfb-footer-beauty .main-footer .footer-copyright p,
body.onfb-footer-beauty .main-footer .footer-copyright div {
	text-align: left !important;
}

body.onfb-copy-center .main-footer .footer-copyright,
body.onfb-copy-center .main-footer .footer-copyright p,
body.onfb-copy-center .main-footer .footer-copyright div {
	text-align: center !important;
}

body.onfb-footer-beauty .main-footer .footer-copyright > :last-child {
	margin-bottom: 0 !important;
}

body.onfb-footer-beauty .main-footer .footer-copyright a {
	color: inherit;
	text-decoration: none;
}

body.onfb-footer-beauty .main-footer .footer-copyright a:hover {
	color: var(--theme-color, #f1404b);
}



/* 1.0.2：页脚导航位置可由后台选择左、中、右。 */
@media (min-width: 992px) {
	body.onfb-nav-center.onfb-footer-beauty .main-footer .footer.row {
		grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
	}

	body.onfb-nav-center.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-5 {
		grid-column: 2;
		justify-self: center;
	}

	body.onfb-nav-center.onfb-footer-beauty .main-footer .footer-links {
		justify-content: center;
		text-align: center;
	}

	body.onfb-nav-left.onfb-footer-beauty .main-footer .footer.row,
	body.onfb-nav-right.onfb-footer-beauty .main-footer .footer.row {
		grid-template-columns: minmax(280px, 520px) minmax(220px, 1fr) auto;
	}

	body.onfb-nav-left.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-5 {
		grid-column: 2;
		justify-self: start;
		text-align: left !important;
	}

	body.onfb-nav-left.onfb-footer-beauty .main-footer .footer-links {
		justify-content: flex-start;
		text-align: left;
	}

	body.onfb-nav-right.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-5 {
		grid-column: 2;
		justify-self: end;
		text-align: right !important;
	}

	body.onfb-nav-right.onfb-footer-beauty .main-footer .footer-links {
		justify-content: flex-end;
		text-align: right;
	}
}

/* 平板 */
@media (min-width: 768px) and (max-width: 991.98px) {
	body.onfb-footer-beauty .main-footer .footer.row {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 24px;
	}

	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-4 {
		grid-column: 1;
	}

	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-5 {
		grid-column: 1;
		grid-row: 2;
		justify-self: start;
		width: 100% !important;
		max-width: 620px !important;
		text-align: left !important;
		transform: none !important;
	}

	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-3 {
		grid-column: 2;
		grid-row: 1 / span 2;
	}

	body.onfb-footer-beauty .main-footer .footer-links {
		justify-content: flex-start;
	}
}

/* 手机 */
@media (max-width: 767.98px) {
	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-5 {
		position: static !important;
		left: auto !important;
		justify-self: stretch !important;
		width: 100% !important;
		max-width: none !important;
		transform: none !important;
	}

	.onfb-friend-section {
		margin: 12px 0;
	}

	.onfb-friend-card {
		padding: 15px 16px;
	}

	.onfb-friend-links {
		gap: 3px 10px;
	}

	.onfb-friend-links a {
		font-size: 11px;
	}

	body.onfb-footer-beauty .main-footer {
		margin-top: 12px;
		padding-bottom: 14px;
	}

	body.onfb-footer-beauty .main-footer .footer.row {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 24px 18px 0 !important;
		text-align: center !important;
	}

	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-4,
	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-5,
	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-3 {
		grid-column: 1;
		grid-row: auto;
		text-align: center !important;
	}

	body.onfb-footer-beauty .main-footer .footer-logo {
		justify-content: center;
	}

	body.onfb-footer-beauty .main-footer .footer-logo + .text-sm {
		margin-right: auto;
		margin-left: auto;
	}

	body.onfb-footer-beauty .main-footer .footer-social,
	body.onfb-footer-beauty .main-footer .footer-links,
	body.onfb-footer-beauty .main-footer .footer.row > .col-12.col-md-3 {
		justify-content: center;
	}

	body.onfb-footer-mobile-compact .main-footer .footer-logo + .text-sm {
		margin-top: 12px !important;
		line-height: 1.65;
	}

	body.onfb-footer-mobile-compact .main-footer .footer-mini-img {
		width: 68px;
	}

	body.onfb-footer-mobile-compact .main-footer .footer-mini-img > .bg-l {
		width: 68px;
		height: 68px;
	}

	body.onfb-footer-mobile-compact .main-footer .footer-mini-img img {
		width: 58px;
		height: 58px;
	}

	body.onfb-footer-beauty .main-footer .footer-copyright,
	body.onfb-footer-beauty .main-footer .footer-copyright p,
	body.onfb-footer-beauty .main-footer .footer-copyright div {
		text-align: center !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.onfb-friend-links a,
	body.onfb-footer-beauty .main-footer .footer-social .social-btn {
		transition: none;
	}
}
