/**
 * 投稿中心前台样式。
 *
 * ⚠️ 主题 CSS 在插件 CSS 之后加载（本项目高频坑），所以这里的选择器一律
 *    带 .esb 前缀做两级（0,2,0）以上特异性，避免被主题的单类规则盖掉。
 */

.esb {
	--esb-primary: #e23b3b;
	--esb-primary-d: #c62f2f;
	--esb-line: #e5e7eb;
	--esb-text: #1f2937;
	--esb-muted: #6b7280;
	max-width: 100%;
	color: var(--esb-text);
	font-size: 14px;
	line-height: 1.7;
}

.esb a {
	color: var(--esb-primary);
	text-decoration: none;
}

.esb a:hover {
	text-decoration: underline;
}

/* ---------- 须知 ---------- */
.esb .esb-guide {
	background: #fff;
	border: 1px solid var(--esb-line);
	border-radius: 12px;
	padding: 16px 20px;
	margin: 0 0 18px;
	font-size: 13px;
	line-height: 1.85;
}

.esb .esb-guide__h {
	font-size: 14px;
	font-weight: 600;
	margin: 16px 0 6px;
	padding: 0;
}

.esb .esb-guide__h:first-child {
	margin-top: 0;
}

.esb .esb-guide__p {
	margin: 0 0 8px;
}

.esb .esb-guide__ul {
	margin: 0 0 10px;
	padding-left: 22px;
	list-style: disc;
}

.esb .esb-guide__ul li {
	margin: 2px 0;
}

/* ---------- Tab ---------- */
.esb .esb-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 16px;
	border-bottom: 1px solid var(--esb-line);
}

.esb .esb-tab {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	margin: 0;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 500;
	color: var(--esb-muted);
	cursor: pointer;
	border-radius: 0;
}

.esb .esb-tab.is-active {
	color: var(--esb-primary);
	border-bottom-color: var(--esb-primary);
}

/* ---------- 表单 ---------- */
.esb .esb-form {
	display: none;
	background: #fff;
	border: 1px solid var(--esb-line);
	border-radius: 12px;
	padding: 18px 20px 20px;
	margin: 0 0 22px;
}

.esb .esb-form.is-active {
	display: block;
}

.esb .esb-field {
	margin: 0 0 14px;
}

.esb .esb-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.esb .esb-field__label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
}

.esb .esb-req {
	color: var(--esb-primary);
	margin-left: 2px;
}

.esb .esb-input {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid var(--esb-line);
	border-radius: 8px;
	background: #fff;
	color: var(--esb-text);
	font-size: 14px;
	line-height: 1.6;
}

.esb .esb-input:focus {
	border-color: var(--esb-primary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(226, 59, 59, .12);
}

.esb .esb-textarea {
	resize: vertical;
	min-height: 84px;
}

.esb .esb-textarea--tall {
	min-height: 240px;
}

.esb .esb-select {
	height: auto;
	padding: 8px 10px;
}

.esb .esb-hint {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--esb-muted);
}

/* ---------- 上传 ---------- */
.esb .esb-upload {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-start;
}

.esb .esb-upload__input {
	flex: 0 0 auto;
	max-width: 260px;
	font-size: 12px;
}

.esb .esb-upload__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.esb .esb-upload__list:empty {
	display: none;
}

.esb .esb-upload__item {
	position: relative;
	width: 76px;
}

.esb .esb-upload__item img {
	display: block;
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--esb-line);
}

.esb .esb-upload__del {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	line-height: 18px;
	text-align: center;
	border-radius: 50%;
	border: 1px solid var(--esb-line);
	background: #fff;
	color: #b32d2e;
	cursor: pointer;
	font-size: 13px;
	padding: 0;
}

/* ---------- 书目选择 ---------- */
.esb .esb-bookpick {
	margin: 6px 0 0;
	padding: 4px 0;
	list-style: none;
	border: 1px solid var(--esb-line);
	border-radius: 8px;
	background: #fff;
	max-height: 220px;
	overflow: auto;
}

.esb .esb-bookpick li {
	padding: 7px 12px;
	cursor: pointer;
	font-size: 13px;
}

.esb .esb-bookpick li:hover {
	background: #f3f4f6;
}

/* ---------- 查重提示 ---------- */
.esb .esb-dup {
	background: #fff7ed;
	border: 1px solid #fdba74;
	border-radius: 10px;
	padding: 12px 14px;
	margin: 0 0 14px;
	font-size: 13px;
}

.esb .esb-dup__title {
	margin: 0 0 6px;
	font-weight: 600;
	color: #9a3412;
}

.esb .esb-dup__list {
	margin: 0 0 8px;
	padding-left: 20px;
	list-style: disc;
}

.esb .esb-dup__acts {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */
.esb .esb-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-block;
	padding: 8px 18px;
	border: 1px solid transparent;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
	cursor: pointer;
	text-decoration: none;
	background: #f3f4f6;
	color: var(--esb-text);
}

.esb .esb-btn:hover {
	text-decoration: none;
}

.esb .esb-btn--primary {
	background: var(--esb-primary);
	border-color: var(--esb-primary);
	color: #fff;
}

.esb .esb-btn--primary:hover {
	background: var(--esb-primary-d);
	border-color: var(--esb-primary-d);
	color: #fff;
}

.esb .esb-btn--ghost {
	background: #fff;
	border-color: var(--esb-line);
	color: #374151;
}

.esb .esb-btn--mini {
	padding: 3px 10px;
	font-size: 12px;
	border-color: var(--esb-line);
	background: #fff;
}

.esb .esb-btn[disabled] {
	opacity: .55;
	cursor: not-allowed;
}

.esb .esb-acts {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 4px;
}

.esb .esb-acts__tip {
	font-size: 12px;
	color: var(--esb-muted);
}

/* ---------- 消息 ---------- */
.esb .esb-msg {
	border-radius: 8px;
	padding: 10px 14px;
	margin: 0 0 12px;
	font-size: 13px;
}

.esb .esb-msg.is-ok {
	background: #ecfdf5;
	border: 1px solid #6ee7b7;
	color: #065f46;
}

.esb .esb-msg.is-err {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #991b1b;
}

.esb .esb-off,
.esb .esb-login {
	background: #fff;
	border: 1px solid var(--esb-line);
	border-radius: 12px;
	padding: 20px;
	text-align: center;
}

/* ---------- 我的投稿 ---------- */
.esb .esb-my {
	background: #fff;
	border: 1px solid var(--esb-line);
	border-radius: 12px;
	padding: 16px 20px 18px;
}

.esb .esb-my__title {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 600;
}

.esb .esb-my__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.esb .esb-my__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px dashed var(--esb-line);
	font-size: 13px;
}

.esb .esb-my__item:last-child {
	border-bottom: 0;
}

.esb .esb-my__name {
	font-weight: 500;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.esb .esb-my__date,
.esb .esb-my__reward {
	color: var(--esb-muted);
	font-size: 12px;
}

.esb .esb-my__reward {
	color: #b91c1c;
	font-weight: 600;
}

.esb .esb-my__tip {
	flex: 1 0 100%;
	margin: 4px 0 0;
	font-size: 12px;
	color: #9a3412;
}

.esb .esb-my__empty {
	margin: 0;
	color: var(--esb-muted);
	font-size: 13px;
}

.esb .esb-badge {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: 12px;
	line-height: 18px;
	white-space: nowrap;
}

.esb .esb-badge--type {
	background: #eef2ff;
	color: #4338ca;
}

.esb .esb-badge--pending {
	background: #fff7ed;
	color: #c2410c;
}

.esb .esb-badge--approved {
	background: #ecfdf5;
	color: #047857;
}

.esb .esb-badge--need_info {
	background: #eff6ff;
	color: #1d4ed8;
}

.esb .esb-badge--rejected {
	background: #fef2f2;
	color: #b91c1c;
}

.esb .esb-badge--withdrawn {
	background: #f3f4f6;
	color: #6b7280;
}

/* ---------- 分页 ---------- */
.esb .esb-pager {
	margin-top: 14px;
}

.esb .esb-pager .page-numbers {
	display: inline-block;
	padding: 4px 10px;
	border: 1px solid var(--esb-line);
	border-radius: 6px;
	margin-right: 6px;
	font-size: 13px;
	background: #fff;
}

.esb .esb-pager .page-numbers.current {
	background: var(--esb-primary);
	border-color: var(--esb-primary);
	color: #fff;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 782px) {
	.esb .esb-row {
		grid-template-columns: 1fr;
	}

	.esb .esb-my__name {
		white-space: normal;
	}
}

/* ---------- 投稿须知提示条 ---------- */
.esb .esb-guide-note {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	background: #fff7ed;
	border: 1px solid #fdba74;
	border-radius: 12px;
	padding: 12px 16px;
	margin: 0 0 18px;
}

.esb .esb-guide-note__text {
	margin: 0;
	font-size: 13px;
	color: #9a3412;
	flex: 1 1 200px;
	line-height: 1.7;
}

/* ---------- 投稿须知弹窗 ---------- */
.esb .esb-guide-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.esb .esb-guide-modal[hidden] {
	display: none;
}

.esb .esb-guide-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .55);
}

.esb .esb-guide-modal__dialog {
	position: relative;
	width: min(680px, 92vw);
	max-height: 86vh;
	background: #fff;
	border-radius: 14px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.esb .esb-guide-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	border-bottom: 1px solid var(--esb-line);
}

.esb .esb-guide-modal__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}

.esb .esb-guide-modal__x {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	color: #9ca3af;
	cursor: pointer;
	padding: 0 4px;
}

.esb .esb-guide-modal__x.is-locked {
	color: #cbd5e1;
	cursor: not-allowed;
}

.esb .esb-guide-modal__body {
	padding: 16px 20px;
	overflow-y: auto;
	font-size: 13px;
	line-height: 1.85;
}

.esb .esb-guide-modal__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-top: 1px solid var(--esb-line);
}

.esb .esb-guide-modal__hint {
	margin: 0;
	font-size: 12px;
	color: var(--esb-muted);
	flex: 1 1 auto;
	min-width: 0;
}

/* 关闭按钮：锁定态灰色不可点 → 解锁态从灰变亮 + 脉冲动画 */
.esb .js-esb-guide-close {
	transition: background-color .4s ease, transform .25s ease, box-shadow .4s ease, color .4s ease;
	flex: 0 0 auto;
}

.esb .js-esb-guide-close.is-locked {
	background: #cbd5e1;
	border-color: #cbd5e1;
	color: #fff;
	cursor: not-allowed;
}

.esb .js-esb-guide-close.is-ready {
	background: var(--esb-primary);
	border-color: var(--esb-primary);
	color: #fff;
	animation: esbLightup .6s ease;
}

@keyframes esbLightup {
	0% {
		transform: scale(1);
		background: #cbd5e1;
		box-shadow: 0 0 0 0 rgba(226, 59, 59, .5);
	}
	40% {
		transform: scale(1.06);
		box-shadow: 0 0 0 8px rgba(226, 59, 59, 0);
	}
	100% {
		transform: scale(1);
		background: var(--esb-primary);
		box-shadow: 0 0 0 0 rgba(226, 59, 59, 0);
	}
}

body.esb-guide-lock {
	overflow: hidden;
}

/* ---------- 投稿中心小工具 ---------- */
.esb .esb-widget {
	background: #fff;
	border: 1px solid var(--esb-line);
	border-radius: 12px;
	padding: 16px;
	text-align: center;
}

.esb .esb-widget__desc {
	margin: 0 0 12px;
	font-size: 13px;
	color: var(--esb-muted);
	line-height: 1.7;
}

.esb .esb-widget__cta {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 782px) {
	.esb .esb-guide-modal__foot {
		flex-direction: column;
		align-items: stretch;
	}

	.esb .esb-guide-modal__hint {
		text-align: center;
	}
}
