/* ===== 主体 ===== */
.main {
	padding: 34px 0 0;
}

.content-wrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 24px;
	align-items: start;
}

.article-box {
	background: #fff;
	border-radius: 14px;
	padding: 28px;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
	min-width: 0;
}

.breadcrumb {
	font-size: 13px;
	color: #888;
	margin-bottom: 16px;
}

.breadcrumb a:hover {
	color: #d62828;
}

.article-title {
	font-size: 28px;
	line-height: 1.45;
	color: #222;
	margin-bottom: 14px;
	font-weight: 700;
}

.article-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 14px;
	color: #888;
	padding-bottom: 18px;
	border-bottom: 1px solid #f0f0f0;
	margin-bottom: 24px;
}

.article-cover {
	margin-bottom: 24px;
	border-radius: 12px;
	overflow: hidden;
	background: #eee;
}

.article-cover img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.article-content {
	font-size: 17px;
	color: #555;
}

.article-content p {
	line-height: 1.8;
	margin: 0 0 24px;
	word-break: break-word;
	letter-spacing: 0.04em;
}

.article-content h2 {
	font-size: 26px;
	color: #222;
	margin: 32px 0 14px;
	line-height: 1.4;
}

.article-content h3 {
	color: #222;
	line-height: 1.4;
	font-size: 22px;
	font-weight: 700;
	margin: 36px 0 26px;
	padding: 12px 16px;
	padding-left: 16px;
	background: linear-gradient(90deg, #fff1f0, #ffffff);
	border-left: 5px solid #ff4d4f;
	border-radius: 6px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.article-content h3:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.article-content h4 {
	font-size: 19px;
	color: #333;
	margin: 36px 0 26px 0;
	line-height: 1.4;
}

.article-content ul, .article-content ol {
	margin: 0 0 18px 24px;
}

.article-content li {
	margin-bottom: 10px;
}

.article-content blockquote {
	margin: 22px 0;
	padding: 16px 18px;
	background: #faf7f7;
	border-left: 4px solid #d62828;
	color: #666;
	border-radius: 8px;
}

.article-content img {
	margin: 22px auto;
	border-radius: 10px;
	height: auto !important;
}

.article-content a {
	color: #ff3b3b!important;
}

.article-content a:hover {
	color: #ff0000!important;
}

.article-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 28px;
	padding-top: 22px;
	border-top: 1px solid #f0f0f0;
}

.article-tags a {
	display: inline-block;
	padding: 7px 14px;
	background: #f7f7f7;
	border-radius: 999px;
	font-size: 13px;
	color: #666;
}

.article-tags a:hover {
	background: #d62828;
	color: #fff;
}

.article-page-nav {
	margin-top: 24px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.article-page-nav a {
	display: block;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 10px;
	padding: 15px 16px;
	color: #444;
	min-height: 72px;
}

.article-page-nav a:hover {
	border-color: #d62828;
	color: #d62828;
	background: #fff;
}

.page-nav-label {
	display: block;
	font-size: 12px;
	color: #999;
	margin-bottom: 6px;
}

.related-box, .sidebar-box {
	background: #fff;
	border-radius: 14px;
	padding: 22px;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.related-box {
	margin-top: 24px;
}

.box-title {
	font-size: 20px;
	color: #222;
	margin-bottom: 18px;
	padding-left: 12px;
	border-left: 4px solid #d62828;
	line-height: 1.2;
}

.related-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}

.related-item {
	background: #fafafa;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #f1f1f1;
}

.related-item:hover {
	transform: translateY(-2px);
}

.related-thumb img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.related-content {
	padding: 14px;
}

.related-content h3 {
	font-size: 16px;
	line-height: 1.5;
	color: #222;
	margin-bottom: 8px;
}

.related-meta {
	font-size: 12px;
	color: #999;
}

.sidebar-box + .sidebar-box {
	margin-top: 20px;
}

.sidebar-list {
	list-style: none;
}

.sidebar-list li + li {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #f3f3f3;
}

.sidebar-list a {
	font-size: 15px;
	color: #333;
	line-height: 1.6;
}

.sidebar-list a:hover {
	color: #d62828;
}

.sidebar-list span {
	display: block;
	font-size: 12px;
	color: #999;
	margin-top: 5px;
}

.article-content a:hover {
	color: #d62828;
	font-weight: bold;
}

/* ===== 平板 ===== */
@media (max-width: 980px) {
	.content-wrap {
		grid-template-columns: 1fr;
	}

	.related-list {
		grid-template-columns: 1fr 1fr;
	}
}

/* ===== 手机 ===== */
@media (max-width: 768px) {
	.main {
		padding-top: 18px;
	}

	.article-box, .related-box, .sidebar-box {
		padding: 18px;
		border-radius: 12px;
	}

	.article-title {
		font-size: 26px;
	}

	.article-meta {
		gap: 10px;
		font-size: 13px;
	}

	.article-content {
		font-size: 16px;
	}

	.article-content h2 {
		font-size: 22px;
	}

	.article-content h3 {
		font-size: 19px;
	}

	.article-content h4 {
		font-size: 13px;
	}

	.article-page-nav {
		grid-template-columns: 1fr;
	}

	.related-list {
		grid-template-columns: 1fr;
	}
}

/* 代码块样式 */
.article-content pre {
	display: none;
}

.code-block {
	position: relative;
	max-width: 790px;
	width: 100%;
	background: #1f2430;
	border-radius: 6px;
	overflow: hidden;
	margin: 16px 0;
}

.code-line {
	display: flex;
	align-items: center;
	min-height: 42px;
	color: #fff;
	transition: background 0.15s ease;
	border-bottom: 1px solid rgba(255,255,255,0.05);
}

.code-line:last-child {
	border-bottom: none;
}

.code-line:hover {
	background: #262c3a;
}

.line-number {
	width: 50px;
	min-width: 50px;
	text-align: right;
	padding-right: 10px;
	font-size: 14px;
	color: #34416a;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.line-text {
	flex: 1;
	padding: 0 48px 0 12px;
	font-size: 14px;
	white-space: pre-wrap;
	word-break: break-word;
}

.code-copy-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	right: 10px;
	padding: 6px 10px;
	font-size: 12px;
	border: none;
	border-radius: 4px;
	background: #3a4152;
	color: #fff;
	cursor: pointer;
	opacity: 0;
	transition: all 0.2s ease;
}

.code-block:hover .code-copy-btn {
	opacity: 1;
}

@media (max-width: 600px) {
	.line-number {
		width: 40px;
		min-width: 40px;
		font-size: 12px;
	}

	.line-text {
		font-size: 13px;
		padding: 0 44px 0 8px;
	}

	.code-copy-btn {
		font-size: 11px;
		padding: 3px 8px;
		top: 50%;
		transform: translateY(-50%);
		right: 8px;
	}
}

/* 表格 */
.article-content table{
  width:100%;
  border-collapse:collapse;
  min-width:600px;
margin: 0 0 24px;
}
.article-content tr:first-child{
    background:#f2f3f5;
    font-weight:600;
}
.article-content th,
.article-content td{
  border:1px solid #ddd;
  padding:10px;
  text-align:center;
}

.article-content th{
  background:#f5f5f5;
  font-weight:600;
}

@media (max-width:768px){
  .article-content table{
    font-size:14px;
  }
}