/* Manga — 漫画风格 + 粗黑描边 + 网点纸效果 + 对话框气泡 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=Kosugi+Maru&display=swap');

:root {
	--mg-bg: #ffffff;
	--mg-paper: #fffef8;
	--mg-ink: #1a1a1a;
	--mg-muted: #666666;
	--mg-accent: #ff4444;
	--mg-accent-blue: #4488ff;
	--mg-accent-yellow: #ffcc00;
	--mg-accent-green: #44cc88;
	--mg-border: 3px solid #000;
	--mg-shadow: 6px 6px 0 #000;
	--mg-radius: 0;
	--mg-max: 1200px;
	--mg-gutter: clamp(1rem, 4vw, 2rem);
	--mg-font: "Noto Sans SC", "Kosugi Maru", "Comic Sans MS", sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	padding: 0;
	color: var(--mg-ink);
	font-size: 16px;
	line-height: 1.7;
	font-family: var(--mg-font);
	background: var(--mg-bg);
	background-image: 
		radial-gradient(circle at 25% 25%, #f0f0f0 2px, transparent 2px),
		radial-gradient(circle at 75% 75%, #f0f0f0 2px, transparent 2px);
	background-size: 20px 20px;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--mg-accent);
	text-decoration: none;
	font-weight: 700;
	transition: all 0.2s ease;
}

a:hover {
	color: var(--mg-accent-blue);
	transform: scale(1.05);
	display: inline-block;
}

ol, ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

img {
	border: var(--mg-border);
	max-width: 100%;
	height: auto;
	box-shadow: var(--mg-shadow);
}

p, dl, dd, dt, h1, h2, h3, h4, h5, h6 {
	margin: 0;
	padding: 0;
}

.clear {
	clear: both;
}

/* ========== 漫画气泡对话框 ========== */
.speech-bubble {
	position: relative;
	background: #fff;
	border: var(--mg-border);
	padding: 1.5rem;
	box-shadow: var(--mg-shadow);
}

.speech-bubble::after {
	content: "";
	position: absolute;
	bottom: -15px;
	left: 30px;
	width: 0;
	height: 0;
	border: 15px solid transparent;
	border-top-color: #000;
	border-bottom: 0;
	margin-left: -15px;
	margin-bottom: -3px;
}

.speech-bubble::before {
	content: "";
	position: absolute;
	bottom: -10px;
	left: 30px;
	width: 0;
	height: 0;
	border: 15px solid transparent;
	border-top-color: #fff;
	border-bottom: 0;
	margin-left: -15px;
	z-index: 1;
}

/* ========== 网点纸效果 ========== */
.halftone {
	background-color: #fff;
	background-image: radial-gradient(circle, #000 1.5px, transparent 2px);
	background-size: 8px 8px;
}

.speed-lines {
	background: repeating-linear-gradient(
		90deg,
		transparent,
		transparent 10px,
		rgba(0,0,0,0.03) 10px,
		rgba(0,0,0,0.03) 12px
	);
}

/* ========== 外壳布局 ========== */
#divAll {
	width: 100%;
	max-width: var(--mg-max);
	margin: 0 auto;
	padding: var(--mg-gutter);
}

#divPage {
	width: 100%;
}

#divMiddle {
	width: 100%;
}

/* ========== 顶部区域 ========== */
#divTop {
	text-align: center;
	padding: 2rem 2rem 1.5rem;
	margin-bottom: 2rem;
	background: var(--mg-accent-yellow);
	border: var(--mg-border);
	box-shadow: var(--mg-shadow);
	position: relative;
	transform: rotate(-1deg);
}

/* 漫画效果线 */
#divTop::before {
	content: "";
	position: absolute;
	top: -10px;
	left: -10px;
	right: -10px;
	bottom: -10px;
	background: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 10px,
		var(--mg-accent) 10px,
		var(--mg-accent) 12px
	);
	z-index: -1;
}

/* 闪光效果 */
#divTop::after {
	content: "★";
	position: absolute;
	top: 10px;
	right: 20px;
	font-size: 2rem;
	color: #fff;
	text-shadow: 3px 3px 0 #000;
	animation: sparkle 1s infinite;
}

@keyframes sparkle {
	0%, 100% { transform: scale(1) rotate(0deg); }
	50% { transform: scale(1.2) rotate(180deg); }
}

#BlogTitle {
	font-family: var(--mg-font);
	font-size: clamp(2.5rem, 7vw, 4.5rem);
	font-weight: 900;
	color: var(--mg-ink);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 0.5rem;
	text-shadow: 4px 4px 0 #fff, 6px 6px 0 #000;
	-webkit-text-stroke: 2px #000;
}

#BlogTitle a {
	color: var(--mg-ink);
	-webkit-text-stroke: 2px #000;
}

#BlogSubTitle {
	font-size: 1rem;
	font-weight: 700;
	color: var(--mg-ink);
	background: #fff;
	display: inline-block;
	padding: 0.5rem 1.5rem;
	border: 3px solid #000;
	transform: rotate(2deg);
	box-shadow: 4px 4px 0 #000;
}

/* ========== 导航栏 ========== */
#divNavBar {
	margin-bottom: 2rem;
	padding: 1rem;
	background: var(--mg-accent-blue);
	border: var(--mg-border);
	box-shadow: var(--mg-shadow);
	transform: rotate(1deg);
}

#divNavBar h3 {
	display: none;
}

#divNavBar ul {
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

#divNavBar a {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 900;
	color: #fff;
	background: var(--mg-ink);
	border: 3px solid #fff;
	box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
	transform: rotate(-2deg);
	transition: all 0.2s ease;
	text-shadow: none;
}

#divNavBar a:hover,
#divNavBar a.on {
	background: var(--mg-accent);
	transform: rotate(2deg) scale(1.1);
	box-shadow: 6px 6px 0 rgba(0,0,0,0.3);
}

/* ========== 主内容区 ========== */
#divMain {
	float: left;
	width: 65%;
	padding-right: 2rem;
}

/* ========== 侧边栏 ========== */
#divSidebar {
	float: right;
	width: 35%;
}

/* ========== 文章卡片 ========== */
div.post {
	margin-bottom: 2.5rem;
	padding: 1.5rem;
	background: #fff;
	border: var(--mg-border);
	box-shadow: var(--mg-shadow);
	position: relative;
}

/* 漫画格子效果 */
div.post::before {
	content: "";
	position: absolute;
	top: 10px;
	right: 10px;
	width: 20px;
	height: 20px;
	background: var(--mg-accent);
	border: 2px solid #000;
}

/* 速度线背景 */
div.post::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 20px,
		rgba(0,0,0,0.02) 20px,
		rgba(0,0,0,0.02) 22px
	);
	pointer-events: none;
	z-index: 0;
}

div.post > * {
	position: relative;
	z-index: 1;
}

div.post:last-of-type {
	margin-bottom: 0;
}

/* 不同颜色的卡片 */
div.post:nth-child(4n+1) { background: #fff; }
div.post:nth-child(4n+2) { background: #fffef0; }
div.post:nth-child(4n+3) { background: #f0fff5; }
div.post:nth-child(4n+4) { background: #fff5f5; }

/* 文章日期 */
div.post .post-date {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 900;
	color: #fff;
	background: var(--mg-ink);
	padding: 0.3rem 1rem;
	margin-bottom: 1rem;
	border: 2px solid #fff;
	box-shadow: 3px 3px 0 #000;
	transform: rotate(-3deg);
}

/* 文章标题 */
div.post .post-title {
	font-size: 1.5rem;
	font-weight: 900;
	color: var(--mg-ink);
	margin-bottom: 1rem;
	line-height: 1.3;
	text-shadow: 2px 2px 0 #fff;
	border-bottom: 4px solid var(--mg-ink);
	padding-bottom: 0.5rem;
}

div.post .post-title a {
	color: var(--mg-ink);
	text-shadow: 2px 2px 0 #fff;
}

div.post .post-title a:hover {
	color: var(--mg-accent);
}

/* 文章内容 */
div.post div.post-body {
	color: var(--mg-ink);
	font-size: 1rem;
	line-height: 1.8;
	margin-bottom: 1.5rem;
	background: #fff;
	padding: 1rem;
	border: 2px solid #000;
}

/* 文章底部 */
div.post .post-footer {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--mg-ink);
	background: var(--mg-accent-green);
	display: inline-block;
	padding: 0.5rem 1rem;
	border: 2px solid #000;
	box-shadow: 3px 3px 0 #000;
}

/* ========== 单篇文章详情 ========== */
div.post.single {
	padding: 2rem;
	background: #fff;
}

div.post.single .post-title {
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	text-align: center;
	border-bottom: 6px solid var(--mg-ink);
	padding-bottom: 1rem;
	margin-bottom: 2rem;
}

div.post.single .post-date {
	display: block;
	text-align: center;
	margin-bottom: 1.5rem;
	background: var(--mg-accent);
}

/* ========== 侧边栏模块 ========== */
.function {
	margin-bottom: 2rem;
	padding: 1.25rem;
	background: #fff;
	border: var(--mg-border);
	box-shadow: var(--mg-shadow);
	position: relative;
}

/* 爆炸对话框效果 */
.function::before {
	content: "BAM!";
	position: absolute;
	top: -15px;
	right: 10px;
	font-size: 0.75rem;
	font-weight: 900;
	color: var(--mg-accent);
	background: #fff;
	padding: 0.25rem 0.5rem;
	border: 2px solid #000;
	transform: rotate(15deg);
}

.function .function_t {
	font-size: 1.125rem;
	font-weight: 900;
	color: #fff;
	background: var(--mg-ink);
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	border: 2px solid #fff;
	box-shadow: 4px 4px 0 #000;
	transform: rotate(-1deg);
}

.function li {
	padding: 0.75rem;
	margin-bottom: 0.5rem;
	font-size: 0.9375rem;
	font-weight: 700;
	background: #f5f5f5;
	border: 2px solid #000;
	box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
	transition: all 0.2s ease;
}

.function li:hover {
	transform: translate(-2px, -2px);
	box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
	background: var(--mg-accent-yellow);
}

.function li:last-child {
	margin-bottom: 0;
}

.function a {
	color: var(--mg-ink);
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.function a:hover {
	color: var(--mg-accent);
}

/* ========== 文章内容样式 ========== */
div.post-body {
	color: var(--mg-ink);
	font-size: 1rem;
	line-height: 1.9;
}

div.post-body p {
	margin-bottom: 1.5em;
}

div.post-body a {
	color: var(--mg-accent);
	border-bottom: 3px solid var(--mg-accent);
	padding: 0 0.2rem;
}

div.post-body a:hover {
	background: var(--mg-accent);
	color: #fff;
}

div.post-body h1,
div.post-body h2,
div.post-body h3,
div.post-body h4,
div.post-body h5,
div.post-body h6 {
	font-weight: 900;
	color: var(--mg-ink);
	margin: 1.5em 0 0.5em;
	background: var(--mg-accent-yellow);
	display: inline-block;
	padding: 0.5rem 1rem;
	border: 3px solid #000;
	box-shadow: 4px 4px 0 #000;
}

div.post-body h1 {
	font-size: 1.75rem;
	transform: rotate(-1deg);
}

div.post-body h2 {
	font-size: 1.5rem;
	background: var(--mg-accent-blue);
	color: #fff;
	transform: rotate(1deg);
}

div.post-body h3 {
	font-size: 1.25rem;
	background: var(--mg-accent-green);
}

div.post-body blockquote {
	margin: 1.5rem 0;
	padding: 1.5rem;
	background: #f0f0f0;
	border: 3px solid #000;
	box-shadow: 6px 6px 0 #000;
	position: relative;
	font-style: normal;
	font-weight: 700;
}

div.post-body blockquote::before {
	content: "";
	position: absolute;
	top: -15px;
	left: 20px;
	width: 0;
	height: 0;
	border: 15px solid transparent;
	border-bottom-color: #000;
	border-top: 0;
}

div.post-body blockquote::after {
	content: "";
	position: absolute;
	top: -10px;
	left: 23px;
	width: 0;
	height: 0;
	border: 12px solid transparent;
	border-bottom-color: #f0f0f0;
	border-top: 0;
}

div.post-body code {
	font-family: "Courier New", monospace;
	font-size: 0.875em;
	font-weight: 700;
	color: var(--mg-ink);
	background: var(--mg-accent-yellow);
	padding: 0.2em 0.5em;
	border: 2px solid #000;
}

div.post-body pre {
	background: #f8f8f8;
	border: var(--mg-border);
	box-shadow: var(--mg-shadow);
	padding: 1.5rem;
	margin: 1.5rem 0;
	overflow-x: auto;
}

div.post-body pre code {
	background: none;
	border: none;
	padding: 0;
}

div.post-body ul,
div.post-body ol {
	margin: 1.5rem 0;
	padding-left: 1.5rem;
}

div.post-body li {
	margin: 0.75rem 0;
	font-weight: 700;
	position: relative;
}

div.post-body ul li::marker {
	content: "▸";
	color: var(--mg-accent);
	font-size: 1.25rem;
}

div.post-body table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 1.5rem 0;
	font-size: 0.9375rem;
	border: 3px solid #000;
	box-shadow: var(--mg-shadow);
}

div.post-body th,
div.post-body td {
	padding: 1rem;
	border: 2px solid #000;
	text-align: left;
	font-weight: 700;
}

div.post-body th {
	background: var(--mg-ink);
	color: #fff;
}

div.post-body tr:nth-child(even) {
	background: #f5f5f5;
}

/* ========== 分页 ========== */
div.pagebar {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 4px dashed #000;
	text-align: center;
}

span.page,
span.now-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3rem;
	height: 3rem;
	margin: 0 0.5rem;
	font-size: 1rem;
	font-weight: 900;
	color: var(--mg-ink);
	background: #fff;
	border: 3px solid #000;
	box-shadow: 4px 4px 0 #000;
	transition: all 0.2s ease;
}

span.page:hover {
	background: var(--mg-accent-yellow);
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 0 #000;
}

span.now-page {
	background: var(--mg-accent);
	color: #fff;
	transform: rotate(-5deg);
}

/* ========== 评论 ========== */
ul.msg {
	margin: 1.5rem 0;
	padding: 1.25rem;
	background: #fff;
	border: var(--mg-border);
	box-shadow: var(--mg-shadow);
}

li.msgname {
	font-weight: 900;
	color: #fff;
	background: var(--mg-ink);
	display: inline-block;
	padding: 0.5rem 1rem;
	margin-bottom: 0.5rem;
	border: 2px solid #fff;
	box-shadow: 3px 3px 0 #000;
}

li.msgarticle {
	font-weight: 700;
	color: var(--mg-ink);
	line-height: 1.7;
	background: #f5f5f5;
	padding: 1rem;
	border: 2px solid #000;
}

li.msgtime {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--mg-muted);
	margin-top: 1rem;
}

/* 评论表单 */
#divCommentPost {
	margin-top: 2rem;
	padding: 1.5rem;
	background: var(--mg-accent-blue);
	border: var(--mg-border);
	box-shadow: var(--mg-shadow);
}

#divCommentPost a[name="comment"] {
	font-size: 1.25rem;
	font-weight: 900;
	color: #fff;
	background: var(--mg-ink);
	padding: 0.5rem 1rem;
	border: 2px solid #fff;
	box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
	display: inline-block;
	margin-bottom: 1rem;
}

input.text,
#txaArticle {
	width: 100%;
	padding: 1rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--mg-ink);
	background: #fff;
	border: 3px solid #000;
	box-shadow: 4px 4px 0 #000;
	font-family: var(--mg-font);
	transition: all 0.2s ease;
}

input.text:focus,
#txaArticle:focus {
	outline: none;
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 0 #000;
}

#txaArticle {
	min-height: 120px;
	resize: vertical;
}

input.button {
	padding: 1rem 3rem;
	font-size: 1rem;
	font-weight: 900;
	color: var(--mg-ink);
	background: var(--mg-accent-yellow);
	border: 3px solid #000;
	box-shadow: 4px 4px 0 #000;
	cursor: pointer;
	font-family: var(--mg-font);
	transition: all 0.2s ease;
	text-transform: uppercase;
}

input.button:hover {
	background: var(--mg-accent);
	color: #fff;
	transform: translate(-3px, -3px);
	box-shadow: 7px 7px 0 #000;
}

input.button:active {
	transform: translate(0, 0);
	box-shadow: 2px 2px 0 #000;
}

/* ========== 页脚 ========== */
#divBottom {
	clear: both;
	margin-top: 2rem;
	padding: 2rem;
	text-align: center;
	background: var(--mg-ink);
	border: 4px solid #000;
	box-shadow: 8px 8px 0 var(--mg-accent);
	position: relative;
}

#divBottom::before {
	content: "◆ ◆ ◆";
	position: absolute;
	top: -15px;
	left: 50%;
	transform: translateX(-50%);
	background: #fff;
	padding: 0 1rem;
	font-size: 1rem;
	font-weight: 900;
	color: var(--mg-accent);
}

#BlogCopyRight {
	font-size: 0.875rem;
	font-weight: 700;
	color: #fff;
	line-height: 1.8;
}

#BlogCopyRight a {
	color: var(--mg-accent-yellow);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
	#divMain {
		float: none;
		width: 100%;
		padding-right: 0;
		margin-bottom: 2rem;
	}
	
	#divSidebar {
		float: none;
		width: 100%;
	}
	
	div.post.single {
		padding: 1.5rem;
	}
	
	#BlogTitle {
		font-size: 2rem;
	}
}

@media (max-width: 640px) {
	div.post {
		padding: 1rem;
	}
	
	.function {
		padding: 1rem;
	}
	
	#divCommentPost {
		padding: 1rem;
	}
	
	#divBottom {
		padding: 1.5rem;
	}
}
