/* 全局样式 */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: linear-gradient(135deg, #dfdfdf 0%, #ffffff 100%);
	min-height: 100vh;
	padding: 20px;
}

.container {
	max-width: 70vw;
	margin: 0 auto;
}

/* 头部区域 */
header {
	background: white;
	padding: 30px;
	border-radius: 15px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.1);
	margin-bottom: 30px;
	width: 100%;
}

h1 {
	color: #000;
	font-size: 2.5em;
	margin-bottom: 10px;
}

header > p {
	color: #666;
	font-size: 1.1em;
}

/* 按钮 */
button {
	padding: 12px 24px;
	background: linear-gradient(135deg, #000 0%, #333 100%);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 1em;
	cursor: pointer;
	transition: transform 0.2s;
}

button:hover {
	transform: translateY(-2px);
}

button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* 文章网格 - 单列布局 */
.posts-grid {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-bottom: 30px;
	width: 100%;
}

.post-card {
	background: white;
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 5px 20px rgba(0,0,0,0.1);
	transition: transform 0.3s, box-shadow 0.3s;
	display: flex;
	flex-direction: column;
}

.post-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 图片容器 - 全宽 */
.post-images {
	position: relative;
	width: 100%;
	min-height: 200px;
	max-height: 500px;
	background: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* 图片占位符 */
.image-placeholder {
	position: absolute;
	color: #999;
	font-size: 0.85em;
	pointer-events: none;
	z-index: 1;
	text-align: center;
}

/* 图片元素 */
.post-images .post-image {
	position: relative;
	z-index: 2;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.post-images .post-image.loaded {
	opacity: 1;
}

.post-images .post-image.load-error {
	display: none;
}

/* 单图模式 */
.post-images.single .post-image {
	width: 100%;
	height: auto;
	max-height: 500px;
	object-fit: contain;
	display: block;
}

/* 多图模式 - 按钮切换 */
.post-images.multiple {
	position: relative;
}

.post-images.multiple .post-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: auto;
	max-height: 500px;
	object-fit: contain;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.post-images.multiple .post-image.active {
	opacity: 1;
	pointer-events: auto;
	position: relative;
}

/* 图片导航按钮 */
.image-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.6);
	color: white;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 1.5em;
	cursor: pointer;
	z-index: 10;
	transition: background 0.3s;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.image-nav:hover {
	background: rgba(0, 0, 0, 0.8);
	transform: translateY(-50%) scale(1.1);
}

.image-nav.prev {
	left: 10px;
}

.image-nav.next {
	right: 10px;
}

/* 图片数量标签 */
.image-count {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.75);
	color: white;
	padding: 6px 12px;
	border-radius: 15px;
	font-size: 0.85em;
	font-weight: 600;
	pointer-events: none;
	z-index: 5;
}

.post-user {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 15px 20px;
	border-bottom: 1px solid #f0f0f0;
	background: #fafafa;
}

.post-source {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: #f5f5f5;
	border-bottom: 1px solid #e0e0e0;
}

.game-tag {
	color: white;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 0.8em;
	font-weight: 600;
}

.game-tag.game-zmz {
	background: #b2b300;
}

.game-tag.game-lzxc {
	background: #b30000;
}

.game-tag.game-pmpm {
	background: #3c00b3;
}

.game-tag.game-nstg {
	background: #002db3;
}

.game-tag.game-default {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-tag {
	color: white;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 0.8em;
	font-weight: 600;
}

.category-tag.category-forum {
	background: #ff511a;
}

.category-tag.category-guide {
	background: #ffc61a;
}

.category-tag.category-event {
	background: #0099cc;
}

.category-tag.category-help {
	background: #3300cc;
}

.category-tag.category-gryphline {
	background: #9900cc;
}

.category-tag.category-default {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.time-tag {
	color: #666;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 0.8em;
	font-weight: 500;
	background: #e8e8e8;
	margin-left: auto;
}

.category-tag.category-default {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.post-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.post-caption {
	line-height: 1.6;
	color: #333;
	font-size: 0.95em;
}

.user-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.user-name {
	font-weight: 600;
	color: #000;
	font-size: 0.9em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.post-link {
	display: inline-block;
	color: #000;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9em;
	margin-top: 8px;
}

.post-link:hover {
	text-decoration: underline;
}

/* 加载和错误状态 */
.loading {
	text-align: center;
	padding: 40px;
	color: white;
	font-size: 1.2em;
}

.error {
	background: #ff4444;
	color: white;
	padding: 20px;
	border-radius: 10px;
	margin: 20px 0;
	text-align: center;
}

/* 分页 */
.pagination {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 30px 0;
}

.pagination button {
	min-width: 100px;
}

/* 响应式设计 */
@media (max-width: 768px) {
	.container {
		max-width: 95vw;
	}

	h1 {
		font-size: 1.8em;
	}

	.post-card {
		flex-direction: column;
		max-height: none;
	}

	.post-images {
		width: 100%;
		min-height: 180px;
		max-height: 250px;
	}

	.post-images.multiple .post-image {
		flex: 0 0 100%;
		width: 100%;
		min-height: 180px;
		max-height: 250px;
	}

	.post-caption {
		-webkit-line-clamp: 3;
	}

	.controls {
		flex-direction: column;
	}

	.search-box {
		width: 100%;
	}

	.stat-card {
		min-width: 100px;
	}
}
