/*
Theme Name: BCIwiki Child
Theme URI: https://bciwiki.com
Description: BCIwiki 子主题 —— 脑机接口产业进度信息站。基于 GeneratePress。
Author: BCIwiki
Template: generatepress
Version: 0.1.0
Text Domain: bciwiki
*/

:root {
	--bw-text: #16171a;
	--bw-text-2: #5f6167;
	--bw-muted: #8b8d94;
	--bw-line: #e5e6e9;
	--bw-surface: #fff;
	--bw-surface-2: #f6f7f8;
	--bw-accent: #185fa5;
	--bw-accent-bg: #e6f1fb;
	--bw-radius: 8px;

	/* 思源黑体打头，中英统一字形。后面整条是兜底链：
	   字体没加载到（或国内访问不畅）时逐级退到系统字体，不会白屏。 */
	--bw-font: "Noto Sans SC", "Source Han Sans SC", "思源黑体",
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
		"Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bw-text: #ececee;
		--bw-text-2: #a8aab0;
		--bw-muted: #7c7e85;
		--bw-line: #2c2e33;
		--bw-surface: #16171a;
		--bw-surface-2: #1e2024;
		--bw-accent: #85b7eb;
		--bw-accent-bg: #0c2740;
	}
}

/* --- 版心 ------------------------------------------------------------- */

.bw-wrap {
	max-width: 760px;
	margin: 0 auto;
	padding: 0 20px;
}

.bw-section {
	padding: 28px 0;
	border-bottom: 1px solid var(--bw-line);
}

.bw-section:last-child { border-bottom: 0; }

.bw-section__h {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 14px;
}

.bw-section__h h2 {
	font-size: 17px;
	font-weight: 500;
	margin: 0;
	color: var(--bw-text);
}

.bw-section__note,
.bw-muted {
	font-size: 12px;
	color: var(--bw-muted);
}

/* --- 榜单 ------------------------------------------------------------- */

.bw-rank {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 9px 0;
	border-bottom: 1px solid var(--bw-line);
	text-decoration: none;
	color: var(--bw-text);
}

.bw-rank:last-of-type { border-bottom: 0; }
.bw-rank:hover .bw-rank__t { color: var(--bw-accent); }

.bw-rank__n {
	font-size: 13px;
	color: var(--bw-muted);
	min-width: 14px;
	line-height: 1.5;
}

.bw-rank__t {
	flex: 1;
	font-size: 15px;
	line-height: 1.5;
}

/* --- 评分徽章 ---------------------------------------------------------
   脑机领域的分数没有传播含义，弱化展示，只做排序依据 */

.bw-score {
	font-size: 12px;
	background: var(--bw-accent-bg);
	color: var(--bw-accent);
	border-radius: var(--bw-radius);
	padding: 1px 7px;
	white-space: nowrap;
	height: fit-content;
}

.bw-tag {
	font-size: 12px;
	background: var(--bw-surface-2);
	color: var(--bw-text-2);
	border-radius: var(--bw-radius);
	padding: 1px 7px;
	white-space: nowrap;
}

/* --- 条目卡片 --------------------------------------------------------- */

.bw-card {
	border: 1px solid var(--bw-line);
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 10px;
	background: var(--bw-surface);
}

.bw-card__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	font-size: 12px;
	color: var(--bw-text-2);
	margin-bottom: 8px;
}

.bw-card__meta a { color: var(--bw-text-2); text-decoration: none; }
.bw-card__meta a:hover { color: var(--bw-accent); }
.bw-dot { color: var(--bw-muted); }

/* 标题：原文在上（正常字号），译文在下（灰字小一号） */
.bw-card__title {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	margin: 0;
}

.bw-card__title a { color: var(--bw-text); text-decoration: none; }
.bw-card__title a:hover { color: var(--bw-accent); }

.bw-card__subtitle {
	font-size: 13.5px;
	color: var(--bw-text-2);
	line-height: 1.5;
	margin: 3px 0 0;
}

.bw-card__summary {
	font-size: 13.5px;
	color: var(--bw-text-2);
	line-height: 1.7;
	margin: 9px 0 0;
}

/* --- 推荐理由 ---------------------------------------------------------
   纯聚合站里唯一的原创增量，也是聚合站和采集器的区别所在 */

.bw-reason {
	font-size: 13.5px;
	line-height: 1.7;
	background: var(--bw-surface-2);
	border-radius: var(--bw-radius);
	padding: 10px 12px;
	margin-top: 11px;
	color: var(--bw-text);
}

.bw-reason__label {
	color: var(--bw-muted);
	font-size: 12px;
	margin-right: 4px;
}

/* --- 条目页 ----------------------------------------------------------- */

.bw-single__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	font-size: 12px;
	color: var(--bw-text-2);
	margin-bottom: 12px;
}

.bw-single__title {
	font-size: 25px;
	font-weight: 500;
	line-height: 1.4;
	margin: 0 0 6px;
	color: var(--bw-text);
}

.bw-single__subtitle {
	font-size: 16px;
	color: var(--bw-text-2);
	line-height: 1.5;
	margin: 0 0 18px;
}

/* 原文链接做成按钮：既是读者的核心动作，也是版权上的姿态 —— 这页是导流不是转载 */
.bw-origin {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	border: 1px solid var(--bw-text-2);
	border-radius: var(--bw-radius);
	padding: 8px 14px;
	text-decoration: none;
	color: var(--bw-text);
	margin-top: 6px;
	margin-bottom: 18px;
}

.bw-origin:hover {
	background: var(--bw-surface-2);
	color: var(--bw-text);
}

.bw-body {
	font-size: 15px;
	line-height: 1.85;
	color: var(--bw-text);
	margin-bottom: 18px;
}

/* 摘要之前没有任何标签，紧挨着带标签的"推荐理由"框，读起来像漏了内容。
   加个和 bw-reason__label 同规格的小标签，两块视觉对称。 */
.bw-body__label {
	display: block;
	color: var(--bw-muted);
	font-size: 12px;
	margin-bottom: 5px;
}

/* --- 关键数字条 -------------------------------------------------------
   最可能被截图引用的部分 */

.bw-facts {
	background: var(--bw-surface-2);
	border-radius: var(--bw-radius);
	padding: 12px 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	font-size: 14px;
	margin-bottom: 18px;
}

.bw-facts__l {
	color: var(--bw-muted);
	font-size: 12px;
	margin-right: 5px;
}

/* --- 关联信源 --------------------------------------------------------- */

.bw-sources { margin-bottom: 18px; }

.bw-sources__h {
	font-size: 12px;
	color: var(--bw-muted);
	margin-bottom: 7px;
}

.bw-sources__i {
	font-size: 13.5px;
	line-height: 2;
}

.bw-sources__i a {
	color: var(--bw-accent);
	text-decoration: none;
}

.bw-sources__i a:hover { text-decoration: underline; }

/* --- 实体标签 --------------------------------------------------------- */

.bw-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 18px;
}

.bw-terms a {
	font-size: 12px;
	background: var(--bw-surface-2);
	color: var(--bw-text-2);
	border-radius: var(--bw-radius);
	padding: 3px 10px;
	text-decoration: none;
}

.bw-terms a:hover { color: var(--bw-accent); }

/* --- 时间线 -----------------------------------------------------------
   把一条新闻放回机构的进度轴上：单看是点，加上时间线才是位移 */

.bw-timeline {
	border-top: 1px solid var(--bw-line);
	padding-top: 18px;
	margin-top: 6px;
}

.bw-timeline__h {
	font-size: 14px;
	font-weight: 500;
	margin: 0 0 10px;
	color: var(--bw-text);
}

.bw-timeline__i {
	display: flex;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--bw-line);
	font-size: 14px;
	text-decoration: none;
	color: var(--bw-text-2);
}

.bw-timeline__i:hover { color: var(--bw-accent); }

.bw-timeline__d {
	color: var(--bw-muted);
	font-size: 12px;
	min-width: 56px;
	line-height: 1.6;
}

.bw-timeline__t { flex: 1; line-height: 1.6; }

.bw-timeline__more {
	display: inline-block;
	font-size: 13px;
	color: var(--bw-text-2);
	text-decoration: none;
	padding-top: 10px;
}

.bw-timeline__more:hover { color: var(--bw-accent); }

/* --- 入口卡 -----------------------------------------------------------
   文献、临床、机构、月报在首页只给体量信号，不铺内容 —— 稀疏的一周也不会空 */

.bw-entries {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
}

.bw-entry {
	background: var(--bw-surface-2);
	border-radius: var(--bw-radius);
	padding: 12px 14px;
	text-decoration: none;
	display: block;
}

.bw-entry:hover { background: var(--bw-line); }

.bw-entry__t {
	font-size: 14px;
	font-weight: 500;
	color: var(--bw-text);
	margin-bottom: 5px;
}

.bw-entry__n {
	font-size: 12px;
	color: var(--bw-text-2);
}

/* --- 月分组 ----------------------------------------------------------- */

.bw-group {
	font-size: 14px;
	font-weight: 500;
	color: var(--bw-text);
	margin: 22px 0 10px;
	padding-top: 16px;
	border-top: 1px solid var(--bw-line);
}

.bw-group:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

/* --- 筛选条 ----------------------------------------------------------- */

.bw-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}

.bw-filters a {
	font-size: 12px;
	border: 1px solid var(--bw-line);
	border-radius: var(--bw-radius);
	padding: 4px 11px;
	text-decoration: none;
	color: var(--bw-text-2);
}

.bw-filters a:hover { border-color: var(--bw-text-2); }

.bw-filters a.is-on {
	background: var(--bw-text);
	border-color: var(--bw-text);
	color: var(--bw-surface);
}

/* --- 语言切换与指正 --------------------------------------------------- */

.bw-lang {
	font-size: 12px;
	color: var(--bw-muted);
}

.bw-lang a {
	color: var(--bw-muted);
	text-decoration: none;
	padding: 0 2px;
}

.bw-lang a.is-on { color: var(--bw-text); }

.bw-correct {
	font-size: 12px;
	color: var(--bw-muted);
	text-decoration: none;
}

.bw-correct:hover { color: var(--bw-accent); }

.bw-foot {
	display: flex;
	align-items: center;
	gap: 16px;
	border-top: 1px solid var(--bw-line);
	padding-top: 12px;
	margin-top: 18px;
	font-size: 12px;
	color: var(--bw-muted);
}

/* --- 压平 GeneratePress 的默认外观 -------------------------------------
   GP 默认是「灰底 + 白卡片」，本站是「白底 + 灰色辅助块」。
   两套叠在一起会让灰色的入口卡糊在灰底上，层次全丢。这里统一到白底。 */

body,
.site-content,
.site-main,
#page {
	background: var(--bw-surface);
}

/* --- 字体 --------------------------------------------------------------
   不引入 web font：中文字体包即使子集化也有几百 KB，
   而读者主要在国内，Google Fonts 还会拖慢首屏。
   系统字体栈调好后差距不大，加载成本是零。 */

body,
button,
input,
select,
textarea,
.bw-nav,
.bw-wrap {
	font-family: var(--bw-font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* 按语言分流字体。
   思源 SC 的假名可以用，但汉字是简体字形 —— 日文里的「実」「発」会被
   渲染成简体样子。所以日文和繁体整体交给系统对应字体，字形才不会混。 */

:lang(ja) {
	font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
		"Yu Gothic", Meiryo, "Noto Sans JP", var(--bw-font);
}

:lang(ko) {
	font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", var(--bw-font);
}

:lang(zh-Hant), :lang(zh-TW), :lang(zh-HK) {
	font-family: "PingFang TC", "Microsoft JhengHei UI", "Microsoft JhengHei",
		"Noto Sans TC", var(--bw-font);
}

/* 思源的字面比系统字体略小、行高需求略大，正文行距相应放开一点 */
.bw-card__summary,
.bw-body,
.bw-reason { line-height: 1.8; }

/* 标题一律 500。中文粗体在屏幕上会糊成一团，700 只会更差 */
h1, h2, h3, h4,
.bw-card__title,
.bw-single__title,
.bw-nav__logo,
.bw-entry__t,
.bw-group,
.bw-timeline__h {
	font-weight: 500;
}

/* 评分、日期这类数字用等宽数位，列表里才对得齐 */
.bw-score,
.bw-rank__n,
.bw-timeline__d,
.bw-card__meta,
.bw-single__meta,
.bw-facts {
	font-variant-numeric: tabular-nums;
}

.site-content {
	padding: 0;
}

.site-header,
.site-info,
.site-footer .inside-site-info {
	display: none;
}

.entry-content > *:first-child { margin-top: 0; }

/* --- 顶部导航 ---------------------------------------------------------
   固定六栏，不走 WordPress 菜单系统 —— 栏目是结构的一部分，不该靠后台配置漂移 */

.bw-nav {
	border-bottom: 1px solid var(--bw-line);
	background: var(--bw-surface);
}

.bw-nav__in {
	max-width: 760px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	gap: 18px;
}

.bw-nav__logo {
	font-size: 15px;
	font-weight: 500;
	color: var(--bw-text);
	text-decoration: none;
	letter-spacing: -0.01em;
}

.bw-nav__links {
	display: flex;
	align-items: center;
	gap: 17px;
	flex: 1;
	overflow-x: auto;
	scrollbar-width: none;
}

.bw-nav__links::-webkit-scrollbar { display: none; }

.bw-nav__links a {
	font-size: 14px;
	color: var(--bw-text-2);
	text-decoration: none;
	white-space: nowrap;
	padding-bottom: 2px;
	border-bottom: 2px solid transparent;
}

.bw-nav__links a:hover { color: var(--bw-text); }

.bw-nav__links a.is-on {
	color: var(--bw-text);
	border-bottom-color: var(--bw-text);
}

/* --- 入口卡在白底上需要边框才有形 --------------------------------------- */

.bw-entry {
	border: 1px solid var(--bw-line);
	background: var(--bw-surface);
}

.bw-entry:hover {
	background: var(--bw-surface-2);
	border-color: var(--bw-text-2);
}

/* --- 版心与节奏 -------------------------------------------------------- */

.bw-wrap {
	padding-top: 4px;
	padding-bottom: 40px;
}

.bw-section { padding: 26px 0; }

.bw-section:first-child { padding-top: 22px; }

.bw-card { margin-bottom: 12px; }

.bw-card:last-of-type { margin-bottom: 0; }

/* 正文行高与字距：中英混排时英文标题要压紧一点，否则显得散 */
.bw-card__title,
.bw-single__title { letter-spacing: -0.01em; }

.bw-site-foot {
	max-width: 760px;
	margin: 0 auto;
	padding: 18px 20px 40px;
	font-size: 12px;
	color: var(--bw-muted);
	border-top: 1px solid var(--bw-line);
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.bw-site-foot a {
	color: var(--bw-muted);
	text-decoration: none;
}

.bw-site-foot a:hover { color: var(--bw-accent); }

/* --- 机构库 ------------------------------------------------------------ */

.bw-orglist {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 8px;
}

.bw-org {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	border: 1px solid var(--bw-line);
	border-radius: var(--bw-radius);
	padding: 11px 13px;
	text-decoration: none;
	color: var(--bw-text);
	font-size: 14px;
	line-height: 1.45;
}

.bw-org:hover {
	border-color: var(--bw-text-2);
	color: var(--bw-text);
}

.bw-org__n { min-width: 0; }

/* 另一种语言的名称：中文机构挂英文名，外国机构挂中文名 */
.bw-org__alt {
	display: block;
	font-size: 12px;
	color: var(--bw-muted);
	margin-top: 2px;
}

.bw-org__c {
	font-size: 12px;
	color: var(--bw-muted);
	flex-shrink: 0;
	font-variant-numeric: tabular-nums;
}

/* --- 机构身份行 -------------------------------------------------------- */

.bw-orghead {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: -6px 0 16px;
	font-size: 13px;
	color: var(--bw-text-2);
}

.bw-orghead__alt { color: var(--bw-text-2); }

.bw-orghead a.bw-tag { text-decoration: none; }

.bw-orghead__url {
	color: var(--bw-accent);
	text-decoration: none;
	font-size: 12px;
}

.bw-orghead__url:hover { text-decoration: underline; }

/* 分组标题里的计数 */
.bw-group .bw-muted {
	font-weight: 400;
	margin-left: 6px;
}

/* --- 移动端 ----------------------------------------------------------- */

@media (max-width: 600px) {
	.bw-single__title { font-size: 21px; }
	.bw-wrap { padding-left: 16px; padding-right: 16px; }
	.bw-nav__in { padding: 12px 16px; gap: 14px; }
	.bw-nav__links { gap: 14px; }
}
