/* ===================================================================
 * component.css — Atom site reusable component styles
 *
 * DESIGN.md tokens reference:
 *   button-primary: tertiary bg, white text, 8px radius, 12px 24px
 *   button-secondary: transparent, text color, border, 8px radius
 *   card: surface bg, md radius (12px), 24px padding, shadow
 *   tag: tertiary-15 bg, tertiary text, full radius
 * =================================================================== */

/* ------------------------------------------------------------------
 * Button system
 * ------------------------------------------------------------------ */
.a-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	border-radius: var(--atom-radius-sm);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
	line-height: 1.5;
}

.a-btn:hover {
	box-shadow: var(--atom-shadow-lg);
}

a.a-btn.primary,
button.a-btn.primary {
	color: var(--atom-white);
	background: var(--atom-primary);
	box-shadow: var(--atom-shadow);
}

a.a-btn.primary:hover,
button.a-btn.primary:hover {
	background: var(--atom-primary-dark);
	/* color: var(--atom-primary); */
}

a.a-btn.secondary,
button.a-btn.secondary {
	color: var(--atom-text);
	background: var(--atom-surface);
	border: 1px solid var(--atom-border);
}

a.a-btn.secondary:hover,
button.a-btn.secondary:hover {
	border-color: var(--atom-text);
}

.a-btn.light {
	color: var(--atom-text);
	background: var(--atom-surface);
}

button {
	border: 0;
	background: none;
	cursor: pointer;
}

/* ------------------------------------------------------------------
 * Text link
 * ------------------------------------------------------------------ */
.text-link {
	color: var(--atom-primary);
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}

/* ------------------------------------------------------------------
 * Eyebrow label (section intro tag)
 * ------------------------------------------------------------------ */
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0 0 0.75rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--atom-text-soft);
}

/* ------------------------------------------------------------------
 * Card system
 * ------------------------------------------------------------------ */
.card {
	border: 1px solid var(--atom-border);
	border-radius: var(--atom-radius-md);
	background: var(--atom-surface);
	box-shadow: var(--atom-shadow);
	padding: 1.5rem;
}

.card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.8rem;
	height: 2.8rem;
	margin-bottom: 1rem;
	border-radius: var(--atom-radius-md);
	background: var(--atom-primary-soft);
	color: var(--atom-primary);
}

.card-icon.soft {
	background: var(--atom-surface-soft);
	color: #59647f;
}

/* ------------------------------------------------------------------
 * Tag / Pill
 * ------------------------------------------------------------------ */
.pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.34rem 0.65rem;
	border-radius: 4px;
	background: var(--atom-primary-soft);
	color: var(--atom-primary-dark);
	font-size: 0.72rem;
	font-weight: 700;
}

.pill.light {
	background: #eef1f8;
	color: #525d78;
}

/* ------------------------------------------------------------------
 * Mini bullet list
 * ------------------------------------------------------------------ */
.mini-list {
	display: grid;
	gap: 0.55rem;
	margin-top: 0.9rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.mini-list li {
	position: relative;
	padding-left: 1rem;
	color: var(--atom-text-soft);
	font-size: 0.92rem;
}

.mini-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.7rem;
	width: 0.35rem;
	height: 0.35rem;
	border-radius: var(--atom-radius-full);
	background: var(--atom-primary);
}

/* ------------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------------ */
.pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	justify-content: center;
	margin-top: 2rem;
}

.pagination-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--atom-border);
	border-radius: 4px;
	background: var(--atom-surface);
	font-size: 0.84rem;
	font-weight: 700;
	text-decoration: none;
}

.pagination-link.is-current {
	background: var(--atom-primary);
	border-color: var(--atom-primary);
	color: var(--atom-white);
}

/* ------------------------------------------------------------------
 * Inline meta (index + tag row inside cards)
 * ------------------------------------------------------------------ */
.library-inline-meta {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin-bottom: 0.8rem;
}

.library-inline-meta strong {
	font-size: 1.6rem;
	font-weight: 800;
	color: rgba(0, 0, 0, 0.06);
	line-height: 1;
}


/* Article Style */

.article-page {
	background-color: var(--atom-bg-card);
}

.article-page .page-hero {
	position: relative;
	background: linear-gradient(287deg, #fff -1.66%, #d5e6f8 27.03%, #fff 56.44%);
	margin-block-end: 4rem;
}

.article-page .page-hero .inner {
	display: flex;
	gap: 4.5rem;
	align-items: center;
	justify-content: space-between;
}


.article-page .page-hero::before,
.article-page .page-hero::after {
	border-radius: 100%;
	content: "";
	filter: blur(150px);
	height: 450px;
	opacity: .8;
	position: absolute;
	width: 450px;
	z-index: -1;
}

.article-page .page-hero::before {
	background: #d7f6f8;
	left: 33%;
	top: 0;
	translate: -50% -70%;
}

.article-page .page-hero::after {
	background: #f2ecfc;
	bottom: 0;
	left: 0;
	translate: 0 50%;
}

.article-page .page-hero > .container {
	max-width: 1265px;
}

.article-page .page-hero .hero-content h1 {
	color: var(--atom-text);
	max-width: unset;
	margin-bottom: 2rem;
}

.article-page .page-hero .hero-content,
.article-page .page-hero .hero-image {
	flex-basis: 100%;
}

.article-page .page-hero .hero-image {
	position: relative;
}

.article-page .page-hero .hero-image::before,
.article-page .page-hero .hero-image::after {
	border-radius: 100%;
	content: "";
	filter: blur(42.5px);
	height: 270px;
	position: absolute;
	width: 270px;
	z-index: -1;
}


.article-page .page-hero .hero-image::before {
	background: var(--secondary-secondary-200, #e9e0fb);
	opacity: .8;
	right: -170px;
	top: -105px;
}


.article-page .page-hero .hero-image::after {
	background: var(--accent-accent-200, #d7f6f8);
	bottom: 50%;
	left: 0;
	opacity: .6;
	translate: -50% 50%;
}

.article-page .page-hero .hero-image img {
	object-position: center top;
	border-radius: 1rem;
	margin: 0 auto;
	max-width: 36.75rem;
	object-fit: cover;
	width: 100%;
}

/* ── 3-column article layout ── */
.article-layout {
	display: grid;
	grid-template-columns: 56px 820px 1fr;
	gap: 2rem;
	align-items: start;
	justify-content: center;
	max-width: 1265px;
	margin: 0 auto;
}

/* ── LEFT: Floating action bar ── */
.article-left {
	position: sticky;
	top: calc(4rem + 40px);
	z-index: 5;
	padding-bottom: 24rem;
}

.article-action-bar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	border: 1px solid var(--atom-border);
	border-radius: var(--atom-radius-sm);
	background: var(--atom-surface);
	padding: 0.6rem 0.3rem;
	box-shadow: var(--atom-shadow);
}

.article-action-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	width: 46px;
	padding: 0.5rem 0;
	border: none;
	border-radius: var(--atom-radius-sm);
	background: transparent;
	color: var(--atom-text-soft);
	font-size: 0.62rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: color 0.2s ease, background 0.2s ease;
}

.article-action-btn:hover {
	color: var(--atom-primary);
	background: var(--atom-primary-soft);
}

.article-action-btn i {
	font-size: 1.15rem;
	line-height: 1;
}

.article-action-btn.is-liked {
	color: var(--atom-primary);
}

.article-action-label {
	display: block;
	line-height: 1.2;
}

/* ── CENTER: Main article ── */
.article-main {
	max-width: 100%;
	padding: 2rem;
	background-color: var(--atom-surface);
}


/* ========================================
   文章内容样式（仅限 .entry-content 容器内）
   ======================================== */

.entry-content {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.8;
	color: #252933;
	word-break: break-word;
}

.entry-content p {
	line-height: inherit;
	margin-top: 22px;
	margin-bottom: 22px;
}

/* ----- 标题层级（h2~h6）----- */

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
	line-height: 1.5;
	margin-top: 35px;
	margin-bottom: 10px;
	padding-bottom: 5px;
}

.entry-content h2 {
	font-size: 22px;
	line-height: 34px;
	padding-bottom: 12px;
	border-bottom: 1px solid #ececec;
}

.entry-content h3 {
	font-size: 20px;
	line-height: 28px;
}

.entry-content h4 {
	font-size: 18px;
	margin: 1.2em 0 0.4em 0;
	line-height: 1.4;
}

.entry-content h5,
.entry-content h6 {
	font-size: 16px;
	font-weight: 600;
	margin: 1em 0 0.3em 0;
	line-height: 1.4;
}

/* ----- 链接 ----- */
.entry-content a {
	color: var(--atom-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
	/* 下划线与文字间距 */
	transition: color 0.2s;
}

.entry-content a:hover {
	color: var(--atom-primary-dark);
	text-decoration: none;
}

/* ----- 列表（有序/无序）----- */
.entry-content ul,
.entry-content ol {
	padding-left: 28px;
}

.entry-content li {
	margin-bottom: 0;
	list-style: inherit;
}

/* 嵌套列表增加缩进 */
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
	margin-bottom: 0.3em;
}

/* ----- 引用块 ----- */
.entry-content blockquote {
	color: #666;
	padding: 1px 23px;
	margin: 22px 0;
	border-left: 4px solid #cbcbcb;
	background-color: #f8f8f8;
}

.entry-content blockquote p {
	margin: 10px 0;
}

.entry-content blockquote cite {
	display: block;
	margin-top: 0.4em;
	font-style: normal;
	font-size: 0.9em;
	color: var(--atom-text-muted);
}

/* ----- 图片 ----- */
.entry-content img {
	margin: 1.5em 0;
}

/* 图片描述（figcaption） */
.entry-content figcaption,
.entry-content .wp-block-image figcaption,
.entry-content .wp-element-caption {
	font-size: 14px;
	color: #5a6a7a;
	text-align: center;
	margin: -0.8em 0 1.5em 0;
	line-height: 1.5;
	font-style: italic;
}

/* 如果图片是居中对齐的，确保其父容器也居中 */
.entry-content .wp-block-image {
	text-align: center;
	margin: 1.5em 0;
}

.entry-content .wp-block-image img {
	margin: 0 auto;
}

/* ----- 视频（iframe / video 标签） ----- */
.entry-content iframe,
.entry-content video {
	max-width: 100%;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	/* 保持宽高比，防止变形 */
	border: none;
	border-radius: var(--atom-radius-sm);
	margin: 1.5em 0;
	display: block;
	background: #000;
	/* 加载时黑色背景 */
}

/* 对于普通 <video> 添加播放控制样式 */
.entry-content video {
	background: #1a1a1a;
}

/* ----- 表格 ----- */
.entry-content table {
	font-size: 12px;
	width: auto;
	max-width: 100%;
	overflow: auto;
	border: 1px solid #f6f6f6;
}

.entry-content table.has-fixed-layout {
	border-collapse: separate;
	border: none;
}

.entry-content table.has-fixed-layout td {
	border: none;
}

.entry-content table thead {
	background: #f6f6f6;
	color: #000;
	text-align: left;
}

.entry-content table th,
.entry-content table td {
	padding: 12px 7px;
	line-height: 24px;
}

.entry-content table tr:first-child {
	background: #f6f6f6;
	color: #000;
	font-weight: bold;
}

.entry-content table tr:nth-child(2n+1):not(:first-child) {
	background-color: #fcfcfc;
}

/* 表格内文本 */
.entry-content table p {
	margin-bottom: 0;
}

/* 如果表格在小屏上显示不全，可启用横向滚动 */
@media (max-width: 600px) {
	.entry-content table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}

/* ----- 代码块 ----- */
.entry-content pre {
	background: #f0f2f5;
	padding: 1.2em 1.5em;
	border-radius: 6px;
	overflow-x: auto;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
	font-size: 0.9em;
	line-height: 1.6;
	margin: 1.5em 0;
	color: #2c3e50;
	border: 1px solid #e1e4e8;
}

.entry-content code {
	font-family: inherit;
	background: #eef2f6;
	padding: 0.2em 0.4em;
	border-radius: 4px;
	font-size: 0.9em;
	color: #d63384;
}

.entry-content pre code {
	background: transparent;
	padding: 0;
	color: inherit;
}

/* ----- 分隔线 ----- */
.entry-content hr {
	border: none;
	border-top: 2px solid #eaecef;
	margin: 2.5em 0;
}

/* ----- 对齐类（WordPress 常用） ----- */
.entry-content .aligncenter {
	text-align: center;
	margin-left: auto;
	margin-right: auto;
	display: block;
}

.entry-content .alignleft {
	float: left;
	margin: 0.5em 1.5em 0.5em 0;
	max-width: 40%;
}

.entry-content .alignright {
	float: right;
	margin: 0.5em 0 0.5em 1.5em;
	max-width: 40%;
}

/* 浮动清除 */
.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

/* ----- 响应式调整（移动端） ----- */
@media (max-width: 768px) {
	.entry-content {
		font-size: 16px;
		padding: 0 1em;
		/* 两侧留白 */
	}

	.entry-content h2 {
		font-size: 24px;
	}

	.entry-content h3 {
		font-size: 20px;
	}

	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		max-width: 100%;
		margin: 0.5em 0;
	}
}

.article-end {
	border-radius: 0 0 4px 4px;
	padding-bottom: 2rem;
	background-color: var(--juejin-layer-1);
}

.article-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--atom-border);
}

.article-tags-label {
	font-size: 0.82rem;
	color: var(--atom-text-soft);
	margin-right: 0.3rem;
}

.article-tags .tag {
	background-color: #f7f8fa;
	color: #515767;
	display: flex;
	align-items: center;
	padding: 0.4rem 1rem;
	border-radius: 4px;
	transition: background-color .15s linear;
	font-size: 0.85rem;
}

.article-tags .tag:hover {
	background-color: #eaf2ff;
	color: var(--atom-primary);
}

#comments.article-comments {
	border-radius: var(--atom-radius-sm);
	grid-column: 2;
	width: 100%;
	margin-top: 0;
	margin-bottom: 8rem;
	background-color: var(--atom-surface);
}

/* ── RIGHT: Sidebar ── */
.article-right {
	position: sticky;
	top: calc(4rem + 40px);
	padding-bottom: 16rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.article-side-widget {
	border: 1px solid var(--atom-border);
	border-radius: var(--atom-radius-sm);
	background: var(--atom-surface);
	padding: 1.25rem;
	box-shadow: var(--atom-shadow);
}

.article-side-title {
	margin: 0 0 1rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--atom-text);
	padding-bottom: 0.6rem;
	border-bottom: 2px solid var(--atom-primary);
}

.article-side-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.article-side-list li {
	font-size: 0.88rem;
	line-height: 1.4;
}

.article-side-list a {
	color: var(--atom-text-soft);
	text-decoration: none;
	transition: color 0.2s ease;
	display: block;
	padding: 0.25rem 0;
}

.article-side-list a:hover {
	color: var(--atom-primary);
}

.article-side-list.numbered li {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.article-side-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	border-radius: var(--atom-radius-full);
	background: var(--atom-primary-soft);
	color: var(--atom-primary);
	font-size: 0.72rem;
	font-weight: 700;
	flex-shrink: 0;
}

/* ── Toast ── */
.article-toast {
	position: fixed;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	background: var(--atom-text);
	color: var(--atom-white);
	padding: 0.6rem 1.25rem;
	border-radius: var(--atom-radius-sm);
	font-size: 0.84rem;
	font-weight: 500;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 100;
	pointer-events: none;
}

.article-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}


/* ── Breadcrumb ── */
.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.75rem;
}

.breadcrumb a {
	color: var(--atom-text-soft);
	text-decoration: none;
	transition: color 0.2s ease;
}

.breadcrumb.should-white a,
.breadcrumb.should-white span {
	color: var(--atom-white);
}

.breadcrumb a:hover {
	color: var(--atom-primary);
}

.breadcrumb-sep {
	color: var(--atom-border);
	font-size: 0.75rem;
	user-select: none;
}

.breadcrumb-current {
	color: var(--atom-text);
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 24ch;
}

/* ── Article mobile ── */
@media (max-width: 1024px) {
	.article-layout {
		grid-template-columns: 1fr;
	}

	/* LEFT: fixed to top on mobile */
	.article-left {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 50;
	}

	.article-action-bar {
		flex-direction: row;
		justify-content: center;
		border-radius: 0;
		border: none;
		border-top: 1px solid var(--atom-border);
		padding: 0.4rem 0.5rem;
		background: rgba(255, 255, 255, 0.96);
		backdrop-filter: blur(12px);
		gap: 0.2rem;
	}

	.article-action-btn {
		flex-direction: row;
		width: auto;
		gap: 0.35rem;
		padding: 0.4rem 0.7rem;
		font-size: 0.72rem;
	}

	.article-action-btn i {
		font-size: 0.95rem;
	}

	/* RIGHT: moves to bottom */
	.article-right {
		margin-top: 1rem;
	}

	.article-side-list {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.4rem;
	}

	.article-side-list li {
		flex: 1 1 calc(50% - 0.4rem);
		min-width: 0;
	}

	.article-side-list.numbered li {
		flex: 1 1 calc(50% - 0.4rem);
	}

	/* breadcrumb truncate adjust */
	.breadcrumb-current {
		max-width: 16ch;
	}
}

/* Article Style END */

/* Language Switcher */
/* 语言切换器容器 */
.language-switcher {
	position: relative;
	display: inline-block;
}

/* 当前语言链接 */
.language-switcher .current-language {
	text-decoration: none;
	display: flex;
	align-items: center;
	cursor: pointer;
	color: var(--atom-text);
}

/* 下拉菜单图标 */
.language-switcher .current-language .dropdown-icon {
	display: inline-block;
	margin-left: 5px;
	width: 0.35rem;
	height: 0.35rem;
	border-left: 2px solid var(--atom-text-soft);
	border-bottom: 2px solid var(--atom-text-soft);
	transform: rotate(-45deg);
	transition: transform 0.3s ease;
}

/* 鼠标移入时旋转图标 */
.language-switcher:hover .current-language .dropdown-icon {
	transform: rotate(135deg);
	color: inherit;
}

/* 语言菜单 */
.language-switcher .language-menu {
	position: absolute;
	top: 100%;
	left: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	list-style: none;
	padding: 0;
	margin: 0;
	display: none;
	min-width: 120px;
}

/* 鼠标移入时显示菜单 */
.language-switcher:hover .language-menu {
	display: block;
	animation: fadeIn 0.3s ease;
}

/* 语言菜单项 */
.language-switcher .language-menu li {
	padding: 0;
}

/* 语言菜单链接 */
.language-switcher .language-menu li a {
	display: block;
	padding: 8px 16px;
	color: #333;
	text-decoration: none;
	transition: background 0.3s ease;
}

/* 鼠标移入菜单项 */
.language-switcher .language-menu li a:hover {
	background: #f5f5f5;
	color: var(--atom-primary);
}

/* 动画效果：淡入 */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/*end-lang*/

/* Call-to-Action 按钮样式 */
.call-to-action .free-diagnosis-button {
	display: inline-block;
	background-color: #014dff;
	color: #ffffff;
	font-size: 16px;
	padding: 7px 14px;
	border-radius: 3px;
	text-decoration: none;
	transition: background-color 0.3s ease;
	margin-top: -10px;
}

/* 鼠标悬停效果 */
.call-to-action .free-diagnosis-button:hover {
	background-color: #003bcc;
}


/* Language Switcher END */