/* Bilingual overlay styles for the Math is Fun ZH mirror */
.zh {
	color: #1a5e1a;
	background: #f3faf3;
	border-left: 3px solid #6abf6a;
	padding: 4px 10px;
	margin: 4px 0 14px 0;
	border-radius: 4px;
	line-height: 1.7;
}
h1 .zh, h2 .zh, h3 .zh {
	display: block;
	background: none;
	border: 0;
	padding: 0;
	font-size: 0.72em;
	margin-top: 2px;
}
/* Language mode toggle（!important：部分 .zh/.en 带内联 display:block，否则藏不住） */
body.mode-en .zh { display: none !important; }
body.mode-zh .en { display: none !important; }
/* 页底相关链接：英文是裸 <a>（无 .en class），中文在 .zh 块里。
   中文模式下隐藏这些英文直接子链接，只留中文（全站 .related 均有 .zh 块）。 */
body.mode-zh .related > a { display: none; }
#langbar {
	position: sticky; top: 0; z-index: 50;
	text-align: center; padding: 8px;
	background: #2d6a2d; color: #fff;
}
#langbar button {
	font: inherit; margin: 0 4px; padding: 4px 14px;
	border: 1px solid #fff; border-radius: 16px;
	background: transparent; color: #fff; cursor: pointer;
}
#langbar button.active { background: #fff; color: #2d6a2d; font-weight: bold; }

/* untranslated cross-links fall back to English original */
a.ext-en::after { content: " ↗EN"; font-size: 0.72em; color: #888; vertical-align: super; }
/* intentional always-English reference link (对照原版) */
a.en-ref::after { content: " ↗EN"; font-size: 0.72em; color: #888; vertical-align: super; }

/* ---- 夜间模式（跟随 style4.css 的 :root[theme='dark']）---- */
:root[theme='dark'] { color-scheme: dark; }  /* 原生输入框/滚动条用深色渲染 */
:root[theme='dark'] .zh {
	color: #b9e4b9;
	background: rgba(60, 120, 60, 0.16);
	border-left-color: #3f8a3f;
}
:root[theme='dark'] h1 .zh, :root[theme='dark'] h2 .zh, :root[theme='dark'] h3 .zh { background: none; }
:root[theme='dark'] #langbar { background: #1c421c; }
:root[theme='dark'] #langbar button { border-color: #9c9; color: #cfe8cf; }
:root[theme='dark'] #langbar button.active { background: #cfe8cf; color: #1c421c; }
:root[theme='dark'] a.ext-en::after, :root[theme='dark'] a.en-ref::after { color: #777; }
/* 自建工具的中文说明框在 EN 模式下隐藏（还原英文原版观感） */
body.mode-en .tool-note { display: none; }
