@charset "UTF-8";
/* ==========================================================================
   Moment — Twitter / X 风格博客主题 for Bludit
   --------------------------------------------------------------------------
   纯手写 CSS，不依赖任何框架或 CDN，离线可用。
   设计语言对齐 X：15px 基准字号、1px 细分隔线（不用卡片阴影）、
   圆角 16px 媒体、悬停变色圆圈操作按钮、蓝白纯色体系 + 纯黑深色模式。

   目录：
     01. 设计变量（浅色 / 深色）
     02. 基础重置
     03. 三栏骨架
     04. 左侧导航栏
     05. 中间列：吸顶头 / 标签页
     06. 信息流条目（"推文"）
     07. 操作按钮条
     08. 单篇详情（线程页）
     09. 正文排版
     10. 右侧栏（小工具 / 关于 / 正在发生）
     11. 分页 / 空状态 / 404
     12. 移动端底栏
     13. 粘贴提示 / 辅助
     14. 响应式
   ========================================================================== */


/* ==========================================================================
   01. 设计变量
   ========================================================================== */

:root {
	--accent: #1d9bf0;          /* head.php 会按主题选项覆盖 */

	--bg: #ffffff;
	--bg-hover: #f7f9f9;        /* 信息流条目悬停底色 */
	--bg-elev: #ffffff;
	--bg-soft: #eff3f4;         /* 悬停圆圈 / 输入框底色 */

	--text: #0f1419;
	--text-soft: #536471;
	--text-faint: #8b98a5;

	--border: #eff3f4;
	--border-strong: #cfd9de;

	--like: #f91880;
	--retweet: #00ba7c;

	--shadow: 0 0 15px rgba(101, 119, 134, .2), 0 0 3px 1px rgba(101, 119, 134, .15);

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
		Helvetica, Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
		"Liberation Mono", monospace;

	--col-main: 600px;
	--col-left: 275px;
	--col-right: 370px;

	--ease: cubic-bezier(.4, 0, .2, 1);
}

/* 纯黑深色模式（X 的 "Lights out"） */
html[data-theme="dark"] {
	--accent: #1d9bf0;

	--bg: #000000;
	--bg-hover: #080808;
	--bg-elev: #16181c;
	--bg-soft: #16181c;

	--text: #e7e9ea;
	--text-soft: #71767b;
	--text-faint: #565a5f;

	--border: #2f3336;
	--border-strong: #3d4144;

	--shadow: 0 0 15px rgba(255, 255, 255, .18), 0 0 3px 1px rgba(255, 255, 255, .12);
}


/* ==========================================================================
   02. 基础重置
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 64px;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 15px;
	line-height: 20px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; }
/*
 * 全局去掉链接下划线。
 *
 * 以前是每处单独写 text-decoration:none（全文件二十多处），只要漏一处
 * 就会冒出默认的蓝色下划线 —— 右侧「关于本站」卡片里的站名就是这么漏的。
 * 这里统一兜底，需要下划线的地方（正文里的链接、各处 hover）再单独加回来。
 */
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

.icon {
	width: 20px;
	height: 20px;
	display: block;
	flex: none;
}

.badge-verified {
	width: 18px;
	height: 18px;
	flex: none;
	color: var(--accent);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 300;
	padding: 12px 20px;
	background: var(--bg-elev);
	border: 1px solid var(--border);
	font-size: 14px;
	text-decoration: none;
}

.skip-link:focus { left: 0; }


/* ==========================================================================
   03. 三栏骨架
   ========================================================================== */

.app {
	display: flex;
	/* 显式禁止换行：万一某个子元素变宽，宁可横向溢出也不能把右栏挤到下一行 */
	flex-wrap: nowrap;
	justify-content: center;
	align-items: flex-start;
	max-width: calc(var(--col-left) + var(--col-main) + var(--col-right));
	margin: 0 auto;
	min-height: 100vh;
}

.col-main {
	flex: 0 1 var(--col-main);
	width: 100%;
	max-width: var(--col-main);
	min-height: 100vh;
	border-left: 1px solid var(--border);
	border-right: 1px solid var(--border);
}

.feed { display: block; }


/* ==========================================================================
   04. 左侧导航栏
   ========================================================================== */

.rail-left {
	position: sticky;
	top: 0;
	flex: 0 0 var(--col-left);
	width: var(--col-left);
	height: 100vh;
	display: flex;
	flex-direction: column;
	padding: 4px 8px 12px;
	overflow: hidden;            /* 外层不滚，滚的是中段 */
	overscroll-behavior: contain;
}

/* 中段：内容多了自己滚 */
.rail-scroll {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.rail-scroll::-webkit-scrollbar { width: 6px; }
.rail-scroll::-webkit-scrollbar-thumb {
	background: var(--border-strong);
	border-radius: 999px;
}

/* 底部：钉死，不跟着滚。账号信息就在这里 */
.rail-bottom {
	flex: none;
	width: 100%;
	margin-top: 8px;
	padding-top: 10px;
	border-top: 1px solid var(--border);
}

.rail-logo {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin: 2px 0 2px 2px;
	border-radius: 50%;
	color: var(--text);
	text-decoration: none;
	transition: background .2s var(--ease);
}

.rail-logo:hover { background: var(--bg-soft); }

.rail-logo .icon { width: 30px; height: 30px; }

.rail-logo-img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

/* logo + 站点名的横向组合 */
.rail-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 2px 4px 6px;
	min-width: 0;
}

.rail-brand-name {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 顶部标题留空时占位，保持头部高度一致 */
.col-title--spacer {
	flex: 1;
	min-width: 0;
}

@media (max-width: 720px) {
	/* 窄屏那里没有左栏了，标题位就不必留空 */
	.col-title--spacer { display: none; }
}

.rail-nav {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	margin-top: 4px;
}

.rail-item {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	padding: 10px 16px 10px 12px;
	border-radius: 999px;
	color: var(--text);
	font-size: 17px;
	line-height: 24px;
	text-decoration: none;
	transition: background .2s var(--ease);
}

.rail-item:hover { background: var(--bg-soft); }

.rail-item .icon { width: 25px; height: 25px; }

/*
 * 选中态。原来只有 font-weight:700，在 17px 的字上几乎看不出来 ——
 * 用户反馈"边栏不会高亮选中的项目"。加个胶囊底色，一眼能认。
 */
.rail-item.is-active {
	font-weight: 700;
	background: var(--bg-soft);
}

/* 鼠标悬停保持和选中一致的手感 */
.rail-item:hover { background: var(--bg-hover); }
.rail-item.is-active:hover { background: var(--bg-soft); }

.rail-item-label { white-space: nowrap; }

/* 分类小标题 */
/* 「话题」小标题去掉后，分类组和上方导航之间补一点呼吸空间 */
.rail-nav + .rail-nav { margin-top: 6px; }

.rail-section {
	margin: 14px 0 2px;
	padding: 0 14px;
	color: var(--text-faint);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

/* 蓝色主行动按钮（对应 X 的"发帖"按钮，这里用来订阅 RSS） */
.rail-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: 18px;
	padding: 15px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 20px;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s var(--ease), transform .2s var(--ease);
}

.rail-cta:hover {
	background: color-mix(in srgb, var(--accent) 88%, #000);
	transform: translateY(-1px);
}

.rail-cta .icon { width: 20px; height: 20px; }

/* 底部账号条 */
.rail-account {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 12px;
	border-radius: 999px;
	color: inherit;
	text-decoration: none;
	transition: background .2s var(--ease);
}

.rail-account:hover { background: var(--bg-soft); }

.rail-account-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 18px;
}

.rail-account-name {
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rail-account-handle {
	color: var(--text-soft);
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}


/* ==========================================================================
   05. 中间列：吸顶头 / 标签页
   ========================================================================== */

.col-header {
	position: sticky;
	top: 0;
	z-index: 30;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}

.col-header-top {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 53px;
	padding: 0 16px;
}

.col-header-avatar {
	display: none;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--bg-soft);
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 800;
	text-decoration: none;
}

.col-header-initial { line-height: 1; }

.col-header-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.col-back {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin-left: -8px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--text);
	cursor: pointer;
	text-decoration: none;
	transition: background .2s var(--ease);
}

.col-back:hover { background: var(--bg-soft); }
.col-back .icon { width: 20px; height: 20px; }

.col-title {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 24px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.col-title-sub {
	display: block;
	color: var(--text-soft);
	font-size: 13px;
	font-weight: 400;
	line-height: 16px;
}

.col-header-tools {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: none;
	margin-right: -8px;
}

/* 图标圆形按钮 */
.round-btn {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--text);
	cursor: pointer;
	text-decoration: none;
	transition: background .2s var(--ease), color .2s var(--ease);
}

.round-btn:hover { background: var(--bg-soft); }
.round-btn .icon { width: 20px; height: 20px; }

.icon-sun { display: none; }
.icon-moon { display: block; }

html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* 标签页 */
.tabs {
	display: flex;
	overflow-x: auto;
	scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

/* --------------------------------------------------------------------------
   标签栏嵌进顶部那一行
   --------------------------------------------------------------------------
   保持原来的观感：**均分整行宽度 + 选中项底部横条**，只是从独立一行
   挪到了头部这一排。所以这里不改 .tab 的弹性规则，只补"撑满行高"
   和"去掉胶囊底色"两件事。
   -------------------------------------------------------------------------- */

.col-header-top .tabs {
	flex: 1 1 auto;
	min-width: 0;
	align-self: stretch;
	gap: 0;
	margin: 0;
	/* 超过 4 个标签时这里会出现横向滚动 */
	overflow-x: auto;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
}

.col-header-top .tab {
	display: flex;
	align-items: center;
	justify-content: center;
	/*
	 * flex-basis 用 0 而不是 auto：auto 会按内容宽度分配，
	 * 「General」比「全部」长，两个标签就不等宽了。用 0 才是真正的均分。
	 *
	 * min-width: 25% —— 最多显示 4 个的锁：
	 *   ≤4 个 → 每项至少 25%，剩余空间均分，正好铺满
	 *   >4 个 → 每项被锁在 25% 不肯再缩，总宽超过容器 → 触发横向滚动
	 * 纯 CSS 做到"超过 4 个就滚动"，不用 JS 数个数。
	 */
	flex: 1 1 0;
	min-width: 25%;
	padding: 0 12px;
	border-radius: 0;        /* 不要胶囊 */
	align-self: stretch;
}

/* 选中态回到"文字加粗 + 底部横条"，不用底色 */
.col-header-top .tab.is-active {
	background: transparent;
	color: var(--text);
	font-weight: 700;
}

.col-header-top .tab.is-active::after { display: block; }

/* 窄屏：字号收一档，避免和工具按钮挤在一起 */
@media (max-width: 720px) {
	.col-header-top { gap: 6px; }
	.col-header-top .tab { padding: 0 8px; font-size: 13px; }
	.col-header-top .tab.is-active::after { width: 36px; height: 3px; }
}

.tab {
	position: relative;
	flex: 1 0 auto;
	min-width: 90px;
	padding: 16px 18px;
	color: var(--text-soft);
	font-size: 15px;
	font-weight: 500;
	line-height: 20px;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	transition: background .2s var(--ease), color .2s var(--ease);
}

.tab:hover { background: var(--bg-hover); color: var(--text); }

.tab.is-active { color: var(--text); font-weight: 700; }

.tab.is-active::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 56px;
	height: 4px;
	transform: translateX(-50%);
	border-radius: 999px;
	background: var(--accent);
}


/* ==========================================================================
   06. 信息流条目
   ========================================================================== */

.tweet {
	position: relative;
	display: flex;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	transition: background .15s var(--ease);
}

.tweet:hover { background: var(--bg-hover); }

.tweet-avatar {
	display: grid;
	place-items: center;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--bg-soft);
	color: var(--text-soft);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
}

.tweet-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tweet-avatar--lg { flex-basis: 40px; width: 40px; height: 40px; }

/* 标签栏原地切换：新信息流滑入 */
.feed-enter {
	animation: feedSlideIn .22s cubic-bezier(.2, .7, .3, 1);
}

@keyframes feedSlideIn {
	from { opacity: 0; transform: translateX(22px); }
	to   { opacity: 1; transform: translateX(0); }
}

/* 取数据期间让旧内容微微淡一下，避免"点了没反应" */
html.feed-loading .feed,
html.feed-loading .empty {
	opacity: .55;
	transition: opacity .15s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
	.feed-enter { animation: none; }
}

/* 「...」下拉菜单（作者/管理员可删文章） */
.post-more-wrap {
	position: relative;
	flex: none;
	/* 推到头部最右侧。头部是 flex，没这行它就会紧贴着昵称 */
	margin-left: auto;
}

.post-more-menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 40;
	min-width: 148px;
	padding: 4px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--bg-elev);
	box-shadow: var(--shadow);
}

.post-more-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 10px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	transition: background .15s var(--ease);
}

.post-more-item:hover { background: var(--bg-hover); }

.post-more-item--danger { color: #f4212e; }

.post-more-item--danger:hover {
	background: color-mix(in srgb, #f4212e 12%, transparent);
}

.post-more-item .icon { width: 16px; height: 16px; }

.post-more-item:disabled { opacity: .5; cursor: default; }

/* 成员头像（插件生成）嵌进主题的圆形容器里，撑满并裁干净 */
.tweet-avatar .ms-avatar {
	width: 100% !important;
	height: 100% !important;
	border-radius: 50%;
}

.tweet-main { flex: 1; min-width: 0; }

.tweet-head {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
	font-size: 15px;
	line-height: 20px;
}

.tweet-name {
	font-weight: 700;
	color: var(--text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex-shrink: 0;
	max-width: 60%;
	text-decoration: none;
}

.tweet-name:hover { text-decoration: underline; }

.tweet-handle,
.tweet-time {
	color: var(--text-soft);
	font-weight: 400;
	white-space: nowrap;
	text-decoration: none;
}

.tweet-time { margin-left: 2px; }
.tweet-time:hover { text-decoration: underline; }

.tweet-head-more {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	margin-left: auto;
	margin-right: -6px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--text-soft);
	cursor: pointer;
	transition: background .2s var(--ease), color .2s var(--ease);
}

.tweet-head-more:hover {
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	color: var(--accent);
}

.tweet-head-more .icon { width: 18px; height: 18px; }

/* 正文（信息流里截断） */
/* 信息流里的文章标题（比正文重一档，跟正文一起被点击） */
.tweet-title {
	display: block;
	margin: 2px 0 2px;
	color: var(--text);
	font-size: 16px;
	line-height: 22px;
	font-weight: 800;
	text-decoration: none;
	overflow-wrap: anywhere;
}

/* 标题/正文不做 hover 下划线（用户明确不要这条线） */

.tweet-text {
	display: block;
	margin: 2px 0 0;
	color: var(--text);
	font-size: 15px;
	line-height: 20px;
	font-weight: 400;
	text-decoration: none;
	overflow-wrap: anywhere;
	/*
	 * ⚠ 这里**不能**用 white-space: pre-wrap。
	 * 摘要（moment_excerpt）已经把空白折叠成单个空格并 trim 过了，
	 * pre-wrap 不但没用，还会把正文里残留的空格/换行原样渲染出来 ——
	 * 表现就是信息流里的正文整体右移几十像素，看着像居中了。
	 */
	white-space: normal;
}

.tweet-text--clamp {
	display: -webkit-box;
	/* 信息流最多显示 3 行正文，超出用省略号；点进详情页看全文 */
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}



/* 媒体 */
.tweet-media {
	display: block;
	margin-top: 12px;
	border: 1px solid var(--border);
	border-radius: 16px;
	overflow: hidden;
	background: var(--bg-soft);
}

.tweet-media img {
	display: block;
	width: 100%;
	max-height: 510px;
	object-fit: cover;
	transition: opacity .4s var(--ease);
}

/* 懒加载淡入：只有 JS 在的时候才先隐藏，避免脚本被拦时图片集体消失 */
.js .tweet-media img { opacity: 0; }
.js .tweet-media img.is-loaded { opacity: 1; }

/* 没有配图的条目 */
.tweet--notext .tweet-text { display: none; }


/* ==========================================================================
   07. 操作按钮条
   ========================================================================== */

.actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 425px;
	margin: 12px 0 0 -8px;
}

.action {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--text-soft);
	font-size: 13px;
	line-height: 16px;
	cursor: pointer;
	text-decoration: none;
}

.action-icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	transition: background .2s var(--ease), color .2s var(--ease);
}

.action .icon { width: 18px; height: 18px; }

.action-count { padding-right: 6px; }

.action:hover .action-icon {
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	color: var(--accent);
}

.action--like:hover .action-icon {
	background: color-mix(in srgb, var(--like) 12%, transparent);
	color: var(--like);
}

.action--share:hover .action-icon {
	background: color-mix(in srgb, var(--retweet) 12%, transparent);
	color: var(--retweet);
}

/* 已"喜欢"：图标填充成实心 */
.action.is-liked { color: var(--like); }
.action.is-liked .icon { fill: currentColor; }

.action.is-liked:hover .action-icon {
	background: color-mix(in srgb, var(--like) 14%, transparent);
}

/* 分享成功后的短暂反馈 */
.action.is-done { color: var(--retweet); }
.action.is-done .icon { fill: currentColor; }

/* 只读的元信息（阅读时长） */
.action--meta { cursor: default; }
.action--meta:hover .action-icon { background: none; color: var(--text-soft); }


/* ==========================================================================
   08. 单篇详情（线程页）
   ========================================================================== */

.post { padding: 12px 16px 0; }

.post-head {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 15px;
	line-height: 20px;
}

.post-head-text { display: flex; flex-direction: column; min-width: 0; }

.post-author {
	display: flex;
	align-items: center;
	gap: 3px;
	font-weight: 700;
	line-height: 20px;
}

.post-handle { color: var(--text-soft); font-size: 15px; line-height: 20px; }

.post-more { margin-left: auto; }

.post-title {
	margin: 12px 0 0;
	font-size: 23px;
	font-weight: 800;
	line-height: 28px;
	letter-spacing: -.01em;
}

.post-meta-line {
	margin: 12px 0 0;
	color: var(--text-soft);
	font-size: 15px;
	line-height: 20px;
}

.post-stats {
	margin: 16px 0 0;
	padding: 16px 16px 0;
	border-top: 1px solid var(--border);
	color: var(--text-soft);
	font-size: 15px;
	line-height: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
}

.post-stats b { color: var(--text); font-weight: 700; }

.post-actions {
	display: flex;
	align-items: center;
	justify-content: space-around;
	margin: 12px 0 0;
	padding: 4px 8px;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

.post-actions .action-icon { width: 38px; height: 38px; }
.post-actions .icon { width: 22px; height: 22px; }

/* 正文区 */
.post-body {
	padding: 4px 16px 20px;
	font-size: 17px;
	line-height: 26px;
	overflow-wrap: anywhere;
}

/* 标签行 */
.post-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
}

.tag-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--accent) 12%, transparent);
	color: var(--accent);
	font-size: 13px;
	font-weight: 600;
	line-height: 18px;
	text-decoration: none;
	transition: background .2s var(--ease);
}

.tag-chip:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* 回复区（评论区插件挂这里） */
.replies-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
}

.replies-title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	line-height: 24px;
}

.replies-body { padding: 0; }

.replies-body:empty { display: none; }

/* 上/下一篇 */
.post-nav { border-bottom: 1px solid var(--border); }

.post-nav-title-bar {
	padding: 12px 16px 4px;
	color: var(--text-soft);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.post-nav-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	color: inherit;
	text-decoration: none;
	transition: background .15s var(--ease);
}

.post-nav-item:hover { background: var(--bg-hover); }

.post-nav-item-main { flex: 1; min-width: 0; }

.post-nav-item-label {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--text-soft);
	font-size: 13px;
	line-height: 16px;
}

.post-nav-item-title {
	margin-top: 2px;
	font-size: 15px;
	font-weight: 600;
	line-height: 20px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}


/* ==========================================================================
   09. 正文排版（长文）
   ========================================================================== */

.post-body > * + * { margin-top: 1.1em; }
.post-body p { margin: 0; }

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
	margin: 1.6em 0 0;
	font-weight: 800;
	line-height: 1.35;
	letter-spacing: -.01em;
}

.post-body h1 { font-size: 22px; }
.post-body h2 { font-size: 20px; }
.post-body h3 { font-size: 18px; }
.post-body h4 { font-size: 17px; }

.post-body a {
	color: var(--accent);
	text-decoration: none;
}

.post-body a:hover { text-decoration: underline; }

.post-body img {
	display: block;
	margin: 12px 0;
	border: 1px solid var(--border);
	border-radius: 16px;
}

.post-body ul,
.post-body ol { margin: 1.1em 0 0; padding-left: 1.4em; }

.post-body li + li { margin-top: .4em; }

.post-body blockquote {
	margin: 1.2em 0 0;
	padding: 4px 0 4px 16px;
	border-left: 3px solid var(--accent);
	color: var(--text-soft);
}

.post-body code {
	padding: .12em .38em;
	border-radius: 5px;
	background: var(--bg-soft);
	font-family: var(--font-mono);
	font-size: .88em;
}

.post-body pre {
	position: relative;
	margin: 1.2em 0 0;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--bg-soft);
	font-size: 14px;
	line-height: 1.65;
	overflow-x: auto;
}

.post-body pre code { padding: 0; background: none; font-size: inherit; }

.post-body hr {
	margin: 1.8em 0;
	border: none;
	border-top: 1px solid var(--border);
}

.post-body table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.post-body th,
.post-body td {
	padding: 9px 12px;
	border: 1px solid var(--border);
	text-align: left;
}

.post-body th { background: var(--bg-soft); font-weight: 700; }

.post-body iframe,
.post-body video { max-width: 100%; border-radius: 12px; }

.post-body figcaption {
	margin-top: 6px;
	color: var(--text-soft);
	font-size: 14px;
}

/* 代码复制按钮 */
.code-copy {
	position: absolute;
	top: 8px;
	right: 8px;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--border-strong);
	border-radius: 8px;
	background: var(--bg-elev);
	color: var(--text-soft);
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s var(--ease), color .2s var(--ease);
}

.code-copy .icon { width: 16px; height: 16px; }

.post-body pre:hover .code-copy,
.code-copy:focus-visible { opacity: 1; }

.code-copy.is-done { color: var(--retweet); }


/* ==========================================================================
   10. 右侧栏
   ========================================================================== */

.rail-right {
	position: sticky;
	top: 0;
	flex: 0 0 var(--col-right);
	width: var(--col-right);
	max-height: 100vh;
	padding: 8px 0 24px 24px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.rail-right::-webkit-scrollbar { width: 6px; }
.rail-right::-webkit-scrollbar-thumb {
	background: var(--border-strong);
	border-radius: 999px;
}

.card {
	margin-bottom: 16px;
	border-radius: 16px;
	background: var(--bg-soft);
	overflow: hidden;
}

.card-title {
	margin: 0;
	padding: 12px 16px 4px;
	font-size: 20px;
	font-weight: 800;
	line-height: 24px;
}

/* 关于本站（对应 X 的账号卡片） */
.card-profile { padding: 12px 16px 16px; }

.card-profile-head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.card-profile-avatar {
	display: grid;
	place-items: center;
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--bg);
	color: var(--text-soft);
	font-size: 19px;
	font-weight: 700;
}

.card-profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 卡片里的站名是链接，hover 时才给下划线（默认不显示） */
.card-profile-name a:hover { text-decoration: underline; }

.card-profile-name {
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: 15px;
	font-weight: 800;
	line-height: 20px;
}

.card-profile-handle { color: var(--text-soft); font-size: 15px; line-height: 20px; }

.card-profile-desc {
	margin: 12px 0 0;
	font-size: 15px;
	line-height: 20px;
}

/* 统计单独成块时（「关于本站」卡片关掉了）需要自己的内边距 */
.card-stats {
	padding: 14px 16px;
}

.card-stats .card-profile-meta {
	padding: 0;
	margin: 0;
}

.card-profile-meta {
	margin: 12px 0 0;
	color: var(--text-soft);
	font-size: 14px;
	line-height: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
}

.card-profile-meta b { color: var(--text); }

/* 正在发生（标签） */
.trend {
	display: block;
	padding: 10px 16px;
	color: inherit;
	text-decoration: none;
	transition: background .15s var(--ease);
}

.trend:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }

.trend-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--text-soft);
	font-size: 13px;
	line-height: 16px;
}

.trend-name { margin-top: 2px; font-size: 15px; font-weight: 700; line-height: 20px; }

.card-more {
	display: block;
	padding: 14px 16px;
	color: var(--accent);
	font-size: 15px;
	line-height: 20px;
	text-decoration: none;
	transition: background .15s var(--ease);
}

.card-more:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }

/* 右侧栏页脚 */
.rail-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	padding: 0 16px;
	color: var(--text-soft);
	font-size: 13px;
	line-height: 18px;
}

.rail-footer a { text-decoration: none; }
.rail-footer a:hover { text-decoration: underline; }

/* 插件小工具（搜索插件会渲染在这里，正好顶替 X 的搜索框） */
.widgets { margin-bottom: 16px; }

.widgets ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.widgets li { margin: 0; }

.widgets a {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--bg-soft);
	color: var(--text);
	font-size: 14px;
	text-decoration: none;
	transition: background .2s var(--ease);
}

.widgets a:hover { background: var(--border); }

.widgets form { display: flex; gap: 8px; }

.widgets input[type="text"],
.widgets input[type="search"],
.widgets input[type="email"] {
	width: 100%;
	padding: 11px 16px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--bg-soft);
	color: var(--text);
	font-family: inherit;
	font-size: 15px;
	line-height: 20px;
}

.widgets input:focus {
	border-color: var(--accent);
	background: var(--bg);
	outline: none;
}

.widgets input::placeholder { color: var(--text-soft); }

.widgets button,
.widgets input[type="submit"] {
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}


/* ==========================================================================
   11. 分页 / 空状态 / 404
   ========================================================================== */

.pager { border-bottom: 1px solid var(--border); }

.pager-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
}

.pager-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	background: var(--bg);
	color: var(--text);
	font-size: 15px;
	line-height: 20px;
	text-decoration: none;
	transition: background .2s var(--ease), border-color .2s var(--ease);
}

.pager-btn:hover {
	background: var(--bg-soft);
	border-color: var(--text-soft);
}

.pager-btn.is-disabled {
	opacity: .4;
	pointer-events: none;
}

.pager-btn .icon { width: 17px; height: 17px; }

.pager-info {
	color: var(--text-soft);
	font-size: 14px;
	line-height: 18px;
}

.empty {
	padding: 48px 32px;
	text-align: center;
}

.empty-title {
	margin: 0;
	font-size: 23px;
	font-weight: 800;
	line-height: 28px;
}

.empty-desc {
	margin: 8px 0 0;
	color: var(--text-soft);
	font-size: 15px;
	line-height: 20px;
}

.empty-code {
	margin: 0 0 8px;
	color: var(--text-faint);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .1em;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
	padding: 11px 22px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s var(--ease);
}

.btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }

.btn--ghost {
	margin-left: 8px;
	background: transparent;
	color: var(--text);
	border-color: var(--border-strong);
}

.btn--ghost:hover { background: var(--bg-soft); }


/* ==========================================================================
   12. 移动端底栏
   ========================================================================== */

.bottom-nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 50;
	display: none;
	border-top: 1px solid var(--border);
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
	display: flex;
	align-items: stretch;
	justify-content: space-around;
}

.bottom-nav-item {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 9px 4px;
	border: 0;
	background: none;
	color: var(--text-soft);
	font-size: 11px;
	line-height: 14px;
	text-decoration: none;
	cursor: pointer;
}

.bottom-nav-item .icon { width: 24px; height: 24px; }

/*
 * 手机底栏选中态。
 * 原来只是字色变深 + 加粗，11px 的字根本分不出来 —— 改用主题色。
 */
.bottom-nav-item.is-active {
	color: var(--accent);
	font-weight: 700;
}


/* ==========================================================================
   13. 粘贴提示 / 辅助
   ========================================================================== */

/* 左侧栏的品牌标记（没上传 logo 时用站点名首字） */
.rail-mark {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	font-size: 17px;
	font-weight: 800;
	line-height: 1;
}

/* 小号头像（底部账号条、上/下一篇） */
.tweet-avatar--sm {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	font-size: 14px;
}

.tweet-avatar--sm .icon { width: 18px; height: 18px; }

/* 详情页封面图：放进正文流里，跟着正文的内边距走 */
.post-cover { margin: 0 0 20px; }
.post-cover img { margin: 0; }

/* 插件托管的功能页（登录/注册/个人主页/成员）：只有内容，没有文章头 */
.post-body--bare { padding-top: 18px; padding-bottom: 28px; }
.post-body--bare > * + * { margin-top: 0; }

/* 左侧栏的账号入口（装了 Moment Social 才会有） */
.rail-account-block { margin-top: 16px; }

.toast {
	position: fixed;
	left: 50%;
	bottom: 84px;
	z-index: 200;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 20px;
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 10px);
	transition: opacity .25s var(--ease), transform .25s var(--ease),
		visibility .25s var(--ease);
}

.toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.toast .icon { width: 18px; height: 18px; }


/* ==========================================================================
   13.5 移动端页脚
   --------------------------------------------------------------------------
   桌面端的页脚挂在右侧栏里，而右栏 ≤1080px 就隐藏了 —— 备案号在手机上根本
   看不到。这里补一份放在正文下面的页脚，宽屏自动隐藏，不会和右栏重复。
   ========================================================================== */

.mobile-footer {
	display: none;
	padding: 24px 20px calc(16px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--border);
}

.mobile-footer-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 16px;
	font-size: 13px;
	color: var(--text-soft);
}

.mobile-footer-links a {
	color: var(--text-soft);
	text-decoration: none;
}

.mobile-footer-links a:hover { text-decoration: underline; }

.mobile-footer-links .footer-icp {
	color: var(--text-soft);
	opacity: .9;
}


/* ==========================================================================
   14. 响应式
   ========================================================================== */

/*
 * 中等屏幕：右栏先**变窄**，别直接消失。
 * 原来 1080 就 display:none —— 浏览器稍微缩放一下（CSS 宽度 < 1080）
 * 右栏就没了，用户会以为"页面缺了一块"。
 * 现在：1080 以下收窄，900 以下才隐藏。
 */
@media (max-width: 1080px) {
	.rail-right {
		width: 210px;
		flex-basis: 210px;
		padding-left: 12px;
		padding-right: 12px;
	}
}

@media (max-width: 900px) {
	.rail-right { display: none; }
}

/* 窄屏：左侧栏变成底部标签栏 */
@media (max-width: 720px) {
	.rail-left { display: none; }

	.col-main {
		max-width: 100%;
		border-left: 0;
		border-right: 0;
	}

	.col-header-avatar { display: grid; }

	.bottom-nav { display: block; }

	/* 去掉移动端 300ms 双击缩放延迟（按钮"要点两次"的元凶） */
a, button, .tab, .rail-item, .bottom-nav-item, [data-theme-toggle],
.post-delete-btn, .post-more-item, .tag-chip {
	touch-action: manipulation;
}

/* 移动端页脚（备案号在这里） */
	.mobile-footer { display: block; }

	body { padding-bottom: 56px; }

	.tweet { padding: 12px 14px; }
	.post { padding: 12px 14px 0; }
	.post-body { padding: 4px 14px 20px; }
	.tags-row,
	.post-tags { padding-inline: 14px; }

	.toast { bottom: 76px; }

	/* 移动端字号略收紧，跟 X 一致 */
	.post-title { font-size: 21px; line-height: 26px; }
}

@media (max-width: 420px) {
	.tweet-avatar { flex-basis: 36px; width: 36px; height: 36px; }
	.tweet-text { font-size: 15px; }
	.actions { max-width: none; }
}

/* 尊重"减少动态效果" */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }

	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}

@media print {
	.rail-left,
	.rail-right,
	.bottom-nav,
	.col-header-tools,
	.actions,
	.post-actions,
	.pager,
	.code-copy,
	.toast { display: none !important; }

	body { background: #fff; color: #000; }

	.col-main { border: 0; max-width: 100%; }
}
