/* ============================================================
   OSWiki · 开源知识库
   沿用 OSList 的现代简约风格，扩展 Wiki 所需组件
   ============================================================ */

:root {
	--bg: #f7f7f8;
	--surface: #ffffff;
	--border: #e7e7ea;
	--text: #18181b;
	--text-2: #71717a;
	--text-3: #a1a1aa;
	--accent: #4f46e5;
	--accent-strong: #4338ca;
	--accent-soft: #eef2ff;
	--green: #067647;
	--danger: #dc2626;
	--danger-soft: #fef2f2;
	--amber: #b45309;
	--amber-soft: #fffbeb;
	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
	--shadow-lg: 0 2px 6px rgba(0, 0, 0, .08), 0 20px 48px rgba(0, 0, 0, .10);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
		"Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	--mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* {
	box-sizing: border-box;
}

/* 保证 hidden 属性永远生效，不被 display:flex 等规则覆盖 */
[hidden] {
	display: none !important;
}

html,
body {
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font);
	color: var(--text);
	background: var(--bg);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

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

a:hover {
	color: var(--accent-strong);
}

/* ---------------- 首页：全屏、无滚动 ---------------- */
body.home {
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background:
		radial-gradient(1200px 600px at 50% -10%, #eef2ff 0%, transparent 60%),
		var(--bg);
}

.hero {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 30px;
	padding: 24px;
	text-align: center;
}

.brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.brand-mark {
	width: 72px;
	height: 72px;
	border-radius: 20px;
	background: linear-gradient(135deg, var(--accent), #7c3aed);
	color: #fff;
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -.02em;
	display: grid;
	place-items: center;
	box-shadow: var(--shadow-lg);
}

.brand-title {
	margin: 0;
	font-size: 44px;
	font-weight: 700;
	letter-spacing: -.02em;
}

.brand-sub {
	margin: 0;
	color: var(--text-2);
	font-size: 16px;
}

.hero-search {
	display: flex;
	align-items: center;
	width: min(640px, 92vw);
	height: 56px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0 22px;
	box-shadow: var(--shadow);
	transition: box-shadow .18s ease, border-color .18s ease;
}

.hero-search:focus-within {
	border-color: var(--accent);
	box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft);
}

.search-icon {
	font-size: 22px;
	color: var(--text-3);
	margin-right: 12px;
}

.hero-search input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 17px;
	color: var(--text);
	background: transparent;
}

.hero-search input::placeholder {
	color: var(--text-3);
}

.hero-links {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}

.hero-link {
	padding: 10px 22px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
	font-size: 14px;
	transition: all .15s ease;
}

.hero-link:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.hero-link-primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.hero-link-primary:hover {
	background: var(--accent-strong);
	color: #fff;
}

/* ---------------- 顶栏（内页） ---------------- */
.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 12px 28px;
	background: rgba(255, 255, 255, .85);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}

.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
}

.logo-mark {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--accent), #7c3aed);
	color: #fff;
	font-weight: 700;
	display: grid;
	place-items: center;
	font-size: 15px;
}

.logo-text {
	font-weight: 700;
	font-size: 16px;
}

.topsearch {
	flex: 1;
	max-width: 480px;
}

.topsearch input {
	width: 100%;
	height: 40px;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0 18px;
	font-size: 14px;
	outline: none;
	background: var(--surface);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.topsearch input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav {
	display: flex;
	gap: 4px;
	margin-left: auto;
	align-items: center;
}

.nav a {
	padding: 8px 14px;
	border-radius: 8px;
	color: var(--text-2);
	font-size: 14px;
}

.nav a:hover {
	background: var(--accent-soft);
	color: var(--accent);
}

.nav-links,
.nav-user-area {
	display: flex;
	align-items: center;
	gap: 4px;
}

.nav-user-area {
	padding-left: 8px;
	margin-left: 8px;
	border-left: 1px solid var(--border);
}

.nav-me {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nav-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--accent-soft);
}

.nav-avatar-ph {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	display: grid;
	place-items: center;
}

.nav-name {
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nav-user {
	font-size: 14px;
	color: var(--text-2);
	padding: 8px 10px;
}

/* 移动端汉堡菜单按钮（桌面隐藏） */
.nav-toggle {
	display: none;
	width: 40px;
	height: 40px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	cursor: pointer;
	position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
	content: "";
	position: absolute;
	left: 10px;
	right: 10px;
	height: 2px;
	background: var(--text-2);
	border-radius: 2px;
}

.nav-toggle span {
	top: 19px;
}

.nav-toggle span::before {
	top: -7px;
}

.nav-toggle span::after {
	top: 7px;
}

/* ---------------- 容器与页脚 ---------------- */
/* 内页：body 纵向弹性布局，main 撑满剩余高度，页脚短内容贴窗口底、长内容贴内容底 */
body.inner {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

body.inner main {
	flex: 1 0 auto;
}

.container {
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	padding: 32px 24px 64px;
}

.footer {
	display: flex;
	justify-content: center;
	gap: 24px;
	padding: 18px 24px;
	color: var(--text-3);
	font-size: 13px;
	border-top: 1px solid var(--border);
}

.footer-home {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	border-top: none;
}

.footer a {
	color: var(--text-3);
}

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

/* ---------------- 检索结果 ---------------- */
.results-meta {
	color: var(--text-2);
	font-size: 14px;
	margin: 4px 0 20px;
}

.results-count {
	color: var(--text-3);
	margin-left: 8px;
}

.filter-bar {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.filter-bar input,
.filter-bar select {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 8px 14px;
	font-size: 14px;
	font-family: inherit;
	color: var(--text);
	outline: none;
	background: var(--surface);
}

.filter-bar input[type="search"] {
	flex: 1;
	min-width: 200px;
}

.filter-bar input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.results {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.result {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.result-title {
	font-size: 20px;
	font-weight: 600;
	color: var(--accent);
}

.result-title:hover {
	text-decoration: underline;
}

.result-brief {
	margin: 0;
	color: var(--text-2);
	font-size: 14px;
}

.result-meta {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	font-size: 12px;
	color: var(--text-3);
	align-items: center;
}

/* ---------------- 批量管理条 ---------------- */
.bulk-bar {
	display: flex;
	align-items: stretch;
}

.bulk-group {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1 1 0;
	min-width: 0;
	padding: 4px 12px;
}

.bulk-check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--text-2);
	cursor: pointer;
}

.bulk-input {
	width: 110px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 6px 10px;
	font-size: 13px;
	font-family: inherit;
	color: var(--text);
	background: var(--bg);
	outline: none;
}

.bulk-input:focus {
	border-color: var(--accent);
}

.result-head {
	display: flex;
	align-items: center;
	gap: 8px;
}

.result-head .bulk-select {
	margin: 0;
}

/* ---------------- 标签 chips ---------------- */
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.chip {
	display: inline-block;
	padding: 3px 12px;
	font-size: 12px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
}

.chip:hover {
	background: var(--accent);
	color: #fff;
}

.chip-group {
	background: #ecfdf5;
	color: var(--green);
}

.chip-group:hover {
	background: var(--green);
	color: #fff;
}

.chip-static {
	cursor: default;
}

.chip-static:hover {
	background: var(--accent-soft);
	color: var(--accent);
}

/* ---------------- 徽章（状态 / 角色） ---------------- */
.badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

.badge-online {
	background: #ecfdf5;
	color: #065f46;
}

.badge-review {
	background: var(--amber-soft);
	color: var(--amber);
}

.badge-blocked {
	background: var(--danger-soft);
	color: var(--danger);
}

.badge-delete {
	background: #f4f4f5;
	color: var(--text-3);
}

.badge-admin {
	background: #fef2f2;
	color: #b91c1c;
}

.badge-manager {
	background: var(--accent-soft);
	color: var(--accent);
}

.badge-member {
	background: #ecfdf5;
	color: #065f46;
}

.badge-blacklist {
	background: #18181b;
	color: #fff;
}

/* ---------------- 页面标题 ---------------- */
.page-title {
	margin: 0 0 6px;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -.01em;
}

.page-sub {
	margin: 0 0 24px;
	color: var(--text-2);
}

/* ---------------- 详情页 / 条目 ---------------- */
.detail {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.detail-title {
	margin: 0;
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -.01em;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.detail-meta {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--text-3);
}

.detail-id {
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text-2);
}

.detail-brief {
	margin: 0;
	font-size: 16px;
	color: var(--text-2);
}

.detail-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.detail-section {
	padding-top: 18px;
	border-top: 1px solid var(--border);
}

.detail-section h2 {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 600;
	color: var(--text-2);
}

.placeholder {
	color: var(--text-3);
	font-style: italic;
}

/* ---------------- Markdown 正文 ---------------- */
.markdown-body {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px 28px;
	line-height: 1.7;
}

.markdown-body > *:first-child {
	margin-top: 0;
}

.markdown-body > *:last-child {
	margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
	margin: 1.4em 0 .6em;
	line-height: 1.3;
	font-weight: 600;
}

.markdown-body h1 {
	font-size: 1.6em;
	border-bottom: 1px solid var(--border);
	padding-bottom: .3em;
}

.markdown-body h2 {
	font-size: 1.35em;
	border-bottom: 1px solid var(--border);
	padding-bottom: .3em;
}

.markdown-body h3 {
	font-size: 1.15em;
}

.markdown-body p {
	margin: .8em 0;
}

.markdown-body a {
	text-decoration: underline;
}

.markdown-body ul,
.markdown-body ol {
	padding-left: 1.6em;
	margin: .8em 0;
}

.markdown-body li {
	margin: .3em 0;
}

.markdown-body blockquote {
	margin: .8em 0;
	padding: 2px 16px;
	border-left: 4px solid var(--accent);
	background: var(--accent-soft);
	color: var(--text-2);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-body code {
	font-family: var(--mono);
	font-size: .9em;
	background: #f4f4f5;
	padding: 2px 6px;
	border-radius: 4px;
}

.markdown-body pre {
	background: #18181b;
	color: #e4e4e7;
	padding: 16px;
	border-radius: var(--radius-sm);
	overflow-x: auto;
}

.markdown-body pre code {
	background: transparent;
	color: inherit;
	padding: 0;
}

.markdown-body table {
	border-collapse: collapse;
	width: 100%;
	margin: .8em 0;
}

.markdown-body .table-wrapper {
	overflow-x: auto;
	margin: .8em 0;
}

.markdown-body .table-wrapper table {
	margin: 0;
}

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

.markdown-body th {
	background: #fafafa;
}

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

.markdown-body img {
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: var(--radius-sm);
	cursor: zoom-in;
}

/* 超宽公式可横向滚动（不撑破页面） */
.markdown-body .katex-display {
	overflow-x: auto;
	overflow-y: hidden;
	padding: 2px 0;
}

/* ---------------- 表单 ---------------- */
.form {
	display: flex;
	flex-direction: column;
	gap: 18px;
	max-width: 720px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.field-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--text);
}

.field-label em {
	color: var(--danger);
	font-style: normal;
}

.field-hint {
	font-size: 12px;
	color: var(--text-3);
}

.field input[type="text"],
.field input[type="search"],
.field input[type="password"],
.field input[type="email"],
.field input[type="number"],
.field input[type="file"],
.field select,
.field textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	font-size: 15px;
	font-family: inherit;
	color: var(--text);
	background: var(--surface);
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea {
	resize: vertical;
}

.field textarea.code {
	font-family: var(--mono);
	font-size: 14px;
	line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.field-readonly {
	color: var(--text-3);
	font-size: 13px;
	padding: 8px 0;
}

/* ---------------- 编辑页实时预览 ---------------- */
.editor {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	overflow: hidden;
}

.editor-toolbar {
	display: flex;
	gap: 4px;
	padding: 6px;
	border-bottom: 1px solid var(--border);
}

.editor-toolbar button {
	padding: 4px 12px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: var(--text-2);
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
}

.editor-toolbar button:hover {
	background: var(--accent-soft);
	color: var(--accent);
}

.editor-toolbar button.active {
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 600;
}

.editor-panes {
	display: flex;
}

.editor-input,
.editor-preview {
	flex: 1;
	min-width: 0;
}

.editor-input textarea {
	width: 100%;
	height: 420px;
	border: none;
	outline: none;
	padding: 14px 16px;
	font-family: var(--mono);
	font-size: 14px;
	line-height: 1.6;
	color: var(--text);
	background: transparent;
	resize: vertical;
}

.editor-preview {
	border-left: 1px solid var(--border);
	height: 420px;
	overflow: auto;
}

.editor-preview .markdown-body {
	border: none;
	border-radius: 0;
	background: transparent;
	padding: 14px 16px;
}

.editor[data-mode="edit"] .editor-preview {
	display: none;
}

.editor[data-mode="preview"] .editor-input {
	display: none;
}

.editor[data-mode="preview"] .editor-preview {
	border-left: none;
}

/* ---------------- 按钮 ---------------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s ease;
	font-family: inherit;
	white-space: nowrap;
}

.btn-primary {
	background: var(--accent);
	color: #fff;
}

.btn-primary:hover {
	background: var(--accent-strong);
}

.btn-ghost {
	background: var(--surface);
	border-color: var(--border);
	color: var(--text);
}

.btn-ghost:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.btn-danger {
	background: var(--surface);
	border-color: #fecaca;
	color: var(--danger);
}

.btn-danger:hover {
	background: var(--danger-soft);
	border-color: var(--danger);
}

.btn-sm {
	padding: 6px 14px;
	font-size: 13px;
}

/* ---------------- 后台 / 审核 ---------------- */
.admin-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.admin-section {
	margin-top: 32px;
}

.admin-section h2 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
}

.count-badge {
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 13px;
}

.admin-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.admin-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 18px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

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

.admin-item-title {
	font-weight: 600;
	font-size: 15px;
}

.admin-item-title a {
	color: var(--text);
}

.admin-item-title a:hover {
	color: var(--accent);
}

.admin-item-id {
	color: var(--text-3);
	font-size: 12px;
	margin-left: 8px;
}

.admin-item-meta {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 13px;
	margin-top: 2px;
	color: var(--text-2);
}

.admin-item-brief {
	margin: 8px 0 0;
	color: var(--text-2);
	font-size: 14px;
}

.admin-item-preview {
	margin: 8px 0 0;
	max-height: 180px;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	font-size: 14px;
	position: relative;
}

.admin-item-preview::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 48px;
	background: linear-gradient(transparent, var(--surface));
}

.admin-item-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.admin-item-actions form {
	margin: 0;
}

.admin-inline-input {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 6px 10px;
	font-size: 13px;
	font-family: inherit;
	background: var(--bg);
	color: var(--text);
	outline: none;
	width: 150px;
}

.admin-inline-input:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.admin-inline-select {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 6px 10px;
	font-size: 13px;
	font-family: inherit;
	background: var(--bg);
	color: var(--text);
	outline: none;
}

.admin-inline-select:focus {
	border-color: var(--accent);
}

.admin-action-form {
	display: flex;
	gap: 8px;
	align-items: center;
}

/* ---------------- 上传 ---------------- */
.upload-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}

.upload-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--text);
	transition: all .15s ease;
}

.upload-card:hover {
	border-color: var(--accent);
	box-shadow: var(--shadow);
}

.upload-card .card-title {
	font-size: 16px;
	font-weight: 600;
}

.upload-card .card-desc {
	font-size: 13px;
	color: var(--text-2);
}

.dropzone {
	border: 2px dashed var(--border);
	border-radius: var(--radius);
	padding: 24px;
	text-align: center;
	color: var(--text-2);
	background: var(--surface);
}

/* ---------------- 历史 / 回滚 ---------------- */
.history-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.history-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.history-main {
	min-width: 0;
}

.history-version {
	font-weight: 600;
	font-size: 14px;
}

.history-meta {
	font-size: 12px;
	color: var(--text-3);
	margin-top: 2px;
}

.history-note {
	font-size: 12px;
	color: var(--text-2);
	margin-top: 2px;
}

.history-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* ---------------- 评论 ---------------- */
.comment-list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.comment {
	padding: 12px 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.comment-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}

.comment-author {
	font-weight: 600;
	font-size: 14px;
}

.comment-date {
	color: var(--text-3);
	font-size: 12px;
}

.comment-body {
	margin: 0;
	color: var(--text);
	font-size: 14px;
}

.comment-body p {
	margin: 0 0 8px;
}

.comment-body p:last-child {
	margin-bottom: 0;
}

.comment-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 16px;
}

.comment-form textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	color: var(--text);
	background: var(--surface);
	outline: none;
	resize: vertical;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.comment-form textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------------- 贡献者 ---------------- */
.tier {
	margin-bottom: 28px;
}

.tier h2 {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 14px;
}

.user-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}

.user-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.user-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 700;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	overflow: hidden;
}

.user-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.user-info {
	min-width: 0;
}

.user-name {
	font-weight: 600;
	font-size: 14px;
}

.user-meta {
	font-size: 12px;
	color: var(--text-3);
}

/* ---------------- 个人主页 profile ---------------- */
.profile {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	padding: 20px;
	margin-bottom: 28px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.profile-avatar img,
.profile-avatar-ph {
	width: 80px;
	height: 80px;
	border-radius: 50%;
}

.profile-avatar img {
	object-fit: cover;
}

.profile-avatar-ph {
	background: var(--accent);
	color: #fff;
	font-size: 32px;
	font-weight: 700;
	display: grid;
	place-items: center;
}

.profile-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.profile-name {
	font-size: 20px;
	font-weight: 700;
}

.profile-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 6px;
}

.profile-form input[type="text"] {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 8px 12px;
	font-size: 14px;
	font-family: inherit;
	color: var(--text);
	background: var(--bg);
	outline: none;
}

.profile-form input[type="text"]:focus {
	border-color: var(--accent);
}

.profile-form label {
	cursor: pointer;
}

.profile-bio {
	flex-basis: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 8px 12px;
	font-size: 14px;
	font-family: inherit;
	background: var(--bg);
	color: var(--text);
	outline: none;
	resize: vertical;
	min-height: 40px;
}

.profile-bio:focus {
	border-color: var(--accent);
}

.profile-bio-text {
	margin: 0 0 4px;
	color: var(--text-2);
	font-size: 14px;
}

@media (max-width: 640px) {
	.profile {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.profile-info {
		align-items: center;
	}

	.profile-form {
		justify-content: center;
	}
}

/* ---------------- 其它 ---------------- */
.flash {
	margin-bottom: 16px;
	padding: 12px 16px;
	border-radius: var(--radius-sm);
	font-size: 14px;
}

.flash-ok {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.flash-error {
	background: var(--danger-soft);
	color: #991b1b;
	border: 1px solid #fecaca;
}

.empty {
	text-align: center;
	padding: 48px 0;
	color: var(--text-2);
}

.empty-code {
	font-size: 64px;
	margin: 0;
	color: var(--text-3);
	font-weight: 700;
}

.empty .btn {
	margin-top: 12px;
}

.login {
	max-width: 360px;
	margin: 40px auto;
}

/* ---------------- 响应式 ---------------- */
/* 平板：编辑页预览上下堆叠 */
@media (max-width: 720px) {
	.editor-panes {
		flex-direction: column;
	}

	.editor-preview {
		border-left: none;
		border-top: 1px solid var(--border);
		height: 320px;
	}

	.editor-input textarea {
		height: 320px;
	}
}

@media (max-width: 640px) {
	.brand-title {
		font-size: 34px;
	}

	.topbar {
		flex-wrap: wrap;
		gap: 10px;
		padding: 10px 16px;
	}

	.topsearch {
		order: 3;
		flex-basis: 100%;
		max-width: none;
	}

	.nav-toggle {
		display: block;
		margin-left: auto;
	}

	.nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		margin-left: 0;
		padding: 8px 16px;
		background: var(--surface);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow);
	}

	.nav.open {
		display: flex;
	}

	.nav a {
		padding: 10px 8px;
	}

	.nav-links,
	.nav-user-area {
		flex-direction: column;
		align-items: stretch;
		padding-left: 0;
		margin-left: 0;
		border-left: none;
	}

	.nav-user-area {
		border-top: 1px solid var(--border);
		padding-top: 8px;
		margin-top: 4px;
	}

	.admin-item {
		flex-direction: column;
	}

	.admin-item-actions {
		align-self: flex-end;
	}

	.upload-grid {
		grid-template-columns: 1fr;
	}

	.markdown-body {
		padding: 18px 16px;
	}

	.container {
		padding: 20px 16px 48px;
	}

	.footer {
		flex-wrap: wrap;
		gap: 12px 20px;
	}
}

/* ---------------- 明暗主题切换 ---------------- */
.theme-toggle {
	width: 34px;
	height: 34px;
	padding: 0;
	display: grid;
	place-items: center;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-size: 15px;
	cursor: pointer;
	transition: all .15s ease;
}

.theme-toggle:hover {
	border-color: var(--accent);
}

.theme-toggle-fixed {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 20;
}

/* ---------------- 夜间模式 ---------------- */
[data-theme="dark"] {
	--bg: #0e0e11;
	--surface: #1b1b1f;
	--border: #2a2a30;
	--text: #ececee;
	--text-2: #a1a1aa;
	--text-3: #71717a;
	--accent: #818cf8;
	--accent-strong: #a5b4fc;
	--accent-soft: #26263a;
	--green: #34d399;
	--danger: #f87171;
	--danger-soft: #3a1d1d;
	--amber: #fbbf24;
	--amber-soft: #3a2f14;
	--shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .4);
	--shadow-lg: 0 2px 6px rgba(0, 0, 0, .6), 0 20px 48px rgba(0, 0, 0, .5);
}

[data-theme="dark"] body.home {
	background:
		radial-gradient(1200px 600px at 50% -10%, #1e1b4b 0%, transparent 60%),
		var(--bg);
}

[data-theme="dark"] .topbar {
	background: rgba(20, 20, 24, .85);
}

[data-theme="dark"] .markdown-body code {
	background: #2a2a30;
}

[data-theme="dark"] .markdown-body th {
	background: #1b1b1f;
}

[data-theme="dark"] .markdown-body pre {
	background: #0b0b0d;
	border: 1px solid var(--border);
}

[data-theme="dark"] .flash-ok {
	background: #0f2a1f;
	color: #6ee7b7;
	border-color: #1d4a33;
}

[data-theme="dark"] .badge-online,
[data-theme="dark"] .badge-member {
	background: #0f2a1f;
	color: #6ee7b7;
}

[data-theme="dark"] .badge-admin {
	background: #3a1d1d;
	color: #fca5a5;
}

[data-theme="dark"] .badge-manager {
	background: var(--accent-soft);
	color: var(--accent);
}

[data-theme="dark"] .badge-review {
	background: var(--amber-soft);
	color: var(--amber);
}

[data-theme="dark"] .badge-delete {
	background: #26262b;
	color: var(--text-3);
}

[data-theme="dark"] .chip-group {
	background: #0f2a1f;
	color: var(--green);
}

[data-theme="dark"] .admin-item-preview::after {
	background: linear-gradient(transparent, var(--surface));
}

[data-theme="dark"] .user-avatar {
	background: var(--accent-soft);
}

/* ---------------- 图片灯箱（点击查看原图） ---------------- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .82);
	padding: 24px;
	cursor: zoom-out;
}

.lightbox.open {
	display: flex;
}

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 8px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}

/* ---------------- 图片确认步文件选择 ---------------- */
.confirm-file {
	font-size: 13px;
	color: var(--text-2);
	max-width: 220px;
}

/* ---------------- 明暗主题图标（太阳 / 月亮） ---------------- */
.theme-icon {
	display: none;
}

.theme-moon {
	display: block;
}

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

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

/* ---------------- 归档页（search检索 / 排序 / 筛选 / 批量管理） ---------------- */
.archive-ops {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 28px;
}

.ops-section {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 18px;
}

.ops-title {
	margin: 0 0 12px;
	font-size: 13px;
	font-weight: 700;
	color: var(--text-2);
	letter-spacing: .02em;
}

.search-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.search-row {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.search-box {
	flex: 1;
	min-width: 0;
}

.search-bar {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg);
	overflow: hidden;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.search-bar:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box .search-input {
	width: 100%;
	min-height: 42px;
	padding: 7px 12px;
	font-size: 15px;
	font-family: inherit;
	background: var(--bg);
	color: var(--text);
	outline: none;
	line-height: 1.9;
	cursor: text;
}

.search-box .search-input:empty::before {
	content: attr(data-placeholder);
	color: var(--text-2);
	opacity: .65;
	pointer-events: none;
}

.search-submit {
	flex-shrink: 0;
	width: 64px;
	border: none;
	border-left: 1px solid var(--border);
	background: var(--surface);
	color: var(--accent);
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background .15s ease;
}

.search-submit:hover {
	background: var(--accent-soft);
}

.qchip {
	display: inline-block;
	padding: 1px 8px;
	margin: 0 2px;
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.9;
	white-space: nowrap;
}

.qchip-tag {
	background: var(--accent-soft);
	color: var(--accent);
}

.qchip-group {
	background: #ecfdf5;
	color: var(--green);
}

.qchip-exact {
	background: #f4f4f5;
	color: var(--text-2);
	font-weight: 600;
}

.qchip-neg {
	background: var(--danger-soft);
	color: var(--danger);
	text-decoration: line-through;
}

[data-theme="dark"] .qchip-group {
	background: #0f2a1f;
	color: var(--green);
}

[data-theme="dark"] .qchip-exact {
	background: #26262b;
	color: var(--text-2);
}

.search-add {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.search-tokens {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.search-tokens:empty {
	display: none;
}

.token {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	line-height: 1.6;
}

.token-tag {
	background: var(--accent-soft);
	color: var(--accent);
}

.token-group {
	background: #ecfdf5;
	color: var(--green);
}

.token-neg {
	background: var(--danger-soft);
	color: var(--danger);
	text-decoration: line-through;
}

.token-exact {
	background: #f4f4f5;
	color: var(--text-2);
	font-weight: 600;
}

.token-text {
	background: #f4f4f5;
	color: var(--text-2);
}

[data-theme="dark"] .token-tag {
	background: var(--accent-soft);
	color: var(--accent);
}

[data-theme="dark"] .token-group {
	background: #0f2a1f;
	color: var(--green);
}

[data-theme="dark"] .token-neg {
	background: var(--danger-soft);
	color: var(--danger);
}

[data-theme="dark"] .token-exact,
[data-theme="dark"] .token-text {
	background: #26262b;
	color: var(--text-2);
}

.search-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
}

.search-controls-left {
	display: flex;
	align-items: center;
	gap: 8px;
}

.seg {
	display: inline-flex;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.seg-item {
	padding: 6px 14px;
	border: none;
	background: var(--bg);
	color: var(--text-2);
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
	transition: all .12s ease;
}

.seg-item + .seg-item {
	border-left: 1px solid var(--border);
}

.seg-item:hover {
	color: var(--accent);
}

.seg-item.active {
	background: var(--accent);
	color: #fff;
	font-weight: 600;
}

.order-toggle {
	min-width: 76px;
}

.select-all {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--text-2);
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.select-all input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
}

.select-all .checkmark {
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	position: relative;
	transition: all .15s ease;
	flex-shrink: 0;
}

.select-all:hover .checkmark {
	border-color: var(--accent);
}

.select-all input:checked + .checkmark {
	background: var(--accent);
	border-color: var(--accent);
}

.select-all input:checked + .checkmark::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.sort-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}

.sort-left {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

/* ---------------- 归档条目卡片 ---------------- */
.archive-list {
	gap: 0;
}

.archive-item {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 0;
	padding: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 0;
	overflow: hidden;
}

.archive-item-main {
	flex: 1;
	min-width: 0;
	padding: 16px 18px;
}

.archive-item-side {
	flex-shrink: 0;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 14px;
}

.item-check {
	flex-shrink: 0;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	border-left: 1px solid var(--border);
	background: var(--bg);
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	transition: background .15s ease;
}

.item-check:hover {
	background: var(--accent-soft);
}

.item-check input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
}

.item-check .checkmark {
	width: 22px;
	height: 22px;
	border: 1.5px solid var(--border);
	border-radius: 6px;
	background: var(--surface);
	position: relative;
	transition: all .15s ease;
	pointer-events: none;
}

.item-check:hover .checkmark {
	border-color: var(--accent);
}

.item-check input:checked + .checkmark {
	background: var(--accent);
	border-color: var(--accent);
}

.item-check input:checked + .checkmark::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 12px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.archive-item + .archive-item {
	border-top: none;
}

.archive-item:first-child {
	border-radius: var(--radius) var(--radius) 0 0;
}

.archive-item:last-child {
	border-radius: 0 0 var(--radius) var(--radius);
}

.archive-item:first-child:last-child {
	border-radius: var(--radius);
}

.archive-item-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.archive-item-title {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	min-width: 0;
}

.archive-item-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.archive-item-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 10px;
}

.archive-item-actions form {
	margin: 0;
}

.inline-status {
	display: inline-flex;
}

.result-id {
	font-family: var(--mono);
}

/* ---------------- 美化多选框 ---------------- */
.pretty-check {
	position: relative;
	display: inline-block;
	width: 20px;
	height: 20px;
	cursor: pointer;
	flex-shrink: 0;
}

.pretty-check input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.pretty-check .checkmark {
	position: absolute;
	inset: 0;
	border: 1.5px solid var(--border);
	border-radius: 6px;
	background: var(--bg);
	transition: all .15s ease;
	pointer-events: none;
}

.pretty-check:hover .checkmark {
	border-color: var(--accent);
}

.pretty-check input:checked + .checkmark {
	background: var(--accent);
	border-color: var(--accent);
}

.pretty-check input:checked + .checkmark::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------------- 分类页 ---------------- */
.cat-chip {
	padding: 6px 14px;
	font-size: 13px;
}

.cat-count {
	margin-left: 6px;
	opacity: .65;
	font-size: 11px;
}

/* ---------------- 个人主页：头像蒙版与编辑按钮 ---------------- */
.profile-avatar-wrap {
	position: relative;
	width: 80px;
	height: 80px;
	flex-shrink: 0;
}

.profile-avatar-wrap .profile-avatar,
.profile-avatar-wrap .profile-avatar-ph {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: block;
}

.avatar-form {
	margin: 0;
}

.avatar-mask {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: rgba(0, 0, 0, .45);
	color: #fff;
	opacity: 0;
	transition: opacity .15s ease;
	cursor: pointer;
}

.avatar-mask input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.profile-avatar-wrap:hover .avatar-mask,
.avatar-mask:focus-within {
	opacity: 1;
}

.avatar-mask[aria-disabled="true"] {
	opacity: .6;
	cursor: not-allowed;
}

.edit-icon {
	display: block;
}

.edit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--surface);
	color: var(--text-3);
	cursor: pointer;
	transition: all .15s ease;
	flex-shrink: 0;
}

.edit-btn:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.profile-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.profile-field-head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.profile-field-head .field-hint {
	font-size: 12px;
	color: var(--amber);
}

.inline-edit-form {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.inline-edit-form input[type="text"] {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 8px 12px;
	font-size: 14px;
	font-family: inherit;
	background: var(--bg);
	color: var(--text);
	outline: none;
	flex: 1;
	min-width: 160px;
}

.inline-edit-form textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 8px 12px;
	font-size: 14px;
	font-family: inherit;
	background: var(--bg);
	color: var(--text);
	outline: none;
	resize: vertical;
	min-height: 48px;
}

.inline-edit-form input[type="text"]:focus,
.inline-edit-form textarea:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 行内编辑：输入框与原文原地同尺寸，避免切换时跳动 */
.profile-field-head .inline-edit-form {
	gap: 6px;
}

.profile-field-head .inline-edit-form input[type="text"] {
	font-size: 20px;
	font-weight: 700;
	min-width: 120px;
	padding: 4px 10px;
	color: var(--text);
}

.inline-edit-form .btn-sm {
	font-size: 12px;
	padding: 6px 10px;
}

/* 头像蒙版内的铅笔图标居中且不随悬停位移 */
.avatar-mask svg {
	pointer-events: none;
}
