/* 主容器 */
#bber {
	margin-top: 2rem;
	width: auto !important;
	min-height: 100vh;
	/* 确保容器有足够的内边距 */
	box-sizing: border-box;
}

/* 卡片竖直排列布局 */
.bb-timeline {
	position: relative;
	padding: 0;
	min-height: 100px;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 0 !important;

}

.bb-timeline .memo-item {
	position: relative;
	/* 使用flexbox进行竖直排列 */
	transition: all 0.3s ease;
	opacity: 1;
	width: 100%;
	max-width: 800px;
	margin: 0 auto;
	width: 100% !important;
}

.bb-timeline .bb-item {
	background: #fff;
	border-radius: 12px;
	padding: 0.6rem;
	box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.24), 0 7px 10px 0 rgba(0, 0, 0, 0.19);
	transition: all 0.3s ease;
	border: 1px solid #f0f0f0;
}

.bb-timeline .bb-item:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
	transform: translateY(-2px);
}

/* 内容区域 */
.bb-cont {
	margin-bottom: 0.6rem;
	line-height: 1.5;
}

.bb-cont p {
	margin: 0.3rem 0;
	color: #333;
}

.bb-cont img {
	border-radius: 8px;
	max-width: 100%;
	max-height: 400px;
	height: auto;
	object-fit: cover;
	cursor: pointer;
	transition: transform 0.2s ease;
	/* 添加最小高度避免布局跳跃 */
	min-height: 120px;
	background-color: #f5f5f5;
	/* 图片加载时的占位样式 */
	background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
		linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
		linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
	background-size: 20px 20px;
	background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.bb-cont img:hover {
	transform: scale(1.02);
}

/* 标签样式 */
.tag-span {
	display: inline-block;
	background: #e3f2fd;
	color: #1976d2;
	padding: 0.2rem 0.4rem;
	border-radius: 12px;
	font-size: 0.875rem;
	margin: 0.2rem 0.2rem 0.2rem 0;
	cursor: pointer;
	transition: all 0.2s ease;
}

.tag-span:hover {
	background: #bbdefb;
}

#tag-list {
	margin-top: 1rem;
}

#tag-list .tag-span {
	background: rgba(25, 118, 210, 0.1);
	border: 1px solid #1976d2;
	position: relative;
}

/* 亮色模式特定样式 */
[data-user-color-scheme="light"] .bb-timeline .bb-item {
	background: #fff;
	border-color: #f0f0f0;
	color: #333;
}

[data-user-color-scheme="light"] .bb-cont p {
	color: #333;
}

[data-user-color-scheme="light"] .bb-info {
	color: #666;
}

[data-user-color-scheme="light"] .bb-info a {
	color: #666;
}

[data-user-color-scheme="light"] .bb-tool {
	border-top-color: #f0f0f0;
}

[data-user-color-scheme="light"] .datacount {
	color: #666;
}

[data-user-color-scheme="light"] .datacount:hover {
	color: #1976d2;
}

/* 工具栏 */
.bb-tool {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 0.75rem;
	border-top: 1px solid #f0f0f0;
	margin-top: 0.75rem;
}

/* 信息区域 */
.bb-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 0.4rem;
	font-size: 0.875rem;
	color: #666;
}

.bb-info a {
	text-decoration: none;
	color: #666;
}

.bb-info a:hover {
	color: var(--post-link-color);
}

.datatime {
	font-size: 0.875rem;
}

/* 加载按钮 - 风琴样式 */
.bb-load {
	position: relative;
	width: 100%;
	margin: 2rem 0;
	z-index: 10;
}

.bb-load button {
	width: 100%;
	padding: 0.5rem 0;
	background: transparent;
	color: #666;
	border: 2px dashed #e0e0e0;
	border-radius: 12px;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 400;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	letter-spacing: 0.5px;
}

.bb-load button::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
	transition: left 0.6s ease;
}

.bb-load button:hover {
	border-color: #667eea;
	color: #667eea;
	background: rgba(102, 126, 234, 0.05);
	transform: translateY(-1px);
}

.bb-load button:hover::before {
	left: 100%;
}

.bb-load button:active {
	transform: translateY(0);
	transition: transform 0.1s;
}

.bb-load button:disabled {
	background: transparent;
	color: #ccc;
	border-color: #f0f0f0;
	cursor: not-allowed;
	transform: none;
}

.bb-load button:disabled::before {
	display: none;
}

/* 加载中动画 */
.bb-load button.loading {
	pointer-events: none;
	border-style: solid;
	border-color: #667eea;
	background: rgba(102, 126, 234, 0.05);
	color: #667eea;
}

.bb-load button.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid transparent;
	border-top: 2px solid #667eea;
	border-radius: 50%;
	animation: button-spin 1s linear infinite;
}

ol,
ul,
menu {
	list-style: none;
}

@keyframes button-spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* 图片网格 */
.resimg {
	margin: 0.4rem 0;
}

.resimg img {
	max-height: 300px;
	object-fit: cover;
	cursor: pointer;
	transition: transform 0.2s ease;
	/* 添加最小高度避免布局跳跃 */
	min-height: 120px;
	background-color: #f5f5f5;
	border-radius: 8px;
	/* 图片加载时的占位样式 */
	background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
		linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
		linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
	background-size: 15px 15px;
	background-position: 0 0, 0 7.5px, 7.5px -7.5px, -7.5px 0px;
}

.resimg img:hover {
	transform: scale(1.02);
}

.resimg.grid {
	display: grid;
	gap: 0.3rem;
	grid-template-columns: repeat(3, 1fr);
}

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

.resimg.grid-2 {
	grid-template-columns: repeat(2, 1fr);
}

.resimg.grid-4 {
	grid-template-columns: repeat(2, 1fr);
}

.resimg figure {
	margin: 0;
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	max-height: 250px;
}

.resimg.grid figure.gallery-thumbnail {
	max-height: 200px;
}

.resimg.grid figure.gallery-thumbnail>img.thumbnail-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: pointer;
}

/* 视频容器 */
.video-wrapper {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	margin: 0.75rem 0;
	border-radius: 8px;
	overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* 音频播放器 */
audio {
	width: 100%;
	margin: 0.5rem 0;
}

.audio-wrapper {
	margin: 0.75rem 0;
}

/* 文件链接样式 */
.file-link {
	display: flex;
	align-items: center;
	padding: 0.5rem;
	margin: 0.25rem 0;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	text-decoration: none;
	color: #333;
	transition: all 0.2s ease;
}

.file-link:hover {
	border-color: #1976d2;
	background-color: #f5f9ff;
	color: #1976d2;
}

.file-icon {
	margin-right: 0.5rem;
	font-size: 1.2rem;
}

.file-size {
	margin-left: auto;
	font-size: 0.8rem;
	color: #666;
}

[data-user-color-scheme="dark"] .file-link {
	border-color: #444;
	color: #ddd;
	background-color: #2d2d2d;
}

[data-user-color-scheme="dark"] .file-link:hover {
	border-color: #42a5f5;
	background-color: #1a2330;
	color: #42a5f5;
}

[data-user-color-scheme="dark"] .file-size {
	color: #aaa;
}

/* 加载动画 */
.loader {
	position: relative;
	width: 100%;
	margin: 3rem auto;
	text-align: center;
	z-index: 10;
}

.loader .circular {
	animation: rotate 2s linear infinite;
	width: 60px;
	height: 60px;
	margin: 0 auto;
}

.path {
	stroke-dasharray: 90, 150;
	stroke-dashoffset: 0;
	animation: dash 1.5s ease-in-out infinite;
	stroke-linecap: round;
	stroke: #1976d2;
	stroke-width: 2;
}

@keyframes rotate {
	100% {
		transform: rotate(360deg);
	}
}

@keyframes dash {
	0% {
		stroke-dasharray: 1, 150;
		stroke-dashoffset: 0;
	}

	50% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -35;
	}

	100% {
		stroke-dasharray: 90, 150;
		stroke-dashoffset: -124;
	}
}

/* 暗色主题 */
[data-user-color-scheme="dark"] .bb-cont p {
	color: var(--subtitle-color);
}

[data-user-color-scheme="dark"] .load-btn {
	color: var(--subtitle-color);
}

[data-user-color-scheme="dark"] .bb-timeline .bb-item {
	background: var(--board-bg-color);
	border-color: var(--line-color);
	color: var(--text-color);
}

[data-user-color-scheme="dark"] .tag-span {
	background: rgba(21, 137, 233, 0.2);
	color: var(--post-link-color);
}

[data-user-color-scheme="dark"] .bb-tool {
	border-top-color: var(--line-color);
}

[data-user-color-scheme="dark"] .bb-info {
	color: var(--sec-text-color);
}

[data-user-color-scheme="dark"] .bb-info a {
	color: var(--sec-text-color);
}

[data-user-color-scheme="dark"] .bb-info a:hover {
	color: var(--post-link-color);
}

[data-user-color-scheme="dark"] .datacount {
	color: var(--sec-text-color);
}

[data-user-color-scheme="dark"] .datacount:hover {
	color: var(--post-link-color);
}

/* 反应表情样式 */
.memo-reactions {
	padding: 0.5rem 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.reaction-item {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.6rem;
	border: 1px solid #e0e0e0;
	border-radius: 1rem;
	font-size: 0.85rem;
	background: #f8f9fa;
	color: #666;
}

[data-user-color-scheme="dark"] .reaction-item {
	border-color: #555;
	background: #333;
	color: #ddd;
}

:root {
	--start-smile-border-color-default: #e5e5e5;
	--start-smile-border-color-hover-default: #cccccc;
	--start-smile-bg-color-default: #ffffff;
	--start-smile-svg-fill-color-default: #333333;
	--reaction-got-not-reacted-bg-color-default: #ffffff;
	--reaction-got-not-reacted-bg-color-hover-default: #f2f2f2;
	--reaction-got-not-reacted-border-color-default: #e5e5e5;
	--reaction-got-not-reacted-text-color-default: #333333;
	--reaction-got-reacted-bg-color-default: #f2f2f2;
	--reaction-got-reacted-bg-color-hover-default: #e5e5e5;
	--reaction-got-reacted-border-color-default: #42b983;
	--reaction-got-reacted-text-color-default: #42b983;
	--reaction-available-popup-bg-color-default: #ffffff;
	--reaction-available-popup-border-color-default: #dddddd;
	--reaction-available-popup-box-shadow-default: 0 4px 6px rgba(0, 0, 0, .04);
	--reaction-available-emoji-reacted-bg-color-default: #388bfd1a;
	--reaction-available-emoji-bg-color-hover-default: #f2f2f2;
	--reaction-available-emoji-z-index-default: 100;
	--reaction-available-mask-z-index-default: 80;
}

.reaction-got-reacted {
	background-color: var(--reaction-got-not-reacted-bg-color, var(--reaction-got-not-reacted-bg-color-default));
	border-width: 1px;
	border-style: solid;
	border-color: var(--reaction-got-not-reacted-border-color, var(--reaction-got-not-reacted-border-color-default));
	color: var(--reaction-got-not-reacted-text-color, var(--reaction-got-not-reacted-text-color-default));
}

/* 暗色主题变量覆盖 */
[data-user-color-scheme="dark"] {
	--start-smile-border-color-default: #3b3d42;
	--start-smile-border-color-hover-default: #3b3d42;
	--start-smile-bg-color-default: transparent;
	--start-smile-svg-fill-color-default: #ffffff;
	--reaction-got-not-reacted-bg-color-default: transparent;
	--reaction-got-not-reacted-bg-color-hover-default: #272727;
	--reaction-got-not-reacted-border-color-default: #3b3d42;
	--reaction-got-not-reacted-text-color-default: #ffffff;
	--reaction-got-reacted-bg-color-default: #272727;
	--reaction-got-reacted-bg-color-hover-default: #272727;
	--reaction-got-reacted-border-color-default: #42b983;
	--reaction-got-reacted-text-color-default: #42b983;
	--reaction-available-popup-bg-color-default: #161b22;
	--reaction-available-popup-border-color-default: #30363d;
	--reaction-available-popup-box-shadow-default: 0 4px 6px rgba(0, 0, 0, .04);
	--reaction-available-emoji-reacted-bg-color-default: #388bfd1a;
	--reaction-available-emoji-bg-color-hover-default: #30363d;

}


/* 移动端响应式样式 */
@media (max-width: 768px) {

	#bber,
	#tag-list {
		margin-top: 0.5rem !important;
		padding: 0 10px !important;
	}

	.bb-timeline {
		padding: 0 !important;
	}

	.bb-timeline .bb-item {
		padding: 1rem !important;
		margin-bottom: 1rem !important;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
		width: 100% !important;
		box-sizing: border-box;
	}

	.bb-timeline .bb-item:hover {
		transform: none !important;
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
	}

	.bb-cont {
		margin-bottom: 1rem;
	}

	.tag-span {
		font-size: 0.8rem;
		padding: 0.15rem 0.3rem;
	}

	.bb-info {
		font-size: 0.8rem;
	}

	.bb-tool {
		padding-top: 0.5rem;
		margin-top: 0.5rem;
	}

	/* 超小屏幕设备优化 */
	@media (max-width: 480px) {
		#bber {
			padding: 0 5px !important;
		}

		.bb-timeline .bb-item {
			padding: 0.8rem !important;
			border-radius: 8px !important;
			width: 100% !important;
			box-sizing: border-box;
		}

		.bb-cont {
			margin-bottom: 0.8rem;
		}

		.bb-cont p {
			margin: 0.2rem 0;
			font-size: 0.95rem;
		}

		.tag-span {
			font-size: 0.75rem;
			padding: 0.1rem 0.25rem;
			margin: 0.1rem 0.1rem 0.1rem 0;
		}

		.bb-info {
			font-size: 0.75rem;
			margin-top: 0.3rem;
		}

		.datatime {
			font-size: 0.75rem;
		}

		.bb-tool {
			padding-top: 0.4rem;
			margin-top: 0.4rem;
		}

	}
}


.bb-info {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.memo-relations {
    margin-top: 12px;
    border: 1px solid oklch(76.21% .0156 98.3528);
    border-radius: 10px;
}

.relation-tabs {
	gap: 16px;
	margin-bottom: 12px;
	border-bottom: 1px solid #e5e7eb;
}

.relation-single-title {
	font-size: 13px;
	font-weight: 500;
	color: #10b981;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
	background-color: color-mix(in oklab, oklch(93.41% .0153 90.239) 30%, transparent);
}

.relation-tab-btn {
	background: none;
	border: none;
	padding: 6px 5px;
	cursor: pointer;
	font-size: 13px;
	color: #6b7280;
	transition: all 0.2s;
	border-radius: 6px 6px 0 0;
	position: relative;
}

.relation-tab-btn:hover {
	color: #374151;
}

.relation-tab-btn.active {
	color: #374151;
}

/* .relation-tab-btn.active::after {
	content: '';
	position: absolute;
	bottom: -9px;
	left: 0;
	right: 0;
	height: 2px;
	background-color: #10b981;
} */

.relation-tab-btn.text-foreground {
	color: #1f2937;
}

.relation-tab-btn.font-medium {
	font-weight: 500;
}

.relation-tab-btn.text-muted-foreground {
	color: #6b7280;
}

.relation-tab-btn.hover-text-foreground:hover {
	color: #1f2937;
}

.relation-content {
	background-color: rgba(16, 185, 129, 0.04);
	border: 1px solid rgba(16, 185, 129, 0.1);
	border-radius: 6px;
	padding: 10px 12px;
}

.relation-content.hidden {
	display: none;
}

.relation-item {
	display: flex;
	align-items: flex-start;
	padding: 6px 8px;
	text-decoration: none;
	color: #374151;
	transition: all 0.2s;
	border-radius: 4px;
	gap: 8px;
}

.relation-item:hover {
	background-color: rgba(16, 185, 129, 0.08);
}

.relation-item:first-child {
	padding-top: 6px;
}

.relation-item:last-child {
	padding-bottom: 6px;
}

.relation-snippet {
	font-size: 13px;
	line-height: 1.5;
	color: #4b5563;
	display: block;
	flex: 1;
}

.relation-link-icon {
	display: inline-block;
	margin-right: 6px;
	font-size: 12px;
	opacity: 0.5;
	flex-shrink: 0;
}

.relation-empty {
	font-size: 13px;
	color: #9ca3af;
	padding: 12px 0;
	text-align: center;
	font-style: italic;
}

.memo-reactions {
	display: inline-block;
	margin-left: 8px;
	vertical-align: middle;
}

.reaction-item {
	display: inline-block;
	margin-left: 4px;
	padding: 2px 6px;
	background-color: #f3f4f6;
	border-radius: 4px;
	font-size: 12px;
	transition: all 0.2s;
}

.reaction-item:hover {
	background-color: #e5e7eb;
}