:root {
	--tools-red: #b82020;
	--tools-red-dark: #7f1111;
	--tools-ink: #241816;
	--tools-muted: #766765;
	--tools-paper: #fffaf3;
	--tools-line: #ead8c0;
	--tools-gold: #c99b4f;
}

body {
	background: #f7f2ea;
	color: var(--tools-ink);
}

.tools-page {
	min-height: 100vh;
	background:
		linear-gradient(180deg, rgba(184, 32, 32, .08), rgba(247, 242, 234, 0) 260px),
		#f7f2ea;
}

.tools-container {
	width: 1200px;
	max-width: calc(100% - 32px);
	margin: 0 auto;
}

.tools-hero {
	padding: 42px 0 30px;
	border-bottom: 1px solid rgba(127, 17, 17, .08);
}

.hero-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 430px;
	gap: 36px;
	align-items: stretch;
}

.hero-kicker {
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 12px;
	border: 1px solid rgba(184, 32, 32, .16);
	border-radius: 3px;
	background: rgba(255, 250, 243, .72);
	color: var(--tools-red-dark);
	font-size: 13px;
	font-weight: 700;
}

.hero-copy h1,
.image-form-panel h1 {
	margin: 18px 0 12px;
	font-size: 44px;
	line-height: 1.12;
	letter-spacing: 0;
	color: var(--tools-red-dark);
	font-family: "Songti SC", "SimSun", serif;
}

.hero-copy p,
.image-form-panel .lead {
	max-width: 640px;
	margin: 0;
	font-size: 16px;
	line-height: 1.9;
	color: var(--tools-muted);
}

.hero-panel {
	display: grid;
	gap: 10px;
	padding: 14px;
	background: rgba(255, 250, 243, .86);
	border: 1px solid var(--tools-line);
	border-radius: 8px;
	box-shadow: 0 18px 42px rgba(127, 17, 17, .08);
}

.hero-nav-item {
	display: block;
	padding: 15px 16px;
	border-radius: 6px;
	text-decoration: none;
	background: #fff;
	border: 1px solid rgba(234, 216, 192, .82);
	color: var(--tools-ink);
	transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.hero-nav-item:hover {
	transform: translateY(-2px);
	border-color: rgba(184, 32, 32, .28);
	box-shadow: 0 10px 24px rgba(127, 17, 17, .08);
}

.hero-nav-item b,
.hero-nav-item span {
	display: block;
}

.hero-nav-item b {
	margin-bottom: 7px;
	font-size: 16px;
}

.hero-nav-item span {
	color: var(--tools-muted);
	font-size: 13px;
	line-height: 1.55;
}

.tools-layout {
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	gap: 28px;
	padding: 28px 0 52px;
}

.tools-side {
	position: sticky;
	top: 18px;
	align-self: start;
	padding: 14px;
	border: 1px solid var(--tools-line);
	border-radius: 8px;
	background: rgba(255, 250, 243, .92);
}

.side-title {
	margin-bottom: 8px;
	color: var(--tools-red-dark);
	font-weight: 700;
}

.side-link {
	display: block;
	padding: 12px 10px;
	border-radius: 5px;
	color: var(--tools-muted);
	text-decoration: none;
}

.side-link:hover,
.side-link.is-active {
	background: rgba(184, 32, 32, .08);
	color: var(--tools-red-dark);
}

.tool-section {
	margin-bottom: 26px;
	padding: 24px;
	border: 1px solid var(--tools-line);
	border-radius: 8px;
	background: rgba(255, 250, 243, .94);
}

.section-head {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.section-head h2 {
	margin: 0 0 8px;
	font-size: 24px;
	color: var(--tools-ink);
}

.section-head p {
	margin: 0;
	color: var(--tools-muted);
	line-height: 1.7;
}

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

.tool-card {
	position: relative;
	min-height: 152px;
	padding: 18px;
	border: 1px solid rgba(234, 216, 192, .9);
	border-radius: 8px;
	background: #fff;
	color: var(--tools-ink);
	text-decoration: none;
	overflow: hidden;
	transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.tool-card:hover {
	transform: translateY(-2px);
	border-color: rgba(184, 32, 32, .25);
	box-shadow: 0 12px 30px rgba(127, 17, 17, .08);
}

.tool-card.is-coming {
	cursor: default;
	background: #fffdf9;
}

.tool-mark {
	position: absolute;
	right: 14px;
	top: 14px;
	padding: 3px 8px;
	border-radius: 3px;
	background: rgba(201, 155, 79, .13);
	color: #94672b;
	font-size: 12px;
}

.tool-icon {
	display: block;
	width: 40px;
	height: 40px;
	margin-bottom: 14px;
	border-radius: 8px;
	background: var(--tools-red);
	box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .08);
}

.cat-format .tool-icon { background: #8f3a24; }
.cat-image .tool-icon { background: #b8751a; }
.cat-ai .tool-icon { background: var(--tools-red); }

.tool-card strong,
.tool-card em,
.tool-action {
	display: block;
}

.tool-card strong {
	margin-bottom: 8px;
	font-size: 17px;
}

.tool-card em {
	min-height: 42px;
	color: var(--tools-muted);
	font-style: normal;
	line-height: 1.6;
}

.tool-action {
	margin-top: 12px;
	color: var(--tools-red-dark);
	font-weight: 700;
}

.is-coming .tool-action {
	color: #9b9285;
}

.image-workbench {
	display: grid;
	grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
	gap: 24px;
	padding: 36px 0 54px;
}

.image-form-panel,
.image-result-panel {
	border: 1px solid var(--tools-line);
	border-radius: 8px;
	background: rgba(255, 250, 243, .96);
	box-shadow: 0 18px 42px rgba(127, 17, 17, .08);
}

.image-form-panel {
	padding: 28px;
}

.back-link {
	display: inline-block;
	margin-bottom: 18px;
	color: var(--tools-red-dark);
	text-decoration: none;
	font-weight: 700;
}

.config-note {
	margin: 18px 0;
	padding: 12px 14px;
	border-radius: 6px;
	line-height: 1.6;
}

.config-note.is-ok {
	background: rgba(46, 125, 50, .08);
	color: #2f7035;
}

.config-note.is-warn {
	background: rgba(184, 32, 32, .08);
	color: var(--tools-red-dark);
}

.ai-image-form label {
	display: block;
	margin-bottom: 16px;
}

.ai-image-form label span {
	display: block;
	margin-bottom: 8px;
	font-weight: 700;
	color: var(--tools-ink);
}

.ai-image-form input,
.ai-image-form select,
.ai-image-form textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--tools-line);
	border-radius: 6px;
	background: #fff;
	padding: 12px 13px;
	font-size: 14px;
	color: var(--tools-ink);
	outline: none;
}

.ai-image-form textarea {
	resize: vertical;
	line-height: 1.7;
}

.ai-image-form input:focus,
.ai-image-form select:focus,
.ai-image-form textarea:focus {
	border-color: rgba(184, 32, 32, .45);
	box-shadow: 0 0 0 3px rgba(184, 32, 32, .08);
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.form-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.primary-action {
	min-width: 132px;
	height: 42px;
	border: 0;
	border-radius: 5px;
	background: var(--tools-red);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.primary-action:disabled {
	background: #b8aca0;
	cursor: not-allowed;
}

.credit-tip {
	color: var(--tools-muted);
	font-size: 13px;
}

.image-result-panel {
	min-height: 520px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
}

.result-empty {
	text-align: center;
	color: var(--tools-muted);
}

.result-empty i {
	display: block;
	width: 116px;
	height: 150px;
	margin: 0 auto 18px;
	border-radius: 8px;
	background: linear-gradient(160deg, #b82020, #f5d79c);
	box-shadow: inset 0 -24px 0 rgba(0, 0, 0, .08);
}

.result-empty strong {
	display: block;
	margin-bottom: 8px;
	color: var(--tools-ink);
	font-size: 18px;
}

.result-loading {
	text-align: center;
	color: var(--tools-red-dark);
	font-weight: 700;
}

.result-image {
	width: 100%;
}

.result-image img {
	display: block;
	max-width: 100%;
	max-height: 620px;
	margin: 0 auto 16px;
	border-radius: 8px;
	box-shadow: 0 16px 42px rgba(36, 24, 22, .16);
}

.result-image a {
	color: var(--tools-red-dark);
	font-weight: 700;
}

.tools-toast {
	position: fixed;
	left: 50%;
	bottom: 32px;
	z-index: 9999;
	transform: translateX(-50%);
	padding: 11px 16px;
	border-radius: 5px;
	background: rgba(36, 24, 22, .92);
	color: #fff;
	font-size: 14px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

@media (max-width: 980px) {
	.hero-inner,
	.tools-layout,
	.image-workbench {
		grid-template-columns: 1fr;
	}

	.tools-side {
		position: static;
		display: flex;
		gap: 8px;
		overflow-x: auto;
	}

	.side-title {
		display: none;
	}

	.side-link {
		white-space: nowrap;
	}

	.tool-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.tools-container {
		max-width: calc(100% - 20px);
	}

	.tools-hero {
		padding-top: 24px;
	}

	.hero-copy h1,
	.image-form-panel h1 {
		font-size: 34px;
	}

	.tool-section,
	.image-form-panel {
		padding: 18px;
	}

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

	.image-result-panel {
		min-height: 360px;
	}
}
