/* ==========================================================================
   社交功能：关注作者 / 站内私信
   对应 inc/social/follow.php、inc/social/messages.php、
   template-parts/widgets/author-card.php、page-templates/page-blog.php
   ========================================================================== */

/* ---------- 作者卡：关注按钮 ---------- */
.bk-follow-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: 0 0 auto;
	padding: 4px 12px;
	border: 1px solid #4a6cf7;
	border-radius: 999px;
	background: #4a6cf7;
	color: #fff;
	font-size: 12px;
	line-height: 18px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bk-follow-btn:hover {
	background: #3b5ce0;
	border-color: #3b5ce0;
}

/* 已关注：白底描边，hover 时变成「取消关注」的红调提示 */
.bk-follow-btn.is-following {
	background: #fff;
	color: #6b7280;
	border-color: #d7dced;
}

.bk-follow-btn.is-following:hover {
	background: #fff;
	color: #e5484d;
	border-color: #f6c9cb;
}

.bk-follow-btn.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* 作者卡上的「粉丝 / 关注」数字行 */
.user-social-meta {
	display: flex;
	gap: 14px;
	margin-top: 8px;
	font-size: 12px;
	color: #94a3b8;
}

.user-social-meta a.user-social-link,
.user-social-meta span {
	color: inherit;
	text-decoration: none;
}

.user-social-meta a.user-social-link {
	cursor: pointer;
	transition: color 0.15s ease;
}

.user-social-meta a.user-social-link:hover {
	color: #4a6cf7;
}

.user-social-meta strong {
	color: #4a6cf7;
	font-weight: 600;
}

/* 作者卡名字行：名字 + 关注按钮 */
.user-name-row .bk-follow-btn {
	margin-left: auto;
}

/* ---------- 联系作者：弹窗 ---------- */
.bk-contact-mask {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.45);
}

.bk-contact-modal {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 460px;
	max-height: 86vh;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
	overflow: hidden;
}

.bk-contact-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid #eef1f8;
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
}

.bk-contact-close {
	width: 26px;
	height: 26px;
	border: none;
	background: transparent;
	color: #94a3b8;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	border-radius: 6px;
}

.bk-contact-close:hover {
	background: #f1f5f9;
	color: #475569;
}

.bk-contact-body {
	padding: 16px 18px;
	overflow-y: auto;
}

.bk-contact-hint {
	margin: 0 0 10px;
	font-size: 13px;
	line-height: 1.6;
	color: #64748b;
}

.bk-contact-body textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 110px;
	max-height: 240px;
	padding: 10px 12px;
	border: 1px solid #e2e8f5;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.6;
	font-family: inherit;
	resize: vertical;
}

.bk-contact-body textarea:focus {
	outline: none;
	border-color: #4a6cf7;
	box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
}

.bk-contact-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 18px 16px;
}

.bk-contact-msg {
	font-size: 12px;
	color: #94a3b8;
}

.bk-contact-msg.is-error {
	color: #e5484d;
}

.bk-contact-msg.is-ok {
	color: #16a34a;
}

.bk-contact-send {
	padding: 9px 22px;
	border: none;
	border-radius: 10px;
	background: #4a6cf7;
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}

.bk-contact-send:hover {
	background: #3b5ce0;
}

.bk-contact-send:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ---------- 个人空间：消息（会话列表 + 对话） ---------- */
.bk-msg-layout {
	display: flex;
	min-height: 520px;
	background: #fff;
	border: 1px solid #eef1f8;
	border-radius: 12px;
	overflow: hidden;
}

.bk-msg-side {
	flex: 0 0 196px;
	max-height: 620px;
	overflow-y: auto;
	border-right: 1px solid #eef1f8;
	background: #fcfdff;
}

.bk-msg-side-empty {
	padding: 24px 14px;
	font-size: 12px;
	line-height: 1.7;
	color: #a3aec2;
	text-align: center;
}

.bk-msg-item {
	display: flex;
	gap: 9px;
	padding: 11px 12px;
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid #f4f7fd;
	transition: background 0.15s ease;
}

.bk-msg-item:hover {
	background: #f5f7ff;
}

.bk-msg-item.is-active {
	background: #eef2ff;
}

.bk-msg-item-avatar {
	flex: 0 0 auto;
	line-height: 0;
}

.bk-msg-item-avatar img {
	width: 34px;
	height: 34px;
	border-radius: 50%;
}

.bk-msg-item-main {
	flex: 1 1 auto;
	min-width: 0;
}

.bk-msg-item-top {
	display: flex;
	align-items: center;
	gap: 6px;
}

.bk-msg-item-name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 13px;
	font-weight: 600;
	color: #1f2937;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bk-msg-item-badge {
	flex: 0 0 auto;
	min-width: 16px;
	height: 16px;
	padding: 0 5px;
	box-sizing: border-box;
	border-radius: 999px;
	background: #e5484d;
	color: #fff;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
}

.bk-msg-item-last {
	margin-top: 2px;
	font-size: 12px;
	color: #9aa6ba;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bk-msg-panel {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.bk-msg-panel-head {
	padding: 12px 16px;
	border-bottom: 1px solid #eef1f8;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
}

.bk-msg-body {
	flex: 1 1 auto;
	max-height: 460px;
	padding: 16px;
	overflow-y: auto;
	background: #fafbff;
}

.bk-msg-empty {
	padding: 40px 16px;
	font-size: 13px;
	line-height: 1.8;
	color: #a3aec2;
	text-align: center;
}

.bk-msg-row {
	display: flex;
	margin-bottom: 12px;
}

.bk-msg-row.is-mine {
	justify-content: flex-end;
}

/* 气泡 + 时间戳作为整体，宽度由这一层控制 */
.bk-msg-stack {
	display: flex;
	flex-direction: column;
	min-width: 0;
	max-width: 76%;
}

.bk-msg-row.is-mine .bk-msg-stack {
	align-items: flex-end;
}

.bk-msg-bubble {
	max-width: 100%;
	padding: 8px 12px;
	border: 1px solid #eef1f8;
	border-radius: 12px;
	background: #fff;
	color: #1f2937;
	font-size: 13px;
	line-height: 1.65;
	word-break: break-word;
}

.bk-msg-row.is-mine .bk-msg-bubble {
	background: #4a6cf7;
	border-color: #4a6cf7;
	color: #fff;
}

.bk-msg-stamp {
	margin-top: 4px;
	font-size: 11px;
	color: #b6c0d3;
}

.bk-msg-row.is-mine .bk-msg-stamp {
	text-align: right;
}

.bk-msg-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #eef1f8;
}

.bk-msg-form textarea {
	flex: 1 1 auto;
	box-sizing: border-box;
	min-height: 44px;
	max-height: 130px;
	padding: 10px 12px;
	border: 1px solid #e2e8f5;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.6;
	font-family: inherit;
	resize: vertical;
}

.bk-msg-form textarea:focus {
	outline: none;
	border-color: #4a6cf7;
	box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
}

.bk-msg-send {
	padding: 10px 18px;
	border: none;
	border-radius: 10px;
	background: #4a6cf7;
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}

.bk-msg-send:hover {
	background: #3b5ce0;
}

.bk-msg-send:disabled {
	opacity: 0.6;
	cursor: default;
}

@media (max-width: 700px) {
	.bk-msg-layout {
		flex-direction: column;
		min-height: 0;
	}

	.bk-msg-side {
		flex: 0 0 auto;
		max-height: 190px;
		border-right: none;
		border-bottom: 1px solid #eef1f8;
	}

	.bk-msg-body {
		max-height: 320px;
	}

	.bk-msg-stack {
		max-width: 88%;
	}
}

/* ---------- 密码过期页：关注 / 联系作者按钮组 ---------- */
.bk-password-social-actions {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 14px;
}

.bk-contact-btn {
	padding: 4px 12px;
	border: 1px solid #d7dced;
	border-radius: 999px;
	background: #fff;
	color: #4a6cf7;
	font-size: 12px;
	line-height: 18px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.bk-contact-btn:hover {
	background: #f5f7ff;
	border-color: #4a6cf7;
}

/* ---------- 个人空间导航上的未读消息角标 ---------- */
.bk-msg-nav-badge {
	display: inline-block;
	min-width: 16px;
	height: 16px;
	padding: 0 5px;
	margin-left: 4px;
	box-sizing: border-box;
	border-radius: 999px;
	background: #e5484d;
	color: #fff;
	font-size: 10px;
	line-height: 16px;
	text-align: center;
}

/* ---------- 关注 Tab：粉丝 / 关注 列表 ---------- */
.bk-follow-tabs {
	display: flex;
	gap: 8px;
	padding: 0 0 14px;
}

.bk-follow-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid #e8f0ff;
	border-radius: 999px;
	background: #fff;
	color: #4a6cf7;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
}

.bk-follow-tab.is-active {
	background: linear-gradient(135deg, #4a6cf7 0%, #6366f1 100%);
	border-color: transparent;
	color: #fff;
}

.bk-follow-tab-num {
	font-weight: 600;
}

.bk-follow-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bk-follow-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #eef1f8;
	border-radius: 12px;
}

.bk-follow-avatar {
	flex: 0 0 auto;
	line-height: 0;
}

.bk-follow-avatar img {
	width: 42px;
	height: 42px;
	border-radius: 50%;
}

.bk-follow-main {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.bk-follow-name {
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
}

.bk-follow-bio {
	font-size: 12px;
	color: #9aa6ba;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bk-follow-actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
}

.bk-follow-empty {
	padding: 40px 16px;
	background: #fff;
	border: 1px solid #eef1f8;
	border-radius: 12px;
	font-size: 13px;
	color: #a3aec2;
	text-align: center;
}

@media (max-width: 700px) {
	.bk-follow-row {
		flex-wrap: wrap;
	}

	.bk-follow-actions {
		justify-content: flex-end;
		width: 100%;
	}
}

