/**
 * AK Campus —— 编程题投稿 / 审核
 * 前台 /lab-submit/ 表单、投稿专区的编程题列表、后台审核卡片
 */

/* ================================================================
 * 一、前台投稿表单
 * ================================================================ */

.cq-page .akz-hero {
	margin-bottom: 18px;
}

.cq-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cq-sec {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 20px 22px 22px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.cq-h2 {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
}

.cq-h2 i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	font-size: 12px;
	font-style: normal;
	font-weight: 700;
	flex: 0 0 auto;
}

.cq-f {
	display: block;
	margin-bottom: 16px;
}

.cq-f:last-child {
	margin-bottom: 0;
}

.cq-lb {
	display: block;
	margin-bottom: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: #334155;
}

.cq-lb em {
	font-style: normal;
	font-size: 11px;
	font-weight: 500;
	color: #94a3b8;
	margin-left: 4px;
}

.cq-f input[type="text"],
.cq-f select,
.cq-f textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 14px;
	line-height: 1.6;
	color: #0f172a;
	background: #fff;
	font-family: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cq-f textarea {
	resize: vertical;
	min-height: 60px;
}

.cq-f input:focus,
.cq-f select:focus,
.cq-f textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.cq-f small {
	display: block;
	margin-top: 5px;
	font-size: 12px;
	color: #94a3b8;
	line-height: 1.55;
}

.cq-tip {
	color: #b45309;
}

/* 代码框：等宽字体 + 深色底，和实验室观感一致 */
.cq-f textarea.cq-code {
	font-family: Consolas, "Courier New", monospace;
	font-size: 13px;
	line-height: 1.7;
	background: #0f172a;
	color: #e2e8f0;
	border-color: #1e293b;
	tab-size: 4;
}

.cq-f textarea.cq-code::placeholder {
	color: #64748b;
}

.cq-f textarea.cq-code:focus {
	border-color: #38bdf8;
	box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.cq-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.cq-submit {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	padding: 4px 2px 0;
}

.cq-btn-go {
	padding: 11px 26px;
	font-size: 14.5px;
	border-radius: 9px;
}

.cq-submit-tip {
	font-size: 12.5px;
	color: #94a3b8;
	flex: 1 1 260px;
	line-height: 1.6;
}

/* 提交结果条 */
.cq-flash {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 13.5px;
	line-height: 1.6;
	border: 1px solid transparent;
}

.cq-flash.is-ok {
	background: #ecfdf5;
	border-color: #a7f3d0;
	color: #047857;
}

.cq-flash.is-bad {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
}

/* 我的投稿 */
.cq-mine-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cq-mine-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 10px 13px;
	background: #f8fafc;
	border: 1px solid #eef2f7;
	border-radius: 8px;
	font-size: 13px;
}

.cq-mine-st {
	flex: 0 0 auto;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
}

.cq-mine-st.is-ok {
	background: #d1fae5;
	color: #047857;
}

.cq-mine-st.is-wait {
	background: #fef3c7;
	color: #b45309;
}

.cq-mine-st.is-no {
	background: #fee2e2;
	color: #b91c1c;
}

.cq-mine-t {
	font-weight: 600;
	color: #0f172a;
	flex: 1 1 160px;
}

.cq-mine-time {
	color: #94a3b8;
	font-size: 12px;
}

.cq-mine-go {
	color: #2563eb;
	font-weight: 600;
	text-decoration: none;
	font-size: 12.5px;
}

.cq-mine-go:hover {
	text-decoration: underline;
}

.cq-mine-note {
	flex-basis: 100%;
	color: #b91c1c;
	font-size: 12px;
	background: #fff5f5;
	border-radius: 6px;
	padding: 6px 9px;
}

/* ================================================================
 * 二、投稿专区里的编程题列表
 * ================================================================ */

.cq-zone-tip {
	margin: -4px 0 14px;
	font-size: 13px;
	color: #64748b;
	line-height: 1.7;
}

.cq-zone-blank {
	margin: 0;
	padding: 18px;
	background: #f8fafc;
	border: 1px dashed #d1d5db;
	border-radius: 10px;
	font-size: 13px;
	color: #64748b;
	text-align: center;
}

.cq-zone-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 12px;
}

.cq-qitem {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-left: 3px solid #2563eb;
	border-radius: 10px;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cq-qitem:hover {
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
	transform: translateY(-1px);
}

.cq-qitem-hd {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.cq-qstar {
	font-size: 11px;
	color: #f59e0b;
	letter-spacing: -1px;
	flex: 0 0 auto;
}

.cq-qtitle {
	font-size: 14.5px;
	color: #0f172a;
	flex: 1 1 140px;
	line-height: 1.4;
}

.cq-qitem .akz-qauthor {
	font-size: 11.5px;
	color: #2563eb;
	background: #f0fdfa;
	border-radius: 999px;
	padding: 2px 8px;
	white-space: nowrap;
}

.cq-qbrief {
	margin: 0;
	font-size: 13px;
	color: #64748b;
	line-height: 1.65;
}

.cq-qitem-ft {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 4px;
}

.cq-qrun {
	font-size: 11.5px;
	color: #94a3b8;
}

/* ================================================================
 * 三、后台审核
 * ================================================================ */

.cq-admin-sub {
	font-size: 13px;
	color: #64748b;
	max-width: 760px;
	line-height: 1.7;
}

.cq-admin-stat {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 14px 0 22px;
}

.cq-admin-stat > span {
	padding: 6px 13px;
	border-radius: 999px;
	font-size: 13px;
	background: #f1f5f9;
	color: #475569;
}

.cq-admin-stat .is-wait {
	background: #fef3c7;
	color: #b45309;
}

.cq-admin-stat .is-ok {
	background: #d1fae5;
	color: #047857;
}

.cq-admin-stat .is-no {
	background: #fee2e2;
	color: #b91c1c;
}

.cq-admin-empty {
	padding: 14px 16px;
	background: #f8fafc;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	color: #64748b;
	font-size: 13px;
}

.cq-adm-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-left: 4px solid #f59e0b;
	border-radius: 10px;
	padding: 14px 18px 16px;
	margin-bottom: 14px;
	max-width: 1000px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cq-adm-card.is-ok {
	border-left-color: #10b981;
}

.cq-adm-card.is-no {
	border-left-color: #ef4444;
	opacity: 0.86;
}

.cq-adm-hd {
	display: flex;
	align-items: center;
	gap: 9px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.cq-adm-st {
	flex: 0 0 auto;
	font-size: 11.5px;
	font-weight: 700;
	padding: 2px 9px;
	border-radius: 999px;
	background: #fef3c7;
	color: #b45309;
}

.cq-adm-st.is-ok {
	background: #d1fae5;
	color: #047857;
}

.cq-adm-st.is-no {
	background: #fee2e2;
	color: #b91c1c;
}

.cq-adm-t {
	font-size: 15px;
	color: #0f172a;
}

.cq-adm-meta {
	font-size: 12px;
	color: #94a3b8;
}

.cq-adm-brief {
	margin: 0 0 10px;
	font-size: 13.5px;
	color: #334155;
	line-height: 1.75;
	white-space: pre-wrap;
}

.cq-adm-pre {
	margin: 0;
	padding: 10px 12px;
	background: #0f172a;
	color: #e2e8f0;
	border-radius: 8px;
	font-family: Consolas, "Courier New", monospace;
	font-size: 12.5px;
	line-height: 1.65;
	overflow: auto;
	max-height: 260px;
	white-space: pre;
}

.cq-adm-need {
	background: #f8fafc;
	color: #334155;
	border: 1px solid #eef2f7;
	margin-bottom: 10px;
	max-height: 150px;
}

.cq-adm-codes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 8px;
}

.cq-adm-codes > div {
	min-width: 0;
}

.cq-adm-lb {
	display: block;
	margin-bottom: 5px;
	font-size: 11.5px;
	font-weight: 700;
	color: #64748b;
	letter-spacing: 0.5px;
}

.cq-adm-extra {
	margin: 8px 0 0;
	font-size: 12.5px;
	color: #475569;
	line-height: 1.8;
}

.cq-adm-extra code {
	background: #f1f5f9;
	padding: 1px 6px;
	border-radius: 4px;
	font-size: 12px;
	color: #2563eb;
}

.cq-adm-note {
	margin: 8px 0 0;
	padding: 8px 11px;
	background: #fff5f5;
	border-radius: 6px;
	font-size: 12.5px;
	color: #b91c1c;
}

.cq-adm-act {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed #e5e7eb;
}

.cq-adm-input {
	flex: 1 1 260px;
	max-width: 380px;
	height: 32px;
	font-size: 13px;
}

.cq-adm-act .button.cq-adm-del {
	color: #b91c1c;
	border-color: #fecaca;
}

/* ================================================================
 * 四、手机
 * ================================================================ */

@media (max-width: 760px) {
	.cq-sec {
		padding: 16px 15px 18px;
	}

	.cq-row {
		grid-template-columns: 1fr;
		gap: 0;
	}

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

	.cq-adm-codes {
		grid-template-columns: 1fr;
	}

	.cq-submit {
		align-items: stretch;
		flex-direction: column;
	}

	.cq-btn-go {
		width: 100%;
	}

	.cq-f textarea.cq-code {
		font-size: 12px;
	}
}

/* ================================================================
 * 六、图片上传（题目配图 / 参考流程图）
 * ================================================================ */

.cq-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 22px 16px;
	border: 1.5px dashed #cbd5e1;
	border-radius: 10px;
	background: #f8fafc;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.cq-drop:hover,
.cq-drop.is-over {
	border-color: #2563eb;
	background: #ecfdf5;
}

.cq-drop input[type="file"] {
	display: none;
}

.cq-drop-ico {
	font-size: 24px;
	line-height: 1;
}

.cq-drop-tx {
	font-size: 13.5px;
	color: #334155;
}

.cq-drop-tx b {
	color: #2563eb;
}

.cq-drop-sub {
	font-size: 11.5px;
	color: #94a3b8;
	line-height: 1.5;
}

.cq-drop-slim {
	padding: 16px;
}

.cq-up-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 10px;
}

.cq-up-item {
	width: 128px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.cq-up-item img {
	display: block;
	width: 100%;
	height: 80px;
	object-fit: cover;
	background: #f1f5f9;
}

.cq-up-item span {
	display: block;
	padding: 4px 6px;
	font-size: 10.5px;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cq-up-err {
	margin: 8px 0 0;
	font-size: 12.5px;
	line-height: 1.6;
	color: #b91c1c;
}

.cq-up-loading {
	font-size: 12.5px;
	color: #64748b;
}

/* ================================================================
 * 七、题面页（/problem/?cq=ID）—— 洛谷式排版
 * ================================================================ */

.cqp-page {
	max-width: 940px;
	margin: 0 auto;
	padding-bottom: 40px;
}

.cqp-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.cqp-back {
	font-size: 13px;
	font-weight: 600;
	color: #2563eb;
	text-decoration: none;
}

.cqp-back:hover {
	text-decoration: underline;
}

.cqp-bar-act {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.cqp-state {
	font-size: 12px;
	color: #b45309;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 999px;
	padding: 3px 10px;
}

.cqp-hd {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 20px 22px;
	margin-bottom: 14px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.cqp-no {
	font-family: Consolas, "Courier New", monospace;
	font-size: 12px;
	color: #94a3b8;
}

.cqp-title {
	display: inline-block;
	margin: 6px 8px 0 0;
	font-size: 23px;
	line-height: 1.4;
	font-weight: 700;
	color: #0f172a;
}

.cqp-diff {
	display: inline-block;
	vertical-align: middle;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: #eef2ff;
	color: #4338ca;
}

.cqp-diff.is-1 {
	background: #dcfce7;
	color: #15803d;
}

.cqp-diff.is-2 {
	background: #fef3c7;
	color: #b45309;
}

.cqp-diff.is-3 {
	background: #fee2e2;
	color: #b91c1c;
}

.cqp-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-top: 10px;
	font-size: 12.5px;
	color: #64748b;
}

.cqp-sec {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 18px 22px;
	margin-bottom: 14px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.cqp-h2 {
	margin: 0 0 12px;
	padding-left: 10px;
	border-left: 3px solid #2563eb;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: #0f172a;
}

.cqp-h2-flex {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.cqp-zoom {
	font-size: 12.5px;
	font-weight: 600;
	color: #2563eb;
	text-decoration: none;
}

.cqp-text p {
	margin: 0 0 10px;
	font-size: 14.5px;
	line-height: 1.85;
	color: #334155;
}

.cqp-text p:last-child {
	margin-bottom: 0;
}

.cqp-imgs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: 14px;
}

.cqp-imgs.is-1 {
	grid-template-columns: 1fr;
}

.cqp-img {
	display: block;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #f8fafc;
}

.cqp-img img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 300px;
	object-fit: cover;
}

.cqp-two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.cqp-need {
	margin: 0;
	padding-left: 22px;
	font-size: 14px;
	line-height: 1.9;
	color: #334155;
}

.cqp-eg {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.cqp-eg-box {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #f8fafc;
}

.cqp-eg-hd {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 7px 12px;
	background: #f1f5f9;
	border-bottom: 1px solid #e5e7eb;
	font-size: 12.5px;
	color: #475569;
}

.cqp-eg-box pre {
	margin: 0;
	padding: 12px;
	min-height: 64px;
	font-family: Consolas, "Courier New", monospace;
	font-size: 13px;
	line-height: 1.7;
	color: #0f172a;
	white-space: pre-wrap;
	overflow-x: auto;
}

.cqp-copy {
	border: 0;
	background: none;
	padding: 0;
	font-size: 12px;
	font-weight: 600;
	color: #2563eb;
	cursor: pointer;
}

.cqp-flow {
	display: block;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #f8fafc;
}

.cqp-flow img {
	display: block;
	width: 100%;
	height: auto;
}

.cqp-hint {
	background: #fffbeb;
	border-radius: 8px;
	padding: 12px 14px;
}

.cqp-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 18px;
}

/* 后台审核卡片里的图片 / 输入输出 */
.cq-adm-imgs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0;
}

.cq-adm-imgs a {
	position: relative;
	display: block;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.cq-adm-imgs img {
	display: block;
	width: 120px;
	height: 76px;
	object-fit: cover;
}

.cq-adm-imgs a.is-flow img {
	width: 152px;
	height: 96px;
	object-fit: contain;
	background: #f8fafc;
}

.cq-adm-imgs i {
	position: absolute;
	left: 4px;
	bottom: 4px;
	padding: 1px 6px;
	border-radius: 4px;
	background: rgba(15, 23, 42, 0.72);
	color: #fff;
	font-size: 10px;
	font-style: normal;
}

.cq-adm-fmt {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 10px 0;
}

@media (max-width: 720px) {
	.cqp-two,
	.cqp-eg,
	.cqp-imgs,
	.cq-adm-fmt {
		grid-template-columns: 1fr;
	}

	.cqp-title {
		font-size: 19px;
	}

	.cqp-sec,
	.cqp-hd {
		padding: 14px 15px;
	}

	.cqp-bar {
		align-items: flex-start;
	}

	.cqp-bar-act .akz-btn {
		width: 100%;
		text-align: center;
	}

	.cqp-img img {
		max-height: none;
	}
}

/* 编程题卡片底部：一行说明 + 两个按钮，窄卡片时说明独占一行 */
.cq-qitem-ft {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.cq-qitem-ft .cq-qrun {
	flex: 1 1 100%;
	margin-right: auto;
	line-height: 1.5;
}

.cq-qitem-ft .akz-btn {
	flex: 0 0 auto;
	white-space: nowrap;
}
