:root {
	--bg-1: #f8f4ec;
	--bg-2: #e5f3ee;
	--ink: #1e2b2f;
	--muted: #5d6a6f;
	--card: #fffdf9;
	--line: #d5ddd5;
	--brand: #0f766e;
	--brand-strong: #115e59;
	--accent: #d97706;
	--danger: #b91c1c;
	--success: #15803d;
	--shadow: 0 12px 28px rgba(18, 38, 36, 0.08);
	--radius-lg: 20px;
	--radius-md: 14px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", "Microsoft YaHei",
		sans-serif;
	color: var(--ink);
	background: linear-gradient(
		165deg,
		var(--bg-1) 0%,
		#f3efe4 45%,
		var(--bg-2) 100%
	);
}

.page-bg {
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(
			circle at 85% 15%,
			rgba(217, 119, 6, 0.2),
			transparent 32%
		),
		radial-gradient(
			circle at 10% 82%,
			rgba(15, 118, 110, 0.2),
			transparent 30%
		);
	z-index: -1;
}

.container {
	width: min(980px, 92vw);
	margin: 36px auto 50px;
}

.hero {
	background: linear-gradient(145deg, #114b5f 0%, #0f766e 56%, #198f7a 100%);
	color: #f4fffb;
	border-radius: var(--radius-lg);
	padding: 34px 30px;
	box-shadow: var(--shadow);
}

.eyebrow {
	margin: 0;
	letter-spacing: 0.12em;
	font-weight: 700;
	font-size: 0.76rem;
	text-transform: uppercase;
	opacity: 0.85;
}

.hero h1 {
	margin: 10px 0 10px;
	font-size: clamp(1.6rem, 2.3vw, 2.3rem);
	line-height: 1.28;
}

.subtitle {
	margin: 0;
	color: rgba(244, 255, 251, 0.9);
	font-size: 1rem;
	line-height: 1.75;
}

.card {
	margin-top: 18px;
	background: rgba(255, 253, 249, 0.92);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	padding: 22px;
	box-shadow: var(--shadow);
	backdrop-filter: blur(2px);
}

.card h2 {
	margin: 0 0 16px;
	font-size: 1.1rem;
}

.card-title-row {
	display: flex;
	gap: 12px;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 14px;
}

.upload-box {
	border: 2px dashed #8ab7b0;
	border-radius: var(--radius-md);
	background: linear-gradient(160deg, #f9f9f4, #edf6f2);
	padding: 24px;
	text-align: center;
	cursor: pointer;
	transition: transform 0.25s ease, border-color 0.25s ease,
		background 0.25s ease;
}

.upload-box:hover,
.upload-box.drag-over {
	transform: translateY(-2px);
	border-color: var(--brand);
	background: linear-gradient(160deg, #f7f8f3, #e2f2ec);
}

.upload-main {
	margin: 0;
	font-weight: 600;
}

.upload-tip {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 0.92rem;
}

.file-list {
	margin-top: 14px;
	display: grid;
	gap: 10px;
}

.encoding-row {
	margin-top: 14px;
	max-width: 320px;
}

.file-item {
	background: #f7f7f3;
	border: 1px solid #d8ddd7;
	border-radius: 12px;
	padding: 10px 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

.file-meta strong {
	display: block;
	font-size: 0.95rem;
}

.file-meta small {
	color: var(--muted);
	font-size: 0.82rem;
}

.file-remove {
	border: 0;
	background: transparent;
	color: var(--danger);
	font-size: 1.25rem;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	cursor: pointer;
}

.file-remove:hover {
	background: rgba(185, 28, 28, 0.12);
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.field span {
	font-size: 0.9rem;
	color: var(--muted);
}

.field input,
.field select,
.field textarea {
	border: 1px solid #ccd6cf;
	border-radius: 10px;
	background: #fff;
	padding: 11px 12px;
	font: inherit;
	color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
	outline: 2px solid rgba(15, 118, 110, 0.25);
	border-color: var(--brand);
}

.full-width {
	grid-column: 1 / -1;
}

.cover-upload {
	border: 2px dashed #8ab7b0;
	border-radius: var(--radius-md);
	background: linear-gradient(160deg, #f9f9f4, #edf6f2);
	min-height: 80px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: border-color 0.25s ease;
	position: relative;
}

.cover-upload:hover {
	border-color: var(--brand);
}

.cover-empty {
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 20px;
}

.cover-empty span {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--muted);
}

.cover-empty small {
	font-size: 0.82rem;
	color: var(--muted);
}

.cover-preview-wrap {
	position: relative;
	width: 100%;
	display: flex;
	justify-content: center;
	padding: 12px;
}

.cover-preview {
	max-height: 220px;
	max-width: 100%;
	border-radius: 8px;
	object-fit: contain;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.cover-clear {
	position: absolute;
	top: 6px;
	right: 6px;
	border: 0;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 1.1rem;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.cover-clear:hover {
	background: rgba(185, 28, 28, 0.8);
}

.inline-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.pattern-wrap {
	margin-top: 14px;
	border-left: 3px solid #89bdb4;
	padding-left: 12px;
}

.pattern-tip {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 0.86rem;
}

.chapter-info {
	margin-top: 14px;
	background: #f4f6f1;
	border: 1px solid #d8ddd7;
	border-radius: 10px;
	padding: 11px 12px;
	color: var(--muted);
}

.preview-box {
	max-height: 340px;
	overflow: auto;
	border: 1px solid #d8ddd7;
	border-radius: var(--radius-md);
	background: #f6f6f2;
	padding: 14px;
}

.preview-box pre {
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.72;
	font-family: "Source Han Serif SC", "Songti SC", "Noto Serif SC", serif;
}

.preview-box .decode-note {
	margin: 0 0 10px;
	color: var(--muted);
	font-size: 0.86rem;
}

.placeholder {
	margin: 0;
	color: var(--muted);
}

.action-card {
	text-align: center;
}

.action-tip {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.btn {
	border-radius: 11px;
	border: 0;
	padding: 10px 16px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.btn-ghost {
	border: 1px solid #b7c7bf;
	background: #fff;
	color: var(--ink);
}

.btn-ghost:hover {
	background: #f3f5f2;
}

.btn-primary {
	width: min(100%, 360px);
	padding: 13px 18px;
	background: linear-gradient(135deg, #0f766e, #0f5f77);
	color: #f7fffd;
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.btn-primary:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(15, 118, 110, 0.26);
}

.btn-primary:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.modal {
	position: fixed;
	inset: 0;
	background: rgba(17, 38, 47, 0.45);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 20;
}

.modal.show {
	display: flex;
}

.modal-content {
	width: min(420px, 90vw);
	border-radius: 16px;
	background: #fff;
	padding: 22px;
	border: 1px solid #d2dad4;
}

.modal-content h3 {
	margin: 0 0 12px;
}

.progress-bar {
	height: 10px;
	background: #e0e8e3;
	border-radius: 999px;
	overflow: hidden;
}

.progress-fill {
	height: 100%;
	width: 0;
	background: linear-gradient(90deg, #0f766e, #d97706);
	transition: width 0.25s ease;
}

#progressText {
	margin: 10px 0 0;
	color: var(--muted);
}

.notification {
	position: fixed;
	right: 18px;
	top: 18px;
	max-width: 320px;
	border-radius: 11px;
	border: 1px solid #d5ddd5;
	background: #fff;
	padding: 10px 12px;
	box-shadow: var(--shadow);
	transform: translateX(380px);
	transition: transform 0.28s ease;
	z-index: 30;
}

.notification.show {
	transform: translateX(0);
}

.notification.success {
	border-left: 4px solid var(--success);
}

.notification.error {
	border-left: 4px solid var(--danger);
}

.notification.info {
	border-left: 4px solid var(--accent);
}

.fade-up {
	opacity: 0;
	transform: translateY(8px);
	animation: fadeUp 0.55s ease forwards;
}

@keyframes fadeUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 760px) {
	.container {
		width: 94vw;
		margin-top: 16px;
	}

	.hero,
	.card {
		border-radius: 16px;
	}

	.form-grid {
		grid-template-columns: 1fr;
	}

	.card-title-row {
		align-items: flex-start;
		flex-direction: column;
	}
}
