MediaWiki:Common.css

THDeb​(留言 | 贡献)2026年8月11日 (二) 14:16的版本 (Unify compact sidebar navigation styling)

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
  • Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
  • Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* === TYZX opt-in Comments theme: BEGIN ===
 * Scope: pages that explicitly transclude 模板:访客评论.
 * Rollback: remove this complete BEGIN/END block.
 */
.tyzx-comments {
	--tyzx-comments-border: var(--border-color-subtle, #a2a9b1);
	--tyzx-comments-card: var(--background-color-neutral-subtle, #f8f9fa);
	--tyzx-comments-text: var(--color-base, #202122);
	--tyzx-comments-muted: var(--color-subtle, #54595d);
	--tyzx-comments-link: var(--color-progressive, #36c);
	--tyzx-comments-danger: var(--color-destructive, #b32424);
	--tyzx-comments-radius: var(--border-radius-base, 2px);
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin-block-start: 2rem;
	padding-block-start: 1rem;
	border-block-start: 1px solid var(--tyzx-comments-border);
	color: var(--tyzx-comments-text);
	font-family: var(--font-family-system-sans, sans-serif);
}

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

.tyzx-comments__heading {
	margin: 0;
	color: var(--tyzx-comments-text);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.3;
}

.tyzx-comments__notice {
	margin-block: 0.35rem 1rem;
	color: var(--tyzx-comments-muted);
	font-size: 0.875rem;
	line-height: 1.6;
}

.tyzx-comments #comments-body,
.tyzx-comments .full,
.tyzx-comments textarea#comment,
.tyzx-comments .c-form-message {
	width: 100%;
	max-width: 100%;
}

.tyzx-comments .c-item {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	gap: 0.75rem;
	width: 100%;
	max-width: 100%;
	margin: 0 0 0.75rem;
	padding: 0.75rem;
	overflow: hidden;
	border: 1px solid var(--tyzx-comments-border);
	border-radius: var(--tyzx-comments-radius);
	background: var(--tyzx-comments-card);
}

.tyzx-comments .c-item.reply {
	width: auto;
	max-width: calc(100% - 1.5rem);
	margin-inline-start: 1.5rem !important;
}

.tyzx-comments .c-avatar {
	position: static;
	width: 40px;
	height: 40px;
}

.tyzx-comments .c-avatar img {
	display: block;
	width: 40px;
	height: 40px;
	padding: 0;
	object-fit: cover;
	border: 1px solid var(--tyzx-comments-border);
	border-radius: 50%;
	background: var(--background-color-base, #fff);
}

.tyzx-comments .c-container {
	position: static;
	min-width: 0;
	margin: 0;
}

.tyzx-comments .c-user {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 0.5rem;
	align-items: baseline;
	margin: 0 0 0.4rem;
	color: var(--tyzx-comments-text);
	font-weight: 600;
}

.tyzx-comments .c-user a {
	color: var(--tyzx-comments-link);
	font-size: 0.95rem;
}

.tyzx-comments .c-time,
.tyzx-comments .c-user-level {
	margin: 0;
	color: var(--tyzx-comments-muted);
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1.4 !important;
}

.tyzx-comments .c-score {
	position: static;
	margin-inline-start: auto;
	padding: 0;
	color: var(--tyzx-comments-muted);
	font-size: 0.75rem;
}

.tyzx-comments .c-comment,
.tyzx-comments .f-message,
.tyzx-comments .r-message {
	width: auto;
	max-width: 100%;
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
	color: var(--tyzx-comments-text);
	font-size: 0.95rem;
	line-height: 1.6;
}

.tyzx-comments .c-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.7rem;
	justify-content: flex-end;
	float: none;
	margin-block-start: 0.6rem;
	color: var(--tyzx-comments-muted);
	font-size: 0.8rem;
}

.tyzx-comments a,
.tyzx-comments .c-actions a {
	color: var(--tyzx-comments-link);
}

.tyzx-comments .c-delete a {
	color: var(--tyzx-comments-danger) !important;
}

.tyzx-comments textarea#comment,
.tyzx-comments .c-comment-edit-form textarea {
	display: block;
	min-height: 7rem;
	padding: 0.6rem 0.7rem;
	resize: vertical;
	border: 1px solid var(--tyzx-comments-border);
	border-radius: var(--tyzx-comments-radius);
	background: var(--background-color-base, #fff);
	color: var(--tyzx-comments-text);
	font: inherit;
	line-height: 1.5;
}

.tyzx-comments .site-button,
.tyzx-comments .c-comment-edit-form button {
	min-height: 2.25rem;
	margin: 0.25rem 0.35rem 0.25rem 0;
	padding: 0.4rem 0.75rem;
	border: 1px solid var(--tyzx-comments-link);
	border-radius: var(--tyzx-comments-radius);
	background: var(--background-color-base, #fff);
	color: var(--tyzx-comments-link);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.tyzx-comments a:focus-visible,
.tyzx-comments button:focus-visible,
.tyzx-comments input:focus-visible,
.tyzx-comments select:focus-visible,
.tyzx-comments textarea:focus-visible {
	outline: 3px solid var(--tyzx-comments-link);
	outline-offset: 2px;
}

@media screen and (max-width: 640px) {
	.tyzx-comments {
		margin-block-start: 1.5rem;
		padding-block-start: 0.75rem;
	}

	.tyzx-comments .c-item {
		gap: 0.6rem;
		padding: 0.65rem;
	}

	.tyzx-comments .c-item.reply {
		max-width: calc(100% - 0.75rem);
		margin-inline-start: 0.75rem !important;
	}

	.tyzx-comments .c-score {
		flex-basis: 100%;
		margin-inline-start: 0;
	}

	.tyzx-comments .c-actions {
		justify-content: flex-start;
	}
}
/* === TYZX opt-in Comments theme: END === */
/* === TYZX black curtain: BEGIN === */
.tyzx-black-curtain {
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	background-color: #000;
	color: #000;
	cursor: pointer;
	box-shadow: inset 0 0 0.08em #000;
	text-shadow: 0 0 0.35em #000;
	transition:
		color 220ms ease,
		background-color 220ms ease,
		box-shadow 220ms ease,
		text-shadow 220ms ease;
}

.tyzx-black-curtain:hover,
.tyzx-black-curtain:focus,
.tyzx-black-curtain:focus-visible,
.tyzx-black-curtain:active {
	background-color: #000;
	color: #fff;
	box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.35);
	text-shadow: 0 0 0.12em rgba(255, 255, 255, 0.25);
}

.tyzx-black-curtain:focus-visible {
	outline: 2px solid var(--color-progressive, #36c);
	outline-offset: 2px;
}

.tyzx-black-curtain::selection {
	background-color: #000;
	color: #fff;
}

.tyzx-black-curtain::-moz-selection {
	background-color: #000;
	color: #fff;
}

@media (prefers-color-scheme: dark) {
	.tyzx-black-curtain:hover,
	.tyzx-black-curtain:focus,
	.tyzx-black-curtain:focus-visible,
	.tyzx-black-curtain:active,
	.tyzx-black-curtain::selection {
		background-color: #000;
		color: #fff;
		box-shadow: 0 0 0.25em rgba(255, 255, 255, 0.2);
		text-shadow: 0 0 0.12em rgba(255, 255, 255, 0.3);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tyzx-black-curtain {
		transition: none;
	}
}
/* === TYZX black curtain: END === */

/* Regional CJK font stacks; interface/content language determines the stack. */
html:lang(zh-cn) body,
html:lang(zh-hans) body,
:lang(zh-cn),
:lang(zh-hans) {
	font-family: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC",
		"Microsoft YaHei", "Heiti SC", system-ui, sans-serif;
}

html:lang(zh-tw) body,
:lang(zh-tw) {
	font-family: "Noto Sans CJK TC", "Source Han Sans TC", "PingFang TC",
		"Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
}

html:lang(zh-hk) body,
html:lang(zh-hant) body,
:lang(zh-hk),
:lang(zh-hant) {
	font-family: "Noto Sans CJK HK", "Source Han Sans HC", "PingFang HK",
		"Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
}

html:lang(ja) body,
:lang(ja) {
	font-family: "Noto Sans CJK JP", "Source Han Sans JP",
		"Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

html:lang(ko) body,
:lang(ko) {
	font-family: "Noto Sans CJK KR", "Source Han Sans KR",
		"Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

/* === TYZX unified sidebar: BEGIN === */
.tyzx-sidebar-fixed,
.tyzx-sidebar-topic {
	box-sizing: border-box;
	max-width: 100%;
	margin-block: 0;
	overflow-wrap: anywhere;
	font-size: 0.875rem;
	line-height: 1.35;
}

.tyzx-sidebar-fixed {
	margin-block-end: 0.75rem;
}

.tyzx-sidebar-fixed li + li,
.tyzx-sidebar-topic-content li + li {
	border-block-start: 1px solid var(--border-color-subtle, #eaecf0);
}

.tyzx-sidebar-fixed a,
.tyzx-sidebar-topic-content a {
	display: flex;
	box-sizing: border-box;
	align-items: center;
	min-width: 0;
	min-height: 2rem;
	padding: 0.35rem 0.45rem;
	border-radius: 2px;
	color: var(--color-progressive, #36c);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.tyzx-sidebar-fixed a {
	font-weight: 600;
}

.tyzx-sidebar-fixed a:hover,
.tyzx-sidebar-topic-content a:hover {
	background: var(--background-color-interactive-subtle, #f8f9fa);
	text-decoration: underline;
}

.tyzx-sidebar-fixed a:focus-visible,
.tyzx-sidebar-topic .tyzx-sidebar-toggle:focus-visible,
.tyzx-sidebar-topic-content a:focus-visible {
	outline: 2px solid var(--color-progressive, #36c);
	outline-offset: -2px;
}

.tyzx-sidebar-topic + .tyzx-sidebar-topic {
	margin-block-start: 0.3rem;
}

.tyzx-sidebar-topic .tyzx-sidebar-toggle {
	display: flex;
	box-sizing: border-box;
	align-items: center;
	width: 100%;
	min-height: 2.25rem;
	margin: 0;
	padding: 0.4rem 0.45rem;
	border: 0;
	border-inline-start: 3px solid #d97706;
	border-radius: 2px;
	background: transparent;
	color: #9a4d00;
	font: inherit;
	font-weight: 650;
	line-height: 1.25;
	text-align: start;
	cursor: pointer;
}

.tyzx-sidebar-topic .tyzx-sidebar-toggle::before {
	display: inline-block;
	flex: 0 0 auto;
	width: 0;
	height: 0;
	margin-inline: 0.05rem 0.5rem;
	border-block: 0.28rem solid transparent;
	border-inline-start: 0.4rem solid currentColor;
	content: "";
	transform: rotate(0deg);
	transform-origin: 35% 50%;
	transition: transform 180ms ease;
}

.tyzx-sidebar-topic .tyzx-sidebar-toggle[aria-expanded="true"] {
	background: #fff8ef;
}

.tyzx-sidebar-topic .tyzx-sidebar-toggle[aria-expanded="true"]::before {
	transform: rotate(90deg);
}

.tyzx-sidebar-topic .tyzx-sidebar-toggle:hover {
	background: var(--background-color-interactive-subtle, #f8f9fa);
	color: #7a3d00;
}

.client-js .tyzx-sidebar-topic > .tyzx-sidebar-topic-content {
	display: grid;
	grid-template-rows: 1fr;
	opacity: 1;
	transition:
		grid-template-rows 200ms ease,
		opacity 160ms ease;
}

.client-js .tyzx-sidebar-topic > .tyzx-sidebar-topic-content > ul {
	min-width: 0;
	min-height: 0;
	margin: 0;
	overflow: hidden;
}

.client-js .tyzx-sidebar-topic[data-tyzx-collapsed="true"] > .tyzx-sidebar-topic-content {
	grid-template-rows: 0fr;
	opacity: 0;
}

.tyzx-sidebar-language-current > a,
.tyzx-sidebar-language-current a,
.tyzx-sidebar-language a[aria-current="true"] {
	border-inline-start: 3px solid #d97706;
	background: #fff8ef;
	color: var(--color-base, #202122);
	font-weight: 650;
}

@media screen and (max-width: 720px) {
	.tyzx-sidebar-fixed a,
	.tyzx-sidebar-topic .tyzx-sidebar-toggle,
	.tyzx-sidebar-topic .tyzx-sidebar-topic-content a {
		min-height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tyzx-sidebar-topic .tyzx-sidebar-toggle::before,
	.client-js .tyzx-sidebar-topic > .tyzx-sidebar-topic-content {
		transition: none;
	}
}
/* === TYZX unified sidebar: END === */