/*
 * jason.wa 的文档库 - 自定义样式
 * 中文排版优化
 */

/* 中文系统字体栈 */
body {
	font-family:
		-apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
		"Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Helvetica, Arial,
		sans-serif;
	font-size: 0.85rem;
}

/* 正文行高 */
.md-content p,
.md-content li {
	line-height: 1.8;
}

/* 正文宽度约束 */
.md-grid {
	max-width: 68rem;
}

.md-content {
	max-width: 48rem;
}

/* 标题层级 */
.md-content h1 {
	font-size: 1.75rem;
	font-weight: 700;
	margin-top: 1.5rem;
	margin-bottom: 1rem;
}

.md-content h2 {
	font-size: 1.35rem;
	font-weight: 600;
	margin-top: 1.5rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-content h3 {
	font-size: 1.1rem;
	font-weight: 600;
	margin-top: 1.25rem;
	margin-bottom: 0.5rem;
}

.md-content h4 {
	font-size: 1rem;
	font-weight: 600;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
	color: var(--md-default-fg-color--light);
}

/* 图片圆角 */
.md-content img {
	border-radius: 6px;
}

/* 按钮圆角 */
.md-button {
	border-radius: 6px !important;
}

/* 表格样式优化 */
.md-content table {
	font-size: 0.85rem;
}

.md-content table th {
	font-weight: 600;
}

/* 代码块微调 */
.md-content .highlight {
	border-radius: 6px;
}

/* 引用样式 */
.md-content blockquote {
	border-left: 4px solid var(--md-primary-fg-color);
	padding-left: 1rem;
	color: var(--md-default-fg-color--light);
}

/* 深色模式调整 */
[data-md-color-scheme="slate"] .md-content h2 {
	border-bottom-color: var(--md-default-fg-color--lightest);
}

[data-md-color-scheme="slate"] .md-content blockquote {
	color: var(--md-default-fg-color);
}

/* ===== 首页卡片 ===== */

/* 4 列网格布局：桌面 4 列，平板 2 列 */
.md-typeset .grid.cards {
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: 0.8rem;
}

.md-typeset .grid.cards > ul > li {
	border-radius: 10px;
	padding: 1.2rem 1rem 1rem;
	transition:
		box-shadow 0.15s ease,
		transform 0.15s ease;
	display: flex;
	flex-direction: column;
}

.md-typeset .grid.cards > ul > li:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* 卡片内按钮底部对齐 */
.md-typeset .grid.cards > ul > li > p:last-child {
	margin-top: auto;
	margin-bottom: 0;
}

/* 首页副标题 */
.md-content h1 + p {
	font-size: 1rem;
	color: var(--md-default-fg-color--light);
	margin-top: -0.5rem;
	margin-bottom: 1.5rem;
}

/* 导航顶部间距 */
.md-header__inner {
	padding-top: 0.2rem;
	padding-bottom: 0.2rem;
}

/* 搜索框优化 */
.md-search__input {
	font-size: 0.8rem;
}

/* 页脚 */
.md-footer .md-footer-meta {
	font-size: 0.75rem;
}
